module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _cli__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "run", function() { return _cli__WEBPACK_IMPORTED_MODULE_0__["run"]; }); /* harmony import */ var _production__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(371); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return _production__WEBPACK_IMPORTED_MODULE_1__["buildProductionProjects"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return _production__WEBPACK_IMPORTED_MODULE_1__["prepareExternalProjectDependencies"]; }); /* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(35); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getProjects", function() { return _utils_projects__WEBPACK_IMPORTED_MODULE_2__["getProjects"]; }); /* harmony import */ var _utils_project__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Project", function() { return _utils_project__WEBPACK_IMPORTED_MODULE_3__["Project"]; }); /* harmony import */ var _utils_workspaces__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(134); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "copyWorkspacePackages", function() { return _utils_workspaces__WEBPACK_IMPORTED_MODULE_4__["copyWorkspacePackages"]; }); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(135); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getProjectPaths", function() { return _config__WEBPACK_IMPORTED_MODULE_5__["getProjectPaths"]; }); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /***/ }), /* 1 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "run", function() { return run; }); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var dedent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); /* harmony import */ var dedent__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dedent__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var getopts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15); /* harmony import */ var getopts__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(getopts__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17); /* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(361); /* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(33); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function help() { const availableCommands = Object.keys(_commands__WEBPACK_IMPORTED_MODULE_4__["commands"]).map(commandName => _commands__WEBPACK_IMPORTED_MODULE_4__["commands"][commandName]).map(command => `${command.name} - ${command.description}`); _utils_log__WEBPACK_IMPORTED_MODULE_6__["log"].write(dedent__WEBPACK_IMPORTED_MODULE_1___default.a` usage: kbn [] By default commands are run for Kibana itself, all packages in the 'packages/' folder and for all plugins in './plugins' and '../kibana-extra'. Available commands: ${availableCommands.join('\n ')} Global options: -e, --exclude Exclude specified project. Can be specified multiple times to exclude multiple projects, e.g. '-e kibana -e @kbn/pm'. -i, --include Include only specified projects. If left unspecified, it defaults to including all projects. --oss Do not include the x-pack when running command. --skip-kibana-plugins Filter all plugins in ./plugins and ../kibana-extra when running command. `); } async function run(argv) { // We can simplify this setup (and remove this extra handling) once Yarn // starts forwarding the `--` directly to this script, see // https://github.com/yarnpkg/yarn/blob/b2d3e1a8fe45ef376b716d597cc79b38702a9320/src/cli/index.js#L174-L182 if (argv.includes('--')) { _utils_log__WEBPACK_IMPORTED_MODULE_6__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`Using "--" is not allowed, as it doesn't work with 'yarn kbn'.`)); process.exit(1); } const options = getopts__WEBPACK_IMPORTED_MODULE_2___default()(argv, { alias: { e: 'exclude', h: 'help', i: 'include' }, boolean: ['prefer-offline', 'frozen-lockfile'] }); const args = options._; if (options.help || args.length === 0) { help(); return; } // This `rootPath` is relative to `./dist/` as that's the location of the // built version of this tool. const rootPath = Object(path__WEBPACK_IMPORTED_MODULE_3__["resolve"])(__dirname, '../../../'); const commandName = args[0]; const extraArgs = args.slice(1); const commandOptions = { options, extraArgs, rootPath }; const command = _commands__WEBPACK_IMPORTED_MODULE_4__["commands"][commandName]; if (command === undefined) { _utils_log__WEBPACK_IMPORTED_MODULE_6__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`[${commandName}] is not a valid command, see 'kbn --help'`)); process.exit(1); } await Object(_run__WEBPACK_IMPORTED_MODULE_5__["runCommand"])(command, commandOptions); } /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const escapeStringRegexp = __webpack_require__(3); const ansiStyles = __webpack_require__(4); const stdoutColor = __webpack_require__(10).stdout; const template = __webpack_require__(13); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); // `supportsColor.level` → `ansiStyles.color[name]` mapping const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; // `color-convert` models to exclude from the Chalk API due to conflicts and such const skipModels = new Set(['gray']); const styles = Object.create(null); function applyOptions(obj, options) { options = options || {}; // Detect level if not set manually const scLevel = stdoutColor ? stdoutColor.level : 0; obj.level = options.level === undefined ? scLevel : options.level; obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; } function Chalk(options) { // We check for this.template here since calling `chalk.constructor()` // by itself will have a `this` of a previously constructed chalk object if (!this || !(this instanceof Chalk) || this.template) { const chalk = {}; applyOptions(chalk, options); chalk.template = function () { const args = [].slice.call(arguments); return chalkTag.apply(null, [chalk.template].concat(args)); }; Object.setPrototypeOf(chalk, Chalk.prototype); Object.setPrototypeOf(chalk.template, chalk); chalk.template.constructor = Chalk; return chalk.template; } applyOptions(this, options); } // Use bright blue on Windows as the normal blue color is illegible if (isSimpleWindowsTerm) { ansiStyles.blue.open = '\u001B[94m'; } for (const key of Object.keys(ansiStyles)) { ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); styles[key] = { get() { const codes = ansiStyles[key]; return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); } }; } styles.visible = { get() { return build.call(this, this._styles || [], true, 'visible'); } }; ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); for (const model of Object.keys(ansiStyles.color.ansi)) { if (skipModels.has(model)) { continue; } styles[model] = { get() { const level = this.level; return function () { const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); const codes = { open, close: ansiStyles.color.close, closeRe: ansiStyles.color.closeRe }; return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); }; } }; } ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); for (const model of Object.keys(ansiStyles.bgColor.ansi)) { if (skipModels.has(model)) { continue; } const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); styles[bgModel] = { get() { const level = this.level; return function () { const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); const codes = { open, close: ansiStyles.bgColor.close, closeRe: ansiStyles.bgColor.closeRe }; return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); }; } }; } const proto = Object.defineProperties(() => {}, styles); function build(_styles, _empty, key) { const builder = function () { return applyStyle.apply(builder, arguments); }; builder._styles = _styles; builder._empty = _empty; const self = this; Object.defineProperty(builder, 'level', { enumerable: true, get() { return self.level; }, set(level) { self.level = level; } }); Object.defineProperty(builder, 'enabled', { enumerable: true, get() { return self.enabled; }, set(enabled) { self.enabled = enabled; } }); // See below for fix regarding invisible grey/dim combination on Windows builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; // `__proto__` is used because we must return a function, but there is // no way to create a function with a different prototype builder.__proto__ = proto; // eslint-disable-line no-proto return builder; } function applyStyle() { // Support varags, but simply cast to string in case there's only one arg const args = arguments; const argsLen = args.length; let str = String(arguments[0]); if (argsLen === 0) { return ''; } if (argsLen > 1) { // Don't slice `arguments`, it prevents V8 optimizations for (let a = 1; a < argsLen; a++) { str += ' ' + args[a]; } } if (!this.enabled || this.level <= 0 || !str) { return this._empty ? '' : str; } // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, // see https://github.com/chalk/chalk/issues/58 // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. const originalDim = ansiStyles.dim.open; if (isSimpleWindowsTerm && this.hasGrey) { ansiStyles.dim.open = ''; } for (const code of this._styles.slice().reverse()) { // Replace any instances already present with a re-opening code // otherwise only the part of the string until said closing code // will be colored, and the rest will simply be 'plain'. str = code.open + str.replace(code.closeRe, code.open) + code.close; // Close the styling before a linebreak and reopen // after next line to fix a bleed issue on macOS // https://github.com/chalk/chalk/pull/92 str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); } // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue ansiStyles.dim.open = originalDim; return str; } function chalkTag(chalk, strings) { if (!Array.isArray(strings)) { // If chalk() was called by itself or with a string, // return the string itself as a string. return [].slice.call(arguments, 1).join(' '); } const args = [].slice.call(arguments, 2); const parts = [strings.raw[0]]; for (let i = 1; i < strings.length; i++) { parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); parts.push(String(strings.raw[i])); } return template(chalk, parts.join('')); } Object.defineProperties(Chalk.prototype, styles); module.exports = Chalk(); // eslint-disable-line new-cap module.exports.supportsColor = stdoutColor; module.exports.default = module.exports; // For TypeScript /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; module.exports = function (str) { if (typeof str !== 'string') { throw new TypeError('Expected a string'); } return str.replace(matchOperatorsRe, '\\$&'); }; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(module) { const colorConvert = __webpack_require__(6); const wrapAnsi16 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); return `\u001B[${code + offset}m`; }; const wrapAnsi256 = (fn, offset) => function () { const code = fn.apply(colorConvert, arguments); return `\u001B[${38 + offset};5;${code}m`; }; const wrapAnsi16m = (fn, offset) => function () { const rgb = fn.apply(colorConvert, arguments); return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; }; function assembleStyles() { const codes = new Map(); const styles = { modifier: { reset: [0, 0], // 21 isn't widely supported and 22 does the same thing bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], gray: [90, 39], // Bright color redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], // Bright color bgBlackBright: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; // Fix humans styles.color.grey = styles.color.gray; for (const groupName of Object.keys(styles)) { const group = styles[groupName]; for (const styleName of Object.keys(group)) { const style = group[styleName]; styles[styleName] = { open: `\u001B[${style[0]}m`, close: `\u001B[${style[1]}m` }; group[styleName] = styles[styleName]; codes.set(style[0], style[1]); } Object.defineProperty(styles, groupName, { value: group, enumerable: false }); Object.defineProperty(styles, 'codes', { value: codes, enumerable: false }); } const ansi2ansi = n => n; const rgb2rgb = (r, g, b) => [r, g, b]; styles.color.close = '\u001B[39m'; styles.bgColor.close = '\u001B[49m'; styles.color.ansi = { ansi: wrapAnsi16(ansi2ansi, 0) }; styles.color.ansi256 = { ansi256: wrapAnsi256(ansi2ansi, 0) }; styles.color.ansi16m = { rgb: wrapAnsi16m(rgb2rgb, 0) }; styles.bgColor.ansi = { ansi: wrapAnsi16(ansi2ansi, 10) }; styles.bgColor.ansi256 = { ansi256: wrapAnsi256(ansi2ansi, 10) }; styles.bgColor.ansi16m = { rgb: wrapAnsi16m(rgb2rgb, 10) }; for (let key of Object.keys(colorConvert)) { if (typeof colorConvert[key] !== 'object') { continue; } const suite = colorConvert[key]; if (key === 'ansi16') { key = 'ansi'; } if ('ansi16' in suite) { styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); } if ('ansi256' in suite) { styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); } if ('rgb' in suite) { styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); } } return styles; } // Make the export immutable Object.defineProperty(module, 'exports', { enumerable: true, get: assembleStyles }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(5)(module))) /***/ }), /* 5 */ /***/ (function(module, exports) { module.exports = function(module) { if (!module.webpackPolyfill) { module.deprecate = function() {}; module.paths = []; // module.parent = undefined by default if (!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function() { return module.i; } }); module.webpackPolyfill = 1; } return module; }; /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { var conversions = __webpack_require__(7); var route = __webpack_require__(9); var convert = {}; var models = Object.keys(conversions); function wrapRaw(fn) { var wrappedFn = function (args) { if (args === undefined || args === null) { return args; } if (arguments.length > 1) { args = Array.prototype.slice.call(arguments); } return fn(args); }; // preserve .conversion property if there is one if ('conversion' in fn) { wrappedFn.conversion = fn.conversion; } return wrappedFn; } function wrapRounded(fn) { var wrappedFn = function (args) { if (args === undefined || args === null) { return args; } if (arguments.length > 1) { args = Array.prototype.slice.call(arguments); } var result = fn(args); // we're assuming the result is an array here. // see notice in conversions.js; don't use box types // in conversion functions. if (typeof result === 'object') { for (var len = result.length, i = 0; i < len; i++) { result[i] = Math.round(result[i]); } } return result; }; // preserve .conversion property if there is one if ('conversion' in fn) { wrappedFn.conversion = fn.conversion; } return wrappedFn; } models.forEach(function (fromModel) { convert[fromModel] = {}; Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels}); Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels}); var routes = route(fromModel); var routeModels = Object.keys(routes); routeModels.forEach(function (toModel) { var fn = routes[toModel]; convert[fromModel][toModel] = wrapRounded(fn); convert[fromModel][toModel].raw = wrapRaw(fn); }); }); module.exports = convert; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { /* MIT license */ var cssKeywords = __webpack_require__(8); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). // do not use box values types (i.e. Number(), String(), etc.) var reverseKeywords = {}; for (var key in cssKeywords) { if (cssKeywords.hasOwnProperty(key)) { reverseKeywords[cssKeywords[key]] = key; } } var convert = module.exports = { rgb: {channels: 3, labels: 'rgb'}, hsl: {channels: 3, labels: 'hsl'}, hsv: {channels: 3, labels: 'hsv'}, hwb: {channels: 3, labels: 'hwb'}, cmyk: {channels: 4, labels: 'cmyk'}, xyz: {channels: 3, labels: 'xyz'}, lab: {channels: 3, labels: 'lab'}, lch: {channels: 3, labels: 'lch'}, hex: {channels: 1, labels: ['hex']}, keyword: {channels: 1, labels: ['keyword']}, ansi16: {channels: 1, labels: ['ansi16']}, ansi256: {channels: 1, labels: ['ansi256']}, hcg: {channels: 3, labels: ['h', 'c', 'g']}, apple: {channels: 3, labels: ['r16', 'g16', 'b16']}, gray: {channels: 1, labels: ['gray']} }; // hide .channels and .labels properties for (var model in convert) { if (convert.hasOwnProperty(model)) { if (!('channels' in convert[model])) { throw new Error('missing channels property: ' + model); } if (!('labels' in convert[model])) { throw new Error('missing channel labels property: ' + model); } if (convert[model].labels.length !== convert[model].channels) { throw new Error('channel and label counts mismatch: ' + model); } var channels = convert[model].channels; var labels = convert[model].labels; delete convert[model].channels; delete convert[model].labels; Object.defineProperty(convert[model], 'channels', {value: channels}); Object.defineProperty(convert[model], 'labels', {value: labels}); } } convert.rgb.hsl = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; var min = Math.min(r, g, b); var max = Math.max(r, g, b); var delta = max - min; var h; var s; var l; if (max === min) { h = 0; } else if (r === max) { h = (g - b) / delta; } else if (g === max) { h = 2 + (b - r) / delta; } else if (b === max) { h = 4 + (r - g) / delta; } h = Math.min(h * 60, 360); if (h < 0) { h += 360; } l = (min + max) / 2; if (max === min) { s = 0; } else if (l <= 0.5) { s = delta / (max + min); } else { s = delta / (2 - max - min); } return [h, s * 100, l * 100]; }; convert.rgb.hsv = function (rgb) { var r = rgb[0]; var g = rgb[1]; var b = rgb[2]; var min = Math.min(r, g, b); var max = Math.max(r, g, b); var delta = max - min; var h; var s; var v; if (max === 0) { s = 0; } else { s = (delta / max * 1000) / 10; } if (max === min) { h = 0; } else if (r === max) { h = (g - b) / delta; } else if (g === max) { h = 2 + (b - r) / delta; } else if (b === max) { h = 4 + (r - g) / delta; } h = Math.min(h * 60, 360); if (h < 0) { h += 360; } v = ((max / 255) * 1000) / 10; return [h, s, v]; }; convert.rgb.hwb = function (rgb) { var r = rgb[0]; var g = rgb[1]; var b = rgb[2]; var h = convert.rgb.hsl(rgb)[0]; var w = 1 / 255 * Math.min(r, Math.min(g, b)); b = 1 - 1 / 255 * Math.max(r, Math.max(g, b)); return [h, w * 100, b * 100]; }; convert.rgb.cmyk = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; var c; var m; var y; var k; k = Math.min(1 - r, 1 - g, 1 - b); c = (1 - r - k) / (1 - k) || 0; m = (1 - g - k) / (1 - k) || 0; y = (1 - b - k) / (1 - k) || 0; return [c * 100, m * 100, y * 100, k * 100]; }; /** * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance * */ function comparativeDistance(x, y) { return ( Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2) ); } convert.rgb.keyword = function (rgb) { var reversed = reverseKeywords[rgb]; if (reversed) { return reversed; } var currentClosestDistance = Infinity; var currentClosestKeyword; for (var keyword in cssKeywords) { if (cssKeywords.hasOwnProperty(keyword)) { var value = cssKeywords[keyword]; // Compute comparative distance var distance = comparativeDistance(rgb, value); // Check if its less, if so set as closest if (distance < currentClosestDistance) { currentClosestDistance = distance; currentClosestKeyword = keyword; } } } return currentClosestKeyword; }; convert.keyword.rgb = function (keyword) { return cssKeywords[keyword]; }; convert.rgb.xyz = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; // assume sRGB r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92); g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92); b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92); var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); return [x * 100, y * 100, z * 100]; }; convert.rgb.lab = function (rgb) { var xyz = convert.rgb.xyz(rgb); var x = xyz[0]; var y = xyz[1]; var z = xyz[2]; var l; var a; var b; x /= 95.047; y /= 100; z /= 108.883; x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); l = (116 * y) - 16; a = 500 * (x - y); b = 200 * (y - z); return [l, a, b]; }; convert.hsl.rgb = function (hsl) { var h = hsl[0] / 360; var s = hsl[1] / 100; var l = hsl[2] / 100; var t1; var t2; var t3; var rgb; var val; if (s === 0) { val = l * 255; return [val, val, val]; } if (l < 0.5) { t2 = l * (1 + s); } else { t2 = l + s - l * s; } t1 = 2 * l - t2; rgb = [0, 0, 0]; for (var i = 0; i < 3; i++) { t3 = h + 1 / 3 * -(i - 1); if (t3 < 0) { t3++; } if (t3 > 1) { t3--; } if (6 * t3 < 1) { val = t1 + (t2 - t1) * 6 * t3; } else if (2 * t3 < 1) { val = t2; } else if (3 * t3 < 2) { val = t1 + (t2 - t1) * (2 / 3 - t3) * 6; } else { val = t1; } rgb[i] = val * 255; } return rgb; }; convert.hsl.hsv = function (hsl) { var h = hsl[0]; var s = hsl[1] / 100; var l = hsl[2] / 100; var smin = s; var lmin = Math.max(l, 0.01); var sv; var v; l *= 2; s *= (l <= 1) ? l : 2 - l; smin *= lmin <= 1 ? lmin : 2 - lmin; v = (l + s) / 2; sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s); return [h, sv * 100, v * 100]; }; convert.hsv.rgb = function (hsv) { var h = hsv[0] / 60; var s = hsv[1] / 100; var v = hsv[2] / 100; var hi = Math.floor(h) % 6; var f = h - Math.floor(h); var p = 255 * v * (1 - s); var q = 255 * v * (1 - (s * f)); var t = 255 * v * (1 - (s * (1 - f))); v *= 255; switch (hi) { case 0: return [v, t, p]; case 1: return [q, v, p]; case 2: return [p, v, t]; case 3: return [p, q, v]; case 4: return [t, p, v]; case 5: return [v, p, q]; } }; convert.hsv.hsl = function (hsv) { var h = hsv[0]; var s = hsv[1] / 100; var v = hsv[2] / 100; var vmin = Math.max(v, 0.01); var lmin; var sl; var l; l = (2 - s) * v; lmin = (2 - s) * vmin; sl = s * vmin; sl /= (lmin <= 1) ? lmin : 2 - lmin; sl = sl || 0; l /= 2; return [h, sl * 100, l * 100]; }; // http://dev.w3.org/csswg/css-color/#hwb-to-rgb convert.hwb.rgb = function (hwb) { var h = hwb[0] / 360; var wh = hwb[1] / 100; var bl = hwb[2] / 100; var ratio = wh + bl; var i; var v; var f; var n; // wh + bl cant be > 1 if (ratio > 1) { wh /= ratio; bl /= ratio; } i = Math.floor(6 * h); v = 1 - bl; f = 6 * h - i; if ((i & 0x01) !== 0) { f = 1 - f; } n = wh + f * (v - wh); // linear interpolation var r; var g; var b; switch (i) { default: case 6: case 0: r = v; g = n; b = wh; break; case 1: r = n; g = v; b = wh; break; case 2: r = wh; g = v; b = n; break; case 3: r = wh; g = n; b = v; break; case 4: r = n; g = wh; b = v; break; case 5: r = v; g = wh; b = n; break; } return [r * 255, g * 255, b * 255]; }; convert.cmyk.rgb = function (cmyk) { var c = cmyk[0] / 100; var m = cmyk[1] / 100; var y = cmyk[2] / 100; var k = cmyk[3] / 100; var r; var g; var b; r = 1 - Math.min(1, c * (1 - k) + k); g = 1 - Math.min(1, m * (1 - k) + k); b = 1 - Math.min(1, y * (1 - k) + k); return [r * 255, g * 255, b * 255]; }; convert.xyz.rgb = function (xyz) { var x = xyz[0] / 100; var y = xyz[1] / 100; var z = xyz[2] / 100; var r; var g; var b; r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); // assume sRGB r = r > 0.0031308 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055) : r * 12.92; g = g > 0.0031308 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055) : g * 12.92; b = b > 0.0031308 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055) : b * 12.92; r = Math.min(Math.max(0, r), 1); g = Math.min(Math.max(0, g), 1); b = Math.min(Math.max(0, b), 1); return [r * 255, g * 255, b * 255]; }; convert.xyz.lab = function (xyz) { var x = xyz[0]; var y = xyz[1]; var z = xyz[2]; var l; var a; var b; x /= 95.047; y /= 100; z /= 108.883; x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116); y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116); z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116); l = (116 * y) - 16; a = 500 * (x - y); b = 200 * (y - z); return [l, a, b]; }; convert.lab.xyz = function (lab) { var l = lab[0]; var a = lab[1]; var b = lab[2]; var x; var y; var z; y = (l + 16) / 116; x = a / 500 + y; z = y - b / 200; var y2 = Math.pow(y, 3); var x2 = Math.pow(x, 3); var z2 = Math.pow(z, 3); y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787; x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787; z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787; x *= 95.047; y *= 100; z *= 108.883; return [x, y, z]; }; convert.lab.lch = function (lab) { var l = lab[0]; var a = lab[1]; var b = lab[2]; var hr; var h; var c; hr = Math.atan2(b, a); h = hr * 360 / 2 / Math.PI; if (h < 0) { h += 360; } c = Math.sqrt(a * a + b * b); return [l, c, h]; }; convert.lch.lab = function (lch) { var l = lch[0]; var c = lch[1]; var h = lch[2]; var a; var b; var hr; hr = h / 360 * 2 * Math.PI; a = c * Math.cos(hr); b = c * Math.sin(hr); return [l, a, b]; }; convert.rgb.ansi16 = function (args) { var r = args[0]; var g = args[1]; var b = args[2]; var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization value = Math.round(value / 50); if (value === 0) { return 30; } var ansi = 30 + ((Math.round(b / 255) << 2) | (Math.round(g / 255) << 1) | Math.round(r / 255)); if (value === 2) { ansi += 60; } return ansi; }; convert.hsv.ansi16 = function (args) { // optimization here; we already know the value and don't need to get // it converted for us. return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]); }; convert.rgb.ansi256 = function (args) { var r = args[0]; var g = args[1]; var b = args[2]; // we use the extended greyscale palette here, with the exception of // black and white. normal palette only has 4 greyscale shades. if (r === g && g === b) { if (r < 8) { return 16; } if (r > 248) { return 231; } return Math.round(((r - 8) / 247) * 24) + 232; } var ansi = 16 + (36 * Math.round(r / 255 * 5)) + (6 * Math.round(g / 255 * 5)) + Math.round(b / 255 * 5); return ansi; }; convert.ansi16.rgb = function (args) { var color = args % 10; // handle greyscale if (color === 0 || color === 7) { if (args > 50) { color += 3.5; } color = color / 10.5 * 255; return [color, color, color]; } var mult = (~~(args > 50) + 1) * 0.5; var r = ((color & 1) * mult) * 255; var g = (((color >> 1) & 1) * mult) * 255; var b = (((color >> 2) & 1) * mult) * 255; return [r, g, b]; }; convert.ansi256.rgb = function (args) { // handle greyscale if (args >= 232) { var c = (args - 232) * 10 + 8; return [c, c, c]; } args -= 16; var rem; var r = Math.floor(args / 36) / 5 * 255; var g = Math.floor((rem = args % 36) / 6) / 5 * 255; var b = (rem % 6) / 5 * 255; return [r, g, b]; }; convert.rgb.hex = function (args) { var integer = ((Math.round(args[0]) & 0xFF) << 16) + ((Math.round(args[1]) & 0xFF) << 8) + (Math.round(args[2]) & 0xFF); var string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.hex.rgb = function (args) { var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!match) { return [0, 0, 0]; } var colorString = match[0]; if (match[0].length === 3) { colorString = colorString.split('').map(function (char) { return char + char; }).join(''); } var integer = parseInt(colorString, 16); var r = (integer >> 16) & 0xFF; var g = (integer >> 8) & 0xFF; var b = integer & 0xFF; return [r, g, b]; }; convert.rgb.hcg = function (rgb) { var r = rgb[0] / 255; var g = rgb[1] / 255; var b = rgb[2] / 255; var max = Math.max(Math.max(r, g), b); var min = Math.min(Math.min(r, g), b); var chroma = (max - min); var grayscale; var hue; if (chroma < 1) { grayscale = min / (1 - chroma); } else { grayscale = 0; } if (chroma <= 0) { hue = 0; } else if (max === r) { hue = ((g - b) / chroma) % 6; } else if (max === g) { hue = 2 + (b - r) / chroma; } else { hue = 4 + (r - g) / chroma + 4; } hue /= 6; hue %= 1; return [hue * 360, chroma * 100, grayscale * 100]; }; convert.hsl.hcg = function (hsl) { var s = hsl[1] / 100; var l = hsl[2] / 100; var c = 1; var f = 0; if (l < 0.5) { c = 2.0 * s * l; } else { c = 2.0 * s * (1.0 - l); } if (c < 1.0) { f = (l - 0.5 * c) / (1.0 - c); } return [hsl[0], c * 100, f * 100]; }; convert.hsv.hcg = function (hsv) { var s = hsv[1] / 100; var v = hsv[2] / 100; var c = s * v; var f = 0; if (c < 1.0) { f = (v - c) / (1 - c); } return [hsv[0], c * 100, f * 100]; }; convert.hcg.rgb = function (hcg) { var h = hcg[0] / 360; var c = hcg[1] / 100; var g = hcg[2] / 100; if (c === 0.0) { return [g * 255, g * 255, g * 255]; } var pure = [0, 0, 0]; var hi = (h % 1) * 6; var v = hi % 1; var w = 1 - v; var mg = 0; switch (Math.floor(hi)) { case 0: pure[0] = 1; pure[1] = v; pure[2] = 0; break; case 1: pure[0] = w; pure[1] = 1; pure[2] = 0; break; case 2: pure[0] = 0; pure[1] = 1; pure[2] = v; break; case 3: pure[0] = 0; pure[1] = w; pure[2] = 1; break; case 4: pure[0] = v; pure[1] = 0; pure[2] = 1; break; default: pure[0] = 1; pure[1] = 0; pure[2] = w; } mg = (1.0 - c) * g; return [ (c * pure[0] + mg) * 255, (c * pure[1] + mg) * 255, (c * pure[2] + mg) * 255 ]; }; convert.hcg.hsv = function (hcg) { var c = hcg[1] / 100; var g = hcg[2] / 100; var v = c + g * (1.0 - c); var f = 0; if (v > 0.0) { f = c / v; } return [hcg[0], f * 100, v * 100]; }; convert.hcg.hsl = function (hcg) { var c = hcg[1] / 100; var g = hcg[2] / 100; var l = g * (1.0 - c) + 0.5 * c; var s = 0; if (l > 0.0 && l < 0.5) { s = c / (2 * l); } else if (l >= 0.5 && l < 1.0) { s = c / (2 * (1 - l)); } return [hcg[0], s * 100, l * 100]; }; convert.hcg.hwb = function (hcg) { var c = hcg[1] / 100; var g = hcg[2] / 100; var v = c + g * (1.0 - c); return [hcg[0], (v - c) * 100, (1 - v) * 100]; }; convert.hwb.hcg = function (hwb) { var w = hwb[1] / 100; var b = hwb[2] / 100; var v = 1 - b; var c = v - w; var g = 0; if (c < 1) { g = (v - c) / (1 - c); } return [hwb[0], c * 100, g * 100]; }; convert.apple.rgb = function (apple) { return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255]; }; convert.rgb.apple = function (rgb) { return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535]; }; convert.gray.rgb = function (args) { return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255]; }; convert.gray.hsl = convert.gray.hsv = function (args) { return [0, 0, args[0]]; }; convert.gray.hwb = function (gray) { return [0, 100, gray[0]]; }; convert.gray.cmyk = function (gray) { return [0, 0, 0, gray[0]]; }; convert.gray.lab = function (gray) { return [gray[0], 0, 0]; }; convert.gray.hex = function (gray) { var val = Math.round(gray[0] / 100 * 255) & 0xFF; var integer = (val << 16) + (val << 8) + val; var string = integer.toString(16).toUpperCase(); return '000000'.substring(string.length) + string; }; convert.rgb.gray = function (rgb) { var val = (rgb[0] + rgb[1] + rgb[2]) / 3; return [val / 255 * 100]; }; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = { "aliceblue": [240, 248, 255], "antiquewhite": [250, 235, 215], "aqua": [0, 255, 255], "aquamarine": [127, 255, 212], "azure": [240, 255, 255], "beige": [245, 245, 220], "bisque": [255, 228, 196], "black": [0, 0, 0], "blanchedalmond": [255, 235, 205], "blue": [0, 0, 255], "blueviolet": [138, 43, 226], "brown": [165, 42, 42], "burlywood": [222, 184, 135], "cadetblue": [95, 158, 160], "chartreuse": [127, 255, 0], "chocolate": [210, 105, 30], "coral": [255, 127, 80], "cornflowerblue": [100, 149, 237], "cornsilk": [255, 248, 220], "crimson": [220, 20, 60], "cyan": [0, 255, 255], "darkblue": [0, 0, 139], "darkcyan": [0, 139, 139], "darkgoldenrod": [184, 134, 11], "darkgray": [169, 169, 169], "darkgreen": [0, 100, 0], "darkgrey": [169, 169, 169], "darkkhaki": [189, 183, 107], "darkmagenta": [139, 0, 139], "darkolivegreen": [85, 107, 47], "darkorange": [255, 140, 0], "darkorchid": [153, 50, 204], "darkred": [139, 0, 0], "darksalmon": [233, 150, 122], "darkseagreen": [143, 188, 143], "darkslateblue": [72, 61, 139], "darkslategray": [47, 79, 79], "darkslategrey": [47, 79, 79], "darkturquoise": [0, 206, 209], "darkviolet": [148, 0, 211], "deeppink": [255, 20, 147], "deepskyblue": [0, 191, 255], "dimgray": [105, 105, 105], "dimgrey": [105, 105, 105], "dodgerblue": [30, 144, 255], "firebrick": [178, 34, 34], "floralwhite": [255, 250, 240], "forestgreen": [34, 139, 34], "fuchsia": [255, 0, 255], "gainsboro": [220, 220, 220], "ghostwhite": [248, 248, 255], "gold": [255, 215, 0], "goldenrod": [218, 165, 32], "gray": [128, 128, 128], "green": [0, 128, 0], "greenyellow": [173, 255, 47], "grey": [128, 128, 128], "honeydew": [240, 255, 240], "hotpink": [255, 105, 180], "indianred": [205, 92, 92], "indigo": [75, 0, 130], "ivory": [255, 255, 240], "khaki": [240, 230, 140], "lavender": [230, 230, 250], "lavenderblush": [255, 240, 245], "lawngreen": [124, 252, 0], "lemonchiffon": [255, 250, 205], "lightblue": [173, 216, 230], "lightcoral": [240, 128, 128], "lightcyan": [224, 255, 255], "lightgoldenrodyellow": [250, 250, 210], "lightgray": [211, 211, 211], "lightgreen": [144, 238, 144], "lightgrey": [211, 211, 211], "lightpink": [255, 182, 193], "lightsalmon": [255, 160, 122], "lightseagreen": [32, 178, 170], "lightskyblue": [135, 206, 250], "lightslategray": [119, 136, 153], "lightslategrey": [119, 136, 153], "lightsteelblue": [176, 196, 222], "lightyellow": [255, 255, 224], "lime": [0, 255, 0], "limegreen": [50, 205, 50], "linen": [250, 240, 230], "magenta": [255, 0, 255], "maroon": [128, 0, 0], "mediumaquamarine": [102, 205, 170], "mediumblue": [0, 0, 205], "mediumorchid": [186, 85, 211], "mediumpurple": [147, 112, 219], "mediumseagreen": [60, 179, 113], "mediumslateblue": [123, 104, 238], "mediumspringgreen": [0, 250, 154], "mediumturquoise": [72, 209, 204], "mediumvioletred": [199, 21, 133], "midnightblue": [25, 25, 112], "mintcream": [245, 255, 250], "mistyrose": [255, 228, 225], "moccasin": [255, 228, 181], "navajowhite": [255, 222, 173], "navy": [0, 0, 128], "oldlace": [253, 245, 230], "olive": [128, 128, 0], "olivedrab": [107, 142, 35], "orange": [255, 165, 0], "orangered": [255, 69, 0], "orchid": [218, 112, 214], "palegoldenrod": [238, 232, 170], "palegreen": [152, 251, 152], "paleturquoise": [175, 238, 238], "palevioletred": [219, 112, 147], "papayawhip": [255, 239, 213], "peachpuff": [255, 218, 185], "peru": [205, 133, 63], "pink": [255, 192, 203], "plum": [221, 160, 221], "powderblue": [176, 224, 230], "purple": [128, 0, 128], "rebeccapurple": [102, 51, 153], "red": [255, 0, 0], "rosybrown": [188, 143, 143], "royalblue": [65, 105, 225], "saddlebrown": [139, 69, 19], "salmon": [250, 128, 114], "sandybrown": [244, 164, 96], "seagreen": [46, 139, 87], "seashell": [255, 245, 238], "sienna": [160, 82, 45], "silver": [192, 192, 192], "skyblue": [135, 206, 235], "slateblue": [106, 90, 205], "slategray": [112, 128, 144], "slategrey": [112, 128, 144], "snow": [255, 250, 250], "springgreen": [0, 255, 127], "steelblue": [70, 130, 180], "tan": [210, 180, 140], "teal": [0, 128, 128], "thistle": [216, 191, 216], "tomato": [255, 99, 71], "turquoise": [64, 224, 208], "violet": [238, 130, 238], "wheat": [245, 222, 179], "white": [255, 255, 255], "whitesmoke": [245, 245, 245], "yellow": [255, 255, 0], "yellowgreen": [154, 205, 50] }; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { var conversions = __webpack_require__(7); /* this function routes a model to all other models. all functions that are routed have a property `.conversion` attached to the returned synthetic function. This property is an array of strings, each with the steps in between the 'from' and 'to' color models (inclusive). conversions that are not possible simply are not included. */ function buildGraph() { var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3 var models = Object.keys(conversions); for (var len = models.length, i = 0; i < len; i++) { graph[models[i]] = { // http://jsperf.com/1-vs-infinity // micro-opt, but this is simple. distance: -1, parent: null }; } return graph; } // https://en.wikipedia.org/wiki/Breadth-first_search function deriveBFS(fromModel) { var graph = buildGraph(); var queue = [fromModel]; // unshift -> queue -> pop graph[fromModel].distance = 0; while (queue.length) { var current = queue.pop(); var adjacents = Object.keys(conversions[current]); for (var len = adjacents.length, i = 0; i < len; i++) { var adjacent = adjacents[i]; var node = graph[adjacent]; if (node.distance === -1) { node.distance = graph[current].distance + 1; node.parent = current; queue.unshift(adjacent); } } } return graph; } function link(from, to) { return function (args) { return to(from(args)); }; } function wrapConversion(toModel, graph) { var path = [graph[toModel].parent, toModel]; var fn = conversions[graph[toModel].parent][toModel]; var cur = graph[toModel].parent; while (graph[cur].parent) { path.unshift(graph[cur].parent); fn = link(conversions[graph[cur].parent][cur], fn); cur = graph[cur].parent; } fn.conversion = path; return fn; } module.exports = function (fromModel) { var graph = deriveBFS(fromModel); var conversion = {}; var models = Object.keys(graph); for (var len = models.length, i = 0; i < len; i++) { var toModel = models[i]; var node = graph[toModel]; if (node.parent === null) { // no possible conversion, or this node is the source model. continue; } conversion[toModel] = wrapConversion(toModel, graph); } return conversion; }; /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const os = __webpack_require__(11); const hasFlag = __webpack_require__(12); const env = process.env; let forceColor; if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) { forceColor = false; } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) { forceColor = true; } if ('FORCE_COLOR' in env) { forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; } function translateLevel(level) { if (level === 0) { return false; } return { level, hasBasic: true, has256: level >= 2, has16m: level >= 3 }; } function supportsColor(stream) { if (forceColor === false) { return 0; } if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) { return 3; } if (hasFlag('color=256')) { return 2; } if (stream && !stream.isTTY && forceColor !== true) { // VS code debugger doesn't have isTTY set if (env.VSCODE_PID) { return 1; } return 0; } const min = forceColor ? 1 : 0; if (process.platform === 'win32') { // Node.js 7.5.0 is the first version of Node.js to include a patch to // libuv that enables 256 color output on Windows. Anything earlier and it // won't work. However, here we target Node.js 8 at minimum as it is an LTS // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows // release that supports 256 colors. Windows 10 build 14931 is the first release // that supports 16m/TrueColor. const osRelease = os.release().split('.'); if ( Number(process.versions.node.split('.')[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } if ('CI' in env) { if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') { return 1; } return min; } if ('TEAMCITY_VERSION' in env) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } if (env.COLORTERM === 'truecolor') { return 3; } if ('TERM_PROGRAM' in env) { const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); switch (env.TERM_PROGRAM) { case 'iTerm.app': return version >= 3 ? 3 : 2; case 'Apple_Terminal': return 2; // No default } } if (/-256(color)?$/i.test(env.TERM)) { return 2; } if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { return 1; } if ('COLORTERM' in env) { return 1; } if (env.TERM === 'dumb') { return min; } return min; } function getSupportLevel(stream) { const level = supportsColor(stream); return translateLevel(level); } module.exports = { supportsColor: getSupportLevel, stdout: getSupportLevel(process.stdout), stderr: getSupportLevel(process.stderr) }; /***/ }), /* 11 */ /***/ (function(module, exports) { module.exports = require("os"); /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = (flag, argv) => { argv = argv || process.argv; const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); const pos = argv.indexOf(prefix + flag); const terminatorPos = argv.indexOf('--'); return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); }; /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi; const ESCAPES = new Map([ ['n', '\n'], ['r', '\r'], ['t', '\t'], ['b', '\b'], ['f', '\f'], ['v', '\v'], ['0', '\0'], ['\\', '\\'], ['e', '\u001B'], ['a', '\u0007'] ]); function unescape(c) { if ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) { return String.fromCharCode(parseInt(c.slice(1), 16)); } return ESCAPES.get(c) || c; } function parseArguments(name, args) { const results = []; const chunks = args.trim().split(/\s*,\s*/g); let matches; for (const chunk of chunks) { if (!isNaN(chunk)) { results.push(Number(chunk)); } else if ((matches = chunk.match(STRING_REGEX))) { results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr)); } else { throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); } } return results; } function parseStyle(style) { STYLE_REGEX.lastIndex = 0; const results = []; let matches; while ((matches = STYLE_REGEX.exec(style)) !== null) { const name = matches[1]; if (matches[2]) { const args = parseArguments(name, matches[2]); results.push([name].concat(args)); } else { results.push([name]); } } return results; } function buildStyle(chalk, styles) { const enabled = {}; for (const layer of styles) { for (const style of layer.styles) { enabled[style[0]] = layer.inverse ? null : style.slice(1); } } let current = chalk; for (const styleName of Object.keys(enabled)) { if (Array.isArray(enabled[styleName])) { if (!(styleName in current)) { throw new Error(`Unknown Chalk style: ${styleName}`); } if (enabled[styleName].length > 0) { current = current[styleName].apply(current, enabled[styleName]); } else { current = current[styleName]; } } } return current; } module.exports = (chalk, tmp) => { const styles = []; const chunks = []; let chunk = []; // eslint-disable-next-line max-params tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => { if (escapeChar) { chunk.push(unescape(escapeChar)); } else if (style) { const str = chunk.join(''); chunk = []; chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str)); styles.push({inverse, styles: parseStyle(style)}); } else if (close) { if (styles.length === 0) { throw new Error('Found extraneous } in Chalk template literal'); } chunks.push(buildStyle(chalk, styles)(chunk.join(''))); chunk = []; styles.pop(); } else { chunk.push(chr); } }); chunks.push(chunk.join('')); if (styles.length > 0) { const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`; throw new Error(errMsg); } return chunks.join(''); }; /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; function dedent(strings) { var raw = void 0; if (typeof strings === "string") { // dedent can be used as a plain function raw = [strings]; } else { raw = strings.raw; } // first, perform interpolation var result = ""; for (var i = 0; i < raw.length; i++) { result += raw[i]. // join lines when there is a suppressed newline replace(/\\\n[ \t]*/g, ""). // handle escaped backticks replace(/\\`/g, "`"); if (i < (arguments.length <= 1 ? 0 : arguments.length - 1)) { result += arguments.length <= i + 1 ? undefined : arguments[i + 1]; } } // now strip indentation var lines = result.split("\n"); var mindent = null; lines.forEach(function (l) { var m = l.match(/^(\s+)\S+/); if (m) { var indent = m[1].length; if (!mindent) { // this is the first indented line mindent = indent; } else { mindent = Math.min(mindent, indent); } } }); if (mindent !== null) { result = lines.map(function (l) { return l[0] === " " ? l.slice(mindent) : l; }).join("\n"); } // dedent eats leading and trailing whitespace too result = result.trim(); // handle escaped newlines at the end to ensure they don't get stripped too return result.replace(/\\n/g, "\n"); } if (true) { module.exports = dedent; } /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const EMPTYARR = [] const SHORTSPLIT = /$|[!-@[-`{-~][\s\S]*/g const isArray = Array.isArray const parseValue = function(any) { if (any === "") return "" if (any === "false") return false const maybe = Number(any) return maybe * 0 === 0 ? maybe : any } const parseAlias = function(aliases) { let out = {}, key, alias, prev, len, any, i, k for (key in aliases) { any = aliases[key] alias = out[key] = isArray(any) ? any : [any] for (i = 0, len = alias.length; i < len; i++) { prev = out[alias[i]] = [key] for (k = 0; k < len; k++) { if (i !== k) prev.push(alias[k]) } } } return out } const parseDefault = function(aliases, defaults) { let out = {}, key, alias, value, len, i for (key in defaults) { value = defaults[key] alias = aliases[key] out[key] = value if (alias === undefined) { aliases[key] = EMPTYARR } else { for (i = 0, len = alias.length; i < len; i++) { out[alias[i]] = value } } } return out } const parseOptions = function(aliases, options, value) { let out = {}, key, alias, len, end, i, k if (options !== undefined) { for (i = 0, len = options.length; i < len; i++) { key = options[i] alias = aliases[key] out[key] = value if (alias === undefined) { aliases[key] = EMPTYARR } else { for (k = 0, end = alias.length; k < end; k++) { out[alias[k]] = value } } } } return out } const write = function(out, key, value, aliases, unknown) { let i, prev, alias = aliases[key], len = alias === undefined ? -1 : alias.length if (len >= 0 || unknown === undefined || unknown(key)) { prev = out[key] if (prev === undefined) { out[key] = value } else { if (isArray(prev)) { prev.push(value) } else { out[key] = [prev, value] } } for (i = 0; i < len; i++) { out[alias[i]] = out[key] } } } const getopts = function(argv, opts) { let unknown = (opts = opts || {}).unknown, aliases = parseAlias(opts.alias), strings = parseOptions(aliases, opts.string, ""), values = parseDefault(aliases, opts.default), bools = parseOptions(aliases, opts.boolean, false), stopEarly = opts.stopEarly, _ = [], out = { _ }, i = 0, k = 0, len = argv.length, key, arg, end, match, value for (; i < len; i++) { arg = argv[i] if (arg[0] !== "-" || arg === "-") { if (stopEarly) while (i < len) _.push(argv[i++]) else _.push(arg) } else if (arg === "--") { while (++i < len) _.push(argv[i]) } else if (arg[1] === "-") { end = arg.indexOf("=", 2) if (arg[2] === "n" && arg[3] === "o" && arg[4] === "-") { key = arg.slice(5, end >= 0 ? end : undefined) value = false } else if (end >= 0) { key = arg.slice(2, end) value = bools[key] !== undefined || (strings[key] === undefined ? parseValue(arg.slice(end + 1)) : arg.slice(end + 1)) } else { key = arg.slice(2) value = bools[key] !== undefined || (len === i + 1 || argv[i + 1][0] === "-" ? strings[key] === undefined ? true : "" : strings[key] === undefined ? parseValue(argv[++i]) : argv[++i]) } write(out, key, value, aliases, unknown) } else { SHORTSPLIT.lastIndex = 2 match = SHORTSPLIT.exec(arg) end = match.index value = match[0] for (k = 1; k < end; k++) { write( out, (key = arg[k]), k + 1 < end ? strings[key] === undefined || arg.substring(k + 1, (k = end)) + value : value === "" ? len === i + 1 || argv[i + 1][0] === "-" ? strings[key] === undefined || "" : bools[key] !== undefined || (strings[key] === undefined ? parseValue(argv[++i]) : argv[++i]) : bools[key] !== undefined || (strings[key] === undefined ? parseValue(value) : value), aliases, unknown ) } } } for (key in values) if (out[key] === undefined) out[key] = values[key] for (key in bools) if (out[key] === undefined) out[key] = false for (key in strings) if (out[key] === undefined) out[key] = "" return out } module.exports = getopts /***/ }), /* 16 */ /***/ (function(module, exports) { module.exports = require("path"); /***/ }), /* 17 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commands", function() { return commands; }); /* harmony import */ var _bootstrap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18); /* harmony import */ var _clean__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(136); /* harmony import */ var _run__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(159); /* harmony import */ var _watch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(160); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ const commands = { bootstrap: _bootstrap__WEBPACK_IMPORTED_MODULE_0__["BootstrapCommand"], clean: _clean__WEBPACK_IMPORTED_MODULE_1__["CleanCommand"], run: _run__WEBPACK_IMPORTED_MODULE_2__["RunCommand"], watch: _watch__WEBPACK_IMPORTED_MODULE_3__["WatchCommand"] }; /***/ }), /* 18 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BootstrapCommand", function() { return BootstrapCommand; }); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _utils_link_project_executables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19); /* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33); /* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34); /* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ const BootstrapCommand = { description: 'Install dependencies and crosslink projects', name: 'bootstrap', async run(projects, projectGraph, { options }) { const batchedProjectsByWorkspace = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_4__["topologicallyBatchProjects"])(projects, projectGraph, { batchByWorkspace: true }); const batchedProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_4__["topologicallyBatchProjects"])(projects, projectGraph); const extraArgs = [...(options['frozen-lockfile'] === true ? ['--frozen-lockfile'] : []), ...(options['prefer-offline'] === true ? ['--prefer-offline'] : [])]; _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold('\nRunning installs in topological order:')); for (const batch of batchedProjectsByWorkspace) { for (const project of batch) { if (project.isWorkspaceProject) { _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(`Skipping workspace project: ${project.name}`); continue; } if (project.hasDependencies()) { await project.installDependencies({ extraArgs }); } } } _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold('\nInstalls completed, linking package executables:\n')); await Object(_utils_link_project_executables__WEBPACK_IMPORTED_MODULE_1__["linkProjectExecutables"])(projects, projectGraph); /** * At the end of the bootstrapping process we call all `kbn:bootstrap` scripts * in the list of projects. We do this because some projects need to be * transpiled before they can be used. Ideally we shouldn't do this unless we * have to, as it will slow down the bootstrapping process. */ _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold('\nLinking executables completed, running `kbn:bootstrap` scripts\n')); await Object(_utils_parallelize__WEBPACK_IMPORTED_MODULE_3__["parallelizeBatches"])(batchedProjects, async pkg => { if (pkg.hasScript('kbn:bootstrap')) { await pkg.runScriptStreaming('kbn:bootstrap'); } }); _utils_log__WEBPACK_IMPORTED_MODULE_2__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green.bold('\nBootstrapping completed!\n')); } }; /***/ }), /* 19 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linkProjectExecutables", function() { return linkProjectExecutables; }); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20); /* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(33); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Yarn does not link the executables from dependencies that are installed * using `link:` https://github.com/yarnpkg/yarn/pull/5046 * * We simulate this functionality by walking through each project's project * dependencies, and manually linking their executables if defined. The logic * for linking was mostly adapted from lerna: https://github.com/lerna/lerna/blob/1d7eb9eeff65d5a7de64dea73613b1bf6bfa8d57/src/PackageUtilities.js#L348 */ async function linkProjectExecutables(projectsByName, projectGraph) { for (const [projectName, projectDeps] of projectGraph) { const project = projectsByName.get(projectName); const binsDir = Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(project.nodeModulesLocation, '.bin'); for (const projectDep of projectDeps) { const executables = projectDep.getExecutables(); for (const name of Object.keys(executables)) { const srcPath = executables[name]; // existing logic from lerna -- ensure that the bin we are going to // point to exists or ignore it if (!(await Object(_fs__WEBPACK_IMPORTED_MODULE_2__["isFile"])(srcPath))) { continue; } const dest = Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(binsDir, name); // Get relative project path with normalized path separators. const projectRelativePath = Object(path__WEBPACK_IMPORTED_MODULE_0__["relative"])(project.path, srcPath).split(path__WEBPACK_IMPORTED_MODULE_0__["sep"]).join('/'); _log__WEBPACK_IMPORTED_MODULE_3__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_1___default.a`{dim [${project.name}]} ${name} -> {dim ${projectRelativePath}}`); await Object(_fs__WEBPACK_IMPORTED_MODULE_2__["mkdirp"])(Object(path__WEBPACK_IMPORTED_MODULE_0__["dirname"])(dest)); await Object(_fs__WEBPACK_IMPORTED_MODULE_2__["createSymlink"])(srcPath, dest, 'exec'); await Object(_fs__WEBPACK_IMPORTED_MODULE_2__["chmod"])(dest, '755'); } } } } /***/ }), /* 20 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unlink", function() { return unlink; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyDirectory", function() { return copyDirectory; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "chmod", function() { return chmod; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readFile", function() { return readFile; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mkdirp", function() { return mkdirp; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSymlink", function() { return isSymlink; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDirectory", function() { return isDirectory; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFile", function() { return isFile; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSymlink", function() { return createSymlink; }); /* harmony import */ var cmd_shim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21); /* harmony import */ var cmd_shim__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cmd_shim__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var mkdirp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31); /* harmony import */ var mkdirp__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(mkdirp__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var ncp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(32); /* harmony import */ var ncp__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(ncp__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29); /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_5__); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ const lstat = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.lstat); const readFile = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.readFile); const symlink = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.symlink); const chmod = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.chmod); const cmdShim = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(cmd_shim__WEBPACK_IMPORTED_MODULE_0___default.a); const mkdirp = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(mkdirp__WEBPACK_IMPORTED_MODULE_2___default.a); const unlink = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(fs__WEBPACK_IMPORTED_MODULE_1___default.a.unlink); const copyDirectory = Object(util__WEBPACK_IMPORTED_MODULE_5__["promisify"])(ncp__WEBPACK_IMPORTED_MODULE_3__["ncp"]); async function statTest(path, block) { try { return block((await lstat(path))); } catch (e) { if (e.code === 'ENOENT') { return false; } throw e; } } /** * Test if a path points to a symlink. * @param path */ async function isSymlink(path) { return await statTest(path, stats => stats.isSymbolicLink()); } /** * Test if a path points to a directory. * @param path */ async function isDirectory(path) { return await statTest(path, stats => stats.isDirectory()); } /** * Test if a path points to a regular file. * @param path */ async function isFile(path) { return await statTest(path, stats => stats.isFile()); } /** * Create a symlink at dest that points to src. Adapted from * https://github.com/lerna/lerna/blob/2f1b87d9e2295f587e4ac74269f714271d8ed428/src/FileSystemUtilities.js#L103. * * @param src * @param dest * @param type 'dir', 'file', 'junction', or 'exec'. 'exec' on * windows will use the `cmd-shim` module since symlinks can't be used * for executable files on windows. */ async function createSymlink(src, dest, type) { if (process.platform === 'win32') { if (type === 'exec') { await cmdShim(src, dest); } else { await forceCreate(src, dest, type); } } else { const posixType = type === 'exec' ? 'file' : type; const relativeSource = Object(path__WEBPACK_IMPORTED_MODULE_4__["relative"])(Object(path__WEBPACK_IMPORTED_MODULE_4__["dirname"])(dest), src); await forceCreate(relativeSource, dest, posixType); } } async function forceCreate(src, dest, type) { try { // If something exists at `dest` we need to remove it first. await unlink(dest); } catch (error) { if (error.code !== 'ENOENT') { throw error; } } await symlink(src, dest, type); } /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { // On windows, create a .cmd file. // Read the #! in the file to see what it uses. The vast majority // of the time, this will be either: // "#!/usr/bin/env " // or: // "#! " // // Write a binroot/pkg.bin + ".cmd" file that has this line in it: // @ %~dp0 %* module.exports = cmdShim cmdShim.ifExists = cmdShimIfExists var fs = __webpack_require__(22) var mkdir = __webpack_require__(31) , path = __webpack_require__(16) , shebangExpr = /^#\!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/ function cmdShimIfExists (from, to, cb) { fs.stat(from, function (er) { if (er) return cb() cmdShim(from, to, cb) }) } // Try to unlink, but ignore errors. // Any problems will surface later. function rm (path, cb) { fs.unlink(path, function(er) { cb() }) } function cmdShim (from, to, cb) { fs.stat(from, function (er, stat) { if (er) return cb(er) cmdShim_(from, to, cb) }) } function cmdShim_ (from, to, cb) { var then = times(2, next, cb) rm(to, then) rm(to + ".cmd", then) function next(er) { writeShim(from, to, cb) } } function writeShim (from, to, cb) { // make a cmd file and a sh script // First, check if the bin is a #! of some sort. // If not, then assume it's something that'll be compiled, or some other // sort of script, and just call it directly. mkdir(path.dirname(to), function (er) { if (er) return cb(er) fs.readFile(from, "utf8", function (er, data) { if (er) return writeShim_(from, to, null, null, cb) var firstLine = data.trim().split(/\r*\n/)[0] , shebang = firstLine.match(shebangExpr) if (!shebang) return writeShim_(from, to, null, null, cb) var prog = shebang[1] , args = shebang[2] || "" return writeShim_(from, to, prog, args, cb) }) }) } function writeShim_ (from, to, prog, args, cb) { var shTarget = path.relative(path.dirname(to), from) , target = shTarget.split("/").join("\\") , longProg , shProg = prog && prog.split("\\").join("/") , shLongProg shTarget = shTarget.split("\\").join("/") args = args || "" if (!prog) { prog = "\"%~dp0\\" + target + "\"" shProg = "\"$basedir/" + shTarget + "\"" args = "" target = "" shTarget = "" } else { longProg = "\"%~dp0\\" + prog + ".exe\"" shLongProg = "\"$basedir/" + prog + "\"" target = "\"%~dp0\\" + target + "\"" shTarget = "\"$basedir/" + shTarget + "\"" } // @IF EXIST "%~dp0\node.exe" ( // "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* // ) ELSE ( // SETLOCAL // SET PATHEXT=%PATHEXT:;.JS;=;% // node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* // ) var cmd if (longProg) { cmd = "@IF EXIST " + longProg + " (\r\n" + " " + longProg + " " + args + " " + target + " %*\r\n" + ") ELSE (\r\n" + " @SETLOCAL\r\n" + " @SET PATHEXT=%PATHEXT:;.JS;=;%\r\n" + " " + prog + " " + args + " " + target + " %*\r\n" + ")" } else { cmd = "@" + prog + " " + args + " " + target + " %*\r\n" } // #!/bin/sh // basedir=`dirname "$0"` // // case `uname` in // *CYGWIN*) basedir=`cygpath -w "$basedir"`;; // esac // // if [ -x "$basedir/node.exe" ]; then // "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@" // ret=$? // else // node "$basedir/node_modules/npm/bin/npm-cli.js" "$@" // ret=$? // fi // exit $ret var sh = "#!/bin/sh\n" if (shLongProg) { sh = sh + "basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n" + "\n" + "case `uname` in\n" + " *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;\n" + "esac\n" + "\n" sh = sh + "if [ -x "+shLongProg+" ]; then\n" + " " + shLongProg + " " + args + " " + shTarget + " \"$@\"\n" + " ret=$?\n" + "else \n" + " " + shProg + " " + args + " " + shTarget + " \"$@\"\n" + " ret=$?\n" + "fi\n" + "exit $ret\n" } else { sh = shProg + " " + args + " " + shTarget + " \"$@\"\n" + "exit $?\n" } var then = times(2, next, cb) fs.writeFile(to + ".cmd", cmd, "utf8", then) fs.writeFile(to, sh, "utf8", then) function next () { chmodShim(to, cb) } } function chmodShim (to, cb) { var then = times(2, cb, cb) fs.chmod(to, 0755, then) fs.chmod(to + ".cmd", 0755, then) } function times(n, ok, cb) { var errState = null return function(er) { if (!errState) { if (er) cb(errState = er) else if (--n === 0) ok() } } } /***/ }), /* 22 */ /***/ (function(module, exports, __webpack_require__) { var fs = __webpack_require__(23) var polyfills = __webpack_require__(24) var legacy = __webpack_require__(27) var queue = [] var util = __webpack_require__(29) function noop () {} var debug = noop if (util.debuglog) debug = util.debuglog('gfs4') else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) debug = function() { var m = util.format.apply(util, arguments) m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') console.error(m) } if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { process.on('exit', function() { debug(queue) __webpack_require__(30).equal(queue.length, 0) }) } module.exports = patch(__webpack_require__(25)) if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { module.exports = patch(fs) } // Always patch fs.close/closeSync, because we want to // retry() whenever a close happens *anywhere* in the program. // This is essential when multiple graceful-fs instances are // in play at the same time. module.exports.close = fs.close = (function (fs$close) { return function (fd, cb) { return fs$close.call(fs, fd, function (err) { if (!err) retry() if (typeof cb === 'function') cb.apply(this, arguments) }) }})(fs.close) module.exports.closeSync = fs.closeSync = (function (fs$closeSync) { return function (fd) { // Note that graceful-fs also retries when fs.closeSync() fails. // Looks like a bug to me, although it's probably a harmless one. var rval = fs$closeSync.apply(fs, arguments) retry() return rval }})(fs.closeSync) function patch (fs) { // Everything that references the open() function needs to be in here polyfills(fs) fs.gracefulify = patch fs.FileReadStream = ReadStream; // Legacy name. fs.FileWriteStream = WriteStream; // Legacy name. fs.createReadStream = createReadStream fs.createWriteStream = createWriteStream var fs$readFile = fs.readFile fs.readFile = readFile function readFile (path, options, cb) { if (typeof options === 'function') cb = options, options = null return go$readFile(path, options, cb) function go$readFile (path, options, cb) { return fs$readFile(path, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$readFile, [path, options, cb]]) else { if (typeof cb === 'function') cb.apply(this, arguments) retry() } }) } } var fs$writeFile = fs.writeFile fs.writeFile = writeFile function writeFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$writeFile(path, data, options, cb) function go$writeFile (path, data, options, cb) { return fs$writeFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$writeFile, [path, data, options, cb]]) else { if (typeof cb === 'function') cb.apply(this, arguments) retry() } }) } } var fs$appendFile = fs.appendFile if (fs$appendFile) fs.appendFile = appendFile function appendFile (path, data, options, cb) { if (typeof options === 'function') cb = options, options = null return go$appendFile(path, data, options, cb) function go$appendFile (path, data, options, cb) { return fs$appendFile(path, data, options, function (err) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$appendFile, [path, data, options, cb]]) else { if (typeof cb === 'function') cb.apply(this, arguments) retry() } }) } } var fs$readdir = fs.readdir fs.readdir = readdir function readdir (path, options, cb) { var args = [path] if (typeof options !== 'function') { args.push(options) } else { cb = options } args.push(go$readdir$cb) return go$readdir(args) function go$readdir$cb (err, files) { if (files && files.sort) files.sort() if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$readdir, [args]]) else { if (typeof cb === 'function') cb.apply(this, arguments) retry() } } } function go$readdir (args) { return fs$readdir.apply(fs, args) } if (process.version.substr(0, 4) === 'v0.8') { var legStreams = legacy(fs) ReadStream = legStreams.ReadStream WriteStream = legStreams.WriteStream } var fs$ReadStream = fs.ReadStream ReadStream.prototype = Object.create(fs$ReadStream.prototype) ReadStream.prototype.open = ReadStream$open var fs$WriteStream = fs.WriteStream WriteStream.prototype = Object.create(fs$WriteStream.prototype) WriteStream.prototype.open = WriteStream$open fs.ReadStream = ReadStream fs.WriteStream = WriteStream function ReadStream (path, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this else return ReadStream.apply(Object.create(ReadStream.prototype), arguments) } function ReadStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { if (that.autoClose) that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) that.read() } }) } function WriteStream (path, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this else return WriteStream.apply(Object.create(WriteStream.prototype), arguments) } function WriteStream$open () { var that = this open(that.path, that.flags, that.mode, function (err, fd) { if (err) { that.destroy() that.emit('error', err) } else { that.fd = fd that.emit('open', fd) } }) } function createReadStream (path, options) { return new ReadStream(path, options) } function createWriteStream (path, options) { return new WriteStream(path, options) } var fs$open = fs.open fs.open = open function open (path, flags, mode, cb) { if (typeof mode === 'function') cb = mode, mode = null return go$open(path, flags, mode, cb) function go$open (path, flags, mode, cb) { return fs$open(path, flags, mode, function (err, fd) { if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) enqueue([go$open, [path, flags, mode, cb]]) else { if (typeof cb === 'function') cb.apply(this, arguments) retry() } }) } } return fs } function enqueue (elem) { debug('ENQUEUE', elem[0].name, elem[1]) queue.push(elem) } function retry () { var elem = queue.shift() if (elem) { debug('RETRY', elem[0].name, elem[1]) elem[0].apply(null, elem[1]) } } /***/ }), /* 23 */ /***/ (function(module, exports) { module.exports = require("fs"); /***/ }), /* 24 */ /***/ (function(module, exports, __webpack_require__) { var fs = __webpack_require__(25) var constants = __webpack_require__(26) var origCwd = process.cwd var cwd = null var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform process.cwd = function() { if (!cwd) cwd = origCwd.call(process) return cwd } try { process.cwd() } catch (er) {} var chdir = process.chdir process.chdir = function(d) { cwd = null chdir.call(process, d) } module.exports = patch function patch (fs) { // (re-)implement some things that are known busted or missing. // lchmod, broken prior to 0.6.2 // back-port the fix here. if (constants.hasOwnProperty('O_SYMLINK') && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { patchLchmod(fs) } // lutimes implementation, or no-op if (!fs.lutimes) { patchLutimes(fs) } // https://github.com/isaacs/node-graceful-fs/issues/4 // Chown should not fail on einval or eperm if non-root. // It should not fail on enosys ever, as this just indicates // that a fs doesn't support the intended operation. fs.chown = chownFix(fs.chown) fs.fchown = chownFix(fs.fchown) fs.lchown = chownFix(fs.lchown) fs.chmod = chmodFix(fs.chmod) fs.fchmod = chmodFix(fs.fchmod) fs.lchmod = chmodFix(fs.lchmod) fs.chownSync = chownFixSync(fs.chownSync) fs.fchownSync = chownFixSync(fs.fchownSync) fs.lchownSync = chownFixSync(fs.lchownSync) fs.chmodSync = chmodFixSync(fs.chmodSync) fs.fchmodSync = chmodFixSync(fs.fchmodSync) fs.lchmodSync = chmodFixSync(fs.lchmodSync) fs.stat = statFix(fs.stat) fs.fstat = statFix(fs.fstat) fs.lstat = statFix(fs.lstat) fs.statSync = statFixSync(fs.statSync) fs.fstatSync = statFixSync(fs.fstatSync) fs.lstatSync = statFixSync(fs.lstatSync) // if lchmod/lchown do not exist, then make them no-ops if (!fs.lchmod) { fs.lchmod = function (path, mode, cb) { if (cb) process.nextTick(cb) } fs.lchmodSync = function () {} } if (!fs.lchown) { fs.lchown = function (path, uid, gid, cb) { if (cb) process.nextTick(cb) } fs.lchownSync = function () {} } // on Windows, A/V software can lock the directory, causing this // to fail with an EACCES or EPERM if the directory contains newly // created files. Try again on failure, for up to 60 seconds. // Set the timeout this long because some Windows Anti-Virus, such as Parity // bit9, may lock files for up to a minute, causing npm package install // failures. Also, take care to yield the scheduler. Windows scheduling gives // CPU to a busy looping process, which can cause the program causing the lock // contention to be starved of CPU by node, so the contention doesn't resolve. if (platform === "win32") { fs.rename = (function (fs$rename) { return function (from, to, cb) { var start = Date.now() var backoff = 0; fs$rename(from, to, function CB (er) { if (er && (er.code === "EACCES" || er.code === "EPERM") && Date.now() - start < 60000) { setTimeout(function() { fs.stat(to, function (stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else cb(er) }) }, backoff) if (backoff < 100) backoff += 10; return; } if (cb) cb(er) }) }})(fs.rename) } // if read() returns EAGAIN, then just try it again. fs.read = (function (fs$read) { return function (fd, buffer, offset, length, position, callback_) { var callback if (callback_ && typeof callback_ === 'function') { var eagCounter = 0 callback = function (er, _, __) { if (er && er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ return fs$read.call(fs, fd, buffer, offset, length, position, callback) } callback_.apply(this, arguments) } } return fs$read.call(fs, fd, buffer, offset, length, position, callback) }})(fs.read) fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { var eagCounter = 0 while (true) { try { return fs$readSync.call(fs, fd, buffer, offset, length, position) } catch (er) { if (er.code === 'EAGAIN' && eagCounter < 10) { eagCounter ++ continue } throw er } } }})(fs.readSync) } function patchLchmod (fs) { fs.lchmod = function (path, mode, callback) { fs.open( path , constants.O_WRONLY | constants.O_SYMLINK , mode , function (err, fd) { if (err) { if (callback) callback(err) return } // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. fs.fchmod(fd, mode, function (err) { fs.close(fd, function(err2) { if (callback) callback(err || err2) }) }) }) } fs.lchmodSync = function (path, mode) { var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. var threw = true var ret try { ret = fs.fchmodSync(fd, mode) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } function patchLutimes (fs) { if (constants.hasOwnProperty("O_SYMLINK")) { fs.lutimes = function (path, at, mt, cb) { fs.open(path, constants.O_SYMLINK, function (er, fd) { if (er) { if (cb) cb(er) return } fs.futimes(fd, at, mt, function (er) { fs.close(fd, function (er2) { if (cb) cb(er || er2) }) }) }) } fs.lutimesSync = function (path, at, mt) { var fd = fs.openSync(path, constants.O_SYMLINK) var ret var threw = true try { ret = fs.futimesSync(fd, at, mt) threw = false } finally { if (threw) { try { fs.closeSync(fd) } catch (er) {} } else { fs.closeSync(fd) } } return ret } } else { fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } fs.lutimesSync = function () {} } } function chmodFix (orig) { if (!orig) return orig return function (target, mode, cb) { return orig.call(fs, target, mode, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chmodFixSync (orig) { if (!orig) return orig return function (target, mode) { try { return orig.call(fs, target, mode) } catch (er) { if (!chownErOk(er)) throw er } } } function chownFix (orig) { if (!orig) return orig return function (target, uid, gid, cb) { return orig.call(fs, target, uid, gid, function (er) { if (chownErOk(er)) er = null if (cb) cb.apply(this, arguments) }) } } function chownFixSync (orig) { if (!orig) return orig return function (target, uid, gid) { try { return orig.call(fs, target, uid, gid) } catch (er) { if (!chownErOk(er)) throw er } } } function statFix (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target, cb) { return orig.call(fs, target, function (er, stats) { if (!stats) return cb.apply(this, arguments) if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 if (cb) cb.apply(this, arguments) }) } } function statFixSync (orig) { if (!orig) return orig // Older versions of Node erroneously returned signed integers for // uid + gid. return function (target) { var stats = orig.call(fs, target) if (stats.uid < 0) stats.uid += 0x100000000 if (stats.gid < 0) stats.gid += 0x100000000 return stats; } } // ENOSYS means that the fs doesn't support the op. Just ignore // that, because it doesn't matter. // // if there's no getuid, or if getuid() is something other // than 0, and the error is EINVAL or EPERM, then just ignore // it. // // This specific case is a silent failure in cp, install, tar, // and most other unix tools that manage permissions. // // When running as root, or if other types of errors are // encountered, then it's strict. function chownErOk (er) { if (!er) return true if (er.code === "ENOSYS") return true var nonroot = !process.getuid || process.getuid() !== 0 if (nonroot) { if (er.code === "EINVAL" || er.code === "EPERM") return true } return false } /***/ }), /* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fs = __webpack_require__(23) module.exports = clone(fs) function clone (obj) { if (obj === null || typeof obj !== 'object') return obj if (obj instanceof Object) var copy = { __proto__: obj.__proto__ } else var copy = Object.create(null) Object.getOwnPropertyNames(obj).forEach(function (key) { Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) }) return copy } /***/ }), /* 26 */ /***/ (function(module, exports) { module.exports = require("constants"); /***/ }), /* 27 */ /***/ (function(module, exports, __webpack_require__) { var Stream = __webpack_require__(28).Stream module.exports = legacy function legacy (fs) { return { ReadStream: ReadStream, WriteStream: WriteStream } function ReadStream (path, options) { if (!(this instanceof ReadStream)) return new ReadStream(path, options); Stream.call(this); var self = this; this.path = path; this.fd = null; this.readable = true; this.paused = false; this.flags = 'r'; this.mode = 438; /*=0666*/ this.bufferSize = 64 * 1024; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.encoding) this.setEncoding(this.encoding); if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.end === undefined) { this.end = Infinity; } else if ('number' !== typeof this.end) { throw TypeError('end must be a Number'); } if (this.start > this.end) { throw new Error('start must be <= end'); } this.pos = this.start; } if (this.fd !== null) { process.nextTick(function() { self._read(); }); return; } fs.open(this.path, this.flags, this.mode, function (err, fd) { if (err) { self.emit('error', err); self.readable = false; return; } self.fd = fd; self.emit('open', fd); self._read(); }) } function WriteStream (path, options) { if (!(this instanceof WriteStream)) return new WriteStream(path, options); Stream.call(this); this.path = path; this.fd = null; this.writable = true; this.flags = 'w'; this.encoding = 'binary'; this.mode = 438; /*=0666*/ this.bytesWritten = 0; options = options || {}; // Mixin options into this var keys = Object.keys(options); for (var index = 0, length = keys.length; index < length; index++) { var key = keys[index]; this[key] = options[key]; } if (this.start !== undefined) { if ('number' !== typeof this.start) { throw TypeError('start must be a Number'); } if (this.start < 0) { throw new Error('start must be >= zero'); } this.pos = this.start; } this.busy = false; this._queue = []; if (this.fd === null) { this._open = fs.open; this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); this.flush(); } } } /***/ }), /* 28 */ /***/ (function(module, exports) { module.exports = require("stream"); /***/ }), /* 29 */ /***/ (function(module, exports) { module.exports = require("util"); /***/ }), /* 30 */ /***/ (function(module, exports) { module.exports = require("assert"); /***/ }), /* 31 */ /***/ (function(module, exports, __webpack_require__) { var path = __webpack_require__(16); var fs = __webpack_require__(23); var _0777 = parseInt('0777', 8); module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; function mkdirP (p, opts, f, made) { if (typeof opts === 'function') { f = opts; opts = {}; } else if (!opts || typeof opts !== 'object') { opts = { mode: opts }; } var mode = opts.mode; var xfs = opts.fs || fs; if (mode === undefined) { mode = _0777 & (~process.umask()); } if (!made) made = null; var cb = f || function () {}; p = path.resolve(p); xfs.mkdir(p, mode, function (er) { if (!er) { made = made || p; return cb(null, made); } switch (er.code) { case 'ENOENT': mkdirP(path.dirname(p), opts, function (er, made) { if (er) cb(er, made); else mkdirP(p, opts, cb, made); }); break; // In the case of any other error, just see if there's a dir // there already. If so, then hooray! If not, then something // is borked. default: xfs.stat(p, function (er2, stat) { // if the stat fails, then that's super weird. // let the original error be the failure reason. if (er2 || !stat.isDirectory()) cb(er, made) else cb(null, made); }); break; } }); } mkdirP.sync = function sync (p, opts, made) { if (!opts || typeof opts !== 'object') { opts = { mode: opts }; } var mode = opts.mode; var xfs = opts.fs || fs; if (mode === undefined) { mode = _0777 & (~process.umask()); } if (!made) made = null; p = path.resolve(p); try { xfs.mkdirSync(p, mode); made = made || p; } catch (err0) { switch (err0.code) { case 'ENOENT' : made = sync(path.dirname(p), opts, made); sync(p, opts, made); break; // In the case of any other error, just see if there's a dir // there already. If so, then hooray! If not, then something // is borked. default: var stat; try { stat = xfs.statSync(p); } catch (err1) { throw err0; } if (!stat.isDirectory()) throw err0; break; } } return made; }; /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { var fs = __webpack_require__(23), path = __webpack_require__(16); module.exports = ncp; ncp.ncp = ncp; function ncp (source, dest, options, callback) { var cback = callback; if (!callback) { cback = options; options = {}; } var basePath = process.cwd(), currentPath = path.resolve(basePath, source), targetPath = path.resolve(basePath, dest), filter = options.filter, rename = options.rename, transform = options.transform, clobber = options.clobber !== false, modified = options.modified, dereference = options.dereference, errs = null, started = 0, finished = 0, running = 0, limit = options.limit || ncp.limit || 16; limit = (limit < 1) ? 1 : (limit > 512) ? 512 : limit; startCopy(currentPath); function startCopy(source) { started++; if (filter) { if (filter instanceof RegExp) { if (!filter.test(source)) { return cb(true); } } else if (typeof filter === 'function') { if (!filter(source)) { return cb(true); } } } return getStats(source); } function getStats(source) { var stat = dereference ? fs.stat : fs.lstat; if (running >= limit) { return setImmediate(function () { getStats(source); }); } running++; stat(source, function (err, stats) { var item = {}; if (err) { return onError(err); } // We need to get the mode from the stats object and preserve it. item.name = source; item.mode = stats.mode; item.mtime = stats.mtime; //modified time item.atime = stats.atime; //access time if (stats.isDirectory()) { return onDir(item); } else if (stats.isFile()) { return onFile(item); } else if (stats.isSymbolicLink()) { // Symlinks don't really need to know about the mode. return onLink(source); } }); } function onFile(file) { var target = file.name.replace(currentPath, targetPath); if(rename) { target = rename(target); } isWritable(target, function (writable) { if (writable) { return copyFile(file, target); } if(clobber) { rmFile(target, function () { copyFile(file, target); }); } if (modified) { var stat = dereference ? fs.stat : fs.lstat; stat(target, function(err, stats) { //if souce modified time greater to target modified time copy file if (file.mtime.getTime()>stats.mtime.getTime()) copyFile(file, target); else return cb(); }); } else { return cb(); } }); } function copyFile(file, target) { var readStream = fs.createReadStream(file.name), writeStream = fs.createWriteStream(target, { mode: file.mode }); readStream.on('error', onError); writeStream.on('error', onError); if(transform) { transform(readStream, writeStream, file); } else { writeStream.on('open', function() { readStream.pipe(writeStream); }); } writeStream.once('finish', function() { if (modified) { //target file modified date sync. fs.utimesSync(target, file.atime, file.mtime); cb(); } else cb(); }); } function rmFile(file, done) { fs.unlink(file, function (err) { if (err) { return onError(err); } return done(); }); } function onDir(dir) { var target = dir.name.replace(currentPath, targetPath); isWritable(target, function (writable) { if (writable) { return mkDir(dir, target); } copyDir(dir.name); }); } function mkDir(dir, target) { fs.mkdir(target, dir.mode, function (err) { if (err) { return onError(err); } copyDir(dir.name); }); } function copyDir(dir) { fs.readdir(dir, function (err, items) { if (err) { return onError(err); } items.forEach(function (item) { startCopy(path.join(dir, item)); }); return cb(); }); } function onLink(link) { var target = link.replace(currentPath, targetPath); fs.readlink(link, function (err, resolvedPath) { if (err) { return onError(err); } checkLink(resolvedPath, target); }); } function checkLink(resolvedPath, target) { if (dereference) { resolvedPath = path.resolve(basePath, resolvedPath); } isWritable(target, function (writable) { if (writable) { return makeLink(resolvedPath, target); } fs.readlink(target, function (err, targetDest) { if (err) { return onError(err); } if (dereference) { targetDest = path.resolve(basePath, targetDest); } if (targetDest === resolvedPath) { return cb(); } return rmFile(target, function () { makeLink(resolvedPath, target); }); }); }); } function makeLink(linkPath, target) { fs.symlink(linkPath, target, function (err) { if (err) { return onError(err); } return cb(); }); } function isWritable(path, done) { fs.lstat(path, function (err) { if (err) { if (err.code === 'ENOENT') return done(true); return done(false); } return done(false); }); } function onError(err) { if (options.stopOnError) { return cback(err); } else if (!errs && options.errs) { errs = fs.createWriteStream(options.errs); } else if (!errs) { errs = []; } if (typeof errs.write === 'undefined') { errs.push(err); } else { errs.write(err.stack + '\n\n'); } return cb(); } function cb(skipped) { if (!skipped) running--; finished++; if ((started === finished) && (running === 0)) { if (cback !== undefined ) { return errs ? cback(errs) : cback(null); } } } } /***/ }), /* 33 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "log", function() { return log; }); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ const log = { /** * Log something to the console. Ideally we would use a real logger in * kbn-pm, but that's a pretty big change for now. * @param ...args */ write(...args) { // eslint-disable-next-line no-console console.log(...args); } }; /***/ }), /* 34 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parallelizeBatches", function() { return parallelizeBatches; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parallelize", function() { return parallelize; }); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ async function parallelizeBatches(batches, fn) { for (const batch of batches) { // We need to make sure the entire batch has completed before we can move on // to the next batch await parallelize(batch, fn); } } async function parallelize(items, fn, concurrency = 4) { if (items.length === 0) { return; } return new Promise((resolve, reject) => { let activePromises = 0; const values = items.slice(0); async function scheduleItem(item) { activePromises++; try { await fn(item); activePromises--; if (values.length > 0) { // We have more work to do, so we schedule the next promise scheduleItem(values.shift()); } else if (activePromises === 0) { // We have no more values left, and all items have completed, so we've // completed all the work. resolve(); } } catch (error) { reject(error); } } values.splice(0, concurrency).map(scheduleItem); }); } /***/ }), /* 35 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getProjects", function() { return getProjects; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildProjectGraph", function() { return buildProjectGraph; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "topologicallyBatchProjects", function() { return topologicallyBatchProjects; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "includeTransitiveProjects", function() { return includeTransitiveProjects; }); /* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36); /* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(glob__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29); /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(52); /* harmony import */ var _project__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53); /* harmony import */ var _workspaces__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(134); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ const glob = Object(util__WEBPACK_IMPORTED_MODULE_2__["promisify"])(glob__WEBPACK_IMPORTED_MODULE_0___default.a); async function getProjects(rootPath, projectsPathsPatterns, { include = [], exclude = [] } = {}) { const projects = new Map(); const workspaceProjectsPaths = await Object(_workspaces__WEBPACK_IMPORTED_MODULE_5__["workspacePackagePaths"])(rootPath); for (const pattern of projectsPathsPatterns) { const pathsToProcess = await packagesFromGlobPattern({ pattern, rootPath }); for (const filePath of pathsToProcess) { const projectConfigPath = normalize(filePath); const projectDir = path__WEBPACK_IMPORTED_MODULE_1___default.a.dirname(projectConfigPath); const project = await _project__WEBPACK_IMPORTED_MODULE_4__["Project"].fromPath(projectDir); if (workspaceProjectsPaths.indexOf(filePath) >= 0) { project.isWorkspaceProject = true; } const excludeProject = exclude.includes(project.name) || include.length > 0 && !include.includes(project.name); if (excludeProject) { continue; } if (projects.has(project.name)) { throw new _errors__WEBPACK_IMPORTED_MODULE_3__["CliError"](`There are multiple projects with the same name [${project.name}]`, { name: project.name, paths: [project.path, projects.get(project.name).path] }); } projects.set(project.name, project); } } return projects; } function packagesFromGlobPattern({ pattern, rootPath }) { const globOptions = { cwd: rootPath, // Should throw in case of unusual errors when reading the file system strict: true, // Always returns absolute paths for matched files absolute: true, // Do not match ** against multiple filenames // (This is only specified because we currently don't have a need for it.) noglobstar: true }; return glob(path__WEBPACK_IMPORTED_MODULE_1___default.a.join(pattern, 'package.json'), globOptions); } // https://github.com/isaacs/node-glob/blob/master/common.js#L104 // glob always returns "\\" as "/" in windows, so everyone // gets normalized because we can't have nice things. function normalize(dir) { return path__WEBPACK_IMPORTED_MODULE_1___default.a.normalize(dir); } function buildProjectGraph(projects) { const projectGraph = new Map(); for (const project of projects.values()) { const projectDeps = []; const dependencies = project.allDependencies; for (const depName of Object.keys(dependencies)) { if (projects.has(depName)) { const dep = projects.get(depName); const dependentProjectIsInWorkspace = project.isWorkspaceProject || project.json.name === 'kibana'; project.ensureValidProjectDependency(dep, dependentProjectIsInWorkspace); projectDeps.push(dep); } } projectGraph.set(project.name, projectDeps); } return projectGraph; } function topologicallyBatchProjects(projectsToBatch, projectGraph, { batchByWorkspace = false } = {}) { // We're going to be chopping stuff out of this list, so copy it. const projectsLeftToBatch = new Set(projectsToBatch.keys()); const batches = []; if (batchByWorkspace) { const workspaceRootProject = Array.from(projectsToBatch.values()).find(p => p.isWorkspaceRoot); if (!workspaceRootProject) { throw new _errors__WEBPACK_IMPORTED_MODULE_3__["CliError"](`There was no yarn workspace root found.`); } // Push in the workspace root first. batches.push([workspaceRootProject]); projectsLeftToBatch.delete(workspaceRootProject.name); // In the next batch, push in all workspace projects. const workspaceBatch = []; for (const projectName of projectsLeftToBatch) { const project = projectsToBatch.get(projectName); if (project.isWorkspaceProject) { workspaceBatch.push(project); projectsLeftToBatch.delete(projectName); } } batches.push(workspaceBatch); } while (projectsLeftToBatch.size > 0) { // Get all projects that have no remaining dependencies within the repo // that haven't yet been picked. const batch = []; for (const projectName of projectsLeftToBatch) { const projectDeps = projectGraph.get(projectName); const needsDependenciesBatched = projectDeps.some(dep => projectsLeftToBatch.has(dep.name)); if (!needsDependenciesBatched) { batch.push(projectsToBatch.get(projectName)); } } // If we weren't able to find a project with no remaining dependencies, // then we've encountered a cycle in the dependency graph. const hasCycles = batch.length === 0; if (hasCycles) { const cycleProjectNames = [...projectsLeftToBatch]; const message = 'Encountered a cycle in the dependency graph. Projects in cycle are:\n' + cycleProjectNames.join(', '); throw new _errors__WEBPACK_IMPORTED_MODULE_3__["CliError"](message); } batches.push(batch); batch.forEach(project => projectsLeftToBatch.delete(project.name)); } return batches; } function includeTransitiveProjects(subsetOfProjects, allProjects, { onlyProductionDependencies = false } = {}) { const dependentProjects = new Map(); // the current list of packages we are expanding using breadth-first-search const toProcess = [...subsetOfProjects]; while (toProcess.length > 0) { const project = toProcess.shift(); const dependencies = onlyProductionDependencies ? project.productionDependencies : project.allDependencies; Object.keys(dependencies).forEach(dep => { if (allProjects.has(dep)) { toProcess.push(allProjects.get(dep)); } }); dependentProjects.set(project.name, project); } return dependentProjects; } /***/ }), /* 36 */ /***/ (function(module, exports, __webpack_require__) { // Approach: // // 1. Get the minimatch set // 2. For each pattern in the set, PROCESS(pattern, false) // 3. Store matches per-set, then uniq them // // PROCESS(pattern, inGlobStar) // Get the first [n] items from pattern that are all strings // Join these together. This is PREFIX. // If there is no more remaining, then stat(PREFIX) and // add to matches if it succeeds. END. // // If inGlobStar and PREFIX is symlink and points to dir // set ENTRIES = [] // else readdir(PREFIX) as ENTRIES // If fail, END // // with ENTRIES // If pattern[n] is GLOBSTAR // // handle the case where the globstar match is empty // // by pruning it out, and testing the resulting pattern // PROCESS(pattern[0..n] + pattern[n+1 .. $], false) // // handle other cases. // for ENTRY in ENTRIES (not dotfiles) // // attach globstar + tail onto the entry // // Mark that this entry is a globstar match // PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) // // else // not globstar // for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) // Test ENTRY against pattern[n] // If fails, continue // If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) // // Caveat: // Cache all stats and readdirs results to minimize syscall. Since all // we ever care about is existence and directory-ness, we can just keep // `true` for files, and [children,...] for directories, or `false` for // things that don't exist. module.exports = glob var fs = __webpack_require__(23) var rp = __webpack_require__(37) var minimatch = __webpack_require__(39) var Minimatch = minimatch.Minimatch var inherits = __webpack_require__(43) var EE = __webpack_require__(45).EventEmitter var path = __webpack_require__(16) var assert = __webpack_require__(30) var isAbsolute = __webpack_require__(46) var globSync = __webpack_require__(47) var common = __webpack_require__(48) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp var inflight = __webpack_require__(49) var util = __webpack_require__(29) var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored var once = __webpack_require__(51) function glob (pattern, options, cb) { if (typeof options === 'function') cb = options, options = {} if (!options) options = {} if (options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return globSync(pattern, options) } return new Glob(pattern, options, cb) } glob.sync = globSync var GlobSync = glob.GlobSync = globSync.GlobSync // old api surface glob.glob = glob function extend (origin, add) { if (add === null || typeof add !== 'object') { return origin } var keys = Object.keys(add) var i = keys.length while (i--) { origin[keys[i]] = add[keys[i]] } return origin } glob.hasMagic = function (pattern, options_) { var options = extend({}, options_) options.noprocess = true var g = new Glob(pattern, options) var set = g.minimatch.set if (!pattern) return false if (set.length > 1) return true for (var j = 0; j < set[0].length; j++) { if (typeof set[0][j] !== 'string') return true } return false } glob.Glob = Glob inherits(Glob, EE) function Glob (pattern, options, cb) { if (typeof options === 'function') { cb = options options = null } if (options && options.sync) { if (cb) throw new TypeError('callback provided to sync glob') return new GlobSync(pattern, options) } if (!(this instanceof Glob)) return new Glob(pattern, options, cb) setopts(this, pattern, options) this._didRealPath = false // process each pattern in the minimatch set var n = this.minimatch.set.length // The matches are stored as {: true,...} so that // duplicates are automagically pruned. // Later, we do an Object.keys() on these. // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) if (typeof cb === 'function') { cb = once(cb) this.on('error', cb) this.on('end', function (matches) { cb(null, matches) }) } var self = this this._processing = 0 this._emitQueue = [] this._processQueue = [] this.paused = false if (this.noprocess) return this if (n === 0) return done() var sync = true for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false, done) } sync = false function done () { --self._processing if (self._processing <= 0) { if (sync) { process.nextTick(function () { self._finish() }) } else { self._finish() } } } } Glob.prototype._finish = function () { assert(this instanceof Glob) if (this.aborted) return if (this.realpath && !this._didRealpath) return this._realpath() common.finish(this) this.emit('end', this.found) } Glob.prototype._realpath = function () { if (this._didRealpath) return this._didRealpath = true var n = this.matches.length if (n === 0) return this._finish() var self = this for (var i = 0; i < this.matches.length; i++) this._realpathSet(i, next) function next () { if (--n === 0) self._finish() } } Glob.prototype._realpathSet = function (index, cb) { var matchset = this.matches[index] if (!matchset) return cb() var found = Object.keys(matchset) var self = this var n = found.length if (n === 0) return cb() var set = this.matches[index] = Object.create(null) found.forEach(function (p, i) { // If there's a problem with the stat, then it means that // one or more of the links in the realpath couldn't be // resolved. just return the abs value in that case. p = self._makeAbs(p) rp.realpath(p, self.realpathCache, function (er, real) { if (!er) set[real] = true else if (er.syscall === 'stat') set[p] = true else self.emit('error', er) // srsly wtf right here if (--n === 0) { self.matches[index] = set cb() } }) }) } Glob.prototype._mark = function (p) { return common.mark(this, p) } Glob.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } Glob.prototype.abort = function () { this.aborted = true this.emit('abort') } Glob.prototype.pause = function () { if (!this.paused) { this.paused = true this.emit('pause') } } Glob.prototype.resume = function () { if (this.paused) { this.emit('resume') this.paused = false if (this._emitQueue.length) { var eq = this._emitQueue.slice(0) this._emitQueue.length = 0 for (var i = 0; i < eq.length; i ++) { var e = eq[i] this._emitMatch(e[0], e[1]) } } if (this._processQueue.length) { var pq = this._processQueue.slice(0) this._processQueue.length = 0 for (var i = 0; i < pq.length; i ++) { var p = pq[i] this._processing-- this._process(p[0], p[1], p[2], p[3]) } } } } Glob.prototype._process = function (pattern, index, inGlobStar, cb) { assert(this instanceof Glob) assert(typeof cb === 'function') if (this.aborted) return this._processing++ if (this.paused) { this._processQueue.push([pattern, index, inGlobStar, cb]) return } //console.error('PROCESS %d', this._processing, pattern) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // see if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index, cb) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip _processing if (childrenIgnored(this, read)) return cb() var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) } Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { // if the abs isn't a dir, then nothing can match! if (!entries) return cb() // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return cb() // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return cb() } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) { if (prefix !== '/') e = prefix + '/' + e else e = prefix + e } this._process([e].concat(remain), index, inGlobStar, cb) } cb() } Glob.prototype._emitMatch = function (index, e) { if (this.aborted) return if (isIgnored(this, e)) return if (this.paused) { this._emitQueue.push([index, e]) return } var abs = isAbsolute(e) ? e : this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) e = abs if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true var st = this.statCache[abs] if (st) this.emit('stat', e, st) this.emit('match', e) } Glob.prototype._readdirInGlobStar = function (abs, cb) { if (this.aborted) return // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false, cb) var lstatkey = 'lstat\0' + abs var self = this var lstatcb = inflight(lstatkey, lstatcb_) if (lstatcb) fs.lstat(abs, lstatcb) function lstatcb_ (er, lstat) { if (er && er.code === 'ENOENT') return cb() var isSym = lstat && lstat.isSymbolicLink() self.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) { self.cache[abs] = 'FILE' cb() } else self._readdir(abs, false, cb) } } Glob.prototype._readdir = function (abs, inGlobStar, cb) { if (this.aborted) return cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) if (!cb) return //console.error('RD %j %j', +inGlobStar, abs) if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs, cb) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return cb() if (Array.isArray(c)) return cb(null, c) } var self = this fs.readdir(abs, readdirCb(this, abs, cb)) } function readdirCb (self, abs, cb) { return function (er, entries) { if (er) self._readdirError(abs, er, cb) else self._readdirEntries(abs, entries, cb) } } Glob.prototype._readdirEntries = function (abs, entries, cb) { if (this.aborted) return // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries return cb(null, entries) } Glob.prototype._readdirError = function (f, er, cb) { if (this.aborted) return // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code this.emit('error', error) this.abort() } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) { this.emit('error', er) // If the error is handled, then we abort // if not, we threw out of here this.abort() } if (!this.silent) console.error('glob error', er) break } return cb() } Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { var self = this this._readdir(abs, inGlobStar, function (er, entries) { self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) }) } Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { //console.error('pgs2', prefix, remain[0], entries) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return cb() // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false, cb) var isSym = this.symlinks[abs] var len = entries.length // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return cb() for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true, cb) var below = gspref.concat(entries[i], remain) this._process(below, index, true, cb) } cb() } Glob.prototype._processSimple = function (prefix, index, cb) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var self = this this._stat(prefix, function (er, exists) { self._processSimple2(prefix, index, er, exists, cb) }) } Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { //console.error('ps2', prefix, exists) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return cb() if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) cb() } // Returns either 'DIR', 'FILE', or false Glob.prototype._stat = function (f, cb) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return cb() if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return cb(null, c) if (needDir && c === 'FILE') return cb() // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (stat !== undefined) { if (stat === false) return cb(null, stat) else { var type = stat.isDirectory() ? 'DIR' : 'FILE' if (needDir && type === 'FILE') return cb() else return cb(null, type, stat) } } var self = this var statcb = inflight('stat\0' + abs, lstatcb_) if (statcb) fs.lstat(abs, statcb) function lstatcb_ (er, lstat) { if (lstat && lstat.isSymbolicLink()) { // If it's a symlink, then treat it as the target, unless // the target does not exist, then treat it as a file. return fs.stat(abs, function (er, stat) { if (er) self._stat2(f, abs, null, lstat, cb) else self._stat2(f, abs, er, stat, cb) }) } else { self._stat2(f, abs, er, lstat, cb) } } } Glob.prototype._stat2 = function (f, abs, er, stat, cb) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return cb() } var needDir = f.slice(-1) === '/' this.statCache[abs] = stat if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) return cb(null, false, stat) var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return cb() return cb(null, c, stat) } /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { module.exports = realpath realpath.realpath = realpath realpath.sync = realpathSync realpath.realpathSync = realpathSync realpath.monkeypatch = monkeypatch realpath.unmonkeypatch = unmonkeypatch var fs = __webpack_require__(23) var origRealpath = fs.realpath var origRealpathSync = fs.realpathSync var version = process.version var ok = /^v[0-5]\./.test(version) var old = __webpack_require__(38) function newError (er) { return er && er.syscall === 'realpath' && ( er.code === 'ELOOP' || er.code === 'ENOMEM' || er.code === 'ENAMETOOLONG' ) } function realpath (p, cache, cb) { if (ok) { return origRealpath(p, cache, cb) } if (typeof cache === 'function') { cb = cache cache = null } origRealpath(p, cache, function (er, result) { if (newError(er)) { old.realpath(p, cache, cb) } else { cb(er, result) } }) } function realpathSync (p, cache) { if (ok) { return origRealpathSync(p, cache) } try { return origRealpathSync(p, cache) } catch (er) { if (newError(er)) { return old.realpathSync(p, cache) } else { throw er } } } function monkeypatch () { fs.realpath = realpath fs.realpathSync = realpathSync } function unmonkeypatch () { fs.realpath = origRealpath fs.realpathSync = origRealpathSync } /***/ }), /* 38 */ /***/ (function(module, exports, __webpack_require__) { // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var pathModule = __webpack_require__(16); var isWindows = process.platform === 'win32'; var fs = __webpack_require__(23); // JavaScript implementation of realpath, ported from node pre-v6 var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); function rethrow() { // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and // is fairly slow to generate. var callback; if (DEBUG) { var backtrace = new Error; callback = debugCallback; } else callback = missingCallback; return callback; function debugCallback(err) { if (err) { backtrace.message = err.message; err = backtrace; missingCallback(err); } } function missingCallback(err) { if (err) { if (process.throwDeprecation) throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs else if (!process.noDeprecation) { var msg = 'fs: missing callback ' + (err.stack || err.message); if (process.traceDeprecation) console.trace(msg); else console.error(msg); } } } } function maybeCallback(cb) { return typeof cb === 'function' ? cb : rethrow(); } var normalize = pathModule.normalize; // Regexp that finds the next partion of a (partial) path // result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] if (isWindows) { var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; } else { var nextPartRe = /(.*?)(?:[\/]+|$)/g; } // Regex to find the device root, including trailing slash. E.g. 'c:\\'. if (isWindows) { var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; } else { var splitRootRe = /^[\/]*/; } exports.realpathSync = function realpathSync(p, cache) { // make p is absolute p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return cache[p]; } var original = p, seenLinks = {}, knownHard = {}; // current character position in p var pos; // the partial path so far, including a trailing slash if any var current; // the partial path without a trailing slash (except when pointing at a root) var base; // the partial path scanned in the previous round, with slash var previous; start(); function start() { // Skip over roots var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ''; // On windows, check that the root exists. On unix there is no need. if (isWindows && !knownHard[base]) { fs.lstatSync(base); knownHard[base] = true; } } // walk down the path, swapping out linked pathparts for their real // values // NB: p.length changes. while (pos < p.length) { // find the next part nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; // continue if not a symlink if (knownHard[base] || (cache && cache[base] === base)) { continue; } var resolvedLink; if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { // some known symbolic link. no need to stat again. resolvedLink = cache[base]; } else { var stat = fs.lstatSync(base); if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; continue; } // read the link if it wasn't read before // dev/ino always return 0 on windows, so skip the check. var linkTarget = null; if (!isWindows) { var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { linkTarget = seenLinks[id]; } } if (linkTarget === null) { fs.statSync(base); linkTarget = fs.readlinkSync(base); } resolvedLink = pathModule.resolve(previous, linkTarget); // track this, if given a cache. if (cache) cache[base] = resolvedLink; if (!isWindows) seenLinks[id] = linkTarget; } // resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } if (cache) cache[original] = p; return p; }; exports.realpath = function realpath(p, cache, cb) { if (typeof cb !== 'function') { cb = maybeCallback(cache); cache = null; } // make p is absolute p = pathModule.resolve(p); if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { return process.nextTick(cb.bind(null, null, cache[p])); } var original = p, seenLinks = {}, knownHard = {}; // current character position in p var pos; // the partial path so far, including a trailing slash if any var current; // the partial path without a trailing slash (except when pointing at a root) var base; // the partial path scanned in the previous round, with slash var previous; start(); function start() { // Skip over roots var m = splitRootRe.exec(p); pos = m[0].length; current = m[0]; base = m[0]; previous = ''; // On windows, check that the root exists. On unix there is no need. if (isWindows && !knownHard[base]) { fs.lstat(base, function(err) { if (err) return cb(err); knownHard[base] = true; LOOP(); }); } else { process.nextTick(LOOP); } } // walk down the path, swapping out linked pathparts for their real // values function LOOP() { // stop if scanned past end of path if (pos >= p.length) { if (cache) cache[original] = p; return cb(null, p); } // find the next part nextPartRe.lastIndex = pos; var result = nextPartRe.exec(p); previous = current; current += result[0]; base = previous + result[1]; pos = nextPartRe.lastIndex; // continue if not a symlink if (knownHard[base] || (cache && cache[base] === base)) { return process.nextTick(LOOP); } if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { // known symbolic link. no need to stat again. return gotResolvedLink(cache[base]); } return fs.lstat(base, gotStat); } function gotStat(err, stat) { if (err) return cb(err); // if not a symlink, skip to the next path part if (!stat.isSymbolicLink()) { knownHard[base] = true; if (cache) cache[base] = base; return process.nextTick(LOOP); } // stat & read the link if not read before // call gotTarget as soon as the link target is known // dev/ino always return 0 on windows, so skip the check. if (!isWindows) { var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); if (seenLinks.hasOwnProperty(id)) { return gotTarget(null, seenLinks[id], base); } } fs.stat(base, function(err) { if (err) return cb(err); fs.readlink(base, function(err, target) { if (!isWindows) seenLinks[id] = target; gotTarget(err, target); }); }); } function gotTarget(err, target, base) { if (err) return cb(err); var resolvedLink = pathModule.resolve(previous, target); if (cache) cache[base] = resolvedLink; gotResolvedLink(resolvedLink); } function gotResolvedLink(resolvedLink) { // resolve the link, then start over p = pathModule.resolve(resolvedLink, p.slice(pos)); start(); } }; /***/ }), /* 39 */ /***/ (function(module, exports, __webpack_require__) { module.exports = minimatch minimatch.Minimatch = Minimatch var path = { sep: '/' } try { path = __webpack_require__(16) } catch (er) {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = __webpack_require__(40) var plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, '?': { open: '(?:', close: ')?' }, '+': { open: '(?:', close: ')+' }, '*': { open: '(?:', close: ')*' }, '@': { open: '(?:', close: ')' } } // any single thing other than / // don't need to escape / when using new RegExp() var qmark = '[^/]' // * => any number of characters var star = qmark + '*?' // ** when dots are allowed. Anything goes, except .. and . // not (^ or / followed by one or two dots followed by $ or /), // followed by anything, any number of times. var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' // not a ^ or / followed by a dot, // followed by anything, any number of times. var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' // characters that need to be escaped in RegExp. var reSpecials = charSet('().*{}+?[]^$\\!') // "abc" -> { a:true, b:true, c:true } function charSet (s) { return s.split('').reduce(function (set, c) { set[c] = true return set }, {}) } // normalizes slashes. var slashSplit = /\/+/ minimatch.filter = filter function filter (pattern, options) { options = options || {} return function (p, i, list) { return minimatch(p, pattern, options) } } function ext (a, b) { a = a || {} b = b || {} var t = {} Object.keys(b).forEach(function (k) { t[k] = b[k] }) Object.keys(a).forEach(function (k) { t[k] = a[k] }) return t } minimatch.defaults = function (def) { if (!def || !Object.keys(def).length) return minimatch var orig = minimatch var m = function minimatch (p, pattern, options) { return orig.minimatch(p, pattern, ext(def, options)) } m.Minimatch = function Minimatch (pattern, options) { return new orig.Minimatch(pattern, ext(def, options)) } return m } Minimatch.defaults = function (def) { if (!def || !Object.keys(def).length) return Minimatch return minimatch.defaults(def).Minimatch } function minimatch (p, pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('glob pattern string required') } if (!options) options = {} // shortcut: comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { return false } // "" only matches "" if (pattern.trim() === '') return p === '' return new Minimatch(pattern, options).match(p) } function Minimatch (pattern, options) { if (!(this instanceof Minimatch)) { return new Minimatch(pattern, options) } if (typeof pattern !== 'string') { throw new TypeError('glob pattern string required') } if (!options) options = {} pattern = pattern.trim() // windows support: need to use /, not \ if (path.sep !== '/') { pattern = pattern.split(path.sep).join('/') } this.options = options this.set = [] this.pattern = pattern this.regexp = null this.negate = false this.comment = false this.empty = false // make the set of regexps etc. this.make() } Minimatch.prototype.debug = function () {} Minimatch.prototype.make = make function make () { // don't do it more than once. if (this._made) return var pattern = this.pattern var options = this.options // empty patterns and comments match nothing. if (!options.nocomment && pattern.charAt(0) === '#') { this.comment = true return } if (!pattern) { this.empty = true return } // step 1: figure out negation, etc. this.parseNegate() // step 2: expand braces var set = this.globSet = this.braceExpand() if (options.debug) this.debug = console.error this.debug(this.pattern, set) // step 3: now we have a set, so turn each one into a series of path-portion // matching patterns. // These will be regexps, except in the case of "**", which is // set to the GLOBSTAR object for globstar behavior, // and will not contain any / characters set = this.globParts = set.map(function (s) { return s.split(slashSplit) }) this.debug(this.pattern, set) // glob --> regexps set = set.map(function (s, si, set) { return s.map(this.parse, this) }, this) this.debug(this.pattern, set) // filter out everything that didn't compile properly. set = set.filter(function (s) { return s.indexOf(false) === -1 }) this.debug(this.pattern, set) this.set = set } Minimatch.prototype.parseNegate = parseNegate function parseNegate () { var pattern = this.pattern var negate = false var options = this.options var negateOffset = 0 if (options.nonegate) return for (var i = 0, l = pattern.length ; i < l && pattern.charAt(i) === '!' ; i++) { negate = !negate negateOffset++ } if (negateOffset) this.pattern = pattern.substr(negateOffset) this.negate = negate } // Brace expansion: // a{b,c}d -> abd acd // a{b,}c -> abc ac // a{0..3}d -> a0d a1d a2d a3d // a{b,c{d,e}f}g -> abg acdfg acefg // a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg // // Invalid sets are not expanded. // a{2..}b -> a{2..}b // a{b}c -> a{b}c minimatch.braceExpand = function (pattern, options) { return braceExpand(pattern, options) } Minimatch.prototype.braceExpand = braceExpand function braceExpand (pattern, options) { if (!options) { if (this instanceof Minimatch) { options = this.options } else { options = {} } } pattern = typeof pattern === 'undefined' ? this.pattern : pattern if (typeof pattern === 'undefined') { throw new TypeError('undefined pattern') } if (options.nobrace || !pattern.match(/\{.*\}/)) { // shortcut. no need to expand. return [pattern] } return expand(pattern) } // parse a component of the expanded set. // At this point, no pattern may contain "/" in it // so we're going to return a 2d array, where each entry is the full // pattern, split on '/', and then turned into a regular expression. // A regexp is made at the end which joins each array with an // escaped /, and another full one which joins each regexp with |. // // Following the lead of Bash 4.1, note that "**" only has special meaning // when it is the *only* thing in a path portion. Otherwise, any series // of * is equivalent to a single *. Globstar behavior is enabled by // default, and can be disabled by setting options.noglobstar. Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { if (pattern.length > 1024 * 64) { throw new TypeError('pattern is too long') } var options = this.options // shortcuts if (!options.noglobstar && pattern === '**') return GLOBSTAR if (pattern === '') return '' var re = '' var hasMagic = !!options.nocase var escaping = false // ? => one single character var patternListStack = [] var negativeLists = [] var stateChar var inClass = false var reClassStart = -1 var classStart = -1 // . and .. never match anything that doesn't start with ., // even when options.dot is set. var patternStart = pattern.charAt(0) === '.' ? '' // anything // not (start or / followed by . or .. followed by / or end) : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' : '(?!\\.)' var self = this function clearStateChar () { if (stateChar) { // we had some state-tracking character // that wasn't consumed by this pass. switch (stateChar) { case '*': re += star hasMagic = true break case '?': re += qmark hasMagic = true break default: re += '\\' + stateChar break } self.debug('clearStateChar %j %j', stateChar, re) stateChar = false } } for (var i = 0, len = pattern.length, c ; (i < len) && (c = pattern.charAt(i)) ; i++) { this.debug('%s\t%s %s %j', pattern, i, re, c) // skip over any that are escaped. if (escaping && reSpecials[c]) { re += '\\' + c escaping = false continue } switch (c) { case '/': // completely not allowed, even escaped. // Should already be path-split by now. return false case '\\': clearStateChar() escaping = true continue // the various stateChar values // for the "extglob" stuff. case '?': case '*': case '+': case '@': case '!': this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) // all of those are literals inside a class, except that // the glob [!a] means [^a] in regexp if (inClass) { this.debug(' in class') if (c === '!' && i === classStart + 1) c = '^' re += c continue } // if we already have a stateChar, then it means // that there was something like ** or +? in there. // Handle the stateChar, then proceed with this one. self.debug('call clearStateChar %j', stateChar) clearStateChar() stateChar = c // if extglob is disabled, then +(asdf|foo) isn't a thing. // just clear the statechar *now*, rather than even diving into // the patternList stuff. if (options.noext) clearStateChar() continue case '(': if (inClass) { re += '(' continue } if (!stateChar) { re += '\\(' continue } patternListStack.push({ type: stateChar, start: i - 1, reStart: re.length, open: plTypes[stateChar].open, close: plTypes[stateChar].close }) // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:' this.debug('plType %j %j', stateChar, re) stateChar = false continue case ')': if (inClass || !patternListStack.length) { re += '\\)' continue } clearStateChar() hasMagic = true var pl = patternListStack.pop() // negation is (?:(?!js)[^/]*) // The others are (?:) re += pl.close if (pl.type === '!') { negativeLists.push(pl) } pl.reEnd = re.length continue case '|': if (inClass || !patternListStack.length || escaping) { re += '\\|' escaping = false continue } clearStateChar() re += '|' continue // these are mostly the same in regexp and glob case '[': // swallow any state-tracking char before the [ clearStateChar() if (inClass) { re += '\\' + c continue } inClass = true classStart = i reClassStart = re.length re += c continue case ']': // a right bracket shall lose its special // meaning and represent itself in // a bracket expression if it occurs // first in the list. -- POSIX.2 2.8.3.2 if (i === classStart + 1 || !inClass) { re += '\\' + c escaping = false continue } // handle the case where we left a class open. // "[z-a]" is valid, equivalent to "\[z-a\]" if (inClass) { // split where the last [ was, make sure we don't have // an invalid re. if so, re-walk the contents of the // would-be class to re-translate any characters that // were passed through as-is // TODO: It would probably be faster to determine this // without a try/catch and a new RegExp, but it's tricky // to do safely. For now, this is safe and works. var cs = pattern.substring(classStart + 1, i) try { RegExp('[' + cs + ']') } catch (er) { // not a valid class! var sp = this.parse(cs, SUBPARSE) re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' hasMagic = hasMagic || sp[1] inClass = false continue } } // finish up the class. hasMagic = true inClass = false re += c continue default: // swallow any state char that wasn't consumed clearStateChar() if (escaping) { // no need escaping = false } else if (reSpecials[c] && !(c === '^' && inClass)) { re += '\\' } re += c } // switch } // for // handle the case where we left a class open. // "[abc" is valid, equivalent to "\[abc" if (inClass) { // split where the last [ was, and escape it // this is a huge pita. We now have to re-walk // the contents of the would-be class to re-translate // any characters that were passed through as-is cs = pattern.substr(classStart + 1) sp = this.parse(cs, SUBPARSE) re = re.substr(0, reClassStart) + '\\[' + sp[0] hasMagic = hasMagic || sp[1] } // handle the case where we had a +( thing at the *end* // of the pattern. // each pattern list stack adds 3 chars, and we need to go through // and escape any | chars that were passed through as-is for the regexp. // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { var tail = re.slice(pl.reStart + pl.open.length) this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\' } // need to escape all those slashes *again*, without escaping the // one that we need for escaping the | character. As it works out, // escaping an even number of slashes can be done by simply repeating // it exactly after itself. That's why this trick works. // // I am sorry that you have to see this. return $1 + $1 + $2 + '|' }) this.debug('tail=%j\n %s', tail, tail, pl, re) var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type hasMagic = true re = re.slice(0, pl.reStart) + t + '\\(' + tail } // handle trailing things that only matter at the very end. clearStateChar() if (escaping) { // trailing \\ re += '\\\\' } // only need to apply the nodot start if the re starts with // something that could conceivably capture a dot var addPatternStart = false switch (re.charAt(0)) { case '.': case '[': case '(': addPatternStart = true } // Hack to work around lack of negative lookbehind in JS // A pattern like: *.!(x).!(y|z) needs to ensure that a name // like 'a.xyz.yz' doesn't match. So, the first negative // lookahead, has to look ALL the way ahead, to the end of // the pattern. for (var n = negativeLists.length - 1; n > -1; n--) { var nl = negativeLists[n] var nlBefore = re.slice(0, nl.reStart) var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) var nlAfter = re.slice(nl.reEnd) nlLast += nlAfter // Handle nested stuff like *(*.js|!(*.json)), where open parens // mean that we should *not* include the ) in the bit that is considered // "after" the negated section. var openParensBefore = nlBefore.split('(').length - 1 var cleanAfter = nlAfter for (i = 0; i < openParensBefore; i++) { cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') } nlAfter = cleanAfter var dollar = '' if (nlAfter === '' && isSub !== SUBPARSE) { dollar = '$' } var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast re = newRe } // if the re is not "" at this point, then we need to make sure // it doesn't match against an empty path part. // Otherwise a/* will match a/, which it should not. if (re !== '' && hasMagic) { re = '(?=.)' + re } if (addPatternStart) { re = patternStart + re } // parsing just a piece of a larger pattern. if (isSub === SUBPARSE) { return [re, hasMagic] } // skip the regexp for non-magical patterns // unescape anything in it, though, so that it'll be // an exact match against a file etc. if (!hasMagic) { return globUnescape(pattern) } var flags = options.nocase ? 'i' : '' try { var regExp = new RegExp('^' + re + '$', flags) } catch (er) { // If it was an invalid regular expression, then it can't match // anything. This trick looks for a character after the end of // the string, which is of course impossible, except in multi-line // mode, but it's not a /m regex. return new RegExp('$.') } regExp._glob = pattern regExp._src = re return regExp } minimatch.makeRe = function (pattern, options) { return new Minimatch(pattern, options || {}).makeRe() } Minimatch.prototype.makeRe = makeRe function makeRe () { if (this.regexp || this.regexp === false) return this.regexp // at this point, this.set is a 2d array of partial // pattern strings, or "**". // // It's better to use .match(). This function shouldn't // be used, really, but it's pretty convenient sometimes, // when you just want to work with a regex. var set = this.set if (!set.length) { this.regexp = false return this.regexp } var options = this.options var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot var flags = options.nocase ? 'i' : '' var re = set.map(function (pattern) { return pattern.map(function (p) { return (p === GLOBSTAR) ? twoStar : (typeof p === 'string') ? regExpEscape(p) : p._src }).join('\\\/') }).join('|') // must match entire pattern // ending in a * or ** will make it less strict. re = '^(?:' + re + ')$' // can match anything, as long as it's not this. if (this.negate) re = '^(?!' + re + ').*$' try { this.regexp = new RegExp(re, flags) } catch (ex) { this.regexp = false } return this.regexp } minimatch.match = function (list, pattern, options) { options = options || {} var mm = new Minimatch(pattern, options) list = list.filter(function (f) { return mm.match(f) }) if (mm.options.nonull && !list.length) { list.push(pattern) } return list } Minimatch.prototype.match = match function match (f, partial) { this.debug('match', f, this.pattern) // short-circuit in the case of busted things. // comments, etc. if (this.comment) return false if (this.empty) return f === '' if (f === '/' && partial) return true var options = this.options // windows: need to use /, not \ if (path.sep !== '/') { f = f.split(path.sep).join('/') } // treat the test path as a set of pathparts. f = f.split(slashSplit) this.debug(this.pattern, 'split', f) // just ONE of the pattern sets in this.set needs to match // in order for it to be valid. If negating, then just one // match means that we have failed. // Either way, return on the first hit. var set = this.set this.debug(this.pattern, 'set', set) // Find the basename of the path by looking for the last non-empty segment var filename var i for (i = f.length - 1; i >= 0; i--) { filename = f[i] if (filename) break } for (i = 0; i < set.length; i++) { var pattern = set[i] var file = f if (options.matchBase && pattern.length === 1) { file = [filename] } var hit = this.matchOne(file, pattern, partial) if (hit) { if (options.flipNegate) return true return !this.negate } } // didn't get any hits. this is success if it's a negative // pattern, failure otherwise. if (options.flipNegate) return false return this.negate } // set partial to true to test if, for example, // "/a/b" matches the start of "/*/b/*/d" // Partial means, if you run out of file before you run // out of pattern, then that's fine, as long as all // the parts match. Minimatch.prototype.matchOne = function (file, pattern, partial) { var options = this.options this.debug('matchOne', { 'this': this, file: file, pattern: pattern }) this.debug('matchOne', file.length, pattern.length) for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length ; (fi < fl) && (pi < pl) ; fi++, pi++) { this.debug('matchOne loop') var p = pattern[pi] var f = file[fi] this.debug(pattern, p, f) // should be impossible. // some invalid regexp stuff in the set. if (p === false) return false if (p === GLOBSTAR) { this.debug('GLOBSTAR', [pattern, p, f]) // "**" // a/**/b/**/c would match the following: // a/b/x/y/z/c // a/x/y/z/b/c // a/b/x/b/x/c // a/b/c // To do this, take the rest of the pattern after // the **, and see if it would match the file remainder. // If so, return success. // If not, the ** "swallows" a segment, and try again. // This is recursively awful. // // a/**/b/**/c matching a/b/x/y/z/c // - a matches a // - doublestar // - matchOne(b/x/y/z/c, b/**/c) // - b matches b // - doublestar // - matchOne(x/y/z/c, c) -> no // - matchOne(y/z/c, c) -> no // - matchOne(z/c, c) -> no // - matchOne(c, c) yes, hit var fr = fi var pr = pi + 1 if (pr === pl) { this.debug('** at the end') // a ** at the end will just swallow the rest. // We have found a match. // however, it will not swallow /.x, unless // options.dot is set. // . and .. are *never* matched by **, for explosively // exponential reasons. for (; fi < fl; fi++) { if (file[fi] === '.' || file[fi] === '..' || (!options.dot && file[fi].charAt(0) === '.')) return false } return true } // ok, let's see if we can swallow whatever we can. while (fr < fl) { var swallowee = file[fr] this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) // XXX remove this slice. Just pass the start index. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { this.debug('globstar found match!', fr, fl, swallowee) // found a match. return true } else { // can't swallow "." or ".." ever. // can only swallow ".foo" when explicitly asked. if (swallowee === '.' || swallowee === '..' || (!options.dot && swallowee.charAt(0) === '.')) { this.debug('dot detected!', file, fr, pattern, pr) break } // ** swallows a segment, and continue. this.debug('globstar swallow a segment, and continue') fr++ } } // no match was found. // However, in partial mode, we can't say this is necessarily over. // If there's more *pattern* left, then if (partial) { // ran out of file this.debug('\n>>> no match, partial?', file, fr, pattern, pr) if (fr === fl) return true } return false } // something other than ** // non-magic patterns just have to match exactly // patterns with magic have been turned into regexps. var hit if (typeof p === 'string') { if (options.nocase) { hit = f.toLowerCase() === p.toLowerCase() } else { hit = f === p } this.debug('string match', p, f, hit) } else { hit = f.match(p) this.debug('pattern match', p, f, hit) } if (!hit) return false } // Note: ending in / means that we'll get a final "" // at the end of the pattern. This can only match a // corresponding "" at the end of the file. // If the file ends in /, then it can only match a // a pattern that ends in /, unless the pattern just // doesn't have any more for it. But, a/b/ should *not* // match "a/b/*", even though "" matches against the // [^/]*? pattern, except in partial mode, where it might // simply not be reached yet. // However, a/b/ should still satisfy a/* // now either we fell off the end of the pattern, or we're done. if (fi === fl && pi === pl) { // ran out of pattern and filename at the same time. // an exact hit! return true } else if (fi === fl) { // ran out of file, but still had pattern left. // this is ok if we're doing the match as part of // a glob fs traversal. return partial } else if (pi === pl) { // ran out of pattern, still have file left. // this is only acceptable if we're on the very last // empty segment of a file with a trailing slash. // a/* should match a/b/ var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') return emptyFileEnd } // should be unreachable. throw new Error('wtf?') } // replace stuff like \* with * function globUnescape (s) { return s.replace(/\\(.)/g, '$1') } function regExpEscape (s) { return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') } /***/ }), /* 40 */ /***/ (function(module, exports, __webpack_require__) { var concatMap = __webpack_require__(41); var balanced = __webpack_require__(42); module.exports = expandTop; var escSlash = '\0SLASH'+Math.random()+'\0'; var escOpen = '\0OPEN'+Math.random()+'\0'; var escClose = '\0CLOSE'+Math.random()+'\0'; var escComma = '\0COMMA'+Math.random()+'\0'; var escPeriod = '\0PERIOD'+Math.random()+'\0'; function numeric(str) { return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0); } function escapeBraces(str) { return str.split('\\\\').join(escSlash) .split('\\{').join(escOpen) .split('\\}').join(escClose) .split('\\,').join(escComma) .split('\\.').join(escPeriod); } function unescapeBraces(str) { return str.split(escSlash).join('\\') .split(escOpen).join('{') .split(escClose).join('}') .split(escComma).join(',') .split(escPeriod).join('.'); } // Basically just str.split(","), but handling cases // where we have nested braced sections, which should be // treated as individual members, like {a,{b,c},d} function parseCommaParts(str) { if (!str) return ['']; var parts = []; var m = balanced('{', '}', str); if (!m) return str.split(','); var pre = m.pre; var body = m.body; var post = m.post; var p = pre.split(','); p[p.length-1] += '{' + body + '}'; var postParts = parseCommaParts(post); if (post.length) { p[p.length-1] += postParts.shift(); p.push.apply(p, postParts); } parts.push.apply(parts, p); return parts; } function expandTop(str) { if (!str) return []; // I don't know why Bash 4.3 does this, but it does. // Anything starting with {} will have the first two bytes preserved // but *only* at the top level, so {},a}b will not expand to anything, // but a{},b}c will be expanded to [a}c,abc]. // One could argue that this is a bug in Bash, but since the goal of // this module is to match Bash's rules, we escape a leading {} if (str.substr(0, 2) === '{}') { str = '\\{\\}' + str.substr(2); } return expand(escapeBraces(str), true).map(unescapeBraces); } function identity(e) { return e; } function embrace(str) { return '{' + str + '}'; } function isPadded(el) { return /^-?0\d/.test(el); } function lte(i, y) { return i <= y; } function gte(i, y) { return i >= y; } function expand(str, isTop) { var expansions = []; var m = balanced('{', '}', str); if (!m || /\$$/.test(m.pre)) return [str]; var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); var isSequence = isNumericSequence || isAlphaSequence; var isOptions = m.body.indexOf(',') >= 0; if (!isSequence && !isOptions) { // {a},b} if (m.post.match(/,.*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; return expand(str); } return [str]; } var n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); if (n.length === 1) { // x{{a,b}}y ==> x{a}y x{b}y n = expand(n[0], false).map(embrace); if (n.length === 1) { var post = m.post.length ? expand(m.post, false) : ['']; return post.map(function(p) { return m.pre + n[0] + p; }); } } } // at this point, n is the parts, and we know it's not a comma set // with a single entry. // no need to expand pre, since it is guaranteed to be free of brace-sets var pre = m.pre; var post = m.post.length ? expand(m.post, false) : ['']; var N; if (isSequence) { var x = numeric(n[0]); var y = numeric(n[1]); var width = Math.max(n[0].length, n[1].length) var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; var test = lte; var reverse = y < x; if (reverse) { incr *= -1; test = gte; } var pad = n.some(isPadded); N = []; for (var i = x; test(i, y); i += incr) { var c; if (isAlphaSequence) { c = String.fromCharCode(i); if (c === '\\') c = ''; } else { c = String(i); if (pad) { var need = width - c.length; if (need > 0) { var z = new Array(need + 1).join('0'); if (i < 0) c = '-' + z + c.slice(1); else c = z + c; } } } N.push(c); } } else { N = concatMap(n, function(el) { return expand(el, false) }); } for (var j = 0; j < N.length; j++) { for (var k = 0; k < post.length; k++) { var expansion = pre + N[j] + post[k]; if (!isTop || isSequence || expansion) expansions.push(expansion); } } return expansions; } /***/ }), /* 41 */ /***/ (function(module, exports) { module.exports = function (xs, fn) { var res = []; for (var i = 0; i < xs.length; i++) { var x = fn(xs[i], i); if (isArray(x)) res.push.apply(res, x); else res.push(x); } return res; }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; /***/ }), /* 42 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = balanced; function balanced(a, b, str) { if (a instanceof RegExp) a = maybeMatch(a, str); if (b instanceof RegExp) b = maybeMatch(b, str); var r = range(a, b, str); return r && { start: r[0], end: r[1], pre: str.slice(0, r[0]), body: str.slice(r[0] + a.length, r[1]), post: str.slice(r[1] + b.length) }; } function maybeMatch(reg, str) { var m = str.match(reg); return m ? m[0] : null; } balanced.range = range; function range(a, b, str) { var begs, beg, left, right, result; var ai = str.indexOf(a); var bi = str.indexOf(b, ai + 1); var i = ai; if (ai >= 0 && bi > 0) { begs = []; left = str.length; while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); } else if (begs.length == 1) { result = [ begs.pop(), bi ]; } else { beg = begs.pop(); if (beg < left) { left = beg; right = bi; } bi = str.indexOf(b, i + 1); } i = ai < bi && ai >= 0 ? ai : bi; } if (begs.length) { result = [ left, right ]; } } return result; } /***/ }), /* 43 */ /***/ (function(module, exports, __webpack_require__) { try { var util = __webpack_require__(29); if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { module.exports = __webpack_require__(44); } /***/ }), /* 44 */ /***/ (function(module, exports) { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor var TempCtor = function () {} TempCtor.prototype = superCtor.prototype ctor.prototype = new TempCtor() ctor.prototype.constructor = ctor } } /***/ }), /* 45 */ /***/ (function(module, exports) { module.exports = require("events"); /***/ }), /* 46 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; function posix(path) { return path.charAt(0) === '/'; } function win32(path) { // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; var result = splitDeviceRe.exec(path); var device = result[1] || ''; var isUnc = Boolean(device && device.charAt(1) !== ':'); // UNC paths are always absolute return Boolean(result[2] || isUnc); } module.exports = process.platform === 'win32' ? win32 : posix; module.exports.posix = posix; module.exports.win32 = win32; /***/ }), /* 47 */ /***/ (function(module, exports, __webpack_require__) { module.exports = globSync globSync.GlobSync = GlobSync var fs = __webpack_require__(23) var rp = __webpack_require__(37) var minimatch = __webpack_require__(39) var Minimatch = minimatch.Minimatch var Glob = __webpack_require__(36).Glob var util = __webpack_require__(29) var path = __webpack_require__(16) var assert = __webpack_require__(30) var isAbsolute = __webpack_require__(46) var common = __webpack_require__(48) var alphasort = common.alphasort var alphasorti = common.alphasorti var setopts = common.setopts var ownProp = common.ownProp var childrenIgnored = common.childrenIgnored var isIgnored = common.isIgnored function globSync (pattern, options) { if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') return new GlobSync(pattern, options).found } function GlobSync (pattern, options) { if (!pattern) throw new Error('must provide pattern') if (typeof options === 'function' || arguments.length === 3) throw new TypeError('callback provided to sync glob\n'+ 'See: https://github.com/isaacs/node-glob/issues/167') if (!(this instanceof GlobSync)) return new GlobSync(pattern, options) setopts(this, pattern, options) if (this.noprocess) return this var n = this.minimatch.set.length this.matches = new Array(n) for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false) } this._finish() } GlobSync.prototype._finish = function () { assert(this instanceof GlobSync) if (this.realpath) { var self = this this.matches.forEach(function (matchset, index) { var set = self.matches[index] = Object.create(null) for (var p in matchset) { try { p = self._makeAbs(p) var real = rp.realpathSync(p, self.realpathCache) set[real] = true } catch (er) { if (er.syscall === 'stat') set[self._makeAbs(p)] = true else throw er } } }) } common.finish(this) } GlobSync.prototype._process = function (pattern, index, inGlobStar) { assert(this instanceof GlobSync) // Get the first [n] parts of pattern that are all strings. var n = 0 while (typeof pattern[n] === 'string') { n ++ } // now n is the index of the first one that is *not* a string. // See if there's anything else var prefix switch (n) { // if not, then this is rather simple case pattern.length: this._processSimple(pattern.join('/'), index) return case 0: // pattern *starts* with some non-trivial item. // going to readdir(cwd), but not include the prefix in matches. prefix = null break default: // pattern has some string bits in the front. // whatever it starts with, whether that's 'absolute' like /foo/bar, // or 'relative' like '../baz' prefix = pattern.slice(0, n).join('/') break } var remain = pattern.slice(n) // get the list of entries. var read if (prefix === null) read = '.' else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { if (!prefix || !isAbsolute(prefix)) prefix = '/' + prefix read = prefix } else read = prefix var abs = this._makeAbs(read) //if ignored, skip processing if (childrenIgnored(this, read)) return var isGlobStar = remain[0] === minimatch.GLOBSTAR if (isGlobStar) this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) else this._processReaddir(prefix, read, abs, remain, index, inGlobStar) } GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // if the abs isn't a dir, then nothing can match! if (!entries) return // It will only match dot entries if it starts with a dot, or if // dot is set. Stuff like @(.foo|.bar) isn't allowed. var pn = remain[0] var negate = !!this.minimatch.negate var rawGlob = pn._glob var dotOk = this.dot || rawGlob.charAt(0) === '.' var matchedEntries = [] for (var i = 0; i < entries.length; i++) { var e = entries[i] if (e.charAt(0) !== '.' || dotOk) { var m if (negate && !prefix) { m = !e.match(pn) } else { m = e.match(pn) } if (m) matchedEntries.push(e) } } var len = matchedEntries.length // If there are no matched entries, then nothing matches. if (len === 0) return // if this is the last remaining pattern bit, then no need for // an additional stat *unless* the user has specified mark or // stat explicitly. We know they exist, since readdir returned // them. if (remain.length === 1 && !this.mark && !this.stat) { if (!this.matches[index]) this.matches[index] = Object.create(null) for (var i = 0; i < len; i ++) { var e = matchedEntries[i] if (prefix) { if (prefix.slice(-1) !== '/') e = prefix + '/' + e else e = prefix + e } if (e.charAt(0) === '/' && !this.nomount) { e = path.join(this.root, e) } this._emitMatch(index, e) } // This was the last one, and no stats were needed return } // now test all matched entries as stand-ins for that part // of the pattern. remain.shift() for (var i = 0; i < len; i ++) { var e = matchedEntries[i] var newPattern if (prefix) newPattern = [prefix, e] else newPattern = [e] this._process(newPattern.concat(remain), index, inGlobStar) } } GlobSync.prototype._emitMatch = function (index, e) { if (isIgnored(this, e)) return var abs = this._makeAbs(e) if (this.mark) e = this._mark(e) if (this.absolute) { e = abs } if (this.matches[index][e]) return if (this.nodir) { var c = this.cache[abs] if (c === 'DIR' || Array.isArray(c)) return } this.matches[index][e] = true if (this.stat) this._stat(e) } GlobSync.prototype._readdirInGlobStar = function (abs) { // follow all symlinked directories forever // just proceed as if this is a non-globstar situation if (this.follow) return this._readdir(abs, false) var entries var lstat var stat try { lstat = fs.lstatSync(abs) } catch (er) { if (er.code === 'ENOENT') { // lstat failed, doesn't exist return null } } var isSym = lstat && lstat.isSymbolicLink() this.symlinks[abs] = isSym // If it's not a symlink or a dir, then it's definitely a regular file. // don't bother doing a readdir in that case. if (!isSym && lstat && !lstat.isDirectory()) this.cache[abs] = 'FILE' else entries = this._readdir(abs, false) return entries } GlobSync.prototype._readdir = function (abs, inGlobStar) { var entries if (inGlobStar && !ownProp(this.symlinks, abs)) return this._readdirInGlobStar(abs) if (ownProp(this.cache, abs)) { var c = this.cache[abs] if (!c || c === 'FILE') return null if (Array.isArray(c)) return c } try { return this._readdirEntries(abs, fs.readdirSync(abs)) } catch (er) { this._readdirError(abs, er) return null } } GlobSync.prototype._readdirEntries = function (abs, entries) { // if we haven't asked to stat everything, then just // assume that everything in there exists, so we can avoid // having to stat it a second time. if (!this.mark && !this.stat) { for (var i = 0; i < entries.length; i ++) { var e = entries[i] if (abs === '/') e = abs + e else e = abs + '/' + e this.cache[e] = true } } this.cache[abs] = entries // mark and cache dir-ness return entries } GlobSync.prototype._readdirError = function (f, er) { // handle errors, and cache the information switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. var abs = this._makeAbs(f) this.cache[abs] = 'FILE' if (abs === this.cwdAbs) { var error = new Error(er.code + ' invalid cwd ' + this.cwd) error.path = this.cwd error.code = er.code throw error } break case 'ENOENT': // not terribly unusual case 'ELOOP': case 'ENAMETOOLONG': case 'UNKNOWN': this.cache[this._makeAbs(f)] = false break default: // some unusual error. Treat as failure. this.cache[this._makeAbs(f)] = false if (this.strict) throw er if (!this.silent) console.error('glob error', er) break } } GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { var entries = this._readdir(abs, inGlobStar) // no entries means not a dir, so it can never have matches // foo.txt/** doesn't match foo.txt if (!entries) return // test without the globstar, and with every child both below // and replacing the globstar. var remainWithoutGlobStar = remain.slice(1) var gspref = prefix ? [ prefix ] : [] var noGlobStar = gspref.concat(remainWithoutGlobStar) // the noGlobStar pattern exits the inGlobStar state this._process(noGlobStar, index, false) var len = entries.length var isSym = this.symlinks[abs] // If it's a symlink, and we're in a globstar, then stop if (isSym && inGlobStar) return for (var i = 0; i < len; i++) { var e = entries[i] if (e.charAt(0) === '.' && !this.dot) continue // these two cases enter the inGlobStar state var instead = gspref.concat(entries[i], remainWithoutGlobStar) this._process(instead, index, true) var below = gspref.concat(entries[i], remain) this._process(below, index, true) } } GlobSync.prototype._processSimple = function (prefix, index) { // XXX review this. Shouldn't it be doing the mounting etc // before doing stat? kinda weird? var exists = this._stat(prefix) if (!this.matches[index]) this.matches[index] = Object.create(null) // If it doesn't exist, then just mark the lack of results if (!exists) return if (prefix && isAbsolute(prefix) && !this.nomount) { var trail = /[\/\\]$/.test(prefix) if (prefix.charAt(0) === '/') { prefix = path.join(this.root, prefix) } else { prefix = path.resolve(this.root, prefix) if (trail) prefix += '/' } } if (process.platform === 'win32') prefix = prefix.replace(/\\/g, '/') // Mark this as a match this._emitMatch(index, prefix) } // Returns either 'DIR', 'FILE', or false GlobSync.prototype._stat = function (f) { var abs = this._makeAbs(f) var needDir = f.slice(-1) === '/' if (f.length > this.maxLength) return false if (!this.stat && ownProp(this.cache, abs)) { var c = this.cache[abs] if (Array.isArray(c)) c = 'DIR' // It exists, but maybe not how we need it if (!needDir || c === 'DIR') return c if (needDir && c === 'FILE') return false // otherwise we have to stat, because maybe c=true // if we know it exists, but not what it is. } var exists var stat = this.statCache[abs] if (!stat) { var lstat try { lstat = fs.lstatSync(abs) } catch (er) { if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { this.statCache[abs] = false return false } } if (lstat && lstat.isSymbolicLink()) { try { stat = fs.statSync(abs) } catch (er) { stat = lstat } } else { stat = lstat } } this.statCache[abs] = stat var c = true if (stat) c = stat.isDirectory() ? 'DIR' : 'FILE' this.cache[abs] = this.cache[abs] || c if (needDir && c === 'FILE') return false return c } GlobSync.prototype._mark = function (p) { return common.mark(this, p) } GlobSync.prototype._makeAbs = function (f) { return common.makeAbs(this, f) } /***/ }), /* 48 */ /***/ (function(module, exports, __webpack_require__) { exports.alphasort = alphasort exports.alphasorti = alphasorti exports.setopts = setopts exports.ownProp = ownProp exports.makeAbs = makeAbs exports.finish = finish exports.mark = mark exports.isIgnored = isIgnored exports.childrenIgnored = childrenIgnored function ownProp (obj, field) { return Object.prototype.hasOwnProperty.call(obj, field) } var path = __webpack_require__(16) var minimatch = __webpack_require__(39) var isAbsolute = __webpack_require__(46) var Minimatch = minimatch.Minimatch function alphasorti (a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()) } function alphasort (a, b) { return a.localeCompare(b) } function setupIgnores (self, options) { self.ignore = options.ignore || [] if (!Array.isArray(self.ignore)) self.ignore = [self.ignore] if (self.ignore.length) { self.ignore = self.ignore.map(ignoreMap) } } // ignore patterns are always in dot:true mode. function ignoreMap (pattern) { var gmatcher = null if (pattern.slice(-3) === '/**') { var gpattern = pattern.replace(/(\/\*\*)+$/, '') gmatcher = new Minimatch(gpattern, { dot: true }) } return { matcher: new Minimatch(pattern, { dot: true }), gmatcher: gmatcher } } function setopts (self, pattern, options) { if (!options) options = {} // base-matching: just use globstar for that. if (options.matchBase && -1 === pattern.indexOf("/")) { if (options.noglobstar) { throw new Error("base matching requires globstar") } pattern = "**/" + pattern } self.silent = !!options.silent self.pattern = pattern self.strict = options.strict !== false self.realpath = !!options.realpath self.realpathCache = options.realpathCache || Object.create(null) self.follow = !!options.follow self.dot = !!options.dot self.mark = !!options.mark self.nodir = !!options.nodir if (self.nodir) self.mark = true self.sync = !!options.sync self.nounique = !!options.nounique self.nonull = !!options.nonull self.nosort = !!options.nosort self.nocase = !!options.nocase self.stat = !!options.stat self.noprocess = !!options.noprocess self.absolute = !!options.absolute self.maxLength = options.maxLength || Infinity self.cache = options.cache || Object.create(null) self.statCache = options.statCache || Object.create(null) self.symlinks = options.symlinks || Object.create(null) setupIgnores(self, options) self.changedCwd = false var cwd = process.cwd() if (!ownProp(options, "cwd")) self.cwd = cwd else { self.cwd = path.resolve(options.cwd) self.changedCwd = self.cwd !== cwd } self.root = options.root || path.resolve(self.cwd, "/") self.root = path.resolve(self.root) if (process.platform === "win32") self.root = self.root.replace(/\\/g, "/") // TODO: is an absolute `cwd` supposed to be resolved against `root`? // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) if (process.platform === "win32") self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") self.nomount = !!options.nomount // disable comments and negation in Minimatch. // Note that they are not supported in Glob itself anyway. options.nonegate = true options.nocomment = true self.minimatch = new Minimatch(pattern, options) self.options = self.minimatch.options } function finish (self) { var nou = self.nounique var all = nou ? [] : Object.create(null) for (var i = 0, l = self.matches.length; i < l; i ++) { var matches = self.matches[i] if (!matches || Object.keys(matches).length === 0) { if (self.nonull) { // do like the shell, and spit out the literal glob var literal = self.minimatch.globSet[i] if (nou) all.push(literal) else all[literal] = true } } else { // had matches var m = Object.keys(matches) if (nou) all.push.apply(all, m) else m.forEach(function (m) { all[m] = true }) } } if (!nou) all = Object.keys(all) if (!self.nosort) all = all.sort(self.nocase ? alphasorti : alphasort) // at *some* point we statted all of these if (self.mark) { for (var i = 0; i < all.length; i++) { all[i] = self._mark(all[i]) } if (self.nodir) { all = all.filter(function (e) { var notDir = !(/\/$/.test(e)) var c = self.cache[e] || self.cache[makeAbs(self, e)] if (notDir && c) notDir = c !== 'DIR' && !Array.isArray(c) return notDir }) } } if (self.ignore.length) all = all.filter(function(m) { return !isIgnored(self, m) }) self.found = all } function mark (self, p) { var abs = makeAbs(self, p) var c = self.cache[abs] var m = p if (c) { var isDir = c === 'DIR' || Array.isArray(c) var slash = p.slice(-1) === '/' if (isDir && !slash) m += '/' else if (!isDir && slash) m = m.slice(0, -1) if (m !== p) { var mabs = makeAbs(self, m) self.statCache[mabs] = self.statCache[abs] self.cache[mabs] = self.cache[abs] } } return m } // lotta situps... function makeAbs (self, f) { var abs = f if (f.charAt(0) === '/') { abs = path.join(self.root, f) } else if (isAbsolute(f) || f === '') { abs = f } else if (self.changedCwd) { abs = path.resolve(self.cwd, f) } else { abs = path.resolve(f) } if (process.platform === 'win32') abs = abs.replace(/\\/g, '/') return abs } // Return true, if pattern ends with globstar '**', for the accompanying parent directory. // Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents function isIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) }) } function childrenIgnored (self, path) { if (!self.ignore.length) return false return self.ignore.some(function(item) { return !!(item.gmatcher && item.gmatcher.match(path)) }) } /***/ }), /* 49 */ /***/ (function(module, exports, __webpack_require__) { var wrappy = __webpack_require__(50) var reqs = Object.create(null) var once = __webpack_require__(51) module.exports = wrappy(inflight) function inflight (key, cb) { if (reqs[key]) { reqs[key].push(cb) return null } else { reqs[key] = [cb] return makeres(key) } } function makeres (key) { return once(function RES () { var cbs = reqs[key] var len = cbs.length var args = slice(arguments) // XXX It's somewhat ambiguous whether a new callback added in this // pass should be queued for later execution if something in the // list of callbacks throws, or if it should just be discarded. // However, it's such an edge case that it hardly matters, and either // choice is likely as surprising as the other. // As it happens, we do go ahead and schedule it for later execution. try { for (var i = 0; i < len; i++) { cbs[i].apply(null, args) } } finally { if (cbs.length > len) { // added more in the interim. // de-zalgo, just in case, but don't call again. cbs.splice(0, len) process.nextTick(function () { RES.apply(null, args) }) } else { delete reqs[key] } } }) } function slice (args) { var length = args.length var array = [] for (var i = 0; i < length; i++) array[i] = args[i] return array } /***/ }), /* 50 */ /***/ (function(module, exports) { // Returns a wrapper function that returns a wrapped callback // The wrapper function should do some stuff, and return a // presumably different callback function. // This makes sure that own properties are retained, so that // decorations and such are not lost along the way. module.exports = wrappy function wrappy (fn, cb) { if (fn && cb) return wrappy(fn)(cb) if (typeof fn !== 'function') throw new TypeError('need wrapper function') Object.keys(fn).forEach(function (k) { wrapper[k] = fn[k] }) return wrapper function wrapper() { var args = new Array(arguments.length) for (var i = 0; i < args.length; i++) { args[i] = arguments[i] } var ret = fn.apply(this, args) var cb = args[args.length-1] if (typeof ret === 'function' && ret !== cb) { Object.keys(cb).forEach(function (k) { ret[k] = cb[k] }) } return ret } } /***/ }), /* 51 */ /***/ (function(module, exports, __webpack_require__) { var wrappy = __webpack_require__(50) module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) once.proto = once(function () { Object.defineProperty(Function.prototype, 'once', { value: function () { return once(this) }, configurable: true }) Object.defineProperty(Function.prototype, 'onceStrict', { value: function () { return onceStrict(this) }, configurable: true }) }) function once (fn) { var f = function () { if (f.called) return f.value f.called = true return f.value = fn.apply(this, arguments) } f.called = false return f } function onceStrict (fn) { var f = function () { if (f.called) throw new Error(f.onceError) f.called = true return f.value = fn.apply(this, arguments) } var name = fn.name || 'Function wrapped with `once`' f.onceError = name + " shouldn't be called more than once" f.called = false return f } /***/ }), /* 52 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CliError", function() { return CliError; }); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ class CliError extends Error { constructor(message, meta = {}) { super(message); this.meta = meta; } } /***/ }), /* 53 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Project", function() { return Project; }); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29); /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(52); /* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33); /* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(54); /* harmony import */ var _scripts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(95); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ class Project { static async fromPath(path) { const pkgJson = await Object(_package_json__WEBPACK_IMPORTED_MODULE_6__["readPackageJson"])(path); return new Project(pkgJson, path); } constructor(packageJson, projectPath) { _defineProperty(this, "json", void 0); _defineProperty(this, "packageJsonLocation", void 0); _defineProperty(this, "nodeModulesLocation", void 0); _defineProperty(this, "targetLocation", void 0); _defineProperty(this, "path", void 0); _defineProperty(this, "allDependencies", void 0); _defineProperty(this, "productionDependencies", void 0); _defineProperty(this, "devDependencies", void 0); _defineProperty(this, "scripts", void 0); _defineProperty(this, "isWorkspaceRoot", false); _defineProperty(this, "isWorkspaceProject", false); this.json = Object.freeze(packageJson); this.path = projectPath; this.packageJsonLocation = Object(path__WEBPACK_IMPORTED_MODULE_2__["resolve"])(this.path, 'package.json'); this.nodeModulesLocation = Object(path__WEBPACK_IMPORTED_MODULE_2__["resolve"])(this.path, 'node_modules'); this.targetLocation = Object(path__WEBPACK_IMPORTED_MODULE_2__["resolve"])(this.path, 'target'); this.productionDependencies = this.json.dependencies || {}; this.devDependencies = this.json.devDependencies || {}; this.allDependencies = _objectSpread({}, this.devDependencies, this.productionDependencies); this.isWorkspaceRoot = this.json.hasOwnProperty('workspaces'); this.scripts = this.json.scripts || {}; } get name() { return this.json.name; } ensureValidProjectDependency(project, dependentProjectIsInWorkspace) { const versionInPackageJson = this.allDependencies[project.name]; let expectedVersionInPackageJson; if (dependentProjectIsInWorkspace) { expectedVersionInPackageJson = project.json.version; } else { const relativePathToProject = normalizePath(Object(path__WEBPACK_IMPORTED_MODULE_2__["relative"])(this.path, project.path)); expectedVersionInPackageJson = `link:${relativePathToProject}`; } // No issues! if (versionInPackageJson === expectedVersionInPackageJson) { return; } let problemMsg; if (Object(_package_json__WEBPACK_IMPORTED_MODULE_6__["isLinkDependency"])(versionInPackageJson) && dependentProjectIsInWorkspace) { problemMsg = `but should be using a workspace`; } else if (Object(_package_json__WEBPACK_IMPORTED_MODULE_6__["isLinkDependency"])(versionInPackageJson)) { problemMsg = `using 'link:', but the path is wrong`; } else { problemMsg = `but it's not using the local package`; } throw new _errors__WEBPACK_IMPORTED_MODULE_4__["CliError"](`[${this.name}] depends on [${project.name}] ${problemMsg}. Update its package.json to the expected value below.`, { actual: `"${project.name}": "${versionInPackageJson}"`, expected: `"${project.name}": "${expectedVersionInPackageJson}"`, package: `${this.name} (${this.packageJsonLocation})` }); } getBuildConfig() { return this.json.kibana && this.json.kibana.build || {}; } /** * Returns the directory that should be copied into the Kibana build artifact. * This config can be specified to only include the project's build artifacts * instead of everything located in the project directory. */ getIntermediateBuildDirectory() { return Object(path__WEBPACK_IMPORTED_MODULE_2__["resolve"])(this.path, this.getBuildConfig().intermediateBuildDirectory || '.'); } getCleanConfig() { return this.json.kibana && this.json.kibana.clean || {}; } hasScript(name) { return name in this.scripts; } getExecutables() { const raw = this.json.bin; if (!raw) { return {}; } if (typeof raw === 'string') { return { [this.name]: Object(path__WEBPACK_IMPORTED_MODULE_2__["resolve"])(this.path, raw) }; } if (typeof raw === 'object') { const binsConfig = {}; for (const binName of Object.keys(raw)) { binsConfig[binName] = Object(path__WEBPACK_IMPORTED_MODULE_2__["resolve"])(this.path, raw[binName]); } return binsConfig; } throw new _errors__WEBPACK_IMPORTED_MODULE_4__["CliError"](`[${this.name}] has an invalid "bin" field in its package.json, ` + `expected an object or a string`, { binConfig: Object(util__WEBPACK_IMPORTED_MODULE_3__["inspect"])(raw), package: `${this.name} (${this.packageJsonLocation})` }); } async runScript(scriptName, args = []) { _log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`\n\nRunning script [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(scriptName)}] in [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(this.name)}]:\n`)); return Object(_scripts__WEBPACK_IMPORTED_MODULE_7__["runScriptInPackage"])(scriptName, args, this); } runScriptStreaming(scriptName, args = []) { return Object(_scripts__WEBPACK_IMPORTED_MODULE_7__["runScriptInPackageStreaming"])(scriptName, args, this); } hasDependencies() { return Object.keys(this.allDependencies).length > 0; } async installDependencies({ extraArgs }) { _log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`\n\nInstalling dependencies in [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(this.name)}]:\n`)); await Object(_scripts__WEBPACK_IMPORTED_MODULE_7__["installInDir"])(this.path, extraArgs); await this.removeExtraneousNodeModules(); } /** * Yarn workspaces symlinks workspace projects to the root node_modules, even * when there is no depenency on the project. This results in unnecicary, and * often duplicated code in the build archives. */ async removeExtraneousNodeModules() { // this is only relevant for the root workspace if (!this.isWorkspaceRoot) { return; } const workspacesInfo = await Object(_scripts__WEBPACK_IMPORTED_MODULE_7__["yarnWorkspacesInfo"])(this.path); const unusedWorkspaces = new Set(Object.keys(workspacesInfo)); // check for any cross-project dependency for (const name of Object.keys(workspacesInfo)) { const workspace = workspacesInfo[name]; workspace.workspaceDependencies.forEach(w => unusedWorkspaces.delete(w)); } unusedWorkspaces.forEach(name => { const { dependencies, devDependencies } = this.json; const nodeModulesPath = Object(path__WEBPACK_IMPORTED_MODULE_2__["resolve"])(this.nodeModulesLocation, name); const isDependency = dependencies && dependencies.hasOwnProperty(name); const isDevDependency = devDependencies && devDependencies.hasOwnProperty(name); if (!isDependency && !isDevDependency && fs__WEBPACK_IMPORTED_MODULE_1___default.a.existsSync(nodeModulesPath)) { _log__WEBPACK_IMPORTED_MODULE_5__["log"].write(`No dependency on ${name}, removing link in node_modules`); fs__WEBPACK_IMPORTED_MODULE_1___default.a.unlinkSync(nodeModulesPath); } }); } } // We normalize all path separators to `/` in generated files function normalizePath(path) { return path.replace(/[\\\/]+/g, '/'); } /***/ }), /* 54 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "readPackageJson", function() { return readPackageJson; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "writePackageJson", function() { return writePackageJson; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinkDependency", function() { return isLinkDependency; }); /* harmony import */ var read_pkg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55); /* harmony import */ var read_pkg__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(read_pkg__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var write_pkg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83); /* harmony import */ var write_pkg__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(write_pkg__WEBPACK_IMPORTED_MODULE_1__); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function readPackageJson(dir) { return read_pkg__WEBPACK_IMPORTED_MODULE_0___default()(dir, { normalize: false }); } function writePackageJson(path, json) { return write_pkg__WEBPACK_IMPORTED_MODULE_1___default()(path, json); } const isLinkDependency = depVersion => depVersion.startsWith('link:'); /***/ }), /* 55 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); const loadJsonFile = __webpack_require__(56); const pathType = __webpack_require__(63); module.exports = (fp, opts) => { if (typeof fp !== 'string') { opts = fp; fp = '.'; } opts = opts || {}; return pathType.dir(fp) .then(isDir => { if (isDir) { fp = path.join(fp, 'package.json'); } return loadJsonFile(fp); }) .then(x => { if (opts.normalize !== false) { __webpack_require__(65)(x); } return x; }); }; module.exports.sync = (fp, opts) => { if (typeof fp !== 'string') { opts = fp; fp = '.'; } opts = opts || {}; fp = pathType.dirSync(fp) ? path.join(fp, 'package.json') : fp; const x = loadJsonFile.sync(fp); if (opts.normalize !== false) { __webpack_require__(65)(x); } return x; }; /***/ }), /* 56 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); const fs = __webpack_require__(22); const stripBom = __webpack_require__(57); const parseJson = __webpack_require__(58); const pify = __webpack_require__(62); const parse = (data, fp) => parseJson(stripBom(data), path.relative('.', fp)); module.exports = fp => pify(fs.readFile)(fp, 'utf8').then(data => parse(data, fp)); module.exports.sync = fp => parse(fs.readFileSync(fp, 'utf8'), fp); /***/ }), /* 57 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = x => { if (typeof x !== 'string') { throw new TypeError('Expected a string, got ' + typeof x); } // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string // conversion translates it to FEFF (UTF-16 BOM) if (x.charCodeAt(0) === 0xFEFF) { return x.slice(1); } return x; }; /***/ }), /* 58 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const errorEx = __webpack_require__(59); const fallback = __webpack_require__(61); const JSONError = errorEx('JSONError', { fileName: errorEx.append('in %s') }); module.exports = (input, reviver, filename) => { if (typeof reviver === 'string') { filename = reviver; reviver = null; } try { try { return JSON.parse(input, reviver); } catch (err) { fallback(input, reviver); throw err; } } catch (err) { err.message = err.message.replace(/\n/g, ''); const jsonErr = new JSONError(err); if (filename) { jsonErr.fileName = filename; } throw jsonErr; } }; /***/ }), /* 59 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(29); var isArrayish = __webpack_require__(60); var errorEx = function errorEx(name, properties) { if (!name || name.constructor !== String) { properties = name || {}; name = Error.name; } var errorExError = function ErrorEXError(message) { if (!this) { return new ErrorEXError(message); } message = message instanceof Error ? message.message : (message || this.message); Error.call(this, message); Error.captureStackTrace(this, errorExError); this.name = name; Object.defineProperty(this, 'message', { configurable: true, enumerable: false, get: function () { var newMessage = message.split(/\r?\n/g); for (var key in properties) { if (!properties.hasOwnProperty(key)) { continue; } var modifier = properties[key]; if ('message' in modifier) { newMessage = modifier.message(this[key], newMessage) || newMessage; if (!isArrayish(newMessage)) { newMessage = [newMessage]; } } } return newMessage.join('\n'); }, set: function (v) { message = v; } }); var stackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); var stackGetter = stackDescriptor.get; var stackValue = stackDescriptor.value; delete stackDescriptor.value; delete stackDescriptor.writable; stackDescriptor.get = function () { var stack = (stackGetter) ? stackGetter.call(this).split(/\r?\n+/g) : stackValue.split(/\r?\n+/g); // starting in Node 7, the stack builder caches the message. // just replace it. stack[0] = this.name + ': ' + this.message; var lineCount = 1; for (var key in properties) { if (!properties.hasOwnProperty(key)) { continue; } var modifier = properties[key]; if ('line' in modifier) { var line = modifier.line(this[key]); if (line) { stack.splice(lineCount++, 0, ' ' + line); } } if ('stack' in modifier) { modifier.stack(this[key], stack); } } return stack.join('\n'); }; Object.defineProperty(this, 'stack', stackDescriptor); }; if (Object.setPrototypeOf) { Object.setPrototypeOf(errorExError.prototype, Error.prototype); Object.setPrototypeOf(errorExError, Error); } else { util.inherits(errorExError, Error); } return errorExError; }; errorEx.append = function (str, def) { return { message: function (v, message) { v = v || def; if (v) { message[0] += ' ' + str.replace('%s', v.toString()); } return message; } }; }; errorEx.line = function (str, def) { return { line: function (v) { v = v || def; if (v) { return str.replace('%s', v.toString()); } return null; } }; }; module.exports = errorEx; /***/ }), /* 60 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function isArrayish(obj) { if (!obj) { return false; } return obj instanceof Array || Array.isArray(obj) || (obj.length >= 0 && obj.splice instanceof Function); }; /***/ }), /* 61 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = parseJson function parseJson (txt, reviver, context) { context = context || 20 try { return JSON.parse(txt, reviver) } catch (e) { const syntaxErr = e.message.match(/^Unexpected token.*position\s+(\d+)/i) const errIdx = syntaxErr ? +syntaxErr[1] : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1 : null if (errIdx != null) { const start = errIdx <= context ? 0 : errIdx - context const end = errIdx + context >= txt.length ? txt.length : errIdx + context e.message += ` while parsing near '${ start === 0 ? '' : '...' }${txt.slice(start, end)}${ end === txt.length ? '' : '...' }'` } else { e.message += ` while parsing '${txt.slice(0, context * 2)}'` } throw e } } /***/ }), /* 62 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const processFn = (fn, opts) => function () { const P = opts.promiseModule; const args = new Array(arguments.length); for (let i = 0; i < arguments.length; i++) { args[i] = arguments[i]; } return new P((resolve, reject) => { if (opts.errorFirst) { args.push(function (err, result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 1; i < arguments.length; i++) { results[i - 1] = arguments[i]; } if (err) { results.unshift(err); reject(results); } else { resolve(results); } } else if (err) { reject(err); } else { resolve(result); } }); } else { args.push(function (result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 0; i < arguments.length; i++) { results[i] = arguments[i]; } resolve(results); } else { resolve(result); } }); } fn.apply(this, args); }); }; module.exports = (obj, opts) => { opts = Object.assign({ exclude: [/.+(Sync|Stream)$/], errorFirst: true, promiseModule: Promise }, opts); const filter = key => { const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); return opts.include ? opts.include.some(match) : !opts.exclude.some(match); }; let ret; if (typeof obj === 'function') { ret = function () { if (opts.excludeMain) { return obj.apply(this, arguments); } return processFn(obj, opts).apply(this, arguments); }; } else { ret = Object.create(Object.getPrototypeOf(obj)); } for (const key in obj) { // eslint-disable-line guard-for-in const x = obj[key]; ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x; } return ret; }; /***/ }), /* 63 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const fs = __webpack_require__(23); const pify = __webpack_require__(64); function type(fn, fn2, fp) { if (typeof fp !== 'string') { return Promise.reject(new TypeError(`Expected a string, got ${typeof fp}`)); } return pify(fs[fn])(fp) .then(stats => stats[fn2]()) .catch(err => { if (err.code === 'ENOENT') { return false; } throw err; }); } function typeSync(fn, fn2, fp) { if (typeof fp !== 'string') { throw new TypeError(`Expected a string, got ${typeof fp}`); } try { return fs[fn](fp)[fn2](); } catch (err) { if (err.code === 'ENOENT') { return false; } throw err; } } exports.file = type.bind(null, 'stat', 'isFile'); exports.dir = type.bind(null, 'stat', 'isDirectory'); exports.symlink = type.bind(null, 'lstat', 'isSymbolicLink'); exports.fileSync = typeSync.bind(null, 'statSync', 'isFile'); exports.dirSync = typeSync.bind(null, 'statSync', 'isDirectory'); exports.symlinkSync = typeSync.bind(null, 'lstatSync', 'isSymbolicLink'); /***/ }), /* 64 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const processFn = (fn, opts) => function () { const P = opts.promiseModule; const args = new Array(arguments.length); for (let i = 0; i < arguments.length; i++) { args[i] = arguments[i]; } return new P((resolve, reject) => { if (opts.errorFirst) { args.push(function (err, result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 1; i < arguments.length; i++) { results[i - 1] = arguments[i]; } if (err) { results.unshift(err); reject(results); } else { resolve(results); } } else if (err) { reject(err); } else { resolve(result); } }); } else { args.push(function (result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 0; i < arguments.length; i++) { results[i] = arguments[i]; } resolve(results); } else { resolve(result); } }); } fn.apply(this, args); }); }; module.exports = (obj, opts) => { opts = Object.assign({ exclude: [/.+(Sync|Stream)$/], errorFirst: true, promiseModule: Promise }, opts); const filter = key => { const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); return opts.include ? opts.include.some(match) : !opts.exclude.some(match); }; let ret; if (typeof obj === 'function') { ret = function () { if (opts.excludeMain) { return obj.apply(this, arguments); } return processFn(obj, opts).apply(this, arguments); }; } else { ret = Object.create(Object.getPrototypeOf(obj)); } for (const key in obj) { // eslint-disable-line guard-for-in const x = obj[key]; ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x; } return ret; }; /***/ }), /* 65 */ /***/ (function(module, exports, __webpack_require__) { module.exports = normalize var fixer = __webpack_require__(66) normalize.fixer = fixer var makeWarning = __webpack_require__(81) var fieldsToFix = ['name','version','description','repository','modules','scripts' ,'files','bin','man','bugs','keywords','readme','homepage','license'] var otherThingsToFix = ['dependencies','people', 'typos'] var thingsToFix = fieldsToFix.map(function(fieldName) { return ucFirst(fieldName) + "Field" }) // two ways to do this in CoffeeScript on only one line, sub-70 chars: // thingsToFix = fieldsToFix.map (name) -> ucFirst(name) + "Field" // thingsToFix = (ucFirst(name) + "Field" for name in fieldsToFix) thingsToFix = thingsToFix.concat(otherThingsToFix) function normalize (data, warn, strict) { if(warn === true) warn = null, strict = true if(!strict) strict = false if(!warn || data.private) warn = function(msg) { /* noop */ } if (data.scripts && data.scripts.install === "node-gyp rebuild" && !data.scripts.preinstall) { data.gypfile = true } fixer.warn = function() { warn(makeWarning.apply(null, arguments)) } thingsToFix.forEach(function(thingName) { fixer["fix" + ucFirst(thingName)](data, strict) }) data._id = data.name + "@" + data.version } function ucFirst (string) { return string.charAt(0).toUpperCase() + string.slice(1); } /***/ }), /* 66 */ /***/ (function(module, exports, __webpack_require__) { var semver = __webpack_require__(67) var validateLicense = __webpack_require__(68); var hostedGitInfo = __webpack_require__(73) var isBuiltinModule = __webpack_require__(77) var depTypes = ["dependencies","devDependencies","optionalDependencies"] var extractDescription = __webpack_require__(79) var url = __webpack_require__(74) var typos = __webpack_require__(80) var fixer = module.exports = { // default warning function warn: function() {}, fixRepositoryField: function(data) { if (data.repositories) { this.warn("repositories"); data.repository = data.repositories[0] } if (!data.repository) return this.warn("missingRepository") if (typeof data.repository === "string") { data.repository = { type: "git", url: data.repository } } var r = data.repository.url || "" if (r) { var hosted = hostedGitInfo.fromUrl(r) if (hosted) { r = data.repository.url = hosted.getDefaultRepresentation() == "shortcut" ? hosted.https() : hosted.toString() } } if (r.match(/github.com\/[^\/]+\/[^\/]+\.git\.git$/)) { this.warn("brokenGitUrl", r) } } , fixTypos: function(data) { Object.keys(typos.topLevel).forEach(function (d) { if (data.hasOwnProperty(d)) { this.warn("typo", d, typos.topLevel[d]) } }, this) } , fixScriptsField: function(data) { if (!data.scripts) return if (typeof data.scripts !== "object") { this.warn("nonObjectScripts") delete data.scripts return } Object.keys(data.scripts).forEach(function (k) { if (typeof data.scripts[k] !== "string") { this.warn("nonStringScript") delete data.scripts[k] } else if (typos.script[k] && !data.scripts[typos.script[k]]) { this.warn("typo", k, typos.script[k], "scripts") } }, this) } , fixFilesField: function(data) { var files = data.files if (files && !Array.isArray(files)) { this.warn("nonArrayFiles") delete data.files } else if (data.files) { data.files = data.files.filter(function(file) { if (!file || typeof file !== "string") { this.warn("invalidFilename", file) return false } else { return true } }, this) } } , fixBinField: function(data) { if (!data.bin) return; if (typeof data.bin === "string") { var b = {} var match if (match = data.name.match(/^@[^/]+[/](.*)$/)) { b[match[1]] = data.bin } else { b[data.name] = data.bin } data.bin = b } } , fixManField: function(data) { if (!data.man) return; if (typeof data.man === "string") { data.man = [ data.man ] } } , fixBundleDependenciesField: function(data) { var bdd = "bundledDependencies" var bd = "bundleDependencies" if (data[bdd] && !data[bd]) { data[bd] = data[bdd] delete data[bdd] } if (data[bd] && !Array.isArray(data[bd])) { this.warn("nonArrayBundleDependencies") delete data[bd] } else if (data[bd]) { data[bd] = data[bd].filter(function(bd) { if (!bd || typeof bd !== 'string') { this.warn("nonStringBundleDependency", bd) return false } else { if (!data.dependencies) { data.dependencies = {} } if (!data.dependencies.hasOwnProperty(bd)) { this.warn("nonDependencyBundleDependency", bd) data.dependencies[bd] = "*" } return true } }, this) } } , fixDependencies: function(data, strict) { var loose = !strict objectifyDeps(data, this.warn) addOptionalDepsToDeps(data, this.warn) this.fixBundleDependenciesField(data) ;['dependencies','devDependencies'].forEach(function(deps) { if (!(deps in data)) return if (!data[deps] || typeof data[deps] !== "object") { this.warn("nonObjectDependencies", deps) delete data[deps] return } Object.keys(data[deps]).forEach(function (d) { var r = data[deps][d] if (typeof r !== 'string') { this.warn("nonStringDependency", d, JSON.stringify(r)) delete data[deps][d] } var hosted = hostedGitInfo.fromUrl(data[deps][d]) if (hosted) data[deps][d] = hosted.toString() }, this) }, this) } , fixModulesField: function (data) { if (data.modules) { this.warn("deprecatedModules") delete data.modules } } , fixKeywordsField: function (data) { if (typeof data.keywords === "string") { data.keywords = data.keywords.split(/,\s+/) } if (data.keywords && !Array.isArray(data.keywords)) { delete data.keywords this.warn("nonArrayKeywords") } else if (data.keywords) { data.keywords = data.keywords.filter(function(kw) { if (typeof kw !== "string" || !kw) { this.warn("nonStringKeyword"); return false } else { return true } }, this) } } , fixVersionField: function(data, strict) { // allow "loose" semver 1.0 versions in non-strict mode // enforce strict semver 2.0 compliance in strict mode var loose = !strict if (!data.version) { data.version = "" return true } if (!semver.valid(data.version, loose)) { throw new Error('Invalid version: "'+ data.version + '"') } data.version = semver.clean(data.version, loose) return true } , fixPeople: function(data) { modifyPeople(data, unParsePerson) modifyPeople(data, parsePerson) } , fixNameField: function(data, options) { if (typeof options === "boolean") options = {strict: options} else if (typeof options === "undefined") options = {} var strict = options.strict if (!data.name && !strict) { data.name = "" return } if (typeof data.name !== "string") { throw new Error("name field must be a string.") } if (!strict) data.name = data.name.trim() ensureValidName(data.name, strict, options.allowLegacyCase) if (isBuiltinModule(data.name)) this.warn("conflictingName", data.name) } , fixDescriptionField: function (data) { if (data.description && typeof data.description !== 'string') { this.warn("nonStringDescription") delete data.description } if (data.readme && !data.description) data.description = extractDescription(data.readme) if(data.description === undefined) delete data.description; if (!data.description) this.warn("missingDescription") } , fixReadmeField: function (data) { if (!data.readme) { this.warn("missingReadme") data.readme = "ERROR: No README data found!" } } , fixBugsField: function(data) { if (!data.bugs && data.repository && data.repository.url) { var hosted = hostedGitInfo.fromUrl(data.repository.url) if(hosted && hosted.bugs()) { data.bugs = {url: hosted.bugs()} } } else if(data.bugs) { var emailRe = /^.+@.*\..+$/ if(typeof data.bugs == "string") { if(emailRe.test(data.bugs)) data.bugs = {email:data.bugs} else if(url.parse(data.bugs).protocol) data.bugs = {url: data.bugs} else this.warn("nonEmailUrlBugsString") } else { bugsTypos(data.bugs, this.warn) var oldBugs = data.bugs data.bugs = {} if(oldBugs.url) { if(typeof(oldBugs.url) == "string" && url.parse(oldBugs.url).protocol) data.bugs.url = oldBugs.url else this.warn("nonUrlBugsUrlField") } if(oldBugs.email) { if(typeof(oldBugs.email) == "string" && emailRe.test(oldBugs.email)) data.bugs.email = oldBugs.email else this.warn("nonEmailBugsEmailField") } } if(!data.bugs.email && !data.bugs.url) { delete data.bugs this.warn("emptyNormalizedBugs") } } } , fixHomepageField: function(data) { if (!data.homepage && data.repository && data.repository.url) { var hosted = hostedGitInfo.fromUrl(data.repository.url) if (hosted && hosted.docs()) data.homepage = hosted.docs() } if (!data.homepage) return if(typeof data.homepage !== "string") { this.warn("nonUrlHomepage") return delete data.homepage } if(!url.parse(data.homepage).protocol) { data.homepage = "http://" + data.homepage } } , fixLicenseField: function(data) { if (!data.license) { return this.warn("missingLicense") } else{ if ( typeof(data.license) !== 'string' || data.license.length < 1 ) { this.warn("invalidLicense") } else { if (!validateLicense(data.license).validForNewPackages) this.warn("invalidLicense") } } } } function isValidScopedPackageName(spec) { if (spec.charAt(0) !== '@') return false var rest = spec.slice(1).split('/') if (rest.length !== 2) return false return rest[0] && rest[1] && rest[0] === encodeURIComponent(rest[0]) && rest[1] === encodeURIComponent(rest[1]) } function isCorrectlyEncodedName(spec) { return !spec.match(/[\/@\s\+%:]/) && spec === encodeURIComponent(spec) } function ensureValidName (name, strict, allowLegacyCase) { if (name.charAt(0) === "." || !(isValidScopedPackageName(name) || isCorrectlyEncodedName(name)) || (strict && (!allowLegacyCase) && name !== name.toLowerCase()) || name.toLowerCase() === "node_modules" || name.toLowerCase() === "favicon.ico") { throw new Error("Invalid name: " + JSON.stringify(name)) } } function modifyPeople (data, fn) { if (data.author) data.author = fn(data.author) ;["maintainers", "contributors"].forEach(function (set) { if (!Array.isArray(data[set])) return; data[set] = data[set].map(fn) }) return data } function unParsePerson (person) { if (typeof person === "string") return person var name = person.name || "" var u = person.url || person.web var url = u ? (" ("+u+")") : "" var e = person.email || person.mail var email = e ? (" <"+e+">") : "" return name+email+url } function parsePerson (person) { if (typeof person !== "string") return person var name = person.match(/^([^\(<]+)/) var url = person.match(/\(([^\)]+)\)/) var email = person.match(/<([^>]+)>/) var obj = {} if (name && name[0].trim()) obj.name = name[0].trim() if (email) obj.email = email[1]; if (url) obj.url = url[1]; return obj } function addOptionalDepsToDeps (data, warn) { var o = data.optionalDependencies if (!o) return; var d = data.dependencies || {} Object.keys(o).forEach(function (k) { d[k] = o[k] }) data.dependencies = d } function depObjectify (deps, type, warn) { if (!deps) return {} if (typeof deps === "string") { deps = deps.trim().split(/[\n\r\s\t ,]+/) } if (!Array.isArray(deps)) return deps warn("deprecatedArrayDependencies", type) var o = {} deps.filter(function (d) { return typeof d === "string" }).forEach(function(d) { d = d.trim().split(/(:?[@\s><=])/) var dn = d.shift() var dv = d.join("") dv = dv.trim() dv = dv.replace(/^@/, "") o[dn] = dv }) return o } function objectifyDeps (data, warn) { depTypes.forEach(function (type) { if (!data[type]) return; data[type] = depObjectify(data[type], type, warn) }) } function bugsTypos(bugs, warn) { if (!bugs) return Object.keys(bugs).forEach(function (k) { if (typos.bugs[k]) { warn("typo", k, typos.bugs[k], "bugs") bugs[typos.bugs[k]] = bugs[k] delete bugs[k] } }) } /***/ }), /* 67 */ /***/ (function(module, exports) { exports = module.exports = SemVer; // The debug function is excluded entirely from the minified version. /* nomin */ var debug; /* nomin */ if (typeof process === 'object' && /* nomin */ process.env && /* nomin */ process.env.NODE_DEBUG && /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) /* nomin */ debug = function() { /* nomin */ var args = Array.prototype.slice.call(arguments, 0); /* nomin */ args.unshift('SEMVER'); /* nomin */ console.log.apply(console, args); /* nomin */ }; /* nomin */ else /* nomin */ debug = function() {}; // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. exports.SEMVER_SPEC_VERSION = '2.0.0'; var MAX_LENGTH = 256; var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; // The actual regexps go on exports.re var re = exports.re = []; var src = exports.src = []; var R = 0; // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. var NUMERICIDENTIFIER = R++; src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; var NUMERICIDENTIFIERLOOSE = R++; src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. var NONNUMERICIDENTIFIER = R++; src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; // ## Main Version // Three dot-separated numeric identifiers. var MAINVERSION = R++; src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')'; var MAINVERSIONLOOSE = R++; src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. var PRERELEASEIDENTIFIER = R++; src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + '|' + src[NONNUMERICIDENTIFIER] + ')'; var PRERELEASEIDENTIFIERLOOSE = R++; src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + '|' + src[NONNUMERICIDENTIFIER] + ')'; // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. var PRERELEASE = R++; src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; var PRERELEASELOOSE = R++; src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. var BUILDIDENTIFIER = R++; src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. var BUILD = R++; src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. var FULL = R++; var FULLPLAIN = 'v?' + src[MAINVERSION] + src[PRERELEASE] + '?' + src[BUILD] + '?'; src[FULL] = '^' + FULLPLAIN + '$'; // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + src[PRERELEASELOOSE] + '?' + src[BUILD] + '?'; var LOOSE = R++; src[LOOSE] = '^' + LOOSEPLAIN + '$'; var GTLT = R++; src[GTLT] = '((?:<|>)?=?)'; // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. var XRANGEIDENTIFIERLOOSE = R++; src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; var XRANGEIDENTIFIER = R++; src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; var XRANGEPLAIN = R++; src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:' + src[PRERELEASE] + ')?' + src[BUILD] + '?' + ')?)?'; var XRANGEPLAINLOOSE = R++; src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:' + src[PRERELEASELOOSE] + ')?' + src[BUILD] + '?' + ')?)?'; var XRANGE = R++; src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; var XRANGELOOSE = R++; src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; // Tilde ranges. // Meaning is "reasonably at or greater than" var LONETILDE = R++; src[LONETILDE] = '(?:~>?)'; var TILDETRIM = R++; src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); var tildeTrimReplace = '$1~'; var TILDE = R++; src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; var TILDELOOSE = R++; src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; // Caret ranges. // Meaning is "at least and backwards compatible with" var LONECARET = R++; src[LONECARET] = '(?:\\^)'; var CARETTRIM = R++; src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); var caretTrimReplace = '$1^'; var CARET = R++; src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; var CARETLOOSE = R++; src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; // A simple gt/lt/eq thing, or just "" to indicate "any version" var COMPARATORLOOSE = R++; src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; var COMPARATOR = R++; src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` var COMPARATORTRIM = R++; src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; // this one has to use the /g flag re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); var comparatorTrimReplace = '$1$2$3'; // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. var HYPHENRANGE = R++; src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAIN] + ')' + '\\s*$'; var HYPHENRANGELOOSE = R++; src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAINLOOSE] + ')' + '\\s*$'; // Star ranges basically just allow anything at all. var STAR = R++; src[STAR] = '(<|>)?=?\\s*\\*'; // Compile to actual regexp objects. // All are flag-free, unless they were created above with a flag. for (var i = 0; i < R; i++) { debug(i, src[i]); if (!re[i]) re[i] = new RegExp(src[i]); } exports.parse = parse; function parse(version, loose) { if (version instanceof SemVer) return version; if (typeof version !== 'string') return null; if (version.length > MAX_LENGTH) return null; var r = loose ? re[LOOSE] : re[FULL]; if (!r.test(version)) return null; try { return new SemVer(version, loose); } catch (er) { return null; } } exports.valid = valid; function valid(version, loose) { var v = parse(version, loose); return v ? v.version : null; } exports.clean = clean; function clean(version, loose) { var s = parse(version.trim().replace(/^[=v]+/, ''), loose); return s ? s.version : null; } exports.SemVer = SemVer; function SemVer(version, loose) { if (version instanceof SemVer) { if (version.loose === loose) return version; else version = version.version; } else if (typeof version !== 'string') { throw new TypeError('Invalid Version: ' + version); } if (version.length > MAX_LENGTH) throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') if (!(this instanceof SemVer)) return new SemVer(version, loose); debug('SemVer', version, loose); this.loose = loose; var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); if (!m) throw new TypeError('Invalid Version: ' + version); this.raw = version; // these are actually numbers this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError('Invalid major version') if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError('Invalid minor version') if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError('Invalid patch version') // numberify any prerelease numeric ids if (!m[4]) this.prerelease = []; else this.prerelease = m[4].split('.').map(function(id) { if (/^[0-9]+$/.test(id)) { var num = +id; if (num >= 0 && num < MAX_SAFE_INTEGER) return num; } return id; }); this.build = m[5] ? m[5].split('.') : []; this.format(); } SemVer.prototype.format = function() { this.version = this.major + '.' + this.minor + '.' + this.patch; if (this.prerelease.length) this.version += '-' + this.prerelease.join('.'); return this.version; }; SemVer.prototype.toString = function() { return this.version; }; SemVer.prototype.compare = function(other) { debug('SemVer.compare', this.version, this.loose, other); if (!(other instanceof SemVer)) other = new SemVer(other, this.loose); return this.compareMain(other) || this.comparePre(other); }; SemVer.prototype.compareMain = function(other) { if (!(other instanceof SemVer)) other = new SemVer(other, this.loose); return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); }; SemVer.prototype.comparePre = function(other) { if (!(other instanceof SemVer)) other = new SemVer(other, this.loose); // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) return -1; else if (!this.prerelease.length && other.prerelease.length) return 1; else if (!this.prerelease.length && !other.prerelease.length) return 0; var i = 0; do { var a = this.prerelease[i]; var b = other.prerelease[i]; debug('prerelease compare', i, a, b); if (a === undefined && b === undefined) return 0; else if (b === undefined) return 1; else if (a === undefined) return -1; else if (a === b) continue; else return compareIdentifiers(a, b); } while (++i); }; // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. SemVer.prototype.inc = function(release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0; this.patch = 0; this.minor = 0; this.major++; this.inc('pre', identifier); break; case 'preminor': this.prerelease.length = 0; this.patch = 0; this.minor++; this.inc('pre', identifier); break; case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0; this.inc('patch', identifier); this.inc('pre', identifier); break; // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) this.inc('patch', identifier); this.inc('pre', identifier); break; case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++; this.minor = 0; this.patch = 0; this.prerelease = []; break; case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) this.minor++; this.patch = 0; this.prerelease = []; break; case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) this.patch++; this.prerelease = []; break; // This probably shouldn't be used publicly. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) this.prerelease = [0]; else { var i = this.prerelease.length; while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++; i = -2; } } if (i === -1) // didn't increment anything this.prerelease.push(0); } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) this.prerelease = [identifier, 0]; } else this.prerelease = [identifier, 0]; } break; default: throw new Error('invalid increment argument: ' + release); } this.format(); this.raw = this.version; return this; }; exports.inc = inc; function inc(version, release, loose, identifier) { if (typeof(loose) === 'string') { identifier = loose; loose = undefined; } try { return new SemVer(version, loose).inc(release, identifier).version; } catch (er) { return null; } } exports.diff = diff; function diff(version1, version2) { if (eq(version1, version2)) { return null; } else { var v1 = parse(version1); var v2 = parse(version2); if (v1.prerelease.length || v2.prerelease.length) { for (var key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return 'pre'+key; } } } return 'prerelease'; } for (var key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return key; } } } } } exports.compareIdentifiers = compareIdentifiers; var numeric = /^[0-9]+$/; function compareIdentifiers(a, b) { var anum = numeric.test(a); var bnum = numeric.test(b); if (anum && bnum) { a = +a; b = +b; } return (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : a > b ? 1 : 0; } exports.rcompareIdentifiers = rcompareIdentifiers; function rcompareIdentifiers(a, b) { return compareIdentifiers(b, a); } exports.major = major; function major(a, loose) { return new SemVer(a, loose).major; } exports.minor = minor; function minor(a, loose) { return new SemVer(a, loose).minor; } exports.patch = patch; function patch(a, loose) { return new SemVer(a, loose).patch; } exports.compare = compare; function compare(a, b, loose) { return new SemVer(a, loose).compare(new SemVer(b, loose)); } exports.compareLoose = compareLoose; function compareLoose(a, b) { return compare(a, b, true); } exports.rcompare = rcompare; function rcompare(a, b, loose) { return compare(b, a, loose); } exports.sort = sort; function sort(list, loose) { return list.sort(function(a, b) { return exports.compare(a, b, loose); }); } exports.rsort = rsort; function rsort(list, loose) { return list.sort(function(a, b) { return exports.rcompare(a, b, loose); }); } exports.gt = gt; function gt(a, b, loose) { return compare(a, b, loose) > 0; } exports.lt = lt; function lt(a, b, loose) { return compare(a, b, loose) < 0; } exports.eq = eq; function eq(a, b, loose) { return compare(a, b, loose) === 0; } exports.neq = neq; function neq(a, b, loose) { return compare(a, b, loose) !== 0; } exports.gte = gte; function gte(a, b, loose) { return compare(a, b, loose) >= 0; } exports.lte = lte; function lte(a, b, loose) { return compare(a, b, loose) <= 0; } exports.cmp = cmp; function cmp(a, op, b, loose) { var ret; switch (op) { case '===': if (typeof a === 'object') a = a.version; if (typeof b === 'object') b = b.version; ret = a === b; break; case '!==': if (typeof a === 'object') a = a.version; if (typeof b === 'object') b = b.version; ret = a !== b; break; case '': case '=': case '==': ret = eq(a, b, loose); break; case '!=': ret = neq(a, b, loose); break; case '>': ret = gt(a, b, loose); break; case '>=': ret = gte(a, b, loose); break; case '<': ret = lt(a, b, loose); break; case '<=': ret = lte(a, b, loose); break; default: throw new TypeError('Invalid operator: ' + op); } return ret; } exports.Comparator = Comparator; function Comparator(comp, loose) { if (comp instanceof Comparator) { if (comp.loose === loose) return comp; else comp = comp.value; } if (!(this instanceof Comparator)) return new Comparator(comp, loose); debug('comparator', comp, loose); this.loose = loose; this.parse(comp); if (this.semver === ANY) this.value = ''; else this.value = this.operator + this.semver.version; debug('comp', this); } var ANY = {}; Comparator.prototype.parse = function(comp) { var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; var m = comp.match(r); if (!m) throw new TypeError('Invalid comparator: ' + comp); this.operator = m[1]; if (this.operator === '=') this.operator = ''; // if it literally is just '>' or '' then allow anything. if (!m[2]) this.semver = ANY; else this.semver = new SemVer(m[2], this.loose); }; Comparator.prototype.toString = function() { return this.value; }; Comparator.prototype.test = function(version) { debug('Comparator.test', version, this.loose); if (this.semver === ANY) return true; if (typeof version === 'string') version = new SemVer(version, this.loose); return cmp(version, this.operator, this.semver, this.loose); }; Comparator.prototype.intersects = function(comp, loose) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required'); } var rangeTmp; if (this.operator === '') { rangeTmp = new Range(comp.value, loose); return satisfies(this.value, rangeTmp, loose); } else if (comp.operator === '') { rangeTmp = new Range(this.value, loose); return satisfies(comp.semver, rangeTmp, loose); } var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>'); var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<'); var sameSemVer = this.semver.version === comp.semver.version; var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<='); var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, loose) && ((this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<')); var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, loose) && ((this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>')); return sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; }; exports.Range = Range; function Range(range, loose) { if (range instanceof Range) { if (range.loose === loose) { return range; } else { return new Range(range.raw, loose); } } if (range instanceof Comparator) { return new Range(range.value, loose); } if (!(this instanceof Range)) return new Range(range, loose); this.loose = loose; // First, split based on boolean or || this.raw = range; this.set = range.split(/\s*\|\|\s*/).map(function(range) { return this.parseRange(range.trim()); }, this).filter(function(c) { // throw out any that are not relevant for whatever reason return c.length; }); if (!this.set.length) { throw new TypeError('Invalid SemVer Range: ' + range); } this.format(); } Range.prototype.format = function() { this.range = this.set.map(function(comps) { return comps.join(' ').trim(); }).join('||').trim(); return this.range; }; Range.prototype.toString = function() { return this.range; }; Range.prototype.parseRange = function(range) { var loose = this.loose; range = range.trim(); debug('range', range, loose); // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; range = range.replace(hr, hyphenReplace); debug('hyphen replace', range); // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); debug('comparator trim', range, re[COMPARATORTRIM]); // `~ 1.2.3` => `~1.2.3` range = range.replace(re[TILDETRIM], tildeTrimReplace); // `^ 1.2.3` => `^1.2.3` range = range.replace(re[CARETTRIM], caretTrimReplace); // normalize spaces range = range.split(/\s+/).join(' '); // At this point, the range is completely trimmed and // ready to be split into comparators. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; var set = range.split(' ').map(function(comp) { return parseComparator(comp, loose); }).join(' ').split(/\s+/); if (this.loose) { // in loose mode, throw out any that are not valid comparators set = set.filter(function(comp) { return !!comp.match(compRe); }); } set = set.map(function(comp) { return new Comparator(comp, loose); }); return set; }; Range.prototype.intersects = function(range, loose) { if (!(range instanceof Range)) { throw new TypeError('a Range is required'); } return this.set.some(function(thisComparators) { return thisComparators.every(function(thisComparator) { return range.set.some(function(rangeComparators) { return rangeComparators.every(function(rangeComparator) { return thisComparator.intersects(rangeComparator, loose); }); }); }); }); }; // Mostly just for testing and legacy API reasons exports.toComparators = toComparators; function toComparators(range, loose) { return new Range(range, loose).set.map(function(comp) { return comp.map(function(c) { return c.value; }).join(' ').trim().split(' '); }); } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. function parseComparator(comp, loose) { debug('comp', comp); comp = replaceCarets(comp, loose); debug('caret', comp); comp = replaceTildes(comp, loose); debug('tildes', comp); comp = replaceXRanges(comp, loose); debug('xrange', comp); comp = replaceStars(comp, loose); debug('stars', comp); return comp; } function isX(id) { return !id || id.toLowerCase() === 'x' || id === '*'; } // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 function replaceTildes(comp, loose) { return comp.trim().split(/\s+/).map(function(comp) { return replaceTilde(comp, loose); }).join(' '); } function replaceTilde(comp, loose) { var r = loose ? re[TILDELOOSE] : re[TILDE]; return comp.replace(r, function(_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr); var ret; if (isX(M)) ret = ''; else if (isX(m)) ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) // ~1.2 == >=1.2.0 <1.3.0 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else if (pr) { debug('replaceTilde pr', pr); if (pr.charAt(0) !== '-') pr = '-' + pr; ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + M + '.' + (+m + 1) + '.0'; } else // ~1.2.3 == >=1.2.3 <1.3.0 ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0'; debug('tilde return', ret); return ret; }); } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 // ^1.2.3 --> >=1.2.3 <2.0.0 // ^1.2.0 --> >=1.2.0 <2.0.0 function replaceCarets(comp, loose) { return comp.trim().split(/\s+/).map(function(comp) { return replaceCaret(comp, loose); }).join(' '); } function replaceCaret(comp, loose) { debug('caret', comp, loose); var r = loose ? re[CARETLOOSE] : re[CARET]; return comp.replace(r, function(_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr); var ret; if (isX(M)) ret = ''; else if (isX(m)) ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) { if (M === '0') ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; } else if (pr) { debug('replaceCaret pr', pr); if (pr.charAt(0) !== '-') pr = '-' + pr; if (M === '0') { if (m === '0') ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + M + '.' + m + '.' + (+p + 1); else ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + M + '.' + (+m + 1) + '.0'; } else ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + (+M + 1) + '.0.0'; } else { debug('no pr'); if (M === '0') { if (m === '0') ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + m + '.' + (+p + 1); else ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0'; } else ret = '>=' + M + '.' + m + '.' + p + ' <' + (+M + 1) + '.0.0'; } debug('caret return', ret); return ret; }); } function replaceXRanges(comp, loose) { debug('replaceXRanges', comp, loose); return comp.split(/\s+/).map(function(comp) { return replaceXRange(comp, loose); }).join(' '); } function replaceXRange(comp, loose) { comp = comp.trim(); var r = loose ? re[XRANGELOOSE] : re[XRANGE]; return comp.replace(r, function(ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr); var xM = isX(M); var xm = xM || isX(m); var xp = xm || isX(p); var anyX = xp; if (gtlt === '=' && anyX) gtlt = ''; if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0'; } else { // nothing is forbidden ret = '*'; } } else if (gtlt && anyX) { // replace X with 0 if (xm) m = 0; if (xp) p = 0; if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 // >1.2.3 => >= 1.2.4 gtlt = '>='; if (xm) { M = +M + 1; m = 0; p = 0; } else if (xp) { m = +m + 1; p = 0; } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<'; if (xm) M = +M + 1; else m = +m + 1; } ret = gtlt + M + '.' + m + '.' + p; } else if (xm) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; } else if (xp) { ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; } debug('xRange return', ret); return ret; }); } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. function replaceStars(comp, loose) { debug('replaceStars', comp, loose); // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[STAR], ''); } // This function is passed to string.replace(re[HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0 function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { if (isX(fM)) from = ''; else if (isX(fm)) from = '>=' + fM + '.0.0'; else if (isX(fp)) from = '>=' + fM + '.' + fm + '.0'; else from = '>=' + from; if (isX(tM)) to = ''; else if (isX(tm)) to = '<' + (+tM + 1) + '.0.0'; else if (isX(tp)) to = '<' + tM + '.' + (+tm + 1) + '.0'; else if (tpr) to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; else to = '<=' + to; return (from + ' ' + to).trim(); } // if ANY of the sets match ALL of its comparators, then pass Range.prototype.test = function(version) { if (!version) return false; if (typeof version === 'string') version = new SemVer(version, this.loose); for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version)) return true; } return false; }; function testSet(set, version) { for (var i = 0; i < set.length; i++) { if (!set[i].test(version)) return false; } if (version.prerelease.length) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (var i = 0; i < set.length; i++) { debug(set[i].semver); if (set[i].semver === ANY) continue; if (set[i].semver.prerelease.length > 0) { var allowed = set[i].semver; if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true; } } // Version has a -pre, but it's not one of the ones we like. return false; } return true; } exports.satisfies = satisfies; function satisfies(version, range, loose) { try { range = new Range(range, loose); } catch (er) { return false; } return range.test(version); } exports.maxSatisfying = maxSatisfying; function maxSatisfying(versions, range, loose) { var max = null; var maxSV = null; try { var rangeObj = new Range(range, loose); } catch (er) { return null; } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, loose) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v; maxSV = new SemVer(max, loose); } } }) return max; } exports.minSatisfying = minSatisfying; function minSatisfying(versions, range, loose) { var min = null; var minSV = null; try { var rangeObj = new Range(range, loose); } catch (er) { return null; } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, loose) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v; minSV = new SemVer(min, loose); } } }) return min; } exports.validRange = validRange; function validRange(range, loose) { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, loose).range || '*'; } catch (er) { return null; } } // Determine if version is less than all the versions possible in the range exports.ltr = ltr; function ltr(version, range, loose) { return outside(version, range, '<', loose); } // Determine if version is greater than all the versions possible in the range. exports.gtr = gtr; function gtr(version, range, loose) { return outside(version, range, '>', loose); } exports.outside = outside; function outside(version, range, hilo, loose) { version = new SemVer(version, loose); range = new Range(range, loose); var gtfn, ltefn, ltfn, comp, ecomp; switch (hilo) { case '>': gtfn = gt; ltefn = lte; ltfn = lt; comp = '>'; ecomp = '>='; break; case '<': gtfn = lt; ltefn = gte; ltfn = gt; comp = '<'; ecomp = '<='; break; default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } // If it satisifes the range it is not outside if (satisfies(version, range, loose)) { return false; } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i]; var high = null; var low = null; comparators.forEach(function(comparator) { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator; low = low || comparator; if (gtfn(comparator.semver, high.semver, loose)) { high = comparator; } else if (ltfn(comparator.semver, low.semver, loose)) { low = comparator; } }); // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false; } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false; } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false; } } return true; } exports.prerelease = prerelease; function prerelease(version, loose) { var parsed = parse(version, loose); return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; } exports.intersects = intersects; function intersects(r1, r2, loose) { r1 = new Range(r1, loose) r2 = new Range(r2, loose) return r1.intersects(r2) } /***/ }), /* 68 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(69); var correct = __webpack_require__(71); var genericWarning = ( 'license should be ' + 'a valid SPDX license expression (without "LicenseRef"), ' + '"UNLICENSED", or ' + '"SEE LICENSE IN "' ); var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/; function startsWith(prefix, string) { return string.slice(0, prefix.length) === prefix; } function usesLicenseRef(ast) { if (ast.hasOwnProperty('license')) { var license = ast.license; return ( startsWith('LicenseRef', license) || startsWith('DocumentRef', license) ); } else { return ( usesLicenseRef(ast.left) || usesLicenseRef(ast.right) ); } } module.exports = function(argument) { var ast; try { ast = parse(argument); } catch (e) { var match if ( argument === 'UNLICENSED' || argument === 'UNLICENCED' ) { return { validForOldPackages: true, validForNewPackages: true, unlicensed: true }; } else if (match = fileReferenceRE.exec(argument)) { return { validForOldPackages: true, validForNewPackages: true, inFile: match[1] }; } else { var result = { validForOldPackages: false, validForNewPackages: false, warnings: [genericWarning] }; var corrected = correct(argument); if (corrected) { result.warnings.push( 'license is similar to the valid expression "' + corrected + '"' ); } return result; } } if (usesLicenseRef(ast)) { return { validForNewPackages: false, validForOldPackages: false, spdx: true, warnings: [genericWarning] }; } else { return { validForNewPackages: true, validForOldPackages: true, spdx: true }; } }; /***/ }), /* 69 */ /***/ (function(module, exports, __webpack_require__) { var parser = __webpack_require__(70).parser module.exports = function (argument) { return parser.parse(argument) } /***/ }), /* 70 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {/* parser generated by jison 0.4.17 */ /* Returns a Parser object of the following structure: Parser: { yy: {} } Parser.prototype: { yy: {}, trace: function(), symbols_: {associative list: name ==> number}, terminals_: {associative list: number ==> name}, productions_: [...], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), table: [...], defaultActions: {...}, parseError: function(str, hash), parse: function(input), lexer: { EOF: 1, parseError: function(str, hash), setInput: function(input), input: function(), unput: function(str), more: function(), less: function(n), pastInput: function(), upcomingInput: function(), showPosition: function(), test_match: function(regex_match_array, rule_index), next: function(), lex: function(), begin: function(condition), popState: function(), _currentRules: function(), topState: function(), pushState: function(condition), options: { ranges: boolean (optional: true ==> token location info will include a .range[] member) flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) }, performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), rules: [...], conditions: {associative list: name ==> set}, } } token location info (@$, _$, etc.): { first_line: n, last_line: n, first_column: n, last_column: n, range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) } the parseError function receives a 'hash' object with these members for lexer and parser errors: { text: (matched text) token: (the produced terminal token, if any) line: (yylineno) } while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { loc: (yylloc) expected: (string describing the set of expected tokens) recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) } */ var spdxparse = (function(){ var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,5],$V1=[1,6],$V2=[1,7],$V3=[1,4],$V4=[1,9],$V5=[1,10],$V6=[5,14,15,17],$V7=[5,12,14,15,17]; var parser = {trace: function trace() { }, yy: {}, symbols_: {"error":2,"start":3,"expression":4,"EOS":5,"simpleExpression":6,"LICENSE":7,"PLUS":8,"LICENSEREF":9,"DOCUMENTREF":10,"COLON":11,"WITH":12,"EXCEPTION":13,"AND":14,"OR":15,"OPEN":16,"CLOSE":17,"$accept":0,"$end":1}, terminals_: {2:"error",5:"EOS",7:"LICENSE",8:"PLUS",9:"LICENSEREF",10:"DOCUMENTREF",11:"COLON",12:"WITH",13:"EXCEPTION",14:"AND",15:"OR",16:"OPEN",17:"CLOSE"}, productions_: [0,[3,2],[6,1],[6,2],[6,1],[6,3],[4,1],[4,3],[4,3],[4,3],[4,3]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { case 1: return this.$ = $$[$0-1] break; case 2: case 4: case 5: this.$ = {license: yytext} break; case 3: this.$ = {license: $$[$0-1], plus: true} break; case 6: this.$ = $$[$0] break; case 7: this.$ = {exception: $$[$0]} this.$.license = $$[$0-2].license if ($$[$0-2].hasOwnProperty('plus')) { this.$.plus = $$[$0-2].plus } break; case 8: this.$ = {conjunction: 'and', left: $$[$0-2], right: $$[$0]} break; case 9: this.$ = {conjunction: 'or', left: $$[$0-2], right: $$[$0]} break; case 10: this.$ = $$[$0-1] break; } }, table: [{3:1,4:2,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{1:[3]},{5:[1,8],14:$V4,15:$V5},o($V6,[2,6],{12:[1,11]}),{4:12,6:3,7:$V0,9:$V1,10:$V2,16:$V3},o($V7,[2,2],{8:[1,13]}),o($V7,[2,4]),{11:[1,14]},{1:[2,1]},{4:15,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{4:16,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{13:[1,17]},{14:$V4,15:$V5,17:[1,18]},o($V7,[2,3]),{9:[1,19]},o($V6,[2,8]),o([5,15,17],[2,9],{14:$V4}),o($V6,[2,7]),o($V6,[2,10]),o($V7,[2,5])], defaultActions: {8:[2,1]}, parseError: function parseError(str, hash) { if (hash.recoverable) { this.trace(str); } else { function _parseError (msg, hash) { this.message = msg; this.hash = hash; } _parseError.prototype = Error; throw new _parseError(str, hash); } }, parse: function parse(input) { var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; var args = lstack.slice.call(arguments, 1); var lexer = Object.create(this.lexer); var sharedState = { yy: {} }; for (var k in this.yy) { if (Object.prototype.hasOwnProperty.call(this.yy, k)) { sharedState.yy[k] = this.yy[k]; } } lexer.setInput(input, sharedState.yy); sharedState.yy.lexer = lexer; sharedState.yy.parser = this; if (typeof lexer.yylloc == 'undefined') { lexer.yylloc = {}; } var yyloc = lexer.yylloc; lstack.push(yyloc); var ranges = lexer.options && lexer.options.ranges; if (typeof sharedState.yy.parseError === 'function') { this.parseError = sharedState.yy.parseError; } else { this.parseError = Object.getPrototypeOf(this).parseError; } function popStack(n) { stack.length = stack.length - 2 * n; vstack.length = vstack.length - n; lstack.length = lstack.length - n; } _token_stack: var lex = function () { var token; token = lexer.lex() || EOF; if (typeof token !== 'number') { token = self.symbols_[token] || token; } return token; }; var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; while (true) { state = stack[stack.length - 1]; if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { if (symbol === null || typeof symbol == 'undefined') { symbol = lex(); } action = table[state] && table[state][symbol]; } if (typeof action === 'undefined' || !action.length || !action[0]) { var errStr = ''; expected = []; for (p in table[state]) { if (this.terminals_[p] && p > TERROR) { expected.push('\'' + this.terminals_[p] + '\''); } } if (lexer.showPosition) { errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; } else { errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); } this.parseError(errStr, { text: lexer.match, token: this.terminals_[symbol] || symbol, line: lexer.yylineno, loc: yyloc, expected: expected }); } if (action[0] instanceof Array && action.length > 1) { throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); } switch (action[0]) { case 1: stack.push(symbol); vstack.push(lexer.yytext); lstack.push(lexer.yylloc); stack.push(action[1]); symbol = null; if (!preErrorSymbol) { yyleng = lexer.yyleng; yytext = lexer.yytext; yylineno = lexer.yylineno; yyloc = lexer.yylloc; if (recovering > 0) { recovering--; } } else { symbol = preErrorSymbol; preErrorSymbol = null; } break; case 2: len = this.productions_[action[1]][1]; yyval.$ = vstack[vstack.length - len]; yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; if (ranges) { yyval._$.range = [ lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1] ]; } r = this.performAction.apply(yyval, [ yytext, yyleng, yylineno, sharedState.yy, action[1], vstack, lstack ].concat(args)); if (typeof r !== 'undefined') { return r; } if (len) { stack = stack.slice(0, -1 * len * 2); vstack = vstack.slice(0, -1 * len); lstack = lstack.slice(0, -1 * len); } stack.push(this.productions_[action[1]][0]); vstack.push(yyval.$); lstack.push(yyval._$); newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; stack.push(newState); break; case 3: return true; } } return true; }}; /* generated by jison-lex 0.3.4 */ var lexer = (function(){ var lexer = ({ EOF:1, parseError:function parseError(str, hash) { if (this.yy.parser) { this.yy.parser.parseError(str, hash); } else { throw new Error(str); } }, // resets the lexer, sets new input setInput:function (input, yy) { this.yy = yy || this.yy || {}; this._input = input; this._more = this._backtrack = this.done = false; this.yylineno = this.yyleng = 0; this.yytext = this.matched = this.match = ''; this.conditionStack = ['INITIAL']; this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; if (this.options.ranges) { this.yylloc.range = [0,0]; } this.offset = 0; return this; }, // consumes and returns one char from the input input:function () { var ch = this._input[0]; this.yytext += ch; this.yyleng++; this.offset++; this.match += ch; this.matched += ch; var lines = ch.match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno++; this.yylloc.last_line++; } else { this.yylloc.last_column++; } if (this.options.ranges) { this.yylloc.range[1]++; } this._input = this._input.slice(1); return ch; }, // unshifts one char (or a string) into the input unput:function (ch) { var len = ch.length; var lines = ch.split(/(?:\r\n?|\n)/g); this._input = ch + this._input; this.yytext = this.yytext.substr(0, this.yytext.length - len); //this.yyleng -= len; this.offset -= len; var oldLines = this.match.split(/(?:\r\n?|\n)/g); this.match = this.match.substr(0, this.match.length - 1); this.matched = this.matched.substr(0, this.matched.length - 1); if (lines.length - 1) { this.yylineno -= lines.length - 1; } var r = this.yylloc.range; this.yylloc = { first_line: this.yylloc.first_line, last_line: this.yylineno + 1, first_column: this.yylloc.first_column, last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len }; if (this.options.ranges) { this.yylloc.range = [r[0], r[0] + this.yyleng - len]; } this.yyleng = this.yytext.length; return this; }, // When called from action, caches matched text and appends it on next action more:function () { this._more = true; return this; }, // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. reject:function () { if (this.options.backtrack_lexer) { this._backtrack = true; } else { return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } return this; }, // retain first n characters of the match less:function (n) { this.unput(this.match.slice(n)); }, // displays already matched input, i.e. for error messages pastInput:function () { var past = this.matched.substr(0, this.matched.length - this.match.length); return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); }, // displays upcoming input, i.e. for error messages upcomingInput:function () { var next = this.match; if (next.length < 20) { next += this._input.substr(0, 20-next.length); } return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); }, // displays the character position where the lexing error occurred, i.e. for error messages showPosition:function () { var pre = this.pastInput(); var c = new Array(pre.length + 1).join("-"); return pre + this.upcomingInput() + "\n" + c + "^"; }, // test the lexed token: return FALSE when not a match, otherwise return token test_match:function (match, indexed_rule) { var token, lines, backup; if (this.options.backtrack_lexer) { // save context backup = { yylineno: this.yylineno, yylloc: { first_line: this.yylloc.first_line, last_line: this.last_line, first_column: this.yylloc.first_column, last_column: this.yylloc.last_column }, yytext: this.yytext, match: this.match, matches: this.matches, matched: this.matched, yyleng: this.yyleng, offset: this.offset, _more: this._more, _input: this._input, yy: this.yy, conditionStack: this.conditionStack.slice(0), done: this.done }; if (this.options.ranges) { backup.yylloc.range = this.yylloc.range.slice(0); } } lines = match[0].match(/(?:\r\n?|\n).*/g); if (lines) { this.yylineno += lines.length; } this.yylloc = { first_line: this.yylloc.last_line, last_line: this.yylineno + 1, first_column: this.yylloc.last_column, last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; this.yytext += match[0]; this.match += match[0]; this.matches = match; this.yyleng = this.yytext.length; if (this.options.ranges) { this.yylloc.range = [this.offset, this.offset += this.yyleng]; } this._more = false; this._backtrack = false; this._input = this._input.slice(match[0].length); this.matched += match[0]; token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); if (this.done && this._input) { this.done = false; } if (token) { return token; } else if (this._backtrack) { // recover context for (var k in backup) { this[k] = backup[k]; } return false; // rule action called reject() implying the next rule should be tested instead. } return false; }, // return next match in input next:function () { if (this.done) { return this.EOF; } if (!this._input) { this.done = true; } var token, match, tempMatch, index; if (!this._more) { this.yytext = ''; this.match = ''; } var rules = this._currentRules(); for (var i = 0; i < rules.length; i++) { tempMatch = this._input.match(this.rules[rules[i]]); if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { match = tempMatch; index = i; if (this.options.backtrack_lexer) { token = this.test_match(tempMatch, rules[i]); if (token !== false) { return token; } else if (this._backtrack) { match = false; continue; // rule action called reject() implying a rule MISmatch. } else { // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } } else if (!this.options.flex) { break; } } } if (match) { token = this.test_match(match, rules[index]); if (token !== false) { return token; } // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) return false; } if (this._input === "") { return this.EOF; } else { return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); } }, // return next match that has a token lex:function lex() { var r = this.next(); if (r) { return r; } else { return this.lex(); } }, // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) begin:function begin(condition) { this.conditionStack.push(condition); }, // pop the previously active lexer condition state off the condition stack popState:function popState() { var n = this.conditionStack.length - 1; if (n > 0) { return this.conditionStack.pop(); } else { return this.conditionStack[0]; } }, // produce the lexer rule set which is active for the currently active lexer condition state _currentRules:function _currentRules() { if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; } else { return this.conditions["INITIAL"].rules; } }, // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available topState:function topState(n) { n = this.conditionStack.length - 1 - Math.abs(n || 0); if (n >= 0) { return this.conditionStack[n]; } else { return "INITIAL"; } }, // alias for begin(condition) pushState:function pushState(condition) { this.begin(condition); }, // return the number of states currently on the stack stateStackSize:function stateStackSize() { return this.conditionStack.length; }, options: {}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { var YYSTATE=YY_START; switch($avoiding_name_collisions) { case 0:return 5 break; case 1:/* skip whitespace */ break; case 2:return 8 break; case 3:return 16 break; case 4:return 17 break; case 5:return 11 break; case 6:return 10 break; case 7:return 9 break; case 8:return 14 break; case 9:return 15 break; case 10:return 12 break; case 11:return 7 break; case 12:return 7 break; case 13:return 7 break; case 14:return 7 break; case 15:return 7 break; case 16:return 7 break; case 17:return 7 break; case 18:return 7 break; case 19:return 7 break; case 20:return 7 break; case 21:return 7 break; case 22:return 7 break; case 23:return 7 break; case 24:return 13 break; case 25:return 13 break; case 26:return 13 break; case 27:return 13 break; case 28:return 13 break; case 29:return 13 break; case 30:return 13 break; case 31:return 13 break; case 32:return 7 break; case 33:return 13 break; case 34:return 7 break; case 35:return 13 break; case 36:return 7 break; case 37:return 13 break; case 38:return 13 break; case 39:return 7 break; case 40:return 13 break; case 41:return 13 break; case 42:return 13 break; case 43:return 13 break; case 44:return 13 break; case 45:return 7 break; case 46:return 13 break; case 47:return 7 break; case 48:return 7 break; case 49:return 7 break; case 50:return 7 break; case 51:return 7 break; case 52:return 7 break; case 53:return 7 break; case 54:return 7 break; case 55:return 7 break; case 56:return 7 break; case 57:return 7 break; case 58:return 7 break; case 59:return 7 break; case 60:return 7 break; case 61:return 7 break; case 62:return 7 break; case 63:return 13 break; case 64:return 7 break; case 65:return 7 break; case 66:return 13 break; case 67:return 7 break; case 68:return 7 break; case 69:return 7 break; case 70:return 7 break; case 71:return 7 break; case 72:return 7 break; case 73:return 13 break; case 74:return 7 break; case 75:return 13 break; case 76:return 7 break; case 77:return 7 break; case 78:return 7 break; case 79:return 7 break; case 80:return 7 break; case 81:return 7 break; case 82:return 7 break; case 83:return 7 break; case 84:return 7 break; case 85:return 7 break; case 86:return 7 break; case 87:return 7 break; case 88:return 7 break; case 89:return 7 break; case 90:return 7 break; case 91:return 7 break; case 92:return 7 break; case 93:return 7 break; case 94:return 7 break; case 95:return 7 break; case 96:return 7 break; case 97:return 7 break; case 98:return 7 break; case 99:return 7 break; case 100:return 7 break; case 101:return 7 break; case 102:return 7 break; case 103:return 7 break; case 104:return 7 break; case 105:return 7 break; case 106:return 7 break; case 107:return 7 break; case 108:return 7 break; case 109:return 7 break; case 110:return 7 break; case 111:return 7 break; case 112:return 7 break; case 113:return 7 break; case 114:return 7 break; case 115:return 7 break; case 116:return 7 break; case 117:return 7 break; case 118:return 7 break; case 119:return 7 break; case 120:return 7 break; case 121:return 7 break; case 122:return 7 break; case 123:return 7 break; case 124:return 7 break; case 125:return 7 break; case 126:return 7 break; case 127:return 7 break; case 128:return 7 break; case 129:return 7 break; case 130:return 7 break; case 131:return 7 break; case 132:return 7 break; case 133:return 7 break; case 134:return 7 break; case 135:return 7 break; case 136:return 7 break; case 137:return 7 break; case 138:return 7 break; case 139:return 7 break; case 140:return 7 break; case 141:return 7 break; case 142:return 7 break; case 143:return 7 break; case 144:return 7 break; case 145:return 7 break; case 146:return 7 break; case 147:return 7 break; case 148:return 7 break; case 149:return 7 break; case 150:return 7 break; case 151:return 7 break; case 152:return 7 break; case 153:return 7 break; case 154:return 7 break; case 155:return 7 break; case 156:return 7 break; case 157:return 7 break; case 158:return 7 break; case 159:return 7 break; case 160:return 7 break; case 161:return 7 break; case 162:return 7 break; case 163:return 7 break; case 164:return 7 break; case 165:return 7 break; case 166:return 7 break; case 167:return 7 break; case 168:return 7 break; case 169:return 7 break; case 170:return 7 break; case 171:return 7 break; case 172:return 7 break; case 173:return 7 break; case 174:return 7 break; case 175:return 7 break; case 176:return 7 break; case 177:return 7 break; case 178:return 7 break; case 179:return 7 break; case 180:return 7 break; case 181:return 7 break; case 182:return 7 break; case 183:return 7 break; case 184:return 7 break; case 185:return 7 break; case 186:return 7 break; case 187:return 7 break; case 188:return 7 break; case 189:return 7 break; case 190:return 7 break; case 191:return 7 break; case 192:return 7 break; case 193:return 7 break; case 194:return 7 break; case 195:return 7 break; case 196:return 7 break; case 197:return 7 break; case 198:return 7 break; case 199:return 7 break; case 200:return 7 break; case 201:return 7 break; case 202:return 7 break; case 203:return 7 break; case 204:return 7 break; case 205:return 7 break; case 206:return 7 break; case 207:return 7 break; case 208:return 7 break; case 209:return 7 break; case 210:return 7 break; case 211:return 7 break; case 212:return 7 break; case 213:return 7 break; case 214:return 7 break; case 215:return 7 break; case 216:return 7 break; case 217:return 7 break; case 218:return 7 break; case 219:return 7 break; case 220:return 7 break; case 221:return 7 break; case 222:return 7 break; case 223:return 7 break; case 224:return 7 break; case 225:return 7 break; case 226:return 7 break; case 227:return 7 break; case 228:return 7 break; case 229:return 7 break; case 230:return 7 break; case 231:return 7 break; case 232:return 7 break; case 233:return 7 break; case 234:return 7 break; case 235:return 7 break; case 236:return 7 break; case 237:return 7 break; case 238:return 7 break; case 239:return 7 break; case 240:return 7 break; case 241:return 7 break; case 242:return 7 break; case 243:return 7 break; case 244:return 7 break; case 245:return 7 break; case 246:return 7 break; case 247:return 7 break; case 248:return 7 break; case 249:return 7 break; case 250:return 7 break; case 251:return 7 break; case 252:return 7 break; case 253:return 7 break; case 254:return 7 break; case 255:return 7 break; case 256:return 7 break; case 257:return 7 break; case 258:return 7 break; case 259:return 7 break; case 260:return 7 break; case 261:return 7 break; case 262:return 7 break; case 263:return 7 break; case 264:return 7 break; case 265:return 7 break; case 266:return 7 break; case 267:return 7 break; case 268:return 7 break; case 269:return 7 break; case 270:return 7 break; case 271:return 7 break; case 272:return 7 break; case 273:return 7 break; case 274:return 7 break; case 275:return 7 break; case 276:return 7 break; case 277:return 7 break; case 278:return 7 break; case 279:return 7 break; case 280:return 7 break; case 281:return 7 break; case 282:return 7 break; case 283:return 7 break; case 284:return 7 break; case 285:return 7 break; case 286:return 7 break; case 287:return 7 break; case 288:return 7 break; case 289:return 7 break; case 290:return 7 break; case 291:return 7 break; case 292:return 7 break; case 293:return 7 break; case 294:return 7 break; case 295:return 7 break; case 296:return 7 break; case 297:return 7 break; case 298:return 7 break; case 299:return 7 break; case 300:return 7 break; case 301:return 7 break; case 302:return 7 break; case 303:return 7 break; case 304:return 7 break; case 305:return 7 break; case 306:return 7 break; case 307:return 7 break; case 308:return 7 break; case 309:return 7 break; case 310:return 7 break; case 311:return 7 break; case 312:return 7 break; case 313:return 7 break; case 314:return 7 break; case 315:return 7 break; case 316:return 7 break; case 317:return 7 break; case 318:return 7 break; case 319:return 7 break; case 320:return 7 break; case 321:return 7 break; case 322:return 7 break; case 323:return 7 break; case 324:return 7 break; case 325:return 7 break; case 326:return 7 break; case 327:return 7 break; case 328:return 7 break; case 329:return 7 break; case 330:return 7 break; case 331:return 7 break; case 332:return 7 break; case 333:return 7 break; case 334:return 7 break; case 335:return 7 break; case 336:return 7 break; case 337:return 7 break; case 338:return 7 break; case 339:return 7 break; case 340:return 7 break; case 341:return 7 break; case 342:return 7 break; case 343:return 7 break; case 344:return 7 break; case 345:return 7 break; case 346:return 7 break; case 347:return 7 break; case 348:return 7 break; case 349:return 7 break; case 350:return 7 break; case 351:return 7 break; case 352:return 7 break; case 353:return 7 break; case 354:return 7 break; case 355:return 7 break; case 356:return 7 break; case 357:return 7 break; case 358:return 7 break; case 359:return 7 break; case 360:return 7 break; case 361:return 7 break; case 362:return 7 break; case 363:return 7 break; case 364:return 7 break; } }, rules: [/^(?:$)/,/^(?:\s+)/,/^(?:\+)/,/^(?:\()/,/^(?:\))/,/^(?::)/,/^(?:DocumentRef-([0-9A-Za-z-+.]+))/,/^(?:LicenseRef-([0-9A-Za-z-+.]+))/,/^(?:AND)/,/^(?:OR)/,/^(?:WITH)/,/^(?:BSD-3-Clause-No-Nuclear-License-2014)/,/^(?:BSD-3-Clause-No-Nuclear-Warranty)/,/^(?:GPL-2\.0-with-classpath-exception)/,/^(?:GPL-3\.0-with-autoconf-exception)/,/^(?:GPL-2\.0-with-autoconf-exception)/,/^(?:BSD-3-Clause-No-Nuclear-License)/,/^(?:MPL-2\.0-no-copyleft-exception)/,/^(?:GPL-2\.0-with-bison-exception)/,/^(?:GPL-2\.0-with-font-exception)/,/^(?:GPL-2\.0-with-GCC-exception)/,/^(?:CNRI-Python-GPL-Compatible)/,/^(?:GPL-3\.0-with-GCC-exception)/,/^(?:BSD-3-Clause-Attribution)/,/^(?:Classpath-exception-2\.0)/,/^(?:WxWindows-exception-3\.1)/,/^(?:freertos-exception-2\.0)/,/^(?:Autoconf-exception-3\.0)/,/^(?:i2p-gpl-java-exception)/,/^(?:gnu-javamail-exception)/,/^(?:Nokia-Qt-exception-1\.1)/,/^(?:Autoconf-exception-2\.0)/,/^(?:BSD-2-Clause-FreeBSD)/,/^(?:u-boot-exception-2\.0)/,/^(?:zlib-acknowledgement)/,/^(?:Bison-exception-2\.2)/,/^(?:BSD-2-Clause-NetBSD)/,/^(?:CLISP-exception-2\.0)/,/^(?:eCos-exception-2\.0)/,/^(?:BSD-3-Clause-Clear)/,/^(?:Font-exception-2\.0)/,/^(?:FLTK-exception-2\.0)/,/^(?:GCC-exception-2\.0)/,/^(?:Qwt-exception-1\.0)/,/^(?:Libtool-exception)/,/^(?:BSD-3-Clause-LBNL)/,/^(?:GCC-exception-3\.1)/,/^(?:Artistic-1\.0-Perl)/,/^(?:Artistic-1\.0-cl8)/,/^(?:CC-BY-NC-SA-2\.5)/,/^(?:MIT-advertising)/,/^(?:BSD-Source-Code)/,/^(?:CC-BY-NC-SA-4\.0)/,/^(?:LiLiQ-Rplus-1\.1)/,/^(?:CC-BY-NC-SA-3\.0)/,/^(?:BSD-4-Clause-UC)/,/^(?:CC-BY-NC-SA-2\.0)/,/^(?:CC-BY-NC-SA-1\.0)/,/^(?:CC-BY-NC-ND-4\.0)/,/^(?:CC-BY-NC-ND-3\.0)/,/^(?:CC-BY-NC-ND-2\.5)/,/^(?:CC-BY-NC-ND-2\.0)/,/^(?:CC-BY-NC-ND-1\.0)/,/^(?:LZMA-exception)/,/^(?:BitTorrent-1\.1)/,/^(?:CrystalStacker)/,/^(?:FLTK-exception)/,/^(?:SugarCRM-1\.1\.3)/,/^(?:BSD-Protection)/,/^(?:BitTorrent-1\.0)/,/^(?:HaskellReport)/,/^(?:Interbase-1\.0)/,/^(?:StandardML-NJ)/,/^(?:mif-exception)/,/^(?:Frameworx-1\.0)/,/^(?:389-exception)/,/^(?:CC-BY-NC-2\.0)/,/^(?:CC-BY-NC-2\.5)/,/^(?:CC-BY-NC-3\.0)/,/^(?:CC-BY-NC-4\.0)/,/^(?:W3C-19980720)/,/^(?:CC-BY-SA-1\.0)/,/^(?:CC-BY-SA-2\.0)/,/^(?:CC-BY-SA-2\.5)/,/^(?:CC-BY-ND-2\.0)/,/^(?:CC-BY-SA-4\.0)/,/^(?:CC-BY-SA-3\.0)/,/^(?:Artistic-1\.0)/,/^(?:Artistic-2\.0)/,/^(?:CC-BY-ND-2\.5)/,/^(?:CC-BY-ND-3\.0)/,/^(?:CC-BY-ND-4\.0)/,/^(?:CC-BY-ND-1\.0)/,/^(?:BSD-4-Clause)/,/^(?:BSD-3-Clause)/,/^(?:BSD-2-Clause)/,/^(?:CC-BY-NC-1\.0)/,/^(?:bzip2-1\.0\.6)/,/^(?:Unicode-TOU)/,/^(?:CNRI-Jython)/,/^(?:ImageMagick)/,/^(?:Adobe-Glyph)/,/^(?:CUA-OPL-1\.0)/,/^(?:OLDAP-2\.2\.2)/,/^(?:LiLiQ-R-1\.1)/,/^(?:bzip2-1\.0\.5)/,/^(?:LiLiQ-P-1\.1)/,/^(?:OLDAP-2\.0\.1)/,/^(?:OLDAP-2\.2\.1)/,/^(?:CNRI-Python)/,/^(?:XFree86-1\.1)/,/^(?:OSET-PL-2\.1)/,/^(?:Apache-2\.0)/,/^(?:Watcom-1\.0)/,/^(?:PostgreSQL)/,/^(?:Python-2\.0)/,/^(?:RHeCos-1\.1)/,/^(?:EUDatagrid)/,/^(?:Spencer-99)/,/^(?:Intel-ACPI)/,/^(?:CECILL-1\.0)/,/^(?:CECILL-1\.1)/,/^(?:JasPer-2\.0)/,/^(?:CECILL-2\.0)/,/^(?:CECILL-2\.1)/,/^(?:gSOAP-1\.3b)/,/^(?:Spencer-94)/,/^(?:Apache-1\.1)/,/^(?:Spencer-86)/,/^(?:Apache-1\.0)/,/^(?:ClArtistic)/,/^(?:TORQUE-1\.1)/,/^(?:CATOSL-1\.1)/,/^(?:Adobe-2006)/,/^(?:Zimbra-1\.4)/,/^(?:Zimbra-1\.3)/,/^(?:Condor-1\.1)/,/^(?:CC-BY-3\.0)/,/^(?:CC-BY-2\.5)/,/^(?:OLDAP-2\.4)/,/^(?:SGI-B-1\.1)/,/^(?:SISSL-1\.2)/,/^(?:SGI-B-1\.0)/,/^(?:OLDAP-2\.3)/,/^(?:CC-BY-4\.0)/,/^(?:Crossword)/,/^(?:SimPL-2\.0)/,/^(?:OLDAP-2\.2)/,/^(?:OLDAP-2\.1)/,/^(?:ErlPL-1\.1)/,/^(?:LPPL-1\.3a)/,/^(?:LPPL-1\.3c)/,/^(?:OLDAP-2\.0)/,/^(?:Leptonica)/,/^(?:CPOL-1\.02)/,/^(?:OLDAP-1\.4)/,/^(?:OLDAP-1\.3)/,/^(?:CC-BY-2\.0)/,/^(?:Unlicense)/,/^(?:OLDAP-2\.8)/,/^(?:OLDAP-1\.2)/,/^(?:MakeIndex)/,/^(?:OLDAP-2\.7)/,/^(?:OLDAP-1\.1)/,/^(?:Sleepycat)/,/^(?:D-FSL-1\.0)/,/^(?:CC-BY-1\.0)/,/^(?:OLDAP-2\.6)/,/^(?:WXwindows)/,/^(?:NPOSL-3\.0)/,/^(?:FreeImage)/,/^(?:SGI-B-2\.0)/,/^(?:OLDAP-2\.5)/,/^(?:Beerware)/,/^(?:Newsletr)/,/^(?:NBPL-1\.0)/,/^(?:NASA-1\.3)/,/^(?:NLOD-1\.0)/,/^(?:AGPL-1\.0)/,/^(?:OCLC-2\.0)/,/^(?:ODbL-1\.0)/,/^(?:PDDL-1\.0)/,/^(?:Motosoto)/,/^(?:Afmparse)/,/^(?:ANTLR-PD)/,/^(?:LPL-1\.02)/,/^(?:Abstyles)/,/^(?:eCos-2\.0)/,/^(?:APSL-1\.0)/,/^(?:LPPL-1\.2)/,/^(?:LPPL-1\.1)/,/^(?:LPPL-1\.0)/,/^(?:APSL-1\.1)/,/^(?:APSL-2\.0)/,/^(?:Info-ZIP)/,/^(?:Zend-2\.0)/,/^(?:IBM-pibs)/,/^(?:LGPL-2\.0)/,/^(?:LGPL-3\.0)/,/^(?:LGPL-2\.1)/,/^(?:GFDL-1\.3)/,/^(?:PHP-3\.01)/,/^(?:GFDL-1\.2)/,/^(?:GFDL-1\.1)/,/^(?:AGPL-3\.0)/,/^(?:Giftware)/,/^(?:EUPL-1\.1)/,/^(?:RPSL-1\.0)/,/^(?:EUPL-1\.0)/,/^(?:MIT-enna)/,/^(?:CECILL-B)/,/^(?:diffmark)/,/^(?:CECILL-C)/,/^(?:CDDL-1\.0)/,/^(?:Sendmail)/,/^(?:CDDL-1\.1)/,/^(?:CPAL-1\.0)/,/^(?:APSL-1\.2)/,/^(?:NPL-1\.1)/,/^(?:AFL-1\.2)/,/^(?:Caldera)/,/^(?:AFL-2\.0)/,/^(?:FSFULLR)/,/^(?:AFL-2\.1)/,/^(?:VSL-1\.0)/,/^(?:VOSTROM)/,/^(?:UPL-1\.0)/,/^(?:Dotseqn)/,/^(?:CPL-1\.0)/,/^(?:dvipdfm)/,/^(?:EPL-1\.0)/,/^(?:OCCT-PL)/,/^(?:ECL-1\.0)/,/^(?:Latex2e)/,/^(?:ECL-2\.0)/,/^(?:GPL-1\.0)/,/^(?:GPL-2\.0)/,/^(?:GPL-3\.0)/,/^(?:AFL-3\.0)/,/^(?:LAL-1\.2)/,/^(?:LAL-1\.3)/,/^(?:EFL-1\.0)/,/^(?:EFL-2\.0)/,/^(?:gnuplot)/,/^(?:Aladdin)/,/^(?:LPL-1\.0)/,/^(?:libtiff)/,/^(?:Entessa)/,/^(?:AMDPLPA)/,/^(?:IPL-1\.0)/,/^(?:OPL-1\.0)/,/^(?:OSL-1\.0)/,/^(?:OSL-1\.1)/,/^(?:OSL-2\.0)/,/^(?:OSL-2\.1)/,/^(?:OSL-3\.0)/,/^(?:OpenSSL)/,/^(?:ZPL-2\.1)/,/^(?:PHP-3\.0)/,/^(?:ZPL-2\.0)/,/^(?:ZPL-1\.1)/,/^(?:CC0-1\.0)/,/^(?:SPL-1\.0)/,/^(?:psutils)/,/^(?:MPL-1\.0)/,/^(?:QPL-1\.0)/,/^(?:MPL-1\.1)/,/^(?:MPL-2\.0)/,/^(?:APL-1\.0)/,/^(?:RPL-1\.1)/,/^(?:RPL-1\.5)/,/^(?:MIT-CMU)/,/^(?:Multics)/,/^(?:Eurosym)/,/^(?:BSL-1\.0)/,/^(?:MIT-feh)/,/^(?:Saxpath)/,/^(?:Borceux)/,/^(?:OFL-1\.1)/,/^(?:OFL-1\.0)/,/^(?:AFL-1\.1)/,/^(?:YPL-1\.1)/,/^(?:YPL-1\.0)/,/^(?:NPL-1\.0)/,/^(?:iMatix)/,/^(?:mpich2)/,/^(?:APAFML)/,/^(?:Bahyph)/,/^(?:RSA-MD)/,/^(?:psfrag)/,/^(?:Plexus)/,/^(?:eGenix)/,/^(?:Glulxe)/,/^(?:SAX-PD)/,/^(?:Imlib2)/,/^(?:Wsuipa)/,/^(?:LGPLLR)/,/^(?:Libpng)/,/^(?:xinetd)/,/^(?:MITNFA)/,/^(?:NetCDF)/,/^(?:Naumen)/,/^(?:SMPPL)/,/^(?:Nunit)/,/^(?:FSFUL)/,/^(?:GL2PS)/,/^(?:SMLNJ)/,/^(?:Rdisc)/,/^(?:Noweb)/,/^(?:Nokia)/,/^(?:SISSL)/,/^(?:Qhull)/,/^(?:Intel)/,/^(?:Glide)/,/^(?:Xerox)/,/^(?:AMPAS)/,/^(?:WTFPL)/,/^(?:MS-PL)/,/^(?:XSkat)/,/^(?:MS-RL)/,/^(?:MirOS)/,/^(?:RSCPL)/,/^(?:TMate)/,/^(?:OGTSL)/,/^(?:FSFAP)/,/^(?:NCSA)/,/^(?:Zlib)/,/^(?:SCEA)/,/^(?:SNIA)/,/^(?:NGPL)/,/^(?:NOSL)/,/^(?:ADSL)/,/^(?:MTLL)/,/^(?:NLPL)/,/^(?:Ruby)/,/^(?:JSON)/,/^(?:Barr)/,/^(?:0BSD)/,/^(?:Xnet)/,/^(?:Cube)/,/^(?:curl)/,/^(?:DSDP)/,/^(?:Fair)/,/^(?:HPND)/,/^(?:TOSL)/,/^(?:IJG)/,/^(?:SWL)/,/^(?:Vim)/,/^(?:FTL)/,/^(?:ICU)/,/^(?:OML)/,/^(?:NRL)/,/^(?:DOC)/,/^(?:TCL)/,/^(?:W3C)/,/^(?:NTP)/,/^(?:IPA)/,/^(?:ISC)/,/^(?:X11)/,/^(?:AAL)/,/^(?:AML)/,/^(?:xpp)/,/^(?:Zed)/,/^(?:MIT)/,/^(?:Mup)/], conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364],"inclusive":true}} }); return lexer; })(); parser.lexer = lexer; function Parser () { this.yy = {}; } Parser.prototype = parser;parser.Parser = Parser; return new Parser; })(); if (true) { exports.parser = spdxparse; exports.Parser = spdxparse.Parser; exports.parse = function () { return spdxparse.parse.apply(spdxparse, arguments); }; exports.main = function commonjsMain(args) { if (!args[1]) { console.log('Usage: '+args[0]+' FILE'); process.exit(1); } var source = __webpack_require__(23).readFileSync(__webpack_require__(16).normalize(args[1]), "utf8"); return exports.parser.parse(source); }; if ( true && __webpack_require__.c[__webpack_require__.s] === module) { exports.main(process.argv.slice(1)); } } /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(5)(module))) /***/ }), /* 71 */ /***/ (function(module, exports, __webpack_require__) { var licenseIDs = __webpack_require__(72); function valid(string) { return licenseIDs.indexOf(string) > -1; } // Common transpositions of license identifier acronyms var transpositions = [ ['APGL', 'AGPL'], ['Gpl', 'GPL'], ['GLP', 'GPL'], ['APL', 'Apache'], ['ISD', 'ISC'], ['GLP', 'GPL'], ['IST', 'ISC'], ['Claude', 'Clause'], [' or later', '+'], [' International', ''], ['GNU', 'GPL'], ['GUN', 'GPL'], ['+', ''], ['GNU GPL', 'GPL'], ['GNU/GPL', 'GPL'], ['GNU GLP', 'GPL'], ['GNU General Public License', 'GPL'], ['Gnu public license', 'GPL'], ['GNU Public License', 'GPL'], ['GNU GENERAL PUBLIC LICENSE', 'GPL'], ['MTI', 'MIT'], ['Mozilla Public License', 'MPL'], ['WTH', 'WTF'], ['-License', ''] ]; var TRANSPOSED = 0; var CORRECT = 1; // Simple corrections to nearly valid identifiers. var transforms = [ // e.g. 'mit' function(argument) { return argument.toUpperCase(); }, // e.g. 'MIT ' function(argument) { return argument.trim(); }, // e.g. 'M.I.T.' function(argument) { return argument.replace(/\./g, ''); }, // e.g. 'Apache- 2.0' function(argument) { return argument.replace(/\s+/g, ''); }, // e.g. 'CC BY 4.0'' function(argument) { return argument.replace(/\s+/g, '-'); }, // e.g. 'LGPLv2.1' function(argument) { return argument.replace('v', '-'); }, // e.g. 'Apache 2.0' function(argument) { return argument.replace(/,?\s*(\d)/, '-$1'); }, // e.g. 'GPL 2' function(argument) { return argument.replace(/,?\s*(\d)/, '-$1.0'); }, // e.g. 'Apache Version 2.0' function(argument) { return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2'); }, // e.g. 'Apache Version 2' function(argument) { return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2.0'); }, // e.g. 'ZLIB' function(argument) { return argument[0].toUpperCase() + argument.slice(1); }, // e.g. 'MPL/2.0' function(argument) { return argument.replace('/', '-'); }, // e.g. 'Apache 2' function(argument) { return argument .replace(/\s*V\s*(\d)/, '-$1') .replace(/(\d)$/, '$1.0'); }, // e.g. 'GPL-2.0-' function(argument) { return argument.slice(0, argument.length - 1); }, // e.g. 'GPL2' function(argument) { return argument.replace(/(\d)$/, '-$1.0'); }, // e.g. 'BSD 3' function(argument) { return argument.replace(/(-| )?(\d)$/, '-$2-Clause'); }, // e.g. 'BSD clause 3' function(argument) { return argument.replace(/(-| )clause(-| )(\d)/, '-$3-Clause'); }, // e.g. 'BY-NC-4.0' function(argument) { return 'CC-' + argument; }, // e.g. 'BY-NC' function(argument) { return 'CC-' + argument + '-4.0'; }, // e.g. 'Attribution-NonCommercial' function(argument) { return argument .replace('Attribution', 'BY') .replace('NonCommercial', 'NC') .replace('NoDerivatives', 'ND') .replace(/ (\d)/, '-$1') .replace(/ ?International/, ''); }, // e.g. 'Attribution-NonCommercial' function(argument) { return 'CC-' + argument .replace('Attribution', 'BY') .replace('NonCommercial', 'NC') .replace('NoDerivatives', 'ND') .replace(/ (\d)/, '-$1') .replace(/ ?International/, '') + '-4.0'; } ]; // If all else fails, guess that strings containing certain substrings // meant to identify certain licenses. var lastResorts = [ ['UNLI', 'Unlicense'], ['WTF', 'WTFPL'], ['2 CLAUSE', 'BSD-2-Clause'], ['2-CLAUSE', 'BSD-2-Clause'], ['3 CLAUSE', 'BSD-3-Clause'], ['3-CLAUSE', 'BSD-3-Clause'], ['AFFERO', 'AGPL-3.0'], ['AGPL', 'AGPL-3.0'], ['APACHE', 'Apache-2.0'], ['ARTISTIC', 'Artistic-2.0'], ['Affero', 'AGPL-3.0'], ['BEER', 'Beerware'], ['BOOST', 'BSL-1.0'], ['BSD', 'BSD-2-Clause'], ['ECLIPSE', 'EPL-1.0'], ['FUCK', 'WTFPL'], ['GNU', 'GPL-3.0'], ['LGPL', 'LGPL-3.0'], ['GPL', 'GPL-3.0'], ['MIT', 'MIT'], ['MPL', 'MPL-2.0'], ['X11', 'X11'], ['ZLIB', 'Zlib'] ]; var SUBSTRING = 0; var IDENTIFIER = 1; var validTransformation = function(identifier) { for (var i = 0; i < transforms.length; i++) { var transformed = transforms[i](identifier); if (transformed !== identifier && valid(transformed)) { return transformed; } } return null; }; var validLastResort = function(identifier) { var upperCased = identifier.toUpperCase(); for (var i = 0; i < lastResorts.length; i++) { var lastResort = lastResorts[i]; if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) { return lastResort[IDENTIFIER]; } } return null; }; var anyCorrection = function(identifier, check) { for (var i = 0; i < transpositions.length; i++) { var transposition = transpositions[i]; var transposed = transposition[TRANSPOSED]; if (identifier.indexOf(transposed) > -1) { var corrected = identifier.replace( transposed, transposition[CORRECT] ); var checked = check(corrected); if (checked !== null) { return checked; } } } return null; }; module.exports = function(identifier) { identifier = identifier.replace(/\+$/, ''); if (valid(identifier)) { return identifier; } var transformed = validTransformation(identifier); if (transformed !== null) { return transformed; } transformed = anyCorrection(identifier, function(argument) { if (valid(argument)) { return argument; } return validTransformation(argument); }); if (transformed !== null) { return transformed; } transformed = validLastResort(identifier); if (transformed !== null) { return transformed; } transformed = anyCorrection(identifier, validLastResort); if (transformed !== null) { return transformed; } return null; }; /***/ }), /* 72 */ /***/ (function(module) { module.exports = ["Glide","Abstyles","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AMPAS","APL-1.0","Adobe-Glyph","APAFML","Adobe-2006","AGPL-1.0","Afmparse","Aladdin","ADSL","AMDPLPA","ANTLR-PD","Apache-1.0","Apache-1.1","Apache-2.0","AML","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","AAL","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","BSL-1.0","Borceux","BSD-2-Clause","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","BSD-3-Clause","BSD-3-Clause-Clear","BSD-4-Clause","BSD-Protection","BSD-Source-Code","BSD-3-Clause-Attribution","0BSD","BSD-4-Clause-UC","bzip2-1.0.5","bzip2-1.0.6","Caldera","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","ClArtistic","MIT-CMU","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","CPOL-1.02","CDDL-1.0","CDDL-1.1","CPAL-1.0","CPL-1.0","CATOSL-1.1","Condor-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-3.0","CC-BY-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-4.0","CC0-1.0","Crossword","CrystalStacker","CUA-OPL-1.0","Cube","curl","D-FSL-1.0","diffmark","WTFPL","DOC","Dotseqn","DSDP","dvipdfm","EPL-1.0","ECL-1.0","ECL-2.0","eGenix","EFL-1.0","EFL-2.0","MIT-advertising","MIT-enna","Entessa","ErlPL-1.1","EUDatagrid","EUPL-1.0","EUPL-1.1","Eurosym","Fair","MIT-feh","Frameworx-1.0","FreeImage","FTL","FSFAP","FSFUL","FSFULLR","Giftware","GL2PS","Glulxe","AGPL-3.0","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-3.0","LGPL-2.1","LGPL-3.0","LGPL-2.0","gnuplot","gSOAP-1.3b","HaskellReport","HPND","IBM-pibs","IPL-1.0","ICU","ImageMagick","iMatix","Imlib2","IJG","Info-ZIP","Intel-ACPI","Intel","Interbase-1.0","IPA","ISC","JasPer-2.0","JSON","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","Latex2e","BSD-3-Clause-LBNL","Leptonica","LGPLLR","Libpng","libtiff","LAL-1.2","LAL-1.3","LiLiQ-P-1.1","LiLiQ-Rplus-1.1","LiLiQ-R-1.1","LPL-1.02","LPL-1.0","MakeIndex","MTLL","MS-PL","MS-RL","MirOS","MITNFA","MIT","Motosoto","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","mpich2","Multics","Mup","NASA-1.3","Naumen","NBPL-1.0","NetCDF","NGPL","NOSL","NPL-1.0","NPL-1.1","Newsletr","NLPL","Nokia","NPOSL-3.0","NLOD-1.0","Noweb","NRL","NTP","Nunit","OCLC-2.0","ODbL-1.0","PDDL-1.0","OCCT-PL","OGTSL","OLDAP-2.2.2","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OML","OPL-1.0","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenSSL","OSET-PL-2.1","PHP-3.0","PHP-3.01","Plexus","PostgreSQL","psfrag","psutils","Python-2.0","QPL-1.0","Qhull","Rdisc","RPSL-1.0","RPL-1.1","RPL-1.5","RHeCos-1.1","RSCPL","RSA-MD","Ruby","SAX-PD","Saxpath","SCEA","SWL","SMPPL","Sendmail","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","OFL-1.0","OFL-1.1","SimPL-2.0","Sleepycat","SNIA","Spencer-86","Spencer-94","Spencer-99","SMLNJ","SugarCRM-1.1.3","SISSL","SISSL-1.2","SPL-1.0","Watcom-1.0","TCL","Unlicense","TMate","TORQUE-1.1","TOSL","Unicode-TOU","UPL-1.0","NCSA","Vim","VOSTROM","VSL-1.0","W3C-19980720","W3C","Wsuipa","Xnet","X11","Xerox","XFree86-1.1","xinetd","xpp","XSkat","YPL-1.0","YPL-1.1","Zed","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","zlib-acknowledgement","ZPL-1.1","ZPL-2.0","ZPL-2.1","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-No-Nuclear-License-2014","eCos-2.0","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-2.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","GPL-3.0-with-GCC-exception","StandardML-NJ","WXwindows"]; /***/ }), /* 73 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var url = __webpack_require__(74) var gitHosts = __webpack_require__(75) var GitHost = module.exports = __webpack_require__(76) var protocolToRepresentationMap = { 'git+ssh': 'sshurl', 'git+https': 'https', 'ssh': 'sshurl', 'git': 'git' } function protocolToRepresentation (protocol) { if (protocol.substr(-1) === ':') protocol = protocol.slice(0, -1) return protocolToRepresentationMap[protocol] || protocol } var authProtocols = { 'git:': true, 'https:': true, 'git+https:': true, 'http:': true, 'git+http:': true } var cache = {} module.exports.fromUrl = function (giturl, opts) { var key = giturl + JSON.stringify(opts || {}) if (!(key in cache)) { cache[key] = fromUrl(giturl, opts) } return cache[key] } function fromUrl (giturl, opts) { if (giturl == null || giturl === '') return var url = fixupUnqualifiedGist( isGitHubShorthand(giturl) ? 'github:' + giturl : giturl ) var parsed = parseGitUrl(url) var shortcutMatch = url.match(new RegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)')) var matches = Object.keys(gitHosts).map(function (gitHostName) { try { var gitHostInfo = gitHosts[gitHostName] var auth = null if (parsed.auth && authProtocols[parsed.protocol]) { auth = decodeURIComponent(parsed.auth) } var committish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null var user = null var project = null var defaultRepresentation = null if (shortcutMatch && shortcutMatch[1] === gitHostName) { user = shortcutMatch[2] && decodeURIComponent(shortcutMatch[2]) project = decodeURIComponent(shortcutMatch[3]) defaultRepresentation = 'shortcut' } else { if (parsed.host !== gitHostInfo.domain) return if (!gitHostInfo.protocols_re.test(parsed.protocol)) return if (!parsed.path) return var pathmatch = gitHostInfo.pathmatch var matched = parsed.path.match(pathmatch) if (!matched) return if (matched[1] != null) user = decodeURIComponent(matched[1].replace(/^:/, '')) if (matched[2] != null) project = decodeURIComponent(matched[2]) defaultRepresentation = protocolToRepresentation(parsed.protocol) } return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts) } catch (ex) { if (!(ex instanceof URIError)) throw ex } }).filter(function (gitHostInfo) { return gitHostInfo }) if (matches.length !== 1) return return matches[0] } function isGitHubShorthand (arg) { // Note: This does not fully test the git ref format. // See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html // // The only way to do this properly would be to shell out to // git-check-ref-format, and as this is a fast sync function, // we don't want to do that. Just let git fail if it turns // out that the commit-ish is invalid. // GH usernames cannot start with . or - return /^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg) } function fixupUnqualifiedGist (giturl) { // necessary for round-tripping gists var parsed = url.parse(giturl) if (parsed.protocol === 'gist:' && parsed.host && !parsed.path) { return parsed.protocol + '/' + parsed.host } else { return giturl } } function parseGitUrl (giturl) { if (typeof giturl !== 'string') giturl = '' + giturl var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) if (!matched) return url.parse(giturl) return { protocol: 'git+ssh:', slashes: true, auth: matched[1], host: matched[2], port: null, hostname: matched[2], hash: matched[4], search: null, query: null, pathname: '/' + matched[3], path: '/' + matched[3], href: 'git+ssh://' + matched[1] + '@' + matched[2] + '/' + matched[3] + (matched[4] || '') } } /***/ }), /* 74 */ /***/ (function(module, exports) { module.exports = require("url"); /***/ }), /* 75 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var gitHosts = module.exports = { github: { // First two are insecure and generally shouldn't be used any more, but // they are still supported. 'protocols': [ 'git', 'http', 'git+ssh', 'git+https', 'ssh', 'https' ], 'domain': 'github.com', 'treepath': 'tree', 'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}', 'bugstemplate': 'https://{domain}/{user}/{project}/issues', 'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}', 'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz' }, bitbucket: { 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], 'domain': 'bitbucket.org', 'treepath': 'src', 'tarballtemplate': 'https://{domain}/{user}/{project}/get/{committish}.tar.gz' }, gitlab: { 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], 'domain': 'gitlab.com', 'treepath': 'tree', 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#README', 'bugstemplate': 'https://{domain}/{user}/{project}/issues', 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}' }, gist: { 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ], 'domain': 'gist.github.com', 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]+)(?:[.]git)?$/, 'filetemplate': 'https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}', 'bugstemplate': 'https://{domain}/{project}', 'gittemplate': 'git://{domain}/{project}.git{#committish}', 'sshtemplate': 'git@{domain}:/{project}.git{#committish}', 'sshurltemplate': 'git+ssh://git@{domain}/{project}.git{#committish}', 'browsetemplate': 'https://{domain}/{project}{/committish}', 'docstemplate': 'https://{domain}/{project}{/committish}', 'httpstemplate': 'git+https://{domain}/{project}.git{#committish}', 'shortcuttemplate': '{type}:{project}{#committish}', 'pathtemplate': '{project}{#committish}', 'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz' } } var gitHostDefaults = { 'sshtemplate': 'git@{domain}:{user}/{project}.git{#committish}', 'sshurltemplate': 'git+ssh://git@{domain}/{user}/{project}.git{#committish}', 'browsetemplate': 'https://{domain}/{user}/{project}{/tree/committish}', 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#readme', 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{project}.git{#committish}', 'filetemplate': 'https://{domain}/{user}/{project}/raw/{committish}/{path}', 'shortcuttemplate': '{type}:{user}/{project}{#committish}', 'pathtemplate': '{user}/{project}{#committish}', 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/ } Object.keys(gitHosts).forEach(function (name) { Object.keys(gitHostDefaults).forEach(function (key) { if (gitHosts[name][key]) return gitHosts[name][key] = gitHostDefaults[key] }) gitHosts[name].protocols_re = RegExp('^(' + gitHosts[name].protocols.map(function (protocol) { return protocol.replace(/([\\+*{}()[\]$^|])/g, '\\$1') }).join('|') + '):$') }) /***/ }), /* 76 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var gitHosts = __webpack_require__(75) var extend = Object.assign || __webpack_require__(29)._extend var GitHost = module.exports = function (type, user, auth, project, committish, defaultRepresentation, opts) { var gitHostInfo = this gitHostInfo.type = type Object.keys(gitHosts[type]).forEach(function (key) { gitHostInfo[key] = gitHosts[type][key] }) gitHostInfo.user = user gitHostInfo.auth = auth gitHostInfo.project = project gitHostInfo.committish = committish gitHostInfo.default = defaultRepresentation gitHostInfo.opts = opts || {} } GitHost.prototype = {} GitHost.prototype.hash = function () { return this.committish ? '#' + this.committish : '' } GitHost.prototype._fill = function (template, opts) { if (!template) return var vars = extend({}, opts) opts = extend(extend({}, this.opts), opts) var self = this Object.keys(this).forEach(function (key) { if (self[key] != null && vars[key] == null) vars[key] = self[key] }) var rawAuth = vars.auth var rawComittish = vars.committish Object.keys(vars).forEach(function (key) { vars[key] = encodeURIComponent(vars[key]) }) vars['auth@'] = rawAuth ? rawAuth + '@' : '' if (opts.noCommittish) { vars['#committish'] = '' vars['/tree/committish'] = '' vars['/comittish'] = '' vars.comittish = '' } else { vars['#committish'] = rawComittish ? '#' + rawComittish : '' vars['/tree/committish'] = vars.committish ? '/' + vars.treepath + '/' + vars.committish : '' vars['/committish'] = vars.committish ? '/' + vars.committish : '' vars.committish = vars.committish || 'master' } var res = template Object.keys(vars).forEach(function (key) { res = res.replace(new RegExp('[{]' + key + '[}]', 'g'), vars[key]) }) if (opts.noGitPlus) { return res.replace(/^git[+]/, '') } else { return res } } GitHost.prototype.ssh = function (opts) { return this._fill(this.sshtemplate, opts) } GitHost.prototype.sshurl = function (opts) { return this._fill(this.sshurltemplate, opts) } GitHost.prototype.browse = function (opts) { return this._fill(this.browsetemplate, opts) } GitHost.prototype.docs = function (opts) { return this._fill(this.docstemplate, opts) } GitHost.prototype.bugs = function (opts) { return this._fill(this.bugstemplate, opts) } GitHost.prototype.https = function (opts) { return this._fill(this.httpstemplate, opts) } GitHost.prototype.git = function (opts) { return this._fill(this.gittemplate, opts) } GitHost.prototype.shortcut = function (opts) { return this._fill(this.shortcuttemplate, opts) } GitHost.prototype.path = function (opts) { return this._fill(this.pathtemplate, opts) } GitHost.prototype.tarball = function (opts) { return this._fill(this.tarballtemplate, opts) } GitHost.prototype.file = function (P, opts) { return this._fill(this.filetemplate, extend({ path: P.replace(/^[/]+/g, '') }, opts)) } GitHost.prototype.getDefaultRepresentation = function () { return this.default } GitHost.prototype.toString = function (opts) { return (this[this.default] || this.sshurl).call(this, opts) } /***/ }), /* 77 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var builtinModules = __webpack_require__(78); module.exports = function (str) { if (typeof str !== 'string') { throw new TypeError('Expected a string'); } return builtinModules.indexOf(str) !== -1; }; /***/ }), /* 78 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var blacklist = [ 'freelist', 'sys' ]; module.exports = Object.keys(process.binding('natives')).filter(function (el) { return !/^_|^internal|\//.test(el) && blacklist.indexOf(el) === -1; }).sort(); /***/ }), /* 79 */ /***/ (function(module, exports) { module.exports = extractDescription // Extracts description from contents of a readme file in markdown format function extractDescription (d) { if (!d) return; if (d === "ERROR: No README data found!") return; // the first block of text before the first heading // that isn't the first line heading d = d.trim().split('\n') for (var s = 0; d[s] && d[s].trim().match(/^(#|$)/); s ++); var l = d.length for (var e = s + 1; e < l && d[e].trim(); e ++); return d.slice(s, e).join(' ').trim() } /***/ }), /* 80 */ /***/ (function(module) { module.exports = {"topLevel":{"dependancies":"dependencies","dependecies":"dependencies","depdenencies":"dependencies","devEependencies":"devDependencies","depends":"dependencies","dev-dependencies":"devDependencies","devDependences":"devDependencies","devDepenencies":"devDependencies","devdependencies":"devDependencies","repostitory":"repository","repo":"repository","prefereGlobal":"preferGlobal","hompage":"homepage","hampage":"homepage","autohr":"author","autor":"author","contributers":"contributors","publicationConfig":"publishConfig","script":"scripts"},"bugs":{"web":"url","name":"url"},"script":{"server":"start","tests":"test"}}; /***/ }), /* 81 */ /***/ (function(module, exports, __webpack_require__) { var util = __webpack_require__(29) var messages = __webpack_require__(82) module.exports = function() { var args = Array.prototype.slice.call(arguments, 0) var warningName = args.shift() if (warningName == "typo") { return makeTypoWarning.apply(null,args) } else { var msgTemplate = messages[warningName] ? messages[warningName] : warningName + ": '%s'" args.unshift(msgTemplate) return util.format.apply(null, args) } } function makeTypoWarning (providedName, probableName, field) { if (field) { providedName = field + "['" + providedName + "']" probableName = field + "['" + probableName + "']" } return util.format(messages.typo, providedName, probableName) } /***/ }), /* 82 */ /***/ (function(module) { module.exports = {"repositories":"'repositories' (plural) Not supported. Please pick one as the 'repository' field","missingRepository":"No repository field.","brokenGitUrl":"Probably broken git url: %s","nonObjectScripts":"scripts must be an object","nonStringScript":"script values must be string commands","nonArrayFiles":"Invalid 'files' member","invalidFilename":"Invalid filename in 'files' list: %s","nonArrayBundleDependencies":"Invalid 'bundleDependencies' list. Must be array of package names","nonStringBundleDependency":"Invalid bundleDependencies member: %s","nonDependencyBundleDependency":"Non-dependency in bundleDependencies: %s","nonObjectDependencies":"%s field must be an object","nonStringDependency":"Invalid dependency: %s %s","deprecatedArrayDependencies":"specifying %s as array is deprecated","deprecatedModules":"modules field is deprecated","nonArrayKeywords":"keywords should be an array of strings","nonStringKeyword":"keywords should be an array of strings","conflictingName":"%s is also the name of a node core module.","nonStringDescription":"'description' field should be a string","missingDescription":"No description","missingReadme":"No README data","missingLicense":"No license field.","nonEmailUrlBugsString":"Bug string field must be url, email, or {email,url}","nonUrlBugsUrlField":"bugs.url field must be a string url. Deleted.","nonEmailBugsEmailField":"bugs.email field must be a string email. Deleted.","emptyNormalizedBugs":"Normalized value of bugs field is an empty object. Deleted.","nonUrlHomepage":"homepage field must be a string url. Deleted.","invalidLicense":"license should be a valid SPDX license expression","typo":"%s should probably be %s."}; /***/ }), /* 83 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); const writeJsonFile = __webpack_require__(84); const sortKeys = __webpack_require__(89); const opts = {detectIndent: true}; const dependencyKeys = new Set([ 'dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies' ]); function normalize(pkg) { const ret = {}; for (const key of Object.keys(pkg)) { if (!dependencyKeys.has(key)) { ret[key] = pkg[key]; } else if (Object.keys(pkg[key]).length !== 0) { ret[key] = sortKeys(pkg[key]); } } return ret; } module.exports = (fp, data) => { if (typeof fp !== 'string') { data = fp; fp = '.'; } fp = path.basename(fp) === 'package.json' ? fp : path.join(fp, 'package.json'); data = normalize(data); return writeJsonFile(fp, data, opts); }; module.exports.sync = (fp, data) => { if (typeof fp !== 'string') { data = fp; fp = '.'; } fp = path.basename(fp) === 'package.json' ? fp : path.join(fp, 'package.json'); data = normalize(data); writeJsonFile.sync(fp, data, opts); }; /***/ }), /* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); const fs = __webpack_require__(22); const writeFileAtomic = __webpack_require__(85); const sortKeys = __webpack_require__(89); const makeDir = __webpack_require__(91); const pify = __webpack_require__(93); const detectIndent = __webpack_require__(94); const init = (fn, fp, data, opts) => { if (!fp) { throw new TypeError('Expected a filepath'); } if (data === undefined) { throw new TypeError('Expected data to stringify'); } opts = Object.assign({ indent: '\t', sortKeys: false }, opts); if (opts.sortKeys) { data = sortKeys(data, { deep: true, compare: typeof opts.sortKeys === 'function' && opts.sortKeys }); } return fn(fp, data, opts); }; const readFile = fp => pify(fs.readFile)(fp, 'utf8').catch(() => {}); const main = (fp, data, opts) => { return (opts.detectIndent ? readFile(fp) : Promise.resolve()) .then(str => { const indent = str ? detectIndent(str).indent : opts.indent; const json = JSON.stringify(data, opts.replacer, indent); return pify(writeFileAtomic)(fp, `${json}\n`, {mode: opts.mode}); }); }; const mainSync = (fp, data, opts) => { let indent = opts.indent; if (opts.detectIndent) { try { const file = fs.readFileSync(fp, 'utf8'); indent = detectIndent(file).indent; } catch (err) { if (err.code !== 'ENOENT') { throw err; } } } const json = JSON.stringify(data, opts.replacer, indent); return writeFileAtomic.sync(fp, `${json}\n`, {mode: opts.mode}); }; module.exports = (fp, data, opts) => { return makeDir(path.dirname(fp), {fs}) .then(() => init(main, fp, data, opts)); }; module.exports.sync = (fp, data, opts) => { makeDir.sync(path.dirname(fp), {fs}); init(mainSync, fp, data, opts); }; /***/ }), /* 85 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = writeFile module.exports.sync = writeFileSync module.exports._getTmpname = getTmpname // for testing module.exports._cleanupOnExit = cleanupOnExit var fs = __webpack_require__(22) var MurmurHash3 = __webpack_require__(86) var onExit = __webpack_require__(87) var path = __webpack_require__(16) var activeFiles = {} var invocations = 0 function getTmpname (filename) { return filename + '.' + MurmurHash3(__filename) .hash(String(process.pid)) .hash(String(++invocations)) .result() } function cleanupOnExit (tmpfile) { return function () { try { fs.unlinkSync(typeof tmpfile === 'function' ? tmpfile() : tmpfile) } catch (_) {} } } function writeFile (filename, data, options, callback) { if (options instanceof Function) { callback = options options = null } if (!options) options = {} var Promise = options.Promise || global.Promise var truename var fd var tmpfile var removeOnExit = cleanupOnExit(() => tmpfile) var absoluteName = path.resolve(filename) new Promise(function serializeSameFile (resolve) { // make a queue if it doesn't already exist if (!activeFiles[absoluteName]) activeFiles[absoluteName] = [] activeFiles[absoluteName].push(resolve) // add this job to the queue if (activeFiles[absoluteName].length === 1) resolve() // kick off the first one }).then(function getRealPath () { return new Promise(function (resolve) { fs.realpath(filename, function (_, realname) { truename = realname || filename tmpfile = getTmpname(truename) resolve() }) }) }).then(function stat () { return new Promise(function stat (resolve) { if (options.mode && options.chown) resolve() else { // Either mode or chown is not explicitly set // Default behavior is to copy it from original file fs.stat(truename, function (err, stats) { if (err || !stats) resolve() else { options = Object.assign({}, options) if (!options.mode) { options.mode = stats.mode } if (!options.chown && process.getuid) { options.chown = { uid: stats.uid, gid: stats.gid } } resolve() } }) } }) }).then(function thenWriteFile () { return new Promise(function (resolve, reject) { fs.open(tmpfile, 'w', options.mode, function (err, _fd) { fd = _fd if (err) reject(err) else resolve() }) }) }).then(function write () { return new Promise(function (resolve, reject) { if (Buffer.isBuffer(data)) { fs.write(fd, data, 0, data.length, 0, function (err) { if (err) reject(err) else resolve() }) } else if (data != null) { fs.write(fd, String(data), 0, String(options.encoding || 'utf8'), function (err) { if (err) reject(err) else resolve() }) } else resolve() }) }).then(function syncAndClose () { if (options.fsync !== false) { return new Promise(function (resolve, reject) { fs.fsync(fd, function (err) { if (err) reject(err) else fs.close(fd, resolve) }) }) } }).then(function chown () { if (options.chown) { return new Promise(function (resolve, reject) { fs.chown(tmpfile, options.chown.uid, options.chown.gid, function (err) { if (err) reject(err) else resolve() }) }) } }).then(function chmod () { if (options.mode) { return new Promise(function (resolve, reject) { fs.chmod(tmpfile, options.mode, function (err) { if (err) reject(err) else resolve() }) }) } }).then(function rename () { return new Promise(function (resolve, reject) { fs.rename(tmpfile, truename, function (err) { if (err) reject(err) else resolve() }) }) }).then(function success () { removeOnExit() callback() }).catch(function fail (err) { removeOnExit() fs.unlink(tmpfile, function () { callback(err) }) }).then(function checkQueue () { activeFiles[absoluteName].shift() // remove the element added by serializeSameFile if (activeFiles[absoluteName].length > 0) { activeFiles[absoluteName][0]() // start next job if one is pending } else delete activeFiles[absoluteName] }) } function writeFileSync (filename, data, options) { if (!options) options = {} try { filename = fs.realpathSync(filename) } catch (ex) { // it's ok, it'll happen on a not yet existing file } var tmpfile = getTmpname(filename) try { if (!options.mode || !options.chown) { // Either mode or chown is not explicitly set // Default behavior is to copy it from original file try { var stats = fs.statSync(filename) options = Object.assign({}, options) if (!options.mode) { options.mode = stats.mode } if (!options.chown && process.getuid) { options.chown = { uid: stats.uid, gid: stats.gid } } } catch (ex) { // ignore stat errors } } var removeOnExit = onExit(cleanupOnExit(tmpfile)) var fd = fs.openSync(tmpfile, 'w', options.mode) if (Buffer.isBuffer(data)) { fs.writeSync(fd, data, 0, data.length, 0) } else if (data != null) { fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8')) } if (options.fsync !== false) { fs.fsyncSync(fd) } fs.closeSync(fd) if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) if (options.mode) fs.chmodSync(tmpfile, options.mode) fs.renameSync(tmpfile, filename) removeOnExit() } catch (err) { removeOnExit() try { fs.unlinkSync(tmpfile) } catch (e) {} throw err } } /***/ }), /* 86 */ /***/ (function(module, exports, __webpack_require__) { /** * @preserve * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) * * @author Jens Taylor * @see http://github.com/homebrewing/brauhaus-diff * @author Gary Court * @see http://github.com/garycourt/murmurhash-js * @author Austin Appleby * @see http://sites.google.com/site/murmurhash/ */ (function(){ var cache; // Call this function without `new` to use the cached object (good for // single-threaded environments), or with `new` to create a new object. // // @param {string} key A UTF-16 or ASCII string // @param {number} seed An optional positive integer // @return {object} A MurmurHash3 object for incremental hashing function MurmurHash3(key, seed) { var m = this instanceof MurmurHash3 ? this : cache; m.reset(seed) if (typeof key === 'string' && key.length > 0) { m.hash(key); } if (m !== this) { return m; } }; // Incrementally add a string to this hash // // @param {string} key A UTF-16 or ASCII string // @return {object} this MurmurHash3.prototype.hash = function(key) { var h1, k1, i, top, len; len = key.length; this.len += len; k1 = this.k1; i = 0; switch (this.rem) { case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; case 3: k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; } this.rem = (len + this.rem) & 3; // & 3 is same as % 4 len -= this.rem; if (len > 0) { h1 = this.h1; while (1) { k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; k1 = (k1 << 15) | (k1 >>> 17); k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; h1 ^= k1; h1 = (h1 << 13) | (h1 >>> 19); h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; if (i >= len) { break; } k1 = ((key.charCodeAt(i++) & 0xffff)) ^ ((key.charCodeAt(i++) & 0xffff) << 8) ^ ((key.charCodeAt(i++) & 0xffff) << 16); top = key.charCodeAt(i++); k1 ^= ((top & 0xff) << 24) ^ ((top & 0xff00) >> 8); } k1 = 0; switch (this.rem) { case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; case 1: k1 ^= (key.charCodeAt(i) & 0xffff); } this.h1 = h1; } this.k1 = k1; return this; }; // Get the result of this hash // // @return {number} The 32-bit hash MurmurHash3.prototype.result = function() { var k1, h1; k1 = this.k1; h1 = this.h1; if (k1 > 0) { k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; k1 = (k1 << 15) | (k1 >>> 17); k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; h1 ^= k1; } h1 ^= this.len; h1 ^= h1 >>> 16; h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; h1 ^= h1 >>> 13; h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; h1 ^= h1 >>> 16; return h1 >>> 0; }; // Reset the hash object for reuse // // @param {number} seed An optional positive integer MurmurHash3.prototype.reset = function(seed) { this.h1 = typeof seed === 'number' ? seed : 0; this.rem = this.k1 = this.len = 0; return this; }; // A cached object to use. This can be safely used if you're in a single- // threaded environment, otherwise you need to create new hashes to use. cache = new MurmurHash3(); if (true) { module.exports = MurmurHash3; } else {} }()); /***/ }), /* 87 */ /***/ (function(module, exports, __webpack_require__) { // Note: since nyc uses this module to output coverage, any lines // that are in the direct sync flow of nyc's outputCoverage are // ignored, since we can never get coverage for them. var assert = __webpack_require__(30) var signals = __webpack_require__(88) var EE = __webpack_require__(45) /* istanbul ignore if */ if (typeof EE !== 'function') { EE = EE.EventEmitter } var emitter if (process.__signal_exit_emitter__) { emitter = process.__signal_exit_emitter__ } else { emitter = process.__signal_exit_emitter__ = new EE() emitter.count = 0 emitter.emitted = {} } // Because this emitter is a global, we have to check to see if a // previous version of this library failed to enable infinite listeners. // I know what you're about to say. But literally everything about // signal-exit is a compromise with evil. Get used to it. if (!emitter.infinite) { emitter.setMaxListeners(Infinity) emitter.infinite = true } module.exports = function (cb, opts) { assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') if (loaded === false) { load() } var ev = 'exit' if (opts && opts.alwaysLast) { ev = 'afterexit' } var remove = function () { emitter.removeListener(ev, cb) if (emitter.listeners('exit').length === 0 && emitter.listeners('afterexit').length === 0) { unload() } } emitter.on(ev, cb) return remove } module.exports.unload = unload function unload () { if (!loaded) { return } loaded = false signals.forEach(function (sig) { try { process.removeListener(sig, sigListeners[sig]) } catch (er) {} }) process.emit = originalProcessEmit process.reallyExit = originalProcessReallyExit emitter.count -= 1 } function emit (event, code, signal) { if (emitter.emitted[event]) { return } emitter.emitted[event] = true emitter.emit(event, code, signal) } // { : , ... } var sigListeners = {} signals.forEach(function (sig) { sigListeners[sig] = function listener () { // If there are no other listeners, an exit is coming! // Simplest way: remove us and then re-send the signal. // We know that this will kill the process, so we can // safely emit now. var listeners = process.listeners(sig) if (listeners.length === emitter.count) { unload() emit('exit', null, sig) /* istanbul ignore next */ emit('afterexit', null, sig) /* istanbul ignore next */ process.kill(process.pid, sig) } } }) module.exports.signals = function () { return signals } module.exports.load = load var loaded = false function load () { if (loaded) { return } loaded = true // This is the number of onSignalExit's that are in play. // It's important so that we can count the correct number of // listeners on signals, and don't wait for the other one to // handle it instead of us. emitter.count += 1 signals = signals.filter(function (sig) { try { process.on(sig, sigListeners[sig]) return true } catch (er) { return false } }) process.emit = processEmit process.reallyExit = processReallyExit } var originalProcessReallyExit = process.reallyExit function processReallyExit (code) { process.exitCode = code || 0 emit('exit', process.exitCode, null) /* istanbul ignore next */ emit('afterexit', process.exitCode, null) /* istanbul ignore next */ originalProcessReallyExit.call(process, process.exitCode) } var originalProcessEmit = process.emit function processEmit (ev, arg) { if (ev === 'exit') { if (arg !== undefined) { process.exitCode = arg } var ret = originalProcessEmit.apply(this, arguments) emit('exit', process.exitCode, null) /* istanbul ignore next */ emit('afterexit', process.exitCode, null) return ret } else { return originalProcessEmit.apply(this, arguments) } } /***/ }), /* 88 */ /***/ (function(module, exports) { // This is not the set of all possible signals. // // It IS, however, the set of all signals that trigger // an exit on either Linux or BSD systems. Linux is a // superset of the signal names supported on BSD, and // the unknown signals just fail to register, so we can // catch that easily enough. // // Don't bother with SIGKILL. It's uncatchable, which // means that we can't fire any callbacks anyway. // // If a user does happen to register a handler on a non- // fatal signal like SIGWINCH or something, and then // exit, it'll end up firing `process.emit('exit')`, so // the handler will be fired anyway. // // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised // artificially, inherently leave the process in a // state from which it is not safe to try and enter JS // listeners. module.exports = [ 'SIGABRT', 'SIGALRM', 'SIGHUP', 'SIGINT', 'SIGTERM' ] if (process.platform !== 'win32') { module.exports.push( 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' // should detect profiler and enable/disable accordingly. // see #21 // 'SIGPROF' ) } if (process.platform === 'linux') { module.exports.push( 'SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT', 'SIGUNUSED' ) } /***/ }), /* 89 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const isPlainObj = __webpack_require__(90); module.exports = (obj, opts) => { if (!isPlainObj(obj)) { throw new TypeError('Expected a plain object'); } opts = opts || {}; // DEPRECATED if (typeof opts === 'function') { throw new TypeError('Specify the compare function as an option instead'); } const deep = opts.deep; const seenInput = []; const seenOutput = []; const sortKeys = x => { const seenIndex = seenInput.indexOf(x); if (seenIndex !== -1) { return seenOutput[seenIndex]; } const ret = {}; const keys = Object.keys(x).sort(opts.compare); seenInput.push(x); seenOutput.push(ret); for (let i = 0; i < keys.length; i++) { const key = keys[i]; const val = x[key]; if (deep && Array.isArray(val)) { const retArr = []; for (let j = 0; j < val.length; j++) { retArr[j] = isPlainObj(val[j]) ? sortKeys(val[j]) : val[j]; } ret[key] = retArr; continue; } ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val; } return ret; }; return sortKeys(obj); }; /***/ }), /* 90 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toString = Object.prototype.toString; module.exports = function (x) { var prototype; return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({})); }; /***/ }), /* 91 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const fs = __webpack_require__(23); const path = __webpack_require__(16); const pify = __webpack_require__(92); const defaults = { mode: 0o777 & (~process.umask()), fs }; // https://github.com/nodejs/node/issues/8987 // https://github.com/libuv/libuv/pull/1088 const checkPath = pth => { if (process.platform === 'win32') { const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); if (pathHasInvalidWinCharacters) { const err = new Error(`Path contains invalid characters: ${pth}`); err.code = 'EINVAL'; throw err; } } }; module.exports = (input, opts) => Promise.resolve().then(() => { checkPath(input); opts = Object.assign({}, defaults, opts); const mkdir = pify(opts.fs.mkdir); const stat = pify(opts.fs.stat); const make = pth => { return mkdir(pth, opts.mode) .then(() => pth) .catch(err => { if (err.code === 'ENOENT') { if (err.message.includes('null bytes') || path.dirname(pth) === pth) { throw err; } return make(path.dirname(pth)).then(() => make(pth)); } return stat(pth) .then(stats => stats.isDirectory() ? pth : Promise.reject()) .catch(() => { throw err; }); }); }; return make(path.resolve(input)); }); module.exports.sync = (input, opts) => { checkPath(input); opts = Object.assign({}, defaults, opts); const make = pth => { try { opts.fs.mkdirSync(pth, opts.mode); } catch (err) { if (err.code === 'ENOENT') { if (err.message.includes('null bytes') || path.dirname(pth) === pth) { throw err; } make(path.dirname(pth)); return make(pth); } try { if (!opts.fs.statSync(pth).isDirectory()) { throw new Error('The path is not a directory'); } } catch (_) { throw err; } } return pth; }; return make(path.resolve(input)); }; /***/ }), /* 92 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const processFn = (fn, opts) => function () { const P = opts.promiseModule; const args = new Array(arguments.length); for (let i = 0; i < arguments.length; i++) { args[i] = arguments[i]; } return new P((resolve, reject) => { if (opts.errorFirst) { args.push(function (err, result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 1; i < arguments.length; i++) { results[i - 1] = arguments[i]; } if (err) { results.unshift(err); reject(results); } else { resolve(results); } } else if (err) { reject(err); } else { resolve(result); } }); } else { args.push(function (result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 0; i < arguments.length; i++) { results[i] = arguments[i]; } resolve(results); } else { resolve(result); } }); } fn.apply(this, args); }); }; module.exports = (obj, opts) => { opts = Object.assign({ exclude: [/.+(Sync|Stream)$/], errorFirst: true, promiseModule: Promise }, opts); const filter = key => { const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); return opts.include ? opts.include.some(match) : !opts.exclude.some(match); }; let ret; if (typeof obj === 'function') { ret = function () { if (opts.excludeMain) { return obj.apply(this, arguments); } return processFn(obj, opts).apply(this, arguments); }; } else { ret = Object.create(Object.getPrototypeOf(obj)); } for (const key in obj) { // eslint-disable-line guard-for-in const x = obj[key]; ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x; } return ret; }; /***/ }), /* 93 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const processFn = (fn, opts) => function () { const P = opts.promiseModule; const args = new Array(arguments.length); for (let i = 0; i < arguments.length; i++) { args[i] = arguments[i]; } return new P((resolve, reject) => { if (opts.errorFirst) { args.push(function (err, result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 1; i < arguments.length; i++) { results[i - 1] = arguments[i]; } if (err) { results.unshift(err); reject(results); } else { resolve(results); } } else if (err) { reject(err); } else { resolve(result); } }); } else { args.push(function (result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 0; i < arguments.length; i++) { results[i] = arguments[i]; } resolve(results); } else { resolve(result); } }); } fn.apply(this, args); }); }; module.exports = (obj, opts) => { opts = Object.assign({ exclude: [/.+(Sync|Stream)$/], errorFirst: true, promiseModule: Promise }, opts); const filter = key => { const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); return opts.include ? opts.include.some(match) : !opts.exclude.some(match); }; let ret; if (typeof obj === 'function') { ret = function () { if (opts.excludeMain) { return obj.apply(this, arguments); } return processFn(obj, opts).apply(this, arguments); }; } else { ret = Object.create(Object.getPrototypeOf(obj)); } for (const key in obj) { // eslint-disable-line guard-for-in const x = obj[key]; ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x; } return ret; }; /***/ }), /* 94 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // detect either spaces or tabs but not both to properly handle tabs // for indentation and spaces for alignment const INDENT_RE = /^(?:( )+|\t+)/; function getMostUsed(indents) { let result = 0; let maxUsed = 0; let maxWeight = 0; for (const entry of indents) { // TODO: use destructuring when targeting Node.js 6 const key = entry[0]; const val = entry[1]; const u = val[0]; const w = val[1]; if (u > maxUsed || (u === maxUsed && w > maxWeight)) { maxUsed = u; maxWeight = w; result = Number(key); } } return result; } module.exports = str => { if (typeof str !== 'string') { throw new TypeError('Expected a string'); } // used to see if tabs or spaces are the most used let tabs = 0; let spaces = 0; // remember the size of previous line's indentation let prev = 0; // remember how many indents/unindents as occurred for a given size // and how much lines follow a given indentation // // indents = { // 3: [1, 0], // 4: [1, 5], // 5: [1, 0], // 12: [1, 0], // } const indents = new Map(); // pointer to the array of last used indent let current; // whether the last action was an indent (opposed to an unindent) let isIndent; for (const line of str.split(/\n/g)) { if (!line) { // ignore empty lines continue; } let indent; const matches = line.match(INDENT_RE); if (matches) { indent = matches[0].length; if (matches[1]) { spaces++; } else { tabs++; } } else { indent = 0; } const diff = indent - prev; prev = indent; if (diff) { // an indent or unindent has been detected isIndent = diff > 0; current = indents.get(isIndent ? diff : -diff); if (current) { current[0]++; } else { current = [1, 0]; indents.set(diff, current); } } else if (current) { // if the last action was an indent, increment the weight current[1] += Number(isIndent); } } const amount = getMostUsed(indents); let type; let indent; if (!amount) { type = null; indent = ''; } else if (spaces >= tabs) { type = 'space'; indent = ' '.repeat(amount); } else { type = 'tab'; indent = '\t'.repeat(amount); } return { amount, type, indent }; }; /***/ }), /* 95 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "installInDir", function() { return installInDir; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runScriptInPackage", function() { return runScriptInPackage; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runScriptInPackageStreaming", function() { return runScriptInPackageStreaming; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "yarnWorkspacesInfo", function() { return yarnWorkspacesInfo; }); /* harmony import */ var _child_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Install all dependencies in the given directory */ async function installInDir(directory, extraArgs = []) { const options = ['install', '--non-interactive', ...extraArgs]; // We pass the mutex flag to ensure only one instance of yarn runs at any // given time (e.g. to avoid conflicts). await Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawn"])('yarn', options, { cwd: directory }); } /** * Run script in the given directory */ async function runScriptInPackage(script, args, pkg) { const execOpts = { cwd: pkg.path }; await Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawn"])('yarn', ['run', script, ...args], execOpts); } /** * Run script in the given directory */ function runScriptInPackageStreaming(script, args, pkg) { const execOpts = { cwd: pkg.path }; return Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawnStreaming"])('yarn', ['run', script, ...args], execOpts, { prefix: pkg.name }); } async function yarnWorkspacesInfo(directory) { const workspacesInfo = await Object(_child_process__WEBPACK_IMPORTED_MODULE_0__["spawn"])('yarn', ['workspaces', 'info', '--json'], { cwd: directory, stdio: 'pipe' }); const stdout = JSON.parse(workspacesInfo.stdout); return JSON.parse(stdout.data); } /***/ }), /* 96 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spawn", function() { return spawn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spawnStreaming", function() { return spawnStreaming; }); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97); /* harmony import */ var execa__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(execa__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var log_symbols__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(125); /* harmony import */ var log_symbols__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(log_symbols__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var strong_log_transformer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(126); /* harmony import */ var strong_log_transformer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(strong_log_transformer__WEBPACK_IMPORTED_MODULE_3__); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function generateColors() { const colorWheel = [chalk__WEBPACK_IMPORTED_MODULE_0___default.a.cyan, chalk__WEBPACK_IMPORTED_MODULE_0___default.a.magenta, chalk__WEBPACK_IMPORTED_MODULE_0___default.a.blue, chalk__WEBPACK_IMPORTED_MODULE_0___default.a.yellow, chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green]; const count = colorWheel.length; let children = 0; return () => colorWheel[children++ % count]; } function spawn(command, args, opts) { return execa__WEBPACK_IMPORTED_MODULE_1___default()(command, args, _objectSpread({ stdio: 'inherit' }, opts)); } const nextColor = generateColors(); function spawnStreaming(command, args, opts, { prefix }) { const spawned = execa__WEBPACK_IMPORTED_MODULE_1___default()(command, args, _objectSpread({ stdio: ['ignore', 'pipe', 'pipe'] }, opts)); const color = nextColor(); const prefixedStdout = strong_log_transformer__WEBPACK_IMPORTED_MODULE_3___default()({ tag: `${color.bold(prefix)}:` }); const prefixedStderr = strong_log_transformer__WEBPACK_IMPORTED_MODULE_3___default()({ mergeMultiline: true, tag: `${log_symbols__WEBPACK_IMPORTED_MODULE_2___default.a.error} ${color.bold(prefix)}:` }); spawned.stdout.pipe(prefixedStdout).pipe(process.stdout); spawned.stderr.pipe(prefixedStderr).pipe(process.stderr); return spawned; } /***/ }), /* 97 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); const childProcess = __webpack_require__(98); const crossSpawn = __webpack_require__(99); const stripEof = __webpack_require__(114); const npmRunPath = __webpack_require__(115); const isStream = __webpack_require__(117); const _getStream = __webpack_require__(118); const pFinally = __webpack_require__(122); const onExit = __webpack_require__(87); const errname = __webpack_require__(123); const stdio = __webpack_require__(124); const TEN_MEGABYTES = 1000 * 1000 * 10; function handleArgs(cmd, args, opts) { let parsed; opts = Object.assign({ extendEnv: true, env: {} }, opts); if (opts.extendEnv) { opts.env = Object.assign({}, process.env, opts.env); } if (opts.__winShell === true) { delete opts.__winShell; parsed = { command: cmd, args, options: opts, file: cmd, original: { cmd, args } }; } else { parsed = crossSpawn._parse(cmd, args, opts); } opts = Object.assign({ maxBuffer: TEN_MEGABYTES, buffer: true, stripEof: true, preferLocal: true, localDir: parsed.options.cwd || process.cwd(), encoding: 'utf8', reject: true, cleanup: true }, parsed.options); opts.stdio = stdio(opts); if (opts.preferLocal) { opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir})); } if (opts.detached) { // #115 opts.cleanup = false; } if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') { // #116 parsed.args.unshift('/q'); } return { cmd: parsed.command, args: parsed.args, opts, parsed }; } function handleInput(spawned, input) { if (input === null || input === undefined) { return; } if (isStream(input)) { input.pipe(spawned.stdin); } else { spawned.stdin.end(input); } } function handleOutput(opts, val) { if (val && opts.stripEof) { val = stripEof(val); } return val; } function handleShell(fn, cmd, opts) { let file = '/bin/sh'; let args = ['-c', cmd]; opts = Object.assign({}, opts); if (process.platform === 'win32') { opts.__winShell = true; file = process.env.comspec || 'cmd.exe'; args = ['/s', '/c', `"${cmd}"`]; opts.windowsVerbatimArguments = true; } if (opts.shell) { file = opts.shell; delete opts.shell; } return fn(file, args, opts); } function getStream(process, stream, {encoding, buffer, maxBuffer}) { if (!process[stream]) { return null; } let ret; if (!buffer) { // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10 ret = new Promise((resolve, reject) => { process[stream] .once('end', resolve) .once('error', reject); }); } else if (encoding) { ret = _getStream(process[stream], { encoding, maxBuffer }); } else { ret = _getStream.buffer(process[stream], {maxBuffer}); } return ret.catch(err => { err.stream = stream; err.message = `${stream} ${err.message}`; throw err; }); } function makeError(result, options) { const {stdout, stderr} = result; let err = result.error; const {code, signal} = result; const {parsed, joinedCmd} = options; const timedOut = options.timedOut || false; if (!err) { let output = ''; if (Array.isArray(parsed.opts.stdio)) { if (parsed.opts.stdio[2] !== 'inherit') { output += output.length > 0 ? stderr : `\n${stderr}`; } if (parsed.opts.stdio[1] !== 'inherit') { output += `\n${stdout}`; } } else if (parsed.opts.stdio !== 'inherit') { output = `\n${stderr}${stdout}`; } err = new Error(`Command failed: ${joinedCmd}${output}`); err.code = code < 0 ? errname(code) : code; } err.stdout = stdout; err.stderr = stderr; err.failed = true; err.signal = signal || null; err.cmd = joinedCmd; err.timedOut = timedOut; return err; } function joinCmd(cmd, args) { let joinedCmd = cmd; if (Array.isArray(args) && args.length > 0) { joinedCmd += ' ' + args.join(' '); } return joinedCmd; } module.exports = (cmd, args, opts) => { const parsed = handleArgs(cmd, args, opts); const {encoding, buffer, maxBuffer} = parsed.opts; const joinedCmd = joinCmd(cmd, args); let spawned; try { spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts); } catch (err) { return Promise.reject(err); } let removeExitHandler; if (parsed.opts.cleanup) { removeExitHandler = onExit(() => { spawned.kill(); }); } let timeoutId = null; let timedOut = false; const cleanup = () => { if (timeoutId) { clearTimeout(timeoutId); timeoutId = null; } if (removeExitHandler) { removeExitHandler(); } }; if (parsed.opts.timeout > 0) { timeoutId = setTimeout(() => { timeoutId = null; timedOut = true; spawned.kill(parsed.opts.killSignal); }, parsed.opts.timeout); } const processDone = new Promise(resolve => { spawned.on('exit', (code, signal) => { cleanup(); resolve({code, signal}); }); spawned.on('error', err => { cleanup(); resolve({error: err}); }); if (spawned.stdin) { spawned.stdin.on('error', err => { cleanup(); resolve({error: err}); }); } }); function destroy() { if (spawned.stdout) { spawned.stdout.destroy(); } if (spawned.stderr) { spawned.stderr.destroy(); } } const handlePromise = () => pFinally(Promise.all([ processDone, getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}), getStream(spawned, 'stderr', {encoding, buffer, maxBuffer}) ]).then(arr => { const result = arr[0]; result.stdout = arr[1]; result.stderr = arr[2]; if (result.error || result.code !== 0 || result.signal !== null) { const err = makeError(result, { joinedCmd, parsed, timedOut }); // TODO: missing some timeout logic for killed // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203 // err.killed = spawned.killed || killed; err.killed = err.killed || spawned.killed; if (!parsed.opts.reject) { return err; } throw err; } return { stdout: handleOutput(parsed.opts, result.stdout), stderr: handleOutput(parsed.opts, result.stderr), code: 0, failed: false, killed: false, signal: null, cmd: joinedCmd, timedOut: false }; }), destroy); crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); handleInput(spawned, parsed.opts.input); spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected); spawned.catch = onrejected => handlePromise().catch(onrejected); return spawned; }; // TODO: set `stderr: 'ignore'` when that option is implemented module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout); // TODO: set `stdout: 'ignore'` when that option is implemented module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr); module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts); module.exports.sync = (cmd, args, opts) => { const parsed = handleArgs(cmd, args, opts); const joinedCmd = joinCmd(cmd, args); if (isStream(parsed.opts.input)) { throw new TypeError('The `input` option cannot be a stream in sync mode'); } const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); result.code = result.status; if (result.error || result.status !== 0 || result.signal !== null) { const err = makeError(result, { joinedCmd, parsed }); if (!parsed.opts.reject) { return err; } throw err; } return { stdout: handleOutput(parsed.opts, result.stdout), stderr: handleOutput(parsed.opts, result.stderr), code: 0, failed: false, signal: null, cmd: joinedCmd, timedOut: false }; }; module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts); /***/ }), /* 98 */ /***/ (function(module, exports) { module.exports = require("child_process"); /***/ }), /* 99 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const cp = __webpack_require__(98); const parse = __webpack_require__(100); const enoent = __webpack_require__(113); function spawn(command, args, options) { // Parse the arguments const parsed = parse(command, args, options); // Spawn the child process const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); // Hook into child process "exit" event to emit an error if the command // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 enoent.hookChildProcess(spawned, parsed); return spawned; } function spawnSync(command, args, options) { // Parse the arguments const parsed = parse(command, args, options); // Spawn the child process const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); return result; } module.exports = spawn; module.exports.spawn = spawn; module.exports.sync = spawnSync; module.exports._parse = parse; module.exports._enoent = enoent; /***/ }), /* 100 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); const niceTry = __webpack_require__(101); const resolveCommand = __webpack_require__(102); const escape = __webpack_require__(108); const readShebang = __webpack_require__(109); const semver = __webpack_require__(112); const isWin = process.platform === 'win32'; const isExecutableRegExp = /\.(?:com|exe)$/i; const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0 const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false; function detectShebang(parsed) { parsed.file = resolveCommand(parsed); const shebang = parsed.file && readShebang(parsed.file); if (shebang) { parsed.args.unshift(parsed.file); parsed.command = shebang; return resolveCommand(parsed); } return parsed.file; } function parseNonShell(parsed) { if (!isWin) { return parsed; } // Detect & add support for shebangs const commandFile = detectShebang(parsed); // We don't need a shell if the command filename is an executable const needsShell = !isExecutableRegExp.test(commandFile); // If a shell is required, use cmd.exe and take care of escaping everything correctly // Note that `forceShell` is an hidden option used only in tests if (parsed.options.forceShell || needsShell) { // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, // we need to double escape them const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) // This is necessary otherwise it will always fail with ENOENT in those cases parsed.command = path.normalize(parsed.command); // Escape command & arguments parsed.command = escape.command(parsed.command); parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); const shellCommand = [parsed.command].concat(parsed.args).join(' '); parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; parsed.command = process.env.comspec || 'cmd.exe'; parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped } return parsed; } function parseShell(parsed) { // If node supports the shell option, there's no need to mimic its behavior if (supportsShellOption) { return parsed; } // Mimic node shell option // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335 const shellCommand = [parsed.command].concat(parsed.args).join(' '); if (isWin) { parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe'; parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped } else { if (typeof parsed.options.shell === 'string') { parsed.command = parsed.options.shell; } else if (process.platform === 'android') { parsed.command = '/system/bin/sh'; } else { parsed.command = '/bin/sh'; } parsed.args = ['-c', shellCommand]; } return parsed; } function parse(command, args, options) { // Normalize arguments, similar to nodejs if (args && !Array.isArray(args)) { options = args; args = null; } args = args ? args.slice(0) : []; // Clone array to avoid changing the original options = Object.assign({}, options); // Clone object to avoid changing the original // Build our parsed object const parsed = { command, args, options, file: undefined, original: { command, args, }, }; // Delegate further parsing to shell or non-shell return options.shell ? parseShell(parsed) : parseNonShell(parsed); } module.exports = parse; /***/ }), /* 101 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Tries to execute a function and discards any error that occurs. * @param {Function} fn - Function that might or might not throw an error. * @returns {?*} Return-value of the function when no error occurred. */ module.exports = function(fn) { try { return fn() } catch (e) {} } /***/ }), /* 102 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); const which = __webpack_require__(103); const pathKey = __webpack_require__(107)(); function resolveCommandAttempt(parsed, withoutPathExt) { const cwd = process.cwd(); const hasCustomCwd = parsed.options.cwd != null; // If a custom `cwd` was specified, we need to change the process cwd // because `which` will do stat calls but does not support a custom cwd if (hasCustomCwd) { try { process.chdir(parsed.options.cwd); } catch (err) { /* Empty */ } } let resolved; try { resolved = which.sync(parsed.command, { path: (parsed.options.env || process.env)[pathKey], pathExt: withoutPathExt ? path.delimiter : undefined, }); } catch (e) { /* Empty */ } finally { process.chdir(cwd); } // If we successfully resolved, ensure that an absolute path is returned // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it if (resolved) { resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); } return resolved; } function resolveCommand(parsed) { return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); } module.exports = resolveCommand; /***/ }), /* 103 */ /***/ (function(module, exports, __webpack_require__) { module.exports = which which.sync = whichSync var isWindows = process.platform === 'win32' || process.env.OSTYPE === 'cygwin' || process.env.OSTYPE === 'msys' var path = __webpack_require__(16) var COLON = isWindows ? ';' : ':' var isexe = __webpack_require__(104) function getNotFoundError (cmd) { var er = new Error('not found: ' + cmd) er.code = 'ENOENT' return er } function getPathInfo (cmd, opt) { var colon = opt.colon || COLON var pathEnv = opt.path || process.env.PATH || '' var pathExt = [''] pathEnv = pathEnv.split(colon) var pathExtExe = '' if (isWindows) { pathEnv.unshift(process.cwd()) pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') pathExt = pathExtExe.split(colon) // Always test the cmd itself first. isexe will check to make sure // it's found in the pathExt set. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') pathExt.unshift('') } // If it has a slash, then we don't bother searching the pathenv. // just check the file itself, and that's it. if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) pathEnv = [''] return { env: pathEnv, ext: pathExt, extExe: pathExtExe } } function which (cmd, opt, cb) { if (typeof opt === 'function') { cb = opt opt = {} } var info = getPathInfo(cmd, opt) var pathEnv = info.env var pathExt = info.ext var pathExtExe = info.extExe var found = [] ;(function F (i, l) { if (i === l) { if (opt.all && found.length) return cb(null, found) else return cb(getNotFoundError(cmd)) } var pathPart = pathEnv[i] if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') pathPart = pathPart.slice(1, -1) var p = path.join(pathPart, cmd) if (!pathPart && (/^\.[\\\/]/).test(cmd)) { p = cmd.slice(0, 2) + p } ;(function E (ii, ll) { if (ii === ll) return F(i + 1, l) var ext = pathExt[ii] isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { if (!er && is) { if (opt.all) found.push(p + ext) else return cb(null, p + ext) } return E(ii + 1, ll) }) })(0, pathExt.length) })(0, pathEnv.length) } function whichSync (cmd, opt) { opt = opt || {} var info = getPathInfo(cmd, opt) var pathEnv = info.env var pathExt = info.ext var pathExtExe = info.extExe var found = [] for (var i = 0, l = pathEnv.length; i < l; i ++) { var pathPart = pathEnv[i] if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') pathPart = pathPart.slice(1, -1) var p = path.join(pathPart, cmd) if (!pathPart && /^\.[\\\/]/.test(cmd)) { p = cmd.slice(0, 2) + p } for (var j = 0, ll = pathExt.length; j < ll; j ++) { var cur = p + pathExt[j] var is try { is = isexe.sync(cur, { pathExt: pathExtExe }) if (is) { if (opt.all) found.push(cur) else return cur } } catch (ex) {} } } if (opt.all && found.length) return found if (opt.nothrow) return null throw getNotFoundError(cmd) } /***/ }), /* 104 */ /***/ (function(module, exports, __webpack_require__) { var fs = __webpack_require__(23) var core if (process.platform === 'win32' || global.TESTING_WINDOWS) { core = __webpack_require__(105) } else { core = __webpack_require__(106) } module.exports = isexe isexe.sync = sync function isexe (path, options, cb) { if (typeof options === 'function') { cb = options options = {} } if (!cb) { if (typeof Promise !== 'function') { throw new TypeError('callback not provided') } return new Promise(function (resolve, reject) { isexe(path, options || {}, function (er, is) { if (er) { reject(er) } else { resolve(is) } }) }) } core(path, options || {}, function (er, is) { // ignore EACCES because that just means we aren't allowed to run it if (er) { if (er.code === 'EACCES' || options && options.ignoreErrors) { er = null is = false } } cb(er, is) }) } function sync (path, options) { // my kingdom for a filtered catch try { return core.sync(path, options || {}) } catch (er) { if (options && options.ignoreErrors || er.code === 'EACCES') { return false } else { throw er } } } /***/ }), /* 105 */ /***/ (function(module, exports, __webpack_require__) { module.exports = isexe isexe.sync = sync var fs = __webpack_require__(23) function checkPathExt (path, options) { var pathext = options.pathExt !== undefined ? options.pathExt : process.env.PATHEXT if (!pathext) { return true } pathext = pathext.split(';') if (pathext.indexOf('') !== -1) { return true } for (var i = 0; i < pathext.length; i++) { var p = pathext[i].toLowerCase() if (p && path.substr(-p.length).toLowerCase() === p) { return true } } return false } function checkStat (stat, path, options) { if (!stat.isSymbolicLink() && !stat.isFile()) { return false } return checkPathExt(path, options) } function isexe (path, options, cb) { fs.stat(path, function (er, stat) { cb(er, er ? false : checkStat(stat, path, options)) }) } function sync (path, options) { return checkStat(fs.statSync(path), path, options) } /***/ }), /* 106 */ /***/ (function(module, exports, __webpack_require__) { module.exports = isexe isexe.sync = sync var fs = __webpack_require__(23) function isexe (path, options, cb) { fs.stat(path, function (er, stat) { cb(er, er ? false : checkStat(stat, options)) }) } function sync (path, options) { return checkStat(fs.statSync(path), options) } function checkStat (stat, options) { return stat.isFile() && checkMode(stat, options) } function checkMode (stat, options) { var mod = stat.mode var uid = stat.uid var gid = stat.gid var myUid = options.uid !== undefined ? options.uid : process.getuid && process.getuid() var myGid = options.gid !== undefined ? options.gid : process.getgid && process.getgid() var u = parseInt('100', 8) var g = parseInt('010', 8) var o = parseInt('001', 8) var ug = u | g var ret = (mod & o) || (mod & g) && gid === myGid || (mod & u) && uid === myUid || (mod & ug) && myUid === 0 return ret } /***/ }), /* 107 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = opts => { opts = opts || {}; const env = opts.env || process.env; const platform = opts.platform || process.platform; if (platform !== 'win32') { return 'PATH'; } return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; }; /***/ }), /* 108 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // See http://www.robvanderwoude.com/escapechars.php const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; function escapeCommand(arg) { // Escape meta chars arg = arg.replace(metaCharsRegExp, '^$1'); return arg; } function escapeArgument(arg, doubleEscapeMetaChars) { // Convert to string arg = `${arg}`; // Algorithm below is based on https://qntm.org/cmd // Sequence of backslashes followed by a double quote: // double up all the backslashes and escape the double quote arg = arg.replace(/(\\*)"/g, '$1$1\\"'); // Sequence of backslashes followed by the end of the string // (which will become a double quote later): // double up all the backslashes arg = arg.replace(/(\\*)$/, '$1$1'); // All other backslashes occur literally // Quote the whole thing: arg = `"${arg}"`; // Escape meta chars arg = arg.replace(metaCharsRegExp, '^$1'); // Double escape meta chars if necessary if (doubleEscapeMetaChars) { arg = arg.replace(metaCharsRegExp, '^$1'); } return arg; } module.exports.command = escapeCommand; module.exports.argument = escapeArgument; /***/ }), /* 109 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const fs = __webpack_require__(23); const shebangCommand = __webpack_require__(110); function readShebang(command) { // Read the first 150 bytes from the file const size = 150; let buffer; if (Buffer.alloc) { // Node.js v4.5+ / v5.10+ buffer = Buffer.alloc(size); } else { // Old Node.js API buffer = new Buffer(size); buffer.fill(0); // zero-fill } let fd; try { fd = fs.openSync(command, 'r'); fs.readSync(fd, buffer, 0, size, 0); fs.closeSync(fd); } catch (e) { /* Empty */ } // Attempt to extract shebang (null is returned if not a shebang) return shebangCommand(buffer.toString()); } module.exports = readShebang; /***/ }), /* 110 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var shebangRegex = __webpack_require__(111); module.exports = function (str) { var match = str.match(shebangRegex); if (!match) { return null; } var arr = match[0].replace(/#! ?/, '').split(' '); var bin = arr[0].split('/').pop(); var arg = arr[1]; return (bin === 'env' ? arg : bin + (arg ? ' ' + arg : '') ); }; /***/ }), /* 111 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = /^#!.*/; /***/ }), /* 112 */ /***/ (function(module, exports) { exports = module.exports = SemVer; // The debug function is excluded entirely from the minified version. /* nomin */ var debug; /* nomin */ if (typeof process === 'object' && /* nomin */ process.env && /* nomin */ process.env.NODE_DEBUG && /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) /* nomin */ debug = function() { /* nomin */ var args = Array.prototype.slice.call(arguments, 0); /* nomin */ args.unshift('SEMVER'); /* nomin */ console.log.apply(console, args); /* nomin */ }; /* nomin */ else /* nomin */ debug = function() {}; // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. exports.SEMVER_SPEC_VERSION = '2.0.0'; var MAX_LENGTH = 256; var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; // Max safe segment length for coercion. var MAX_SAFE_COMPONENT_LENGTH = 16; // The actual regexps go on exports.re var re = exports.re = []; var src = exports.src = []; var R = 0; // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. var NUMERICIDENTIFIER = R++; src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; var NUMERICIDENTIFIERLOOSE = R++; src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. var NONNUMERICIDENTIFIER = R++; src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; // ## Main Version // Three dot-separated numeric identifiers. var MAINVERSION = R++; src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')'; var MAINVERSIONLOOSE = R++; src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. var PRERELEASEIDENTIFIER = R++; src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + '|' + src[NONNUMERICIDENTIFIER] + ')'; var PRERELEASEIDENTIFIERLOOSE = R++; src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + '|' + src[NONNUMERICIDENTIFIER] + ')'; // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. var PRERELEASE = R++; src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; var PRERELEASELOOSE = R++; src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. var BUILDIDENTIFIER = R++; src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. var BUILD = R++; src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. var FULL = R++; var FULLPLAIN = 'v?' + src[MAINVERSION] + src[PRERELEASE] + '?' + src[BUILD] + '?'; src[FULL] = '^' + FULLPLAIN + '$'; // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + src[PRERELEASELOOSE] + '?' + src[BUILD] + '?'; var LOOSE = R++; src[LOOSE] = '^' + LOOSEPLAIN + '$'; var GTLT = R++; src[GTLT] = '((?:<|>)?=?)'; // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. var XRANGEIDENTIFIERLOOSE = R++; src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; var XRANGEIDENTIFIER = R++; src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; var XRANGEPLAIN = R++; src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:' + src[PRERELEASE] + ')?' + src[BUILD] + '?' + ')?)?'; var XRANGEPLAINLOOSE = R++; src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:' + src[PRERELEASELOOSE] + ')?' + src[BUILD] + '?' + ')?)?'; var XRANGE = R++; src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; var XRANGELOOSE = R++; src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; // Coercion. // Extract anything that could conceivably be a part of a valid semver var COERCE = R++; src[COERCE] = '(?:^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:$|[^\\d])'; // Tilde ranges. // Meaning is "reasonably at or greater than" var LONETILDE = R++; src[LONETILDE] = '(?:~>?)'; var TILDETRIM = R++; src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); var tildeTrimReplace = '$1~'; var TILDE = R++; src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; var TILDELOOSE = R++; src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; // Caret ranges. // Meaning is "at least and backwards compatible with" var LONECARET = R++; src[LONECARET] = '(?:\\^)'; var CARETTRIM = R++; src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); var caretTrimReplace = '$1^'; var CARET = R++; src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; var CARETLOOSE = R++; src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; // A simple gt/lt/eq thing, or just "" to indicate "any version" var COMPARATORLOOSE = R++; src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; var COMPARATOR = R++; src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` var COMPARATORTRIM = R++; src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; // this one has to use the /g flag re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); var comparatorTrimReplace = '$1$2$3'; // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. var HYPHENRANGE = R++; src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAIN] + ')' + '\\s*$'; var HYPHENRANGELOOSE = R++; src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAINLOOSE] + ')' + '\\s*$'; // Star ranges basically just allow anything at all. var STAR = R++; src[STAR] = '(<|>)?=?\\s*\\*'; // Compile to actual regexp objects. // All are flag-free, unless they were created above with a flag. for (var i = 0; i < R; i++) { debug(i, src[i]); if (!re[i]) re[i] = new RegExp(src[i]); } exports.parse = parse; function parse(version, loose) { if (version instanceof SemVer) return version; if (typeof version !== 'string') return null; if (version.length > MAX_LENGTH) return null; var r = loose ? re[LOOSE] : re[FULL]; if (!r.test(version)) return null; try { return new SemVer(version, loose); } catch (er) { return null; } } exports.valid = valid; function valid(version, loose) { var v = parse(version, loose); return v ? v.version : null; } exports.clean = clean; function clean(version, loose) { var s = parse(version.trim().replace(/^[=v]+/, ''), loose); return s ? s.version : null; } exports.SemVer = SemVer; function SemVer(version, loose) { if (version instanceof SemVer) { if (version.loose === loose) return version; else version = version.version; } else if (typeof version !== 'string') { throw new TypeError('Invalid Version: ' + version); } if (version.length > MAX_LENGTH) throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') if (!(this instanceof SemVer)) return new SemVer(version, loose); debug('SemVer', version, loose); this.loose = loose; var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); if (!m) throw new TypeError('Invalid Version: ' + version); this.raw = version; // these are actually numbers this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError('Invalid major version') if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError('Invalid minor version') if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError('Invalid patch version') // numberify any prerelease numeric ids if (!m[4]) this.prerelease = []; else this.prerelease = m[4].split('.').map(function(id) { if (/^[0-9]+$/.test(id)) { var num = +id; if (num >= 0 && num < MAX_SAFE_INTEGER) return num; } return id; }); this.build = m[5] ? m[5].split('.') : []; this.format(); } SemVer.prototype.format = function() { this.version = this.major + '.' + this.minor + '.' + this.patch; if (this.prerelease.length) this.version += '-' + this.prerelease.join('.'); return this.version; }; SemVer.prototype.toString = function() { return this.version; }; SemVer.prototype.compare = function(other) { debug('SemVer.compare', this.version, this.loose, other); if (!(other instanceof SemVer)) other = new SemVer(other, this.loose); return this.compareMain(other) || this.comparePre(other); }; SemVer.prototype.compareMain = function(other) { if (!(other instanceof SemVer)) other = new SemVer(other, this.loose); return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); }; SemVer.prototype.comparePre = function(other) { if (!(other instanceof SemVer)) other = new SemVer(other, this.loose); // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) return -1; else if (!this.prerelease.length && other.prerelease.length) return 1; else if (!this.prerelease.length && !other.prerelease.length) return 0; var i = 0; do { var a = this.prerelease[i]; var b = other.prerelease[i]; debug('prerelease compare', i, a, b); if (a === undefined && b === undefined) return 0; else if (b === undefined) return 1; else if (a === undefined) return -1; else if (a === b) continue; else return compareIdentifiers(a, b); } while (++i); }; // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. SemVer.prototype.inc = function(release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0; this.patch = 0; this.minor = 0; this.major++; this.inc('pre', identifier); break; case 'preminor': this.prerelease.length = 0; this.patch = 0; this.minor++; this.inc('pre', identifier); break; case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0; this.inc('patch', identifier); this.inc('pre', identifier); break; // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) this.inc('patch', identifier); this.inc('pre', identifier); break; case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++; this.minor = 0; this.patch = 0; this.prerelease = []; break; case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) this.minor++; this.patch = 0; this.prerelease = []; break; case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) this.patch++; this.prerelease = []; break; // This probably shouldn't be used publicly. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) this.prerelease = [0]; else { var i = this.prerelease.length; while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++; i = -2; } } if (i === -1) // didn't increment anything this.prerelease.push(0); } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) this.prerelease = [identifier, 0]; } else this.prerelease = [identifier, 0]; } break; default: throw new Error('invalid increment argument: ' + release); } this.format(); this.raw = this.version; return this; }; exports.inc = inc; function inc(version, release, loose, identifier) { if (typeof(loose) === 'string') { identifier = loose; loose = undefined; } try { return new SemVer(version, loose).inc(release, identifier).version; } catch (er) { return null; } } exports.diff = diff; function diff(version1, version2) { if (eq(version1, version2)) { return null; } else { var v1 = parse(version1); var v2 = parse(version2); if (v1.prerelease.length || v2.prerelease.length) { for (var key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return 'pre'+key; } } } return 'prerelease'; } for (var key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return key; } } } } } exports.compareIdentifiers = compareIdentifiers; var numeric = /^[0-9]+$/; function compareIdentifiers(a, b) { var anum = numeric.test(a); var bnum = numeric.test(b); if (anum && bnum) { a = +a; b = +b; } return (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : a > b ? 1 : 0; } exports.rcompareIdentifiers = rcompareIdentifiers; function rcompareIdentifiers(a, b) { return compareIdentifiers(b, a); } exports.major = major; function major(a, loose) { return new SemVer(a, loose).major; } exports.minor = minor; function minor(a, loose) { return new SemVer(a, loose).minor; } exports.patch = patch; function patch(a, loose) { return new SemVer(a, loose).patch; } exports.compare = compare; function compare(a, b, loose) { return new SemVer(a, loose).compare(new SemVer(b, loose)); } exports.compareLoose = compareLoose; function compareLoose(a, b) { return compare(a, b, true); } exports.rcompare = rcompare; function rcompare(a, b, loose) { return compare(b, a, loose); } exports.sort = sort; function sort(list, loose) { return list.sort(function(a, b) { return exports.compare(a, b, loose); }); } exports.rsort = rsort; function rsort(list, loose) { return list.sort(function(a, b) { return exports.rcompare(a, b, loose); }); } exports.gt = gt; function gt(a, b, loose) { return compare(a, b, loose) > 0; } exports.lt = lt; function lt(a, b, loose) { return compare(a, b, loose) < 0; } exports.eq = eq; function eq(a, b, loose) { return compare(a, b, loose) === 0; } exports.neq = neq; function neq(a, b, loose) { return compare(a, b, loose) !== 0; } exports.gte = gte; function gte(a, b, loose) { return compare(a, b, loose) >= 0; } exports.lte = lte; function lte(a, b, loose) { return compare(a, b, loose) <= 0; } exports.cmp = cmp; function cmp(a, op, b, loose) { var ret; switch (op) { case '===': if (typeof a === 'object') a = a.version; if (typeof b === 'object') b = b.version; ret = a === b; break; case '!==': if (typeof a === 'object') a = a.version; if (typeof b === 'object') b = b.version; ret = a !== b; break; case '': case '=': case '==': ret = eq(a, b, loose); break; case '!=': ret = neq(a, b, loose); break; case '>': ret = gt(a, b, loose); break; case '>=': ret = gte(a, b, loose); break; case '<': ret = lt(a, b, loose); break; case '<=': ret = lte(a, b, loose); break; default: throw new TypeError('Invalid operator: ' + op); } return ret; } exports.Comparator = Comparator; function Comparator(comp, loose) { if (comp instanceof Comparator) { if (comp.loose === loose) return comp; else comp = comp.value; } if (!(this instanceof Comparator)) return new Comparator(comp, loose); debug('comparator', comp, loose); this.loose = loose; this.parse(comp); if (this.semver === ANY) this.value = ''; else this.value = this.operator + this.semver.version; debug('comp', this); } var ANY = {}; Comparator.prototype.parse = function(comp) { var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; var m = comp.match(r); if (!m) throw new TypeError('Invalid comparator: ' + comp); this.operator = m[1]; if (this.operator === '=') this.operator = ''; // if it literally is just '>' or '' then allow anything. if (!m[2]) this.semver = ANY; else this.semver = new SemVer(m[2], this.loose); }; Comparator.prototype.toString = function() { return this.value; }; Comparator.prototype.test = function(version) { debug('Comparator.test', version, this.loose); if (this.semver === ANY) return true; if (typeof version === 'string') version = new SemVer(version, this.loose); return cmp(version, this.operator, this.semver, this.loose); }; Comparator.prototype.intersects = function(comp, loose) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required'); } var rangeTmp; if (this.operator === '') { rangeTmp = new Range(comp.value, loose); return satisfies(this.value, rangeTmp, loose); } else if (comp.operator === '') { rangeTmp = new Range(this.value, loose); return satisfies(comp.semver, rangeTmp, loose); } var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>'); var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<'); var sameSemVer = this.semver.version === comp.semver.version; var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<='); var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, loose) && ((this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<')); var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, loose) && ((this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>')); return sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; }; exports.Range = Range; function Range(range, loose) { if (range instanceof Range) { if (range.loose === loose) { return range; } else { return new Range(range.raw, loose); } } if (range instanceof Comparator) { return new Range(range.value, loose); } if (!(this instanceof Range)) return new Range(range, loose); this.loose = loose; // First, split based on boolean or || this.raw = range; this.set = range.split(/\s*\|\|\s*/).map(function(range) { return this.parseRange(range.trim()); }, this).filter(function(c) { // throw out any that are not relevant for whatever reason return c.length; }); if (!this.set.length) { throw new TypeError('Invalid SemVer Range: ' + range); } this.format(); } Range.prototype.format = function() { this.range = this.set.map(function(comps) { return comps.join(' ').trim(); }).join('||').trim(); return this.range; }; Range.prototype.toString = function() { return this.range; }; Range.prototype.parseRange = function(range) { var loose = this.loose; range = range.trim(); debug('range', range, loose); // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; range = range.replace(hr, hyphenReplace); debug('hyphen replace', range); // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); debug('comparator trim', range, re[COMPARATORTRIM]); // `~ 1.2.3` => `~1.2.3` range = range.replace(re[TILDETRIM], tildeTrimReplace); // `^ 1.2.3` => `^1.2.3` range = range.replace(re[CARETTRIM], caretTrimReplace); // normalize spaces range = range.split(/\s+/).join(' '); // At this point, the range is completely trimmed and // ready to be split into comparators. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; var set = range.split(' ').map(function(comp) { return parseComparator(comp, loose); }).join(' ').split(/\s+/); if (this.loose) { // in loose mode, throw out any that are not valid comparators set = set.filter(function(comp) { return !!comp.match(compRe); }); } set = set.map(function(comp) { return new Comparator(comp, loose); }); return set; }; Range.prototype.intersects = function(range, loose) { if (!(range instanceof Range)) { throw new TypeError('a Range is required'); } return this.set.some(function(thisComparators) { return thisComparators.every(function(thisComparator) { return range.set.some(function(rangeComparators) { return rangeComparators.every(function(rangeComparator) { return thisComparator.intersects(rangeComparator, loose); }); }); }); }); }; // Mostly just for testing and legacy API reasons exports.toComparators = toComparators; function toComparators(range, loose) { return new Range(range, loose).set.map(function(comp) { return comp.map(function(c) { return c.value; }).join(' ').trim().split(' '); }); } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. function parseComparator(comp, loose) { debug('comp', comp); comp = replaceCarets(comp, loose); debug('caret', comp); comp = replaceTildes(comp, loose); debug('tildes', comp); comp = replaceXRanges(comp, loose); debug('xrange', comp); comp = replaceStars(comp, loose); debug('stars', comp); return comp; } function isX(id) { return !id || id.toLowerCase() === 'x' || id === '*'; } // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 function replaceTildes(comp, loose) { return comp.trim().split(/\s+/).map(function(comp) { return replaceTilde(comp, loose); }).join(' '); } function replaceTilde(comp, loose) { var r = loose ? re[TILDELOOSE] : re[TILDE]; return comp.replace(r, function(_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr); var ret; if (isX(M)) ret = ''; else if (isX(m)) ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) // ~1.2 == >=1.2.0 <1.3.0 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else if (pr) { debug('replaceTilde pr', pr); if (pr.charAt(0) !== '-') pr = '-' + pr; ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + M + '.' + (+m + 1) + '.0'; } else // ~1.2.3 == >=1.2.3 <1.3.0 ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0'; debug('tilde return', ret); return ret; }); } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 // ^1.2.3 --> >=1.2.3 <2.0.0 // ^1.2.0 --> >=1.2.0 <2.0.0 function replaceCarets(comp, loose) { return comp.trim().split(/\s+/).map(function(comp) { return replaceCaret(comp, loose); }).join(' '); } function replaceCaret(comp, loose) { debug('caret', comp, loose); var r = loose ? re[CARETLOOSE] : re[CARET]; return comp.replace(r, function(_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr); var ret; if (isX(M)) ret = ''; else if (isX(m)) ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) { if (M === '0') ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; } else if (pr) { debug('replaceCaret pr', pr); if (pr.charAt(0) !== '-') pr = '-' + pr; if (M === '0') { if (m === '0') ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + M + '.' + m + '.' + (+p + 1); else ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + M + '.' + (+m + 1) + '.0'; } else ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + (+M + 1) + '.0.0'; } else { debug('no pr'); if (M === '0') { if (m === '0') ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + m + '.' + (+p + 1); else ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0'; } else ret = '>=' + M + '.' + m + '.' + p + ' <' + (+M + 1) + '.0.0'; } debug('caret return', ret); return ret; }); } function replaceXRanges(comp, loose) { debug('replaceXRanges', comp, loose); return comp.split(/\s+/).map(function(comp) { return replaceXRange(comp, loose); }).join(' '); } function replaceXRange(comp, loose) { comp = comp.trim(); var r = loose ? re[XRANGELOOSE] : re[XRANGE]; return comp.replace(r, function(ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr); var xM = isX(M); var xm = xM || isX(m); var xp = xm || isX(p); var anyX = xp; if (gtlt === '=' && anyX) gtlt = ''; if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0'; } else { // nothing is forbidden ret = '*'; } } else if (gtlt && anyX) { // replace X with 0 if (xm) m = 0; if (xp) p = 0; if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 // >1.2.3 => >= 1.2.4 gtlt = '>='; if (xm) { M = +M + 1; m = 0; p = 0; } else if (xp) { m = +m + 1; p = 0; } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<'; if (xm) M = +M + 1; else m = +m + 1; } ret = gtlt + M + '.' + m + '.' + p; } else if (xm) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; } else if (xp) { ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; } debug('xRange return', ret); return ret; }); } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. function replaceStars(comp, loose) { debug('replaceStars', comp, loose); // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[STAR], ''); } // This function is passed to string.replace(re[HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0 function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { if (isX(fM)) from = ''; else if (isX(fm)) from = '>=' + fM + '.0.0'; else if (isX(fp)) from = '>=' + fM + '.' + fm + '.0'; else from = '>=' + from; if (isX(tM)) to = ''; else if (isX(tm)) to = '<' + (+tM + 1) + '.0.0'; else if (isX(tp)) to = '<' + tM + '.' + (+tm + 1) + '.0'; else if (tpr) to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; else to = '<=' + to; return (from + ' ' + to).trim(); } // if ANY of the sets match ALL of its comparators, then pass Range.prototype.test = function(version) { if (!version) return false; if (typeof version === 'string') version = new SemVer(version, this.loose); for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version)) return true; } return false; }; function testSet(set, version) { for (var i = 0; i < set.length; i++) { if (!set[i].test(version)) return false; } if (version.prerelease.length) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (var i = 0; i < set.length; i++) { debug(set[i].semver); if (set[i].semver === ANY) continue; if (set[i].semver.prerelease.length > 0) { var allowed = set[i].semver; if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true; } } // Version has a -pre, but it's not one of the ones we like. return false; } return true; } exports.satisfies = satisfies; function satisfies(version, range, loose) { try { range = new Range(range, loose); } catch (er) { return false; } return range.test(version); } exports.maxSatisfying = maxSatisfying; function maxSatisfying(versions, range, loose) { var max = null; var maxSV = null; try { var rangeObj = new Range(range, loose); } catch (er) { return null; } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, loose) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v; maxSV = new SemVer(max, loose); } } }) return max; } exports.minSatisfying = minSatisfying; function minSatisfying(versions, range, loose) { var min = null; var minSV = null; try { var rangeObj = new Range(range, loose); } catch (er) { return null; } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, loose) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v; minSV = new SemVer(min, loose); } } }) return min; } exports.validRange = validRange; function validRange(range, loose) { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, loose).range || '*'; } catch (er) { return null; } } // Determine if version is less than all the versions possible in the range exports.ltr = ltr; function ltr(version, range, loose) { return outside(version, range, '<', loose); } // Determine if version is greater than all the versions possible in the range. exports.gtr = gtr; function gtr(version, range, loose) { return outside(version, range, '>', loose); } exports.outside = outside; function outside(version, range, hilo, loose) { version = new SemVer(version, loose); range = new Range(range, loose); var gtfn, ltefn, ltfn, comp, ecomp; switch (hilo) { case '>': gtfn = gt; ltefn = lte; ltfn = lt; comp = '>'; ecomp = '>='; break; case '<': gtfn = lt; ltefn = gte; ltfn = gt; comp = '<'; ecomp = '<='; break; default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } // If it satisifes the range it is not outside if (satisfies(version, range, loose)) { return false; } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i]; var high = null; var low = null; comparators.forEach(function(comparator) { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator; low = low || comparator; if (gtfn(comparator.semver, high.semver, loose)) { high = comparator; } else if (ltfn(comparator.semver, low.semver, loose)) { low = comparator; } }); // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false; } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false; } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false; } } return true; } exports.prerelease = prerelease; function prerelease(version, loose) { var parsed = parse(version, loose); return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; } exports.intersects = intersects; function intersects(r1, r2, loose) { r1 = new Range(r1, loose) r2 = new Range(r2, loose) return r1.intersects(r2) } exports.coerce = coerce; function coerce(version) { if (version instanceof SemVer) return version; if (typeof version !== 'string') return null; var match = version.match(re[COERCE]); if (match == null) return null; return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0')); } /***/ }), /* 113 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const isWin = process.platform === 'win32'; function notFoundError(original, syscall) { return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { code: 'ENOENT', errno: 'ENOENT', syscall: `${syscall} ${original.command}`, path: original.command, spawnargs: original.args, }); } function hookChildProcess(cp, parsed) { if (!isWin) { return; } const originalEmit = cp.emit; cp.emit = function (name, arg1) { // If emitting "exit" event and exit code is 1, we need to check if // the command exists and emit an "error" instead // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 if (name === 'exit') { const err = verifyENOENT(arg1, parsed, 'spawn'); if (err) { return originalEmit.call(cp, 'error', err); } } return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params }; } function verifyENOENT(status, parsed) { if (isWin && status === 1 && !parsed.file) { return notFoundError(parsed.original, 'spawn'); } return null; } function verifyENOENTSync(status, parsed) { if (isWin && status === 1 && !parsed.file) { return notFoundError(parsed.original, 'spawnSync'); } return null; } module.exports = { hookChildProcess, verifyENOENT, verifyENOENTSync, notFoundError, }; /***/ }), /* 114 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (x) { var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt(); var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt(); if (x[x.length - 1] === lf) { x = x.slice(0, x.length - 1); } if (x[x.length - 1] === cr) { x = x.slice(0, x.length - 1); } return x; }; /***/ }), /* 115 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); const pathKey = __webpack_require__(116); module.exports = opts => { opts = Object.assign({ cwd: process.cwd(), path: process.env[pathKey()] }, opts); let prev; let pth = path.resolve(opts.cwd); const ret = []; while (prev !== pth) { ret.push(path.join(pth, 'node_modules/.bin')); prev = pth; pth = path.resolve(pth, '..'); } // ensure the running `node` binary is used ret.push(path.dirname(process.execPath)); return ret.concat(opts.path).join(path.delimiter); }; module.exports.env = opts => { opts = Object.assign({ env: process.env }, opts); const env = Object.assign({}, opts.env); const path = pathKey({env}); opts.path = env[path]; env[path] = module.exports(opts); return env; }; /***/ }), /* 116 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = opts => { opts = opts || {}; const env = opts.env || process.env; const platform = opts.platform || process.platform; if (platform !== 'win32') { return 'PATH'; } return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; }; /***/ }), /* 117 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isStream = module.exports = function (stream) { return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; }; isStream.writable = function (stream) { return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; }; isStream.readable = function (stream) { return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; }; isStream.duplex = function (stream) { return isStream.writable(stream) && isStream.readable(stream); }; isStream.transform = function (stream) { return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; }; /***/ }), /* 118 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const pump = __webpack_require__(119); const bufferStream = __webpack_require__(121); class MaxBufferError extends Error { constructor() { super('maxBuffer exceeded'); this.name = 'MaxBufferError'; } } function getStream(inputStream, options) { if (!inputStream) { return Promise.reject(new Error('Expected a stream')); } options = Object.assign({maxBuffer: Infinity}, options); const {maxBuffer} = options; let stream; return new Promise((resolve, reject) => { const rejectPromise = error => { if (error) { // A null check error.bufferedData = stream.getBufferedValue(); } reject(error); }; stream = pump(inputStream, bufferStream(options), error => { if (error) { rejectPromise(error); return; } resolve(); }); stream.on('data', () => { if (stream.getBufferedLength() > maxBuffer) { rejectPromise(new MaxBufferError()); } }); }).then(() => stream.getBufferedValue()); } module.exports = getStream; module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'})); module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true})); module.exports.MaxBufferError = MaxBufferError; /***/ }), /* 119 */ /***/ (function(module, exports, __webpack_require__) { var once = __webpack_require__(51) var eos = __webpack_require__(120) var fs = __webpack_require__(23) // we only need fs to get the ReadStream and WriteStream prototypes var noop = function () {} var ancient = /^v?\.0/.test(process.version) var isFn = function (fn) { return typeof fn === 'function' } var isFS = function (stream) { if (!ancient) return false // newer node version do not need to care about fs is a special way if (!fs) return false // browser return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) } var isRequest = function (stream) { return stream.setHeader && isFn(stream.abort) } var destroyer = function (stream, reading, writing, callback) { callback = once(callback) var closed = false stream.on('close', function () { closed = true }) eos(stream, {readable: reading, writable: writing}, function (err) { if (err) return callback(err) closed = true callback() }) var destroyed = false return function (err) { if (closed) return if (destroyed) return destroyed = true if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want if (isFn(stream.destroy)) return stream.destroy() callback(err || new Error('stream was destroyed')) } } var call = function (fn) { fn() } var pipe = function (from, to) { return from.pipe(to) } var pump = function () { var streams = Array.prototype.slice.call(arguments) var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop if (Array.isArray(streams[0])) streams = streams[0] if (streams.length < 2) throw new Error('pump requires two streams per minimum') var error var destroys = streams.map(function (stream, i) { var reading = i < streams.length - 1 var writing = i > 0 return destroyer(stream, reading, writing, function (err) { if (!error) error = err if (err) destroys.forEach(call) if (reading) return destroys.forEach(call) callback(error) }) }) return streams.reduce(pipe) } module.exports = pump /***/ }), /* 120 */ /***/ (function(module, exports, __webpack_require__) { var once = __webpack_require__(51); var noop = function() {}; var isRequest = function(stream) { return stream.setHeader && typeof stream.abort === 'function'; }; var isChildProcess = function(stream) { return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 }; var eos = function(stream, opts, callback) { if (typeof opts === 'function') return eos(stream, null, opts); if (!opts) opts = {}; callback = once(callback || noop); var ws = stream._writableState; var rs = stream._readableState; var readable = opts.readable || (opts.readable !== false && stream.readable); var writable = opts.writable || (opts.writable !== false && stream.writable); var onlegacyfinish = function() { if (!stream.writable) onfinish(); }; var onfinish = function() { writable = false; if (!readable) callback.call(stream); }; var onend = function() { readable = false; if (!writable) callback.call(stream); }; var onexit = function(exitCode) { callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); }; var onerror = function(err) { callback.call(stream, err); }; var onclose = function() { if (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close')); if (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close')); }; var onrequest = function() { stream.req.on('finish', onfinish); }; if (isRequest(stream)) { stream.on('complete', onfinish); stream.on('abort', onclose); if (stream.req) onrequest(); else stream.on('request', onrequest); } else if (writable && !ws) { // legacy streams stream.on('end', onlegacyfinish); stream.on('close', onlegacyfinish); } if (isChildProcess(stream)) stream.on('exit', onexit); stream.on('end', onend); stream.on('finish', onfinish); if (opts.error !== false) stream.on('error', onerror); stream.on('close', onclose); return function() { stream.removeListener('complete', onfinish); stream.removeListener('abort', onclose); stream.removeListener('request', onrequest); if (stream.req) stream.req.removeListener('finish', onfinish); stream.removeListener('end', onlegacyfinish); stream.removeListener('close', onlegacyfinish); stream.removeListener('finish', onfinish); stream.removeListener('exit', onexit); stream.removeListener('end', onend); stream.removeListener('error', onerror); stream.removeListener('close', onclose); }; }; module.exports = eos; /***/ }), /* 121 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const {PassThrough} = __webpack_require__(28); module.exports = options => { options = Object.assign({}, options); const {array} = options; let {encoding} = options; const buffer = encoding === 'buffer'; let objectMode = false; if (array) { objectMode = !(encoding || buffer); } else { encoding = encoding || 'utf8'; } if (buffer) { encoding = null; } let len = 0; const ret = []; const stream = new PassThrough({objectMode}); if (encoding) { stream.setEncoding(encoding); } stream.on('data', chunk => { ret.push(chunk); if (objectMode) { len = ret.length; } else { len += chunk.length; } }); stream.getBufferedValue = () => { if (array) { return ret; } return buffer ? Buffer.concat(ret, len) : ret.join(''); }; stream.getBufferedLength = () => len; return stream; }; /***/ }), /* 122 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = (promise, onFinally) => { onFinally = onFinally || (() => {}); return promise.then( val => new Promise(resolve => { resolve(onFinally()); }).then(() => val), err => new Promise(resolve => { resolve(onFinally()); }).then(() => { throw err; }) ); }; /***/ }), /* 123 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Older verions of Node.js might not have `util.getSystemErrorName()`. // In that case, fall back to a deprecated internal. const util = __webpack_require__(29); let uv; if (typeof util.getSystemErrorName === 'function') { module.exports = util.getSystemErrorName; } else { try { uv = process.binding('uv'); if (typeof uv.errname !== 'function') { throw new TypeError('uv.errname is not a function'); } } catch (err) { console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); uv = null; } module.exports = code => errname(uv, code); } // Used for testing the fallback behavior module.exports.__test__ = errname; function errname(uv, code) { if (uv) { return uv.errname(code); } if (!(code < 0)) { throw new Error('err >= 0'); } return `Unknown system error ${code}`; } /***/ }), /* 124 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const alias = ['stdin', 'stdout', 'stderr']; const hasAlias = opts => alias.some(x => Boolean(opts[x])); module.exports = opts => { if (!opts) { return null; } if (opts.stdio && hasAlias(opts)) { throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`); } if (typeof opts.stdio === 'string') { return opts.stdio; } const stdio = opts.stdio || []; if (!Array.isArray(stdio)) { throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); } const result = []; const len = Math.max(stdio.length, alias.length); for (let i = 0; i < len; i++) { let value = null; if (stdio[i] !== undefined) { value = stdio[i]; } else if (opts[alias[i]] !== undefined) { value = opts[alias[i]]; } result[i] = value; } return result; }; /***/ }), /* 125 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const chalk = __webpack_require__(2); const isSupported = process.platform !== 'win32' || process.env.CI || process.env.TERM === 'xterm-256color'; const main = { info: chalk.blue('ℹ'), success: chalk.green('✔'), warning: chalk.yellow('⚠'), error: chalk.red('✖') }; const fallbacks = { info: chalk.blue('i'), success: chalk.green('√'), warning: chalk.yellow('‼'), error: chalk.red('×') }; module.exports = isSupported ? main : fallbacks; /***/ }), /* 126 */ /***/ (function(module, exports, __webpack_require__) { // Copyright IBM Corp. 2014,2018. All Rights Reserved. // Node module: strong-log-transformer // This file is licensed under the Apache License 2.0. // License text available at https://opensource.org/licenses/Apache-2.0 module.exports = __webpack_require__(127); module.exports.cli = __webpack_require__(131); /***/ }), /* 127 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright IBM Corp. 2014,2018. All Rights Reserved. // Node module: strong-log-transformer // This file is licensed under the Apache License 2.0. // License text available at https://opensource.org/licenses/Apache-2.0 var stream = __webpack_require__(28); var util = __webpack_require__(29); var fs = __webpack_require__(23); var through = __webpack_require__(128); var duplexer = __webpack_require__(129); var StringDecoder = __webpack_require__(130).StringDecoder; module.exports = Logger; Logger.DEFAULTS = { format: 'text', tag: '', mergeMultiline: false, timeStamp: false, }; var formatters = { text: textFormatter, json: jsonFormatter, } function Logger(options) { var defaults = JSON.parse(JSON.stringify(Logger.DEFAULTS)); options = util._extend(defaults, options || {}); var catcher = deLiner(); var emitter = catcher; var transforms = [ objectifier(), ]; if (options.tag) { transforms.push(staticTagger(options.tag)); } if (options.mergeMultiline) { transforms.push(lineMerger()); } // TODO // if (options.pidStamp) { // transforms.push(pidStamper(options.pid)); // } // TODO // if (options.workerStamp) { // transforms.push(workerStamper(options.worker)); // } transforms.push(formatters[options.format](options)); // restore line endings that were removed by line splitting transforms.push(reLiner()); for (var t in transforms) { emitter = emitter.pipe(transforms[t]); } return duplexer(catcher, emitter); } function deLiner() { var decoder = new StringDecoder('utf8'); var last = ''; return new stream.Transform({ transform(chunk, _enc, callback) { last += decoder.write(chunk); var list = last.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g); last = list.pop(); for (var i = 0; i < list.length; i++) { // swallow empty lines if (list[i]) { this.push(list[i]); } } callback(); }, flush(callback) { // incomplete UTF8 sequences become UTF8 replacement characters last += decoder.end(); if (last) { this.push(last); } callback(); }, }); } function reLiner() { return through(appendNewline); function appendNewline(line) { this.emit('data', line + '\n'); } } function objectifier() { return through(objectify, null, {autoDestroy: false}); function objectify(line) { this.emit('data', { msg: line, time: Date.now(), }); } } function staticTagger(tag) { return through(tagger); function tagger(logEvent) { logEvent.tag = tag; this.emit('data', logEvent); } } function textFormatter(options) { return through(textify); function textify(logEvent) { var line = util.format('%s%s', textifyTags(logEvent.tag), logEvent.msg.toString()); if (options.timeStamp) { line = util.format('%s %s', new Date(logEvent.time).toISOString(), line); } this.emit('data', line.replace(/\n/g, '\\n')); } function textifyTags(tags) { var str = ''; if (typeof tags === 'string') { str = tags + ' '; } else if (typeof tags === 'object') { for (var t in tags) { str += t + ':' + tags[t] + ' '; } } return str; } } function jsonFormatter(options) { return through(jsonify); function jsonify(logEvent) { if (options.timeStamp) { logEvent.time = new Date(logEvent.time).toISOString(); } else { delete logEvent.time; } logEvent.msg = logEvent.msg.toString(); this.emit('data', JSON.stringify(logEvent)); } } function lineMerger(host) { var previousLine = null; var flushTimer = null; var stream = through(lineMergerWrite, lineMergerEnd); var flush = _flush.bind(stream); return stream; function lineMergerWrite(line) { if (/^\s+/.test(line.msg)) { if (previousLine) { previousLine.msg += '\n' + line.msg; } else { previousLine = line; } } else { flush(); previousLine = line; } // rolling timeout clearTimeout(flushTimer); flushTimer = setTimeout(flush.bind(this), 10); } function _flush() { if (previousLine) { this.emit('data', previousLine); previousLine = null; } } function lineMergerEnd() { flush.call(this); this.emit('end'); } } /***/ }), /* 128 */ /***/ (function(module, exports, __webpack_require__) { var Stream = __webpack_require__(28) // through // // a stream that does nothing but re-emit the input. // useful for aggregating a series of changing but not ending streams into one stream) exports = module.exports = through through.through = through //create a readable writable stream. function through (write, end, opts) { write = write || function (data) { this.queue(data) } end = end || function () { this.queue(null) } var ended = false, destroyed = false, buffer = [], _ended = false var stream = new Stream() stream.readable = stream.writable = true stream.paused = false // stream.autoPause = !(opts && opts.autoPause === false) stream.autoDestroy = !(opts && opts.autoDestroy === false) stream.write = function (data) { write.call(this, data) return !stream.paused } function drain() { while(buffer.length && !stream.paused) { var data = buffer.shift() if(null === data) return stream.emit('end') else stream.emit('data', data) } } stream.queue = stream.push = function (data) { // console.error(ended) if(_ended) return stream if(data === null) _ended = true buffer.push(data) drain() return stream } //this will be registered as the first 'end' listener //must call destroy next tick, to make sure we're after any //stream piped from here. //this is only a problem if end is not emitted synchronously. //a nicer way to do this is to make sure this is the last listener for 'end' stream.on('end', function () { stream.readable = false if(!stream.writable && stream.autoDestroy) process.nextTick(function () { stream.destroy() }) }) function _end () { stream.writable = false end.call(stream) if(!stream.readable && stream.autoDestroy) stream.destroy() } stream.end = function (data) { if(ended) return ended = true if(arguments.length) stream.write(data) _end() // will emit or queue return stream } stream.destroy = function () { if(destroyed) return destroyed = true ended = true buffer.length = 0 stream.writable = stream.readable = false stream.emit('close') return stream } stream.pause = function () { if(stream.paused) return stream.paused = true return stream } stream.resume = function () { if(stream.paused) { stream.paused = false stream.emit('resume') } drain() //may have become paused again, //as drain emits 'data'. if(!stream.paused) stream.emit('drain') return stream } return stream } /***/ }), /* 129 */ /***/ (function(module, exports, __webpack_require__) { var Stream = __webpack_require__(28) var writeMethods = ["write", "end", "destroy"] var readMethods = ["resume", "pause"] var readEvents = ["data", "close"] var slice = Array.prototype.slice module.exports = duplex function forEach (arr, fn) { if (arr.forEach) { return arr.forEach(fn) } for (var i = 0; i < arr.length; i++) { fn(arr[i], i) } } function duplex(writer, reader) { var stream = new Stream() var ended = false forEach(writeMethods, proxyWriter) forEach(readMethods, proxyReader) forEach(readEvents, proxyStream) reader.on("end", handleEnd) writer.on("drain", function() { stream.emit("drain") }) writer.on("error", reemit) reader.on("error", reemit) stream.writable = writer.writable stream.readable = reader.readable return stream function proxyWriter(methodName) { stream[methodName] = method function method() { return writer[methodName].apply(writer, arguments) } } function proxyReader(methodName) { stream[methodName] = method function method() { stream.emit(methodName) var func = reader[methodName] if (func) { return func.apply(reader, arguments) } reader.emit(methodName) } } function proxyStream(methodName) { reader.on(methodName, reemit) function reemit() { var args = slice.call(arguments) args.unshift(methodName) stream.emit.apply(stream, args) } } function handleEnd() { if (ended) { return } ended = true var args = slice.call(arguments) args.unshift("end") stream.emit.apply(stream, args) } function reemit(err) { stream.emit("error", err) } } /***/ }), /* 130 */ /***/ (function(module, exports) { module.exports = require("string_decoder"); /***/ }), /* 131 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright IBM Corp. 2014,2018. All Rights Reserved. // Node module: strong-log-transformer // This file is licensed under the Apache License 2.0. // License text available at https://opensource.org/licenses/Apache-2.0 var minimist = __webpack_require__(132); var path = __webpack_require__(16); var Logger = __webpack_require__(127); var pkg = __webpack_require__(133); module.exports = cli; function cli(args) { var opts = minimist(args.slice(2)); var $0 = path.basename(args[1]); var p = console.log.bind(console); if (opts.v || opts.version) { version($0, p); } else if (opts.h || opts.help) { usage($0, p); } else if (args.length < 3) { process.stdin.pipe(Logger()).pipe(process.stdout); } else { process.stdin.pipe(Logger(opts)).pipe(process.stdout); } } function version($0, p) { p('%s v%s', pkg.name, pkg.version); } function usage($0, p) { var PADDING = ' '; var opt, def; p('Usage: %s [options]', $0); p(''); p('%s', pkg.description); p(''); p('OPTIONS:'); for (opt in Logger.DEFAULTS) { def = Logger.DEFAULTS[opt]; if (typeof def === 'boolean') boolOpt(opt, Logger.DEFAULTS[opt]); else stdOpt(opt, Logger.DEFAULTS[opt]); } p(''); function boolOpt(name, def) { name = name + PADDING.slice(0, 20-name.length); p(' --%s default: %s', name, def); } function stdOpt(name, def) { var value = name.toUpperCase() + PADDING.slice(0, 19 - name.length*2); p(' --%s %s default: %j', name, value, def); } } /***/ }), /* 132 */ /***/ (function(module, exports) { module.exports = function (args, opts) { if (!opts) opts = {}; var flags = { bools : {}, strings : {}, unknownFn: null }; if (typeof opts['unknown'] === 'function') { flags.unknownFn = opts['unknown']; } if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { flags.allBools = true; } else { [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { flags.bools[key] = true; }); } var aliases = {}; Object.keys(opts.alias || {}).forEach(function (key) { aliases[key] = [].concat(opts.alias[key]); aliases[key].forEach(function (x) { aliases[x] = [key].concat(aliases[key].filter(function (y) { return x !== y; })); }); }); [].concat(opts.string).filter(Boolean).forEach(function (key) { flags.strings[key] = true; if (aliases[key]) { flags.strings[aliases[key]] = true; } }); var defaults = opts['default'] || {}; var argv = { _ : [] }; Object.keys(flags.bools).forEach(function (key) { setArg(key, defaults[key] === undefined ? false : defaults[key]); }); var notFlags = []; if (args.indexOf('--') !== -1) { notFlags = args.slice(args.indexOf('--')+1); args = args.slice(0, args.indexOf('--')); } function argDefined(key, arg) { return (flags.allBools && /^--[^=]+$/.test(arg)) || flags.strings[key] || flags.bools[key] || aliases[key]; } function setArg (key, val, arg) { if (arg && flags.unknownFn && !argDefined(key, arg)) { if (flags.unknownFn(arg) === false) return; } var value = !flags.strings[key] && isNumber(val) ? Number(val) : val ; setKey(argv, key.split('.'), value); (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), value); }); } function setKey (obj, keys, value) { var o = obj; keys.slice(0,-1).forEach(function (key) { if (o[key] === undefined) o[key] = {}; o = o[key]; }); var key = keys[keys.length - 1]; if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { o[key] = value; } else if (Array.isArray(o[key])) { o[key].push(value); } else { o[key] = [ o[key], value ]; } } function aliasIsBoolean(key) { return aliases[key].some(function (x) { return flags.bools[x]; }); } for (var i = 0; i < args.length; i++) { var arg = args[i]; if (/^--.+=/.test(arg)) { // Using [\s\S] instead of . because js doesn't support the // 'dotall' regex modifier. See: // http://stackoverflow.com/a/1068308/13216 var m = arg.match(/^--([^=]+)=([\s\S]*)$/); var key = m[1]; var value = m[2]; if (flags.bools[key]) { value = value !== 'false'; } setArg(key, value, arg); } else if (/^--no-.+/.test(arg)) { var key = arg.match(/^--no-(.+)/)[1]; setArg(key, false, arg); } else if (/^--.+/.test(arg)) { var key = arg.match(/^--(.+)/)[1]; var next = args[i + 1]; if (next !== undefined && !/^-/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) { setArg(key, next, arg); i++; } else if (/^(true|false)$/.test(next)) { setArg(key, next === 'true', arg); i++; } else { setArg(key, flags.strings[key] ? '' : true, arg); } } else if (/^-[^-]+/.test(arg)) { var letters = arg.slice(1,-1).split(''); var broken = false; for (var j = 0; j < letters.length; j++) { var next = arg.slice(j+2); if (next === '-') { setArg(letters[j], next, arg) continue; } if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { setArg(letters[j], next.split('=')[1], arg); broken = true; break; } if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { setArg(letters[j], next, arg); broken = true; break; } if (letters[j+1] && letters[j+1].match(/\W/)) { setArg(letters[j], arg.slice(j+2), arg); broken = true; break; } else { setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); } } var key = arg.slice(-1)[0]; if (!broken && key !== '-') { if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) { setArg(key, args[i+1], arg); i++; } else if (args[i+1] && /true|false/.test(args[i+1])) { setArg(key, args[i+1] === 'true', arg); i++; } else { setArg(key, flags.strings[key] ? '' : true, arg); } } } else { if (!flags.unknownFn || flags.unknownFn(arg) !== false) { argv._.push( flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) ); } if (opts.stopEarly) { argv._.push.apply(argv._, args.slice(i + 1)); break; } } } Object.keys(defaults).forEach(function (key) { if (!hasKey(argv, key.split('.'))) { setKey(argv, key.split('.'), defaults[key]); (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), defaults[key]); }); } }); if (opts['--']) { argv['--'] = new Array(); notFlags.forEach(function(key) { argv['--'].push(key); }); } else { notFlags.forEach(function(key) { argv._.push(key); }); } return argv; }; function hasKey (obj, keys) { var o = obj; keys.slice(0,-1).forEach(function (key) { o = (o[key] || {}); }); var key = keys[keys.length - 1]; return key in o; } function isNumber (x) { if (typeof x === 'number') return true; if (/^0x[0-9a-f]+$/i.test(x)) return true; return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); } /***/ }), /* 133 */ /***/ (function(module) { module.exports = {"name":"strong-log-transformer","version":"2.1.0","description":"Stream transformer that prefixes lines with timestamps and other things.","author":"Ryan Graham ","license":"Apache-2.0","repository":{"type":"git","url":"git://github.com/strongloop/strong-log-transformer"},"keywords":["logging","streams"],"bugs":{"url":"https://github.com/strongloop/strong-log-transformer/issues"},"homepage":"https://github.com/strongloop/strong-log-transformer","directories":{"test":"test"},"bin":{"sl-log-transformer":"bin/sl-log-transformer.js"},"main":"index.js","scripts":{"test":"tap --100 test/test-*"},"dependencies":{"duplexer":"^0.1.1","minimist":"^1.2.0","through":"^2.3.4"},"devDependencies":{"tap":"^12.0.1"},"engines":{"node":">=4"}}; /***/ }), /* 134 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "workspacePackagePaths", function() { return workspacePackagePaths; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyWorkspacePackages", function() { return copyWorkspacePackages; }); /* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36); /* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(glob__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29); /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(135); /* harmony import */ var _fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20); /* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(54); /* harmony import */ var _projects__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(35); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ const glob = Object(util__WEBPACK_IMPORTED_MODULE_2__["promisify"])(glob__WEBPACK_IMPORTED_MODULE_0___default.a); async function workspacePackagePaths(rootPath) { const rootPkgJson = await Object(_package_json__WEBPACK_IMPORTED_MODULE_5__["readPackageJson"])(path__WEBPACK_IMPORTED_MODULE_1___default.a.join(rootPath, 'package.json')); if (!rootPkgJson.workspaces) { return []; } const workspacesPathsPatterns = rootPkgJson.workspaces.packages; let workspaceProjectsPaths = []; for (const pattern of workspacesPathsPatterns) { workspaceProjectsPaths = workspaceProjectsPaths.concat((await packagesFromGlobPattern({ pattern, rootPath }))); } // Filter out exclude glob patterns for (const pattern of workspacesPathsPatterns) { if (pattern.startsWith('!')) { const pathToRemove = path__WEBPACK_IMPORTED_MODULE_1___default.a.join(rootPath, pattern.slice(1), 'package.json'); workspaceProjectsPaths = workspaceProjectsPaths.filter(p => p !== pathToRemove); } } return workspaceProjectsPaths; } async function copyWorkspacePackages(rootPath) { const projectPaths = Object(_config__WEBPACK_IMPORTED_MODULE_3__["getProjectPaths"])(rootPath, {}); const projects = await Object(_projects__WEBPACK_IMPORTED_MODULE_6__["getProjects"])(rootPath, projectPaths); for (const project of projects.values()) { const dest = path__WEBPACK_IMPORTED_MODULE_1___default.a.resolve(rootPath, 'node_modules', project.name); if ((await Object(_fs__WEBPACK_IMPORTED_MODULE_4__["isSymlink"])(dest)) === false) { continue; } // Remove the symlink await Object(_fs__WEBPACK_IMPORTED_MODULE_4__["unlink"])(dest); // Copy in the package await Object(_fs__WEBPACK_IMPORTED_MODULE_4__["copyDirectory"])(project.path, dest); } } function packagesFromGlobPattern({ pattern, rootPath }) { const globOptions = { cwd: rootPath, // Should throw in case of unusual errors when reading the file system strict: true, // Always returns absolute paths for matched files absolute: true, // Do not match ** against multiple filenames // (This is only specified because we currently don't have a need for it.) noglobstar: true }; return glob(path__WEBPACK_IMPORTED_MODULE_1___default.a.join(pattern, 'package.json'), globOptions); } /***/ }), /* 135 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getProjectPaths", function() { return getProjectPaths; }); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Returns all the paths where plugins are located */ function getProjectPaths(rootPath, options = {}) { const skipKibanaPlugins = Boolean(options['skip-kibana-plugins']); const ossOnly = Boolean(options.oss); const projectPaths = [rootPath, Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'packages/*')]; // This is needed in order to install the dependencies for the declared // plugin functional used in the selenium functional tests. // As we are now using the webpack dll for the client vendors dependencies // when we run the plugin functional tests against the distributable // dependencies used by such plugins like @eui, react and react-dom can't // be loaded from the dll as the context is different from the one declared // into the webpack dll reference plugin. // In anyway, have a plugin declaring their own dependencies is the // correct and the expect behavior. projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'test/plugin_functional/plugins/*')); projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'test/interpreter_functional/plugins/*')); if (!ossOnly) { projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'x-pack')); projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'x-pack/legacy/plugins/*')); } if (!skipKibanaPlugins) { projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, '../kibana-extra/*')); projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, '../kibana-extra/*/packages/*')); projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, '../kibana-extra/*/plugins/*')); projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'plugins/*')); projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'plugins/*/packages/*')); projectPaths.push(Object(path__WEBPACK_IMPORTED_MODULE_0__["resolve"])(rootPath, 'plugins/*/plugins/*')); } return projectPaths; } /***/ }), /* 136 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CleanCommand", function() { return CleanCommand; }); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(137); /* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(del__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var ora__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(152); /* harmony import */ var ora__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(ora__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20); /* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ const CleanCommand = { description: 'Remove the node_modules and target directories from all projects.', name: 'clean', async run(projects) { const toDelete = []; for (const project of projects.values()) { if (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_4__["isDirectory"])(project.nodeModulesLocation)) { toDelete.push({ cwd: project.path, pattern: Object(path__WEBPACK_IMPORTED_MODULE_3__["relative"])(project.path, project.nodeModulesLocation) }); } if (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_4__["isDirectory"])(project.targetLocation)) { toDelete.push({ cwd: project.path, pattern: Object(path__WEBPACK_IMPORTED_MODULE_3__["relative"])(project.path, project.targetLocation) }); } const { extraPatterns } = project.getCleanConfig(); if (extraPatterns) { toDelete.push({ cwd: project.path, pattern: extraPatterns }); } } if (toDelete.length === 0) { _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold.green('\n\nNothing to delete')); } else { _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold.red('\n\nDeleting:\n')); /** * In order to avoid patterns like `/build` in packages from accidentally * impacting files outside the package we use `process.chdir()` to change * the cwd to the package and execute `del()` without the `force` option * so it will check that each file being deleted is within the package. * * `del()` does support a `cwd` option, but it's only for resolving the * patterns and does not impact the cwd check. */ const originalCwd = process.cwd(); try { for (const _ref of toDelete) { const { pattern, cwd } = _ref; process.chdir(cwd); const promise = del__WEBPACK_IMPORTED_MODULE_1___default()(pattern); ora__WEBPACK_IMPORTED_MODULE_2___default.a.promise(promise, Object(path__WEBPACK_IMPORTED_MODULE_3__["relative"])(originalCwd, Object(path__WEBPACK_IMPORTED_MODULE_3__["join"])(cwd, String(pattern)))); await promise; } } finally { process.chdir(originalCwd); } } } }; /***/ }), /* 137 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); const globby = __webpack_require__(138); const isPathCwd = __webpack_require__(145); const isPathInCwd = __webpack_require__(146); const pify = __webpack_require__(149); const rimraf = __webpack_require__(150); const pMap = __webpack_require__(151); const rimrafP = pify(rimraf); function safeCheck(file) { if (isPathCwd(file)) { throw new Error('Cannot delete the current working directory. Can be overridden with the `force` option.'); } if (!isPathInCwd(file)) { throw new Error('Cannot delete files/folders outside the current working directory. Can be overridden with the `force` option.'); } } const del = (patterns, options) => { options = Object.assign({}, options); const {force, dryRun} = options; delete options.force; delete options.dryRun; const mapper = file => { if (!force) { safeCheck(file); } file = path.resolve(options.cwd || '', file); if (dryRun) { return file; } return rimrafP(file, {glob: false}).then(() => file); }; return globby(patterns, options).then(files => pMap(files, mapper, options)); }; module.exports = del; // TODO: Remove this for the next major release module.exports.default = del; module.exports.sync = (patterns, options) => { options = Object.assign({}, options); const {force, dryRun} = options; delete options.force; delete options.dryRun; return globby.sync(patterns, options).map(file => { if (!force) { safeCheck(file); } file = path.resolve(options.cwd || '', file); if (!dryRun) { rimraf.sync(file, {glob: false}); } return file; }); }; /***/ }), /* 138 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Promise = __webpack_require__(139); var arrayUnion = __webpack_require__(141); var objectAssign = __webpack_require__(143); var glob = __webpack_require__(36); var pify = __webpack_require__(144); var globP = pify(glob, Promise).bind(glob); function isNegative(pattern) { return pattern[0] === '!'; } function isString(value) { return typeof value === 'string'; } function assertPatternsInput(patterns) { if (!patterns.every(isString)) { throw new TypeError('patterns must be a string or an array of strings'); } } function generateGlobTasks(patterns, opts) { patterns = [].concat(patterns); assertPatternsInput(patterns); var globTasks = []; opts = objectAssign({ cache: Object.create(null), statCache: Object.create(null), realpathCache: Object.create(null), symlinks: Object.create(null), ignore: [] }, opts); patterns.forEach(function (pattern, i) { if (isNegative(pattern)) { return; } var ignore = patterns.slice(i).filter(isNegative).map(function (pattern) { return pattern.slice(1); }); globTasks.push({ pattern: pattern, opts: objectAssign({}, opts, { ignore: opts.ignore.concat(ignore) }) }); }); return globTasks; } module.exports = function (patterns, opts) { var globTasks; try { globTasks = generateGlobTasks(patterns, opts); } catch (err) { return Promise.reject(err); } return Promise.all(globTasks.map(function (task) { return globP(task.pattern, task.opts); })).then(function (paths) { return arrayUnion.apply(null, paths); }); }; module.exports.sync = function (patterns, opts) { var globTasks = generateGlobTasks(patterns, opts); return globTasks.reduce(function (matches, task) { return arrayUnion(matches, glob.sync(task.pattern, task.opts)); }, []); }; module.exports.generateGlobTasks = generateGlobTasks; module.exports.hasMagic = function (patterns, opts) { return [].concat(patterns).some(function (pattern) { return glob.hasMagic(pattern, opts); }); }; /***/ }), /* 139 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = typeof Promise === 'function' ? Promise : __webpack_require__(140); /***/ }), /* 140 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var PENDING = 'pending'; var SETTLED = 'settled'; var FULFILLED = 'fulfilled'; var REJECTED = 'rejected'; var NOOP = function () {}; var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function'; var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; var asyncQueue = []; var asyncTimer; function asyncFlush() { // run promise callbacks for (var i = 0; i < asyncQueue.length; i++) { asyncQueue[i][0](asyncQueue[i][1]); } // reset async asyncQueue asyncQueue = []; asyncTimer = false; } function asyncCall(callback, arg) { asyncQueue.push([callback, arg]); if (!asyncTimer) { asyncTimer = true; asyncSetTimer(asyncFlush, 0); } } function invokeResolver(resolver, promise) { function resolvePromise(value) { resolve(promise, value); } function rejectPromise(reason) { reject(promise, reason); } try { resolver(resolvePromise, rejectPromise); } catch (e) { rejectPromise(e); } } function invokeCallback(subscriber) { var owner = subscriber.owner; var settled = owner._state; var value = owner._data; var callback = subscriber[settled]; var promise = subscriber.then; if (typeof callback === 'function') { settled = FULFILLED; try { value = callback(value); } catch (e) { reject(promise, e); } } if (!handleThenable(promise, value)) { if (settled === FULFILLED) { resolve(promise, value); } if (settled === REJECTED) { reject(promise, value); } } } function handleThenable(promise, value) { var resolved; try { if (promise === value) { throw new TypeError('A promises callback cannot return that same promise.'); } if (value && (typeof value === 'function' || typeof value === 'object')) { // then should be retrieved only once var then = value.then; if (typeof then === 'function') { then.call(value, function (val) { if (!resolved) { resolved = true; if (value === val) { fulfill(promise, val); } else { resolve(promise, val); } } }, function (reason) { if (!resolved) { resolved = true; reject(promise, reason); } }); return true; } } } catch (e) { if (!resolved) { reject(promise, e); } return true; } return false; } function resolve(promise, value) { if (promise === value || !handleThenable(promise, value)) { fulfill(promise, value); } } function fulfill(promise, value) { if (promise._state === PENDING) { promise._state = SETTLED; promise._data = value; asyncCall(publishFulfillment, promise); } } function reject(promise, reason) { if (promise._state === PENDING) { promise._state = SETTLED; promise._data = reason; asyncCall(publishRejection, promise); } } function publish(promise) { promise._then = promise._then.forEach(invokeCallback); } function publishFulfillment(promise) { promise._state = FULFILLED; publish(promise); } function publishRejection(promise) { promise._state = REJECTED; publish(promise); if (!promise._handled && isNode) { global.process.emit('unhandledRejection', promise._data, promise); } } function notifyRejectionHandled(promise) { global.process.emit('rejectionHandled', promise); } /** * @class */ function Promise(resolver) { if (typeof resolver !== 'function') { throw new TypeError('Promise resolver ' + resolver + ' is not a function'); } if (this instanceof Promise === false) { throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); } this._then = []; invokeResolver(resolver, this); } Promise.prototype = { constructor: Promise, _state: PENDING, _then: null, _data: undefined, _handled: false, then: function (onFulfillment, onRejection) { var subscriber = { owner: this, then: new this.constructor(NOOP), fulfilled: onFulfillment, rejected: onRejection }; if ((onRejection || onFulfillment) && !this._handled) { this._handled = true; if (this._state === REJECTED && isNode) { asyncCall(notifyRejectionHandled, this); } } if (this._state === FULFILLED || this._state === REJECTED) { // already resolved, call callback async asyncCall(invokeCallback, subscriber); } else { // subscribe this._then.push(subscriber); } return subscriber.then; }, catch: function (onRejection) { return this.then(null, onRejection); } }; Promise.all = function (promises) { if (!Array.isArray(promises)) { throw new TypeError('You must pass an array to Promise.all().'); } return new Promise(function (resolve, reject) { var results = []; var remaining = 0; function resolver(index) { remaining++; return function (value) { results[index] = value; if (!--remaining) { resolve(results); } }; } for (var i = 0, promise; i < promises.length; i++) { promise = promises[i]; if (promise && typeof promise.then === 'function') { promise.then(resolver(i), reject); } else { results[i] = promise; } } if (!remaining) { resolve(results); } }); }; Promise.race = function (promises) { if (!Array.isArray(promises)) { throw new TypeError('You must pass an array to Promise.race().'); } return new Promise(function (resolve, reject) { for (var i = 0, promise; i < promises.length; i++) { promise = promises[i]; if (promise && typeof promise.then === 'function') { promise.then(resolve, reject); } else { resolve(promise); } } }); }; Promise.resolve = function (value) { if (value && typeof value === 'object' && value.constructor === Promise) { return value; } return new Promise(function (resolve) { resolve(value); }); }; Promise.reject = function (reason) { return new Promise(function (resolve, reject) { reject(reason); }); }; module.exports = Promise; /***/ }), /* 141 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var arrayUniq = __webpack_require__(142); module.exports = function () { return arrayUniq([].concat.apply([], arguments)); }; /***/ }), /* 142 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // there's 3 implementations written in increasing order of efficiency // 1 - no Set type is defined function uniqNoSet(arr) { var ret = []; for (var i = 0; i < arr.length; i++) { if (ret.indexOf(arr[i]) === -1) { ret.push(arr[i]); } } return ret; } // 2 - a simple Set type is defined function uniqSet(arr) { var seen = new Set(); return arr.filter(function (el) { if (!seen.has(el)) { seen.add(el); return true; } return false; }); } // 3 - a standard Set type is defined and it has a forEach method function uniqSetWithForEach(arr) { var ret = []; (new Set(arr)).forEach(function (el) { ret.push(el); }); return ret; } // V8 currently has a broken implementation // https://github.com/joyent/node/issues/8449 function doesForEachActuallyWork() { var ret = false; (new Set([true])).forEach(function (el) { ret = el; }); return ret === true; } if ('Set' in global) { if (typeof Set.prototype.forEach === 'function' && doesForEachActuallyWork()) { module.exports = uniqSetWithForEach; } else { module.exports = uniqSet; } } else { module.exports = uniqNoSet; } /***/ }), /* 143 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* object-assign (c) Sindre Sorhus @license MIT */ /* 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; }; /***/ }), /* 144 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var processFn = function (fn, P, opts) { return function () { var that = this; var args = new Array(arguments.length); for (var i = 0; i < arguments.length; i++) { args[i] = arguments[i]; } return new P(function (resolve, reject) { args.push(function (err, result) { if (err) { reject(err); } else if (opts.multiArgs) { var results = new Array(arguments.length - 1); for (var i = 1; i < arguments.length; i++) { results[i - 1] = arguments[i]; } resolve(results); } else { resolve(result); } }); fn.apply(that, args); }); }; }; var pify = module.exports = function (obj, P, opts) { if (typeof P !== 'function') { opts = P; P = Promise; } opts = opts || {}; opts.exclude = opts.exclude || [/.+Sync$/]; var filter = function (key) { var match = function (pattern) { return typeof pattern === 'string' ? key === pattern : pattern.test(key); }; return opts.include ? opts.include.some(match) : !opts.exclude.some(match); }; var ret = typeof obj === 'function' ? function () { if (opts.excludeMain) { return obj.apply(this, arguments); } return processFn(obj, P, opts).apply(this, arguments); } : {}; return Object.keys(obj).reduce(function (ret, key) { var x = obj[key]; ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x; return ret; }, ret); }; pify.all = pify; /***/ }), /* 145 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); module.exports = path_ => path.resolve(path_) === process.cwd(); /***/ }), /* 146 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const isPathInside = __webpack_require__(147); module.exports = path => isPathInside(path, process.cwd()); /***/ }), /* 147 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); const pathIsInside = __webpack_require__(148); module.exports = (childPath, parentPath) => { childPath = path.resolve(childPath); parentPath = path.resolve(parentPath); if (childPath === parentPath) { return false; } return pathIsInside(childPath, parentPath); }; /***/ }), /* 148 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var path = __webpack_require__(16); module.exports = function (thePath, potentialParent) { // For inside-directory checking, we want to allow trailing slashes, so normalize. thePath = stripTrailingSep(thePath); potentialParent = stripTrailingSep(potentialParent); // Node treats only Windows as case-insensitive in its path module; we follow those conventions. if (process.platform === "win32") { thePath = thePath.toLowerCase(); potentialParent = potentialParent.toLowerCase(); } return thePath.lastIndexOf(potentialParent, 0) === 0 && ( thePath[potentialParent.length] === path.sep || thePath[potentialParent.length] === undefined ); }; function stripTrailingSep(thePath) { if (thePath[thePath.length - 1] === path.sep) { return thePath.slice(0, -1); } return thePath; } /***/ }), /* 149 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const processFn = (fn, options) => function (...args) { const P = options.promiseModule; return new P((resolve, reject) => { if (options.multiArgs) { args.push((...result) => { if (options.errorFirst) { if (result[0]) { reject(result); } else { result.shift(); resolve(result); } } else { resolve(result); } }); } else if (options.errorFirst) { args.push((error, result) => { if (error) { reject(error); } else { resolve(result); } }); } else { args.push(resolve); } fn.apply(this, args); }); }; module.exports = (input, options) => { options = Object.assign({ exclude: [/.+(Sync|Stream)$/], errorFirst: true, promiseModule: Promise }, options); const objType = typeof input; if (!(input !== null && (objType === 'object' || objType === 'function'))) { throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${input === null ? 'null' : objType}\``); } const filter = key => { const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); return options.include ? options.include.some(match) : !options.exclude.some(match); }; let ret; if (objType === 'function') { ret = function (...args) { return options.excludeMain ? input(...args) : processFn(input, options).apply(this, args); }; } else { ret = Object.create(Object.getPrototypeOf(input)); } for (const key in input) { // eslint-disable-line guard-for-in const property = input[key]; ret[key] = typeof property === 'function' && filter(key) ? processFn(property, options) : property; } return ret; }; /***/ }), /* 150 */ /***/ (function(module, exports, __webpack_require__) { module.exports = rimraf rimraf.sync = rimrafSync var assert = __webpack_require__(30) var path = __webpack_require__(16) var fs = __webpack_require__(23) var glob = __webpack_require__(36) var _0666 = parseInt('666', 8) var defaultGlobOpts = { nosort: true, silent: true } // for EMFILE handling var timeout = 0 var isWindows = (process.platform === "win32") function defaults (options) { var methods = [ 'unlink', 'chmod', 'stat', 'lstat', 'rmdir', 'readdir' ] methods.forEach(function(m) { options[m] = options[m] || fs[m] m = m + 'Sync' options[m] = options[m] || fs[m] }) options.maxBusyTries = options.maxBusyTries || 3 options.emfileWait = options.emfileWait || 1000 if (options.glob === false) { options.disableGlob = true } options.disableGlob = options.disableGlob || false options.glob = options.glob || defaultGlobOpts } function rimraf (p, options, cb) { if (typeof options === 'function') { cb = options options = {} } assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') assert.equal(typeof cb, 'function', 'rimraf: callback function required') assert(options, 'rimraf: invalid options argument provided') assert.equal(typeof options, 'object', 'rimraf: options should be object') defaults(options) var busyTries = 0 var errState = null var n = 0 if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [p]) options.lstat(p, function (er, stat) { if (!er) return afterGlob(null, [p]) glob(p, options.glob, afterGlob) }) function next (er) { errState = errState || er if (--n === 0) cb(errState) } function afterGlob (er, results) { if (er) return cb(er) n = results.length if (n === 0) return cb() results.forEach(function (p) { rimraf_(p, options, function CB (er) { if (er) { if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && busyTries < options.maxBusyTries) { busyTries ++ var time = busyTries * 100 // try again, with the same exact callback as this one. return setTimeout(function () { rimraf_(p, options, CB) }, time) } // this one won't happen if graceful-fs is used. if (er.code === "EMFILE" && timeout < options.emfileWait) { return setTimeout(function () { rimraf_(p, options, CB) }, timeout ++) } // already gone if (er.code === "ENOENT") er = null } timeout = 0 next(er) }) }) } } // Two possible strategies. // 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR // 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR // // Both result in an extra syscall when you guess wrong. However, there // are likely far more normal files in the world than directories. This // is based on the assumption that a the average number of files per // directory is >= 1. // // If anyone ever complains about this, then I guess the strategy could // be made configurable somehow. But until then, YAGNI. function rimraf_ (p, options, cb) { assert(p) assert(options) assert(typeof cb === 'function') // sunos lets the root user unlink directories, which is... weird. // so we have to lstat here and make sure it's not a dir. options.lstat(p, function (er, st) { if (er && er.code === "ENOENT") return cb(null) // Windows can EPERM on stat. Life is suffering. if (er && er.code === "EPERM" && isWindows) fixWinEPERM(p, options, er, cb) if (st && st.isDirectory()) return rmdir(p, options, er, cb) options.unlink(p, function (er) { if (er) { if (er.code === "ENOENT") return cb(null) if (er.code === "EPERM") return (isWindows) ? fixWinEPERM(p, options, er, cb) : rmdir(p, options, er, cb) if (er.code === "EISDIR") return rmdir(p, options, er, cb) } return cb(er) }) }) } function fixWinEPERM (p, options, er, cb) { assert(p) assert(options) assert(typeof cb === 'function') if (er) assert(er instanceof Error) options.chmod(p, _0666, function (er2) { if (er2) cb(er2.code === "ENOENT" ? null : er) else options.stat(p, function(er3, stats) { if (er3) cb(er3.code === "ENOENT" ? null : er) else if (stats.isDirectory()) rmdir(p, options, er, cb) else options.unlink(p, cb) }) }) } function fixWinEPERMSync (p, options, er) { assert(p) assert(options) if (er) assert(er instanceof Error) try { options.chmodSync(p, _0666) } catch (er2) { if (er2.code === "ENOENT") return else throw er } try { var stats = options.statSync(p) } catch (er3) { if (er3.code === "ENOENT") return else throw er } if (stats.isDirectory()) rmdirSync(p, options, er) else options.unlinkSync(p) } function rmdir (p, options, originalEr, cb) { assert(p) assert(options) if (originalEr) assert(originalEr instanceof Error) assert(typeof cb === 'function') // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) // if we guessed wrong, and it's not a directory, then // raise the original error. options.rmdir(p, function (er) { if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) rmkids(p, options, cb) else if (er && er.code === "ENOTDIR") cb(originalEr) else cb(er) }) } function rmkids(p, options, cb) { assert(p) assert(options) assert(typeof cb === 'function') options.readdir(p, function (er, files) { if (er) return cb(er) var n = files.length if (n === 0) return options.rmdir(p, cb) var errState files.forEach(function (f) { rimraf(path.join(p, f), options, function (er) { if (errState) return if (er) return cb(errState = er) if (--n === 0) options.rmdir(p, cb) }) }) }) } // this looks simpler, and is strictly *faster*, but will // tie up the JavaScript thread and fail on excessively // deep directory trees. function rimrafSync (p, options) { options = options || {} defaults(options) assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') assert(options, 'rimraf: missing options') assert.equal(typeof options, 'object', 'rimraf: options should be object') var results if (options.disableGlob || !glob.hasMagic(p)) { results = [p] } else { try { options.lstatSync(p) results = [p] } catch (er) { results = glob.sync(p, options.glob) } } if (!results.length) return for (var i = 0; i < results.length; i++) { var p = results[i] try { var st = options.lstatSync(p) } catch (er) { if (er.code === "ENOENT") return // Windows can EPERM on stat. Life is suffering. if (er.code === "EPERM" && isWindows) fixWinEPERMSync(p, options, er) } try { // sunos lets the root user unlink directories, which is... weird. if (st && st.isDirectory()) rmdirSync(p, options, null) else options.unlinkSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "EPERM") return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) if (er.code !== "EISDIR") throw er rmdirSync(p, options, er) } } } function rmdirSync (p, options, originalEr) { assert(p) assert(options) if (originalEr) assert(originalEr instanceof Error) try { options.rmdirSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "ENOTDIR") throw originalEr if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") rmkidsSync(p, options) } } function rmkidsSync (p, options) { assert(p) assert(options) options.readdirSync(p).forEach(function (f) { rimrafSync(path.join(p, f), options) }) // We only end up here once we got ENOTEMPTY at least once, and // at this point, we are guaranteed to have removed all the kids. // So, we know that it won't be ENOENT or ENOTDIR or anything else. // try really hard to delete stuff on windows, because it has a // PROFOUNDLY annoying habit of not closing handles promptly when // files are deleted, resulting in spurious ENOTEMPTY errors. var retries = isWindows ? 100 : 1 var i = 0 do { var threw = true try { var ret = options.rmdirSync(p, options) threw = false return ret } finally { if (++i < retries && threw) continue } } while (true) } /***/ }), /* 151 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const pMap = (iterable, mapper, options) => new Promise((resolve, reject) => { options = Object.assign({ concurrency: Infinity }, options); if (typeof mapper !== 'function') { throw new TypeError('Mapper function is required'); } const {concurrency} = options; if (!(typeof concurrency === 'number' && concurrency >= 1)) { throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${concurrency}\` (${typeof concurrency})`); } const ret = []; const iterator = iterable[Symbol.iterator](); let isRejected = false; let isIterableDone = false; let resolvingCount = 0; let currentIndex = 0; const next = () => { if (isRejected) { return; } const nextItem = iterator.next(); const i = currentIndex; currentIndex++; if (nextItem.done) { isIterableDone = true; if (resolvingCount === 0) { resolve(ret); } return; } resolvingCount++; Promise.resolve(nextItem.value) .then(element => mapper(element, i)) .then( value => { ret[i] = value; resolvingCount--; next(); }, error => { isRejected = true; reject(error); } ); }; for (let i = 0; i < concurrency; i++) { next(); if (isIterableDone) { break; } } }); module.exports = pMap; // TODO: Remove this for the next major release module.exports.default = pMap; /***/ }), /* 152 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const chalk = __webpack_require__(2); const cliCursor = __webpack_require__(153); const cliSpinners = __webpack_require__(157); const logSymbols = __webpack_require__(125); class Ora { constructor(options) { if (typeof options === 'string') { options = { text: options }; } this.options = Object.assign({ text: '', color: 'cyan', stream: process.stderr }, options); const sp = this.options.spinner; this.spinner = typeof sp === 'object' ? sp : (process.platform === 'win32' ? cliSpinners.line : (cliSpinners[sp] || cliSpinners.dots)); // eslint-disable-line no-nested-ternary if (this.spinner.frames === undefined) { throw new Error('Spinner must define `frames`'); } this.text = this.options.text; this.color = this.options.color; this.interval = this.options.interval || this.spinner.interval || 100; this.stream = this.options.stream; this.id = null; this.frameIndex = 0; this.enabled = typeof this.options.enabled === 'boolean' ? this.options.enabled : ((this.stream && this.stream.isTTY) && !process.env.CI); } frame() { const frames = this.spinner.frames; let frame = frames[this.frameIndex]; if (this.color) { frame = chalk[this.color](frame); } this.frameIndex = ++this.frameIndex % frames.length; return frame + ' ' + this.text; } clear() { if (!this.enabled) { return this; } this.stream.clearLine(); this.stream.cursorTo(0); return this; } render() { this.clear(); this.stream.write(this.frame()); return this; } start(text) { if (text) { this.text = text; } if (!this.enabled || this.id) { return this; } cliCursor.hide(this.stream); this.render(); this.id = setInterval(this.render.bind(this), this.interval); return this; } stop() { if (!this.enabled) { return this; } clearInterval(this.id); this.id = null; this.frameIndex = 0; this.clear(); cliCursor.show(this.stream); return this; } succeed(text) { return this.stopAndPersist({symbol: logSymbols.success, text}); } fail(text) { return this.stopAndPersist({symbol: logSymbols.error, text}); } warn(text) { return this.stopAndPersist({symbol: logSymbols.warning, text}); } info(text) { return this.stopAndPersist({symbol: logSymbols.info, text}); } stopAndPersist(options) { if (!this.enabled) { return this; } // Legacy argument // TODO: Deprecate sometime in the future if (typeof options === 'string') { options = { symbol: options }; } options = options || {}; this.stop(); this.stream.write(`${options.symbol || ' '} ${options.text || this.text}\n`); return this; } } module.exports = function (opts) { return new Ora(opts); }; module.exports.promise = (action, options) => { if (typeof action.then !== 'function') { throw new TypeError('Parameter `action` must be a Promise'); } const spinner = new Ora(options); spinner.start(); action.then( () => { spinner.succeed(); }, () => { spinner.fail(); } ); return spinner; }; /***/ }), /* 153 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const restoreCursor = __webpack_require__(154); let hidden = false; exports.show = stream => { const s = stream || process.stderr; if (!s.isTTY) { return; } hidden = false; s.write('\u001b[?25h'); }; exports.hide = stream => { const s = stream || process.stderr; if (!s.isTTY) { return; } restoreCursor(); hidden = true; s.write('\u001b[?25l'); }; exports.toggle = (force, stream) => { if (force !== undefined) { hidden = force; } if (hidden) { exports.show(stream); } else { exports.hide(stream); } }; /***/ }), /* 154 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const onetime = __webpack_require__(155); const signalExit = __webpack_require__(87); module.exports = onetime(() => { signalExit(() => { process.stderr.write('\u001b[?25h'); }, {alwaysLast: true}); }); /***/ }), /* 155 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const mimicFn = __webpack_require__(156); module.exports = (fn, opts) => { // TODO: Remove this in v3 if (opts === true) { throw new TypeError('The second argument is now an options object'); } if (typeof fn !== 'function') { throw new TypeError('Expected a function'); } opts = opts || {}; let ret; let called = false; const fnName = fn.displayName || fn.name || ''; const onetime = function () { if (called) { if (opts.throw === true) { throw new Error(`Function \`${fnName}\` can only be called once`); } return ret; } called = true; ret = fn.apply(this, arguments); fn = null; return ret; }; mimicFn(onetime, fn); return onetime; }; /***/ }), /* 156 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = (to, from) => { // TODO: use `Reflect.ownKeys()` when targeting Node.js 6 for (const prop of Object.getOwnPropertyNames(from).concat(Object.getOwnPropertySymbols(from))) { Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); } return to; }; /***/ }), /* 157 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(158); /***/ }), /* 158 */ /***/ (function(module) { module.exports = {"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"line":{"interval":130,"frames":["-","\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","'","´","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","°","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["😄 ","😝 "]},"monkey":{"interval":300,"frames":["🙈 ","🙈 ","🙉 ","🙊 "]},"hearts":{"interval":100,"frames":["💛 ","💙 ","💜 ","💚 ","❤️ "]},"clock":{"interval":100,"frames":["🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},"earth":{"interval":180,"frames":["🌍 ","🌎 ","🌏 "]},"moon":{"interval":80,"frames":["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},"runner":{"interval":140,"frames":["🚶 ","🏃 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["🌲","🎄"]}}; /***/ }), /* 159 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RunCommand", function() { return RunCommand; }); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33); /* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34); /* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ const RunCommand = { description: 'Run script defined in package.json in each package that contains that script.', name: 'run', async run(projects, projectGraph, { extraArgs }) { const batchedProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_3__["topologicallyBatchProjects"])(projects, projectGraph); if (extraArgs.length === 0) { _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red.bold('\nNo script specified')); process.exit(1); } const scriptName = extraArgs[0]; const scriptArgs = extraArgs.slice(1); _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`\nRunning script [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(scriptName)}] in batched topological order\n`)); await Object(_utils_parallelize__WEBPACK_IMPORTED_MODULE_2__["parallelizeBatches"])(batchedProjects, async pkg => { if (pkg.hasScript(scriptName)) { await pkg.runScriptStreaming(scriptName, scriptArgs); } }); } }; /***/ }), /* 160 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WatchCommand", function() { return WatchCommand; }); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33); /* harmony import */ var _utils_parallelize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(34); /* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(35); /* harmony import */ var _utils_watch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(161); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Name of the script in the package/project package.json file to run during `kbn watch`. */ const watchScriptName = 'kbn:watch'; /** * Name of the Kibana project. */ const kibanaProjectName = 'kibana'; /** * Command that traverses through list of available projects/packages that have `kbn:watch` script in their * package.json files, groups them into topology aware batches and then processes theses batches one by one * running `kbn:watch` scripts in parallel within the same batch. * * Command internally relies on the fact that most of the build systems that are triggered by `kbn:watch` * will emit special "marker" once build/watch process is ready that we can use as completion condition for * the `kbn:watch` script and eventually for the entire batch. Currently we support completion "markers" for * `webpack` and `tsc` only, for the rest we rely on predefined timeouts. */ const WatchCommand = { description: 'Runs `kbn:watch` script for every project.', name: 'watch', async run(projects, projectGraph) { const projectsToWatch = new Map(); for (const project of projects.values()) { // We can't watch project that doesn't have `kbn:watch` script. if (project.hasScript(watchScriptName)) { projectsToWatch.set(project.name, project); } } if (projectsToWatch.size === 0) { _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`\nThere are no projects to watch found. Make sure that projects define 'kbn:watch' script in 'package.json'.\n`)); return; } const projectNames = Array.from(projectsToWatch.keys()); _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(`Running ${watchScriptName} scripts for [${projectNames.join(', ')}].`))); // Kibana should always be run the last, so we don't rely on automatic // topological batching and push it to the last one-entry batch manually. const shouldWatchKibanaProject = projectsToWatch.delete(kibanaProjectName); const batchedProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_3__["topologicallyBatchProjects"])(projectsToWatch, projectGraph); if (shouldWatchKibanaProject) { batchedProjects.push([projects.get(kibanaProjectName)]); } await Object(_utils_parallelize__WEBPACK_IMPORTED_MODULE_2__["parallelizeBatches"])(batchedProjects, async pkg => { const completionHint = await Object(_utils_watch__WEBPACK_IMPORTED_MODULE_4__["waitUntilWatchIsReady"])(pkg.runScriptStreaming(watchScriptName).stdout); _utils_log__WEBPACK_IMPORTED_MODULE_1__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`[${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(pkg.name)}] Initial build completed (${completionHint}).`)); }); } }; /***/ }), /* 161 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "waitUntilWatchIsReady", function() { return waitUntilWatchIsReady; }); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(162); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(261); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * Number of milliseconds we wait before we fall back to the default watch handler. */ const defaultHandlerDelay = 3000; /** * If default watch handler is used, then it's the number of milliseconds we wait for * any build output before we consider watch task ready. */ const defaultHandlerReadinessTimeout = 2000; /** * Describes configurable watch options. */ function getWatchHandlers(buildOutput$, { handlerDelay = defaultHandlerDelay, handlerReadinessTimeout = defaultHandlerReadinessTimeout }) { const typescriptHandler = buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["first"])(data => data.includes('$ tsc')), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["map"])(() => buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["first"])(data => data.includes('Compilation complete.')), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["mapTo"])('tsc')))); const webpackHandler = buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["first"])(data => data.includes('$ webpack')), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["map"])(() => buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["first"])(data => data.includes('Chunk Names')), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["mapTo"])('webpack')))); const defaultHandler = rxjs__WEBPACK_IMPORTED_MODULE_0__["of"](undefined).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["delay"])(handlerReadinessTimeout), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["map"])(() => buildOutput$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["timeout"])(handlerDelay), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["catchError"])(() => rxjs__WEBPACK_IMPORTED_MODULE_0__["of"]('timeout'))))); return [typescriptHandler, webpackHandler, defaultHandler]; } function waitUntilWatchIsReady(stream, opts = {}) { const buildOutput$ = new rxjs__WEBPACK_IMPORTED_MODULE_0__["Subject"](); const onDataListener = data => buildOutput$.next(data.toString('utf-8')); const onEndListener = () => buildOutput$.complete(); const onErrorListener = e => buildOutput$.error(e); stream.once('end', onEndListener); stream.once('error', onErrorListener); stream.on('data', onDataListener); return rxjs__WEBPACK_IMPORTED_MODULE_0__["race"](getWatchHandlers(buildOutput$, opts)).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["mergeMap"])(whenReady => whenReady), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_1__["finalize"])(() => { stream.removeListener('data', onDataListener); stream.removeListener('end', onEndListener); stream.removeListener('error', onErrorListener); buildOutput$.complete(); })).toPromise(); } /***/ }), /* 162 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _internal_Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return _internal_Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]; }); /* harmony import */ var _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(181); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return _internal_observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_1__["ConnectableObservable"]; }); /* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(186); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_2__["GroupedObservable"]; }); /* harmony import */ var _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(178); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_3__["observable"]; }); /* harmony import */ var _internal_Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(182); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return _internal_Subject__WEBPACK_IMPORTED_MODULE_4__["Subject"]; }); /* harmony import */ var _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(187); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return _internal_BehaviorSubject__WEBPACK_IMPORTED_MODULE_5__["BehaviorSubject"]; }); /* harmony import */ var _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(188); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return _internal_ReplaySubject__WEBPACK_IMPORTED_MODULE_6__["ReplaySubject"]; }); /* harmony import */ var _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(205); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return _internal_AsyncSubject__WEBPACK_IMPORTED_MODULE_7__["AsyncSubject"]; }); /* harmony import */ var _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(206); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "asapScheduler", function() { return _internal_scheduler_asap__WEBPACK_IMPORTED_MODULE_8__["asap"]; }); /* harmony import */ var _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(210); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "asyncScheduler", function() { return _internal_scheduler_async__WEBPACK_IMPORTED_MODULE_9__["async"]; }); /* harmony import */ var _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(189); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "queueScheduler", function() { return _internal_scheduler_queue__WEBPACK_IMPORTED_MODULE_10__["queue"]; }); /* harmony import */ var _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(211); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "animationFrameScheduler", function() { return _internal_scheduler_animationFrame__WEBPACK_IMPORTED_MODULE_11__["animationFrame"]; }); /* harmony import */ var _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(214); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualTimeScheduler"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return _internal_scheduler_VirtualTimeScheduler__WEBPACK_IMPORTED_MODULE_12__["VirtualAction"]; }); /* harmony import */ var _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(195); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return _internal_Scheduler__WEBPACK_IMPORTED_MODULE_13__["Scheduler"]; }); /* harmony import */ var _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(171); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return _internal_Subscription__WEBPACK_IMPORTED_MODULE_14__["Subscription"]; }); /* harmony import */ var _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(165); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return _internal_Subscriber__WEBPACK_IMPORTED_MODULE_15__["Subscriber"]; }); /* harmony import */ var _internal_Notification__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(197); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return _internal_Notification__WEBPACK_IMPORTED_MODULE_16__["Notification"]; }); /* harmony import */ var _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(179); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return _internal_util_pipe__WEBPACK_IMPORTED_MODULE_17__["pipe"]; }); /* harmony import */ var _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(180); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return _internal_util_noop__WEBPACK_IMPORTED_MODULE_18__["noop"]; }); /* harmony import */ var _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(215); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return _internal_util_identity__WEBPACK_IMPORTED_MODULE_19__["identity"]; }); /* harmony import */ var _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(216); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return _internal_util_isObservable__WEBPACK_IMPORTED_MODULE_20__["isObservable"]; }); /* harmony import */ var _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(217); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return _internal_util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_21__["ArgumentOutOfRangeError"]; }); /* harmony import */ var _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(218); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return _internal_util_EmptyError__WEBPACK_IMPORTED_MODULE_22__["EmptyError"]; }); /* harmony import */ var _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(183); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return _internal_util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_23__["ObjectUnsubscribedError"]; }); /* harmony import */ var _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(176); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return _internal_util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_24__["UnsubscriptionError"]; }); /* harmony import */ var _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(219); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return _internal_util_TimeoutError__WEBPACK_IMPORTED_MODULE_25__["TimeoutError"]; }); /* harmony import */ var _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(220); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return _internal_observable_bindCallback__WEBPACK_IMPORTED_MODULE_26__["bindCallback"]; }); /* harmony import */ var _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(222); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return _internal_observable_bindNodeCallback__WEBPACK_IMPORTED_MODULE_27__["bindNodeCallback"]; }); /* harmony import */ var _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(223); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_observable_combineLatest__WEBPACK_IMPORTED_MODULE_28__["combineLatest"]; }); /* harmony import */ var _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(234); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_observable_concat__WEBPACK_IMPORTED_MODULE_29__["concat"]; }); /* harmony import */ var _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(244); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return _internal_observable_defer__WEBPACK_IMPORTED_MODULE_30__["defer"]; }); /* harmony import */ var _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(198); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["empty"]; }); /* harmony import */ var _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(245); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return _internal_observable_forkJoin__WEBPACK_IMPORTED_MODULE_32__["forkJoin"]; }); /* harmony import */ var _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(235); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "from", function() { return _internal_observable_from__WEBPACK_IMPORTED_MODULE_33__["from"]; }); /* harmony import */ var _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(246); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return _internal_observable_fromEvent__WEBPACK_IMPORTED_MODULE_34__["fromEvent"]; }); /* harmony import */ var _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(247); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return _internal_observable_fromEventPattern__WEBPACK_IMPORTED_MODULE_35__["fromEventPattern"]; }); /* harmony import */ var _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(248); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return _internal_observable_generate__WEBPACK_IMPORTED_MODULE_36__["generate"]; }); /* harmony import */ var _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(249); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return _internal_observable_iif__WEBPACK_IMPORTED_MODULE_37__["iif"]; }); /* harmony import */ var _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(250); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return _internal_observable_interval__WEBPACK_IMPORTED_MODULE_38__["interval"]; }); /* harmony import */ var _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(252); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_observable_merge__WEBPACK_IMPORTED_MODULE_39__["merge"]; }); /* harmony import */ var _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(253); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "never", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["never"]; }); /* harmony import */ var _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(199); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "of", function() { return _internal_observable_of__WEBPACK_IMPORTED_MODULE_41__["of"]; }); /* harmony import */ var _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(254); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_observable_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_42__["onErrorResumeNext"]; }); /* harmony import */ var _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(255); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return _internal_observable_pairs__WEBPACK_IMPORTED_MODULE_43__["pairs"]; }); /* harmony import */ var _internal_observable_race__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(256); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_observable_race__WEBPACK_IMPORTED_MODULE_44__["race"]; }); /* harmony import */ var _internal_observable_range__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(257); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "range", function() { return _internal_observable_range__WEBPACK_IMPORTED_MODULE_45__["range"]; }); /* harmony import */ var _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(204); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return _internal_observable_throwError__WEBPACK_IMPORTED_MODULE_46__["throwError"]; }); /* harmony import */ var _internal_observable_timer__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(258); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return _internal_observable_timer__WEBPACK_IMPORTED_MODULE_47__["timer"]; }); /* harmony import */ var _internal_observable_using__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(259); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "using", function() { return _internal_observable_using__WEBPACK_IMPORTED_MODULE_48__["using"]; }); /* harmony import */ var _internal_observable_zip__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(260); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_observable_zip__WEBPACK_IMPORTED_MODULE_49__["zip"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return _internal_observable_empty__WEBPACK_IMPORTED_MODULE_31__["EMPTY"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return _internal_observable_never__WEBPACK_IMPORTED_MODULE_40__["NEVER"]; }); /* harmony import */ var _internal_config__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(169); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "config", function() { return _internal_config__WEBPACK_IMPORTED_MODULE_50__["config"]; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ //# sourceMappingURL=index.js.map /***/ }), /* 163 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return Observable; }); /* harmony import */ var _util_toSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(164); /* harmony import */ var _internal_symbol_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(178); /* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(179); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(169); /** PURE_IMPORTS_START _util_toSubscriber,_internal_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */ var Observable = /*@__PURE__*/ (function () { function Observable(subscribe) { this._isScalar = false; if (subscribe) { this._subscribe = subscribe; } } Observable.prototype.lift = function (operator) { var observable = new Observable(); observable.source = this; observable.operator = operator; return observable; }; Observable.prototype.subscribe = function (observerOrNext, error, complete) { var operator = this.operator; var sink = Object(_util_toSubscriber__WEBPACK_IMPORTED_MODULE_0__["toSubscriber"])(observerOrNext, error, complete); if (operator) { operator.call(sink, this.source); } else { sink.add(this.source || (_config__WEBPACK_IMPORTED_MODULE_3__["config"].useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ? this._subscribe(sink) : this._trySubscribe(sink)); } if (_config__WEBPACK_IMPORTED_MODULE_3__["config"].useDeprecatedSynchronousErrorHandling) { if (sink.syncErrorThrowable) { sink.syncErrorThrowable = false; if (sink.syncErrorThrown) { throw sink.syncErrorValue; } } } return sink; }; Observable.prototype._trySubscribe = function (sink) { try { return this._subscribe(sink); } catch (err) { if (_config__WEBPACK_IMPORTED_MODULE_3__["config"].useDeprecatedSynchronousErrorHandling) { sink.syncErrorThrown = true; sink.syncErrorValue = err; } sink.error(err); } }; Observable.prototype.forEach = function (next, promiseCtor) { var _this = this; promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor(function (resolve, reject) { var subscription; subscription = _this.subscribe(function (value) { try { next(value); } catch (err) { reject(err); if (subscription) { subscription.unsubscribe(); } } }, reject, resolve); }); }; Observable.prototype._subscribe = function (subscriber) { var source = this.source; return source && source.subscribe(subscriber); }; Observable.prototype[_internal_symbol_observable__WEBPACK_IMPORTED_MODULE_1__["observable"]] = function () { return this; }; Observable.prototype.pipe = function () { var operations = []; for (var _i = 0; _i < arguments.length; _i++) { operations[_i] = arguments[_i]; } if (operations.length === 0) { return this; } return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_2__["pipeFromArray"])(operations)(this); }; Observable.prototype.toPromise = function (promiseCtor) { var _this = this; promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor(function (resolve, reject) { var value; _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); }); }); }; Observable.create = function (subscribe) { return new Observable(subscribe); }; return Observable; }()); function getPromiseCtor(promiseCtor) { if (!promiseCtor) { promiseCtor = _config__WEBPACK_IMPORTED_MODULE_3__["config"].Promise || Promise; } if (!promiseCtor) { throw new Error('no Promise impl found'); } return promiseCtor; } //# sourceMappingURL=Observable.js.map /***/ }), /* 164 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toSubscriber", function() { return toSubscriber; }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(165); /* harmony import */ var _symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(177); /* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(168); /** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */ function toSubscriber(nextOrObserver, error, complete) { if (nextOrObserver) { if (nextOrObserver instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"]) { return nextOrObserver; } if (nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__["rxSubscriber"]]) { return nextOrObserver[_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_1__["rxSubscriber"]](); } } if (!nextOrObserver && !error && !complete) { return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](_Observer__WEBPACK_IMPORTED_MODULE_2__["empty"]); } return new _Subscriber__WEBPACK_IMPORTED_MODULE_0__["Subscriber"](nextOrObserver, error, complete); } //# sourceMappingURL=toSubscriber.js.map /***/ }), /* 165 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return Subscriber; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(167); /* harmony import */ var _Observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(168); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(171); /* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(177); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(169); /* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(170); /** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */ var Subscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](Subscriber, _super); function Subscriber(destinationOrNext, error, complete) { var _this = _super.call(this) || this; _this.syncErrorValue = null; _this.syncErrorThrown = false; _this.syncErrorThrowable = false; _this.isStopped = false; switch (arguments.length) { case 0: _this.destination = _Observer__WEBPACK_IMPORTED_MODULE_2__["empty"]; break; case 1: if (!destinationOrNext) { _this.destination = _Observer__WEBPACK_IMPORTED_MODULE_2__["empty"]; break; } if (typeof destinationOrNext === 'object') { if (isTrustedSubscriber(destinationOrNext)) { var trustedSubscriber = destinationOrNext[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__["rxSubscriber"]](); _this.syncErrorThrowable = trustedSubscriber.syncErrorThrowable; _this.destination = trustedSubscriber; trustedSubscriber.add(_this); } else { _this.syncErrorThrowable = true; _this.destination = new SafeSubscriber(_this, destinationOrNext); } break; } default: _this.syncErrorThrowable = true; _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete); break; } return _this; } Subscriber.prototype[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__["rxSubscriber"]] = function () { return this; }; Subscriber.create = function (next, error, complete) { var subscriber = new Subscriber(next, error, complete); subscriber.syncErrorThrowable = false; return subscriber; }; Subscriber.prototype.next = function (value) { if (!this.isStopped) { this._next(value); } }; Subscriber.prototype.error = function (err) { if (!this.isStopped) { this.isStopped = true; this._error(err); } }; Subscriber.prototype.complete = function () { if (!this.isStopped) { this.isStopped = true; this._complete(); } }; Subscriber.prototype.unsubscribe = function () { if (this.closed) { return; } this.isStopped = true; _super.prototype.unsubscribe.call(this); }; Subscriber.prototype._next = function (value) { this.destination.next(value); }; Subscriber.prototype._error = function (err) { this.destination.error(err); this.unsubscribe(); }; Subscriber.prototype._complete = function () { this.destination.complete(); this.unsubscribe(); }; Subscriber.prototype._unsubscribeAndRecycle = function () { var _a = this, _parent = _a._parent, _parents = _a._parents; this._parent = null; this._parents = null; this.unsubscribe(); this.closed = false; this.isStopped = false; this._parent = _parent; this._parents = _parents; return this; }; return Subscriber; }(_Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"])); var SafeSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SafeSubscriber, _super); function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) { var _this = _super.call(this) || this; _this._parentSubscriber = _parentSubscriber; var next; var context = _this; if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(observerOrNext)) { next = observerOrNext; } else if (observerOrNext) { next = observerOrNext.next; error = observerOrNext.error; complete = observerOrNext.complete; if (observerOrNext !== _Observer__WEBPACK_IMPORTED_MODULE_2__["empty"]) { context = Object.create(observerOrNext); if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_1__["isFunction"])(context.unsubscribe)) { _this.add(context.unsubscribe.bind(context)); } context.unsubscribe = _this.unsubscribe.bind(_this); } } _this._context = context; _this._next = next; _this._error = error; _this._complete = complete; return _this; } SafeSubscriber.prototype.next = function (value) { if (!this.isStopped && this._next) { var _parentSubscriber = this._parentSubscriber; if (!_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { this.__tryOrUnsub(this._next, value); } else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) { this.unsubscribe(); } } }; SafeSubscriber.prototype.error = function (err) { if (!this.isStopped) { var _parentSubscriber = this._parentSubscriber; var useDeprecatedSynchronousErrorHandling = _config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling; if (this._error) { if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { this.__tryOrUnsub(this._error, err); this.unsubscribe(); } else { this.__tryOrSetError(_parentSubscriber, this._error, err); this.unsubscribe(); } } else if (!_parentSubscriber.syncErrorThrowable) { this.unsubscribe(); if (useDeprecatedSynchronousErrorHandling) { throw err; } Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err); } else { if (useDeprecatedSynchronousErrorHandling) { _parentSubscriber.syncErrorValue = err; _parentSubscriber.syncErrorThrown = true; } else { Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err); } this.unsubscribe(); } } }; SafeSubscriber.prototype.complete = function () { var _this = this; if (!this.isStopped) { var _parentSubscriber = this._parentSubscriber; if (this._complete) { var wrappedComplete = function () { return _this._complete.call(_this._context); }; if (!_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { this.__tryOrUnsub(wrappedComplete); this.unsubscribe(); } else { this.__tryOrSetError(_parentSubscriber, wrappedComplete); this.unsubscribe(); } } else { this.unsubscribe(); } } }; SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) { try { fn.call(this._context, value); } catch (err) { this.unsubscribe(); if (_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling) { throw err; } else { Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err); } } }; SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) { if (!_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling) { throw new Error('bad call'); } try { fn.call(this._context, value); } catch (err) { if (_config__WEBPACK_IMPORTED_MODULE_5__["config"].useDeprecatedSynchronousErrorHandling) { parent.syncErrorValue = err; parent.syncErrorThrown = true; return true; } else { Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_6__["hostReportError"])(err); return true; } } return false; }; SafeSubscriber.prototype._unsubscribe = function () { var _parentSubscriber = this._parentSubscriber; this._context = null; this._parentSubscriber = null; _parentSubscriber.unsubscribe(); }; return SafeSubscriber; }(Subscriber)); function isTrustedSubscriber(obj) { return obj instanceof Subscriber || ('syncErrorThrowable' in obj && obj[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_4__["rxSubscriber"]]); } //# sourceMappingURL=Subscriber.js.map /***/ }), /* 166 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]]; return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } function __exportStar(m, exports) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } function __values(o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result.default = mod; return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } /***/ }), /* 167 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function isFunction(x) { return typeof x === 'function'; } //# sourceMappingURL=isFunction.js.map /***/ }), /* 168 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; }); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(169); /* harmony import */ var _util_hostReportError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(170); /** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */ var empty = { closed: true, next: function (value) { }, error: function (err) { if (_config__WEBPACK_IMPORTED_MODULE_0__["config"].useDeprecatedSynchronousErrorHandling) { throw err; } else { Object(_util_hostReportError__WEBPACK_IMPORTED_MODULE_1__["hostReportError"])(err); } }, complete: function () { } }; //# sourceMappingURL=Observer.js.map /***/ }), /* 169 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return config; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var _enable_super_gross_mode_that_will_cause_bad_things = false; var config = { Promise: undefined, set useDeprecatedSynchronousErrorHandling(value) { if (value) { var error = /*@__PURE__*/ new Error(); /*@__PURE__*/ console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack); } else if (_enable_super_gross_mode_that_will_cause_bad_things) { /*@__PURE__*/ console.log('RxJS: Back to a better error behavior. Thank you. <3'); } _enable_super_gross_mode_that_will_cause_bad_things = value; }, get useDeprecatedSynchronousErrorHandling() { return _enable_super_gross_mode_that_will_cause_bad_things; }, }; //# sourceMappingURL=config.js.map /***/ }), /* 170 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hostReportError", function() { return hostReportError; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function hostReportError(err) { setTimeout(function () { throw err; }); } //# sourceMappingURL=hostReportError.js.map /***/ }), /* 171 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return Subscription; }); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(172); /* harmony import */ var _util_isObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(173); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(167); /* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(174); /* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(175); /* harmony import */ var _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(176); /** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_tryCatch,_util_errorObject,_util_UnsubscriptionError PURE_IMPORTS_END */ var Subscription = /*@__PURE__*/ (function () { function Subscription(unsubscribe) { this.closed = false; this._parent = null; this._parents = null; this._subscriptions = null; if (unsubscribe) { this._unsubscribe = unsubscribe; } } Subscription.prototype.unsubscribe = function () { var hasErrors = false; var errors; if (this.closed) { return; } var _a = this, _parent = _a._parent, _parents = _a._parents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions; this.closed = true; this._parent = null; this._parents = null; this._subscriptions = null; var index = -1; var len = _parents ? _parents.length : 0; while (_parent) { _parent.remove(this); _parent = ++index < len && _parents[index] || null; } if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(_unsubscribe)) { var trial = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_3__["tryCatch"])(_unsubscribe).call(this); if (trial === _util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"]) { hasErrors = true; errors = errors || (_util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"].e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_5__["UnsubscriptionError"] ? flattenUnsubscriptionErrors(_util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"].e.errors) : [_util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"].e]); } } if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(_subscriptions)) { index = -1; len = _subscriptions.length; while (++index < len) { var sub = _subscriptions[index]; if (Object(_util_isObject__WEBPACK_IMPORTED_MODULE_1__["isObject"])(sub)) { var trial = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_3__["tryCatch"])(sub.unsubscribe).call(sub); if (trial === _util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"]) { hasErrors = true; errors = errors || []; var err = _util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"].e; if (err instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_5__["UnsubscriptionError"]) { errors = errors.concat(flattenUnsubscriptionErrors(err.errors)); } else { errors.push(err); } } } } } if (hasErrors) { throw new _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_5__["UnsubscriptionError"](errors); } }; Subscription.prototype.add = function (teardown) { if (!teardown || (teardown === Subscription.EMPTY)) { return Subscription.EMPTY; } if (teardown === this) { return this; } var subscription = teardown; switch (typeof teardown) { case 'function': subscription = new Subscription(teardown); case 'object': if (subscription.closed || typeof subscription.unsubscribe !== 'function') { return subscription; } else if (this.closed) { subscription.unsubscribe(); return subscription; } else if (typeof subscription._addParent !== 'function') { var tmp = subscription; subscription = new Subscription(); subscription._subscriptions = [tmp]; } break; default: throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.'); } var subscriptions = this._subscriptions || (this._subscriptions = []); subscriptions.push(subscription); subscription._addParent(this); return subscription; }; Subscription.prototype.remove = function (subscription) { var subscriptions = this._subscriptions; if (subscriptions) { var subscriptionIndex = subscriptions.indexOf(subscription); if (subscriptionIndex !== -1) { subscriptions.splice(subscriptionIndex, 1); } } }; Subscription.prototype._addParent = function (parent) { var _a = this, _parent = _a._parent, _parents = _a._parents; if (!_parent || _parent === parent) { this._parent = parent; } else if (!_parents) { this._parents = [parent]; } else if (_parents.indexOf(parent) === -1) { _parents.push(parent); } }; Subscription.EMPTY = (function (empty) { empty.closed = true; return empty; }(new Subscription())); return Subscription; }()); function flattenUnsubscriptionErrors(errors) { return errors.reduce(function (errs, err) { return errs.concat((err instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_5__["UnsubscriptionError"]) ? err.errors : err); }, []); } //# sourceMappingURL=Subscription.js.map /***/ }), /* 172 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var isArray = Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); //# sourceMappingURL=isArray.js.map /***/ }), /* 173 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function isObject(x) { return x != null && typeof x === 'object'; } //# sourceMappingURL=isObject.js.map /***/ }), /* 174 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tryCatch", function() { return tryCatch; }); /* harmony import */ var _errorObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(175); /** PURE_IMPORTS_START _errorObject PURE_IMPORTS_END */ var tryCatchTarget; function tryCatcher() { try { return tryCatchTarget.apply(this, arguments); } catch (e) { _errorObject__WEBPACK_IMPORTED_MODULE_0__["errorObject"].e = e; return _errorObject__WEBPACK_IMPORTED_MODULE_0__["errorObject"]; } } function tryCatch(fn) { tryCatchTarget = fn; return tryCatcher; } //# sourceMappingURL=tryCatch.js.map /***/ }), /* 175 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "errorObject", function() { return errorObject; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var errorObject = { e: {} }; //# sourceMappingURL=errorObject.js.map /***/ }), /* 176 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return UnsubscriptionError; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /** PURE_IMPORTS_START tslib PURE_IMPORTS_END */ var UnsubscriptionError = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](UnsubscriptionError, _super); function UnsubscriptionError(errors) { var _this = _super.call(this, errors ? errors.length + " errors occurred during unsubscription:\n " + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ') : '') || this; _this.errors = errors; _this.name = 'UnsubscriptionError'; Object.setPrototypeOf(_this, UnsubscriptionError.prototype); return _this; } return UnsubscriptionError; }(Error)); //# sourceMappingURL=UnsubscriptionError.js.map /***/ }), /* 177 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rxSubscriber", function() { return rxSubscriber; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$$rxSubscriber", function() { return $$rxSubscriber; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var rxSubscriber = (typeof Symbol === 'function' && typeof Symbol.for === 'function') ? /*@__PURE__*/ Symbol.for('rxSubscriber') : '@@rxSubscriber'; var $$rxSubscriber = rxSubscriber; //# sourceMappingURL=rxSubscriber.js.map /***/ }), /* 178 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return observable; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var observable = typeof Symbol === 'function' && Symbol.observable || '@@observable'; //# sourceMappingURL=observable.js.map /***/ }), /* 179 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return pipe; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pipeFromArray", function() { return pipeFromArray; }); /* harmony import */ var _noop__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(180); /** PURE_IMPORTS_START _noop PURE_IMPORTS_END */ function pipe() { var fns = []; for (var _i = 0; _i < arguments.length; _i++) { fns[_i] = arguments[_i]; } return pipeFromArray(fns); } function pipeFromArray(fns) { if (!fns) { return _noop__WEBPACK_IMPORTED_MODULE_0__["noop"]; } if (fns.length === 1) { return fns[0]; } return function piped(input) { return fns.reduce(function (prev, fn) { return fn(prev); }, input); }; } //# sourceMappingURL=pipe.js.map /***/ }), /* 180 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return noop; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function noop() { } //# sourceMappingURL=noop.js.map /***/ }), /* 181 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return ConnectableObservable; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "connectableObservableDescriptor", function() { return connectableObservableDescriptor; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(182); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(163); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(165); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(171); /* harmony import */ var _operators_refCount__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(185); /** PURE_IMPORTS_START tslib,_Subject,_Observable,_Subscriber,_Subscription,_operators_refCount PURE_IMPORTS_END */ var ConnectableObservable = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ConnectableObservable, _super); function ConnectableObservable(source, subjectFactory) { var _this = _super.call(this) || this; _this.source = source; _this.subjectFactory = subjectFactory; _this._refCount = 0; _this._isComplete = false; return _this; } ConnectableObservable.prototype._subscribe = function (subscriber) { return this.getSubject().subscribe(subscriber); }; ConnectableObservable.prototype.getSubject = function () { var subject = this._subject; if (!subject || subject.isStopped) { this._subject = this.subjectFactory(); } return this._subject; }; ConnectableObservable.prototype.connect = function () { var connection = this._connection; if (!connection) { this._isComplete = false; connection = this._connection = new _Subscription__WEBPACK_IMPORTED_MODULE_4__["Subscription"](); connection.add(this.source .subscribe(new ConnectableSubscriber(this.getSubject(), this))); if (connection.closed) { this._connection = null; connection = _Subscription__WEBPACK_IMPORTED_MODULE_4__["Subscription"].EMPTY; } else { this._connection = connection; } } return connection; }; ConnectableObservable.prototype.refCount = function () { return Object(_operators_refCount__WEBPACK_IMPORTED_MODULE_5__["refCount"])()(this); }; return ConnectableObservable; }(_Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"])); var connectableProto = ConnectableObservable.prototype; var connectableObservableDescriptor = { operator: { value: null }, _refCount: { value: 0, writable: true }, _subject: { value: null, writable: true }, _connection: { value: null, writable: true }, _subscribe: { value: connectableProto._subscribe }, _isComplete: { value: connectableProto._isComplete, writable: true }, getSubject: { value: connectableProto.getSubject }, connect: { value: connectableProto.connect }, refCount: { value: connectableProto.refCount } }; var ConnectableSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ConnectableSubscriber, _super); function ConnectableSubscriber(destination, connectable) { var _this = _super.call(this, destination) || this; _this.connectable = connectable; return _this; } ConnectableSubscriber.prototype._error = function (err) { this._unsubscribe(); _super.prototype._error.call(this, err); }; ConnectableSubscriber.prototype._complete = function () { this.connectable._isComplete = true; this._unsubscribe(); _super.prototype._complete.call(this); }; ConnectableSubscriber.prototype._unsubscribe = function () { var connectable = this.connectable; if (connectable) { this.connectable = null; var connection = connectable._connection; connectable._refCount = 0; connectable._subject = null; connectable._connection = null; if (connection) { connection.unsubscribe(); } } }; return ConnectableSubscriber; }(_Subject__WEBPACK_IMPORTED_MODULE_1__["SubjectSubscriber"])); var RefCountOperator = /*@__PURE__*/ (function () { function RefCountOperator(connectable) { this.connectable = connectable; } RefCountOperator.prototype.call = function (subscriber, source) { var connectable = this.connectable; connectable._refCount++; var refCounter = new RefCountSubscriber(subscriber, connectable); var subscription = source.subscribe(refCounter); if (!refCounter.closed) { refCounter.connection = connectable.connect(); } return subscription; }; return RefCountOperator; }()); var RefCountSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RefCountSubscriber, _super); function RefCountSubscriber(destination, connectable) { var _this = _super.call(this, destination) || this; _this.connectable = connectable; return _this; } RefCountSubscriber.prototype._unsubscribe = function () { var connectable = this.connectable; if (!connectable) { this.connection = null; return; } this.connectable = null; var refCount = connectable._refCount; if (refCount <= 0) { this.connection = null; return; } connectable._refCount = refCount - 1; if (refCount > 1) { this.connection = null; return; } var connection = this.connection; var sharedConnection = connectable._connection; this.connection = null; if (sharedConnection && (!connection || sharedConnection === connection)) { sharedConnection.unsubscribe(); } }; return RefCountSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"])); //# sourceMappingURL=ConnectableObservable.js.map /***/ }), /* 182 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubjectSubscriber", function() { return SubjectSubscriber; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return Subject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnonymousSubject", function() { return AnonymousSubject; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(163); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(165); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(171); /* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(183); /* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(184); /* harmony import */ var _internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(177); /** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */ var SubjectSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubjectSubscriber, _super); function SubjectSubscriber(destination) { var _this = _super.call(this, destination) || this; _this.destination = destination; return _this; } return SubjectSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"])); var Subject = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](Subject, _super); function Subject() { var _this = _super.call(this) || this; _this.observers = []; _this.closed = false; _this.isStopped = false; _this.hasError = false; _this.thrownError = null; return _this; } Subject.prototype[_internal_symbol_rxSubscriber__WEBPACK_IMPORTED_MODULE_6__["rxSubscriber"]] = function () { return new SubjectSubscriber(this); }; Subject.prototype.lift = function (operator) { var subject = new AnonymousSubject(this, this); subject.operator = operator; return subject; }; Subject.prototype.next = function (value) { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"](); } if (!this.isStopped) { var observers = this.observers; var len = observers.length; var copy = observers.slice(); for (var i = 0; i < len; i++) { copy[i].next(value); } } }; Subject.prototype.error = function (err) { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"](); } this.hasError = true; this.thrownError = err; this.isStopped = true; var observers = this.observers; var len = observers.length; var copy = observers.slice(); for (var i = 0; i < len; i++) { copy[i].error(err); } this.observers.length = 0; }; Subject.prototype.complete = function () { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"](); } this.isStopped = true; var observers = this.observers; var len = observers.length; var copy = observers.slice(); for (var i = 0; i < len; i++) { copy[i].complete(); } this.observers.length = 0; }; Subject.prototype.unsubscribe = function () { this.isStopped = true; this.closed = true; this.observers = null; }; Subject.prototype._trySubscribe = function (subscriber) { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"](); } else { return _super.prototype._trySubscribe.call(this, subscriber); } }; Subject.prototype._subscribe = function (subscriber) { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_4__["ObjectUnsubscribedError"](); } else if (this.hasError) { subscriber.error(this.thrownError); return _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY; } else if (this.isStopped) { subscriber.complete(); return _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY; } else { this.observers.push(subscriber); return new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_5__["SubjectSubscription"](this, subscriber); } }; Subject.prototype.asObservable = function () { var observable = new _Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"](); observable.source = this; return observable; }; Subject.create = function (destination, source) { return new AnonymousSubject(destination, source); }; return Subject; }(_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"])); var AnonymousSubject = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AnonymousSubject, _super); function AnonymousSubject(destination, source) { var _this = _super.call(this) || this; _this.destination = destination; _this.source = source; return _this; } AnonymousSubject.prototype.next = function (value) { var destination = this.destination; if (destination && destination.next) { destination.next(value); } }; AnonymousSubject.prototype.error = function (err) { var destination = this.destination; if (destination && destination.error) { this.destination.error(err); } }; AnonymousSubject.prototype.complete = function () { var destination = this.destination; if (destination && destination.complete) { this.destination.complete(); } }; AnonymousSubject.prototype._subscribe = function (subscriber) { var source = this.source; if (source) { return this.source.subscribe(subscriber); } else { return _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY; } }; return AnonymousSubject; }(Subject)); //# sourceMappingURL=Subject.js.map /***/ }), /* 183 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return ObjectUnsubscribedError; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /** PURE_IMPORTS_START tslib PURE_IMPORTS_END */ var ObjectUnsubscribedError = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ObjectUnsubscribedError, _super); function ObjectUnsubscribedError() { var _this = _super.call(this, 'object unsubscribed') || this; _this.name = 'ObjectUnsubscribedError'; Object.setPrototypeOf(_this, ObjectUnsubscribedError.prototype); return _this; } return ObjectUnsubscribedError; }(Error)); //# sourceMappingURL=ObjectUnsubscribedError.js.map /***/ }), /* 184 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubjectSubscription", function() { return SubjectSubscription; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); /** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */ var SubjectSubscription = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubjectSubscription, _super); function SubjectSubscription(subject, subscriber) { var _this = _super.call(this) || this; _this.subject = subject; _this.subscriber = subscriber; _this.closed = false; return _this; } SubjectSubscription.prototype.unsubscribe = function () { if (this.closed) { return; } this.closed = true; var subject = this.subject; var observers = subject.observers; this.subject = null; if (!observers || observers.length === 0 || subject.isStopped || subject.closed) { return; } var subscriberIndex = observers.indexOf(this.subscriber); if (subscriberIndex !== -1) { observers.splice(subscriberIndex, 1); } }; return SubjectSubscription; }(_Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"])); //# sourceMappingURL=SubjectSubscription.js.map /***/ }), /* 185 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return refCount; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function refCount() { return function refCountOperatorFunction(source) { return source.lift(new RefCountOperator(source)); }; } var RefCountOperator = /*@__PURE__*/ (function () { function RefCountOperator(connectable) { this.connectable = connectable; } RefCountOperator.prototype.call = function (subscriber, source) { var connectable = this.connectable; connectable._refCount++; var refCounter = new RefCountSubscriber(subscriber, connectable); var subscription = source.subscribe(refCounter); if (!refCounter.closed) { refCounter.connection = connectable.connect(); } return subscription; }; return RefCountOperator; }()); var RefCountSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RefCountSubscriber, _super); function RefCountSubscriber(destination, connectable) { var _this = _super.call(this, destination) || this; _this.connectable = connectable; return _this; } RefCountSubscriber.prototype._unsubscribe = function () { var connectable = this.connectable; if (!connectable) { this.connection = null; return; } this.connectable = null; var refCount = connectable._refCount; if (refCount <= 0) { this.connection = null; return; } connectable._refCount = refCount - 1; if (refCount > 1) { this.connection = null; return; } var connection = this.connection; var sharedConnection = connectable._connection; this.connection = null; if (sharedConnection && (!connection || sharedConnection === connection)) { sharedConnection.unsubscribe(); } }; return RefCountSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=refCount.js.map /***/ }), /* 186 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return GroupedObservable; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(171); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(163); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(182); /** PURE_IMPORTS_START tslib,_Subscriber,_Subscription,_Observable,_Subject PURE_IMPORTS_END */ function groupBy(keySelector, elementSelector, durationSelector, subjectSelector) { return function (source) { return source.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector)); }; } var GroupByOperator = /*@__PURE__*/ (function () { function GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector) { this.keySelector = keySelector; this.elementSelector = elementSelector; this.durationSelector = durationSelector; this.subjectSelector = subjectSelector; } GroupByOperator.prototype.call = function (subscriber, source) { return source.subscribe(new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector)); }; return GroupByOperator; }()); var GroupBySubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](GroupBySubscriber, _super); function GroupBySubscriber(destination, keySelector, elementSelector, durationSelector, subjectSelector) { var _this = _super.call(this, destination) || this; _this.keySelector = keySelector; _this.elementSelector = elementSelector; _this.durationSelector = durationSelector; _this.subjectSelector = subjectSelector; _this.groups = null; _this.attemptedToUnsubscribe = false; _this.count = 0; return _this; } GroupBySubscriber.prototype._next = function (value) { var key; try { key = this.keySelector(value); } catch (err) { this.error(err); return; } this._group(value, key); }; GroupBySubscriber.prototype._group = function (value, key) { var groups = this.groups; if (!groups) { groups = this.groups = new Map(); } var group = groups.get(key); var element; if (this.elementSelector) { try { element = this.elementSelector(value); } catch (err) { this.error(err); } } else { element = value; } if (!group) { group = (this.subjectSelector ? this.subjectSelector() : new _Subject__WEBPACK_IMPORTED_MODULE_4__["Subject"]()); groups.set(key, group); var groupedObservable = new GroupedObservable(key, group, this); this.destination.next(groupedObservable); if (this.durationSelector) { var duration = void 0; try { duration = this.durationSelector(new GroupedObservable(key, group)); } catch (err) { this.error(err); return; } this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this))); } } if (!group.closed) { group.next(element); } }; GroupBySubscriber.prototype._error = function (err) { var groups = this.groups; if (groups) { groups.forEach(function (group, key) { group.error(err); }); groups.clear(); } this.destination.error(err); }; GroupBySubscriber.prototype._complete = function () { var groups = this.groups; if (groups) { groups.forEach(function (group, key) { group.complete(); }); groups.clear(); } this.destination.complete(); }; GroupBySubscriber.prototype.removeGroup = function (key) { this.groups.delete(key); }; GroupBySubscriber.prototype.unsubscribe = function () { if (!this.closed) { this.attemptedToUnsubscribe = true; if (this.count === 0) { _super.prototype.unsubscribe.call(this); } } }; return GroupBySubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); var GroupDurationSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](GroupDurationSubscriber, _super); function GroupDurationSubscriber(key, group, parent) { var _this = _super.call(this, group) || this; _this.key = key; _this.group = group; _this.parent = parent; return _this; } GroupDurationSubscriber.prototype._next = function (value) { this.complete(); }; GroupDurationSubscriber.prototype._unsubscribe = function () { var _a = this, parent = _a.parent, key = _a.key; this.key = this.parent = null; if (parent) { parent.removeGroup(key); } }; return GroupDurationSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); var GroupedObservable = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](GroupedObservable, _super); function GroupedObservable(key, groupSubject, refCountSubscription) { var _this = _super.call(this) || this; _this.key = key; _this.groupSubject = groupSubject; _this.refCountSubscription = refCountSubscription; return _this; } GroupedObservable.prototype._subscribe = function (subscriber) { var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"](); var _a = this, refCountSubscription = _a.refCountSubscription, groupSubject = _a.groupSubject; if (refCountSubscription && !refCountSubscription.closed) { subscription.add(new InnerRefCountSubscription(refCountSubscription)); } subscription.add(groupSubject.subscribe(subscriber)); return subscription; }; return GroupedObservable; }(_Observable__WEBPACK_IMPORTED_MODULE_3__["Observable"])); var InnerRefCountSubscription = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](InnerRefCountSubscription, _super); function InnerRefCountSubscription(parent) { var _this = _super.call(this) || this; _this.parent = parent; parent.count++; return _this; } InnerRefCountSubscription.prototype.unsubscribe = function () { var parent = this.parent; if (!parent.closed && !this.closed) { _super.prototype.unsubscribe.call(this); parent.count -= 1; if (parent.count === 0 && parent.attemptedToUnsubscribe) { parent.unsubscribe(); } } }; return InnerRefCountSubscription; }(_Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"])); //# sourceMappingURL=groupBy.js.map /***/ }), /* 187 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return BehaviorSubject; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(182); /* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(183); /** PURE_IMPORTS_START tslib,_Subject,_util_ObjectUnsubscribedError PURE_IMPORTS_END */ var BehaviorSubject = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BehaviorSubject, _super); function BehaviorSubject(_value) { var _this = _super.call(this) || this; _this._value = _value; return _this; } Object.defineProperty(BehaviorSubject.prototype, "value", { get: function () { return this.getValue(); }, enumerable: true, configurable: true }); BehaviorSubject.prototype._subscribe = function (subscriber) { var subscription = _super.prototype._subscribe.call(this, subscriber); if (subscription && !subscription.closed) { subscriber.next(this._value); } return subscription; }; BehaviorSubject.prototype.getValue = function () { if (this.hasError) { throw this.thrownError; } else if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_2__["ObjectUnsubscribedError"](); } else { return this._value; } }; BehaviorSubject.prototype.next = function (value) { _super.prototype.next.call(this, this._value = value); }; return BehaviorSubject; }(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"])); //# sourceMappingURL=BehaviorSubject.js.map /***/ }), /* 188 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return ReplaySubject; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(182); /* harmony import */ var _scheduler_queue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(189); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(171); /* harmony import */ var _operators_observeOn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(196); /* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(183); /* harmony import */ var _SubjectSubscription__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(184); /** PURE_IMPORTS_START tslib,_Subject,_scheduler_queue,_Subscription,_operators_observeOn,_util_ObjectUnsubscribedError,_SubjectSubscription PURE_IMPORTS_END */ var ReplaySubject = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ReplaySubject, _super); function ReplaySubject(bufferSize, windowTime, scheduler) { if (bufferSize === void 0) { bufferSize = Number.POSITIVE_INFINITY; } if (windowTime === void 0) { windowTime = Number.POSITIVE_INFINITY; } var _this = _super.call(this) || this; _this.scheduler = scheduler; _this._events = []; _this._infiniteTimeWindow = false; _this._bufferSize = bufferSize < 1 ? 1 : bufferSize; _this._windowTime = windowTime < 1 ? 1 : windowTime; if (windowTime === Number.POSITIVE_INFINITY) { _this._infiniteTimeWindow = true; _this.next = _this.nextInfiniteTimeWindow; } else { _this.next = _this.nextTimeWindow; } return _this; } ReplaySubject.prototype.nextInfiniteTimeWindow = function (value) { var _events = this._events; _events.push(value); if (_events.length > this._bufferSize) { _events.shift(); } _super.prototype.next.call(this, value); }; ReplaySubject.prototype.nextTimeWindow = function (value) { this._events.push(new ReplayEvent(this._getNow(), value)); this._trimBufferThenGetEvents(); _super.prototype.next.call(this, value); }; ReplaySubject.prototype._subscribe = function (subscriber) { var _infiniteTimeWindow = this._infiniteTimeWindow; var _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents(); var scheduler = this.scheduler; var len = _events.length; var subscription; if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_5__["ObjectUnsubscribedError"](); } else if (this.isStopped || this.hasError) { subscription = _Subscription__WEBPACK_IMPORTED_MODULE_3__["Subscription"].EMPTY; } else { this.observers.push(subscriber); subscription = new _SubjectSubscription__WEBPACK_IMPORTED_MODULE_6__["SubjectSubscription"](this, subscriber); } if (scheduler) { subscriber.add(subscriber = new _operators_observeOn__WEBPACK_IMPORTED_MODULE_4__["ObserveOnSubscriber"](subscriber, scheduler)); } if (_infiniteTimeWindow) { for (var i = 0; i < len && !subscriber.closed; i++) { subscriber.next(_events[i]); } } else { for (var i = 0; i < len && !subscriber.closed; i++) { subscriber.next(_events[i].value); } } if (this.hasError) { subscriber.error(this.thrownError); } else if (this.isStopped) { subscriber.complete(); } return subscription; }; ReplaySubject.prototype._getNow = function () { return (this.scheduler || _scheduler_queue__WEBPACK_IMPORTED_MODULE_2__["queue"]).now(); }; ReplaySubject.prototype._trimBufferThenGetEvents = function () { var now = this._getNow(); var _bufferSize = this._bufferSize; var _windowTime = this._windowTime; var _events = this._events; var eventsCount = _events.length; var spliceCount = 0; while (spliceCount < eventsCount) { if ((now - _events[spliceCount].time) < _windowTime) { break; } spliceCount++; } if (eventsCount > _bufferSize) { spliceCount = Math.max(spliceCount, eventsCount - _bufferSize); } if (spliceCount > 0) { _events.splice(0, spliceCount); } return _events; }; return ReplaySubject; }(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"])); var ReplayEvent = /*@__PURE__*/ (function () { function ReplayEvent(time, value) { this.time = time; this.value = value; } return ReplayEvent; }()); //# sourceMappingURL=ReplaySubject.js.map /***/ }), /* 189 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "queue", function() { return queue; }); /* harmony import */ var _QueueAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(190); /* harmony import */ var _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(193); /** PURE_IMPORTS_START _QueueAction,_QueueScheduler PURE_IMPORTS_END */ var queue = /*@__PURE__*/ new _QueueScheduler__WEBPACK_IMPORTED_MODULE_1__["QueueScheduler"](_QueueAction__WEBPACK_IMPORTED_MODULE_0__["QueueAction"]); //# sourceMappingURL=queue.js.map /***/ }), /* 190 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueueAction", function() { return QueueAction; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(191); /** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */ var QueueAction = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](QueueAction, _super); function QueueAction(scheduler, work) { var _this = _super.call(this, scheduler, work) || this; _this.scheduler = scheduler; _this.work = work; return _this; } QueueAction.prototype.schedule = function (state, delay) { if (delay === void 0) { delay = 0; } if (delay > 0) { return _super.prototype.schedule.call(this, state, delay); } this.delay = delay; this.state = state; this.scheduler.flush(this); return this; }; QueueAction.prototype.execute = function (state, delay) { return (delay > 0 || this.closed) ? _super.prototype.execute.call(this, state, delay) : this._execute(state, delay); }; QueueAction.prototype.requestAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) { return _super.prototype.requestAsyncId.call(this, scheduler, id, delay); } return scheduler.flush(this); }; return QueueAction; }(_AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"])); //# sourceMappingURL=QueueAction.js.map /***/ }), /* 191 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncAction", function() { return AsyncAction; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Action__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(192); /** PURE_IMPORTS_START tslib,_Action PURE_IMPORTS_END */ var AsyncAction = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsyncAction, _super); function AsyncAction(scheduler, work) { var _this = _super.call(this, scheduler, work) || this; _this.scheduler = scheduler; _this.work = work; _this.pending = false; return _this; } AsyncAction.prototype.schedule = function (state, delay) { if (delay === void 0) { delay = 0; } if (this.closed) { return this; } this.state = state; var id = this.id; var scheduler = this.scheduler; if (id != null) { this.id = this.recycleAsyncId(scheduler, id, delay); } this.pending = true; this.delay = delay; this.id = this.id || this.requestAsyncId(scheduler, this.id, delay); return this; }; AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } return setInterval(scheduler.flush.bind(scheduler, this), delay); }; AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } if (delay !== null && this.delay === delay && this.pending === false) { return id; } return clearInterval(id) && undefined || undefined; }; AsyncAction.prototype.execute = function (state, delay) { if (this.closed) { return new Error('executing a cancelled action'); } this.pending = false; var error = this._execute(state, delay); if (error) { return error; } else if (this.pending === false && this.id != null) { this.id = this.recycleAsyncId(this.scheduler, this.id, null); } }; AsyncAction.prototype._execute = function (state, delay) { var errored = false; var errorValue = undefined; try { this.work(state); } catch (e) { errored = true; errorValue = !!e && e || new Error(e); } if (errored) { this.unsubscribe(); return errorValue; } }; AsyncAction.prototype._unsubscribe = function () { var id = this.id; var scheduler = this.scheduler; var actions = scheduler.actions; var index = actions.indexOf(this); this.work = null; this.state = null; this.pending = false; this.scheduler = null; if (index !== -1) { actions.splice(index, 1); } if (id != null) { this.id = this.recycleAsyncId(scheduler, id, null); } this.delay = null; }; return AsyncAction; }(_Action__WEBPACK_IMPORTED_MODULE_1__["Action"])); //# sourceMappingURL=AsyncAction.js.map /***/ }), /* 192 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Action", function() { return Action; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); /** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */ var Action = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](Action, _super); function Action(scheduler, work) { return _super.call(this) || this; } Action.prototype.schedule = function (state, delay) { if (delay === void 0) { delay = 0; } return this; }; return Action; }(_Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"])); //# sourceMappingURL=Action.js.map /***/ }), /* 193 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QueueScheduler", function() { return QueueScheduler; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(194); /** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */ var QueueScheduler = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](QueueScheduler, _super); function QueueScheduler() { return _super !== null && _super.apply(this, arguments) || this; } return QueueScheduler; }(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"])); //# sourceMappingURL=QueueScheduler.js.map /***/ }), /* 194 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncScheduler", function() { return AsyncScheduler; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Scheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(195); /** PURE_IMPORTS_START tslib,_Scheduler PURE_IMPORTS_END */ var AsyncScheduler = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsyncScheduler, _super); function AsyncScheduler(SchedulerAction, now) { if (now === void 0) { now = _Scheduler__WEBPACK_IMPORTED_MODULE_1__["Scheduler"].now; } var _this = _super.call(this, SchedulerAction, function () { if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) { return AsyncScheduler.delegate.now(); } else { return now(); } }) || this; _this.actions = []; _this.active = false; _this.scheduled = undefined; return _this; } AsyncScheduler.prototype.schedule = function (work, delay, state) { if (delay === void 0) { delay = 0; } if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) { return AsyncScheduler.delegate.schedule(work, delay, state); } else { return _super.prototype.schedule.call(this, work, delay, state); } }; AsyncScheduler.prototype.flush = function (action) { var actions = this.actions; if (this.active) { actions.push(action); return; } var error; this.active = true; do { if (error = action.execute(action.state, action.delay)) { break; } } while (action = actions.shift()); this.active = false; if (error) { while (action = actions.shift()) { action.unsubscribe(); } throw error; } }; return AsyncScheduler; }(_Scheduler__WEBPACK_IMPORTED_MODULE_1__["Scheduler"])); //# sourceMappingURL=AsyncScheduler.js.map /***/ }), /* 195 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return Scheduler; }); var Scheduler = /*@__PURE__*/ (function () { function Scheduler(SchedulerAction, now) { if (now === void 0) { now = Scheduler.now; } this.SchedulerAction = SchedulerAction; this.now = now; } Scheduler.prototype.schedule = function (work, delay, state) { if (delay === void 0) { delay = 0; } return new this.SchedulerAction(this, work).schedule(state, delay); }; Scheduler.now = Date.now ? Date.now : function () { return +new Date(); }; return Scheduler; }()); //# sourceMappingURL=Scheduler.js.map /***/ }), /* 196 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return observeOn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnOperator", function() { return ObserveOnOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnSubscriber", function() { return ObserveOnSubscriber; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObserveOnMessage", function() { return ObserveOnMessage; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(197); /** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */ function observeOn(scheduler, delay) { if (delay === void 0) { delay = 0; } return function observeOnOperatorFunction(source) { return source.lift(new ObserveOnOperator(scheduler, delay)); }; } var ObserveOnOperator = /*@__PURE__*/ (function () { function ObserveOnOperator(scheduler, delay) { if (delay === void 0) { delay = 0; } this.scheduler = scheduler; this.delay = delay; } ObserveOnOperator.prototype.call = function (subscriber, source) { return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay)); }; return ObserveOnOperator; }()); var ObserveOnSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ObserveOnSubscriber, _super); function ObserveOnSubscriber(destination, scheduler, delay) { if (delay === void 0) { delay = 0; } var _this = _super.call(this, destination) || this; _this.scheduler = scheduler; _this.delay = delay; return _this; } ObserveOnSubscriber.dispatch = function (arg) { var notification = arg.notification, destination = arg.destination; notification.observe(destination); this.unsubscribe(); }; ObserveOnSubscriber.prototype.scheduleMessage = function (notification) { this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination))); }; ObserveOnSubscriber.prototype._next = function (value) { this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createNext(value)); }; ObserveOnSubscriber.prototype._error = function (err) { this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createError(err)); }; ObserveOnSubscriber.prototype._complete = function () { this.scheduleMessage(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createComplete()); }; return ObserveOnSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); var ObserveOnMessage = /*@__PURE__*/ (function () { function ObserveOnMessage(notification, destination) { this.notification = notification; this.destination = destination; } return ObserveOnMessage; }()); //# sourceMappingURL=observeOn.js.map /***/ }), /* 197 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return Notification; }); /* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(198); /* harmony import */ var _observable_of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(199); /* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(204); /** PURE_IMPORTS_START _observable_empty,_observable_of,_observable_throwError PURE_IMPORTS_END */ var Notification = /*@__PURE__*/ (function () { function Notification(kind, value, error) { this.kind = kind; this.value = value; this.error = error; this.hasValue = kind === 'N'; } Notification.prototype.observe = function (observer) { switch (this.kind) { case 'N': return observer.next && observer.next(this.value); case 'E': return observer.error && observer.error(this.error); case 'C': return observer.complete && observer.complete(); } }; Notification.prototype.do = function (next, error, complete) { var kind = this.kind; switch (kind) { case 'N': return next && next(this.value); case 'E': return error && error(this.error); case 'C': return complete && complete(); } }; Notification.prototype.accept = function (nextOrObserver, error, complete) { if (nextOrObserver && typeof nextOrObserver.next === 'function') { return this.observe(nextOrObserver); } else { return this.do(nextOrObserver, error, complete); } }; Notification.prototype.toObservable = function () { var kind = this.kind; switch (kind) { case 'N': return Object(_observable_of__WEBPACK_IMPORTED_MODULE_1__["of"])(this.value); case 'E': return Object(_observable_throwError__WEBPACK_IMPORTED_MODULE_2__["throwError"])(this.error); case 'C': return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_0__["empty"])(); } throw new Error('unexpected notification kind value'); }; Notification.createNext = function (value) { if (typeof value !== 'undefined') { return new Notification('N', value); } return Notification.undefinedValueNotification; }; Notification.createError = function (err) { return new Notification('E', undefined, err); }; Notification.createComplete = function () { return Notification.completeNotification; }; Notification.completeNotification = new Notification('C'); Notification.undefinedValueNotification = new Notification('N', undefined); return Notification; }()); //# sourceMappingURL=Notification.js.map /***/ }), /* 198 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return EMPTY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return empty; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "emptyScheduled", function() { return emptyScheduled; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */ var EMPTY = /*@__PURE__*/ new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return subscriber.complete(); }); function empty(scheduler) { return scheduler ? emptyScheduled(scheduler) : EMPTY; } function emptyScheduled(scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); }); } //# sourceMappingURL=empty.js.map /***/ }), /* 199 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "of", function() { return of; }); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(200); /* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); /* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(198); /* harmony import */ var _scalar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(203); /** PURE_IMPORTS_START _util_isScheduler,_fromArray,_empty,_scalar PURE_IMPORTS_END */ function of() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var scheduler = args[args.length - 1]; if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__["isScheduler"])(scheduler)) { args.pop(); } else { scheduler = undefined; } switch (args.length) { case 0: return Object(_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])(scheduler); case 1: return scheduler ? Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(args, scheduler) : Object(_scalar__WEBPACK_IMPORTED_MODULE_3__["scalar"])(args[0]); default: return Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(args, scheduler); } } //# sourceMappingURL=of.js.map /***/ }), /* 200 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isScheduler", function() { return isScheduler; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function isScheduler(value) { return value && typeof value.schedule === 'function'; } //# sourceMappingURL=isScheduler.js.map /***/ }), /* 201 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromArray", function() { return fromArray; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); /* harmony import */ var _util_subscribeToArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(202); /** PURE_IMPORTS_START _Observable,_Subscription,_util_subscribeToArray PURE_IMPORTS_END */ function fromArray(input, scheduler) { if (!scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeToArray__WEBPACK_IMPORTED_MODULE_2__["subscribeToArray"])(input)); } else { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); var i = 0; sub.add(scheduler.schedule(function () { if (i === input.length) { subscriber.complete(); return; } subscriber.next(input[i++]); if (!subscriber.closed) { sub.add(this.schedule()); } })); return sub; }); } } //# sourceMappingURL=fromArray.js.map /***/ }), /* 202 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToArray", function() { return subscribeToArray; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var subscribeToArray = function (array) { return function (subscriber) { for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) { subscriber.next(array[i]); } if (!subscriber.closed) { subscriber.complete(); } }; }; //# sourceMappingURL=subscribeToArray.js.map /***/ }), /* 203 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scalar", function() { return scalar; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */ function scalar(value) { var result = new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { subscriber.next(value); subscriber.complete(); }); result._isScalar = true; result.value = value; return result; } //# sourceMappingURL=scalar.js.map /***/ }), /* 204 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return throwError; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */ function throwError(error, scheduler) { if (!scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return subscriber.error(error); }); } else { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { return scheduler.schedule(dispatch, 0, { error: error, subscriber: subscriber }); }); } } function dispatch(_a) { var error = _a.error, subscriber = _a.subscriber; subscriber.error(error); } //# sourceMappingURL=throwError.js.map /***/ }), /* 205 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return AsyncSubject; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(182); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(171); /** PURE_IMPORTS_START tslib,_Subject,_Subscription PURE_IMPORTS_END */ var AsyncSubject = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsyncSubject, _super); function AsyncSubject() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.value = null; _this.hasNext = false; _this.hasCompleted = false; return _this; } AsyncSubject.prototype._subscribe = function (subscriber) { if (this.hasError) { subscriber.error(this.thrownError); return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY; } else if (this.hasCompleted && this.hasNext) { subscriber.next(this.value); subscriber.complete(); return _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"].EMPTY; } return _super.prototype._subscribe.call(this, subscriber); }; AsyncSubject.prototype.next = function (value) { if (!this.hasCompleted) { this.value = value; this.hasNext = true; } }; AsyncSubject.prototype.error = function (error) { if (!this.hasCompleted) { _super.prototype.error.call(this, error); } }; AsyncSubject.prototype.complete = function () { this.hasCompleted = true; if (this.hasNext) { _super.prototype.next.call(this, this.value); } _super.prototype.complete.call(this); }; return AsyncSubject; }(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"])); //# sourceMappingURL=AsyncSubject.js.map /***/ }), /* 206 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asap", function() { return asap; }); /* harmony import */ var _AsapAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(207); /* harmony import */ var _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(209); /** PURE_IMPORTS_START _AsapAction,_AsapScheduler PURE_IMPORTS_END */ var asap = /*@__PURE__*/ new _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__["AsapScheduler"](_AsapAction__WEBPACK_IMPORTED_MODULE_0__["AsapAction"]); //# sourceMappingURL=asap.js.map /***/ }), /* 207 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsapAction", function() { return AsapAction; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _util_Immediate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(208); /* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(191); /** PURE_IMPORTS_START tslib,_util_Immediate,_AsyncAction PURE_IMPORTS_END */ var AsapAction = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsapAction, _super); function AsapAction(scheduler, work) { var _this = _super.call(this, scheduler, work) || this; _this.scheduler = scheduler; _this.work = work; return _this; } AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } if (delay !== null && delay > 0) { return _super.prototype.requestAsyncId.call(this, scheduler, id, delay); } scheduler.actions.push(this); return scheduler.scheduled || (scheduler.scheduled = _util_Immediate__WEBPACK_IMPORTED_MODULE_1__["Immediate"].setImmediate(scheduler.flush.bind(scheduler, null))); }; AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) { return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay); } if (scheduler.actions.length === 0) { _util_Immediate__WEBPACK_IMPORTED_MODULE_1__["Immediate"].clearImmediate(id); scheduler.scheduled = undefined; } return undefined; }; return AsapAction; }(_AsyncAction__WEBPACK_IMPORTED_MODULE_2__["AsyncAction"])); //# sourceMappingURL=AsapAction.js.map /***/ }), /* 208 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Immediate", function() { return Immediate; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var nextHandle = 1; var tasksByHandle = {}; function runIfPresent(handle) { var cb = tasksByHandle[handle]; if (cb) { cb(); } } var Immediate = { setImmediate: function (cb) { var handle = nextHandle++; tasksByHandle[handle] = cb; Promise.resolve().then(function () { return runIfPresent(handle); }); return handle; }, clearImmediate: function (handle) { delete tasksByHandle[handle]; }, }; //# sourceMappingURL=Immediate.js.map /***/ }), /* 209 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AsapScheduler", function() { return AsapScheduler; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(194); /** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */ var AsapScheduler = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AsapScheduler, _super); function AsapScheduler() { return _super !== null && _super.apply(this, arguments) || this; } AsapScheduler.prototype.flush = function (action) { this.active = true; this.scheduled = undefined; var actions = this.actions; var error; var index = -1; var count = actions.length; action = action || actions.shift(); do { if (error = action.execute(action.state, action.delay)) { break; } } while (++index < count && (action = actions.shift())); this.active = false; if (error) { while (++index < count && (action = actions.shift())) { action.unsubscribe(); } throw error; } }; return AsapScheduler; }(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"])); //# sourceMappingURL=AsapScheduler.js.map /***/ }), /* 210 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "async", function() { return async; }); /* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(191); /* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(194); /** PURE_IMPORTS_START _AsyncAction,_AsyncScheduler PURE_IMPORTS_END */ var async = /*@__PURE__*/ new _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"](_AsyncAction__WEBPACK_IMPORTED_MODULE_0__["AsyncAction"]); //# sourceMappingURL=async.js.map /***/ }), /* 211 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "animationFrame", function() { return animationFrame; }); /* harmony import */ var _AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(212); /* harmony import */ var _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(213); /** PURE_IMPORTS_START _AnimationFrameAction,_AnimationFrameScheduler PURE_IMPORTS_END */ var animationFrame = /*@__PURE__*/ new _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__["AnimationFrameScheduler"](_AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__["AnimationFrameAction"]); //# sourceMappingURL=animationFrame.js.map /***/ }), /* 212 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationFrameAction", function() { return AnimationFrameAction; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(191); /** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */ var AnimationFrameAction = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AnimationFrameAction, _super); function AnimationFrameAction(scheduler, work) { var _this = _super.call(this, scheduler, work) || this; _this.scheduler = scheduler; _this.work = work; return _this; } AnimationFrameAction.prototype.requestAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } if (delay !== null && delay > 0) { return _super.prototype.requestAsyncId.call(this, scheduler, id, delay); } scheduler.actions.push(this); return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(function () { return scheduler.flush(null); })); }; AnimationFrameAction.prototype.recycleAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) { return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay); } if (scheduler.actions.length === 0) { cancelAnimationFrame(id); scheduler.scheduled = undefined; } return undefined; }; return AnimationFrameAction; }(_AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"])); //# sourceMappingURL=AnimationFrameAction.js.map /***/ }), /* 213 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationFrameScheduler", function() { return AnimationFrameScheduler; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(194); /** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */ var AnimationFrameScheduler = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AnimationFrameScheduler, _super); function AnimationFrameScheduler() { return _super !== null && _super.apply(this, arguments) || this; } AnimationFrameScheduler.prototype.flush = function (action) { this.active = true; this.scheduled = undefined; var actions = this.actions; var error; var index = -1; var count = actions.length; action = action || actions.shift(); do { if (error = action.execute(action.state, action.delay)) { break; } } while (++index < count && (action = actions.shift())); this.active = false; if (error) { while (++index < count && (action = actions.shift())) { action.unsubscribe(); } throw error; } }; return AnimationFrameScheduler; }(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__["AsyncScheduler"])); //# sourceMappingURL=AnimationFrameScheduler.js.map /***/ }), /* 214 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return VirtualTimeScheduler; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return VirtualAction; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(191); /* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(194); /** PURE_IMPORTS_START tslib,_AsyncAction,_AsyncScheduler PURE_IMPORTS_END */ var VirtualTimeScheduler = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](VirtualTimeScheduler, _super); function VirtualTimeScheduler(SchedulerAction, maxFrames) { if (SchedulerAction === void 0) { SchedulerAction = VirtualAction; } if (maxFrames === void 0) { maxFrames = Number.POSITIVE_INFINITY; } var _this = _super.call(this, SchedulerAction, function () { return _this.frame; }) || this; _this.maxFrames = maxFrames; _this.frame = 0; _this.index = -1; return _this; } VirtualTimeScheduler.prototype.flush = function () { var _a = this, actions = _a.actions, maxFrames = _a.maxFrames; var error, action; while ((action = actions.shift()) && (this.frame = action.delay) <= maxFrames) { if (error = action.execute(action.state, action.delay)) { break; } } if (error) { while (action = actions.shift()) { action.unsubscribe(); } throw error; } }; VirtualTimeScheduler.frameTimeFactor = 10; return VirtualTimeScheduler; }(_AsyncScheduler__WEBPACK_IMPORTED_MODULE_2__["AsyncScheduler"])); var VirtualAction = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](VirtualAction, _super); function VirtualAction(scheduler, work, index) { if (index === void 0) { index = scheduler.index += 1; } var _this = _super.call(this, scheduler, work) || this; _this.scheduler = scheduler; _this.work = work; _this.index = index; _this.active = true; _this.index = scheduler.index = index; return _this; } VirtualAction.prototype.schedule = function (state, delay) { if (delay === void 0) { delay = 0; } if (!this.id) { return _super.prototype.schedule.call(this, state, delay); } this.active = false; var action = new VirtualAction(this.scheduler, this.work); this.add(action); return action.schedule(state, delay); }; VirtualAction.prototype.requestAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } this.delay = scheduler.frame + delay; var actions = scheduler.actions; actions.push(this); actions.sort(VirtualAction.sortActions); return true; }; VirtualAction.prototype.recycleAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } return undefined; }; VirtualAction.prototype._execute = function (state, delay) { if (this.active === true) { return _super.prototype._execute.call(this, state, delay); } }; VirtualAction.sortActions = function (a, b) { if (a.delay === b.delay) { if (a.index === b.index) { return 0; } else if (a.index > b.index) { return 1; } else { return -1; } } else if (a.delay > b.delay) { return 1; } else { return -1; } }; return VirtualAction; }(_AsyncAction__WEBPACK_IMPORTED_MODULE_1__["AsyncAction"])); //# sourceMappingURL=VirtualTimeScheduler.js.map /***/ }), /* 215 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return identity; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function identity(x) { return x; } //# sourceMappingURL=identity.js.map /***/ }), /* 216 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return isObservable; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */ function isObservable(obj) { return !!obj && (obj instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"] || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function')); } //# sourceMappingURL=isObservable.js.map /***/ }), /* 217 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return ArgumentOutOfRangeError; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /** PURE_IMPORTS_START tslib PURE_IMPORTS_END */ var ArgumentOutOfRangeError = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ArgumentOutOfRangeError, _super); function ArgumentOutOfRangeError() { var _this = _super.call(this, 'argument out of range') || this; _this.name = 'ArgumentOutOfRangeError'; Object.setPrototypeOf(_this, ArgumentOutOfRangeError.prototype); return _this; } return ArgumentOutOfRangeError; }(Error)); //# sourceMappingURL=ArgumentOutOfRangeError.js.map /***/ }), /* 218 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return EmptyError; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /** PURE_IMPORTS_START tslib PURE_IMPORTS_END */ var EmptyError = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](EmptyError, _super); function EmptyError() { var _this = _super.call(this, 'no elements in sequence') || this; _this.name = 'EmptyError'; Object.setPrototypeOf(_this, EmptyError.prototype); return _this; } return EmptyError; }(Error)); //# sourceMappingURL=EmptyError.js.map /***/ }), /* 219 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return TimeoutError; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /** PURE_IMPORTS_START tslib PURE_IMPORTS_END */ var TimeoutError = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TimeoutError, _super); function TimeoutError() { var _this = _super.call(this, 'Timeout has occurred') || this; _this.name = 'TimeoutError'; Object.setPrototypeOf(_this, TimeoutError.prototype); return _this; } return TimeoutError; }(Error)); //# sourceMappingURL=TimeoutError.js.map /***/ }), /* 220 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return bindCallback; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(205); /* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(221); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(172); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(200); /** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_isArray,_util_isScheduler PURE_IMPORTS_END */ function bindCallback(callbackFunc, resultSelector, scheduler) { if (resultSelector) { if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(resultSelector)) { scheduler = resultSelector; } else { return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return bindCallback(callbackFunc, scheduler).apply(void 0, args).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_3__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); })); }; } } return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var context = this; var subject; var params = { context: context, subject: subject, callbackFunc: callbackFunc, scheduler: scheduler, }; return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { if (!scheduler) { if (!subject) { subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"](); var handler = function () { var innerArgs = []; for (var _i = 0; _i < arguments.length; _i++) { innerArgs[_i] = arguments[_i]; } subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs); subject.complete(); }; try { callbackFunc.apply(context, args.concat([handler])); } catch (err) { subject.error(err); } } return subject.subscribe(subscriber); } else { var state = { args: args, subscriber: subscriber, params: params, }; return scheduler.schedule(dispatch, 0, state); } }); }; } function dispatch(state) { var _this = this; var self = this; var args = state.args, subscriber = state.subscriber, params = state.params; var callbackFunc = params.callbackFunc, context = params.context, scheduler = params.scheduler; var subject = params.subject; if (!subject) { subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"](); var handler = function () { var innerArgs = []; for (var _i = 0; _i < arguments.length; _i++) { innerArgs[_i] = arguments[_i]; } var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs; _this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject })); }; try { callbackFunc.apply(context, args.concat([handler])); } catch (err) { subject.error(err); } } this.add(subject.subscribe(subscriber)); } function dispatchNext(state) { var value = state.value, subject = state.subject; subject.next(value); subject.complete(); } function dispatchError(state) { var err = state.err, subject = state.subject; subject.error(err); } //# sourceMappingURL=bindCallback.js.map /***/ }), /* 221 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return map; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MapOperator", function() { return MapOperator; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function map(project, thisArg) { return function mapOperation(source) { if (typeof project !== 'function') { throw new TypeError('argument is not a function. Are you looking for `mapTo()`?'); } return source.lift(new MapOperator(project, thisArg)); }; } var MapOperator = /*@__PURE__*/ (function () { function MapOperator(project, thisArg) { this.project = project; this.thisArg = thisArg; } MapOperator.prototype.call = function (subscriber, source) { return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg)); }; return MapOperator; }()); var MapSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MapSubscriber, _super); function MapSubscriber(destination, project, thisArg) { var _this = _super.call(this, destination) || this; _this.project = project; _this.count = 0; _this.thisArg = thisArg || _this; return _this; } MapSubscriber.prototype._next = function (value) { var result; try { result = this.project.call(this.thisArg, value, this.count++); } catch (err) { this.destination.error(err); return; } this.destination.next(result); }; return MapSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=map.js.map /***/ }), /* 222 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return bindNodeCallback; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(205); /* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(221); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(200); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(172); /** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_isScheduler,_util_isArray PURE_IMPORTS_END */ function bindNodeCallback(callbackFunc, resultSelector, scheduler) { if (resultSelector) { if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(resultSelector)) { scheduler = resultSelector; } else { return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return bindNodeCallback(callbackFunc, scheduler).apply(void 0, args).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_2__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_4__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); })); }; } } return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var params = { subject: undefined, args: args, callbackFunc: callbackFunc, scheduler: scheduler, context: this, }; return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var context = params.context; var subject = params.subject; if (!scheduler) { if (!subject) { subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"](); var handler = function () { var innerArgs = []; for (var _i = 0; _i < arguments.length; _i++) { innerArgs[_i] = arguments[_i]; } var err = innerArgs.shift(); if (err) { subject.error(err); return; } subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs); subject.complete(); }; try { callbackFunc.apply(context, args.concat([handler])); } catch (err) { subject.error(err); } } return subject.subscribe(subscriber); } else { return scheduler.schedule(dispatch, 0, { params: params, subscriber: subscriber, context: context }); } }); }; } function dispatch(state) { var _this = this; var params = state.params, subscriber = state.subscriber, context = state.context; var callbackFunc = params.callbackFunc, args = params.args, scheduler = params.scheduler; var subject = params.subject; if (!subject) { subject = params.subject = new _AsyncSubject__WEBPACK_IMPORTED_MODULE_1__["AsyncSubject"](); var handler = function () { var innerArgs = []; for (var _i = 0; _i < arguments.length; _i++) { innerArgs[_i] = arguments[_i]; } var err = innerArgs.shift(); if (err) { _this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject })); } else { var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs; _this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject })); } }; try { callbackFunc.apply(context, args.concat([handler])); } catch (err) { this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject })); } } this.add(subject.subscribe(subscriber)); } function dispatchNext(arg) { var value = arg.value, subject = arg.subject; subject.next(value); subject.complete(); } function dispatchError(arg) { var err = arg.err, subject = arg.subject; subject.error(err); } //# sourceMappingURL=bindNodeCallback.js.map /***/ }), /* 223 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CombineLatestOperator", function() { return CombineLatestOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CombineLatestSubscriber", function() { return CombineLatestSubscriber; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(172); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(225); /* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(201); /** PURE_IMPORTS_START tslib,_util_isScheduler,_util_isArray,_OuterSubscriber,_util_subscribeToResult,_fromArray PURE_IMPORTS_END */ var NONE = {}; function combineLatest() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i] = arguments[_i]; } var resultSelector = null; var scheduler = null; if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(observables[observables.length - 1])) { scheduler = observables.pop(); } if (typeof observables[observables.length - 1] === 'function') { resultSelector = observables.pop(); } if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(observables[0])) { observables = observables[0]; } return Object(_fromArray__WEBPACK_IMPORTED_MODULE_5__["fromArray"])(observables, scheduler).lift(new CombineLatestOperator(resultSelector)); } var CombineLatestOperator = /*@__PURE__*/ (function () { function CombineLatestOperator(resultSelector) { this.resultSelector = resultSelector; } CombineLatestOperator.prototype.call = function (subscriber, source) { return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector)); }; return CombineLatestOperator; }()); var CombineLatestSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CombineLatestSubscriber, _super); function CombineLatestSubscriber(destination, resultSelector) { var _this = _super.call(this, destination) || this; _this.resultSelector = resultSelector; _this.active = 0; _this.values = []; _this.observables = []; return _this; } CombineLatestSubscriber.prototype._next = function (observable) { this.values.push(NONE); this.observables.push(observable); }; CombineLatestSubscriber.prototype._complete = function () { var observables = this.observables; var len = observables.length; if (len === 0) { this.destination.complete(); } else { this.active = len; this.toRespond = len; for (var i = 0; i < len; i++) { var observable = observables[i]; this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, observable, observable, i)); } } }; CombineLatestSubscriber.prototype.notifyComplete = function (unused) { if ((this.active -= 1) === 0) { this.destination.complete(); } }; CombineLatestSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { var values = this.values; var oldVal = values[outerIndex]; var toRespond = !this.toRespond ? 0 : oldVal === NONE ? --this.toRespond : this.toRespond; values[outerIndex] = innerValue; if (toRespond === 0) { if (this.resultSelector) { this._tryResultSelector(values); } else { this.destination.next(values.slice()); } } }; CombineLatestSubscriber.prototype._tryResultSelector = function (values) { var result; try { result = this.resultSelector.apply(this, values); } catch (err) { this.destination.error(err); return; } this.destination.next(result); }; return CombineLatestSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"])); //# sourceMappingURL=combineLatest.js.map /***/ }), /* 224 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OuterSubscriber", function() { return OuterSubscriber; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ var OuterSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](OuterSubscriber, _super); function OuterSubscriber() { return _super !== null && _super.apply(this, arguments) || this; } OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.destination.next(innerValue); }; OuterSubscriber.prototype.notifyError = function (error, innerSub) { this.destination.error(error); }; OuterSubscriber.prototype.notifyComplete = function (innerSub) { this.destination.complete(); }; return OuterSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=OuterSubscriber.js.map /***/ }), /* 225 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToResult", function() { return subscribeToResult; }); /* harmony import */ var _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(226); /* harmony import */ var _subscribeTo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(227); /** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo PURE_IMPORTS_END */ function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) { var destination = new _InnerSubscriber__WEBPACK_IMPORTED_MODULE_0__["InnerSubscriber"](outerSubscriber, outerValue, outerIndex); return Object(_subscribeTo__WEBPACK_IMPORTED_MODULE_1__["subscribeTo"])(result)(destination); } //# sourceMappingURL=subscribeToResult.js.map /***/ }), /* 226 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InnerSubscriber", function() { return InnerSubscriber; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ var InnerSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](InnerSubscriber, _super); function InnerSubscriber(parent, outerValue, outerIndex) { var _this = _super.call(this) || this; _this.parent = parent; _this.outerValue = outerValue; _this.outerIndex = outerIndex; _this.index = 0; return _this; } InnerSubscriber.prototype._next = function (value) { this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this); }; InnerSubscriber.prototype._error = function (error) { this.parent.notifyError(error, this); this.unsubscribe(); }; InnerSubscriber.prototype._complete = function () { this.parent.notifyComplete(this); this.unsubscribe(); }; return InnerSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=InnerSubscriber.js.map /***/ }), /* 227 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeTo", function() { return subscribeTo; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _subscribeToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(202); /* harmony import */ var _subscribeToPromise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228); /* harmony import */ var _subscribeToIterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(229); /* harmony import */ var _subscribeToObservable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(231); /* harmony import */ var _isArrayLike__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(232); /* harmony import */ var _isPromise__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(233); /* harmony import */ var _isObject__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(173); /* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(230); /* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(178); /** PURE_IMPORTS_START _Observable,_subscribeToArray,_subscribeToPromise,_subscribeToIterable,_subscribeToObservable,_isArrayLike,_isPromise,_isObject,_symbol_iterator,_symbol_observable PURE_IMPORTS_END */ var subscribeTo = function (result) { if (result instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) { return function (subscriber) { if (result._isScalar) { subscriber.next(result.value); subscriber.complete(); return undefined; } else { return result.subscribe(subscriber); } }; } else if (result && typeof result[_symbol_observable__WEBPACK_IMPORTED_MODULE_9__["observable"]] === 'function') { return Object(_subscribeToObservable__WEBPACK_IMPORTED_MODULE_4__["subscribeToObservable"])(result); } else if (Object(_isArrayLike__WEBPACK_IMPORTED_MODULE_5__["isArrayLike"])(result)) { return Object(_subscribeToArray__WEBPACK_IMPORTED_MODULE_1__["subscribeToArray"])(result); } else if (Object(_isPromise__WEBPACK_IMPORTED_MODULE_6__["isPromise"])(result)) { return Object(_subscribeToPromise__WEBPACK_IMPORTED_MODULE_2__["subscribeToPromise"])(result); } else if (result && typeof result[_symbol_iterator__WEBPACK_IMPORTED_MODULE_8__["iterator"]] === 'function') { return Object(_subscribeToIterable__WEBPACK_IMPORTED_MODULE_3__["subscribeToIterable"])(result); } else { var value = Object(_isObject__WEBPACK_IMPORTED_MODULE_7__["isObject"])(result) ? 'an invalid object' : "'" + result + "'"; var msg = "You provided " + value + " where a stream was expected." + ' You can provide an Observable, Promise, Array, or Iterable.'; throw new TypeError(msg); } }; //# sourceMappingURL=subscribeTo.js.map /***/ }), /* 228 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToPromise", function() { return subscribeToPromise; }); /* harmony import */ var _hostReportError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170); /** PURE_IMPORTS_START _hostReportError PURE_IMPORTS_END */ var subscribeToPromise = function (promise) { return function (subscriber) { promise.then(function (value) { if (!subscriber.closed) { subscriber.next(value); subscriber.complete(); } }, function (err) { return subscriber.error(err); }) .then(null, _hostReportError__WEBPACK_IMPORTED_MODULE_0__["hostReportError"]); return subscriber; }; }; //# sourceMappingURL=subscribeToPromise.js.map /***/ }), /* 229 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToIterable", function() { return subscribeToIterable; }); /* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(230); /** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */ var subscribeToIterable = function (iterable) { return function (subscriber) { var iterator = iterable[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__["iterator"]](); do { var item = iterator.next(); if (item.done) { subscriber.complete(); break; } subscriber.next(item.value); if (subscriber.closed) { break; } } while (true); if (typeof iterator.return === 'function') { subscriber.add(function () { if (iterator.return) { iterator.return(); } }); } return subscriber; }; }; //# sourceMappingURL=subscribeToIterable.js.map /***/ }), /* 230 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSymbolIterator", function() { return getSymbolIterator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iterator", function() { return iterator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "$$iterator", function() { return $$iterator; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function getSymbolIterator() { if (typeof Symbol !== 'function' || !Symbol.iterator) { return '@@iterator'; } return Symbol.iterator; } var iterator = /*@__PURE__*/ getSymbolIterator(); var $$iterator = iterator; //# sourceMappingURL=iterator.js.map /***/ }), /* 231 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeToObservable", function() { return subscribeToObservable; }); /* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(178); /** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */ var subscribeToObservable = function (obj) { return function (subscriber) { var obs = obj[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__["observable"]](); if (typeof obs.subscribe !== 'function') { throw new TypeError('Provided object does not correctly implement Symbol.observable'); } else { return obs.subscribe(subscriber); } }; }; //# sourceMappingURL=subscribeToObservable.js.map /***/ }), /* 232 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayLike", function() { return isArrayLike; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; }); //# sourceMappingURL=isArrayLike.js.map /***/ }), /* 233 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromise", function() { return isPromise; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function isPromise(value) { return value && typeof value.subscribe !== 'function' && typeof value.then === 'function'; } //# sourceMappingURL=isPromise.js.map /***/ }), /* 234 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; }); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(200); /* harmony import */ var _of__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(199); /* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(235); /* harmony import */ var _operators_concatAll__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(241); /** PURE_IMPORTS_START _util_isScheduler,_of,_from,_operators_concatAll PURE_IMPORTS_END */ function concat() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i] = arguments[_i]; } if (observables.length === 1 || (observables.length === 2 && Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_0__["isScheduler"])(observables[1]))) { return Object(_from__WEBPACK_IMPORTED_MODULE_2__["from"])(observables[0]); } return Object(_operators_concatAll__WEBPACK_IMPORTED_MODULE_3__["concatAll"])()(_of__WEBPACK_IMPORTED_MODULE_1__["of"].apply(void 0, observables)); } //# sourceMappingURL=concat.js.map /***/ }), /* 235 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "from", function() { return from; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _util_isPromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(233); /* harmony import */ var _util_isArrayLike__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(232); /* harmony import */ var _util_isInteropObservable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(236); /* harmony import */ var _util_isIterable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(237); /* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(201); /* harmony import */ var _fromPromise__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(238); /* harmony import */ var _fromIterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(239); /* harmony import */ var _fromObservable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(240); /* harmony import */ var _util_subscribeTo__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(227); /** PURE_IMPORTS_START _Observable,_util_isPromise,_util_isArrayLike,_util_isInteropObservable,_util_isIterable,_fromArray,_fromPromise,_fromIterable,_fromObservable,_util_subscribeTo PURE_IMPORTS_END */ function from(input, scheduler) { if (!scheduler) { if (input instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) { return input; } return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeTo__WEBPACK_IMPORTED_MODULE_9__["subscribeTo"])(input)); } if (input != null) { if (Object(_util_isInteropObservable__WEBPACK_IMPORTED_MODULE_3__["isInteropObservable"])(input)) { return Object(_fromObservable__WEBPACK_IMPORTED_MODULE_8__["fromObservable"])(input, scheduler); } else if (Object(_util_isPromise__WEBPACK_IMPORTED_MODULE_1__["isPromise"])(input)) { return Object(_fromPromise__WEBPACK_IMPORTED_MODULE_6__["fromPromise"])(input, scheduler); } else if (Object(_util_isArrayLike__WEBPACK_IMPORTED_MODULE_2__["isArrayLike"])(input)) { return Object(_fromArray__WEBPACK_IMPORTED_MODULE_5__["fromArray"])(input, scheduler); } else if (Object(_util_isIterable__WEBPACK_IMPORTED_MODULE_4__["isIterable"])(input) || typeof input === 'string') { return Object(_fromIterable__WEBPACK_IMPORTED_MODULE_7__["fromIterable"])(input, scheduler); } } throw new TypeError((input !== null && typeof input || input) + ' is not observable'); } //# sourceMappingURL=from.js.map /***/ }), /* 236 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInteropObservable", function() { return isInteropObservable; }); /* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(178); /** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */ function isInteropObservable(input) { return input && typeof input[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__["observable"]] === 'function'; } //# sourceMappingURL=isInteropObservable.js.map /***/ }), /* 237 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIterable", function() { return isIterable; }); /* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(230); /** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */ function isIterable(input) { return input && typeof input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__["iterator"]] === 'function'; } //# sourceMappingURL=isIterable.js.map /***/ }), /* 238 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromPromise", function() { return fromPromise; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); /* harmony import */ var _util_subscribeToPromise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(228); /** PURE_IMPORTS_START _Observable,_Subscription,_util_subscribeToPromise PURE_IMPORTS_END */ function fromPromise(input, scheduler) { if (!scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeToPromise__WEBPACK_IMPORTED_MODULE_2__["subscribeToPromise"])(input)); } else { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); sub.add(scheduler.schedule(function () { return input.then(function (value) { sub.add(scheduler.schedule(function () { subscriber.next(value); sub.add(scheduler.schedule(function () { return subscriber.complete(); })); })); }, function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); }); })); return sub; }); } } //# sourceMappingURL=fromPromise.js.map /***/ }), /* 239 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromIterable", function() { return fromIterable; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); /* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(230); /* harmony import */ var _util_subscribeToIterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(229); /** PURE_IMPORTS_START _Observable,_Subscription,_symbol_iterator,_util_subscribeToIterable PURE_IMPORTS_END */ function fromIterable(input, scheduler) { if (!input) { throw new Error('Iterable cannot be null'); } if (!scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeToIterable__WEBPACK_IMPORTED_MODULE_3__["subscribeToIterable"])(input)); } else { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); var iterator; sub.add(function () { if (iterator && typeof iterator.return === 'function') { iterator.return(); } }); sub.add(scheduler.schedule(function () { iterator = input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_2__["iterator"]](); sub.add(scheduler.schedule(function () { if (subscriber.closed) { return; } var value; var done; try { var result = iterator.next(); value = result.value; done = result.done; } catch (err) { subscriber.error(err); return; } if (done) { subscriber.complete(); } else { subscriber.next(value); this.schedule(); } })); })); return sub; }); } } //# sourceMappingURL=fromIterable.js.map /***/ }), /* 240 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromObservable", function() { return fromObservable; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); /* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(178); /* harmony import */ var _util_subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(231); /** PURE_IMPORTS_START _Observable,_Subscription,_symbol_observable,_util_subscribeToObservable PURE_IMPORTS_END */ function fromObservable(input, scheduler) { if (!scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](Object(_util_subscribeToObservable__WEBPACK_IMPORTED_MODULE_3__["subscribeToObservable"])(input)); } else { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var sub = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); sub.add(scheduler.schedule(function () { var observable = input[_symbol_observable__WEBPACK_IMPORTED_MODULE_2__["observable"]](); sub.add(observable.subscribe({ next: function (value) { sub.add(scheduler.schedule(function () { return subscriber.next(value); })); }, error: function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); }, complete: function () { sub.add(scheduler.schedule(function () { return subscriber.complete(); })); }, })); })); return sub; }); } } //# sourceMappingURL=fromObservable.js.map /***/ }), /* 241 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return concatAll; }); /* harmony import */ var _mergeAll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(242); /** PURE_IMPORTS_START _mergeAll PURE_IMPORTS_END */ function concatAll() { return Object(_mergeAll__WEBPACK_IMPORTED_MODULE_0__["mergeAll"])(1); } //# sourceMappingURL=concatAll.js.map /***/ }), /* 242 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return mergeAll; }); /* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(243); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(215); /** PURE_IMPORTS_START _mergeMap,_util_identity PURE_IMPORTS_END */ function mergeAll(concurrent) { if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(_util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"], concurrent); } //# sourceMappingURL=mergeAll.js.map /***/ }), /* 243 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return mergeMap; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeMapOperator", function() { return MergeMapOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeMapSubscriber", function() { return MergeMapSubscriber; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(225); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(224); /* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(221); /* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(235); /** PURE_IMPORTS_START tslib,_util_subscribeToResult,_OuterSubscriber,_map,_observable_from PURE_IMPORTS_END */ function mergeMap(project, resultSelector, concurrent) { if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } if (typeof resultSelector === 'function') { return function (source) { return source.pipe(mergeMap(function (a, i) { return Object(_observable_from__WEBPACK_IMPORTED_MODULE_4__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (b, ii) { return resultSelector(a, b, i, ii); })); }, concurrent)); }; } else if (typeof resultSelector === 'number') { concurrent = resultSelector; } return function (source) { return source.lift(new MergeMapOperator(project, concurrent)); }; } var MergeMapOperator = /*@__PURE__*/ (function () { function MergeMapOperator(project, concurrent) { if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } this.project = project; this.concurrent = concurrent; } MergeMapOperator.prototype.call = function (observer, source) { return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent)); }; return MergeMapOperator; }()); var MergeMapSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MergeMapSubscriber, _super); function MergeMapSubscriber(destination, project, concurrent) { if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } var _this = _super.call(this, destination) || this; _this.project = project; _this.concurrent = concurrent; _this.hasCompleted = false; _this.buffer = []; _this.active = 0; _this.index = 0; return _this; } MergeMapSubscriber.prototype._next = function (value) { if (this.active < this.concurrent) { this._tryNext(value); } else { this.buffer.push(value); } }; MergeMapSubscriber.prototype._tryNext = function (value) { var result; var index = this.index++; try { result = this.project(value, index); } catch (err) { this.destination.error(err); return; } this.active++; this._innerSub(result, value, index); }; MergeMapSubscriber.prototype._innerSub = function (ish, value, index) { this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_1__["subscribeToResult"])(this, ish, value, index)); }; MergeMapSubscriber.prototype._complete = function () { this.hasCompleted = true; if (this.active === 0 && this.buffer.length === 0) { this.destination.complete(); } }; MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.destination.next(innerValue); }; MergeMapSubscriber.prototype.notifyComplete = function (innerSub) { var buffer = this.buffer; this.remove(innerSub); this.active--; if (buffer.length > 0) { this._next(buffer.shift()); } else if (this.active === 0 && this.hasCompleted) { this.destination.complete(); } }; return MergeMapSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"])); //# sourceMappingURL=mergeMap.js.map /***/ }), /* 244 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return defer; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(235); /* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(198); /** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */ function defer(observableFactory) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var input; try { input = observableFactory(); } catch (err) { subscriber.error(err); return undefined; } var source = input ? Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(input) : Object(_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])(); return source.subscribe(subscriber); }); } //# sourceMappingURL=defer.js.map /***/ }), /* 245 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return forkJoin; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(163); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(172); /* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(198); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(225); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(224); /* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(221); /** PURE_IMPORTS_START tslib,_Observable,_util_isArray,_empty,_util_subscribeToResult,_OuterSubscriber,_operators_map PURE_IMPORTS_END */ function forkJoin() { var sources = []; for (var _i = 0; _i < arguments.length; _i++) { sources[_i] = arguments[_i]; } var resultSelector; if (typeof sources[sources.length - 1] === 'function') { resultSelector = sources.pop(); } if (sources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(sources[0])) { sources = sources[0]; } if (sources.length === 0) { return _empty__WEBPACK_IMPORTED_MODULE_3__["EMPTY"]; } if (resultSelector) { return forkJoin(sources).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_6__["map"])(function (args) { return resultSelector.apply(void 0, args); })); } return new _Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"](function (subscriber) { return new ForkJoinSubscriber(subscriber, sources); }); } var ForkJoinSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ForkJoinSubscriber, _super); function ForkJoinSubscriber(destination, sources) { var _this = _super.call(this, destination) || this; _this.sources = sources; _this.completed = 0; _this.haveValues = 0; var len = sources.length; _this.values = new Array(len); for (var i = 0; i < len; i++) { var source = sources[i]; var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(_this, source, null, i); if (innerSubscription) { _this.add(innerSubscription); } } return _this; } ForkJoinSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.values[outerIndex] = innerValue; if (!innerSub._hasValue) { innerSub._hasValue = true; this.haveValues++; } }; ForkJoinSubscriber.prototype.notifyComplete = function (innerSub) { var _a = this, destination = _a.destination, haveValues = _a.haveValues, values = _a.values; var len = values.length; if (!innerSub._hasValue) { destination.complete(); return; } this.completed++; if (this.completed !== len) { return; } if (haveValues === len) { destination.next(values); } destination.complete(); }; return ForkJoinSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_5__["OuterSubscriber"])); //# sourceMappingURL=forkJoin.js.map /***/ }), /* 246 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return fromEvent; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(172); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(167); /* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(221); /** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */ var toString = Object.prototype.toString; function fromEvent(target, eventName, options, resultSelector) { if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(options)) { resultSelector = options; options = undefined; } if (resultSelector) { return fromEvent(target, eventName, options).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); })); } return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { function handler(e) { if (arguments.length > 1) { subscriber.next(Array.prototype.slice.call(arguments)); } else { subscriber.next(e); } } setupSubscription(target, eventName, handler, subscriber, options); }); } function setupSubscription(sourceObj, eventName, handler, subscriber, options) { var unsubscribe; if (isEventTarget(sourceObj)) { var source_1 = sourceObj; sourceObj.addEventListener(eventName, handler, options); unsubscribe = function () { return source_1.removeEventListener(eventName, handler, options); }; } else if (isJQueryStyleEventEmitter(sourceObj)) { var source_2 = sourceObj; sourceObj.on(eventName, handler); unsubscribe = function () { return source_2.off(eventName, handler); }; } else if (isNodeStyleEventEmitter(sourceObj)) { var source_3 = sourceObj; sourceObj.addListener(eventName, handler); unsubscribe = function () { return source_3.removeListener(eventName, handler); }; } else if (sourceObj && sourceObj.length) { for (var i = 0, len = sourceObj.length; i < len; i++) { setupSubscription(sourceObj[i], eventName, handler, subscriber, options); } } else { throw new TypeError('Invalid event target'); } subscriber.add(unsubscribe); } function isNodeStyleEventEmitter(sourceObj) { return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function'; } function isJQueryStyleEventEmitter(sourceObj) { return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function'; } function isEventTarget(sourceObj) { return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function'; } //# sourceMappingURL=fromEvent.js.map /***/ }), /* 247 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return fromEventPattern; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(172); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(167); /* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(221); /** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */ function fromEventPattern(addHandler, removeHandler, resultSelector) { if (resultSelector) { return fromEventPattern(addHandler, removeHandler).pipe(Object(_operators_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (args) { return Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); })); } return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var handler = function () { var e = []; for (var _i = 0; _i < arguments.length; _i++) { e[_i] = arguments[_i]; } return subscriber.next(e.length === 1 ? e[0] : e); }; var retValue; try { retValue = addHandler(handler); } catch (err) { subscriber.error(err); return undefined; } if (!Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_2__["isFunction"])(removeHandler)) { return undefined; } return function () { return removeHandler(handler, retValue); }; }); } //# sourceMappingURL=fromEventPattern.js.map /***/ }), /* 248 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return generate; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(215); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(200); /** PURE_IMPORTS_START _Observable,_util_identity,_util_isScheduler PURE_IMPORTS_END */ function generate(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) { var resultSelector; var initialState; if (arguments.length == 1) { var options = initialStateOrOptions; initialState = options.initialState; condition = options.condition; iterate = options.iterate; resultSelector = options.resultSelector || _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"]; scheduler = options.scheduler; } else if (resultSelectorOrObservable === undefined || Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_2__["isScheduler"])(resultSelectorOrObservable)) { initialState = initialStateOrOptions; resultSelector = _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"]; scheduler = resultSelectorOrObservable; } else { initialState = initialStateOrOptions; resultSelector = resultSelectorOrObservable; } return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var state = initialState; if (scheduler) { return scheduler.schedule(dispatch, 0, { subscriber: subscriber, iterate: iterate, condition: condition, resultSelector: resultSelector, state: state }); } do { if (condition) { var conditionResult = void 0; try { conditionResult = condition(state); } catch (err) { subscriber.error(err); return undefined; } if (!conditionResult) { subscriber.complete(); break; } } var value = void 0; try { value = resultSelector(state); } catch (err) { subscriber.error(err); return undefined; } subscriber.next(value); if (subscriber.closed) { break; } try { state = iterate(state); } catch (err) { subscriber.error(err); return undefined; } } while (true); return undefined; }); } function dispatch(state) { var subscriber = state.subscriber, condition = state.condition; if (subscriber.closed) { return undefined; } if (state.needIterate) { try { state.state = state.iterate(state.state); } catch (err) { subscriber.error(err); return undefined; } } else { state.needIterate = true; } if (condition) { var conditionResult = void 0; try { conditionResult = condition(state.state); } catch (err) { subscriber.error(err); return undefined; } if (!conditionResult) { subscriber.complete(); return undefined; } if (subscriber.closed) { return undefined; } } var value; try { value = state.resultSelector(state.state); } catch (err) { subscriber.error(err); return undefined; } if (subscriber.closed) { return undefined; } subscriber.next(value); if (subscriber.closed) { return undefined; } return this.schedule(state); } //# sourceMappingURL=generate.js.map /***/ }), /* 249 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return iif; }); /* harmony import */ var _defer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(244); /* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(198); /** PURE_IMPORTS_START _defer,_empty PURE_IMPORTS_END */ function iif(condition, trueResult, falseResult) { if (trueResult === void 0) { trueResult = _empty__WEBPACK_IMPORTED_MODULE_1__["EMPTY"]; } if (falseResult === void 0) { falseResult = _empty__WEBPACK_IMPORTED_MODULE_1__["EMPTY"]; } return Object(_defer__WEBPACK_IMPORTED_MODULE_0__["defer"])(function () { return condition() ? trueResult : falseResult; }); } //# sourceMappingURL=iif.js.map /***/ }), /* 250 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return interval; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(210); /* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(251); /** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric PURE_IMPORTS_END */ function interval(period, scheduler) { if (period === void 0) { period = 0; } if (scheduler === void 0) { scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]; } if (!Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(period) || period < 0) { period = 0; } if (!scheduler || typeof scheduler.schedule !== 'function') { scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]; } return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { subscriber.add(scheduler.schedule(dispatch, period, { subscriber: subscriber, counter: 0, period: period })); return subscriber; }); } function dispatch(state) { var subscriber = state.subscriber, counter = state.counter, period = state.period; subscriber.next(counter); this.schedule({ subscriber: subscriber, counter: counter + 1, period: period }, period); } //# sourceMappingURL=interval.js.map /***/ }), /* 251 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumeric", function() { return isNumeric; }); /* harmony import */ var _isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(172); /** PURE_IMPORTS_START _isArray PURE_IMPORTS_END */ function isNumeric(val) { return !Object(_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(val) && (val - parseFloat(val) + 1) >= 0; } //# sourceMappingURL=isNumeric.js.map /***/ }), /* 252 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(200); /* harmony import */ var _operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(242); /* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(201); /** PURE_IMPORTS_START _Observable,_util_isScheduler,_operators_mergeAll,_fromArray PURE_IMPORTS_END */ function merge() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i] = arguments[_i]; } var concurrent = Number.POSITIVE_INFINITY; var scheduler = null; var last = observables[observables.length - 1]; if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_1__["isScheduler"])(last)) { scheduler = observables.pop(); if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') { concurrent = observables.pop(); } } else if (typeof last === 'number') { concurrent = observables.pop(); } if (scheduler === null && observables.length === 1 && observables[0] instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"]) { return observables[0]; } return Object(_operators_mergeAll__WEBPACK_IMPORTED_MODULE_2__["mergeAll"])(concurrent)(Object(_fromArray__WEBPACK_IMPORTED_MODULE_3__["fromArray"])(observables, scheduler)); } //# sourceMappingURL=merge.js.map /***/ }), /* 253 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return NEVER; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "never", function() { return never; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(180); /** PURE_IMPORTS_START _Observable,_util_noop PURE_IMPORTS_END */ var NEVER = /*@__PURE__*/ new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](_util_noop__WEBPACK_IMPORTED_MODULE_1__["noop"]); function never() { return NEVER; } //# sourceMappingURL=never.js.map /***/ }), /* 254 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(235); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(172); /* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(198); /** PURE_IMPORTS_START _Observable,_from,_util_isArray,_empty PURE_IMPORTS_END */ function onErrorResumeNext() { var sources = []; for (var _i = 0; _i < arguments.length; _i++) { sources[_i] = arguments[_i]; } if (sources.length === 0) { return _empty__WEBPACK_IMPORTED_MODULE_3__["EMPTY"]; } var first = sources[0], remainder = sources.slice(1); if (sources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(first)) { return onErrorResumeNext.apply(void 0, first); } return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var subNext = function () { return subscriber.add(onErrorResumeNext.apply(void 0, remainder).subscribe(subscriber)); }; return Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(first).subscribe({ next: function (value) { subscriber.next(value); }, error: subNext, complete: subNext, }); }); } //# sourceMappingURL=onErrorResumeNext.js.map /***/ }), /* 255 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return pairs; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dispatch; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); /** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */ function pairs(obj, scheduler) { if (!scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var keys = Object.keys(obj); for (var i = 0; i < keys.length && !subscriber.closed; i++) { var key = keys[i]; if (obj.hasOwnProperty(key)) { subscriber.next([key, obj[key]]); } } subscriber.complete(); }); } else { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var keys = Object.keys(obj); var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); subscription.add(scheduler.schedule(dispatch, 0, { keys: keys, index: 0, subscriber: subscriber, subscription: subscription, obj: obj })); return subscription; }); } } function dispatch(state) { var keys = state.keys, index = state.index, subscriber = state.subscriber, subscription = state.subscription, obj = state.obj; if (!subscriber.closed) { if (index < keys.length) { var key = keys[index]; subscriber.next([key, obj[key]]); subscription.add(this.schedule({ keys: keys, index: index + 1, subscriber: subscriber, subscription: subscription, obj: obj })); } else { subscriber.complete(); } } } //# sourceMappingURL=pairs.js.map /***/ }), /* 256 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return race; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RaceOperator", function() { return RaceOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RaceSubscriber", function() { return RaceSubscriber; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(172); /* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(201); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_util_isArray,_fromArray,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function race() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i] = arguments[_i]; } if (observables.length === 1) { if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_1__["isArray"])(observables[0])) { observables = observables[0]; } else { return observables[0]; } } return Object(_fromArray__WEBPACK_IMPORTED_MODULE_2__["fromArray"])(observables, undefined).lift(new RaceOperator()); } var RaceOperator = /*@__PURE__*/ (function () { function RaceOperator() { } RaceOperator.prototype.call = function (subscriber, source) { return source.subscribe(new RaceSubscriber(subscriber)); }; return RaceOperator; }()); var RaceSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RaceSubscriber, _super); function RaceSubscriber(destination) { var _this = _super.call(this, destination) || this; _this.hasFirst = false; _this.observables = []; _this.subscriptions = []; return _this; } RaceSubscriber.prototype._next = function (observable) { this.observables.push(observable); }; RaceSubscriber.prototype._complete = function () { var observables = this.observables; var len = observables.length; if (len === 0) { this.destination.complete(); } else { for (var i = 0; i < len && !this.hasFirst; i++) { var observable = observables[i]; var subscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, observable, observable, i); if (this.subscriptions) { this.subscriptions.push(subscription); } this.add(subscription); } this.observables = null; } }; RaceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { if (!this.hasFirst) { this.hasFirst = true; for (var i = 0; i < this.subscriptions.length; i++) { if (i !== outerIndex) { var subscription = this.subscriptions[i]; subscription.unsubscribe(); this.remove(subscription); } } this.subscriptions = null; } this.destination.next(innerValue); }; return RaceSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"])); //# sourceMappingURL=race.js.map /***/ }), /* 257 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return dispatch; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */ function range(start, count, scheduler) { if (start === void 0) { start = 0; } if (count === void 0) { count = 0; } return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var index = 0; var current = start; if (scheduler) { return scheduler.schedule(dispatch, 0, { index: index, count: count, start: start, subscriber: subscriber }); } else { do { if (index++ >= count) { subscriber.complete(); break; } subscriber.next(current++); if (subscriber.closed) { break; } } while (true); } return undefined; }); } function dispatch(state) { var start = state.start, index = state.index, count = state.count, subscriber = state.subscriber; if (index >= count) { subscriber.complete(); return; } subscriber.next(start); if (subscriber.closed) { return; } state.index = index + 1; state.start = start + 1; this.schedule(state); } //# sourceMappingURL=range.js.map /***/ }), /* 258 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return timer; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(210); /* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(251); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(200); /** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */ function timer(dueTime, periodOrScheduler, scheduler) { if (dueTime === void 0) { dueTime = 0; } var period = -1; if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(periodOrScheduler)) { period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler); } else if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(periodOrScheduler)) { scheduler = periodOrScheduler; } if (!Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(scheduler)) { scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]; } return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var due = Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_2__["isNumeric"])(dueTime) ? dueTime : (+dueTime - scheduler.now()); return scheduler.schedule(dispatch, due, { index: 0, period: period, subscriber: subscriber }); }); } function dispatch(state) { var index = state.index, period = state.period, subscriber = state.subscriber; subscriber.next(index); if (subscriber.closed) { return; } else if (period === -1) { return subscriber.complete(); } state.index = index + 1; this.schedule(state, period); } //# sourceMappingURL=timer.js.map /***/ }), /* 259 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "using", function() { return using; }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(163); /* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(235); /* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(198); /** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */ function using(resourceFactory, observableFactory) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) { var resource; try { resource = resourceFactory(); } catch (err) { subscriber.error(err); return undefined; } var result; try { result = observableFactory(resource); } catch (err) { subscriber.error(err); return undefined; } var source = result ? Object(_from__WEBPACK_IMPORTED_MODULE_1__["from"])(result) : _empty__WEBPACK_IMPORTED_MODULE_2__["EMPTY"]; var subscription = source.subscribe(subscriber); return function () { subscription.unsubscribe(); if (resource) { resource.unsubscribe(); } }; }); } //# sourceMappingURL=using.js.map /***/ }), /* 260 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZipOperator", function() { return ZipOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ZipSubscriber", function() { return ZipSubscriber; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _fromArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(201); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(172); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(165); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(225); /* harmony import */ var _internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(230); /** PURE_IMPORTS_START tslib,_fromArray,_util_isArray,_Subscriber,_OuterSubscriber,_util_subscribeToResult,_.._internal_symbol_iterator PURE_IMPORTS_END */ function zip() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i] = arguments[_i]; } var resultSelector = observables[observables.length - 1]; if (typeof resultSelector === 'function') { observables.pop(); } return Object(_fromArray__WEBPACK_IMPORTED_MODULE_1__["fromArray"])(observables, undefined).lift(new ZipOperator(resultSelector)); } var ZipOperator = /*@__PURE__*/ (function () { function ZipOperator(resultSelector) { this.resultSelector = resultSelector; } ZipOperator.prototype.call = function (subscriber, source) { return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector)); }; return ZipOperator; }()); var ZipSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ZipSubscriber, _super); function ZipSubscriber(destination, resultSelector, values) { if (values === void 0) { values = Object.create(null); } var _this = _super.call(this, destination) || this; _this.iterators = []; _this.active = 0; _this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : null; _this.values = values; return _this; } ZipSubscriber.prototype._next = function (value) { var iterators = this.iterators; if (Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(value)) { iterators.push(new StaticArrayIterator(value)); } else if (typeof value[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]] === 'function') { iterators.push(new StaticIterator(value[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]]())); } else { iterators.push(new ZipBufferIterator(this.destination, this, value)); } }; ZipSubscriber.prototype._complete = function () { var iterators = this.iterators; var len = iterators.length; if (len === 0) { this.destination.complete(); return; } this.active = len; for (var i = 0; i < len; i++) { var iterator = iterators[i]; if (iterator.stillUnsubscribed) { this.add(iterator.subscribe(iterator, i)); } else { this.active--; } } }; ZipSubscriber.prototype.notifyInactive = function () { this.active--; if (this.active === 0) { this.destination.complete(); } }; ZipSubscriber.prototype.checkIterators = function () { var iterators = this.iterators; var len = iterators.length; var destination = this.destination; for (var i = 0; i < len; i++) { var iterator = iterators[i]; if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) { return; } } var shouldComplete = false; var args = []; for (var i = 0; i < len; i++) { var iterator = iterators[i]; var result = iterator.next(); if (iterator.hasCompleted()) { shouldComplete = true; } if (result.done) { destination.complete(); return; } args.push(result.value); } if (this.resultSelector) { this._tryresultSelector(args); } else { destination.next(args); } if (shouldComplete) { destination.complete(); } }; ZipSubscriber.prototype._tryresultSelector = function (args) { var result; try { result = this.resultSelector.apply(this, args); } catch (err) { this.destination.error(err); return; } this.destination.next(result); }; return ZipSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"])); var StaticIterator = /*@__PURE__*/ (function () { function StaticIterator(iterator) { this.iterator = iterator; this.nextResult = iterator.next(); } StaticIterator.prototype.hasValue = function () { return true; }; StaticIterator.prototype.next = function () { var result = this.nextResult; this.nextResult = this.iterator.next(); return result; }; StaticIterator.prototype.hasCompleted = function () { var nextResult = this.nextResult; return nextResult && nextResult.done; }; return StaticIterator; }()); var StaticArrayIterator = /*@__PURE__*/ (function () { function StaticArrayIterator(array) { this.array = array; this.index = 0; this.length = 0; this.length = array.length; } StaticArrayIterator.prototype[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]] = function () { return this; }; StaticArrayIterator.prototype.next = function (value) { var i = this.index++; var array = this.array; return i < this.length ? { value: array[i], done: false } : { value: null, done: true }; }; StaticArrayIterator.prototype.hasValue = function () { return this.array.length > this.index; }; StaticArrayIterator.prototype.hasCompleted = function () { return this.array.length === this.index; }; return StaticArrayIterator; }()); var ZipBufferIterator = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ZipBufferIterator, _super); function ZipBufferIterator(destination, parent, observable) { var _this = _super.call(this, destination) || this; _this.parent = parent; _this.observable = observable; _this.stillUnsubscribed = true; _this.buffer = []; _this.isComplete = false; return _this; } ZipBufferIterator.prototype[_internal_symbol_iterator__WEBPACK_IMPORTED_MODULE_6__["iterator"]] = function () { return this; }; ZipBufferIterator.prototype.next = function () { var buffer = this.buffer; if (buffer.length === 0 && this.isComplete) { return { value: null, done: true }; } else { return { value: buffer.shift(), done: false }; } }; ZipBufferIterator.prototype.hasValue = function () { return this.buffer.length > 0; }; ZipBufferIterator.prototype.hasCompleted = function () { return this.buffer.length === 0 && this.isComplete; }; ZipBufferIterator.prototype.notifyComplete = function () { if (this.buffer.length > 0) { this.isComplete = true; this.parent.notifyInactive(); } else { this.destination.complete(); } }; ZipBufferIterator.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.buffer.push(innerValue); this.parent.checkIterators(); }; ZipBufferIterator.prototype.subscribe = function (value, index) { return Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, this.observable, this, index); }; return ZipBufferIterator; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"])); //# sourceMappingURL=zip.js.map /***/ }), /* 261 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(262); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return _internal_operators_audit__WEBPACK_IMPORTED_MODULE_0__["audit"]; }); /* harmony import */ var _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(263); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return _internal_operators_auditTime__WEBPACK_IMPORTED_MODULE_1__["auditTime"]; }); /* harmony import */ var _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(264); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return _internal_operators_buffer__WEBPACK_IMPORTED_MODULE_2__["buffer"]; }); /* harmony import */ var _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(265); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return _internal_operators_bufferCount__WEBPACK_IMPORTED_MODULE_3__["bufferCount"]; }); /* harmony import */ var _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(266); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return _internal_operators_bufferTime__WEBPACK_IMPORTED_MODULE_4__["bufferTime"]; }); /* harmony import */ var _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(267); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return _internal_operators_bufferToggle__WEBPACK_IMPORTED_MODULE_5__["bufferToggle"]; }); /* harmony import */ var _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(268); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return _internal_operators_bufferWhen__WEBPACK_IMPORTED_MODULE_6__["bufferWhen"]; }); /* harmony import */ var _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(269); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return _internal_operators_catchError__WEBPACK_IMPORTED_MODULE_7__["catchError"]; }); /* harmony import */ var _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(270); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return _internal_operators_combineAll__WEBPACK_IMPORTED_MODULE_8__["combineAll"]; }); /* harmony import */ var _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(271); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return _internal_operators_combineLatest__WEBPACK_IMPORTED_MODULE_9__["combineLatest"]; }); /* harmony import */ var _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(272); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return _internal_operators_concat__WEBPACK_IMPORTED_MODULE_10__["concat"]; }); /* harmony import */ var _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(241); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return _internal_operators_concatAll__WEBPACK_IMPORTED_MODULE_11__["concatAll"]; }); /* harmony import */ var _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(273); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return _internal_operators_concatMap__WEBPACK_IMPORTED_MODULE_12__["concatMap"]; }); /* harmony import */ var _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(274); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return _internal_operators_concatMapTo__WEBPACK_IMPORTED_MODULE_13__["concatMapTo"]; }); /* harmony import */ var _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(275); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "count", function() { return _internal_operators_count__WEBPACK_IMPORTED_MODULE_14__["count"]; }); /* harmony import */ var _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(276); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return _internal_operators_debounce__WEBPACK_IMPORTED_MODULE_15__["debounce"]; }); /* harmony import */ var _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(277); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return _internal_operators_debounceTime__WEBPACK_IMPORTED_MODULE_16__["debounceTime"]; }); /* harmony import */ var _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(278); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return _internal_operators_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_17__["defaultIfEmpty"]; }); /* harmony import */ var _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(279); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return _internal_operators_delay__WEBPACK_IMPORTED_MODULE_18__["delay"]; }); /* harmony import */ var _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(281); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return _internal_operators_delayWhen__WEBPACK_IMPORTED_MODULE_19__["delayWhen"]; }); /* harmony import */ var _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(282); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return _internal_operators_dematerialize__WEBPACK_IMPORTED_MODULE_20__["dematerialize"]; }); /* harmony import */ var _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(283); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return _internal_operators_distinct__WEBPACK_IMPORTED_MODULE_21__["distinct"]; }); /* harmony import */ var _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(284); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return _internal_operators_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_22__["distinctUntilChanged"]; }); /* harmony import */ var _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(285); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return _internal_operators_distinctUntilKeyChanged__WEBPACK_IMPORTED_MODULE_23__["distinctUntilKeyChanged"]; }); /* harmony import */ var _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(286); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return _internal_operators_elementAt__WEBPACK_IMPORTED_MODULE_24__["elementAt"]; }); /* harmony import */ var _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(291); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "endWith", function() { return _internal_operators_endWith__WEBPACK_IMPORTED_MODULE_25__["endWith"]; }); /* harmony import */ var _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(292); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "every", function() { return _internal_operators_every__WEBPACK_IMPORTED_MODULE_26__["every"]; }); /* harmony import */ var _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(293); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return _internal_operators_exhaust__WEBPACK_IMPORTED_MODULE_27__["exhaust"]; }); /* harmony import */ var _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(294); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return _internal_operators_exhaustMap__WEBPACK_IMPORTED_MODULE_28__["exhaustMap"]; }); /* harmony import */ var _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(295); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return _internal_operators_expand__WEBPACK_IMPORTED_MODULE_29__["expand"]; }); /* harmony import */ var _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(287); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return _internal_operators_filter__WEBPACK_IMPORTED_MODULE_30__["filter"]; }); /* harmony import */ var _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(296); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return _internal_operators_finalize__WEBPACK_IMPORTED_MODULE_31__["finalize"]; }); /* harmony import */ var _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(297); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "find", function() { return _internal_operators_find__WEBPACK_IMPORTED_MODULE_32__["find"]; }); /* harmony import */ var _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(298); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return _internal_operators_findIndex__WEBPACK_IMPORTED_MODULE_33__["findIndex"]; }); /* harmony import */ var _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(299); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "first", function() { return _internal_operators_first__WEBPACK_IMPORTED_MODULE_34__["first"]; }); /* harmony import */ var _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(186); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return _internal_operators_groupBy__WEBPACK_IMPORTED_MODULE_35__["groupBy"]; }); /* harmony import */ var _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(300); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return _internal_operators_ignoreElements__WEBPACK_IMPORTED_MODULE_36__["ignoreElements"]; }); /* harmony import */ var _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(301); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return _internal_operators_isEmpty__WEBPACK_IMPORTED_MODULE_37__["isEmpty"]; }); /* harmony import */ var _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(302); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "last", function() { return _internal_operators_last__WEBPACK_IMPORTED_MODULE_38__["last"]; }); /* harmony import */ var _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(221); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "map", function() { return _internal_operators_map__WEBPACK_IMPORTED_MODULE_39__["map"]; }); /* harmony import */ var _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(304); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return _internal_operators_mapTo__WEBPACK_IMPORTED_MODULE_40__["mapTo"]; }); /* harmony import */ var _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(305); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return _internal_operators_materialize__WEBPACK_IMPORTED_MODULE_41__["materialize"]; }); /* harmony import */ var _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(306); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _internal_operators_max__WEBPACK_IMPORTED_MODULE_42__["max"]; }); /* harmony import */ var _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(309); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return _internal_operators_merge__WEBPACK_IMPORTED_MODULE_43__["merge"]; }); /* harmony import */ var _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(242); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return _internal_operators_mergeAll__WEBPACK_IMPORTED_MODULE_44__["mergeAll"]; }); /* harmony import */ var _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(243); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["mergeMap"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return _internal_operators_mergeMap__WEBPACK_IMPORTED_MODULE_45__["mergeMap"]; }); /* harmony import */ var _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(310); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return _internal_operators_mergeMapTo__WEBPACK_IMPORTED_MODULE_46__["mergeMapTo"]; }); /* harmony import */ var _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(311); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return _internal_operators_mergeScan__WEBPACK_IMPORTED_MODULE_47__["mergeScan"]; }); /* harmony import */ var _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(312); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "min", function() { return _internal_operators_min__WEBPACK_IMPORTED_MODULE_48__["min"]; }); /* harmony import */ var _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(313); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return _internal_operators_multicast__WEBPACK_IMPORTED_MODULE_49__["multicast"]; }); /* harmony import */ var _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(196); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return _internal_operators_observeOn__WEBPACK_IMPORTED_MODULE_50__["observeOn"]; }); /* harmony import */ var _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(314); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return _internal_operators_onErrorResumeNext__WEBPACK_IMPORTED_MODULE_51__["onErrorResumeNext"]; }); /* harmony import */ var _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(315); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return _internal_operators_pairwise__WEBPACK_IMPORTED_MODULE_52__["pairwise"]; }); /* harmony import */ var _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(316); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return _internal_operators_partition__WEBPACK_IMPORTED_MODULE_53__["partition"]; }); /* harmony import */ var _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(318); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return _internal_operators_pluck__WEBPACK_IMPORTED_MODULE_54__["pluck"]; }); /* harmony import */ var _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(319); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return _internal_operators_publish__WEBPACK_IMPORTED_MODULE_55__["publish"]; }); /* harmony import */ var _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(320); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return _internal_operators_publishBehavior__WEBPACK_IMPORTED_MODULE_56__["publishBehavior"]; }); /* harmony import */ var _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(321); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return _internal_operators_publishLast__WEBPACK_IMPORTED_MODULE_57__["publishLast"]; }); /* harmony import */ var _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(322); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return _internal_operators_publishReplay__WEBPACK_IMPORTED_MODULE_58__["publishReplay"]; }); /* harmony import */ var _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(323); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "race", function() { return _internal_operators_race__WEBPACK_IMPORTED_MODULE_59__["race"]; }); /* harmony import */ var _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(307); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return _internal_operators_reduce__WEBPACK_IMPORTED_MODULE_60__["reduce"]; }); /* harmony import */ var _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(324); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return _internal_operators_repeat__WEBPACK_IMPORTED_MODULE_61__["repeat"]; }); /* harmony import */ var _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(325); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return _internal_operators_repeatWhen__WEBPACK_IMPORTED_MODULE_62__["repeatWhen"]; }); /* harmony import */ var _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(326); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return _internal_operators_retry__WEBPACK_IMPORTED_MODULE_63__["retry"]; }); /* harmony import */ var _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(327); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return _internal_operators_retryWhen__WEBPACK_IMPORTED_MODULE_64__["retryWhen"]; }); /* harmony import */ var _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(185); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return _internal_operators_refCount__WEBPACK_IMPORTED_MODULE_65__["refCount"]; }); /* harmony import */ var _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(328); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return _internal_operators_sample__WEBPACK_IMPORTED_MODULE_66__["sample"]; }); /* harmony import */ var _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(329); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return _internal_operators_sampleTime__WEBPACK_IMPORTED_MODULE_67__["sampleTime"]; }); /* harmony import */ var _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(308); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return _internal_operators_scan__WEBPACK_IMPORTED_MODULE_68__["scan"]; }); /* harmony import */ var _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(330); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return _internal_operators_sequenceEqual__WEBPACK_IMPORTED_MODULE_69__["sequenceEqual"]; }); /* harmony import */ var _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(331); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "share", function() { return _internal_operators_share__WEBPACK_IMPORTED_MODULE_70__["share"]; }); /* harmony import */ var _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(332); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return _internal_operators_shareReplay__WEBPACK_IMPORTED_MODULE_71__["shareReplay"]; }); /* harmony import */ var _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(333); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "single", function() { return _internal_operators_single__WEBPACK_IMPORTED_MODULE_72__["single"]; }); /* harmony import */ var _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(334); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return _internal_operators_skip__WEBPACK_IMPORTED_MODULE_73__["skip"]; }); /* harmony import */ var _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(335); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return _internal_operators_skipLast__WEBPACK_IMPORTED_MODULE_74__["skipLast"]; }); /* harmony import */ var _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(336); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return _internal_operators_skipUntil__WEBPACK_IMPORTED_MODULE_75__["skipUntil"]; }); /* harmony import */ var _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(337); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return _internal_operators_skipWhile__WEBPACK_IMPORTED_MODULE_76__["skipWhile"]; }); /* harmony import */ var _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(338); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return _internal_operators_startWith__WEBPACK_IMPORTED_MODULE_77__["startWith"]; }); /* harmony import */ var _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(339); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return _internal_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_78__["subscribeOn"]; }); /* harmony import */ var _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(341); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return _internal_operators_switchAll__WEBPACK_IMPORTED_MODULE_79__["switchAll"]; }); /* harmony import */ var _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(342); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return _internal_operators_switchMap__WEBPACK_IMPORTED_MODULE_80__["switchMap"]; }); /* harmony import */ var _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(343); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return _internal_operators_switchMapTo__WEBPACK_IMPORTED_MODULE_81__["switchMapTo"]; }); /* harmony import */ var _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(290); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "take", function() { return _internal_operators_take__WEBPACK_IMPORTED_MODULE_82__["take"]; }); /* harmony import */ var _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(303); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return _internal_operators_takeLast__WEBPACK_IMPORTED_MODULE_83__["takeLast"]; }); /* harmony import */ var _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(344); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return _internal_operators_takeUntil__WEBPACK_IMPORTED_MODULE_84__["takeUntil"]; }); /* harmony import */ var _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(345); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return _internal_operators_takeWhile__WEBPACK_IMPORTED_MODULE_85__["takeWhile"]; }); /* harmony import */ var _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(289); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return _internal_operators_tap__WEBPACK_IMPORTED_MODULE_86__["tap"]; }); /* harmony import */ var _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(346); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return _internal_operators_throttle__WEBPACK_IMPORTED_MODULE_87__["throttle"]; }); /* harmony import */ var _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(347); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return _internal_operators_throttleTime__WEBPACK_IMPORTED_MODULE_88__["throttleTime"]; }); /* harmony import */ var _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(288); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return _internal_operators_throwIfEmpty__WEBPACK_IMPORTED_MODULE_89__["throwIfEmpty"]; }); /* harmony import */ var _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(348); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return _internal_operators_timeInterval__WEBPACK_IMPORTED_MODULE_90__["timeInterval"]; }); /* harmony import */ var _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(349); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return _internal_operators_timeout__WEBPACK_IMPORTED_MODULE_91__["timeout"]; }); /* harmony import */ var _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(350); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return _internal_operators_timeoutWith__WEBPACK_IMPORTED_MODULE_92__["timeoutWith"]; }); /* harmony import */ var _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(351); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return _internal_operators_timestamp__WEBPACK_IMPORTED_MODULE_93__["timestamp"]; }); /* harmony import */ var _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(352); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return _internal_operators_toArray__WEBPACK_IMPORTED_MODULE_94__["toArray"]; }); /* harmony import */ var _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(353); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "window", function() { return _internal_operators_window__WEBPACK_IMPORTED_MODULE_95__["window"]; }); /* harmony import */ var _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(354); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return _internal_operators_windowCount__WEBPACK_IMPORTED_MODULE_96__["windowCount"]; }); /* harmony import */ var _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(355); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return _internal_operators_windowTime__WEBPACK_IMPORTED_MODULE_97__["windowTime"]; }); /* harmony import */ var _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(356); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return _internal_operators_windowToggle__WEBPACK_IMPORTED_MODULE_98__["windowToggle"]; }); /* harmony import */ var _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(357); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return _internal_operators_windowWhen__WEBPACK_IMPORTED_MODULE_99__["windowWhen"]; }); /* harmony import */ var _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(358); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return _internal_operators_withLatestFrom__WEBPACK_IMPORTED_MODULE_100__["withLatestFrom"]; }); /* harmony import */ var _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(359); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return _internal_operators_zip__WEBPACK_IMPORTED_MODULE_101__["zip"]; }); /* harmony import */ var _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(360); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return _internal_operators_zipAll__WEBPACK_IMPORTED_MODULE_102__["zipAll"]; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ //# sourceMappingURL=index.js.map /***/ }), /* 262 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return audit; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(174); /* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(175); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function audit(durationSelector) { return function auditOperatorFunction(source) { return source.lift(new AuditOperator(durationSelector)); }; } var AuditOperator = /*@__PURE__*/ (function () { function AuditOperator(durationSelector) { this.durationSelector = durationSelector; } AuditOperator.prototype.call = function (subscriber, source) { return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector)); }; return AuditOperator; }()); var AuditSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](AuditSubscriber, _super); function AuditSubscriber(destination, durationSelector) { var _this = _super.call(this, destination) || this; _this.durationSelector = durationSelector; _this.hasValue = false; return _this; } AuditSubscriber.prototype._next = function (value) { this.value = value; this.hasValue = true; if (!this.throttled) { var duration = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_1__["tryCatch"])(this.durationSelector)(value); if (duration === _util_errorObject__WEBPACK_IMPORTED_MODULE_2__["errorObject"]) { this.destination.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_2__["errorObject"].e); } else { var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, duration); if (!innerSubscription || innerSubscription.closed) { this.clearThrottle(); } else { this.add(this.throttled = innerSubscription); } } } }; AuditSubscriber.prototype.clearThrottle = function () { var _a = this, value = _a.value, hasValue = _a.hasValue, throttled = _a.throttled; if (throttled) { this.remove(throttled); this.throttled = null; throttled.unsubscribe(); } if (hasValue) { this.value = null; this.hasValue = false; this.destination.next(value); } }; AuditSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) { this.clearThrottle(); }; AuditSubscriber.prototype.notifyComplete = function () { this.clearThrottle(); }; return AuditSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"])); //# sourceMappingURL=audit.js.map /***/ }), /* 263 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return auditTime; }); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(210); /* harmony import */ var _audit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(262); /* harmony import */ var _observable_timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(258); /** PURE_IMPORTS_START _scheduler_async,_audit,_observable_timer PURE_IMPORTS_END */ function auditTime(duration, scheduler) { if (scheduler === void 0) { scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]; } return Object(_audit__WEBPACK_IMPORTED_MODULE_1__["audit"])(function () { return Object(_observable_timer__WEBPACK_IMPORTED_MODULE_2__["timer"])(duration, scheduler); }); } //# sourceMappingURL=auditTime.js.map /***/ }), /* 264 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return buffer; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function buffer(closingNotifier) { return function bufferOperatorFunction(source) { return source.lift(new BufferOperator(closingNotifier)); }; } var BufferOperator = /*@__PURE__*/ (function () { function BufferOperator(closingNotifier) { this.closingNotifier = closingNotifier; } BufferOperator.prototype.call = function (subscriber, source) { return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier)); }; return BufferOperator; }()); var BufferSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferSubscriber, _super); function BufferSubscriber(destination, closingNotifier) { var _this = _super.call(this, destination) || this; _this.buffer = []; _this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, closingNotifier)); return _this; } BufferSubscriber.prototype._next = function (value) { this.buffer.push(value); }; BufferSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { var buffer = this.buffer; this.buffer = []; this.destination.next(buffer); }; return BufferSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"])); //# sourceMappingURL=buffer.js.map /***/ }), /* 265 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return bufferCount; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function bufferCount(bufferSize, startBufferEvery) { if (startBufferEvery === void 0) { startBufferEvery = null; } return function bufferCountOperatorFunction(source) { return source.lift(new BufferCountOperator(bufferSize, startBufferEvery)); }; } var BufferCountOperator = /*@__PURE__*/ (function () { function BufferCountOperator(bufferSize, startBufferEvery) { this.bufferSize = bufferSize; this.startBufferEvery = startBufferEvery; if (!startBufferEvery || bufferSize === startBufferEvery) { this.subscriberClass = BufferCountSubscriber; } else { this.subscriberClass = BufferSkipCountSubscriber; } } BufferCountOperator.prototype.call = function (subscriber, source) { return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery)); }; return BufferCountOperator; }()); var BufferCountSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferCountSubscriber, _super); function BufferCountSubscriber(destination, bufferSize) { var _this = _super.call(this, destination) || this; _this.bufferSize = bufferSize; _this.buffer = []; return _this; } BufferCountSubscriber.prototype._next = function (value) { var buffer = this.buffer; buffer.push(value); if (buffer.length == this.bufferSize) { this.destination.next(buffer); this.buffer = []; } }; BufferCountSubscriber.prototype._complete = function () { var buffer = this.buffer; if (buffer.length > 0) { this.destination.next(buffer); } _super.prototype._complete.call(this); }; return BufferCountSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); var BufferSkipCountSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferSkipCountSubscriber, _super); function BufferSkipCountSubscriber(destination, bufferSize, startBufferEvery) { var _this = _super.call(this, destination) || this; _this.bufferSize = bufferSize; _this.startBufferEvery = startBufferEvery; _this.buffers = []; _this.count = 0; return _this; } BufferSkipCountSubscriber.prototype._next = function (value) { var _a = this, bufferSize = _a.bufferSize, startBufferEvery = _a.startBufferEvery, buffers = _a.buffers, count = _a.count; this.count++; if (count % startBufferEvery === 0) { buffers.push([]); } for (var i = buffers.length; i--;) { var buffer = buffers[i]; buffer.push(value); if (buffer.length === bufferSize) { buffers.splice(i, 1); this.destination.next(buffer); } } }; BufferSkipCountSubscriber.prototype._complete = function () { var _a = this, buffers = _a.buffers, destination = _a.destination; while (buffers.length > 0) { var buffer = buffers.shift(); if (buffer.length > 0) { destination.next(buffer); } } _super.prototype._complete.call(this); }; return BufferSkipCountSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=bufferCount.js.map /***/ }), /* 266 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return bufferTime; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(210); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(165); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(200); /** PURE_IMPORTS_START tslib,_scheduler_async,_Subscriber,_util_isScheduler PURE_IMPORTS_END */ function bufferTime(bufferTimeSpan) { var length = arguments.length; var scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]; if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_3__["isScheduler"])(arguments[arguments.length - 1])) { scheduler = arguments[arguments.length - 1]; length--; } var bufferCreationInterval = null; if (length >= 2) { bufferCreationInterval = arguments[1]; } var maxBufferSize = Number.POSITIVE_INFINITY; if (length >= 3) { maxBufferSize = arguments[2]; } return function bufferTimeOperatorFunction(source) { return source.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler)); }; } var BufferTimeOperator = /*@__PURE__*/ (function () { function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) { this.bufferTimeSpan = bufferTimeSpan; this.bufferCreationInterval = bufferCreationInterval; this.maxBufferSize = maxBufferSize; this.scheduler = scheduler; } BufferTimeOperator.prototype.call = function (subscriber, source) { return source.subscribe(new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.maxBufferSize, this.scheduler)); }; return BufferTimeOperator; }()); var Context = /*@__PURE__*/ (function () { function Context() { this.buffer = []; } return Context; }()); var BufferTimeSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferTimeSubscriber, _super); function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) { var _this = _super.call(this, destination) || this; _this.bufferTimeSpan = bufferTimeSpan; _this.bufferCreationInterval = bufferCreationInterval; _this.maxBufferSize = maxBufferSize; _this.scheduler = scheduler; _this.contexts = []; var context = _this.openContext(); _this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0; if (_this.timespanOnly) { var timeSpanOnlyState = { subscriber: _this, context: context, bufferTimeSpan: bufferTimeSpan }; _this.add(context.closeAction = scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState)); } else { var closeState = { subscriber: _this, context: context }; var creationState = { bufferTimeSpan: bufferTimeSpan, bufferCreationInterval: bufferCreationInterval, subscriber: _this, scheduler: scheduler }; _this.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState)); _this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState)); } return _this; } BufferTimeSubscriber.prototype._next = function (value) { var contexts = this.contexts; var len = contexts.length; var filledBufferContext; for (var i = 0; i < len; i++) { var context_1 = contexts[i]; var buffer = context_1.buffer; buffer.push(value); if (buffer.length == this.maxBufferSize) { filledBufferContext = context_1; } } if (filledBufferContext) { this.onBufferFull(filledBufferContext); } }; BufferTimeSubscriber.prototype._error = function (err) { this.contexts.length = 0; _super.prototype._error.call(this, err); }; BufferTimeSubscriber.prototype._complete = function () { var _a = this, contexts = _a.contexts, destination = _a.destination; while (contexts.length > 0) { var context_2 = contexts.shift(); destination.next(context_2.buffer); } _super.prototype._complete.call(this); }; BufferTimeSubscriber.prototype._unsubscribe = function () { this.contexts = null; }; BufferTimeSubscriber.prototype.onBufferFull = function (context) { this.closeContext(context); var closeAction = context.closeAction; closeAction.unsubscribe(); this.remove(closeAction); if (!this.closed && this.timespanOnly) { context = this.openContext(); var bufferTimeSpan = this.bufferTimeSpan; var timeSpanOnlyState = { subscriber: this, context: context, bufferTimeSpan: bufferTimeSpan }; this.add(context.closeAction = this.scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState)); } }; BufferTimeSubscriber.prototype.openContext = function () { var context = new Context(); this.contexts.push(context); return context; }; BufferTimeSubscriber.prototype.closeContext = function (context) { this.destination.next(context.buffer); var contexts = this.contexts; var spliceIndex = contexts ? contexts.indexOf(context) : -1; if (spliceIndex >= 0) { contexts.splice(contexts.indexOf(context), 1); } }; return BufferTimeSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_2__["Subscriber"])); function dispatchBufferTimeSpanOnly(state) { var subscriber = state.subscriber; var prevContext = state.context; if (prevContext) { subscriber.closeContext(prevContext); } if (!subscriber.closed) { state.context = subscriber.openContext(); state.context.closeAction = this.schedule(state, state.bufferTimeSpan); } } function dispatchBufferCreation(state) { var bufferCreationInterval = state.bufferCreationInterval, bufferTimeSpan = state.bufferTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler; var context = subscriber.openContext(); var action = this; if (!subscriber.closed) { subscriber.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { subscriber: subscriber, context: context })); action.schedule(state, bufferCreationInterval); } } function dispatchBufferClose(arg) { var subscriber = arg.subscriber, context = arg.context; subscriber.closeContext(context); } //# sourceMappingURL=bufferTime.js.map /***/ }), /* 267 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return bufferToggle; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(225); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(224); /** PURE_IMPORTS_START tslib,_Subscription,_util_subscribeToResult,_OuterSubscriber PURE_IMPORTS_END */ function bufferToggle(openings, closingSelector) { return function bufferToggleOperatorFunction(source) { return source.lift(new BufferToggleOperator(openings, closingSelector)); }; } var BufferToggleOperator = /*@__PURE__*/ (function () { function BufferToggleOperator(openings, closingSelector) { this.openings = openings; this.closingSelector = closingSelector; } BufferToggleOperator.prototype.call = function (subscriber, source) { return source.subscribe(new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector)); }; return BufferToggleOperator; }()); var BufferToggleSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferToggleSubscriber, _super); function BufferToggleSubscriber(destination, openings, closingSelector) { var _this = _super.call(this, destination) || this; _this.openings = openings; _this.closingSelector = closingSelector; _this.contexts = []; _this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, openings)); return _this; } BufferToggleSubscriber.prototype._next = function (value) { var contexts = this.contexts; var len = contexts.length; for (var i = 0; i < len; i++) { contexts[i].buffer.push(value); } }; BufferToggleSubscriber.prototype._error = function (err) { var contexts = this.contexts; while (contexts.length > 0) { var context_1 = contexts.shift(); context_1.subscription.unsubscribe(); context_1.buffer = null; context_1.subscription = null; } this.contexts = null; _super.prototype._error.call(this, err); }; BufferToggleSubscriber.prototype._complete = function () { var contexts = this.contexts; while (contexts.length > 0) { var context_2 = contexts.shift(); this.destination.next(context_2.buffer); context_2.subscription.unsubscribe(); context_2.buffer = null; context_2.subscription = null; } this.contexts = null; _super.prototype._complete.call(this); }; BufferToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { outerValue ? this.closeBuffer(outerValue) : this.openBuffer(innerValue); }; BufferToggleSubscriber.prototype.notifyComplete = function (innerSub) { this.closeBuffer(innerSub.context); }; BufferToggleSubscriber.prototype.openBuffer = function (value) { try { var closingSelector = this.closingSelector; var closingNotifier = closingSelector.call(this, value); if (closingNotifier) { this.trySubscribe(closingNotifier); } } catch (err) { this._error(err); } }; BufferToggleSubscriber.prototype.closeBuffer = function (context) { var contexts = this.contexts; if (contexts && context) { var buffer = context.buffer, subscription = context.subscription; this.destination.next(buffer); contexts.splice(contexts.indexOf(context), 1); this.remove(subscription); subscription.unsubscribe(); } }; BufferToggleSubscriber.prototype.trySubscribe = function (closingNotifier) { var contexts = this.contexts; var buffer = []; var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); var context = { buffer: buffer, subscription: subscription }; contexts.push(context); var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, closingNotifier, context); if (!innerSubscription || innerSubscription.closed) { this.closeBuffer(context); } else { innerSubscription.context = context; this.add(innerSubscription); subscription.add(innerSubscription); } }; return BufferToggleSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"])); //# sourceMappingURL=bufferToggle.js.map /***/ }), /* 268 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return bufferWhen; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(171); /* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(174); /* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(175); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_Subscription,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function bufferWhen(closingSelector) { return function (source) { return source.lift(new BufferWhenOperator(closingSelector)); }; } var BufferWhenOperator = /*@__PURE__*/ (function () { function BufferWhenOperator(closingSelector) { this.closingSelector = closingSelector; } BufferWhenOperator.prototype.call = function (subscriber, source) { return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector)); }; return BufferWhenOperator; }()); var BufferWhenSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](BufferWhenSubscriber, _super); function BufferWhenSubscriber(destination, closingSelector) { var _this = _super.call(this, destination) || this; _this.closingSelector = closingSelector; _this.subscribing = false; _this.openBuffer(); return _this; } BufferWhenSubscriber.prototype._next = function (value) { this.buffer.push(value); }; BufferWhenSubscriber.prototype._complete = function () { var buffer = this.buffer; if (buffer) { this.destination.next(buffer); } _super.prototype._complete.call(this); }; BufferWhenSubscriber.prototype._unsubscribe = function () { this.buffer = null; this.subscribing = false; }; BufferWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.openBuffer(); }; BufferWhenSubscriber.prototype.notifyComplete = function () { if (this.subscribing) { this.complete(); } else { this.openBuffer(); } }; BufferWhenSubscriber.prototype.openBuffer = function () { var closingSubscription = this.closingSubscription; if (closingSubscription) { this.remove(closingSubscription); closingSubscription.unsubscribe(); } var buffer = this.buffer; if (this.buffer) { this.destination.next(buffer); } this.buffer = []; var closingNotifier = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(this.closingSelector)(); if (closingNotifier === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) { this.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"].e); } else { closingSubscription = new _Subscription__WEBPACK_IMPORTED_MODULE_1__["Subscription"](); this.closingSubscription = closingSubscription; this.add(closingSubscription); this.subscribing = true; closingSubscription.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, closingNotifier)); this.subscribing = false; } }; return BufferWhenSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"])); //# sourceMappingURL=bufferWhen.js.map /***/ }), /* 269 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return catchError; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function catchError(selector) { return function catchErrorOperatorFunction(source) { var operator = new CatchOperator(selector); var caught = source.lift(operator); return (operator.caught = caught); }; } var CatchOperator = /*@__PURE__*/ (function () { function CatchOperator(selector) { this.selector = selector; } CatchOperator.prototype.call = function (subscriber, source) { return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught)); }; return CatchOperator; }()); var CatchSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CatchSubscriber, _super); function CatchSubscriber(destination, selector, caught) { var _this = _super.call(this, destination) || this; _this.selector = selector; _this.caught = caught; return _this; } CatchSubscriber.prototype.error = function (err) { if (!this.isStopped) { var result = void 0; try { result = this.selector(err, this.caught); } catch (err2) { _super.prototype.error.call(this, err2); return; } this._unsubscribeAndRecycle(); this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, result)); } }; return CatchSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"])); //# sourceMappingURL=catchError.js.map /***/ }), /* 270 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return combineAll; }); /* harmony import */ var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(223); /** PURE_IMPORTS_START _observable_combineLatest PURE_IMPORTS_END */ function combineAll(project) { return function (source) { return source.lift(new _observable_combineLatest__WEBPACK_IMPORTED_MODULE_0__["CombineLatestOperator"](project)); }; } //# sourceMappingURL=combineAll.js.map /***/ }), /* 271 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return combineLatest; }); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(172); /* harmony import */ var _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(223); /* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(235); /** PURE_IMPORTS_START _util_isArray,_observable_combineLatest,_observable_from PURE_IMPORTS_END */ var none = {}; function combineLatest() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i] = arguments[_i]; } var project = null; if (typeof observables[observables.length - 1] === 'function') { project = observables.pop(); } if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) { observables = observables[0].slice(); } return function (source) { return source.lift.call(Object(_observable_from__WEBPACK_IMPORTED_MODULE_2__["from"])([source].concat(observables)), new _observable_combineLatest__WEBPACK_IMPORTED_MODULE_1__["CombineLatestOperator"](project)); }; } //# sourceMappingURL=combineLatest.js.map /***/ }), /* 272 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return concat; }); /* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(234); /** PURE_IMPORTS_START _observable_concat PURE_IMPORTS_END */ function concat() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i] = arguments[_i]; } return function (source) { return source.lift.call(_observable_concat__WEBPACK_IMPORTED_MODULE_0__["concat"].apply(void 0, [source].concat(observables))); }; } //# sourceMappingURL=concat.js.map /***/ }), /* 273 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return concatMap; }); /* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(243); /** PURE_IMPORTS_START _mergeMap PURE_IMPORTS_END */ function concatMap(project, resultSelector) { return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(project, resultSelector, 1); } //# sourceMappingURL=concatMap.js.map /***/ }), /* 274 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return concatMapTo; }); /* harmony import */ var _concatMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(273); /** PURE_IMPORTS_START _concatMap PURE_IMPORTS_END */ function concatMapTo(innerObservable, resultSelector) { return Object(_concatMap__WEBPACK_IMPORTED_MODULE_0__["concatMap"])(function () { return innerObservable; }, resultSelector); } //# sourceMappingURL=concatMapTo.js.map /***/ }), /* 275 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "count", function() { return count; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function count(predicate) { return function (source) { return source.lift(new CountOperator(predicate, source)); }; } var CountOperator = /*@__PURE__*/ (function () { function CountOperator(predicate, source) { this.predicate = predicate; this.source = source; } CountOperator.prototype.call = function (subscriber, source) { return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source)); }; return CountOperator; }()); var CountSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CountSubscriber, _super); function CountSubscriber(destination, predicate, source) { var _this = _super.call(this, destination) || this; _this.predicate = predicate; _this.source = source; _this.count = 0; _this.index = 0; return _this; } CountSubscriber.prototype._next = function (value) { if (this.predicate) { this._tryPredicate(value); } else { this.count++; } }; CountSubscriber.prototype._tryPredicate = function (value) { var result; try { result = this.predicate(value, this.index++, this.source); } catch (err) { this.destination.error(err); return; } if (result) { this.count++; } }; CountSubscriber.prototype._complete = function () { this.destination.next(this.count); this.destination.complete(); }; return CountSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=count.js.map /***/ }), /* 276 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return debounce; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function debounce(durationSelector) { return function (source) { return source.lift(new DebounceOperator(durationSelector)); }; } var DebounceOperator = /*@__PURE__*/ (function () { function DebounceOperator(durationSelector) { this.durationSelector = durationSelector; } DebounceOperator.prototype.call = function (subscriber, source) { return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector)); }; return DebounceOperator; }()); var DebounceSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DebounceSubscriber, _super); function DebounceSubscriber(destination, durationSelector) { var _this = _super.call(this, destination) || this; _this.durationSelector = durationSelector; _this.hasValue = false; _this.durationSubscription = null; return _this; } DebounceSubscriber.prototype._next = function (value) { try { var result = this.durationSelector.call(this, value); if (result) { this._tryNext(value, result); } } catch (err) { this.destination.error(err); } }; DebounceSubscriber.prototype._complete = function () { this.emitValue(); this.destination.complete(); }; DebounceSubscriber.prototype._tryNext = function (value, duration) { var subscription = this.durationSubscription; this.value = value; this.hasValue = true; if (subscription) { subscription.unsubscribe(); this.remove(subscription); } subscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, duration); if (subscription && !subscription.closed) { this.add(this.durationSubscription = subscription); } }; DebounceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.emitValue(); }; DebounceSubscriber.prototype.notifyComplete = function () { this.emitValue(); }; DebounceSubscriber.prototype.emitValue = function () { if (this.hasValue) { var value = this.value; var subscription = this.durationSubscription; if (subscription) { this.durationSubscription = null; subscription.unsubscribe(); this.remove(subscription); } this.value = null; this.hasValue = false; _super.prototype._next.call(this, value); } }; return DebounceSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"])); //# sourceMappingURL=debounce.js.map /***/ }), /* 277 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return debounceTime; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(210); /** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */ function debounceTime(dueTime, scheduler) { if (scheduler === void 0) { scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"]; } return function (source) { return source.lift(new DebounceTimeOperator(dueTime, scheduler)); }; } var DebounceTimeOperator = /*@__PURE__*/ (function () { function DebounceTimeOperator(dueTime, scheduler) { this.dueTime = dueTime; this.scheduler = scheduler; } DebounceTimeOperator.prototype.call = function (subscriber, source) { return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler)); }; return DebounceTimeOperator; }()); var DebounceTimeSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DebounceTimeSubscriber, _super); function DebounceTimeSubscriber(destination, dueTime, scheduler) { var _this = _super.call(this, destination) || this; _this.dueTime = dueTime; _this.scheduler = scheduler; _this.debouncedSubscription = null; _this.lastValue = null; _this.hasValue = false; return _this; } DebounceTimeSubscriber.prototype._next = function (value) { this.clearDebounce(); this.lastValue = value; this.hasValue = true; this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this)); }; DebounceTimeSubscriber.prototype._complete = function () { this.debouncedNext(); this.destination.complete(); }; DebounceTimeSubscriber.prototype.debouncedNext = function () { this.clearDebounce(); if (this.hasValue) { var lastValue = this.lastValue; this.lastValue = null; this.hasValue = false; this.destination.next(lastValue); } }; DebounceTimeSubscriber.prototype.clearDebounce = function () { var debouncedSubscription = this.debouncedSubscription; if (debouncedSubscription !== null) { this.remove(debouncedSubscription); debouncedSubscription.unsubscribe(); this.debouncedSubscription = null; } }; return DebounceTimeSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); function dispatchNext(subscriber) { subscriber.debouncedNext(); } //# sourceMappingURL=debounceTime.js.map /***/ }), /* 278 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return defaultIfEmpty; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function defaultIfEmpty(defaultValue) { if (defaultValue === void 0) { defaultValue = null; } return function (source) { return source.lift(new DefaultIfEmptyOperator(defaultValue)); }; } var DefaultIfEmptyOperator = /*@__PURE__*/ (function () { function DefaultIfEmptyOperator(defaultValue) { this.defaultValue = defaultValue; } DefaultIfEmptyOperator.prototype.call = function (subscriber, source) { return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue)); }; return DefaultIfEmptyOperator; }()); var DefaultIfEmptySubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DefaultIfEmptySubscriber, _super); function DefaultIfEmptySubscriber(destination, defaultValue) { var _this = _super.call(this, destination) || this; _this.defaultValue = defaultValue; _this.isEmpty = true; return _this; } DefaultIfEmptySubscriber.prototype._next = function (value) { this.isEmpty = false; this.destination.next(value); }; DefaultIfEmptySubscriber.prototype._complete = function () { if (this.isEmpty) { this.destination.next(this.defaultValue); } this.destination.complete(); }; return DefaultIfEmptySubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=defaultIfEmpty.js.map /***/ }), /* 279 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return delay; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(210); /* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(280); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(165); /* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(197); /** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_Subscriber,_Notification PURE_IMPORTS_END */ function delay(delay, scheduler) { if (scheduler === void 0) { scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]; } var absoluteDelay = Object(_util_isDate__WEBPACK_IMPORTED_MODULE_2__["isDate"])(delay); var delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay); return function (source) { return source.lift(new DelayOperator(delayFor, scheduler)); }; } var DelayOperator = /*@__PURE__*/ (function () { function DelayOperator(delay, scheduler) { this.delay = delay; this.scheduler = scheduler; } DelayOperator.prototype.call = function (subscriber, source) { return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler)); }; return DelayOperator; }()); var DelaySubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DelaySubscriber, _super); function DelaySubscriber(destination, delay, scheduler) { var _this = _super.call(this, destination) || this; _this.delay = delay; _this.scheduler = scheduler; _this.queue = []; _this.active = false; _this.errored = false; return _this; } DelaySubscriber.dispatch = function (state) { var source = state.source; var queue = source.queue; var scheduler = state.scheduler; var destination = state.destination; while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) { queue.shift().notification.observe(destination); } if (queue.length > 0) { var delay_1 = Math.max(0, queue[0].time - scheduler.now()); this.schedule(state, delay_1); } else { this.unsubscribe(); source.active = false; } }; DelaySubscriber.prototype._schedule = function (scheduler) { this.active = true; this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, { source: this, destination: this.destination, scheduler: scheduler })); }; DelaySubscriber.prototype.scheduleNotification = function (notification) { if (this.errored === true) { return; } var scheduler = this.scheduler; var message = new DelayMessage(scheduler.now() + this.delay, notification); this.queue.push(message); if (this.active === false) { this._schedule(scheduler); } }; DelaySubscriber.prototype._next = function (value) { this.scheduleNotification(_Notification__WEBPACK_IMPORTED_MODULE_4__["Notification"].createNext(value)); }; DelaySubscriber.prototype._error = function (err) { this.errored = true; this.queue = []; this.destination.error(err); }; DelaySubscriber.prototype._complete = function () { this.scheduleNotification(_Notification__WEBPACK_IMPORTED_MODULE_4__["Notification"].createComplete()); }; return DelaySubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"])); var DelayMessage = /*@__PURE__*/ (function () { function DelayMessage(time, notification) { this.time = time; this.notification = notification; } return DelayMessage; }()); //# sourceMappingURL=delay.js.map /***/ }), /* 280 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDate", function() { return isDate; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function isDate(value) { return value instanceof Date && !isNaN(+value); } //# sourceMappingURL=isDate.js.map /***/ }), /* 281 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return delayWhen; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(163); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_Subscriber,_Observable,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function delayWhen(delayDurationSelector, subscriptionDelay) { if (subscriptionDelay) { return function (source) { return new SubscriptionDelayObservable(source, subscriptionDelay) .lift(new DelayWhenOperator(delayDurationSelector)); }; } return function (source) { return source.lift(new DelayWhenOperator(delayDurationSelector)); }; } var DelayWhenOperator = /*@__PURE__*/ (function () { function DelayWhenOperator(delayDurationSelector) { this.delayDurationSelector = delayDurationSelector; } DelayWhenOperator.prototype.call = function (subscriber, source) { return source.subscribe(new DelayWhenSubscriber(subscriber, this.delayDurationSelector)); }; return DelayWhenOperator; }()); var DelayWhenSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DelayWhenSubscriber, _super); function DelayWhenSubscriber(destination, delayDurationSelector) { var _this = _super.call(this, destination) || this; _this.delayDurationSelector = delayDurationSelector; _this.completed = false; _this.delayNotifierSubscriptions = []; return _this; } DelayWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.destination.next(outerValue); this.removeSubscription(innerSub); this.tryComplete(); }; DelayWhenSubscriber.prototype.notifyError = function (error, innerSub) { this._error(error); }; DelayWhenSubscriber.prototype.notifyComplete = function (innerSub) { var value = this.removeSubscription(innerSub); if (value) { this.destination.next(value); } this.tryComplete(); }; DelayWhenSubscriber.prototype._next = function (value) { try { var delayNotifier = this.delayDurationSelector(value); if (delayNotifier) { this.tryDelay(delayNotifier, value); } } catch (err) { this.destination.error(err); } }; DelayWhenSubscriber.prototype._complete = function () { this.completed = true; this.tryComplete(); }; DelayWhenSubscriber.prototype.removeSubscription = function (subscription) { subscription.unsubscribe(); var subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription); if (subscriptionIdx !== -1) { this.delayNotifierSubscriptions.splice(subscriptionIdx, 1); } return subscription.outerValue; }; DelayWhenSubscriber.prototype.tryDelay = function (delayNotifier, value) { var notifierSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, delayNotifier, value); if (notifierSubscription && !notifierSubscription.closed) { this.add(notifierSubscription); this.delayNotifierSubscriptions.push(notifierSubscription); } }; DelayWhenSubscriber.prototype.tryComplete = function () { if (this.completed && this.delayNotifierSubscriptions.length === 0) { this.destination.complete(); } }; return DelayWhenSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"])); var SubscriptionDelayObservable = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubscriptionDelayObservable, _super); function SubscriptionDelayObservable(source, subscriptionDelay) { var _this = _super.call(this) || this; _this.source = source; _this.subscriptionDelay = subscriptionDelay; return _this; } SubscriptionDelayObservable.prototype._subscribe = function (subscriber) { this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source)); }; return SubscriptionDelayObservable; }(_Observable__WEBPACK_IMPORTED_MODULE_2__["Observable"])); var SubscriptionDelaySubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubscriptionDelaySubscriber, _super); function SubscriptionDelaySubscriber(parent, source) { var _this = _super.call(this) || this; _this.parent = parent; _this.source = source; _this.sourceSubscribed = false; return _this; } SubscriptionDelaySubscriber.prototype._next = function (unused) { this.subscribeToSource(); }; SubscriptionDelaySubscriber.prototype._error = function (err) { this.unsubscribe(); this.parent.error(err); }; SubscriptionDelaySubscriber.prototype._complete = function () { this.subscribeToSource(); }; SubscriptionDelaySubscriber.prototype.subscribeToSource = function () { if (!this.sourceSubscribed) { this.sourceSubscribed = true; this.unsubscribe(); this.source.subscribe(this.parent); } }; return SubscriptionDelaySubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=delayWhen.js.map /***/ }), /* 282 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return dematerialize; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function dematerialize() { return function dematerializeOperatorFunction(source) { return source.lift(new DeMaterializeOperator()); }; } var DeMaterializeOperator = /*@__PURE__*/ (function () { function DeMaterializeOperator() { } DeMaterializeOperator.prototype.call = function (subscriber, source) { return source.subscribe(new DeMaterializeSubscriber(subscriber)); }; return DeMaterializeOperator; }()); var DeMaterializeSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DeMaterializeSubscriber, _super); function DeMaterializeSubscriber(destination) { return _super.call(this, destination) || this; } DeMaterializeSubscriber.prototype._next = function (value) { value.observe(this.destination); }; return DeMaterializeSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=dematerialize.js.map /***/ }), /* 283 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DistinctSubscriber", function() { return DistinctSubscriber; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function distinct(keySelector, flushes) { return function (source) { return source.lift(new DistinctOperator(keySelector, flushes)); }; } var DistinctOperator = /*@__PURE__*/ (function () { function DistinctOperator(keySelector, flushes) { this.keySelector = keySelector; this.flushes = flushes; } DistinctOperator.prototype.call = function (subscriber, source) { return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes)); }; return DistinctOperator; }()); var DistinctSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DistinctSubscriber, _super); function DistinctSubscriber(destination, keySelector, flushes) { var _this = _super.call(this, destination) || this; _this.keySelector = keySelector; _this.values = new Set(); if (flushes) { _this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, flushes)); } return _this; } DistinctSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.values.clear(); }; DistinctSubscriber.prototype.notifyError = function (error, innerSub) { this._error(error); }; DistinctSubscriber.prototype._next = function (value) { if (this.keySelector) { this._useKeySelector(value); } else { this._finalizeNext(value, value); } }; DistinctSubscriber.prototype._useKeySelector = function (value) { var key; var destination = this.destination; try { key = this.keySelector(value); } catch (err) { destination.error(err); return; } this._finalizeNext(key, value); }; DistinctSubscriber.prototype._finalizeNext = function (key, value) { var values = this.values; if (!values.has(key)) { values.add(key); this.destination.next(value); } }; return DistinctSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"])); //# sourceMappingURL=distinct.js.map /***/ }), /* 284 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return distinctUntilChanged; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(174); /* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(175); /** PURE_IMPORTS_START tslib,_Subscriber,_util_tryCatch,_util_errorObject PURE_IMPORTS_END */ function distinctUntilChanged(compare, keySelector) { return function (source) { return source.lift(new DistinctUntilChangedOperator(compare, keySelector)); }; } var DistinctUntilChangedOperator = /*@__PURE__*/ (function () { function DistinctUntilChangedOperator(compare, keySelector) { this.compare = compare; this.keySelector = keySelector; } DistinctUntilChangedOperator.prototype.call = function (subscriber, source) { return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector)); }; return DistinctUntilChangedOperator; }()); var DistinctUntilChangedSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](DistinctUntilChangedSubscriber, _super); function DistinctUntilChangedSubscriber(destination, compare, keySelector) { var _this = _super.call(this, destination) || this; _this.keySelector = keySelector; _this.hasKey = false; if (typeof compare === 'function') { _this.compare = compare; } return _this; } DistinctUntilChangedSubscriber.prototype.compare = function (x, y) { return x === y; }; DistinctUntilChangedSubscriber.prototype._next = function (value) { var keySelector = this.keySelector; var key = value; if (keySelector) { key = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(this.keySelector)(value); if (key === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) { return this.destination.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"].e); } } var result = false; if (this.hasKey) { result = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(this.compare)(this.key, key); if (result === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) { return this.destination.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"].e); } } else { this.hasKey = true; } if (Boolean(result) === false) { this.key = key; this.destination.next(value); } }; return DistinctUntilChangedSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=distinctUntilChanged.js.map /***/ }), /* 285 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return distinctUntilKeyChanged; }); /* harmony import */ var _distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(284); /** PURE_IMPORTS_START _distinctUntilChanged PURE_IMPORTS_END */ function distinctUntilKeyChanged(key, compare) { return Object(_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__["distinctUntilChanged"])(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; }); } //# sourceMappingURL=distinctUntilKeyChanged.js.map /***/ }), /* 286 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return elementAt; }); /* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(217); /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(287); /* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(288); /* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(278); /* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(290); /** PURE_IMPORTS_START _util_ArgumentOutOfRangeError,_filter,_throwIfEmpty,_defaultIfEmpty,_take PURE_IMPORTS_END */ function elementAt(index, defaultValue) { if (index < 0) { throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__["ArgumentOutOfRangeError"](); } var hasDefaultValue = arguments.length >= 2; return function (source) { return source.pipe(Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(function (v, i) { return i === index; }), Object(_take__WEBPACK_IMPORTED_MODULE_4__["take"])(1), hasDefaultValue ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__["defaultIfEmpty"])(defaultValue) : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_2__["throwIfEmpty"])(function () { return new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_0__["ArgumentOutOfRangeError"](); })); }; } //# sourceMappingURL=elementAt.js.map /***/ }), /* 287 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return filter; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function filter(predicate, thisArg) { return function filterOperatorFunction(source) { return source.lift(new FilterOperator(predicate, thisArg)); }; } var FilterOperator = /*@__PURE__*/ (function () { function FilterOperator(predicate, thisArg) { this.predicate = predicate; this.thisArg = thisArg; } FilterOperator.prototype.call = function (subscriber, source) { return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg)); }; return FilterOperator; }()); var FilterSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](FilterSubscriber, _super); function FilterSubscriber(destination, predicate, thisArg) { var _this = _super.call(this, destination) || this; _this.predicate = predicate; _this.thisArg = thisArg; _this.count = 0; return _this; } FilterSubscriber.prototype._next = function (value) { var result; try { result = this.predicate.call(this.thisArg, value, this.count++); } catch (err) { this.destination.error(err); return; } if (result) { this.destination.next(value); } }; return FilterSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=filter.js.map /***/ }), /* 288 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return throwIfEmpty; }); /* harmony import */ var _tap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(289); /* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(218); /** PURE_IMPORTS_START _tap,_util_EmptyError PURE_IMPORTS_END */ var throwIfEmpty = function (errorFactory) { if (errorFactory === void 0) { errorFactory = defaultErrorFactory; } return Object(_tap__WEBPACK_IMPORTED_MODULE_0__["tap"])({ hasValue: false, next: function () { this.hasValue = true; }, complete: function () { if (!this.hasValue) { throw errorFactory(); } } }); }; function defaultErrorFactory() { return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_1__["EmptyError"](); } //# sourceMappingURL=throwIfEmpty.js.map /***/ }), /* 289 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return tap; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(180); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(167); /** PURE_IMPORTS_START tslib,_Subscriber,_util_noop,_util_isFunction PURE_IMPORTS_END */ function tap(nextOrObserver, error, complete) { return function tapOperatorFunction(source) { return source.lift(new DoOperator(nextOrObserver, error, complete)); }; } var DoOperator = /*@__PURE__*/ (function () { function DoOperator(nextOrObserver, error, complete) { this.nextOrObserver = nextOrObserver; this.error = error; this.complete = complete; } DoOperator.prototype.call = function (subscriber, source) { return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete)); }; return DoOperator; }()); var TapSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TapSubscriber, _super); function TapSubscriber(destination, observerOrNext, error, complete) { var _this = _super.call(this, destination) || this; _this._tapNext = _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"]; _this._tapError = _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"]; _this._tapComplete = _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"]; _this._tapError = error || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"]; _this._tapComplete = complete || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"]; if (Object(_util_isFunction__WEBPACK_IMPORTED_MODULE_3__["isFunction"])(observerOrNext)) { _this._context = _this; _this._tapNext = observerOrNext; } else if (observerOrNext) { _this._context = observerOrNext; _this._tapNext = observerOrNext.next || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"]; _this._tapError = observerOrNext.error || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"]; _this._tapComplete = observerOrNext.complete || _util_noop__WEBPACK_IMPORTED_MODULE_2__["noop"]; } return _this; } TapSubscriber.prototype._next = function (value) { try { this._tapNext.call(this._context, value); } catch (err) { this.destination.error(err); return; } this.destination.next(value); }; TapSubscriber.prototype._error = function (err) { try { this._tapError.call(this._context, err); } catch (err) { this.destination.error(err); return; } this.destination.error(err); }; TapSubscriber.prototype._complete = function () { try { this._tapComplete.call(this._context); } catch (err) { this.destination.error(err); return; } return this.destination.complete(); }; return TapSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=tap.js.map /***/ }), /* 290 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return take; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(217); /* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(198); /** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */ function take(count) { return function (source) { if (count === 0) { return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_3__["empty"])(); } else { return source.lift(new TakeOperator(count)); } }; } var TakeOperator = /*@__PURE__*/ (function () { function TakeOperator(total) { this.total = total; if (this.total < 0) { throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__["ArgumentOutOfRangeError"]; } } TakeOperator.prototype.call = function (subscriber, source) { return source.subscribe(new TakeSubscriber(subscriber, this.total)); }; return TakeOperator; }()); var TakeSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeSubscriber, _super); function TakeSubscriber(destination, total) { var _this = _super.call(this, destination) || this; _this.total = total; _this.count = 0; return _this; } TakeSubscriber.prototype._next = function (value) { var total = this.total; var count = ++this.count; if (count <= total) { this.destination.next(value); if (count === total) { this.destination.complete(); this.unsubscribe(); } } }; return TakeSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=take.js.map /***/ }), /* 291 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endWith", function() { return endWith; }); /* harmony import */ var _observable_fromArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(201); /* harmony import */ var _observable_scalar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(203); /* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(198); /* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(234); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(200); /** PURE_IMPORTS_START _observable_fromArray,_observable_scalar,_observable_empty,_observable_concat,_util_isScheduler PURE_IMPORTS_END */ function endWith() { var array = []; for (var _i = 0; _i < arguments.length; _i++) { array[_i] = arguments[_i]; } return function (source) { var scheduler = array[array.length - 1]; if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(scheduler)) { array.pop(); } else { scheduler = null; } var len = array.length; if (len === 1 && !scheduler) { return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_3__["concat"])(source, Object(_observable_scalar__WEBPACK_IMPORTED_MODULE_1__["scalar"])(array[0])); } else if (len > 0) { return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_3__["concat"])(source, Object(_observable_fromArray__WEBPACK_IMPORTED_MODULE_0__["fromArray"])(array, scheduler)); } else { return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_3__["concat"])(source, Object(_observable_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])(scheduler)); } }; } //# sourceMappingURL=endWith.js.map /***/ }), /* 292 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return every; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function every(predicate, thisArg) { return function (source) { return source.lift(new EveryOperator(predicate, thisArg, source)); }; } var EveryOperator = /*@__PURE__*/ (function () { function EveryOperator(predicate, thisArg, source) { this.predicate = predicate; this.thisArg = thisArg; this.source = source; } EveryOperator.prototype.call = function (observer, source) { return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source)); }; return EveryOperator; }()); var EverySubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](EverySubscriber, _super); function EverySubscriber(destination, predicate, thisArg, source) { var _this = _super.call(this, destination) || this; _this.predicate = predicate; _this.thisArg = thisArg; _this.source = source; _this.index = 0; _this.thisArg = thisArg || _this; return _this; } EverySubscriber.prototype.notifyComplete = function (everyValueMatch) { this.destination.next(everyValueMatch); this.destination.complete(); }; EverySubscriber.prototype._next = function (value) { var result = false; try { result = this.predicate.call(this.thisArg, value, this.index++, this.source); } catch (err) { this.destination.error(err); return; } if (!result) { this.notifyComplete(false); } }; EverySubscriber.prototype._complete = function () { this.notifyComplete(true); }; return EverySubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=every.js.map /***/ }), /* 293 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return exhaust; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function exhaust() { return function (source) { return source.lift(new SwitchFirstOperator()); }; } var SwitchFirstOperator = /*@__PURE__*/ (function () { function SwitchFirstOperator() { } SwitchFirstOperator.prototype.call = function (subscriber, source) { return source.subscribe(new SwitchFirstSubscriber(subscriber)); }; return SwitchFirstOperator; }()); var SwitchFirstSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SwitchFirstSubscriber, _super); function SwitchFirstSubscriber(destination) { var _this = _super.call(this, destination) || this; _this.hasCompleted = false; _this.hasSubscription = false; return _this; } SwitchFirstSubscriber.prototype._next = function (value) { if (!this.hasSubscription) { this.hasSubscription = true; this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, value)); } }; SwitchFirstSubscriber.prototype._complete = function () { this.hasCompleted = true; if (!this.hasSubscription) { this.destination.complete(); } }; SwitchFirstSubscriber.prototype.notifyComplete = function (innerSub) { this.remove(innerSub); this.hasSubscription = false; if (this.hasCompleted) { this.destination.complete(); } }; return SwitchFirstSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"])); //# sourceMappingURL=exhaust.js.map /***/ }), /* 294 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return exhaustMap; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(225); /* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(221); /* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(235); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */ function exhaustMap(project, resultSelector) { if (resultSelector) { return function (source) { return source.pipe(exhaustMap(function (a, i) { return Object(_observable_from__WEBPACK_IMPORTED_MODULE_4__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (b, ii) { return resultSelector(a, b, i, ii); })); })); }; } return function (source) { return source.lift(new ExhauseMapOperator(project)); }; } var ExhauseMapOperator = /*@__PURE__*/ (function () { function ExhauseMapOperator(project) { this.project = project; } ExhauseMapOperator.prototype.call = function (subscriber, source) { return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project)); }; return ExhauseMapOperator; }()); var ExhaustMapSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ExhaustMapSubscriber, _super); function ExhaustMapSubscriber(destination, project) { var _this = _super.call(this, destination) || this; _this.project = project; _this.hasSubscription = false; _this.hasCompleted = false; _this.index = 0; return _this; } ExhaustMapSubscriber.prototype._next = function (value) { if (!this.hasSubscription) { this.tryNext(value); } }; ExhaustMapSubscriber.prototype.tryNext = function (value) { var index = this.index++; var destination = this.destination; try { var result = this.project(value, index); this.hasSubscription = true; this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, result, value, index)); } catch (err) { destination.error(err); } }; ExhaustMapSubscriber.prototype._complete = function () { this.hasCompleted = true; if (!this.hasSubscription) { this.destination.complete(); } }; ExhaustMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.destination.next(innerValue); }; ExhaustMapSubscriber.prototype.notifyError = function (err) { this.destination.error(err); }; ExhaustMapSubscriber.prototype.notifyComplete = function (innerSub) { this.remove(innerSub); this.hasSubscription = false; if (this.hasCompleted) { this.destination.complete(); } }; return ExhaustMapSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"])); //# sourceMappingURL=exhaustMap.js.map /***/ }), /* 295 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return expand; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpandOperator", function() { return ExpandOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExpandSubscriber", function() { return ExpandSubscriber; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(174); /* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(175); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function expand(project, concurrent, scheduler) { if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } if (scheduler === void 0) { scheduler = undefined; } concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent; return function (source) { return source.lift(new ExpandOperator(project, concurrent, scheduler)); }; } var ExpandOperator = /*@__PURE__*/ (function () { function ExpandOperator(project, concurrent, scheduler) { this.project = project; this.concurrent = concurrent; this.scheduler = scheduler; } ExpandOperator.prototype.call = function (subscriber, source) { return source.subscribe(new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler)); }; return ExpandOperator; }()); var ExpandSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ExpandSubscriber, _super); function ExpandSubscriber(destination, project, concurrent, scheduler) { var _this = _super.call(this, destination) || this; _this.project = project; _this.concurrent = concurrent; _this.scheduler = scheduler; _this.index = 0; _this.active = 0; _this.hasCompleted = false; if (concurrent < Number.POSITIVE_INFINITY) { _this.buffer = []; } return _this; } ExpandSubscriber.dispatch = function (arg) { var subscriber = arg.subscriber, result = arg.result, value = arg.value, index = arg.index; subscriber.subscribeToProjection(result, value, index); }; ExpandSubscriber.prototype._next = function (value) { var destination = this.destination; if (destination.closed) { this._complete(); return; } var index = this.index++; if (this.active < this.concurrent) { destination.next(value); var result = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_1__["tryCatch"])(this.project)(value, index); if (result === _util_errorObject__WEBPACK_IMPORTED_MODULE_2__["errorObject"]) { destination.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_2__["errorObject"].e); } else if (!this.scheduler) { this.subscribeToProjection(result, value, index); } else { var state = { subscriber: this, result: result, value: value, index: index }; this.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state)); } } else { this.buffer.push(value); } }; ExpandSubscriber.prototype.subscribeToProjection = function (result, value, index) { this.active++; this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, result, value, index)); }; ExpandSubscriber.prototype._complete = function () { this.hasCompleted = true; if (this.hasCompleted && this.active === 0) { this.destination.complete(); } }; ExpandSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this._next(innerValue); }; ExpandSubscriber.prototype.notifyComplete = function (innerSub) { var buffer = this.buffer; this.remove(innerSub); this.active--; if (buffer && buffer.length > 0) { this._next(buffer.shift()); } if (this.hasCompleted && this.active === 0) { this.destination.complete(); } }; return ExpandSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"])); //# sourceMappingURL=expand.js.map /***/ }), /* 296 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return finalize; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(171); /** PURE_IMPORTS_START tslib,_Subscriber,_Subscription PURE_IMPORTS_END */ function finalize(callback) { return function (source) { return source.lift(new FinallyOperator(callback)); }; } var FinallyOperator = /*@__PURE__*/ (function () { function FinallyOperator(callback) { this.callback = callback; } FinallyOperator.prototype.call = function (subscriber, source) { return source.subscribe(new FinallySubscriber(subscriber, this.callback)); }; return FinallyOperator; }()); var FinallySubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](FinallySubscriber, _super); function FinallySubscriber(destination, callback) { var _this = _super.call(this, destination) || this; _this.add(new _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"](callback)); return _this; } return FinallySubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=finalize.js.map /***/ }), /* 297 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return find; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindValueOperator", function() { return FindValueOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FindValueSubscriber", function() { return FindValueSubscriber; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function find(predicate, thisArg) { if (typeof predicate !== 'function') { throw new TypeError('predicate is not a function'); } return function (source) { return source.lift(new FindValueOperator(predicate, source, false, thisArg)); }; } var FindValueOperator = /*@__PURE__*/ (function () { function FindValueOperator(predicate, source, yieldIndex, thisArg) { this.predicate = predicate; this.source = source; this.yieldIndex = yieldIndex; this.thisArg = thisArg; } FindValueOperator.prototype.call = function (observer, source) { return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg)); }; return FindValueOperator; }()); var FindValueSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](FindValueSubscriber, _super); function FindValueSubscriber(destination, predicate, source, yieldIndex, thisArg) { var _this = _super.call(this, destination) || this; _this.predicate = predicate; _this.source = source; _this.yieldIndex = yieldIndex; _this.thisArg = thisArg; _this.index = 0; return _this; } FindValueSubscriber.prototype.notifyComplete = function (value) { var destination = this.destination; destination.next(value); destination.complete(); }; FindValueSubscriber.prototype._next = function (value) { var _a = this, predicate = _a.predicate, thisArg = _a.thisArg; var index = this.index++; try { var result = predicate.call(thisArg || this, value, index, this.source); if (result) { this.notifyComplete(this.yieldIndex ? index : value); } } catch (err) { this.destination.error(err); } }; FindValueSubscriber.prototype._complete = function () { this.notifyComplete(this.yieldIndex ? -1 : undefined); }; return FindValueSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=find.js.map /***/ }), /* 298 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return findIndex; }); /* harmony import */ var _operators_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(297); /** PURE_IMPORTS_START _operators_find PURE_IMPORTS_END */ function findIndex(predicate, thisArg) { return function (source) { return source.lift(new _operators_find__WEBPACK_IMPORTED_MODULE_0__["FindValueOperator"](predicate, source, true, thisArg)); }; } //# sourceMappingURL=findIndex.js.map /***/ }), /* 299 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; }); /* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(218); /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(287); /* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(290); /* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(278); /* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(288); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(215); /** PURE_IMPORTS_START _util_EmptyError,_filter,_take,_defaultIfEmpty,_throwIfEmpty,_util_identity PURE_IMPORTS_END */ function first(predicate, defaultValue) { var hasDefaultValue = arguments.length >= 2; return function (source) { return source.pipe(predicate ? Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(function (v, i) { return predicate(v, i, source); }) : _util_identity__WEBPACK_IMPORTED_MODULE_5__["identity"], Object(_take__WEBPACK_IMPORTED_MODULE_2__["take"])(1), hasDefaultValue ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__["defaultIfEmpty"])(defaultValue) : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__["throwIfEmpty"])(function () { return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"](); })); }; } //# sourceMappingURL=first.js.map /***/ }), /* 300 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return ignoreElements; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function ignoreElements() { return function ignoreElementsOperatorFunction(source) { return source.lift(new IgnoreElementsOperator()); }; } var IgnoreElementsOperator = /*@__PURE__*/ (function () { function IgnoreElementsOperator() { } IgnoreElementsOperator.prototype.call = function (subscriber, source) { return source.subscribe(new IgnoreElementsSubscriber(subscriber)); }; return IgnoreElementsOperator; }()); var IgnoreElementsSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](IgnoreElementsSubscriber, _super); function IgnoreElementsSubscriber() { return _super !== null && _super.apply(this, arguments) || this; } IgnoreElementsSubscriber.prototype._next = function (unused) { }; return IgnoreElementsSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=ignoreElements.js.map /***/ }), /* 301 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return isEmpty; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function isEmpty() { return function (source) { return source.lift(new IsEmptyOperator()); }; } var IsEmptyOperator = /*@__PURE__*/ (function () { function IsEmptyOperator() { } IsEmptyOperator.prototype.call = function (observer, source) { return source.subscribe(new IsEmptySubscriber(observer)); }; return IsEmptyOperator; }()); var IsEmptySubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](IsEmptySubscriber, _super); function IsEmptySubscriber(destination) { return _super.call(this, destination) || this; } IsEmptySubscriber.prototype.notifyComplete = function (isEmpty) { var destination = this.destination; destination.next(isEmpty); destination.complete(); }; IsEmptySubscriber.prototype._next = function (value) { this.notifyComplete(false); }; IsEmptySubscriber.prototype._complete = function () { this.notifyComplete(true); }; return IsEmptySubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=isEmpty.js.map /***/ }), /* 302 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return last; }); /* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(218); /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(287); /* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(303); /* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(288); /* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(278); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(215); /** PURE_IMPORTS_START _util_EmptyError,_filter,_takeLast,_throwIfEmpty,_defaultIfEmpty,_util_identity PURE_IMPORTS_END */ function last(predicate, defaultValue) { var hasDefaultValue = arguments.length >= 2; return function (source) { return source.pipe(predicate ? Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(function (v, i) { return predicate(v, i, source); }) : _util_identity__WEBPACK_IMPORTED_MODULE_5__["identity"], Object(_takeLast__WEBPACK_IMPORTED_MODULE_2__["takeLast"])(1), hasDefaultValue ? Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_4__["defaultIfEmpty"])(defaultValue) : Object(_throwIfEmpty__WEBPACK_IMPORTED_MODULE_3__["throwIfEmpty"])(function () { return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__["EmptyError"](); })); }; } //# sourceMappingURL=last.js.map /***/ }), /* 303 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return takeLast; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(217); /* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(198); /** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */ function takeLast(count) { return function takeLastOperatorFunction(source) { if (count === 0) { return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_3__["empty"])(); } else { return source.lift(new TakeLastOperator(count)); } }; } var TakeLastOperator = /*@__PURE__*/ (function () { function TakeLastOperator(total) { this.total = total; if (this.total < 0) { throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__["ArgumentOutOfRangeError"]; } } TakeLastOperator.prototype.call = function (subscriber, source) { return source.subscribe(new TakeLastSubscriber(subscriber, this.total)); }; return TakeLastOperator; }()); var TakeLastSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeLastSubscriber, _super); function TakeLastSubscriber(destination, total) { var _this = _super.call(this, destination) || this; _this.total = total; _this.ring = new Array(); _this.count = 0; return _this; } TakeLastSubscriber.prototype._next = function (value) { var ring = this.ring; var total = this.total; var count = this.count++; if (ring.length < total) { ring.push(value); } else { var index = count % total; ring[index] = value; } }; TakeLastSubscriber.prototype._complete = function () { var destination = this.destination; var count = this.count; if (count > 0) { var total = this.count >= this.total ? this.total : this.count; var ring = this.ring; for (var i = 0; i < total; i++) { var idx = (count++) % total; destination.next(ring[idx]); } } destination.complete(); }; return TakeLastSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=takeLast.js.map /***/ }), /* 304 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return mapTo; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function mapTo(value) { return function (source) { return source.lift(new MapToOperator(value)); }; } var MapToOperator = /*@__PURE__*/ (function () { function MapToOperator(value) { this.value = value; } MapToOperator.prototype.call = function (subscriber, source) { return source.subscribe(new MapToSubscriber(subscriber, this.value)); }; return MapToOperator; }()); var MapToSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MapToSubscriber, _super); function MapToSubscriber(destination, value) { var _this = _super.call(this, destination) || this; _this.value = value; return _this; } MapToSubscriber.prototype._next = function (x) { this.destination.next(this.value); }; return MapToSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=mapTo.js.map /***/ }), /* 305 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return materialize; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _Notification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(197); /** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */ function materialize() { return function materializeOperatorFunction(source) { return source.lift(new MaterializeOperator()); }; } var MaterializeOperator = /*@__PURE__*/ (function () { function MaterializeOperator() { } MaterializeOperator.prototype.call = function (subscriber, source) { return source.subscribe(new MaterializeSubscriber(subscriber)); }; return MaterializeOperator; }()); var MaterializeSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MaterializeSubscriber, _super); function MaterializeSubscriber(destination) { return _super.call(this, destination) || this; } MaterializeSubscriber.prototype._next = function (value) { this.destination.next(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createNext(value)); }; MaterializeSubscriber.prototype._error = function (err) { var destination = this.destination; destination.next(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createError(err)); destination.complete(); }; MaterializeSubscriber.prototype._complete = function () { var destination = this.destination; destination.next(_Notification__WEBPACK_IMPORTED_MODULE_2__["Notification"].createComplete()); destination.complete(); }; return MaterializeSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=materialize.js.map /***/ }), /* 306 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return max; }); /* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307); /** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */ function max(comparer) { var max = (typeof comparer === 'function') ? function (x, y) { return comparer(x, y) > 0 ? x : y; } : function (x, y) { return x > y ? x : y; }; return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(max); } //# sourceMappingURL=max.js.map /***/ }), /* 307 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return reduce; }); /* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(308); /* harmony import */ var _takeLast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(303); /* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(278); /* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(179); /** PURE_IMPORTS_START _scan,_takeLast,_defaultIfEmpty,_util_pipe PURE_IMPORTS_END */ function reduce(accumulator, seed) { if (arguments.length >= 2) { return function reduceOperatorFunctionWithSeed(source) { return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipe"])(Object(_scan__WEBPACK_IMPORTED_MODULE_0__["scan"])(accumulator, seed), Object(_takeLast__WEBPACK_IMPORTED_MODULE_1__["takeLast"])(1), Object(_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_2__["defaultIfEmpty"])(seed))(source); }; } return function reduceOperatorFunction(source) { return Object(_util_pipe__WEBPACK_IMPORTED_MODULE_3__["pipe"])(Object(_scan__WEBPACK_IMPORTED_MODULE_0__["scan"])(function (acc, value, index) { return accumulator(acc, value, index + 1); }), Object(_takeLast__WEBPACK_IMPORTED_MODULE_1__["takeLast"])(1))(source); }; } //# sourceMappingURL=reduce.js.map /***/ }), /* 308 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return scan; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function scan(accumulator, seed) { var hasSeed = false; if (arguments.length >= 2) { hasSeed = true; } return function scanOperatorFunction(source) { return source.lift(new ScanOperator(accumulator, seed, hasSeed)); }; } var ScanOperator = /*@__PURE__*/ (function () { function ScanOperator(accumulator, seed, hasSeed) { if (hasSeed === void 0) { hasSeed = false; } this.accumulator = accumulator; this.seed = seed; this.hasSeed = hasSeed; } ScanOperator.prototype.call = function (subscriber, source) { return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed)); }; return ScanOperator; }()); var ScanSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ScanSubscriber, _super); function ScanSubscriber(destination, accumulator, _seed, hasSeed) { var _this = _super.call(this, destination) || this; _this.accumulator = accumulator; _this._seed = _seed; _this.hasSeed = hasSeed; _this.index = 0; return _this; } Object.defineProperty(ScanSubscriber.prototype, "seed", { get: function () { return this._seed; }, set: function (value) { this.hasSeed = true; this._seed = value; }, enumerable: true, configurable: true }); ScanSubscriber.prototype._next = function (value) { if (!this.hasSeed) { this.seed = value; this.destination.next(value); } else { return this._tryNext(value); } }; ScanSubscriber.prototype._tryNext = function (value) { var index = this.index++; var result; try { result = this.accumulator(this.seed, value, index); } catch (err) { this.destination.error(err); } this.seed = result; this.destination.next(result); }; return ScanSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=scan.js.map /***/ }), /* 309 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; }); /* harmony import */ var _observable_merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(252); /** PURE_IMPORTS_START _observable_merge PURE_IMPORTS_END */ function merge() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i] = arguments[_i]; } return function (source) { return source.lift.call(_observable_merge__WEBPACK_IMPORTED_MODULE_0__["merge"].apply(void 0, [source].concat(observables))); }; } //# sourceMappingURL=merge.js.map /***/ }), /* 310 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return mergeMapTo; }); /* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(243); /** PURE_IMPORTS_START _mergeMap PURE_IMPORTS_END */ function mergeMapTo(innerObservable, resultSelector, concurrent) { if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } if (typeof resultSelector === 'function') { return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(function () { return innerObservable; }, resultSelector, concurrent); } if (typeof resultSelector === 'number') { concurrent = resultSelector; } return Object(_mergeMap__WEBPACK_IMPORTED_MODULE_0__["mergeMap"])(function () { return innerObservable; }, concurrent); } //# sourceMappingURL=mergeMapTo.js.map /***/ }), /* 311 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return mergeScan; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeScanOperator", function() { return MergeScanOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MergeScanSubscriber", function() { return MergeScanSubscriber; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(174); /* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(175); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(225); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(224); /** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_util_subscribeToResult,_OuterSubscriber PURE_IMPORTS_END */ function mergeScan(accumulator, seed, concurrent) { if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; } return function (source) { return source.lift(new MergeScanOperator(accumulator, seed, concurrent)); }; } var MergeScanOperator = /*@__PURE__*/ (function () { function MergeScanOperator(accumulator, seed, concurrent) { this.accumulator = accumulator; this.seed = seed; this.concurrent = concurrent; } MergeScanOperator.prototype.call = function (subscriber, source) { return source.subscribe(new MergeScanSubscriber(subscriber, this.accumulator, this.seed, this.concurrent)); }; return MergeScanOperator; }()); var MergeScanSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](MergeScanSubscriber, _super); function MergeScanSubscriber(destination, accumulator, acc, concurrent) { var _this = _super.call(this, destination) || this; _this.accumulator = accumulator; _this.acc = acc; _this.concurrent = concurrent; _this.hasValue = false; _this.hasCompleted = false; _this.buffer = []; _this.active = 0; _this.index = 0; return _this; } MergeScanSubscriber.prototype._next = function (value) { if (this.active < this.concurrent) { var index = this.index++; var ish = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_1__["tryCatch"])(this.accumulator)(this.acc, value); var destination = this.destination; if (ish === _util_errorObject__WEBPACK_IMPORTED_MODULE_2__["errorObject"]) { destination.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_2__["errorObject"].e); } else { this.active++; this._innerSub(ish, value, index); } } else { this.buffer.push(value); } }; MergeScanSubscriber.prototype._innerSub = function (ish, value, index) { this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(this, ish, value, index)); }; MergeScanSubscriber.prototype._complete = function () { this.hasCompleted = true; if (this.active === 0 && this.buffer.length === 0) { if (this.hasValue === false) { this.destination.next(this.acc); } this.destination.complete(); } }; MergeScanSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { var destination = this.destination; this.acc = innerValue; this.hasValue = true; destination.next(innerValue); }; MergeScanSubscriber.prototype.notifyComplete = function (innerSub) { var buffer = this.buffer; this.remove(innerSub); this.active--; if (buffer.length > 0) { this._next(buffer.shift()); } else if (this.active === 0 && this.hasCompleted) { if (this.hasValue === false) { this.destination.next(this.acc); } this.destination.complete(); } }; return MergeScanSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"])); //# sourceMappingURL=mergeScan.js.map /***/ }), /* 312 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return min; }); /* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307); /** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */ function min(comparer) { var min = (typeof comparer === 'function') ? function (x, y) { return comparer(x, y) < 0 ? x : y; } : function (x, y) { return x < y ? x : y; }; return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(min); } //# sourceMappingURL=min.js.map /***/ }), /* 313 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return multicast; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MulticastOperator", function() { return MulticastOperator; }); /* harmony import */ var _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(181); /** PURE_IMPORTS_START _observable_ConnectableObservable PURE_IMPORTS_END */ function multicast(subjectOrSubjectFactory, selector) { return function multicastOperatorFunction(source) { var subjectFactory; if (typeof subjectOrSubjectFactory === 'function') { subjectFactory = subjectOrSubjectFactory; } else { subjectFactory = function subjectFactory() { return subjectOrSubjectFactory; }; } if (typeof selector === 'function') { return source.lift(new MulticastOperator(subjectFactory, selector)); } var connectable = Object.create(source, _observable_ConnectableObservable__WEBPACK_IMPORTED_MODULE_0__["connectableObservableDescriptor"]); connectable.source = source; connectable.subjectFactory = subjectFactory; return connectable; }; } var MulticastOperator = /*@__PURE__*/ (function () { function MulticastOperator(subjectFactory, selector) { this.subjectFactory = subjectFactory; this.selector = selector; } MulticastOperator.prototype.call = function (subscriber, source) { var selector = this.selector; var subject = this.subjectFactory(); var subscription = selector(subject).subscribe(subscriber); subscription.add(source.subscribe(subject)); return subscription; }; return MulticastOperator; }()); //# sourceMappingURL=multicast.js.map /***/ }), /* 314 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return onErrorResumeNext; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNextStatic", function() { return onErrorResumeNextStatic; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(235); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(172); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_observable_from,_util_isArray,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function onErrorResumeNext() { var nextSources = []; for (var _i = 0; _i < arguments.length; _i++) { nextSources[_i] = arguments[_i]; } if (nextSources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(nextSources[0])) { nextSources = nextSources[0]; } return function (source) { return source.lift(new OnErrorResumeNextOperator(nextSources)); }; } function onErrorResumeNextStatic() { var nextSources = []; for (var _i = 0; _i < arguments.length; _i++) { nextSources[_i] = arguments[_i]; } var source = null; if (nextSources.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_2__["isArray"])(nextSources[0])) { nextSources = nextSources[0]; } source = nextSources.shift(); return Object(_observable_from__WEBPACK_IMPORTED_MODULE_1__["from"])(source, null).lift(new OnErrorResumeNextOperator(nextSources)); } var OnErrorResumeNextOperator = /*@__PURE__*/ (function () { function OnErrorResumeNextOperator(nextSources) { this.nextSources = nextSources; } OnErrorResumeNextOperator.prototype.call = function (subscriber, source) { return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources)); }; return OnErrorResumeNextOperator; }()); var OnErrorResumeNextSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](OnErrorResumeNextSubscriber, _super); function OnErrorResumeNextSubscriber(destination, nextSources) { var _this = _super.call(this, destination) || this; _this.destination = destination; _this.nextSources = nextSources; return _this; } OnErrorResumeNextSubscriber.prototype.notifyError = function (error, innerSub) { this.subscribeToNextSource(); }; OnErrorResumeNextSubscriber.prototype.notifyComplete = function (innerSub) { this.subscribeToNextSource(); }; OnErrorResumeNextSubscriber.prototype._error = function (err) { this.subscribeToNextSource(); }; OnErrorResumeNextSubscriber.prototype._complete = function () { this.subscribeToNextSource(); }; OnErrorResumeNextSubscriber.prototype.subscribeToNextSource = function () { var next = this.nextSources.shift(); if (next) { this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(this, next)); } else { this.destination.complete(); } }; return OnErrorResumeNextSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"])); //# sourceMappingURL=onErrorResumeNext.js.map /***/ }), /* 315 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return pairwise; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function pairwise() { return function (source) { return source.lift(new PairwiseOperator()); }; } var PairwiseOperator = /*@__PURE__*/ (function () { function PairwiseOperator() { } PairwiseOperator.prototype.call = function (subscriber, source) { return source.subscribe(new PairwiseSubscriber(subscriber)); }; return PairwiseOperator; }()); var PairwiseSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](PairwiseSubscriber, _super); function PairwiseSubscriber(destination) { var _this = _super.call(this, destination) || this; _this.hasPrev = false; return _this; } PairwiseSubscriber.prototype._next = function (value) { if (this.hasPrev) { this.destination.next([this.prev, value]); } else { this.hasPrev = true; } this.prev = value; }; return PairwiseSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=pairwise.js.map /***/ }), /* 316 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return partition; }); /* harmony import */ var _util_not__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(317); /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(287); /** PURE_IMPORTS_START _util_not,_filter PURE_IMPORTS_END */ function partition(predicate, thisArg) { return function (source) { return [ Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(predicate, thisArg)(source), Object(_filter__WEBPACK_IMPORTED_MODULE_1__["filter"])(Object(_util_not__WEBPACK_IMPORTED_MODULE_0__["not"])(predicate, thisArg))(source) ]; }; } //# sourceMappingURL=partition.js.map /***/ }), /* 317 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "not", function() { return not; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ function not(pred, thisArg) { function notPred() { return !(notPred.pred.apply(notPred.thisArg, arguments)); } notPred.pred = pred; notPred.thisArg = thisArg; return notPred; } //# sourceMappingURL=not.js.map /***/ }), /* 318 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return pluck; }); /* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(221); /** PURE_IMPORTS_START _map PURE_IMPORTS_END */ function pluck() { var properties = []; for (var _i = 0; _i < arguments.length; _i++) { properties[_i] = arguments[_i]; } var length = properties.length; if (length === 0) { throw new Error('list of properties cannot be empty.'); } return function (source) { return Object(_map__WEBPACK_IMPORTED_MODULE_0__["map"])(plucker(properties, length))(source); }; } function plucker(props, length) { var mapper = function (x) { var currentProp = x; for (var i = 0; i < length; i++) { var p = currentProp[props[i]]; if (typeof p !== 'undefined') { currentProp = p; } else { return undefined; } } return currentProp; }; return mapper; } //# sourceMappingURL=pluck.js.map /***/ }), /* 319 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return publish; }); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(182); /* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(313); /** PURE_IMPORTS_START _Subject,_multicast PURE_IMPORTS_END */ function publish(selector) { return selector ? Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(function () { return new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"](); }, selector) : Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _Subject__WEBPACK_IMPORTED_MODULE_0__["Subject"]()); } //# sourceMappingURL=publish.js.map /***/ }), /* 320 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return publishBehavior; }); /* harmony import */ var _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(187); /* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(313); /** PURE_IMPORTS_START _BehaviorSubject,_multicast PURE_IMPORTS_END */ function publishBehavior(value) { return function (source) { return Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _BehaviorSubject__WEBPACK_IMPORTED_MODULE_0__["BehaviorSubject"](value))(source); }; } //# sourceMappingURL=publishBehavior.js.map /***/ }), /* 321 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return publishLast; }); /* harmony import */ var _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(205); /* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(313); /** PURE_IMPORTS_START _AsyncSubject,_multicast PURE_IMPORTS_END */ function publishLast() { return function (source) { return Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(new _AsyncSubject__WEBPACK_IMPORTED_MODULE_0__["AsyncSubject"]())(source); }; } //# sourceMappingURL=publishLast.js.map /***/ }), /* 322 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return publishReplay; }); /* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(188); /* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(313); /** PURE_IMPORTS_START _ReplaySubject,_multicast PURE_IMPORTS_END */ function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) { if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') { scheduler = selectorOrScheduler; } var selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined; var subject = new _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__["ReplaySubject"](bufferSize, windowTime, scheduler); return function (source) { return Object(_multicast__WEBPACK_IMPORTED_MODULE_1__["multicast"])(function () { return subject; }, selector)(source); }; } //# sourceMappingURL=publishReplay.js.map /***/ }), /* 323 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return race; }); /* harmony import */ var _util_isArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(172); /* harmony import */ var _observable_race__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(256); /** PURE_IMPORTS_START _util_isArray,_observable_race PURE_IMPORTS_END */ function race() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i] = arguments[_i]; } return function raceOperatorFunction(source) { if (observables.length === 1 && Object(_util_isArray__WEBPACK_IMPORTED_MODULE_0__["isArray"])(observables[0])) { observables = observables[0]; } return source.lift.call(_observable_race__WEBPACK_IMPORTED_MODULE_1__["race"].apply(void 0, [source].concat(observables))); }; } //# sourceMappingURL=race.js.map /***/ }), /* 324 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(198); /** PURE_IMPORTS_START tslib,_Subscriber,_observable_empty PURE_IMPORTS_END */ function repeat(count) { if (count === void 0) { count = -1; } return function (source) { if (count === 0) { return Object(_observable_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])(); } else if (count < 0) { return source.lift(new RepeatOperator(-1, source)); } else { return source.lift(new RepeatOperator(count - 1, source)); } }; } var RepeatOperator = /*@__PURE__*/ (function () { function RepeatOperator(count, source) { this.count = count; this.source = source; } RepeatOperator.prototype.call = function (subscriber, source) { return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source)); }; return RepeatOperator; }()); var RepeatSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RepeatSubscriber, _super); function RepeatSubscriber(destination, count, source) { var _this = _super.call(this, destination) || this; _this.count = count; _this.source = source; return _this; } RepeatSubscriber.prototype.complete = function () { if (!this.isStopped) { var _a = this, source = _a.source, count = _a.count; if (count === 0) { return _super.prototype.complete.call(this); } else if (count > -1) { this.count = count - 1; } source.subscribe(this._unsubscribeAndRecycle()); } }; return RepeatSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=repeat.js.map /***/ }), /* 325 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return repeatWhen; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(182); /* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(174); /* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(175); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_Subject,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function repeatWhen(notifier) { return function (source) { return source.lift(new RepeatWhenOperator(notifier)); }; } var RepeatWhenOperator = /*@__PURE__*/ (function () { function RepeatWhenOperator(notifier) { this.notifier = notifier; } RepeatWhenOperator.prototype.call = function (subscriber, source) { return source.subscribe(new RepeatWhenSubscriber(subscriber, this.notifier, source)); }; return RepeatWhenOperator; }()); var RepeatWhenSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RepeatWhenSubscriber, _super); function RepeatWhenSubscriber(destination, notifier, source) { var _this = _super.call(this, destination) || this; _this.notifier = notifier; _this.source = source; _this.sourceIsBeingSubscribedTo = true; return _this; } RepeatWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.sourceIsBeingSubscribedTo = true; this.source.subscribe(this); }; RepeatWhenSubscriber.prototype.notifyComplete = function (innerSub) { if (this.sourceIsBeingSubscribedTo === false) { return _super.prototype.complete.call(this); } }; RepeatWhenSubscriber.prototype.complete = function () { this.sourceIsBeingSubscribedTo = false; if (!this.isStopped) { if (!this.retries) { this.subscribeToRetries(); } if (!this.retriesSubscription || this.retriesSubscription.closed) { return _super.prototype.complete.call(this); } this._unsubscribeAndRecycle(); this.notifications.next(); } }; RepeatWhenSubscriber.prototype._unsubscribe = function () { var _a = this, notifications = _a.notifications, retriesSubscription = _a.retriesSubscription; if (notifications) { notifications.unsubscribe(); this.notifications = null; } if (retriesSubscription) { retriesSubscription.unsubscribe(); this.retriesSubscription = null; } this.retries = null; }; RepeatWhenSubscriber.prototype._unsubscribeAndRecycle = function () { var _unsubscribe = this._unsubscribe; this._unsubscribe = null; _super.prototype._unsubscribeAndRecycle.call(this); this._unsubscribe = _unsubscribe; return this; }; RepeatWhenSubscriber.prototype.subscribeToRetries = function () { this.notifications = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"](); var retries = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(this.notifier)(this.notifications); if (retries === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) { return _super.prototype.complete.call(this); } this.retries = retries; this.retriesSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, retries); }; return RepeatWhenSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"])); //# sourceMappingURL=repeatWhen.js.map /***/ }), /* 326 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return retry; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function retry(count) { if (count === void 0) { count = -1; } return function (source) { return source.lift(new RetryOperator(count, source)); }; } var RetryOperator = /*@__PURE__*/ (function () { function RetryOperator(count, source) { this.count = count; this.source = source; } RetryOperator.prototype.call = function (subscriber, source) { return source.subscribe(new RetrySubscriber(subscriber, this.count, this.source)); }; return RetryOperator; }()); var RetrySubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RetrySubscriber, _super); function RetrySubscriber(destination, count, source) { var _this = _super.call(this, destination) || this; _this.count = count; _this.source = source; return _this; } RetrySubscriber.prototype.error = function (err) { if (!this.isStopped) { var _a = this, source = _a.source, count = _a.count; if (count === 0) { return _super.prototype.error.call(this, err); } else if (count > -1) { this.count = count - 1; } source.subscribe(this._unsubscribeAndRecycle()); } }; return RetrySubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=retry.js.map /***/ }), /* 327 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return retryWhen; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(182); /* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(174); /* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(175); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_Subject,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function retryWhen(notifier) { return function (source) { return source.lift(new RetryWhenOperator(notifier, source)); }; } var RetryWhenOperator = /*@__PURE__*/ (function () { function RetryWhenOperator(notifier, source) { this.notifier = notifier; this.source = source; } RetryWhenOperator.prototype.call = function (subscriber, source) { return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source)); }; return RetryWhenOperator; }()); var RetryWhenSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](RetryWhenSubscriber, _super); function RetryWhenSubscriber(destination, notifier, source) { var _this = _super.call(this, destination) || this; _this.notifier = notifier; _this.source = source; return _this; } RetryWhenSubscriber.prototype.error = function (err) { if (!this.isStopped) { var errors = this.errors; var retries = this.retries; var retriesSubscription = this.retriesSubscription; if (!retries) { errors = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"](); retries = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(this.notifier)(errors); if (retries === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) { return _super.prototype.error.call(this, _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"].e); } retriesSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, retries); } else { this.errors = null; this.retriesSubscription = null; } this._unsubscribeAndRecycle(); this.errors = errors; this.retries = retries; this.retriesSubscription = retriesSubscription; errors.next(err); } }; RetryWhenSubscriber.prototype._unsubscribe = function () { var _a = this, errors = _a.errors, retriesSubscription = _a.retriesSubscription; if (errors) { errors.unsubscribe(); this.errors = null; } if (retriesSubscription) { retriesSubscription.unsubscribe(); this.retriesSubscription = null; } this.retries = null; }; RetryWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { var _unsubscribe = this._unsubscribe; this._unsubscribe = null; this._unsubscribeAndRecycle(); this._unsubscribe = _unsubscribe; this.source.subscribe(this); }; return RetryWhenSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"])); //# sourceMappingURL=retryWhen.js.map /***/ }), /* 328 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return sample; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function sample(notifier) { return function (source) { return source.lift(new SampleOperator(notifier)); }; } var SampleOperator = /*@__PURE__*/ (function () { function SampleOperator(notifier) { this.notifier = notifier; } SampleOperator.prototype.call = function (subscriber, source) { var sampleSubscriber = new SampleSubscriber(subscriber); var subscription = source.subscribe(sampleSubscriber); subscription.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(sampleSubscriber, this.notifier)); return subscription; }; return SampleOperator; }()); var SampleSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SampleSubscriber, _super); function SampleSubscriber() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.hasValue = false; return _this; } SampleSubscriber.prototype._next = function (value) { this.value = value; this.hasValue = true; }; SampleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.emitValue(); }; SampleSubscriber.prototype.notifyComplete = function () { this.emitValue(); }; SampleSubscriber.prototype.emitValue = function () { if (this.hasValue) { this.hasValue = false; this.destination.next(this.value); } }; return SampleSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"])); //# sourceMappingURL=sample.js.map /***/ }), /* 329 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return sampleTime; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(210); /** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */ function sampleTime(period, scheduler) { if (scheduler === void 0) { scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"]; } return function (source) { return source.lift(new SampleTimeOperator(period, scheduler)); }; } var SampleTimeOperator = /*@__PURE__*/ (function () { function SampleTimeOperator(period, scheduler) { this.period = period; this.scheduler = scheduler; } SampleTimeOperator.prototype.call = function (subscriber, source) { return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler)); }; return SampleTimeOperator; }()); var SampleTimeSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SampleTimeSubscriber, _super); function SampleTimeSubscriber(destination, period, scheduler) { var _this = _super.call(this, destination) || this; _this.period = period; _this.scheduler = scheduler; _this.hasValue = false; _this.add(scheduler.schedule(dispatchNotification, period, { subscriber: _this, period: period })); return _this; } SampleTimeSubscriber.prototype._next = function (value) { this.lastValue = value; this.hasValue = true; }; SampleTimeSubscriber.prototype.notifyNext = function () { if (this.hasValue) { this.hasValue = false; this.destination.next(this.lastValue); } }; return SampleTimeSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); function dispatchNotification(state) { var subscriber = state.subscriber, period = state.period; subscriber.notifyNext(); this.schedule(state, period); } //# sourceMappingURL=sampleTime.js.map /***/ }), /* 330 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return sequenceEqual; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SequenceEqualOperator", function() { return SequenceEqualOperator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SequenceEqualSubscriber", function() { return SequenceEqualSubscriber; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(174); /* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(175); /** PURE_IMPORTS_START tslib,_Subscriber,_util_tryCatch,_util_errorObject PURE_IMPORTS_END */ function sequenceEqual(compareTo, comparor) { return function (source) { return source.lift(new SequenceEqualOperator(compareTo, comparor)); }; } var SequenceEqualOperator = /*@__PURE__*/ (function () { function SequenceEqualOperator(compareTo, comparor) { this.compareTo = compareTo; this.comparor = comparor; } SequenceEqualOperator.prototype.call = function (subscriber, source) { return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparor)); }; return SequenceEqualOperator; }()); var SequenceEqualSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SequenceEqualSubscriber, _super); function SequenceEqualSubscriber(destination, compareTo, comparor) { var _this = _super.call(this, destination) || this; _this.compareTo = compareTo; _this.comparor = comparor; _this._a = []; _this._b = []; _this._oneComplete = false; _this.add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, _this))); return _this; } SequenceEqualSubscriber.prototype._next = function (value) { if (this._oneComplete && this._b.length === 0) { this.emit(false); } else { this._a.push(value); this.checkValues(); } }; SequenceEqualSubscriber.prototype._complete = function () { if (this._oneComplete) { this.emit(this._a.length === 0 && this._b.length === 0); } else { this._oneComplete = true; } }; SequenceEqualSubscriber.prototype.checkValues = function () { var _c = this, _a = _c._a, _b = _c._b, comparor = _c.comparor; while (_a.length > 0 && _b.length > 0) { var a = _a.shift(); var b = _b.shift(); var areEqual = false; if (comparor) { areEqual = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(comparor)(a, b); if (areEqual === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) { this.destination.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"].e); } } else { areEqual = a === b; } if (!areEqual) { this.emit(false); } } }; SequenceEqualSubscriber.prototype.emit = function (value) { var destination = this.destination; destination.next(value); destination.complete(); }; SequenceEqualSubscriber.prototype.nextB = function (value) { if (this._oneComplete && this._a.length === 0) { this.emit(false); } else { this._b.push(value); this.checkValues(); } }; return SequenceEqualSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); var SequenceEqualCompareToSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SequenceEqualCompareToSubscriber, _super); function SequenceEqualCompareToSubscriber(destination, parent) { var _this = _super.call(this, destination) || this; _this.parent = parent; return _this; } SequenceEqualCompareToSubscriber.prototype._next = function (value) { this.parent.nextB(value); }; SequenceEqualCompareToSubscriber.prototype._error = function (err) { this.parent.error(err); }; SequenceEqualCompareToSubscriber.prototype._complete = function () { this.parent._complete(); }; return SequenceEqualCompareToSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=sequenceEqual.js.map /***/ }), /* 331 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "share", function() { return share; }); /* harmony import */ var _multicast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(313); /* harmony import */ var _refCount__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(185); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(182); /** PURE_IMPORTS_START _multicast,_refCount,_Subject PURE_IMPORTS_END */ function shareSubjectFactory() { return new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"](); } function share() { return function (source) { return Object(_refCount__WEBPACK_IMPORTED_MODULE_1__["refCount"])()(Object(_multicast__WEBPACK_IMPORTED_MODULE_0__["multicast"])(shareSubjectFactory)(source)); }; } //# sourceMappingURL=share.js.map /***/ }), /* 332 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return shareReplay; }); /* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(188); /** PURE_IMPORTS_START _ReplaySubject PURE_IMPORTS_END */ function shareReplay(bufferSize, windowTime, scheduler) { return function (source) { return source.lift(shareReplayOperator(bufferSize, windowTime, scheduler)); }; } function shareReplayOperator(bufferSize, windowTime, scheduler) { var subject; var refCount = 0; var subscription; var hasError = false; var isComplete = false; return function shareReplayOperation(source) { refCount++; if (!subject || hasError) { hasError = false; subject = new _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__["ReplaySubject"](bufferSize, windowTime, scheduler); subscription = source.subscribe({ next: function (value) { subject.next(value); }, error: function (err) { hasError = true; subject.error(err); }, complete: function () { isComplete = true; subject.complete(); }, }); } var innerSub = subject.subscribe(this); return function () { refCount--; innerSub.unsubscribe(); if (subscription && refCount === 0 && isComplete) { subscription.unsubscribe(); } }; }; } //# sourceMappingURL=shareReplay.js.map /***/ }), /* 333 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "single", function() { return single; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(218); /** PURE_IMPORTS_START tslib,_Subscriber,_util_EmptyError PURE_IMPORTS_END */ function single(predicate) { return function (source) { return source.lift(new SingleOperator(predicate, source)); }; } var SingleOperator = /*@__PURE__*/ (function () { function SingleOperator(predicate, source) { this.predicate = predicate; this.source = source; } SingleOperator.prototype.call = function (subscriber, source) { return source.subscribe(new SingleSubscriber(subscriber, this.predicate, this.source)); }; return SingleOperator; }()); var SingleSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SingleSubscriber, _super); function SingleSubscriber(destination, predicate, source) { var _this = _super.call(this, destination) || this; _this.predicate = predicate; _this.source = source; _this.seenValue = false; _this.index = 0; return _this; } SingleSubscriber.prototype.applySingleValue = function (value) { if (this.seenValue) { this.destination.error('Sequence contains more than one element'); } else { this.seenValue = true; this.singleValue = value; } }; SingleSubscriber.prototype._next = function (value) { var index = this.index++; if (this.predicate) { this.tryNext(value, index); } else { this.applySingleValue(value); } }; SingleSubscriber.prototype.tryNext = function (value, index) { try { if (this.predicate(value, index, this.source)) { this.applySingleValue(value); } } catch (err) { this.destination.error(err); } }; SingleSubscriber.prototype._complete = function () { var destination = this.destination; if (this.index > 0) { destination.next(this.seenValue ? this.singleValue : undefined); destination.complete(); } else { destination.error(new _util_EmptyError__WEBPACK_IMPORTED_MODULE_2__["EmptyError"]); } }; return SingleSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=single.js.map /***/ }), /* 334 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return skip; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function skip(count) { return function (source) { return source.lift(new SkipOperator(count)); }; } var SkipOperator = /*@__PURE__*/ (function () { function SkipOperator(total) { this.total = total; } SkipOperator.prototype.call = function (subscriber, source) { return source.subscribe(new SkipSubscriber(subscriber, this.total)); }; return SkipOperator; }()); var SkipSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipSubscriber, _super); function SkipSubscriber(destination, total) { var _this = _super.call(this, destination) || this; _this.total = total; _this.count = 0; return _this; } SkipSubscriber.prototype._next = function (x) { if (++this.count > this.total) { this.destination.next(x); } }; return SkipSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=skip.js.map /***/ }), /* 335 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return skipLast; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(217); /** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError PURE_IMPORTS_END */ function skipLast(count) { return function (source) { return source.lift(new SkipLastOperator(count)); }; } var SkipLastOperator = /*@__PURE__*/ (function () { function SkipLastOperator(_skipCount) { this._skipCount = _skipCount; if (this._skipCount < 0) { throw new _util_ArgumentOutOfRangeError__WEBPACK_IMPORTED_MODULE_2__["ArgumentOutOfRangeError"]; } } SkipLastOperator.prototype.call = function (subscriber, source) { if (this._skipCount === 0) { return source.subscribe(new _Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"](subscriber)); } else { return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount)); } }; return SkipLastOperator; }()); var SkipLastSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipLastSubscriber, _super); function SkipLastSubscriber(destination, _skipCount) { var _this = _super.call(this, destination) || this; _this._skipCount = _skipCount; _this._count = 0; _this._ring = new Array(_skipCount); return _this; } SkipLastSubscriber.prototype._next = function (value) { var skipCount = this._skipCount; var count = this._count++; if (count < skipCount) { this._ring[count] = value; } else { var currentIndex = count % skipCount; var ring = this._ring; var oldValue = ring[currentIndex]; ring[currentIndex] = value; this.destination.next(oldValue); } }; return SkipLastSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=skipLast.js.map /***/ }), /* 336 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return skipUntil; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function skipUntil(notifier) { return function (source) { return source.lift(new SkipUntilOperator(notifier)); }; } var SkipUntilOperator = /*@__PURE__*/ (function () { function SkipUntilOperator(notifier) { this.notifier = notifier; } SkipUntilOperator.prototype.call = function (destination, source) { return source.subscribe(new SkipUntilSubscriber(destination, this.notifier)); }; return SkipUntilOperator; }()); var SkipUntilSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipUntilSubscriber, _super); function SkipUntilSubscriber(destination, notifier) { var _this = _super.call(this, destination) || this; _this.hasValue = false; _this.add(_this.innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, notifier)); return _this; } SkipUntilSubscriber.prototype._next = function (value) { if (this.hasValue) { _super.prototype._next.call(this, value); } }; SkipUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.hasValue = true; if (this.innerSubscription) { this.innerSubscription.unsubscribe(); } }; SkipUntilSubscriber.prototype.notifyComplete = function () { }; return SkipUntilSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"])); //# sourceMappingURL=skipUntil.js.map /***/ }), /* 337 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return skipWhile; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function skipWhile(predicate) { return function (source) { return source.lift(new SkipWhileOperator(predicate)); }; } var SkipWhileOperator = /*@__PURE__*/ (function () { function SkipWhileOperator(predicate) { this.predicate = predicate; } SkipWhileOperator.prototype.call = function (subscriber, source) { return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate)); }; return SkipWhileOperator; }()); var SkipWhileSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SkipWhileSubscriber, _super); function SkipWhileSubscriber(destination, predicate) { var _this = _super.call(this, destination) || this; _this.predicate = predicate; _this.skipping = true; _this.index = 0; return _this; } SkipWhileSubscriber.prototype._next = function (value) { var destination = this.destination; if (this.skipping) { this.tryCallPredicate(value); } if (!this.skipping) { destination.next(value); } }; SkipWhileSubscriber.prototype.tryCallPredicate = function (value) { try { var result = this.predicate(value, this.index++); this.skipping = Boolean(result); } catch (err) { this.destination.error(err); } }; return SkipWhileSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=skipWhile.js.map /***/ }), /* 338 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return startWith; }); /* harmony import */ var _observable_fromArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(201); /* harmony import */ var _observable_scalar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(203); /* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(198); /* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(234); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(200); /** PURE_IMPORTS_START _observable_fromArray,_observable_scalar,_observable_empty,_observable_concat,_util_isScheduler PURE_IMPORTS_END */ function startWith() { var array = []; for (var _i = 0; _i < arguments.length; _i++) { array[_i] = arguments[_i]; } return function (source) { var scheduler = array[array.length - 1]; if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_4__["isScheduler"])(scheduler)) { array.pop(); } else { scheduler = null; } var len = array.length; if (len === 1 && !scheduler) { return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_3__["concat"])(Object(_observable_scalar__WEBPACK_IMPORTED_MODULE_1__["scalar"])(array[0]), source); } else if (len > 0) { return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_3__["concat"])(Object(_observable_fromArray__WEBPACK_IMPORTED_MODULE_0__["fromArray"])(array, scheduler), source); } else { return Object(_observable_concat__WEBPACK_IMPORTED_MODULE_3__["concat"])(Object(_observable_empty__WEBPACK_IMPORTED_MODULE_2__["empty"])(scheduler), source); } }; } //# sourceMappingURL=startWith.js.map /***/ }), /* 339 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return subscribeOn; }); /* harmony import */ var _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(340); /** PURE_IMPORTS_START _observable_SubscribeOnObservable PURE_IMPORTS_END */ function subscribeOn(scheduler, delay) { if (delay === void 0) { delay = 0; } return function subscribeOnOperatorFunction(source) { return source.lift(new SubscribeOnOperator(scheduler, delay)); }; } var SubscribeOnOperator = /*@__PURE__*/ (function () { function SubscribeOnOperator(scheduler, delay) { this.scheduler = scheduler; this.delay = delay; } SubscribeOnOperator.prototype.call = function (subscriber, source) { return new _observable_SubscribeOnObservable__WEBPACK_IMPORTED_MODULE_0__["SubscribeOnObservable"](source, this.delay, this.scheduler).subscribe(subscriber); }; return SubscribeOnOperator; }()); //# sourceMappingURL=subscribeOn.js.map /***/ }), /* 340 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubscribeOnObservable", function() { return SubscribeOnObservable; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(163); /* harmony import */ var _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(206); /* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(251); /** PURE_IMPORTS_START tslib,_Observable,_scheduler_asap,_util_isNumeric PURE_IMPORTS_END */ var SubscribeOnObservable = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SubscribeOnObservable, _super); function SubscribeOnObservable(source, delayTime, scheduler) { if (delayTime === void 0) { delayTime = 0; } if (scheduler === void 0) { scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__["asap"]; } var _this = _super.call(this) || this; _this.source = source; _this.delayTime = delayTime; _this.scheduler = scheduler; if (!Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_3__["isNumeric"])(delayTime) || delayTime < 0) { _this.delayTime = 0; } if (!scheduler || typeof scheduler.schedule !== 'function') { _this.scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__["asap"]; } return _this; } SubscribeOnObservable.create = function (source, delay, scheduler) { if (delay === void 0) { delay = 0; } if (scheduler === void 0) { scheduler = _scheduler_asap__WEBPACK_IMPORTED_MODULE_2__["asap"]; } return new SubscribeOnObservable(source, delay, scheduler); }; SubscribeOnObservable.dispatch = function (arg) { var source = arg.source, subscriber = arg.subscriber; return this.add(source.subscribe(subscriber)); }; SubscribeOnObservable.prototype._subscribe = function (subscriber) { var delay = this.delayTime; var source = this.source; var scheduler = this.scheduler; return scheduler.schedule(SubscribeOnObservable.dispatch, delay, { source: source, subscriber: subscriber }); }; return SubscribeOnObservable; }(_Observable__WEBPACK_IMPORTED_MODULE_1__["Observable"])); //# sourceMappingURL=SubscribeOnObservable.js.map /***/ }), /* 341 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return switchAll; }); /* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(342); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(215); /** PURE_IMPORTS_START _switchMap,_util_identity PURE_IMPORTS_END */ function switchAll() { return Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(_util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"]); } //# sourceMappingURL=switchAll.js.map /***/ }), /* 342 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return switchMap; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(225); /* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(221); /* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(235); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */ function switchMap(project, resultSelector) { if (typeof resultSelector === 'function') { return function (source) { return source.pipe(switchMap(function (a, i) { return Object(_observable_from__WEBPACK_IMPORTED_MODULE_4__["from"])(project(a, i)).pipe(Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (b, ii) { return resultSelector(a, b, i, ii); })); })); }; } return function (source) { return source.lift(new SwitchMapOperator(project)); }; } var SwitchMapOperator = /*@__PURE__*/ (function () { function SwitchMapOperator(project) { this.project = project; } SwitchMapOperator.prototype.call = function (subscriber, source) { return source.subscribe(new SwitchMapSubscriber(subscriber, this.project)); }; return SwitchMapOperator; }()); var SwitchMapSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](SwitchMapSubscriber, _super); function SwitchMapSubscriber(destination, project) { var _this = _super.call(this, destination) || this; _this.project = project; _this.index = 0; return _this; } SwitchMapSubscriber.prototype._next = function (value) { var result; var index = this.index++; try { result = this.project(value, index); } catch (error) { this.destination.error(error); return; } this._innerSub(result, value, index); }; SwitchMapSubscriber.prototype._innerSub = function (result, value, index) { var innerSubscription = this.innerSubscription; if (innerSubscription) { innerSubscription.unsubscribe(); } this.add(this.innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, result, value, index)); }; SwitchMapSubscriber.prototype._complete = function () { var innerSubscription = this.innerSubscription; if (!innerSubscription || innerSubscription.closed) { _super.prototype._complete.call(this); } }; SwitchMapSubscriber.prototype._unsubscribe = function () { this.innerSubscription = null; }; SwitchMapSubscriber.prototype.notifyComplete = function (innerSub) { this.remove(innerSub); this.innerSubscription = null; if (this.isStopped) { _super.prototype._complete.call(this); } }; SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.destination.next(innerValue); }; return SwitchMapSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"])); //# sourceMappingURL=switchMap.js.map /***/ }), /* 343 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return switchMapTo; }); /* harmony import */ var _switchMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(342); /** PURE_IMPORTS_START _switchMap PURE_IMPORTS_END */ function switchMapTo(innerObservable, resultSelector) { return resultSelector ? Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(function () { return innerObservable; }, resultSelector) : Object(_switchMap__WEBPACK_IMPORTED_MODULE_0__["switchMap"])(function () { return innerObservable; }); } //# sourceMappingURL=switchMapTo.js.map /***/ }), /* 344 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return takeUntil; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function takeUntil(notifier) { return function (source) { return source.lift(new TakeUntilOperator(notifier)); }; } var TakeUntilOperator = /*@__PURE__*/ (function () { function TakeUntilOperator(notifier) { this.notifier = notifier; } TakeUntilOperator.prototype.call = function (subscriber, source) { var takeUntilSubscriber = new TakeUntilSubscriber(subscriber); var notifierSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(takeUntilSubscriber, this.notifier); if (notifierSubscription && !notifierSubscription.closed) { takeUntilSubscriber.add(notifierSubscription); return source.subscribe(takeUntilSubscriber); } return takeUntilSubscriber; }; return TakeUntilOperator; }()); var TakeUntilSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeUntilSubscriber, _super); function TakeUntilSubscriber(destination) { return _super.call(this, destination) || this; } TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.complete(); }; TakeUntilSubscriber.prototype.notifyComplete = function () { }; return TakeUntilSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"])); //# sourceMappingURL=takeUntil.js.map /***/ }), /* 345 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return takeWhile; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ function takeWhile(predicate) { return function (source) { return source.lift(new TakeWhileOperator(predicate)); }; } var TakeWhileOperator = /*@__PURE__*/ (function () { function TakeWhileOperator(predicate) { this.predicate = predicate; } TakeWhileOperator.prototype.call = function (subscriber, source) { return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate)); }; return TakeWhileOperator; }()); var TakeWhileSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TakeWhileSubscriber, _super); function TakeWhileSubscriber(destination, predicate) { var _this = _super.call(this, destination) || this; _this.predicate = predicate; _this.index = 0; return _this; } TakeWhileSubscriber.prototype._next = function (value) { var destination = this.destination; var result; try { result = this.predicate(value, this.index++); } catch (err) { destination.error(err); return; } this.nextOrComplete(value, result); }; TakeWhileSubscriber.prototype.nextOrComplete = function (value, predicateResult) { var destination = this.destination; if (Boolean(predicateResult)) { destination.next(value); } else { destination.complete(); } }; return TakeWhileSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=takeWhile.js.map /***/ }), /* 346 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultThrottleConfig", function() { return defaultThrottleConfig; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return throttle; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ var defaultThrottleConfig = { leading: true, trailing: false }; function throttle(durationSelector, config) { if (config === void 0) { config = defaultThrottleConfig; } return function (source) { return source.lift(new ThrottleOperator(durationSelector, config.leading, config.trailing)); }; } var ThrottleOperator = /*@__PURE__*/ (function () { function ThrottleOperator(durationSelector, leading, trailing) { this.durationSelector = durationSelector; this.leading = leading; this.trailing = trailing; } ThrottleOperator.prototype.call = function (subscriber, source) { return source.subscribe(new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing)); }; return ThrottleOperator; }()); var ThrottleSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ThrottleSubscriber, _super); function ThrottleSubscriber(destination, durationSelector, _leading, _trailing) { var _this = _super.call(this, destination) || this; _this.destination = destination; _this.durationSelector = durationSelector; _this._leading = _leading; _this._trailing = _trailing; _this._hasValue = false; return _this; } ThrottleSubscriber.prototype._next = function (value) { this._hasValue = true; this._sendValue = value; if (!this._throttled) { if (this._leading) { this.send(); } else { this.throttle(value); } } }; ThrottleSubscriber.prototype.send = function () { var _a = this, _hasValue = _a._hasValue, _sendValue = _a._sendValue; if (_hasValue) { this.destination.next(_sendValue); this.throttle(_sendValue); } this._hasValue = false; this._sendValue = null; }; ThrottleSubscriber.prototype.throttle = function (value) { var duration = this.tryDurationSelector(value); if (duration) { this.add(this._throttled = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(this, duration)); } }; ThrottleSubscriber.prototype.tryDurationSelector = function (value) { try { return this.durationSelector(value); } catch (err) { this.destination.error(err); return null; } }; ThrottleSubscriber.prototype.throttlingDone = function () { var _a = this, _throttled = _a._throttled, _trailing = _a._trailing; if (_throttled) { _throttled.unsubscribe(); } this._throttled = null; if (_trailing) { this.send(); } }; ThrottleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.throttlingDone(); }; ThrottleSubscriber.prototype.notifyComplete = function () { this.throttlingDone(); }; return ThrottleSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"])); //# sourceMappingURL=throttle.js.map /***/ }), /* 347 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return throttleTime; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(210); /* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(346); /** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async,_throttle PURE_IMPORTS_END */ function throttleTime(duration, scheduler, config) { if (scheduler === void 0) { scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"]; } if (config === void 0) { config = _throttle__WEBPACK_IMPORTED_MODULE_3__["defaultThrottleConfig"]; } return function (source) { return source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing)); }; } var ThrottleTimeOperator = /*@__PURE__*/ (function () { function ThrottleTimeOperator(duration, scheduler, leading, trailing) { this.duration = duration; this.scheduler = scheduler; this.leading = leading; this.trailing = trailing; } ThrottleTimeOperator.prototype.call = function (subscriber, source) { return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing)); }; return ThrottleTimeOperator; }()); var ThrottleTimeSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](ThrottleTimeSubscriber, _super); function ThrottleTimeSubscriber(destination, duration, scheduler, leading, trailing) { var _this = _super.call(this, destination) || this; _this.duration = duration; _this.scheduler = scheduler; _this.leading = leading; _this.trailing = trailing; _this._hasTrailingValue = false; _this._trailingValue = null; return _this; } ThrottleTimeSubscriber.prototype._next = function (value) { if (this.throttled) { if (this.trailing) { this._trailingValue = value; this._hasTrailingValue = true; } } else { this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, { subscriber: this })); if (this.leading) { this.destination.next(value); } } }; ThrottleTimeSubscriber.prototype._complete = function () { if (this._hasTrailingValue) { this.destination.next(this._trailingValue); this.destination.complete(); } else { this.destination.complete(); } }; ThrottleTimeSubscriber.prototype.clearThrottle = function () { var throttled = this.throttled; if (throttled) { if (this.trailing && this._hasTrailingValue) { this.destination.next(this._trailingValue); this._trailingValue = null; this._hasTrailingValue = false; } throttled.unsubscribe(); this.remove(throttled); this.throttled = null; } }; return ThrottleTimeSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); function dispatchNext(arg) { var subscriber = arg.subscriber; subscriber.clearThrottle(); } //# sourceMappingURL=throttleTime.js.map /***/ }), /* 348 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return timeInterval; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeInterval", function() { return TimeInterval; }); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(210); /* harmony import */ var _scan__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(308); /* harmony import */ var _observable_defer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(244); /* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(221); /** PURE_IMPORTS_START _scheduler_async,_scan,_observable_defer,_map PURE_IMPORTS_END */ function timeInterval(scheduler) { if (scheduler === void 0) { scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]; } return function (source) { return Object(_observable_defer__WEBPACK_IMPORTED_MODULE_2__["defer"])(function () { return source.pipe(Object(_scan__WEBPACK_IMPORTED_MODULE_1__["scan"])(function (_a, value) { var current = _a.current; return ({ value: value, current: scheduler.now(), last: current }); }, { current: scheduler.now(), value: undefined, last: undefined }), Object(_map__WEBPACK_IMPORTED_MODULE_3__["map"])(function (_a) { var current = _a.current, last = _a.last, value = _a.value; return new TimeInterval(value, current - last); })); }); }; } var TimeInterval = /*@__PURE__*/ (function () { function TimeInterval(value, interval) { this.value = value; this.interval = interval; } return TimeInterval; }()); //# sourceMappingURL=timeInterval.js.map /***/ }), /* 349 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return timeout; }); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(210); /* harmony import */ var _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(219); /* harmony import */ var _timeoutWith__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(350); /* harmony import */ var _observable_throwError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(204); /** PURE_IMPORTS_START _scheduler_async,_util_TimeoutError,_timeoutWith,_observable_throwError PURE_IMPORTS_END */ function timeout(due, scheduler) { if (scheduler === void 0) { scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]; } return Object(_timeoutWith__WEBPACK_IMPORTED_MODULE_2__["timeoutWith"])(due, Object(_observable_throwError__WEBPACK_IMPORTED_MODULE_3__["throwError"])(new _util_TimeoutError__WEBPACK_IMPORTED_MODULE_1__["TimeoutError"]()), scheduler); } //# sourceMappingURL=timeout.js.map /***/ }), /* 350 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return timeoutWith; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(210); /* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(280); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function timeoutWith(due, withObservable, scheduler) { if (scheduler === void 0) { scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__["async"]; } return function (source) { var absoluteTimeout = Object(_util_isDate__WEBPACK_IMPORTED_MODULE_2__["isDate"])(due); var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due); return source.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler)); }; } var TimeoutWithOperator = /*@__PURE__*/ (function () { function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) { this.waitFor = waitFor; this.absoluteTimeout = absoluteTimeout; this.withObservable = withObservable; this.scheduler = scheduler; } TimeoutWithOperator.prototype.call = function (subscriber, source) { return source.subscribe(new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler)); }; return TimeoutWithOperator; }()); var TimeoutWithSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](TimeoutWithSubscriber, _super); function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) { var _this = _super.call(this, destination) || this; _this.absoluteTimeout = absoluteTimeout; _this.waitFor = waitFor; _this.withObservable = withObservable; _this.scheduler = scheduler; _this.action = null; _this.scheduleTimeout(); return _this; } TimeoutWithSubscriber.dispatchTimeout = function (subscriber) { var withObservable = subscriber.withObservable; subscriber._unsubscribeAndRecycle(); subscriber.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_4__["subscribeToResult"])(subscriber, withObservable)); }; TimeoutWithSubscriber.prototype.scheduleTimeout = function () { var action = this.action; if (action) { this.action = action.schedule(this, this.waitFor); } else { this.add(this.action = this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, this)); } }; TimeoutWithSubscriber.prototype._next = function (value) { if (!this.absoluteTimeout) { this.scheduleTimeout(); } _super.prototype._next.call(this, value); }; TimeoutWithSubscriber.prototype._unsubscribe = function () { this.action = null; this.scheduler = null; this.withObservable = null; }; return TimeoutWithSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_3__["OuterSubscriber"])); //# sourceMappingURL=timeoutWith.js.map /***/ }), /* 351 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return timestamp; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Timestamp", function() { return Timestamp; }); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(210); /* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(221); /** PURE_IMPORTS_START _scheduler_async,_map PURE_IMPORTS_END */ function timestamp(scheduler) { if (scheduler === void 0) { scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__["async"]; } return Object(_map__WEBPACK_IMPORTED_MODULE_1__["map"])(function (value) { return new Timestamp(value, scheduler.now()); }); } var Timestamp = /*@__PURE__*/ (function () { function Timestamp(value, timestamp) { this.value = value; this.timestamp = timestamp; } return Timestamp; }()); //# sourceMappingURL=timestamp.js.map /***/ }), /* 352 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return toArray; }); /* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(307); /** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */ function toArrayReducer(arr, item, index) { if (index === 0) { return [item]; } arr.push(item); return arr; } function toArray() { return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__["reduce"])(toArrayReducer, []); } //# sourceMappingURL=toArray.js.map /***/ }), /* 353 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "window", function() { return window; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(182); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_Subject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function window(windowBoundaries) { return function windowOperatorFunction(source) { return source.lift(new WindowOperator(windowBoundaries)); }; } var WindowOperator = /*@__PURE__*/ (function () { function WindowOperator(windowBoundaries) { this.windowBoundaries = windowBoundaries; } WindowOperator.prototype.call = function (subscriber, source) { var windowSubscriber = new WindowSubscriber(subscriber); var sourceSubscription = source.subscribe(windowSubscriber); if (!sourceSubscription.closed) { windowSubscriber.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_3__["subscribeToResult"])(windowSubscriber, this.windowBoundaries)); } return sourceSubscription; }; return WindowOperator; }()); var WindowSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowSubscriber, _super); function WindowSubscriber(destination) { var _this = _super.call(this, destination) || this; _this.window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"](); destination.next(_this.window); return _this; } WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.openWindow(); }; WindowSubscriber.prototype.notifyError = function (error, innerSub) { this._error(error); }; WindowSubscriber.prototype.notifyComplete = function (innerSub) { this._complete(); }; WindowSubscriber.prototype._next = function (value) { this.window.next(value); }; WindowSubscriber.prototype._error = function (err) { this.window.error(err); this.destination.error(err); }; WindowSubscriber.prototype._complete = function () { this.window.complete(); this.destination.complete(); }; WindowSubscriber.prototype._unsubscribe = function () { this.window = null; }; WindowSubscriber.prototype.openWindow = function () { var prevWindow = this.window; if (prevWindow) { prevWindow.complete(); } var destination = this.destination; var newWindow = this.window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"](); destination.next(newWindow); }; return WindowSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_2__["OuterSubscriber"])); //# sourceMappingURL=window.js.map /***/ }), /* 354 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return windowCount; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(165); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(182); /** PURE_IMPORTS_START tslib,_Subscriber,_Subject PURE_IMPORTS_END */ function windowCount(windowSize, startWindowEvery) { if (startWindowEvery === void 0) { startWindowEvery = 0; } return function windowCountOperatorFunction(source) { return source.lift(new WindowCountOperator(windowSize, startWindowEvery)); }; } var WindowCountOperator = /*@__PURE__*/ (function () { function WindowCountOperator(windowSize, startWindowEvery) { this.windowSize = windowSize; this.startWindowEvery = startWindowEvery; } WindowCountOperator.prototype.call = function (subscriber, source) { return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery)); }; return WindowCountOperator; }()); var WindowCountSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowCountSubscriber, _super); function WindowCountSubscriber(destination, windowSize, startWindowEvery) { var _this = _super.call(this, destination) || this; _this.destination = destination; _this.windowSize = windowSize; _this.startWindowEvery = startWindowEvery; _this.windows = [new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"]()]; _this.count = 0; destination.next(_this.windows[0]); return _this; } WindowCountSubscriber.prototype._next = function (value) { var startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize; var destination = this.destination; var windowSize = this.windowSize; var windows = this.windows; var len = windows.length; for (var i = 0; i < len && !this.closed; i++) { windows[i].next(value); } var c = this.count - windowSize + 1; if (c >= 0 && c % startWindowEvery === 0 && !this.closed) { windows.shift().complete(); } if (++this.count % startWindowEvery === 0 && !this.closed) { var window_1 = new _Subject__WEBPACK_IMPORTED_MODULE_2__["Subject"](); windows.push(window_1); destination.next(window_1); } }; WindowCountSubscriber.prototype._error = function (err) { var windows = this.windows; if (windows) { while (windows.length > 0 && !this.closed) { windows.shift().error(err); } } this.destination.error(err); }; WindowCountSubscriber.prototype._complete = function () { var windows = this.windows; if (windows) { while (windows.length > 0 && !this.closed) { windows.shift().complete(); } } this.destination.complete(); }; WindowCountSubscriber.prototype._unsubscribe = function () { this.count = 0; this.windows = null; }; return WindowCountSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_1__["Subscriber"])); //# sourceMappingURL=windowCount.js.map /***/ }), /* 355 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return windowTime; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(182); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(210); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(165); /* harmony import */ var _util_isNumeric__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(251); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(200); /** PURE_IMPORTS_START tslib,_Subject,_scheduler_async,_Subscriber,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */ function windowTime(windowTimeSpan) { var scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_2__["async"]; var windowCreationInterval = null; var maxWindowSize = Number.POSITIVE_INFINITY; if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(arguments[3])) { scheduler = arguments[3]; } if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(arguments[2])) { scheduler = arguments[2]; } else if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_4__["isNumeric"])(arguments[2])) { maxWindowSize = arguments[2]; } if (Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_5__["isScheduler"])(arguments[1])) { scheduler = arguments[1]; } else if (Object(_util_isNumeric__WEBPACK_IMPORTED_MODULE_4__["isNumeric"])(arguments[1])) { windowCreationInterval = arguments[1]; } return function windowTimeOperatorFunction(source) { return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler)); }; } var WindowTimeOperator = /*@__PURE__*/ (function () { function WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) { this.windowTimeSpan = windowTimeSpan; this.windowCreationInterval = windowCreationInterval; this.maxWindowSize = maxWindowSize; this.scheduler = scheduler; } WindowTimeOperator.prototype.call = function (subscriber, source) { return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler)); }; return WindowTimeOperator; }()); var CountedSubject = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](CountedSubject, _super); function CountedSubject() { var _this = _super !== null && _super.apply(this, arguments) || this; _this._numberOfNextedValues = 0; return _this; } CountedSubject.prototype.next = function (value) { this._numberOfNextedValues++; _super.prototype.next.call(this, value); }; Object.defineProperty(CountedSubject.prototype, "numberOfNextedValues", { get: function () { return this._numberOfNextedValues; }, enumerable: true, configurable: true }); return CountedSubject; }(_Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"])); var WindowTimeSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowTimeSubscriber, _super); function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) { var _this = _super.call(this, destination) || this; _this.destination = destination; _this.windowTimeSpan = windowTimeSpan; _this.windowCreationInterval = windowCreationInterval; _this.maxWindowSize = maxWindowSize; _this.scheduler = scheduler; _this.windows = []; var window = _this.openWindow(); if (windowCreationInterval !== null && windowCreationInterval >= 0) { var closeState = { subscriber: _this, window: window, context: null }; var creationState = { windowTimeSpan: windowTimeSpan, windowCreationInterval: windowCreationInterval, subscriber: _this, scheduler: scheduler }; _this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState)); _this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState)); } else { var timeSpanOnlyState = { subscriber: _this, window: window, windowTimeSpan: windowTimeSpan }; _this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState)); } return _this; } WindowTimeSubscriber.prototype._next = function (value) { var windows = this.windows; var len = windows.length; for (var i = 0; i < len; i++) { var window_1 = windows[i]; if (!window_1.closed) { window_1.next(value); if (window_1.numberOfNextedValues >= this.maxWindowSize) { this.closeWindow(window_1); } } } }; WindowTimeSubscriber.prototype._error = function (err) { var windows = this.windows; while (windows.length > 0) { windows.shift().error(err); } this.destination.error(err); }; WindowTimeSubscriber.prototype._complete = function () { var windows = this.windows; while (windows.length > 0) { var window_2 = windows.shift(); if (!window_2.closed) { window_2.complete(); } } this.destination.complete(); }; WindowTimeSubscriber.prototype.openWindow = function () { var window = new CountedSubject(); this.windows.push(window); var destination = this.destination; destination.next(window); return window; }; WindowTimeSubscriber.prototype.closeWindow = function (window) { window.complete(); var windows = this.windows; windows.splice(windows.indexOf(window), 1); }; return WindowTimeSubscriber; }(_Subscriber__WEBPACK_IMPORTED_MODULE_3__["Subscriber"])); function dispatchWindowTimeSpanOnly(state) { var subscriber = state.subscriber, windowTimeSpan = state.windowTimeSpan, window = state.window; if (window) { subscriber.closeWindow(window); } state.window = subscriber.openWindow(); this.schedule(state, windowTimeSpan); } function dispatchWindowCreation(state) { var windowTimeSpan = state.windowTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler, windowCreationInterval = state.windowCreationInterval; var window = subscriber.openWindow(); var action = this; var context = { action: action, subscription: null }; var timeSpanState = { subscriber: subscriber, window: window, context: context }; context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState); action.add(context.subscription); action.schedule(state, windowCreationInterval); } function dispatchWindowClose(state) { var subscriber = state.subscriber, window = state.window, context = state.context; if (context && context.action && context.subscription) { context.action.remove(context.subscription); } subscriber.closeWindow(window); } //# sourceMappingURL=windowTime.js.map /***/ }), /* 356 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return windowToggle; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(182); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(171); /* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(174); /* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(175); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_Subject,_Subscription,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function windowToggle(openings, closingSelector) { return function (source) { return source.lift(new WindowToggleOperator(openings, closingSelector)); }; } var WindowToggleOperator = /*@__PURE__*/ (function () { function WindowToggleOperator(openings, closingSelector) { this.openings = openings; this.closingSelector = closingSelector; } WindowToggleOperator.prototype.call = function (subscriber, source) { return source.subscribe(new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector)); }; return WindowToggleOperator; }()); var WindowToggleSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowToggleSubscriber, _super); function WindowToggleSubscriber(destination, openings, closingSelector) { var _this = _super.call(this, destination) || this; _this.openings = openings; _this.closingSelector = closingSelector; _this.contexts = []; _this.add(_this.openSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_6__["subscribeToResult"])(_this, openings, openings)); return _this; } WindowToggleSubscriber.prototype._next = function (value) { var contexts = this.contexts; if (contexts) { var len = contexts.length; for (var i = 0; i < len; i++) { contexts[i].window.next(value); } } }; WindowToggleSubscriber.prototype._error = function (err) { var contexts = this.contexts; this.contexts = null; if (contexts) { var len = contexts.length; var index = -1; while (++index < len) { var context_1 = contexts[index]; context_1.window.error(err); context_1.subscription.unsubscribe(); } } _super.prototype._error.call(this, err); }; WindowToggleSubscriber.prototype._complete = function () { var contexts = this.contexts; this.contexts = null; if (contexts) { var len = contexts.length; var index = -1; while (++index < len) { var context_2 = contexts[index]; context_2.window.complete(); context_2.subscription.unsubscribe(); } } _super.prototype._complete.call(this); }; WindowToggleSubscriber.prototype._unsubscribe = function () { var contexts = this.contexts; this.contexts = null; if (contexts) { var len = contexts.length; var index = -1; while (++index < len) { var context_3 = contexts[index]; context_3.window.unsubscribe(); context_3.subscription.unsubscribe(); } } }; WindowToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { if (outerValue === this.openings) { var closingSelector = this.closingSelector; var closingNotifier = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_3__["tryCatch"])(closingSelector)(innerValue); if (closingNotifier === _util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"]) { return this.error(_util_errorObject__WEBPACK_IMPORTED_MODULE_4__["errorObject"].e); } else { var window_1 = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"](); var subscription = new _Subscription__WEBPACK_IMPORTED_MODULE_2__["Subscription"](); var context_4 = { window: window_1, subscription: subscription }; this.contexts.push(context_4); var innerSubscription = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_6__["subscribeToResult"])(this, closingNotifier, context_4); if (innerSubscription.closed) { this.closeWindow(this.contexts.length - 1); } else { innerSubscription.context = context_4; subscription.add(innerSubscription); } this.destination.next(window_1); } } else { this.closeWindow(this.contexts.indexOf(outerValue)); } }; WindowToggleSubscriber.prototype.notifyError = function (err) { this.error(err); }; WindowToggleSubscriber.prototype.notifyComplete = function (inner) { if (inner !== this.openSubscription) { this.closeWindow(this.contexts.indexOf(inner.context)); } }; WindowToggleSubscriber.prototype.closeWindow = function (index) { if (index === -1) { return; } var contexts = this.contexts; var context = contexts[index]; var window = context.window, subscription = context.subscription; contexts.splice(index, 1); window.complete(); subscription.unsubscribe(); }; return WindowToggleSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_5__["OuterSubscriber"])); //# sourceMappingURL=windowToggle.js.map /***/ }), /* 357 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return windowWhen; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(182); /* harmony import */ var _util_tryCatch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(174); /* harmony import */ var _util_errorObject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(175); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_Subject,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function windowWhen(closingSelector) { return function windowWhenOperatorFunction(source) { return source.lift(new WindowOperator(closingSelector)); }; } var WindowOperator = /*@__PURE__*/ (function () { function WindowOperator(closingSelector) { this.closingSelector = closingSelector; } WindowOperator.prototype.call = function (subscriber, source) { return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector)); }; return WindowOperator; }()); var WindowSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WindowSubscriber, _super); function WindowSubscriber(destination, closingSelector) { var _this = _super.call(this, destination) || this; _this.destination = destination; _this.closingSelector = closingSelector; _this.openWindow(); return _this; } WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.openWindow(innerSub); }; WindowSubscriber.prototype.notifyError = function (error, innerSub) { this._error(error); }; WindowSubscriber.prototype.notifyComplete = function (innerSub) { this.openWindow(innerSub); }; WindowSubscriber.prototype._next = function (value) { this.window.next(value); }; WindowSubscriber.prototype._error = function (err) { this.window.error(err); this.destination.error(err); this.unsubscribeClosingNotification(); }; WindowSubscriber.prototype._complete = function () { this.window.complete(); this.destination.complete(); this.unsubscribeClosingNotification(); }; WindowSubscriber.prototype.unsubscribeClosingNotification = function () { if (this.closingNotification) { this.closingNotification.unsubscribe(); } }; WindowSubscriber.prototype.openWindow = function (innerSub) { if (innerSub === void 0) { innerSub = null; } if (innerSub) { this.remove(innerSub); innerSub.unsubscribe(); } var prevWindow = this.window; if (prevWindow) { prevWindow.complete(); } var window = this.window = new _Subject__WEBPACK_IMPORTED_MODULE_1__["Subject"](); this.destination.next(window); var closingNotifier = Object(_util_tryCatch__WEBPACK_IMPORTED_MODULE_2__["tryCatch"])(this.closingSelector)(); if (closingNotifier === _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"]) { var err = _util_errorObject__WEBPACK_IMPORTED_MODULE_3__["errorObject"].e; this.destination.error(err); this.window.error(err); } else { this.add(this.closingNotification = Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_5__["subscribeToResult"])(this, closingNotifier)); } }; return WindowSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_4__["OuterSubscriber"])); //# sourceMappingURL=windowWhen.js.map /***/ }), /* 358 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return withLatestFrom; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166); /* harmony import */ var _OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(224); /* harmony import */ var _util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(225); /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ function withLatestFrom() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return function (source) { var project; if (typeof args[args.length - 1] === 'function') { project = args.pop(); } var observables = args; return source.lift(new WithLatestFromOperator(observables, project)); }; } var WithLatestFromOperator = /*@__PURE__*/ (function () { function WithLatestFromOperator(observables, project) { this.observables = observables; this.project = project; } WithLatestFromOperator.prototype.call = function (subscriber, source) { return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project)); }; return WithLatestFromOperator; }()); var WithLatestFromSubscriber = /*@__PURE__*/ (function (_super) { tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"](WithLatestFromSubscriber, _super); function WithLatestFromSubscriber(destination, observables, project) { var _this = _super.call(this, destination) || this; _this.observables = observables; _this.project = project; _this.toRespond = []; var len = observables.length; _this.values = new Array(len); for (var i = 0; i < len; i++) { _this.toRespond.push(i); } for (var i = 0; i < len; i++) { var observable = observables[i]; _this.add(Object(_util_subscribeToResult__WEBPACK_IMPORTED_MODULE_2__["subscribeToResult"])(_this, observable, observable, i)); } return _this; } WithLatestFromSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.values[outerIndex] = innerValue; var toRespond = this.toRespond; if (toRespond.length > 0) { var found = toRespond.indexOf(outerIndex); if (found !== -1) { toRespond.splice(found, 1); } } }; WithLatestFromSubscriber.prototype.notifyComplete = function () { }; WithLatestFromSubscriber.prototype._next = function (value) { if (this.toRespond.length === 0) { var args = [value].concat(this.values); if (this.project) { this._tryProject(args); } else { this.destination.next(args); } } }; WithLatestFromSubscriber.prototype._tryProject = function (args) { var result; try { result = this.project.apply(this, args); } catch (err) { this.destination.error(err); return; } this.destination.next(result); }; return WithLatestFromSubscriber; }(_OuterSubscriber__WEBPACK_IMPORTED_MODULE_1__["OuterSubscriber"])); //# sourceMappingURL=withLatestFrom.js.map /***/ }), /* 359 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return zip; }); /* harmony import */ var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(260); /** PURE_IMPORTS_START _observable_zip PURE_IMPORTS_END */ function zip() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i] = arguments[_i]; } return function zipOperatorFunction(source) { return source.lift.call(_observable_zip__WEBPACK_IMPORTED_MODULE_0__["zip"].apply(void 0, [source].concat(observables))); }; } //# sourceMappingURL=zip.js.map /***/ }), /* 360 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return zipAll; }); /* harmony import */ var _observable_zip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(260); /** PURE_IMPORTS_START _observable_zip PURE_IMPORTS_END */ function zipAll(project) { return function (source) { return source.lift(new _observable_zip__WEBPACK_IMPORTED_MODULE_0__["ZipOperator"](project)); }; } //# sourceMappingURL=zipAll.js.map /***/ }), /* 361 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "runCommand", function() { return runCommand; }); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var indent_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(362); /* harmony import */ var indent_string__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(indent_string__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var wrap_ansi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(363); /* harmony import */ var wrap_ansi__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(wrap_ansi__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(135); /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(52); /* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33); /* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(35); /* harmony import */ var _utils_projects_tree__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(370); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ async function runCommand(command, config) { try { _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`Running [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(command.name)}] command from [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.yellow(config.rootPath)}]:\n`)); const projectPaths = Object(_config__WEBPACK_IMPORTED_MODULE_3__["getProjectPaths"])(config.rootPath, config.options); const projects = await Object(_utils_projects__WEBPACK_IMPORTED_MODULE_6__["getProjects"])(config.rootPath, projectPaths, { exclude: toArray(config.options.exclude), include: toArray(config.options.include) }); if (projects.size === 0) { _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`There are no projects found. Double check project name(s) in '-i/--include' and '-e/--exclude' filters.\n`)); return process.exit(1); } const projectGraph = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_6__["buildProjectGraph"])(projects); _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold(`Found [${chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(projects.size.toString())}] projects:\n`)); _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(Object(_utils_projects_tree__WEBPACK_IMPORTED_MODULE_7__["renderProjectsTree"])(config.rootPath, projects)); await command.run(projects, projectGraph, config); } catch (e) { _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(chalk__WEBPACK_IMPORTED_MODULE_0___default.a.bold.red(`\n[${command.name}] failed:\n`)); if (e instanceof _utils_errors__WEBPACK_IMPORTED_MODULE_4__["CliError"]) { const msg = chalk__WEBPACK_IMPORTED_MODULE_0___default.a.red(`CliError: ${e.message}\n`); _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(wrap_ansi__WEBPACK_IMPORTED_MODULE_2___default()(msg, 80)); const keys = Object.keys(e.meta); if (keys.length > 0) { const metaOutput = keys.map(key => { const value = e.meta[key]; return `${key}: ${value}`; }); _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write('Additional debugging info:\n'); _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(indent_string__WEBPACK_IMPORTED_MODULE_1___default()(metaOutput.join('\n'), 3)); } } else { _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(e.stack); } process.exit(1); } } function toArray(value) { if (value == null) { return []; } return Array.isArray(value) ? value : [value]; } /***/ }), /* 362 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = (str, count, opts) => { // Support older versions: use the third parameter as options.indent // TODO: Remove the workaround in the next major version const options = typeof opts === 'object' ? Object.assign({indent: ' '}, opts) : {indent: opts || ' '}; count = count === undefined ? 1 : count; if (typeof str !== 'string') { throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof str}\``); } if (typeof count !== 'number') { throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof count}\``); } if (typeof options.indent !== 'string') { throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``); } if (count === 0) { return str; } const regex = options.includeEmptyLines ? /^/mg : /^(?!\s*$)/mg; return str.replace(regex, options.indent.repeat(count)); } ; /***/ }), /* 363 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const stringWidth = __webpack_require__(364); const stripAnsi = __webpack_require__(368); const ESCAPES = new Set([ '\u001B', '\u009B' ]); const END_CODE = 39; const ESCAPE_CODES = new Map([ [0, 0], [1, 22], [2, 22], [3, 23], [4, 24], [7, 27], [8, 28], [9, 29], [30, 39], [31, 39], [32, 39], [33, 39], [34, 39], [35, 39], [36, 39], [37, 39], [90, 39], [40, 49], [41, 49], [42, 49], [43, 49], [44, 49], [45, 49], [46, 49], [47, 49] ]); const wrapAnsi = code => `${ESCAPES.values().next().value}[${code}m`; // Calculate the length of words split on ' ', ignoring // the extra characters added by ansi escape codes const wordLengths = str => str.split(' ').map(s => stringWidth(s)); // Wrap a long word across multiple rows // Ansi escape codes do not count towards length const wrapWord = (rows, word, cols) => { const arr = Array.from(word); let insideEscape = false; let visible = stringWidth(stripAnsi(rows[rows.length - 1])); for (const item of arr.entries()) { const i = item[0]; const char = item[1]; const charLength = stringWidth(char); if (visible + charLength <= cols) { rows[rows.length - 1] += char; } else { rows.push(char); visible = 0; } if (ESCAPES.has(char)) { insideEscape = true; } else if (insideEscape && char === 'm') { insideEscape = false; continue; } if (insideEscape) { continue; } visible += charLength; if (visible === cols && i < arr.length - 1) { rows.push(''); visible = 0; } } // It's possible that the last row we copy over is only // ansi escape characters, handle this edge-case if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) { rows[rows.length - 2] += rows.pop(); } }; // The wrap-ansi module can be invoked // in either 'hard' or 'soft' wrap mode // // 'hard' will never allow a string to take up more // than cols characters // // 'soft' allows long words to expand past the column length const exec = (str, cols, opts) => { const options = opts || {}; if (str.trim() === '') { return options.trim === false ? str : str.trim(); } let pre = ''; let ret = ''; let escapeCode; const lengths = wordLengths(str); const words = str.split(' '); const rows = ['']; for (const item of Array.from(words).entries()) { const i = item[0]; const word = item[1]; rows[rows.length - 1] = options.trim === false ? rows[rows.length - 1] : rows[rows.length - 1].trim(); let rowLength = stringWidth(rows[rows.length - 1]); if (rowLength || word === '') { if (rowLength === cols && options.wordWrap === false) { // If we start with a new word but the current row length equals the length of the columns, add a new row rows.push(''); rowLength = 0; } rows[rows.length - 1] += ' '; rowLength++; } // In 'hard' wrap mode, the length of a line is // never allowed to extend past 'cols' if (lengths[i] > cols && options.hard) { if (rowLength) { rows.push(''); } wrapWord(rows, word, cols); continue; } if (rowLength + lengths[i] > cols && rowLength > 0) { if (options.wordWrap === false && rowLength < cols) { wrapWord(rows, word, cols); continue; } rows.push(''); } if (rowLength + lengths[i] > cols && options.wordWrap === false) { wrapWord(rows, word, cols); continue; } rows[rows.length - 1] += word; } pre = rows.map(r => options.trim === false ? r : r.trim()).join('\n'); for (const item of Array.from(pre).entries()) { const i = item[0]; const char = item[1]; ret += char; if (ESCAPES.has(char)) { const code = parseFloat(/\d[^m]*/.exec(pre.slice(i, i + 4))); escapeCode = code === END_CODE ? null : code; } const code = ESCAPE_CODES.get(Number(escapeCode)); if (escapeCode && code) { if (pre[i + 1] === '\n') { ret += wrapAnsi(code); } else if (char === '\n') { ret += wrapAnsi(escapeCode); } } } return ret; }; // For each newline, invoke the method separately module.exports = (str, cols, opts) => { return String(str) .normalize() .split('\n') .map(line => exec(line, cols, opts)) .join('\n'); }; /***/ }), /* 364 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const stripAnsi = __webpack_require__(365); const isFullwidthCodePoint = __webpack_require__(367); module.exports = str => { if (typeof str !== 'string' || str.length === 0) { return 0; } str = stripAnsi(str); let width = 0; for (let i = 0; i < str.length; i++) { const code = str.codePointAt(i); // Ignore control characters if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { continue; } // Ignore combining characters if (code >= 0x300 && code <= 0x36F) { continue; } // Surrogates if (code > 0xFFFF) { i++; } width += isFullwidthCodePoint(code) ? 2 : 1; } return width; }; /***/ }), /* 365 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const ansiRegex = __webpack_require__(366); module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; /***/ }), /* 366 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = () => { const pattern = [ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))' ].join('|'); return new RegExp(pattern, 'g'); }; /***/ }), /* 367 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable yoda */ module.exports = x => { if (Number.isNaN(x)) { return false; } // code points are derived from: // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt if ( x >= 0x1100 && ( x <= 0x115f || // Hangul Jamo x === 0x2329 || // LEFT-POINTING ANGLE BRACKET x === 0x232a || // RIGHT-POINTING ANGLE BRACKET // CJK Radicals Supplement .. Enclosed CJK Letters and Months (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A (0x3250 <= x && x <= 0x4dbf) || // CJK Unified Ideographs .. Yi Radicals (0x4e00 <= x && x <= 0xa4c6) || // Hangul Jamo Extended-A (0xa960 <= x && x <= 0xa97c) || // Hangul Syllables (0xac00 <= x && x <= 0xd7a3) || // CJK Compatibility Ideographs (0xf900 <= x && x <= 0xfaff) || // Vertical Forms (0xfe10 <= x && x <= 0xfe19) || // CJK Compatibility Forms .. Small Form Variants (0xfe30 <= x && x <= 0xfe6b) || // Halfwidth and Fullwidth Forms (0xff01 <= x && x <= 0xff60) || (0xffe0 <= x && x <= 0xffe6) || // Kana Supplement (0x1b000 <= x && x <= 0x1b001) || // Enclosed Ideographic Supplement (0x1f200 <= x && x <= 0x1f251) || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane (0x20000 <= x && x <= 0x3fffd) ) ) { return true; } return false; }; /***/ }), /* 368 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const ansiRegex = __webpack_require__(369); module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; /***/ }), /* 369 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = () => { const pattern = [ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))' ].join('|'); return new RegExp(pattern, 'g'); }; /***/ }), /* 370 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderProjectsTree", function() { return renderProjectsTree; }); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ const projectKey = Symbol('__project'); function renderProjectsTree(rootPath, projects) { const projectsTree = buildProjectsTree(rootPath, projects); return treeToString(createTreeStructure(projectsTree)); } function treeToString(tree) { return [tree.name].concat(childrenToStrings(tree.children, '')).join('\n'); } function childrenToStrings(tree, treePrefix) { if (tree === undefined) { return []; } let strings = []; tree.forEach((node, index) => { const isLastNode = tree.length - 1 === index; const nodePrefix = isLastNode ? '└── ' : '├── '; const childPrefix = isLastNode ? ' ' : '│ '; const childrenPrefix = treePrefix + childPrefix; strings.push(`${treePrefix}${nodePrefix}${node.name}`); strings = strings.concat(childrenToStrings(node.children, childrenPrefix)); }); return strings; } function createTreeStructure(tree) { let name; const children = []; for (const [dir, project] of tree.entries()) { // This is a leaf node (aka a project) if (typeof project === 'string') { name = chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(project); continue; } // If there's only one project and the key indicates it's a leaf node, we // know that we're at a package folder that contains a package.json, so we // "inline it" so we don't get unnecessary levels, i.e. we'll just see // `foo` instead of `foo -> foo`. if (project.size === 1 && project.has(projectKey)) { const projectName = project.get(projectKey); children.push({ children: [], name: dirOrProjectName(dir, projectName) }); continue; } const subtree = createTreeStructure(project); // If the name is specified, we know there's a package at the "root" of the // subtree itself. if (subtree.name !== undefined) { const projectName = subtree.name; children.push({ children: subtree.children, name: dirOrProjectName(dir, projectName) }); continue; } // Special-case whenever we have one child, so we don't get unnecessary // folders in the output. E.g. instead of `foo -> bar -> baz` we get // `foo/bar/baz` instead. if (subtree.children && subtree.children.length === 1) { const child = subtree.children[0]; const newName = chalk__WEBPACK_IMPORTED_MODULE_0___default.a.dim(path__WEBPACK_IMPORTED_MODULE_1___default.a.join(dir.toString(), child.name)); children.push({ children: child.children, name: newName }); continue; } children.push({ children: subtree.children, name: chalk__WEBPACK_IMPORTED_MODULE_0___default.a.dim(dir.toString()) }); } return { name, children }; } function dirOrProjectName(dir, projectName) { return dir === projectName ? chalk__WEBPACK_IMPORTED_MODULE_0___default.a.green(dir) : chalk__WEBPACK_IMPORTED_MODULE_0___default.a`{dim ${dir.toString()} ({reset.green ${projectName}})}`; } function buildProjectsTree(rootPath, projects) { const tree = new Map(); for (const project of projects.values()) { if (rootPath === project.path) { tree.set(projectKey, project.name); } else { const relativeProjectPath = path__WEBPACK_IMPORTED_MODULE_1___default.a.relative(rootPath, project.path); addProjectToTree(tree, relativeProjectPath.split(path__WEBPACK_IMPORTED_MODULE_1___default.a.sep), project); } } return tree; } function addProjectToTree(tree, pathParts, project) { if (pathParts.length === 0) { tree.set(projectKey, project.name); } else { const [currentDir, ...rest] = pathParts; if (!tree.has(currentDir)) { tree.set(currentDir, new Map()); } const subtree = tree.get(currentDir); addProjectToTree(subtree, rest, project); } } /***/ }), /* 371 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _build_production_projects__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(372); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return _build_production_projects__WEBPACK_IMPORTED_MODULE_0__["buildProductionProjects"]; }); /* harmony import */ var _prepare_project_dependencies__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(553); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return _prepare_project_dependencies__WEBPACK_IMPORTED_MODULE_1__["prepareExternalProjectDependencies"]; }); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /***/ }), /* 372 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildProductionProjects", function() { return buildProductionProjects; }); /* harmony import */ var cpy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(373); /* harmony import */ var cpy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cpy__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(137); /* harmony import */ var del__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(del__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(135); /* harmony import */ var _utils_fs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(20); /* harmony import */ var _utils_log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(33); /* harmony import */ var _utils_package_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(54); /* harmony import */ var _utils_projects__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(35); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ async function buildProductionProjects({ kibanaRoot, buildRoot, onlyOSS }) { const projects = await getProductionProjects(kibanaRoot, onlyOSS); const projectGraph = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_7__["buildProjectGraph"])(projects); const batchedProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_7__["topologicallyBatchProjects"])(projects, projectGraph); const projectNames = [...projects.values()].map(project => project.name); _utils_log__WEBPACK_IMPORTED_MODULE_5__["log"].write(`Preparing production build for [${projectNames.join(', ')}]`); for (const batch of batchedProjects) { for (const project of batch) { await deleteTarget(project); await buildProject(project); await copyToBuild(project, kibanaRoot, buildRoot); } } } /** * Returns the subset of projects that should be built into the production * bundle. As we copy these into Kibana's `node_modules` during the build step, * and let Kibana's build process be responsible for installing dependencies, * we only include Kibana's transitive _production_ dependencies. If onlyOSS * is supplied, we omit projects with build.oss in their package.json set to false. */ async function getProductionProjects(rootPath, onlyOSS) { const projectPaths = Object(_config__WEBPACK_IMPORTED_MODULE_3__["getProjectPaths"])(rootPath, {}); const projects = await Object(_utils_projects__WEBPACK_IMPORTED_MODULE_7__["getProjects"])(rootPath, projectPaths); const projectsSubset = [projects.get('kibana')]; if (projects.has('x-pack')) { projectsSubset.push(projects.get('x-pack')); } const productionProjects = Object(_utils_projects__WEBPACK_IMPORTED_MODULE_7__["includeTransitiveProjects"])(projectsSubset, projects, { onlyProductionDependencies: true }); // We remove Kibana, as we're already building Kibana productionProjects.delete('kibana'); if (onlyOSS) { productionProjects.forEach(project => { if (project.getBuildConfig().oss === false) { productionProjects.delete(project.json.name); } }); } return productionProjects; } async function deleteTarget(project) { const targetDir = project.targetLocation; if (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_4__["isDirectory"])(targetDir)) { await del__WEBPACK_IMPORTED_MODULE_1___default()(targetDir, { force: true }); } } async function buildProject(project) { if (project.hasScript('build')) { await project.runScript('build'); } } /** * Copy all the project's files from its "intermediate build directory" and * into the build. The intermediate directory can either be the root of the * project or some other location defined in the project's `package.json`. * * When copying all the files into the build, we exclude `node_modules` because * we want the Kibana build to be responsible for actually installing all * dependencies. The primary reason for allowing the Kibana build process to * manage dependencies is that it will "dedupe" them, so we don't include * unnecessary copies of dependencies. */ async function copyToBuild(project, kibanaRoot, buildRoot) { // We want the package to have the same relative location within the build const relativeProjectPath = Object(path__WEBPACK_IMPORTED_MODULE_2__["relative"])(kibanaRoot, project.path); const buildProjectPath = Object(path__WEBPACK_IMPORTED_MODULE_2__["resolve"])(buildRoot, relativeProjectPath); await cpy__WEBPACK_IMPORTED_MODULE_0___default()(['**/*', '!node_modules/**'], buildProjectPath, { cwd: project.getIntermediateBuildDirectory(), dot: true, nodir: true, parents: true }); // If a project is using an intermediate build directory, we special-case our // handling of `package.json`, as the project build process might have copied // (a potentially modified) `package.json` into the intermediate build // directory already. If so, we want to use that `package.json` as the basis // for creating the production-ready `package.json`. If it's not present in // the intermediate build, we fall back to using the project's already defined // `package.json`. const packageJson = (await Object(_utils_fs__WEBPACK_IMPORTED_MODULE_4__["isFile"])(Object(path__WEBPACK_IMPORTED_MODULE_2__["join"])(buildProjectPath, 'package.json'))) ? await Object(_utils_package_json__WEBPACK_IMPORTED_MODULE_6__["readPackageJson"])(buildProjectPath) : project.json; await Object(_utils_package_json__WEBPACK_IMPORTED_MODULE_6__["writePackageJson"])(buildProjectPath, packageJson); } /***/ }), /* 373 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const EventEmitter = __webpack_require__(45); const path = __webpack_require__(16); const arrify = __webpack_require__(374); const globby = __webpack_require__(375); const cpFile = __webpack_require__(544); const CpyError = __webpack_require__(552); const preprocessSrcPath = (srcPath, options) => options.cwd ? path.resolve(options.cwd, srcPath) : srcPath; const preprocessDestPath = (srcPath, dest, options) => { let basename = path.basename(srcPath); const dirname = path.dirname(srcPath); if (typeof options.rename === 'string') { basename = options.rename; } else if (typeof options.rename === 'function') { basename = options.rename(basename); } if (options.cwd) { dest = path.resolve(options.cwd, dest); } if (options.parents) { return path.join(dest, dirname, basename); } return path.join(dest, basename); }; module.exports = (src, dest, options = {}) => { src = arrify(src); const progressEmitter = new EventEmitter(); if (src.length === 0 || !dest) { const promise = Promise.reject(new CpyError('`files` and `destination` required')); promise.on = (...args) => { progressEmitter.on(...args); return promise; }; return promise; } const copyStatus = new Map(); let completedFiles = 0; let completedSize = 0; const promise = globby(src, options) .catch(err => { throw new CpyError(`Cannot glob \`${src}\`: ${err.message}`, err); }) .then(files => { if (files.length === 0) { progressEmitter.emit('progress', { totalFiles: 0, percent: 1, completedFiles: 0, completedSize: 0 }); } return Promise.all(files.map(srcPath => { const from = preprocessSrcPath(srcPath, options); const to = preprocessDestPath(srcPath, dest, options); return cpFile(from, to, options) .on('progress', event => { const fileStatus = copyStatus.get(event.src) || {written: 0, percent: 0}; if (fileStatus.written !== event.written || fileStatus.percent !== event.percent) { completedSize -= fileStatus.written; completedSize += event.written; if (event.percent === 1 && fileStatus.percent !== 1) { completedFiles++; } copyStatus.set(event.src, {written: event.written, percent: event.percent}); progressEmitter.emit('progress', { totalFiles: files.length, percent: completedFiles / files.length, completedFiles, completedSize }); } }) .catch(err => { throw new CpyError(`Cannot copy from \`${from}\` to \`${to}\`: ${err.message}`, err); }); })); }); promise.on = (...args) => { progressEmitter.on(...args); return promise; }; return promise; }; /***/ }), /* 374 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (val) { if (val === null || val === undefined) { return []; } return Array.isArray(val) ? val : [val]; }; /***/ }), /* 375 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const arrayUnion = __webpack_require__(141); const glob = __webpack_require__(36); const fastGlob = __webpack_require__(376); const dirGlob = __webpack_require__(539); const gitignore = __webpack_require__(540); const DEFAULT_FILTER = () => false; const isNegative = pattern => pattern[0] === '!'; const assertPatternsInput = patterns => { if (!patterns.every(x => typeof x === 'string')) { throw new TypeError('Patterns must be a string or an array of strings'); } }; const generateGlobTasks = (patterns, taskOpts) => { patterns = [].concat(patterns); assertPatternsInput(patterns); const globTasks = []; taskOpts = Object.assign({ ignore: [], expandDirectories: true }, taskOpts); patterns.forEach((pattern, i) => { if (isNegative(pattern)) { return; } const ignore = patterns .slice(i) .filter(isNegative) .map(pattern => pattern.slice(1)); const opts = Object.assign({}, taskOpts, { ignore: taskOpts.ignore.concat(ignore) }); globTasks.push({pattern, opts}); }); return globTasks; }; const globDirs = (task, fn) => { let opts = {cwd: task.opts.cwd}; if (Array.isArray(task.opts.expandDirectories)) { opts = Object.assign(opts, {files: task.opts.expandDirectories}); } else if (typeof task.opts.expandDirectories === 'object') { opts = Object.assign(opts, task.opts.expandDirectories); } return fn(task.pattern, opts); }; const getPattern = (task, fn) => task.opts.expandDirectories ? globDirs(task, fn) : [task.pattern]; module.exports = (patterns, opts) => { let globTasks; try { globTasks = generateGlobTasks(patterns, opts); } catch (err) { return Promise.reject(err); } const getTasks = Promise.all(globTasks.map(task => Promise.resolve(getPattern(task, dirGlob)) .then(globs => Promise.all(globs.map(glob => ({ pattern: glob, opts: task.opts })))) )) .then(tasks => arrayUnion.apply(null, tasks)); const getFilter = () => { return Promise.resolve( opts && opts.gitignore ? gitignore({cwd: opts.cwd, ignore: opts.ignore}) : DEFAULT_FILTER ); }; return getFilter() .then(filter => { return getTasks .then(tasks => Promise.all(tasks.map(task => fastGlob(task.pattern, task.opts)))) .then(paths => arrayUnion.apply(null, paths)) .then(paths => paths.filter(p => !filter(p))); }); }; module.exports.sync = (patterns, opts) => { const globTasks = generateGlobTasks(patterns, opts); const getFilter = () => { return opts && opts.gitignore ? gitignore.sync({cwd: opts.cwd, ignore: opts.ignore}) : DEFAULT_FILTER; }; const tasks = globTasks.reduce((tasks, task) => { const newTask = getPattern(task, dirGlob.sync).map(glob => ({ pattern: glob, opts: task.opts })); return tasks.concat(newTask); }, []); const filter = getFilter(); return tasks.reduce( (matches, task) => arrayUnion(matches, fastGlob.sync(task.pattern, task.opts)), [] ).filter(p => !filter(p)); }; module.exports.generateGlobTasks = generateGlobTasks; module.exports.hasMagic = (patterns, opts) => [] .concat(patterns) .some(pattern => glob.hasMagic(pattern, opts)); module.exports.gitignore = gitignore; /***/ }), /* 376 */ /***/ (function(module, exports, __webpack_require__) { const pkg = __webpack_require__(377); module.exports = pkg.async; module.exports.default = pkg.async; module.exports.async = pkg.async; module.exports.sync = pkg.sync; module.exports.stream = pkg.stream; /***/ }), /* 377 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var merge2 = __webpack_require__(378); var optionsManager = __webpack_require__(379); var taskManager = __webpack_require__(380); var reader_async_1 = __webpack_require__(518); var reader_stream_1 = __webpack_require__(537); var reader_sync_1 = __webpack_require__(538); var arrayUtils = __webpack_require__(534); /** * Returns a set of works based on provided tasks and class of the reader. */ function getWorks(source, _Reader, opts) { var patterns = [].concat(source); var options = optionsManager.prepare(opts); var tasks = taskManager.generate(patterns, options); var reader = new _Reader(options); return tasks.map(reader.read, reader); } /** * Synchronous API. */ function sync(source, opts) { var works = getWorks(source, reader_sync_1.default, opts); return arrayUtils.flatten(works); } exports.sync = sync; /** * Asynchronous API. */ function async(source, opts) { var works = getWorks(source, reader_async_1.default, opts); return Promise.all(works).then(arrayUtils.flatten); } exports.async = async; /** * Stream API. */ function stream(source, opts) { var works = getWorks(source, reader_stream_1.default, opts); return merge2(works); } exports.stream = stream; /***/ }), /* 378 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* * merge2 * https://github.com/teambition/merge2 * * Copyright (c) 2014-2016 Teambition * Licensed under the MIT license. */ const Stream = __webpack_require__(28) const PassThrough = Stream.PassThrough const slice = Array.prototype.slice module.exports = merge2 function merge2 () { const streamsQueue = [] let merging = false let args = slice.call(arguments) let options = args[args.length - 1] if (options && !Array.isArray(options) && options.pipe == null) args.pop() else options = {} let doEnd = options.end !== false if (options.objectMode == null) options.objectMode = true if (options.highWaterMark == null) options.highWaterMark = 64 * 1024 const mergedStream = PassThrough(options) function addStream () { for (let i = 0, len = arguments.length; i < len; i++) { streamsQueue.push(pauseStreams(arguments[i], options)) } mergeStream() return this } function mergeStream () { if (merging) return merging = true let streams = streamsQueue.shift() if (!streams) { process.nextTick(endStream) return } if (!Array.isArray(streams)) streams = [streams] let pipesCount = streams.length + 1 function next () { if (--pipesCount > 0) return merging = false mergeStream() } function pipe (stream) { function onend () { stream.removeListener('merge2UnpipeEnd', onend) stream.removeListener('end', onend) next() } // skip ended stream if (stream._readableState.endEmitted) return next() stream.on('merge2UnpipeEnd', onend) stream.on('end', onend) stream.pipe(mergedStream, {end: false}) // compatible for old stream stream.resume() } for (let i = 0; i < streams.length; i++) pipe(streams[i]) next() } function endStream () { merging = false // emit 'queueDrain' when all streams merged. mergedStream.emit('queueDrain') return doEnd && mergedStream.end() } mergedStream.setMaxListeners(0) mergedStream.add = addStream mergedStream.on('unpipe', function (stream) { stream.emit('merge2UnpipeEnd') }) if (args.length) addStream.apply(null, args) return mergedStream } // check and pause streams for pipe. function pauseStreams (streams, options) { if (!Array.isArray(streams)) { // Backwards-compat with old-style streams if (!streams._readableState && streams.pipe) streams = streams.pipe(PassThrough(options)) if (!streams._readableState || !streams.pause || !streams.pipe) { throw new Error('Only readable stream can be merged.') } streams.pause() } else { for (let i = 0, len = streams.length; i < len; i++) streams[i] = pauseStreams(streams[i], options) } return streams } /***/ }), /* 379 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function prepare(options) { var opts = Object.assign({ cwd: process.cwd(), deep: true, ignore: [], dot: false, stats: false, onlyFiles: true, onlyDirectories: false, followSymlinkedDirectories: true, unique: true, markDirectories: false, absolute: false, nobrace: false, noglobstar: false, noext: false, nocase: false, matchBase: false, transform: null }, options); if (opts.onlyDirectories) { opts.onlyFiles = false; } return opts; } exports.prepare = prepare; /***/ }), /* 380 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var objectUtils = __webpack_require__(381); var patternUtils = __webpack_require__(382); /** * Returns grouped patterns by base directory of each pattern. */ function groupPatternsByParentDirectory(patterns) { return patterns.reduce(function (collection, pattern) { var parent = patternUtils.getBaseDirectory(pattern); if (!collection[parent]) { collection[parent] = []; } collection[parent].push(pattern); return collection; }, {}); } exports.groupPatternsByParentDirectory = groupPatternsByParentDirectory; /** * Convert positive patterns to tasks. */ function makePositiveTaskGroup(positive) { return Object.keys(positive).reduce(function (collection, base) { var positivePatterns = [].concat(positive[base]); collection[base] = { base: base, patterns: positivePatterns, positive: positivePatterns, negative: [] }; return collection; }, {}); } exports.makePositiveTaskGroup = makePositiveTaskGroup; /** * Convert negative patterns to tasks. */ function makeNegativeTaskGroup(negative) { return Object.keys(negative).reduce(function (collection, base) { var negativePatterns = [].concat(negative[base]); collection[base] = { base: base, patterns: negativePatterns.map(patternUtils.convertToNegativePattern), positive: [], negative: negativePatterns }; return collection; }, {}); } exports.makeNegativeTaskGroup = makeNegativeTaskGroup; /** * Returns merged positive and negative task groups. * * Just two rules: * - If a positive task group has a pair in the negative group, then merge it. * - If a negative task group has a global base task, then merge them to full positive group. */ function mergeTaskGroups(positive, negative) { var group = positive; var globalNegativePatterns = '.' in negative ? negative['.'].negative : []; Object.keys(group).forEach(function (base) { if (base in negative) { group[base].patterns = group[base].patterns.concat(negative[base].negative.map(patternUtils.convertToNegativePattern)); group[base].negative = group[base].negative.concat(negative[base].negative); } if (globalNegativePatterns.length !== 0) { group[base].patterns = group[base].patterns.concat(globalNegativePatterns.map(patternUtils.convertToNegativePattern)); group[base].negative = group[base].negative.concat(globalNegativePatterns); } }); return group; } exports.mergeTaskGroups = mergeTaskGroups; /** * Returns builded tasks for provided patterns groups. */ function makeTasks(positive, negative) { var positiveTaskGroup = makePositiveTaskGroup(positive); var negativeTaskGroup = makeNegativeTaskGroup(negative); var groups = mergeTaskGroups(positiveTaskGroup, negativeTaskGroup); return objectUtils.values(groups); } exports.makeTasks = makeTasks; /** * Generate tasks for provided patterns based on base directory of each pattern. */ function generate(patterns, options) { var unixPatterns = patterns.map(patternUtils.unixifyPattern); var positive = patternUtils.getPositivePatterns(unixPatterns); if (positive.length === 0) { return []; } var ignore = options.ignore; var negative = patternUtils.getNegativePatterns(unixPatterns) .map(patternUtils.convertToPositivePattern) .concat(ignore) .map(patternUtils.trimTrailingSlashGlobStar); var positiveGroup = groupPatternsByParentDirectory(positive); var negativeGroup = groupPatternsByParentDirectory(negative); // When we have a global group – there is no reason to divide the patterns into independent tasks because the first task covers the rest. if ('.' in positiveGroup) { var task = { base: '.', patterns: [].concat(positive, negative.map(patternUtils.convertToNegativePattern)), positive: positive, negative: negative }; return [task]; } return makeTasks(positiveGroup, negativeGroup); } exports.generate = generate; /***/ }), /* 381 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function values(obj) { return Object.keys(obj).map(function (key) { return obj[key]; }); } exports.values = values; /***/ }), /* 382 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __values = (this && this.__values) || function (o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; }; Object.defineProperty(exports, "__esModule", { value: true }); var globParent = __webpack_require__(383); var micromatch = __webpack_require__(387); var GLOBSTAR = '**'; /** * Convert a windows «path» to a unix-style «path». */ function unixifyPattern(pattern) { return pattern.replace(/\\/g, '/'); } exports.unixifyPattern = unixifyPattern; /** * Returns negative pattern as positive pattern. */ function convertToPositivePattern(pattern) { return pattern.slice(1); } exports.convertToPositivePattern = convertToPositivePattern; /** * Returns positive pattern as negative pattern. */ function convertToNegativePattern(pattern) { return '!' + pattern; } exports.convertToNegativePattern = convertToNegativePattern; /** * Return true if provided pattern is negative pattern. */ function isNegativePattern(pattern) { return pattern.startsWith('!'); } exports.isNegativePattern = isNegativePattern; /** * Return true if provided pattern is positive pattern. */ function isPositivePattern(pattern) { return !isNegativePattern(pattern); } exports.isPositivePattern = isPositivePattern; /** * Extracts negative patterns from array of patterns. */ function getNegativePatterns(patterns) { return patterns.filter(isNegativePattern); } exports.getNegativePatterns = getNegativePatterns; /** * Extracts positive patterns from array of patterns. */ function getPositivePatterns(patterns) { return patterns.filter(isPositivePattern); } exports.getPositivePatterns = getPositivePatterns; /** * Extract base directory from provided pattern. */ function getBaseDirectory(pattern) { return globParent(pattern); } exports.getBaseDirectory = getBaseDirectory; /** * Return true if provided pattern has globstar. */ function hasGlobStar(pattern) { return pattern.indexOf(GLOBSTAR) !== -1; } exports.hasGlobStar = hasGlobStar; /** * Return true if provided pattern ends with slash and globstar. */ function endsWithSlashGlobStar(pattern) { return pattern.endsWith('/' + GLOBSTAR); } exports.endsWithSlashGlobStar = endsWithSlashGlobStar; /** * Trim trailing globstar if provided pattern ends with slash and globstar. */ function trimTrailingSlashGlobStar(pattern) { return endsWithSlashGlobStar(pattern) ? pattern.slice(0, -3) : pattern; } exports.trimTrailingSlashGlobStar = trimTrailingSlashGlobStar; /** * Return naive depth of provided pattern. */ function getDepth(pattern) { return pattern.split('/').length; } exports.getDepth = getDepth; /** * Make RegExp for provided pattern. */ function makeRe(pattern, options) { return micromatch.makeRe(pattern, options); } exports.makeRe = makeRe; /** * Convert patterns to regexps. */ function convertPatternsToRe(patterns, options) { return patterns.map(function (pattern) { return makeRe(pattern, options); }); } exports.convertPatternsToRe = convertPatternsToRe; /** * Returns true if the entry match any of the given RegExp's. */ function matchAny(entry, patternsRe) { try { for (var patternsRe_1 = __values(patternsRe), patternsRe_1_1 = patternsRe_1.next(); !patternsRe_1_1.done; patternsRe_1_1 = patternsRe_1.next()) { var regexp = patternsRe_1_1.value; if (regexp.test(entry)) { return true; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (patternsRe_1_1 && !patternsRe_1_1.done && (_a = patternsRe_1.return)) _a.call(patternsRe_1); } finally { if (e_1) throw e_1.error; } } return false; var e_1, _a; } exports.matchAny = matchAny; /** * Returns true if the entry doesn't match any of the given negative RegExp's and match any of the given positive RegExp's. */ function match(entry, positiveRe, negativeRe) { return matchAny(entry, negativeRe) ? false : matchAny(entry, positiveRe); } exports.match = match; /***/ }), /* 383 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var path = __webpack_require__(16); var isglob = __webpack_require__(384); var pathDirname = __webpack_require__(386); var isWin32 = __webpack_require__(11).platform() === 'win32'; module.exports = function globParent(str) { // flip windows path separators if (isWin32 && str.indexOf('/') < 0) str = str.split('\\').join('/'); // special case for strings ending in enclosure containing path separator if (/[\{\[].*[\/]*.*[\}\]]$/.test(str)) str += '/'; // preserves full path in case of trailing path separator str += 'a'; // remove path parts that are globby do {str = pathDirname.posix(str)} while (isglob(str) || /(^|[^\\])([\{\[]|\([^\)]+$)/.test(str)); // remove escape chars and return result return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1'); }; /***/ }), /* 384 */ /***/ (function(module, exports, __webpack_require__) { /*! * is-glob * * Copyright (c) 2014-2016, Jon Schlinkert. * Licensed under the MIT License. */ var isExtglob = __webpack_require__(385); module.exports = function isGlob(str) { if (typeof str !== 'string' || str === '') { return false; } if (isExtglob(str)) return true; var regex = /(\\).|([*?]|\[.*\]|\{.*\}|\(.*\|.*\)|^!)/; var match; while ((match = regex.exec(str))) { if (match[2]) return true; str = str.slice(match.index + match[0].length); } return false; }; /***/ }), /* 385 */ /***/ (function(module, exports) { /*! * is-extglob * * Copyright (c) 2014-2016, Jon Schlinkert. * Licensed under the MIT License. */ module.exports = function isExtglob(str) { if (typeof str !== 'string' || str === '') { return false; } var match; while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { if (match[2]) return true; str = str.slice(match.index + match[0].length); } return false; }; /***/ }), /* 386 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var path = __webpack_require__(16); var inspect = __webpack_require__(29).inspect; function assertPath(path) { if (typeof path !== 'string') { throw new TypeError('Path must be a string. Received ' + inspect(path)); } } function posix(path) { assertPath(path); if (path.length === 0) return '.'; var code = path.charCodeAt(0); var hasRoot = (code === 47/*/*/); var end = -1; var matchedSlash = true; for (var i = path.length - 1; i >= 1; --i) { code = path.charCodeAt(i); if (code === 47/*/*/) { if (!matchedSlash) { end = i; break; } } else { // We saw the first non-path separator matchedSlash = false; } } if (end === -1) return hasRoot ? '/' : '.'; if (hasRoot && end === 1) return '//'; return path.slice(0, end); } function win32(path) { assertPath(path); var len = path.length; if (len === 0) return '.'; var rootEnd = -1; var end = -1; var matchedSlash = true; var offset = 0; var code = path.charCodeAt(0); // Try to match a root if (len > 1) { if (code === 47/*/*/ || code === 92/*\*/) { // Possible UNC root rootEnd = offset = 1; code = path.charCodeAt(1); if (code === 47/*/*/ || code === 92/*\*/) { // Matched double path separator at beginning var j = 2; var last = j; // Match 1 or more non-path separators for (; j < len; ++j) { code = path.charCodeAt(j); if (code === 47/*/*/ || code === 92/*\*/) break; } if (j < len && j !== last) { // Matched! last = j; // Match 1 or more path separators for (; j < len; ++j) { code = path.charCodeAt(j); if (code !== 47/*/*/ && code !== 92/*\*/) break; } if (j < len && j !== last) { // Matched! last = j; // Match 1 or more non-path separators for (; j < len; ++j) { code = path.charCodeAt(j); if (code === 47/*/*/ || code === 92/*\*/) break; } if (j === len) { // We matched a UNC root only return path; } if (j !== last) { // We matched a UNC root with leftovers // Offset by 1 to include the separator after the UNC root to // treat it as a "normal root" on top of a (UNC) root rootEnd = offset = j + 1; } } } } } else if ((code >= 65/*A*/ && code <= 90/*Z*/) || (code >= 97/*a*/ && code <= 122/*z*/)) { // Possible device root code = path.charCodeAt(1); if (path.charCodeAt(1) === 58/*:*/) { rootEnd = offset = 2; if (len > 2) { code = path.charCodeAt(2); if (code === 47/*/*/ || code === 92/*\*/) rootEnd = offset = 3; } } } } else if (code === 47/*/*/ || code === 92/*\*/) { return path[0]; } for (var i = len - 1; i >= offset; --i) { code = path.charCodeAt(i); if (code === 47/*/*/ || code === 92/*\*/) { if (!matchedSlash) { end = i; break; } } else { // We saw the first non-path separator matchedSlash = false; } } if (end === -1) { if (rootEnd === -1) return '.'; else end = rootEnd; } return path.slice(0, end); } module.exports = process.platform === 'win32' ? win32 : posix; module.exports.posix = posix; module.exports.win32 = win32; /***/ }), /* 387 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Module dependencies */ var util = __webpack_require__(29); var braces = __webpack_require__(388); var toRegex = __webpack_require__(389); var extend = __webpack_require__(398); /** * Local dependencies */ var compilers = __webpack_require__(492); var parsers = __webpack_require__(514); var cache = __webpack_require__(515); var utils = __webpack_require__(516); var MAX_LENGTH = 1024 * 64; /** * The main function takes a list of strings and one or more * glob patterns to use for matching. * * ```js * var mm = require('micromatch'); * mm(list, patterns[, options]); * * console.log(mm(['a.js', 'a.txt'], ['*.js'])); * //=> [ 'a.js' ] * ``` * @param {Array} `list` A list of strings to match * @param {String|Array} `patterns` One or more glob patterns to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Array} Returns an array of matches * @summary false * @api public */ function micromatch(list, patterns, options) { patterns = utils.arrayify(patterns); list = utils.arrayify(list); var len = patterns.length; if (list.length === 0 || len === 0) { return []; } if (len === 1) { return micromatch.match(list, patterns[0], options); } var omit = []; var keep = []; var idx = -1; while (++idx < len) { var pattern = patterns[idx]; if (typeof pattern === 'string' && pattern.charCodeAt(0) === 33 /* ! */) { omit.push.apply(omit, micromatch.match(list, pattern.slice(1), options)); } else { keep.push.apply(keep, micromatch.match(list, pattern, options)); } } var matches = utils.diff(keep, omit); if (!options || options.nodupes !== false) { return utils.unique(matches); } return matches; } /** * Similar to the main function, but `pattern` must be a string. * * ```js * var mm = require('micromatch'); * mm.match(list, pattern[, options]); * * console.log(mm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a')); * //=> ['a.a', 'a.aa'] * ``` * @param {Array} `list` Array of strings to match * @param {String} `pattern` Glob pattern to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Array} Returns an array of matches * @api public */ micromatch.match = function(list, pattern, options) { if (Array.isArray(pattern)) { throw new TypeError('expected pattern to be a string'); } var unixify = utils.unixify(options); var isMatch = memoize('match', pattern, options, micromatch.matcher); var matches = []; list = utils.arrayify(list); var len = list.length; var idx = -1; while (++idx < len) { var ele = list[idx]; if (ele === pattern || isMatch(ele)) { matches.push(utils.value(ele, unixify, options)); } } // if no options were passed, uniquify results and return if (typeof options === 'undefined') { return utils.unique(matches); } if (matches.length === 0) { if (options.failglob === true) { throw new Error('no matches found for "' + pattern + '"'); } if (options.nonull === true || options.nullglob === true) { return [options.unescape ? utils.unescape(pattern) : pattern]; } } // if `opts.ignore` was defined, diff ignored list if (options.ignore) { matches = micromatch.not(matches, options.ignore, options); } return options.nodupes !== false ? utils.unique(matches) : matches; }; /** * Returns true if the specified `string` matches the given glob `pattern`. * * ```js * var mm = require('micromatch'); * mm.isMatch(string, pattern[, options]); * * console.log(mm.isMatch('a.a', '*.a')); * //=> true * console.log(mm.isMatch('a.b', '*.a')); * //=> false * ``` * @param {String} `string` String to match * @param {String} `pattern` Glob pattern to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns true if the string matches the glob pattern. * @api public */ micromatch.isMatch = function(str, pattern, options) { if (typeof str !== 'string') { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } if (isEmptyString(str) || isEmptyString(pattern)) { return false; } var equals = utils.equalsPattern(options); if (equals(str)) { return true; } var isMatch = memoize('isMatch', pattern, options, micromatch.matcher); return isMatch(str); }; /** * Returns true if some of the strings in the given `list` match any of the * given glob `patterns`. * * ```js * var mm = require('micromatch'); * mm.some(list, patterns[, options]); * * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); * // true * console.log(mm.some(['foo.js'], ['*.js', '!foo.js'])); * // false * ``` * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. * @param {String|Array} `patterns` One or more glob patterns to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns true if any patterns match `str` * @api public */ micromatch.some = function(list, patterns, options) { if (typeof list === 'string') { list = [list]; } for (var i = 0; i < list.length; i++) { if (micromatch(list[i], patterns, options).length === 1) { return true; } } return false; }; /** * Returns true if every string in the given `list` matches * any of the given glob `patterns`. * * ```js * var mm = require('micromatch'); * mm.every(list, patterns[, options]); * * console.log(mm.every('foo.js', ['foo.js'])); * // true * console.log(mm.every(['foo.js', 'bar.js'], ['*.js'])); * // true * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); * // false * console.log(mm.every(['foo.js'], ['*.js', '!foo.js'])); * // false * ``` * @param {String|Array} `list` The string or array of strings to test. * @param {String|Array} `patterns` One or more glob patterns to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns true if any patterns match `str` * @api public */ micromatch.every = function(list, patterns, options) { if (typeof list === 'string') { list = [list]; } for (var i = 0; i < list.length; i++) { if (micromatch(list[i], patterns, options).length !== 1) { return false; } } return true; }; /** * Returns true if **any** of the given glob `patterns` * match the specified `string`. * * ```js * var mm = require('micromatch'); * mm.any(string, patterns[, options]); * * console.log(mm.any('a.a', ['b.*', '*.a'])); * //=> true * console.log(mm.any('a.a', 'b.*')); * //=> false * ``` * @param {String|Array} `str` The string to test. * @param {String|Array} `patterns` One or more glob patterns to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns true if any patterns match `str` * @api public */ micromatch.any = function(str, patterns, options) { if (typeof str !== 'string') { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } if (isEmptyString(str) || isEmptyString(patterns)) { return false; } if (typeof patterns === 'string') { patterns = [patterns]; } for (var i = 0; i < patterns.length; i++) { if (micromatch.isMatch(str, patterns[i], options)) { return true; } } return false; }; /** * Returns true if **all** of the given `patterns` match * the specified string. * * ```js * var mm = require('micromatch'); * mm.all(string, patterns[, options]); * * console.log(mm.all('foo.js', ['foo.js'])); * // true * * console.log(mm.all('foo.js', ['*.js', '!foo.js'])); * // false * * console.log(mm.all('foo.js', ['*.js', 'foo.js'])); * // true * * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); * // true * ``` * @param {String|Array} `str` The string to test. * @param {String|Array} `patterns` One or more glob patterns to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns true if any patterns match `str` * @api public */ micromatch.all = function(str, patterns, options) { if (typeof str !== 'string') { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } if (typeof patterns === 'string') { patterns = [patterns]; } for (var i = 0; i < patterns.length; i++) { if (!micromatch.isMatch(str, patterns[i], options)) { return false; } } return true; }; /** * Returns a list of strings that _**do not match any**_ of the given `patterns`. * * ```js * var mm = require('micromatch'); * mm.not(list, patterns[, options]); * * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a')); * //=> ['b.b', 'c.c'] * ``` * @param {Array} `list` Array of strings to match. * @param {String|Array} `patterns` One or more glob pattern to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Array} Returns an array of strings that **do not match** the given patterns. * @api public */ micromatch.not = function(list, patterns, options) { var opts = extend({}, options); var ignore = opts.ignore; delete opts.ignore; var unixify = utils.unixify(opts); list = utils.arrayify(list).map(unixify); var matches = utils.diff(list, micromatch(list, patterns, opts)); if (ignore) { matches = utils.diff(matches, micromatch(list, ignore)); } return opts.nodupes !== false ? utils.unique(matches) : matches; }; /** * Returns true if the given `string` contains the given pattern. Similar * to [.isMatch](#isMatch) but the pattern can match any part of the string. * * ```js * var mm = require('micromatch'); * mm.contains(string, pattern[, options]); * * console.log(mm.contains('aa/bb/cc', '*b')); * //=> true * console.log(mm.contains('aa/bb/cc', '*d')); * //=> false * ``` * @param {String} `str` The string to match. * @param {String|Array} `patterns` Glob pattern to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns true if the patter matches any part of `str`. * @api public */ micromatch.contains = function(str, patterns, options) { if (typeof str !== 'string') { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } if (typeof patterns === 'string') { if (isEmptyString(str) || isEmptyString(patterns)) { return false; } var equals = utils.equalsPattern(patterns, options); if (equals(str)) { return true; } var contains = utils.containsPattern(patterns, options); if (contains(str)) { return true; } } var opts = extend({}, options, {contains: true}); return micromatch.any(str, patterns, opts); }; /** * Returns true if the given pattern and options should enable * the `matchBase` option. * @return {Boolean} * @api private */ micromatch.matchBase = function(pattern, options) { if (pattern && pattern.indexOf('/') !== -1 || !options) return false; return options.basename === true || options.matchBase === true; }; /** * Filter the keys of the given object with the given `glob` pattern * and `options`. Does not attempt to match nested keys. If you need this feature, * use [glob-object][] instead. * * ```js * var mm = require('micromatch'); * mm.matchKeys(object, patterns[, options]); * * var obj = { aa: 'a', ab: 'b', ac: 'c' }; * console.log(mm.matchKeys(obj, '*b')); * //=> { ab: 'b' } * ``` * @param {Object} `object` The object with keys to filter. * @param {String|Array} `patterns` One or more glob patterns to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Object} Returns an object with only keys that match the given patterns. * @api public */ micromatch.matchKeys = function(obj, patterns, options) { if (!utils.isObject(obj)) { throw new TypeError('expected the first argument to be an object'); } var keys = micromatch(Object.keys(obj), patterns, options); return utils.pick(obj, keys); }; /** * Returns a memoized matcher function from the given glob `pattern` and `options`. * The returned function takes a string to match as its only argument and returns * true if the string is a match. * * ```js * var mm = require('micromatch'); * mm.matcher(pattern[, options]); * * var isMatch = mm.matcher('*.!(*a)'); * console.log(isMatch('a.a')); * //=> false * console.log(isMatch('a.b')); * //=> true * ``` * @param {String} `pattern` Glob pattern * @param {Object} `options` See available [options](#options) for changing how matches are performed. * @return {Function} Returns a matcher function. * @api public */ micromatch.matcher = function matcher(pattern, options) { if (Array.isArray(pattern)) { return compose(pattern, options, matcher); } // if pattern is a regex if (pattern instanceof RegExp) { return test(pattern); } // if pattern is invalid if (!utils.isString(pattern)) { throw new TypeError('expected pattern to be an array, string or regex'); } // if pattern is a non-glob string if (!utils.hasSpecialChars(pattern)) { if (options && options.nocase === true) { pattern = pattern.toLowerCase(); } return utils.matchPath(pattern, options); } // if pattern is a glob string var re = micromatch.makeRe(pattern, options); // if `options.matchBase` or `options.basename` is defined if (micromatch.matchBase(pattern, options)) { return utils.matchBasename(re, options); } function test(regex) { var equals = utils.equalsPattern(options); var unixify = utils.unixify(options); return function(str) { if (equals(str)) { return true; } if (regex.test(unixify(str))) { return true; } return false; }; } var fn = test(re); Object.defineProperty(fn, 'result', { configurable: true, enumerable: false, value: re.result }); return fn; }; /** * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match. * * ```js * var mm = require('micromatch'); * mm.capture(pattern, string[, options]); * * console.log(mm.capture('test/*.js', 'test/foo.js')); * //=> ['foo'] * console.log(mm.capture('test/*.js', 'foo/bar.css')); * //=> null * ``` * @param {String} `pattern` Glob pattern to use for matching. * @param {String} `string` String to match * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`. * @api public */ micromatch.capture = function(pattern, str, options) { var re = micromatch.makeRe(pattern, extend({capture: true}, options)); var unixify = utils.unixify(options); function match() { return function(string) { var match = re.exec(unixify(string)); if (!match) { return null; } return match.slice(1); }; } var capture = memoize('capture', pattern, options, match); return capture(str); }; /** * Create a regular expression from the given glob `pattern`. * * ```js * var mm = require('micromatch'); * mm.makeRe(pattern[, options]); * * console.log(mm.makeRe('*.js')); * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ * ``` * @param {String} `pattern` A glob pattern to convert to regex. * @param {Object} `options` See available [options](#options) for changing how matches are performed. * @return {RegExp} Returns a regex created from the given pattern. * @api public */ micromatch.makeRe = function(pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('expected pattern to be a string'); } if (pattern.length > MAX_LENGTH) { throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); } function makeRe() { var result = micromatch.create(pattern, options); var ast_array = []; var output = result.map(function(obj) { obj.ast.state = obj.state; ast_array.push(obj.ast); return obj.output; }); var regex = toRegex(output.join('|'), options); Object.defineProperty(regex, 'result', { configurable: true, enumerable: false, value: ast_array }); return regex; } return memoize('makeRe', pattern, options, makeRe); }; /** * Expand the given brace `pattern`. * * ```js * var mm = require('micromatch'); * console.log(mm.braces('foo/{a,b}/bar')); * //=> ['foo/(a|b)/bar'] * * console.log(mm.braces('foo/{a,b}/bar', {expand: true})); * //=> ['foo/(a|b)/bar'] * ``` * @param {String} `pattern` String with brace pattern to expand. * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options. * @return {Array} * @api public */ micromatch.braces = function(pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('expected a string'); } function expand() { if (options && options.nobrace === true) return [pattern]; if (!/\{.*\}/.test(pattern)) return [pattern]; // if (/[!@*?+]\{/.test(pattern)) { // options = utils.extend({}, options, {expand: true}); // } return braces(pattern, options); } return memoize('braces', pattern, options, expand); }; /** * Proxy to the [micromatch.braces](#method), for parity with * minimatch. */ micromatch.braceExpand = function(pattern, options) { var opts = extend({}, options, {expand: true}); return micromatch.braces(pattern, opts); }; /** * Parses the given glob `pattern` and returns an array of abstract syntax * trees (ASTs), with the compiled `output` and optional source `map` on * each AST. * * ```js * var mm = require('micromatch'); * mm.create(pattern[, options]); * * console.log(mm.create('abc/*.js')); * // [{ options: { source: 'string', sourcemap: true }, * // state: {}, * // compilers: * // { ... }, * // output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js', * // ast: * // { type: 'root', * // errors: [], * // nodes: * // [ ... ], * // dot: false, * // input: 'abc/*.js' }, * // parsingErrors: [], * // map: * // { version: 3, * // sources: [ 'string' ], * // names: [], * // mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE', * // sourcesContent: [ 'abc/*.js' ] }, * // position: { line: 1, column: 28 }, * // content: {}, * // files: {}, * // idx: 6 }] * ``` * @param {String} `pattern` Glob pattern to parse and compile. * @param {Object} `options` Any [options](#options) to change how parsing and compiling is performed. * @return {Object} Returns an object with the parsed AST, compiled string and optional source map. * @api public */ micromatch.create = function(pattern, options) { return memoize('create', pattern, options, function() { function create(str, opts) { return micromatch.compile(micromatch.parse(str, opts), opts); } pattern = micromatch.braces(pattern, options); var len = pattern.length; var idx = -1; var res = []; while (++idx < len) { res.push(create(pattern[idx], options)); } return res; }); }; /** * Parse the given `str` with the given `options`. * * ```js * var mm = require('micromatch'); * mm.parse(pattern[, options]); * * var ast = mm.parse('a/{b,c}/d'); * console.log(ast); * // { type: 'root', * // errors: [], * // input: 'a/{b,c}/d', * // nodes: * // [ { type: 'bos', val: '' }, * // { type: 'text', val: 'a/' }, * // { type: 'brace', * // nodes: * // [ { type: 'brace.open', val: '{' }, * // { type: 'text', val: 'b,c' }, * // { type: 'brace.close', val: '}' } ] }, * // { type: 'text', val: '/d' }, * // { type: 'eos', val: '' } ] } * ``` * @param {String} `str` * @param {Object} `options` * @return {Object} Returns an AST * @api public */ micromatch.parse = function(pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('expected a string'); } function parse() { var snapdragon = utils.instantiate(null, options); parsers(snapdragon, options); var ast = snapdragon.parse(pattern, options); utils.define(ast, 'snapdragon', snapdragon); ast.input = pattern; return ast; } return memoize('parse', pattern, options, parse); }; /** * Compile the given `ast` or string with the given `options`. * * ```js * var mm = require('micromatch'); * mm.compile(ast[, options]); * * var ast = mm.parse('a/{b,c}/d'); * console.log(mm.compile(ast)); * // { options: { source: 'string' }, * // state: {}, * // compilers: * // { eos: [Function], * // noop: [Function], * // bos: [Function], * // brace: [Function], * // 'brace.open': [Function], * // text: [Function], * // 'brace.close': [Function] }, * // output: [ 'a/(b|c)/d' ], * // ast: * // { ... }, * // parsingErrors: [] } * ``` * @param {Object|String} `ast` * @param {Object} `options` * @return {Object} Returns an object that has an `output` property with the compiled string. * @api public */ micromatch.compile = function(ast, options) { if (typeof ast === 'string') { ast = micromatch.parse(ast, options); } return memoize('compile', ast.input, options, function() { var snapdragon = utils.instantiate(ast, options); compilers(snapdragon, options); return snapdragon.compile(ast, options); }); }; /** * Clear the regex cache. * * ```js * mm.clearCache(); * ``` * @api public */ micromatch.clearCache = function() { micromatch.cache.caches = {}; }; /** * Returns true if the given value is effectively an empty string */ function isEmptyString(val) { return String(val) === '' || String(val) === './'; } /** * Compose a matcher function with the given patterns. * This allows matcher functions to be compiled once and * called multiple times. */ function compose(patterns, options, matcher) { var matchers; return memoize('compose', String(patterns), options, function() { return function(file) { // delay composition until it's invoked the first time, // after that it won't be called again if (!matchers) { matchers = []; for (var i = 0; i < patterns.length; i++) { matchers.push(matcher(patterns[i], options)); } } var len = matchers.length; while (len--) { if (matchers[len](file) === true) { return true; } } return false; }; }); } /** * Memoize a generated regex or function. A unique key is generated * from the `type` (usually method name), the `pattern`, and * user-defined options. */ function memoize(type, pattern, options, fn) { var key = utils.createKey(type + '=' + pattern, options); if (options && options.cache === false) { return fn(pattern, options); } if (cache.has(type, key)) { return cache.get(type, key); } var val = fn(pattern, options); cache.set(type, key, val); return val; } /** * Expose compiler, parser and cache on `micromatch` */ micromatch.compilers = compilers; micromatch.parsers = parsers; micromatch.caches = cache.caches; /** * Expose `micromatch` * @type {Function} */ module.exports = micromatch; /***/ }), /* 388 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Module dependencies */ var toRegex = __webpack_require__(389); var unique = __webpack_require__(401); var extend = __webpack_require__(398); /** * Local dependencies */ var compilers = __webpack_require__(402); var parsers = __webpack_require__(417); var Braces = __webpack_require__(427); var utils = __webpack_require__(403); var MAX_LENGTH = 1024 * 64; var cache = {}; /** * Convert the given `braces` pattern into a regex-compatible string. By default, only one string is generated for every input string. Set `options.expand` to true to return an array of patterns (similar to Bash or minimatch. Before using `options.expand`, it's recommended that you read the [performance notes](#performance)). * * ```js * var braces = require('braces'); * console.log(braces('{a,b,c}')); * //=> ['(a|b|c)'] * * console.log(braces('{a,b,c}', {expand: true})); * //=> ['a', 'b', 'c'] * ``` * @param {String} `str` * @param {Object} `options` * @return {String} * @api public */ function braces(pattern, options) { var key = utils.createKey(String(pattern), options); var arr = []; var disabled = options && options.cache === false; if (!disabled && cache.hasOwnProperty(key)) { return cache[key]; } if (Array.isArray(pattern)) { for (var i = 0; i < pattern.length; i++) { arr.push.apply(arr, braces.create(pattern[i], options)); } } else { arr = braces.create(pattern, options); } if (options && options.nodupes === true) { arr = unique(arr); } if (!disabled) { cache[key] = arr; } return arr; } /** * Expands a brace pattern into an array. This method is called by the main [braces](#braces) function when `options.expand` is true. Before using this method it's recommended that you read the [performance notes](#performance)) and advantages of using [.optimize](#optimize) instead. * * ```js * var braces = require('braces'); * console.log(braces.expand('a/{b,c}/d')); * //=> ['a/b/d', 'a/c/d']; * ``` * @param {String} `pattern` Brace pattern * @param {Object} `options` * @return {Array} Returns an array of expanded values. * @api public */ braces.expand = function(pattern, options) { return braces.create(pattern, extend({}, options, {expand: true})); }; /** * Expands a brace pattern into a regex-compatible, optimized string. This method is called by the main [braces](#braces) function by default. * * ```js * var braces = require('braces'); * console.log(braces.expand('a/{b,c}/d')); * //=> ['a/(b|c)/d'] * ``` * @param {String} `pattern` Brace pattern * @param {Object} `options` * @return {Array} Returns an array of expanded values. * @api public */ braces.optimize = function(pattern, options) { return braces.create(pattern, options); }; /** * Processes a brace pattern and returns either an expanded array (if `options.expand` is true), a highly optimized regex-compatible string. This method is called by the main [braces](#braces) function. * * ```js * var braces = require('braces'); * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' * ``` * @param {String} `pattern` Brace pattern * @param {Object} `options` * @return {Array} Returns an array of expanded values. * @api public */ braces.create = function(pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('expected a string'); } var maxLength = (options && options.maxLength) || MAX_LENGTH; if (pattern.length >= maxLength) { throw new Error('expected pattern to be less than ' + maxLength + ' characters'); } function create() { if (pattern === '' || pattern.length < 3) { return [pattern]; } if (utils.isEmptySets(pattern)) { return []; } if (utils.isQuotedString(pattern)) { return [pattern.slice(1, -1)]; } var proto = new Braces(options); var result = !options || options.expand !== true ? proto.optimize(pattern, options) : proto.expand(pattern, options); // get the generated pattern(s) var arr = result.output; // filter out empty strings if specified if (options && options.noempty === true) { arr = arr.filter(Boolean); } // filter out duplicates if specified if (options && options.nodupes === true) { arr = unique(arr); } Object.defineProperty(arr, 'result', { enumerable: false, value: result }); return arr; } return memoize('create', pattern, options, create); }; /** * Create a regular expression from the given string `pattern`. * * ```js * var braces = require('braces'); * * console.log(braces.makeRe('id-{200..300}')); * //=> /^(?:id-(20[0-9]|2[1-9][0-9]|300))$/ * ``` * @param {String} `pattern` The pattern to convert to regex. * @param {Object} `options` * @return {RegExp} * @api public */ braces.makeRe = function(pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('expected a string'); } var maxLength = (options && options.maxLength) || MAX_LENGTH; if (pattern.length >= maxLength) { throw new Error('expected pattern to be less than ' + maxLength + ' characters'); } function makeRe() { var arr = braces(pattern, options); var opts = extend({strictErrors: false}, options); return toRegex(arr, opts); } return memoize('makeRe', pattern, options, makeRe); }; /** * Parse the given `str` with the given `options`. * * ```js * var braces = require('braces'); * var ast = braces.parse('a/{b,c}/d'); * console.log(ast); * // { type: 'root', * // errors: [], * // input: 'a/{b,c}/d', * // nodes: * // [ { type: 'bos', val: '' }, * // { type: 'text', val: 'a/' }, * // { type: 'brace', * // nodes: * // [ { type: 'brace.open', val: '{' }, * // { type: 'text', val: 'b,c' }, * // { type: 'brace.close', val: '}' } ] }, * // { type: 'text', val: '/d' }, * // { type: 'eos', val: '' } ] } * ``` * @param {String} `pattern` Brace pattern to parse * @param {Object} `options` * @return {Object} Returns an AST * @api public */ braces.parse = function(pattern, options) { var proto = new Braces(options); return proto.parse(pattern, options); }; /** * Compile the given `ast` or string with the given `options`. * * ```js * var braces = require('braces'); * var ast = braces.parse('a/{b,c}/d'); * console.log(braces.compile(ast)); * // { options: { source: 'string' }, * // state: {}, * // compilers: * // { eos: [Function], * // noop: [Function], * // bos: [Function], * // brace: [Function], * // 'brace.open': [Function], * // text: [Function], * // 'brace.close': [Function] }, * // output: [ 'a/(b|c)/d' ], * // ast: * // { ... }, * // parsingErrors: [] } * ``` * @param {Object|String} `ast` AST from [.parse](#parse). If a string is passed it will be parsed first. * @param {Object} `options` * @return {Object} Returns an object that has an `output` property with the compiled string. * @api public */ braces.compile = function(ast, options) { var proto = new Braces(options); return proto.compile(ast, options); }; /** * Clear the regex cache. * * ```js * braces.clearCache(); * ``` * @api public */ braces.clearCache = function() { cache = braces.cache = {}; }; /** * Memoize a generated regex or function. A unique key is generated * from the method name, pattern, and user-defined options. Set * options.memoize to false to disable. */ function memoize(type, pattern, options, fn) { var key = utils.createKey(type + ':' + pattern, options); var disabled = options && options.cache === false; if (disabled) { braces.clearCache(); return fn(pattern, options); } if (cache.hasOwnProperty(key)) { return cache[key]; } var res = fn(pattern, options); cache[key] = res; return res; } /** * Expose `Braces` constructor and methods * @type {Function} */ braces.Braces = Braces; braces.compilers = compilers; braces.parsers = parsers; braces.cache = cache; /** * Expose `braces` * @type {Function} */ module.exports = braces; /***/ }), /* 389 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var define = __webpack_require__(390); var extend = __webpack_require__(398); var not = __webpack_require__(400); var MAX_LENGTH = 1024 * 64; /** * Session cache */ var cache = {}; /** * Create a regular expression from the given `pattern` string. * * @param {String|RegExp} `pattern` Pattern can be a string or regular expression. * @param {Object} `options` * @return {RegExp} * @api public */ module.exports = function(patterns, options) { if (!Array.isArray(patterns)) { return makeRe(patterns, options); } return makeRe(patterns.join('|'), options); }; /** * Create a regular expression from the given `pattern` string. * * @param {String|RegExp} `pattern` Pattern can be a string or regular expression. * @param {Object} `options` * @return {RegExp} * @api public */ function makeRe(pattern, options) { if (pattern instanceof RegExp) { return pattern; } if (typeof pattern !== 'string') { throw new TypeError('expected a string'); } if (pattern.length > MAX_LENGTH) { throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); } var key = pattern; // do this before shallow cloning options, it's a lot faster if (!options || (options && options.cache !== false)) { key = createKey(pattern, options); if (cache.hasOwnProperty(key)) { return cache[key]; } } var opts = extend({}, options); if (opts.contains === true) { if (opts.negate === true) { opts.strictNegate = false; } else { opts.strict = false; } } if (opts.strict === false) { opts.strictOpen = false; opts.strictClose = false; } var open = opts.strictOpen !== false ? '^' : ''; var close = opts.strictClose !== false ? '$' : ''; var flags = opts.flags || ''; var regex; if (opts.nocase === true && !/i/.test(flags)) { flags += 'i'; } try { if (opts.negate || typeof opts.strictNegate === 'boolean') { pattern = not.create(pattern, opts); } var str = open + '(?:' + pattern + ')' + close; regex = new RegExp(str, flags); } catch (err) { if (opts.strictErrors === true) { err.key = key; err.pattern = pattern; err.originalOptions = options; err.createdOptions = opts; throw err; } try { regex = new RegExp('^' + pattern.replace(/(\W)/g, '\\$1') + '$'); } catch (err) { regex = /.^/; //<= match nothing } } if (opts.cache !== false) { cacheRegex(regex, key, pattern, opts); } return regex; } /** * Cache generated regex. This can result in dramatic speed improvements * and simplify debugging by adding options and pattern to the regex. It can be * disabled by passing setting `options.cache` to false. */ function cacheRegex(regex, key, pattern, options) { define(regex, 'cached', true); define(regex, 'pattern', pattern); define(regex, 'options', options); define(regex, 'key', key); cache[key] = regex; } /** * Create the key to use for memoization. The key is generated * by iterating over the options and concatenating key-value pairs * to the pattern string. */ function createKey(pattern, options) { if (!options) return pattern; var key = pattern; for (var prop in options) { if (options.hasOwnProperty(prop)) { key += ';' + prop + '=' + String(options[prop]); } } return key; } /** * Expose `makeRe` */ module.exports.makeRe = makeRe; /***/ }), /* 390 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * define-property * * Copyright (c) 2015, Jon Schlinkert. * Licensed under the MIT License. */ var isDescriptor = __webpack_require__(391); module.exports = function defineProperty(obj, prop, val) { if (typeof obj !== 'object' && typeof obj !== 'function') { throw new TypeError('expected an object or function.'); } if (typeof prop !== 'string') { throw new TypeError('expected `prop` to be a string.'); } if (isDescriptor(val) && ('set' in val || 'get' in val)) { return Object.defineProperty(obj, prop, val); } return Object.defineProperty(obj, prop, { configurable: true, enumerable: false, writable: true, value: val }); }; /***/ }), /* 391 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * is-descriptor * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. */ var typeOf = __webpack_require__(392); var isAccessor = __webpack_require__(393); var isData = __webpack_require__(396); module.exports = function isDescriptor(obj, key) { if (typeOf(obj) !== 'object') { return false; } if ('get' in obj) { return isAccessor(obj, key); } return isData(obj, key); }; /***/ }), /* 392 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; /** * Get the native `typeof` a value. * * @param {*} `val` * @return {*} Native javascript type */ module.exports = function kindOf(val) { var type = typeof val; // primitivies if (type === 'undefined') { return 'undefined'; } if (val === null) { return 'null'; } if (val === true || val === false || val instanceof Boolean) { return 'boolean'; } if (type === 'string' || val instanceof String) { return 'string'; } if (type === 'number' || val instanceof Number) { return 'number'; } // functions if (type === 'function' || val instanceof Function) { if (typeof val.constructor.name !== 'undefined' && val.constructor.name.slice(0, 9) === 'Generator') { return 'generatorfunction'; } return 'function'; } // array if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { return 'array'; } // check for instances of RegExp and Date before calling `toString` if (val instanceof RegExp) { return 'regexp'; } if (val instanceof Date) { return 'date'; } // other objects type = toString.call(val); if (type === '[object RegExp]') { return 'regexp'; } if (type === '[object Date]') { return 'date'; } if (type === '[object Arguments]') { return 'arguments'; } if (type === '[object Error]') { return 'error'; } if (type === '[object Promise]') { return 'promise'; } // buffer if (isBuffer(val)) { return 'buffer'; } // es6: Map, WeakMap, Set, WeakSet if (type === '[object Set]') { return 'set'; } if (type === '[object WeakSet]') { return 'weakset'; } if (type === '[object Map]') { return 'map'; } if (type === '[object WeakMap]') { return 'weakmap'; } if (type === '[object Symbol]') { return 'symbol'; } if (type === '[object Map Iterator]') { return 'mapiterator'; } if (type === '[object Set Iterator]') { return 'setiterator'; } if (type === '[object String Iterator]') { return 'stringiterator'; } if (type === '[object Array Iterator]') { return 'arrayiterator'; } // typed arrays if (type === '[object Int8Array]') { return 'int8array'; } if (type === '[object Uint8Array]') { return 'uint8array'; } if (type === '[object Uint8ClampedArray]') { return 'uint8clampedarray'; } if (type === '[object Int16Array]') { return 'int16array'; } if (type === '[object Uint16Array]') { return 'uint16array'; } if (type === '[object Int32Array]') { return 'int32array'; } if (type === '[object Uint32Array]') { return 'uint32array'; } if (type === '[object Float32Array]') { return 'float32array'; } if (type === '[object Float64Array]') { return 'float64array'; } // must be a plain object return 'object'; }; /** * If you need to support Safari 5-7 (8-10 yr-old browser), * take a look at https://github.com/feross/is-buffer */ function isBuffer(val) { return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); } /***/ }), /* 393 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * is-accessor-descriptor * * Copyright (c) 2015, Jon Schlinkert. * Licensed under the MIT License. */ var typeOf = __webpack_require__(394); // accessor descriptor properties var accessor = { get: 'function', set: 'function', configurable: 'boolean', enumerable: 'boolean' }; function isAccessorDescriptor(obj, prop) { if (typeof prop === 'string') { var val = Object.getOwnPropertyDescriptor(obj, prop); return typeof val !== 'undefined'; } if (typeOf(obj) !== 'object') { return false; } if (has(obj, 'value') || has(obj, 'writable')) { return false; } if (!has(obj, 'get') || typeof obj.get !== 'function') { return false; } // tldr: it's valid to have "set" be undefined // "set" might be undefined if `Object.getOwnPropertyDescriptor` // was used to get the value, and only `get` was defined by the user if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') { return false; } for (var key in obj) { if (!accessor.hasOwnProperty(key)) { continue; } if (typeOf(obj[key]) === accessor[key]) { continue; } if (typeof obj[key] !== 'undefined') { return false; } } return true; } function has(obj, key) { return {}.hasOwnProperty.call(obj, key); } /** * Expose `isAccessorDescriptor` */ module.exports = isAccessorDescriptor; /***/ }), /* 394 */ /***/ (function(module, exports, __webpack_require__) { var isBuffer = __webpack_require__(395); var toString = Object.prototype.toString; /** * Get the native `typeof` a value. * * @param {*} `val` * @return {*} Native javascript type */ module.exports = function kindOf(val) { // primitivies if (typeof val === 'undefined') { return 'undefined'; } if (val === null) { return 'null'; } if (val === true || val === false || val instanceof Boolean) { return 'boolean'; } if (typeof val === 'string' || val instanceof String) { return 'string'; } if (typeof val === 'number' || val instanceof Number) { return 'number'; } // functions if (typeof val === 'function' || val instanceof Function) { return 'function'; } // array if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { return 'array'; } // check for instances of RegExp and Date before calling `toString` if (val instanceof RegExp) { return 'regexp'; } if (val instanceof Date) { return 'date'; } // other objects var type = toString.call(val); if (type === '[object RegExp]') { return 'regexp'; } if (type === '[object Date]') { return 'date'; } if (type === '[object Arguments]') { return 'arguments'; } if (type === '[object Error]') { return 'error'; } // buffer if (isBuffer(val)) { return 'buffer'; } // es6: Map, WeakMap, Set, WeakSet if (type === '[object Set]') { return 'set'; } if (type === '[object WeakSet]') { return 'weakset'; } if (type === '[object Map]') { return 'map'; } if (type === '[object WeakMap]') { return 'weakmap'; } if (type === '[object Symbol]') { return 'symbol'; } // typed arrays if (type === '[object Int8Array]') { return 'int8array'; } if (type === '[object Uint8Array]') { return 'uint8array'; } if (type === '[object Uint8ClampedArray]') { return 'uint8clampedarray'; } if (type === '[object Int16Array]') { return 'int16array'; } if (type === '[object Uint16Array]') { return 'uint16array'; } if (type === '[object Int32Array]') { return 'int32array'; } if (type === '[object Uint32Array]') { return 'uint32array'; } if (type === '[object Float32Array]') { return 'float32array'; } if (type === '[object Float64Array]') { return 'float64array'; } // must be a plain object return 'object'; }; /***/ }), /* 395 */ /***/ (function(module, exports) { /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ // The _isBuffer check is for Safari 5-7 support, because it's missing // Object.prototype.constructor. Remove this eventually module.exports = function (obj) { return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) } function isBuffer (obj) { return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) } // For Node v0.10 support. Remove this eventually. function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) } /***/ }), /* 396 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * is-data-descriptor * * Copyright (c) 2015, Jon Schlinkert. * Licensed under the MIT License. */ var typeOf = __webpack_require__(397); // data descriptor properties var data = { configurable: 'boolean', enumerable: 'boolean', writable: 'boolean' }; function isDataDescriptor(obj, prop) { if (typeOf(obj) !== 'object') { return false; } if (typeof prop === 'string') { var val = Object.getOwnPropertyDescriptor(obj, prop); return typeof val !== 'undefined'; } if (!('value' in obj) && !('writable' in obj)) { return false; } for (var key in obj) { if (key === 'value') continue; if (!data.hasOwnProperty(key)) { continue; } if (typeOf(obj[key]) === data[key]) { continue; } if (typeof obj[key] !== 'undefined') { return false; } } return true; } /** * Expose `isDataDescriptor` */ module.exports = isDataDescriptor; /***/ }), /* 397 */ /***/ (function(module, exports, __webpack_require__) { var isBuffer = __webpack_require__(395); var toString = Object.prototype.toString; /** * Get the native `typeof` a value. * * @param {*} `val` * @return {*} Native javascript type */ module.exports = function kindOf(val) { // primitivies if (typeof val === 'undefined') { return 'undefined'; } if (val === null) { return 'null'; } if (val === true || val === false || val instanceof Boolean) { return 'boolean'; } if (typeof val === 'string' || val instanceof String) { return 'string'; } if (typeof val === 'number' || val instanceof Number) { return 'number'; } // functions if (typeof val === 'function' || val instanceof Function) { return 'function'; } // array if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { return 'array'; } // check for instances of RegExp and Date before calling `toString` if (val instanceof RegExp) { return 'regexp'; } if (val instanceof Date) { return 'date'; } // other objects var type = toString.call(val); if (type === '[object RegExp]') { return 'regexp'; } if (type === '[object Date]') { return 'date'; } if (type === '[object Arguments]') { return 'arguments'; } if (type === '[object Error]') { return 'error'; } // buffer if (isBuffer(val)) { return 'buffer'; } // es6: Map, WeakMap, Set, WeakSet if (type === '[object Set]') { return 'set'; } if (type === '[object WeakSet]') { return 'weakset'; } if (type === '[object Map]') { return 'map'; } if (type === '[object WeakMap]') { return 'weakmap'; } if (type === '[object Symbol]') { return 'symbol'; } // typed arrays if (type === '[object Int8Array]') { return 'int8array'; } if (type === '[object Uint8Array]') { return 'uint8array'; } if (type === '[object Uint8ClampedArray]') { return 'uint8clampedarray'; } if (type === '[object Int16Array]') { return 'int16array'; } if (type === '[object Uint16Array]') { return 'uint16array'; } if (type === '[object Int32Array]') { return 'int32array'; } if (type === '[object Uint32Array]') { return 'uint32array'; } if (type === '[object Float32Array]') { return 'float32array'; } if (type === '[object Float64Array]') { return 'float64array'; } // must be a plain object return 'object'; }; /***/ }), /* 398 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isObject = __webpack_require__(399); module.exports = function extend(o/*, objects*/) { if (!isObject(o)) { o = {}; } var len = arguments.length; for (var i = 1; i < len; i++) { var obj = arguments[i]; if (isObject(obj)) { assign(o, obj); } } return o; }; function assign(a, b) { for (var key in b) { if (hasOwn(b, key)) { a[key] = b[key]; } } } /** * Returns true if the given `key` is an own property of `obj`. */ function hasOwn(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); } /***/ }), /* 399 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * is-extendable * * Copyright (c) 2015, Jon Schlinkert. * Licensed under the MIT License. */ module.exports = function isExtendable(val) { return typeof val !== 'undefined' && val !== null && (typeof val === 'object' || typeof val === 'function'); }; /***/ }), /* 400 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var extend = __webpack_require__(398); /** * The main export is a function that takes a `pattern` string and an `options` object. * * ```js & var not = require('regex-not'); & console.log(not('foo')); & //=> /^(?:(?!^(?:foo)$).)*$/ * ``` * * @param {String} `pattern` * @param {Object} `options` * @return {RegExp} Converts the given `pattern` to a regex using the specified `options`. * @api public */ function toRegex(pattern, options) { return new RegExp(toRegex.create(pattern, options)); } /** * Create a regex-compatible string from the given `pattern` and `options`. * * ```js & var not = require('regex-not'); & console.log(not.create('foo')); & //=> '^(?:(?!^(?:foo)$).)*$' * ``` * @param {String} `pattern` * @param {Object} `options` * @return {String} * @api public */ toRegex.create = function(pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('expected a string'); } var opts = extend({}, options); if (opts && opts.contains === true) { opts.strictNegate = false; } var open = opts.strictOpen !== false ? '^' : ''; var close = opts.strictClose !== false ? '$' : ''; var endChar = opts.endChar ? opts.endChar : '+'; var str = pattern; if (opts && opts.strictNegate === false) { str = '(?:(?!(?:' + pattern + ')).)' + endChar; } else { str = '(?:(?!^(?:' + pattern + ')$).)' + endChar; } return open + str + close; }; /** * Expose `toRegex` */ module.exports = toRegex; /***/ }), /* 401 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * array-unique * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ module.exports = function unique(arr) { if (!Array.isArray(arr)) { throw new TypeError('array-unique expects an array.'); } var len = arr.length; var i = -1; while (i++ < len) { var j = i + 1; for (; j < arr.length; ++j) { if (arr[i] === arr[j]) { arr.splice(j--, 1); } } } return arr; }; module.exports.immutable = function uniqueImmutable(arr) { if (!Array.isArray(arr)) { throw new TypeError('array-unique expects an array.'); } var arrLen = arr.length; var newArr = new Array(arrLen); for (var i = 0; i < arrLen; i++) { newArr[i] = arr[i]; } return module.exports(newArr); }; /***/ }), /* 402 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(403); module.exports = function(braces, options) { braces.compiler /** * bos */ .set('bos', function() { if (this.output) return; this.ast.queue = isEscaped(this.ast) ? [this.ast.val] : []; this.ast.count = 1; }) /** * Square brackets */ .set('bracket', function(node) { var close = node.close; var open = !node.escaped ? '[' : '\\['; var negated = node.negated; var inner = node.inner; inner = inner.replace(/\\(?=[\\\w]|$)/g, '\\\\'); if (inner === ']-') { inner = '\\]\\-'; } if (negated && inner.indexOf('.') === -1) { inner += '.'; } if (negated && inner.indexOf('/') === -1) { inner += '/'; } var val = open + negated + inner + close; var queue = node.parent.queue; var last = utils.arrayify(queue.pop()); queue.push(utils.join(last, val)); queue.push.apply(queue, []); }) /** * Brace */ .set('brace', function(node) { node.queue = isEscaped(node) ? [node.val] : []; node.count = 1; return this.mapVisit(node.nodes); }) /** * Open */ .set('brace.open', function(node) { node.parent.open = node.val; }) /** * Inner */ .set('text', function(node) { var queue = node.parent.queue; var escaped = node.escaped; var segs = [node.val]; if (node.optimize === false) { options = utils.extend({}, options, {optimize: false}); } if (node.multiplier > 1) { node.parent.count *= node.multiplier; } if (options.quantifiers === true && utils.isQuantifier(node.val)) { escaped = true; } else if (node.val.length > 1) { if (isType(node.parent, 'brace') && !isEscaped(node)) { var expanded = utils.expand(node.val, options); segs = expanded.segs; if (expanded.isOptimized) { node.parent.isOptimized = true; } // if nothing was expanded, we probably have a literal brace if (!segs.length) { var val = (expanded.val || node.val); if (options.unescape !== false) { // unescape unexpanded brace sequence/set separators val = val.replace(/\\([,.])/g, '$1'); // strip quotes val = val.replace(/["'`]/g, ''); } segs = [val]; escaped = true; } } } else if (node.val === ',') { if (options.expand) { node.parent.queue.push(['']); segs = ['']; } else { segs = ['|']; } } else { escaped = true; } if (escaped && isType(node.parent, 'brace')) { if (node.parent.nodes.length <= 4 && node.parent.count === 1) { node.parent.escaped = true; } else if (node.parent.length <= 3) { node.parent.escaped = true; } } if (!hasQueue(node.parent)) { node.parent.queue = segs; return; } var last = utils.arrayify(queue.pop()); if (node.parent.count > 1 && options.expand) { last = multiply(last, node.parent.count); node.parent.count = 1; } queue.push(utils.join(utils.flatten(last), segs.shift())); queue.push.apply(queue, segs); }) /** * Close */ .set('brace.close', function(node) { var queue = node.parent.queue; var prev = node.parent.parent; var last = prev.queue.pop(); var open = node.parent.open; var close = node.val; if (open && close && isOptimized(node, options)) { open = '('; close = ')'; } // if a close brace exists, and the previous segment is one character // don't wrap the result in braces or parens var ele = utils.last(queue); if (node.parent.count > 1 && options.expand) { ele = multiply(queue.pop(), node.parent.count); node.parent.count = 1; queue.push(ele); } if (close && typeof ele === 'string' && ele.length === 1) { open = ''; close = ''; } if ((isLiteralBrace(node, options) || noInner(node)) && !node.parent.hasEmpty) { queue.push(utils.join(open, queue.pop() || '')); queue = utils.flatten(utils.join(queue, close)); } if (typeof last === 'undefined') { prev.queue = [queue]; } else { prev.queue.push(utils.flatten(utils.join(last, queue))); } }) /** * eos */ .set('eos', function(node) { if (this.input) return; if (options.optimize !== false) { this.output = utils.last(utils.flatten(this.ast.queue)); } else if (Array.isArray(utils.last(this.ast.queue))) { this.output = utils.flatten(this.ast.queue.pop()); } else { this.output = utils.flatten(this.ast.queue); } if (node.parent.count > 1 && options.expand) { this.output = multiply(this.output, node.parent.count); } this.output = utils.arrayify(this.output); this.ast.queue = []; }); }; /** * Multiply the segments in the current brace level */ function multiply(queue, n, options) { return utils.flatten(utils.repeat(utils.arrayify(queue), n)); } /** * Return true if `node` is escaped */ function isEscaped(node) { return node.escaped === true; } /** * Returns true if regex parens should be used for sets. If the parent `type` * is not `brace`, then we're on a root node, which means we should never * expand segments and open/close braces should be `{}` (since this indicates * a brace is missing from the set) */ function isOptimized(node, options) { if (node.parent.isOptimized) return true; return isType(node.parent, 'brace') && !isEscaped(node.parent) && options.expand !== true; } /** * Returns true if the value in `node` should be wrapped in a literal brace. * @return {Boolean} */ function isLiteralBrace(node, options) { return isEscaped(node.parent) || options.optimize !== false; } /** * Returns true if the given `node` does not have an inner value. * @return {Boolean} */ function noInner(node, type) { if (node.parent.queue.length === 1) { return true; } var nodes = node.parent.nodes; return nodes.length === 3 && isType(nodes[0], 'brace.open') && !isType(nodes[1], 'text') && isType(nodes[2], 'brace.close'); } /** * Returns true if the given `node` is the given `type` * @return {Boolean} */ function isType(node, type) { return typeof node !== 'undefined' && node.type === type; } /** * Returns true if the given `node` has a non-empty queue. * @return {Boolean} */ function hasQueue(node) { return Array.isArray(node.queue) && node.queue.length; } /***/ }), /* 403 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var splitString = __webpack_require__(404); var utils = module.exports; /** * Module dependencies */ utils.extend = __webpack_require__(398); utils.flatten = __webpack_require__(410); utils.isObject = __webpack_require__(408); utils.fillRange = __webpack_require__(411); utils.repeat = __webpack_require__(416); utils.unique = __webpack_require__(401); utils.define = function(obj, key, val) { Object.defineProperty(obj, key, { writable: true, configurable: true, enumerable: false, value: val }); }; /** * Returns true if the given string contains only empty brace sets. */ utils.isEmptySets = function(str) { return /^(?:\{,\})+$/.test(str); }; /** * Returns true if the given string contains only empty brace sets. */ utils.isQuotedString = function(str) { var open = str.charAt(0); if (open === '\'' || open === '"' || open === '`') { return str.slice(-1) === open; } return false; }; /** * Create the key to use for memoization. The unique key is generated * by iterating over the options and concatenating key-value pairs * to the pattern string. */ utils.createKey = function(pattern, options) { var id = pattern; if (typeof options === 'undefined') { return id; } var keys = Object.keys(options); for (var i = 0; i < keys.length; i++) { var key = keys[i]; id += ';' + key + '=' + String(options[key]); } return id; }; /** * Normalize options */ utils.createOptions = function(options) { var opts = utils.extend.apply(null, arguments); if (typeof opts.expand === 'boolean') { opts.optimize = !opts.expand; } if (typeof opts.optimize === 'boolean') { opts.expand = !opts.optimize; } if (opts.optimize === true) { opts.makeRe = true; } return opts; }; /** * Join patterns in `a` to patterns in `b` */ utils.join = function(a, b, options) { options = options || {}; a = utils.arrayify(a); b = utils.arrayify(b); if (!a.length) return b; if (!b.length) return a; var len = a.length; var idx = -1; var arr = []; while (++idx < len) { var val = a[idx]; if (Array.isArray(val)) { for (var i = 0; i < val.length; i++) { val[i] = utils.join(val[i], b, options); } arr.push(val); continue; } for (var j = 0; j < b.length; j++) { var bval = b[j]; if (Array.isArray(bval)) { arr.push(utils.join(val, bval, options)); } else { arr.push(val + bval); } } } return arr; }; /** * Split the given string on `,` if not escaped. */ utils.split = function(str, options) { var opts = utils.extend({sep: ','}, options); if (typeof opts.keepQuotes !== 'boolean') { opts.keepQuotes = true; } if (opts.unescape === false) { opts.keepEscaping = true; } return splitString(str, opts, utils.escapeBrackets(opts)); }; /** * Expand ranges or sets in the given `pattern`. * * @param {String} `str` * @param {Object} `options` * @return {Object} */ utils.expand = function(str, options) { var opts = utils.extend({rangeLimit: 10000}, options); var segs = utils.split(str, opts); var tok = { segs: segs }; if (utils.isQuotedString(str)) { return tok; } if (opts.rangeLimit === true) { opts.rangeLimit = 10000; } if (segs.length > 1) { if (opts.optimize === false) { tok.val = segs[0]; return tok; } tok.segs = utils.stringifyArray(tok.segs); } else if (segs.length === 1) { var arr = str.split('..'); if (arr.length === 1) { tok.val = tok.segs[tok.segs.length - 1] || tok.val || str; tok.segs = []; return tok; } if (arr.length === 2 && arr[0] === arr[1]) { tok.escaped = true; tok.val = arr[0]; tok.segs = []; return tok; } if (arr.length > 1) { if (opts.optimize !== false) { opts.optimize = true; delete opts.expand; } if (opts.optimize !== true) { var min = Math.min(arr[0], arr[1]); var max = Math.max(arr[0], arr[1]); var step = arr[2] || 1; if (opts.rangeLimit !== false && ((max - min) / step >= opts.rangeLimit)) { throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); } } arr.push(opts); tok.segs = utils.fillRange.apply(null, arr); if (!tok.segs.length) { tok.escaped = true; tok.val = str; return tok; } if (opts.optimize === true) { tok.segs = utils.stringifyArray(tok.segs); } if (tok.segs === '') { tok.val = str; } else { tok.val = tok.segs[0]; } return tok; } } else { tok.val = str; } return tok; }; /** * Ensure commas inside brackets and parens are not split. * @param {Object} `tok` Token from the `split-string` module * @return {undefined} */ utils.escapeBrackets = function(options) { return function(tok) { if (tok.escaped && tok.val === 'b') { tok.val = '\\b'; return; } if (tok.val !== '(' && tok.val !== '[') return; var opts = utils.extend({}, options); var brackets = []; var parens = []; var stack = []; var val = tok.val; var str = tok.str; var i = tok.idx - 1; while (++i < str.length) { var ch = str[i]; if (ch === '\\') { val += (opts.keepEscaping === false ? '' : ch) + str[++i]; continue; } if (ch === '(') { parens.push(ch); stack.push(ch); } if (ch === '[') { brackets.push(ch); stack.push(ch); } if (ch === ')') { parens.pop(); stack.pop(); if (!stack.length) { val += ch; break; } } if (ch === ']') { brackets.pop(); stack.pop(); if (!stack.length) { val += ch; break; } } val += ch; } tok.split = false; tok.val = val.slice(1); tok.idx = i; }; }; /** * Returns true if the given string looks like a regex quantifier * @return {Boolean} */ utils.isQuantifier = function(str) { return /^(?:[0-9]?,[0-9]|[0-9],)$/.test(str); }; /** * Cast `val` to an array. * @param {*} `val` */ utils.stringifyArray = function(arr) { return [utils.arrayify(arr).join('|')]; }; /** * Cast `val` to an array. * @param {*} `val` */ utils.arrayify = function(arr) { if (typeof arr === 'undefined') { return []; } if (typeof arr === 'string') { return [arr]; } return arr; }; /** * Returns true if the given `str` is a non-empty string * @return {Boolean} */ utils.isString = function(str) { return str != null && typeof str === 'string'; }; /** * Get the last element from `array` * @param {Array} `array` * @return {*} */ utils.last = function(arr, n) { return arr[arr.length - (n || 1)]; }; utils.escapeRegex = function(str) { return str.replace(/\\?([!^*?()[\]{}+?/])/g, '\\$1'); }; /***/ }), /* 404 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * split-string * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. */ var extend = __webpack_require__(405); module.exports = function(str, options, fn) { if (typeof str !== 'string') { throw new TypeError('expected a string'); } if (typeof options === 'function') { fn = options; options = null; } // allow separator to be defined as a string if (typeof options === 'string') { options = { sep: options }; } var opts = extend({sep: '.'}, options); var quotes = opts.quotes || ['"', "'", '`']; var brackets; if (opts.brackets === true) { brackets = { '<': '>', '(': ')', '[': ']', '{': '}' }; } else if (opts.brackets) { brackets = opts.brackets; } var tokens = []; var stack = []; var arr = ['']; var sep = opts.sep; var len = str.length; var idx = -1; var closeIdx; function expected() { if (brackets && stack.length) { return brackets[stack[stack.length - 1]]; } } while (++idx < len) { var ch = str[idx]; var next = str[idx + 1]; var tok = { val: ch, idx: idx, arr: arr, str: str }; tokens.push(tok); if (ch === '\\') { tok.val = keepEscaping(opts, str, idx) === true ? (ch + next) : next; tok.escaped = true; if (typeof fn === 'function') { fn(tok); } arr[arr.length - 1] += tok.val; idx++; continue; } if (brackets && brackets[ch]) { stack.push(ch); var e = expected(); var i = idx + 1; if (str.indexOf(e, i + 1) !== -1) { while (stack.length && i < len) { var s = str[++i]; if (s === '\\') { s++; continue; } if (quotes.indexOf(s) !== -1) { i = getClosingQuote(str, s, i + 1); continue; } e = expected(); if (stack.length && str.indexOf(e, i + 1) === -1) { break; } if (brackets[s]) { stack.push(s); continue; } if (e === s) { stack.pop(); } } } closeIdx = i; if (closeIdx === -1) { arr[arr.length - 1] += ch; continue; } ch = str.slice(idx, closeIdx + 1); tok.val = ch; tok.idx = idx = closeIdx; } if (quotes.indexOf(ch) !== -1) { closeIdx = getClosingQuote(str, ch, idx + 1); if (closeIdx === -1) { arr[arr.length - 1] += ch; continue; } if (keepQuotes(ch, opts) === true) { ch = str.slice(idx, closeIdx + 1); } else { ch = str.slice(idx + 1, closeIdx); } tok.val = ch; tok.idx = idx = closeIdx; } if (typeof fn === 'function') { fn(tok, tokens); ch = tok.val; idx = tok.idx; } if (tok.val === sep && tok.split !== false) { arr.push(''); continue; } arr[arr.length - 1] += tok.val; } return arr; }; function getClosingQuote(str, ch, i, brackets) { var idx = str.indexOf(ch, i); if (str.charAt(idx - 1) === '\\') { return getClosingQuote(str, ch, idx + 1); } return idx; } function keepQuotes(ch, opts) { if (opts.keepDoubleQuotes === true && ch === '"') return true; if (opts.keepSingleQuotes === true && ch === "'") return true; return opts.keepQuotes; } function keepEscaping(opts, str, idx) { if (typeof opts.keepEscaping === 'function') { return opts.keepEscaping(str, idx); } return opts.keepEscaping === true || str[idx + 1] === '\\'; } /***/ }), /* 405 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isExtendable = __webpack_require__(406); var assignSymbols = __webpack_require__(409); module.exports = Object.assign || function(obj/*, objects*/) { if (obj === null || typeof obj === 'undefined') { throw new TypeError('Cannot convert undefined or null to object'); } if (!isObject(obj)) { obj = {}; } for (var i = 1; i < arguments.length; i++) { var val = arguments[i]; if (isString(val)) { val = toObject(val); } if (isObject(val)) { assign(obj, val); assignSymbols(obj, val); } } return obj; }; function assign(a, b) { for (var key in b) { if (hasOwn(b, key)) { a[key] = b[key]; } } } function isString(val) { return (val && typeof val === 'string'); } function toObject(str) { var obj = {}; for (var i in str) { obj[i] = str[i]; } return obj; } function isObject(val) { return (val && typeof val === 'object') || isExtendable(val); } /** * Returns true if the given `key` is an own property of `obj`. */ function hasOwn(obj, key) { return Object.prototype.hasOwnProperty.call(obj, key); } function isEnum(obj, key) { return Object.prototype.propertyIsEnumerable.call(obj, key); } /***/ }), /* 406 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * is-extendable * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. */ var isPlainObject = __webpack_require__(407); module.exports = function isExtendable(val) { return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); }; /***/ }), /* 407 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ var isObject = __webpack_require__(408); function isObjectObject(o) { return isObject(o) === true && Object.prototype.toString.call(o) === '[object Object]'; } module.exports = function isPlainObject(o) { var ctor,prot; if (isObjectObject(o) === false) return false; // If has modified constructor ctor = o.constructor; if (typeof ctor !== 'function') return false; // If has modified prototype prot = ctor.prototype; if (isObjectObject(prot) === false) return false; // If constructor does not have an Object-specific method if (prot.hasOwnProperty('isPrototypeOf') === false) { return false; } // Most likely a plain Object return true; }; /***/ }), /* 408 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * isobject * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ module.exports = function isObject(val) { return val != null && typeof val === 'object' && Array.isArray(val) === false; }; /***/ }), /* 409 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * assign-symbols * * Copyright (c) 2015, Jon Schlinkert. * Licensed under the MIT License. */ module.exports = function(receiver, objects) { if (receiver === null || typeof receiver === 'undefined') { throw new TypeError('expected first argument to be an object.'); } if (typeof objects === 'undefined' || typeof Symbol === 'undefined') { return receiver; } if (typeof Object.getOwnPropertySymbols !== 'function') { return receiver; } var isEnumerable = Object.prototype.propertyIsEnumerable; var target = Object(receiver); var len = arguments.length, i = 0; while (++i < len) { var provider = Object(arguments[i]); var names = Object.getOwnPropertySymbols(provider); for (var j = 0; j < names.length; j++) { var key = names[j]; if (isEnumerable.call(provider, key)) { target[key] = provider[key]; } } } return target; }; /***/ }), /* 410 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * arr-flatten * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ module.exports = function (arr) { return flat(arr, []); }; function flat(arr, res) { var i = 0, cur; var len = arr.length; for (; i < len; i++) { cur = arr[i]; Array.isArray(cur) ? flat(cur, res) : res.push(cur); } return res; } /***/ }), /* 411 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * fill-range * * Copyright (c) 2014-2015, 2017, Jon Schlinkert. * Released under the MIT License. */ var util = __webpack_require__(29); var isNumber = __webpack_require__(412); var extend = __webpack_require__(398); var repeat = __webpack_require__(414); var toRegex = __webpack_require__(415); /** * Return a range of numbers or letters. * * @param {String} `start` Start of the range * @param {String} `stop` End of the range * @param {String} `step` Increment or decrement to use. * @param {Function} `fn` Custom function to modify each element in the range. * @return {Array} */ function fillRange(start, stop, step, options) { if (typeof start === 'undefined') { return []; } if (typeof stop === 'undefined' || start === stop) { // special case, for handling negative zero var isString = typeof start === 'string'; if (isNumber(start) && !toNumber(start)) { return [isString ? '0' : 0]; } return [start]; } if (typeof step !== 'number' && typeof step !== 'string') { options = step; step = undefined; } if (typeof options === 'function') { options = { transform: options }; } var opts = extend({step: step}, options); if (opts.step && !isValidNumber(opts.step)) { if (opts.strictRanges === true) { throw new TypeError('expected options.step to be a number'); } return []; } opts.isNumber = isValidNumber(start) && isValidNumber(stop); if (!opts.isNumber && !isValid(start, stop)) { if (opts.strictRanges === true) { throw new RangeError('invalid range arguments: ' + util.inspect([start, stop])); } return []; } opts.isPadded = isPadded(start) || isPadded(stop); opts.toString = opts.stringify || typeof opts.step === 'string' || typeof start === 'string' || typeof stop === 'string' || !opts.isNumber; if (opts.isPadded) { opts.maxLength = Math.max(String(start).length, String(stop).length); } // support legacy minimatch/fill-range options if (typeof opts.optimize === 'boolean') opts.toRegex = opts.optimize; if (typeof opts.makeRe === 'boolean') opts.toRegex = opts.makeRe; return expand(start, stop, opts); } function expand(start, stop, options) { var a = options.isNumber ? toNumber(start) : start.charCodeAt(0); var b = options.isNumber ? toNumber(stop) : stop.charCodeAt(0); var step = Math.abs(toNumber(options.step)) || 1; if (options.toRegex && step === 1) { return toRange(a, b, start, stop, options); } var zero = {greater: [], lesser: []}; var asc = a < b; var arr = new Array(Math.round((asc ? b - a : a - b) / step)); var idx = 0; while (asc ? a <= b : a >= b) { var val = options.isNumber ? a : String.fromCharCode(a); if (options.toRegex && (val >= 0 || !options.isNumber)) { zero.greater.push(val); } else { zero.lesser.push(Math.abs(val)); } if (options.isPadded) { val = zeros(val, options); } if (options.toString) { val = String(val); } if (typeof options.transform === 'function') { arr[idx++] = options.transform(val, a, b, step, idx, arr, options); } else { arr[idx++] = val; } if (asc) { a += step; } else { a -= step; } } if (options.toRegex === true) { return toSequence(arr, zero, options); } return arr; } function toRange(a, b, start, stop, options) { if (options.isPadded) { return toRegex(start, stop, options); } if (options.isNumber) { return toRegex(Math.min(a, b), Math.max(a, b), options); } var start = String.fromCharCode(Math.min(a, b)); var stop = String.fromCharCode(Math.max(a, b)); return '[' + start + '-' + stop + ']'; } function toSequence(arr, zeros, options) { var greater = '', lesser = ''; if (zeros.greater.length) { greater = zeros.greater.join('|'); } if (zeros.lesser.length) { lesser = '-(' + zeros.lesser.join('|') + ')'; } var res = greater && lesser ? greater + '|' + lesser : greater || lesser; if (options.capture) { return '(' + res + ')'; } return res; } function zeros(val, options) { if (options.isPadded) { var str = String(val); var len = str.length; var dash = ''; if (str.charAt(0) === '-') { dash = '-'; str = str.slice(1); } var diff = options.maxLength - len; var pad = repeat('0', diff); val = (dash + pad + str); } if (options.stringify) { return String(val); } return val; } function toNumber(val) { return Number(val) || 0; } function isPadded(str) { return /^-?0\d/.test(str); } function isValid(min, max) { return (isValidNumber(min) || isValidLetter(min)) && (isValidNumber(max) || isValidLetter(max)); } function isValidLetter(ch) { return typeof ch === 'string' && ch.length === 1 && /^\w+$/.test(ch); } function isValidNumber(n) { return isNumber(n) && !/\./.test(n); } /** * Expose `fillRange` * @type {Function} */ module.exports = fillRange; /***/ }), /* 412 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * is-number * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ var typeOf = __webpack_require__(413); module.exports = function isNumber(num) { var type = typeOf(num); if (type === 'string') { if (!num.trim()) return false; } else if (type !== 'number') { return false; } return (num - num + 1) >= 0; }; /***/ }), /* 413 */ /***/ (function(module, exports, __webpack_require__) { var isBuffer = __webpack_require__(395); var toString = Object.prototype.toString; /** * Get the native `typeof` a value. * * @param {*} `val` * @return {*} Native javascript type */ module.exports = function kindOf(val) { // primitivies if (typeof val === 'undefined') { return 'undefined'; } if (val === null) { return 'null'; } if (val === true || val === false || val instanceof Boolean) { return 'boolean'; } if (typeof val === 'string' || val instanceof String) { return 'string'; } if (typeof val === 'number' || val instanceof Number) { return 'number'; } // functions if (typeof val === 'function' || val instanceof Function) { return 'function'; } // array if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { return 'array'; } // check for instances of RegExp and Date before calling `toString` if (val instanceof RegExp) { return 'regexp'; } if (val instanceof Date) { return 'date'; } // other objects var type = toString.call(val); if (type === '[object RegExp]') { return 'regexp'; } if (type === '[object Date]') { return 'date'; } if (type === '[object Arguments]') { return 'arguments'; } if (type === '[object Error]') { return 'error'; } // buffer if (isBuffer(val)) { return 'buffer'; } // es6: Map, WeakMap, Set, WeakSet if (type === '[object Set]') { return 'set'; } if (type === '[object WeakSet]') { return 'weakset'; } if (type === '[object Map]') { return 'map'; } if (type === '[object WeakMap]') { return 'weakmap'; } if (type === '[object Symbol]') { return 'symbol'; } // typed arrays if (type === '[object Int8Array]') { return 'int8array'; } if (type === '[object Uint8Array]') { return 'uint8array'; } if (type === '[object Uint8ClampedArray]') { return 'uint8clampedarray'; } if (type === '[object Int16Array]') { return 'int16array'; } if (type === '[object Uint16Array]') { return 'uint16array'; } if (type === '[object Int32Array]') { return 'int32array'; } if (type === '[object Uint32Array]') { return 'uint32array'; } if (type === '[object Float32Array]') { return 'float32array'; } if (type === '[object Float64Array]') { return 'float64array'; } // must be a plain object return 'object'; }; /***/ }), /* 414 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * repeat-string * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ /** * Results cache */ var res = ''; var cache; /** * Expose `repeat` */ module.exports = repeat; /** * Repeat the given `string` the specified `number` * of times. * * **Example:** * * ```js * var repeat = require('repeat-string'); * repeat('A', 5); * //=> AAAAA * ``` * * @param {String} `string` The string to repeat * @param {Number} `number` The number of times to repeat the string * @return {String} Repeated string * @api public */ function repeat(str, num) { if (typeof str !== 'string') { throw new TypeError('expected a string'); } // cover common, quick use cases if (num === 1) return str; if (num === 2) return str + str; var max = str.length * num; if (cache !== str || typeof cache === 'undefined') { cache = str; res = ''; } else if (res.length >= max) { return res.substr(0, max); } while (max > res.length && num > 1) { if (num & 1) { res += str; } num >>= 1; str += str; } res += str; res = res.substr(0, max); return res; } /***/ }), /* 415 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * to-regex-range * * Copyright (c) 2015, 2017, Jon Schlinkert. * Released under the MIT License. */ var repeat = __webpack_require__(414); var isNumber = __webpack_require__(412); var cache = {}; function toRegexRange(min, max, options) { if (isNumber(min) === false) { throw new RangeError('toRegexRange: first argument is invalid.'); } if (typeof max === 'undefined' || min === max) { return String(min); } if (isNumber(max) === false) { throw new RangeError('toRegexRange: second argument is invalid.'); } options = options || {}; var relax = String(options.relaxZeros); var shorthand = String(options.shorthand); var capture = String(options.capture); var key = min + ':' + max + '=' + relax + shorthand + capture; if (cache.hasOwnProperty(key)) { return cache[key].result; } var a = Math.min(min, max); var b = Math.max(min, max); if (Math.abs(a - b) === 1) { var result = min + '|' + max; if (options.capture) { return '(' + result + ')'; } return result; } var isPadded = padding(min) || padding(max); var positives = []; var negatives = []; var tok = {min: min, max: max, a: a, b: b}; if (isPadded) { tok.isPadded = isPadded; tok.maxLen = String(tok.max).length; } if (a < 0) { var newMin = b < 0 ? Math.abs(b) : 1; var newMax = Math.abs(a); negatives = splitToPatterns(newMin, newMax, tok, options); a = tok.a = 0; } if (b >= 0) { positives = splitToPatterns(a, b, tok, options); } tok.negatives = negatives; tok.positives = positives; tok.result = siftPatterns(negatives, positives, options); if (options.capture && (positives.length + negatives.length) > 1) { tok.result = '(' + tok.result + ')'; } cache[key] = tok; return tok.result; } function siftPatterns(neg, pos, options) { var onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; var onlyPositive = filterPatterns(pos, neg, '', false, options) || []; var intersected = filterPatterns(neg, pos, '-?', true, options) || []; var subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); return subpatterns.join('|'); } function splitToRanges(min, max) { min = Number(min); max = Number(max); var nines = 1; var stops = [max]; var stop = +countNines(min, nines); while (min <= stop && stop <= max) { stops = push(stops, stop); nines += 1; stop = +countNines(min, nines); } var zeros = 1; stop = countZeros(max + 1, zeros) - 1; while (min < stop && stop <= max) { stops = push(stops, stop); zeros += 1; stop = countZeros(max + 1, zeros) - 1; } stops.sort(compare); return stops; } /** * Convert a range to a regex pattern * @param {Number} `start` * @param {Number} `stop` * @return {String} */ function rangeToPattern(start, stop, options) { if (start === stop) { return {pattern: String(start), digits: []}; } var zipped = zip(String(start), String(stop)); var len = zipped.length, i = -1; var pattern = ''; var digits = 0; while (++i < len) { var numbers = zipped[i]; var startDigit = numbers[0]; var stopDigit = numbers[1]; if (startDigit === stopDigit) { pattern += startDigit; } else if (startDigit !== '0' || stopDigit !== '9') { pattern += toCharacterClass(startDigit, stopDigit); } else { digits += 1; } } if (digits) { pattern += options.shorthand ? '\\d' : '[0-9]'; } return { pattern: pattern, digits: [digits] }; } function splitToPatterns(min, max, tok, options) { var ranges = splitToRanges(min, max); var len = ranges.length; var idx = -1; var tokens = []; var start = min; var prev; while (++idx < len) { var range = ranges[idx]; var obj = rangeToPattern(start, range, options); var zeros = ''; if (!tok.isPadded && prev && prev.pattern === obj.pattern) { if (prev.digits.length > 1) { prev.digits.pop(); } prev.digits.push(obj.digits[0]); prev.string = prev.pattern + toQuantifier(prev.digits); start = range + 1; continue; } if (tok.isPadded) { zeros = padZeros(range, tok); } obj.string = zeros + obj.pattern + toQuantifier(obj.digits); tokens.push(obj); start = range + 1; prev = obj; } return tokens; } function filterPatterns(arr, comparison, prefix, intersection, options) { var res = []; for (var i = 0; i < arr.length; i++) { var tok = arr[i]; var ele = tok.string; if (options.relaxZeros !== false) { if (prefix === '-' && ele.charAt(0) === '0') { if (ele.charAt(1) === '{') { ele = '0*' + ele.replace(/^0\{\d+\}/, ''); } else { ele = '0*' + ele.slice(1); } } } if (!intersection && !contains(comparison, 'string', ele)) { res.push(prefix + ele); } if (intersection && contains(comparison, 'string', ele)) { res.push(prefix + ele); } } return res; } /** * Zip strings (`for in` can be used on string characters) */ function zip(a, b) { var arr = []; for (var ch in a) arr.push([a[ch], b[ch]]); return arr; } function compare(a, b) { return a > b ? 1 : b > a ? -1 : 0; } function push(arr, ele) { if (arr.indexOf(ele) === -1) arr.push(ele); return arr; } function contains(arr, key, val) { for (var i = 0; i < arr.length; i++) { if (arr[i][key] === val) { return true; } } return false; } function countNines(min, len) { return String(min).slice(0, -len) + repeat('9', len); } function countZeros(integer, zeros) { return integer - (integer % Math.pow(10, zeros)); } function toQuantifier(digits) { var start = digits[0]; var stop = digits[1] ? (',' + digits[1]) : ''; if (!stop && (!start || start === 1)) { return ''; } return '{' + start + stop + '}'; } function toCharacterClass(a, b) { return '[' + a + ((b - a === 1) ? '' : '-') + b + ']'; } function padding(str) { return /^-?(0+)\d/.exec(str); } function padZeros(val, tok) { if (tok.isPadded) { var diff = Math.abs(tok.maxLen - String(val).length); switch (diff) { case 0: return ''; case 1: return '0'; default: { return '0{' + diff + '}'; } } } return val; } /** * Expose `toRegexRange` */ module.exports = toRegexRange; /***/ }), /* 416 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * repeat-element * * Copyright (c) 2015 Jon Schlinkert. * Licensed under the MIT license. */ module.exports = function repeat(ele, num) { var arr = new Array(num); for (var i = 0; i < num; i++) { arr[i] = ele; } return arr; }; /***/ }), /* 417 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Node = __webpack_require__(418); var utils = __webpack_require__(403); /** * Braces parsers */ module.exports = function(braces, options) { braces.parser .set('bos', function() { if (!this.parsed) { this.ast = this.nodes[0] = new Node(this.ast); } }) /** * Character parsers */ .set('escape', function() { var pos = this.position(); var m = this.match(/^(?:\\(.)|\$\{)/); if (!m) return; var prev = this.prev(); var last = utils.last(prev.nodes); var node = pos(new Node({ type: 'text', multiplier: 1, val: m[0] })); if (node.val === '\\\\') { return node; } if (node.val === '${') { var str = this.input; var idx = -1; var ch; while ((ch = str[++idx])) { this.consume(1); node.val += ch; if (ch === '\\') { node.val += str[++idx]; continue; } if (ch === '}') { break; } } } if (this.options.unescape !== false) { node.val = node.val.replace(/\\([{}])/g, '$1'); } if (last.val === '"' && this.input.charAt(0) === '"') { last.val = node.val; this.consume(1); return; } return concatNodes.call(this, pos, node, prev, options); }) /** * Brackets: "[...]" (basic, this is overridden by * other parsers in more advanced implementations) */ .set('bracket', function() { var isInside = this.isInside('brace'); var pos = this.position(); var m = this.match(/^(?:\[([!^]?)([^\]]{2,}|\]-)(\]|[^*+?]+)|\[)/); if (!m) return; var prev = this.prev(); var val = m[0]; var negated = m[1] ? '^' : ''; var inner = m[2] || ''; var close = m[3] || ''; if (isInside && prev.type === 'brace') { prev.text = prev.text || ''; prev.text += val; } var esc = this.input.slice(0, 2); if (inner === '' && esc === '\\]') { inner += esc; this.consume(2); var str = this.input; var idx = -1; var ch; while ((ch = str[++idx])) { this.consume(1); if (ch === ']') { close = ch; break; } inner += ch; } } return pos(new Node({ type: 'bracket', val: val, escaped: close !== ']', negated: negated, inner: inner, close: close })); }) /** * Empty braces (we capture these early to * speed up processing in the compiler) */ .set('multiplier', function() { var isInside = this.isInside('brace'); var pos = this.position(); var m = this.match(/^\{((?:,|\{,+\})+)\}/); if (!m) return; this.multiplier = true; var prev = this.prev(); var val = m[0]; if (isInside && prev.type === 'brace') { prev.text = prev.text || ''; prev.text += val; } var node = pos(new Node({ type: 'text', multiplier: 1, match: m, val: val })); return concatNodes.call(this, pos, node, prev, options); }) /** * Open */ .set('brace.open', function() { var pos = this.position(); var m = this.match(/^\{(?!(?:[^\\}]?|,+)\})/); if (!m) return; var prev = this.prev(); var last = utils.last(prev.nodes); // if the last parsed character was an extglob character // we need to _not optimize_ the brace pattern because // it might be mistaken for an extglob by a downstream parser if (last && last.val && isExtglobChar(last.val.slice(-1))) { last.optimize = false; } var open = pos(new Node({ type: 'brace.open', val: m[0] })); var node = pos(new Node({ type: 'brace', nodes: [] })); node.push(open); prev.push(node); this.push('brace', node); }) /** * Close */ .set('brace.close', function() { var pos = this.position(); var m = this.match(/^\}/); if (!m || !m[0]) return; var brace = this.pop('brace'); var node = pos(new Node({ type: 'brace.close', val: m[0] })); if (!this.isType(brace, 'brace')) { if (this.options.strict) { throw new Error('missing opening "{"'); } node.type = 'text'; node.multiplier = 0; node.escaped = true; return node; } var prev = this.prev(); var last = utils.last(prev.nodes); if (last.text) { var lastNode = utils.last(last.nodes); if (lastNode.val === ')' && /[!@*?+]\(/.test(last.text)) { var open = last.nodes[0]; var text = last.nodes[1]; if (open.type === 'brace.open' && text && text.type === 'text') { text.optimize = false; } } } if (brace.nodes.length > 2) { var first = brace.nodes[1]; if (first.type === 'text' && first.val === ',') { brace.nodes.splice(1, 1); brace.nodes.push(first); } } brace.push(node); }) /** * Capture boundary characters */ .set('boundary', function() { var pos = this.position(); var m = this.match(/^[$^](?!\{)/); if (!m) return; return pos(new Node({ type: 'text', val: m[0] })); }) /** * One or zero, non-comma characters wrapped in braces */ .set('nobrace', function() { var isInside = this.isInside('brace'); var pos = this.position(); var m = this.match(/^\{[^,]?\}/); if (!m) return; var prev = this.prev(); var val = m[0]; if (isInside && prev.type === 'brace') { prev.text = prev.text || ''; prev.text += val; } return pos(new Node({ type: 'text', multiplier: 0, val: val })); }) /** * Text */ .set('text', function() { var isInside = this.isInside('brace'); var pos = this.position(); var m = this.match(/^((?!\\)[^${}[\]])+/); if (!m) return; var prev = this.prev(); var val = m[0]; if (isInside && prev.type === 'brace') { prev.text = prev.text || ''; prev.text += val; } var node = pos(new Node({ type: 'text', multiplier: 1, val: val })); return concatNodes.call(this, pos, node, prev, options); }); }; /** * Returns true if the character is an extglob character. */ function isExtglobChar(ch) { return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+'; } /** * Combine text nodes, and calculate empty sets (`{,,}`) * @param {Function} `pos` Function to calculate node position * @param {Object} `node` AST node * @return {Object} */ function concatNodes(pos, node, parent, options) { node.orig = node.val; var prev = this.prev(); var last = utils.last(prev.nodes); var isEscaped = false; if (node.val.length > 1) { var a = node.val.charAt(0); var b = node.val.slice(-1); isEscaped = (a === '"' && b === '"') || (a === "'" && b === "'") || (a === '`' && b === '`'); } if (isEscaped && options.unescape !== false) { node.val = node.val.slice(1, node.val.length - 1); node.escaped = true; } if (node.match) { var match = node.match[1]; if (!match || match.indexOf('}') === -1) { match = node.match[0]; } // replace each set with a single "," var val = match.replace(/\{/g, ',').replace(/\}/g, ''); node.multiplier *= val.length; node.val = ''; } var simpleText = last.type === 'text' && last.multiplier === 1 && node.multiplier === 1 && node.val; if (simpleText) { last.val += node.val; return; } prev.push(node); } /***/ }), /* 418 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isObject = __webpack_require__(408); var define = __webpack_require__(419); var utils = __webpack_require__(426); var ownNames; /** * Create a new AST `Node` with the given `val` and `type`. * * ```js * var node = new Node('*', 'Star'); * var node = new Node({type: 'star', val: '*'}); * ``` * @name Node * @param {String|Object} `val` Pass a matched substring, or an object to merge onto the node. * @param {String} `type` The node type to use when `val` is a string. * @return {Object} node instance * @api public */ function Node(val, type, parent) { if (typeof type !== 'string') { parent = type; type = null; } define(this, 'parent', parent); define(this, 'isNode', true); define(this, 'expect', null); if (typeof type !== 'string' && isObject(val)) { lazyKeys(); var keys = Object.keys(val); for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (ownNames.indexOf(key) === -1) { this[key] = val[key]; } } } else { this.type = type; this.val = val; } } /** * Returns true if the given value is a node. * * ```js * var Node = require('snapdragon-node'); * var node = new Node({type: 'foo'}); * console.log(Node.isNode(node)); //=> true * console.log(Node.isNode({})); //=> false * ``` * @param {Object} `node` * @returns {Boolean} * @api public */ Node.isNode = function(node) { return utils.isNode(node); }; /** * Define a non-enumberable property on the node instance. * Useful for adding properties that shouldn't be extended * or visible during debugging. * * ```js * var node = new Node(); * node.define('foo', 'something non-enumerable'); * ``` * @param {String} `name` * @param {any} `val` * @return {Object} returns the node instance * @api public */ Node.prototype.define = function(name, val) { define(this, name, val); return this; }; /** * Returns true if `node.val` is an empty string, or `node.nodes` does * not contain any non-empty text nodes. * * ```js * var node = new Node({type: 'text'}); * node.isEmpty(); //=> true * node.val = 'foo'; * node.isEmpty(); //=> false * ``` * @param {Function} `fn` (optional) Filter function that is called on `node` and/or child nodes. `isEmpty` will return false immediately when the filter function returns false on any nodes. * @return {Boolean} * @api public */ Node.prototype.isEmpty = function(fn) { return utils.isEmpty(this, fn); }; /** * Given node `foo` and node `bar`, push node `bar` onto `foo.nodes`, and * set `foo` as `bar.parent`. * * ```js * var foo = new Node({type: 'foo'}); * var bar = new Node({type: 'bar'}); * foo.push(bar); * ``` * @param {Object} `node` * @return {Number} Returns the length of `node.nodes` * @api public */ Node.prototype.push = function(node) { assert(Node.isNode(node), 'expected node to be an instance of Node'); define(node, 'parent', this); this.nodes = this.nodes || []; return this.nodes.push(node); }; /** * Given node `foo` and node `bar`, unshift node `bar` onto `foo.nodes`, and * set `foo` as `bar.parent`. * * ```js * var foo = new Node({type: 'foo'}); * var bar = new Node({type: 'bar'}); * foo.unshift(bar); * ``` * @param {Object} `node` * @return {Number} Returns the length of `node.nodes` * @api public */ Node.prototype.unshift = function(node) { assert(Node.isNode(node), 'expected node to be an instance of Node'); define(node, 'parent', this); this.nodes = this.nodes || []; return this.nodes.unshift(node); }; /** * Pop a node from `node.nodes`. * * ```js * var node = new Node({type: 'foo'}); * node.push(new Node({type: 'a'})); * node.push(new Node({type: 'b'})); * node.push(new Node({type: 'c'})); * node.push(new Node({type: 'd'})); * console.log(node.nodes.length); * //=> 4 * node.pop(); * console.log(node.nodes.length); * //=> 3 * ``` * @return {Number} Returns the popped `node` * @api public */ Node.prototype.pop = function() { return this.nodes && this.nodes.pop(); }; /** * Shift a node from `node.nodes`. * * ```js * var node = new Node({type: 'foo'}); * node.push(new Node({type: 'a'})); * node.push(new Node({type: 'b'})); * node.push(new Node({type: 'c'})); * node.push(new Node({type: 'd'})); * console.log(node.nodes.length); * //=> 4 * node.shift(); * console.log(node.nodes.length); * //=> 3 * ``` * @return {Object} Returns the shifted `node` * @api public */ Node.prototype.shift = function() { return this.nodes && this.nodes.shift(); }; /** * Remove `node` from `node.nodes`. * * ```js * node.remove(childNode); * ``` * @param {Object} `node` * @return {Object} Returns the removed node. * @api public */ Node.prototype.remove = function(node) { assert(Node.isNode(node), 'expected node to be an instance of Node'); this.nodes = this.nodes || []; var idx = node.index; if (idx !== -1) { node.index = -1; return this.nodes.splice(idx, 1); } return null; }; /** * Get the first child node from `node.nodes` that matches the given `type`. * If `type` is a number, the child node at that index is returned. * * ```js * var child = node.find(1); //<= index of the node to get * var child = node.find('foo'); //<= node.type of a child node * var child = node.find(/^(foo|bar)$/); //<= regex to match node.type * var child = node.find(['foo', 'bar']); //<= array of node.type(s) * ``` * @param {String} `type` * @return {Object} Returns a child node or undefined. * @api public */ Node.prototype.find = function(type) { return utils.findNode(this.nodes, type); }; /** * Return true if the node is the given `type`. * * ```js * var node = new Node({type: 'bar'}); * cosole.log(node.isType('foo')); // false * cosole.log(node.isType(/^(foo|bar)$/)); // true * cosole.log(node.isType(['foo', 'bar'])); // true * ``` * @param {String} `type` * @return {Boolean} * @api public */ Node.prototype.isType = function(type) { return utils.isType(this, type); }; /** * Return true if the `node.nodes` has the given `type`. * * ```js * var foo = new Node({type: 'foo'}); * var bar = new Node({type: 'bar'}); * foo.push(bar); * * cosole.log(foo.hasType('qux')); // false * cosole.log(foo.hasType(/^(qux|bar)$/)); // true * cosole.log(foo.hasType(['qux', 'bar'])); // true * ``` * @param {String} `type` * @return {Boolean} * @api public */ Node.prototype.hasType = function(type) { return utils.hasType(this, type); }; /** * Get the siblings array, or `null` if it doesn't exist. * * ```js * var foo = new Node({type: 'foo'}); * var bar = new Node({type: 'bar'}); * var baz = new Node({type: 'baz'}); * foo.push(bar); * foo.push(baz); * * console.log(bar.siblings.length) // 2 * console.log(baz.siblings.length) // 2 * ``` * @return {Array} * @api public */ Object.defineProperty(Node.prototype, 'siblings', { set: function() { throw new Error('node.siblings is a getter and cannot be defined'); }, get: function() { return this.parent ? this.parent.nodes : null; } }); /** * Get the node's current index from `node.parent.nodes`. * This should always be correct, even when the parent adds nodes. * * ```js * var foo = new Node({type: 'foo'}); * var bar = new Node({type: 'bar'}); * var baz = new Node({type: 'baz'}); * var qux = new Node({type: 'qux'}); * foo.push(bar); * foo.push(baz); * foo.unshift(qux); * * console.log(bar.index) // 1 * console.log(baz.index) // 2 * console.log(qux.index) // 0 * ``` * @return {Number} * @api public */ Object.defineProperty(Node.prototype, 'index', { set: function(index) { define(this, 'idx', index); }, get: function() { if (!Array.isArray(this.siblings)) { return -1; } var tok = this.idx !== -1 ? this.siblings[this.idx] : null; if (tok !== this) { this.idx = this.siblings.indexOf(this); } return this.idx; } }); /** * Get the previous node from the siblings array or `null`. * * ```js * var foo = new Node({type: 'foo'}); * var bar = new Node({type: 'bar'}); * var baz = new Node({type: 'baz'}); * foo.push(bar); * foo.push(baz); * * console.log(baz.prev.type) // 'bar' * ``` * @return {Object} * @api public */ Object.defineProperty(Node.prototype, 'prev', { set: function() { throw new Error('node.prev is a getter and cannot be defined'); }, get: function() { if (Array.isArray(this.siblings)) { return this.siblings[this.index - 1] || this.parent.prev; } return null; } }); /** * Get the siblings array, or `null` if it doesn't exist. * * ```js * var foo = new Node({type: 'foo'}); * var bar = new Node({type: 'bar'}); * var baz = new Node({type: 'baz'}); * foo.push(bar); * foo.push(baz); * * console.log(bar.siblings.length) // 2 * console.log(baz.siblings.length) // 2 * ``` * @return {Object} * @api public */ Object.defineProperty(Node.prototype, 'next', { set: function() { throw new Error('node.next is a getter and cannot be defined'); }, get: function() { if (Array.isArray(this.siblings)) { return this.siblings[this.index + 1] || this.parent.next; } return null; } }); /** * Get the first node from `node.nodes`. * * ```js * var foo = new Node({type: 'foo'}); * var bar = new Node({type: 'bar'}); * var baz = new Node({type: 'baz'}); * var qux = new Node({type: 'qux'}); * foo.push(bar); * foo.push(baz); * foo.push(qux); * * console.log(foo.first.type) // 'bar' * ``` * @return {Object} The first node, or undefiend * @api public */ Object.defineProperty(Node.prototype, 'first', { get: function() { return this.nodes ? this.nodes[0] : null; } }); /** * Get the last node from `node.nodes`. * * ```js * var foo = new Node({type: 'foo'}); * var bar = new Node({type: 'bar'}); * var baz = new Node({type: 'baz'}); * var qux = new Node({type: 'qux'}); * foo.push(bar); * foo.push(baz); * foo.push(qux); * * console.log(foo.last.type) // 'qux' * ``` * @return {Object} The last node, or undefiend * @api public */ Object.defineProperty(Node.prototype, 'last', { get: function() { return this.nodes ? utils.last(this.nodes) : null; } }); /** * Get the last node from `node.nodes`. * * ```js * var foo = new Node({type: 'foo'}); * var bar = new Node({type: 'bar'}); * var baz = new Node({type: 'baz'}); * var qux = new Node({type: 'qux'}); * foo.push(bar); * foo.push(baz); * foo.push(qux); * * console.log(foo.last.type) // 'qux' * ``` * @return {Object} The last node, or undefiend * @api public */ Object.defineProperty(Node.prototype, 'scope', { get: function() { if (this.isScope !== true) { return this.parent ? this.parent.scope : this; } return this; } }); /** * Get own property names from Node prototype, but only the * first time `Node` is instantiated */ function lazyKeys() { if (!ownNames) { ownNames = Object.getOwnPropertyNames(Node.prototype); } } /** * Simplified assertion. Throws an error is `val` is falsey. */ function assert(val, message) { if (!val) throw new Error(message); } /** * Expose `Node` */ exports = module.exports = Node; /***/ }), /* 419 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * define-property * * Copyright (c) 2015, 2017, Jon Schlinkert. * Released under the MIT License. */ var isDescriptor = __webpack_require__(420); module.exports = function defineProperty(obj, prop, val) { if (typeof obj !== 'object' && typeof obj !== 'function') { throw new TypeError('expected an object or function.'); } if (typeof prop !== 'string') { throw new TypeError('expected `prop` to be a string.'); } if (isDescriptor(val) && ('set' in val || 'get' in val)) { return Object.defineProperty(obj, prop, val); } return Object.defineProperty(obj, prop, { configurable: true, enumerable: false, writable: true, value: val }); }; /***/ }), /* 420 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * is-descriptor * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. */ var typeOf = __webpack_require__(421); var isAccessor = __webpack_require__(422); var isData = __webpack_require__(424); module.exports = function isDescriptor(obj, key) { if (typeOf(obj) !== 'object') { return false; } if ('get' in obj) { return isAccessor(obj, key); } return isData(obj, key); }; /***/ }), /* 421 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; module.exports = function kindOf(val) { if (val === void 0) return 'undefined'; if (val === null) return 'null'; var type = typeof val; if (type === 'boolean') return 'boolean'; if (type === 'string') return 'string'; if (type === 'number') return 'number'; if (type === 'symbol') return 'symbol'; if (type === 'function') { return isGeneratorFn(val) ? 'generatorfunction' : 'function'; } if (isArray(val)) return 'array'; if (isBuffer(val)) return 'buffer'; if (isArguments(val)) return 'arguments'; if (isDate(val)) return 'date'; if (isError(val)) return 'error'; if (isRegexp(val)) return 'regexp'; switch (ctorName(val)) { case 'Symbol': return 'symbol'; case 'Promise': return 'promise'; // Set, Map, WeakSet, WeakMap case 'WeakMap': return 'weakmap'; case 'WeakSet': return 'weakset'; case 'Map': return 'map'; case 'Set': return 'set'; // 8-bit typed arrays case 'Int8Array': return 'int8array'; case 'Uint8Array': return 'uint8array'; case 'Uint8ClampedArray': return 'uint8clampedarray'; // 16-bit typed arrays case 'Int16Array': return 'int16array'; case 'Uint16Array': return 'uint16array'; // 32-bit typed arrays case 'Int32Array': return 'int32array'; case 'Uint32Array': return 'uint32array'; case 'Float32Array': return 'float32array'; case 'Float64Array': return 'float64array'; } if (isGeneratorObj(val)) { return 'generator'; } // Non-plain objects type = toString.call(val); switch (type) { case '[object Object]': return 'object'; // iterators case '[object Map Iterator]': return 'mapiterator'; case '[object Set Iterator]': return 'setiterator'; case '[object String Iterator]': return 'stringiterator'; case '[object Array Iterator]': return 'arrayiterator'; } // other return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); }; function ctorName(val) { return val.constructor ? val.constructor.name : null; } function isArray(val) { if (Array.isArray) return Array.isArray(val); return val instanceof Array; } function isError(val) { return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); } function isDate(val) { if (val instanceof Date) return true; return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function'; } function isRegexp(val) { if (val instanceof RegExp) return true; return typeof val.flags === 'string' && typeof val.ignoreCase === 'boolean' && typeof val.multiline === 'boolean' && typeof val.global === 'boolean'; } function isGeneratorFn(name, val) { return ctorName(name) === 'GeneratorFunction'; } function isGeneratorObj(val) { return typeof val.throw === 'function' && typeof val.return === 'function' && typeof val.next === 'function'; } function isArguments(val) { try { if (typeof val.length === 'number' && typeof val.callee === 'function') { return true; } } catch (err) { if (err.message.indexOf('callee') !== -1) { return true; } } return false; } /** * If you need to support Safari 5-7 (8-10 yr-old browser), * take a look at https://github.com/feross/is-buffer */ function isBuffer(val) { if (val.constructor && typeof val.constructor.isBuffer === 'function') { return val.constructor.isBuffer(val); } return false; } /***/ }), /* 422 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * is-accessor-descriptor * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. */ var typeOf = __webpack_require__(423); // accessor descriptor properties var accessor = { get: 'function', set: 'function', configurable: 'boolean', enumerable: 'boolean' }; function isAccessorDescriptor(obj, prop) { if (typeof prop === 'string') { var val = Object.getOwnPropertyDescriptor(obj, prop); return typeof val !== 'undefined'; } if (typeOf(obj) !== 'object') { return false; } if (has(obj, 'value') || has(obj, 'writable')) { return false; } if (!has(obj, 'get') || typeof obj.get !== 'function') { return false; } // tldr: it's valid to have "set" be undefined // "set" might be undefined if `Object.getOwnPropertyDescriptor` // was used to get the value, and only `get` was defined by the user if (has(obj, 'set') && typeof obj[key] !== 'function' && typeof obj[key] !== 'undefined') { return false; } for (var key in obj) { if (!accessor.hasOwnProperty(key)) { continue; } if (typeOf(obj[key]) === accessor[key]) { continue; } if (typeof obj[key] !== 'undefined') { return false; } } return true; } function has(obj, key) { return {}.hasOwnProperty.call(obj, key); } /** * Expose `isAccessorDescriptor` */ module.exports = isAccessorDescriptor; /***/ }), /* 423 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; module.exports = function kindOf(val) { if (val === void 0) return 'undefined'; if (val === null) return 'null'; var type = typeof val; if (type === 'boolean') return 'boolean'; if (type === 'string') return 'string'; if (type === 'number') return 'number'; if (type === 'symbol') return 'symbol'; if (type === 'function') { return isGeneratorFn(val) ? 'generatorfunction' : 'function'; } if (isArray(val)) return 'array'; if (isBuffer(val)) return 'buffer'; if (isArguments(val)) return 'arguments'; if (isDate(val)) return 'date'; if (isError(val)) return 'error'; if (isRegexp(val)) return 'regexp'; switch (ctorName(val)) { case 'Symbol': return 'symbol'; case 'Promise': return 'promise'; // Set, Map, WeakSet, WeakMap case 'WeakMap': return 'weakmap'; case 'WeakSet': return 'weakset'; case 'Map': return 'map'; case 'Set': return 'set'; // 8-bit typed arrays case 'Int8Array': return 'int8array'; case 'Uint8Array': return 'uint8array'; case 'Uint8ClampedArray': return 'uint8clampedarray'; // 16-bit typed arrays case 'Int16Array': return 'int16array'; case 'Uint16Array': return 'uint16array'; // 32-bit typed arrays case 'Int32Array': return 'int32array'; case 'Uint32Array': return 'uint32array'; case 'Float32Array': return 'float32array'; case 'Float64Array': return 'float64array'; } if (isGeneratorObj(val)) { return 'generator'; } // Non-plain objects type = toString.call(val); switch (type) { case '[object Object]': return 'object'; // iterators case '[object Map Iterator]': return 'mapiterator'; case '[object Set Iterator]': return 'setiterator'; case '[object String Iterator]': return 'stringiterator'; case '[object Array Iterator]': return 'arrayiterator'; } // other return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); }; function ctorName(val) { return val.constructor ? val.constructor.name : null; } function isArray(val) { if (Array.isArray) return Array.isArray(val); return val instanceof Array; } function isError(val) { return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); } function isDate(val) { if (val instanceof Date) return true; return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function'; } function isRegexp(val) { if (val instanceof RegExp) return true; return typeof val.flags === 'string' && typeof val.ignoreCase === 'boolean' && typeof val.multiline === 'boolean' && typeof val.global === 'boolean'; } function isGeneratorFn(name, val) { return ctorName(name) === 'GeneratorFunction'; } function isGeneratorObj(val) { return typeof val.throw === 'function' && typeof val.return === 'function' && typeof val.next === 'function'; } function isArguments(val) { try { if (typeof val.length === 'number' && typeof val.callee === 'function') { return true; } } catch (err) { if (err.message.indexOf('callee') !== -1) { return true; } } return false; } /** * If you need to support Safari 5-7 (8-10 yr-old browser), * take a look at https://github.com/feross/is-buffer */ function isBuffer(val) { if (val.constructor && typeof val.constructor.isBuffer === 'function') { return val.constructor.isBuffer(val); } return false; } /***/ }), /* 424 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * is-data-descriptor * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. */ var typeOf = __webpack_require__(425); module.exports = function isDataDescriptor(obj, prop) { // data descriptor properties var data = { configurable: 'boolean', enumerable: 'boolean', writable: 'boolean' }; if (typeOf(obj) !== 'object') { return false; } if (typeof prop === 'string') { var val = Object.getOwnPropertyDescriptor(obj, prop); return typeof val !== 'undefined'; } if (!('value' in obj) && !('writable' in obj)) { return false; } for (var key in obj) { if (key === 'value') continue; if (!data.hasOwnProperty(key)) { continue; } if (typeOf(obj[key]) === data[key]) { continue; } if (typeof obj[key] !== 'undefined') { return false; } } return true; }; /***/ }), /* 425 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; module.exports = function kindOf(val) { if (val === void 0) return 'undefined'; if (val === null) return 'null'; var type = typeof val; if (type === 'boolean') return 'boolean'; if (type === 'string') return 'string'; if (type === 'number') return 'number'; if (type === 'symbol') return 'symbol'; if (type === 'function') { return isGeneratorFn(val) ? 'generatorfunction' : 'function'; } if (isArray(val)) return 'array'; if (isBuffer(val)) return 'buffer'; if (isArguments(val)) return 'arguments'; if (isDate(val)) return 'date'; if (isError(val)) return 'error'; if (isRegexp(val)) return 'regexp'; switch (ctorName(val)) { case 'Symbol': return 'symbol'; case 'Promise': return 'promise'; // Set, Map, WeakSet, WeakMap case 'WeakMap': return 'weakmap'; case 'WeakSet': return 'weakset'; case 'Map': return 'map'; case 'Set': return 'set'; // 8-bit typed arrays case 'Int8Array': return 'int8array'; case 'Uint8Array': return 'uint8array'; case 'Uint8ClampedArray': return 'uint8clampedarray'; // 16-bit typed arrays case 'Int16Array': return 'int16array'; case 'Uint16Array': return 'uint16array'; // 32-bit typed arrays case 'Int32Array': return 'int32array'; case 'Uint32Array': return 'uint32array'; case 'Float32Array': return 'float32array'; case 'Float64Array': return 'float64array'; } if (isGeneratorObj(val)) { return 'generator'; } // Non-plain objects type = toString.call(val); switch (type) { case '[object Object]': return 'object'; // iterators case '[object Map Iterator]': return 'mapiterator'; case '[object Set Iterator]': return 'setiterator'; case '[object String Iterator]': return 'stringiterator'; case '[object Array Iterator]': return 'arrayiterator'; } // other return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); }; function ctorName(val) { return val.constructor ? val.constructor.name : null; } function isArray(val) { if (Array.isArray) return Array.isArray(val); return val instanceof Array; } function isError(val) { return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); } function isDate(val) { if (val instanceof Date) return true; return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function'; } function isRegexp(val) { if (val instanceof RegExp) return true; return typeof val.flags === 'string' && typeof val.ignoreCase === 'boolean' && typeof val.multiline === 'boolean' && typeof val.global === 'boolean'; } function isGeneratorFn(name, val) { return ctorName(name) === 'GeneratorFunction'; } function isGeneratorObj(val) { return typeof val.throw === 'function' && typeof val.return === 'function' && typeof val.next === 'function'; } function isArguments(val) { try { if (typeof val.length === 'number' && typeof val.callee === 'function') { return true; } } catch (err) { if (err.message.indexOf('callee') !== -1) { return true; } } return false; } /** * If you need to support Safari 5-7 (8-10 yr-old browser), * take a look at https://github.com/feross/is-buffer */ function isBuffer(val) { if (val.constructor && typeof val.constructor.isBuffer === 'function') { return val.constructor.isBuffer(val); } return false; } /***/ }), /* 426 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var typeOf = __webpack_require__(413); var utils = module.exports; /** * Returns true if the given value is a node. * * ```js * var Node = require('snapdragon-node'); * var node = new Node({type: 'foo'}); * console.log(utils.isNode(node)); //=> true * console.log(utils.isNode({})); //=> false * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @returns {Boolean} * @api public */ utils.isNode = function(node) { return typeOf(node) === 'object' && node.isNode === true; }; /** * Emit an empty string for the given `node`. * * ```js * // do nothing for beginning-of-string * snapdragon.compiler.set('bos', utils.noop); * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @returns {undefined} * @api public */ utils.noop = function(node) { append(this, '', node); }; /** * Appdend `node.val` to `compiler.output`, exactly as it was created * by the parser. * * ```js * snapdragon.compiler.set('text', utils.identity); * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @returns {undefined} * @api public */ utils.identity = function(node) { append(this, node.val, node); }; /** * Previously named `.emit`, this method appends the given `val` * to `compiler.output` for the given node. Useful when you know * what value should be appended advance, regardless of the actual * value of `node.val`. * * ```js * snapdragon.compiler * .set('i', function(node) { * this.mapVisit(node); * }) * .set('i.open', utils.append('')) * .set('i.close', utils.append('')) * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @returns {Function} Returns a compiler middleware function. * @api public */ utils.append = function(val) { return function(node) { append(this, val, node); }; }; /** * Used in compiler middleware, this onverts an AST node into * an empty `text` node and deletes `node.nodes` if it exists. * The advantage of this method is that, as opposed to completely * removing the node, indices will not need to be re-calculated * in sibling nodes, and nothing is appended to the output. * * ```js * utils.toNoop(node); * // convert `node.nodes` to the given value instead of deleting it * utils.toNoop(node, []); * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @param {Array} `nodes` Optionally pass a new `nodes` value, to replace the existing `node.nodes` array. * @api public */ utils.toNoop = function(node, nodes) { if (nodes) { node.nodes = nodes; } else { delete node.nodes; node.type = 'text'; node.val = ''; } }; /** * Visit `node` with the given `fn`. The built-in `.visit` method in snapdragon * automatically calls registered compilers, this allows you to pass a visitor * function. * * ```js * snapdragon.compiler.set('i', function(node) { * utils.visit(node, function(childNode) { * // do stuff with "childNode" * return childNode; * }); * }); * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @param {Function} `fn` * @return {Object} returns the node after recursively visiting all child nodes. * @api public */ utils.visit = function(node, fn) { assert(utils.isNode(node), 'expected node to be an instance of Node'); assert(isFunction(fn), 'expected a visitor function'); fn(node); return node.nodes ? utils.mapVisit(node, fn) : node; }; /** * Map [visit](#visit) the given `fn` over `node.nodes`. This is called by * [visit](#visit), use this method if you do not want `fn` to be called on * the first node. * * ```js * snapdragon.compiler.set('i', function(node) { * utils.mapVisit(node, function(childNode) { * // do stuff with "childNode" * return childNode; * }); * }); * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @param {Object} `options` * @param {Function} `fn` * @return {Object} returns the node * @api public */ utils.mapVisit = function(node, fn) { assert(utils.isNode(node), 'expected node to be an instance of Node'); assert(isArray(node.nodes), 'expected node.nodes to be an array'); assert(isFunction(fn), 'expected a visitor function'); for (var i = 0; i < node.nodes.length; i++) { utils.visit(node.nodes[i], fn); } return node; }; /** * Unshift an `*.open` node onto `node.nodes`. * * ```js * var Node = require('snapdragon-node'); * snapdragon.parser.set('brace', function(node) { * var match = this.match(/^{/); * if (match) { * var parent = new Node({type: 'brace'}); * utils.addOpen(parent, Node); * console.log(parent.nodes[0]): * // { type: 'brace.open', val: '' }; * * // push the parent "brace" node onto the stack * this.push(parent); * * // return the parent node, so it's also added to the AST * return brace; * } * }); * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][]. * @param {Function} `filter` Optionaly specify a filter function to exclude the node. * @return {Object} Returns the created opening node. * @api public */ utils.addOpen = function(node, Node, val, filter) { assert(utils.isNode(node), 'expected node to be an instance of Node'); assert(isFunction(Node), 'expected Node to be a constructor function'); if (typeof val === 'function') { filter = val; val = ''; } if (typeof filter === 'function' && !filter(node)) return; var open = new Node({ type: node.type + '.open', val: val}); var unshift = node.unshift || node.unshiftNode; if (typeof unshift === 'function') { unshift.call(node, open); } else { utils.unshiftNode(node, open); } return open; }; /** * Push a `*.close` node onto `node.nodes`. * * ```js * var Node = require('snapdragon-node'); * snapdragon.parser.set('brace', function(node) { * var match = this.match(/^}/); * if (match) { * var parent = this.parent(); * if (parent.type !== 'brace') { * throw new Error('missing opening: ' + '}'); * } * * utils.addClose(parent, Node); * console.log(parent.nodes[parent.nodes.length - 1]): * // { type: 'brace.close', val: '' }; * * // no need to return a node, since the parent * // was already added to the AST * return; * } * }); * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][]. * @param {Function} `filter` Optionaly specify a filter function to exclude the node. * @return {Object} Returns the created closing node. * @api public */ utils.addClose = function(node, Node, val, filter) { assert(utils.isNode(node), 'expected node to be an instance of Node'); assert(isFunction(Node), 'expected Node to be a constructor function'); if (typeof val === 'function') { filter = val; val = ''; } if (typeof filter === 'function' && !filter(node)) return; var close = new Node({ type: node.type + '.close', val: val}); var push = node.push || node.pushNode; if (typeof push === 'function') { push.call(node, close); } else { utils.pushNode(node, close); } return close; }; /** * Wraps the given `node` with `*.open` and `*.close` nodes. * * @param {Object} `node` Instance of [snapdragon-node][] * @param {Function} `Node` (required) Node constructor function from [snapdragon-node][]. * @param {Function} `filter` Optionaly specify a filter function to exclude the node. * @return {Object} Returns the node * @api public */ utils.wrapNodes = function(node, Node, filter) { assert(utils.isNode(node), 'expected node to be an instance of Node'); assert(isFunction(Node), 'expected Node to be a constructor function'); utils.addOpen(node, Node, filter); utils.addClose(node, Node, filter); return node; }; /** * Push the given `node` onto `parent.nodes`, and set `parent` as `node.parent. * * ```js * var parent = new Node({type: 'foo'}); * var node = new Node({type: 'bar'}); * utils.pushNode(parent, node); * console.log(parent.nodes[0].type) // 'bar' * console.log(node.parent.type) // 'foo' * ``` * @param {Object} `parent` * @param {Object} `node` Instance of [snapdragon-node][] * @return {Object} Returns the child node * @api public */ utils.pushNode = function(parent, node) { assert(utils.isNode(parent), 'expected parent node to be an instance of Node'); assert(utils.isNode(node), 'expected node to be an instance of Node'); node.define('parent', parent); parent.nodes = parent.nodes || []; parent.nodes.push(node); return node; }; /** * Unshift `node` onto `parent.nodes`, and set `parent` as `node.parent. * * ```js * var parent = new Node({type: 'foo'}); * var node = new Node({type: 'bar'}); * utils.unshiftNode(parent, node); * console.log(parent.nodes[0].type) // 'bar' * console.log(node.parent.type) // 'foo' * ``` * @param {Object} `parent` * @param {Object} `node` Instance of [snapdragon-node][] * @return {undefined} * @api public */ utils.unshiftNode = function(parent, node) { assert(utils.isNode(parent), 'expected parent node to be an instance of Node'); assert(utils.isNode(node), 'expected node to be an instance of Node'); node.define('parent', parent); parent.nodes = parent.nodes || []; parent.nodes.unshift(node); }; /** * Pop the last `node` off of `parent.nodes`. The advantage of * using this method is that it checks for `node.nodes` and works * with any version of `snapdragon-node`. * * ```js * var parent = new Node({type: 'foo'}); * utils.pushNode(parent, new Node({type: 'foo'})); * utils.pushNode(parent, new Node({type: 'bar'})); * utils.pushNode(parent, new Node({type: 'baz'})); * console.log(parent.nodes.length); //=> 3 * utils.popNode(parent); * console.log(parent.nodes.length); //=> 2 * ``` * @param {Object} `parent` * @param {Object} `node` Instance of [snapdragon-node][] * @return {Number|Undefined} Returns the length of `node.nodes` or undefined. * @api public */ utils.popNode = function(node) { assert(utils.isNode(node), 'expected node to be an instance of Node'); if (typeof node.pop === 'function') { return node.pop(); } return node.nodes && node.nodes.pop(); }; /** * Shift the first `node` off of `parent.nodes`. The advantage of * using this method is that it checks for `node.nodes` and works * with any version of `snapdragon-node`. * * ```js * var parent = new Node({type: 'foo'}); * utils.pushNode(parent, new Node({type: 'foo'})); * utils.pushNode(parent, new Node({type: 'bar'})); * utils.pushNode(parent, new Node({type: 'baz'})); * console.log(parent.nodes.length); //=> 3 * utils.shiftNode(parent); * console.log(parent.nodes.length); //=> 2 * ``` * @param {Object} `parent` * @param {Object} `node` Instance of [snapdragon-node][] * @return {Number|Undefined} Returns the length of `node.nodes` or undefined. * @api public */ utils.shiftNode = function(node) { assert(utils.isNode(node), 'expected node to be an instance of Node'); if (typeof node.shift === 'function') { return node.shift(); } return node.nodes && node.nodes.shift(); }; /** * Remove the specified `node` from `parent.nodes`. * * ```js * var parent = new Node({type: 'abc'}); * var foo = new Node({type: 'foo'}); * utils.pushNode(parent, foo); * utils.pushNode(parent, new Node({type: 'bar'})); * utils.pushNode(parent, new Node({type: 'baz'})); * console.log(parent.nodes.length); //=> 3 * utils.removeNode(parent, foo); * console.log(parent.nodes.length); //=> 2 * ``` * @param {Object} `parent` * @param {Object} `node` Instance of [snapdragon-node][] * @return {Object|undefined} Returns the removed node, if successful, or undefined if it does not exist on `parent.nodes`. * @api public */ utils.removeNode = function(parent, node) { assert(utils.isNode(parent), 'expected parent.node to be an instance of Node'); assert(utils.isNode(node), 'expected node to be an instance of Node'); if (!parent.nodes) { return null; } if (typeof parent.remove === 'function') { return parent.remove(node); } var idx = parent.nodes.indexOf(node); if (idx !== -1) { return parent.nodes.splice(idx, 1); } }; /** * Returns true if `node.type` matches the given `type`. Throws a * `TypeError` if `node` is not an instance of `Node`. * * ```js * var Node = require('snapdragon-node'); * var node = new Node({type: 'foo'}); * console.log(utils.isType(node, 'foo')); // false * console.log(utils.isType(node, 'bar')); // true * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @param {String} `type` * @return {Boolean} * @api public */ utils.isType = function(node, type) { assert(utils.isNode(node), 'expected node to be an instance of Node'); switch (typeOf(type)) { case 'array': var types = type.slice(); for (var i = 0; i < types.length; i++) { if (utils.isType(node, types[i])) { return true; } } return false; case 'string': return node.type === type; case 'regexp': return type.test(node.type); default: { throw new TypeError('expected "type" to be an array, string or regexp'); } } }; /** * Returns true if the given `node` has the given `type` in `node.nodes`. * Throws a `TypeError` if `node` is not an instance of `Node`. * * ```js * var Node = require('snapdragon-node'); * var node = new Node({ * type: 'foo', * nodes: [ * new Node({type: 'bar'}), * new Node({type: 'baz'}) * ] * }); * console.log(utils.hasType(node, 'xyz')); // false * console.log(utils.hasType(node, 'baz')); // true * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @param {String} `type` * @return {Boolean} * @api public */ utils.hasType = function(node, type) { assert(utils.isNode(node), 'expected node to be an instance of Node'); if (!Array.isArray(node.nodes)) return false; for (var i = 0; i < node.nodes.length; i++) { if (utils.isType(node.nodes[i], type)) { return true; } } return false; }; /** * Returns the first node from `node.nodes` of the given `type` * * ```js * var node = new Node({ * type: 'foo', * nodes: [ * new Node({type: 'text', val: 'abc'}), * new Node({type: 'text', val: 'xyz'}) * ] * }); * * var textNode = utils.firstOfType(node.nodes, 'text'); * console.log(textNode.val); * //=> 'abc' * ``` * @param {Array} `nodes` * @param {String} `type` * @return {Object|undefined} Returns the first matching node or undefined. * @api public */ utils.firstOfType = function(nodes, type) { for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; if (utils.isType(node, type)) { return node; } } }; /** * Returns the node at the specified index, or the first node of the * given `type` from `node.nodes`. * * ```js * var node = new Node({ * type: 'foo', * nodes: [ * new Node({type: 'text', val: 'abc'}), * new Node({type: 'text', val: 'xyz'}) * ] * }); * * var nodeOne = utils.findNode(node.nodes, 'text'); * console.log(nodeOne.val); * //=> 'abc' * * var nodeTwo = utils.findNode(node.nodes, 1); * console.log(nodeTwo.val); * //=> 'xyz' * ``` * * @param {Array} `nodes` * @param {String|Number} `type` Node type or index. * @return {Object} Returns a node or undefined. * @api public */ utils.findNode = function(nodes, type) { if (!Array.isArray(nodes)) { return null; } if (typeof type === 'number') { return nodes[type]; } return utils.firstOfType(nodes, type); }; /** * Returns true if the given node is an "*.open" node. * * ```js * var Node = require('snapdragon-node'); * var brace = new Node({type: 'brace'}); * var open = new Node({type: 'brace.open'}); * var close = new Node({type: 'brace.close'}); * * console.log(utils.isOpen(brace)); // false * console.log(utils.isOpen(open)); // true * console.log(utils.isOpen(close)); // false * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @return {Boolean} * @api public */ utils.isOpen = function(node) { assert(utils.isNode(node), 'expected node to be an instance of Node'); return node.type.slice(-5) === '.open'; }; /** * Returns true if the given node is a "*.close" node. * * ```js * var Node = require('snapdragon-node'); * var brace = new Node({type: 'brace'}); * var open = new Node({type: 'brace.open'}); * var close = new Node({type: 'brace.close'}); * * console.log(utils.isClose(brace)); // false * console.log(utils.isClose(open)); // false * console.log(utils.isClose(close)); // true * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @return {Boolean} * @api public */ utils.isClose = function(node) { assert(utils.isNode(node), 'expected node to be an instance of Node'); return node.type.slice(-6) === '.close'; }; /** * Returns true if `node.nodes` **has** an `.open` node * * ```js * var Node = require('snapdragon-node'); * var brace = new Node({ * type: 'brace', * nodes: [] * }); * * var open = new Node({type: 'brace.open'}); * console.log(utils.hasOpen(brace)); // false * * brace.pushNode(open); * console.log(utils.hasOpen(brace)); // true * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @return {Boolean} * @api public */ utils.hasOpen = function(node) { assert(utils.isNode(node), 'expected node to be an instance of Node'); var first = node.first || node.nodes ? node.nodes[0] : null; if (utils.isNode(first)) { return first.type === node.type + '.open'; } return false; }; /** * Returns true if `node.nodes` **has** a `.close` node * * ```js * var Node = require('snapdragon-node'); * var brace = new Node({ * type: 'brace', * nodes: [] * }); * * var close = new Node({type: 'brace.close'}); * console.log(utils.hasClose(brace)); // false * * brace.pushNode(close); * console.log(utils.hasClose(brace)); // true * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @return {Boolean} * @api public */ utils.hasClose = function(node) { assert(utils.isNode(node), 'expected node to be an instance of Node'); var last = node.last || node.nodes ? node.nodes[node.nodes.length - 1] : null; if (utils.isNode(last)) { return last.type === node.type + '.close'; } return false; }; /** * Returns true if `node.nodes` has both `.open` and `.close` nodes * * ```js * var Node = require('snapdragon-node'); * var brace = new Node({ * type: 'brace', * nodes: [] * }); * * var open = new Node({type: 'brace.open'}); * var close = new Node({type: 'brace.close'}); * console.log(utils.hasOpen(brace)); // false * console.log(utils.hasClose(brace)); // false * * brace.pushNode(open); * brace.pushNode(close); * console.log(utils.hasOpen(brace)); // true * console.log(utils.hasClose(brace)); // true * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @return {Boolean} * @api public */ utils.hasOpenAndClose = function(node) { return utils.hasOpen(node) && utils.hasClose(node); }; /** * Push the given `node` onto the `state.inside` array for the * given type. This array is used as a specialized "stack" for * only the given `node.type`. * * ```js * var state = { inside: {}}; * var node = new Node({type: 'brace'}); * utils.addType(state, node); * console.log(state.inside); * //=> { brace: [{type: 'brace'}] } * ``` * @param {Object} `state` The `compiler.state` object or custom state object. * @param {Object} `node` Instance of [snapdragon-node][] * @return {Array} Returns the `state.inside` stack for the given type. * @api public */ utils.addType = function(state, node) { assert(utils.isNode(node), 'expected node to be an instance of Node'); assert(isObject(state), 'expected state to be an object'); var type = node.parent ? node.parent.type : node.type.replace(/\.open$/, ''); if (!state.hasOwnProperty('inside')) { state.inside = {}; } if (!state.inside.hasOwnProperty(type)) { state.inside[type] = []; } var arr = state.inside[type]; arr.push(node); return arr; }; /** * Remove the given `node` from the `state.inside` array for the * given type. This array is used as a specialized "stack" for * only the given `node.type`. * * ```js * var state = { inside: {}}; * var node = new Node({type: 'brace'}); * utils.addType(state, node); * console.log(state.inside); * //=> { brace: [{type: 'brace'}] } * utils.removeType(state, node); * //=> { brace: [] } * ``` * @param {Object} `state` The `compiler.state` object or custom state object. * @param {Object} `node` Instance of [snapdragon-node][] * @return {Array} Returns the `state.inside` stack for the given type. * @api public */ utils.removeType = function(state, node) { assert(utils.isNode(node), 'expected node to be an instance of Node'); assert(isObject(state), 'expected state to be an object'); var type = node.parent ? node.parent.type : node.type.replace(/\.close$/, ''); if (state.inside.hasOwnProperty(type)) { return state.inside[type].pop(); } }; /** * Returns true if `node.val` is an empty string, or `node.nodes` does * not contain any non-empty text nodes. * * ```js * var node = new Node({type: 'text'}); * utils.isEmpty(node); //=> true * node.val = 'foo'; * utils.isEmpty(node); //=> false * ``` * @param {Object} `node` Instance of [snapdragon-node][] * @param {Function} `fn` * @return {Boolean} * @api public */ utils.isEmpty = function(node, fn) { assert(utils.isNode(node), 'expected node to be an instance of Node'); if (!Array.isArray(node.nodes)) { if (node.type !== 'text') { return true; } if (typeof fn === 'function') { return fn(node, node.parent); } return !utils.trim(node.val); } for (var i = 0; i < node.nodes.length; i++) { var child = node.nodes[i]; if (utils.isOpen(child) || utils.isClose(child)) { continue; } if (!utils.isEmpty(child, fn)) { return false; } } return true; }; /** * Returns true if the `state.inside` stack for the given type exists * and has one or more nodes on it. * * ```js * var state = { inside: {}}; * var node = new Node({type: 'brace'}); * console.log(utils.isInsideType(state, 'brace')); //=> false * utils.addType(state, node); * console.log(utils.isInsideType(state, 'brace')); //=> true * utils.removeType(state, node); * console.log(utils.isInsideType(state, 'brace')); //=> false * ``` * @param {Object} `state` * @param {String} `type` * @return {Boolean} * @api public */ utils.isInsideType = function(state, type) { assert(isObject(state), 'expected state to be an object'); assert(isString(type), 'expected type to be a string'); if (!state.hasOwnProperty('inside')) { return false; } if (!state.inside.hasOwnProperty(type)) { return false; } return state.inside[type].length > 0; }; /** * Returns true if `node` is either a child or grand-child of the given `type`, * or `state.inside[type]` is a non-empty array. * * ```js * var state = { inside: {}}; * var node = new Node({type: 'brace'}); * var open = new Node({type: 'brace.open'}); * console.log(utils.isInside(state, open, 'brace')); //=> false * utils.pushNode(node, open); * console.log(utils.isInside(state, open, 'brace')); //=> true * ``` * @param {Object} `state` Either the `compiler.state` object, if it exists, or a user-supplied state object. * @param {Object} `node` Instance of [snapdragon-node][] * @param {String} `type` The `node.type` to check for. * @return {Boolean} * @api public */ utils.isInside = function(state, node, type) { assert(utils.isNode(node), 'expected node to be an instance of Node'); assert(isObject(state), 'expected state to be an object'); if (Array.isArray(type)) { for (var i = 0; i < type.length; i++) { if (utils.isInside(state, node, type[i])) { return true; } } return false; } var parent = node.parent; if (typeof type === 'string') { return (parent && parent.type === type) || utils.isInsideType(state, type); } if (typeOf(type) === 'regexp') { if (parent && parent.type && type.test(parent.type)) { return true; } var keys = Object.keys(state.inside); var len = keys.length; var idx = -1; while (++idx < len) { var key = keys[idx]; var val = state.inside[key]; if (Array.isArray(val) && val.length !== 0 && type.test(key)) { return true; } } } return false; }; /** * Get the last `n` element from the given `array`. Used for getting * a node from `node.nodes.` * * @param {Array} `array` * @param {Number} `n` * @return {undefined} * @api public */ utils.last = function(arr, n) { return arr[arr.length - (n || 1)]; }; /** * Cast the given `val` to an array. * * ```js * console.log(utils.arrayify('')); * //=> [] * console.log(utils.arrayify('foo')); * //=> ['foo'] * console.log(utils.arrayify(['foo'])); * //=> ['foo'] * ``` * @param {any} `val` * @return {Array} * @api public */ utils.arrayify = function(val) { if (typeof val === 'string' && val !== '') { return [val]; } if (!Array.isArray(val)) { return []; } return val; }; /** * Convert the given `val` to a string by joining with `,`. Useful * for creating a cheerio/CSS/DOM-style selector from a list of strings. * * @param {any} `val` * @return {Array} * @api public */ utils.stringify = function(val) { return utils.arrayify(val).join(','); }; /** * Ensure that the given value is a string and call `.trim()` on it, * or return an empty string. * * @param {String} `str` * @return {String} * @api public */ utils.trim = function(str) { return typeof str === 'string' ? str.trim() : ''; }; /** * Return true if val is an object */ function isObject(val) { return typeOf(val) === 'object'; } /** * Return true if val is a string */ function isString(val) { return typeof val === 'string'; } /** * Return true if val is a function */ function isFunction(val) { return typeof val === 'function'; } /** * Return true if val is an array */ function isArray(val) { return Array.isArray(val); } /** * Shim to ensure the `.append` methods work with any version of snapdragon */ function append(compiler, val, node) { if (typeof compiler.append !== 'function') { return compiler.emit(val, node); } return compiler.append(val, node); } /** * Simplified assertion. Throws an error is `val` is falsey. */ function assert(val, message) { if (!val) throw new Error(message); } /***/ }), /* 427 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var extend = __webpack_require__(398); var Snapdragon = __webpack_require__(428); var compilers = __webpack_require__(402); var parsers = __webpack_require__(417); var utils = __webpack_require__(403); /** * Customize Snapdragon parser and renderer */ function Braces(options) { this.options = extend({}, options); } /** * Initialize braces */ Braces.prototype.init = function(options) { if (this.isInitialized) return; this.isInitialized = true; var opts = utils.createOptions({}, this.options, options); this.snapdragon = this.options.snapdragon || new Snapdragon(opts); this.compiler = this.snapdragon.compiler; this.parser = this.snapdragon.parser; compilers(this.snapdragon, opts); parsers(this.snapdragon, opts); /** * Call Snapdragon `.parse` method. When AST is returned, we check to * see if any unclosed braces are left on the stack and, if so, we iterate * over the stack and correct the AST so that compilers are called in the correct * order and unbalance braces are properly escaped. */ utils.define(this.snapdragon, 'parse', function(pattern, options) { var parsed = Snapdragon.prototype.parse.apply(this, arguments); this.parser.ast.input = pattern; var stack = this.parser.stack; while (stack.length) { addParent({type: 'brace.close', val: ''}, stack.pop()); } function addParent(node, parent) { utils.define(node, 'parent', parent); parent.nodes.push(node); } // add non-enumerable parser reference utils.define(parsed, 'parser', this.parser); return parsed; }); }; /** * Decorate `.parse` method */ Braces.prototype.parse = function(ast, options) { if (ast && typeof ast === 'object' && ast.nodes) return ast; this.init(options); return this.snapdragon.parse(ast, options); }; /** * Decorate `.compile` method */ Braces.prototype.compile = function(ast, options) { if (typeof ast === 'string') { ast = this.parse(ast, options); } else { this.init(options); } return this.snapdragon.compile(ast, options); }; /** * Expand */ Braces.prototype.expand = function(pattern) { var ast = this.parse(pattern, {expand: true}); return this.compile(ast, {expand: true}); }; /** * Optimize */ Braces.prototype.optimize = function(pattern) { var ast = this.parse(pattern, {optimize: true}); return this.compile(ast, {optimize: true}); }; /** * Expose `Braces` */ module.exports = Braces; /***/ }), /* 428 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Base = __webpack_require__(429); var define = __webpack_require__(390); var Compiler = __webpack_require__(459); var Parser = __webpack_require__(489); var utils = __webpack_require__(469); var regexCache = {}; var cache = {}; /** * Create a new instance of `Snapdragon` with the given `options`. * * ```js * var snapdragon = new Snapdragon(); * ``` * * @param {Object} `options` * @api public */ function Snapdragon(options) { Base.call(this, null, options); this.options = utils.extend({source: 'string'}, this.options); this.compiler = new Compiler(this.options); this.parser = new Parser(this.options); Object.defineProperty(this, 'compilers', { get: function() { return this.compiler.compilers; } }); Object.defineProperty(this, 'parsers', { get: function() { return this.parser.parsers; } }); Object.defineProperty(this, 'regex', { get: function() { return this.parser.regex; } }); } /** * Inherit Base */ Base.extend(Snapdragon); /** * Add a parser to `snapdragon.parsers` for capturing the given `type` using * the specified regex or parser function. A function is useful if you need * to customize how the token is created and/or have access to the parser * instance to check options, etc. * * ```js * snapdragon * .capture('slash', /^\//) * .capture('dot', function() { * var pos = this.position(); * var m = this.match(/^\./); * if (!m) return; * return pos({ * type: 'dot', * val: m[0] * }); * }); * ``` * @param {String} `type` * @param {RegExp|Function} `regex` * @return {Object} Returns the parser instance for chaining * @api public */ Snapdragon.prototype.capture = function() { return this.parser.capture.apply(this.parser, arguments); }; /** * Register a plugin `fn`. * * ```js * var snapdragon = new Snapdgragon([options]); * snapdragon.use(function() { * console.log(this); //<= snapdragon instance * console.log(this.parser); //<= parser instance * console.log(this.compiler); //<= compiler instance * }); * ``` * @param {Object} `fn` * @api public */ Snapdragon.prototype.use = function(fn) { fn.call(this, this); return this; }; /** * Parse the given `str`. * * ```js * var snapdragon = new Snapdgragon([options]); * // register parsers * snapdragon.parser.use(function() {}); * * // parse * var ast = snapdragon.parse('foo/bar'); * console.log(ast); * ``` * @param {String} `str` * @param {Object} `options` Set `options.sourcemap` to true to enable source maps. * @return {Object} Returns an AST. * @api public */ Snapdragon.prototype.parse = function(str, options) { this.options = utils.extend({}, this.options, options); var parsed = this.parser.parse(str, this.options); // add non-enumerable parser reference define(parsed, 'parser', this.parser); return parsed; }; /** * Compile the given `AST`. * * ```js * var snapdragon = new Snapdgragon([options]); * // register plugins * snapdragon.use(function() {}); * // register parser plugins * snapdragon.parser.use(function() {}); * // register compiler plugins * snapdragon.compiler.use(function() {}); * * // parse * var ast = snapdragon.parse('foo/bar'); * * // compile * var res = snapdragon.compile(ast); * console.log(res.output); * ``` * @param {Object} `ast` * @param {Object} `options` * @return {Object} Returns an object with an `output` property with the rendered string. * @api public */ Snapdragon.prototype.compile = function(ast, options) { this.options = utils.extend({}, this.options, options); var compiled = this.compiler.compile(ast, this.options); // add non-enumerable compiler reference define(compiled, 'compiler', this.compiler); return compiled; }; /** * Expose `Snapdragon` */ module.exports = Snapdragon; /** * Expose `Parser` and `Compiler` */ module.exports.Compiler = Compiler; module.exports.Parser = Parser; /***/ }), /* 429 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(29); var define = __webpack_require__(430); var CacheBase = __webpack_require__(431); var Emitter = __webpack_require__(432); var isObject = __webpack_require__(408); var merge = __webpack_require__(450); var pascal = __webpack_require__(453); var cu = __webpack_require__(454); /** * Optionally define a custom `cache` namespace to use. */ function namespace(name) { var Cache = name ? CacheBase.namespace(name) : CacheBase; var fns = []; /** * Create an instance of `Base` with the given `config` and `options`. * * ```js * // initialize with `config` and `options` * var app = new Base({isApp: true}, {abc: true}); * app.set('foo', 'bar'); * * // values defined with the given `config` object will be on the root of the instance * console.log(app.baz); //=> undefined * console.log(app.foo); //=> 'bar' * // or use `.get` * console.log(app.get('isApp')); //=> true * console.log(app.get('foo')); //=> 'bar' * * // values defined with the given `options` object will be on `app.options * console.log(app.options.abc); //=> true * ``` * * @param {Object} `config` If supplied, this object is passed to [cache-base][] to merge onto the the instance upon instantiation. * @param {Object} `options` If supplied, this object is used to initialize the `base.options` object. * @api public */ function Base(config, options) { if (!(this instanceof Base)) { return new Base(config, options); } Cache.call(this, config); this.is('base'); this.initBase(config, options); } /** * Inherit cache-base */ util.inherits(Base, Cache); /** * Add static emitter methods */ Emitter(Base); /** * Initialize `Base` defaults with the given `config` object */ Base.prototype.initBase = function(config, options) { this.options = merge({}, this.options, options); this.cache = this.cache || {}; this.define('registered', {}); if (name) this[name] = {}; // make `app._callbacks` non-enumerable this.define('_callbacks', this._callbacks); if (isObject(config)) { this.visit('set', config); } Base.run(this, 'use', fns); }; /** * Set the given `name` on `app._name` and `app.is*` properties. Used for doing * lookups in plugins. * * ```js * app.is('foo'); * console.log(app._name); * //=> 'foo' * console.log(app.isFoo); * //=> true * app.is('bar'); * console.log(app.isFoo); * //=> true * console.log(app.isBar); * //=> true * console.log(app._name); * //=> 'bar' * ``` * @name .is * @param {String} `name` * @return {Boolean} * @api public */ Base.prototype.is = function(name) { if (typeof name !== 'string') { throw new TypeError('expected name to be a string'); } this.define('is' + pascal(name), true); this.define('_name', name); this.define('_appname', name); return this; }; /** * Returns true if a plugin has already been registered on an instance. * * Plugin implementors are encouraged to use this first thing in a plugin * to prevent the plugin from being called more than once on the same * instance. * * ```js * var base = new Base(); * base.use(function(app) { * if (app.isRegistered('myPlugin')) return; * // do stuff to `app` * }); * * // to also record the plugin as being registered * base.use(function(app) { * if (app.isRegistered('myPlugin', true)) return; * // do stuff to `app` * }); * ``` * @name .isRegistered * @emits `plugin` Emits the name of the plugin being registered. Useful for unit tests, to ensure plugins are only registered once. * @param {String} `name` The plugin name. * @param {Boolean} `register` If the plugin if not already registered, to record it as being registered pass `true` as the second argument. * @return {Boolean} Returns true if a plugin is already registered. * @api public */ Base.prototype.isRegistered = function(name, register) { if (this.registered.hasOwnProperty(name)) { return true; } if (register !== false) { this.registered[name] = true; this.emit('plugin', name); } return false; }; /** * Define a plugin function to be called immediately upon init. Plugins are chainable * and expose the following arguments to the plugin function: * * - `app`: the current instance of `Base` * - `base`: the [first ancestor instance](#base) of `Base` * * ```js * var app = new Base() * .use(foo) * .use(bar) * .use(baz) * ``` * @name .use * @param {Function} `fn` plugin function to call * @return {Object} Returns the item instance for chaining. * @api public */ Base.prototype.use = function(fn) { fn.call(this, this); return this; }; /** * The `.define` method is used for adding non-enumerable property on the instance. * Dot-notation is **not supported** with `define`. * * ```js * // arbitrary `render` function using lodash `template` * app.define('render', function(str, locals) { * return _.template(str)(locals); * }); * ``` * @name .define * @param {String} `key` The name of the property to define. * @param {any} `value` * @return {Object} Returns the instance for chaining. * @api public */ Base.prototype.define = function(key, val) { if (isObject(key)) { return this.visit('define', key); } define(this, key, val); return this; }; /** * Mix property `key` onto the Base prototype. If base is inherited using * `Base.extend` this method will be overridden by a new `mixin` method that will * only add properties to the prototype of the inheriting application. * * ```js * app.mixin('foo', function() { * // do stuff * }); * ``` * @name .mixin * @param {String} `key` * @param {Object|Array} `val` * @return {Object} Returns the `base` instance for chaining. * @api public */ Base.prototype.mixin = function(key, val) { Base.prototype[key] = val; return this; }; /** * Non-enumberable mixin array, used by the static [Base.mixin]() method. */ Base.prototype.mixins = Base.prototype.mixins || []; /** * Getter/setter used when creating nested instances of `Base`, for storing a reference * to the first ancestor instance. This works by setting an instance of `Base` on the `parent` * property of a "child" instance. The `base` property defaults to the current instance if * no `parent` property is defined. * * ```js * // create an instance of `Base`, this is our first ("base") instance * var first = new Base(); * first.foo = 'bar'; // arbitrary property, to make it easier to see what's happening later * * // create another instance * var second = new Base(); * // create a reference to the first instance (`first`) * second.parent = first; * * // create another instance * var third = new Base(); * // create a reference to the previous instance (`second`) * // repeat this pattern every time a "child" instance is created * third.parent = second; * * // we can always access the first instance using the `base` property * console.log(first.base.foo); * //=> 'bar' * console.log(second.base.foo); * //=> 'bar' * console.log(third.base.foo); * //=> 'bar' * // and now you know how to get to third base ;) * ``` * @name .base * @api public */ Object.defineProperty(Base.prototype, 'base', { configurable: true, get: function() { return this.parent ? this.parent.base : this; } }); /** * Static method for adding global plugin functions that will * be added to an instance when created. * * ```js * Base.use(function(app) { * app.foo = 'bar'; * }); * var app = new Base(); * console.log(app.foo); * //=> 'bar' * ``` * @name #use * @param {Function} `fn` Plugin function to use on each instance. * @return {Object} Returns the `Base` constructor for chaining * @api public */ define(Base, 'use', function(fn) { fns.push(fn); return Base; }); /** * Run an array of functions by passing each function * to a method on the given object specified by the given property. * * @param {Object} `obj` Object containing method to use. * @param {String} `prop` Name of the method on the object to use. * @param {Array} `arr` Array of functions to pass to the method. */ define(Base, 'run', function(obj, prop, arr) { var len = arr.length, i = 0; while (len--) { obj[prop](arr[i++]); } return Base; }); /** * Static method for inheriting the prototype and static methods of the `Base` class. * This method greatly simplifies the process of creating inheritance-based applications. * See [static-extend][] for more details. * * ```js * var extend = cu.extend(Parent); * Parent.extend(Child); * * // optional methods * Parent.extend(Child, { * foo: function() {}, * bar: function() {} * }); * ``` * @name #extend * @param {Function} `Ctor` constructor to extend * @param {Object} `methods` Optional prototype properties to mix in. * @return {Object} Returns the `Base` constructor for chaining * @api public */ define(Base, 'extend', cu.extend(Base, function(Ctor, Parent) { Ctor.prototype.mixins = Ctor.prototype.mixins || []; define(Ctor, 'mixin', function(fn) { var mixin = fn(Ctor.prototype, Ctor); if (typeof mixin === 'function') { Ctor.prototype.mixins.push(mixin); } return Ctor; }); define(Ctor, 'mixins', function(Child) { Base.run(Child, 'mixin', Ctor.prototype.mixins); return Ctor; }); Ctor.prototype.mixin = function(key, value) { Ctor.prototype[key] = value; return this; }; return Base; })); /** * Used for adding methods to the `Base` prototype, and/or to the prototype of child instances. * When a mixin function returns a function, the returned function is pushed onto the `.mixins` * array, making it available to be used on inheriting classes whenever `Base.mixins()` is * called (e.g. `Base.mixins(Child)`). * * ```js * Base.mixin(function(proto) { * proto.foo = function(msg) { * return 'foo ' + msg; * }; * }); * ``` * @name #mixin * @param {Function} `fn` Function to call * @return {Object} Returns the `Base` constructor for chaining * @api public */ define(Base, 'mixin', function(fn) { var mixin = fn(Base.prototype, Base); if (typeof mixin === 'function') { Base.prototype.mixins.push(mixin); } return Base; }); /** * Static method for running global mixin functions against a child constructor. * Mixins must be registered before calling this method. * * ```js * Base.extend(Child); * Base.mixins(Child); * ``` * @name #mixins * @param {Function} `Child` Constructor function of a child class * @return {Object} Returns the `Base` constructor for chaining * @api public */ define(Base, 'mixins', function(Child) { Base.run(Child, 'mixin', Base.prototype.mixins); return Base; }); /** * Similar to `util.inherit`, but copies all static properties, prototype properties, and * getters/setters from `Provider` to `Receiver`. See [class-utils][]{#inherit} for more details. * * ```js * Base.inherit(Foo, Bar); * ``` * @name #inherit * @param {Function} `Receiver` Receiving (child) constructor * @param {Function} `Provider` Providing (parent) constructor * @return {Object} Returns the `Base` constructor for chaining * @api public */ define(Base, 'inherit', cu.inherit); define(Base, 'bubble', cu.bubble); return Base; } /** * Expose `Base` with default settings */ module.exports = namespace(); /** * Allow users to define a namespace */ module.exports.namespace = namespace; /***/ }), /* 430 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * define-property * * Copyright (c) 2015, 2017, Jon Schlinkert. * Released under the MIT License. */ var isDescriptor = __webpack_require__(420); module.exports = function defineProperty(obj, prop, val) { if (typeof obj !== 'object' && typeof obj !== 'function') { throw new TypeError('expected an object or function.'); } if (typeof prop !== 'string') { throw new TypeError('expected `prop` to be a string.'); } if (isDescriptor(val) && ('set' in val || 'get' in val)) { return Object.defineProperty(obj, prop, val); } return Object.defineProperty(obj, prop, { configurable: true, enumerable: false, writable: true, value: val }); }; /***/ }), /* 431 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isObject = __webpack_require__(408); var Emitter = __webpack_require__(432); var visit = __webpack_require__(433); var toPath = __webpack_require__(436); var union = __webpack_require__(437); var del = __webpack_require__(441); var get = __webpack_require__(439); var has = __webpack_require__(446); var set = __webpack_require__(449); /** * Create a `Cache` constructor that when instantiated will * store values on the given `prop`. * * ```js * var Cache = require('cache-base').namespace('data'); * var cache = new Cache(); * * cache.set('foo', 'bar'); * //=> {data: {foo: 'bar'}} * ``` * @param {String} `prop` The property name to use for storing values. * @return {Function} Returns a custom `Cache` constructor * @api public */ function namespace(prop) { /** * Create a new `Cache`. Internally the `Cache` constructor is created using * the `namespace` function, with `cache` defined as the storage object. * * ```js * var app = new Cache(); * ``` * @param {Object} `cache` Optionally pass an object to initialize with. * @constructor * @api public */ function Cache(cache) { if (prop) { this[prop] = {}; } if (cache) { this.set(cache); } } /** * Inherit Emitter */ Emitter(Cache.prototype); /** * Assign `value` to `key`. Also emits `set` with * the key and value. * * ```js * app.on('set', function(key, val) { * // do something when `set` is emitted * }); * * app.set(key, value); * * // also takes an object or array * app.set({name: 'Halle'}); * app.set([{foo: 'bar'}, {baz: 'quux'}]); * console.log(app); * //=> {name: 'Halle', foo: 'bar', baz: 'quux'} * ``` * * @name .set * @emits `set` with `key` and `value` as arguments. * @param {String} `key` * @param {any} `value` * @return {Object} Returns the instance for chaining. * @api public */ Cache.prototype.set = function(key, val) { if (Array.isArray(key) && arguments.length === 2) { key = toPath(key); } if (isObject(key) || Array.isArray(key)) { this.visit('set', key); } else { set(prop ? this[prop] : this, key, val); this.emit('set', key, val); } return this; }; /** * Union `array` to `key`. Also emits `set` with * the key and value. * * ```js * app.union('a.b', ['foo']); * app.union('a.b', ['bar']); * console.log(app.get('a')); * //=> {b: ['foo', 'bar']} * ``` * @name .union * @param {String} `key` * @param {any} `value` * @return {Object} Returns the instance for chaining. * @api public */ Cache.prototype.union = function(key, val) { if (Array.isArray(key) && arguments.length === 2) { key = toPath(key); } var ctx = prop ? this[prop] : this; union(ctx, key, arrayify(val)); this.emit('union', val); return this; }; /** * Return the value of `key`. Dot notation may be used * to get [nested property values][get-value]. * * ```js * app.set('a.b.c', 'd'); * app.get('a.b'); * //=> {c: 'd'} * * app.get(['a', 'b']); * //=> {c: 'd'} * ``` * * @name .get * @emits `get` with `key` and `value` as arguments. * @param {String} `key` The name of the property to get. Dot-notation may be used. * @return {any} Returns the value of `key` * @api public */ Cache.prototype.get = function(key) { key = toPath(arguments); var ctx = prop ? this[prop] : this; var val = get(ctx, key); this.emit('get', key, val); return val; }; /** * Return true if app has a stored value for `key`, * false only if value is `undefined`. * * ```js * app.set('foo', 'bar'); * app.has('foo'); * //=> true * ``` * * @name .has * @emits `has` with `key` and true or false as arguments. * @param {String} `key` * @return {Boolean} * @api public */ Cache.prototype.has = function(key) { key = toPath(arguments); var ctx = prop ? this[prop] : this; var val = get(ctx, key); var has = typeof val !== 'undefined'; this.emit('has', key, has); return has; }; /** * Delete one or more properties from the instance. * * ```js * app.del(); // delete all * // or * app.del('foo'); * // or * app.del(['foo', 'bar']); * ``` * @name .del * @emits `del` with the `key` as the only argument. * @param {String|Array} `key` Property name or array of property names. * @return {Object} Returns the instance for chaining. * @api public */ Cache.prototype.del = function(key) { if (Array.isArray(key)) { this.visit('del', key); } else { del(prop ? this[prop] : this, key); this.emit('del', key); } return this; }; /** * Reset the entire cache to an empty object. * * ```js * app.clear(); * ``` * @api public */ Cache.prototype.clear = function() { if (prop) { this[prop] = {}; } }; /** * Visit `method` over the properties in the given object, or map * visit over the object-elements in an array. * * @name .visit * @param {String} `method` The name of the `base` method to call. * @param {Object|Array} `val` The object or array to iterate over. * @return {Object} Returns the instance for chaining. * @api public */ Cache.prototype.visit = function(method, val) { visit(this, method, val); return this; }; return Cache; } /** * Cast val to an array */ function arrayify(val) { return val ? (Array.isArray(val) ? val : [val]) : []; } /** * Expose `Cache` */ module.exports = namespace(); /** * Expose `Cache.namespace` */ module.exports.namespace = namespace; /***/ }), /* 432 */ /***/ (function(module, exports, __webpack_require__) { /** * Expose `Emitter`. */ if (true) { module.exports = Emitter; } /** * Initialize a new `Emitter`. * * @api public */ function Emitter(obj) { if (obj) return mixin(obj); }; /** * Mixin the emitter properties. * * @param {Object} obj * @return {Object} * @api private */ function mixin(obj) { for (var key in Emitter.prototype) { obj[key] = Emitter.prototype[key]; } return obj; } /** * Listen on the given `event` with `fn`. * * @param {String} event * @param {Function} fn * @return {Emitter} * @api public */ Emitter.prototype.on = Emitter.prototype.addEventListener = function(event, fn){ this._callbacks = this._callbacks || {}; (this._callbacks['$' + event] = this._callbacks['$' + event] || []) .push(fn); return this; }; /** * Adds an `event` listener that will be invoked a single * time then automatically removed. * * @param {String} event * @param {Function} fn * @return {Emitter} * @api public */ Emitter.prototype.once = function(event, fn){ function on() { this.off(event, on); fn.apply(this, arguments); } on.fn = fn; this.on(event, on); return this; }; /** * Remove the given callback for `event` or all * registered callbacks. * * @param {String} event * @param {Function} fn * @return {Emitter} * @api public */ Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function(event, fn){ this._callbacks = this._callbacks || {}; // all if (0 == arguments.length) { this._callbacks = {}; return this; } // specific event var callbacks = this._callbacks['$' + event]; if (!callbacks) return this; // remove all handlers if (1 == arguments.length) { delete this._callbacks['$' + event]; return this; } // remove specific handler var cb; for (var i = 0; i < callbacks.length; i++) { cb = callbacks[i]; if (cb === fn || cb.fn === fn) { callbacks.splice(i, 1); break; } } return this; }; /** * Emit `event` with the given args. * * @param {String} event * @param {Mixed} ... * @return {Emitter} */ Emitter.prototype.emit = function(event){ this._callbacks = this._callbacks || {}; var args = [].slice.call(arguments, 1) , callbacks = this._callbacks['$' + event]; if (callbacks) { callbacks = callbacks.slice(0); for (var i = 0, len = callbacks.length; i < len; ++i) { callbacks[i].apply(this, args); } } return this; }; /** * Return array of callbacks for `event`. * * @param {String} event * @return {Array} * @api public */ Emitter.prototype.listeners = function(event){ this._callbacks = this._callbacks || {}; return this._callbacks['$' + event] || []; }; /** * Check if this emitter has `event` handlers. * * @param {String} event * @return {Boolean} * @api public */ Emitter.prototype.hasListeners = function(event){ return !! this.listeners(event).length; }; /***/ }), /* 433 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * collection-visit * * Copyright (c) 2015, 2017, Jon Schlinkert. * Released under the MIT License. */ var visit = __webpack_require__(434); var mapVisit = __webpack_require__(435); module.exports = function(collection, method, val) { var result; if (typeof val === 'string' && (method in collection)) { var args = [].slice.call(arguments, 2); result = collection[method].apply(collection, args); } else if (Array.isArray(val)) { result = mapVisit.apply(null, arguments); } else { result = visit.apply(null, arguments); } if (typeof result !== 'undefined') { return result; } return collection; }; /***/ }), /* 434 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * object-visit * * Copyright (c) 2015, 2017, Jon Schlinkert. * Released under the MIT License. */ var isObject = __webpack_require__(408); module.exports = function visit(thisArg, method, target, val) { if (!isObject(thisArg) && typeof thisArg !== 'function') { throw new Error('object-visit expects `thisArg` to be an object.'); } if (typeof method !== 'string') { throw new Error('object-visit expects `method` name to be a string'); } if (typeof thisArg[method] !== 'function') { return thisArg; } var args = [].slice.call(arguments, 3); target = target || {}; for (var key in target) { var arr = [key, target[key]].concat(args); thisArg[method].apply(thisArg, arr); } return thisArg; }; /***/ }), /* 435 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(29); var visit = __webpack_require__(434); /** * Map `visit` over an array of objects. * * @param {Object} `collection` The context in which to invoke `method` * @param {String} `method` Name of the method to call on `collection` * @param {Object} `arr` Array of objects. */ module.exports = function mapVisit(collection, method, val) { if (isObject(val)) { return visit.apply(null, arguments); } if (!Array.isArray(val)) { throw new TypeError('expected an array: ' + util.inspect(val)); } var args = [].slice.call(arguments, 3); for (var i = 0; i < val.length; i++) { var ele = val[i]; if (isObject(ele)) { visit.apply(null, [collection, method, ele].concat(args)); } else { collection[method].apply(collection, [ele].concat(args)); } } }; function isObject(val) { return val && (typeof val === 'function' || (!Array.isArray(val) && typeof val === 'object')); } /***/ }), /* 436 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * to-object-path * * Copyright (c) 2015, Jon Schlinkert. * Licensed under the MIT License. */ var typeOf = __webpack_require__(413); module.exports = function toPath(args) { if (typeOf(args) !== 'arguments') { args = arguments; } return filter(args).join('.'); }; function filter(arr) { var len = arr.length; var idx = -1; var res = []; while (++idx < len) { var ele = arr[idx]; if (typeOf(ele) === 'arguments' || Array.isArray(ele)) { res.push.apply(res, filter(ele)); } else if (typeof ele === 'string') { res.push(ele); } } return res; } /***/ }), /* 437 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isObject = __webpack_require__(399); var union = __webpack_require__(438); var get = __webpack_require__(439); var set = __webpack_require__(440); module.exports = function unionValue(obj, prop, value) { if (!isObject(obj)) { throw new TypeError('union-value expects the first argument to be an object.'); } if (typeof prop !== 'string') { throw new TypeError('union-value expects `prop` to be a string.'); } var arr = arrayify(get(obj, prop)); set(obj, prop, union(arr, arrayify(value))); return obj; }; function arrayify(val) { if (val === null || typeof val === 'undefined') { return []; } if (Array.isArray(val)) { return val; } return [val]; } /***/ }), /* 438 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function union(init) { if (!Array.isArray(init)) { throw new TypeError('arr-union expects the first argument to be an array.'); } var len = arguments.length; var i = 0; while (++i < len) { var arg = arguments[i]; if (!arg) continue; if (!Array.isArray(arg)) { arg = [arg]; } for (var j = 0; j < arg.length; j++) { var ele = arg[j]; if (init.indexOf(ele) >= 0) { continue; } init.push(ele); } } return init; }; /***/ }), /* 439 */ /***/ (function(module, exports) { /*! * get-value * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ module.exports = function(obj, prop, a, b, c) { if (!isObject(obj) || !prop) { return obj; } prop = toString(prop); // allowing for multiple properties to be passed as // a string or array, but much faster (3-4x) than doing // `[].slice.call(arguments)` if (a) prop += '.' + toString(a); if (b) prop += '.' + toString(b); if (c) prop += '.' + toString(c); if (prop in obj) { return obj[prop]; } var segs = prop.split('.'); var len = segs.length; var i = -1; while (obj && (++i < len)) { var key = segs[i]; while (key[key.length - 1] === '\\') { key = key.slice(0, -1) + '.' + segs[++i]; } obj = obj[key]; } return obj; }; function isObject(val) { return val !== null && (typeof val === 'object' || typeof val === 'function'); } function toString(val) { if (!val) return ''; if (Array.isArray(val)) { return val.join('.'); } return val; } /***/ }), /* 440 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * set-value * * Copyright (c) 2014-2015, 2017, Jon Schlinkert. * Released under the MIT License. */ var toPath = __webpack_require__(436); var extend = __webpack_require__(398); var isPlainObject = __webpack_require__(407); var isObject = __webpack_require__(399); module.exports = function(obj, path, val) { if (!isObject(obj)) { return obj; } if (Array.isArray(path)) { path = toPath(path); } if (typeof path !== 'string') { return obj; } var segs = path.split('.'); var len = segs.length, i = -1; var res = obj; var last; while (++i < len) { var key = segs[i]; while (key[key.length - 1] === '\\') { key = key.slice(0, -1) + '.' + segs[++i]; } if (i === len - 1) { last = key; break; } if (!isObject(obj[key])) { obj[key] = {}; } obj = obj[key]; } if (obj.hasOwnProperty(last) && isObject(obj[last])) { if (isPlainObject(val)) { extend(obj[last], val); } else { obj[last] = val; } } else { obj[last] = val; } return res; }; /***/ }), /* 441 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * unset-value * * Copyright (c) 2015, 2017, Jon Schlinkert. * Released under the MIT License. */ var isObject = __webpack_require__(408); var has = __webpack_require__(442); module.exports = function unset(obj, prop) { if (!isObject(obj)) { throw new TypeError('expected an object.'); } if (obj.hasOwnProperty(prop)) { delete obj[prop]; return true; } if (has(obj, prop)) { var segs = prop.split('.'); var last = segs.pop(); while (segs.length && segs[segs.length - 1].slice(-1) === '\\') { last = segs.pop().slice(0, -1) + '.' + last; } while (segs.length) obj = obj[prop = segs.shift()]; return (delete obj[last]); } return true; }; /***/ }), /* 442 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * has-value * * Copyright (c) 2014-2016, Jon Schlinkert. * Licensed under the MIT License. */ var isObject = __webpack_require__(443); var hasValues = __webpack_require__(445); var get = __webpack_require__(439); module.exports = function(obj, prop, noZero) { if (isObject(obj)) { return hasValues(get(obj, prop), noZero); } return hasValues(obj, prop); }; /***/ }), /* 443 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * isobject * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ var isArray = __webpack_require__(444); module.exports = function isObject(val) { return val != null && typeof val === 'object' && isArray(val) === false; }; /***/ }), /* 444 */ /***/ (function(module, exports) { var toString = {}.toString; module.exports = Array.isArray || function (arr) { return toString.call(arr) == '[object Array]'; }; /***/ }), /* 445 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * has-values * * Copyright (c) 2014-2015, Jon Schlinkert. * Licensed under the MIT License. */ module.exports = function hasValue(o, noZero) { if (o === null || o === undefined) { return false; } if (typeof o === 'boolean') { return true; } if (typeof o === 'number') { if (o === 0 && noZero === true) { return false; } return true; } if (o.length !== undefined) { return o.length !== 0; } for (var key in o) { if (o.hasOwnProperty(key)) { return true; } } return false; }; /***/ }), /* 446 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * has-value * * Copyright (c) 2014-2017, Jon Schlinkert. * Licensed under the MIT License. */ var isObject = __webpack_require__(408); var hasValues = __webpack_require__(447); var get = __webpack_require__(439); module.exports = function(val, prop) { return hasValues(isObject(val) && prop ? get(val, prop) : val); }; /***/ }), /* 447 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * has-values * * Copyright (c) 2014-2015, 2017, Jon Schlinkert. * Released under the MIT License. */ var typeOf = __webpack_require__(448); var isNumber = __webpack_require__(412); module.exports = function hasValue(val) { // is-number checks for NaN and other edge cases if (isNumber(val)) { return true; } switch (typeOf(val)) { case 'null': case 'boolean': case 'function': return true; case 'string': case 'arguments': return val.length !== 0; case 'error': return val.message !== ''; case 'array': var len = val.length; if (len === 0) { return false; } for (var i = 0; i < len; i++) { if (hasValue(val[i])) { return true; } } return false; case 'file': case 'map': case 'set': return val.size !== 0; case 'object': var keys = Object.keys(val); if (keys.length === 0) { return false; } for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (hasValue(val[key])) { return true; } } return false; default: { return false; } } }; /***/ }), /* 448 */ /***/ (function(module, exports, __webpack_require__) { var isBuffer = __webpack_require__(395); var toString = Object.prototype.toString; /** * Get the native `typeof` a value. * * @param {*} `val` * @return {*} Native javascript type */ module.exports = function kindOf(val) { // primitivies if (typeof val === 'undefined') { return 'undefined'; } if (val === null) { return 'null'; } if (val === true || val === false || val instanceof Boolean) { return 'boolean'; } if (typeof val === 'string' || val instanceof String) { return 'string'; } if (typeof val === 'number' || val instanceof Number) { return 'number'; } // functions if (typeof val === 'function' || val instanceof Function) { return 'function'; } // array if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { return 'array'; } // check for instances of RegExp and Date before calling `toString` if (val instanceof RegExp) { return 'regexp'; } if (val instanceof Date) { return 'date'; } // other objects var type = toString.call(val); if (type === '[object RegExp]') { return 'regexp'; } if (type === '[object Date]') { return 'date'; } if (type === '[object Arguments]') { return 'arguments'; } if (type === '[object Error]') { return 'error'; } if (type === '[object Promise]') { return 'promise'; } // buffer if (isBuffer(val)) { return 'buffer'; } // es6: Map, WeakMap, Set, WeakSet if (type === '[object Set]') { return 'set'; } if (type === '[object WeakSet]') { return 'weakset'; } if (type === '[object Map]') { return 'map'; } if (type === '[object WeakMap]') { return 'weakmap'; } if (type === '[object Symbol]') { return 'symbol'; } // typed arrays if (type === '[object Int8Array]') { return 'int8array'; } if (type === '[object Uint8Array]') { return 'uint8array'; } if (type === '[object Uint8ClampedArray]') { return 'uint8clampedarray'; } if (type === '[object Int16Array]') { return 'int16array'; } if (type === '[object Uint16Array]') { return 'uint16array'; } if (type === '[object Int32Array]') { return 'int32array'; } if (type === '[object Uint32Array]') { return 'uint32array'; } if (type === '[object Float32Array]') { return 'float32array'; } if (type === '[object Float64Array]') { return 'float64array'; } // must be a plain object return 'object'; }; /***/ }), /* 449 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * set-value * * Copyright (c) 2014-2015, 2017, Jon Schlinkert. * Released under the MIT License. */ var split = __webpack_require__(404); var extend = __webpack_require__(398); var isPlainObject = __webpack_require__(407); var isObject = __webpack_require__(399); module.exports = function(obj, prop, val) { if (!isObject(obj)) { return obj; } if (Array.isArray(prop)) { prop = [].concat.apply([], prop).join('.'); } if (typeof prop !== 'string') { return obj; } var keys = split(prop, {sep: '.', brackets: true}); var len = keys.length; var idx = -1; var current = obj; while (++idx < len) { var key = keys[idx]; if (idx !== len - 1) { if (!isObject(current[key])) { current[key] = {}; } current = current[key]; continue; } if (isPlainObject(current[key]) && isPlainObject(val)) { current[key] = extend({}, current[key], val); } else { current[key] = val; } } return obj; }; /***/ }), /* 450 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isExtendable = __webpack_require__(451); var forIn = __webpack_require__(452); function mixinDeep(target, objects) { var len = arguments.length, i = 0; while (++i < len) { var obj = arguments[i]; if (isObject(obj)) { forIn(obj, copy, target); } } return target; } /** * Copy properties from the source object to the * target object. * * @param {*} `val` * @param {String} `key` */ function copy(val, key) { if (key === '__proto__') { return; } var obj = this[key]; if (isObject(val) && isObject(obj)) { mixinDeep(obj, val); } else { this[key] = val; } } /** * Returns true if `val` is an object or function. * * @param {any} val * @return {Boolean} */ function isObject(val) { return isExtendable(val) && !Array.isArray(val); } /** * Expose `mixinDeep` */ module.exports = mixinDeep; /***/ }), /* 451 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * is-extendable * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. */ var isPlainObject = __webpack_require__(407); module.exports = function isExtendable(val) { return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); }; /***/ }), /* 452 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * for-in * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ module.exports = function forIn(obj, fn, thisArg) { for (var key in obj) { if (fn.call(thisArg, obj[key], key, obj) === false) { break; } } }; /***/ }), /* 453 */ /***/ (function(module, exports) { /*! * pascalcase * * Copyright (c) 2015, Jon Schlinkert. * Licensed under the MIT License. */ function pascalcase(str) { if (typeof str !== 'string') { throw new TypeError('expected a string.'); } str = str.replace(/([A-Z])/g, ' $1'); if (str.length === 1) { return str.toUpperCase(); } str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase(); str = str.charAt(0).toUpperCase() + str.slice(1); return str.replace(/[\W_]+(\w|$)/g, function (_, ch) { return ch.toUpperCase(); }); } module.exports = pascalcase; /***/ }), /* 454 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(29); var utils = __webpack_require__(455); /** * Expose class utils */ var cu = module.exports; /** * Expose class utils: `cu` */ cu.isObject = function isObject(val) { return utils.isObj(val) || typeof val === 'function'; }; /** * Returns true if an array has any of the given elements, or an * object has any of the give keys. * * ```js * cu.has(['a', 'b', 'c'], 'c'); * //=> true * * cu.has(['a', 'b', 'c'], ['c', 'z']); * //=> true * * cu.has({a: 'b', c: 'd'}, ['c', 'z']); * //=> true * ``` * @param {Object} `obj` * @param {String|Array} `val` * @return {Boolean} * @api public */ cu.has = function has(obj, val) { val = cu.arrayify(val); var len = val.length; if (cu.isObject(obj)) { for (var key in obj) { if (val.indexOf(key) > -1) { return true; } } var keys = cu.nativeKeys(obj); return cu.has(keys, val); } if (Array.isArray(obj)) { var arr = obj; while (len--) { if (arr.indexOf(val[len]) > -1) { return true; } } return false; } throw new TypeError('expected an array or object.'); }; /** * Returns true if an array or object has all of the given values. * * ```js * cu.hasAll(['a', 'b', 'c'], 'c'); * //=> true * * cu.hasAll(['a', 'b', 'c'], ['c', 'z']); * //=> false * * cu.hasAll({a: 'b', c: 'd'}, ['c', 'z']); * //=> false * ``` * @param {Object|Array} `val` * @param {String|Array} `values` * @return {Boolean} * @api public */ cu.hasAll = function hasAll(val, values) { values = cu.arrayify(values); var len = values.length; while (len--) { if (!cu.has(val, values[len])) { return false; } } return true; }; /** * Cast the given value to an array. * * ```js * cu.arrayify('foo'); * //=> ['foo'] * * cu.arrayify(['foo']); * //=> ['foo'] * ``` * * @param {String|Array} `val` * @return {Array} * @api public */ cu.arrayify = function arrayify(val) { return val ? (Array.isArray(val) ? val : [val]) : []; }; /** * Noop */ cu.noop = function noop() { return; }; /** * Returns the first argument passed to the function. */ cu.identity = function identity(val) { return val; }; /** * Returns true if a value has a `contructor` * * ```js * cu.hasConstructor({}); * //=> true * * cu.hasConstructor(Object.create(null)); * //=> false * ``` * @param {Object} `value` * @return {Boolean} * @api public */ cu.hasConstructor = function hasConstructor(val) { return cu.isObject(val) && typeof val.constructor !== 'undefined'; }; /** * Get the native `ownPropertyNames` from the constructor of the * given `object`. An empty array is returned if the object does * not have a constructor. * * ```js * cu.nativeKeys({a: 'b', b: 'c', c: 'd'}) * //=> ['a', 'b', 'c'] * * cu.nativeKeys(function(){}) * //=> ['length', 'caller'] * ``` * * @param {Object} `obj` Object that has a `constructor`. * @return {Array} Array of keys. * @api public */ cu.nativeKeys = function nativeKeys(val) { if (!cu.hasConstructor(val)) return []; return Object.getOwnPropertyNames(val); }; /** * Returns property descriptor `key` if it's an "own" property * of the given object. * * ```js * function App() {} * Object.defineProperty(App.prototype, 'count', { * get: function() { * return Object.keys(this).length; * } * }); * cu.getDescriptor(App.prototype, 'count'); * // returns: * // { * // get: [Function], * // set: undefined, * // enumerable: false, * // configurable: false * // } * ``` * * @param {Object} `obj` * @param {String} `key` * @return {Object} Returns descriptor `key` * @api public */ cu.getDescriptor = function getDescriptor(obj, key) { if (!cu.isObject(obj)) { throw new TypeError('expected an object.'); } if (typeof key !== 'string') { throw new TypeError('expected key to be a string.'); } return Object.getOwnPropertyDescriptor(obj, key); }; /** * Copy a descriptor from one object to another. * * ```js * function App() {} * Object.defineProperty(App.prototype, 'count', { * get: function() { * return Object.keys(this).length; * } * }); * var obj = {}; * cu.copyDescriptor(obj, App.prototype, 'count'); * ``` * @param {Object} `receiver` * @param {Object} `provider` * @param {String} `name` * @return {Object} * @api public */ cu.copyDescriptor = function copyDescriptor(receiver, provider, name) { if (!cu.isObject(receiver)) { throw new TypeError('expected receiving object to be an object.'); } if (!cu.isObject(provider)) { throw new TypeError('expected providing object to be an object.'); } if (typeof name !== 'string') { throw new TypeError('expected name to be a string.'); } var val = cu.getDescriptor(provider, name); if (val) Object.defineProperty(receiver, name, val); }; /** * Copy static properties, prototype properties, and descriptors * from one object to another. * * @param {Object} `receiver` * @param {Object} `provider` * @param {String|Array} `omit` One or more properties to omit * @return {Object} * @api public */ cu.copy = function copy(receiver, provider, omit) { if (!cu.isObject(receiver)) { throw new TypeError('expected receiving object to be an object.'); } if (!cu.isObject(provider)) { throw new TypeError('expected providing object to be an object.'); } var props = Object.getOwnPropertyNames(provider); var keys = Object.keys(provider); var len = props.length, key; omit = cu.arrayify(omit); while (len--) { key = props[len]; if (cu.has(keys, key)) { utils.define(receiver, key, provider[key]); } else if (!(key in receiver) && !cu.has(omit, key)) { cu.copyDescriptor(receiver, provider, key); } } }; /** * Inherit the static properties, prototype properties, and descriptors * from of an object. * * @param {Object} `receiver` * @param {Object} `provider` * @param {String|Array} `omit` One or more properties to omit * @return {Object} * @api public */ cu.inherit = function inherit(receiver, provider, omit) { if (!cu.isObject(receiver)) { throw new TypeError('expected receiving object to be an object.'); } if (!cu.isObject(provider)) { throw new TypeError('expected providing object to be an object.'); } var keys = []; for (var key in provider) { keys.push(key); receiver[key] = provider[key]; } keys = keys.concat(cu.arrayify(omit)); var a = provider.prototype || provider; var b = receiver.prototype || receiver; cu.copy(b, a, keys); }; /** * Returns a function for extending the static properties, * prototype properties, and descriptors from the `Parent` * constructor onto `Child` constructors. * * ```js * var extend = cu.extend(Parent); * Parent.extend(Child); * * // optional methods * Parent.extend(Child, { * foo: function() {}, * bar: function() {} * }); * ``` * @param {Function} `Parent` Parent ctor * @param {Function} `extend` Optional extend function to handle custom extensions. Useful when updating methods that require a specific prototype. * @param {Function} `Child` Child ctor * @param {Object} `proto` Optionally pass additional prototype properties to inherit. * @return {Object} * @api public */ cu.extend = function() { // keep it lazy, instead of assigning to `cu.extend` return utils.staticExtend.apply(null, arguments); }; /** * Bubble up events emitted from static methods on the Parent ctor. * * @param {Object} `Parent` * @param {Array} `events` Event names to bubble up * @api public */ cu.bubble = function(Parent, events) { events = events || []; Parent.bubble = function(Child, arr) { if (Array.isArray(arr)) { events = utils.union([], events, arr); } var len = events.length; var idx = -1; while (++idx < len) { var name = events[idx]; Parent.on(name, Child.emit.bind(Child, name)); } cu.bubble(Child, events); }; }; /***/ }), /* 455 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = {}; /** * Lazily required module dependencies */ utils.union = __webpack_require__(438); utils.define = __webpack_require__(390); utils.isObj = __webpack_require__(408); utils.staticExtend = __webpack_require__(456); /** * Expose `utils` */ module.exports = utils; /***/ }), /* 456 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * static-extend * * Copyright (c) 2016, Jon Schlinkert. * Licensed under the MIT License. */ var copy = __webpack_require__(457); var define = __webpack_require__(390); var util = __webpack_require__(29); /** * Returns a function for extending the static properties, * prototype properties, and descriptors from the `Parent` * constructor onto `Child` constructors. * * ```js * var extend = require('static-extend'); * Parent.extend = extend(Parent); * * // optionally pass a custom merge function as the second arg * Parent.extend = extend(Parent, function(Child) { * Child.prototype.mixin = function(key, val) { * Child.prototype[key] = val; * }; * }); * * // extend "child" constructors * Parent.extend(Child); * * // optionally define prototype methods as the second arg * Parent.extend(Child, { * foo: function() {}, * bar: function() {} * }); * ``` * @param {Function} `Parent` Parent ctor * @param {Function} `extendFn` Optional extend function for handling any necessary custom merging. Useful when updating methods that require a specific prototype. * @param {Function} `Child` Child ctor * @param {Object} `proto` Optionally pass additional prototype properties to inherit. * @return {Object} * @api public */ function extend(Parent, extendFn) { if (typeof Parent !== 'function') { throw new TypeError('expected Parent to be a function.'); } return function(Ctor, proto) { if (typeof Ctor !== 'function') { throw new TypeError('expected Ctor to be a function.'); } util.inherits(Ctor, Parent); copy(Ctor, Parent); // proto can be null or a plain object if (typeof proto === 'object') { var obj = Object.create(proto); for (var k in obj) { Ctor.prototype[k] = obj[k]; } } // keep a reference to the parent prototype define(Ctor.prototype, '_parent_', { configurable: true, set: function() {}, get: function() { return Parent.prototype; } }); if (typeof extendFn === 'function') { extendFn(Ctor, Parent); } Ctor.extend = extend(Ctor, extendFn); }; }; /** * Expose `extend` */ module.exports = extend; /***/ }), /* 457 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var typeOf = __webpack_require__(413); var copyDescriptor = __webpack_require__(458); var define = __webpack_require__(390); /** * Copy static properties, prototype properties, and descriptors from one object to another. * * ```js * function App() {} * var proto = App.prototype; * App.prototype.set = function() {}; * App.prototype.get = function() {}; * * var obj = {}; * copy(obj, proto); * ``` * @param {Object} `receiver` * @param {Object} `provider` * @param {String|Array} `omit` One or more properties to omit * @return {Object} * @api public */ function copy(receiver, provider, omit) { if (!isObject(receiver)) { throw new TypeError('expected receiving object to be an object.'); } if (!isObject(provider)) { throw new TypeError('expected providing object to be an object.'); } var props = nativeKeys(provider); var keys = Object.keys(provider); var len = props.length; omit = arrayify(omit); while (len--) { var key = props[len]; if (has(keys, key)) { define(receiver, key, provider[key]); } else if (!(key in receiver) && !has(omit, key)) { copyDescriptor(receiver, provider, key); } } }; /** * Return true if the given value is an object or function */ function isObject(val) { return typeOf(val) === 'object' || typeof val === 'function'; } /** * Returns true if an array has any of the given elements, or an * object has any of the give keys. * * ```js * has(['a', 'b', 'c'], 'c'); * //=> true * * has(['a', 'b', 'c'], ['c', 'z']); * //=> true * * has({a: 'b', c: 'd'}, ['c', 'z']); * //=> true * ``` * @param {Object} `obj` * @param {String|Array} `val` * @return {Boolean} */ function has(obj, val) { val = arrayify(val); var len = val.length; if (isObject(obj)) { for (var key in obj) { if (val.indexOf(key) > -1) { return true; } } var keys = nativeKeys(obj); return has(keys, val); } if (Array.isArray(obj)) { var arr = obj; while (len--) { if (arr.indexOf(val[len]) > -1) { return true; } } return false; } throw new TypeError('expected an array or object.'); } /** * Cast the given value to an array. * * ```js * arrayify('foo'); * //=> ['foo'] * * arrayify(['foo']); * //=> ['foo'] * ``` * * @param {String|Array} `val` * @return {Array} */ function arrayify(val) { return val ? (Array.isArray(val) ? val : [val]) : []; } /** * Returns true if a value has a `contructor` * * ```js * hasConstructor({}); * //=> true * * hasConstructor(Object.create(null)); * //=> false * ``` * @param {Object} `value` * @return {Boolean} */ function hasConstructor(val) { return isObject(val) && typeof val.constructor !== 'undefined'; } /** * Get the native `ownPropertyNames` from the constructor of the * given `object`. An empty array is returned if the object does * not have a constructor. * * ```js * nativeKeys({a: 'b', b: 'c', c: 'd'}) * //=> ['a', 'b', 'c'] * * nativeKeys(function(){}) * //=> ['length', 'caller'] * ``` * * @param {Object} `obj` Object that has a `constructor`. * @return {Array} Array of keys. */ function nativeKeys(val) { if (!hasConstructor(val)) return []; return Object.getOwnPropertyNames(val); } /** * Expose `copy` */ module.exports = copy; /** * Expose `copy.has` for tests */ module.exports.has = has; /***/ }), /* 458 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * copy-descriptor * * Copyright (c) 2015, Jon Schlinkert. * Licensed under the MIT License. */ /** * Copy a descriptor from one object to another. * * ```js * function App() { * this.cache = {}; * } * App.prototype.set = function(key, val) { * this.cache[key] = val; * return this; * }; * Object.defineProperty(App.prototype, 'count', { * get: function() { * return Object.keys(this.cache).length; * } * }); * * copy(App.prototype, 'count', 'len'); * * // create an instance * var app = new App(); * * app.set('a', true); * app.set('b', true); * app.set('c', true); * * console.log(app.count); * //=> 3 * console.log(app.len); * //=> 3 * ``` * @name copy * @param {Object} `receiver` The target object * @param {Object} `provider` The provider object * @param {String} `from` The key to copy on provider. * @param {String} `to` Optionally specify a new key name to use. * @return {Object} * @api public */ module.exports = function copyDescriptor(receiver, provider, from, to) { if (!isObject(provider) && typeof provider !== 'function') { to = from; from = provider; provider = receiver; } if (!isObject(receiver) && typeof receiver !== 'function') { throw new TypeError('expected the first argument to be an object'); } if (!isObject(provider) && typeof provider !== 'function') { throw new TypeError('expected provider to be an object'); } if (typeof to !== 'string') { to = from; } if (typeof from !== 'string') { throw new TypeError('expected key to be a string'); } if (!(from in provider)) { throw new Error('property "' + from + '" does not exist'); } var val = Object.getOwnPropertyDescriptor(provider, from); if (val) Object.defineProperty(receiver, to, val); }; function isObject(val) { return {}.toString.call(val) === '[object Object]'; } /***/ }), /* 459 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var use = __webpack_require__(460); var define = __webpack_require__(390); var debug = __webpack_require__(462)('snapdragon:compiler'); var utils = __webpack_require__(469); /** * Create a new `Compiler` with the given `options`. * @param {Object} `options` */ function Compiler(options, state) { debug('initializing', __filename); this.options = utils.extend({source: 'string'}, options); this.state = state || {}; this.compilers = {}; this.output = ''; this.set('eos', function(node) { return this.emit(node.val, node); }); this.set('noop', function(node) { return this.emit(node.val, node); }); this.set('bos', function(node) { return this.emit(node.val, node); }); use(this); } /** * Prototype methods */ Compiler.prototype = { /** * Throw an error message with details including the cursor position. * @param {String} `msg` Message to use in the Error. */ error: function(msg, node) { var pos = node.position || {start: {column: 0}}; var message = this.options.source + ' column:' + pos.start.column + ': ' + msg; var err = new Error(message); err.reason = msg; err.column = pos.start.column; err.source = this.pattern; if (this.options.silent) { this.errors.push(err); } else { throw err; } }, /** * Define a non-enumberable property on the `Compiler` instance. * * ```js * compiler.define('foo', 'bar'); * ``` * @name .define * @param {String} `key` propery name * @param {any} `val` property value * @return {Object} Returns the Compiler instance for chaining. * @api public */ define: function(key, val) { define(this, key, val); return this; }, /** * Emit `node.val` */ emit: function(str, node) { this.output += str; return str; }, /** * Add a compiler `fn` with the given `name` */ set: function(name, fn) { this.compilers[name] = fn; return this; }, /** * Get compiler `name`. */ get: function(name) { return this.compilers[name]; }, /** * Get the previous AST node. */ prev: function(n) { return this.ast.nodes[this.idx - (n || 1)] || { type: 'bos', val: '' }; }, /** * Get the next AST node. */ next: function(n) { return this.ast.nodes[this.idx + (n || 1)] || { type: 'eos', val: '' }; }, /** * Visit `node`. */ visit: function(node, nodes, i) { var fn = this.compilers[node.type]; this.idx = i; if (typeof fn !== 'function') { throw this.error('compiler "' + node.type + '" is not registered', node); } return fn.call(this, node, nodes, i); }, /** * Map visit over array of `nodes`. */ mapVisit: function(nodes) { if (!Array.isArray(nodes)) { throw new TypeError('expected an array'); } var len = nodes.length; var idx = -1; while (++idx < len) { this.visit(nodes[idx], nodes, idx); } return this; }, /** * Compile `ast`. */ compile: function(ast, options) { var opts = utils.extend({}, this.options, options); this.ast = ast; this.parsingErrors = this.ast.errors; this.output = ''; // source map support if (opts.sourcemap) { var sourcemaps = __webpack_require__(488); sourcemaps(this); this.mapVisit(this.ast.nodes); this.applySourceMaps(); this.map = opts.sourcemap === 'generator' ? this.map : this.map.toJSON(); return this; } this.mapVisit(this.ast.nodes); return this; } }; /** * Expose `Compiler` */ module.exports = Compiler; /***/ }), /* 460 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * use * * Copyright (c) 2015, 2017, Jon Schlinkert. * Released under the MIT License. */ var utils = __webpack_require__(461); module.exports = function base(app, opts) { if (!utils.isObject(app) && typeof app !== 'function') { throw new TypeError('use: expect `app` be an object or function'); } if (!utils.isObject(opts)) { opts = {}; } var prop = utils.isString(opts.prop) ? opts.prop : 'fns'; if (!Array.isArray(app[prop])) { utils.define(app, prop, []); } /** * Define a plugin function to be passed to use. The only * parameter exposed to the plugin is `app`, the object or function. * passed to `use(app)`. `app` is also exposed as `this` in plugins. * * Additionally, **if a plugin returns a function, the function will * be pushed onto the `fns` array**, allowing the plugin to be * called at a later point by the `run` method. * * ```js * var use = require('use'); * * // define a plugin * function foo(app) { * // do stuff * } * * var app = function(){}; * use(app); * * // register plugins * app.use(foo); * app.use(bar); * app.use(baz); * ``` * @name .use * @param {Function} `fn` plugin function to call * @api public */ utils.define(app, 'use', use); /** * Run all plugins on `fns`. Any plugin that returns a function * when called by `use` is pushed onto the `fns` array. * * ```js * var config = {}; * app.run(config); * ``` * @name .run * @param {Object} `value` Object to be modified by plugins. * @return {Object} Returns the object passed to `run` * @api public */ utils.define(app, 'run', function(val) { if (!utils.isObject(val)) return; decorate(val); var self = this || app; var fns = self[prop]; var len = fns.length; var idx = -1; while (++idx < len) { val.use(fns[idx]); } return val; }); /** * Call plugin `fn`. If a function is returned push it into the * `fns` array to be called by the `run` method. */ function use(fn, options) { if (typeof fn !== 'function') { throw new TypeError('.use expects `fn` be a function'); } var self = this || app; if (typeof opts.fn === 'function') { opts.fn.call(self, self, options); } var plugin = fn.call(self, self); if (typeof plugin === 'function') { var fns = self[prop]; fns.push(plugin); } return self; } /** * Ensure the `.use` method exists on `val` */ function decorate(val) { if (!val.use || !val.run) { base(val); } } return app; }; /***/ }), /* 461 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = {}; /** * Lazily required module dependencies */ utils.define = __webpack_require__(390); utils.isObject = __webpack_require__(408); utils.isString = function(val) { return val && typeof val === 'string'; }; /** * Expose `utils` modules */ module.exports = utils; /***/ }), /* 462 */ /***/ (function(module, exports, __webpack_require__) { /** * Detect Electron renderer process, which is node, but we should * treat as a browser. */ if (typeof process !== 'undefined' && process.type === 'renderer') { module.exports = __webpack_require__(463); } else { module.exports = __webpack_require__(466); } /***/ }), /* 463 */ /***/ (function(module, exports, __webpack_require__) { /** * This is the web browser implementation of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = __webpack_require__(464); exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage(); /** * Colors. */ exports.colors = [ 'lightseagreen', 'forestgreen', 'goldenrod', 'dodgerblue', 'darkorchid', 'crimson' ]; /** * 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 */ 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') { return true; } // 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+)/)); } /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ exports.formatters.j = function(v) { try { return JSON.stringify(v); } catch (err) { return '[UnexpectedJSONParseError]: ' + err.message; } }; /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { var useColors = this.useColors; args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff); if (!useColors) return; var 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 var index = 0; var lastC = 0; args[0].replace(/%[a-zA-Z%]/g, function(match) { if ('%%' === match) return; index++; if ('%c' === match) { // 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() { // this hackery is required for IE8/9, where // the `console.log` function doesn't have 'apply' return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (null == namespaces) { exports.storage.removeItem('debug'); } else { exports.storage.debug = namespaces; } } catch(e) {} } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { var r; try { r = exports.storage.debug; } catch(e) {} // 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; } /** * Enable namespaces listed in `localStorage.debug` initially. */ exports.enable(load()); /** * 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 { return window.localStorage; } catch (e) {} } /***/ }), /* 464 */ /***/ (function(module, exports, __webpack_require__) { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = createDebug.debug = createDebug['default'] = createDebug; exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; exports.humanize = __webpack_require__(465); /** * The currently active debug mode names, and names to skip. */ exports.names = []; exports.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". */ exports.formatters = {}; /** * Previous log timestamp. */ var prevTime; /** * Select a color. * @param {String} namespace * @return {Number} * @api private */ function selectColor(namespace) { var hash = 0, i; for (i in namespace) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return exports.colors[Math.abs(hash) % exports.colors.length]; } /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { function debug() { // disabled? if (!debug.enabled) return; var self = debug; // set `diff` timestamp var curr = +new Date(); var ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; // turn the `arguments` into a proper Array var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } args[0] = exports.coerce(args[0]); if ('string' !== typeof args[0]) { // anything else let's inspect with %O args.unshift('%O'); } // apply any `formatters` transformations var index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { // if we encounter an escaped % then don't increase the array index if (match === '%%') return match; index++; var formatter = exports.formatters[format]; if ('function' === typeof formatter) { var 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.) exports.formatArgs.call(self, args); var logFn = debug.log || exports.log || console.log.bind(console); logFn.apply(self, args); } debug.namespace = namespace; debug.enabled = exports.enabled(namespace); debug.useColors = exports.useColors(); debug.color = selectColor(namespace); // env-specific initialization logic for debug instances if ('function' === typeof exports.init) { exports.init(debug); } return debug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { exports.save(namespaces); exports.names = []; exports.skips = []; var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); var len = split.length; for (var i = 0; i < len; i++) { if (!split[i]) continue; // ignore empty strings namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); } else { exports.names.push(new RegExp('^' + namespaces + '$')); } } } /** * Disable debug output. * * @api public */ function disable() { exports.enable(''); } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { var i, len; for (i = 0, len = exports.skips.length; i < len; i++) { if (exports.skips[i].test(name)) { return false; } } for (i = 0, len = exports.names.length; i < len; i++) { if (exports.names[i].test(name)) { return true; } } return false; } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) return val.stack || val.message; return val; } /***/ }), /* 465 */ /***/ (function(module, exports) { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; 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' && isNaN(val) === false) { 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|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 '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) { if (ms >= d) { return Math.round(ms / d) + 'd'; } if (ms >= h) { return Math.round(ms / h) + 'h'; } if (ms >= m) { return Math.round(ms / m) + 'm'; } if (ms >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, n, name) { if (ms < n) { return; } if (ms < n * 1.5) { return Math.floor(ms / n) + ' ' + name; } return Math.ceil(ms / n) + ' ' + name + 's'; } /***/ }), /* 466 */ /***/ (function(module, exports, __webpack_require__) { /** * Module dependencies. */ var tty = __webpack_require__(467); var util = __webpack_require__(29); /** * This is the Node.js implementation of `debug()`. * * Expose `debug()` as the module. */ exports = module.exports = __webpack_require__(464); exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(function (key) { return /^debug_/i.test(key); }).reduce(function (obj, key) { // camel-case var prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() }); // coerce string value into JS value var val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) val = true; else if (/^(no|off|false|disabled)$/i.test(val)) val = false; else if (val === 'null') val = null; else val = Number(val); obj[prop] = val; return obj; }, {}); /** * The file descriptor to write the `debug()` calls to. * Set the `DEBUG_FD` env variable to override with another value. i.e.: * * $ DEBUG_FD=3 node script.js 3>debug.log */ var fd = parseInt(process.env.DEBUG_FD, 10) || 2; if (1 !== fd && 2 !== fd) { util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')() } var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(fd); } /** * Map %o to `util.inspect()`, all on a single line. */ exports.formatters.o = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .split('\n').map(function(str) { return str.trim() }).join(' '); }; /** * Map %o to `util.inspect()`, allowing multiple lines if needed. */ exports.formatters.O = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { var name = this.namespace; var useColors = this.useColors; if (useColors) { var c = this.color; var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); } else { args[0] = new Date().toUTCString() + ' ' + name + ' ' + args[0]; } } /** * Invokes `util.format()` with the specified arguments and writes to `stream`. */ function log() { return stream.write(util.format.apply(util, arguments) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (null == namespaces) { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } else { process.env.DEBUG = namespaces; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Copied from `node/src/node.js`. * * XXX: It's lame that node doesn't expose this API out-of-the-box. It also * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. */ function createWritableStdioStream (fd) { var stream; var tty_wrap = process.binding('tty_wrap'); // Note stream._type is used for test-module-load-list.js switch (tty_wrap.guessHandleType(fd)) { case 'TTY': stream = new tty.WriteStream(fd); stream._type = 'tty'; // Hack to have stream not keep the event loop alive. // See https://github.com/joyent/node/issues/1726 if (stream._handle && stream._handle.unref) { stream._handle.unref(); } break; case 'FILE': var fs = __webpack_require__(23); stream = new fs.SyncWriteStream(fd, { autoClose: false }); stream._type = 'fs'; break; case 'PIPE': case 'TCP': var net = __webpack_require__(468); stream = new net.Socket({ fd: fd, readable: false, writable: true }); // FIXME Should probably have an option in net.Socket to create a // stream from an existing fd which is writable only. But for now // we'll just add this hack and set the `readable` member to false. // Test: ./node test/fixtures/echo.js < /etc/passwd stream.readable = false; stream.read = null; stream._type = 'pipe'; // FIXME Hack to have stream not keep the event loop alive. // See https://github.com/joyent/node/issues/1726 if (stream._handle && stream._handle.unref) { stream._handle.unref(); } break; default: // Probably an error on in uv_guess_handle() throw new Error('Implement me. Unknown stream file type!'); } // For supporting legacy API we put the FD here. stream.fd = fd; stream._isStdio = true; return stream; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init (debug) { debug.inspectOpts = {}; var keys = Object.keys(exports.inspectOpts); for (var i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } /** * Enable namespaces listed in `process.env.DEBUG` initially. */ exports.enable(load()); /***/ }), /* 467 */ /***/ (function(module, exports) { module.exports = require("tty"); /***/ }), /* 468 */ /***/ (function(module, exports) { module.exports = require("net"); /***/ }), /* 469 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Module dependencies */ exports.extend = __webpack_require__(398); exports.SourceMap = __webpack_require__(470); exports.sourceMapResolve = __webpack_require__(481); /** * Convert backslash in the given string to forward slashes */ exports.unixify = function(fp) { return fp.split(/\\+/).join('/'); }; /** * Return true if `val` is a non-empty string * * @param {String} `str` * @return {Boolean} */ exports.isString = function(str) { return str && typeof str === 'string'; }; /** * Cast `val` to an array * @return {Array} */ exports.arrayify = function(val) { if (typeof val === 'string') return [val]; return val ? (Array.isArray(val) ? val : [val]) : []; }; /** * Get the last `n` element from the given `array` * @param {Array} `array` * @return {*} */ exports.last = function(arr, n) { return arr[arr.length - (n || 1)]; }; /***/ }), /* 470 */ /***/ (function(module, exports, __webpack_require__) { /* * Copyright 2009-2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE.txt or: * http://opensource.org/licenses/BSD-3-Clause */ exports.SourceMapGenerator = __webpack_require__(471).SourceMapGenerator; exports.SourceMapConsumer = __webpack_require__(477).SourceMapConsumer; exports.SourceNode = __webpack_require__(480).SourceNode; /***/ }), /* 471 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var base64VLQ = __webpack_require__(472); var util = __webpack_require__(474); var ArraySet = __webpack_require__(475).ArraySet; var MappingList = __webpack_require__(476).MappingList; /** * An instance of the SourceMapGenerator represents a source map which is * being built incrementally. You may pass an object with the following * properties: * * - file: The filename of the generated source. * - sourceRoot: A root for all relative URLs in this source map. */ function SourceMapGenerator(aArgs) { if (!aArgs) { aArgs = {}; } this._file = util.getArg(aArgs, 'file', null); this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); this._skipValidation = util.getArg(aArgs, 'skipValidation', false); this._sources = new ArraySet(); this._names = new ArraySet(); this._mappings = new MappingList(); this._sourcesContents = null; } SourceMapGenerator.prototype._version = 3; /** * Creates a new SourceMapGenerator based on a SourceMapConsumer * * @param aSourceMapConsumer The SourceMap. */ SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { var sourceRoot = aSourceMapConsumer.sourceRoot; var generator = new SourceMapGenerator({ file: aSourceMapConsumer.file, sourceRoot: sourceRoot }); aSourceMapConsumer.eachMapping(function (mapping) { var newMapping = { generated: { line: mapping.generatedLine, column: mapping.generatedColumn } }; if (mapping.source != null) { newMapping.source = mapping.source; if (sourceRoot != null) { newMapping.source = util.relative(sourceRoot, newMapping.source); } newMapping.original = { line: mapping.originalLine, column: mapping.originalColumn }; if (mapping.name != null) { newMapping.name = mapping.name; } } generator.addMapping(newMapping); }); aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { generator.setSourceContent(sourceFile, content); } }); return generator; }; /** * Add a single mapping from original source line and column to the generated * source's line and column for this source map being created. The mapping * object should have the following properties: * * - generated: An object with the generated line and column positions. * - original: An object with the original line and column positions. * - source: The original source file (relative to the sourceRoot). * - name: An optional original token name for this mapping. */ SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) { var generated = util.getArg(aArgs, 'generated'); var original = util.getArg(aArgs, 'original', null); var source = util.getArg(aArgs, 'source', null); var name = util.getArg(aArgs, 'name', null); if (!this._skipValidation) { this._validateMapping(generated, original, source, name); } if (source != null) { source = String(source); if (!this._sources.has(source)) { this._sources.add(source); } } if (name != null) { name = String(name); if (!this._names.has(name)) { this._names.add(name); } } this._mappings.add({ generatedLine: generated.line, generatedColumn: generated.column, originalLine: original != null && original.line, originalColumn: original != null && original.column, source: source, name: name }); }; /** * Set the source content for a source file. */ SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { var source = aSourceFile; if (this._sourceRoot != null) { source = util.relative(this._sourceRoot, source); } if (aSourceContent != null) { // Add the source content to the _sourcesContents map. // Create a new _sourcesContents map if the property is null. if (!this._sourcesContents) { this._sourcesContents = Object.create(null); } this._sourcesContents[util.toSetString(source)] = aSourceContent; } else if (this._sourcesContents) { // Remove the source file from the _sourcesContents map. // If the _sourcesContents map is empty, set the property to null. delete this._sourcesContents[util.toSetString(source)]; if (Object.keys(this._sourcesContents).length === 0) { this._sourcesContents = null; } } }; /** * Applies the mappings of a sub-source-map for a specific source file to the * source map being generated. Each mapping to the supplied source file is * rewritten using the supplied source map. Note: The resolution for the * resulting mappings is the minimium of this map and the supplied map. * * @param aSourceMapConsumer The source map to be applied. * @param aSourceFile Optional. The filename of the source file. * If omitted, SourceMapConsumer's file property will be used. * @param aSourceMapPath Optional. The dirname of the path to the source map * to be applied. If relative, it is relative to the SourceMapConsumer. * This parameter is needed when the two source maps aren't in the same * directory, and the source map to be applied contains relative source * paths. If so, those relative source paths need to be rewritten * relative to the SourceMapGenerator. */ SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { var sourceFile = aSourceFile; // If aSourceFile is omitted, we will use the file property of the SourceMap if (aSourceFile == null) { if (aSourceMapConsumer.file == null) { throw new Error( 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + 'or the source map\'s "file" property. Both were omitted.' ); } sourceFile = aSourceMapConsumer.file; } var sourceRoot = this._sourceRoot; // Make "sourceFile" relative if an absolute Url is passed. if (sourceRoot != null) { sourceFile = util.relative(sourceRoot, sourceFile); } // Applying the SourceMap can add and remove items from the sources and // the names array. var newSources = new ArraySet(); var newNames = new ArraySet(); // Find mappings for the "sourceFile" this._mappings.unsortedForEach(function (mapping) { if (mapping.source === sourceFile && mapping.originalLine != null) { // Check if it can be mapped by the source map, then update the mapping. var original = aSourceMapConsumer.originalPositionFor({ line: mapping.originalLine, column: mapping.originalColumn }); if (original.source != null) { // Copy mapping mapping.source = original.source; if (aSourceMapPath != null) { mapping.source = util.join(aSourceMapPath, mapping.source) } if (sourceRoot != null) { mapping.source = util.relative(sourceRoot, mapping.source); } mapping.originalLine = original.line; mapping.originalColumn = original.column; if (original.name != null) { mapping.name = original.name; } } } var source = mapping.source; if (source != null && !newSources.has(source)) { newSources.add(source); } var name = mapping.name; if (name != null && !newNames.has(name)) { newNames.add(name); } }, this); this._sources = newSources; this._names = newNames; // Copy sourcesContents of applied map. aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { if (aSourceMapPath != null) { sourceFile = util.join(aSourceMapPath, sourceFile); } if (sourceRoot != null) { sourceFile = util.relative(sourceRoot, sourceFile); } this.setSourceContent(sourceFile, content); } }, this); }; /** * A mapping can have one of the three levels of data: * * 1. Just the generated position. * 2. The Generated position, original position, and original source. * 3. Generated and original position, original source, as well as a name * token. * * To maintain consistency, we validate that any new mapping being added falls * in to one of these categories. */ SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) { // When aOriginal is truthy but has empty values for .line and .column, // it is most likely a programmer error. In this case we throw a very // specific error message to try to guide them the right way. // For example: https://github.com/Polymer/polymer-bundler/pull/519 if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') { throw new Error( 'original.line and original.column are not numbers -- you probably meant to omit ' + 'the original mapping entirely and only map the generated position. If so, pass ' + 'null for the original mapping instead of an object with empty or null values.' ); } if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) { // Case 1. return; } else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) { // Cases 2 and 3. return; } else { throw new Error('Invalid mapping: ' + JSON.stringify({ generated: aGenerated, source: aSource, original: aOriginal, name: aName })); } }; /** * Serialize the accumulated mappings in to the stream of base 64 VLQs * specified by the source map format. */ SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() { var previousGeneratedColumn = 0; var previousGeneratedLine = 1; var previousOriginalColumn = 0; var previousOriginalLine = 0; var previousName = 0; var previousSource = 0; var result = ''; var next; var mapping; var nameIdx; var sourceIdx; var mappings = this._mappings.toArray(); for (var i = 0, len = mappings.length; i < len; i++) { mapping = mappings[i]; next = '' if (mapping.generatedLine !== previousGeneratedLine) { previousGeneratedColumn = 0; while (mapping.generatedLine !== previousGeneratedLine) { next += ';'; previousGeneratedLine++; } } else { if (i > 0) { if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { continue; } next += ','; } } next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn); previousGeneratedColumn = mapping.generatedColumn; if (mapping.source != null) { sourceIdx = this._sources.indexOf(mapping.source); next += base64VLQ.encode(sourceIdx - previousSource); previousSource = sourceIdx; // lines are stored 0-based in SourceMap spec version 3 next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine); previousOriginalLine = mapping.originalLine - 1; next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn); previousOriginalColumn = mapping.originalColumn; if (mapping.name != null) { nameIdx = this._names.indexOf(mapping.name); next += base64VLQ.encode(nameIdx - previousName); previousName = nameIdx; } } result += next; } return result; }; SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { return aSources.map(function (source) { if (!this._sourcesContents) { return null; } if (aSourceRoot != null) { source = util.relative(aSourceRoot, source); } var key = util.toSetString(source); return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; }, this); }; /** * Externalize the source map. */ SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() { var map = { version: this._version, sources: this._sources.toArray(), names: this._names.toArray(), mappings: this._serializeMappings() }; if (this._file != null) { map.file = this._file; } if (this._sourceRoot != null) { map.sourceRoot = this._sourceRoot; } if (this._sourcesContents) { map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); } return map; }; /** * Render the source map being generated to a string. */ SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() { return JSON.stringify(this.toJSON()); }; exports.SourceMapGenerator = SourceMapGenerator; /***/ }), /* 472 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause * * Based on the Base 64 VLQ implementation in Closure Compiler: * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java * * Copyright 2011 The Closure Compiler Authors. All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ var base64 = __webpack_require__(473); // A single base 64 digit can contain 6 bits of data. For the base 64 variable // length quantities we use in the source map spec, the first bit is the sign, // the next four bits are the actual value, and the 6th bit is the // continuation bit. The continuation bit tells us whether there are more // digits in this value following this digit. // // Continuation // | Sign // | | // V V // 101011 var VLQ_BASE_SHIFT = 5; // binary: 100000 var VLQ_BASE = 1 << VLQ_BASE_SHIFT; // binary: 011111 var VLQ_BASE_MASK = VLQ_BASE - 1; // binary: 100000 var VLQ_CONTINUATION_BIT = VLQ_BASE; /** * Converts from a two-complement value to a value where the sign bit is * placed in the least significant bit. For example, as decimals: * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) */ function toVLQSigned(aValue) { return aValue < 0 ? ((-aValue) << 1) + 1 : (aValue << 1) + 0; } /** * Converts to a two-complement value from a value where the sign bit is * placed in the least significant bit. For example, as decimals: * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 */ function fromVLQSigned(aValue) { var isNegative = (aValue & 1) === 1; var shifted = aValue >> 1; return isNegative ? -shifted : shifted; } /** * Returns the base 64 VLQ encoded value. */ exports.encode = function base64VLQ_encode(aValue) { var encoded = ""; var digit; var vlq = toVLQSigned(aValue); do { digit = vlq & VLQ_BASE_MASK; vlq >>>= VLQ_BASE_SHIFT; if (vlq > 0) { // There are still more digits in this value, so we must make sure the // continuation bit is marked. digit |= VLQ_CONTINUATION_BIT; } encoded += base64.encode(digit); } while (vlq > 0); return encoded; }; /** * Decodes the next base 64 VLQ value from the given string and returns the * value and the rest of the string via the out parameter. */ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { var strLen = aStr.length; var result = 0; var shift = 0; var continuation, digit; do { if (aIndex >= strLen) { throw new Error("Expected more digits in base 64 VLQ value."); } digit = base64.decode(aStr.charCodeAt(aIndex++)); if (digit === -1) { throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); } continuation = !!(digit & VLQ_CONTINUATION_BIT); digit &= VLQ_BASE_MASK; result = result + (digit << shift); shift += VLQ_BASE_SHIFT; } while (continuation); aOutParam.value = fromVLQSigned(result); aOutParam.rest = aIndex; }; /***/ }), /* 473 */ /***/ (function(module, exports) { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); /** * Encode an integer in the range of 0 to 63 to a single base 64 digit. */ exports.encode = function (number) { if (0 <= number && number < intToCharMap.length) { return intToCharMap[number]; } throw new TypeError("Must be between 0 and 63: " + number); }; /** * Decode a single base 64 character code digit to an integer. Returns -1 on * failure. */ exports.decode = function (charCode) { var bigA = 65; // 'A' var bigZ = 90; // 'Z' var littleA = 97; // 'a' var littleZ = 122; // 'z' var zero = 48; // '0' var nine = 57; // '9' var plus = 43; // '+' var slash = 47; // '/' var littleOffset = 26; var numberOffset = 52; // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ if (bigA <= charCode && charCode <= bigZ) { return (charCode - bigA); } // 26 - 51: abcdefghijklmnopqrstuvwxyz if (littleA <= charCode && charCode <= littleZ) { return (charCode - littleA + littleOffset); } // 52 - 61: 0123456789 if (zero <= charCode && charCode <= nine) { return (charCode - zero + numberOffset); } // 62: + if (charCode == plus) { return 62; } // 63: / if (charCode == slash) { return 63; } // Invalid base64 digit. return -1; }; /***/ }), /* 474 */ /***/ (function(module, exports) { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ /** * This is a helper function for getting values from parameter/options * objects. * * @param args The object we are extracting values from * @param name The name of the property we are getting. * @param defaultValue An optional value to return if the property is missing * from the object. If this is not specified and the property is missing, an * error will be thrown. */ function getArg(aArgs, aName, aDefaultValue) { if (aName in aArgs) { return aArgs[aName]; } else if (arguments.length === 3) { return aDefaultValue; } else { throw new Error('"' + aName + '" is a required argument.'); } } exports.getArg = getArg; var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/; var dataUrlRegexp = /^data:.+\,.+$/; function urlParse(aUrl) { var match = aUrl.match(urlRegexp); if (!match) { return null; } return { scheme: match[1], auth: match[2], host: match[3], port: match[4], path: match[5] }; } exports.urlParse = urlParse; function urlGenerate(aParsedUrl) { var url = ''; if (aParsedUrl.scheme) { url += aParsedUrl.scheme + ':'; } url += '//'; if (aParsedUrl.auth) { url += aParsedUrl.auth + '@'; } if (aParsedUrl.host) { url += aParsedUrl.host; } if (aParsedUrl.port) { url += ":" + aParsedUrl.port } if (aParsedUrl.path) { url += aParsedUrl.path; } return url; } exports.urlGenerate = urlGenerate; /** * Normalizes a path, or the path portion of a URL: * * - Replaces consecutive slashes with one slash. * - Removes unnecessary '.' parts. * - Removes unnecessary '/..' parts. * * Based on code in the Node.js 'path' core module. * * @param aPath The path or url to normalize. */ function normalize(aPath) { var path = aPath; var url = urlParse(aPath); if (url) { if (!url.path) { return aPath; } path = url.path; } var isAbsolute = exports.isAbsolute(path); var parts = path.split(/\/+/); for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { part = parts[i]; if (part === '.') { parts.splice(i, 1); } else if (part === '..') { up++; } else if (up > 0) { if (part === '') { // The first part is blank if the path is absolute. Trying to go // above the root is a no-op. Therefore we can remove all '..' parts // directly after the root. parts.splice(i + 1, up); up = 0; } else { parts.splice(i, 2); up--; } } } path = parts.join('/'); if (path === '') { path = isAbsolute ? '/' : '.'; } if (url) { url.path = path; return urlGenerate(url); } return path; } exports.normalize = normalize; /** * Joins two paths/URLs. * * @param aRoot The root path or URL. * @param aPath The path or URL to be joined with the root. * * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a * scheme-relative URL: Then the scheme of aRoot, if any, is prepended * first. * - Otherwise aPath is a path. If aRoot is a URL, then its path portion * is updated with the result and aRoot is returned. Otherwise the result * is returned. * - If aPath is absolute, the result is aPath. * - Otherwise the two paths are joined with a slash. * - Joining for example 'http://' and 'www.example.com' is also supported. */ function join(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } if (aPath === "") { aPath = "."; } var aPathUrl = urlParse(aPath); var aRootUrl = urlParse(aRoot); if (aRootUrl) { aRoot = aRootUrl.path || '/'; } // `join(foo, '//www.example.org')` if (aPathUrl && !aPathUrl.scheme) { if (aRootUrl) { aPathUrl.scheme = aRootUrl.scheme; } return urlGenerate(aPathUrl); } if (aPathUrl || aPath.match(dataUrlRegexp)) { return aPath; } // `join('http://', 'www.example.com')` if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { aRootUrl.host = aPath; return urlGenerate(aRootUrl); } var joined = aPath.charAt(0) === '/' ? aPath : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); if (aRootUrl) { aRootUrl.path = joined; return urlGenerate(aRootUrl); } return joined; } exports.join = join; exports.isAbsolute = function (aPath) { return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp); }; /** * Make a path relative to a URL or another path. * * @param aRoot The root path or URL. * @param aPath The path or URL to be made relative to aRoot. */ function relative(aRoot, aPath) { if (aRoot === "") { aRoot = "."; } aRoot = aRoot.replace(/\/$/, ''); // It is possible for the path to be above the root. In this case, simply // checking whether the root is a prefix of the path won't work. Instead, we // need to remove components from the root one by one, until either we find // a prefix that fits, or we run out of components to remove. var level = 0; while (aPath.indexOf(aRoot + '/') !== 0) { var index = aRoot.lastIndexOf("/"); if (index < 0) { return aPath; } // If the only part of the root that is left is the scheme (i.e. http://, // file:///, etc.), one or more slashes (/), or simply nothing at all, we // have exhausted all components, so the path is not relative to the root. aRoot = aRoot.slice(0, index); if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { return aPath; } ++level; } // Make sure we add a "../" for each component we removed from the root. return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); } exports.relative = relative; var supportsNullProto = (function () { var obj = Object.create(null); return !('__proto__' in obj); }()); function identity (s) { return s; } /** * Because behavior goes wacky when you set `__proto__` on objects, we * have to prefix all the strings in our set with an arbitrary character. * * See https://github.com/mozilla/source-map/pull/31 and * https://github.com/mozilla/source-map/issues/30 * * @param String aStr */ function toSetString(aStr) { if (isProtoString(aStr)) { return '$' + aStr; } return aStr; } exports.toSetString = supportsNullProto ? identity : toSetString; function fromSetString(aStr) { if (isProtoString(aStr)) { return aStr.slice(1); } return aStr; } exports.fromSetString = supportsNullProto ? identity : fromSetString; function isProtoString(s) { if (!s) { return false; } var length = s.length; if (length < 9 /* "__proto__".length */) { return false; } if (s.charCodeAt(length - 1) !== 95 /* '_' */ || s.charCodeAt(length - 2) !== 95 /* '_' */ || s.charCodeAt(length - 3) !== 111 /* 'o' */ || s.charCodeAt(length - 4) !== 116 /* 't' */ || s.charCodeAt(length - 5) !== 111 /* 'o' */ || s.charCodeAt(length - 6) !== 114 /* 'r' */ || s.charCodeAt(length - 7) !== 112 /* 'p' */ || s.charCodeAt(length - 8) !== 95 /* '_' */ || s.charCodeAt(length - 9) !== 95 /* '_' */) { return false; } for (var i = length - 10; i >= 0; i--) { if (s.charCodeAt(i) !== 36 /* '$' */) { return false; } } return true; } /** * Comparator between two mappings where the original positions are compared. * * Optionally pass in `true` as `onlyCompareGenerated` to consider two * mappings with the same original source/line/column, but different generated * line and column the same. Useful when searching for a mapping with a * stubbed out mapping. */ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { var cmp = mappingA.source - mappingB.source; if (cmp !== 0) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0 || onlyCompareOriginal) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0) { return cmp; } cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } return mappingA.name - mappingB.name; } exports.compareByOriginalPositions = compareByOriginalPositions; /** * Comparator between two mappings with deflated source and name indices where * the generated positions are compared. * * Optionally pass in `true` as `onlyCompareGenerated` to consider two * mappings with the same generated line and column, but different * source/name/original line and column the same. Useful when searching for a * mapping with a stubbed out mapping. */ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { var cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0 || onlyCompareGenerated) { return cmp; } cmp = mappingA.source - mappingB.source; if (cmp !== 0) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0) { return cmp; } return mappingA.name - mappingB.name; } exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; function strcmp(aStr1, aStr2) { if (aStr1 === aStr2) { return 0; } if (aStr1 > aStr2) { return 1; } return -1; } /** * Comparator between two mappings with inflated source and name strings where * the generated positions are compared. */ function compareByGeneratedPositionsInflated(mappingA, mappingB) { var cmp = mappingA.generatedLine - mappingB.generatedLine; if (cmp !== 0) { return cmp; } cmp = mappingA.generatedColumn - mappingB.generatedColumn; if (cmp !== 0) { return cmp; } cmp = strcmp(mappingA.source, mappingB.source); if (cmp !== 0) { return cmp; } cmp = mappingA.originalLine - mappingB.originalLine; if (cmp !== 0) { return cmp; } cmp = mappingA.originalColumn - mappingB.originalColumn; if (cmp !== 0) { return cmp; } return strcmp(mappingA.name, mappingB.name); } exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; /***/ }), /* 475 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var util = __webpack_require__(474); var has = Object.prototype.hasOwnProperty; var hasNativeMap = typeof Map !== "undefined"; /** * A data structure which is a combination of an array and a set. Adding a new * member is O(1), testing for membership is O(1), and finding the index of an * element is O(1). Removing elements from the set is not supported. Only * strings are supported for membership. */ function ArraySet() { this._array = []; this._set = hasNativeMap ? new Map() : Object.create(null); } /** * Static method for creating ArraySet instances from an existing array. */ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { var set = new ArraySet(); for (var i = 0, len = aArray.length; i < len; i++) { set.add(aArray[i], aAllowDuplicates); } return set; }; /** * Return how many unique items are in this ArraySet. If duplicates have been * added, than those do not count towards the size. * * @returns Number */ ArraySet.prototype.size = function ArraySet_size() { return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; }; /** * Add the given string to this set. * * @param String aStr */ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { var sStr = hasNativeMap ? aStr : util.toSetString(aStr); var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); var idx = this._array.length; if (!isDuplicate || aAllowDuplicates) { this._array.push(aStr); } if (!isDuplicate) { if (hasNativeMap) { this._set.set(aStr, idx); } else { this._set[sStr] = idx; } } }; /** * Is the given string a member of this set? * * @param String aStr */ ArraySet.prototype.has = function ArraySet_has(aStr) { if (hasNativeMap) { return this._set.has(aStr); } else { var sStr = util.toSetString(aStr); return has.call(this._set, sStr); } }; /** * What is the index of the given string in the array? * * @param String aStr */ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { if (hasNativeMap) { var idx = this._set.get(aStr); if (idx >= 0) { return idx; } } else { var sStr = util.toSetString(aStr); if (has.call(this._set, sStr)) { return this._set[sStr]; } } throw new Error('"' + aStr + '" is not in the set.'); }; /** * What is the element at the given index? * * @param Number aIdx */ ArraySet.prototype.at = function ArraySet_at(aIdx) { if (aIdx >= 0 && aIdx < this._array.length) { return this._array[aIdx]; } throw new Error('No element indexed by ' + aIdx); }; /** * Returns the array representation of this set (which has the proper indices * indicated by indexOf). Note that this is a copy of the internal array used * for storing the members so that no one can mess with internal state. */ ArraySet.prototype.toArray = function ArraySet_toArray() { return this._array.slice(); }; exports.ArraySet = ArraySet; /***/ }), /* 476 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2014 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var util = __webpack_require__(474); /** * Determine whether mappingB is after mappingA with respect to generated * position. */ function generatedPositionAfter(mappingA, mappingB) { // Optimized for most common case var lineA = mappingA.generatedLine; var lineB = mappingB.generatedLine; var columnA = mappingA.generatedColumn; var columnB = mappingB.generatedColumn; return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; } /** * A data structure to provide a sorted view of accumulated mappings in a * performance conscious manner. It trades a neglibable overhead in general * case for a large speedup in case of mappings being added in order. */ function MappingList() { this._array = []; this._sorted = true; // Serves as infimum this._last = {generatedLine: -1, generatedColumn: 0}; } /** * Iterate through internal items. This method takes the same arguments that * `Array.prototype.forEach` takes. * * NOTE: The order of the mappings is NOT guaranteed. */ MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) { this._array.forEach(aCallback, aThisArg); }; /** * Add the given source mapping. * * @param Object aMapping */ MappingList.prototype.add = function MappingList_add(aMapping) { if (generatedPositionAfter(this._last, aMapping)) { this._last = aMapping; this._array.push(aMapping); } else { this._sorted = false; this._array.push(aMapping); } }; /** * Returns the flat, sorted array of mappings. The mappings are sorted by * generated position. * * WARNING: This method returns internal data without copying, for * performance. The return value must NOT be mutated, and should be treated as * an immutable borrow. If you want to take ownership, you must make your own * copy. */ MappingList.prototype.toArray = function MappingList_toArray() { if (!this._sorted) { this._array.sort(util.compareByGeneratedPositionsInflated); this._sorted = true; } return this._array; }; exports.MappingList = MappingList; /***/ }), /* 477 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var util = __webpack_require__(474); var binarySearch = __webpack_require__(478); var ArraySet = __webpack_require__(475).ArraySet; var base64VLQ = __webpack_require__(472); var quickSort = __webpack_require__(479).quickSort; function SourceMapConsumer(aSourceMap) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); } return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap) : new BasicSourceMapConsumer(sourceMap); } SourceMapConsumer.fromSourceMap = function(aSourceMap) { return BasicSourceMapConsumer.fromSourceMap(aSourceMap); } /** * The version of the source mapping spec that we are consuming. */ SourceMapConsumer.prototype._version = 3; // `__generatedMappings` and `__originalMappings` are arrays that hold the // parsed mapping coordinates from the source map's "mappings" attribute. They // are lazily instantiated, accessed via the `_generatedMappings` and // `_originalMappings` getters respectively, and we only parse the mappings // and create these arrays once queried for a source location. We jump through // these hoops because there can be many thousands of mappings, and parsing // them is expensive, so we only want to do it if we must. // // Each object in the arrays is of the form: // // { // generatedLine: The line number in the generated code, // generatedColumn: The column number in the generated code, // source: The path to the original source file that generated this // chunk of code, // originalLine: The line number in the original source that // corresponds to this chunk of generated code, // originalColumn: The column number in the original source that // corresponds to this chunk of generated code, // name: The name of the original symbol which generated this chunk of // code. // } // // All properties except for `generatedLine` and `generatedColumn` can be // `null`. // // `_generatedMappings` is ordered by the generated positions. // // `_originalMappings` is ordered by the original positions. SourceMapConsumer.prototype.__generatedMappings = null; Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { get: function () { if (!this.__generatedMappings) { this._parseMappings(this._mappings, this.sourceRoot); } return this.__generatedMappings; } }); SourceMapConsumer.prototype.__originalMappings = null; Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { get: function () { if (!this.__originalMappings) { this._parseMappings(this._mappings, this.sourceRoot); } return this.__originalMappings; } }); SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) { var c = aStr.charAt(index); return c === ";" || c === ","; }; /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { throw new Error("Subclasses must implement _parseMappings"); }; SourceMapConsumer.GENERATED_ORDER = 1; SourceMapConsumer.ORIGINAL_ORDER = 2; SourceMapConsumer.GREATEST_LOWER_BOUND = 1; SourceMapConsumer.LEAST_UPPER_BOUND = 2; /** * Iterate over each mapping between an original source/line/column and a * generated line/column in this source map. * * @param Function aCallback * The function that is called with each mapping. * @param Object aContext * Optional. If specified, this object will be the value of `this` every * time that `aCallback` is called. * @param aOrder * Either `SourceMapConsumer.GENERATED_ORDER` or * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to * iterate over the mappings sorted by the generated file's line/column * order or the original's source/line/column order, respectively. Defaults to * `SourceMapConsumer.GENERATED_ORDER`. */ SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { var context = aContext || null; var order = aOrder || SourceMapConsumer.GENERATED_ORDER; var mappings; switch (order) { case SourceMapConsumer.GENERATED_ORDER: mappings = this._generatedMappings; break; case SourceMapConsumer.ORIGINAL_ORDER: mappings = this._originalMappings; break; default: throw new Error("Unknown order of iteration."); } var sourceRoot = this.sourceRoot; mappings.map(function (mapping) { var source = mapping.source === null ? null : this._sources.at(mapping.source); if (source != null && sourceRoot != null) { source = util.join(sourceRoot, source); } return { source: source, generatedLine: mapping.generatedLine, generatedColumn: mapping.generatedColumn, originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name: mapping.name === null ? null : this._names.at(mapping.name) }; }, this).forEach(aCallback, context); }; /** * Returns all generated line and column information for the original source, * line, and column provided. If no column is provided, returns all mappings * corresponding to a either the line we are searching for or the next * closest line that has any mappings. Otherwise, returns all mappings * corresponding to the given line and either the column we are searching for * or the next closest column that has any offsets. * * The only argument is an object with the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. * - column: Optional. the column number in the original source. * * and an array of objects is returned, each with the following properties: * * - line: The line number in the generated source, or null. * - column: The column number in the generated source, or null. */ SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { var line = util.getArg(aArgs, 'line'); // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping // returns the index of the closest mapping less than the needle. By // setting needle.originalColumn to 0, we thus find the last mapping for // the given line, provided such a mapping exists. var needle = { source: util.getArg(aArgs, 'source'), originalLine: line, originalColumn: util.getArg(aArgs, 'column', 0) }; if (this.sourceRoot != null) { needle.source = util.relative(this.sourceRoot, needle.source); } if (!this._sources.has(needle.source)) { return []; } needle.source = this._sources.indexOf(needle.source); var mappings = []; var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND); if (index >= 0) { var mapping = this._originalMappings[index]; if (aArgs.column === undefined) { var originalLine = mapping.originalLine; // Iterate until either we run out of mappings, or we run into // a mapping for a different line than the one we found. Since // mappings are sorted, this is guaranteed to find all mappings for // the line we found. while (mapping && mapping.originalLine === originalLine) { mappings.push({ line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null), lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }); mapping = this._originalMappings[++index]; } } else { var originalColumn = mapping.originalColumn; // Iterate until either we run out of mappings, or we run into // a mapping for a different line than the one we were searching for. // Since mappings are sorted, this is guaranteed to find all mappings for // the line we are searching for. while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) { mappings.push({ line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null), lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }); mapping = this._originalMappings[++index]; } } } return mappings; }; exports.SourceMapConsumer = SourceMapConsumer; /** * A BasicSourceMapConsumer instance represents a parsed source map which we can * query for information about the original file positions by giving it a file * position in the generated source. * * The only parameter is the raw source map (either as a JSON string, or * already parsed to an object). According to the spec, source maps have the * following attributes: * * - version: Which version of the source map spec this map is following. * - sources: An array of URLs to the original source files. * - names: An array of identifiers which can be referrenced by individual mappings. * - sourceRoot: Optional. The URL root from which all sources are relative. * - sourcesContent: Optional. An array of contents of the original source files. * - mappings: A string of base64 VLQs which contain the actual mappings. * - file: Optional. The generated file this source map is associated with. * * Here is an example source map, taken from the source map spec[0]: * * { * version : 3, * file: "out.js", * sourceRoot : "", * sources: ["foo.js", "bar.js"], * names: ["src", "maps", "are", "fun"], * mappings: "AA,AB;;ABCDE;" * } * * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# */ function BasicSourceMapConsumer(aSourceMap) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); } var version = util.getArg(sourceMap, 'version'); var sources = util.getArg(sourceMap, 'sources'); // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which // requires the array) to play nice here. var names = util.getArg(sourceMap, 'names', []); var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); var mappings = util.getArg(sourceMap, 'mappings'); var file = util.getArg(sourceMap, 'file', null); // Once again, Sass deviates from the spec and supplies the version as a // string rather than a number, so we use loose equality checking here. if (version != this._version) { throw new Error('Unsupported version: ' + version); } sources = sources .map(String) // Some source maps produce relative source paths like "./foo.js" instead of // "foo.js". Normalize these first so that future comparisons will succeed. // See bugzil.la/1090768. .map(util.normalize) // Always ensure that absolute sources are internally stored relative to // the source root, if the source root is absolute. Not doing this would // be particularly problematic when the source root is a prefix of the // source (valid, but why??). See github issue #199 and bugzil.la/1188982. .map(function (source) { return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source; }); // Pass `true` below to allow duplicate names and sources. While source maps // are intended to be compressed and deduplicated, the TypeScript compiler // sometimes generates source maps with duplicates in them. See Github issue // #72 and bugzil.la/889492. this._names = ArraySet.fromArray(names.map(String), true); this._sources = ArraySet.fromArray(sources, true); this.sourceRoot = sourceRoot; this.sourcesContent = sourcesContent; this._mappings = mappings; this.file = file; } BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; /** * Create a BasicSourceMapConsumer from a SourceMapGenerator. * * @param SourceMapGenerator aSourceMap * The source map that will be consumed. * @returns BasicSourceMapConsumer */ BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap) { var smc = Object.create(BasicSourceMapConsumer.prototype); var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); smc.sourceRoot = aSourceMap._sourceRoot; smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot); smc.file = aSourceMap._file; // Because we are modifying the entries (by converting string sources and // names to indices into the sources and names ArraySets), we have to make // a copy of the entry or else bad things happen. Shared mutable state // strikes again! See github issue #191. var generatedMappings = aSourceMap._mappings.toArray().slice(); var destGeneratedMappings = smc.__generatedMappings = []; var destOriginalMappings = smc.__originalMappings = []; for (var i = 0, length = generatedMappings.length; i < length; i++) { var srcMapping = generatedMappings[i]; var destMapping = new Mapping; destMapping.generatedLine = srcMapping.generatedLine; destMapping.generatedColumn = srcMapping.generatedColumn; if (srcMapping.source) { destMapping.source = sources.indexOf(srcMapping.source); destMapping.originalLine = srcMapping.originalLine; destMapping.originalColumn = srcMapping.originalColumn; if (srcMapping.name) { destMapping.name = names.indexOf(srcMapping.name); } destOriginalMappings.push(destMapping); } destGeneratedMappings.push(destMapping); } quickSort(smc.__originalMappings, util.compareByOriginalPositions); return smc; }; /** * The version of the source mapping spec that we are consuming. */ BasicSourceMapConsumer.prototype._version = 3; /** * The list of original sources. */ Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { get: function () { return this._sources.toArray().map(function (s) { return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s; }, this); } }); /** * Provide the JIT with a nice shape / hidden class. */ function Mapping() { this.generatedLine = 0; this.generatedColumn = 0; this.source = null; this.originalLine = null; this.originalColumn = null; this.name = null; } /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { var generatedLine = 1; var previousGeneratedColumn = 0; var previousOriginalLine = 0; var previousOriginalColumn = 0; var previousSource = 0; var previousName = 0; var length = aStr.length; var index = 0; var cachedSegments = {}; var temp = {}; var originalMappings = []; var generatedMappings = []; var mapping, str, segment, end, value; while (index < length) { if (aStr.charAt(index) === ';') { generatedLine++; index++; previousGeneratedColumn = 0; } else if (aStr.charAt(index) === ',') { index++; } else { mapping = new Mapping(); mapping.generatedLine = generatedLine; // Because each offset is encoded relative to the previous one, // many segments often have the same encoding. We can exploit this // fact by caching the parsed variable length fields of each segment, // allowing us to avoid a second parse if we encounter the same // segment again. for (end = index; end < length; end++) { if (this._charIsMappingSeparator(aStr, end)) { break; } } str = aStr.slice(index, end); segment = cachedSegments[str]; if (segment) { index += str.length; } else { segment = []; while (index < end) { base64VLQ.decode(aStr, index, temp); value = temp.value; index = temp.rest; segment.push(value); } if (segment.length === 2) { throw new Error('Found a source, but no line and column'); } if (segment.length === 3) { throw new Error('Found a source and line, but no column'); } cachedSegments[str] = segment; } // Generated column. mapping.generatedColumn = previousGeneratedColumn + segment[0]; previousGeneratedColumn = mapping.generatedColumn; if (segment.length > 1) { // Original source. mapping.source = previousSource + segment[1]; previousSource += segment[1]; // Original line. mapping.originalLine = previousOriginalLine + segment[2]; previousOriginalLine = mapping.originalLine; // Lines are stored 0-based mapping.originalLine += 1; // Original column. mapping.originalColumn = previousOriginalColumn + segment[3]; previousOriginalColumn = mapping.originalColumn; if (segment.length > 4) { // Original name. mapping.name = previousName + segment[4]; previousName += segment[4]; } } generatedMappings.push(mapping); if (typeof mapping.originalLine === 'number') { originalMappings.push(mapping); } } } quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); this.__generatedMappings = generatedMappings; quickSort(originalMappings, util.compareByOriginalPositions); this.__originalMappings = originalMappings; }; /** * Find the mapping that best matches the hypothetical "needle" mapping that * we are searching for in the given "haystack" of mappings. */ BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) { // To return the position we are searching for, we must first find the // mapping for the given position and then return the opposite position it // points to. Because the mappings are sorted, we can use binary search to // find the best mapping. if (aNeedle[aLineName] <= 0) { throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]); } if (aNeedle[aColumnName] < 0) { throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]); } return binarySearch.search(aNeedle, aMappings, aComparator, aBias); }; /** * Compute the last column for each generated mapping. The last column is * inclusive. */ BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() { for (var index = 0; index < this._generatedMappings.length; ++index) { var mapping = this._generatedMappings[index]; // Mappings do not contain a field for the last generated columnt. We // can come up with an optimistic estimate, however, by assuming that // mappings are contiguous (i.e. given two consecutive mappings, the // first mapping ends where the second one starts). if (index + 1 < this._generatedMappings.length) { var nextMapping = this._generatedMappings[index + 1]; if (mapping.generatedLine === nextMapping.generatedLine) { mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; continue; } } // The last mapping for each line spans the entire line. mapping.lastGeneratedColumn = Infinity; } }; /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object * with the following properties: * * - line: The line number in the generated source. * - column: The column number in the generated source. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. * * and an object is returned with the following properties: * * - source: The original source file, or null. * - line: The line number in the original source, or null. * - column: The column number in the original source, or null. * - name: The original identifier, or null. */ BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, 'line'), generatedColumn: util.getArg(aArgs, 'column') }; var index = this._findMapping( needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) ); if (index >= 0) { var mapping = this._generatedMappings[index]; if (mapping.generatedLine === needle.generatedLine) { var source = util.getArg(mapping, 'source', null); if (source !== null) { source = this._sources.at(source); if (this.sourceRoot != null) { source = util.join(this.sourceRoot, source); } } var name = util.getArg(mapping, 'name', null); if (name !== null) { name = this._names.at(name); } return { source: source, line: util.getArg(mapping, 'originalLine', null), column: util.getArg(mapping, 'originalColumn', null), name: name }; } } return { source: null, line: null, column: null, name: null }; }; /** * Return true if we have the source content for every source in the source * map, false otherwise. */ BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() { if (!this.sourcesContent) { return false; } return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function (sc) { return sc == null; }); }; /** * Returns the original source content. The only argument is the url of the * original source file. Returns null if no original source content is * available. */ BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { if (!this.sourcesContent) { return null; } if (this.sourceRoot != null) { aSource = util.relative(this.sourceRoot, aSource); } if (this._sources.has(aSource)) { return this.sourcesContent[this._sources.indexOf(aSource)]; } var url; if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) { // XXX: file:// URIs and absolute paths lead to unexpected behavior for // many users. We can help them out when they expect file:// URIs to // behave like it would if they were running a local HTTP server. See // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) { return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] } if ((!url.path || url.path == "/") && this._sources.has("/" + aSource)) { return this.sourcesContent[this._sources.indexOf("/" + aSource)]; } } // This function is used recursively from // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we // don't want to throw if we can't find the source - we just want to // return null, so we provide a flag to exit gracefully. if (nullOnMissing) { return null; } else { throw new Error('"' + aSource + '" is not in the SourceMap.'); } }; /** * Returns the generated line and column information for the original source, * line, and column positions provided. The only argument is an object with * the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. * - column: The column number in the original source. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. * * and an object is returned with the following properties: * * - line: The line number in the generated source, or null. * - column: The column number in the generated source, or null. */ BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) { var source = util.getArg(aArgs, 'source'); if (this.sourceRoot != null) { source = util.relative(this.sourceRoot, source); } if (!this._sources.has(source)) { return { line: null, column: null, lastColumn: null }; } source = this._sources.indexOf(source); var needle = { source: source, originalLine: util.getArg(aArgs, 'line'), originalColumn: util.getArg(aArgs, 'column') }; var index = this._findMapping( needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) ); if (index >= 0) { var mapping = this._originalMappings[index]; if (mapping.source === needle.source) { return { line: util.getArg(mapping, 'generatedLine', null), column: util.getArg(mapping, 'generatedColumn', null), lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) }; } } return { line: null, column: null, lastColumn: null }; }; exports.BasicSourceMapConsumer = BasicSourceMapConsumer; /** * An IndexedSourceMapConsumer instance represents a parsed source map which * we can query for information. It differs from BasicSourceMapConsumer in * that it takes "indexed" source maps (i.e. ones with a "sections" field) as * input. * * The only parameter is a raw source map (either as a JSON string, or already * parsed to an object). According to the spec for indexed source maps, they * have the following attributes: * * - version: Which version of the source map spec this map is following. * - file: Optional. The generated file this source map is associated with. * - sections: A list of section definitions. * * Each value under the "sections" field has two fields: * - offset: The offset into the original specified at which this section * begins to apply, defined as an object with a "line" and "column" * field. * - map: A source map definition. This source map could also be indexed, * but doesn't have to be. * * Instead of the "map" field, it's also possible to have a "url" field * specifying a URL to retrieve a source map from, but that's currently * unsupported. * * Here's an example source map, taken from the source map spec[0], but * modified to omit a section which uses the "url" field. * * { * version : 3, * file: "app.js", * sections: [{ * offset: {line:100, column:10}, * map: { * version : 3, * file: "section.js", * sources: ["foo.js", "bar.js"], * names: ["src", "maps", "are", "fun"], * mappings: "AAAA,E;;ABCDE;" * } * }], * } * * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt */ function IndexedSourceMapConsumer(aSourceMap) { var sourceMap = aSourceMap; if (typeof aSourceMap === 'string') { sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); } var version = util.getArg(sourceMap, 'version'); var sections = util.getArg(sourceMap, 'sections'); if (version != this._version) { throw new Error('Unsupported version: ' + version); } this._sources = new ArraySet(); this._names = new ArraySet(); var lastOffset = { line: -1, column: 0 }; this._sections = sections.map(function (s) { if (s.url) { // The url field will require support for asynchronicity. // See https://github.com/mozilla/source-map/issues/16 throw new Error('Support for url field in sections not implemented.'); } var offset = util.getArg(s, 'offset'); var offsetLine = util.getArg(offset, 'line'); var offsetColumn = util.getArg(offset, 'column'); if (offsetLine < lastOffset.line || (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { throw new Error('Section offsets must be ordered and non-overlapping.'); } lastOffset = offset; return { generatedOffset: { // The offset fields are 0-based, but we use 1-based indices when // encoding/decoding from VLQ. generatedLine: offsetLine + 1, generatedColumn: offsetColumn + 1 }, consumer: new SourceMapConsumer(util.getArg(s, 'map')) } }); } IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; /** * The version of the source mapping spec that we are consuming. */ IndexedSourceMapConsumer.prototype._version = 3; /** * The list of original sources. */ Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { get: function () { var sources = []; for (var i = 0; i < this._sections.length; i++) { for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { sources.push(this._sections[i].consumer.sources[j]); } } return sources; } }); /** * Returns the original source, line, and column information for the generated * source's line and column positions provided. The only argument is an object * with the following properties: * * - line: The line number in the generated source. * - column: The column number in the generated source. * * and an object is returned with the following properties: * * - source: The original source file, or null. * - line: The line number in the original source, or null. * - column: The column number in the original source, or null. * - name: The original identifier, or null. */ IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) { var needle = { generatedLine: util.getArg(aArgs, 'line'), generatedColumn: util.getArg(aArgs, 'column') }; // Find the section containing the generated position we're trying to map // to an original position. var sectionIndex = binarySearch.search(needle, this._sections, function(needle, section) { var cmp = needle.generatedLine - section.generatedOffset.generatedLine; if (cmp) { return cmp; } return (needle.generatedColumn - section.generatedOffset.generatedColumn); }); var section = this._sections[sectionIndex]; if (!section) { return { source: null, line: null, column: null, name: null }; } return section.consumer.originalPositionFor({ line: needle.generatedLine - (section.generatedOffset.generatedLine - 1), column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), bias: aArgs.bias }); }; /** * Return true if we have the source content for every source in the source * map, false otherwise. */ IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() { return this._sections.every(function (s) { return s.consumer.hasContentsOfAllSources(); }); }; /** * Returns the original source content. The only argument is the url of the * original source file. Returns null if no original source content is * available. */ IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; var content = section.consumer.sourceContentFor(aSource, true); if (content) { return content; } } if (nullOnMissing) { return null; } else { throw new Error('"' + aSource + '" is not in the SourceMap.'); } }; /** * Returns the generated line and column information for the original source, * line, and column positions provided. The only argument is an object with * the following properties: * * - source: The filename of the original source. * - line: The line number in the original source. * - column: The column number in the original source. * * and an object is returned with the following properties: * * - line: The line number in the generated source, or null. * - column: The column number in the generated source, or null. */ IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; // Only consider this section if the requested source is in the list of // sources of the consumer. if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) { continue; } var generatedPosition = section.consumer.generatedPositionFor(aArgs); if (generatedPosition) { var ret = { line: generatedPosition.line + (section.generatedOffset.generatedLine - 1), column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0) }; return ret; } } return { line: null, column: null }; }; /** * Parse the mappings in a string in to a data structure which we can easily * query (the ordered arrays in the `this.__generatedMappings` and * `this.__originalMappings` properties). */ IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { this.__generatedMappings = []; this.__originalMappings = []; for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; var sectionMappings = section.consumer._generatedMappings; for (var j = 0; j < sectionMappings.length; j++) { var mapping = sectionMappings[j]; var source = section.consumer._sources.at(mapping.source); if (section.consumer.sourceRoot !== null) { source = util.join(section.consumer.sourceRoot, source); } this._sources.add(source); source = this._sources.indexOf(source); var name = section.consumer._names.at(mapping.name); this._names.add(name); name = this._names.indexOf(name); // The mappings coming from the consumer for the section have // generated positions relative to the start of the section, so we // need to offset them to be relative to the start of the concatenated // generated file. var adjustedMapping = { source: source, generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1), generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0), originalLine: mapping.originalLine, originalColumn: mapping.originalColumn, name: name }; this.__generatedMappings.push(adjustedMapping); if (typeof adjustedMapping.originalLine === 'number') { this.__originalMappings.push(adjustedMapping); } } } quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); quickSort(this.__originalMappings, util.compareByOriginalPositions); }; exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; /***/ }), /* 478 */ /***/ (function(module, exports) { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ exports.GREATEST_LOWER_BOUND = 1; exports.LEAST_UPPER_BOUND = 2; /** * Recursive implementation of binary search. * * @param aLow Indices here and lower do not contain the needle. * @param aHigh Indices here and higher do not contain the needle. * @param aNeedle The element being searched for. * @param aHaystack The non-empty array being searched. * @param aCompare Function which takes two elements and returns -1, 0, or 1. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. */ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { // This function terminates when one of the following is true: // // 1. We find the exact element we are looking for. // // 2. We did not find the exact element, but we can return the index of // the next-closest element. // // 3. We did not find the exact element, and there is no next-closest // element than the one we are searching for, so we return -1. var mid = Math.floor((aHigh - aLow) / 2) + aLow; var cmp = aCompare(aNeedle, aHaystack[mid], true); if (cmp === 0) { // Found the element we are looking for. return mid; } else if (cmp > 0) { // Our needle is greater than aHaystack[mid]. if (aHigh - mid > 1) { // The element is in the upper half. return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); } // The exact needle element was not found in this haystack. Determine if // we are in termination case (3) or (2) and return the appropriate thing. if (aBias == exports.LEAST_UPPER_BOUND) { return aHigh < aHaystack.length ? aHigh : -1; } else { return mid; } } else { // Our needle is less than aHaystack[mid]. if (mid - aLow > 1) { // The element is in the lower half. return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); } // we are in termination case (3) or (2) and return the appropriate thing. if (aBias == exports.LEAST_UPPER_BOUND) { return mid; } else { return aLow < 0 ? -1 : aLow; } } } /** * This is an implementation of binary search which will always try and return * the index of the closest element if there is no exact hit. This is because * mappings between original and generated line/col pairs are single points, * and there is an implicit region between each of them, so a miss just means * that you aren't on the very start of a region. * * @param aNeedle The element you are looking for. * @param aHaystack The array that is being searched. * @param aCompare A function which takes the needle and an element in the * array and returns -1, 0, or 1 depending on whether the needle is less * than, equal to, or greater than the element, respectively. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the * closest element that is smaller than or greater than the one we are * searching for, respectively, if the exact element cannot be found. * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. */ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { if (aHaystack.length === 0) { return -1; } var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND); if (index < 0) { return -1; } // We have found either the exact element, or the next-closest element than // the one we are searching for. However, there may be more than one such // element. Make sure we always return the smallest of these. while (index - 1 >= 0) { if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { break; } --index; } return index; }; /***/ }), /* 479 */ /***/ (function(module, exports) { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ // It turns out that some (most?) JavaScript engines don't self-host // `Array.prototype.sort`. This makes sense because C++ will likely remain // faster than JS when doing raw CPU-intensive sorting. However, when using a // custom comparator function, calling back and forth between the VM's C++ and // JIT'd JS is rather slow *and* loses JIT type information, resulting in // worse generated code for the comparator function than would be optimal. In // fact, when sorting with a comparator, these costs outweigh the benefits of // sorting in C++. By using our own JS-implemented Quick Sort (below), we get // a ~3500ms mean speed-up in `bench/bench.html`. /** * Swap the elements indexed by `x` and `y` in the array `ary`. * * @param {Array} ary * The array. * @param {Number} x * The index of the first item. * @param {Number} y * The index of the second item. */ function swap(ary, x, y) { var temp = ary[x]; ary[x] = ary[y]; ary[y] = temp; } /** * Returns a random integer within the range `low .. high` inclusive. * * @param {Number} low * The lower bound on the range. * @param {Number} high * The upper bound on the range. */ function randomIntInRange(low, high) { return Math.round(low + (Math.random() * (high - low))); } /** * The Quick Sort algorithm. * * @param {Array} ary * An array to sort. * @param {function} comparator * Function to use to compare two items. * @param {Number} p * Start index of the array * @param {Number} r * End index of the array */ function doQuickSort(ary, comparator, p, r) { // If our lower bound is less than our upper bound, we (1) partition the // array into two pieces and (2) recurse on each half. If it is not, this is // the empty array and our base case. if (p < r) { // (1) Partitioning. // // The partitioning chooses a pivot between `p` and `r` and moves all // elements that are less than or equal to the pivot to the before it, and // all the elements that are greater than it after it. The effect is that // once partition is done, the pivot is in the exact place it will be when // the array is put in sorted order, and it will not need to be moved // again. This runs in O(n) time. // Always choose a random pivot so that an input array which is reverse // sorted does not cause O(n^2) running time. var pivotIndex = randomIntInRange(p, r); var i = p - 1; swap(ary, pivotIndex, r); var pivot = ary[r]; // Immediately after `j` is incremented in this loop, the following hold // true: // // * Every element in `ary[p .. i]` is less than or equal to the pivot. // // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. for (var j = p; j < r; j++) { if (comparator(ary[j], pivot) <= 0) { i += 1; swap(ary, i, j); } } swap(ary, i + 1, j); var q = i + 1; // (2) Recurse on each half. doQuickSort(ary, comparator, p, q - 1); doQuickSort(ary, comparator, q + 1, r); } } /** * Sort the given array in-place with the given comparator function. * * @param {Array} ary * An array to sort. * @param {function} comparator * Function to use to compare two items. */ exports.quickSort = function (ary, comparator) { doQuickSort(ary, comparator, 0, ary.length - 1); }; /***/ }), /* 480 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors * Licensed under the New BSD license. See LICENSE or: * http://opensource.org/licenses/BSD-3-Clause */ var SourceMapGenerator = __webpack_require__(471).SourceMapGenerator; var util = __webpack_require__(474); // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other // operating systems these days (capturing the result). var REGEX_NEWLINE = /(\r?\n)/; // Newline character code for charCodeAt() comparisons var NEWLINE_CODE = 10; // Private symbol for identifying `SourceNode`s when multiple versions of // the source-map library are loaded. This MUST NOT CHANGE across // versions! var isSourceNode = "$$$isSourceNode$$$"; /** * SourceNodes provide a way to abstract over interpolating/concatenating * snippets of generated JavaScript source code while maintaining the line and * column information associated with the original source code. * * @param aLine The original line number. * @param aColumn The original column number. * @param aSource The original source's filename. * @param aChunks Optional. An array of strings which are snippets of * generated JS, or other SourceNodes. * @param aName The original identifier. */ function SourceNode(aLine, aColumn, aSource, aChunks, aName) { this.children = []; this.sourceContents = {}; this.line = aLine == null ? null : aLine; this.column = aColumn == null ? null : aColumn; this.source = aSource == null ? null : aSource; this.name = aName == null ? null : aName; this[isSourceNode] = true; if (aChunks != null) this.add(aChunks); } /** * Creates a SourceNode from generated code and a SourceMapConsumer. * * @param aGeneratedCode The generated code * @param aSourceMapConsumer The SourceMap for the generated code * @param aRelativePath Optional. The path that relative sources in the * SourceMapConsumer should be relative to. */ SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { // The SourceNode we want to fill with the generated code // and the SourceMap var node = new SourceNode(); // All even indices of this array are one line of the generated code, // while all odd indices are the newlines between two adjacent lines // (since `REGEX_NEWLINE` captures its match). // Processed fragments are accessed by calling `shiftNextLine`. var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); var remainingLinesIndex = 0; var shiftNextLine = function() { var lineContents = getNextLine(); // The last line of a file might not have a newline. var newLine = getNextLine() || ""; return lineContents + newLine; function getNextLine() { return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : undefined; } }; // We need to remember the position of "remainingLines" var lastGeneratedLine = 1, lastGeneratedColumn = 0; // The generate SourceNodes we need a code range. // To extract it current and last mapping is used. // Here we store the last mapping. var lastMapping = null; aSourceMapConsumer.eachMapping(function (mapping) { if (lastMapping !== null) { // We add the code from "lastMapping" to "mapping": // First check if there is a new line in between. if (lastGeneratedLine < mapping.generatedLine) { // Associate first line with "lastMapping" addMappingWithCode(lastMapping, shiftNextLine()); lastGeneratedLine++; lastGeneratedColumn = 0; // The remaining code is added without mapping } else { // There is no new line in between. // Associate the code between "lastGeneratedColumn" and // "mapping.generatedColumn" with "lastMapping" var nextLine = remainingLines[remainingLinesIndex]; var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn); remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn); lastGeneratedColumn = mapping.generatedColumn; addMappingWithCode(lastMapping, code); // No more remaining code, continue lastMapping = mapping; return; } } // We add the generated code until the first mapping // to the SourceNode without any mapping. // Each line is added as separate string. while (lastGeneratedLine < mapping.generatedLine) { node.add(shiftNextLine()); lastGeneratedLine++; } if (lastGeneratedColumn < mapping.generatedColumn) { var nextLine = remainingLines[remainingLinesIndex]; node.add(nextLine.substr(0, mapping.generatedColumn)); remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn); lastGeneratedColumn = mapping.generatedColumn; } lastMapping = mapping; }, this); // We have processed all mappings. if (remainingLinesIndex < remainingLines.length) { if (lastMapping) { // Associate the remaining code in the current line with "lastMapping" addMappingWithCode(lastMapping, shiftNextLine()); } // and add the remaining lines without any mapping node.add(remainingLines.splice(remainingLinesIndex).join("")); } // Copy sourcesContent into SourceNode aSourceMapConsumer.sources.forEach(function (sourceFile) { var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { if (aRelativePath != null) { sourceFile = util.join(aRelativePath, sourceFile); } node.setSourceContent(sourceFile, content); } }); return node; function addMappingWithCode(mapping, code) { if (mapping === null || mapping.source === undefined) { node.add(code); } else { var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source; node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name)); } } }; /** * Add a chunk of generated JS to this source node. * * @param aChunk A string snippet of generated JS code, another instance of * SourceNode, or an array where each member is one of those things. */ SourceNode.prototype.add = function SourceNode_add(aChunk) { if (Array.isArray(aChunk)) { aChunk.forEach(function (chunk) { this.add(chunk); }, this); } else if (aChunk[isSourceNode] || typeof aChunk === "string") { if (aChunk) { this.children.push(aChunk); } } else { throw new TypeError( "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk ); } return this; }; /** * Add a chunk of generated JS to the beginning of this source node. * * @param aChunk A string snippet of generated JS code, another instance of * SourceNode, or an array where each member is one of those things. */ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { if (Array.isArray(aChunk)) { for (var i = aChunk.length-1; i >= 0; i--) { this.prepend(aChunk[i]); } } else if (aChunk[isSourceNode] || typeof aChunk === "string") { this.children.unshift(aChunk); } else { throw new TypeError( "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk ); } return this; }; /** * Walk over the tree of JS snippets in this node and its children. The * walking function is called once for each snippet of JS and is passed that * snippet and the its original associated source's line/column location. * * @param aFn The traversal function. */ SourceNode.prototype.walk = function SourceNode_walk(aFn) { var chunk; for (var i = 0, len = this.children.length; i < len; i++) { chunk = this.children[i]; if (chunk[isSourceNode]) { chunk.walk(aFn); } else { if (chunk !== '') { aFn(chunk, { source: this.source, line: this.line, column: this.column, name: this.name }); } } } }; /** * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between * each of `this.children`. * * @param aSep The separator. */ SourceNode.prototype.join = function SourceNode_join(aSep) { var newChildren; var i; var len = this.children.length; if (len > 0) { newChildren = []; for (i = 0; i < len-1; i++) { newChildren.push(this.children[i]); newChildren.push(aSep); } newChildren.push(this.children[i]); this.children = newChildren; } return this; }; /** * Call String.prototype.replace on the very right-most source snippet. Useful * for trimming whitespace from the end of a source node, etc. * * @param aPattern The pattern to replace. * @param aReplacement The thing to replace the pattern with. */ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { var lastChild = this.children[this.children.length - 1]; if (lastChild[isSourceNode]) { lastChild.replaceRight(aPattern, aReplacement); } else if (typeof lastChild === 'string') { this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); } else { this.children.push(''.replace(aPattern, aReplacement)); } return this; }; /** * Set the source content for a source file. This will be added to the SourceMapGenerator * in the sourcesContent field. * * @param aSourceFile The filename of the source file * @param aSourceContent The content of the source file */ SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) { this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; }; /** * Walk over the tree of SourceNodes. The walking function is called for each * source file content and is passed the filename and source content. * * @param aFn The traversal function. */ SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { for (var i = 0, len = this.children.length; i < len; i++) { if (this.children[i][isSourceNode]) { this.children[i].walkSourceContents(aFn); } } var sources = Object.keys(this.sourceContents); for (var i = 0, len = sources.length; i < len; i++) { aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); } }; /** * Return the string representation of this source node. Walks over the tree * and concatenates all the various snippets together to one string. */ SourceNode.prototype.toString = function SourceNode_toString() { var str = ""; this.walk(function (chunk) { str += chunk; }); return str; }; /** * Returns the string representation of this source node along with a source * map. */ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { var generated = { code: "", line: 1, column: 0 }; var map = new SourceMapGenerator(aArgs); var sourceMappingActive = false; var lastOriginalSource = null; var lastOriginalLine = null; var lastOriginalColumn = null; var lastOriginalName = null; this.walk(function (chunk, original) { generated.code += chunk; if (original.source !== null && original.line !== null && original.column !== null) { if(lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) { map.addMapping({ source: original.source, original: { line: original.line, column: original.column }, generated: { line: generated.line, column: generated.column }, name: original.name }); } lastOriginalSource = original.source; lastOriginalLine = original.line; lastOriginalColumn = original.column; lastOriginalName = original.name; sourceMappingActive = true; } else if (sourceMappingActive) { map.addMapping({ generated: { line: generated.line, column: generated.column } }); lastOriginalSource = null; sourceMappingActive = false; } for (var idx = 0, length = chunk.length; idx < length; idx++) { if (chunk.charCodeAt(idx) === NEWLINE_CODE) { generated.line++; generated.column = 0; // Mappings end at eol if (idx + 1 === length) { lastOriginalSource = null; sourceMappingActive = false; } else if (sourceMappingActive) { map.addMapping({ source: original.source, original: { line: original.line, column: original.column }, generated: { line: generated.line, column: generated.column }, name: original.name }); } } else { generated.column++; } } }); this.walkSourceContents(function (sourceFile, sourceContent) { map.setSourceContent(sourceFile, sourceContent); }); return { code: generated.code, map: map }; }; exports.SourceNode = SourceNode; /***/ }), /* 481 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2014, 2015, 2016, 2017 Simon Lydell // X11 (“MIT”) Licensed. (See LICENSE.) var sourceMappingURL = __webpack_require__(482) var resolveUrl = __webpack_require__(483) var decodeUriComponent = __webpack_require__(484) var urix = __webpack_require__(486) var atob = __webpack_require__(487) function callbackAsync(callback, error, result) { setImmediate(function() { callback(error, result) }) } function parseMapToJSON(string, data) { try { return JSON.parse(string.replace(/^\)\]\}'/, "")) } catch (error) { error.sourceMapData = data throw error } } function readSync(read, url, data) { var readUrl = decodeUriComponent(url) try { return String(read(readUrl)) } catch (error) { error.sourceMapData = data throw error } } function resolveSourceMap(code, codeUrl, read, callback) { var mapData try { mapData = resolveSourceMapHelper(code, codeUrl) } catch (error) { return callbackAsync(callback, error) } if (!mapData || mapData.map) { return callbackAsync(callback, null, mapData) } var readUrl = decodeUriComponent(mapData.url) read(readUrl, function(error, result) { if (error) { error.sourceMapData = mapData return callback(error) } mapData.map = String(result) try { mapData.map = parseMapToJSON(mapData.map, mapData) } catch (error) { return callback(error) } callback(null, mapData) }) } function resolveSourceMapSync(code, codeUrl, read) { var mapData = resolveSourceMapHelper(code, codeUrl) if (!mapData || mapData.map) { return mapData } mapData.map = readSync(read, mapData.url, mapData) mapData.map = parseMapToJSON(mapData.map, mapData) return mapData } var dataUriRegex = /^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/ var jsonMimeTypeRegex = /^(?:application|text)\/json$/ function resolveSourceMapHelper(code, codeUrl) { codeUrl = urix(codeUrl) var url = sourceMappingURL.getFrom(code) if (!url) { return null } var dataUri = url.match(dataUriRegex) if (dataUri) { var mimeType = dataUri[1] var lastParameter = dataUri[2] || "" var encoded = dataUri[3] || "" var data = { sourceMappingURL: url, url: null, sourcesRelativeTo: codeUrl, map: encoded } if (!jsonMimeTypeRegex.test(mimeType)) { var error = new Error("Unuseful data uri mime type: " + (mimeType || "text/plain")) error.sourceMapData = data throw error } data.map = parseMapToJSON( lastParameter === ";base64" ? atob(encoded) : decodeURIComponent(encoded), data ) return data } var mapUrl = resolveUrl(codeUrl, url) return { sourceMappingURL: url, url: mapUrl, sourcesRelativeTo: mapUrl, map: null } } function resolveSources(map, mapUrl, read, options, callback) { if (typeof options === "function") { callback = options options = {} } var pending = map.sources ? map.sources.length : 0 var result = { sourcesResolved: [], sourcesContent: [] } if (pending === 0) { callbackAsync(callback, null, result) return } var done = function() { pending-- if (pending === 0) { callback(null, result) } } resolveSourcesHelper(map, mapUrl, options, function(fullUrl, sourceContent, index) { result.sourcesResolved[index] = fullUrl if (typeof sourceContent === "string") { result.sourcesContent[index] = sourceContent callbackAsync(done, null) } else { var readUrl = decodeUriComponent(fullUrl) read(readUrl, function(error, source) { result.sourcesContent[index] = error ? error : String(source) done() }) } }) } function resolveSourcesSync(map, mapUrl, read, options) { var result = { sourcesResolved: [], sourcesContent: [] } if (!map.sources || map.sources.length === 0) { return result } resolveSourcesHelper(map, mapUrl, options, function(fullUrl, sourceContent, index) { result.sourcesResolved[index] = fullUrl if (read !== null) { if (typeof sourceContent === "string") { result.sourcesContent[index] = sourceContent } else { var readUrl = decodeUriComponent(fullUrl) try { result.sourcesContent[index] = String(read(readUrl)) } catch (error) { result.sourcesContent[index] = error } } } }) return result } var endingSlash = /\/?$/ function resolveSourcesHelper(map, mapUrl, options, fn) { options = options || {} mapUrl = urix(mapUrl) var fullUrl var sourceContent var sourceRoot for (var index = 0, len = map.sources.length; index < len; index++) { sourceRoot = null if (typeof options.sourceRoot === "string") { sourceRoot = options.sourceRoot } else if (typeof map.sourceRoot === "string" && options.sourceRoot !== false) { sourceRoot = map.sourceRoot } // If the sourceRoot is the empty string, it is equivalent to not setting // the property at all. if (sourceRoot === null || sourceRoot === '') { fullUrl = resolveUrl(mapUrl, map.sources[index]) } else { // Make sure that the sourceRoot ends with a slash, so that `/scripts/subdir` becomes // `/scripts/subdir/`, not `/scripts/`. Pointing to a file as source root // does not make sense. fullUrl = resolveUrl(mapUrl, sourceRoot.replace(endingSlash, "/"), map.sources[index]) } sourceContent = (map.sourcesContent || [])[index] fn(fullUrl, sourceContent, index) } } function resolve(code, codeUrl, read, options, callback) { if (typeof options === "function") { callback = options options = {} } if (code === null) { var mapUrl = codeUrl var data = { sourceMappingURL: null, url: mapUrl, sourcesRelativeTo: mapUrl, map: null } var readUrl = decodeUriComponent(mapUrl) read(readUrl, function(error, result) { if (error) { error.sourceMapData = data return callback(error) } data.map = String(result) try { data.map = parseMapToJSON(data.map, data) } catch (error) { return callback(error) } _resolveSources(data) }) } else { resolveSourceMap(code, codeUrl, read, function(error, mapData) { if (error) { return callback(error) } if (!mapData) { return callback(null, null) } _resolveSources(mapData) }) } function _resolveSources(mapData) { resolveSources(mapData.map, mapData.sourcesRelativeTo, read, options, function(error, result) { if (error) { return callback(error) } mapData.sourcesResolved = result.sourcesResolved mapData.sourcesContent = result.sourcesContent callback(null, mapData) }) } } function resolveSync(code, codeUrl, read, options) { var mapData if (code === null) { var mapUrl = codeUrl mapData = { sourceMappingURL: null, url: mapUrl, sourcesRelativeTo: mapUrl, map: null } mapData.map = readSync(read, mapUrl, mapData) mapData.map = parseMapToJSON(mapData.map, mapData) } else { mapData = resolveSourceMapSync(code, codeUrl, read) if (!mapData) { return null } } var result = resolveSourcesSync(mapData.map, mapData.sourcesRelativeTo, read, options) mapData.sourcesResolved = result.sourcesResolved mapData.sourcesContent = result.sourcesContent return mapData } module.exports = { resolveSourceMap: resolveSourceMap, resolveSourceMapSync: resolveSourceMapSync, resolveSources: resolveSources, resolveSourcesSync: resolveSourcesSync, resolve: resolve, resolveSync: resolveSync, parseMapToJSON: parseMapToJSON } /***/ }), /* 482 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright 2014 Simon Lydell // X11 (“MIT”) Licensed. (See LICENSE.) void (function(root, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) } else {} }(this, function() { var innerRegex = /[#@] sourceMappingURL=([^\s'"]*)/ var regex = RegExp( "(?:" + "/\\*" + "(?:\\s*\r?\n(?://)?)?" + "(?:" + innerRegex.source + ")" + "\\s*" + "\\*/" + "|" + "//(?:" + innerRegex.source + ")" + ")" + "\\s*" ) return { regex: regex, _innerRegex: innerRegex, getFrom: function(code) { var match = code.match(regex) return (match ? match[1] || match[2] || "" : null) }, existsIn: function(code) { return regex.test(code) }, removeFrom: function(code) { return code.replace(regex, "") }, insertBefore: function(code, string) { var match = code.match(regex) if (match) { return code.slice(0, match.index) + string + code.slice(match.index) } else { return code + string } } } })); /***/ }), /* 483 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2014 Simon Lydell // X11 (“MIT”) Licensed. (See LICENSE.) var url = __webpack_require__(74) function resolveUrl(/* ...urls */) { return Array.prototype.reduce.call(arguments, function(resolved, nextUrl) { return url.resolve(resolved, nextUrl) }) } module.exports = resolveUrl /***/ }), /* 484 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Simon Lydell // X11 (“MIT”) Licensed. (See LICENSE.) var decodeUriComponent = __webpack_require__(485) function customDecodeUriComponent(string) { // `decodeUriComponent` turns `+` into ` `, but that's not wanted. return decodeUriComponent(string.replace(/\+/g, "%2B")) } module.exports = customDecodeUriComponent /***/ }), /* 485 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var token = '%[a-f0-9]{2}'; var singleMatcher = new RegExp(token, 'gi'); var multiMatcher = new RegExp('(' + token + ')+', 'gi'); function decodeComponents(components, split) { try { // Try to decode the entire string first return decodeURIComponent(components.join('')); } catch (err) { // Do nothing } if (components.length === 1) { return components; } split = split || 1; // Split the array in 2 parts var left = components.slice(0, split); var right = components.slice(split); return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right)); } function decode(input) { try { return decodeURIComponent(input); } catch (err) { var tokens = input.match(singleMatcher); for (var i = 1; i < tokens.length; i++) { input = decodeComponents(tokens, i).join(''); tokens = input.match(singleMatcher); } return input; } } function customDecodeURIComponent(input) { // Keep track of all the replacements and prefill the map with the `BOM` var replaceMap = { '%FE%FF': '\uFFFD\uFFFD', '%FF%FE': '\uFFFD\uFFFD' }; var match = multiMatcher.exec(input); while (match) { try { // Decode as big chunks as possible replaceMap[match[0]] = decodeURIComponent(match[0]); } catch (err) { var result = decode(match[0]); if (result !== match[0]) { replaceMap[match[0]] = result; } } match = multiMatcher.exec(input); } // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else replaceMap['%C2'] = '\uFFFD'; var entries = Object.keys(replaceMap); for (var i = 0; i < entries.length; i++) { // Replace all decoded components var key = entries[i]; input = input.replace(new RegExp(key, 'g'), replaceMap[key]); } return input; } module.exports = function (encodedURI) { if (typeof encodedURI !== 'string') { throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`'); } try { encodedURI = encodedURI.replace(/\+/g, ' '); // Try the built in decoder first return decodeURIComponent(encodedURI); } catch (err) { // Fallback to a more advanced decoder return customDecodeURIComponent(encodedURI); } }; /***/ }), /* 486 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2014 Simon Lydell // X11 (“MIT”) Licensed. (See LICENSE.) var path = __webpack_require__(16) "use strict" function urix(aPath) { if (path.sep === "\\") { return aPath .replace(/\\/g, "/") .replace(/^[a-z]:\/?/i, "/") } return aPath } module.exports = urix /***/ }), /* 487 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; function atob(str) { return Buffer.from(str, 'base64').toString('binary'); } module.exports = atob.atob = atob; /***/ }), /* 488 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fs = __webpack_require__(23); var path = __webpack_require__(16); var define = __webpack_require__(390); var utils = __webpack_require__(469); /** * Expose `mixin()`. * This code is based on `source-maps-support.js` in reworkcss/css * https://github.com/reworkcss/css/blob/master/lib/stringify/source-map-support.js * Copyright (c) 2012 TJ Holowaychuk */ module.exports = mixin; /** * Mixin source map support into `compiler`. * * @param {Object} `compiler` * @api public */ function mixin(compiler) { define(compiler, '_comment', compiler.comment); compiler.map = new utils.SourceMap.SourceMapGenerator(); compiler.position = { line: 1, column: 1 }; compiler.content = {}; compiler.files = {}; for (var key in exports) { define(compiler, key, exports[key]); } } /** * Update position. * * @param {String} str */ exports.updatePosition = function(str) { var lines = str.match(/\n/g); if (lines) this.position.line += lines.length; var i = str.lastIndexOf('\n'); this.position.column = ~i ? str.length - i : this.position.column + str.length; }; /** * Emit `str` with `position`. * * @param {String} str * @param {Object} [pos] * @return {String} */ exports.emit = function(str, node) { var position = node.position || {}; var source = position.source; if (source) { if (position.filepath) { source = utils.unixify(position.filepath); } this.map.addMapping({ source: source, generated: { line: this.position.line, column: Math.max(this.position.column - 1, 0) }, original: { line: position.start.line, column: position.start.column - 1 } }); if (position.content) { this.addContent(source, position); } if (position.filepath) { this.addFile(source, position); } this.updatePosition(str); this.output += str; } return str; }; /** * Adds a file to the source map output if it has not already been added * @param {String} `file` * @param {Object} `pos` */ exports.addFile = function(file, position) { if (typeof position.content !== 'string') return; if (Object.prototype.hasOwnProperty.call(this.files, file)) return; this.files[file] = position.content; }; /** * Adds a content source to the source map output if it has not already been added * @param {String} `source` * @param {Object} `position` */ exports.addContent = function(source, position) { if (typeof position.content !== 'string') return; if (Object.prototype.hasOwnProperty.call(this.content, source)) return; this.map.setSourceContent(source, position.content); }; /** * Applies any original source maps to the output and embeds the source file * contents in the source map. */ exports.applySourceMaps = function() { Object.keys(this.files).forEach(function(file) { var content = this.files[file]; this.map.setSourceContent(file, content); if (this.options.inputSourcemaps === true) { var originalMap = utils.sourceMapResolve.resolveSync(content, file, fs.readFileSync); if (originalMap) { var map = new utils.SourceMap.SourceMapConsumer(originalMap.map); var relativeTo = originalMap.sourcesRelativeTo; this.map.applySourceMap(map, file, utils.unixify(path.dirname(relativeTo))); } } }, this); }; /** * Process comments, drops sourceMap comments. * @param {Object} node */ exports.comment = function(node) { if (/^# sourceMappingURL=/.test(node.comment)) { return this.emit('', node.position); } return this._comment(node); }; /***/ }), /* 489 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var use = __webpack_require__(460); var util = __webpack_require__(29); var Cache = __webpack_require__(490); var define = __webpack_require__(390); var debug = __webpack_require__(462)('snapdragon:parser'); var Position = __webpack_require__(491); var utils = __webpack_require__(469); /** * Create a new `Parser` with the given `input` and `options`. * @param {String} `input` * @param {Object} `options` * @api public */ function Parser(options) { debug('initializing', __filename); this.options = utils.extend({source: 'string'}, options); this.init(this.options); use(this); } /** * Prototype methods */ Parser.prototype = { constructor: Parser, init: function(options) { this.orig = ''; this.input = ''; this.parsed = ''; this.column = 1; this.line = 1; this.regex = new Cache(); this.errors = this.errors || []; this.parsers = this.parsers || {}; this.types = this.types || []; this.sets = this.sets || {}; this.fns = this.fns || []; this.currentType = 'root'; var pos = this.position(); this.bos = pos({type: 'bos', val: ''}); this.ast = { type: 'root', errors: this.errors, nodes: [this.bos] }; define(this.bos, 'parent', this.ast); this.nodes = [this.ast]; this.count = 0; this.setCount = 0; this.stack = []; }, /** * Throw a formatted error with the cursor column and `msg`. * @param {String} `msg` Message to use in the Error. */ error: function(msg, node) { var pos = node.position || {start: {column: 0, line: 0}}; var line = pos.start.line; var column = pos.start.column; var source = this.options.source; var message = source + ' : ' + msg; var err = new Error(message); err.source = source; err.reason = msg; err.pos = pos; if (this.options.silent) { this.errors.push(err); } else { throw err; } }, /** * Define a non-enumberable property on the `Parser` instance. * * ```js * parser.define('foo', 'bar'); * ``` * @name .define * @param {String} `key` propery name * @param {any} `val` property value * @return {Object} Returns the Parser instance for chaining. * @api public */ define: function(key, val) { define(this, key, val); return this; }, /** * Mark position and patch `node.position`. */ position: function() { var start = { line: this.line, column: this.column }; var self = this; return function(node) { define(node, 'position', new Position(start, self)); return node; }; }, /** * Set parser `name` with the given `fn` * @param {String} `name` * @param {Function} `fn` * @api public */ set: function(type, fn) { if (this.types.indexOf(type) === -1) { this.types.push(type); } this.parsers[type] = fn.bind(this); return this; }, /** * Get parser `name` * @param {String} `name` * @api public */ get: function(name) { return this.parsers[name]; }, /** * Push a `token` onto the `type` stack. * * @param {String} `type` * @return {Object} `token` * @api public */ push: function(type, token) { this.sets[type] = this.sets[type] || []; this.count++; this.stack.push(token); return this.sets[type].push(token); }, /** * Pop a token off of the `type` stack * @param {String} `type` * @returns {Object} Returns a token * @api public */ pop: function(type) { this.sets[type] = this.sets[type] || []; this.count--; this.stack.pop(); return this.sets[type].pop(); }, /** * Return true if inside a `stack` node. Types are `braces`, `parens` or `brackets`. * * @param {String} `type` * @return {Boolean} * @api public */ isInside: function(type) { this.sets[type] = this.sets[type] || []; return this.sets[type].length > 0; }, /** * Return true if `node` is the given `type`. * * ```js * parser.isType(node, 'brace'); * ``` * @param {Object} `node` * @param {String} `type` * @return {Boolean} * @api public */ isType: function(node, type) { return node && node.type === type; }, /** * Get the previous AST node * @return {Object} */ prev: function(n) { return this.stack.length > 0 ? utils.last(this.stack, n) : utils.last(this.nodes, n); }, /** * Update line and column based on `str`. */ consume: function(len) { this.input = this.input.substr(len); }, /** * Update column based on `str`. */ updatePosition: function(str, len) { var lines = str.match(/\n/g); if (lines) this.line += lines.length; var i = str.lastIndexOf('\n'); this.column = ~i ? len - i : this.column + len; this.parsed += str; this.consume(len); }, /** * Match `regex`, return captures, and update the cursor position by `match[0]` length. * @param {RegExp} `regex` * @return {Object} */ match: function(regex) { var m = regex.exec(this.input); if (m) { this.updatePosition(m[0], m[0].length); return m; } }, /** * Capture `type` with the given regex. * @param {String} `type` * @param {RegExp} `regex` * @return {Function} */ capture: function(type, regex) { if (typeof regex === 'function') { return this.set.apply(this, arguments); } this.regex.set(type, regex); this.set(type, function() { var parsed = this.parsed; var pos = this.position(); var m = this.match(regex); if (!m || !m[0]) return; var prev = this.prev(); var node = pos({ type: type, val: m[0], parsed: parsed, rest: this.input }); if (m[1]) { node.inner = m[1]; } define(node, 'inside', this.stack.length > 0); define(node, 'parent', prev); prev.nodes.push(node); }.bind(this)); return this; }, /** * Create a parser with open and close for parens, * brackets or braces */ capturePair: function(type, openRegex, closeRegex, fn) { this.sets[type] = this.sets[type] || []; /** * Open */ this.set(type + '.open', function() { var parsed = this.parsed; var pos = this.position(); var m = this.match(openRegex); if (!m || !m[0]) return; var val = m[0]; this.setCount++; this.specialChars = true; var open = pos({ type: type + '.open', val: val, rest: this.input }); if (typeof m[1] !== 'undefined') { open.inner = m[1]; } var prev = this.prev(); var node = pos({ type: type, nodes: [open] }); define(node, 'rest', this.input); define(node, 'parsed', parsed); define(node, 'prefix', m[1]); define(node, 'parent', prev); define(open, 'parent', node); if (typeof fn === 'function') { fn.call(this, open, node); } this.push(type, node); prev.nodes.push(node); }); /** * Close */ this.set(type + '.close', function() { var pos = this.position(); var m = this.match(closeRegex); if (!m || !m[0]) return; var parent = this.pop(type); var node = pos({ type: type + '.close', rest: this.input, suffix: m[1], val: m[0] }); if (!this.isType(parent, type)) { if (this.options.strict) { throw new Error('missing opening "' + type + '"'); } this.setCount--; node.escaped = true; return node; } if (node.suffix === '\\') { parent.escaped = true; node.escaped = true; } parent.nodes.push(node); define(node, 'parent', parent); }); return this; }, /** * Capture end-of-string */ eos: function() { var pos = this.position(); if (this.input) return; var prev = this.prev(); while (prev.type !== 'root' && !prev.visited) { if (this.options.strict === true) { throw new SyntaxError('invalid syntax:' + util.inspect(prev, null, 2)); } if (!hasDelims(prev)) { prev.parent.escaped = true; prev.escaped = true; } visit(prev, function(node) { if (!hasDelims(node.parent)) { node.parent.escaped = true; node.escaped = true; } }); prev = prev.parent; } var tok = pos({ type: 'eos', val: this.append || '' }); define(tok, 'parent', this.ast); return tok; }, /** * Run parsers to advance the cursor position */ next: function() { var parsed = this.parsed; var len = this.types.length; var idx = -1; var tok; while (++idx < len) { if ((tok = this.parsers[this.types[idx]].call(this))) { define(tok, 'rest', this.input); define(tok, 'parsed', parsed); this.last = tok; return tok; } } }, /** * Parse the given string. * @return {Array} */ parse: function(input) { if (typeof input !== 'string') { throw new TypeError('expected a string'); } this.init(this.options); this.orig = input; this.input = input; var self = this; function parse() { // check input before calling `.next()` input = self.input; // get the next AST ndoe var node = self.next(); if (node) { var prev = self.prev(); if (prev) { define(node, 'parent', prev); if (prev.nodes) { prev.nodes.push(node); } } if (self.sets.hasOwnProperty(prev.type)) { self.currentType = prev.type; } } // if we got here but input is not changed, throw an error if (self.input && input === self.input) { throw new Error('no parsers registered for: "' + self.input.slice(0, 5) + '"'); } } while (this.input) parse(); if (this.stack.length && this.options.strict) { var node = this.stack.pop(); throw this.error('missing opening ' + node.type + ': "' + this.orig + '"'); } var eos = this.eos(); var tok = this.prev(); if (tok.type !== 'eos') { this.ast.nodes.push(eos); } return this.ast; } }; /** * Visit `node` with the given `fn` */ function visit(node, fn) { if (!node.visited) { define(node, 'visited', true); return node.nodes ? mapVisit(node.nodes, fn) : fn(node); } return node; } /** * Map visit over array of `nodes`. */ function mapVisit(nodes, fn) { var len = nodes.length; var idx = -1; while (++idx < len) { visit(nodes[idx], fn); } } function hasOpen(node) { return node.nodes && node.nodes[0].type === (node.type + '.open'); } function hasClose(node) { return node.nodes && utils.last(node.nodes).type === (node.type + '.close'); } function hasDelims(node) { return hasOpen(node) && hasClose(node); } /** * Expose `Parser` */ module.exports = Parser; /***/ }), /* 490 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * map-cache * * Copyright (c) 2015, Jon Schlinkert. * Licensed under the MIT License. */ var hasOwn = Object.prototype.hasOwnProperty; /** * Expose `MapCache` */ module.exports = MapCache; /** * Creates a cache object to store key/value pairs. * * ```js * var cache = new MapCache(); * ``` * * @api public */ function MapCache(data) { this.__data__ = data || {}; } /** * Adds `value` to `key` on the cache. * * ```js * cache.set('foo', 'bar'); * ``` * * @param {String} `key` The key of the value to cache. * @param {*} `value` The value to cache. * @returns {Object} Returns the `Cache` object for chaining. * @api public */ MapCache.prototype.set = function mapSet(key, value) { if (key !== '__proto__') { this.__data__[key] = value; } return this; }; /** * Gets the cached value for `key`. * * ```js * cache.get('foo'); * //=> 'bar' * ``` * * @param {String} `key` The key of the value to get. * @returns {*} Returns the cached value. * @api public */ MapCache.prototype.get = function mapGet(key) { return key === '__proto__' ? undefined : this.__data__[key]; }; /** * Checks if a cached value for `key` exists. * * ```js * cache.has('foo'); * //=> true * ``` * * @param {String} `key` The key of the entry to check. * @returns {Boolean} Returns `true` if an entry for `key` exists, else `false`. * @api public */ MapCache.prototype.has = function mapHas(key) { return key !== '__proto__' && hasOwn.call(this.__data__, key); }; /** * Removes `key` and its value from the cache. * * ```js * cache.del('foo'); * ``` * @title .del * @param {String} `key` The key of the value to remove. * @returns {Boolean} Returns `true` if the entry was removed successfully, else `false`. * @api public */ MapCache.prototype.del = function mapDelete(key) { return this.has(key) && delete this.__data__[key]; }; /***/ }), /* 491 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var define = __webpack_require__(390); /** * Store position for a node */ module.exports = function Position(start, parser) { this.start = start; this.end = { line: parser.line, column: parser.column }; define(this, 'content', parser.orig); define(this, 'source', parser.options.source); }; /***/ }), /* 492 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var nanomatch = __webpack_require__(493); var extglob = __webpack_require__(504); module.exports = function(snapdragon) { var compilers = snapdragon.compiler.compilers; var opts = snapdragon.options; // register nanomatch compilers snapdragon.use(nanomatch.compilers); // get references to some specific nanomatch compilers before they // are overridden by the extglob and/or custom compilers var escape = compilers.escape; var qmark = compilers.qmark; var slash = compilers.slash; var star = compilers.star; var text = compilers.text; var plus = compilers.plus; var dot = compilers.dot; // register extglob compilers or escape exglobs if disabled if (opts.extglob === false || opts.noext === true) { snapdragon.compiler.use(escapeExtglobs); } else { snapdragon.use(extglob.compilers); } snapdragon.use(function() { this.options.star = this.options.star || function(/*node*/) { return '[^/]*?'; }; }); // custom micromatch compilers snapdragon.compiler // reset referenced compiler .set('dot', dot) .set('escape', escape) .set('plus', plus) .set('slash', slash) .set('qmark', qmark) .set('star', star) .set('text', text); }; function escapeExtglobs(compiler) { compiler.set('paren', function(node) { var val = ''; visit(node, function(tok) { if (tok.val) val += '\\' + tok.val; }); return this.emit(val, node); }); /** * Visit `node` with the given `fn` */ function visit(node, fn) { return node.nodes ? mapVisit(node.nodes, fn) : fn(node); } /** * Map visit over array of `nodes`. */ function mapVisit(nodes, fn) { var len = nodes.length; var idx = -1; while (++idx < len) { visit(nodes[idx], fn); } } } /***/ }), /* 493 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Module dependencies */ var util = __webpack_require__(29); var toRegex = __webpack_require__(389); var extend = __webpack_require__(398); /** * Local dependencies */ var compilers = __webpack_require__(494); var parsers = __webpack_require__(495); var cache = __webpack_require__(497); var utils = __webpack_require__(499); var MAX_LENGTH = 1024 * 64; /** * The main function takes a list of strings and one or more * glob patterns to use for matching. * * ```js * var nm = require('nanomatch'); * nm(list, patterns[, options]); * * console.log(nm(['a.js', 'a.txt'], ['*.js'])); * //=> [ 'a.js' ] * ``` * @param {Array} `list` A list of strings to match * @param {String|Array} `patterns` One or more glob patterns to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Array} Returns an array of matches * @summary false * @api public */ function nanomatch(list, patterns, options) { patterns = utils.arrayify(patterns); list = utils.arrayify(list); var len = patterns.length; if (list.length === 0 || len === 0) { return []; } if (len === 1) { return nanomatch.match(list, patterns[0], options); } var negated = false; var omit = []; var keep = []; var idx = -1; while (++idx < len) { var pattern = patterns[idx]; if (typeof pattern === 'string' && pattern.charCodeAt(0) === 33 /* ! */) { omit.push.apply(omit, nanomatch.match(list, pattern.slice(1), options)); negated = true; } else { keep.push.apply(keep, nanomatch.match(list, pattern, options)); } } // minimatch.match parity if (negated && keep.length === 0) { if (options && options.unixify === false) { keep = list.slice(); } else { var unixify = utils.unixify(options); for (var i = 0; i < list.length; i++) { keep.push(unixify(list[i])); } } } var matches = utils.diff(keep, omit); if (!options || options.nodupes !== false) { return utils.unique(matches); } return matches; } /** * Similar to the main function, but `pattern` must be a string. * * ```js * var nm = require('nanomatch'); * nm.match(list, pattern[, options]); * * console.log(nm.match(['a.a', 'a.aa', 'a.b', 'a.c'], '*.a')); * //=> ['a.a', 'a.aa'] * ``` * @param {Array} `list` Array of strings to match * @param {String} `pattern` Glob pattern to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Array} Returns an array of matches * @api public */ nanomatch.match = function(list, pattern, options) { if (Array.isArray(pattern)) { throw new TypeError('expected pattern to be a string'); } var unixify = utils.unixify(options); var isMatch = memoize('match', pattern, options, nanomatch.matcher); var matches = []; list = utils.arrayify(list); var len = list.length; var idx = -1; while (++idx < len) { var ele = list[idx]; if (ele === pattern || isMatch(ele)) { matches.push(utils.value(ele, unixify, options)); } } // if no options were passed, uniquify results and return if (typeof options === 'undefined') { return utils.unique(matches); } if (matches.length === 0) { if (options.failglob === true) { throw new Error('no matches found for "' + pattern + '"'); } if (options.nonull === true || options.nullglob === true) { return [options.unescape ? utils.unescape(pattern) : pattern]; } } // if `opts.ignore` was defined, diff ignored list if (options.ignore) { matches = nanomatch.not(matches, options.ignore, options); } return options.nodupes !== false ? utils.unique(matches) : matches; }; /** * Returns true if the specified `string` matches the given glob `pattern`. * * ```js * var nm = require('nanomatch'); * nm.isMatch(string, pattern[, options]); * * console.log(nm.isMatch('a.a', '*.a')); * //=> true * console.log(nm.isMatch('a.b', '*.a')); * //=> false * ``` * @param {String} `string` String to match * @param {String} `pattern` Glob pattern to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns true if the string matches the glob pattern. * @api public */ nanomatch.isMatch = function(str, pattern, options) { if (typeof str !== 'string') { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } if (utils.isEmptyString(str) || utils.isEmptyString(pattern)) { return false; } var equals = utils.equalsPattern(options); if (equals(str)) { return true; } var isMatch = memoize('isMatch', pattern, options, nanomatch.matcher); return isMatch(str); }; /** * Returns true if some of the elements in the given `list` match any of the * given glob `patterns`. * * ```js * var nm = require('nanomatch'); * nm.some(list, patterns[, options]); * * console.log(nm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); * // true * console.log(nm.some(['foo.js'], ['*.js', '!foo.js'])); * // false * ``` * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found. * @param {String|Array} `patterns` One or more glob patterns to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns true if any patterns match `str` * @api public */ nanomatch.some = function(list, patterns, options) { if (typeof list === 'string') { list = [list]; } for (var i = 0; i < list.length; i++) { if (nanomatch(list[i], patterns, options).length === 1) { return true; } } return false; }; /** * Returns true if every element in the given `list` matches * at least one of the given glob `patterns`. * * ```js * var nm = require('nanomatch'); * nm.every(list, patterns[, options]); * * console.log(nm.every('foo.js', ['foo.js'])); * // true * console.log(nm.every(['foo.js', 'bar.js'], ['*.js'])); * // true * console.log(nm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js'])); * // false * console.log(nm.every(['foo.js'], ['*.js', '!foo.js'])); * // false * ``` * @param {String|Array} `list` The string or array of strings to test. * @param {String|Array} `patterns` One or more glob patterns to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns true if any patterns match `str` * @api public */ nanomatch.every = function(list, patterns, options) { if (typeof list === 'string') { list = [list]; } for (var i = 0; i < list.length; i++) { if (nanomatch(list[i], patterns, options).length !== 1) { return false; } } return true; }; /** * Returns true if **any** of the given glob `patterns` * match the specified `string`. * * ```js * var nm = require('nanomatch'); * nm.any(string, patterns[, options]); * * console.log(nm.any('a.a', ['b.*', '*.a'])); * //=> true * console.log(nm.any('a.a', 'b.*')); * //=> false * ``` * @param {String|Array} `str` The string to test. * @param {String|Array} `patterns` One or more glob patterns to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns true if any patterns match `str` * @api public */ nanomatch.any = function(str, patterns, options) { if (typeof str !== 'string') { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) { return false; } if (typeof patterns === 'string') { patterns = [patterns]; } for (var i = 0; i < patterns.length; i++) { if (nanomatch.isMatch(str, patterns[i], options)) { return true; } } return false; }; /** * Returns true if **all** of the given `patterns` * match the specified string. * * ```js * var nm = require('nanomatch'); * nm.all(string, patterns[, options]); * * console.log(nm.all('foo.js', ['foo.js'])); * // true * * console.log(nm.all('foo.js', ['*.js', '!foo.js'])); * // false * * console.log(nm.all('foo.js', ['*.js', 'foo.js'])); * // true * * console.log(nm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js'])); * // true * ``` * @param {String|Array} `str` The string to test. * @param {String|Array} `patterns` One or more glob patterns to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns true if any patterns match `str` * @api public */ nanomatch.all = function(str, patterns, options) { if (typeof str !== 'string') { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } if (typeof patterns === 'string') { patterns = [patterns]; } for (var i = 0; i < patterns.length; i++) { if (!nanomatch.isMatch(str, patterns[i], options)) { return false; } } return true; }; /** * Returns a list of strings that _**do not match any**_ of the given `patterns`. * * ```js * var nm = require('nanomatch'); * nm.not(list, patterns[, options]); * * console.log(nm.not(['a.a', 'b.b', 'c.c'], '*.a')); * //=> ['b.b', 'c.c'] * ``` * @param {Array} `list` Array of strings to match. * @param {String|Array} `patterns` One or more glob pattern to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Array} Returns an array of strings that **do not match** the given patterns. * @api public */ nanomatch.not = function(list, patterns, options) { var opts = extend({}, options); var ignore = opts.ignore; delete opts.ignore; list = utils.arrayify(list); var matches = utils.diff(list, nanomatch(list, patterns, opts)); if (ignore) { matches = utils.diff(matches, nanomatch(list, ignore)); } return opts.nodupes !== false ? utils.unique(matches) : matches; }; /** * Returns true if the given `string` contains the given pattern. Similar * to [.isMatch](#isMatch) but the pattern can match any part of the string. * * ```js * var nm = require('nanomatch'); * nm.contains(string, pattern[, options]); * * console.log(nm.contains('aa/bb/cc', '*b')); * //=> true * console.log(nm.contains('aa/bb/cc', '*d')); * //=> false * ``` * @param {String} `str` The string to match. * @param {String|Array} `patterns` Glob pattern to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns true if the patter matches any part of `str`. * @api public */ nanomatch.contains = function(str, patterns, options) { if (typeof str !== 'string') { throw new TypeError('expected a string: "' + util.inspect(str) + '"'); } if (typeof patterns === 'string') { if (utils.isEmptyString(str) || utils.isEmptyString(patterns)) { return false; } var equals = utils.equalsPattern(patterns, options); if (equals(str)) { return true; } var contains = utils.containsPattern(patterns, options); if (contains(str)) { return true; } } var opts = extend({}, options, {contains: true}); return nanomatch.any(str, patterns, opts); }; /** * Returns true if the given pattern and options should enable * the `matchBase` option. * @return {Boolean} * @api private */ nanomatch.matchBase = function(pattern, options) { if (pattern && pattern.indexOf('/') !== -1 || !options) return false; return options.basename === true || options.matchBase === true; }; /** * Filter the keys of the given object with the given `glob` pattern * and `options`. Does not attempt to match nested keys. If you need this feature, * use [glob-object][] instead. * * ```js * var nm = require('nanomatch'); * nm.matchKeys(object, patterns[, options]); * * var obj = { aa: 'a', ab: 'b', ac: 'c' }; * console.log(nm.matchKeys(obj, '*b')); * //=> { ab: 'b' } * ``` * @param {Object} `object` The object with keys to filter. * @param {String|Array} `patterns` One or more glob patterns to use for matching. * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Object} Returns an object with only keys that match the given patterns. * @api public */ nanomatch.matchKeys = function(obj, patterns, options) { if (!utils.isObject(obj)) { throw new TypeError('expected the first argument to be an object'); } var keys = nanomatch(Object.keys(obj), patterns, options); return utils.pick(obj, keys); }; /** * Returns a memoized matcher function from the given glob `pattern` and `options`. * The returned function takes a string to match as its only argument and returns * true if the string is a match. * * ```js * var nm = require('nanomatch'); * nm.matcher(pattern[, options]); * * var isMatch = nm.matcher('*.!(*a)'); * console.log(isMatch('a.a')); * //=> false * console.log(isMatch('a.b')); * //=> true * ``` * @param {String} `pattern` Glob pattern * @param {Object} `options` See available [options](#options) for changing how matches are performed. * @return {Function} Returns a matcher function. * @api public */ nanomatch.matcher = function matcher(pattern, options) { if (utils.isEmptyString(pattern)) { return function() { return false; }; } if (Array.isArray(pattern)) { return compose(pattern, options, matcher); } // if pattern is a regex if (pattern instanceof RegExp) { return test(pattern); } // if pattern is invalid if (!utils.isString(pattern)) { throw new TypeError('expected pattern to be an array, string or regex'); } // if pattern is a non-glob string if (!utils.hasSpecialChars(pattern)) { if (options && options.nocase === true) { pattern = pattern.toLowerCase(); } return utils.matchPath(pattern, options); } // if pattern is a glob string var re = nanomatch.makeRe(pattern, options); // if `options.matchBase` or `options.basename` is defined if (nanomatch.matchBase(pattern, options)) { return utils.matchBasename(re, options); } function test(regex) { var equals = utils.equalsPattern(options); var unixify = utils.unixify(options); return function(str) { if (equals(str)) { return true; } if (regex.test(unixify(str))) { return true; } return false; }; } var fn = test(re); Object.defineProperty(fn, 'result', { configurable: true, enumerable: false, value: re.result }); return fn; }; /** * Returns an array of matches captured by `pattern` in `string, or * `null` if the pattern did not match. * * ```js * var nm = require('nanomatch'); * nm.capture(pattern, string[, options]); * * console.log(nm.capture('test/*.js', 'test/foo.js')); * //=> ['foo'] * console.log(nm.capture('test/*.js', 'foo/bar.css')); * //=> null * ``` * @param {String} `pattern` Glob pattern to use for matching. * @param {String} `string` String to match * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`. * @api public */ nanomatch.capture = function(pattern, str, options) { var re = nanomatch.makeRe(pattern, extend({capture: true}, options)); var unixify = utils.unixify(options); function match() { return function(string) { var match = re.exec(unixify(string)); if (!match) { return null; } return match.slice(1); }; } var capture = memoize('capture', pattern, options, match); return capture(str); }; /** * Create a regular expression from the given glob `pattern`. * * ```js * var nm = require('nanomatch'); * nm.makeRe(pattern[, options]); * * console.log(nm.makeRe('*.js')); * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/ * ``` * @param {String} `pattern` A glob pattern to convert to regex. * @param {Object} `options` See available [options](#options) for changing how matches are performed. * @return {RegExp} Returns a regex created from the given pattern. * @api public */ nanomatch.makeRe = function(pattern, options) { if (pattern instanceof RegExp) { return pattern; } if (typeof pattern !== 'string') { throw new TypeError('expected pattern to be a string'); } if (pattern.length > MAX_LENGTH) { throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); } function makeRe() { var opts = utils.extend({wrap: false}, options); var res = nanomatch.create(pattern, opts); var regex = toRegex(res.output, opts); Object.defineProperty(regex, 'result', { configurable: true, enumerable: false, value: res }); return regex; } return memoize('makeRe', pattern, options, makeRe); }; /** * Parses the given glob `pattern` and returns an object with the compiled `output` * and optional source `map`. * * ```js * var nm = require('nanomatch'); * nm.create(pattern[, options]); * * console.log(nm.create('abc/*.js')); * // { options: { source: 'string', sourcemap: true }, * // state: {}, * // compilers: * // { ... }, * // output: '(\\.[\\\\\\/])?abc\\/(?!\\.)(?=.)[^\\/]*?\\.js', * // ast: * // { type: 'root', * // errors: [], * // nodes: * // [ ... ], * // dot: false, * // input: 'abc/*.js' }, * // parsingErrors: [], * // map: * // { version: 3, * // sources: [ 'string' ], * // names: [], * // mappings: 'AAAA,GAAG,EAAC,kBAAC,EAAC,EAAE', * // sourcesContent: [ 'abc/*.js' ] }, * // position: { line: 1, column: 28 }, * // content: {}, * // files: {}, * // idx: 6 } * ``` * @param {String} `pattern` Glob pattern to parse and compile. * @param {Object} `options` Any [options](#options) to change how parsing and compiling is performed. * @return {Object} Returns an object with the parsed AST, compiled string and optional source map. * @api public */ nanomatch.create = function(pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('expected a string'); } function create() { return nanomatch.compile(nanomatch.parse(pattern, options), options); } return memoize('create', pattern, options, create); }; /** * Parse the given `str` with the given `options`. * * ```js * var nm = require('nanomatch'); * nm.parse(pattern[, options]); * * var ast = nm.parse('a/{b,c}/d'); * console.log(ast); * // { type: 'root', * // errors: [], * // input: 'a/{b,c}/d', * // nodes: * // [ { type: 'bos', val: '' }, * // { type: 'text', val: 'a/' }, * // { type: 'brace', * // nodes: * // [ { type: 'brace.open', val: '{' }, * // { type: 'text', val: 'b,c' }, * // { type: 'brace.close', val: '}' } ] }, * // { type: 'text', val: '/d' }, * // { type: 'eos', val: '' } ] } * ``` * @param {String} `str` * @param {Object} `options` * @return {Object} Returns an AST * @api public */ nanomatch.parse = function(pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('expected a string'); } function parse() { var snapdragon = utils.instantiate(null, options); parsers(snapdragon, options); var ast = snapdragon.parse(pattern, options); utils.define(ast, 'snapdragon', snapdragon); ast.input = pattern; return ast; } return memoize('parse', pattern, options, parse); }; /** * Compile the given `ast` or string with the given `options`. * * ```js * var nm = require('nanomatch'); * nm.compile(ast[, options]); * * var ast = nm.parse('a/{b,c}/d'); * console.log(nm.compile(ast)); * // { options: { source: 'string' }, * // state: {}, * // compilers: * // { eos: [Function], * // noop: [Function], * // bos: [Function], * // brace: [Function], * // 'brace.open': [Function], * // text: [Function], * // 'brace.close': [Function] }, * // output: [ 'a/(b|c)/d' ], * // ast: * // { ... }, * // parsingErrors: [] } * ``` * @param {Object|String} `ast` * @param {Object} `options` * @return {Object} Returns an object that has an `output` property with the compiled string. * @api public */ nanomatch.compile = function(ast, options) { if (typeof ast === 'string') { ast = nanomatch.parse(ast, options); } function compile() { var snapdragon = utils.instantiate(ast, options); compilers(snapdragon, options); return snapdragon.compile(ast, options); } return memoize('compile', ast.input, options, compile); }; /** * Clear the regex cache. * * ```js * nm.clearCache(); * ``` * @api public */ nanomatch.clearCache = function() { nanomatch.cache.__data__ = {}; }; /** * Compose a matcher function with the given patterns. * This allows matcher functions to be compiled once and * called multiple times. */ function compose(patterns, options, matcher) { var matchers; return memoize('compose', String(patterns), options, function() { return function(file) { // delay composition until it's invoked the first time, // after that it won't be called again if (!matchers) { matchers = []; for (var i = 0; i < patterns.length; i++) { matchers.push(matcher(patterns[i], options)); } } var len = matchers.length; while (len--) { if (matchers[len](file) === true) { return true; } } return false; }; }); } /** * Memoize a generated regex or function. A unique key is generated * from the `type` (usually method name), the `pattern`, and * user-defined options. */ function memoize(type, pattern, options, fn) { var key = utils.createKey(type + '=' + pattern, options); if (options && options.cache === false) { return fn(pattern, options); } if (cache.has(type, key)) { return cache.get(type, key); } var val = fn(pattern, options); cache.set(type, key, val); return val; } /** * Expose compiler, parser and cache on `nanomatch` */ nanomatch.compilers = compilers; nanomatch.parsers = parsers; nanomatch.cache = cache; /** * Expose `nanomatch` * @type {Function} */ module.exports = nanomatch; /***/ }), /* 494 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Nanomatch compilers */ module.exports = function(nanomatch, options) { var star = '[^/]*?'; var ast = nanomatch.ast = nanomatch.parser.ast; ast.state = nanomatch.parser.state; nanomatch.compiler.state = ast.state; nanomatch.compiler /** * Negation / escaping */ .set('not', function(node) { var prev = this.prev(); if (this.options.nonegate === true || prev.type !== 'bos') { return this.emit('\\' + node.val, node); } return this.emit(node.val, node); }) .set('escape', function(node) { if (this.options.unescape && /^[\w_.-]/.test(node.val)) { return this.emit(node.val, node); } return this.emit('\\' + node.val, node); }) .set('quoted', function(node) { return this.emit(node.val, node); }) /** * Regex */ .set('dollar', function(node) { if (node.parent.type === 'bracket') { return this.emit(node.val, node); } return this.emit('\\' + node.val, node); }) /** * Dot: "." */ .set('dot', function(node) { if (node.dotfiles === true) this.dotfiles = true; return this.emit('\\' + node.val, node); }) /** * Slashes: "/" and "\" */ .set('backslash', function(node) { return this.emit(node.val, node); }) .set('slash', function(node, nodes, i) { var val = '\\' + node.val; var parent = node.parent; var prev = this.prev(); // set "node.hasSlash" to true on all ancestor parens nodes while (parent.type === 'paren' && !parent.hasSlash) { parent.hasSlash = true; parent = parent.parent; } if (prev.addQmark) { val += '?'; } // word boundary if (node.rest.slice(0, 2) === '\\b') { return this.emit(val, node); } // globstars if (node.parsed === '**' || node.parsed === './**') { this.output = '(?:' + this.output; return this.emit(val + ')?', node); } // negation if (node.parsed === '!**' && this.options.nonegate !== true) { return this.emit(val + '?\\b', node); } return this.emit(val, node); }) /** * Square brackets */ .set('bracket', function(node) { var close = node.close; var open = !node.escaped ? '[' : '\\['; var negated = node.negated; var inner = node.inner; var val = node.val; if (node.escaped === true) { inner = inner.replace(/\\?(\W)/g, '\\$1'); negated = ''; } if (inner === ']-') { inner = '\\]\\-'; } if (negated && inner.indexOf('.') === -1) { inner += '.'; } if (negated && inner.indexOf('/') === -1) { inner += '/'; } val = open + negated + inner + close; return this.emit(val, node); }) /** * Square: "[.]" (only matches a single character in brackets) */ .set('square', function(node) { var val = !/^\w/.test(node.val) ? '\\' + node.val : node.val; return this.emit(val, node); }) /** * Question mark: "?" */ .set('qmark', function(node) { var prev = this.prev(); var val = '[^.\\\\/]'; if (this.options.dot || (prev.type !== 'bos' && prev.type !== 'slash')) { val = '[^\\\\/]'; } if (node.parsed.slice(-1) === '(') { var ch = node.rest.charAt(0); if (ch === '!' || ch === '=' || ch === ':') { return this.emit(node.val, node); } } if (node.val.length > 1) { val += '{' + node.val.length + '}'; } return this.emit(val, node); }) /** * Plus */ .set('plus', function(node) { var prev = node.parsed.slice(-1); if (prev === ']' || prev === ')') { return this.emit(node.val, node); } if (!this.output || (/[?*+]/.test(ch) && node.parent.type !== 'bracket')) { return this.emit('\\+', node); } var ch = this.output.slice(-1); if (/\w/.test(ch) && !node.inside) { return this.emit('+\\+?', node); } return this.emit('+', node); }) /** * globstar: '**' */ .set('globstar', function(node, nodes, i) { if (!this.output) { this.state.leadingGlobstar = true; } var next = this.next(); var prev = this.prev(); var next2 = this.next(2); var prev2 = this.prev(2); var type = prev.type; var val = node.val; if (prev.type === 'slash' && next.type === 'slash') { if (prev2.type === 'text') { this.output += '?'; if (next2.type !== 'text') { this.output += '\\b'; } } } var parsed = node.parsed; if (parsed.charAt(0) === '!') { parsed = parsed.slice(1); } var isInside = node.isInside.paren || node.isInside.brace; if (parsed && type !== 'slash' && type !== 'bos' && !isInside) { val = star; } else { val = this.options.dot !== true ? '(?:(?!(?:\\/|^)\\.).)*?' : '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/))(?!\\.{2}).)*?'; } if ((type === 'slash' || type === 'bos') && this.options.dot !== true) { val = '(?!\\.)' + val; } if (prev.type === 'slash' && next.type === 'slash' && prev2.type !== 'text') { if (next2.type === 'text' || next2.type === 'star') { node.addQmark = true; } } if (this.options.capture) { val = '(' + val + ')'; } return this.emit(val, node); }) /** * Star: "*" */ .set('star', function(node, nodes, i) { var prior = nodes[i - 2] || {}; var prev = this.prev(); var next = this.next(); var type = prev.type; function isStart(n) { return n.type === 'bos' || n.type === 'slash'; } if (this.output === '' && this.options.contains !== true) { this.output = '(?!\\/)'; } if (type === 'bracket' && this.options.bash === false) { var str = next && next.type === 'bracket' ? star : '*?'; if (!prev.nodes || prev.nodes[1].type !== 'posix') { return this.emit(str, node); } } var prefix = !this.dotfiles && type !== 'text' && type !== 'escape' ? (this.options.dot ? '(?!(?:^|\\/)\\.{1,2}(?:$|\\/))' : '(?!\\.)') : ''; if (isStart(prev) || (isStart(prior) && type === 'not')) { if (prefix !== '(?!\\.)') { prefix += '(?!(\\.{2}|\\.\\/))(?=.)'; } else { prefix += '(?=.)'; } } else if (prefix === '(?!\\.)') { prefix = ''; } if (prev.type === 'not' && prior.type === 'bos' && this.options.dot === true) { this.output = '(?!\\.)' + this.output; } var output = prefix + star; if (this.options.capture) { output = '(' + output + ')'; } return this.emit(output, node); }) /** * Text */ .set('text', function(node) { return this.emit(node.val, node); }) /** * End-of-string */ .set('eos', function(node) { var prev = this.prev(); var val = node.val; this.output = '(?:(?:\\.(?:\\/|\\\\))(?=.))?' + this.output; if (this.state.metachar && prev.type !== 'qmark' && prev.type !== 'slash') { val += (this.options.contains ? '(?:\\/|\\\\)?' : '(?:(?:\\/|\\\\)|$)'); } return this.emit(val, node); }); /** * Allow custom compilers to be passed on options */ if (options && typeof options.compilers === 'function') { options.compilers(nanomatch.compiler); } }; /***/ }), /* 495 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var regexNot = __webpack_require__(400); var toRegex = __webpack_require__(389); var isOdd = __webpack_require__(496); /** * Characters to use in negation regex (we want to "not" match * characters that are matched by other parsers) */ var cached; var NOT_REGEX = '[!*+?$^"\'.\\\\/\\[]+'; var not = createTextRegex(NOT_REGEX); /** * Nanomatch parsers */ module.exports = function(nanomatch, options) { var parser = nanomatch.parser; var opts = parser.options; parser.state = { slashes: 0, paths: [] }; parser.ast.state = parser.state; parser /** * Beginning-of-string */ .capture('prefix', function() { if (this.parsed) return; var pos = this.position(); var m = this.match(/^\.[\\/]/); if (!m) return; this.state.strictOpen = !!this.options.strictOpen; this.state.addPrefix = true; }) /** * Escape: "\\." */ .capture('escape', function() { if (this.isInside('bracket')) return; var pos = this.position(); var m = this.match(/^(?:\\(.)|([$^]))/); if (!m) return; return pos({ type: 'escape', val: m[2] || m[1] }); }) /** * Quoted strings */ .capture('quoted', function() { var pos = this.position(); var m = this.match(/^["']/); if (!m) return; var quote = m[0]; if (this.input.indexOf(quote) === -1) { return pos({ type: 'escape', val: quote }); } var tok = advanceTo(this.input, quote); this.consume(tok.len); return pos({ type: 'quoted', val: tok.esc }); }) /** * Negations: "!" */ .capture('not', function() { var parsed = this.parsed; var pos = this.position(); var m = this.match(this.notRegex || /^\!+/); if (!m) return; var val = m[0]; var isNegated = isOdd(val.length); if (parsed === '' && !isNegated) { val = ''; } // if nothing has been parsed, we know `!` is at the start, // so we need to wrap the result in a negation regex if (parsed === '' && isNegated && this.options.nonegate !== true) { this.bos.val = '(?!^(?:'; this.append = ')$).*'; val = ''; } return pos({ type: 'not', val: val }); }) /** * Dot: "." */ .capture('dot', function() { var parsed = this.parsed; var pos = this.position(); var m = this.match(/^\.+/); if (!m) return; var val = m[0]; this.state.dot = val === '.' && (parsed === '' || parsed.slice(-1) === '/'); return pos({ type: 'dot', dotfiles: this.state.dot, val: val }); }) /** * Plus: "+" */ .capture('plus', /^\+(?!\()/) /** * Question mark: "?" */ .capture('qmark', function() { var parsed = this.parsed; var pos = this.position(); var m = this.match(/^\?+(?!\()/); if (!m) return; this.state.metachar = true; this.state.qmark = true; return pos({ type: 'qmark', parsed: parsed, val: m[0] }); }) /** * Globstar: "**" */ .capture('globstar', function() { var parsed = this.parsed; var pos = this.position(); var m = this.match(/^\*{2}(?![*(])(?=[,\/)]|$)/); if (!m) return; var type = opts.noglobstar !== true ? 'globstar' : 'star'; var node = pos({type: type, parsed: parsed}); while (this.input.slice(0, 4) === '/**/') { this.input = this.input.slice(3); } node.isInside = { brace: this.isInside('brace'), paren: this.isInside('paren') }; if (type === 'globstar') { this.state.globstar = true; node.val = '**'; } else { this.state.star = true; node.val = '*'; } this.state.metachar = true; return node; }) /** * Star: "*" */ .capture('star', function() { var pos = this.position(); var starRe = /^(?:\*(?![*(])|[*]{3,}(?!\()|[*]{2}(?![(\/]|$)|\*(?=\*\())/; var m = this.match(starRe); if (!m) return; this.state.metachar = true; this.state.star = true; return pos({ type: 'star', val: m[0] }); }) /** * Slash: "/" */ .capture('slash', function() { var pos = this.position(); var m = this.match(/^\//); if (!m) return; this.state.slashes++; return pos({ type: 'slash', val: m[0] }); }) /** * Backslash: "\\" */ .capture('backslash', function() { var pos = this.position(); var m = this.match(/^\\(?![*+?(){}[\]'"])/); if (!m) return; var val = m[0]; if (this.isInside('bracket')) { val = '\\'; } else if (val.length > 1) { val = '\\\\'; } return pos({ type: 'backslash', val: val }); }) /** * Square: "[.]" */ .capture('square', function() { if (this.isInside('bracket')) return; var pos = this.position(); var m = this.match(/^\[([^!^\\])\]/); if (!m) return; return pos({ type: 'square', val: m[1] }); }) /** * Brackets: "[...]" (basic, this can be overridden by other parsers) */ .capture('bracket', function() { var pos = this.position(); var m = this.match(/^(?:\[([!^]?)([^\]]+|\]\-)(\]|[^*+?]+)|\[)/); if (!m) return; var val = m[0]; var negated = m[1] ? '^' : ''; var inner = (m[2] || '').replace(/\\\\+/, '\\\\'); var close = m[3] || ''; if (m[2] && inner.length < m[2].length) { val = val.replace(/\\\\+/, '\\\\'); } var esc = this.input.slice(0, 2); if (inner === '' && esc === '\\]') { inner += esc; this.consume(2); var str = this.input; var idx = -1; var ch; while ((ch = str[++idx])) { this.consume(1); if (ch === ']') { close = ch; break; } inner += ch; } } return pos({ type: 'bracket', val: val, escaped: close !== ']', negated: negated, inner: inner, close: close }); }) /** * Text */ .capture('text', function() { if (this.isInside('bracket')) return; var pos = this.position(); var m = this.match(not); if (!m || !m[0]) return; return pos({ type: 'text', val: m[0] }); }); /** * Allow custom parsers to be passed on options */ if (options && typeof options.parsers === 'function') { options.parsers(nanomatch.parser); } }; /** * Advance to the next non-escaped character */ function advanceTo(input, endChar) { var ch = input.charAt(0); var tok = { len: 1, val: '', esc: '' }; var idx = 0; function advance() { if (ch !== '\\') { tok.esc += '\\' + ch; tok.val += ch; } ch = input.charAt(++idx); tok.len++; if (ch === '\\') { advance(); advance(); } } while (ch && ch !== endChar) { advance(); } return tok; } /** * Create text regex */ function createTextRegex(pattern) { if (cached) return cached; var opts = {contains: true, strictClose: false}; var not = regexNot.create(pattern, opts); var re = toRegex('^(?:[*]\\(|' + not + ')', opts); return (cached = re); } /** * Expose negation string */ module.exports.not = NOT_REGEX; /***/ }), /* 496 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * is-odd * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. */ var isNumber = __webpack_require__(412); module.exports = function isOdd(i) { if (!isNumber(i)) { throw new TypeError('is-odd expects a number.'); } if (Number(i) !== Math.floor(i)) { throw new RangeError('is-odd expects an integer.'); } return !!(~~i & 1); }; /***/ }), /* 497 */ /***/ (function(module, exports, __webpack_require__) { module.exports = new (__webpack_require__(498))(); /***/ }), /* 498 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * fragment-cache * * Copyright (c) 2016-2017, Jon Schlinkert. * Released under the MIT License. */ var MapCache = __webpack_require__(490); /** * Create a new `FragmentCache` with an optional object to use for `caches`. * * ```js * var fragment = new FragmentCache(); * ``` * @name FragmentCache * @param {String} `cacheName` * @return {Object} Returns the [map-cache][] instance. * @api public */ function FragmentCache(caches) { this.caches = caches || {}; } /** * Prototype */ FragmentCache.prototype = { /** * Get cache `name` from the `fragment.caches` object. Creates a new * `MapCache` if it doesn't already exist. * * ```js * var cache = fragment.cache('files'); * console.log(fragment.caches.hasOwnProperty('files')); * //=> true * ``` * @name .cache * @param {String} `cacheName` * @return {Object} Returns the [map-cache][] instance. * @api public */ cache: function(cacheName) { return this.caches[cacheName] || (this.caches[cacheName] = new MapCache()); }, /** * Set a value for property `key` on cache `name` * * ```js * fragment.set('files', 'somefile.js', new File({path: 'somefile.js'})); * ``` * @name .set * @param {String} `name` * @param {String} `key` Property name to set * @param {any} `val` The value of `key` * @return {Object} The cache instance for chaining * @api public */ set: function(cacheName, key, val) { var cache = this.cache(cacheName); cache.set(key, val); return cache; }, /** * Returns true if a non-undefined value is set for `key` on fragment cache `name`. * * ```js * var cache = fragment.cache('files'); * cache.set('somefile.js'); * * console.log(cache.has('somefile.js')); * //=> true * * console.log(cache.has('some-other-file.js')); * //=> false * ``` * @name .has * @param {String} `name` Cache name * @param {String} `key` Optionally specify a property to check for on cache `name` * @return {Boolean} * @api public */ has: function(cacheName, key) { return typeof this.get(cacheName, key) !== 'undefined'; }, /** * Get `name`, or if specified, the value of `key`. Invokes the [cache]() method, * so that cache `name` will be created it doesn't already exist. If `key` is not passed, * the entire cache (`name`) is returned. * * ```js * var Vinyl = require('vinyl'); * var cache = fragment.cache('files'); * cache.set('somefile.js', new Vinyl({path: 'somefile.js'})); * console.log(cache.get('somefile.js')); * //=> * ``` * @name .get * @param {String} `name` * @return {Object} Returns cache `name`, or the value of `key` if specified * @api public */ get: function(name, key) { var cache = this.cache(name); if (typeof key === 'string') { return cache.get(key); } return cache; } }; /** * Expose `FragmentCache` */ exports = module.exports = FragmentCache; /***/ }), /* 499 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = module.exports; var path = __webpack_require__(16); /** * Module dependencies */ var Snapdragon = __webpack_require__(428); utils.define = __webpack_require__(500); utils.diff = __webpack_require__(501); utils.extend = __webpack_require__(398); utils.pick = __webpack_require__(502); utils.typeOf = __webpack_require__(503); utils.unique = __webpack_require__(401); /** * Returns true if the given value is effectively an empty string */ utils.isEmptyString = function(val) { return String(val) === '' || String(val) === './'; }; /** * Returns true if the platform is windows, or `path.sep` is `\\`. * This is defined as a function to allow `path.sep` to be set in unit tests, * or by the user, if there is a reason to do so. * @return {Boolean} */ utils.isWindows = function() { return path.sep === '\\' || process.platform === 'win32'; }; /** * Return the last element from an array */ utils.last = function(arr, n) { return arr[arr.length - (n || 1)]; }; /** * Get the `Snapdragon` instance to use */ utils.instantiate = function(ast, options) { var snapdragon; // if an instance was created by `.parse`, use that instance if (utils.typeOf(ast) === 'object' && ast.snapdragon) { snapdragon = ast.snapdragon; // if the user supplies an instance on options, use that instance } else if (utils.typeOf(options) === 'object' && options.snapdragon) { snapdragon = options.snapdragon; // create a new instance } else { snapdragon = new Snapdragon(options); } utils.define(snapdragon, 'parse', function(str, options) { var parsed = Snapdragon.prototype.parse.apply(this, arguments); parsed.input = str; // escape unmatched brace/bracket/parens var last = this.parser.stack.pop(); if (last && this.options.strictErrors !== true) { var open = last.nodes[0]; var inner = last.nodes[1]; if (last.type === 'bracket') { if (inner.val.charAt(0) === '[') { inner.val = '\\' + inner.val; } } else { open.val = '\\' + open.val; var sibling = open.parent.nodes[1]; if (sibling.type === 'star') { sibling.loose = true; } } } // add non-enumerable parser reference utils.define(parsed, 'parser', this.parser); return parsed; }); return snapdragon; }; /** * Create the key to use for memoization. The key is generated * by iterating over the options and concatenating key-value pairs * to the pattern string. */ utils.createKey = function(pattern, options) { if (typeof options === 'undefined') { return pattern; } var key = pattern; for (var prop in options) { if (options.hasOwnProperty(prop)) { key += ';' + prop + '=' + String(options[prop]); } } return key; }; /** * Cast `val` to an array * @return {Array} */ utils.arrayify = function(val) { if (typeof val === 'string') return [val]; return val ? (Array.isArray(val) ? val : [val]) : []; }; /** * Return true if `val` is a non-empty string */ utils.isString = function(val) { return typeof val === 'string'; }; /** * Return true if `val` is a non-empty string */ utils.isRegex = function(val) { return utils.typeOf(val) === 'regexp'; }; /** * Return true if `val` is a non-empty string */ utils.isObject = function(val) { return utils.typeOf(val) === 'object'; }; /** * Escape regex characters in the given string */ utils.escapeRegex = function(str) { return str.replace(/[-[\]{}()^$|*+?.\\\/\s]/g, '\\$&'); }; /** * Combines duplicate characters in the provided `input` string. * @param {String} `input` * @returns {String} */ utils.combineDupes = function(input, patterns) { patterns = utils.arrayify(patterns).join('|').split('|'); patterns = patterns.map(function(s) { return s.replace(/\\?([+*\\/])/g, '\\$1'); }); var substr = patterns.join('|'); var regex = new RegExp('(' + substr + ')(?=\\1)', 'g'); return input.replace(regex, ''); }; /** * Returns true if the given `str` has special characters */ utils.hasSpecialChars = function(str) { return /(?:(?:(^|\/)[!.])|[*?+()|\[\]{}]|[+@]\()/.test(str); }; /** * Normalize slashes in the given filepath. * * @param {String} `filepath` * @return {String} */ utils.toPosixPath = function(str) { return str.replace(/\\+/g, '/'); }; /** * Strip backslashes before special characters in a string. * * @param {String} `str` * @return {String} */ utils.unescape = function(str) { return utils.toPosixPath(str.replace(/\\(?=[*+?!.])/g, '')); }; /** * Strip the drive letter from a windows filepath * @param {String} `fp` * @return {String} */ utils.stripDrive = function(fp) { return utils.isWindows() ? fp.replace(/^[a-z]:[\\\/]+?/i, '/') : fp; }; /** * Strip the prefix from a filepath * @param {String} `fp` * @return {String} */ utils.stripPrefix = function(str) { if (str.charAt(0) === '.' && (str.charAt(1) === '/' || str.charAt(1) === '\\')) { return str.slice(2); } return str; }; /** * Returns true if `str` is a common character that doesn't need * to be processed to be used for matching. * @param {String} `str` * @return {Boolean} */ utils.isSimpleChar = function(str) { return str === '' || str === ' ' || str === '.'; }; /** * Returns true if the given str is an escaped or * unescaped path character */ utils.isSlash = function(str) { return str === '/' || str === '\\/' || str === '\\' || str === '\\\\'; }; /** * Returns a function that returns true if the given * pattern matches or contains a `filepath` * * @param {String} `pattern` * @return {Function} */ utils.matchPath = function(pattern, options) { return (options && options.contains) ? utils.containsPattern(pattern, options) : utils.equalsPattern(pattern, options); }; /** * Returns true if the given (original) filepath or unixified path are equal * to the given pattern. */ utils._equals = function(filepath, unixPath, pattern) { return pattern === filepath || pattern === unixPath; }; /** * Returns true if the given (original) filepath or unixified path contain * the given pattern. */ utils._contains = function(filepath, unixPath, pattern) { return filepath.indexOf(pattern) !== -1 || unixPath.indexOf(pattern) !== -1; }; /** * Returns a function that returns true if the given * pattern is the same as a given `filepath` * * @param {String} `pattern` * @return {Function} */ utils.equalsPattern = function(pattern, options) { var unixify = utils.unixify(options); options = options || {}; return function fn(filepath) { var equal = utils._equals(filepath, unixify(filepath), pattern); if (equal === true || options.nocase !== true) { return equal; } var lower = filepath.toLowerCase(); return utils._equals(lower, unixify(lower), pattern); }; }; /** * Returns a function that returns true if the given * pattern contains a `filepath` * * @param {String} `pattern` * @return {Function} */ utils.containsPattern = function(pattern, options) { var unixify = utils.unixify(options); options = options || {}; return function(filepath) { var contains = utils._contains(filepath, unixify(filepath), pattern); if (contains === true || options.nocase !== true) { return contains; } var lower = filepath.toLowerCase(); return utils._contains(lower, unixify(lower), pattern); }; }; /** * Returns a function that returns true if the given * regex matches the `filename` of a file path. * * @param {RegExp} `re` Matching regex * @return {Function} */ utils.matchBasename = function(re) { return function(filepath) { return re.test(filepath) || re.test(path.basename(filepath)); }; }; /** * Returns the given value unchanced. * @return {any} */ utils.identity = function(val) { return val; }; /** * Determines the filepath to return based on the provided options. * @return {any} */ utils.value = function(str, unixify, options) { if (options && options.unixify === false) { return str; } if (options && typeof options.unixify === 'function') { return options.unixify(str); } return unixify(str); }; /** * Returns a function that normalizes slashes in a string to forward * slashes, strips `./` from beginning of paths, and optionally unescapes * special characters. * @return {Function} */ utils.unixify = function(options) { var opts = options || {}; return function(filepath) { if (opts.stripPrefix !== false) { filepath = utils.stripPrefix(filepath); } if (opts.unescape === true) { filepath = utils.unescape(filepath); } if (opts.unixify === true || utils.isWindows()) { filepath = utils.toPosixPath(filepath); } return filepath; }; }; /***/ }), /* 500 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * define-property * * Copyright (c) 2015, 2017, Jon Schlinkert. * Released under the MIT License. */ var isDescriptor = __webpack_require__(420); module.exports = function defineProperty(obj, prop, val) { if (typeof obj !== 'object' && typeof obj !== 'function') { throw new TypeError('expected an object or function.'); } if (typeof prop !== 'string') { throw new TypeError('expected `prop` to be a string.'); } if (isDescriptor(val) && ('set' in val || 'get' in val)) { return Object.defineProperty(obj, prop, val); } return Object.defineProperty(obj, prop, { configurable: true, enumerable: false, writable: true, value: val }); }; /***/ }), /* 501 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * arr-diff * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ module.exports = function diff(arr/*, arrays*/) { var len = arguments.length; var idx = 0; while (++idx < len) { arr = diffArray(arr, arguments[idx]); } return arr; }; function diffArray(one, two) { if (!Array.isArray(two)) { return one.slice(); } var tlen = two.length var olen = one.length; var idx = -1; var arr = []; while (++idx < olen) { var ele = one[idx]; var hasEle = false; for (var i = 0; i < tlen; i++) { var val = two[i]; if (ele === val) { hasEle = true; break; } } if (hasEle === false) { arr.push(ele); } } return arr; } /***/ }), /* 502 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * object.pick * * Copyright (c) 2014-2015 Jon Schlinkert, contributors. * Licensed under the MIT License */ var isObject = __webpack_require__(408); module.exports = function pick(obj, keys) { if (!isObject(obj) && typeof obj !== 'function') { return {}; } var res = {}; if (typeof keys === 'string') { if (keys in obj) { res[keys] = obj[keys]; } return res; } var len = keys.length; var idx = -1; while (++idx < len) { var key = keys[idx]; if (key in obj) { res[key] = obj[key]; } } return res; }; /***/ }), /* 503 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; /** * Get the native `typeof` a value. * * @param {*} `val` * @return {*} Native javascript type */ module.exports = function kindOf(val) { var type = typeof val; // primitivies if (type === 'undefined') { return 'undefined'; } if (val === null) { return 'null'; } if (val === true || val === false || val instanceof Boolean) { return 'boolean'; } if (type === 'string' || val instanceof String) { return 'string'; } if (type === 'number' || val instanceof Number) { return 'number'; } // functions if (type === 'function' || val instanceof Function) { if (typeof val.constructor.name !== 'undefined' && val.constructor.name.slice(0, 9) === 'Generator') { return 'generatorfunction'; } return 'function'; } // array if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) { return 'array'; } // check for instances of RegExp and Date before calling `toString` if (val instanceof RegExp) { return 'regexp'; } if (val instanceof Date) { return 'date'; } // other objects type = toString.call(val); if (type === '[object RegExp]') { return 'regexp'; } if (type === '[object Date]') { return 'date'; } if (type === '[object Arguments]') { return 'arguments'; } if (type === '[object Error]') { return 'error'; } if (type === '[object Promise]') { return 'promise'; } // buffer if (isBuffer(val)) { return 'buffer'; } // es6: Map, WeakMap, Set, WeakSet if (type === '[object Set]') { return 'set'; } if (type === '[object WeakSet]') { return 'weakset'; } if (type === '[object Map]') { return 'map'; } if (type === '[object WeakMap]') { return 'weakmap'; } if (type === '[object Symbol]') { return 'symbol'; } if (type === '[object Map Iterator]') { return 'mapiterator'; } if (type === '[object Set Iterator]') { return 'setiterator'; } if (type === '[object String Iterator]') { return 'stringiterator'; } if (type === '[object Array Iterator]') { return 'arrayiterator'; } // typed arrays if (type === '[object Int8Array]') { return 'int8array'; } if (type === '[object Uint8Array]') { return 'uint8array'; } if (type === '[object Uint8ClampedArray]') { return 'uint8clampedarray'; } if (type === '[object Int16Array]') { return 'int16array'; } if (type === '[object Uint16Array]') { return 'uint16array'; } if (type === '[object Int32Array]') { return 'int32array'; } if (type === '[object Uint32Array]') { return 'uint32array'; } if (type === '[object Float32Array]') { return 'float32array'; } if (type === '[object Float64Array]') { return 'float64array'; } // must be a plain object return 'object'; }; /** * If you need to support Safari 5-7 (8-10 yr-old browser), * take a look at https://github.com/feross/is-buffer */ function isBuffer(val) { return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); } /***/ }), /* 504 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Module dependencies */ var extend = __webpack_require__(398); var unique = __webpack_require__(401); var toRegex = __webpack_require__(389); /** * Local dependencies */ var compilers = __webpack_require__(505); var parsers = __webpack_require__(511); var Extglob = __webpack_require__(513); var utils = __webpack_require__(512); var MAX_LENGTH = 1024 * 64; /** * Convert the given `extglob` pattern into a regex-compatible string. Returns * an object with the compiled result and the parsed AST. * * ```js * var extglob = require('extglob'); * console.log(extglob('*.!(*a)')); * //=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' * ``` * @param {String} `pattern` * @param {Object} `options` * @return {String} * @api public */ function extglob(pattern, options) { return extglob.create(pattern, options).output; } /** * Takes an array of strings and an extglob pattern and returns a new * array that contains only the strings that match the pattern. * * ```js * var extglob = require('extglob'); * console.log(extglob.match(['a.a', 'a.b', 'a.c'], '*.!(*a)')); * //=> ['a.b', 'a.c'] * ``` * @param {Array} `list` Array of strings to match * @param {String} `pattern` Extglob pattern * @param {Object} `options` * @return {Array} Returns an array of matches * @api public */ extglob.match = function(list, pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('expected pattern to be a string'); } list = utils.arrayify(list); var isMatch = extglob.matcher(pattern, options); var len = list.length; var idx = -1; var matches = []; while (++idx < len) { var ele = list[idx]; if (isMatch(ele)) { matches.push(ele); } } // if no options were passed, uniquify results and return if (typeof options === 'undefined') { return unique(matches); } if (matches.length === 0) { if (options.failglob === true) { throw new Error('no matches found for "' + pattern + '"'); } if (options.nonull === true || options.nullglob === true) { return [pattern.split('\\').join('')]; } } return options.nodupes !== false ? unique(matches) : matches; }; /** * Returns true if the specified `string` matches the given * extglob `pattern`. * * ```js * var extglob = require('extglob'); * * console.log(extglob.isMatch('a.a', '*.!(*a)')); * //=> false * console.log(extglob.isMatch('a.b', '*.!(*a)')); * //=> true * ``` * @param {String} `string` String to match * @param {String} `pattern` Extglob pattern * @param {String} `options` * @return {Boolean} * @api public */ extglob.isMatch = function(str, pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('expected pattern to be a string'); } if (typeof str !== 'string') { throw new TypeError('expected a string'); } if (pattern === str) { return true; } if (pattern === '' || pattern === ' ' || pattern === '.') { return pattern === str; } var isMatch = utils.memoize('isMatch', pattern, options, extglob.matcher); return isMatch(str); }; /** * Returns true if the given `string` contains the given pattern. Similar to `.isMatch` but * the pattern can match any part of the string. * * ```js * var extglob = require('extglob'); * console.log(extglob.contains('aa/bb/cc', '*b')); * //=> true * console.log(extglob.contains('aa/bb/cc', '*d')); * //=> false * ``` * @param {String} `str` The string to match. * @param {String} `pattern` Glob pattern to use for matching. * @param {Object} `options` * @return {Boolean} Returns true if the patter matches any part of `str`. * @api public */ extglob.contains = function(str, pattern, options) { if (typeof str !== 'string') { throw new TypeError('expected a string'); } if (pattern === '' || pattern === ' ' || pattern === '.') { return pattern === str; } var opts = extend({}, options, {contains: true}); opts.strictClose = false; opts.strictOpen = false; return extglob.isMatch(str, pattern, opts); }; /** * Takes an extglob pattern and returns a matcher function. The returned * function takes the string to match as its only argument. * * ```js * var extglob = require('extglob'); * var isMatch = extglob.matcher('*.!(*a)'); * * console.log(isMatch('a.a')); * //=> false * console.log(isMatch('a.b')); * //=> true * ``` * @param {String} `pattern` Extglob pattern * @param {String} `options` * @return {Boolean} * @api public */ extglob.matcher = function(pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('expected pattern to be a string'); } function matcher() { var re = extglob.makeRe(pattern, options); return function(str) { return re.test(str); }; } return utils.memoize('matcher', pattern, options, matcher); }; /** * Convert the given `extglob` pattern into a regex-compatible string. Returns * an object with the compiled result and the parsed AST. * * ```js * var extglob = require('extglob'); * console.log(extglob.create('*.!(*a)').output); * //=> '(?!\\.)[^/]*?\\.(?!(?!\\.)[^/]*?a\\b).*?' * ``` * @param {String} `str` * @param {Object} `options` * @return {String} * @api public */ extglob.create = function(pattern, options) { if (typeof pattern !== 'string') { throw new TypeError('expected pattern to be a string'); } function create() { var ext = new Extglob(options); var ast = ext.parse(pattern, options); return ext.compile(ast, options); } return utils.memoize('create', pattern, options, create); }; /** * Returns an array of matches captured by `pattern` in `string`, or `null` * if the pattern did not match. * * ```js * var extglob = require('extglob'); * extglob.capture(pattern, string[, options]); * * console.log(extglob.capture('test/*.js', 'test/foo.js')); * //=> ['foo'] * console.log(extglob.capture('test/*.js', 'foo/bar.css')); * //=> null * ``` * @param {String} `pattern` Glob pattern to use for matching. * @param {String} `string` String to match * @param {Object} `options` See available [options](#options) for changing how matches are performed * @return {Boolean} Returns an array of captures if the string matches the glob pattern, otherwise `null`. * @api public */ extglob.capture = function(pattern, str, options) { var re = extglob.makeRe(pattern, extend({capture: true}, options)); function match() { return function(string) { var match = re.exec(string); if (!match) { return null; } return match.slice(1); }; } var capture = utils.memoize('capture', pattern, options, match); return capture(str); }; /** * Create a regular expression from the given `pattern` and `options`. * * ```js * var extglob = require('extglob'); * var re = extglob.makeRe('*.!(*a)'); * console.log(re); * //=> /^[^\/]*?\.(?![^\/]*?a)[^\/]*?$/ * ``` * @param {String} `pattern` The pattern to convert to regex. * @param {Object} `options` * @return {RegExp} * @api public */ extglob.makeRe = function(pattern, options) { if (pattern instanceof RegExp) { return pattern; } if (typeof pattern !== 'string') { throw new TypeError('expected pattern to be a string'); } if (pattern.length > MAX_LENGTH) { throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters'); } function makeRe() { var opts = extend({strictErrors: false}, options); if (opts.strictErrors === true) opts.strict = true; var res = extglob.create(pattern, opts); return toRegex(res.output, opts); } var regex = utils.memoize('makeRe', pattern, options, makeRe); if (regex.source.length > MAX_LENGTH) { throw new SyntaxError('potentially malicious regex detected'); } return regex; }; /** * Cache */ extglob.cache = utils.cache; extglob.clearCache = function() { extglob.cache.__data__ = {}; }; /** * Expose `Extglob` constructor, parsers and compilers */ extglob.Extglob = Extglob; extglob.compilers = compilers; extglob.parsers = parsers; /** * Expose `extglob` * @type {Function} */ module.exports = extglob; /***/ }), /* 505 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var brackets = __webpack_require__(506); /** * Extglob compilers */ module.exports = function(extglob) { function star() { if (typeof extglob.options.star === 'function') { return extglob.options.star.apply(this, arguments); } if (typeof extglob.options.star === 'string') { return extglob.options.star; } return '.*?'; } /** * Use `expand-brackets` compilers */ extglob.use(brackets.compilers); extglob.compiler /** * Escaped: "\\*" */ .set('escape', function(node) { return this.emit(node.val, node); }) /** * Dot: "." */ .set('dot', function(node) { return this.emit('\\' + node.val, node); }) /** * Question mark: "?" */ .set('qmark', function(node) { var val = '[^\\\\/.]'; var prev = this.prev(); if (node.parsed.slice(-1) === '(') { var ch = node.rest.charAt(0); if (ch !== '!' && ch !== '=' && ch !== ':') { return this.emit(val, node); } return this.emit(node.val, node); } if (prev.type === 'text' && prev.val) { return this.emit(val, node); } if (node.val.length > 1) { val += '{' + node.val.length + '}'; } return this.emit(val, node); }) /** * Plus: "+" */ .set('plus', function(node) { var prev = node.parsed.slice(-1); if (prev === ']' || prev === ')') { return this.emit(node.val, node); } var ch = this.output.slice(-1); if (!this.output || (/[?*+]/.test(ch) && node.parent.type !== 'bracket')) { return this.emit('\\+', node); } if (/\w/.test(ch) && !node.inside) { return this.emit('+\\+?', node); } return this.emit('+', node); }) /** * Star: "*" */ .set('star', function(node) { var prev = this.prev(); var prefix = prev.type !== 'text' && prev.type !== 'escape' ? '(?!\\.)' : ''; return this.emit(prefix + star.call(this, node), node); }) /** * Parens */ .set('paren', function(node) { return this.mapVisit(node.nodes); }) .set('paren.open', function(node) { var capture = this.options.capture ? '(' : ''; switch (node.parent.prefix) { case '!': case '^': return this.emit(capture + '(?:(?!(?:', node); case '*': case '+': case '?': case '@': return this.emit(capture + '(?:', node); default: { var val = node.val; if (this.options.bash === true) { val = '\\' + val; } else if (!this.options.capture && val === '(' && node.parent.rest[0] !== '?') { val += '?:'; } return this.emit(val, node); } } }) .set('paren.close', function(node) { var capture = this.options.capture ? ')' : ''; switch (node.prefix) { case '!': case '^': var prefix = /^(\)|$)/.test(node.rest) ? '$' : ''; var str = star.call(this, node); // if the extglob has a slash explicitly defined, we know the user wants // to match slashes, so we need to ensure the "star" regex allows for it if (node.parent.hasSlash && !this.options.star && this.options.slash !== false) { str = '.*?'; } return this.emit(prefix + ('))' + str + ')') + capture, node); case '*': case '+': case '?': return this.emit(')' + node.prefix + capture, node); case '@': return this.emit(')' + capture, node); default: { var val = (this.options.bash === true ? '\\' : '') + ')'; return this.emit(val, node); } } }) /** * Text */ .set('text', function(node) { var val = node.val.replace(/[\[\]]/g, '\\$&'); return this.emit(val, node); }); }; /***/ }), /* 506 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Local dependencies */ var compilers = __webpack_require__(507); var parsers = __webpack_require__(509); /** * Module dependencies */ var debug = __webpack_require__(462)('expand-brackets'); var extend = __webpack_require__(398); var Snapdragon = __webpack_require__(428); var toRegex = __webpack_require__(389); /** * Parses the given POSIX character class `pattern` and returns a * string that can be used for creating regular expressions for matching. * * @param {String} `pattern` * @param {Object} `options` * @return {Object} * @api public */ function brackets(pattern, options) { debug('initializing from <%s>', __filename); var res = brackets.create(pattern, options); return res.output; } /** * Takes an array of strings and a POSIX character class pattern, and returns a new * array with only the strings that matched the pattern. * * ```js * var brackets = require('expand-brackets'); * console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]')); * //=> ['a'] * * console.log(brackets.match(['1', 'a', 'ab'], '[[:alpha:]]+')); * //=> ['a', 'ab'] * ``` * @param {Array} `arr` Array of strings to match * @param {String} `pattern` POSIX character class pattern(s) * @param {Object} `options` * @return {Array} * @api public */ brackets.match = function(arr, pattern, options) { arr = [].concat(arr); var opts = extend({}, options); var isMatch = brackets.matcher(pattern, opts); var len = arr.length; var idx = -1; var res = []; while (++idx < len) { var ele = arr[idx]; if (isMatch(ele)) { res.push(ele); } } if (res.length === 0) { if (opts.failglob === true) { throw new Error('no matches found for "' + pattern + '"'); } if (opts.nonull === true || opts.nullglob === true) { return [pattern.split('\\').join('')]; } } return res; }; /** * Returns true if the specified `string` matches the given * brackets `pattern`. * * ```js * var brackets = require('expand-brackets'); * * console.log(brackets.isMatch('a.a', '[[:alpha:]].[[:alpha:]]')); * //=> true * console.log(brackets.isMatch('1.2', '[[:alpha:]].[[:alpha:]]')); * //=> false * ``` * @param {String} `string` String to match * @param {String} `pattern` Poxis pattern * @param {String} `options` * @return {Boolean} * @api public */ brackets.isMatch = function(str, pattern, options) { return brackets.matcher(pattern, options)(str); }; /** * Takes a POSIX character class pattern and returns a matcher function. The returned * function takes the string to match as its only argument. * * ```js * var brackets = require('expand-brackets'); * var isMatch = brackets.matcher('[[:lower:]].[[:upper:]]'); * * console.log(isMatch('a.a')); * //=> false * console.log(isMatch('a.A')); * //=> true * ``` * @param {String} `pattern` Poxis pattern * @param {String} `options` * @return {Boolean} * @api public */ brackets.matcher = function(pattern, options) { var re = brackets.makeRe(pattern, options); return function(str) { return re.test(str); }; }; /** * Create a regular expression from the given `pattern`. * * ```js * var brackets = require('expand-brackets'); * var re = brackets.makeRe('[[:alpha:]]'); * console.log(re); * //=> /^(?:[a-zA-Z])$/ * ``` * @param {String} `pattern` The pattern to convert to regex. * @param {Object} `options` * @return {RegExp} * @api public */ brackets.makeRe = function(pattern, options) { var res = brackets.create(pattern, options); var opts = extend({strictErrors: false}, options); return toRegex(res.output, opts); }; /** * Parses the given POSIX character class `pattern` and returns an object * with the compiled `output` and optional source `map`. * * ```js * var brackets = require('expand-brackets'); * console.log(brackets('[[:alpha:]]')); * // { options: { source: 'string' }, * // input: '[[:alpha:]]', * // state: {}, * // compilers: * // { eos: [Function], * // noop: [Function], * // bos: [Function], * // not: [Function], * // escape: [Function], * // text: [Function], * // posix: [Function], * // bracket: [Function], * // 'bracket.open': [Function], * // 'bracket.inner': [Function], * // 'bracket.literal': [Function], * // 'bracket.close': [Function] }, * // output: '[a-zA-Z]', * // ast: * // { type: 'root', * // errors: [], * // nodes: [ [Object], [Object], [Object] ] }, * // parsingErrors: [] } * ``` * @param {String} `pattern` * @param {Object} `options` * @return {Object} * @api public */ brackets.create = function(pattern, options) { var snapdragon = (options && options.snapdragon) || new Snapdragon(options); compilers(snapdragon); parsers(snapdragon); var ast = snapdragon.parse(pattern, options); ast.input = pattern; var res = snapdragon.compile(ast, options); res.input = pattern; return res; }; /** * Expose `brackets` constructor, parsers and compilers */ brackets.compilers = compilers; brackets.parsers = parsers; /** * Expose `brackets` * @type {Function} */ module.exports = brackets; /***/ }), /* 507 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var posix = __webpack_require__(508); module.exports = function(brackets) { brackets.compiler /** * Escaped characters */ .set('escape', function(node) { return this.emit('\\' + node.val.replace(/^\\/, ''), node); }) /** * Text */ .set('text', function(node) { return this.emit(node.val.replace(/([{}])/g, '\\$1'), node); }) /** * POSIX character classes */ .set('posix', function(node) { if (node.val === '[::]') { return this.emit('\\[::\\]', node); } var val = posix[node.inner]; if (typeof val === 'undefined') { val = '[' + node.inner + ']'; } return this.emit(val, node); }) /** * Non-posix brackets */ .set('bracket', function(node) { return this.mapVisit(node.nodes); }) .set('bracket.open', function(node) { return this.emit(node.val, node); }) .set('bracket.inner', function(node) { var inner = node.val; if (inner === '[' || inner === ']') { return this.emit('\\' + node.val, node); } if (inner === '^]') { return this.emit('^\\]', node); } if (inner === '^') { return this.emit('^', node); } if (/-/.test(inner) && !/(\d-\d|\w-\w)/.test(inner)) { inner = inner.split('-').join('\\-'); } var isNegated = inner.charAt(0) === '^'; // add slashes to negated brackets, per spec if (isNegated && inner.indexOf('/') === -1) { inner += '/'; } if (isNegated && inner.indexOf('.') === -1) { inner += '.'; } // don't unescape `0` (octal literal) inner = inner.replace(/\\([1-9])/g, '$1'); return this.emit(inner, node); }) .set('bracket.close', function(node) { var val = node.val.replace(/^\\/, ''); if (node.parent.escaped === true) { return this.emit('\\' + val, node); } return this.emit(val, node); }); }; /***/ }), /* 508 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * POSIX character classes */ module.exports = { alnum: 'a-zA-Z0-9', alpha: 'a-zA-Z', ascii: '\\x00-\\x7F', blank: ' \\t', cntrl: '\\x00-\\x1F\\x7F', digit: '0-9', graph: '\\x21-\\x7E', lower: 'a-z', print: '\\x20-\\x7E ', punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', space: ' \\t\\r\\n\\v\\f', upper: 'A-Z', word: 'A-Za-z0-9_', xdigit: 'A-Fa-f0-9' }; /***/ }), /* 509 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = __webpack_require__(510); var define = __webpack_require__(390); /** * Text regex */ var TEXT_REGEX = '(\\[(?=.*\\])|\\])+'; var not = utils.createRegex(TEXT_REGEX); /** * Brackets parsers */ function parsers(brackets) { brackets.state = brackets.state || {}; brackets.parser.sets.bracket = brackets.parser.sets.bracket || []; brackets.parser .capture('escape', function() { if (this.isInside('bracket')) return; var pos = this.position(); var m = this.match(/^\\(.)/); if (!m) return; return pos({ type: 'escape', val: m[0] }); }) /** * Text parser */ .capture('text', function() { if (this.isInside('bracket')) return; var pos = this.position(); var m = this.match(not); if (!m || !m[0]) return; return pos({ type: 'text', val: m[0] }); }) /** * POSIX character classes: "[[:alpha:][:digits:]]" */ .capture('posix', function() { var pos = this.position(); var m = this.match(/^\[:(.*?):\](?=.*\])/); if (!m) return; var inside = this.isInside('bracket'); if (inside) { brackets.posix++; } return pos({ type: 'posix', insideBracket: inside, inner: m[1], val: m[0] }); }) /** * Bracket (noop) */ .capture('bracket', function() {}) /** * Open: '[' */ .capture('bracket.open', function() { var parsed = this.parsed; var pos = this.position(); var m = this.match(/^\[(?=.*\])/); if (!m) return; var prev = this.prev(); var last = utils.last(prev.nodes); if (parsed.slice(-1) === '\\' && !this.isInside('bracket')) { last.val = last.val.slice(0, last.val.length - 1); return pos({ type: 'escape', val: m[0] }); } var open = pos({ type: 'bracket.open', val: m[0] }); if (last.type === 'bracket.open' || this.isInside('bracket')) { open.val = '\\' + open.val; open.type = 'bracket.inner'; open.escaped = true; return open; } var node = pos({ type: 'bracket', nodes: [open] }); define(node, 'parent', prev); define(open, 'parent', node); this.push('bracket', node); prev.nodes.push(node); }) /** * Bracket text */ .capture('bracket.inner', function() { if (!this.isInside('bracket')) return; var pos = this.position(); var m = this.match(not); if (!m || !m[0]) return; var next = this.input.charAt(0); var val = m[0]; var node = pos({ type: 'bracket.inner', val: val }); if (val === '\\\\') { return node; } var first = val.charAt(0); var last = val.slice(-1); if (first === '!') { val = '^' + val.slice(1); } if (last === '\\' || (val === '^' && next === ']')) { val += this.input[0]; this.consume(1); } node.val = val; return node; }) /** * Close: ']' */ .capture('bracket.close', function() { var parsed = this.parsed; var pos = this.position(); var m = this.match(/^\]/); if (!m) return; var prev = this.prev(); var last = utils.last(prev.nodes); if (parsed.slice(-1) === '\\' && !this.isInside('bracket')) { last.val = last.val.slice(0, last.val.length - 1); return pos({ type: 'escape', val: m[0] }); } var node = pos({ type: 'bracket.close', rest: this.input, val: m[0] }); if (last.type === 'bracket.open') { node.type = 'bracket.inner'; node.escaped = true; return node; } var bracket = this.pop('bracket'); if (!this.isType(bracket, 'bracket')) { if (this.options.strict) { throw new Error('missing opening "["'); } node.type = 'bracket.inner'; node.escaped = true; return node; } bracket.nodes.push(node); define(node, 'parent', bracket); }); } /** * Brackets parsers */ module.exports = parsers; /** * Expose text regex */ module.exports.TEXT_REGEX = TEXT_REGEX; /***/ }), /* 510 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toRegex = __webpack_require__(389); var regexNot = __webpack_require__(400); var cached; /** * Get the last element from `array` * @param {Array} `array` * @return {*} */ exports.last = function(arr) { return arr[arr.length - 1]; }; /** * Create and cache regex to use for text nodes */ exports.createRegex = function(pattern, include) { if (cached) return cached; var opts = {contains: true, strictClose: false}; var not = regexNot.create(pattern, opts); var re; if (typeof include === 'string') { re = toRegex('^(?:' + include + '|' + not + ')', opts); } else { re = toRegex(not, opts); } return (cached = re); }; /***/ }), /* 511 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var brackets = __webpack_require__(506); var define = __webpack_require__(500); var utils = __webpack_require__(512); /** * Characters to use in text regex (we want to "not" match * characters that are matched by other parsers) */ var TEXT_REGEX = '([!@*?+]?\\(|\\)|[*?.+\\\\]|\\[:?(?=.*\\])|:?\\])+'; var not = utils.createRegex(TEXT_REGEX); /** * Extglob parsers */ function parsers(extglob) { extglob.state = extglob.state || {}; /** * Use `expand-brackets` parsers */ extglob.use(brackets.parsers); extglob.parser.sets.paren = extglob.parser.sets.paren || []; extglob.parser /** * Extglob open: "*(" */ .capture('paren.open', function() { var parsed = this.parsed; var pos = this.position(); var m = this.match(/^([!@*?+])?\(/); if (!m) return; var prev = this.prev(); var prefix = m[1]; var val = m[0]; var open = pos({ type: 'paren.open', parsed: parsed, val: val }); var node = pos({ type: 'paren', prefix: prefix, nodes: [open] }); // if nested negation extglobs, just cancel them out to simplify if (prefix === '!' && prev.type === 'paren' && prev.prefix === '!') { prev.prefix = '@'; node.prefix = '@'; } define(node, 'rest', this.input); define(node, 'parsed', parsed); define(node, 'parent', prev); define(open, 'parent', node); this.push('paren', node); prev.nodes.push(node); }) /** * Extglob close: ")" */ .capture('paren.close', function() { var parsed = this.parsed; var pos = this.position(); var m = this.match(/^\)/); if (!m) return; var parent = this.pop('paren'); var node = pos({ type: 'paren.close', rest: this.input, parsed: parsed, val: m[0] }); if (!this.isType(parent, 'paren')) { if (this.options.strict) { throw new Error('missing opening paren: "("'); } node.escaped = true; return node; } node.prefix = parent.prefix; parent.nodes.push(node); define(node, 'parent', parent); }) /** * Escape: "\\." */ .capture('escape', function() { var pos = this.position(); var m = this.match(/^\\(.)/); if (!m) return; return pos({ type: 'escape', val: m[0], ch: m[1] }); }) /** * Question marks: "?" */ .capture('qmark', function() { var parsed = this.parsed; var pos = this.position(); var m = this.match(/^\?+(?!\()/); if (!m) return; extglob.state.metachar = true; return pos({ type: 'qmark', rest: this.input, parsed: parsed, val: m[0] }); }) /** * Character parsers */ .capture('star', /^\*(?!\()/) .capture('plus', /^\+(?!\()/) .capture('dot', /^\./) .capture('text', not); }; /** * Expose text regex string */ module.exports.TEXT_REGEX = TEXT_REGEX; /** * Extglob parsers */ module.exports = parsers; /***/ }), /* 512 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var regex = __webpack_require__(400); var Cache = __webpack_require__(498); /** * Utils */ var utils = module.exports; var cache = utils.cache = new Cache(); /** * Cast `val` to an array * @return {Array} */ utils.arrayify = function(val) { if (!Array.isArray(val)) { return [val]; } return val; }; /** * Memoize a generated regex or function */ utils.memoize = function(type, pattern, options, fn) { var key = utils.createKey(type + pattern, options); if (cache.has(type, key)) { return cache.get(type, key); } var val = fn(pattern, options); if (options && options.cache === false) { return val; } cache.set(type, key, val); return val; }; /** * Create the key to use for memoization. The key is generated * by iterating over the options and concatenating key-value pairs * to the pattern string. */ utils.createKey = function(pattern, options) { var key = pattern; if (typeof options === 'undefined') { return key; } for (var prop in options) { key += ';' + prop + '=' + String(options[prop]); } return key; }; /** * Create the regex to use for matching text */ utils.createRegex = function(str) { var opts = {contains: true, strictClose: false}; return regex(str, opts); }; /***/ }), /* 513 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Module dependencies */ var Snapdragon = __webpack_require__(428); var define = __webpack_require__(500); var extend = __webpack_require__(398); /** * Local dependencies */ var compilers = __webpack_require__(505); var parsers = __webpack_require__(511); /** * Customize Snapdragon parser and renderer */ function Extglob(options) { this.options = extend({source: 'extglob'}, options); this.snapdragon = this.options.snapdragon || new Snapdragon(this.options); this.snapdragon.patterns = this.snapdragon.patterns || {}; this.compiler = this.snapdragon.compiler; this.parser = this.snapdragon.parser; compilers(this.snapdragon); parsers(this.snapdragon); /** * Override Snapdragon `.parse` method */ define(this.snapdragon, 'parse', function(str, options) { var parsed = Snapdragon.prototype.parse.apply(this, arguments); parsed.input = str; // escape unmatched brace/bracket/parens var last = this.parser.stack.pop(); if (last && this.options.strict !== true) { var node = last.nodes[0]; node.val = '\\' + node.val; var sibling = node.parent.nodes[1]; if (sibling.type === 'star') { sibling.loose = true; } } // add non-enumerable parser reference define(parsed, 'parser', this.parser); return parsed; }); /** * Decorate `.parse` method */ define(this, 'parse', function(ast, options) { return this.snapdragon.parse.apply(this.snapdragon, arguments); }); /** * Decorate `.compile` method */ define(this, 'compile', function(ast, options) { return this.snapdragon.compile.apply(this.snapdragon, arguments); }); } /** * Expose `Extglob` */ module.exports = Extglob; /***/ }), /* 514 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var extglob = __webpack_require__(504); var nanomatch = __webpack_require__(493); var regexNot = __webpack_require__(400); var toRegex = __webpack_require__(389); var not; /** * Characters to use in negation regex (we want to "not" match * characters that are matched by other parsers) */ var TEXT = '([!@*?+]?\\(|\\)|\\[:?(?=.*?:?\\])|:?\\]|[*+?!^$.\\\\/])+'; var createNotRegex = function(opts) { return not || (not = textRegex(TEXT)); }; /** * Parsers */ module.exports = function(snapdragon) { var parsers = snapdragon.parser.parsers; // register nanomatch parsers snapdragon.use(nanomatch.parsers); // get references to some specific nanomatch parsers before they // are overridden by the extglob and/or parsers var escape = parsers.escape; var slash = parsers.slash; var qmark = parsers.qmark; var plus = parsers.plus; var star = parsers.star; var dot = parsers.dot; // register extglob parsers snapdragon.use(extglob.parsers); // custom micromatch parsers snapdragon.parser .use(function() { // override "notRegex" created in nanomatch parser this.notRegex = /^\!+(?!\()/; }) // reset the referenced parsers .capture('escape', escape) .capture('slash', slash) .capture('qmark', qmark) .capture('star', star) .capture('plus', plus) .capture('dot', dot) /** * Override `text` parser */ .capture('text', function() { if (this.isInside('bracket')) return; var pos = this.position(); var m = this.match(createNotRegex(this.options)); if (!m || !m[0]) return; // escape regex boundary characters and simple brackets var val = m[0].replace(/([[\]^$])/g, '\\$1'); return pos({ type: 'text', val: val }); }); }; /** * Create text regex */ function textRegex(pattern) { var notStr = regexNot.create(pattern, {contains: true, strictClose: false}); var prefix = '(?:[\\^]|\\\\|'; return toRegex(prefix + notStr + ')', {strictClose: false}); } /***/ }), /* 515 */ /***/ (function(module, exports, __webpack_require__) { module.exports = new (__webpack_require__(498))(); /***/ }), /* 516 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var utils = module.exports; var path = __webpack_require__(16); /** * Module dependencies */ var Snapdragon = __webpack_require__(428); utils.define = __webpack_require__(500); utils.diff = __webpack_require__(501); utils.extend = __webpack_require__(398); utils.pick = __webpack_require__(502); utils.typeOf = __webpack_require__(517); utils.unique = __webpack_require__(401); /** * Returns true if the platform is windows, or `path.sep` is `\\`. * This is defined as a function to allow `path.sep` to be set in unit tests, * or by the user, if there is a reason to do so. * @return {Boolean} */ utils.isWindows = function() { return path.sep === '\\' || process.platform === 'win32'; }; /** * Get the `Snapdragon` instance to use */ utils.instantiate = function(ast, options) { var snapdragon; // if an instance was created by `.parse`, use that instance if (utils.typeOf(ast) === 'object' && ast.snapdragon) { snapdragon = ast.snapdragon; // if the user supplies an instance on options, use that instance } else if (utils.typeOf(options) === 'object' && options.snapdragon) { snapdragon = options.snapdragon; // create a new instance } else { snapdragon = new Snapdragon(options); } utils.define(snapdragon, 'parse', function(str, options) { var parsed = Snapdragon.prototype.parse.apply(this, arguments); parsed.input = str; // escape unmatched brace/bracket/parens var last = this.parser.stack.pop(); if (last && this.options.strictErrors !== true) { var open = last.nodes[0]; var inner = last.nodes[1]; if (last.type === 'bracket') { if (inner.val.charAt(0) === '[') { inner.val = '\\' + inner.val; } } else { open.val = '\\' + open.val; var sibling = open.parent.nodes[1]; if (sibling.type === 'star') { sibling.loose = true; } } } // add non-enumerable parser reference utils.define(parsed, 'parser', this.parser); return parsed; }); return snapdragon; }; /** * Create the key to use for memoization. The key is generated * by iterating over the options and concatenating key-value pairs * to the pattern string. */ utils.createKey = function(pattern, options) { if (utils.typeOf(options) !== 'object') { return pattern; } var val = pattern; var keys = Object.keys(options); for (var i = 0; i < keys.length; i++) { var key = keys[i]; val += ';' + key + '=' + String(options[key]); } return val; }; /** * Cast `val` to an array * @return {Array} */ utils.arrayify = function(val) { if (typeof val === 'string') return [val]; return val ? (Array.isArray(val) ? val : [val]) : []; }; /** * Return true if `val` is a non-empty string */ utils.isString = function(val) { return typeof val === 'string'; }; /** * Return true if `val` is a non-empty string */ utils.isObject = function(val) { return utils.typeOf(val) === 'object'; }; /** * Returns true if the given `str` has special characters */ utils.hasSpecialChars = function(str) { return /(?:(?:(^|\/)[!.])|[*?+()|\[\]{}]|[+@]\()/.test(str); }; /** * Escape regex characters in the given string */ utils.escapeRegex = function(str) { return str.replace(/[-[\]{}()^$|*+?.\\\/\s]/g, '\\$&'); }; /** * Normalize slashes in the given filepath. * * @param {String} `filepath` * @return {String} */ utils.toPosixPath = function(str) { return str.replace(/\\+/g, '/'); }; /** * Strip backslashes before special characters in a string. * * @param {String} `str` * @return {String} */ utils.unescape = function(str) { return utils.toPosixPath(str.replace(/\\(?=[*+?!.])/g, '')); }; /** * Strip the prefix from a filepath * @param {String} `fp` * @return {String} */ utils.stripPrefix = function(str) { if (str.charAt(0) !== '.') { return str; } var ch = str.charAt(1); if (utils.isSlash(ch)) { return str.slice(2); } return str; }; /** * Returns true if the given str is an escaped or * unescaped path character */ utils.isSlash = function(str) { return str === '/' || str === '\\/' || str === '\\' || str === '\\\\'; }; /** * Returns a function that returns true if the given * pattern matches or contains a `filepath` * * @param {String} `pattern` * @return {Function} */ utils.matchPath = function(pattern, options) { return (options && options.contains) ? utils.containsPattern(pattern, options) : utils.equalsPattern(pattern, options); }; /** * Returns true if the given (original) filepath or unixified path are equal * to the given pattern. */ utils._equals = function(filepath, unixPath, pattern) { return pattern === filepath || pattern === unixPath; }; /** * Returns true if the given (original) filepath or unixified path contain * the given pattern. */ utils._contains = function(filepath, unixPath, pattern) { return filepath.indexOf(pattern) !== -1 || unixPath.indexOf(pattern) !== -1; }; /** * Returns a function that returns true if the given * pattern is the same as a given `filepath` * * @param {String} `pattern` * @return {Function} */ utils.equalsPattern = function(pattern, options) { var unixify = utils.unixify(options); options = options || {}; return function fn(filepath) { var equal = utils._equals(filepath, unixify(filepath), pattern); if (equal === true || options.nocase !== true) { return equal; } var lower = filepath.toLowerCase(); return utils._equals(lower, unixify(lower), pattern); }; }; /** * Returns a function that returns true if the given * pattern contains a `filepath` * * @param {String} `pattern` * @return {Function} */ utils.containsPattern = function(pattern, options) { var unixify = utils.unixify(options); options = options || {}; return function(filepath) { var contains = utils._contains(filepath, unixify(filepath), pattern); if (contains === true || options.nocase !== true) { return contains; } var lower = filepath.toLowerCase(); return utils._contains(lower, unixify(lower), pattern); }; }; /** * Returns a function that returns true if the given * regex matches the `filename` of a file path. * * @param {RegExp} `re` Matching regex * @return {Function} */ utils.matchBasename = function(re) { return function(filepath) { return re.test(filepath) || re.test(path.basename(filepath)); }; }; /** * Determines the filepath to return based on the provided options. * @return {any} */ utils.value = function(str, unixify, options) { if (options && options.unixify === false) { return str; } return unixify(str); }; /** * Returns a function that normalizes slashes in a string to forward * slashes, strips `./` from beginning of paths, and optionally unescapes * special characters. * @return {Function} */ utils.unixify = function(options) { options = options || {}; return function(filepath) { if (utils.isWindows() || options.unixify === true) { filepath = utils.toPosixPath(filepath); } if (options.stripPrefix !== false) { filepath = utils.stripPrefix(filepath); } if (options.unescape === true) { filepath = utils.unescape(filepath); } return filepath; }; }; /***/ }), /* 517 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; module.exports = function kindOf(val) { if (val === void 0) return 'undefined'; if (val === null) return 'null'; var type = typeof val; if (type === 'boolean') return 'boolean'; if (type === 'string') return 'string'; if (type === 'number') return 'number'; if (type === 'symbol') return 'symbol'; if (type === 'function') { return isGeneratorFn(val) ? 'generatorfunction' : 'function'; } if (isArray(val)) return 'array'; if (isBuffer(val)) return 'buffer'; if (isArguments(val)) return 'arguments'; if (isDate(val)) return 'date'; if (isError(val)) return 'error'; if (isRegexp(val)) return 'regexp'; switch (ctorName(val)) { case 'Symbol': return 'symbol'; case 'Promise': return 'promise'; // Set, Map, WeakSet, WeakMap case 'WeakMap': return 'weakmap'; case 'WeakSet': return 'weakset'; case 'Map': return 'map'; case 'Set': return 'set'; // 8-bit typed arrays case 'Int8Array': return 'int8array'; case 'Uint8Array': return 'uint8array'; case 'Uint8ClampedArray': return 'uint8clampedarray'; // 16-bit typed arrays case 'Int16Array': return 'int16array'; case 'Uint16Array': return 'uint16array'; // 32-bit typed arrays case 'Int32Array': return 'int32array'; case 'Uint32Array': return 'uint32array'; case 'Float32Array': return 'float32array'; case 'Float64Array': return 'float64array'; } if (isGeneratorObj(val)) { return 'generator'; } // Non-plain objects type = toString.call(val); switch (type) { case '[object Object]': return 'object'; // iterators case '[object Map Iterator]': return 'mapiterator'; case '[object Set Iterator]': return 'setiterator'; case '[object String Iterator]': return 'stringiterator'; case '[object Array Iterator]': return 'arrayiterator'; } // other return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); }; function ctorName(val) { return val.constructor ? val.constructor.name : null; } function isArray(val) { if (Array.isArray) return Array.isArray(val); return val instanceof Array; } function isError(val) { return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); } function isDate(val) { if (val instanceof Date) return true; return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function'; } function isRegexp(val) { if (val instanceof RegExp) return true; return typeof val.flags === 'string' && typeof val.ignoreCase === 'boolean' && typeof val.multiline === 'boolean' && typeof val.global === 'boolean'; } function isGeneratorFn(name, val) { return ctorName(name) === 'GeneratorFunction'; } function isGeneratorObj(val) { return typeof val.throw === 'function' && typeof val.return === 'function' && typeof val.next === 'function'; } function isArguments(val) { try { if (typeof val.length === 'number' && typeof val.callee === 'function') { return true; } } catch (err) { if (err.message.indexOf('callee') !== -1) { return true; } } return false; } /** * If you need to support Safari 5-7 (8-10 yr-old browser), * take a look at https://github.com/feross/is-buffer */ function isBuffer(val) { if (val.constructor && typeof val.constructor.isBuffer === 'function') { return val.constructor.isBuffer(val); } return false; } /***/ }), /* 518 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var readdir = __webpack_require__(519); var reader_1 = __webpack_require__(532); var ReaderAsync = /** @class */ (function (_super) { __extends(ReaderAsync, _super); function ReaderAsync() { return _super !== null && _super.apply(this, arguments) || this; } /** * Returns founded paths. */ ReaderAsync.prototype.api = function (root, options) { return readdir.readdirStreamStat(root, options); }; /** * Use sync API to read entries for Task. */ ReaderAsync.prototype.read = function (task) { var _this = this; var root = this.getRootDirectory(task); var options = this.getReaderOptions(task); var entries = []; return new Promise(function (resolve, reject) { var stream = _this.api(root, options); stream.on('error', function (err) { _this.isEnoentCodeError(err) ? resolve([]) : reject(err); stream.pause(); }); stream.on('data', function (entry) { return entries.push(_this.transform(entry)); }); stream.on('end', function () { return resolve(entries); }); }); }; return ReaderAsync; }(reader_1.default)); exports.default = ReaderAsync; /***/ }), /* 519 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const readdirSync = __webpack_require__(520); const readdirAsync = __webpack_require__(528); const readdirStream = __webpack_require__(531); module.exports = exports = readdirAsyncPath; exports.readdir = exports.readdirAsync = exports.async = readdirAsyncPath; exports.readdirAsyncStat = exports.async.stat = readdirAsyncStat; exports.readdirStream = exports.stream = readdirStreamPath; exports.readdirStreamStat = exports.stream.stat = readdirStreamStat; exports.readdirSync = exports.sync = readdirSyncPath; exports.readdirSyncStat = exports.sync.stat = readdirSyncStat; /** * Synchronous readdir that returns an array of string paths. * * @param {string} dir * @param {object} [options] * @returns {string[]} */ function readdirSyncPath (dir, options) { return readdirSync(dir, options, {}); } /** * Synchronous readdir that returns results as an array of {@link fs.Stats} objects * * @param {string} dir * @param {object} [options] * @returns {fs.Stats[]} */ function readdirSyncStat (dir, options) { return readdirSync(dir, options, { stats: true }); } /** * Aynchronous readdir (accepts an error-first callback or returns a {@link Promise}). * Results are an array of path strings. * * @param {string} dir * @param {object} [options] * @param {function} [callback] * @returns {Promise} */ function readdirAsyncPath (dir, options, callback) { return readdirAsync(dir, options, callback, {}); } /** * Aynchronous readdir (accepts an error-first callback or returns a {@link Promise}). * Results are an array of {@link fs.Stats} objects. * * @param {string} dir * @param {object} [options] * @param {function} [callback] * @returns {Promise} */ function readdirAsyncStat (dir, options, callback) { return readdirAsync(dir, options, callback, { stats: true }); } /** * Aynchronous readdir that returns a {@link stream.Readable} (which is also an {@link EventEmitter}). * All stream data events ("data", "file", "directory", "symlink") are passed a path string. * * @param {string} dir * @param {object} [options] * @returns {stream.Readable} */ function readdirStreamPath (dir, options) { return readdirStream(dir, options, {}); } /** * Aynchronous readdir that returns a {@link stream.Readable} (which is also an {@link EventEmitter}) * All stream data events ("data", "file", "directory", "symlink") are passed an {@link fs.Stats} object. * * @param {string} dir * @param {object} [options] * @returns {stream.Readable} */ function readdirStreamStat (dir, options) { return readdirStream(dir, options, { stats: true }); } /***/ }), /* 520 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = readdirSync; const DirectoryReader = __webpack_require__(521); let syncFacade = { fs: __webpack_require__(526), forEach: __webpack_require__(527), sync: true }; /** * Returns the buffered output from a synchronous {@link DirectoryReader}. * * @param {string} dir * @param {object} [options] * @param {object} internalOptions */ function readdirSync (dir, options, internalOptions) { internalOptions.facade = syncFacade; let reader = new DirectoryReader(dir, options, internalOptions); let stream = reader.stream; let results = []; let data = stream.read(); while (data !== null) { results.push(data); data = stream.read(); } return results; } /***/ }), /* 521 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const Readable = __webpack_require__(28).Readable; const EventEmitter = __webpack_require__(45).EventEmitter; const path = __webpack_require__(16); const normalizeOptions = __webpack_require__(522); const stat = __webpack_require__(524); const call = __webpack_require__(525); /** * Asynchronously reads the contents of a directory and streams the results * via a {@link stream.Readable}. */ class DirectoryReader { /** * @param {string} dir - The absolute or relative directory path to read * @param {object} [options] - User-specified options, if any (see {@link normalizeOptions}) * @param {object} internalOptions - Internal options that aren't part of the public API * @class */ constructor (dir, options, internalOptions) { this.options = options = normalizeOptions(options, internalOptions); // Indicates whether we should keep reading // This is set false if stream.Readable.push() returns false. this.shouldRead = true; // The directories to read // (initialized with the top-level directory) this.queue = [{ path: dir, basePath: options.basePath, posixBasePath: options.posixBasePath, depth: 0 }]; // The number of directories that are currently being processed this.pending = 0; // The data that has been read, but not yet emitted this.buffer = []; this.stream = new Readable({ objectMode: true }); this.stream._read = () => { // Start (or resume) reading this.shouldRead = true; // If we have data in the buffer, then send the next chunk if (this.buffer.length > 0) { this.pushFromBuffer(); } // If we have directories queued, then start processing the next one if (this.queue.length > 0) { if (this.options.facade.sync) { while (this.queue.length > 0) { this.readNextDirectory(); } } else { this.readNextDirectory(); } } this.checkForEOF(); }; } /** * Reads the next directory in the queue */ readNextDirectory () { let facade = this.options.facade; let dir = this.queue.shift(); this.pending++; // Read the directory listing call.safe(facade.fs.readdir, dir.path, (err, items) => { if (err) { // fs.readdir threw an error this.emit('error', err); return this.finishedReadingDirectory(); } try { // Process each item in the directory (simultaneously, if async) facade.forEach( items, this.processItem.bind(this, dir), this.finishedReadingDirectory.bind(this, dir) ); } catch (err2) { // facade.forEach threw an error // (probably because fs.readdir returned an invalid result) this.emit('error', err2); this.finishedReadingDirectory(); } }); } /** * This method is called after all items in a directory have been processed. * * NOTE: This does not necessarily mean that the reader is finished, since there may still * be other directories queued or pending. */ finishedReadingDirectory () { this.pending--; if (this.shouldRead) { // If we have directories queued, then start processing the next one if (this.queue.length > 0 && this.options.facade.async) { this.readNextDirectory(); } this.checkForEOF(); } } /** * Determines whether the reader has finished processing all items in all directories. * If so, then the "end" event is fired (via {@Readable#push}) */ checkForEOF () { if (this.buffer.length === 0 && // The stuff we've already read this.pending === 0 && // The stuff we're currently reading this.queue.length === 0) { // The stuff we haven't read yet // There's no more stuff! this.stream.push(null); } } /** * Processes a single item in a directory. * * If the item is a directory, and `option.deep` is enabled, then the item will be added * to the directory queue. * * If the item meets the filter criteria, then it will be emitted to the reader's stream. * * @param {object} dir - A directory object from the queue * @param {string} item - The name of the item (name only, no path) * @param {function} done - A callback function that is called after the item has been processed */ processItem (dir, item, done) { let stream = this.stream; let options = this.options; let itemPath = dir.basePath + item; let posixPath = dir.posixBasePath + item; let fullPath = path.join(dir.path, item); // If `options.deep` is a number, and we've already recursed to the max depth, // then there's no need to check fs.Stats to know if it's a directory. // If `options.deep` is a function, then we'll need fs.Stats let maxDepthReached = dir.depth >= options.recurseDepth; // Do we need to call `fs.stat`? let needStats = !maxDepthReached || // we need the fs.Stats to know if it's a directory options.stats || // the user wants fs.Stats objects returned options.recurseFn || // we need fs.Stats for the recurse function options.filterFn || // we need fs.Stats for the filter function EventEmitter.listenerCount(stream, 'file') || // we need the fs.Stats to know if it's a file EventEmitter.listenerCount(stream, 'directory') || // we need the fs.Stats to know if it's a directory EventEmitter.listenerCount(stream, 'symlink'); // we need the fs.Stats to know if it's a symlink // If we don't need stats, then exit early if (!needStats) { if (this.filter(itemPath, posixPath)) { this.pushOrBuffer({ data: itemPath }); } return done(); } // Get the fs.Stats object for this path stat(options.facade.fs, fullPath, (err, stats) => { if (err) { // fs.stat threw an error this.emit('error', err); return done(); } try { // Add the item's path to the fs.Stats object // The base of this path, and its separators are determined by the options // (i.e. options.basePath and options.sep) stats.path = itemPath; // Add depth of the path to the fs.Stats object for use this in the filter function stats.depth = dir.depth; if (this.shouldRecurse(stats, posixPath, maxDepthReached)) { // Add this subdirectory to the queue this.queue.push({ path: fullPath, basePath: itemPath + options.sep, posixBasePath: posixPath + '/', depth: dir.depth + 1, }); } // Determine whether this item matches the filter criteria if (this.filter(stats, posixPath)) { this.pushOrBuffer({ data: options.stats ? stats : itemPath, file: stats.isFile(), directory: stats.isDirectory(), symlink: stats.isSymbolicLink(), }); } done(); } catch (err2) { // An error occurred while processing the item // (probably during a user-specified function, such as options.deep, options.filter, etc.) this.emit('error', err2); done(); } }); } /** * Pushes the given chunk of data to the stream, or adds it to the buffer, * depending on the state of the stream. * * @param {object} chunk */ pushOrBuffer (chunk) { // Add the chunk to the buffer this.buffer.push(chunk); // If we're still reading, then immediately emit the next chunk in the buffer // (which may or may not be the chunk that we just added) if (this.shouldRead) { this.pushFromBuffer(); } } /** * Immediately pushes the next chunk in the buffer to the reader's stream. * The "data" event will always be fired (via {@link Readable#push}). * In addition, the "file", "directory", and/or "symlink" events may be fired, * depending on the type of properties of the chunk. */ pushFromBuffer () { let stream = this.stream; let chunk = this.buffer.shift(); // Stream the data try { this.shouldRead = stream.push(chunk.data); } catch (err) { this.emit('error', err); } // Also emit specific events, based on the type of chunk chunk.file && this.emit('file', chunk.data); chunk.symlink && this.emit('symlink', chunk.data); chunk.directory && this.emit('directory', chunk.data); } /** * Determines whether the given directory meets the user-specified recursion criteria. * If the user didn't specify recursion criteria, then this function will default to true. * * @param {fs.Stats} stats - The directory's {@link fs.Stats} object * @param {string} posixPath - The item's POSIX path (used for glob matching) * @param {boolean} maxDepthReached - Whether we've already crawled the user-specified depth * @returns {boolean} */ shouldRecurse (stats, posixPath, maxDepthReached) { let options = this.options; if (maxDepthReached) { // We've already crawled to the maximum depth. So no more recursion. return false; } else if (!stats.isDirectory()) { // It's not a directory. So don't try to crawl it. return false; } else if (options.recurseGlob) { // Glob patterns are always tested against the POSIX path, even on Windows // https://github.com/isaacs/node-glob#windows return options.recurseGlob.test(posixPath); } else if (options.recurseRegExp) { // Regular expressions are tested against the normal path // (based on the OS or options.sep) return options.recurseRegExp.test(stats.path); } else if (options.recurseFn) { try { // Run the user-specified recursion criteria return options.recurseFn.call(null, stats); } catch (err) { // An error occurred in the user's code. // In Sync and Async modes, this will return an error. // In Streaming mode, we emit an "error" event, but continue processing this.emit('error', err); } } else { // No recursion function was specified, and we're within the maximum depth. // So crawl this directory. return true; } } /** * Determines whether the given item meets the user-specified filter criteria. * If the user didn't specify a filter, then this function will always return true. * * @param {string|fs.Stats} value - Either the item's path, or the item's {@link fs.Stats} object * @param {string} posixPath - The item's POSIX path (used for glob matching) * @returns {boolean} */ filter (value, posixPath) { let options = this.options; if (options.filterGlob) { // Glob patterns are always tested against the POSIX path, even on Windows // https://github.com/isaacs/node-glob#windows return options.filterGlob.test(posixPath); } else if (options.filterRegExp) { // Regular expressions are tested against the normal path // (based on the OS or options.sep) return options.filterRegExp.test(value.path || value); } else if (options.filterFn) { try { // Run the user-specified filter function return options.filterFn.call(null, value); } catch (err) { // An error occurred in the user's code. // In Sync and Async modes, this will return an error. // In Streaming mode, we emit an "error" event, but continue processing this.emit('error', err); } } else { // No filter was specified, so match everything return true; } } /** * Emits an event. If one of the event listeners throws an error, * then an "error" event is emitted. * * @param {string} eventName * @param {*} data */ emit (eventName, data) { let stream = this.stream; try { stream.emit(eventName, data); } catch (err) { if (eventName === 'error') { // Don't recursively emit "error" events. // If the first one fails, then just throw throw err; } else { stream.emit('error', err); } } } } module.exports = DirectoryReader; /***/ }), /* 522 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); const globToRegExp = __webpack_require__(523); module.exports = normalizeOptions; let isWindows = /^win/.test(process.platform); /** * @typedef {Object} FSFacade * @property {fs.readdir} readdir * @property {fs.stat} stat * @property {fs.lstat} lstat */ /** * Validates and normalizes the options argument * * @param {object} [options] - User-specified options, if any * @param {object} internalOptions - Internal options that aren't part of the public API * * @param {number|boolean|function} [options.deep] * The number of directories to recursively traverse. Any falsy value or negative number will * default to zero, so only the top-level contents will be returned. Set to `true` or `Infinity` * to traverse all subdirectories. Or provide a function that accepts a {@link fs.Stats} object * and returns a truthy value if the directory's contents should be crawled. * * @param {function|string|RegExp} [options.filter] * A function that accepts a {@link fs.Stats} object and returns a truthy value if the data should * be returned. Or a RegExp or glob string pattern, to filter by file name. * * @param {string} [options.sep] * The path separator to use. By default, the OS-specific separator will be used, but this can be * set to a specific value to ensure consistency across platforms. * * @param {string} [options.basePath] * The base path to prepend to each result. If empty, then all results will be relative to `dir`. * * @param {FSFacade} [options.fs] * Synchronous or asynchronous facades for Node.js File System module * * @param {object} [internalOptions.facade] * Synchronous or asynchronous facades for various methods, including for the Node.js File System module * * @param {boolean} [internalOptions.emit] * Indicates whether the reader should emit "file", "directory", and "symlink" events * * @param {boolean} [internalOptions.stats] * Indicates whether the reader should emit {@link fs.Stats} objects instead of path strings * * @returns {object} */ function normalizeOptions (options, internalOptions) { if (options === null || options === undefined) { options = {}; } else if (typeof options !== 'object') { throw new TypeError('options must be an object'); } let recurseDepth, recurseFn, recurseRegExp, recurseGlob, deep = options.deep; if (deep === null || deep === undefined) { recurseDepth = 0; } else if (typeof deep === 'boolean') { recurseDepth = deep ? Infinity : 0; } else if (typeof deep === 'number') { if (deep < 0 || isNaN(deep)) { throw new Error('options.deep must be a positive number'); } else if (Math.floor(deep) !== deep) { throw new Error('options.deep must be an integer'); } else { recurseDepth = deep; } } else if (typeof deep === 'function') { recurseDepth = Infinity; recurseFn = deep; } else if (deep instanceof RegExp) { recurseDepth = Infinity; recurseRegExp = deep; } else if (typeof deep === 'string' && deep.length > 0) { recurseDepth = Infinity; recurseGlob = globToRegExp(deep, { extended: true, globstar: true }); } else { throw new TypeError('options.deep must be a boolean, number, function, regular expression, or glob pattern'); } let filterFn, filterRegExp, filterGlob, filter = options.filter; if (filter !== null && filter !== undefined) { if (typeof filter === 'function') { filterFn = filter; } else if (filter instanceof RegExp) { filterRegExp = filter; } else if (typeof filter === 'string' && filter.length > 0) { filterGlob = globToRegExp(filter, { extended: true, globstar: true }); } else { throw new TypeError('options.filter must be a function, regular expression, or glob pattern'); } } let sep = options.sep; if (sep === null || sep === undefined) { sep = path.sep; } else if (typeof sep !== 'string') { throw new TypeError('options.sep must be a string'); } let basePath = options.basePath; if (basePath === null || basePath === undefined) { basePath = ''; } else if (typeof basePath === 'string') { // Append a path separator to the basePath, if necessary if (basePath && basePath.substr(-1) !== sep) { basePath += sep; } } else { throw new TypeError('options.basePath must be a string'); } // Convert the basePath to POSIX (forward slashes) // so that glob pattern matching works consistently, even on Windows let posixBasePath = basePath; if (posixBasePath && sep !== '/') { posixBasePath = posixBasePath.replace(new RegExp('\\' + sep, 'g'), '/'); /* istanbul ignore if */ if (isWindows) { // Convert Windows root paths (C:\) and UNCs (\\) to POSIX root paths posixBasePath = posixBasePath.replace(/^([a-zA-Z]\:\/|\/\/)/, '/'); } } // Determine which facade methods to use let facade; if (options.fs === null || options.fs === undefined) { // The user didn't provide their own facades, so use our internal ones facade = internalOptions.facade; } else if (typeof options.fs === 'object') { // Merge the internal facade methods with the user-provided `fs` facades facade = Object.assign({}, internalOptions.facade); facade.fs = Object.assign({}, internalOptions.facade.fs, options.fs); } else { throw new TypeError('options.fs must be an object'); } return { recurseDepth, recurseFn, recurseRegExp, recurseGlob, filterFn, filterRegExp, filterGlob, sep, basePath, posixBasePath, facade, emit: !!internalOptions.emit, stats: !!internalOptions.stats, }; } /***/ }), /* 523 */ /***/ (function(module, exports) { module.exports = function (glob, opts) { if (typeof glob !== 'string') { throw new TypeError('Expected a string'); } var str = String(glob); // The regexp we are building, as a string. var reStr = ""; // Whether we are matching so called "extended" globs (like bash) and should // support single character matching, matching ranges of characters, group // matching, etc. var extended = opts ? !!opts.extended : false; // When globstar is _false_ (default), '/foo/*' is translated a regexp like // '^\/foo\/.*$' which will match any string beginning with '/foo/' // When globstar is _true_, '/foo/*' is translated to regexp like // '^\/foo\/[^/]*$' which will match any string beginning with '/foo/' BUT // which does not have a '/' to the right of it. // E.g. with '/foo/*' these will match: '/foo/bar', '/foo/bar.txt' but // these will not '/foo/bar/baz', '/foo/bar/baz.txt' // Lastely, when globstar is _true_, '/foo/**' is equivelant to '/foo/*' when // globstar is _false_ var globstar = opts ? !!opts.globstar : false; // If we are doing extended matching, this boolean is true when we are inside // a group (eg {*.html,*.js}), and false otherwise. var inGroup = false; // RegExp flags (eg "i" ) to pass in to RegExp constructor. var flags = opts && typeof( opts.flags ) === "string" ? opts.flags : ""; var c; for (var i = 0, len = str.length; i < len; i++) { c = str[i]; switch (c) { case "\\": case "/": case "$": case "^": case "+": case ".": case "(": case ")": case "=": case "!": case "|": reStr += "\\" + c; break; case "?": if (extended) { reStr += "."; break; } case "[": case "]": if (extended) { reStr += c; break; } case "{": if (extended) { inGroup = true; reStr += "("; break; } case "}": if (extended) { inGroup = false; reStr += ")"; break; } case ",": if (inGroup) { reStr += "|"; break; } reStr += "\\" + c; break; case "*": // Move over all consecutive "*"'s. // Also store the previous and next characters var prevChar = str[i - 1]; var starCount = 1; while(str[i + 1] === "*") { starCount++; i++; } var nextChar = str[i + 1]; if (!globstar) { // globstar is disabled, so treat any number of "*" as one reStr += ".*"; } else { // globstar is enabled, so determine if this is a globstar segment var isGlobstar = starCount > 1 // multiple "*"'s && (prevChar === "/" || prevChar === undefined) // from the start of the segment && (nextChar === "/" || nextChar === undefined) // to the end of the segment if (isGlobstar) { // it's a globstar, so match zero or more path segments reStr += "(?:[^/]*(?:\/|$))*"; i++; // move over the "/" } else { // it's not a globstar, so only match one path segment reStr += "[^/]*"; } } break; default: reStr += c; } } // When regexp 'g' flag is specified don't // constrain the regular expression with ^ & $ if (!flags || !~flags.indexOf('g')) { reStr = "^" + reStr + "$"; } return new RegExp(reStr, flags); }; /***/ }), /* 524 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const call = __webpack_require__(525); module.exports = stat; /** * Retrieves the {@link fs.Stats} for the given path. If the path is a symbolic link, * then the Stats of the symlink's target are returned instead. If the symlink is broken, * then the Stats of the symlink itself are returned. * * @param {object} fs - Synchronous or Asynchronouse facade for the "fs" module * @param {string} path - The path to return stats for * @param {function} callback */ function stat (fs, path, callback) { let isSymLink = false; call.safe(fs.lstat, path, (err, lstats) => { if (err) { // fs.lstat threw an eror return callback(err); } try { isSymLink = lstats.isSymbolicLink(); } catch (err2) { // lstats.isSymbolicLink() threw an error // (probably because fs.lstat returned an invalid result) return callback(err2); } if (isSymLink) { // Try to resolve the symlink symlinkStat(fs, path, lstats, callback); } else { // It's not a symlink, so return the stats as-is callback(null, lstats); } }); } /** * Retrieves the {@link fs.Stats} for the target of the given symlink. * If the symlink is broken, then the Stats of the symlink itself are returned. * * @param {object} fs - Synchronous or Asynchronouse facade for the "fs" module * @param {string} path - The path of the symlink to return stats for * @param {object} lstats - The stats of the symlink * @param {function} callback */ function symlinkStat (fs, path, lstats, callback) { call.safe(fs.stat, path, (err, stats) => { if (err) { // The symlink is broken, so return the stats for the link itself return callback(null, lstats); } try { // Return the stats for the resolved symlink target, // and override the `isSymbolicLink` method to indicate that it's a symlink stats.isSymbolicLink = () => true; } catch (err2) { // Setting stats.isSymbolicLink threw an error // (probably because fs.stat returned an invalid result) return callback(err2); } callback(null, stats); }); } /***/ }), /* 525 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; let call = module.exports = { safe: safeCall, once: callOnce, }; /** * Calls a function with the given arguments, and ensures that the error-first callback is _always_ * invoked exactly once, even if the function throws an error. * * @param {function} fn - The function to invoke * @param {...*} args - The arguments to pass to the function. The final argument must be a callback function. */ function safeCall (fn, args) { // Get the function arguments as an array args = Array.prototype.slice.call(arguments, 1); // Replace the callback function with a wrapper that ensures it will only be called once let callback = call.once(args.pop()); args.push(callback); try { fn.apply(null, args); } catch (err) { callback(err); } } /** * Returns a wrapper function that ensures the given callback function is only called once. * Subsequent calls are ignored, unless the first argument is an Error, in which case the * error is thrown. * * @param {function} fn - The function that should only be called once * @returns {function} */ function callOnce (fn) { let fulfilled = false; return function onceWrapper (err) { if (!fulfilled) { fulfilled = true; return fn.apply(this, arguments); } else if (err) { // The callback has already been called, but now an error has occurred // (most likely inside the callback function). So re-throw the error, // so it gets handled further up the call stack throw err; } }; } /***/ }), /* 526 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const fs = __webpack_require__(23); const call = __webpack_require__(525); /** * A facade around {@link fs.readdirSync} that allows it to be called * the same way as {@link fs.readdir}. * * @param {string} dir * @param {function} callback */ exports.readdir = function (dir, callback) { // Make sure the callback is only called once callback = call.once(callback); try { let items = fs.readdirSync(dir); callback(null, items); } catch (err) { callback(err); } }; /** * A facade around {@link fs.statSync} that allows it to be called * the same way as {@link fs.stat}. * * @param {string} path * @param {function} callback */ exports.stat = function (path, callback) { // Make sure the callback is only called once callback = call.once(callback); try { let stats = fs.statSync(path); callback(null, stats); } catch (err) { callback(err); } }; /** * A facade around {@link fs.lstatSync} that allows it to be called * the same way as {@link fs.lstat}. * * @param {string} path * @param {function} callback */ exports.lstat = function (path, callback) { // Make sure the callback is only called once callback = call.once(callback); try { let stats = fs.lstatSync(path); callback(null, stats); } catch (err) { callback(err); } }; /***/ }), /* 527 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = syncForEach; /** * A facade that allows {@link Array.forEach} to be called as though it were asynchronous. * * @param {array} array - The array to iterate over * @param {function} iterator - The function to call for each item in the array * @param {function} done - The function to call when all iterators have completed */ function syncForEach (array, iterator, done) { array.forEach(item => { iterator(item, () => { // Note: No error-handling here because this is currently only ever called // by DirectoryReader, which never passes an `error` parameter to the callback. // Instead, DirectoryReader emits an "error" event if an error occurs. }); }); done(); } /***/ }), /* 528 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = readdirAsync; const maybe = __webpack_require__(529); const DirectoryReader = __webpack_require__(521); let asyncFacade = { fs: __webpack_require__(23), forEach: __webpack_require__(530), async: true }; /** * Returns the buffered output from an asynchronous {@link DirectoryReader}, * via an error-first callback or a {@link Promise}. * * @param {string} dir * @param {object} [options] * @param {function} [callback] * @param {object} internalOptions */ function readdirAsync (dir, options, callback, internalOptions) { if (typeof options === 'function') { callback = options; options = undefined; } return maybe(callback, new Promise(((resolve, reject) => { let results = []; internalOptions.facade = asyncFacade; let reader = new DirectoryReader(dir, options, internalOptions); let stream = reader.stream; stream.on('error', err => { reject(err); stream.pause(); }); stream.on('data', result => { results.push(result); }); stream.on('end', () => { resolve(results); }); }))); } /***/ }), /* 529 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var next = (global.process && process.nextTick) || global.setImmediate || function (f) { setTimeout(f, 0) } module.exports = function maybe (cb, promise) { if (cb) { promise .then(function (result) { next(function () { cb(null, result) }) }, function (err) { next(function () { cb(err) }) }) return undefined } else { return promise } } /***/ }), /* 530 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = asyncForEach; /** * Simultaneously processes all items in the given array. * * @param {array} array - The array to iterate over * @param {function} iterator - The function to call for each item in the array * @param {function} done - The function to call when all iterators have completed */ function asyncForEach (array, iterator, done) { if (array.length === 0) { // NOTE: Normally a bad idea to mix sync and async, but it's safe here because // of the way that this method is currently used by DirectoryReader. done(); return; } // Simultaneously process all items in the array. let pending = array.length; array.forEach(item => { iterator(item, () => { if (--pending === 0) { done(); } }); }); } /***/ }), /* 531 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = readdirStream; const DirectoryReader = __webpack_require__(521); let streamFacade = { fs: __webpack_require__(23), forEach: __webpack_require__(530), async: true }; /** * Returns the {@link stream.Readable} of an asynchronous {@link DirectoryReader}. * * @param {string} dir * @param {object} [options] * @param {object} internalOptions */ function readdirStream (dir, options, internalOptions) { internalOptions.facade = streamFacade; let reader = new DirectoryReader(dir, options, internalOptions); return reader.stream; } /***/ }), /* 532 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var path = __webpack_require__(16); var deep_1 = __webpack_require__(533); var entry_1 = __webpack_require__(536); var Reader = /** @class */ (function () { function Reader(options) { this.options = options; this.micromatchOptions = this.getMicromatchOptions(); this.entryFilter = new entry_1.default(options, this.micromatchOptions); this.deepFilter = new deep_1.default(options, this.micromatchOptions); } /** * Returns root path to scanner. */ Reader.prototype.getRootDirectory = function (task) { return path.resolve(this.options.cwd, task.base); }; /** * Returns options for reader. */ Reader.prototype.getReaderOptions = function (task) { return { basePath: task.base === '.' ? '' : task.base, filter: this.entryFilter.getFilter(task.positive, task.negative), deep: this.deepFilter.getFilter(task.positive, task.negative), sep: '/' }; }; /** * Returns options for micromatch. */ Reader.prototype.getMicromatchOptions = function () { return { dot: this.options.dot, nobrace: this.options.nobrace, noglobstar: this.options.noglobstar, noext: this.options.noext, nocase: this.options.nocase, matchBase: this.options.matchBase }; }; /** * Returns transformed entry. */ Reader.prototype.transform = function (entry) { if (this.options.markDirectories && entry.isDirectory()) { entry.path += '/'; } if (this.options.absolute && !path.isAbsolute(entry.path)) { entry.path = path.resolve(this.options.cwd, entry.path); } var item = this.options.stats ? entry : entry.path; if (this.options.transform === null) { return item; } return this.options.transform(item); }; /** * Returns true if error has ENOENT code. */ Reader.prototype.isEnoentCodeError = function (err) { return err.code === 'ENOENT'; }; return Reader; }()); exports.default = Reader; /***/ }), /* 533 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var arrayUtils = __webpack_require__(534); var pathUtils = __webpack_require__(535); var patternUtils = __webpack_require__(382); var DeepFilter = /** @class */ (function () { function DeepFilter(options, micromatchOptions) { this.options = options; this.micromatchOptions = micromatchOptions; } /** * Returns filter for directories. */ DeepFilter.prototype.getFilter = function (positive, negative) { var _this = this; var depth = this.getMaxDeth(positive); var negativeRe = patternUtils.convertPatternsToRe(negative, this.micromatchOptions); return function (entry) { return _this.filter(entry, negativeRe, depth); }; }; /** * Returns true if directory must be read. */ DeepFilter.prototype.filter = function (entry, negativeRe, depth) { // Skip reading, depending on the nesting level if (!this.options.deep || this.skipByDeepOption(entry) || this.skipByPatternDepth(entry, depth)) { return false; } // Skip reading if the directory is symlink and we don't want expand symlinks if (this.isFollowedSymlink(entry)) { return false; } // Skip reading if the directory name starting with a period and is not expected if (this.isFollowedDotDirectory(entry)) { return false; } // Skip by negative patterns if (patternUtils.matchAny(entry.path, negativeRe)) { return false; } return true; }; /** * Returns max depth for reading. */ DeepFilter.prototype.getMaxDeth = function (positive) { var globstar = positive.some(patternUtils.hasGlobStar); var patternDepths = positive.map(patternUtils.getDepth); return globstar ? Infinity : arrayUtils.max(patternDepths); }; /** * Returns true for dot directories if the «dot» option is enabled. */ DeepFilter.prototype.isFollowedDotDirectory = function (entry) { return !this.options.dot && pathUtils.isDotDirectory(entry.path); }; /** * Returns true for symlinked directories if the «followSymlinks» option is enabled. */ DeepFilter.prototype.isFollowedSymlink = function (entry) { return !this.options.followSymlinkedDirectories && entry.isSymbolicLink(); }; /** * Returns true when the «deep» options is number and entry depth greater that the option value. */ DeepFilter.prototype.skipByDeepOption = function (entry) { return typeof this.options.deep === 'number' && entry.depth > this.options.deep; }; /** * Return true when depth parameter is not an Infinity and entry depth greater that the parameter value. */ DeepFilter.prototype.skipByPatternDepth = function (entry, depth) { return depth !== Infinity && entry.depth > depth; }; return DeepFilter; }()); exports.default = DeepFilter; /***/ }), /* 534 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Flatten nested arrays (max depth is 2) into a non-nested array of non-array items. */ function flatten(items) { return items.reduce(function (collection, item) { return [].concat(collection, item); }, []); } exports.flatten = flatten; /** * Returns max number from array. */ function max(items) { return Math.max.apply(null, items); } exports.max = max; /***/ }), /* 535 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Returns true if the last partial of the path starting with a period. */ function isDotDirectory(path) { var pathPartials = path.split('/'); var lastPathPartial = pathPartials[pathPartials.length - 1]; return lastPathPartial.startsWith('.'); } exports.isDotDirectory = isDotDirectory; /***/ }), /* 536 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var patternUtils = __webpack_require__(382); var DeepFilter = /** @class */ (function () { function DeepFilter(options, micromatchOptions) { this.options = options; this.micromatchOptions = micromatchOptions; this.index = new Map(); } /** * Returns filter for directories. */ DeepFilter.prototype.getFilter = function (positive, negative) { var _this = this; var positiveRe = patternUtils.convertPatternsToRe(positive, this.micromatchOptions); var negativeRe = patternUtils.convertPatternsToRe(negative, this.micromatchOptions); return function (entry) { return _this.filter(entry, positiveRe, negativeRe); }; }; /** * Returns true if entry must be added to result. */ DeepFilter.prototype.filter = function (entry, positiveRe, negativeRe) { var entryPath = entry.path; // Exclude duplicate results if (this.options.unique) { if (this.isDuplicateEntry(entry)) { return false; } this.createIndexRecord(entry); } // Mark directory by the final slash. Need to micromatch to support «directory/**» patterns if (entry.isDirectory()) { entryPath += '/'; } // Filter directories that will be excluded by deep filter if (entry.isDirectory() && patternUtils.matchAny(entryPath, negativeRe)) { return false; } // Filter files and directories by options if (this.onlyFileFilter(entry) || this.onlyDirectoryFilter(entry)) { return false; } return patternUtils.match(entryPath, positiveRe, negativeRe); }; /** * Return true if the entry already has in the cross reader index. */ DeepFilter.prototype.isDuplicateEntry = function (entry) { return this.index.has(entry.path); }; /** * Create record in the cross reader index. */ DeepFilter.prototype.createIndexRecord = function (entry) { this.index.set(entry.path, undefined); }; /** * Returns true for non-files if the «onlyFiles» option is enabled. */ DeepFilter.prototype.onlyFileFilter = function (entry) { return this.options.onlyFiles && !entry.isFile(); }; /** * Returns true for non-directories if the «onlyDirectories» option is enabled. */ DeepFilter.prototype.onlyDirectoryFilter = function (entry) { return this.options.onlyDirectories && !entry.isDirectory(); }; return DeepFilter; }()); exports.default = DeepFilter; /***/ }), /* 537 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var stream = __webpack_require__(28); var readdir = __webpack_require__(519); var reader_1 = __webpack_require__(532); var TransformStream = /** @class */ (function (_super) { __extends(TransformStream, _super); function TransformStream(reader) { var _this = _super.call(this, { objectMode: true }) || this; _this.reader = reader; return _this; } TransformStream.prototype._transform = function (entry, _encoding, callback) { callback(null, this.reader.transform(entry)); }; return TransformStream; }(stream.Transform)); var ReaderStream = /** @class */ (function (_super) { __extends(ReaderStream, _super); function ReaderStream() { return _super !== null && _super.apply(this, arguments) || this; } /** * Returns founded paths. */ ReaderStream.prototype.api = function (root, options) { return readdir.readdirStreamStat(root, options); }; /** * Use stream API to read entries for Task. */ ReaderStream.prototype.read = function (task) { var _this = this; var root = this.getRootDirectory(task); var options = this.getReaderOptions(task); var transform = new TransformStream(this); var readable = this.api(root, options); return readable .once('error', function (err) { return _this.isEnoentCodeError(err) ? null : transform.emit('error', err); }) .pipe(transform); }; return ReaderStream; }(reader_1.default)); exports.default = ReaderStream; /***/ }), /* 538 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var readdir = __webpack_require__(519); var reader_1 = __webpack_require__(532); var ReaderSync = /** @class */ (function (_super) { __extends(ReaderSync, _super); function ReaderSync() { return _super !== null && _super.apply(this, arguments) || this; } /** * Returns founded paths. */ ReaderSync.prototype.api = function (root, options) { return readdir.readdirSyncStat(root, options); }; /** * Use sync API to read entries for Task. */ ReaderSync.prototype.read = function (task) { var root = this.getRootDirectory(task); var options = this.getReaderOptions(task); try { var entries = this.api(root, options); return entries.map(this.transform, this); } catch (err) { if (this.isEnoentCodeError(err)) { return []; } throw err; } }; return ReaderSync; }(reader_1.default)); exports.default = ReaderSync; /***/ }), /* 539 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); const arrify = __webpack_require__(374); const pathType = __webpack_require__(63); const getExtensions = extensions => extensions.length > 1 ? `{${extensions.join(',')}}` : extensions[0]; const getPath = filepath => filepath[0] === '!' ? filepath.slice(1) : filepath; const addExtensions = (file, extensions) => { if (path.extname(file)) { return `**/${file}`; } return `**/${file}.${getExtensions(extensions)}`; }; const getGlob = (dir, opts) => { opts = Object.assign({}, opts); if (opts.files && !Array.isArray(opts.files)) { throw new TypeError(`\`options.files\` must be an \`Array\`, not \`${typeof opts.files}\``); } if (opts.extensions && !Array.isArray(opts.extensions)) { throw new TypeError(`\`options.extensions\` must be an \`Array\`, not \`${typeof opts.extensions}\``); } if (opts.files && opts.extensions) { return opts.files.map(x => path.join(dir, addExtensions(x, opts.extensions))); } else if (opts.files) { return opts.files.map(x => path.join(dir, `**/${x}`)); } else if (opts.extensions) { return [path.join(dir, `**/*.${getExtensions(opts.extensions)}`)]; } return [path.join(dir, '**')]; }; module.exports = (input, opts) => { return Promise.all(arrify(input).map(x => pathType.dir(getPath(x)) .then(isDir => isDir ? getGlob(x, opts) : x))) .then(globs => [].concat.apply([], globs)); }; module.exports.sync = (input, opts) => { const globs = arrify(input).map(x => pathType.dirSync(getPath(x)) ? getGlob(x, opts) : x); return [].concat.apply([], globs); }; /***/ }), /* 540 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const fs = __webpack_require__(23); const path = __webpack_require__(16); const fastGlob = __webpack_require__(376); const gitIgnore = __webpack_require__(541); const pify = __webpack_require__(542); const slash = __webpack_require__(543); const DEFAULT_IGNORE = [ '**/node_modules/**', '**/bower_components/**', '**/flow-typed/**', '**/coverage/**', '**/.git' ]; const readFileP = pify(fs.readFile); const mapGitIgnorePatternTo = base => ignore => { if (ignore.startsWith('!')) { return '!' + path.posix.join(base, ignore.substr(1)); } return path.posix.join(base, ignore); }; const parseGitIgnore = (content, opts) => { const base = slash(path.relative(opts.cwd, path.dirname(opts.fileName))); return content .split(/\r?\n/) .filter(Boolean) .filter(l => l.charAt(0) !== '#') .map(mapGitIgnorePatternTo(base)); }; const reduceIgnore = files => { return files.reduce((ignores, file) => { ignores.add(parseGitIgnore(file.content, { cwd: file.cwd, fileName: file.filePath })); return ignores; }, gitIgnore()); }; const getIsIgnoredPredecate = (ignores, cwd) => { return p => ignores.ignores(slash(path.relative(cwd, p))); }; const getFile = (file, cwd) => { const filePath = path.join(cwd, file); return readFileP(filePath, 'utf8') .then(content => ({ content, cwd, filePath })); }; const getFileSync = (file, cwd) => { const filePath = path.join(cwd, file); const content = fs.readFileSync(filePath, 'utf8'); return { content, cwd, filePath }; }; const normalizeOpts = opts => { opts = opts || {}; const ignore = opts.ignore || []; const cwd = opts.cwd || process.cwd(); return {ignore, cwd}; }; module.exports = o => { const opts = normalizeOpts(o); return fastGlob('**/.gitignore', {ignore: DEFAULT_IGNORE.concat(opts.ignore), cwd: opts.cwd}) .then(paths => Promise.all(paths.map(file => getFile(file, opts.cwd)))) .then(files => reduceIgnore(files)) .then(ignores => getIsIgnoredPredecate(ignores, opts.cwd)); }; module.exports.sync = o => { const opts = normalizeOpts(o); const paths = fastGlob.sync('**/.gitignore', {ignore: DEFAULT_IGNORE.concat(opts.ignore), cwd: opts.cwd}); const files = paths.map(file => getFileSync(file, opts.cwd)); const ignores = reduceIgnore(files); return getIsIgnoredPredecate(ignores, opts.cwd); }; /***/ }), /* 541 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } module.exports = function () { return new IgnoreBase(); }; // A simple implementation of make-array function make_array(subject) { return Array.isArray(subject) ? subject : [subject]; } var REGEX_BLANK_LINE = /^\s+$/; var REGEX_LEADING_EXCAPED_EXCLAMATION = /^\\\!/; var REGEX_LEADING_EXCAPED_HASH = /^\\#/; var SLASH = '/'; var KEY_IGNORE = typeof Symbol !== 'undefined' ? Symbol.for('node-ignore') /* istanbul ignore next */ : 'node-ignore'; var IgnoreBase = function () { function IgnoreBase() { _classCallCheck(this, IgnoreBase); this._rules = []; this[KEY_IGNORE] = true; this._initCache(); } _createClass(IgnoreBase, [{ key: '_initCache', value: function _initCache() { this._cache = {}; } // @param {Array.|string|Ignore} pattern }, { key: 'add', value: function add(pattern) { this._added = false; if (typeof pattern === 'string') { pattern = pattern.split(/\r?\n/g); } make_array(pattern).forEach(this._addPattern, this); // Some rules have just added to the ignore, // making the behavior changed. if (this._added) { this._initCache(); } return this; } // legacy }, { key: 'addPattern', value: function addPattern(pattern) { return this.add(pattern); } }, { key: '_addPattern', value: function _addPattern(pattern) { // #32 if (pattern && pattern[KEY_IGNORE]) { this._rules = this._rules.concat(pattern._rules); this._added = true; return; } if (this._checkPattern(pattern)) { var rule = this._createRule(pattern); this._added = true; this._rules.push(rule); } } }, { key: '_checkPattern', value: function _checkPattern(pattern) { // > A blank line matches no files, so it can serve as a separator for readability. return pattern && typeof pattern === 'string' && !REGEX_BLANK_LINE.test(pattern) // > A line starting with # serves as a comment. && pattern.indexOf('#') !== 0; } }, { key: 'filter', value: function filter(paths) { var _this = this; return make_array(paths).filter(function (path) { return _this._filter(path); }); } }, { key: 'createFilter', value: function createFilter() { var _this2 = this; return function (path) { return _this2._filter(path); }; } }, { key: 'ignores', value: function ignores(path) { return !this._filter(path); } }, { key: '_createRule', value: function _createRule(pattern) { var origin = pattern; var negative = false; // > An optional prefix "!" which negates the pattern; if (pattern.indexOf('!') === 0) { negative = true; pattern = pattern.substr(1); } pattern = pattern // > Put a backslash ("\") in front of the first "!" for patterns that begin with a literal "!", for example, `"\!important!.txt"`. .replace(REGEX_LEADING_EXCAPED_EXCLAMATION, '!') // > Put a backslash ("\") in front of the first hash for patterns that begin with a hash. .replace(REGEX_LEADING_EXCAPED_HASH, '#'); var regex = make_regex(pattern, negative); return { origin: origin, pattern: pattern, negative: negative, regex: regex }; } // @returns `Boolean` true if the `path` is NOT ignored }, { key: '_filter', value: function _filter(path, slices) { if (!path) { return false; } if (path in this._cache) { return this._cache[path]; } if (!slices) { // path/to/a.js // ['path', 'to', 'a.js'] slices = path.split(SLASH); } slices.pop(); return this._cache[path] = slices.length // > It is not possible to re-include a file if a parent directory of that file is excluded. // If the path contains a parent directory, check the parent first ? this._filter(slices.join(SLASH) + SLASH, slices) && this._test(path) // Or only test the path : this._test(path); } // @returns {Boolean} true if a file is NOT ignored }, { key: '_test', value: function _test(path) { // Explicitly define variable type by setting matched to `0` var matched = 0; this._rules.forEach(function (rule) { // if matched = true, then we only test negative rules // if matched = false, then we test non-negative rules if (!(matched ^ rule.negative)) { matched = rule.negative ^ rule.regex.test(path); } }); return !matched; } }]); return IgnoreBase; }(); // > If the pattern ends with a slash, // > it is removed for the purpose of the following description, // > but it would only find a match with a directory. // > In other words, foo/ will match a directory foo and paths underneath it, // > but will not match a regular file or a symbolic link foo // > (this is consistent with the way how pathspec works in general in Git). // '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' // -> ignore-rules will not deal with it, because it costs extra `fs.stat` call // you could use option `mark: true` with `glob` // '`foo/`' should not continue with the '`..`' var DEFAULT_REPLACER_PREFIX = [ // > Trailing spaces are ignored unless they are quoted with backslash ("\") [ // (a\ ) -> (a ) // (a ) -> (a) // (a \ ) -> (a ) /\\?\s+$/, function (match) { return match.indexOf('\\') === 0 ? ' ' : ''; }], // replace (\ ) with ' ' [/\\\s/g, function () { return ' '; }], // Escape metacharacters // which is written down by users but means special for regular expressions. // > There are 12 characters with special meanings: // > - the backslash \, // > - the caret ^, // > - the dollar sign $, // > - the period or dot ., // > - the vertical bar or pipe symbol |, // > - the question mark ?, // > - the asterisk or star *, // > - the plus sign +, // > - the opening parenthesis (, // > - the closing parenthesis ), // > - and the opening square bracket [, // > - the opening curly brace {, // > These special characters are often called "metacharacters". [/[\\\^$.|?*+()\[{]/g, function (match) { return '\\' + match; }], // leading slash [ // > A leading slash matches the beginning of the pathname. // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". // A leading slash matches the beginning of the pathname /^\//, function () { return '^'; }], // replace special metacharacter slash after the leading slash [/\//g, function () { return '\\/'; }], [ // > A leading "**" followed by a slash means match in all directories. // > For example, "**/foo" matches file or directory "foo" anywhere, // > the same as pattern "foo". // > "**/foo/bar" matches file or directory "bar" anywhere that is directly under directory "foo". // Notice that the '*'s have been replaced as '\\*' /^\^*\\\*\\\*\\\//, // '**/foo' <-> 'foo' function () { return '^(?:.*\\/)?'; }]]; var DEFAULT_REPLACER_SUFFIX = [ // starting [ // there will be no leading '/' (which has been replaced by section "leading slash") // If starts with '**', adding a '^' to the regular expression also works /^(?=[^\^])/, function () { return !/\/(?!$)/.test(this) // > If the pattern does not contain a slash /, Git treats it as a shell glob pattern // Actually, if there is only a trailing slash, git also treats it as a shell glob pattern ? '(?:^|\\/)' // > Otherwise, Git treats the pattern as a shell glob suitable for consumption by fnmatch(3) : '^'; }], // two globstars [ // Use lookahead assertions so that we could match more than one `'/**'` /\\\/\\\*\\\*(?=\\\/|$)/g, // Zero, one or several directories // should not use '*', or it will be replaced by the next replacer // Check if it is not the last `'/**'` function (match, index, str) { return index + 6 < str.length // case: /**/ // > A slash followed by two consecutive asterisks then a slash matches zero or more directories. // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. // '/**/' ? '(?:\\/[^\\/]+)*' // case: /** // > A trailing `"/**"` matches everything inside. // #21: everything inside but it should not include the current folder : '\\/.+'; }], // intermediate wildcards [ // Never replace escaped '*' // ignore rule '\*' will match the path '*' // 'abc.*/' -> go // 'abc.*' -> skip this rule /(^|[^\\]+)\\\*(?=.+)/g, // '*.js' matches '.js' // '*.js' doesn't match 'abc' function (match, p1) { return p1 + '[^\\/]*'; }], // trailing wildcard [/(\^|\\\/)?\\\*$/, function (match, p1) { return (p1 // '\^': // '/*' does not match '' // '/*' does not match everything // '\\\/': // 'abc/*' does not match 'abc/' ? p1 + '[^/]+' // 'a*' matches 'a' // 'a*' matches 'aa' : '[^/]*') + '(?=$|\\/$)'; }], [ // unescape /\\\\\\/g, function () { return '\\'; }]]; var POSITIVE_REPLACERS = [].concat(DEFAULT_REPLACER_PREFIX, [ // 'f' // matches // - /f(end) // - /f/ // - (start)f(end) // - (start)f/ // doesn't match // - oof // - foo // pseudo: // -> (^|/)f(/|$) // ending [ // 'js' will not match 'js.' // 'ab' will not match 'abc' /(?:[^*\/])$/, // 'js*' will not match 'a.js' // 'js/' will not match 'a.js' // 'js' will match 'a.js' and 'a.js/' function (match) { return match + '(?=$|\\/)'; }]], DEFAULT_REPLACER_SUFFIX); var NEGATIVE_REPLACERS = [].concat(DEFAULT_REPLACER_PREFIX, [ // #24, #38 // The MISSING rule of [gitignore docs](https://git-scm.com/docs/gitignore) // A negative pattern without a trailing wildcard should not // re-include the things inside that directory. // eg: // ['node_modules/*', '!node_modules'] // should ignore `node_modules/a.js` [/(?:[^*])$/, function (match) { return match + '(?=$|\\/$)'; }]], DEFAULT_REPLACER_SUFFIX); // A simple cache, because an ignore rule only has only one certain meaning var cache = {}; // @param {pattern} function make_regex(pattern, negative) { var r = cache[pattern]; if (r) { return r; } var replacers = negative ? NEGATIVE_REPLACERS : POSITIVE_REPLACERS; var source = replacers.reduce(function (prev, current) { return prev.replace(current[0], current[1].bind(pattern)); }, pattern); return cache[pattern] = new RegExp(source, 'i'); } // Windows // -------------------------------------------------------------- /* istanbul ignore if */ if ( // Detect `process` so that it can run in browsers. typeof process !== 'undefined' && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === 'win32')) { var filter = IgnoreBase.prototype._filter; var make_posix = function make_posix(str) { return (/^\\\\\?\\/.test(str) || /[^\x00-\x80]+/.test(str) ? str : str.replace(/\\/g, '/') ); }; IgnoreBase.prototype._filter = function (path, slices) { path = make_posix(path); return filter.call(this, path, slices); }; } /***/ }), /* 542 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const processFn = (fn, opts) => function () { const P = opts.promiseModule; const args = new Array(arguments.length); for (let i = 0; i < arguments.length; i++) { args[i] = arguments[i]; } return new P((resolve, reject) => { if (opts.errorFirst) { args.push(function (err, result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 1; i < arguments.length; i++) { results[i - 1] = arguments[i]; } if (err) { results.unshift(err); reject(results); } else { resolve(results); } } else if (err) { reject(err); } else { resolve(result); } }); } else { args.push(function (result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 0; i < arguments.length; i++) { results[i] = arguments[i]; } resolve(results); } else { resolve(result); } }); } fn.apply(this, args); }); }; module.exports = (obj, opts) => { opts = Object.assign({ exclude: [/.+(Sync|Stream)$/], errorFirst: true, promiseModule: Promise }, opts); const filter = key => { const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); return opts.include ? opts.include.some(match) : !opts.exclude.some(match); }; let ret; if (typeof obj === 'function') { ret = function () { if (opts.excludeMain) { return obj.apply(this, arguments); } return processFn(obj, opts).apply(this, arguments); }; } else { ret = Object.create(Object.getPrototypeOf(obj)); } for (const key in obj) { // eslint-disable-line guard-for-in const x = obj[key]; ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x; } return ret; }; /***/ }), /* 543 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (str) { var isExtendedLengthPath = /^\\\\\?\\/.test(str); var hasNonAscii = /[^\x00-\x80]+/.test(str); if (isExtendedLengthPath || hasNonAscii) { return str; } return str.replace(/\\/g, '/'); }; /***/ }), /* 544 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(16); const fsConstants = __webpack_require__(23).constants; const {Buffer} = __webpack_require__(545); const CpFileError = __webpack_require__(547); const fs = __webpack_require__(549); const ProgressEmitter = __webpack_require__(551); module.exports = (src, dest, opts) => { if (!src || !dest) { return Promise.reject(new CpFileError('`src` and `dest` required')); } opts = Object.assign({overwrite: true}, opts); const progressEmitter = new ProgressEmitter(path.resolve(src), path.resolve(dest)); const promise = fs .stat(src) .then(stat => { progressEmitter.size = stat.size; }) .then(() => fs.createReadStream(src)) .then(read => fs.makeDir(path.dirname(dest)).then(() => read)) .then(read => new Promise((resolve, reject) => { const write = fs.createWriteStream(dest, {flags: opts.overwrite ? 'w' : 'wx'}); read.on('data', () => { progressEmitter.written = write.bytesWritten; }); write.on('error', err => { if (!opts.overwrite && err.code === 'EEXIST') { resolve(false); return; } reject(new CpFileError(`Cannot write to \`${dest}\`: ${err.message}`, err)); }); write.on('close', () => { progressEmitter.written = progressEmitter.size; resolve(true); }); read.pipe(write); })) .then(updateStats => { if (updateStats) { return fs.lstat(src).then(stats => Promise.all([ fs.utimes(dest, stats.atime, stats.mtime), fs.chmod(dest, stats.mode), fs.chown(dest, stats.uid, stats.gid) ])); } }); promise.on = (...args) => { progressEmitter.on(...args); return promise; }; return promise; }; const checkSrcIsFile = (stat, src) => { if (stat.isDirectory()) { throw Object.assign(new CpFileError(`EISDIR: illegal operation on a directory '${src}'`), { errno: -21, code: 'EISDIR', src }); } }; const fixupAttributes = (dest, stat) => { fs.chmodSync(dest, stat.mode); fs.chownSync(dest, stat.uid, stat.gid); }; const copySyncNative = (src, dest, opts) => { const stat = fs.statSync(src); checkSrcIsFile(stat, src); fs.makeDirSync(path.dirname(dest)); const flags = opts.overwrite ? null : fsConstants.COPYFILE_EXCL; try { fs.copyFileSync(src, dest, flags); } catch (err) { if (!opts.overwrite && err.code === 'EEXIST') { return; } throw err; } fs.utimesSync(dest, stat.atime, stat.mtime); fixupAttributes(dest, stat); }; const copySyncFallback = (src, dest, opts) => { let read; // eslint-disable-line prefer-const let bytesRead; let pos; let write; const BUF_LENGTH = 100 * 1024; const buf = Buffer.alloc(BUF_LENGTH); const readSync = pos => fs.readSync(read, buf, 0, BUF_LENGTH, pos, src); const writeSync = () => fs.writeSync(write, buf, 0, bytesRead, undefined, dest); read = fs.openSync(src, 'r'); bytesRead = readSync(0); pos = bytesRead; fs.makeDirSync(path.dirname(dest)); try { write = fs.openSync(dest, opts.overwrite ? 'w' : 'wx'); } catch (err) { if (!opts.overwrite && err.code === 'EEXIST') { return; } throw err; } writeSync(); while (bytesRead === BUF_LENGTH) { bytesRead = readSync(pos); writeSync(); pos += bytesRead; } const stat = fs.fstatSync(read, src); fs.futimesSync(write, stat.atime, stat.mtime, dest); fs.closeSync(read); fs.closeSync(write); fixupAttributes(dest, stat); }; module.exports.sync = (src, dest, opts) => { if (!src || !dest) { throw new CpFileError('`src` and `dest` required'); } opts = Object.assign({overwrite: true}, opts); if (fs.copyFileSync) { copySyncNative(src, dest, opts); } else { copySyncFallback(src, dest, opts); } }; /***/ }), /* 545 */ /***/ (function(module, exports, __webpack_require__) { /* eslint-disable node/no-deprecated-api */ var buffer = __webpack_require__(546) var Buffer = buffer.Buffer // alternative to using Object.keys for old browsers function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } } if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer } else { // Copy properties from require('buffer') copyProps(buffer, exports) exports.Buffer = SafeBuffer } function SafeBuffer (arg, encodingOrOffset, length) { return Buffer(arg, encodingOrOffset, length) } // Copy static methods from Buffer copyProps(Buffer, SafeBuffer) SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { throw new TypeError('Argument must not be a number') } return Buffer(arg, encodingOrOffset, length) } SafeBuffer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } var buf = Buffer(size) if (fill !== undefined) { if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } } else { buf.fill(0) } return buf } SafeBuffer.allocUnsafe = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return Buffer(size) } SafeBuffer.allocUnsafeSlow = function (size) { if (typeof size !== 'number') { throw new TypeError('Argument must be a number') } return buffer.SlowBuffer(size) } /***/ }), /* 546 */ /***/ (function(module, exports) { module.exports = require("buffer"); /***/ }), /* 547 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const NestedError = __webpack_require__(548); class CpFileError extends NestedError { constructor(message, nested) { super(message, nested); Object.assign(this, nested); this.name = 'CpFileError'; } } module.exports = CpFileError; /***/ }), /* 548 */ /***/ (function(module, exports, __webpack_require__) { var inherits = __webpack_require__(43); var NestedError = function (message, nested) { this.nested = nested; if (typeof message !== 'undefined') { Object.defineProperty(this, 'message', { value: message, writable: true, enumerable: false, configurable: true }); } Error.captureStackTrace(this, this.constructor); var oldStackDescriptor = Object.getOwnPropertyDescriptor(this, 'stack'); var stackDescriptor = buildStackDescriptor(oldStackDescriptor, nested); Object.defineProperty(this, 'stack', stackDescriptor); }; function buildStackDescriptor(oldStackDescriptor, nested) { if (oldStackDescriptor.get) { return { get: function () { var stack = oldStackDescriptor.get.call(this); return buildCombinedStacks(stack, this.nested); } }; } else { var stack = oldStackDescriptor.value; return { value: buildCombinedStacks(stack, nested) }; } } function buildCombinedStacks(stack, nested) { if (nested) { stack += '\nCaused By: ' + nested.stack; } return stack; } inherits(NestedError, Error); NestedError.prototype.name = 'NestedError'; module.exports = NestedError; /***/ }), /* 549 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const fs = __webpack_require__(22); const makeDir = __webpack_require__(91); const pify = __webpack_require__(550); const CpFileError = __webpack_require__(547); const fsP = pify(fs); exports.closeSync = fs.closeSync.bind(fs); exports.createWriteStream = fs.createWriteStream.bind(fs); exports.createReadStream = (path, options) => new Promise((resolve, reject) => { const read = fs.createReadStream(path, options); read.once('error', err => { reject(new CpFileError(`Cannot read from \`${path}\`: ${err.message}`, err)); }); read.once('readable', () => { resolve(read); }); read.once('end', () => { resolve(read); }); }); exports.stat = path => fsP.stat(path).catch(err => { throw new CpFileError(`Cannot stat path \`${path}\`: ${err.message}`, err); }); exports.lstat = path => fsP.lstat(path).catch(err => { throw new CpFileError(`lstat \`${path}\` failed: ${err.message}`, err); }); exports.utimes = (path, atime, mtime) => fsP.utimes(path, atime, mtime).catch(err => { throw new CpFileError(`utimes \`${path}\` failed: ${err.message}`, err); }); exports.chmod = (path, mode) => fsP.chmod(path, mode).catch(err => { throw new CpFileError(`chmod \`${path}\` failed: ${err.message}`, err); }); exports.chown = (path, uid, gid) => fsP.chown(path, uid, gid).catch(err => { throw new CpFileError(`chown \`${path}\` failed: ${err.message}`, err); }); exports.openSync = (path, flags, mode) => { try { return fs.openSync(path, flags, mode); } catch (err) { if (flags.includes('w')) { throw new CpFileError(`Cannot write to \`${path}\`: ${err.message}`, err); } throw new CpFileError(`Cannot open \`${path}\`: ${err.message}`, err); } }; // eslint-disable-next-line max-params exports.readSync = (fd, buffer, offset, length, position, path) => { try { return fs.readSync(fd, buffer, offset, length, position); } catch (err) { throw new CpFileError(`Cannot read from \`${path}\`: ${err.message}`, err); } }; // eslint-disable-next-line max-params exports.writeSync = (fd, buffer, offset, length, position, path) => { try { return fs.writeSync(fd, buffer, offset, length, position); } catch (err) { throw new CpFileError(`Cannot write to \`${path}\`: ${err.message}`, err); } }; exports.statSync = path => { try { return fs.statSync(path); } catch (err) { throw new CpFileError(`stat \`${path}\` failed: ${err.message}`, err); } }; exports.fstatSync = (fd, path) => { try { return fs.fstatSync(fd); } catch (err) { throw new CpFileError(`fstat \`${path}\` failed: ${err.message}`, err); } }; exports.futimesSync = (fd, atime, mtime, path) => { try { return fs.futimesSync(fd, atime, mtime, path); } catch (err) { throw new CpFileError(`futimes \`${path}\` failed: ${err.message}`, err); } }; exports.utimesSync = (path, atime, mtime) => { try { return fs.utimesSync(path, atime, mtime); } catch (err) { throw new CpFileError(`utimes \`${path}\` failed: ${err.message}`, err); } }; exports.chmodSync = (path, mode) => { try { return fs.chmodSync(path, mode); } catch (err) { throw new CpFileError(`chmod \`${path}\` failed: ${err.message}`, err); } }; exports.chownSync = (path, uid, gid) => { try { return fs.chownSync(path, uid, gid); } catch (err) { throw new CpFileError(`chown \`${path}\` failed: ${err.message}`, err); } }; exports.makeDir = path => makeDir(path, {fs}).catch(err => { throw new CpFileError(`Cannot create directory \`${path}\`: ${err.message}`, err); }); exports.makeDirSync = path => { try { makeDir.sync(path, {fs}); } catch (err) { throw new CpFileError(`Cannot create directory \`${path}\`: ${err.message}`, err); } }; if (fs.copyFileSync) { exports.copyFileSync = (src, dest, flags) => { try { fs.copyFileSync(src, dest, flags); } catch (err) { throw new CpFileError(`Cannot copy from \`${src}\` to \`${dest}\`: ${err.message}`, err); } }; } /***/ }), /* 550 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const processFn = (fn, opts) => function () { const P = opts.promiseModule; const args = new Array(arguments.length); for (let i = 0; i < arguments.length; i++) { args[i] = arguments[i]; } return new P((resolve, reject) => { if (opts.errorFirst) { args.push(function (err, result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 1; i < arguments.length; i++) { results[i - 1] = arguments[i]; } if (err) { results.unshift(err); reject(results); } else { resolve(results); } } else if (err) { reject(err); } else { resolve(result); } }); } else { args.push(function (result) { if (opts.multiArgs) { const results = new Array(arguments.length - 1); for (let i = 0; i < arguments.length; i++) { results[i] = arguments[i]; } resolve(results); } else { resolve(result); } }); } fn.apply(this, args); }); }; module.exports = (obj, opts) => { opts = Object.assign({ exclude: [/.+(Sync|Stream)$/], errorFirst: true, promiseModule: Promise }, opts); const filter = key => { const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); return opts.include ? opts.include.some(match) : !opts.exclude.some(match); }; let ret; if (typeof obj === 'function') { ret = function () { if (opts.excludeMain) { return obj.apply(this, arguments); } return processFn(obj, opts).apply(this, arguments); }; } else { ret = Object.create(Object.getPrototypeOf(obj)); } for (const key in obj) { // eslint-disable-line guard-for-in const x = obj[key]; ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x; } return ret; }; /***/ }), /* 551 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const EventEmitter = __webpack_require__(45); const written = new WeakMap(); class ProgressEmitter extends EventEmitter { constructor(src, dest) { super(); this.src = src; this.dest = dest; } set written(value) { written.set(this, value); this.emitProgress(); } get written() { return written.get(this); } emitProgress() { const {size, written} = this; this.emit('progress', { src: this.src, dest: this.dest, size, written, percent: written === size ? 1 : written / size }); } } module.exports = ProgressEmitter; /***/ }), /* 552 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const NestedError = __webpack_require__(548); class CpyError extends NestedError { constructor(message, nested) { super(message, nested); Object.assign(this, nested); this.name = 'CpyError'; } } module.exports = CpyError; /***/ }), /* 553 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareExternalProjectDependencies", function() { return prepareExternalProjectDependencies; }); /* harmony import */ var _utils_package_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54); /* harmony import */ var _utils_project__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53); /* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * All external projects are located within `./plugins/{plugin}` relative * to the Kibana root directory or `../kibana-extra/{plugin}` relative * to Kibana itself. */ const isKibanaDep = depVersion => depVersion.includes('../../kibana/'); /** * This prepares the dependencies for an _external_ project. */ async function prepareExternalProjectDependencies(projectPath) { const project = await _utils_project__WEBPACK_IMPORTED_MODULE_1__["Project"].fromPath(projectPath); if (!project.hasDependencies()) { return; } const deps = project.allDependencies; for (const depName of Object.keys(deps)) { const depVersion = deps[depName]; // Kibana currently only supports `link:` dependencies on Kibana's own // packages, as these are packaged into the `node_modules` folder when // Kibana is built, so we don't need to take any action to enable // `require(...)` to resolve for these packages. if (Object(_utils_package_json__WEBPACK_IMPORTED_MODULE_0__["isLinkDependency"])(depVersion) && !isKibanaDep(depVersion)) { // For non-Kibana packages we need to set up symlinks during the // installation process, but this is not something we support yet. throw new Error('This plugin is using `link:` dependencies for non-Kibana packages'); } } } /***/ }) /******/ ]);