diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index bc7e8194..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,97 +0,0 @@ -version: 2 -jobs: - install: - macos: - xcode: "9.2.0" - working_directory: ~/repo - steps: - - checkout - - restore_cache: - key: cache-{{ checksum "yarn.lock" }} - - run: - name: Installing Dependencies - command: yarn --ignore-engines - - save_cache: - key: cache-{{ checksum "yarn.lock" }} - paths: - - node_modules - - run: - name: Getting build icon - command: if [[ $CIRCLE_BRANCH == canary ]]; then cp build/canary.icns build/icon.icns; fi - - persist_to_workspace: - root: . - paths: - - node_modules - - test: - macos: - xcode: "9.2.0" - steps: - - checkout - - attach_workspace: - at: . - - run: - name: Testing - command: yarn test - - build: - macos: - xcode: "9.2.0" - steps: - - checkout - - attach_workspace: - at: . - - run: - name: Building - command: yarn dist --publish 'never' - - store_artifacts: - path: dist - - persist_to_workspace: - root: . - paths: - - dist - - release: - macos: - xcode: "9.2.0" - steps: - - checkout - - attach_workspace: - at: . - - run: - name: Deploying to GitHub - command: yarn dist - - -workflows: - version: 2 - build: - jobs: - - install: - filters: - tags: - only: /.*/ - - test: - requires: - - install - filters: - tags: - only: /.*/ - - build: - requires: - - test - filters: - branches: - only: - - master - - canary - tags: - ignore: /.*/ - - release: - requires: - - test - filters: - tags: - only: /.*/ - branches: - ignore: /.*/ diff --git a/.eslintignore b/.eslintignore index 9344d5af..5f94ba00 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,7 +4,9 @@ app/static app/bin app/dist app/node_modules +app/typings assets website bin -dist \ No newline at end of file +dist +target \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..02af8b96 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,113 @@ +{ + "plugins": [ + "react", + "prettier", + "@typescript-eslint", + "eslint-comments" + ], + "extends": [ + "eslint:recommended", + "plugin:react/recommended", + "plugin:prettier/recommended", + "plugin:eslint-comments/recommended" + ], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 8, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true, + "impliedStrict": true, + "experimentalObjectRestSpread": true + }, + "allowImportExportEverywhere": true, + "project": [ + "./tsconfig.eslint.json" + ] + }, + "env": { + "es6": true, + "browser": true, + "node": true + }, + "settings": { + "react": { + "version": "detect" + } + }, + "rules": { + "func-names": [ + "error", + "as-needed" + ], + "no-shadow": "error", + "no-extra-semi": 0, + "react/prop-types": 0, + "react/react-in-jsx-scope": 0, + "react/no-unescaped-entities": 0, + "react/jsx-no-target-blank": 0, + "react/no-string-refs": 0, + "prettier/prettier": [ + "error", + { + "printWidth": 120, + "tabWidth": 2, + "singleQuote": true, + "trailingComma": "none", + "bracketSpacing": false, + "semi": true, + "useTabs": false, + "jsxBracketSameLine": false + } + ], + "eslint-comments/no-unused-disable": "error" + }, + "overrides": [ + { + "files": [ + "app/config/config-default.js", + ".hyper.js" + ], + "rules": { + "prettier/prettier": [ + "error", + { + "printWidth": 120, + "tabWidth": 2, + "singleQuote": true, + "trailingComma": "es5", + "bracketSpacing": false, + "semi": true, + "useTabs": false, + "parser": "babel", + "jsxBracketSameLine": false + } + ] + } + }, + { + "files": [ + "**.ts", + "**.tsx" + ], + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "prettier" + ], + "rules": { + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/prefer-optional-chain": "error", + "@typescript-eslint/ban-types": "off", + "no-shadow": "off", + "@typescript-eslint/no-shadow": ["error"], + "@typescript-eslint/no-unsafe-assignment": "off", + "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/restrict-template-expressions": "off" + } + } + ] +} diff --git a/.gitattributes b/.gitattributes index 391f0a4e..97c115ec 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,5 @@ * text=auto *.js text eol=lf +*.ts text eol=lf +*.tsx text eol=lf +bin/* linguist-vendored diff --git a/.github/issue_template.md b/.github/ISSUE_TEMPLATE/bug_report.md similarity index 74% rename from .github/issue_template.md rename to .github/ISSUE_TEMPLATE/bug_report.md index b7bef5b2..3e772142 100644 --- a/.github/issue_template.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,14 +1,23 @@ +--- +name: Bug report +about: Create a report to help Hyper improve +title: '' +labels: '' +assignees: '' + +--- + -- [ ] I am on the [latest](https://github.com/zeit/hyper/releases/latest) Hyper.app version -- [ ] I have searched the [issues](https://github.com/zeit/hyper/issues) of this repo and believe that this is not a duplicate +- [ ] I am on the [latest](https://github.com/vercel/hyper/releases/latest) Hyper.app version +- [ ] I have searched the [issues](https://github.com/vercel/hyper/issues) of this repo and believe that this is not a duplicate diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 00000000..07532e5e --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,67 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ canary ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ canary ] + schedule: + - cron: '37 6 * * 5' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 00000000..40901325 --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,76 @@ +name: Node CI +on: + push: + branches: + - master + - canary + pull_request: +defaults: + run: + shell: bash +jobs: + build: + runs-on: ${{matrix.os}} + strategy: + matrix: + node-version: [14.x] + os: [macos-11.0, ubuntu-latest, windows-latest] + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Install + run: yarn install + - name: Test + run: yarn run test + - name: Getting Build Icon + if: github.ref == 'refs/heads/canary' || github.base_ref == 'canary' + run: | + cp build/canary.ico build/icon.ico + cp build/canary.icns build/icon.icns + - name: Build (pr) + if: github.event_name == 'pull_request' + run: yarn run dist --publish=never + - name: Build (push) + if: github.event_name == 'push' + run: yarn run dist + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CSC_LINK: ${{ secrets.MAC_CERT_P12_BASE64 }} + CSC_KEY_PASSWORD: ${{ secrets.MAC_CERT_P12_PASSWORD }} + WIN_CSC_LINK: ${{ secrets.WIN_CERT_P12_BASE64 }} + WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CERT_P12_PASSWORD }} + - name: Test Spectron + if: runner.os != 'Linux' + run: yarn run test:spectron + - name: Archive Spectron test screenshot + if: runner.os != 'Linux' + uses: actions/upload-artifact@v2 + with: + name: spectron + path: dist/tmp/*.png + - name: Archive Build Artifacts + uses: LabhanshAgrawal/upload-artifact@v3 + with: + path: | + dist/*.dmg + dist/*.snap + dist/*.AppImage + dist/*.deb + dist/*.rpm + dist/*.exe + - name: Save the pr number in an artifact + if: github.event_name == 'pull_request' + env: + PR_NUM: ${{ github.event.number }} + run: echo $PR_NUM > pr_num.txt + - name: Upload the pr num + uses: actions/upload-artifact@v2 + if: github.event_name == 'pull_request' + with: + name: pr_num + path: ./pr_num.txt diff --git a/.github/workflows/spectron_comment.yml b/.github/workflows/spectron_comment.yml new file mode 100644 index 00000000..d2f5ac4c --- /dev/null +++ b/.github/workflows/spectron_comment.yml @@ -0,0 +1,56 @@ +name: Comment spectron screenshots on PR +on: + workflow_run: + workflows: ['Node CI'] + types: + - completed +jobs: + spectron_comment: + runs-on: ubuntu-latest + if: github.event.workflow_run.event == 'pull_request' + steps: + - name: Dump Workflow run info from GitHub context + env: + WORKFLOW_RUN_INFO: ${{ toJSON(github.event.workflow_run) }} + run: echo "$WORKFLOW_RUN_INFO" + - name: Download Artifacts + uses: dawidd6/action-download-artifact@v2.11.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + workflow: nodejs.yml + run_id: ${{ github.event.workflow_run.id }} + name: spectron + - name: Get PR number + uses: dawidd6/action-download-artifact@v2.11.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + workflow: nodejs.yml + run_id: ${{ github.event.workflow_run.id }} + name: pr_num + - name: Read the pr_num file + id: pr_num_reader + uses: juliangruber/read-file-action@v1.0.0 + with: + path: ./pr_num.txt + - name: List images + run: ls -al + - name: Upload images to imgur + id: upload_screenshots + uses: devicons/public-upload-to-imgur@v2.2.1 + with: + path: ./*.png + client_id: ${{ secrets.IMGUR_CLIENT_ID }} + - name: Comment on the PR + uses: jungwinter/comment@v1 + env: + IMG_MARKDOWN: ${{ join(fromJSON(steps.upload_screenshots.outputs.markdown_urls), '') }} + MESSAGE: | + Hi there, + Here are screenshots of Hyper built from this pr. + {0} + Thank you for contributing to Hyper! + with: + type: create + issue_number: ${{ steps.pr_num_reader.outputs.content }} + token: ${{ secrets.GITHUB_TOKEN }} + body: ${{ format(env.MESSAGE, env.IMG_MARKDOWN) }} diff --git a/.gitignore b/.gitignore index b5ec510d..ef95864f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # build output dist app/renderer +target bin/cli.* # dependencies @@ -15,3 +16,6 @@ yarn-error.log .hyper_plugins .DS_Store +.vscode/* +!.vscode/launch.json +.idea diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 00000000..31354ec1 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-push b/.husky/pre-push new file mode 100755 index 00000000..f077c917 --- /dev/null +++ b/.husky/pre-push @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9a4b1cae..00000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -sudo: required -dist: trusty - -language: node_js - -matrix: - include: - - os: linux - node_js: 10.2.0 - env: CC=clang CXX=clang++ npm_config_clang=1 - compiler: clang - -addons: - apt: - packages: - - gcc-multilib - - g++-multilib - - libgnome-keyring-dev - - icnsutils - - graphicsmagick - - xz-utils - - rpm - - bsdtar - - snapd - -before_install: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo snap install snapcraft --classic; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start; sleep 3; fi - -cache: yarn - -install: - - yarn - -after_success: - - (git branch --contains $TRAVIS_COMMIT | grep canary > /dev/null || [[ "$TRAVIS_BRANCH" == "canary" ]] ) && (cd build; cp canary.icns icon.icns; cp canary.ico icon.ico) - - yarn run dist - -branches: - except: - - "/^v\\d+\\.\\d+\\.\\d+$/" diff --git a/.vscode/launch.json b/.vscode/launch.json index 9f50ef8f..747bb7b0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,7 +6,7 @@ "request": "launch", "name": "Launch Hyper", "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron", - "program": "${workspaceRoot}/app/index.js", + "program": "${workspaceRoot}/target/index.js", "protocol": "inspector" }, { diff --git a/.yarnrc b/.yarnrc index 3d567722..45291c13 100644 --- a/.yarnrc +++ b/.yarnrc @@ -1 +1 @@ -save-exact true +registry "https://registry.npmjs.org/" diff --git a/LICENSE b/LICENSE index 89491ddb..fe231dc9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ # MIT License -Copyright (c) 2018 ZEIT, Inc. +Copyright (c) 2018 Vercel, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/PLUGINS.md b/PLUGINS.md index 3516119f..d266854d 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -3,11 +3,11 @@ ## Workflow ### Run Hyper in dev mode -Hyper can be run in dev mode by cloning this repository and following the ["Contributing" section of our README](https://github.com/zeit/hyper#contribute). +Hyper can be run in dev mode by cloning this repository and following the ["Contributing" section of our README](https://github.com/vercel/hyper#contribute). In dev mode you'll get more ouput and access to React/Redux dev-tools in Electron. -Prerequisites and steps are described in the ["Contributing" section of our README](https://github.com/zeit/hyper#contribute). +Prerequisites and steps are described in the ["Contributing" section of our README](https://github.com/vercel/hyper#contribute). Be sure to use the `canary` branch. ### Create a dev config file @@ -30,7 +30,7 @@ module.exports = { ``` ### Running your plugin -To load, your plugin should expose at least one API method. All possible methods are listed [here](https://github.com/zeit/hyper/blob/canary/app/plugins/extensions.js). +To load, your plugin should expose at least one API method. All possible methods are listed [here](https://github.com/vercel/hyper/blob/canary/app/plugins/extensions.ts). After launching Hyper in dev mode, run `yarn run app`, it should log that your plugin has been correcty loaded: `Plugin hyper-awesome-plugin (0.1.0) loaded.`. Name and version printed are the ones in your plugins `package.json` file. @@ -41,7 +41,7 @@ Almost all available API methods can be found on https://hyper.is. If there's any missing, let us know or submit a PR to document it! ### Components -You can decorate almost all Hyper components with a Higher-Order Component (HOC). To understand their architecture, the easiest way is to use React dev-tools to dig in to their hierachy. +You can decorate almost all Hyper components with a Higher-Order Component (HOC). To understand their architecture, the easiest way is to use React dev-tools to dig in to their hierarchy. Multiple plugins can decorate the same Hyper component. Thus, `Component` passed as first argument to your decorator function could possibly not be an original Hyper component but a HOC of a previous plugin. If you need to retrieve a reference to a real Hyper component, you can pass down a `onDecorated` handler. ```js @@ -70,7 +70,7 @@ exports.decorateTerms = (Terms, {React}) => { // } } -``` +``` :warning: Note that you have to execute `this.props.onDecorated` to not break the handler chain. Without this, you could break other plugins that decorate the same component. ### Keymaps @@ -190,6 +190,17 @@ exports.decorateTerm = (Term, { React, notify }) => { } ``` +### Require Electron +Hyper doesn't provide a reference to electron. However plugins can directly require electron. + +```js +const electron = require('electron') +// or +const { dialog, Menu } = require('electron') +``` + +This is needed in order to allow show/hide to have proper return of focus. + ## Hyper v2 breaking changes Hyper v2 uses `xterm.js` instead of `hterm`. It means that PTY output renders now in a canvas element, not with a hackable DOM structure. For example, plugins can't use TermCSS in order to modify text or link styles anymore. It is now required to use available configuration params that are passed down to `xterm.js`. diff --git a/README.md b/README.md index d7ca2446..813120cb 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,39 @@ -![](https://assets.zeit.co/image/upload/v1549723846/repositories/hyper/hyper-3-repo-banner.png) +![](https://assets.vercel.com/image/upload/v1549723846/repositories/hyper/hyper-3-repo-banner.png) -[![macOS CI Status](https://circleci.com/gh/zeit/hyper.svg?style=shield)](https://circleci.com/gh/zeit/hyper) -[![Windows CI status](https://ci.appveyor.com/api/projects/status/kqvb4oa772an58sc?svg=true)](https://ci.appveyor.com/project/zeit/hyper) -[![Linux CI status](https://travis-ci.org/zeit/hyper.svg?branch=master)](https://travis-ci.org/zeit/hyper) +

+ + + +

+ +[![Node CI](https://github.com/vercel/hyper/workflows/Node%20CI/badge.svg?event=push)](https://github.com/vercel/hyper/actions?query=workflow%3A%22Node+CI%22+branch%3Acanary+event%3Apush) [![Changelog #213](https://img.shields.io/badge/changelog-%23213-lightgrey.svg)](https://changelog.com/213) -[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit/hyper) For more details, head to: https://hyper.is +## Project goals + +The goal of the project is to create a beautiful and extensible experience for command-line interface users, built on open web standards. In the beginning, our focus will be primarily around speed, stability and the development of the correct API for extension authors. + +In the future, we anticipate the community will come up with innovative additions to enhance what could be the simplest, most powerful and well-tested interface for productivity. + ## Usage [Download the latest release!](https://hyper.is/#installation) ### Linux #### Arch and derivatives -Hyper is available in the [AUR](https://aur.archlinux.org/packages/hyper/). Use an AUR package manager like [aurman](https://github.com/polygamma/aurman) +Hyper is available in the [AUR](https://aur.archlinux.org/packages/hyper/). Use an AUR [package manager](https://wiki.archlinux.org/index.php/AUR_helpers) e.g. [paru](https://github.com/Morganamilo/paru) ```sh -aurman -S hyper +paru -S hyper +``` + +#### NixOS +Hyper is available as [Nix package](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/hyper/default.nix), to install the app run this command: + +```sh +nix-env -i hyper ``` ### macOS @@ -26,7 +42,7 @@ Use [Homebrew Cask](https://brew.sh) to download the app by running these comman ```bash brew update -brew cask install hyper +brew install --cask hyper ``` ### Windows @@ -83,6 +99,10 @@ make sure its build process is working correctly by running `yarn run rebuild-no If you are on macOS, this typically is related to Xcode issues (like not having agreed to the Terms of Service by running `sudo xcodebuild` after a fresh Xcode installation). +##### Error with `c++` on macOS when running `yarn` + +If you are getting compiler errors when running `yarn` add the environment variable `export CXX=clang++` + ##### Error with `codesign` on macOS when running `yarn run dist` If you have issues in the `codesign` step when running `yarn run dist` on macOS, you can temporarily disable code signing locally by setting @@ -90,8 +110,8 @@ If you have issues in the `codesign` step when running `yarn run dist` on macOS, ## Related Repositories -- [Art](https://github.com/zeit/art/tree/master/hyper) -- [Website](https://github.com/zeit/hyper-site) -- [Sample Extension](https://github.com/zeit/hyperpower) -- [Sample Theme](https://github.com/zeit/hyperyellow) +- [Art](https://github.com/vercel/art/tree/master/hyper) +- [Website](https://github.com/vercel/hyper-site) +- [Sample Extension](https://github.com/vercel/hyperpower) +- [Sample Theme](https://github.com/vercel/hyperyellow) - [Awesome Hyper](https://github.com/bnb/awesome-hyper) diff --git a/app/.yarnrc b/app/.yarnrc new file mode 100644 index 00000000..45291c13 --- /dev/null +++ b/app/.yarnrc @@ -0,0 +1 @@ +registry "https://registry.npmjs.org/" diff --git a/app/auto-updater-linux.js b/app/auto-updater-linux.ts similarity index 69% rename from app/auto-updater-linux.js rename to app/auto-updater-linux.ts index 1257c206..08bff975 100644 --- a/app/auto-updater-linux.js +++ b/app/auto-updater-linux.ts @@ -1,9 +1,8 @@ -'use strict'; +import fetch from 'electron-fetch'; +import {EventEmitter} from 'events'; -const fetch = require('electron-fetch').default; -const {EventEmitter} = require('events'); - -class AutoUpdater extends EventEmitter { +class AutoUpdater extends EventEmitter implements Electron.AutoUpdater { + updateURL!: string; quitAndInstall() { this.emitError('QuitAndInstall unimplemented'); } @@ -11,8 +10,8 @@ class AutoUpdater extends EventEmitter { return this.updateURL; } - setFeedURL(updateURL) { - this.updateURL = updateURL; + setFeedURL(options: Electron.FeedURLOptions) { + this.updateURL = options.url; } checkForUpdates() { @@ -22,9 +21,10 @@ class AutoUpdater extends EventEmitter { this.emit('checking-for-update'); fetch(this.updateURL) - .then(res => { + .then((res) => { if (res.status === 204) { - return this.emit('update-not-available'); + this.emit('update-not-available'); + return; } return res.json().then(({name, notes, pub_date}) => { // Only name is mandatory, needed to construct release URL. @@ -39,12 +39,12 @@ class AutoUpdater extends EventEmitter { .catch(this.emitError.bind(this)); } - emitError(error) { + emitError(error: string | Error) { if (typeof error === 'string') { error = new Error(error); } - this.emit('error', error, error.message); + this.emit('error', error); } } -module.exports = new AutoUpdater(); +export default new AutoUpdater(); diff --git a/app/commands.js b/app/commands.js deleted file mode 100644 index 2cecfe93..00000000 --- a/app/commands.js +++ /dev/null @@ -1,127 +0,0 @@ -const {app, Menu} = require('electron'); -const {openConfig, getConfig} = require('./config'); -const {updatePlugins} = require('./plugins'); -const {installCLI} = require('./utils/cli-install'); - -const commands = { - 'window:new': () => { - // If window is created on the same tick, it will consume event too - setTimeout(app.createWindow, 0); - }, - 'tab:new': focusedWindow => { - if (focusedWindow) { - focusedWindow.rpc.emit('termgroup add req'); - } else { - setTimeout(app.createWindow, 0); - } - }, - 'pane:splitVertical': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('split request vertical'); - }, - 'pane:splitHorizontal': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('split request horizontal'); - }, - 'pane:close': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('termgroup close req'); - }, - 'window:preferences': () => { - openConfig(); - }, - 'editor:clearBuffer': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('session clear req'); - }, - 'editor:selectAll': focusedWindow => { - focusedWindow.rpc.emit('term selectAll'); - }, - 'plugins:update': () => { - updatePlugins(); - }, - 'window:reload': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('reload'); - }, - 'window:reloadFull': focusedWindow => { - focusedWindow && focusedWindow.reload(); - }, - 'window:devtools': focusedWindow => { - if (!focusedWindow) { - return; - } - const webContents = focusedWindow.webContents; - if (webContents.isDevToolsOpened()) { - webContents.closeDevTools(); - } else { - webContents.openDevTools({mode: 'detach'}); - } - }, - 'zoom:reset': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('reset fontSize req'); - }, - 'zoom:in': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('increase fontSize req'); - }, - 'zoom:out': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('decrease fontSize req'); - }, - 'tab:prev': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('move left req'); - }, - 'tab:next': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('move right req'); - }, - 'pane:prev': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('prev pane req'); - }, - 'pane:next': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('next pane req'); - }, - 'editor:movePreviousWord': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('session move word left req'); - }, - 'editor:moveNextWord': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('session move word right req'); - }, - 'editor:moveBeginningLine': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('session move line beginning req'); - }, - 'editor:moveEndLine': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('session move line end req'); - }, - 'editor:deletePreviousWord': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('session del word left req'); - }, - 'editor:deleteNextWord': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('session del word right req'); - }, - 'editor:deleteBeginningLine': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('session del line beginning req'); - }, - 'editor:deleteEndLine': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('session del line end req'); - }, - 'editor:break': focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('session break req'); - }, - 'cli:install': () => { - installCLI(true); - }, - 'window:hamburgerMenu': () => { - if (getConfig().showHamburgerMenu) { - Menu.getApplicationMenu().popup({x: 15, y: 15}); - } - } -}; - -//Special numeric command -[1, 2, 3, 4, 5, 6, 7, 8, 'last'].forEach(cmdIndex => { - const index = cmdIndex === 'last' ? cmdIndex : cmdIndex - 1; - commands[`tab:jump:${cmdIndex}`] = focusedWindow => { - focusedWindow && focusedWindow.rpc.emit('move jump req', index); - }; -}); - -exports.execCommand = (command, focusedWindow) => { - const fn = commands[command]; - if (fn) { - fn(focusedWindow); - } -}; diff --git a/app/commands.ts b/app/commands.ts new file mode 100644 index 00000000..e285b163 --- /dev/null +++ b/app/commands.ts @@ -0,0 +1,152 @@ +import {app, Menu, BrowserWindow} from 'electron'; +import {openConfig, getConfig} from './config'; +import {updatePlugins} from './plugins'; +import {installCLI} from './utils/cli-install'; +import * as systemContextMenu from './utils/system-context-menu'; + +const commands: Record void> = { + 'window:new': () => { + // If window is created on the same tick, it will consume event too + setTimeout(app.createWindow, 0); + }, + 'tab:new': (focusedWindow) => { + if (focusedWindow) { + focusedWindow.rpc.emit('termgroup add req', {}); + } else { + setTimeout(app.createWindow, 0); + } + }, + 'pane:splitRight': (focusedWindow) => { + focusedWindow?.rpc.emit('split request vertical', {}); + }, + 'pane:splitDown': (focusedWindow) => { + focusedWindow?.rpc.emit('split request horizontal', {}); + }, + 'pane:close': (focusedWindow) => { + focusedWindow?.rpc.emit('termgroup close req'); + }, + 'window:preferences': () => { + void openConfig(); + }, + 'editor:clearBuffer': (focusedWindow) => { + focusedWindow?.rpc.emit('session clear req'); + }, + 'editor:selectAll': (focusedWindow) => { + focusedWindow?.rpc.emit('term selectAll'); + }, + 'plugins:update': () => { + updatePlugins(); + }, + 'window:reload': (focusedWindow) => { + focusedWindow?.rpc.emit('reload'); + }, + 'window:reloadFull': (focusedWindow) => { + focusedWindow?.reload(); + }, + 'window:devtools': (focusedWindow) => { + if (!focusedWindow) { + return; + } + const webContents = focusedWindow.webContents; + if (webContents.isDevToolsOpened()) { + webContents.closeDevTools(); + } else { + webContents.openDevTools({mode: 'detach'}); + } + }, + 'zoom:reset': (focusedWindow) => { + focusedWindow?.rpc.emit('reset fontSize req'); + }, + 'zoom:in': (focusedWindow) => { + focusedWindow?.rpc.emit('increase fontSize req'); + }, + 'zoom:out': (focusedWindow) => { + focusedWindow?.rpc.emit('decrease fontSize req'); + }, + 'tab:prev': (focusedWindow) => { + focusedWindow?.rpc.emit('move left req'); + }, + 'tab:next': (focusedWindow) => { + focusedWindow?.rpc.emit('move right req'); + }, + 'pane:prev': (focusedWindow) => { + focusedWindow?.rpc.emit('prev pane req'); + }, + 'pane:next': (focusedWindow) => { + focusedWindow?.rpc.emit('next pane req'); + }, + 'editor:movePreviousWord': (focusedWindow) => { + focusedWindow?.rpc.emit('session move word left req'); + }, + 'editor:moveNextWord': (focusedWindow) => { + focusedWindow?.rpc.emit('session move word right req'); + }, + 'editor:moveBeginningLine': (focusedWindow) => { + focusedWindow?.rpc.emit('session move line beginning req'); + }, + 'editor:moveEndLine': (focusedWindow) => { + focusedWindow?.rpc.emit('session move line end req'); + }, + 'editor:deletePreviousWord': (focusedWindow) => { + focusedWindow?.rpc.emit('session del word left req'); + }, + 'editor:deleteNextWord': (focusedWindow) => { + focusedWindow?.rpc.emit('session del word right req'); + }, + 'editor:deleteBeginningLine': (focusedWindow) => { + focusedWindow?.rpc.emit('session del line beginning req'); + }, + 'editor:deleteEndLine': (focusedWindow) => { + focusedWindow?.rpc.emit('session del line end req'); + }, + 'editor:break': (focusedWindow) => { + focusedWindow?.rpc.emit('session break req'); + }, + 'editor:stop': (focusedWindow) => { + focusedWindow?.rpc.emit('session stop req'); + }, + 'editor:quit': (focusedWindow) => { + focusedWindow?.rpc.emit('session quit req'); + }, + 'editor:tmux': (focusedWindow) => { + focusedWindow?.rpc.emit('session tmux req'); + }, + 'editor:search': (focusedWindow) => { + focusedWindow?.rpc.emit('session search'); + }, + 'editor:search-close': (focusedWindow) => { + focusedWindow?.rpc.emit('session search close'); + }, + 'cli:install': () => { + void installCLI(true); + }, + 'window:hamburgerMenu': () => { + if (process.platform !== 'darwin' && ['', true].includes(getConfig().showHamburgerMenu)) { + Menu.getApplicationMenu()!.popup({x: 25, y: 22}); + } + }, + 'systemContextMenu:add': () => { + systemContextMenu.add(); + }, + 'systemContextMenu:remove': () => { + systemContextMenu.remove(); + }, + 'window:toggleKeepOnTop': (focusedWindow) => { + focusedWindow?.setAlwaysOnTop(!focusedWindow.isAlwaysOnTop()); + } +}; + +//Special numeric command +([1, 2, 3, 4, 5, 6, 7, 8, 'last'] as const).forEach((cmdIndex) => { + const index = cmdIndex === 'last' ? cmdIndex : cmdIndex - 1; + commands[`tab:jump:${cmdIndex}`] = (focusedWindow) => { + focusedWindow?.rpc.emit('move jump req', index); + }; +}); + +export const execCommand = (command: string, focusedWindow?: BrowserWindow) => { + const fn = commands[command]; + if (fn) { + fn(focusedWindow); + } +}; diff --git a/app/config.js b/app/config.js deleted file mode 100644 index 6c2a80a3..00000000 --- a/app/config.js +++ /dev/null @@ -1,154 +0,0 @@ -const fs = require('fs'); -const notify = require('./notify'); -const {_import, getDefaultConfig} = require('./config/import'); -const _openConfig = require('./config/open'); -const win = require('./config/windows'); -const {cfgPath, cfgDir} = require('./config/paths'); -const {getColorMap} = require('./utils/colors'); - -const watchers = []; -let cfg = {}; -let _watcher; - -const _watch = function() { - if (_watcher) { - return _watcher; - } - - const onChange = () => { - // Need to wait 100ms to ensure that write is complete - setTimeout(() => { - cfg = _import(); - notify('Configuration updated', 'Hyper configuration reloaded!'); - watchers.forEach(fn => fn()); - checkDeprecatedConfig(); - }, 100); - }; - - // Windows - if (process.platform === 'win32') { - // watch for changes on config every 2s on Windows - // https://github.com/zeit/hyper/pull/1772 - _watcher = fs.watchFile(cfgPath, {interval: 2000}, (curr, prev) => { - if (curr.mtime === 0) { - //eslint-disable-next-line no-console - console.error('error watching config'); - } else if (curr.mtime !== prev.mtime) { - onChange(); - } - }); - return; - } - // macOS/Linux - setWatcher(); - function setWatcher() { - try { - _watcher = fs.watch(cfgPath, eventType => { - if (eventType === 'rename') { - _watcher.close(); - // Ensure that new file has been written - setTimeout(() => setWatcher(), 500); - } - }); - } catch (e) { - //eslint-disable-next-line no-console - console.error('Failed to watch config file:', cfgPath, e); - return; - } - _watcher.on('change', onChange); - _watcher.on('error', error => { - //eslint-disable-next-line no-console - console.error('error watching config', error); - }); - } -}; - -exports.subscribe = fn => { - watchers.push(fn); - return () => { - watchers.splice(watchers.indexOf(fn), 1); - }; -}; - -exports.getConfigDir = () => { - // expose config directory to load plugin from the right place - return cfgDir; -}; - -exports.getConfig = () => { - return cfg.config; -}; - -exports.openConfig = () => { - return _openConfig(); -}; - -exports.getPlugins = () => { - return { - plugins: cfg.plugins, - localPlugins: cfg.localPlugins - }; -}; - -exports.getKeymaps = () => { - return cfg.keymaps; -}; - -exports.setup = () => { - cfg = _import(); - _watch(); - checkDeprecatedConfig(); -}; - -exports.getWin = win.get; -exports.winRecord = win.recordState; -exports.windowDefaults = win.defaults; - -const getDeprecatedCSS = function(config) { - const deprecated = []; - const deprecatedCSS = ['x-screen', 'x-row', 'cursor-node', '::selection']; - deprecatedCSS.forEach(css => { - if ((config.css && config.css.indexOf(css) !== -1) || (config.termCSS && config.termCSS.indexOf(css) !== -1)) { - deprecated.push(css); - } - }); - return deprecated; -}; -exports.getDeprecatedCSS = getDeprecatedCSS; - -const checkDeprecatedConfig = function() { - if (!cfg.config) { - return; - } - const deprecated = getDeprecatedCSS(cfg.config); - if (deprecated.length === 0) { - return; - } - const deprecatedStr = deprecated.join(', '); - notify('Configuration warning', `Your configuration uses some deprecated CSS classes (${deprecatedStr})`); -}; - -exports.fixConfigDefaults = decoratedConfig => { - const defaultConfig = getDefaultConfig().config; - decoratedConfig.colors = getColorMap(decoratedConfig.colors) || {}; - // We must have default colors for xterm css. - decoratedConfig.colors = Object.assign({}, defaultConfig.colors, decoratedConfig.colors); - return decoratedConfig; -}; - -exports.htermConfigTranslate = config => { - const cssReplacements = { - 'x-screen x-row([ {.[])': '.xterm-rows > div$1', - '.cursor-node([ {.[])': '.terminal-cursor$1', - '::selection([ {.[])': '.terminal .xterm-selection div$1', - 'x-screen a([ {.[])': '.terminal a$1', - 'x-row a([ {.[])': '.terminal a$1' - }; - Object.keys(cssReplacements).forEach(pattern => { - const searchvalue = new RegExp(pattern, 'g'); - const newvalue = cssReplacements[pattern]; - config.css = config.css && config.css.replace(searchvalue, newvalue); - config.termCSS = config.termCSS && config.termCSS.replace(searchvalue, newvalue); - }); - return config; -}; diff --git a/app/config.ts b/app/config.ts new file mode 100644 index 00000000..949e1d0e --- /dev/null +++ b/app/config.ts @@ -0,0 +1,137 @@ +import chokidar from 'chokidar'; +import notify from './notify'; +import {_import, getDefaultConfig} from './config/import'; +import _openConfig from './config/open'; +import {cfgPath, cfgDir} from './config/paths'; +import {getColorMap} from './utils/colors'; +import {parsedConfig, configOptions} from '../lib/config'; +import {app} from 'electron'; + +const watchers: Function[] = []; +let cfg: parsedConfig = {} as any; +let _watcher: chokidar.FSWatcher; + +export const getDeprecatedCSS = (config: configOptions) => { + const deprecated: string[] = []; + const deprecatedCSS = ['x-screen', 'x-row', 'cursor-node', '::selection']; + deprecatedCSS.forEach((css) => { + if (config.css?.includes(css) || config.termCSS?.includes(css)) { + deprecated.push(css); + } + }); + return deprecated; +}; + +const checkDeprecatedConfig = () => { + if (!cfg.config) { + return; + } + const deprecated = getDeprecatedCSS(cfg.config); + if (deprecated.length === 0) { + return; + } + const deprecatedStr = deprecated.join(', '); + notify('Configuration warning', `Your configuration uses some deprecated CSS classes (${deprecatedStr})`); +}; + +const _watch = () => { + if (_watcher) { + return; + } + + const onChange = () => { + // Need to wait 100ms to ensure that write is complete + setTimeout(() => { + cfg = _import(); + notify('Configuration updated', 'Hyper configuration reloaded!'); + watchers.forEach((fn) => { + fn(); + }); + checkDeprecatedConfig(); + }, 100); + }; + + _watcher = chokidar.watch(cfgPath); + _watcher.on('change', onChange); + _watcher.on('error', (error) => { + console.error('error watching config', error); + }); + + app.on('before-quit', (e) => { + if (Object.keys(_watcher.getWatched()).length > 0) { + e.preventDefault(); + _watcher + .close() + .catch((err) => { + console.warn(err); + }) + .finally(() => { + app.quit(); + }); + } + }); +}; + +export const subscribe = (fn: Function) => { + watchers.push(fn); + return () => { + watchers.splice(watchers.indexOf(fn), 1); + }; +}; + +export const getConfigDir = () => { + // expose config directory to load plugin from the right place + return cfgDir; +}; + +export const getConfig = () => { + return cfg.config; +}; + +export const openConfig = () => { + return _openConfig(); +}; + +export const getPlugins = (): {plugins: string[]; localPlugins: string[]} => { + return { + plugins: cfg.plugins, + localPlugins: cfg.localPlugins + }; +}; + +export const getKeymaps = () => { + return cfg.keymaps; +}; + +export const setup = () => { + cfg = _import(); + _watch(); + checkDeprecatedConfig(); +}; + +export {get as getWin, recordState as winRecord, defaults as windowDefaults} from './config/windows'; + +export const fixConfigDefaults = (decoratedConfig: configOptions) => { + const defaultConfig = getDefaultConfig().config!; + decoratedConfig.colors = getColorMap(decoratedConfig.colors) || {}; + // We must have default colors for xterm css. + decoratedConfig.colors = {...defaultConfig.colors, ...decoratedConfig.colors}; + return decoratedConfig; +}; + +export const htermConfigTranslate = (config: configOptions) => { + const cssReplacements: Record = { + 'x-screen x-row([ {.[])': '.xterm-rows > div$1', + '.cursor-node([ {.[])': '.terminal-cursor$1', + '::selection([ {.[])': '.terminal .xterm-selection div$1', + 'x-screen a([ {.[])': '.terminal a$1', + 'x-row a([ {.[])': '.terminal a$1' + }; + Object.keys(cssReplacements).forEach((pattern) => { + const searchvalue = new RegExp(pattern, 'g'); + const newvalue = cssReplacements[pattern]; + config.css = config.css?.replace(searchvalue, newvalue); + config.termCSS = config.termCSS?.replace(searchvalue, newvalue); + }); + return config; +}; diff --git a/app/config/config-default.js b/app/config/config-default.js index 7dd07565..512471f8 100644 --- a/app/config/config-default.js +++ b/app/config/config-default.js @@ -57,6 +57,9 @@ module.exports = { // custom CSS to embed in the terminal window termCSS: '', + // set custom startup directory (must be an absolute path) + workingDirectory: '', + // if you're using a Linux setup which show native menus, set to false // default: `true` on Linux, `true` on Windows, ignored on macOS showHamburgerMenu: '', @@ -89,6 +92,8 @@ module.exports = { lightMagenta: '#FD7CFC', lightCyan: '#68FDFE', lightWhite: '#FFFFFF', + limeGreen: '#32CD32', + lightCoral: '#F08080', }, // the shell to run when spawning a new session (i.e. /usr/local/bin/fish) @@ -98,11 +103,17 @@ module.exports = { // - Make sure to use a full path if the binary name doesn't work // - Remove `--login` in shellArgs // - // Bash on Windows - // - Example: `C:\\Windows\\System32\\bash.exe` + // Windows Subsystem for Linux (WSL) - previously Bash on Windows + // - Example: `C:\\Windows\\System32\\wsl.exe` + // + // Git-bash on Windows + // - Example: `C:\\Program Files\\Git\\bin\\bash.exe` // // PowerShell on Windows // - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe` + // + // Cygwin + // - Example: `C:\\cygwin64\\bin\\bash.exe` shell: '', // for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`) @@ -112,9 +123,14 @@ module.exports = { // for environment variables env: {}, - // set to `false` for no bell + // Supported Options: + // 1. 'SOUND' -> Enables the bell as a sound + // 2. false: turns off the bell bell: 'SOUND', + // An absolute file path to a sound file on the machine. + // bellSoundURL: '/path/to/sound/file', + // if `true` (without backticks and without quotes), selected text will automatically be copied to the clipboard copyOnSelect: false, @@ -130,12 +146,16 @@ module.exports = { // (inside tmux or vim with mouse mode enabled for example). macOptionSelectionMode: 'vertical', - // URL to custom bell - // bellSoundURL: 'http://example.com/bell.mp3', - // Whether to use the WebGL renderer. Set it to false to use canvas-based // rendering (slower, but supports transparent backgrounds) - webGLRenderer: true, + webGLRenderer: false, + + // keypress required for weblink activation: [ctrl|alt|meta|shift] + // todo: does not pick up config changes automatically, need to restart terminal :/ + webLinksActivationKey: '', + + // if `false` (without backticks and without quotes), Hyper will use ligatures provided by some fonts + disableLigatures: true, // for advanced config flags please refer to https://hyper.is/#cfg }, diff --git a/app/config/import.js b/app/config/import.ts similarity index 63% rename from app/config/import.js rename to app/config/import.ts index 678dc3d6..613f57ff 100644 --- a/app/config/import.js +++ b/app/config/import.ts @@ -1,16 +1,17 @@ -const {moveSync, copySync, existsSync, writeFileSync, readFileSync, lstatSync} = require('fs-extra'); -const {sync: mkdirpSync} = require('mkdirp'); -const {defaultCfg, cfgPath, legacyCfgPath, plugs, defaultPlatformKeyPath} = require('./paths'); -const {_init, _extractDefault} = require('./init'); -const notify = require('../notify'); +import {moveSync, copySync, existsSync, writeFileSync, readFileSync, lstatSync} from 'fs-extra'; +import {sync as mkdirpSync} from 'mkdirp'; +import {defaultCfg, cfgPath, legacyCfgPath, plugs, defaultPlatformKeyPath} from './paths'; +import {_init, _extractDefault} from './init'; +import notify from '../notify'; +import {rawConfig} from '../../lib/config'; -let defaultConfig; +let defaultConfig: rawConfig; -const _write = function(path, data) { +const _write = (path: string, data: string) => { // This method will take text formatted as Unix line endings and transform it // to text formatted with DOS line endings. We do this because the default // text editor on Windows (notepad) doesn't Deal with LF files. Still. In 2017. - const crlfify = function(str) { + const crlfify = (str: string) => { return str.replace(/\r?\n/g, '\r\n'); }; const format = process.platform === 'win32' ? crlfify(data.toString()) : data; @@ -19,20 +20,15 @@ const _write = function(path, data) { // Saves a file as backup by appending '.backup' or '.backup2', '.backup3', etc. // so as to not override any existing files -const saveAsBackup = src => { +const saveAsBackup = (src: string) => { let attempt = 1; while (attempt < 100) { - try { - const backupPath = src + '.backup' + (attempt === 1 ? '' : attempt); + const backupPath = `${src}.backup${attempt === 1 ? '' : attempt}`; + if (!existsSync(backupPath)) { moveSync(src, backupPath); return backupPath; - } catch (e) { - if (e.code === 'EEXIST') { - attempt++; - } else { - throw e; - } } + attempt++; } throw new Error('Failed to create backup for config file. Too many backups'); }; @@ -81,7 +77,7 @@ const migrateHyper2Config = () => { ); }; -const _importConf = function() { +const _importConf = () => { // init plugin directories if not present mkdirpSync(plugs.base); mkdirpSync(plugs.local); @@ -89,47 +85,49 @@ const _importConf = function() { try { migrateHyper2Config(); } catch (err) { - //eslint-disable-next-line no-console console.error(err); } + let defaultCfgRaw = ''; try { - const defaultCfgRaw = readFileSync(defaultCfg, 'utf8'); - const _defaultCfg = _extractDefault(defaultCfgRaw); - // Importing platform specific keymap - try { - const content = readFileSync(defaultPlatformKeyPath(), 'utf8'); - const mapping = JSON.parse(content); - _defaultCfg.keymaps = mapping; - } catch (err) { - //eslint-disable-next-line no-console - console.error(err); - } - - // Import user config - try { - const userCfg = readFileSync(cfgPath, 'utf8'); - return {userCfg, defaultCfg: _defaultCfg}; - } catch (err) { - _write(cfgPath, defaultCfgRaw); - return {userCfg: defaultCfgRaw, defaultCfg: _defaultCfg}; - } + defaultCfgRaw = readFileSync(defaultCfg, 'utf8'); } catch (err) { - //eslint-disable-next-line no-console console.log(err); } + const _defaultCfg = _extractDefault(defaultCfgRaw) as rawConfig; + + // Importing platform specific keymap + let content = '{}'; + try { + content = readFileSync(defaultPlatformKeyPath(), 'utf8'); + } catch (err) { + console.error(err); + } + const mapping = JSON.parse(content) as Record; + _defaultCfg.keymaps = mapping; + + // Import user config + let userCfg: string; + try { + userCfg = readFileSync(cfgPath, 'utf8'); + } catch (err) { + _write(cfgPath, defaultCfgRaw); + userCfg = defaultCfgRaw; + } + + return {userCfg, defaultCfg: _defaultCfg}; }; -exports._import = () => { +export const _import = () => { const imported = _importConf(); defaultConfig = imported.defaultCfg; const result = _init(imported); return result; }; -exports.getDefaultConfig = () => { +export const getDefaultConfig = () => { if (!defaultConfig) { - defaultConfig = _extractDefault(_importConf().defaultCfg); + defaultConfig = _importConf().defaultCfg; } return defaultConfig; }; diff --git a/app/config/init.js b/app/config/init.js deleted file mode 100644 index 80373b92..00000000 --- a/app/config/init.js +++ /dev/null @@ -1,48 +0,0 @@ -const vm = require('vm'); -const notify = require('../notify'); -const mapKeys = require('../utils/map-keys'); - -const _extract = function(script) { - const module = {}; - script.runInNewContext({module}); - if (!module.exports) { - throw new Error('Error reading configuration: `module.exports` not set'); - } - return module.exports; -}; - -const _syntaxValidation = function(cfg) { - try { - return new vm.Script(cfg, {filename: '.hyper.js', displayErrors: true}); - } catch (err) { - notify('Error loading config:', `${err.name}, see DevTools for more info`, {error: err}); - } -}; - -const _extractDefault = function(cfg) { - return _extract(_syntaxValidation(cfg)); -}; - -// init config -const _init = function(cfg) { - const script = _syntaxValidation(cfg.userCfg); - if (script) { - const _cfg = _extract(script); - if (!_cfg.config) { - notify('Error reading configuration: `config` key is missing'); - return cfg.defaultCfg; - } - // Merging platform specific keymaps with user defined keymaps - _cfg.keymaps = mapKeys(Object.assign({}, cfg.defaultCfg.keymaps, _cfg.keymaps)); - // Ignore undefined values in plugin and localPlugins array Issue #1862 - _cfg.plugins = (_cfg.plugins && _cfg.plugins.filter(Boolean)) || []; - _cfg.localPlugins = (_cfg.localPlugins && _cfg.localPlugins.filter(Boolean)) || []; - return _cfg; - } - return cfg.defaultCfg; -}; - -module.exports = { - _init, - _extractDefault -}; diff --git a/app/config/init.ts b/app/config/init.ts new file mode 100644 index 00000000..39a62b51 --- /dev/null +++ b/app/config/init.ts @@ -0,0 +1,49 @@ +import vm from 'vm'; +import notify from '../notify'; +import mapKeys from '../utils/map-keys'; +import {parsedConfig, rawConfig, configOptions} from '../../lib/config'; + +const _extract = (script?: vm.Script): Record => { + const module: Record = {}; + script?.runInNewContext({module}); + if (!module.exports) { + throw new Error('Error reading configuration: `module.exports` not set'); + } + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + return module.exports; +}; + +const _syntaxValidation = (cfg: string) => { + try { + return new vm.Script(cfg, {filename: '.hyper.js', displayErrors: true}); + } catch (err) { + notify(`Error loading config: ${err.name}`, `${err}`, {error: err}); + } +}; + +const _extractDefault = (cfg: string) => { + return _extract(_syntaxValidation(cfg)); +}; + +// init config +const _init = (cfg: {userCfg: string; defaultCfg: rawConfig}): parsedConfig => { + const script = _syntaxValidation(cfg.userCfg); + const _cfg = script && (_extract(script) as rawConfig); + return { + config: (() => { + if (_cfg?.config) { + return _cfg.config; + } else { + notify('Error reading configuration: `config` key is missing'); + return cfg.defaultCfg.config || ({} as configOptions); + } + })(), + // Merging platform specific keymaps with user defined keymaps + keymaps: mapKeys({...cfg.defaultCfg.keymaps, ..._cfg?.keymaps}), + // Ignore undefined values in plugin and localPlugins array Issue #1862 + plugins: (_cfg?.plugins && _cfg.plugins.filter(Boolean)) || [], + localPlugins: (_cfg?.localPlugins && _cfg.localPlugins.filter(Boolean)) || [] + }; +}; + +export {_init, _extractDefault}; diff --git a/app/config/open.js b/app/config/open.js deleted file mode 100644 index 1e15a58f..00000000 --- a/app/config/open.js +++ /dev/null @@ -1,77 +0,0 @@ -const {shell} = require('electron'); -const {cfgPath} = require('./paths'); - -module.exports = () => Promise.resolve(shell.openItem(cfgPath)); - -// Windows opens .js files with WScript.exe by default -// If the user hasn't set up an editor for .js files, we fallback to notepad. -if (process.platform === 'win32') { - const Registry = require('winreg'); - const {exec} = require('child_process'); - - const getUserChoiceKey = async () => { - // Load FileExts keys for .js files - const keys = await new Promise((resolve, reject) => { - new Registry({ - hive: Registry.HKCU, - key: '\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.js' - }).keys((error, items) => { - if (error) { - reject(error); - } else { - resolve(items || []); - } - }); - }); - - // Find UserChoice key - const userChoice = keys.find(k => k.key.endsWith('UserChoice')); - return userChoice; - }; - - const hasDefaultSet = async () => { - let userChoice = await getUserChoiceKey(); - if (!userChoice) return false; - - // Load key values - let values = await new Promise((resolve, reject) => { - userChoice.values((error, items) => { - if (error) { - reject(error); - } - resolve(items.map(item => item.value || '') || []); - }); - }); - - // Look for default program - const hasDefaultProgramConfigured = values.every( - value => value && typeof value === 'string' && !value.includes('WScript.exe') && !value.includes('JSFile') - ); - - return hasDefaultProgramConfigured; - }; - - // This mimics shell.openItem, true if it worked, false if not. - const openNotepad = file => - new Promise(resolve => { - exec(`start notepad.exe ${file}`, error => { - resolve(!error); - }); - }); - - module.exports = () => - hasDefaultSet() - .then(yes => { - if (yes) { - return shell.openItem(cfgPath); - } - //eslint-disable-next-line no-console - console.warn('No default app set for .js files, using notepad.exe fallback'); - return openNotepad(cfgPath); - }) - .catch(err => { - //eslint-disable-next-line no-console - console.error('Open config with default app error:', err); - return openNotepad(cfgPath); - }); -} diff --git a/app/config/open.ts b/app/config/open.ts new file mode 100644 index 00000000..1d5047c9 --- /dev/null +++ b/app/config/open.ts @@ -0,0 +1,75 @@ +import {shell} from 'electron'; +import {cfgPath} from './paths'; +import * as Registry from 'native-reg'; +import {exec} from 'child_process'; + +const getUserChoiceKey = () => { + try { + // Load FileExts keys for .js files + const fileExtsKeys = Registry.openKey( + Registry.HKCU, + 'Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.js', + Registry.Access.READ + ); + const keys = fileExtsKeys ? Registry.enumKeyNames(fileExtsKeys) : []; + Registry.closeKey(fileExtsKeys); + + // Find UserChoice key + const userChoice = keys.find((k) => k.endsWith('UserChoice')); + return userChoice + ? `Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.js\\${userChoice}` + : userChoice; + } catch (error) { + console.error(error); + return; + } +}; + +const hasDefaultSet = () => { + const userChoice = getUserChoiceKey(); + if (!userChoice) return false; + + try { + // Load key values + const userChoiceKey = Registry.openKey(Registry.HKCU, userChoice, Registry.Access.READ)!; + const values: string[] = Registry.enumValueNames(userChoiceKey).map( + (x) => (Registry.queryValue(userChoiceKey, x) as string) || '' + ); + Registry.closeKey(userChoiceKey); + + // Look for default program + const hasDefaultProgramConfigured = values.every( + (value) => value && typeof value === 'string' && !value.includes('WScript.exe') && !value.includes('JSFile') + ); + + return hasDefaultProgramConfigured; + } catch (error) { + console.error(error); + return false; + } +}; + +// This mimics shell.openItem, true if it worked, false if not. +const openNotepad = (file: string) => + new Promise((resolve) => { + exec(`start notepad.exe ${file}`, (error) => { + resolve(!error); + }); + }); + +export default () => { + // Windows opens .js files with WScript.exe by default + // If the user hasn't set up an editor for .js files, we fallback to notepad. + if (process.platform === 'win32') { + try { + if (hasDefaultSet()) { + return shell.openPath(cfgPath).then((error) => error === ''); + } + console.warn('No default app set for .js files, using notepad.exe fallback'); + } catch (err) { + console.error('Open config with default app error:', err); + } + return openNotepad(cfgPath); + } + return shell.openPath(cfgPath).then((error) => error === ''); +}; diff --git a/app/config/paths.js b/app/config/paths.ts similarity index 83% rename from app/config/paths.js rename to app/config/paths.ts index d662a150..0b794542 100644 --- a/app/config/paths.js +++ b/app/config/paths.ts @@ -1,9 +1,9 @@ // This module exports paths, names, and other metadata that is referenced -const {homedir} = require('os'); -const {app} = require('electron'); -const {statSync} = require('fs'); -const {resolve, join} = require('path'); -const isDev = require('electron-is-dev'); +import {homedir} from 'os'; +import {app} from 'electron'; +import {statSync} from 'fs'; +import {resolve, join} from 'path'; +import isDev from 'electron-is-dev'; const cfgFile = '.hyper.js'; const defaultCfgFile = 'config-default.js'; @@ -14,11 +14,13 @@ const homeDirectory = homedir(); const applicationDirectory = process.env.XDG_CONFIG_HOME !== undefined ? join(process.env.XDG_CONFIG_HOME, 'hyper') - : process.platform == 'win32' ? app.getPath('userData') : homedir(); + : process.platform == 'win32' + ? app.getPath('userData') + : homedir(); let cfgDir = applicationDirectory; let cfgPath = join(applicationDirectory, cfgFile); -let legacyCfgPath = join(homeDirectory, cfgFile); // Hyper 2 config location +const legacyCfgPath = join(homeDirectory, cfgFile); // Hyper 2 config location const devDir = resolve(__dirname, '../..'); const devCfg = join(devDir, cfgFile); @@ -30,7 +32,6 @@ if (isDev) { statSync(devCfg); cfgPath = devCfg; cfgDir = devDir; - //eslint-disable-next-line no-console console.log('using config file:', cfgPath); } catch (err) { // ignore @@ -69,7 +70,7 @@ const defaultPlatformKeyPath = () => { } }; -module.exports = { +export { cfgDir, cfgPath, legacyCfgPath, diff --git a/app/config/windows.js b/app/config/windows.js deleted file mode 100644 index 901f47b2..00000000 --- a/app/config/windows.js +++ /dev/null @@ -1,22 +0,0 @@ -const Config = require('electron-config'); - -const defaults = { - windowPosition: [50, 50], - windowSize: [540, 380] -}; - -// local storage -const cfg = new Config({defaults}); - -module.exports = { - defaults, - get() { - const position = cfg.get('windowPosition'); - const size = cfg.get('windowSize'); - return {position, size}; - }, - recordState(win) { - cfg.set('windowPosition', win.getPosition()); - cfg.set('windowSize', win.getSize()); - } -}; diff --git a/app/config/windows.ts b/app/config/windows.ts new file mode 100644 index 00000000..c18518a7 --- /dev/null +++ b/app/config/windows.ts @@ -0,0 +1,20 @@ +import Config from 'electron-store'; +import {BrowserWindow} from 'electron'; + +export const defaults = { + windowPosition: [50, 50] as [number, number], + windowSize: [540, 380] as [number, number] +}; + +// local storage +const cfg = new Config({defaults}); + +export function get() { + const position = cfg.get('windowPosition', defaults.windowPosition); + const size = cfg.get('windowSize', defaults.windowSize); + return {position, size}; +} +export function recordState(win: BrowserWindow) { + cfg.set('windowPosition', win.getPosition()); + cfg.set('windowSize', win.getSize()); +} diff --git a/app/ext-modules.d.ts b/app/ext-modules.d.ts new file mode 100644 index 00000000..443d58ee --- /dev/null +++ b/app/ext-modules.d.ts @@ -0,0 +1,8 @@ +declare module 'git-describe' { + export function gitDescribe(...args: any[]): void; +} + +declare module 'default-shell' { + const val: string; + export default val; +} diff --git a/app/extend-electron.d.ts b/app/extend-electron.d.ts new file mode 100644 index 00000000..0a9a2ef9 --- /dev/null +++ b/app/extend-electron.d.ts @@ -0,0 +1,25 @@ +import type {Server} from './rpc'; + +declare module 'electron' { + interface App { + config: typeof import('./config'); + plugins: typeof import('./plugins'); + getWindows: () => Set; + getLastFocusedWindow: () => BrowserWindow | null; + windowCallback?: (win: BrowserWindow) => void; + createWindow: ( + fn?: (win: BrowserWindow) => void, + options?: {size?: [number, number]; position?: [number, number]} + ) => BrowserWindow; + setVersion: (version: string) => void; + } + + // type Server = import('./rpc').Server; + interface BrowserWindow { + uid: string; + sessions: Map; + focusTime: number; + clean: () => void; + rpc: Server; + } +} diff --git a/app/index.d.ts b/app/index.d.ts new file mode 100644 index 00000000..1349d7d9 --- /dev/null +++ b/app/index.d.ts @@ -0,0 +1 @@ +// Dummy file, required by tsc diff --git a/app/index.js b/app/index.ts similarity index 63% rename from app/index.js rename to app/index.ts index c536a5cf..b9adc620 100644 --- a/app/index.js +++ b/app/index.ts @@ -1,72 +1,33 @@ // Print diagnostic information for a few arguments instead of running Hyper. if (['--help', '-v', '--version'].includes(process.argv[1])) { + // eslint-disable-next-line @typescript-eslint/no-var-requires const {version} = require('./package'); - const configLocation = process.platform === 'win32' ? process.env.userprofile + '\\.hyper.js' : '~/.hyper.js'; - //eslint-disable-next-line no-console + const configLocation = process.platform === 'win32' ? `${process.env.userprofile}\\.hyper.js` : '~/.hyper.js'; console.log(`Hyper version ${version}`); - //eslint-disable-next-line no-console console.log('Hyper does not accept any command line arguments. Please modify the config file instead.'); - //eslint-disable-next-line no-console console.log(`Hyper configuration file located at: ${configLocation}`); - // eslint-disable-next-line unicorn/no-process-exit process.exit(); } -const checkSquirrel = () => { - let squirrel; - - try { - squirrel = require('electron-squirrel-startup'); - //eslint-disable-next-line no-empty - } catch (err) {} - if (squirrel) { - // eslint-disable-next-line unicorn/no-process-exit - process.exit(); - } -}; - -// handle startup squirrel events -if (process.platform === 'win32') { - // eslint-disable-next-line import/order - const systemContextMenu = require('./system-context-menu'); - - switch (process.argv[1]) { - case '--squirrel-install': - case '--squirrel-updated': - systemContextMenu.add(() => { - checkSquirrel(); - }); - break; - case '--squirrel-uninstall': - systemContextMenu.remove(() => { - checkSquirrel(); - }); - break; - default: - checkSquirrel(); - } -} - // Native -const {resolve} = require('path'); +import {resolve} from 'path'; // Packages -const {app, BrowserWindow, Menu} = require('electron'); -const {gitDescribe} = require('git-describe'); -const isDev = require('electron-is-dev'); - -const config = require('./config'); +import {app, BrowserWindow, Menu} from 'electron'; +import {gitDescribe} from 'git-describe'; +import isDev from 'electron-is-dev'; +import * as config from './config'; // set up config config.setup(); -const plugins = require('./plugins'); -const {installCLI} = require('./utils/cli-install'); -const AppMenu = require('./menus/menu'); -const Window = require('./ui/window'); -const windowUtils = require('./utils/window-utils'); +import * as plugins from './plugins'; +import {installCLI} from './utils/cli-install'; +import * as AppMenu from './menus/menu'; +import {newWindow} from './ui/window'; +import * as windowUtils from './utils/window-utils'; -const windowSet = new Set([]); +const windowSet = new Set([]); // expose to plugins app.config = config; @@ -84,39 +45,56 @@ app.getLastFocusedWindow = () => { }); }; -//eslint-disable-next-line no-console console.log('Disabling Chromium GPU blacklist'); app.commandLine.appendSwitch('ignore-gpu-blacklist'); if (isDev) { - //eslint-disable-next-line no-console console.log('running in dev mode'); // Override default appVersion which is set from package.json - gitDescribe({customArguments: ['--tags']}, (error, gitInfo) => { + gitDescribe({customArguments: ['--tags']}, (error: any, gitInfo: any) => { if (!error) { app.setVersion(gitInfo.raw); } }); } else { - //eslint-disable-next-line no-console console.log('running in prod mode'); } -const url = 'file://' + resolve(isDev ? __dirname : app.getAppPath(), 'index.html'); -//eslint-disable-next-line no-console +const url = `file://${resolve(isDev ? __dirname : app.getAppPath(), 'index.html')}`; console.log('electron will open', url); +async function installDevExtensions(isDev_: boolean) { + if (!isDev_) { + return []; + } + const installer = await import('electron-devtools-installer'); + + const extensions = ['REACT_DEVELOPER_TOOLS', 'REDUX_DEVTOOLS'] as const; + const forceDownload = Boolean(process.env.UPGRADE_EXTENSIONS); + + return Promise.all( + extensions.map((name) => + installer.default(installer[name], {forceDownload, loadExtensionOptions: {allowFileAccess: true}}) + ) + ); +} + +// eslint-disable-next-line @typescript-eslint/no-misused-promises app.on('ready', () => installDevExtensions(isDev) .then(() => { - function createWindow(fn, options = {}) { + function createWindow( + fn?: (win: BrowserWindow) => void, + options: {size?: [number, number]; position?: [number, number]} = {} + ) { const cfg = plugins.getDecoratedConfig(); const winSet = config.getWin(); let [startX, startY] = winSet.position; const [width, height] = options.size ? options.size : cfg.windowSize || winSet.size; + // eslint-disable-next-line @typescript-eslint/no-var-requires const {screen} = require('electron'); const winPos = options.position; @@ -154,9 +132,9 @@ app.on('ready', () => [startX, startY] = config.windowDefaults.windowPosition; } - const hwin = new Window({width, height, x: startX, y: startY}, cfg, fn); + const hwin = newWindow({width, height, x: startX, y: startY}, cfg, fn); windowSet.add(hwin); - hwin.loadURL(url); + void hwin.loadURL(url); // the window can be closed by the browser process itself hwin.on('close', () => { @@ -164,12 +142,6 @@ app.on('ready', () => windowSet.delete(hwin); }); - hwin.on('closed', () => { - if (process.platform !== 'darwin' && windowSet.size === 0) { - app.quit(); - } - }); - return hwin; } @@ -188,6 +160,12 @@ app.on('ready', () => } }); + app.on('window-all-closed', () => { + if (process.platform !== 'darwin') { + app.quit(); + } + }); + const makeMenu = () => { const menu = plugins.decorateMenu(AppMenu.createMenu(createWindow, plugins.getLoadedPluginVersions)); @@ -214,26 +192,26 @@ app.on('ready', () => if (!isDev) { // check if should be set/removed as default ssh protocol client if (config.getConfig().defaultSSHApp && !app.isDefaultProtocolClient('ssh')) { - //eslint-disable-next-line no-console console.log('Setting Hyper as default client for ssh:// protocol'); app.setAsDefaultProtocolClient('ssh'); } else if (!config.getConfig().defaultSSHApp && app.isDefaultProtocolClient('ssh')) { - //eslint-disable-next-line no-console console.log('Removing Hyper from default client for ssh:// protocol'); app.removeAsDefaultProtocolClient('ssh'); } - installCLI(false); + void installCLI(false); } }) - .catch(err => { - //eslint-disable-next-line no-console + .catch((err) => { console.error('Error while loading devtools extensions', err); }) ); -app.on('open-file', (event, path) => { +/** + * Get last focused BrowserWindow or create new if none and callback + * @param callback Function to call with the BrowserWindow + */ +function GetWindow(callback: (win: BrowserWindow) => void) { const lastWindow = app.getLastFocusedWindow(); - const callback = win => win.rpc.emit('open file', {path}); if (lastWindow) { callback(lastWindow); } else if (!lastWindow && {}.hasOwnProperty.call(app, 'createWindow')) { @@ -243,31 +221,16 @@ app.on('open-file', (event, path) => { // sets his callback to an app.windowCallback property. app.windowCallback = callback; } -}); - -app.on('open-url', (event, sshUrl) => { - const lastWindow = app.getLastFocusedWindow(); - const callback = win => win.rpc.emit('open ssh', sshUrl); - if (lastWindow) { - callback(lastWindow); - } else if (!lastWindow && {}.hasOwnProperty.call(app, 'createWindow')) { - app.createWindow(callback); - } else { - // If createWindow doesn't exist yet ('ready' event was not fired), - // sets his callback to an app.windowCallback property. - app.windowCallback = callback; - } -}); - -function installDevExtensions(isDev_) { - if (!isDev_) { - return Promise.resolve(); - } - // eslint-disable-next-line import/no-extraneous-dependencies - const installer = require('electron-devtools-installer'); - - const extensions = ['REACT_DEVELOPER_TOOLS', 'REDUX_DEVTOOLS']; - const forceDownload = Boolean(process.env.UPGRADE_EXTENSIONS); - - return Promise.all(extensions.map(name => installer.default(installer[name], forceDownload))); } + +app.on('open-file', (_event, path) => { + GetWindow((win: BrowserWindow) => { + win.rpc.emit('open file', {path}); + }); +}); + +app.on('open-url', (_event, sshUrl) => { + GetWindow((win: BrowserWindow) => { + win.rpc.emit('open ssh', sshUrl); + }); +}); diff --git a/app/keymaps/darwin.json b/app/keymaps/darwin.json index ab904116..30f0f276 100644 --- a/app/keymaps/darwin.json +++ b/app/keymaps/darwin.json @@ -30,8 +30,8 @@ "tab:jump:prefix": "command", "pane:next": "command+]", "pane:prev": "command+[", - "pane:splitVertical": "command+d", - "pane:splitHorizontal": "command+shift+d", + "pane:splitRight": "command+d", + "pane:splitDown": "command+shift+d", "pane:close": "command+w", "editor:undo": "command+z", "editor:redo": "command+y", @@ -39,6 +39,8 @@ "editor:copy": "command+c", "editor:paste": "command+v", "editor:selectAll": "command+a", + "editor:search": "command+f", + "editor:search-close": "esc", "editor:movePreviousWord": "alt+left", "editor:moveNextWord": "alt+right", "editor:moveBeginningLine": "command+left", diff --git a/app/keymaps/linux.json b/app/keymaps/linux.json index 9067b4fe..c0771e6d 100644 --- a/app/keymaps/linux.json +++ b/app/keymaps/linux.json @@ -3,6 +3,7 @@ "window:reload": "ctrl+shift+r", "window:reloadFull": "ctrl+shift+f5", "window:preferences": "ctrl+,", + "window:hamburgerMenu": "alt", "zoom:reset": "ctrl+0", "zoom:in": "ctrl+=", "zoom:out": "ctrl+-", @@ -27,8 +28,8 @@ "tab:jump:prefix": "ctrl", "pane:next": "ctrl+pageup", "pane:prev": "ctrl+pagedown", - "pane:splitVertical": "ctrl+shift+d", - "pane:splitHorizontal": "ctrl+shift+e", + "pane:splitRight": "ctrl+shift+d", + "pane:splitDown": "ctrl+shift+e", "pane:close": "ctrl+shift+w", "editor:undo": "ctrl+shift+z", "editor:redo": "ctrl+shift+y", @@ -36,6 +37,8 @@ "editor:copy": "ctrl+shift+c", "editor:paste": "ctrl+shift+v", "editor:selectAll": "ctrl+shift+a", + "editor:search": "ctrl+shift+f", + "editor:search-close": "esc", "editor:movePreviousWord": "ctrl+left", "editor:moveNextWord": "ctrl+right", "editor:moveBeginningLine": "home", diff --git a/app/keymaps/win32.json b/app/keymaps/win32.json index 08f78e4a..0ff8301b 100644 --- a/app/keymaps/win32.json +++ b/app/keymaps/win32.json @@ -16,23 +16,11 @@ "alt+f4" ], "tab:new": "ctrl+shift+t", - "tab:next": [ - "ctrl+shift+]", - "ctrl+shift+right", - "ctrl+alt+right", - "ctrl+tab" - ], - "tab:prev": [ - "ctrl+shift+[", - "ctrl+shift+left", - "ctrl+alt+left", - "ctrl+shift+tab" - ], "tab:jump:prefix": "ctrl", "pane:next": "ctrl+pageup", "pane:prev": "ctrl+pagedown", - "pane:splitVertical": "ctrl+shift+d", - "pane:splitHorizontal": "ctrl+shift+e", + "pane:splitRight": "ctrl+shift+d", + "pane:splitDown": "ctrl+shift+e", "pane:close": "ctrl+shift+w", "editor:undo": "ctrl+shift+z", "editor:redo": "ctrl+shift+y", @@ -40,8 +28,10 @@ "editor:copy": "ctrl+shift+c", "editor:paste": "ctrl+shift+v", "editor:selectAll": "ctrl+shift+a", - "editor:movePreviousWord": "ctrl+left", - "editor:moveNextWord": "ctrl+right", + "editor:search": "ctrl+shift+f", + "editor:search-close": "esc", + "editor:movePreviousWord": "", + "editor:moveNextWord": "", "editor:moveBeginningLine": "Home", "editor:moveEndLine": "End", "editor:deletePreviousWord": "ctrl+backspace", diff --git a/app/menus/menu.js b/app/menus/menu.ts similarity index 51% rename from app/menus/menu.js rename to app/menus/menu.ts index d1ba6065..47c5fc47 100644 --- a/app/menus/menu.js +++ b/app/menus/menu.ts @@ -1,46 +1,49 @@ // Packages -const {app, dialog, Menu} = require('electron'); +import {app, dialog, Menu, BrowserWindow} from 'electron'; // Utilities -const {getConfig} = require('../config'); -const {icon} = require('../config/paths'); -const viewMenu = require('./menus/view'); -const shellMenu = require('./menus/shell'); -const editMenu = require('./menus/edit'); -const pluginsMenu = require('./menus/plugins'); -const windowMenu = require('./menus/window'); -const helpMenu = require('./menus/help'); -const darwinMenu = require('./menus/darwin'); -const {getDecoratedKeymaps} = require('../plugins'); -const {execCommand} = require('../commands'); -const {getRendererTypes} = require('../utils/renderer-utils'); +import {getConfig} from '../config'; +import {icon} from '../config/paths'; +import viewMenu from './menus/view'; +import shellMenu from './menus/shell'; +import editMenu from './menus/edit'; +import toolsMenu from './menus/tools'; +import windowMenu from './menus/window'; +import helpMenu from './menus/help'; +import darwinMenu from './menus/darwin'; +import {getDecoratedKeymaps} from '../plugins'; +import {execCommand} from '../commands'; +import {getRendererTypes} from '../utils/renderer-utils'; -const appName = app.getName(); +const appName = app.name; const appVersion = app.getVersion(); -let menu_ = []; +let menu_: Menu; -exports.createMenu = (createWindow, getLoadedPluginVersions) => { +export const createMenu = ( + createWindow: (fn?: (win: BrowserWindow) => void, options?: Record) => BrowserWindow, + getLoadedPluginVersions: () => {name: string; version: string}[] +) => { const config = getConfig(); // We take only first shortcut in array for each command const allCommandKeys = getDecoratedKeymaps(); - const commandKeys = Object.keys(allCommandKeys).reduce((result, command) => { + const commandKeys = Object.keys(allCommandKeys).reduce((result: Record, command) => { result[command] = allCommandKeys[command][0]; return result; }, {}); let updateChannel = 'stable'; - if (config && config.updateChannel && config.updateChannel === 'canary') { + if (config?.updateChannel && config.updateChannel === 'canary') { updateChannel = 'canary'; } const showAbout = () => { const loadedPlugins = getLoadedPluginVersions(); const pluginList = - loadedPlugins.length === 0 ? 'none' : loadedPlugins.map(plugin => `\n ${plugin.name} (${plugin.version})`); + loadedPlugins.length === 0 ? 'none' : loadedPlugins.map((plugin) => `\n ${plugin.name} (${plugin.version})`); - const rendererCounts = Object.values(getRendererTypes()).reduce((acc, type) => { + const rendererCounts = Object.values(getRendererTypes()).reduce((acc: Record, type) => { acc[type] = acc[type] ? acc[type] + 1 : 1; return acc; }, {}); @@ -48,12 +51,12 @@ exports.createMenu = (createWindow, getLoadedPluginVersions) => { .map(([type, count]) => type + (count > 1 ? ` (${count})` : '')) .join(', '); - dialog.showMessageBox({ + void dialog.showMessageBox({ title: `About ${appName}`, message: `${appName} ${appVersion} (${updateChannel})`, - detail: `Renderers: ${renderers}\nPlugins: ${pluginList}\n\nCreated by Guillermo Rauch\nCopyright Š 2019 ZEIT, Inc.`, + detail: `Renderers: ${renderers}\nPlugins: ${pluginList}\n\nCreated by Guillermo Rauch\nCopyright Š 2020 Vercel, Inc.`, buttons: [], - icon + icon: icon as any }); }; const menu = [ @@ -61,7 +64,7 @@ exports.createMenu = (createWindow, getLoadedPluginVersions) => { shellMenu(commandKeys, execCommand), editMenu(commandKeys, execCommand), viewMenu(commandKeys, execCommand), - pluginsMenu(commandKeys, execCommand), + toolsMenu(commandKeys, execCommand), windowMenu(commandKeys, execCommand), helpMenu(commandKeys, showAbout) ]; @@ -69,7 +72,7 @@ exports.createMenu = (createWindow, getLoadedPluginVersions) => { return menu; }; -exports.buildMenu = template => { +export const buildMenu = (template: Electron.MenuItemConstructorOptions[]): Electron.Menu => { menu_ = Menu.buildFromTemplate(template); return menu_; }; diff --git a/app/menus/menus/darwin.js b/app/menus/menus/darwin.ts similarity index 72% rename from app/menus/menus/darwin.js rename to app/menus/menus/darwin.ts index 5badbd8a..1a1376d6 100644 --- a/app/menus/menus/darwin.js +++ b/app/menus/menus/darwin.ts @@ -1,10 +1,14 @@ // This menu label is overrided by OSX to be the appName // The label is set to appName here so it matches actual behavior -const {app} = require('electron'); +import {app, BrowserWindow, MenuItemConstructorOptions} from 'electron'; -module.exports = (commandKeys, execCommand, showAbout) => { +export default ( + commandKeys: Record, + execCommand: (command: string, focusedWindow?: BrowserWindow) => void, + showAbout: () => void +): MenuItemConstructorOptions => { return { - label: `${app.getName()}`, + label: `${app.name}`, submenu: [ { label: 'About Hyper', @@ -36,7 +40,7 @@ module.exports = (commandKeys, execCommand, showAbout) => { role: 'hide' }, { - role: 'hideothers' + role: 'hideOthers' }, { role: 'unhide' diff --git a/app/menus/menus/edit.js b/app/menus/menus/edit.ts similarity index 88% rename from app/menus/menus/edit.js rename to app/menus/menus/edit.ts index bac65a3d..40387b51 100644 --- a/app/menus/menus/edit.js +++ b/app/menus/menus/edit.ts @@ -1,5 +1,10 @@ -module.exports = (commandKeys, execCommand) => { - const submenu = [ +import {BrowserWindow, MenuItemConstructorOptions} from 'electron'; + +export default ( + commandKeys: Record, + execCommand: (command: string, focusedWindow?: BrowserWindow) => void +) => { + const submenu: MenuItemConstructorOptions[] = [ { label: 'Undo', accelerator: commandKeys['editor:undo'], @@ -23,7 +28,7 @@ module.exports = (commandKeys, execCommand) => { command: 'editor:copy', accelerator: commandKeys['editor:copy'], registerAccelerator: true - }, + } as any, { role: 'paste', accelerator: commandKeys['editor:paste'] @@ -113,6 +118,13 @@ module.exports = (commandKeys, execCommand) => { click(item, focusedWindow) { execCommand('editor:clearBuffer', focusedWindow); } + }, + { + label: 'Search', + accelerator: commandKeys['editor:search'], + click(item, focusedWindow) { + execCommand('editor:search', focusedWindow); + } } ]; diff --git a/app/menus/menus/help.js b/app/menus/menus/help.js deleted file mode 100644 index 6f920c8c..00000000 --- a/app/menus/menus/help.js +++ /dev/null @@ -1,83 +0,0 @@ -const {release} = require('os'); -const {app, shell} = require('electron'); - -const {getConfig, getPlugins} = require('../../config'); -const {arch, env, platform, versions} = process; -const {version} = require('../../package.json'); - -module.exports = (commands, showAbout) => { - const submenu = [ - { - label: `${app.getName()} Website`, - click() { - shell.openExternal('https://hyper.is'); - } - }, - { - label: 'Report Issue', - click() { - const body = ` - - - - [ ] Your Hyper.app version is **${version}**. Please verify your using the [latest](https://github.com/zeit/hyper/releases/latest) Hyper.app version - - [ ] I have searched the [issues](https://github.com/zeit/hyper/issues) of this repo and believe that this is not a duplicate - - --- - - **Any relevant information from devtools?** _(CMD+ALT+I on macOS, CTRL+SHIFT+I elsewhere)_: - - - - **Is the issue reproducible in vanilla Hyper.app?** - - -## Issue - - - - - - - - - - **${app.getName()} version**: ${env.TERM_PROGRAM_VERSION} "${app.getVersion()}" - - - **OS ARCH VERSION:** ${platform} ${arch} ${release()} - - **Electron:** ${versions.electron} **LANG:** ${env.LANG} - - **SHELL:** ${env.SHELL} **TERM:** ${env.TERM} - -
- ~/.hyper.js contents -
-        
-          ${JSON.stringify(getConfig(), null, 2)}
-
-          ${JSON.stringify(getPlugins(), null, 2)}
-        
-      
-
`; - - shell.openExternal(`https://github.com/zeit/hyper/issues/new?body=${encodeURIComponent(body)}`); - } - } - ]; - - if (process.platform !== 'darwin') { - submenu.push( - {type: 'separator'}, - { - role: 'about', - click() { - showAbout(); - } - } - ); - } - return { - role: 'help', - submenu - }; -}; diff --git a/app/menus/menus/help.ts b/app/menus/menus/help.ts new file mode 100644 index 00000000..c0d95644 --- /dev/null +++ b/app/menus/menus/help.ts @@ -0,0 +1,108 @@ +import {release} from 'os'; +import {app, shell, MenuItemConstructorOptions, dialog, clipboard} from 'electron'; +import {getConfig, getPlugins} from '../../config'; +const {arch, env, platform, versions} = process; +import {version} from '../../package.json'; + +export default (commands: Record, showAbout: () => void): MenuItemConstructorOptions => { + const submenu: MenuItemConstructorOptions[] = [ + { + label: `${app.name} Website`, + click() { + void shell.openExternal('https://hyper.is'); + } + }, + { + label: 'Report Issue', + click(menuItem, focusedWindow) { + const body = ` + +- [ ] Your Hyper.app version is **${version}**. Please verify your using the [latest](https://github.com/vercel/hyper/releases/latest) Hyper.app version +- [ ] I have searched the [issues](https://github.com/vercel/hyper/issues) of this repo and believe that this is not a duplicate +--- +- **Any relevant information from devtools?** _(CMD+OPTION+I on macOS, CTRL+SHIFT+I elsewhere)_: + + +- **Is the issue reproducible in vanilla Hyper.app?** + + +## Issue + + + + + + +--- + +- **${app.name} version**: ${env.TERM_PROGRAM_VERSION} "${app.getVersion()}" +- **OS ARCH VERSION:** ${platform} ${arch} ${release()} +- **Electron:** ${versions.electron} **LANG:** ${env.LANG} +- **SHELL:** ${env.SHELL} **TERM:** ${env.TERM} +
.hyper.js contents + +\`\`\`json +${JSON.stringify(getConfig(), null, 2)} +\`\`\` +
+
plugins + +\`\`\`json +${JSON.stringify(getPlugins(), null, 2)} +\`\`\` +
`; + + const issueURL = `https://github.com/vercel/hyper/issues/new?body=${encodeURIComponent(body)}`; + const copyAndSend = () => { + clipboard.writeText(body); + void shell.openExternal( + `https://github.com/vercel/hyper/issues/new?body=${encodeURIComponent( + '\n' + )}` + ); + }; + if (!focusedWindow) { + copyAndSend(); + } else if (issueURL.length > 6144) { + void dialog + .showMessageBox(focusedWindow, { + message: + 'There is too much data to send to GitHub directly. The data will be copied to the clipboard, ' + + 'please paste it into the GitHub issue page that will open.', + type: 'warning', + buttons: ['OK', 'Cancel'] + }) + .then((result) => { + if (result.response === 0) { + copyAndSend(); + } + }); + } else { + void shell.openExternal(issueURL); + } + } + } + ]; + + if (process.platform !== 'darwin') { + submenu.push( + {type: 'separator'}, + { + label: 'About Hyper', + click() { + showAbout(); + } + } + ); + } + return { + role: 'help', + submenu + }; +}; diff --git a/app/menus/menus/plugins.js b/app/menus/menus/plugins.js deleted file mode 100644 index e252b2d2..00000000 --- a/app/menus/menus/plugins.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = (commands, execCommand) => { - return { - label: 'Plugins', - submenu: [ - { - label: 'Update', - accelerator: commands['plugins:update'], - click() { - execCommand('plugins:update'); - } - }, - { - label: 'Install Hyper CLI command in PATH', - click() { - execCommand('cli:install'); - } - }, - { - type: 'separator' - } - ] - }; -}; diff --git a/app/menus/menus/shell.js b/app/menus/menus/shell.ts similarity index 67% rename from app/menus/menus/shell.js rename to app/menus/menus/shell.ts index ba6224aa..ec8bde39 100644 --- a/app/menus/menus/shell.js +++ b/app/menus/menus/shell.ts @@ -1,4 +1,9 @@ -module.exports = (commandKeys, execCommand) => { +import {BrowserWindow, MenuItemConstructorOptions} from 'electron'; + +export default ( + commandKeys: Record, + execCommand: (command: string, focusedWindow?: BrowserWindow) => void +): MenuItemConstructorOptions => { const isMac = process.platform === 'darwin'; return { @@ -22,17 +27,17 @@ module.exports = (commandKeys, execCommand) => { type: 'separator' }, { - label: 'Split Horizontally', - accelerator: commandKeys['pane:splitHorizontal'], + label: 'Split Down', + accelerator: commandKeys['pane:splitDown'], click(item, focusedWindow) { - execCommand('pane:splitHorizontal', focusedWindow); + execCommand('pane:splitDown', focusedWindow); } }, { - label: 'Split Vertically', - accelerator: commandKeys['pane:splitVertical'], + label: 'Split Right', + accelerator: commandKeys['pane:splitRight'], click(item, focusedWindow) { - execCommand('pane:splitVertical', focusedWindow); + execCommand('pane:splitRight', focusedWindow); } }, { diff --git a/app/menus/menus/tools.ts b/app/menus/menus/tools.ts new file mode 100644 index 00000000..843d3d35 --- /dev/null +++ b/app/menus/menus/tools.ts @@ -0,0 +1,47 @@ +import {BrowserWindow, MenuItemConstructorOptions} from 'electron'; + +export default ( + commands: Record, + execCommand: (command: string, focusedWindow?: BrowserWindow) => void +): MenuItemConstructorOptions => { + return { + label: 'Tools', + submenu: [ + { + label: 'Update plugins', + accelerator: commands['plugins:update'], + click() { + execCommand('plugins:update'); + } + }, + { + label: 'Install Hyper CLI command in PATH', + click() { + execCommand('cli:install'); + } + }, + { + type: 'separator' + }, + ...(process.platform === 'win32' + ? [ + { + label: 'Add Hyper to system context menu', + click() { + execCommand('systemContextMenu:add'); + } + }, + { + label: 'Remove Hyper from system context menu', + click() { + execCommand('systemContextMenu:remove'); + } + }, + { + type: 'separator' + } + ] + : []) + ] + }; +}; diff --git a/app/menus/menus/view.js b/app/menus/menus/view.ts similarity index 84% rename from app/menus/menus/view.js rename to app/menus/menus/view.ts index 04d6df61..98f9ef1e 100644 --- a/app/menus/menus/view.js +++ b/app/menus/menus/view.ts @@ -1,4 +1,9 @@ -module.exports = (commandKeys, execCommand) => { +import {BrowserWindow, MenuItemConstructorOptions} from 'electron'; + +export default ( + commandKeys: Record, + execCommand: (command: string, focusedWindow?: BrowserWindow) => void +): MenuItemConstructorOptions => { return { label: 'View', submenu: [ diff --git a/app/menus/menus/window.js b/app/menus/menus/window.ts similarity index 82% rename from app/menus/menus/window.js rename to app/menus/menus/window.ts index eefa97dc..56db6fe5 100644 --- a/app/menus/menus/window.js +++ b/app/menus/menus/window.ts @@ -1,11 +1,16 @@ -module.exports = (commandKeys, execCommand) => { +import {BrowserWindow, MenuItemConstructorOptions} from 'electron'; + +export default ( + commandKeys: Record, + execCommand: (command: string, focusedWindow?: BrowserWindow) => void +): MenuItemConstructorOptions => { // Generating tab:jump array const tabJump = []; for (let i = 1; i <= 9; i++) { // 9 is a special number because it means 'last' const label = i === 9 ? 'Last' : `${i}`; tabJump.push({ - label: label, + label, accelerator: commandKeys[`tab:jump:${label.toLowerCase()}`] }); } @@ -76,6 +81,12 @@ module.exports = (commandKeys, execCommand) => { { role: 'front' }, + { + label: 'Toggle Always on Top', + click: (item, focusedWindow) => { + execCommand('window:toggleKeepOnTop', focusedWindow); + } + }, { role: 'togglefullscreen', accelerator: commandKeys['window:toggleFullScreen'] diff --git a/app/notifications.js b/app/notifications.ts similarity index 66% rename from app/notifications.js rename to app/notifications.ts index c4efb4b6..ad7aaabd 100644 --- a/app/notifications.js +++ b/app/notifications.ts @@ -1,20 +1,18 @@ -const ms = require('ms'); -const fetch = require('electron-fetch').default; - -const {version} = require('./package'); +import ms from 'ms'; +import fetch from 'electron-fetch'; +import {version} from './package.json'; +import {BrowserWindow} from 'electron'; const NEWS_URL = 'https://hyper-news.now.sh'; -module.exports = function fetchNotifications(win) { +export default function fetchNotifications(win: BrowserWindow) { const {rpc} = win; - const retry = err => { + const retry = (err?: Error) => { setTimeout(() => fetchNotifications(win), ms('30m')); if (err) { - //eslint-disable-next-line no-console console.error('Notification messages fetch error', err.stack); } }; - //eslint-disable-next-line no-console console.log('Checking for notification messages'); fetch(NEWS_URL, { headers: { @@ -22,14 +20,13 @@ module.exports = function fetchNotifications(win) { 'X-Hyper-Platform': process.platform } }) - .then(res => res.json()) - .then(data => { + .then((res) => res.json()) + .then((data) => { const {message} = data || {}; if (typeof message !== 'object' && message !== '') { throw new Error('Bad response'); } if (message === '') { - //eslint-disable-next-line no-console console.log('No matching notification messages'); } else { rpc.emit('add notification', message); @@ -38,4 +35,4 @@ module.exports = function fetchNotifications(win) { retry(); }) .catch(retry); -}; +} diff --git a/app/notify.html b/app/notify.html deleted file mode 100644 index 6dd8af4e..00000000 --- a/app/notify.html +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/app/notify.js b/app/notify.js deleted file mode 100644 index 266ceefa..00000000 --- a/app/notify.js +++ /dev/null @@ -1,44 +0,0 @@ -const {resolve} = require('path'); - -const {app, BrowserWindow} = require('electron'); -const isDev = require('electron-is-dev'); - -let win; - -// the hack of all hacks -// electron doesn't have a built in notification thing, -// so we launch a window on which we can use the -// HTML5 `Notification` API :'( - -let buffer = []; - -app.on('ready', () => { - const win_ = new BrowserWindow({ - show: false - }); - const url = 'file://' + resolve(isDev ? __dirname : app.getAppPath(), 'notify.html'); - win_.loadURL(url); - win_.webContents.on('dom-ready', () => { - win = win_; - buffer.forEach(([title, body]) => { - notify(title, body); - }); - buffer = null; - }); -}); - -function notify(title, body, details = {}) { - //eslint-disable-next-line no-console - console.log(`[Notification] ${title}: ${body}`); - if (details.error) { - //eslint-disable-next-line no-console - console.error(details.error); - } - if (win) { - win.webContents.send('notification', {title, body}); - } else { - buffer.push([title, body]); - } -} - -module.exports = notify; diff --git a/app/notify.ts b/app/notify.ts new file mode 100644 index 00000000..a31f0305 --- /dev/null +++ b/app/notify.ts @@ -0,0 +1,20 @@ +import {app, Notification} from 'electron'; +import {icon} from './config/paths'; + +export default function notify(title: string, body = '', details: {error?: any} = {}) { + console.log(`[Notification] ${title}: ${body}`); + if (details.error) { + console.error(details.error); + } + if (app.isReady()) { + _createNotification(title, body); + } else { + app.on('ready', () => { + _createNotification(title, body); + }); + } +} + +const _createNotification = (title: string, body: string) => { + new Notification({title, body, ...(process.platform === 'linux' && {icon})}).show(); +}; diff --git a/app/package.json b/app/package.json index ca69c154..55e63e88 100644 --- a/app/package.json +++ b/app/package.json @@ -10,29 +10,33 @@ }, "repository": "zeit/hyper", "dependencies": { - "async-retry": "1.1.4", - "color": "2.0.1", + "async-retry": "1.3.1", + "chokidar": "^3.5.2", + "color": "3.1.3", "convert-css-color-name-to-hex": "0.1.1", "default-shell": "1.0.1", - "electron-config": "2.0.0", - "electron-fetch": "1.3.0", - "electron-is-dev": "1.0.1", - "electron-squirrel-startup": "1.0.0", - "file-uri-to-path": "1.0.0", - "fs-extra": "7.0.1", - "git-describe": "4.0.2", - "lodash": "4.17.5", - "mkdirp": "0.5.1", - "ms": "2.1.1", - "node-pty": "0.8.0", - "os-locale": "3.1.0", - "parse-url": "3.0.2", - "queue": "4.4.2", - "react": "16.2.0", - "react-dom": "16.2.1", - "semver": "5.5.0", - "shell-env": "0.3.0", - "uuid": "3.2.1", - "winreg": "1.2.4" + "electron-fetch": "1.7.3", + "electron-is-dev": "2.0.0", + "electron-store": "8.0.0", + "file-uri-to-path": "2.0.0", + "fs-extra": "10.0.0", + "git-describe": "4.0.4", + "lodash": "4.17.21", + "mkdirp": "1.0.4", + "ms": "2.1.3", + "node-pty": "0.10.1", + "os-locale": "5.0.0", + "parse-url": "5.0.7", + "pify": "5.0.0", + "queue": "6.0.2", + "react": "17.0.2", + "react-dom": "17.0.2", + "semver": "7.3.5", + "shell-env": "3.0.1", + "sudo-prompt": "^9.2.1", + "uuid": "8.3.2" + }, + "optionalDependencies": { + "native-reg": "0.3.5" } } diff --git a/app/plugins.js b/app/plugins.ts similarity index 70% rename from app/plugins.js rename to app/plugins.ts index 589e623e..012c83c4 100644 --- a/app/plugins.js +++ b/app/plugins.ts @@ -1,18 +1,20 @@ -const {app, dialog} = require('electron'); -const {resolve, basename} = require('path'); -const {writeFileSync} = require('fs'); -const Config = require('electron-config'); -const ms = require('ms'); - -const React = require('react'); -const ReactDom = require('react-dom'); - -const config = require('./config'); -const notify = require('./notify'); -const {availableExtensions} = require('./plugins/extensions'); -const {install} = require('./plugins/install'); -const {plugs} = require('./config/paths'); -const mapKeys = require('./utils/map-keys'); +/* eslint-disable eslint-comments/disable-enable-pair */ +/* eslint-disable @typescript-eslint/no-unsafe-return */ +/* eslint-disable @typescript-eslint/no-unsafe-call */ +import {app, dialog, BrowserWindow, App} from 'electron'; +import {resolve, basename} from 'path'; +import {writeFileSync} from 'fs'; +import Config from 'electron-store'; +import ms from 'ms'; +import React from 'react'; +import ReactDom from 'react-dom'; +import * as config from './config'; +import notify from './notify'; +import {availableExtensions} from './plugins/extensions'; +import {install} from './plugins/install'; +import {plugs} from './config/paths'; +import mapKeys from './utils/map-keys'; +import {configOptions} from '../lib/config'; // local storage const cache = new Config(); @@ -28,11 +30,11 @@ let paths = getPaths(); let id = getId(plugins); let modules = requirePlugins(); -function getId(plugins_) { +function getId(plugins_: any) { return JSON.stringify(plugins_); } -const watchers = []; +const watchers: Function[] = []; // we listen on configuration updates to trigger // plugin installation @@ -50,11 +52,12 @@ config.subscribe(() => { // patching Module._load // so plugins can `require` them without needing their own version -// https://github.com/zeit/hyper/issues/619 +// https://github.com/vercel/hyper/issues/619 function patchModuleLoad() { + // eslint-disable-next-line @typescript-eslint/no-var-requires const Module = require('module'); const originalLoad = Module._load; - Module._load = function _load(modulePath) { + Module._load = function _load(modulePath: string) { // PLEASE NOTE: Code changes here, also need to be changed in // lib/utils/plugins.js switch (modulePath) { @@ -74,13 +77,14 @@ function patchModuleLoad() { case 'hyper/decorate': return Object; default: + // eslint-disable-next-line prefer-rest-params return originalLoad.apply(this, arguments); } }; } function checkDeprecatedExtendKeymaps() { - modules.forEach(plugin => { + modules.forEach((plugin) => { if (plugin.extendKeymaps) { notify('Plugin warning!', `"${plugin._name}" use deprecated "extendKeymaps" handler`); return; @@ -97,11 +101,10 @@ function updatePlugins({force = false} = {}) { updating = true; syncPackageJSON(); const id_ = id; - install(err => { + install((err) => { updating = false; if (err) { - //eslint-disable-next-line no-console notify('Error updating plugins.', err, {error: err}); } else { // flag successful plugin update @@ -123,7 +126,9 @@ function updatePlugins({force = false} = {}) { cache.set('hyper.plugin-versions', pluginVersions); // notify watchers - watchers.forEach(fn => fn(err, {force})); + watchers.forEach((fn) => { + fn(err, {force}); + }); if (force || changed) { if (changed) { @@ -139,10 +144,10 @@ function updatePlugins({force = false} = {}) { function getPluginVersions() { const paths_ = paths.plugins.concat(paths.localPlugins); - return paths_.map(path_ => { - let version = null; + return paths_.map((path_) => { + let version: string | null = null; try { - //eslint-disable-next-line import/no-dynamic-require + // eslint-disable-next-line @typescript-eslint/no-var-requires version = require(resolve(path_, 'package.json')).version; //eslint-disable-next-line no-empty } catch (err) {} @@ -152,7 +157,7 @@ function getPluginVersions() { function clearCache() { // trigger unload hooks - modules.forEach(mod => { + modules.forEach((mod) => { if (mod.onUnload) { mod.onUnload(app); } @@ -166,10 +171,10 @@ function clearCache() { } } -exports.updatePlugins = updatePlugins; +export {updatePlugins}; -exports.getLoadedPluginVersions = () => { - return modules.map(mod => ({name: mod._name, version: mod._version})); +export const getLoadedPluginVersions = () => { + return modules.map((mod) => ({name: mod._name, version: mod._version})); }; // we schedule the initial plugins update @@ -177,15 +182,19 @@ exports.getLoadedPluginVersions = () => { // to prevent slowness if (cache.get('hyper.plugins') !== id || process.env.HYPER_FORCE_UPDATE) { // install immediately if the user changed plugins - //eslint-disable-next-line no-console console.log('plugins have changed / not init, scheduling plugins installation'); setTimeout(() => { updatePlugins(); }, 1000); } -// otherwise update plugins every 5 hours -setInterval(updatePlugins, ms('5h')); +(() => { + const baseConfig = config.getConfig(); + if (baseConfig['autoUpdatePlugins']) { + // otherwise update plugins every 5 hours + setInterval(updatePlugins, ms(baseConfig['autoUpdatePlugins'] === true ? '5h' : baseConfig['autoUpdatePlugins'])); + } +})(); function syncPackageJSON() { const dependencies = toDependencies(plugins); @@ -194,7 +203,7 @@ function syncPackageJSON() { description: 'Auto-generated from `~/.hyper.js`!', private: true, version: '0.0.1', - repository: 'zeit/hyper', + repository: 'vercel/hyper', license: 'MIT', homepage: 'https://hyper.is', dependencies @@ -208,16 +217,16 @@ function syncPackageJSON() { } } -function alert(message) { - dialog.showMessageBox({ +function alert(message: string) { + void dialog.showMessageBox({ message, buttons: ['Ok'] }); } -function toDependencies(plugins_) { - const obj = {}; - plugins_.plugins.forEach(plugin => { +function toDependencies(plugins_: {plugins: string[]}) { + const obj: Record = {}; + plugins_.plugins.forEach((plugin) => { const regex = /.(@|#)/; const match = regex.exec(plugin); @@ -235,7 +244,7 @@ function toDependencies(plugins_) { return obj; } -exports.subscribe = fn => { +export const subscribe = (fn: Function) => { watchers.push(fn); return () => { watchers.splice(watchers.indexOf(fn), 1); @@ -244,53 +253,49 @@ exports.subscribe = fn => { function getPaths() { return { - plugins: plugins.plugins.map(name => { - return resolve(path, 'node_modules', name.split('#')[0].split('@')[0]); + plugins: plugins.plugins.map((name) => { + return resolve(path, 'node_modules', name.split('#')[0]); }), - localPlugins: plugins.localPlugins.map(name => { + localPlugins: plugins.localPlugins.map((name) => { return resolve(localPath, name); }) }; } // expose to renderer -exports.getPaths = getPaths; +export {getPaths}; // get paths from renderer -exports.getBasePaths = () => { +export const getBasePaths = () => { return {path, localPath}; }; -function requirePlugins() { +function requirePlugins(): any[] { const {plugins: plugins_, localPlugins} = paths; - const load = path_ => { - let mod; + const load = (path_: string) => { + let mod: any; try { - // eslint-disable-next-line import/no-dynamic-require mod = require(path_); - const exposed = mod && Object.keys(mod).some(key => availableExtensions.has(key)); + const exposed = mod && Object.keys(mod).some((key) => availableExtensions.has(key)); if (!exposed) { - notify('Plugin error!', `Plugin "${basename(path_)}" does not expose any ` + 'Hyper extension API methods'); + notify('Plugin error!', `${`Plugin "${basename(path_)}" does not expose any `}Hyper extension API methods`); return; } // populate the name for internal errors here mod._name = basename(path_); try { - // eslint-disable-next-line import/no-dynamic-require + // eslint-disable-next-line @typescript-eslint/no-var-requires mod._version = require(resolve(path_, 'package.json')).version; } catch (err) { - //eslint-disable-next-line no-console console.warn(`No package.json found in ${path_}`); } - //eslint-disable-next-line no-console console.log(`Plugin ${mod._name} (${mod._version}) loaded.`); return mod; } catch (err) { if (err.code === 'MODULE_NOT_FOUND') { - //eslint-disable-next-line no-console console.warn(`Plugin error while loading "${basename(path_)}" (${path_}): ${err.message}`); } else { notify('Plugin error!', `Plugin "${basename(path_)}" failed to load (${err.message})`, {error: err}); @@ -301,11 +306,11 @@ function requirePlugins() { return plugins_ .map(load) .concat(localPlugins.map(load)) - .filter(v => Boolean(v)); + .filter((v) => Boolean(v)); } -exports.onApp = app_ => { - modules.forEach(plugin => { +export const onApp = (app_: App) => { + modules.forEach((plugin) => { if (plugin.onApp) { try { plugin.onApp(app_); @@ -318,8 +323,8 @@ exports.onApp = app_ => { }); }; -exports.onWindowClass = win => { - modules.forEach(plugin => { +export const onWindowClass = (win: BrowserWindow) => { + modules.forEach((plugin) => { if (plugin.onWindowClass) { try { plugin.onWindowClass(win); @@ -332,8 +337,8 @@ exports.onWindowClass = win => { }); }; -exports.onWindow = win => { - modules.forEach(plugin => { +export const onWindow = (win: BrowserWindow) => { + modules.forEach((plugin) => { if (plugin.onWindow) { try { plugin.onWindow(win); @@ -348,9 +353,9 @@ exports.onWindow = win => { // decorates the base entity by calling plugin[key] // for all the available plugins -function decorateEntity(base, key, type) { +function decorateEntity(base: any, key: string, type: 'object' | 'function') { let decorated = base; - modules.forEach(plugin => { + modules.forEach((plugin) => { if (plugin[key]) { let res; try { @@ -370,23 +375,23 @@ function decorateEntity(base, key, type) { return decorated; } -function decorateObject(base, key) { +function decorateObject(base: T, key: string): T { return decorateEntity(base, key, 'object'); } -function decorateClass(base, key) { +function decorateClass(base: any, key: string) { return decorateEntity(base, key, 'function'); } -exports.getDeprecatedConfig = () => { - const deprecated = {}; +export const getDeprecatedConfig = () => { + const deprecated: Record = {}; const baseConfig = config.getConfig(); - modules.forEach(plugin => { + modules.forEach((plugin) => { if (!plugin.decorateConfig) { return; } // We need to clone config in case of plugin modifies config directly. - let configTmp; + let configTmp: configOptions; try { configTmp = plugin.decorateConfig(JSON.parse(JSON.stringify(baseConfig))); } catch (e) { @@ -404,15 +409,15 @@ exports.getDeprecatedConfig = () => { return deprecated; }; -exports.decorateMenu = tpl => { +export const decorateMenu = (tpl: any) => { return decorateObject(tpl, 'decorateMenu'); }; -exports.getDecoratedEnv = baseEnv => { +export const getDecoratedEnv = (baseEnv: Record) => { return decorateObject(baseEnv, 'decorateEnv'); }; -exports.getDecoratedConfig = () => { +export const getDecoratedConfig = () => { const baseConfig = config.getConfig(); const decoratedConfig = decorateObject(baseConfig, 'decorateConfig'); const fixedConfig = config.fixConfigDefaults(decoratedConfig); @@ -420,27 +425,27 @@ exports.getDecoratedConfig = () => { return translatedConfig; }; -exports.getDecoratedKeymaps = () => { +export const getDecoratedKeymaps = () => { const baseKeymaps = config.getKeymaps(); // Ensure that all keys are in an array and don't use deprecated key combination` const decoratedKeymaps = mapKeys(decorateObject(baseKeymaps, 'decorateKeymaps')); return decoratedKeymaps; }; -exports.getDecoratedBrowserOptions = defaults => { +export const getDecoratedBrowserOptions = (defaults: T): T => { return decorateObject(defaults, 'decorateBrowserOptions'); }; -exports.decorateWindowClass = defaults => { +export const decorateWindowClass = (defaults: T): T => { return decorateObject(defaults, 'decorateWindowClass'); }; -exports.decorateSessionOptions = defaults => { +export const decorateSessionOptions = (defaults: T): T => { return decorateObject(defaults, 'decorateSessionOptions'); }; -exports.decorateSessionClass = Session => { +export const decorateSessionClass = (Session: T): T => { return decorateClass(Session, 'decorateSessionClass'); }; -exports._toDependencies = toDependencies; +export {toDependencies as _toDependencies}; diff --git a/app/plugins/extensions.js b/app/plugins/extensions.js deleted file mode 100644 index 1c124565..00000000 --- a/app/plugins/extensions.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = { - availableExtensions: new Set([ - 'onApp', - 'onWindowClass', - 'decorateWindowClass', - 'onWindow', - 'onRendererWindow', - 'onUnload', - 'decorateSessionClass', - 'decorateSessionOptions', - 'middleware', - 'reduceUI', - 'reduceSessions', - 'reduceTermGroups', - 'decorateBrowserOptions', - 'decorateMenu', - 'decorateTerm', - 'decorateHyper', - 'decorateHyperTerm', // for backwards compatibility with hyperterm - 'decorateHeader', - 'decorateTerms', - 'decorateTab', - 'decorateNotification', - 'decorateNotifications', - 'decorateTabs', - 'decorateConfig', - 'decorateKeymaps', - 'decorateEnv', - 'decorateTermGroup', - 'decorateSplitPane', - 'getTermProps', - 'getTabProps', - 'getTabsProps', - 'getTermGroupProps', - 'mapHyperTermState', - 'mapTermsState', - 'mapHeaderState', - 'mapNotificationsState', - 'mapHyperTermDispatch', - 'mapTermsDispatch', - 'mapHeaderDispatch', - 'mapNotificationsDispatch' - ]) -}; diff --git a/app/plugins/extensions.ts b/app/plugins/extensions.ts new file mode 100644 index 00000000..5fd3cdfe --- /dev/null +++ b/app/plugins/extensions.ts @@ -0,0 +1,42 @@ +export const availableExtensions = new Set([ + 'onApp', + 'onWindowClass', + 'decorateWindowClass', + 'onWindow', + 'onRendererWindow', + 'onUnload', + 'decorateSessionClass', + 'decorateSessionOptions', + 'middleware', + 'reduceUI', + 'reduceSessions', + 'reduceTermGroups', + 'decorateBrowserOptions', + 'decorateMenu', + 'decorateTerm', + 'decorateHyper', + 'decorateHyperTerm', // for backwards compatibility with hyperterm + 'decorateHeader', + 'decorateTerms', + 'decorateTab', + 'decorateNotification', + 'decorateNotifications', + 'decorateTabs', + 'decorateConfig', + 'decorateKeymaps', + 'decorateEnv', + 'decorateTermGroup', + 'decorateSplitPane', + 'getTermProps', + 'getTabProps', + 'getTabsProps', + 'getTermGroupProps', + 'mapHyperTermState', + 'mapTermsState', + 'mapHeaderState', + 'mapNotificationsState', + 'mapHyperTermDispatch', + 'mapTermsDispatch', + 'mapHeaderDispatch', + 'mapNotificationsDispatch' +]); diff --git a/app/plugins/install.js b/app/plugins/install.js deleted file mode 100644 index 145365b9..00000000 --- a/app/plugins/install.js +++ /dev/null @@ -1,50 +0,0 @@ -const cp = require('child_process'); -const queue = require('queue'); -const ms = require('ms'); -const {yarn, plugs} = require('../config/paths'); - -module.exports = { - install: fn => { - const spawnQueue = queue({concurrency: 1}); - function yarnFn(args, cb) { - const env = { - NODE_ENV: 'production', - ELECTRON_RUN_AS_NODE: 'true' - }; - spawnQueue.push(end => { - const cmd = [process.execPath, yarn].concat(args).join(' '); - //eslint-disable-next-line no-console - console.log('Launching yarn:', cmd); - - cp.execFile( - process.execPath, - [yarn].concat(args), - { - cwd: plugs.base, - env, - timeout: ms('5m'), - maxBuffer: 1024 * 1024 - }, - (err, stdout, stderr) => { - if (err) { - cb(stderr); - } else { - cb(null); - } - end(); - spawnQueue.start(); - } - ); - }); - - spawnQueue.start(); - } - - yarnFn(['install', '--no-emoji', '--no-lockfile', '--cache-folder', plugs.cache], err => { - if (err) { - return fn(err); - } - fn(null); - }); - } -}; diff --git a/app/plugins/install.ts b/app/plugins/install.ts new file mode 100644 index 00000000..61fec231 --- /dev/null +++ b/app/plugins/install.ts @@ -0,0 +1,47 @@ +import cp from 'child_process'; +import queue from 'queue'; +import ms from 'ms'; +import {yarn, plugs} from '../config/paths'; + +export const install = (fn: (err: string | null) => void) => { + const spawnQueue = queue({concurrency: 1}); + function yarnFn(args: string[], cb: (err: string | null) => void) { + const env = { + NODE_ENV: 'production', + ELECTRON_RUN_AS_NODE: 'true' + }; + spawnQueue.push((end) => { + const cmd = [process.execPath, yarn].concat(args).join(' '); + console.log('Launching yarn:', cmd); + + cp.execFile( + process.execPath, + [yarn].concat(args), + { + cwd: plugs.base, + env, + timeout: ms('5m'), + maxBuffer: 1024 * 1024 + }, + (err, stdout, stderr) => { + if (err) { + cb(stderr); + } else { + cb(null); + } + end?.(); + spawnQueue.start(); + } + ); + }); + + spawnQueue.start(); + } + + yarnFn(['install', '--no-emoji', '--no-lockfile', '--cache-folder', plugs.cache], (err) => { + if (err) { + return fn(err); + } + fn(null); + }); +}; diff --git a/app/rpc.js b/app/rpc.ts similarity index 63% rename from app/rpc.js rename to app/rpc.ts index e07b9eaf..dd8661ed 100644 --- a/app/rpc.js +++ b/app/rpc.ts @@ -1,9 +1,12 @@ -const {EventEmitter} = require('events'); -const {ipcMain} = require('electron'); -const uuid = require('uuid'); +import {EventEmitter} from 'events'; +import {ipcMain, BrowserWindow} from 'electron'; +import {v4 as uuidv4} from 'uuid'; -class Server extends EventEmitter { - constructor(win) { +export class Server extends EventEmitter { + destroyed = false; + win: BrowserWindow; + id!: string; + constructor(win: BrowserWindow) { super(); this.win = win; this.ipcListener = this.ipcListener.bind(this); @@ -12,9 +15,10 @@ class Server extends EventEmitter { return; } - const uid = uuid.v4(); + const uid = uuidv4(); this.id = uid; + // eslint-disable-next-line @typescript-eslint/unbound-method ipcMain.on(uid, this.ipcListener); // we intentionally subscribe to `on` instead of `once` @@ -29,11 +33,11 @@ class Server extends EventEmitter { return this.win.webContents; } - ipcListener(event, {ev, data}) { + ipcListener(event: any, {ev, data}: {ev: string; data: any}) { super.emit(ev, data); } - emit(ch, data) { + emit(ch: string, data: any = {}): any { // This check is needed because data-batching can cause extra data to be // emitted after the window has already closed if (!this.win.isDestroyed()) { @@ -45,6 +49,7 @@ class Server extends EventEmitter { this.removeAllListeners(); this.wc.removeAllListeners(); if (this.id) { + // eslint-disable-next-line @typescript-eslint/unbound-method ipcMain.removeListener(this.id, this.ipcListener); } else { // mark for `genUid` in constructor @@ -53,6 +58,6 @@ class Server extends EventEmitter { } } -module.exports = win => { +export default (win: BrowserWindow) => { return new Server(win); }; diff --git a/app/session.js b/app/session.ts similarity index 50% rename from app/session.js rename to app/session.ts index 1f84fd42..dcbcba2c 100644 --- a/app/session.js +++ b/app/session.ts @@ -1,25 +1,28 @@ -const {EventEmitter} = require('events'); -const {StringDecoder} = require('string_decoder'); - -const defaultShell = require('default-shell'); - -const {getDecoratedEnv} = require('./plugins'); -const {productName, version} = require('./package'); -const config = require('./config'); +import {EventEmitter} from 'events'; +import {StringDecoder} from 'string_decoder'; +import defaultShell from 'default-shell'; +import {getDecoratedEnv} from './plugins'; +import {productName, version} from './package.json'; +import * as config from './config'; +import {IPty, IWindowsPtyForkOptions, spawn as npSpawn} from 'node-pty'; +import {cliScriptPath} from './config/paths'; +import {dirname} from 'path'; const createNodePtyError = () => new Error( '`node-pty` failed to load. Typically this means that it was built incorrectly. Please check the `readme.md` to more info.' ); -let spawn; +let spawn: typeof npSpawn; try { + // eslint-disable-next-line @typescript-eslint/no-var-requires spawn = require('node-pty').spawn; } catch (err) { throw createNodePtyError(); } const envFromConfig = config.getConfig().env || {}; +const useConpty = config.getConfig().useConpty; // Max duration to batch session data before sending it to the renderer process. const BATCH_DURATION_MS = 16; @@ -34,7 +37,11 @@ const BATCH_MAX_SIZE = 200 * 1024; // with the window ID which is then stripped on the renderer process and this // overhead is reduced with batching. class DataBatcher extends EventEmitter { - constructor(uid) { + uid: string; + decoder: StringDecoder; + data!: string; + timeout!: NodeJS.Timeout | null; + constructor(uid: string) { super(); this.uid = uid; this.decoder = new StringDecoder('utf8'); @@ -47,7 +54,7 @@ class DataBatcher extends EventEmitter { this.timeout = null; } - write(chunk) { + write(chunk: Buffer) { if (this.data.length + chunk.length >= BATCH_MAX_SIZE) { // We've reached the max batch size. Flush it and start another one if (this.timeout) { @@ -73,23 +80,38 @@ class DataBatcher extends EventEmitter { } } -module.exports = class Session extends EventEmitter { - constructor(options) { +interface SessionOptions { + uid: string; + rows: number; + cols: number; + cwd: string; + shell: string; + shellArgs: string[]; +} +export default class Session extends EventEmitter { + pty: IPty | null; + batcher: DataBatcher | null; + shell: string | null; + ended: boolean; + initTimestamp: number; + constructor(options: SessionOptions) { super(); this.pty = null; this.batcher = null; this.shell = null; this.ended = false; + this.initTimestamp = new Date().getTime(); this.init(options); } - init({uid, rows, cols: columns, cwd, shell, shellArgs}) { - const osLocale = require('os-locale'); + init({uid, rows, cols: columns, cwd, shell: _shell, shellArgs: _shellArgs}: SessionOptions) { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const osLocale = require('os-locale') as typeof import('os-locale'); const baseEnv = Object.assign( {}, process.env, { - LANG: osLocale.sync() + '.UTF-8', + LANG: `${osLocale.sync().replace(/-/, '_')}.UTF-8`, TERM: 'xterm-256color', COLORTERM: 'truecolor', TERM_PROGRAM: productName, @@ -98,22 +120,40 @@ module.exports = class Session extends EventEmitter { envFromConfig ); + // path to AppImage mount point is added to PATH environment variable automatically + // which conflicts with the cli + if (baseEnv['APPIMAGE'] && baseEnv['APPDIR']) { + baseEnv['PATH'] = [dirname(cliScriptPath)] + .concat((baseEnv['PATH'] || '').split(':').filter((val) => !val.startsWith(baseEnv['APPDIR']))) + .join(':'); + } + // Electron has a default value for process.env.GOOGLE_API_KEY // We don't want to leak this to the shell - // See https://github.com/zeit/hyper/issues/696 + // See https://github.com/vercel/hyper/issues/696 if (baseEnv.GOOGLE_API_KEY && process.env.GOOGLE_API_KEY === baseEnv.GOOGLE_API_KEY) { delete baseEnv.GOOGLE_API_KEY; } const defaultShellArgs = ['--login']; + const options: IWindowsPtyForkOptions = { + cols: columns, + rows, + cwd, + env: getDecoratedEnv(baseEnv) + }; + + // if config do not set the useConpty, it will be judged by the node-pty + if (typeof useConpty === 'boolean') { + options.useConpty = useConpty; + } + + const shell = _shell || defaultShell; + const shellArgs = _shellArgs || defaultShellArgs; + try { - this.pty = spawn(shell || defaultShell, shellArgs || defaultShellArgs, { - cols: columns, - rows, - cwd, - env: getDecoratedEnv(baseEnv) - }); + this.pty = spawn(shell, shellArgs, options); } catch (err) { if (/is not a function/.test(err.message)) { throw createNodePtyError(); @@ -123,50 +163,62 @@ module.exports = class Session extends EventEmitter { } this.batcher = new DataBatcher(uid); - this.pty.on('data', chunk => { + this.pty.onData((chunk) => { if (this.ended) { return; } - this.batcher.write(chunk); + this.batcher?.write(chunk as any); }); - this.batcher.on('flush', data => { + this.batcher.on('flush', (data: string) => { this.emit('data', data); }); - this.pty.on('exit', () => { + this.pty.onExit((e) => { if (!this.ended) { - this.ended = true; - this.emit('exit'); + // fall back to default shell config if the shell exits within 1 sec with non zero exit code + // this will inform users in case there are errors in the config instead of instant exit + const runDuration = new Date().getTime() - this.initTimestamp; + if (e.exitCode > 0 && runDuration < 1000) { + const defaultShellConfig = {shell: defaultShell, shellArgs: defaultShellArgs}; + const msg = ` +shell exited in ${runDuration} ms with exit code ${e.exitCode} +please check the shell config: ${JSON.stringify({shell, shellArgs}, undefined, 2)} +fallback to default shell config: ${JSON.stringify(defaultShellConfig, undefined, 2)} +`; + console.warn(msg); + this.batcher?.write(msg.replace(/\n/g, '\r\n') as any); + this.init({uid, rows, cols: columns, cwd, ...defaultShellConfig}); + } else { + this.ended = true; + this.emit('exit'); + } } }); - this.shell = shell || defaultShell; + this.shell = shell; } exit() { this.destroy(); } - write(data) { + write(data: string) { if (this.pty) { this.pty.write(data); } else { - //eslint-disable-next-line no-console console.warn('Warning: Attempted to write to a session with no pty'); } } - resize({cols, rows}) { + resize({cols, rows}: {cols: number; rows: number}) { if (this.pty) { try { this.pty.resize(cols, rows); } catch (err) { - //eslint-disable-next-line no-console console.error(err.stack); } } else { - //eslint-disable-next-line no-console console.warn('Warning: Attempted to resize a session with no pty'); } } @@ -176,14 +228,12 @@ module.exports = class Session extends EventEmitter { try { this.pty.kill(); } catch (err) { - //eslint-disable-next-line no-console console.error('exit error', err.stack); } } else { - //eslint-disable-next-line no-console console.warn('Warning: Attempted to destroy a session with no pty'); } this.emit('exit'); this.ended = true; } -}; +} diff --git a/app/system-context-menu.js b/app/system-context-menu.js deleted file mode 100644 index 4d2eb08e..00000000 --- a/app/system-context-menu.js +++ /dev/null @@ -1,89 +0,0 @@ -const Registry = require('winreg'); - -const appPath = `"${process.execPath}"`; -const regKey = `\\Software\\Classes\\Directory\\background\\shell\\Hyper`; -const regParts = [ - {key: 'command', name: '', value: `${appPath} "%V"`}, - {name: '', value: 'Open Hyper here'}, - {name: 'Icon', value: `${appPath}`} -]; - -function addValues(hyperKey, commandKey, callback) { - hyperKey.set(regParts[1].name, Registry.REG_SZ, regParts[1].value, error => { - if (error) { - //eslint-disable-next-line no-console - console.error(error.message); - } - hyperKey.set(regParts[2].name, Registry.REG_SZ, regParts[2].value, err => { - if (err) { - //eslint-disable-next-line no-console - console.error(err.message); - } - commandKey.set(regParts[0].name, Registry.REG_SZ, regParts[0].value, err_ => { - if (err_) { - //eslint-disable-next-line no-console - console.error(err_.message); - } - callback(); - }); - }); - }); -} - -exports.add = callback => { - const hyperKey = new Registry({hive: 'HKCU', key: regKey}); - const commandKey = new Registry({ - hive: 'HKCU', - key: `${regKey}\\${regParts[0].key}` - }); - - hyperKey.keyExists((error, exists) => { - if (error) { - //eslint-disable-next-line no-console - console.error(error.message); - } - if (exists) { - commandKey.keyExists((err_, exists_) => { - if (err_) { - //eslint-disable-next-line no-console - console.error(err_.message); - } - if (exists_) { - addValues(hyperKey, commandKey, callback); - } else { - commandKey.create(err => { - if (err) { - //eslint-disable-next-line no-console - console.error(err.message); - } - addValues(hyperKey, commandKey, callback); - }); - } - }); - } else { - hyperKey.create(err => { - if (err) { - //eslint-disable-next-line no-console - console.error(err.message); - } - commandKey.create(err_ => { - if (err_) { - //eslint-disable-next-line no-console - console.error(err_.message); - } - addValues(hyperKey, commandKey, callback); - }); - }); - } - }); -}; - -exports.remove = callback => { - new Registry({hive: 'HKCU', key: regKey}).destroy(err => { - if (err) { - //eslint-disable-next-line no-console - console.error(err.message); - } - callback(); - }); -}; diff --git a/app/tsconfig.json b/app/tsconfig.json new file mode 100644 index 00000000..467bd920 --- /dev/null +++ b/app/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../tsconfig.base.json", + "compilerOptions": { + "declarationDir": "../dist/tmp/appdts/", + "outDir": "../target/" + }, + "include": [ + "./**/*", + "./package.json" + ] +} diff --git a/app/ui/contextmenu.js b/app/ui/contextmenu.js deleted file mode 100644 index a854ba39..00000000 --- a/app/ui/contextmenu.js +++ /dev/null @@ -1,27 +0,0 @@ -const editMenu = require('../menus/menus/edit'); -const shellMenu = require('../menus/menus/shell'); -const {execCommand} = require('../commands'); -const {getDecoratedKeymaps} = require('../plugins'); -const separator = {type: 'separator'}; - -const getCommandKeys = keymaps => - Object.keys(keymaps).reduce((commandKeys, command) => { - return Object.assign(commandKeys, { - [command]: keymaps[command][0] - }); - }, {}); - -// only display cut/copy when there's a cursor selection -const filterCutCopy = (selection, menuItem) => { - if (/^cut$|^copy$/.test(menuItem.role) && !selection) { - return; - } - return menuItem; -}; - -module.exports = (createWindow, selection) => { - const commandKeys = getCommandKeys(getDecoratedKeymaps()); - const _shell = shellMenu(commandKeys, execCommand).submenu; - const _edit = editMenu(commandKeys, execCommand).submenu.filter(filterCutCopy.bind(null, selection)); - return _edit.concat(separator, _shell).filter(menuItem => !menuItem.hasOwnProperty('enabled') || menuItem.enabled); -}; diff --git a/app/ui/contextmenu.ts b/app/ui/contextmenu.ts new file mode 100644 index 00000000..f6819811 --- /dev/null +++ b/app/ui/contextmenu.ts @@ -0,0 +1,33 @@ +import editMenu from '../menus/menus/edit'; +import shellMenu from '../menus/menus/shell'; +import {execCommand} from '../commands'; +import {getDecoratedKeymaps} from '../plugins'; +import {MenuItemConstructorOptions, BrowserWindow} from 'electron'; +const separator: MenuItemConstructorOptions = {type: 'separator'}; + +const getCommandKeys = (keymaps: Record): Record => + Object.keys(keymaps).reduce((commandKeys: Record, command) => { + return Object.assign(commandKeys, { + [command]: keymaps[command][0] + }); + }, {}); + +// only display cut/copy when there's a cursor selection +const filterCutCopy = (selection: string, menuItem: MenuItemConstructorOptions) => { + if (/^cut$|^copy$/.test(menuItem.role!) && !selection) { + return; + } + return menuItem; +}; + +export default ( + createWindow: (fn?: (win: BrowserWindow) => void, options?: Record) => BrowserWindow, + selection: string +) => { + const commandKeys = getCommandKeys(getDecoratedKeymaps()); + const _shell = shellMenu(commandKeys, execCommand).submenu as MenuItemConstructorOptions[]; + const _edit = editMenu(commandKeys, execCommand).submenu.filter(filterCutCopy.bind(null, selection)); + return _edit + .concat(separator, _shell) + .filter((menuItem) => !Object.prototype.hasOwnProperty.call(menuItem, 'enabled') || menuItem.enabled); +}; diff --git a/app/ui/window.js b/app/ui/window.js deleted file mode 100644 index 543590fb..00000000 --- a/app/ui/window.js +++ /dev/null @@ -1,325 +0,0 @@ -const {app, BrowserWindow, shell, Menu} = require('electron'); -const {isAbsolute} = require('path'); -const {parse: parseUrl} = require('url'); -const uuid = require('uuid'); -const fileUriToPath = require('file-uri-to-path'); -const isDev = require('electron-is-dev'); -const updater = require('../updater'); -const toElectronBackgroundColor = require('../utils/to-electron-background-color'); -const {icon, homeDirectory} = require('../config/paths'); -const createRPC = require('../rpc'); -const notify = require('../notify'); -const fetchNotifications = require('../notifications'); -const Session = require('../session'); -const contextMenuTemplate = require('./contextmenu'); -const {execCommand} = require('../commands'); -const {setRendererType, unsetRendererType} = require('../utils/renderer-utils'); -const {decorateSessionOptions, decorateSessionClass} = require('../plugins'); - -module.exports = class Window { - constructor(options_, cfg, fn) { - const classOpts = Object.assign({uid: uuid.v4()}); - app.plugins.decorateWindowClass(classOpts); - this.uid = classOpts.uid; - - app.plugins.onWindowClass(this); - - const winOpts = Object.assign( - { - minWidth: 370, - minHeight: 190, - backgroundColor: toElectronBackgroundColor(cfg.backgroundColor || '#000'), - titleBarStyle: 'hiddenInset', - title: 'Hyper.app', - // we want to go frameless on Windows and Linux - frame: process.platform === 'darwin', - transparent: process.platform === 'darwin', - icon, - show: process.env.HYPER_DEBUG || process.env.HYPERTERM_DEBUG || isDev, - acceptFirstMouse: true - }, - options_ - ); - - const window = new BrowserWindow(app.plugins.getDecoratedBrowserOptions(winOpts)); - window.uid = classOpts.uid; - - const rpc = createRPC(window); - const sessions = new Map(); - - const updateBackgroundColor = () => { - const cfg_ = app.plugins.getDecoratedConfig(); - window.setBackgroundColor(toElectronBackgroundColor(cfg_.backgroundColor || '#000')); - }; - - // config changes - const cfgUnsubscribe = app.config.subscribe(() => { - const cfg_ = app.plugins.getDecoratedConfig(); - - // notify renderer - window.webContents.send('config change'); - - // notify user that shell changes require new sessions - if (cfg_.shell !== cfg.shell || JSON.stringify(cfg_.shellArgs) !== JSON.stringify(cfg.shellArgs)) { - notify('Shell configuration changed!', 'Open a new tab or window to start using the new shell'); - } - - // update background color if necessary - updateBackgroundColor(); - - cfg = cfg_; - }); - - rpc.on('init', () => { - window.show(); - updateBackgroundColor(); - - // If no callback is passed to createWindow, - // a new session will be created by default. - if (!fn) { - fn = win => win.rpc.emit('termgroup add req'); - } - - // app.windowCallback is the createWindow callback - // that can be set before the 'ready' app event - // and createWindow definition. It's executed in place of - // the callback passed as parameter, and deleted right after. - (app.windowCallback || fn)(window); - delete app.windowCallback; - fetchNotifications(window); - // auto updates - if (!isDev) { - updater(window); - } else { - //eslint-disable-next-line no-console - console.log('ignoring auto updates during dev'); - } - }); - - function createSession(extraOptions = {}) { - const uid = uuid.v4(); - - const defaultOptions = Object.assign( - { - rows: 40, - cols: 100, - cwd: process.argv[1] && isAbsolute(process.argv[1]) ? process.argv[1] : homeDirectory, - splitDirection: undefined, - shell: cfg.shell, - shellArgs: cfg.shellArgs && Array.from(cfg.shellArgs) - }, - extraOptions, - {uid} - ); - const options = decorateSessionOptions(defaultOptions); - const DecoratedSession = decorateSessionClass(Session); - const session = new DecoratedSession(options); - sessions.set(uid, session); - return {session, options}; - } - - // Optimistically create the initial session so that when the window sends - // the first "new" IPC message, there's a session already warmed up. - function createInitialSession() { - let {session, options} = createSession(); - const initialEvents = []; - const handleData = data => initialEvents.push(['session data', data]); - const handleExit = () => initialEvents.push(['session exit']); - session.on('data', handleData); - session.on('exit', handleExit); - - function flushEvents() { - for (let args of initialEvents) { - rpc.emit(...args); - } - session.removeListener('data', handleData); - session.removeListener('exit', handleExit); - } - return {session, options, flushEvents}; - } - let initialSession = createInitialSession(); - - rpc.on('new', extraOptions => { - const {session, options} = initialSession || createSession(extraOptions); - - sessions.set(options.uid, session); - rpc.emit('session add', { - rows: options.rows, - cols: options.cols, - uid: options.uid, - splitDirection: options.splitDirection, - shell: session.shell, - pid: session.pty.pid - }); - - // If this is the initial session, flush any events that might have - // occurred while the window was initializing - if (initialSession) { - initialSession.flushEvents(); - initialSession = null; - } - - session.on('data', data => { - rpc.emit('session data', data); - }); - - session.on('exit', () => { - rpc.emit('session exit', {uid: options.uid}); - unsetRendererType(options.uid); - sessions.delete(options.uid); - }); - }); - - rpc.on('exit', ({uid}) => { - const session = sessions.get(uid); - if (session) { - session.exit(); - } - }); - rpc.on('unmaximize', () => { - window.unmaximize(); - }); - rpc.on('maximize', () => { - window.maximize(); - }); - rpc.on('minimize', () => { - window.minimize(); - }); - rpc.on('resize', ({uid, cols, rows}) => { - const session = sessions.get(uid); - if (session) { - session.resize({cols, rows}); - } - }); - rpc.on('data', ({uid, data, escaped}) => { - const session = sessions.get(uid); - if (session) { - if (escaped) { - const escapedData = session.shell.endsWith('cmd.exe') - ? `"${data}"` // This is how cmd.exe does it - : `'${data.replace(/'/g, `'\\''`)}'`; // Inside a single-quoted string nothing is interpreted - - session.write(escapedData); - } else { - session.write(data); - } - } - }); - rpc.on('info renderer', ({uid, type}) => { - // Used in the "About" dialog - setRendererType(uid, type); - }); - rpc.on('open external', ({url}) => { - shell.openExternal(url); - }); - rpc.on('open context menu', selection => { - const {createWindow} = app; - const {buildFromTemplate} = Menu; - buildFromTemplate(contextMenuTemplate(createWindow, selection)).popup(window); - }); - rpc.on('open hamburger menu', ({x, y}) => { - Menu.getApplicationMenu().popup({x: Math.ceil(x), y: Math.ceil(y)}); - }); - // Same deal as above, grabbing the window titlebar when the window - // is maximized on Windows results in unmaximize, without hitting any - // app buttons - for (const ev of ['maximize', 'unmaximize', 'minimize', 'restore']) { - window.on(ev, () => rpc.emit('windowGeometry change')); - } - window.on('move', () => { - const position = window.getPosition(); - rpc.emit('move', {bounds: {x: position[0], y: position[1]}}); - }); - rpc.on('close', () => { - window.close(); - }); - rpc.on('command', command => { - const focusedWindow = BrowserWindow.getFocusedWindow(); - execCommand(command, focusedWindow); - }); - const deleteSessions = () => { - sessions.forEach((session, key) => { - session.removeAllListeners(); - session.destroy(); - sessions.delete(key); - }); - }; - // we reset the rpc channel only upon - // subsequent refreshes (ie: F5) - let i = 0; - window.webContents.on('did-navigate', () => { - if (i++) { - deleteSessions(); - } - }); - - // If file is dropped onto the terminal window, navigate event is prevented - // and his path is added to active session. - window.webContents.on('will-navigate', (event, url) => { - const protocol = typeof url === 'string' && parseUrl(url).protocol; - if (protocol === 'file:') { - event.preventDefault(); - - const path = fileUriToPath(url); - - rpc.emit('session data send', {data: path, escaped: true}); - } else if (protocol === 'http:' || protocol === 'https:') { - event.preventDefault(); - rpc.emit('session data send', {data: url}); - } - }); - - // xterm makes link clickable - window.webContents.on('new-window', (event, url) => { - const protocol = typeof url === 'string' && parseUrl(url).protocol; - if (protocol === 'http:' || protocol === 'https:') { - event.preventDefault(); - shell.openExternal(url); - } - }); - - // expose internals to extension authors - window.rpc = rpc; - window.sessions = sessions; - - const load = () => { - app.plugins.onWindow(window); - }; - - // load plugins - load(); - - const pluginsUnsubscribe = app.plugins.subscribe(err => { - if (!err) { - load(); - window.webContents.send('plugins change'); - updateBackgroundColor(); - } - }); - - // Keep track of focus time of every window, to figure out - // which one of the existing window is the last focused. - // Works nicely even if a window is closed and removed. - const updateFocusTime = () => { - window.focusTime = process.uptime(); - }; - - window.on('focus', () => { - updateFocusTime(); - }); - - // the window can be closed by the browser process itself - window.clean = () => { - app.config.winRecord(window); - rpc.destroy(); - deleteSessions(); - cfgUnsubscribe(); - pluginsUnsubscribe(); - }; - // Ensure focusTime is set on window open. The focus event doesn't - // fire from the dock (see bug #583) - updateFocusTime(); - - return window; - } -}; diff --git a/app/ui/window.ts b/app/ui/window.ts new file mode 100644 index 00000000..2f001460 --- /dev/null +++ b/app/ui/window.ts @@ -0,0 +1,330 @@ +import {app, BrowserWindow, shell, Menu, BrowserWindowConstructorOptions} from 'electron'; +import {isAbsolute, normalize, sep} from 'path'; +import {parse as parseUrl} from 'url'; +import {v4 as uuidv4} from 'uuid'; +import fileUriToPath from 'file-uri-to-path'; +import isDev from 'electron-is-dev'; +import updater from '../updater'; +import toElectronBackgroundColor from '../utils/to-electron-background-color'; +import {icon, homeDirectory} from '../config/paths'; +import createRPC from '../rpc'; +import notify from '../notify'; +import fetchNotifications from '../notifications'; +import Session from '../session'; +import contextMenuTemplate from './contextmenu'; +import {execCommand} from '../commands'; +import {setRendererType, unsetRendererType} from '../utils/renderer-utils'; +import {decorateSessionOptions, decorateSessionClass} from '../plugins'; + +export function newWindow( + options_: BrowserWindowConstructorOptions, + cfg: any, + fn?: (win: BrowserWindow) => void +): BrowserWindow { + const classOpts = Object.assign({uid: uuidv4()}); + app.plugins.decorateWindowClass(classOpts); + + const winOpts: BrowserWindowConstructorOptions = { + minWidth: 370, + minHeight: 190, + backgroundColor: toElectronBackgroundColor(cfg.backgroundColor || '#000'), + titleBarStyle: 'hiddenInset', + title: 'Hyper.app', + // we want to go frameless on Windows and Linux + frame: process.platform === 'darwin', + transparent: process.platform === 'darwin', + icon, + show: Boolean(process.env.HYPER_DEBUG || process.env.HYPERTERM_DEBUG || isDev), + acceptFirstMouse: true, + webPreferences: { + nodeIntegration: true, + navigateOnDragDrop: true, + enableRemoteModule: true, + contextIsolation: false + }, + ...options_ + }; + const window = new BrowserWindow(app.plugins.getDecoratedBrowserOptions(winOpts)); + window.uid = classOpts.uid; + + app.plugins.onWindowClass(window); + window.uid = classOpts.uid; + + const rpc = createRPC(window); + const sessions = new Map(); + + const updateBackgroundColor = () => { + const cfg_ = app.plugins.getDecoratedConfig(); + window.setBackgroundColor(toElectronBackgroundColor(cfg_.backgroundColor || '#000')); + }; + + // set working directory + let argPath = process.argv[1]; + if (argPath && process.platform === 'win32') { + if (/[a-zA-Z]:"/.test(argPath)) { + argPath = argPath.replace('"', sep); + } + argPath = normalize(argPath + sep); + } + let workingDirectory = homeDirectory; + if (argPath && isAbsolute(argPath)) { + workingDirectory = argPath; + } else if (cfg.workingDirectory && isAbsolute(cfg.workingDirectory)) { + workingDirectory = cfg.workingDirectory; + } + + // config changes + const cfgUnsubscribe = app.config.subscribe(() => { + const cfg_ = app.plugins.getDecoratedConfig(); + + // notify renderer + window.webContents.send('config change'); + + // notify user that shell changes require new sessions + if (cfg_.shell !== cfg.shell || JSON.stringify(cfg_.shellArgs) !== JSON.stringify(cfg.shellArgs)) { + notify('Shell configuration changed!', 'Open a new tab or window to start using the new shell'); + } + + // update background color if necessary + updateBackgroundColor(); + + cfg = cfg_; + }); + + rpc.on('init', () => { + window.show(); + updateBackgroundColor(); + + // If no callback is passed to createWindow, + // a new session will be created by default. + if (!fn) { + fn = (win: BrowserWindow) => { + win.rpc.emit('termgroup add req', {}); + }; + } + + // app.windowCallback is the createWindow callback + // that can be set before the 'ready' app event + // and createWindow definition. It's executed in place of + // the callback passed as parameter, and deleted right after. + (app.windowCallback || fn)(window); + app.windowCallback = undefined; + fetchNotifications(window); + // auto updates + if (!isDev) { + updater(window); + } else { + console.log('ignoring auto updates during dev'); + } + }); + + function createSession(extraOptions: any = {}) { + const uid = uuidv4(); + const extraOptionsFiltered: any = {}; + Object.keys(extraOptions).forEach((key) => { + if (extraOptions[key] !== undefined) extraOptionsFiltered[key] = extraOptions[key]; + }); + + // remove the rows and cols, the wrong value of them will break layout when init create + const defaultOptions = Object.assign( + { + cwd: workingDirectory, + splitDirection: undefined, + shell: cfg.shell, + shellArgs: cfg.shellArgs && Array.from(cfg.shellArgs) + }, + extraOptionsFiltered, + {uid} + ); + const options = decorateSessionOptions(defaultOptions); + const DecoratedSession = decorateSessionClass(Session); + const session = new DecoratedSession(options); + sessions.set(uid, session); + return {session, options}; + } + + rpc.on('new', (extraOptions) => { + const {session, options} = createSession(extraOptions); + + sessions.set(options.uid, session); + rpc.emit('session add', { + rows: options.rows, + cols: options.cols, + uid: options.uid, + splitDirection: options.splitDirection, + shell: session.shell, + pid: session.pty ? session.pty.pid : null, + activeUid: options.activeUid + }); + + session.on('data', (data: string) => { + rpc.emit('session data', data); + }); + + session.on('exit', () => { + rpc.emit('session exit', {uid: options.uid}); + unsetRendererType(options.uid); + sessions.delete(options.uid); + }); + }); + + rpc.on('exit', ({uid}) => { + const session = sessions.get(uid); + if (session) { + session.exit(); + } + }); + rpc.on('unmaximize', () => { + window.unmaximize(); + }); + rpc.on('maximize', () => { + window.maximize(); + }); + rpc.on('minimize', () => { + window.minimize(); + }); + rpc.on('resize', ({uid, cols, rows}) => { + const session = sessions.get(uid); + if (session) { + session.resize({cols, rows}); + } + }); + rpc.on('data', ({uid, data, escaped}: {uid: string; data: string; escaped: boolean}) => { + const session = sessions.get(uid); + if (session) { + if (escaped) { + const escapedData = session.shell?.endsWith('cmd.exe') + ? `"${data}"` // This is how cmd.exe does it + : `'${data.replace(/'/g, `'\\''`)}'`; // Inside a single-quoted string nothing is interpreted + + session.write(escapedData); + } else { + session.write(data); + } + } + }); + rpc.on('info renderer', ({uid, type}) => { + // Used in the "About" dialog + setRendererType(uid, type); + }); + rpc.on('open external', ({url}) => { + void shell.openExternal(url); + }); + rpc.on('open context menu', (selection) => { + const {createWindow} = app; + Menu.buildFromTemplate(contextMenuTemplate(createWindow, selection)).popup({window}); + }); + rpc.on('open hamburger menu', ({x, y}) => { + Menu.getApplicationMenu()!.popup({x: Math.ceil(x), y: Math.ceil(y)}); + }); + // Same deal as above, grabbing the window titlebar when the window + // is maximized on Windows results in unmaximize, without hitting any + // app buttons + for (const ev of ['maximize', 'unmaximize', 'minimize', 'restore'] as any) { + window.on(ev, () => { + rpc.emit('windowGeometry change', {}); + }); + } + window.on('move', () => { + const position = window.getPosition(); + rpc.emit('move', {bounds: {x: position[0], y: position[1]}}); + }); + rpc.on('close', () => { + window.close(); + }); + rpc.on('command', (command) => { + const focusedWindow = BrowserWindow.getFocusedWindow(); + execCommand(command, focusedWindow!); + }); + // pass on the full screen events from the window to react + rpc.win.on('enter-full-screen', () => { + rpc.emit('enter full screen', {}); + }); + rpc.win.on('leave-full-screen', () => { + rpc.emit('leave full screen', {}); + }); + const deleteSessions = () => { + sessions.forEach((session, key) => { + session.removeAllListeners(); + session.destroy(); + sessions.delete(key); + }); + }; + // we reset the rpc channel only upon + // subsequent refreshes (ie: F5) + let i = 0; + window.webContents.on('did-navigate', () => { + if (i++) { + deleteSessions(); + } + }); + + // If file is dropped onto the terminal window, navigate event is prevented + // and his path is added to active session. + window.webContents.on('will-navigate', (event, url) => { + const protocol = typeof url === 'string' && parseUrl(url).protocol; + if (protocol === 'file:') { + event.preventDefault(); + + const path = fileUriToPath(url); + + rpc.emit('session data send', {data: path, escaped: true}); + } else if (protocol === 'http:' || protocol === 'https:') { + event.preventDefault(); + rpc.emit('session data send', {data: url}); + } + }); + + // xterm makes link clickable + window.webContents.on('new-window', (event, url) => { + const protocol = typeof url === 'string' && parseUrl(url).protocol; + if (protocol === 'http:' || protocol === 'https:') { + event.preventDefault(); + void shell.openExternal(url); + } + }); + + // expose internals to extension authors + window.rpc = rpc; + window.sessions = sessions; + + const load = () => { + app.plugins.onWindow(window); + }; + + // load plugins + load(); + + const pluginsUnsubscribe = app.plugins.subscribe((err: any) => { + if (!err) { + load(); + window.webContents.send('plugins change'); + updateBackgroundColor(); + } + }); + + // Keep track of focus time of every window, to figure out + // which one of the existing window is the last focused. + // Works nicely even if a window is closed and removed. + const updateFocusTime = () => { + window.focusTime = process.uptime(); + }; + + window.on('focus', () => { + updateFocusTime(); + }); + + // the window can be closed by the browser process itself + window.clean = () => { + app.config.winRecord(window); + rpc.destroy(); + deleteSessions(); + cfgUnsubscribe(); + pluginsUnsubscribe(); + }; + // Ensure focusTime is set on window open. The focus event doesn't + // fire from the dock (see bug #583) + updateFocusTime(); + + return window; +} diff --git a/app/updater.js b/app/updater.ts similarity index 57% rename from app/updater.js rename to app/updater.ts index 27382eef..5b50665f 100644 --- a/app/updater.js +++ b/app/updater.ts @@ -1,38 +1,36 @@ // Packages -const electron = require('electron'); -const {app} = electron; -const ms = require('ms'); -const retry = require('async-retry'); +import electron, {app, BrowserWindow, AutoUpdater} from 'electron'; +import ms from 'ms'; +import retry from 'async-retry'; // Utilities -// eslint-disable-next-line no-unused-vars -const {version} = require('./package'); -const {getDecoratedConfig} = require('./plugins'); +import {version} from './package.json'; +import {getDecoratedConfig} from './plugins'; +import autoUpdaterLinux from './auto-updater-linux'; const {platform} = process; const isLinux = platform === 'linux'; -const autoUpdater = isLinux ? require('./auto-updater-linux') : electron.autoUpdater; +const autoUpdater: AutoUpdater = isLinux ? autoUpdaterLinux : electron.autoUpdater; let isInit = false; // Default to the "stable" update channel let canaryUpdates = false; -const buildFeedUrl = (canary, currentVersion) => { +const buildFeedUrl = (canary: boolean, currentVersion: string) => { const updatePrefix = canary ? 'releases-canary' : 'releases'; return `https://${updatePrefix}.hyper.is/update/${isLinux ? 'deb' : platform}/${currentVersion}`; }; -const isCanary = updateChannel => updateChannel === 'canary'; +const isCanary = (updateChannel: string) => updateChannel === 'canary'; async function init() { - autoUpdater.on('error', (err, msg) => { - //eslint-disable-next-line no-console - console.error('Error fetching updates', msg + ' (' + err.stack + ')'); + autoUpdater.on('error', (err) => { + console.error('Error fetching updates', `${err.message} (${err.stack})`); }); - const config = await retry(async () => { - const content = await getDecoratedConfig(); + const config = await retry(() => { + const content = getDecoratedConfig(); if (!content) { throw new Error('No config content loaded'); @@ -48,7 +46,7 @@ async function init() { const feedURL = buildFeedUrl(canaryUpdates, version); - autoUpdater.setFeedURL(feedURL); + autoUpdater.setFeedURL({url: feedURL}); setTimeout(() => { autoUpdater.checkForUpdates(); @@ -61,19 +59,26 @@ async function init() { isInit = true; } -module.exports = win => { +export default (win: BrowserWindow) => { if (!isInit) { - init(); + void init(); } const {rpc} = win; - const onupdate = (ev, releaseNotes, releaseName, date, updateUrl, onQuitAndInstall) => { - const releaseUrl = updateUrl || `https://github.com/zeit/hyper/releases/tag/${releaseName}`; + const onupdate = ( + ev: Event, + releaseNotes: string, + releaseName: string, + date: Date, + updateUrl: string, + onQuitAndInstall: any + ) => { + const releaseUrl = updateUrl || `https://github.com/vercel/hyper/releases/tag/${releaseName}`; rpc.emit('update available', {releaseNotes, releaseName, releaseUrl, canInstall: !!onQuitAndInstall}); }; - const eventName = isLinux ? 'update-available' : 'update-downloaded'; + const eventName: any = isLinux ? 'update-available' : 'update-downloaded'; autoUpdater.on(eventName, onupdate); @@ -88,7 +93,7 @@ module.exports = win => { if (newUpdateIsCanary !== canaryUpdates) { const feedURL = buildFeedUrl(newUpdateIsCanary, version); - autoUpdater.setFeedURL(feedURL); + autoUpdater.setFeedURL({url: feedURL}); autoUpdater.checkForUpdates(); canaryUpdates = newUpdateIsCanary; diff --git a/app/utils/cli-install.js b/app/utils/cli-install.js deleted file mode 100644 index 606022cf..00000000 --- a/app/utils/cli-install.js +++ /dev/null @@ -1,122 +0,0 @@ -const pify = require('pify'); -const fs = require('fs'); -const path = require('path'); -const Registry = require('winreg'); - -const notify = require('../notify'); - -const {cliScriptPath, cliLinkPath} = require('../config/paths'); - -const readlink = pify(fs.readlink); -const symlink = pify(fs.symlink); - -const checkInstall = () => { - return readlink(cliLinkPath) - .then(link => link === cliScriptPath) - .catch(err => { - if (err.code === 'ENOENT') { - return false; - } - throw err; - }); -}; - -const addSymlink = () => { - return checkInstall().then(isInstalled => { - if (isInstalled) { - //eslint-disable-next-line no-console - console.log('Hyper CLI already in PATH'); - return Promise.resolve(); - } - //eslint-disable-next-line no-console - console.log('Linking HyperCLI'); - return symlink(cliScriptPath, cliLinkPath); - }); -}; - -const addBinToUserPath = () => { - // Can't use pify because of param order of Registry.values callback - return new Promise((resolve, reject) => { - const envKey = new Registry({hive: 'HKCU', key: '\\Environment'}); - envKey.values((err, items) => { - if (err) { - reject(err); - return; - } - // C:\Users\\AppData\Local\hyper\app-\resources\bin - const binPath = path.dirname(cliScriptPath); - // C:\Users\\AppData\Local\hyper - const basePath = path.resolve(binPath, '../../..'); - - const pathItem = items.find(item => item.name.toUpperCase() === 'PATH'); - - let newPathValue = binPath; - const pathItemName = pathItem ? pathItem.name : 'PATH'; - if (pathItem) { - const pathParts = pathItem.value.split(';'); - const existingPath = pathParts.find(pathPart => pathPart === binPath); - if (existingPath) { - //eslint-disable-next-line no-console - console.log('Hyper CLI already in PATH'); - resolve(); - return; - } - - // Because version is in path we need to remove old path if present and add current path - newPathValue = pathParts - .filter(pathPart => !pathPart.startsWith(basePath)) - .concat([binPath]) - .join(';'); - } - //eslint-disable-next-line no-console - console.log('Adding HyperCLI path (registry)'); - envKey.set(pathItemName, Registry.REG_SZ, newPathValue, error => { - if (error) { - reject(error); - return; - } - resolve(); - }); - }); - }); -}; - -const logNotify = (withNotification, ...args) => { - //eslint-disable-next-line no-console - console.log(...args); - withNotification && notify(...args); -}; - -exports.installCLI = withNotification => { - if (process.platform === 'win32') { - addBinToUserPath() - .then(() => - logNotify( - withNotification, - 'Hyper CLI installed', - 'You may need to restart your computer to complete this installation process.' - ) - ) - .catch(err => - logNotify(withNotification, 'Hyper CLI installation failed', `Failed to add Hyper CLI path to user PATH ${err}`) - ); - } else if (process.platform === 'darwin') { - addSymlink() - .then(() => logNotify(withNotification, 'Hyper CLI installed', `Symlink created at ${cliLinkPath}`)) - .catch(err => { - // 'EINVAL' is returned by readlink, - // 'EEXIST' is returned by symlink - const error = - err.code === 'EEXIST' || err.code === 'EINVAL' - ? `File already exists: ${cliLinkPath}` - : `Symlink creation failed: ${err.code}`; - - //eslint-disable-next-line no-console - console.error(err); - logNotify(withNotification, 'Hyper CLI installation failed', error); - }); - } else { - withNotification && - notify('Hyper CLI installation', 'Command is added in PATH only at package installation. Please reinstall.'); - } -}; diff --git a/app/utils/cli-install.ts b/app/utils/cli-install.ts new file mode 100644 index 00000000..7cac74a6 --- /dev/null +++ b/app/utils/cli-install.ts @@ -0,0 +1,155 @@ +import pify from 'pify'; +import fs from 'fs'; +import path from 'path'; +import notify from '../notify'; +import {cliScriptPath, cliLinkPath} from '../config/paths'; +import * as Registry from 'native-reg'; +import type {ValueType} from 'native-reg'; +import sudoPrompt from 'sudo-prompt'; +import {clipboard, dialog} from 'electron'; +import {mkdirpSync} from 'fs-extra'; + +const readlink = pify(fs.readlink); +const symlink = pify(fs.symlink); +const sudoExec = pify(sudoPrompt.exec, {multiArgs: true}); + +const checkInstall = () => { + return readlink(cliLinkPath) + .then((link) => link === cliScriptPath) + .catch((err) => { + if (err.code === 'ENOENT') { + return false; + } + throw err; + }); +}; + +const addSymlink = async (silent: boolean) => { + try { + const isInstalled = await checkInstall(); + if (isInstalled) { + console.log('Hyper CLI already in PATH'); + return; + } + console.log('Linking HyperCLI'); + if (!fs.existsSync(path.dirname(cliLinkPath))) { + try { + mkdirpSync(path.dirname(cliLinkPath)); + } catch (err) { + throw `Failed to create directory ${path.dirname(cliLinkPath)} - ${err}`; + } + } + await symlink(cliScriptPath, cliLinkPath); + } catch (err) { + // 'EINVAL' is returned by readlink, + // 'EEXIST' is returned by symlink + let error = + err.code === 'EEXIST' || err.code === 'EINVAL' + ? `File already exists: ${cliLinkPath}` + : `Symlink creation failed: ${err.code}`; + // Need sudo access to create symlink + if (err.code === 'EACCES' && !silent) { + const result = await dialog.showMessageBox({ + message: `You need to grant elevated privileges to add Hyper CLI to PATH +Or you can run +sudo ln -sf "${cliScriptPath}" "${cliLinkPath}"`, + type: 'info', + buttons: ['OK', 'Copy Command', 'Cancel'] + }); + if (result.response === 0) { + try { + await sudoExec(`ln -sf "${cliScriptPath}" "${cliLinkPath}"`, {name: 'Hyper'}); + return; + } catch (_error) { + error = _error[0]; + } + } else if (result.response === 1) { + clipboard.writeText(`sudo ln -sf "${cliScriptPath}" "${cliLinkPath}"`); + } + } + throw error; + } +}; + +const addBinToUserPath = () => { + return new Promise((resolve, reject) => { + try { + const envKey = Registry.openKey(Registry.HKCU, 'Environment', Registry.Access.ALL_ACCESS)!; + + // C:\Users\\AppData\Local\Programs\hyper\resources\bin + const binPath = path.dirname(cliScriptPath); + // C:\Users\\AppData\Local\hyper + const oldPath = path.resolve(process.env.LOCALAPPDATA!, 'hyper'); + + const items = Registry.enumValueNames(envKey); + const pathItem = items.find((item) => item.toUpperCase() === 'PATH'); + const pathItemName = pathItem || 'PATH'; + + let newPathValue = binPath; + let type: ValueType = Registry.ValueType.SZ; + if (pathItem) { + type = Registry.queryValueRaw(envKey, pathItem)!.type; + if (type !== Registry.ValueType.SZ && type !== Registry.ValueType.EXPAND_SZ) { + reject(`Registry key type is ${type}`); + return; + } + const value = Registry.queryValue(envKey, pathItem) as string; + let pathParts = value.split(';'); + const existingPath = pathParts.includes(binPath); + const existingOldPath = pathParts.some((pathPart) => pathPart.startsWith(oldPath)); + if (existingPath && !existingOldPath) { + console.log('Hyper CLI already in PATH'); + Registry.closeKey(envKey); + resolve(); + return; + } + + // Because nsis install path is different from squirrel we need to remove old path if present + // and add current path if absent + if (existingOldPath) pathParts = pathParts.filter((pathPart) => !pathPart.startsWith(oldPath)); + if (!pathParts.includes(binPath)) pathParts.push(binPath); + newPathValue = pathParts.join(';'); + } + console.log('Adding HyperCLI path (registry)'); + Registry.setValueRaw(envKey, pathItemName, type, Registry.formatString(newPathValue)); + Registry.closeKey(envKey); + resolve(); + } catch (error) { + reject(error); + } + }); +}; + +const logNotify = (withNotification: boolean, title: string, body: string, details?: {error?: any}) => { + console.log(title, body, details); + withNotification && notify(title, body, details); +}; + +export const installCLI = async (withNotification: boolean) => { + if (process.platform === 'win32') { + try { + await addBinToUserPath(); + logNotify( + withNotification, + 'Hyper CLI installed', + 'You may need to restart your computer to complete this installation process.' + ); + } catch (err) { + logNotify(withNotification, 'Hyper CLI installation failed', `Failed to add Hyper CLI path to user PATH ${err}`); + } + } else if (process.platform === 'darwin' || process.platform === 'linux') { + // AppImages are mounted on run at a temporary path, don't create symlink + if (process.env['APPIMAGE']) { + console.log('Skipping CLI symlink creation as it is an AppImage install'); + return; + } + try { + await addSymlink(!withNotification); + logNotify(withNotification, 'Hyper CLI installed', `Symlink created at ${cliLinkPath}`); + } catch (error) { + logNotify(withNotification, 'Hyper CLI installation failed', `${error}`); + } + } else { + logNotify(withNotification, 'Hyper CLI installation failed', `Unsupported platform ${process.platform}`); + } +}; diff --git a/app/utils/colors.js b/app/utils/colors.ts similarity index 66% rename from app/utils/colors.js rename to app/utils/colors.ts index f571edd3..04a92397 100644 --- a/app/utils/colors.js +++ b/app/utils/colors.ts @@ -19,14 +19,18 @@ const colorList = [ 'grayscale' ]; -exports.getColorMap = colors => { +export const getColorMap: { + (colors: T): T extends (infer U)[] ? {[k: string]: U} : T; +} = (colors) => { if (!Array.isArray(colors)) { return colors; } + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return colors.reduce((result, color, index) => { if (index < colorList.length) { result[colorList[index]] = color; } + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return result; }, {}); }; diff --git a/app/utils/map-keys.js b/app/utils/map-keys.ts similarity index 60% rename from app/utils/map-keys.js rename to app/utils/map-keys.ts index c5f99fb5..e9c79423 100644 --- a/app/utils/map-keys.js +++ b/app/utils/map-keys.ts @@ -1,29 +1,29 @@ -const generatePrefixedCommand = (command, shortcuts) => { - const result = {}; +const generatePrefixedCommand = (command: string, shortcuts: string[]) => { + const result: Record = {}; const baseCmd = command.replace(/:prefix$/, ''); for (let i = 1; i <= 9; i++) { // 9 is a special number because it means 'last' const index = i === 9 ? 'last' : i; - const prefixedShortcuts = shortcuts.map(shortcut => `${shortcut}+${i}`); + const prefixedShortcuts = shortcuts.map((shortcut) => `${shortcut}+${i}`); result[`${baseCmd}:${index}`] = prefixedShortcuts; } return result; }; -module.exports = config => { - return Object.keys(config).reduce((keymap, command) => { +export default (config: Record) => { + return Object.keys(config).reduce((keymap: Record, command: string) => { if (!command) { - return; + return keymap; } // We can have different keys for a same command. - const shortcuts = Array.isArray(config[command]) ? config[command] : [config[command]]; - const fixedShortcuts = []; - shortcuts.forEach(shortcut => { + const _shortcuts = config[command]; + const shortcuts = Array.isArray(_shortcuts) ? _shortcuts : [_shortcuts]; + const fixedShortcuts: string[] = []; + shortcuts.forEach((shortcut) => { let newShortcut = shortcut; if (newShortcut.indexOf('cmd') !== -1) { // Mousetrap use `command` and not `cmd` - //eslint-disable-next-line no-console console.warn('Your config use deprecated `cmd` in key combination. Please use `command` instead.'); newShortcut = newShortcut.replace('cmd', 'command'); } diff --git a/app/utils/renderer-utils.js b/app/utils/renderer-utils.js deleted file mode 100644 index 7385b484..00000000 --- a/app/utils/renderer-utils.js +++ /dev/null @@ -1,19 +0,0 @@ -const rendererTypes = {}; - -function getRendererTypes() { - return rendererTypes; -} - -function setRendererType(uid, type) { - rendererTypes[uid] = type; -} - -function unsetRendererType(uid) { - delete rendererTypes[uid]; -} - -module.exports = { - getRendererTypes, - setRendererType, - unsetRendererType -}; diff --git a/app/utils/renderer-utils.ts b/app/utils/renderer-utils.ts new file mode 100644 index 00000000..4fc1d434 --- /dev/null +++ b/app/utils/renderer-utils.ts @@ -0,0 +1,15 @@ +const rendererTypes: Record = {}; + +function getRendererTypes() { + return rendererTypes; +} + +function setRendererType(uid: string, type: string) { + rendererTypes[uid] = type; +} + +function unsetRendererType(uid: string) { + delete rendererTypes[uid]; +} + +export {getRendererTypes, setRendererType, unsetRendererType}; diff --git a/app/utils/system-context-menu.ts b/app/utils/system-context-menu.ts new file mode 100644 index 00000000..e0c2b94e --- /dev/null +++ b/app/utils/system-context-menu.ts @@ -0,0 +1,60 @@ +import * as Registry from 'native-reg'; +import type {HKEY} from 'native-reg'; + +const appPath = `"${process.execPath}"`; +const regKeys = [ + `Software\\Classes\\Directory\\Background\\shell\\Hyper`, + `Software\\Classes\\Directory\\shell\\Hyper`, + `Software\\Classes\\Drive\\shell\\Hyper` +]; +const regParts = [ + {key: 'command', name: '', value: `${appPath} "%V"`}, + {name: '', value: 'Open Hyper here'}, + {name: 'Icon', value: `${appPath}`} +]; + +function addValues(hyperKey: HKEY, commandKey: HKEY) { + try { + Registry.setValueSZ(hyperKey, regParts[1].name, regParts[1].value); + } catch (error) { + console.error(error); + } + try { + Registry.setValueSZ(hyperKey, regParts[2].name, regParts[2].value); + } catch (err) { + console.error(err); + } + try { + Registry.setValueSZ(commandKey, regParts[0].name, regParts[0].value); + } catch (err_) { + console.error(err_); + } +} + +export const add = () => { + regKeys.forEach((regKey) => { + try { + const hyperKey = + Registry.openKey(Registry.HKCU, regKey, Registry.Access.ALL_ACCESS) || + Registry.createKey(Registry.HKCU, regKey, Registry.Access.ALL_ACCESS); + const commandKey = + Registry.openKey(Registry.HKCU, `${regKey}\\${regParts[0].key}`, Registry.Access.ALL_ACCESS) || + Registry.createKey(Registry.HKCU, `${regKey}\\${regParts[0].key}`, Registry.Access.ALL_ACCESS); + addValues(hyperKey, commandKey); + Registry.closeKey(hyperKey); + Registry.closeKey(commandKey); + } catch (error) { + console.error(error); + } + }); +}; + +export const remove = () => { + regKeys.forEach((regKey) => { + try { + Registry.deleteTree(Registry.HKCU, regKey); + } catch (err) { + console.error(err); + } + }); +}; diff --git a/app/utils/to-electron-background-color.js b/app/utils/to-electron-background-color.ts similarity index 70% rename from app/utils/to-electron-background-color.js rename to app/utils/to-electron-background-color.ts index 053abbae..1a526534 100644 --- a/app/utils/to-electron-background-color.js +++ b/app/utils/to-electron-background-color.ts @@ -1,10 +1,10 @@ // Packages -const Color = require('color'); +import Color from 'color'; // returns a background color that's in hex // format including the alpha channel (e.g.: `#00000050`) // input can be any css value (rgb, hsl, stringâ€Ļ) -module.exports = bgColor => { +export default (bgColor: string) => { const color = Color(bgColor); if (color.alpha() === 1) { @@ -13,12 +13,5 @@ module.exports = bgColor => { // http://stackoverflow.com/a/11019879/1202488 const alphaHex = Math.round(color.alpha() * 255).toString(16); - return ( - '#' + - alphaHex + - color - .hex() - .toString() - .substr(1) - ); + return `#${alphaHex}${color.hex().toString().substr(1)}`; }; diff --git a/app/utils/window-utils.js b/app/utils/window-utils.ts similarity index 68% rename from app/utils/window-utils.js rename to app/utils/window-utils.ts index 7ba4eb91..9a45f88b 100644 --- a/app/utils/window-utils.js +++ b/app/utils/window-utils.ts @@ -1,6 +1,6 @@ -const electron = require('electron'); +import electron from 'electron'; -function positionIsValid(position) { +export function positionIsValid(position: [number, number]) { const displays = electron.screen.getAllDisplays(); const [x, y] = position; @@ -8,7 +8,3 @@ function positionIsValid(position) { return x >= workArea.x && x <= workArea.x + workArea.width && y >= workArea.y && y <= workArea.y + workArea.height; }); } - -module.exports = { - positionIsValid -}; diff --git a/app/yarn.lock b/app/yarn.lock index a1f848a7..9df29625 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -2,75 +2,135 @@ # yarn lockfile v1 -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -asap@~2.0.3: - version "2.0.6" - resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" - -async-retry@1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.1.4.tgz#e0edb546600f19bf90f892e9494faa9e19baf190" +ajv-formats@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.0.2.tgz#69875cb99d76c74be46e9c7a4444bc232354eba0" + integrity sha512-Brah4Uo5/U8v76c6euTwtjVFFaVishwnJrQBYpev1JRh4vjA1F4HY3UzQez41YUCszUCXKagG8v6eVRBHV1gkw== dependencies: - retry "0.10.1" + ajv "^8.0.0" + +ajv@^8.0.0, ajv@^8.1.0: + version "8.1.0" + resolved "https://registry.npmjs.org/ajv/-/ajv-8.1.0.tgz#45d5d3d36c7cdd808930cc3e603cf6200dbeb736" + integrity sha512-B/Sk2Ix7A36fs/ZkuGLIR86EdjbgR6fsAcbx9lOP/QBSXujDNbVmIS/U4Itz5k8fPFDeVZl/zQ/gJW4Jrq6XjQ== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +anymatch@~3.1.2: + version "3.1.2" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" + integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +async-retry@1.3.1: + version "1.3.1" + resolved "https://registry.npmjs.org/async-retry/-/async-retry-1.3.1.tgz#139f31f8ddce50c0870b0ba558a6079684aaed55" + integrity sha512-aiieFW/7h3hY0Bq5d+ktDBejxuwR78vRu9hDUdR8rNhSaQ29VzPL4AoIRG7D/c7tdenwOcKvgPM6tIxB3cB6HA== + dependencies: + retry "0.12.0" + +atomically@^1.7.0: + version "1.7.0" + resolved "https://registry.npmjs.org/atomically/-/atomically-1.7.0.tgz#c07a0458432ea6dbc9a3506fffa424b48bccaafe" + integrity sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w== + +binary-extensions@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" + integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== + +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +chokidar@^3.5.2: + version "3.5.2" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" + integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" color-convert@^1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" + version "1.9.3" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: - color-name "^1.1.1" + color-name "1.1.3" -color-name@^1.0.0, color-name@^1.1.1: +color-name@1.1.3: version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= -color-string@^1.5.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.2.tgz#26e45814bc3c9a7cbd6751648a41434514a773a9" +color-name@^1.0.0: + version "1.1.4" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +color-string@^1.5.4: + version "1.5.5" + resolved "https://registry.npmjs.org/color-string/-/color-string-1.5.5.tgz#65474a8f0e7439625f3d27a6a19d89fc45223014" + integrity sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg== dependencies: color-name "^1.0.0" simple-swizzle "^0.2.2" -color@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color/-/color-2.0.1.tgz#e4ed78a3c4603d0891eba5430b04b86314f4c839" +color@3.1.3: + version "3.1.3" + resolved "https://registry.npmjs.org/color/-/color-3.1.3.tgz#ca67fb4e7b97d611dcde39eceed422067d91596e" + integrity sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ== dependencies: color-convert "^1.9.1" - color-string "^1.5.2" + color-string "^1.5.4" -conf@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/conf/-/conf-1.2.0.tgz#149af7408f0af6abd62c3e24cff747e41a0bc54f" +conf@^10.0.0: + version "10.0.1" + resolved "https://registry.npmjs.org/conf/-/conf-10.0.1.tgz#038093e5cbddc0e59bc14f63382c4ce732a4781d" + integrity sha512-QClEoNcruwBL84QgMEPHibL3ERxWIrRKhbjJKG1VsFBadm5QpS0jsu4QjY/maxUvhyAKXeyrs+ws+lC6PajnEg== dependencies: - dot-prop "^4.1.0" - env-paths "^1.0.0" - make-dir "^1.0.0" - pkg-up "^2.0.0" - write-file-atomic "^2.3.0" + ajv "^8.1.0" + ajv-formats "^2.0.2" + atomically "^1.7.0" + debounce-fn "^4.0.0" + dot-prop "^6.0.1" + env-paths "^2.2.1" + json-schema-typed "^7.0.3" + onetime "^5.1.2" + pkg-up "^3.1.0" + semver "^7.3.5" convert-css-color-name-to-hex@0.1.1: version "0.1.1" - resolved "https://registry.yarnpkg.com/convert-css-color-name-to-hex/-/convert-css-color-name-to-hex-0.1.1.tgz#38ac4d27ca470593fd663b18a072a308926a35a2" + resolved "https://registry.npmjs.org/convert-css-color-name-to-hex/-/convert-css-color-name-to-hex-0.1.1.tgz#38ac4d27ca470593fd663b18a072a308926a35a2" + integrity sha1-OKxNJ8pHBZP9ZjsYoHKjCJJqNaI= dependencies: css-color-names "0.0.3" is-css-color-name "^0.1.1" -core-js@^1.0.0: - version "1.2.7" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" - -cross-spawn@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" - dependencies: - lru-cache "^4.0.1" - which "^1.2.9" - cross-spawn@^6.0.0: version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== dependencies: nice-try "^1.0.4" @@ -79,87 +139,86 @@ cross-spawn@^6.0.0: shebang-command "^1.2.0" which "^1.2.9" +cross-spawn@^7.0.0: + version "7.0.3" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + css-color-names@0.0.2: version "0.0.2" - resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.2.tgz#fba18e8cff86579572d749c146c47ee83f0ea955" + resolved "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.2.tgz#fba18e8cff86579572d749c146c47ee83f0ea955" + integrity sha1-+6GOjP+GV5Vy10nBRsR+6D8OqVU= css-color-names@0.0.3: version "0.0.3" - resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.3.tgz#de0cef16f4d8aa8222a320d5b6d7e9bbada7b9f6" + resolved "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.3.tgz#de0cef16f4d8aa8222a320d5b6d7e9bbada7b9f6" + integrity sha1-3gzvFvTYqoIioyDVttfpu62nufY= -debug@^2.2.0: - version "2.6.8" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" +debounce-fn@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/debounce-fn/-/debounce-fn-4.0.0.tgz#ed76d206d8a50e60de0dd66d494d82835ffe61c7" + integrity sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ== dependencies: - ms "2.0.0" + mimic-fn "^3.0.0" -default-shell@1.0.1, default-shell@^1.0.0: +default-shell@1.0.1, default-shell@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/default-shell/-/default-shell-1.0.1.tgz#752304bddc6174f49eb29cb988feea0b8813c8bc" + resolved "https://registry.npmjs.org/default-shell/-/default-shell-1.0.1.tgz#752304bddc6174f49eb29cb988feea0b8813c8bc" + integrity sha1-dSMEvdxhdPSespy5iP7qC4gTyLw= -dot-prop@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" +dot-prop@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz#fc26b3cf142b9e59b74dbd39ed66ce620c681083" + integrity sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA== dependencies: - is-obj "^1.0.0" + is-obj "^2.0.0" -electron-config@2.0.0: +electron-fetch@1.7.3: + version "1.7.3" + resolved "https://registry.npmjs.org/electron-fetch/-/electron-fetch-1.7.3.tgz#06cf363d7f64073ec00a37e9949ec9d29ce6b08a" + integrity sha512-1AVMaxrHXTTMqd7EK0MGWusdqNr07Rpj8Th6bG4at0oNgIi/1LBwa9CjT/0Zy+M0k/tSJPS04nFxHj0SXDVgVw== + dependencies: + encoding "^0.1.13" + +electron-is-dev@2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/electron-config/-/electron-config-2.0.0.tgz#b00a7d55556d9c1aa59f5eec3bdf446c773425ff" - integrity sha512-5mGwRK4lsAo6tiy4KNF/zUInYpUGr7JJzLA8FHOoqBWV3kkKJWSrDXo4Uk2Ffm5aeQ1o73XuorfkYhaWFV2O4g== - dependencies: - conf "^1.0.0" + resolved "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-2.0.0.tgz#833487a069b8dad21425c67a19847d9064ab19bd" + integrity sha512-3X99K852Yoqu9AcW50qz3ibYBWY79/pBhlMCab8ToEWS48R0T9tyxRiQhwylE7zQdXrMnx2JKqUJyMPmt5FBqA== -electron-fetch@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/electron-fetch/-/electron-fetch-1.3.0.tgz#00d9bb1fe7a66ddc3fea538910e01b26fee9abb5" - integrity sha512-WzHnWZqKdiCKHqqHu+GphezoWRSUVH6BQ/f13vu16VwYKJRZNt2dUrx40eZJcyZcDGn6RJDTAHS6jVoHoglgNw== +electron-store@8.0.0: + version "8.0.0" + resolved "https://registry.npmjs.org/electron-store/-/electron-store-8.0.0.tgz#81a4e687958e2dae1c5c84cc099a8148be776337" + integrity sha512-ZgRPUZkfrrjWSqxZeaxu7lEvmYf6tgl49dLMqxXGnEmliSiwv3u4rJPG+mH3fBQP9PBqgSh4TCuxHZImMMUgWg== dependencies: - encoding "^0.1.12" + conf "^10.0.0" + type-fest "^1.0.2" -electron-is-dev@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/electron-is-dev/-/electron-is-dev-1.0.1.tgz#6e0a184736fe7aea77d18210b0b0f6a02402c4bc" - integrity sha512-iwM3EotA9HTXqMGpQRkR/kT8OZqBbdfHTnlwcxsjSLYqY8svvsq0MuujsWCn3/vtgRmDv/PC/gKUUpoZvi5C1w== - -electron-squirrel-startup@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/electron-squirrel-startup/-/electron-squirrel-startup-1.0.0.tgz#19b4e55933fa0ef8f556784b9c660f772546a0b8" +encoding@^0.1.13: + version "0.1.13" + resolved "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" + integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== dependencies: - debug "^2.2.0" - -encoding@^0.1.11, encoding@^0.1.12: - version "0.1.12" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" - dependencies: - iconv-lite "~0.4.13" + iconv-lite "^0.6.2" end-of-stream@^1.1.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + version "1.4.4" + resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== dependencies: once "^1.4.0" -env-paths@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-1.0.0.tgz#4168133b42bb05c38a35b1ae4397c8298ab369e0" - -execa@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" - dependencies: - cross-spawn "^4.0.0" - get-stream "^2.2.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" +env-paths@^2.2.1: + version "2.2.1" + resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" + integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== execa@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + resolved "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== dependencies: cross-spawn "^6.0.0" @@ -170,516 +229,643 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -fbjs@^0.8.16: - version "0.8.16" - resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.16.tgz#5e67432f550dc41b572bf55847b8aca64e5337db" +execa@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" + integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== dependencies: - core-js "^1.0.0" - isomorphic-fetch "^2.1.1" - loose-envify "^1.0.0" - object-assign "^4.1.0" - promise "^7.1.1" - setimmediate "^1.0.5" - ua-parser-js "^0.7.9" + cross-spawn "^7.0.0" + get-stream "^5.0.0" + human-signals "^1.1.1" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.0" + onetime "^5.1.0" + signal-exit "^3.0.2" + strip-final-newline "^2.0.0" -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - dependencies: - locate-path "^2.0.0" +file-uri-to-path@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-2.0.0.tgz#7b415aeba227d575851e0a5b0c640d7656403fba" + integrity sha512-hjPFI8oE/2iQPVe4gbrJ73Pp+Xfub2+WI2LlXDbsaJBwT5wuMh35WNWVYYTpnz895shtwfyutMFLFywpQAFdLg== -fs-extra@7.0.1: +fill-range@^7.0.1: version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== dependencies: - graceful-fs "^4.1.2" - jsonfile "^4.0.0" - universalify "^0.1.0" + to-regex-range "^5.0.1" -get-stream@^2.2.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== dependencies: - object-assign "^4.0.1" - pinkie-promise "^2.0.0" + locate-path "^3.0.0" + +fs-extra@10.0.0: + version "10.0.0" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" + integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== get-stream@^4.0.0: version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== dependencies: pump "^3.0.0" -git-describe@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/git-describe/-/git-describe-4.0.2.tgz#9ecc5e6df4658450c89ea35d10183c9f5f40dc73" +get-stream@^5.0.0: + version "5.2.0" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== dependencies: - lodash "^4.16.6" + pump "^3.0.0" + +git-describe@4.0.4: + version "4.0.4" + resolved "https://registry.npmjs.org/git-describe/-/git-describe-4.0.4.tgz#f3d55bce309becf6dc27fed535d380a621967e8c" + integrity sha512-L1X9OO1e4MusB4PzG9LXeXCQifRvyuoHTpuuZ521Qyxn/B0kWHWEOtsT4LsSfSNacZz0h4ZdYDsDG7f+SrA3hg== + dependencies: + lodash "^4.17.11" optionalDependencies: - semver "^5.3.0" + semver "^5.6.0" -graceful-fs@^4.1.11: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" -graceful-fs@^4.1.2, graceful-fs@^4.1.6: - version "4.1.15" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== +graceful-fs@^4.1.6, graceful-fs@^4.2.0: + version "4.2.4" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== -iconv-lite@~0.4.13: - version "0.4.19" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" +human-signals@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" + integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" +iconv-lite@^0.6.2: + version "0.6.2" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz#ce13d1875b0c3a674bd6a04b7f76b01b1b6ded01" + integrity sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" -inherits@~2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" +inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -invert-kv@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" - integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== +invert-kv@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/invert-kv/-/invert-kv-3.0.1.tgz#a93c7a3d4386a1dc8325b97da9bb1620c0282523" + integrity sha512-CYdFeFexxhv/Bcny+Q0BfOV+ltRlJcd4BBZBYFX/O0u4npJrgZtIcjokegtiSMAvlMTJ+Koq0GBCc//3bueQxw== is-arrayish@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.1.tgz#c2dfc386abaa0c3e33c48db3fe87059e69065efd" + version "0.3.2" + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz#4574a2ae56f7ab206896fb431eaeed066fdf8f03" + integrity sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" is-css-color-name@^0.1.1: version "0.1.3" - resolved "https://registry.yarnpkg.com/is-css-color-name/-/is-css-color-name-0.1.3.tgz#ea3b51bc901d8a243d32c9b7873d0680dbbef7f1" + resolved "https://registry.npmjs.org/is-css-color-name/-/is-css-color-name-0.1.3.tgz#ea3b51bc901d8a243d32c9b7873d0680dbbef7f1" + integrity sha1-6jtRvJAdiiQ9Msm3hz0GgNu+9/E= dependencies: css-color-names "0.0.2" -is-obj@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= -is-plain-obj@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-obj@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" + integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== is-ssh@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.0.tgz#ebea1169a2614da392a63740366c3ce049d8dff6" + version "1.3.2" + resolved "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.2.tgz#a4b82ab63d73976fd8263cceee27f99a88bdae2b" + integrity sha512-elEw0/0c2UscLrNG+OAorbP539E3rhliKPg+hDMWN9VwrDXfYK+4PBEykDPfxlYYtQvl84TascnQyobfQLHEhQ== dependencies: protocols "^1.1.0" -is-stream@^1.0.1, is-stream@^1.1.0: +is-stream@^1.1.0: version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" + integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== isexe@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -isomorphic-fetch@^2.1.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" - dependencies: - node-fetch "^1.0.1" - whatwg-fetch ">=0.10.0" - -js-tokens@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - -jsonfile@^4.0.0: +"js-tokens@^3.0.0 || ^4.0.0": version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + +json-schema-typed@^7.0.3: + version "7.0.3" + resolved "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-7.0.3.tgz#23ff481b8b4eebcd2ca123b4fa0409e66469a2d9" + integrity sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A== + +jsonfile@^6.0.1: + version "6.1.0" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== + dependencies: + universalify "^2.0.0" optionalDependencies: graceful-fs "^4.1.6" -lcid@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" - integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== +lcid@^3.0.0: + version "3.1.1" + resolved "https://registry.npmjs.org/lcid/-/lcid-3.1.1.tgz#9030ec479a058fc36b5e8243ebaac8b6ac582fd0" + integrity sha512-M6T051+5QCGLBQb8id3hdvIW8+zeFV2FyBGFS9IEK5H9Wt4MueD4bW1eWikpHgZp+5xR3l5c8pZUkQsIA0BFZg== dependencies: - invert-kv "^2.0.0" + invert-kv "^3.0.0" -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== dependencies: - p-locate "^2.0.0" + p-locate "^3.0.0" path-exists "^3.0.0" -lodash@4.17.5: - version "4.17.5" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" +lodash@4.17.21, lodash@^4.17.11: + version "4.17.21" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -lodash@^4.16.6: - version "4.17.4" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" - -loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" +loose-envify@^1.1.0: + version "1.4.0" + resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: - js-tokens "^3.0.0" + js-tokens "^3.0.0 || ^4.0.0" -lru-cache@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" + yallist "^4.0.0" -make-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.0.0.tgz#97a011751e91dd87cfadef58832ebb04936de978" - dependencies: - pify "^2.3.0" - -map-age-cleaner@^0.1.1: +map-age-cleaner@^0.1.3: version "0.1.3" - resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + resolved "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== dependencies: p-defer "^1.0.0" -mem@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-4.0.0.tgz#6437690d9471678f6cc83659c00cbafcd6b0cdaf" - integrity sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA== +mem@^5.0.0: + version "5.1.1" + resolved "https://registry.npmjs.org/mem/-/mem-5.1.1.tgz#7059b67bf9ac2c924c9f1cff7155a064394adfb3" + integrity sha512-qvwipnozMohxLXG1pOqoLiZKNkC4r4qqRucSoDwXowsNGDSULiqFTRUF05vcZWnwJSG22qTsynQhxbaMtnX9gw== dependencies: - map-age-cleaner "^0.1.1" - mimic-fn "^1.0.0" - p-is-promise "^1.1.0" + map-age-cleaner "^0.1.3" + mimic-fn "^2.1.0" + p-is-promise "^2.1.0" -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -mkdirp@0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -ms@2.0.0: +merge-stream@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== -nan@2.10.0: - version "2.10.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" - integrity sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA== +mimic-fn@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz#65755145bbf3e36954b949c16450427451d5ca74" + integrity sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ== + +mkdirp@1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + +ms@2.1.3: + version "2.1.3" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +nan@^2.14.0: + version "2.14.2" + resolved "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" + integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== + +native-reg@0.3.5: + version "0.3.5" + resolved "https://registry.npmjs.org/native-reg/-/native-reg-0.3.5.tgz#80f6601028f236be68ef45b5c17493a94abb1145" + integrity sha512-lwaSAbq02DZ2aFK/ZvHzDpaHQSo7fh0GjIol+juMe6iwmeBO+ZMXFSPLfpOksOhcxgEBhgCU1bVm1G0u9lkdpA== + dependencies: + node-gyp-build "^4" nice-try@^1.0.4: version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + resolved "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -node-fetch@^1.0.1: - version "1.7.3" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" - dependencies: - encoding "^0.1.11" - is-stream "^1.0.1" +node-gyp-build@^4: + version "4.2.3" + resolved "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" + integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg== -node-pty@0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.8.0.tgz#08bccb633f49e2e3f7245eb56ea6b40f37ccd64f" - integrity sha512-g5ggk3gN4gLrDmAllee5ScFyX3YzpOC/U8VJafha4pE7do0TIE1voiIxEbHSRUOPD1xYqmY+uHhOKAd3avbxGQ== +node-pty@0.10.1: + version "0.10.1" + resolved "https://registry.npmjs.org/node-pty/-/node-pty-0.10.1.tgz#cd05d03a2710315ec40221232ec04186f6ac2c6d" + integrity sha512-JTdtUS0Im/yRsWJSx7yiW9rtpfmxqxolrtnyKwPLI+6XqTAPW/O2MjS8FYL4I5TsMbH2lVgDb2VMjp+9LoQGNg== dependencies: - nan "2.10.0" + nan "^2.14.0" -normalize-url@^1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c" - dependencies: - object-assign "^4.0.1" - prepend-http "^1.0.0" - query-string "^4.1.0" - sort-keys "^1.0.0" +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +normalize-url@4.5.1: + version "4.5.1" + resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" + integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== npm-run-path@^2.0.0: version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= dependencies: path-key "^2.0.0" -object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: +npm-run-path@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +object-assign@^4.1.1: version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= once@^1.3.1, once@^1.4.0: version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" -os-locale@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" - integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== +onetime@^5.1.0, onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== dependencies: - execa "^1.0.0" - lcid "^2.0.0" - mem "^4.0.0" + mimic-fn "^2.1.0" + +os-locale@5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/os-locale/-/os-locale-5.0.0.tgz#6d26c1d95b6597c5d5317bf5fba37eccec3672e0" + integrity sha512-tqZcNEDAIZKBEPnHPlVDvKrp7NzgLi7jRmhKiUoa2NUmhl13FtkAGLUVR+ZsYvApBQdBfYm43A4tXXQ4IrYLBA== + dependencies: + execa "^4.0.0" + lcid "^3.0.0" + mem "^5.0.0" p-defer@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + resolved "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= p-finally@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= -p-is-promise@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" - integrity sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4= +p-is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== -p-limit@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" +p-limit@^2.0.0: + version "2.3.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== dependencies: - p-limit "^1.1.0" + p-try "^2.0.0" -parse-path@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-3.0.2.tgz#4686980f0b262ee2dbb9a64eef739c91edc85245" +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parse-path@^4.0.0: + version "4.0.2" + resolved "https://registry.npmjs.org/parse-path/-/parse-path-4.0.2.tgz#ef14f0d3d77bae8dd4bc66563a4c151aac9e65aa" + integrity sha512-HSqVz6iuXSiL8C1ku5Gl1Z5cwDd9Wo0q8CoffdAghP6bz8pJa1tcMC+m4N+z6VAS8QdksnIGq1TB6EgR4vPR6w== dependencies: is-ssh "^1.3.0" protocols "^1.4.0" -parse-url@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-3.0.2.tgz#602787a7063a795d72b8673197505e72f60610be" +parse-url@5.0.7: + version "5.0.7" + resolved "https://registry.npmjs.org/parse-url/-/parse-url-5.0.7.tgz#2ca3c32816f1a092c35e1f2afe63bb7924dde261" + integrity sha512-CgbjyWT6aOh2oNSUS0cioYQsGysj9hQ2IdbOfeNwq5KOaKM7dOw/yTupiI0cnJhaDHJEIGybPkQz7LF9WNIhyw== dependencies: is-ssh "^1.3.0" - normalize-url "^1.9.1" - parse-path "^3.0.1" + normalize-url "4.5.1" + parse-path "^4.0.0" protocols "^1.4.0" path-exists@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + resolved "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= -pify@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.2.2" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== + +pify@5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz#1f5eca3f5e87ebec28cc6d54a0e4aaf00acc127f" + integrity sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA== + +pkg-up@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz#100ec235cc150e4fd42519412596a28512a0def5" + integrity sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA== dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - -pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" - dependencies: - find-up "^2.1.0" - -prepend-http@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - -promise@^7.1.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" - dependencies: - asap "~2.0.3" - -prop-types@^15.6.0: - version "15.6.1" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.1.tgz#36644453564255ddda391191fb3a125cbdf654ca" - dependencies: - fbjs "^0.8.16" - loose-envify "^1.3.1" - object-assign "^4.1.1" + find-up "^3.0.0" protocols@^1.1.0, protocols@^1.4.0: - version "1.4.6" - resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.6.tgz#f8bb263ea1b5fd7a7604d26b8be39bd77678bf8a" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + version "1.4.8" + resolved "https://registry.npmjs.org/protocols/-/protocols-1.4.8.tgz#48eea2d8f58d9644a4a32caae5d5db290a075ce8" + integrity sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg== pump@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + resolved "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== dependencies: end-of-stream "^1.1.0" once "^1.3.1" -query-string@^4.1.0: - version "4.3.4" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" - dependencies: - object-assign "^4.1.0" - strict-uri-encode "^1.0.0" +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -queue@4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/queue/-/queue-4.4.2.tgz#5a9733d9a8b8bd1b36e934bc9c55ab89b28e29c7" +queue@6.0.2: + version "6.0.2" + resolved "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz#b91525283e2315c7553d2efa18d83e76432fed65" + integrity sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA== dependencies: - inherits "~2.0.0" + inherits "~2.0.3" -react-dom@16.2.1: - version "16.2.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.2.1.tgz#5cfb32f66267ece7b3850466bf3b219d4911fc1a" - integrity sha512-0ujGgYnpX0GlaAjUfwU7ddy0DjuzPmTHHi2SlPolGv7hAyUpK7XA7WZcxit5ZcU7cW5QU1HJjlS3eMn42tSfYQ== +react-dom@17.0.2: + version "17.0.2" + resolved "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" + integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== dependencies: - fbjs "^0.8.16" loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.0" + scheduler "^0.20.2" -react@16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.2.0.tgz#a31bd2dab89bff65d42134fa187f24d054c273ba" +react@17.0.2: + version "17.0.2" + resolved "https://registry.npmjs.org/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" + integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== dependencies: - fbjs "^0.8.16" loose-envify "^1.1.0" object-assign "^4.1.1" - prop-types "^15.6.0" -retry@0.10.1: - version "0.10.1" - resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" -semver@5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== -semver@^5.3.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" +retry@0.12.0: + version "0.12.0" + resolved "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= -semver@^5.5.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== +"safer-buffer@>= 2.1.2 < 3.0.0": + version "2.1.2" + resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -setimmediate@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" +scheduler@^0.20.2: + version "0.20.2" + resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" + integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + +semver@7.3.5, semver@^7.3.5: + version "7.3.5" + resolved "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" + integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== + dependencies: + lru-cache "^6.0.0" + +semver@^5.5.0, semver@^5.6.0: + version "5.7.1" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== shebang-command@^1.2.0: version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= dependencies: shebang-regex "^1.0.0" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + shebang-regex@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= -shell-env@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/shell-env/-/shell-env-0.3.0.tgz#2250339022989165bda4eb7bf383afeaaa92dc34" +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +shell-env@3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/shell-env/-/shell-env-3.0.1.tgz#515a62f6cbd5e139365be2535745e8e53438ce77" + integrity sha512-b09fpMipAQ9ObwvIeKoQFLDXcEcCpYUUZanlad4OYQscw2I49C/u97OPQg9jWYo36bRDn62fbe07oWYqovIvKA== dependencies: - default-shell "^1.0.0" - execa "^0.5.0" - strip-ansi "^3.0.0" + default-shell "^1.0.1" + execa "^1.0.0" + strip-ansi "^5.2.0" signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + version "3.0.3" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c" + integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA== simple-swizzle@^0.2.2: version "0.2.2" - resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" + resolved "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a" + integrity sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo= dependencies: is-arrayish "^0.3.1" -sort-keys@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" +strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== dependencies: - is-plain-obj "^1.0.0" - -strict-uri-encode@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" + ansi-regex "^4.1.0" strip-eof@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + resolved "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= -ua-parser-js@^0.7.9: - version "0.7.18" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed" +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== +sudo-prompt@^9.2.1: + version "9.2.1" + resolved "https://registry.npmjs.org/sudo-prompt/-/sudo-prompt-9.2.1.tgz#77efb84309c9ca489527a4e749f287e6bdd52afd" + integrity sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw== -uuid@3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" -whatwg-fetch@>=0.10.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" +type-fest@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-1.0.2.tgz#3f9c39982859f385c77c38b7e5f1432b8a3661c6" + integrity sha512-a720oz3Kjbp3ll0zkeN9qjRhO7I34MKMhPGQiQJAmaZQZQ1lo+NWThK322f7sXV+kTg9B1Ybt16KgBXWgteT8w== + +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== + +uri-js@^4.2.2: + version "4.4.0" + resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz#aa714261de793e8a82347a7bcc9ce74e86f28602" + integrity sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g== + dependencies: + punycode "^2.1.0" + +uuid@8.3.2: + version "8.3.2" + resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== which@^1.2.9: - version "1.3.0" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" + version "1.3.1" + resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" -winreg@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.4.tgz#ba065629b7a925130e15779108cf540990e98d1b" +which@^2.0.1: + version "2.0.2" + resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" wrappy@1: version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write-file-atomic@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - signal-exit "^3.0.2" - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index a8cac3ac..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -# https://github.com/sindresorhus/appveyor-node/blob/master/appveyor.yml - -environment: - matrix: - - platform: x64 - -image: Visual Studio 2015 - -init: - - yarn config set msvs_version 2015 # we need this to build `pty.js` - -install: - - ps: Install-Product node 10.2.0 x64 - - set CI=true - - yarn - -build: off - -matrix: - fast_finish: true - -shallow_clone: true - -test_script: - - node --version - - yarn --version - - yarn run test - -on_success: - - IF %APPVEYOR_REPO_BRANCH%==canary cp build\canary.ico build\icon.ico - - yarn run dist - - ps: Get-ChildItem .\dist\squirrel-windows\*.exe | % { Push-AppveyorArtifact $_.FullName } diff --git a/assets/search-icons.svg b/assets/search-icons.svg new file mode 100644 index 00000000..48778e75 --- /dev/null +++ b/assets/search-icons.svg @@ -0,0 +1,29 @@ + + + + left arrow + + + + + + + + right arrow + + + + + + + + cancel + + + + + + + + + diff --git a/ava-spectron.config.js b/ava-spectron.config.js new file mode 100644 index 00000000..e7298452 --- /dev/null +++ b/ava-spectron.config.js @@ -0,0 +1,10 @@ +export default { + files: ['test/*'], + babel: { + compileEnhancements: false, + compileAsTests: ['**/testUtils/**/*'] + }, + extensions: ['ts'], + require: ['ts-node/register/transpile-only'], + timeout: '30s' +}; diff --git a/ava.config.js b/ava.config.js new file mode 100644 index 00000000..c8c5c9ae --- /dev/null +++ b/ava.config.js @@ -0,0 +1,9 @@ +export default { + files: ['test/unit/*'], + babel: { + compileEnhancements: false, + compileAsTests: ['**/testUtils/**/*'] + }, + extensions: ['ts'], + require: ['ts-node/register/transpile-only'] +}; diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 00000000..a887fe3f --- /dev/null +++ b/babel.config.json @@ -0,0 +1,18 @@ +{ + "presets": [ + "@babel/react", + "@babel/typescript" + ], + "plugins": [ + [ + "styled-jsx/babel", + { + "vendorPrefixes": false + } + ], + "@babel/plugin-proposal-numeric-separator", + "@babel/proposal-class-properties", + "@babel/proposal-object-rest-spread", + "@babel/plugin-proposal-optional-chaining" + ] +} diff --git a/bin/yarn-standalone.js b/bin/yarn-standalone.js index cc3814c1..9420daa5 100644 --- a/bin/yarn-standalone.js +++ b/bin/yarn-standalone.js @@ -65,7 +65,7 @@ module.exports = /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 414); +/******/ return __webpack_require__(__webpack_require__.s = 549); /******/ }) /************************************************************************/ /******/ ([ @@ -76,6 +76,218 @@ module.exports = require("path"); /***/ }), /* 1 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = __extends; +/* unused harmony export __assign */ +/* unused harmony export __rest */ +/* unused harmony export __decorate */ +/* unused harmony export __param */ +/* unused harmony export __metadata */ +/* unused harmony export __awaiter */ +/* unused harmony export __generator */ +/* unused harmony export __exportStar */ +/* unused harmony export __values */ +/* unused harmony export __read */ +/* unused harmony export __spread */ +/* unused harmony export __await */ +/* unused harmony export __asyncGenerator */ +/* unused harmony export __asyncDelegator */ +/* unused harmony export __asyncValues */ +/* unused harmony export __makeTemplateObject */ +/* unused harmony export __importStar */ +/* unused harmony export __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 }; +} + + +/***/ }), +/* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83,7 +295,7 @@ module.exports = require("path"); exports.__esModule = true; -var _promise = __webpack_require__(173); +var _promise = __webpack_require__(227); var _promise2 = _interopRequireDefault(_promise); @@ -119,54 +331,11 @@ exports.default = function (fn) { }; /***/ }), -/* 2 */ +/* 3 */ /***/ (function(module, exports) { module.exports = require("util"); -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -class MessageError extends Error { - constructor(msg, code) { - super(msg); - this.code = code; - } - -} - -exports.MessageError = MessageError; -class ProcessSpawnError extends MessageError { - constructor(msg, code, process) { - super(msg, code); - this.process = process; - } - -} - -exports.ProcessSpawnError = ProcessSpawnError; -class SecurityError extends MessageError {} - -exports.SecurityError = SecurityError; -class ProcessTermError extends MessageError {} - -exports.ProcessTermError = ProcessTermError; -class ResponseError extends Error { - constructor(msg, responseCode) { - super(msg); - this.responseCode = responseCode; - } - -} -exports.ResponseError = ResponseError; - /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { @@ -177,20 +346,20 @@ exports.ResponseError = ResponseError; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getFirstSuitableFolder = exports.readFirstAvailableStream = exports.makeTempDir = exports.hardlinksWork = exports.writeFilePreservingEol = exports.getFileSizeOnDisk = exports.walk = exports.symlink = exports.find = exports.readJsonAndFile = exports.readJson = exports.readFileAny = exports.hardlinkBulk = exports.copyBulk = exports.fileDatesEqual = exports.glob = exports.link = exports.chmod = exports.lstat = exports.exists = exports.mkdirp = exports.unlink = exports.stat = exports.access = exports.rename = exports.readdir = exports.realpath = exports.readlink = exports.writeFile = exports.readFileBuffer = exports.lockQueue = exports.constants = undefined; +exports.getFirstSuitableFolder = exports.readFirstAvailableStream = exports.makeTempDir = exports.hardlinksWork = exports.writeFilePreservingEol = exports.getFileSizeOnDisk = exports.walk = exports.symlink = exports.find = exports.readJsonAndFile = exports.readJson = exports.readFileAny = exports.hardlinkBulk = exports.copyBulk = exports.unlink = exports.glob = exports.link = exports.chmod = exports.lstat = exports.exists = exports.mkdirp = exports.stat = exports.access = exports.rename = exports.readdir = exports.realpath = exports.readlink = exports.writeFile = exports.open = exports.readFileBuffer = exports.lockQueue = exports.constants = undefined; var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } let buildActionsForCopy = (() => { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { // let build = (() => { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { const src = data.src, dest = data.dest, type = data.type; @@ -255,7 +424,14 @@ let buildActionsForCopy = (() => { } catch (err) {} } */ - if (bothFiles && srcStat.size === destStat.size && fileDatesEqual(srcStat.mtime, destStat.mtime)) { + if (bothFiles && artifactFiles.has(dest)) { + // this file gets changed during build, likely by a custom install script. Don't bother checking it. + onDone(); + reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); + return; + } + + if (bothFiles && srcStat.size === destStat.size && (0, (_fsNormalized || _load_fsNormalized()).fileDatesEqual)(srcStat.mtime, destStat.mtime)) { // we can safely assume this is the same file onDone(); reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.size, +srcStat.mtime)); @@ -277,13 +453,39 @@ let buildActionsForCopy = (() => { const destFiles = yield readdir(dest); invariant(srcFiles, 'src files not initialised'); - for (const file of destFiles) { + for (var _iterator4 = destFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref6; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref6 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref6 = _i4.value; + } + + const file = _ref6; + if (srcFiles.indexOf(file) < 0) { const loc = (_path || _load_path()).default.join(dest, file); possibleExtraneous.add(loc); if ((yield lstat(loc)).isDirectory()) { - for (const file of yield readdir(loc)) { + for (var _iterator5 = yield readdir(loc), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref7; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref7 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref7 = _i5.value; + } + + const file = _ref7; + possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); } } @@ -293,7 +495,7 @@ let buildActionsForCopy = (() => { } if (destStat && destStat.isSymbolicLink()) { - yield unlink(dest); + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); destStat = null; } @@ -323,15 +525,38 @@ let buildActionsForCopy = (() => { if (!remaining) { onDone(); } - for (const file of srcFiles) { + for (var _iterator6 = srcFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref8; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref8 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref8 = _i6.value; + } + + const file = _ref8; + queue.push({ dest: (_path || _load_path()).default.join(dest, file), onFresh, - onDone: function () { + onDone: function (_onDone) { + function onDone() { + return _onDone.apply(this, arguments); + } + + onDone.toString = function () { + return _onDone.toString(); + }; + + return onDone; + }(function () { if (--remaining === 0) { onDone(); } - }, + }), src: (_path || _load_path()).default.join(src, file) }); } @@ -350,8 +575,8 @@ let buildActionsForCopy = (() => { } }); - return function build(_x9) { - return _ref3.apply(this, arguments); + return function build(_x5) { + return _ref5.apply(this, arguments); }; })(); @@ -359,7 +584,20 @@ let buildActionsForCopy = (() => { const files = new Set(); // initialise events - for (const item of queue) { + for (var _iterator = queue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + const item = _ref2; + const onDone = item.onDone; item.onDone = function () { events.onProgress(item.dest); @@ -384,15 +622,41 @@ let buildActionsForCopy = (() => { yield Promise.all(items.map(build)); } - // simulate the existence of some files to prevent considering them extraenous - for (const file of artifactFiles) { + // simulate the existence of some files to prevent considering them extraneous + for (var _iterator2 = artifactFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + const file = _ref3; + if (possibleExtraneous.has(file)) { reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); possibleExtraneous.delete(file); } } - for (const loc of possibleExtraneous) { + for (var _iterator3 = possibleExtraneous, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + const loc = _ref4; + if (files.has(loc.toLowerCase())) { possibleExtraneous.delete(loc); } @@ -401,17 +665,17 @@ let buildActionsForCopy = (() => { return actions; }); - return function buildActionsForCopy(_x5, _x6, _x7, _x8) { - return _ref2.apply(this, arguments); + return function buildActionsForCopy(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); }; })(); let buildActionsForHardlink = (() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { + var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { // let build = (() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { const src = data.src, dest = data.dest; @@ -458,6 +722,13 @@ let buildActionsForHardlink = (() => { } } + if (bothFiles && artifactFiles.has(dest)) { + // this file gets changed during build, likely by a custom install script. Don't bother checking it. + onDone(); + reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); + return; + } + // correct hardlink if (bothFiles && srcStat.ino !== null && srcStat.ino === destStat.ino) { onDone(); @@ -480,13 +751,39 @@ let buildActionsForHardlink = (() => { const destFiles = yield readdir(dest); invariant(srcFiles, 'src files not initialised'); - for (const file of destFiles) { + for (var _iterator10 = destFiles, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { + var _ref14; + + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref14 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref14 = _i10.value; + } + + const file = _ref14; + if (srcFiles.indexOf(file) < 0) { const loc = (_path || _load_path()).default.join(dest, file); possibleExtraneous.add(loc); if ((yield lstat(loc)).isDirectory()) { - for (const file of yield readdir(loc)) { + for (var _iterator11 = yield readdir(loc), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { + var _ref15; + + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref15 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref15 = _i11.value; + } + + const file = _ref15; + possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); } } @@ -519,16 +816,39 @@ let buildActionsForHardlink = (() => { if (!remaining) { onDone(); } - for (const file of srcFiles) { + for (var _iterator12 = srcFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { + var _ref16; + + if (_isArray12) { + if (_i12 >= _iterator12.length) break; + _ref16 = _iterator12[_i12++]; + } else { + _i12 = _iterator12.next(); + if (_i12.done) break; + _ref16 = _i12.value; + } + + const file = _ref16; + queue.push({ onFresh, src: (_path || _load_path()).default.join(src, file), dest: (_path || _load_path()).default.join(dest, file), - onDone: function () { + onDone: function (_onDone2) { + function onDone() { + return _onDone2.apply(this, arguments); + } + + onDone.toString = function () { + return _onDone2.toString(); + }; + + return onDone; + }(function () { if (--remaining === 0) { onDone(); } - } + }) }); } } else if (srcStat.isFile()) { @@ -544,8 +864,8 @@ let buildActionsForHardlink = (() => { } }); - return function build(_x14) { - return _ref5.apply(this, arguments); + return function build(_x10) { + return _ref13.apply(this, arguments); }; })(); @@ -553,7 +873,20 @@ let buildActionsForHardlink = (() => { const files = new Set(); // initialise events - for (const item of queue) { + for (var _iterator7 = queue, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref10; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref10 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref10 = _i7.value; + } + + const item = _ref10; + const onDone = item.onDone || noop; item.onDone = function () { events.onProgress(item.dest); @@ -576,15 +909,41 @@ let buildActionsForHardlink = (() => { yield Promise.all(items.map(build)); } - // simulate the existence of some files to prevent considering them extraenous - for (const file of artifactFiles) { + // simulate the existence of some files to prevent considering them extraneous + for (var _iterator8 = artifactFiles, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { + var _ref11; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref11 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref11 = _i8.value; + } + + const file = _ref11; + if (possibleExtraneous.has(file)) { reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); possibleExtraneous.delete(file); } } - for (const loc of possibleExtraneous) { + for (var _iterator9 = possibleExtraneous, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { + var _ref12; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref12 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref12 = _i9.value; + } + + const loc = _ref12; + if (files.has(loc.toLowerCase())) { possibleExtraneous.delete(loc); } @@ -593,13 +952,13 @@ let buildActionsForHardlink = (() => { return actions; }); - return function buildActionsForHardlink(_x10, _x11, _x12, _x13) { - return _ref4.apply(this, arguments); + return function buildActionsForHardlink(_x6, _x7, _x8, _x9) { + return _ref9.apply(this, arguments); }; })(); let copyBulk = exports.copyBulk = (() => { - var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { + var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { const events = { onStart: _events && _events.onStart || noop, onProgress: _events && _events.onProgress || noop, @@ -616,14 +975,14 @@ let copyBulk = exports.copyBulk = (() => { const currentlyWriting = new Map(); yield (_promise || _load_promise()).queue(fileActions, (() => { - var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { let writePromise; while (writePromise = currentlyWriting.get(data.dest)) { yield writePromise; } reporter.verbose(reporter.lang('verboseFileCopy', data.src, data.dest)); - const copier = safeCopyFile(data, function () { + const copier = (0, (_fsNormalized || _load_fsNormalized()).copyFile)(data, function () { return currentlyWriting.delete(data.dest); }); currentlyWriting.set(data.dest, copier); @@ -631,8 +990,8 @@ let copyBulk = exports.copyBulk = (() => { return copier; }); - return function (_x20) { - return _ref8.apply(this, arguments); + return function (_x14) { + return _ref18.apply(this, arguments); }; })(), CONCURRENT_QUEUE_ITEMS); @@ -645,13 +1004,13 @@ let copyBulk = exports.copyBulk = (() => { }); }); - return function copyBulk(_x17, _x18, _x19) { - return _ref7.apply(this, arguments); + return function copyBulk(_x11, _x12, _x13) { + return _ref17.apply(this, arguments); }; })(); let hardlinkBulk = exports.hardlinkBulk = (() => { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { + var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { const events = { onStart: _events && _events.onStart || noop, onProgress: _events && _events.onProgress || noop, @@ -666,16 +1025,16 @@ let hardlinkBulk = exports.hardlinkBulk = (() => { const fileActions = actions.link; yield (_promise || _load_promise()).queue(fileActions, (() => { - var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { + var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { reporter.verbose(reporter.lang('verboseFileLink', data.src, data.dest)); if (data.removeDest) { - yield unlink(data.dest); + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(data.dest); } yield link(data.src, data.dest); }); - return function (_x24) { - return _ref10.apply(this, arguments); + return function (_x18) { + return _ref20.apply(this, arguments); }; })(), CONCURRENT_QUEUE_ITEMS); @@ -688,14 +1047,27 @@ let hardlinkBulk = exports.hardlinkBulk = (() => { }); }); - return function hardlinkBulk(_x21, _x22, _x23) { - return _ref9.apply(this, arguments); + return function hardlinkBulk(_x15, _x16, _x17) { + return _ref19.apply(this, arguments); }; })(); let readFileAny = exports.readFileAny = (() => { - var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) { - for (const file of files) { + var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) { + for (var _iterator13 = files, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { + var _ref22; + + if (_isArray13) { + if (_i13 >= _iterator13.length) break; + _ref22 = _iterator13[_i13++]; + } else { + _i13 = _iterator13.next(); + if (_i13.done) break; + _ref22 = _i13.value; + } + + const file = _ref22; + if (yield exists(file)) { return readFile(file); } @@ -703,23 +1075,23 @@ let readFileAny = exports.readFileAny = (() => { return null; }); - return function readFileAny(_x25) { - return _ref11.apply(this, arguments); + return function readFileAny(_x19) { + return _ref21.apply(this, arguments); }; })(); let readJson = exports.readJson = (() => { - var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { + var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { return (yield readJsonAndFile(loc)).object; }); - return function readJson(_x26) { - return _ref12.apply(this, arguments); + return function readJson(_x20) { + return _ref23.apply(this, arguments); }; })(); let readJsonAndFile = exports.readJsonAndFile = (() => { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { + var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { const file = yield readFile(loc); try { return { @@ -732,13 +1104,13 @@ let readJsonAndFile = exports.readJsonAndFile = (() => { } }); - return function readJsonAndFile(_x27) { - return _ref13.apply(this, arguments); + return function readJsonAndFile(_x21) { + return _ref24.apply(this, arguments); }; })(); let find = exports.find = (() => { - var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) { + var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) { const parts = dir.split((_path || _load_path()).default.sep); while (parts.length) { @@ -754,65 +1126,53 @@ let find = exports.find = (() => { return false; }); - return function find(_x28, _x29) { - return _ref14.apply(this, arguments); + return function find(_x22, _x23) { + return _ref25.apply(this, arguments); }; })(); let symlink = exports.symlink = (() => { - var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) { + var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) { + if (process.platform !== 'win32') { + // use relative paths otherwise which will be retained if the directory is moved + src = (_path || _load_path()).default.relative((_path || _load_path()).default.dirname(dest), src); + // When path.relative returns an empty string for the current directory, we should instead use + // '.', which is a valid fs.symlink target. + src = src || '.'; + } + try { const stats = yield lstat(dest); - - if (stats.isSymbolicLink() && (yield exists(dest))) { - const resolved = yield realpath(dest); + if (stats.isSymbolicLink()) { + const resolved = dest; if (resolved === src) { return; } } - - yield unlink(dest); } catch (err) { if (err.code !== 'ENOENT') { throw err; } } - try { - if (process.platform === 'win32') { - // use directory junctions if possible on win32, this requires absolute paths - yield fsSymlink(src, dest, 'junction'); - } else { - // use relative paths otherwise which will be retained if the directory is moved - let relative; - if (yield exists(src)) { - relative = (_path || _load_path()).default.relative((_fs || _load_fs()).default.realpathSync((_path || _load_path()).default.dirname(dest)), (_fs || _load_fs()).default.realpathSync(src)); - } else { - relative = (_path || _load_path()).default.relative((_path || _load_path()).default.dirname(dest), src); - } - // When path.relative returns an empty string for the current directory, we should instead use - // '.', which is a valid fs.symlink target. - yield fsSymlink(relative || '.', dest); - } - } catch (err) { - if (err.code === 'EEXIST') { - // race condition - yield symlink(src, dest); - } else { - throw err; - } + // We use rimraf for unlink which never throws an ENOENT on missing target + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); + + if (process.platform === 'win32') { + // use directory junctions if possible on win32, this requires absolute paths + yield fsSymlink(src, dest, 'junction'); + } else { + yield fsSymlink(src, dest); } }); - return function symlink(_x30, _x31) { - return _ref15.apply(this, arguments); + return function symlink(_x24, _x25) { + return _ref26.apply(this, arguments); }; })(); let walk = exports.walk = (() => { - var _ref16 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir) { - let ignoreBasenames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Set(); - + var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir, ignoreBasenames = new Set()) { let files = []; let filenames = yield readdir(dir); @@ -822,7 +1182,20 @@ let walk = exports.walk = (() => { }); } - for (const name of filenames) { + for (var _iterator14 = filenames, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { + var _ref28; + + if (_isArray14) { + if (_i14 >= _iterator14.length) break; + _ref28 = _iterator14[_i14++]; + } else { + _i14 = _iterator14.next(); + if (_i14.done) break; + _ref28 = _i14.value; + } + + const name = _ref28; + const relative = relativeDir ? (_path || _load_path()).default.join(relativeDir, name) : name; const loc = (_path || _load_path()).default.join(dir, name); const stat = yield lstat(loc); @@ -842,13 +1215,13 @@ let walk = exports.walk = (() => { return files; }); - return function walk(_x32, _x33) { - return _ref16.apply(this, arguments); + return function walk(_x26, _x27) { + return _ref27.apply(this, arguments); }; })(); let getFileSizeOnDisk = exports.getFileSizeOnDisk = (() => { - var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { + var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { const stat = yield lstat(loc); const size = stat.size, blockSize = stat.blksize; @@ -857,13 +1230,13 @@ let getFileSizeOnDisk = exports.getFileSizeOnDisk = (() => { return Math.ceil(size / blockSize) * blockSize; }); - return function getFileSizeOnDisk(_x35) { - return _ref17.apply(this, arguments); + return function getFileSizeOnDisk(_x28) { + return _ref29.apply(this, arguments); }; })(); let getEolFromFile = (() => { - var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) { + var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) { if (!(yield exists(path))) { return undefined; } @@ -881,13 +1254,13 @@ let getEolFromFile = (() => { return undefined; }); - return function getEolFromFile(_x36) { - return _ref18.apply(this, arguments); + return function getEolFromFile(_x29) { + return _ref30.apply(this, arguments); }; })(); let writeFilePreservingEol = exports.writeFilePreservingEol = (() => { - var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) { + var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) { const eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL; if (eol !== '\n') { data = data.replace(/\n/g, eol); @@ -895,13 +1268,13 @@ let writeFilePreservingEol = exports.writeFilePreservingEol = (() => { yield writeFile(path, data); }); - return function writeFilePreservingEol(_x37, _x38) { - return _ref19.apply(this, arguments); + return function writeFilePreservingEol(_x30, _x31) { + return _ref31.apply(this, arguments); }; })(); let hardlinksWork = exports.hardlinksWork = (() => { - var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { + var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { const filename = 'test-file' + Math.random(); const file = (_path || _load_path()).default.join(dir, filename); const fileLink = (_path || _load_path()).default.join(dir, filename + '-link'); @@ -911,14 +1284,14 @@ let hardlinksWork = exports.hardlinksWork = (() => { } catch (err) { return false; } finally { - yield unlink(file); - yield unlink(fileLink); + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file); + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(fileLink); } return true; }); - return function hardlinksWork(_x39) { - return _ref20.apply(this, arguments); + return function hardlinksWork(_x32) { + return _ref32.apply(this, arguments); }; })(); @@ -926,62 +1299,70 @@ let hardlinksWork = exports.hardlinksWork = (() => { let makeTempDir = exports.makeTempDir = (() => { - var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) { + var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) { const dir = (_path || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ''}-${Date.now()}-${Math.random()}`); - yield unlink(dir); + yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir); yield mkdirp(dir); return dir; }); - return function makeTempDir(_x40) { - return _ref21.apply(this, arguments); + return function makeTempDir(_x33) { + return _ref33.apply(this, arguments); }; })(); let readFirstAvailableStream = exports.readFirstAvailableStream = (() => { - var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { - var _this = this; + var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { + for (var _iterator15 = paths, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { + var _ref35; - let stream; - const triedPaths = []; - for (const tarballPath of paths) { - if (tarballPath) { - try { - // We need the weird `await new Promise()` construct for `createReadStream` because - // it always returns a ReadStream object but immediately triggers an `error` event - // on it if it fails to open the file, instead of throwing an exception. If this event - // is not handled, it crashes node. A saner way to handle this with multiple tries is - // the following construct. - stream = yield new Promise(function (resolve, reject) { - const maybeStream = (_fs || _load_fs()).default.createReadStream(tarballPath); - maybeStream.on('error', reject).on('readable', resolve.bind(_this, maybeStream)); - }); - break; - } catch (err) { - // Try the next one - triedPaths.push(tarballPath); - } + if (_isArray15) { + if (_i15 >= _iterator15.length) break; + _ref35 = _iterator15[_i15++]; + } else { + _i15 = _iterator15.next(); + if (_i15.done) break; + _ref35 = _i15.value; + } + + const path = _ref35; + + try { + const fd = yield open(path, 'r'); + return (_fs || _load_fs()).default.createReadStream(path, { fd }); + } catch (err) { + // Try the next one } } - - return { stream, triedPaths }; + return null; }); - return function readFirstAvailableStream(_x41) { - return _ref22.apply(this, arguments); + return function readFirstAvailableStream(_x34) { + return _ref34.apply(this, arguments); }; })(); let getFirstSuitableFolder = exports.getFirstSuitableFolder = (() => { - var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { - let mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : constants.W_OK | constants.X_OK; - + var _ref36 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths, mode = constants.W_OK | constants.X_OK) { const result = { skipped: [], folder: null }; - for (const folder of paths) { + for (var _iterator16 = paths, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) { + var _ref37; + + if (_isArray16) { + if (_i16 >= _iterator16.length) break; + _ref37 = _iterator16[_i16++]; + } else { + _i16 = _iterator16.next(); + if (_i16.done) break; + _ref37 = _i16.value; + } + + const folder = _ref37; + try { yield mkdirp(folder); yield access(folder, mode); @@ -999,8 +1380,8 @@ let getFirstSuitableFolder = exports.getFirstSuitableFolder = (() => { return result; }); - return function getFirstSuitableFolder(_x42) { - return _ref23.apply(this, arguments); + return function getFirstSuitableFolder(_x35) { + return _ref36.apply(this, arguments); }; })(); @@ -1018,13 +1399,13 @@ function _load_fs() { var _glob; function _load_glob() { - return _glob = _interopRequireDefault(__webpack_require__(71)); + return _glob = _interopRequireDefault(__webpack_require__(99)); } var _os; function _load_os() { - return _os = _interopRequireDefault(__webpack_require__(41)); + return _os = _interopRequireDefault(__webpack_require__(46)); } var _path; @@ -1036,25 +1417,31 @@ function _load_path() { var _blockingQueue; function _load_blockingQueue() { - return _blockingQueue = _interopRequireDefault(__webpack_require__(80)); + return _blockingQueue = _interopRequireDefault(__webpack_require__(110)); } var _promise; function _load_promise() { - return _promise = _interopRequireWildcard(__webpack_require__(53)); + return _promise = _interopRequireWildcard(__webpack_require__(50)); } var _promise2; function _load_promise2() { - return _promise2 = __webpack_require__(53); + return _promise2 = __webpack_require__(50); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(18)); + return _map = _interopRequireDefault(__webpack_require__(29)); +} + +var _fsNormalized; + +function _load_fsNormalized() { + return _fsNormalized = __webpack_require__(218); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -1070,6 +1457,7 @@ const constants = exports.constants = typeof (_fs || _load_fs()).default.constan const lockQueue = exports.lockQueue = new (_blockingQueue || _load_blockingQueue()).default('fs lock'); const readFileBuffer = exports.readFileBuffer = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readFile); +const open = exports.open = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.open); const writeFile = exports.writeFile = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.writeFile); const readlink = exports.readlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readlink); const realpath = exports.realpath = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.realpath); @@ -1077,105 +1465,30 @@ const readdir = exports.readdir = (0, (_promise2 || _load_promise2()).promisify) const rename = exports.rename = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.rename); const access = exports.access = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.access); const stat = exports.stat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.stat); -const unlink = exports.unlink = (0, (_promise2 || _load_promise2()).promisify)(__webpack_require__(227)); -const mkdirp = exports.mkdirp = (0, (_promise2 || _load_promise2()).promisify)(__webpack_require__(115)); +const mkdirp = exports.mkdirp = (0, (_promise2 || _load_promise2()).promisify)(__webpack_require__(145)); const exists = exports.exists = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.exists, true); const lstat = exports.lstat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.lstat); const chmod = exports.chmod = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.chmod); const link = exports.link = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.link); const glob = exports.glob = (0, (_promise2 || _load_promise2()).promisify)((_glob || _load_glob()).default); +exports.unlink = (_fsNormalized || _load_fsNormalized()).unlink; // fs.copyFile uses the native file copying instructions on the system, performing much better // than any JS-based solution and consumes fewer resources. Repeated testing to fine tune the // concurrency level revealed 128 as the sweet spot on a quad-core, 16 CPU Intel system with SSD. + const CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4; -const open = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.open); -const close = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.close); -const write = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.write); -const futimes = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.futimes); -const copyFile = (_fs || _load_fs()).default.copyFile ? // Don't use `promisify` to avoid passing the last, argument `data`, to the native method -(src, dest, flags, data) => new Promise((resolve, reject) => (_fs || _load_fs()).default.copyFile(src, dest, flags, err => err ? reject(err) : resolve(err))) : (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest, flags, data) { - // Use open -> write -> futimes -> close sequence to avoid opening the file twice: - // one with writeFile and one with utimes - const fd = yield open(dest, 'w', data.mode); - try { - const buffer = yield readFileBuffer(src); - yield write(fd, buffer, 0, buffer.length); - yield futimes(fd, data.atime, data.mtime); - } finally { - yield close(fd); - } - }); - - return function (_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -})(); const fsSymlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.symlink); -const invariant = __webpack_require__(6); -const stripBOM = __webpack_require__(120); +const invariant = __webpack_require__(9); +const stripBOM = __webpack_require__(160); const noop = () => {}; -const fileDatesEqual = exports.fileDatesEqual = (a, b) => { - const aTime = a.getTime(); - const bTime = b.getTime(); - - if (process.platform !== 'win32') { - return aTime === bTime; - } - - // See https://github.com/nodejs/node/pull/12607 - // Submillisecond times from stat and utimes are truncated on Windows, - // causing a file with mtime 8.0079998 and 8.0081144 to become 8.007 and 8.008 - // and making it impossible to update these files to their correct timestamps. - if (Math.abs(aTime - bTime) <= 1) { - return true; - } - - const aTimeSec = Math.floor(aTime / 1000); - const bTimeSec = Math.floor(bTime / 1000); - - // See https://github.com/nodejs/node/issues/2069 - // Some versions of Node on windows zero the milliseconds when utime is used - // So if any of the time has a milliseconds part of zero we suspect that the - // bug is present and compare only seconds. - if (aTime - aTimeSec * 1000 === 0 || bTime - bTimeSec * 1000 === 0) { - return aTimeSec === bTimeSec; - } - - return aTime === bTime; -}; - function copy(src, dest, reporter) { return copyBulk([{ src, dest }], reporter); } -/** - * Unlinks the destination to force a recreation. This is needed on case-insensitive file systems - * to force the correct naming when the filename has changed only in charater-casing. (Jest -> jest). - * It also calls a cleanup function once it is done. - * - * `data` contains target file attributes like mode, atime and mtime. Built-in copyFile copies these - * automatically but our polyfill needs the do this manually, thus needs the info. - */ -const safeCopyFile = (() => { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data, cleanup) { - try { - yield unlink(data.dest); - yield copyFile(data.src, data.dest, 0, data); - } finally { - cleanup(); - } - }); - - return function safeCopyFile(_x15, _x16) { - return _ref6.apply(this, arguments); - }; -})(); - function _readFile(loc, encoding) { return new Promise((resolve, reject) => { (_fs || _load_fs()).default.readFile(loc, encoding, function (err, content) { @@ -1200,8 +1513,8 @@ function normalizeOS(body) { return body.replace(/\r\n/g, '\n'); } -const cr = new Buffer('\r', 'utf8')[0]; -const lf = new Buffer('\n', 'utf8')[0]; +const cr = '\r'.charCodeAt(0); +const lf = '\n'.charCodeAt(0); /***/ }), /* 5 */ @@ -1213,14 +1526,452 @@ module.exports = require("fs"); /* 6 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +class MessageError extends Error { + constructor(msg, code) { + super(msg); + this.code = code; + } + +} + +exports.MessageError = MessageError; +class ProcessSpawnError extends MessageError { + constructor(msg, code, process) { + super(msg, code); + this.process = process; + } + +} + +exports.ProcessSpawnError = ProcessSpawnError; +class SecurityError extends MessageError {} + +exports.SecurityError = SecurityError; +class ProcessTermError extends MessageError {} + +exports.ProcessTermError = ProcessTermError; +class ResponseError extends Error { + constructor(msg, responseCode) { + super(msg); + this.responseCode = responseCode; + } + +} + +exports.ResponseError = ResponseError; +class OneTimePasswordError extends Error {} +exports.OneTimePasswordError = OneTimePasswordError; + +/***/ }), +/* 7 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscriber; }); +/* unused harmony export SafeSubscriber */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isFunction__ = __webpack_require__(154); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observer__ = __webpack_require__(420); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__ = __webpack_require__(321); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__config__ = __webpack_require__(185); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_hostReportError__ = __webpack_require__(323); +/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */ + + + + + + + +var Subscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; + _this._parentSubscription = null; + switch (arguments.length) { + case 0: + _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]; + break; + case 1: + if (!destinationOrNext) { + _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]; + break; + } + if (typeof destinationOrNext === 'object') { + if (destinationOrNext instanceof Subscriber) { + _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable; + _this.destination = destinationOrNext; + destinationOrNext.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[__WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__["a" /* 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; + this._parentSubscription = null; + return this; + }; + return Subscriber; +}(__WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */])); + +var SafeSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SafeSubscriber, _super); + function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) { + var _this = _super.call(this) || this; + _this._parentSubscriber = _parentSubscriber; + var next; + var context = _this; + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* isFunction */])(observerOrNext)) { + next = observerOrNext; + } + else if (observerOrNext) { + next = observerOrNext.next; + error = observerOrNext.error; + complete = observerOrNext.complete; + if (observerOrNext !== __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]) { + context = Object.create(observerOrNext); + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* 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 (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* 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 = __WEBPACK_IMPORTED_MODULE_5__config__["a" /* 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; + } + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); + } + else { + if (useDeprecatedSynchronousErrorHandling) { + _parentSubscriber.syncErrorValue = err; + _parentSubscriber.syncErrorThrown = true; + } + else { + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* 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 (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* 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 (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { + throw err; + } + else { + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); + } + } + }; + SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) { + if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { + throw new Error('bad call'); + } + try { + fn.call(this._context, value); + } + catch (err) { + if (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { + parent.syncErrorValue = err; + parent.syncErrorThrown = true; + return true; + } + else { + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* 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)); + +//# sourceMappingURL=Subscriber.js.map + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getPathKey = getPathKey; +const os = __webpack_require__(46); +const path = __webpack_require__(0); +const userHome = __webpack_require__(67).default; + +var _require = __webpack_require__(225); + +const getCacheDir = _require.getCacheDir, + getConfigDir = _require.getConfigDir, + getDataDir = _require.getDataDir; + +const isWebpackBundle = __webpack_require__(278); + +const DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies']; +const OWNED_DEPENDENCY_TYPES = exports.OWNED_DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies']; + +const RESOLUTIONS = exports.RESOLUTIONS = 'resolutions'; +const MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS, ...DEPENDENCY_TYPES]; + +const SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0'; + +const YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com'; +const NPM_REGISTRY_RE = exports.NPM_REGISTRY_RE = /https?:\/\/registry\.npmjs\.org/g; + +const YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/'; +const YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh'; +const YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi'; + +const SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version'; + +// cache version, bump whenever we make backwards incompatible changes +const CACHE_VERSION = exports.CACHE_VERSION = 6; + +// lockfile version, bump whenever we make backwards incompatible changes +const LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1; + +// max amount of network requests to perform concurrently +const NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8; + +// HTTP timeout used when downloading packages +const NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds + +// max amount of child processes to execute concurrently +const CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5; + +const REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid']; + +function getPreferredCacheDirectories() { + const preferredCacheDirectories = [getCacheDir()]; + + if (process.getuid) { + // $FlowFixMe: process.getuid exists, dammit + preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache-${process.getuid()}`)); + } + + preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache`)); + + return preferredCacheDirectories; +} + +const PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories(); +const CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getConfigDir(); +const DATA_DIRECTORY = exports.DATA_DIRECTORY = getDataDir(); +const LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(DATA_DIRECTORY, 'link'); +const GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(DATA_DIRECTORY, 'global'); + +const NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath; +const YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath(); + +// Webpack needs to be configured with node.__dirname/__filename = false +function getYarnBinPath() { + if (isWebpackBundle) { + return __filename; + } else { + return path.join(__dirname, '..', 'bin', 'yarn.js'); + } +} + +const NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules'; +const NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json'; + +const PNP_FILENAME = exports.PNP_FILENAME = '.pnp.js'; + +const POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`; +const FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn'); + +const META_FOLDER = exports.META_FOLDER = '.yarn-meta'; +const INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity'; +const LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock'; +const METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json'; +const TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz'; +const CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean'; + +const NPM_LOCK_FILENAME = exports.NPM_LOCK_FILENAME = 'package-lock.json'; +const NPM_SHRINKWRAP_FILENAME = exports.NPM_SHRINKWRAP_FILENAME = 'npm-shrinkwrap.json'; + +const DEFAULT_INDENT = exports.DEFAULT_INDENT = ' '; +const SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997; +const SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance'; + +const ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env); + +function getPathKey(platform, env) { + let pathKey = 'PATH'; + + // windows calls its path "Path" usually, but this is not guaranteed. + if (platform === 'win32') { + pathKey = 'Path'; + + for (const key in env) { + if (key.toLowerCase() === 'path') { + pathKey = key; + } + } + } + + return pathKey; +} + +const VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = { + major: 'red', + premajor: 'red', + minor: 'yellow', + preminor: 'yellow', + patch: 'green', + prepatch: 'green', + prerelease: 'red', + unchanged: 'white', + unknown: 'red' +}; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + "use strict"; /** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. + * Copyright (c) 2013-present, Facebook, Inc. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ @@ -1269,172 +2020,6 @@ var invariant = function(condition, format, a, b, c, d, e, f) { module.exports = invariant; -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getPathKey = getPathKey; -const os = __webpack_require__(41); -const path = __webpack_require__(0); -const userHome = __webpack_require__(62).default; -const isWebpackBundle = __webpack_require__(218); - -const DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies']; -const RESOLUTIONS = exports.RESOLUTIONS = 'resolutions'; -const MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS, ...DEPENDENCY_TYPES]; - -const SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0'; - -const YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com'; - -const YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/'; -const YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh'; -const YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi'; - -const SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version'; -const SELF_UPDATE_TARBALL_URL = exports.SELF_UPDATE_TARBALL_URL = 'https://yarnpkg.com/latest.tar.gz'; -const SELF_UPDATE_DOWNLOAD_FOLDER = exports.SELF_UPDATE_DOWNLOAD_FOLDER = 'updates'; - -// cache version, bump whenever we make backwards incompatible changes -const CACHE_VERSION = exports.CACHE_VERSION = 1; - -// lockfile version, bump whenever we make backwards incompatible changes -const LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1; - -// max amount of network requests to perform concurrently -const NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8; - -// HTTP timeout used when downloading packages -const NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds - -// max amount of child processes to execute concurrently -const CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5; - -const REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid']; - -function getDirectory(category) { - // use %LOCALAPPDATA%/Yarn on Windows - if (process.platform === 'win32' && process.env.LOCALAPPDATA) { - return path.join(process.env.LOCALAPPDATA, 'Yarn', category); - } - - // otherwise use ~/.{category}/yarn - return path.join(userHome, `.${category}`, 'yarn'); -} - -function getPreferredCacheDirectories() { - const preferredCacheDirectories = []; - - if (process.platform === 'darwin') { - preferredCacheDirectories.push(path.join(userHome, 'Library', 'Caches', 'Yarn')); - } else { - preferredCacheDirectories.push(getDirectory('cache')); - } - - if (process.getuid) { - // $FlowFixMe: process.getuid exists, dammit - preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache-${process.getuid()}`)); - } - - preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache`)); - - return preferredCacheDirectories; -} - -const PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories(); -const CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getDirectory('config'); -const LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(CONFIG_DIRECTORY, 'link'); -const GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(CONFIG_DIRECTORY, 'global'); - -const NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath; -const YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath(); - -// Webpack needs to be configured with node.__dirname/__filename = false -function getYarnBinPath() { - if (isWebpackBundle) { - return __filename; - } else { - return path.join(__dirname, '..', 'bin', 'yarn.js'); - } -} - -const NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules'; -const NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json'; - -const POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`; -const FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn'); - -const META_FOLDER = exports.META_FOLDER = '.yarn-meta'; -const INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity'; -const LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock'; -const METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json'; -const TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz'; -const CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean'; -const ACCESS_FILENAME = exports.ACCESS_FILENAME = '.yarn-access'; - -const DEFAULT_INDENT = exports.DEFAULT_INDENT = ' '; -const SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997; -const SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance'; - -const ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env); - -function getPathKey(platform, env) { - let pathKey = 'PATH'; - - // windows calls its path "Path" usually, but this is not guaranteed. - if (platform === 'win32') { - pathKey = 'Path'; - - for (const key in env) { - if (key.toLowerCase() === 'path') { - pathKey = key; - } - } - } - - return pathKey; -} - -const VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = { - major: 'red', - premajor: 'red', - minor: 'yellow', - preminor: 'yellow', - patch: 'green', - prepatch: 'green', - prerelease: 'red', - unchanged: 'white', - unknown: 'red' -}; - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - -module.exports = require("crypto"); - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -var store = __webpack_require__(104)('wks') - , uid = __webpack_require__(107) - , Symbol = __webpack_require__(13).Symbol - , USE_SYMBOL = typeof Symbol == 'function'; - -var $exports = module.exports = function(name){ - return store[name] || (store[name] = - USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); -}; - -$exports.store = store; - /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { @@ -1442,109 +2027,350 @@ $exports.store = store; "use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.sortAlpha = sortAlpha; -exports.entries = entries; -exports.removePrefix = removePrefix; -exports.removeSuffix = removeSuffix; -exports.addSuffix = addSuffix; -exports.hyphenate = hyphenate; -exports.camelCase = camelCase; -exports.compareSortedArrays = compareSortedArrays; -exports.sleep = sleep; -const _camelCase = __webpack_require__(177); +var YAMLException = __webpack_require__(54); -function sortAlpha(a, b) { - // sort alphabetically in a deterministic way - const shortLen = Math.min(a.length, b.length); - for (let i = 0; i < shortLen; i++) { - const aChar = a.charCodeAt(i); - const bChar = b.charCodeAt(i); - if (aChar !== bChar) { - return aChar - bChar; +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); } - } - return a.length - b.length; -} - -function entries(obj) { - const entries = []; - if (obj) { - for (const key in obj) { - entries.push([key, obj[key]]); - } - } - return entries; -} - -function removePrefix(pattern, prefix) { - if (pattern.startsWith(prefix)) { - pattern = pattern.slice(prefix.length); - } - - return pattern; -} - -function removeSuffix(pattern, suffix) { - if (pattern.endsWith(suffix)) { - return pattern.slice(0, -suffix.length); - } - - return pattern; -} - -function addSuffix(pattern, suffix) { - if (!pattern.endsWith(suffix)) { - return pattern + suffix; - } - - return pattern; -} - -function hyphenate(str) { - return str.replace(/[A-Z]/g, match => { - return '-' + match.charAt(0).toLowerCase(); }); -} -function camelCase(str) { - if (/[A-Z]/.test(str)) { - return null; - } else { - return _camelCase(str); + // TODO: Add tag format check. + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); } } -function compareSortedArrays(array1, array2) { - if (array1.length !== array2.length) { - return false; - } - for (let i = 0, len = array1.length; i < len; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - return true; -} +module.exports = Type; -function sleep(ms) { - return new Promise(resolve => { - setTimeout(resolve, ms); - }); -} /***/ }), /* 11 */ +/***/ (function(module, exports) { + +module.exports = require("crypto"); + +/***/ }), +/* 12 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Observable; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_canReportError__ = __webpack_require__(322); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__ = __webpack_require__(932); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__ = __webpack_require__(117); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_pipe__ = __webpack_require__(324); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config__ = __webpack_require__(185); +/** PURE_IMPORTS_START _util_canReportError,_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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__["a" /* toSubscriber */])(observerOrNext, error, complete); + if (operator) { + operator.call(sink, this.source); + } + else { + sink.add(this.source || (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ? + this._subscribe(sink) : + this._trySubscribe(sink)); + } + if (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* 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 (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { + sink.syncErrorThrown = true; + sink.syncErrorValue = err; + } + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_canReportError__["a" /* canReportError */])(sink)) { + sink.error(err); + } + else { + console.warn(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[__WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__["a" /* 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["b" /* 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 = __WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].Promise || Promise; + } + if (!promiseCtor) { + throw new Error('no Promise impl found'); + } + return promiseCtor; +} +//# sourceMappingURL=Observable.js.map + + +/***/ }), +/* 13 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return OuterSubscriber; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ + + +var OuterSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); + +//# sourceMappingURL=OuterSubscriber.js.map + + +/***/ }), +/* 14 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = subscribeToResult; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__ = __webpack_require__(84); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__subscribeTo__ = __webpack_require__(446); +/** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo PURE_IMPORTS_END */ + + +function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, destination) { + if (destination === void 0) { + destination = new __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__["a" /* InnerSubscriber */](outerSubscriber, outerValue, outerIndex); + } + if (destination.closed) { + return; + } + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__subscribeTo__["a" /* subscribeTo */])(result)(destination); +} +//# sourceMappingURL=subscribeToResult.js.map + + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* eslint-disable node/no-deprecated-api */ + + + +var buffer = __webpack_require__(64) +var Buffer = buffer.Buffer + +var safer = {} + +var key + +for (key in buffer) { + if (!buffer.hasOwnProperty(key)) continue + if (key === 'SlowBuffer' || key === 'Buffer') continue + safer[key] = buffer[key] +} + +var Safer = safer.Buffer = {} +for (key in Buffer) { + if (!Buffer.hasOwnProperty(key)) continue + if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue + Safer[key] = Buffer[key] +} + +safer.Buffer.prototype = Buffer.prototype + +if (!Safer.from || Safer.from === Uint8Array.from) { + Safer.from = function (value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) + } + if (value && typeof value.length === 'undefined') { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) + } + return Buffer(value, encodingOrOffset, length) + } +} + +if (!Safer.alloc) { + Safer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) + } + if (size < 0 || size >= 2 * (1 << 30)) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + var buf = Buffer(size) + if (!fill || fill.length === 0) { + buf.fill(0) + } else if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + return buf + } +} + +if (!safer.kStringMaxLength) { + try { + safer.kStringMaxLength = process.binding('buffer').kStringMaxLength + } catch (e) { + // we can't determine kStringMaxLength in environments where process.binding + // is unsupported, so let's not set it + } +} + +if (!safer.constants) { + safer.constants = { + MAX_LENGTH: safer.kMaxLength + } + if (safer.kStringMaxLength) { + safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength + } +} + +module.exports = safer + + +/***/ }), +/* 16 */ /***/ (function(module, exports, __webpack_require__) { // Copyright (c) 2012, Mark Cavage. All rights reserved. // Copyright 2015 Joyent, Inc. -var assert = __webpack_require__(20); -var Stream = __webpack_require__(25).Stream; -var util = __webpack_require__(2); +var assert = __webpack_require__(28); +var Stream = __webpack_require__(23).Stream; +var util = __webpack_require__(3); ///--- Globals @@ -1753,7 +2579,126 @@ module.exports = _setExports(process.env.NODE_NDEBUG); /***/ }), -/* 12 */ +/* 17 */ +/***/ (function(module, exports) { + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sortAlpha = sortAlpha; +exports.sortOptionsByFlags = sortOptionsByFlags; +exports.entries = entries; +exports.removePrefix = removePrefix; +exports.removeSuffix = removeSuffix; +exports.addSuffix = addSuffix; +exports.hyphenate = hyphenate; +exports.camelCase = camelCase; +exports.compareSortedArrays = compareSortedArrays; +exports.sleep = sleep; +const _camelCase = __webpack_require__(230); + +function sortAlpha(a, b) { + // sort alphabetically in a deterministic way + const shortLen = Math.min(a.length, b.length); + for (let i = 0; i < shortLen; i++) { + const aChar = a.charCodeAt(i); + const bChar = b.charCodeAt(i); + if (aChar !== bChar) { + return aChar - bChar; + } + } + return a.length - b.length; +} + +function sortOptionsByFlags(a, b) { + const aOpt = a.flags.replace(/-/g, ''); + const bOpt = b.flags.replace(/-/g, ''); + return sortAlpha(aOpt, bOpt); +} + +function entries(obj) { + const entries = []; + if (obj) { + for (const key in obj) { + entries.push([key, obj[key]]); + } + } + return entries; +} + +function removePrefix(pattern, prefix) { + if (pattern.startsWith(prefix)) { + pattern = pattern.slice(prefix.length); + } + + return pattern; +} + +function removeSuffix(pattern, suffix) { + if (pattern.endsWith(suffix)) { + return pattern.slice(0, -suffix.length); + } + + return pattern; +} + +function addSuffix(pattern, suffix) { + if (!pattern.endsWith(suffix)) { + return pattern + suffix; + } + + return pattern; +} + +function hyphenate(str) { + return str.replace(/[A-Z]/g, match => { + return '-' + match.charAt(0).toLowerCase(); + }); +} + +function camelCase(str) { + if (/[A-Z]/.test(str)) { + return null; + } else { + return _camelCase(str); + } +} + +function compareSortedArrays(array1, array2) { + if (array1.length !== array2.length) { + return false; + } + for (let i = 0, len = array1.length; i < len; i++) { + if (array1[i] !== array2[i]) { + return false; + } + } + return true; +} + +function sleep(ms) { + return new Promise(resolve => { + setTimeout(resolve, ms); + }); +} + +/***/ }), +/* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1767,18 +2712,18 @@ exports.stringify = exports.parse = undefined; var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } var _parse; function _load_parse() { - return _parse = __webpack_require__(77); + return _parse = __webpack_require__(105); } Object.defineProperty(exports, 'parse', { enumerable: true, - get: function () { + get: function get() { return _interopRequireDefault(_parse || _load_parse()).default; } }); @@ -1786,12 +2731,12 @@ Object.defineProperty(exports, 'parse', { var _stringify; function _load_stringify() { - return _stringify = __webpack_require__(154); + return _stringify = __webpack_require__(199); } Object.defineProperty(exports, 'stringify', { enumerable: true, - get: function () { + get: function get() { return _interopRequireDefault(_stringify || _load_stringify()).default; } }); @@ -1801,25 +2746,25 @@ exports.explodeEntry = explodeEntry; var _misc; function _load_misc() { - return _misc = __webpack_require__(10); + return _misc = __webpack_require__(18); } var _normalizePattern; function _load_normalizePattern() { - return _normalizePattern = __webpack_require__(31); + return _normalizePattern = __webpack_require__(37); } var _parse2; function _load_parse2() { - return _parse2 = _interopRequireDefault(__webpack_require__(77)); + return _parse2 = _interopRequireDefault(__webpack_require__(105)); } var _constants; function _load_constants() { - return _constants = __webpack_require__(7); + return _constants = __webpack_require__(8); } var _fs; @@ -1832,9 +2777,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const invariant = __webpack_require__(6); +const invariant = __webpack_require__(9); const path = __webpack_require__(0); +const ssri = __webpack_require__(65); function getName(pattern) { return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name; @@ -1848,9 +2794,16 @@ function keyForRemote(remote) { return remote.resolved || (remote.reference && remote.hash ? `${remote.reference}#${remote.hash}` : null); } +function serializeIntegrity(integrity) { + // We need this because `Integrity.toString()` does not use sorting to ensure a stable string output + // See https://git.io/vx2Hy + return integrity.toString().split(' ').sort().join(' '); +} + function implodeEntry(pattern, obj) { const inferredName = getName(pattern); - return { + const integrity = obj.integrity ? serializeIntegrity(obj.integrity) : ''; + const imploded = { name: inferredName === obj.name ? undefined : obj.name, version: obj.version, uid: obj.uid === obj.version ? undefined : obj.uid, @@ -1858,8 +2811,13 @@ function implodeEntry(pattern, obj) { registry: obj.registry === 'npm' ? undefined : obj.registry, dependencies: blankObjectUndefined(obj.dependencies), optionalDependencies: blankObjectUndefined(obj.optionalDependencies), - permissions: blankObjectUndefined(obj.permissions) + permissions: blankObjectUndefined(obj.permissions), + prebuiltVariants: blankObjectUndefined(obj.prebuiltVariants) }; + if (integrity) { + imploded.integrity = integrity; + } + return imploded; } function explodeEntry(pattern, obj) { @@ -1869,17 +2827,15 @@ function explodeEntry(pattern, obj) { obj.permissions = obj.permissions || {}; obj.registry = obj.registry || 'npm'; obj.name = obj.name || getName(pattern); + const integrity = obj.integrity; + if (integrity && integrity.isIntegrity) { + obj.integrity = ssri.parse(integrity); + } return obj; } class Lockfile { - constructor() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - let cache = _ref.cache, - source = _ref.source, - parseResultType = _ref.parseResultType; - + constructor({ cache, source, parseResultType } = {}) { this.source = source || ''; this.cache = cache; this.parseResultType = parseResultType; @@ -1888,6 +2844,22 @@ class Lockfile { // source string if the `cache` was parsed + // if true, we're parsing an old yarn file and need to update integrity fields + hasEntriesExistWithoutIntegrity() { + if (!this.cache) { + return false; + } + + for (const key in this.cache) { + // $FlowFixMe - `this.cache` is clearly defined at this point + if (!/^.*@(file:|http)/.test(key) && this.cache[key] && !this.cache[key].integrity) { + return true; + } + } + + return false; + } + static fromDirectory(dir, reporter) { return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { // read the manifest in this directory @@ -1910,10 +2882,13 @@ class Lockfile { } lockfile = parseResult.object; - } else { - if (reporter) { - reporter.info(reporter.lang('noLockfileFound')); - } + } else if (reporter) { + reporter.info(reporter.lang('noLockfileFound')); + } + + if (lockfile && lockfile.__metadata) { + const lockfilev2 = lockfile; + lockfile = {}; } return new Lockfile({ cache: lockfile, source: rawLockfile, parseResultType: parseResult && parseResult.type }); @@ -1955,7 +2930,20 @@ class Lockfile { // ordering allows for consistency in lockfile when it is serialized const sortedPatternsKeys = Object.keys(patterns).sort((_misc || _load_misc()).sortAlpha); - for (const pattern of sortedPatternsKeys) { + for (var _iterator = sortedPatternsKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const pattern = _ref; + const pkg = patterns[pattern]; const remote = pkg._remote, ref = pkg._reference; @@ -1976,18 +2964,20 @@ class Lockfile { } continue; } - const obj = implodeEntry(pattern, { name: pkg.name, version: pkg.version, uid: pkg._uid, resolved: remote.resolved, + integrity: remote.integrity, registry: remote.registry, dependencies: pkg.dependencies, peerDependencies: pkg.peerDependencies, optionalDependencies: pkg.optionalDependencies, - permissions: ref.permissions + permissions: ref.permissions, + prebuiltVariants: pkg.prebuiltVariants }); + lockfile[pattern] = obj; if (remoteKey) { @@ -2001,22 +2991,24 @@ class Lockfile { exports.default = Lockfile; /***/ }), -/* 13 */ -/***/ (function(module, exports) { +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +var store = __webpack_require__(133)('wks'); +var uid = __webpack_require__(137); +var Symbol = __webpack_require__(17).Symbol; +var USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; -// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 -var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); -if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef /***/ }), -/* 14 */ -/***/ (function(module, exports) { - -module.exports = require("url"); - -/***/ }), -/* 15 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2024,84 +3016,28 @@ module.exports = require("url"); exports.__esModule = true; -var _isIterable2 = __webpack_require__(453); +var _assign = __webpack_require__(591); -var _isIterable3 = _interopRequireDefault(_isIterable2); - -var _getIterator2 = __webpack_require__(452); - -var _getIterator3 = _interopRequireDefault(_getIterator2); +var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -exports.default = function () { - function sliceIterator(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; +exports.default = _assign2.default || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; - try { - for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"]) _i["return"](); - } finally { - if (_d) throw _e; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; } } - - return _arr; } - return function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if ((0, _isIterable3.default)(Object(arr))) { - return sliceIterator(arr, i); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - }; -}(); - -/***/ }), -/* 16 */ -/***/ (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; + return target; }; - /***/ }), -/* 17 */ +/* 22 */ /***/ (function(module, exports) { exports = module.exports = SemVer; @@ -2127,6 +3063,9 @@ 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 = []; @@ -2262,6 +3201,15 @@ 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++; @@ -2669,7 +3617,7 @@ function patch(a, loose) { exports.compare = compare; function compare(a, b, loose) { - return new SemVer(a, loose).compare(b); + return new SemVer(a, loose).compare(new SemVer(b, loose)); } exports.compareLoose = compareLoose; @@ -2810,11 +3758,59 @@ Comparator.prototype.test = function(version) { 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) && range.loose === loose) - return range; + 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); @@ -2889,6 +3885,22 @@ Range.prototype.parseRange = function(range) { 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) { @@ -3193,20 +4205,42 @@ function satisfies(version, range, loose) { exports.maxSatisfying = maxSatisfying; function maxSatisfying(versions, range, loose) { - return versions.filter(function(version) { - return satisfies(version, range, loose); - }).sort(function(a, b) { - return rcompare(a, b, loose); - })[0] || null; + 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) { - return versions.filter(function(version) { - return satisfies(version, range, loose); - }).sort(function(a, b) { - return compare(a, b, loose); - })[0] || null; + 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; @@ -3308,41 +4342,190 @@ function prerelease(version, loose) { return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; } - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = nullify; -function nullify() { - let obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - if (Array.isArray(obj)) { - for (const item of obj) { - nullify(item); - } - } else if (obj !== null && typeof obj === 'object' || typeof obj === 'function') { - Object.setPrototypeOf(obj, null); - - // for..in can only be applied to 'object', not 'function' - if (typeof obj === 'object') { - for (const key in obj) { - nullify(obj[key]); - } - } - } - - return obj; +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')); +} + + /***/ }), -/* 19 */ +/* 23 */ +/***/ (function(module, exports) { + +module.exports = require("stream"); + +/***/ }), +/* 24 */ +/***/ (function(module, exports) { + +module.exports = require("url"); + +/***/ }), +/* 25 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isObject__ = __webpack_require__(444); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(154); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_tryCatch__ = __webpack_require__(56); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_errorObject__ = __webpack_require__(48); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__ = __webpack_require__(441); +/** 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 (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isFunction__["a" /* isFunction */])(_unsubscribe)) { + var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(_unsubscribe).call(this); + if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) { + hasErrors = true; + errors = errors || (__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */] ? + flattenUnsubscriptionErrors(__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e.errors) : [__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e]); + } + } + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isArray__["a" /* isArray */])(_subscriptions)) { + index = -1; + len = _subscriptions.length; + while (++index < len) { + var sub = _subscriptions[index]; + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isObject__["a" /* isObject */])(sub)) { + var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(sub.unsubscribe).call(sub); + if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) { + hasErrors = true; + errors = errors || []; + var err = __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e; + if (err instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) { + errors = errors.concat(flattenUnsubscriptionErrors(err.errors)); + } + else { + errors.push(err); + } + } + } + } + } + if (hasErrors) { + throw new __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* 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 __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) ? err.errors : err); }, []); +} +//# sourceMappingURL=Subscription.js.map + + +/***/ }), +/* 26 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. @@ -3351,18 +4534,32 @@ module.exports = { bufferSplit: bufferSplit, addRSAMissing: addRSAMissing, calculateDSAPublic: calculateDSAPublic, + calculateED25519Public: calculateED25519Public, + calculateX25519Public: calculateX25519Public, mpNormalize: mpNormalize, + mpDenormalize: mpDenormalize, ecNormalize: ecNormalize, countZeros: countZeros, assertCompatible: assertCompatible, isCompatible: isCompatible, opensslKeyDeriv: opensslKeyDeriv, - opensshCipherInfo: opensshCipherInfo + opensshCipherInfo: opensshCipherInfo, + publicFromPrivateECDSA: publicFromPrivateECDSA, + zeroPadToLength: zeroPadToLength, + writeBitString: writeBitString, + readBitString: readBitString }; -var assert = __webpack_require__(11); -var PrivateKey = __webpack_require__(24); -var crypto = __webpack_require__(8); +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; +var PrivateKey = __webpack_require__(33); +var Key = __webpack_require__(27); +var crypto = __webpack_require__(11); +var algs = __webpack_require__(32); +var asn1 = __webpack_require__(66); + +var ec, jsbn; +var nacl; var MAX_CLASS_DEPTH = 3; @@ -3435,7 +4632,7 @@ function opensslKeyDeriv(cipher, salt, passphrase, count) { salt = salt.slice(0, PKCS5_SALT_LEN); var D, D_prev, bufs; - var material = new Buffer(0); + var material = Buffer.alloc(0); while (material.length < clen.key + clen.iv) { bufs = []; if (D_prev) @@ -3519,18 +4716,59 @@ function ecNormalize(buf, addZero) { if (!addZero) return (buf); } - var b = new Buffer(buf.length + 1); + var b = Buffer.alloc(buf.length + 1); b[0] = 0x0; buf.copy(b, 1); return (b); } +function readBitString(der, tag) { + if (tag === undefined) + tag = asn1.Ber.BitString; + var buf = der.readString(tag, true); + assert.strictEqual(buf[0], 0x00, 'bit strings with unused bits are ' + + 'not supported (0x' + buf[0].toString(16) + ')'); + return (buf.slice(1)); +} + +function writeBitString(der, buf, tag) { + if (tag === undefined) + tag = asn1.Ber.BitString; + var b = Buffer.alloc(buf.length + 1); + b[0] = 0x00; + buf.copy(b, 1); + der.writeBuffer(b, tag); +} + function mpNormalize(buf) { assert.buffer(buf); while (buf.length > 1 && buf[0] === 0x00 && (buf[1] & 0x80) === 0x00) buf = buf.slice(1); if ((buf[0] & 0x80) === 0x80) { - var b = new Buffer(buf.length + 1); + var b = Buffer.alloc(buf.length + 1); + b[0] = 0x00; + buf.copy(b, 1); + buf = b; + } + return (buf); +} + +function mpDenormalize(buf) { + assert.buffer(buf); + while (buf.length > 1 && buf[0] === 0x00) + buf = buf.slice(1); + return (buf); +} + +function zeroPadToLength(buf, len) { + assert.buffer(buf); + assert.number(len); + while (buf.length > len) { + assert.equal(buf[0], 0x00); + buf = buf.slice(1); + } + while (buf.length < len) { + var b = Buffer.alloc(buf.length + 1); b[0] = 0x00; buf.copy(b, 1); buf = b; @@ -3539,7 +4777,7 @@ function mpNormalize(buf) { } function bigintToMpBuf(bigint) { - var buf = new Buffer(bigint.toByteArray()); + var buf = Buffer.from(bigint.toByteArray()); buf = mpNormalize(buf); return (buf); } @@ -3549,7 +4787,7 @@ function calculateDSAPublic(g, p, x) { assert.buffer(p); assert.buffer(x); try { - var bigInt = __webpack_require__(56).BigInteger; + var bigInt = __webpack_require__(81).BigInteger; } catch (e) { throw (new Error('To load a PKCS#8 format DSA private key, ' + 'the node jsbn library is required.')); @@ -3562,11 +4800,31 @@ function calculateDSAPublic(g, p, x) { return (ybuf); } +function calculateED25519Public(k) { + assert.buffer(k); + + if (nacl === undefined) + nacl = __webpack_require__(76); + + var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k)); + return (Buffer.from(kp.publicKey)); +} + +function calculateX25519Public(k) { + assert.buffer(k); + + if (nacl === undefined) + nacl = __webpack_require__(76); + + var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k)); + return (Buffer.from(kp.publicKey)); +} + function addRSAMissing(key) { assert.object(key); assertCompatible(key, PrivateKey, [1, 1]); try { - var bigInt = __webpack_require__(56).BigInteger; + var bigInt = __webpack_require__(81).BigInteger; } catch (e) { throw (new Error('To write a PEM private key from ' + 'this source, the node jsbn lib is required.')); @@ -3593,6 +4851,32 @@ function addRSAMissing(key) { } } +function publicFromPrivateECDSA(curveName, priv) { + assert.string(curveName, 'curveName'); + assert.buffer(priv); + if (ec === undefined) + ec = __webpack_require__(139); + if (jsbn === undefined) + jsbn = __webpack_require__(81).BigInteger; + var params = algs.curves[curveName]; + var p = new jsbn(params.p); + var a = new jsbn(params.a); + var b = new jsbn(params.b); + var curve = new ec.ECCurveFp(p, a, b); + var G = curve.decodePointHex(params.G.toString('hex')); + + var d = new jsbn(mpNormalize(priv)); + var pub = G.multiply(d); + pub = Buffer.from(curve.encodePointHex(pub), 'hex'); + + var parts = []; + parts.push({name: 'curve', data: Buffer.from(curveName)}); + parts.push({name: 'Q', data: pub}); + + var key = new Key({type: 'ecdsa', curve: curve, parts: parts}); + return (key); +} + function opensshCipherInfo(cipher) { var inf = {}; switch (cipher) { @@ -3636,213 +4920,26 @@ function opensshCipherInfo(cipher) { /***/ }), -/* 20 */ -/***/ (function(module, exports) { - -module.exports = require("assert"); - -/***/ }), -/* 21 */ -/***/ (function(module, exports) { - -var core = module.exports = {version: '2.4.0'}; -if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef - -/***/ }), -/* 22 */ -/***/ (function(module, exports) { - -// Copyright 2015 Joyent, Inc. - -var algInfo = { - 'dsa': { - parts: ['p', 'q', 'g', 'y'], - sizePart: 'p' - }, - 'rsa': { - parts: ['e', 'n'], - sizePart: 'n' - }, - 'ecdsa': { - parts: ['curve', 'Q'], - sizePart: 'Q' - }, - 'ed25519': { - parts: ['R'], - normalize: false, - sizePart: 'R' - } -}; -algInfo['curve25519'] = algInfo['ed25519']; - -var algPrivInfo = { - 'dsa': { - parts: ['p', 'q', 'g', 'y', 'x'] - }, - 'rsa': { - parts: ['n', 'e', 'd', 'iqmp', 'p', 'q'] - }, - 'ecdsa': { - parts: ['curve', 'Q', 'd'] - }, - 'ed25519': { - parts: ['R', 'r'], - normalize: false - } -}; -algPrivInfo['curve25519'] = algPrivInfo['ed25519']; - -var hashAlgs = { - 'md5': true, - 'sha1': true, - 'sha256': true, - 'sha384': true, - 'sha512': true -}; - -/* - * Taken from - * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf - */ -var curves = { - 'nistp256': { - size: 256, - pkcs8oid: '1.2.840.10045.3.1.7', - p: new Buffer(('00' + - 'ffffffff 00000001 00000000 00000000' + - '00000000 ffffffff ffffffff ffffffff'). - replace(/ /g, ''), 'hex'), - a: new Buffer(('00' + - 'FFFFFFFF 00000001 00000000 00000000' + - '00000000 FFFFFFFF FFFFFFFF FFFFFFFC'). - replace(/ /g, ''), 'hex'), - b: new Buffer(( - '5ac635d8 aa3a93e7 b3ebbd55 769886bc' + - '651d06b0 cc53b0f6 3bce3c3e 27d2604b'). - replace(/ /g, ''), 'hex'), - s: new Buffer(('00' + - 'c49d3608 86e70493 6a6678e1 139d26b7' + - '819f7e90'). - replace(/ /g, ''), 'hex'), - n: new Buffer(('00' + - 'ffffffff 00000000 ffffffff ffffffff' + - 'bce6faad a7179e84 f3b9cac2 fc632551'). - replace(/ /g, ''), 'hex'), - G: new Buffer(('04' + - '6b17d1f2 e12c4247 f8bce6e5 63a440f2' + - '77037d81 2deb33a0 f4a13945 d898c296' + - '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' + - '2bce3357 6b315ece cbb64068 37bf51f5'). - replace(/ /g, ''), 'hex') - }, - 'nistp384': { - size: 384, - pkcs8oid: '1.3.132.0.34', - p: new Buffer(('00' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff fffffffe' + - 'ffffffff 00000000 00000000 ffffffff'). - replace(/ /g, ''), 'hex'), - a: new Buffer(('00' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' + - 'FFFFFFFF 00000000 00000000 FFFFFFFC'). - replace(/ /g, ''), 'hex'), - b: new Buffer(( - 'b3312fa7 e23ee7e4 988e056b e3f82d19' + - '181d9c6e fe814112 0314088f 5013875a' + - 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'). - replace(/ /g, ''), 'hex'), - s: new Buffer(('00' + - 'a335926a a319a27a 1d00896a 6773a482' + - '7acdac73'). - replace(/ /g, ''), 'hex'), - n: new Buffer(('00' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff c7634d81 f4372ddf' + - '581a0db2 48b0a77a ecec196a ccc52973'). - replace(/ /g, ''), 'hex'), - G: new Buffer(('04' + - 'aa87ca22 be8b0537 8eb1c71e f320ad74' + - '6e1d3b62 8ba79b98 59f741e0 82542a38' + - '5502f25d bf55296c 3a545e38 72760ab7' + - '3617de4a 96262c6f 5d9e98bf 9292dc29' + - 'f8f41dbd 289a147c e9da3113 b5f0b8c0' + - '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'). - replace(/ /g, ''), 'hex') - }, - 'nistp521': { - size: 521, - pkcs8oid: '1.3.132.0.35', - p: new Buffer(( - '01ffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffff').replace(/ /g, ''), 'hex'), - a: new Buffer(('01FF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + - 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC'). - replace(/ /g, ''), 'hex'), - b: new Buffer(('51' + - '953eb961 8e1c9a1f 929a21a0 b68540ee' + - 'a2da725b 99b315f3 b8b48991 8ef109e1' + - '56193951 ec7e937b 1652c0bd 3bb1bf07' + - '3573df88 3d2c34f1 ef451fd4 6b503f00'). - replace(/ /g, ''), 'hex'), - s: new Buffer(('00' + - 'd09e8800 291cb853 96cc6717 393284aa' + - 'a0da64ba').replace(/ /g, ''), 'hex'), - n: new Buffer(('01ff' + - 'ffffffff ffffffff ffffffff ffffffff' + - 'ffffffff ffffffff ffffffff fffffffa' + - '51868783 bf2f966b 7fcc0148 f709a5d0' + - '3bb5c9b8 899c47ae bb6fb71e 91386409'). - replace(/ /g, ''), 'hex'), - G: new Buffer(('04' + - '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' + - '9c648139 053fb521 f828af60 6b4d3dba' + - 'a14b5e77 efe75928 fe1dc127 a2ffa8de' + - '3348b3c1 856a429b f97e7e31 c2e5bd66' + - '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' + - '98f54449 579b4468 17afbd17 273e662c' + - '97ee7299 5ef42640 c550b901 3fad0761' + - '353c7086 a272c240 88be9476 9fd16650'). - replace(/ /g, ''), 'hex') - } -}; - -module.exports = { - info: algInfo, - privInfo: algPrivInfo, - hashAlgs: hashAlgs, - curves: curves -}; - - -/***/ }), -/* 23 */ +/* 27 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = Key; -var assert = __webpack_require__(11); -var algs = __webpack_require__(22); -var crypto = __webpack_require__(8); -var Fingerprint = __webpack_require__(117); -var Signature = __webpack_require__(46); -var DiffieHellman = __webpack_require__(319).DiffieHellman; -var errs = __webpack_require__(45); -var utils = __webpack_require__(19); -var PrivateKey = __webpack_require__(24); +var assert = __webpack_require__(16); +var algs = __webpack_require__(32); +var crypto = __webpack_require__(11); +var Fingerprint = __webpack_require__(156); +var Signature = __webpack_require__(75); +var DiffieHellman = __webpack_require__(325).DiffieHellman; +var errs = __webpack_require__(74); +var utils = __webpack_require__(26); +var PrivateKey = __webpack_require__(33); var edCompat; try { - edCompat = __webpack_require__(320); + edCompat = __webpack_require__(454); } catch (e) { /* Just continue through, and bail out if we try to use it. */ } @@ -3851,14 +4948,15 @@ var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var formats = {}; -formats['auto'] = __webpack_require__(321); -formats['pem'] = __webpack_require__(58); -formats['pkcs1'] = __webpack_require__(228); -formats['pkcs8'] = __webpack_require__(118); -formats['rfc4253'] = __webpack_require__(75); -formats['ssh'] = __webpack_require__(322); -formats['ssh-private'] = __webpack_require__(145); +formats['auto'] = __webpack_require__(455); +formats['pem'] = __webpack_require__(86); +formats['pkcs1'] = __webpack_require__(327); +formats['pkcs8'] = __webpack_require__(157); +formats['rfc4253'] = __webpack_require__(103); +formats['ssh'] = __webpack_require__(456); +formats['ssh-private'] = __webpack_require__(192); formats['openssh'] = formats['ssh-private']; +formats['dnssec'] = __webpack_require__(326); function Key(opts) { assert.object(opts, 'options'); @@ -3892,7 +4990,7 @@ function Key(opts) { var curve = this.part.curve.data.toString(); this.curve = curve; sz = algs.curves[curve].size; - } else if (this.type === 'ed25519') { + } else if (this.type === 'ed25519' || this.type === 'curve25519') { sz = 256; this.curve = 'curve25519'; } else { @@ -3933,7 +5031,6 @@ Key.prototype.hash = function (algo) { if (this._hashCache[algo]) return (this._hashCache[algo]); - var hash = crypto.createHash(algo). update(this.toBuffer('rfc4253')).digest(); this._hashCache[algo] = hash; @@ -4084,8 +5181,9 @@ Key.isKey = function (obj, ver) { * [1,3] -- added defaultHashAlgorithm * [1,4] -- added ed support, createDH * [1,5] -- first explicitly tagged version + * [1,6] -- changed ed25519 part names */ -Key.prototype._sshpkApiVersion = [1, 5]; +Key.prototype._sshpkApiVersion = [1, 6]; Key._oldVersionDetect = function (obj) { assert.func(obj.toBuffer); @@ -4103,48 +5201,516 @@ Key._oldVersionDetect = function (obj) { /***/ }), -/* 24 */ +/* 28 */ +/***/ (function(module, exports) { + +module.exports = require("assert"); + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = nullify; +function nullify(obj = {}) { + if (Array.isArray(obj)) { + for (var _iterator = obj, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const item = _ref; + + nullify(item); + } + } else if (obj !== null && typeof obj === 'object' || typeof obj === 'function') { + Object.setPrototypeOf(obj, null); + + // for..in can only be applied to 'object', not 'function' + if (typeof obj === 'object') { + for (const key in obj) { + nullify(obj[key]); + } + } + } + + return obj; +} + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +const escapeStringRegexp = __webpack_require__(388); +const ansiStyles = __webpack_require__(506); +const stdoutColor = __webpack_require__(598).stdout; + +const template = __webpack_require__(599); + +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 + + +/***/ }), +/* 31 */ +/***/ (function(module, exports) { + +var core = module.exports = { version: '2.5.7' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2015 Joyent, Inc. + +var Buffer = __webpack_require__(15).Buffer; + +var algInfo = { + 'dsa': { + parts: ['p', 'q', 'g', 'y'], + sizePart: 'p' + }, + 'rsa': { + parts: ['e', 'n'], + sizePart: 'n' + }, + 'ecdsa': { + parts: ['curve', 'Q'], + sizePart: 'Q' + }, + 'ed25519': { + parts: ['A'], + sizePart: 'A' + } +}; +algInfo['curve25519'] = algInfo['ed25519']; + +var algPrivInfo = { + 'dsa': { + parts: ['p', 'q', 'g', 'y', 'x'] + }, + 'rsa': { + parts: ['n', 'e', 'd', 'iqmp', 'p', 'q'] + }, + 'ecdsa': { + parts: ['curve', 'Q', 'd'] + }, + 'ed25519': { + parts: ['A', 'k'] + } +}; +algPrivInfo['curve25519'] = algPrivInfo['ed25519']; + +var hashAlgs = { + 'md5': true, + 'sha1': true, + 'sha256': true, + 'sha384': true, + 'sha512': true +}; + +/* + * Taken from + * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf + */ +var curves = { + 'nistp256': { + size: 256, + pkcs8oid: '1.2.840.10045.3.1.7', + p: Buffer.from(('00' + + 'ffffffff 00000001 00000000 00000000' + + '00000000 ffffffff ffffffff ffffffff'). + replace(/ /g, ''), 'hex'), + a: Buffer.from(('00' + + 'FFFFFFFF 00000001 00000000 00000000' + + '00000000 FFFFFFFF FFFFFFFF FFFFFFFC'). + replace(/ /g, ''), 'hex'), + b: Buffer.from(( + '5ac635d8 aa3a93e7 b3ebbd55 769886bc' + + '651d06b0 cc53b0f6 3bce3c3e 27d2604b'). + replace(/ /g, ''), 'hex'), + s: Buffer.from(('00' + + 'c49d3608 86e70493 6a6678e1 139d26b7' + + '819f7e90'). + replace(/ /g, ''), 'hex'), + n: Buffer.from(('00' + + 'ffffffff 00000000 ffffffff ffffffff' + + 'bce6faad a7179e84 f3b9cac2 fc632551'). + replace(/ /g, ''), 'hex'), + G: Buffer.from(('04' + + '6b17d1f2 e12c4247 f8bce6e5 63a440f2' + + '77037d81 2deb33a0 f4a13945 d898c296' + + '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' + + '2bce3357 6b315ece cbb64068 37bf51f5'). + replace(/ /g, ''), 'hex') + }, + 'nistp384': { + size: 384, + pkcs8oid: '1.3.132.0.34', + p: Buffer.from(('00' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff fffffffe' + + 'ffffffff 00000000 00000000 ffffffff'). + replace(/ /g, ''), 'hex'), + a: Buffer.from(('00' + + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' + + 'FFFFFFFF 00000000 00000000 FFFFFFFC'). + replace(/ /g, ''), 'hex'), + b: Buffer.from(( + 'b3312fa7 e23ee7e4 988e056b e3f82d19' + + '181d9c6e fe814112 0314088f 5013875a' + + 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'). + replace(/ /g, ''), 'hex'), + s: Buffer.from(('00' + + 'a335926a a319a27a 1d00896a 6773a482' + + '7acdac73'). + replace(/ /g, ''), 'hex'), + n: Buffer.from(('00' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff c7634d81 f4372ddf' + + '581a0db2 48b0a77a ecec196a ccc52973'). + replace(/ /g, ''), 'hex'), + G: Buffer.from(('04' + + 'aa87ca22 be8b0537 8eb1c71e f320ad74' + + '6e1d3b62 8ba79b98 59f741e0 82542a38' + + '5502f25d bf55296c 3a545e38 72760ab7' + + '3617de4a 96262c6f 5d9e98bf 9292dc29' + + 'f8f41dbd 289a147c e9da3113 b5f0b8c0' + + '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'). + replace(/ /g, ''), 'hex') + }, + 'nistp521': { + size: 521, + pkcs8oid: '1.3.132.0.35', + p: Buffer.from(( + '01ffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffff').replace(/ /g, ''), 'hex'), + a: Buffer.from(('01FF' + + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC'). + replace(/ /g, ''), 'hex'), + b: Buffer.from(('51' + + '953eb961 8e1c9a1f 929a21a0 b68540ee' + + 'a2da725b 99b315f3 b8b48991 8ef109e1' + + '56193951 ec7e937b 1652c0bd 3bb1bf07' + + '3573df88 3d2c34f1 ef451fd4 6b503f00'). + replace(/ /g, ''), 'hex'), + s: Buffer.from(('00' + + 'd09e8800 291cb853 96cc6717 393284aa' + + 'a0da64ba').replace(/ /g, ''), 'hex'), + n: Buffer.from(('01ff' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff fffffffa' + + '51868783 bf2f966b 7fcc0148 f709a5d0' + + '3bb5c9b8 899c47ae bb6fb71e 91386409'). + replace(/ /g, ''), 'hex'), + G: Buffer.from(('04' + + '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' + + '9c648139 053fb521 f828af60 6b4d3dba' + + 'a14b5e77 efe75928 fe1dc127 a2ffa8de' + + '3348b3c1 856a429b f97e7e31 c2e5bd66' + + '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' + + '98f54449 579b4468 17afbd17 273e662c' + + '97ee7299 5ef42640 c550b901 3fad0761' + + '353c7086 a272c240 88be9476 9fd16650'). + replace(/ /g, ''), 'hex') + } +}; + +module.exports = { + info: algInfo, + privInfo: algPrivInfo, + hashAlgs: hashAlgs, + curves: curves +}; + + +/***/ }), +/* 33 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = PrivateKey; -var assert = __webpack_require__(11); -var algs = __webpack_require__(22); -var crypto = __webpack_require__(8); -var Fingerprint = __webpack_require__(117); -var Signature = __webpack_require__(46); -var errs = __webpack_require__(45); -var util = __webpack_require__(2); -var utils = __webpack_require__(19); -var dhe = __webpack_require__(319); +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var crypto = __webpack_require__(11); +var Fingerprint = __webpack_require__(156); +var Signature = __webpack_require__(75); +var errs = __webpack_require__(74); +var util = __webpack_require__(3); +var utils = __webpack_require__(26); +var dhe = __webpack_require__(325); var generateECDSA = dhe.generateECDSA; var generateED25519 = dhe.generateED25519; var edCompat; -var ed; +var nacl; try { - edCompat = __webpack_require__(320); + edCompat = __webpack_require__(454); } catch (e) { /* Just continue through, and bail out if we try to use it. */ } -var Key = __webpack_require__(23); +var Key = __webpack_require__(27); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var KeyEncryptedError = errs.KeyEncryptedError; var formats = {}; -formats['auto'] = __webpack_require__(321); -formats['pem'] = __webpack_require__(58); -formats['pkcs1'] = __webpack_require__(228); -formats['pkcs8'] = __webpack_require__(118); -formats['rfc4253'] = __webpack_require__(75); -formats['ssh-private'] = __webpack_require__(145); +formats['auto'] = __webpack_require__(455); +formats['pem'] = __webpack_require__(86); +formats['pkcs1'] = __webpack_require__(327); +formats['pkcs8'] = __webpack_require__(157); +formats['rfc4253'] = __webpack_require__(103); +formats['ssh-private'] = __webpack_require__(192); formats['openssh'] = formats['ssh-private']; formats['ssh'] = formats['ssh-private']; +formats['dnssec'] = __webpack_require__(326); function PrivateKey(opts) { assert.object(opts, 'options'); @@ -4191,49 +5757,44 @@ PrivateKey.prototype.toPublic = function () { return (this._pubCache); }; -PrivateKey.prototype.derive = function (newType, newSize) { +PrivateKey.prototype.derive = function (newType) { assert.string(newType, 'type'); - assert.optionalNumber(newSize, 'size'); - var priv, pub; + var priv, pub, pair; if (this.type === 'ed25519' && newType === 'curve25519') { - if (ed === undefined) - ed = __webpack_require__(219); + if (nacl === undefined) + nacl = __webpack_require__(76); - priv = this.part.r.data; + priv = this.part.k.data; if (priv[0] === 0x00) priv = priv.slice(1); - priv = priv.slice(0, 32); - pub = ed.dh.publicKey(priv); - priv = utils.mpNormalize(Buffer.concat([priv, pub])); + pair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv)); + pub = Buffer.from(pair.publicKey); return (new PrivateKey({ type: 'curve25519', parts: [ - { name: 'R', data: utils.mpNormalize(pub) }, - { name: 'r', data: priv } + { name: 'A', data: utils.mpNormalize(pub) }, + { name: 'k', data: utils.mpNormalize(priv) } ] })); } else if (this.type === 'curve25519' && newType === 'ed25519') { - if (ed === undefined) - ed = __webpack_require__(219); + if (nacl === undefined) + nacl = __webpack_require__(76); - priv = this.part.r.data; + priv = this.part.k.data; if (priv[0] === 0x00) priv = priv.slice(1); - priv = priv.slice(0, 32); - pub = ed.eddsa.publicKey(priv.toString('binary')); - pub = new Buffer(pub, 'binary'); - - priv = utils.mpNormalize(Buffer.concat([priv, pub])); + pair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv)); + pub = Buffer.from(pair.publicKey); return (new PrivateKey({ type: 'ed25519', parts: [ - { name: 'R', data: utils.mpNormalize(pub) }, - { name: 'r', data: priv } + { name: 'A', data: utils.mpNormalize(pub) }, + { name: 'k', data: utils.mpNormalize(priv) } ] })); } @@ -4278,7 +5839,7 @@ PrivateKey.prototype.createSign = function (hashAlgo) { v.sign = function () { var sig = oldSign(key); if (typeof (sig) === 'string') - sig = new Buffer(sig, 'binary'); + sig = Buffer.from(sig, 'binary'); sig = Signature.parse(sig, type, 'asn1'); sig.hashAlgorithm = hashAlgo; sig.curve = curve; @@ -4347,8 +5908,9 @@ PrivateKey.generate = function (type, options) { * [1,2] -- added defaultHashAlgorithm * [1,3] -- added derive, ed, createDH * [1,4] -- first tagged version + * [1,5] -- changed ed25519 part names and format */ -PrivateKey.prototype._sshpkApiVersion = [1, 4]; +PrivateKey.prototype._sshpkApiVersion = [1, 5]; PrivateKey._oldVersionDetect = function (obj) { assert.func(obj.toPublic); @@ -4364,23 +5926,1798 @@ PrivateKey._oldVersionDetect = function (obj) { /***/ }), -/* 25 */ -/***/ (function(module, exports) { - -module.exports = require("stream"); - -/***/ }), -/* 26 */ +/* 34 */ /***/ (function(module, exports, __webpack_require__) { -var isObject = __webpack_require__(44); -module.exports = function(it){ - if(!isObject(it))throw TypeError(it + ' is not an object!'); +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.wrapLifecycle = exports.run = exports.install = exports.Install = undefined; + +var _extends2; + +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(21)); +} + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +let install = exports.install = (() => { + var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile) { + yield wrapLifecycle(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const install = new Install(flags, config, reporter, lockfile); + yield install.init(); + })); + }); + + return function install(_x7, _x8, _x9, _x10) { + return _ref29.apply(this, arguments); + }; +})(); + +let run = exports.run = (() => { + var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + let lockfile; + let error = 'installCommandRenamed'; + if (flags.lockfile === false) { + lockfile = new (_lockfile || _load_lockfile()).default(); + } else { + lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); + } + + if (args.length) { + const exampleArgs = args.slice(); + + if (flags.saveDev) { + exampleArgs.push('--dev'); + } + if (flags.savePeer) { + exampleArgs.push('--peer'); + } + if (flags.saveOptional) { + exampleArgs.push('--optional'); + } + if (flags.saveExact) { + exampleArgs.push('--exact'); + } + if (flags.saveTilde) { + exampleArgs.push('--tilde'); + } + let command = 'add'; + if (flags.global) { + error = 'globalFlagRemoved'; + command = 'global add'; + } + throw new (_errors || _load_errors()).MessageError(reporter.lang(error, `yarn ${command} ${exampleArgs.join(' ')}`)); + } + + yield install(config, reporter, flags, lockfile); + }); + + return function run(_x11, _x12, _x13, _x14) { + return _ref31.apply(this, arguments); + }; +})(); + +let wrapLifecycle = exports.wrapLifecycle = (() => { + var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags, factory) { + yield config.executeLifecycleScript('preinstall'); + + yield factory(); + + // npm behaviour, seems kinda funky but yay compatibility + yield config.executeLifecycleScript('install'); + yield config.executeLifecycleScript('postinstall'); + + if (!config.production) { + if (!config.disablePrepublish) { + yield config.executeLifecycleScript('prepublish'); + } + yield config.executeLifecycleScript('prepare'); + } + }); + + return function wrapLifecycle(_x15, _x16, _x17) { + return _ref32.apply(this, arguments); + }; +})(); + +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; + +var _objectPath; + +function _load_objectPath() { + return _objectPath = _interopRequireDefault(__webpack_require__(304)); +} + +var _hooks; + +function _load_hooks() { + return _hooks = __webpack_require__(374); +} + +var _index; + +function _load_index() { + return _index = _interopRequireDefault(__webpack_require__(220)); +} + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _integrityChecker; + +function _load_integrityChecker() { + return _integrityChecker = _interopRequireDefault(__webpack_require__(208)); +} + +var _lockfile; + +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(19)); +} + +var _lockfile2; + +function _load_lockfile2() { + return _lockfile2 = __webpack_require__(19); +} + +var _packageFetcher; + +function _load_packageFetcher() { + return _packageFetcher = _interopRequireWildcard(__webpack_require__(210)); +} + +var _packageInstallScripts; + +function _load_packageInstallScripts() { + return _packageInstallScripts = _interopRequireDefault(__webpack_require__(557)); +} + +var _packageCompatibility; + +function _load_packageCompatibility() { + return _packageCompatibility = _interopRequireWildcard(__webpack_require__(209)); +} + +var _packageResolver; + +function _load_packageResolver() { + return _packageResolver = _interopRequireDefault(__webpack_require__(366)); +} + +var _packageLinker; + +function _load_packageLinker() { + return _packageLinker = _interopRequireDefault(__webpack_require__(211)); +} + +var _index2; + +function _load_index2() { + return _index2 = __webpack_require__(57); +} + +var _index3; + +function _load_index3() { + return _index3 = __webpack_require__(78); +} + +var _autoclean; + +function _load_autoclean() { + return _autoclean = __webpack_require__(354); +} + +var _constants; + +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} + +var _normalizePattern; + +function _load_normalizePattern() { + return _normalizePattern = __webpack_require__(37); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(4)); +} + +var _map; + +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(29)); +} + +var _yarnVersion; + +function _load_yarnVersion() { + return _yarnVersion = __webpack_require__(120); +} + +var _generatePnpMap; + +function _load_generatePnpMap() { + return _generatePnpMap = __webpack_require__(579); +} + +var _workspaceLayout; + +function _load_workspaceLayout() { + return _workspaceLayout = _interopRequireDefault(__webpack_require__(90)); +} + +var _resolutionMap; + +function _load_resolutionMap() { + return _resolutionMap = _interopRequireDefault(__webpack_require__(214)); +} + +var _guessName; + +function _load_guessName() { + return _guessName = _interopRequireDefault(__webpack_require__(169)); +} + +var _audit; + +function _load_audit() { + return _audit = _interopRequireDefault(__webpack_require__(353)); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const deepEqual = __webpack_require__(631); + +const emoji = __webpack_require__(302); +const invariant = __webpack_require__(9); +const path = __webpack_require__(0); +const semver = __webpack_require__(22); +const uuid = __webpack_require__(119); +const ssri = __webpack_require__(65); + +const ONE_DAY = 1000 * 60 * 60 * 24; + +/** + * Try and detect the installation method for Yarn and provide a command to update it with. + */ + +function getUpdateCommand(installationMethod) { + if (installationMethod === 'tar') { + return `curl --compressed -o- -L ${(_constants || _load_constants()).YARN_INSTALLER_SH} | bash`; + } + + if (installationMethod === 'homebrew') { + return 'brew upgrade yarn'; + } + + if (installationMethod === 'deb') { + return 'sudo apt-get update && sudo apt-get install yarn'; + } + + if (installationMethod === 'rpm') { + return 'sudo yum install yarn'; + } + + if (installationMethod === 'npm') { + return 'npm install --global yarn'; + } + + if (installationMethod === 'chocolatey') { + return 'choco upgrade yarn'; + } + + if (installationMethod === 'apk') { + return 'apk update && apk add -u yarn'; + } + + if (installationMethod === 'portage') { + return 'sudo emerge --sync && sudo emerge -au sys-apps/yarn'; + } + + return null; +} + +function getUpdateInstaller(installationMethod) { + // Windows + if (installationMethod === 'msi') { + return (_constants || _load_constants()).YARN_INSTALLER_MSI; + } + + return null; +} + +function normalizeFlags(config, rawFlags) { + const flags = { + // install + har: !!rawFlags.har, + ignorePlatform: !!rawFlags.ignorePlatform, + ignoreEngines: !!rawFlags.ignoreEngines, + ignoreScripts: !!rawFlags.ignoreScripts, + ignoreOptional: !!rawFlags.ignoreOptional, + force: !!rawFlags.force, + flat: !!rawFlags.flat, + lockfile: rawFlags.lockfile !== false, + pureLockfile: !!rawFlags.pureLockfile, + updateChecksums: !!rawFlags.updateChecksums, + skipIntegrityCheck: !!rawFlags.skipIntegrityCheck, + frozenLockfile: !!rawFlags.frozenLockfile, + linkDuplicates: !!rawFlags.linkDuplicates, + checkFiles: !!rawFlags.checkFiles, + audit: !!rawFlags.audit, + + // add + peer: !!rawFlags.peer, + dev: !!rawFlags.dev, + optional: !!rawFlags.optional, + exact: !!rawFlags.exact, + tilde: !!rawFlags.tilde, + ignoreWorkspaceRootCheck: !!rawFlags.ignoreWorkspaceRootCheck, + + // outdated, update-interactive + includeWorkspaceDeps: !!rawFlags.includeWorkspaceDeps, + + // add, remove, update + workspaceRootIsCwd: rawFlags.workspaceRootIsCwd !== false + }; + + if (config.getOption('ignore-scripts')) { + flags.ignoreScripts = true; + } + + if (config.getOption('ignore-platform')) { + flags.ignorePlatform = true; + } + + if (config.getOption('ignore-engines')) { + flags.ignoreEngines = true; + } + + if (config.getOption('ignore-optional')) { + flags.ignoreOptional = true; + } + + if (config.getOption('force')) { + flags.force = true; + } + + return flags; +} + +class Install { + constructor(flags, config, reporter, lockfile) { + this.rootManifestRegistries = []; + this.rootPatternsToOrigin = (0, (_map || _load_map()).default)(); + this.lockfile = lockfile; + this.reporter = reporter; + this.config = config; + this.flags = normalizeFlags(config, flags); + this.resolutions = (0, (_map || _load_map()).default)(); // Legacy resolutions field used for flat install mode + this.resolutionMap = new (_resolutionMap || _load_resolutionMap()).default(config); // Selective resolutions for nested dependencies + this.resolver = new (_packageResolver || _load_packageResolver()).default(config, lockfile, this.resolutionMap); + this.integrityChecker = new (_integrityChecker || _load_integrityChecker()).default(config); + this.linker = new (_packageLinker || _load_packageLinker()).default(config, this.resolver); + this.scripts = new (_packageInstallScripts || _load_packageInstallScripts()).default(config, this.resolver, this.flags.force); + } + + /** + * Create a list of dependency requests from the current directories manifests. + */ + + fetchRequestFromCwd(excludePatterns = [], ignoreUnusedPatterns = false) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const patterns = []; + const deps = []; + let resolutionDeps = []; + const manifest = {}; + + const ignorePatterns = []; + const usedPatterns = []; + let workspaceLayout; + + // some commands should always run in the context of the entire workspace + const cwd = _this.flags.includeWorkspaceDeps || _this.flags.workspaceRootIsCwd ? _this.config.lockfileFolder : _this.config.cwd; + + // non-workspaces are always root, otherwise check for workspace root + const cwdIsRoot = !_this.config.workspaceRootFolder || _this.config.lockfileFolder === cwd; + + // exclude package names that are in install args + const excludeNames = []; + for (var _iterator = excludePatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const pattern = _ref; + + if ((0, (_index3 || _load_index3()).getExoticResolver)(pattern)) { + excludeNames.push((0, (_guessName || _load_guessName()).default)(pattern)); + } else { + // extract the name + const parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern); + excludeNames.push(parts.name); + } + } + + const stripExcluded = function stripExcluded(manifest) { + for (var _iterator2 = excludeNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + const exclude = _ref2; + + if (manifest.dependencies && manifest.dependencies[exclude]) { + delete manifest.dependencies[exclude]; + } + if (manifest.devDependencies && manifest.devDependencies[exclude]) { + delete manifest.devDependencies[exclude]; + } + if (manifest.optionalDependencies && manifest.optionalDependencies[exclude]) { + delete manifest.optionalDependencies[exclude]; + } + } + }; + + for (var _iterator3 = Object.keys((_index2 || _load_index2()).registries), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + const registry = _ref3; + + const filename = (_index2 || _load_index2()).registries[registry].filename; + + const loc = path.join(cwd, filename); + if (!(yield (_fs || _load_fs()).exists(loc))) { + continue; + } + + _this.rootManifestRegistries.push(registry); + + const projectManifestJson = yield _this.config.readJson(loc); + yield (0, (_index || _load_index()).default)(projectManifestJson, cwd, _this.config, cwdIsRoot); + + Object.assign(_this.resolutions, projectManifestJson.resolutions); + Object.assign(manifest, projectManifestJson); + + _this.resolutionMap.init(_this.resolutions); + for (var _iterator4 = Object.keys(_this.resolutionMap.resolutionsByPackage), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + const packageName = _ref4; + + const optional = (_objectPath || _load_objectPath()).default.has(manifest.optionalDependencies, packageName) && _this.flags.ignoreOptional; + for (var _iterator8 = _this.resolutionMap.resolutionsByPackage[packageName], _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { + var _ref9; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref9 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref9 = _i8.value; + } + + const _ref8 = _ref9; + const pattern = _ref8.pattern; + + resolutionDeps = [...resolutionDeps, { registry, pattern, optional, hint: 'resolution' }]; + } + } + + const pushDeps = function pushDeps(depType, manifest, { hint, optional }, isUsed) { + if (ignoreUnusedPatterns && !isUsed) { + return; + } + // We only take unused dependencies into consideration to get deterministic hoisting. + // Since flat mode doesn't care about hoisting and everything is top level and specified then we can safely + // leave these out. + if (_this.flags.flat && !isUsed) { + return; + } + const depMap = manifest[depType]; + for (const name in depMap) { + if (excludeNames.indexOf(name) >= 0) { + continue; + } + + let pattern = name; + if (!_this.lockfile.getLocked(pattern)) { + // when we use --save we save the dependency to the lockfile with just the name rather than the + // version combo + pattern += '@' + depMap[name]; + } + + // normalization made sure packages are mentioned only once + if (isUsed) { + usedPatterns.push(pattern); + } else { + ignorePatterns.push(pattern); + } + + _this.rootPatternsToOrigin[pattern] = depType; + patterns.push(pattern); + deps.push({ pattern, registry, hint, optional, workspaceName: manifest.name, workspaceLoc: manifest._loc }); + } + }; + + if (cwdIsRoot) { + pushDeps('dependencies', projectManifestJson, { hint: null, optional: false }, true); + pushDeps('devDependencies', projectManifestJson, { hint: 'dev', optional: false }, !_this.config.production); + pushDeps('optionalDependencies', projectManifestJson, { hint: 'optional', optional: true }, true); + } + + if (_this.config.workspaceRootFolder) { + const workspaceLoc = cwdIsRoot ? loc : path.join(_this.config.lockfileFolder, filename); + const workspacesRoot = path.dirname(workspaceLoc); + + let workspaceManifestJson = projectManifestJson; + if (!cwdIsRoot) { + // the manifest we read before was a child workspace, so get the root + workspaceManifestJson = yield _this.config.readJson(workspaceLoc); + yield (0, (_index || _load_index()).default)(workspaceManifestJson, workspacesRoot, _this.config, true); + } + + const workspaces = yield _this.config.resolveWorkspaces(workspacesRoot, workspaceManifestJson); + workspaceLayout = new (_workspaceLayout || _load_workspaceLayout()).default(workspaces, _this.config); + + // add virtual manifest that depends on all workspaces, this way package hoisters and resolvers will work fine + const workspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.dependencies); + for (var _iterator5 = Object.keys(workspaces), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref5; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref5 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref5 = _i5.value; + } + + const workspaceName = _ref5; + + const workspaceManifest = workspaces[workspaceName].manifest; + workspaceDependencies[workspaceName] = workspaceManifest.version; + + // include dependencies from all workspaces + if (_this.flags.includeWorkspaceDeps) { + pushDeps('dependencies', workspaceManifest, { hint: null, optional: false }, true); + pushDeps('devDependencies', workspaceManifest, { hint: 'dev', optional: false }, !_this.config.production); + pushDeps('optionalDependencies', workspaceManifest, { hint: 'optional', optional: true }, true); + } + } + const virtualDependencyManifest = { + _uid: '', + name: `workspace-aggregator-${uuid.v4()}`, + version: '1.0.0', + _registry: 'npm', + _loc: workspacesRoot, + dependencies: workspaceDependencies, + devDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.devDependencies), + optionalDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.optionalDependencies), + private: workspaceManifestJson.private, + workspaces: workspaceManifestJson.workspaces + }; + workspaceLayout.virtualManifestName = virtualDependencyManifest.name; + const virtualDep = {}; + virtualDep[virtualDependencyManifest.name] = virtualDependencyManifest.version; + workspaces[virtualDependencyManifest.name] = { loc: workspacesRoot, manifest: virtualDependencyManifest }; + + // ensure dependencies that should be excluded are stripped from the correct manifest + stripExcluded(cwdIsRoot ? virtualDependencyManifest : workspaces[projectManifestJson.name].manifest); + + pushDeps('workspaces', { workspaces: virtualDep }, { hint: 'workspaces', optional: false }, true); + + const implicitWorkspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceDependencies); + + for (var _iterator6 = (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref6; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref6 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref6 = _i6.value; + } + + const type = _ref6; + + for (var _iterator7 = Object.keys(projectManifestJson[type] || {}), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref7; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref7 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref7 = _i7.value; + } + + const dependencyName = _ref7; + + delete implicitWorkspaceDependencies[dependencyName]; + } + } + + pushDeps('dependencies', { dependencies: implicitWorkspaceDependencies }, { hint: 'workspaces', optional: false }, true); + } + + break; + } + + // inherit root flat flag + if (manifest.flat) { + _this.flags.flat = true; + } + + return { + requests: [...resolutionDeps, ...deps], + patterns, + manifest, + usedPatterns, + ignorePatterns, + workspaceLayout + }; + })(); + } + + /** + * TODO description + */ + + prepareRequests(requests) { + return requests; + } + + preparePatterns(patterns) { + return patterns; + } + preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) { + return patterns; + } + + prepareManifests() { + var _this2 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const manifests = yield _this2.config.getRootManifests(); + return manifests; + })(); + } + + bailout(patterns, workspaceLayout) { + var _this3 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // We don't want to skip the audit - it could yield important errors + if (_this3.flags.audit) { + return false; + } + // PNP is so fast that the integrity check isn't pertinent + if (_this3.config.plugnplayEnabled) { + return false; + } + if (_this3.flags.skipIntegrityCheck || _this3.flags.force) { + return false; + } + const lockfileCache = _this3.lockfile.cache; + if (!lockfileCache) { + return false; + } + const lockfileClean = _this3.lockfile.parseResultType === 'success'; + const match = yield _this3.integrityChecker.check(patterns, lockfileCache, _this3.flags, workspaceLayout); + if (_this3.flags.frozenLockfile && (!lockfileClean || match.missingPatterns.length > 0)) { + throw new (_errors || _load_errors()).MessageError(_this3.reporter.lang('frozenLockfileError')); + } + + const haveLockfile = yield (_fs || _load_fs()).exists(path.join(_this3.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); + + const lockfileIntegrityPresent = !_this3.lockfile.hasEntriesExistWithoutIntegrity(); + const integrityBailout = lockfileIntegrityPresent || !_this3.config.autoAddIntegrity; + + if (match.integrityMatches && haveLockfile && lockfileClean && integrityBailout) { + _this3.reporter.success(_this3.reporter.lang('upToDate')); + return true; + } + + if (match.integrityFileMissing && haveLockfile) { + // Integrity file missing, force script installations + _this3.scripts.setForce(true); + return false; + } + + if (match.hardRefreshRequired) { + // e.g. node version doesn't match, force script installations + _this3.scripts.setForce(true); + return false; + } + + if (!patterns.length && !match.integrityFileMissing) { + _this3.reporter.success(_this3.reporter.lang('nothingToInstall')); + yield _this3.createEmptyManifestFolders(); + yield _this3.saveLockfileAndIntegrity(patterns, workspaceLayout); + return true; + } + + return false; + })(); + } + + /** + * Produce empty folders for all used root manifests. + */ + + createEmptyManifestFolders() { + var _this4 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (_this4.config.modulesFolder) { + // already created + return; + } + + for (var _iterator9 = _this4.rootManifestRegistries, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { + var _ref10; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref10 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref10 = _i9.value; + } + + const registryName = _ref10; + const folder = _this4.config.registries[registryName].folder; + + yield (_fs || _load_fs()).mkdirp(path.join(_this4.config.lockfileFolder, folder)); + } + })(); + } + + /** + * TODO description + */ + + markIgnored(patterns) { + for (var _iterator10 = patterns, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { + var _ref11; + + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref11 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref11 = _i10.value; + } + + const pattern = _ref11; + + const manifest = this.resolver.getStrictResolvedPattern(pattern); + const ref = manifest._reference; + invariant(ref, 'expected package reference'); + + // just mark the package as ignored. if the package is used by a required package, the hoister + // will take care of that. + ref.ignore = true; + } + } + + /** + * helper method that gets only recent manifests + * used by global.ls command + */ + getFlattenedDeps() { + var _this5 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _ref12 = yield _this5.fetchRequestFromCwd(); + + const depRequests = _ref12.requests, + rawPatterns = _ref12.patterns; + + + yield _this5.resolver.init(depRequests, {}); + + const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this5.resolver.getManifests(), _this5.config); + _this5.resolver.updateManifests(manifests); + + return _this5.flatten(rawPatterns); + })(); + } + + /** + * TODO description + */ + + init() { + var _this6 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + _this6.checkUpdate(); + + // warn if we have a shrinkwrap + if (yield (_fs || _load_fs()).exists(path.join(_this6.config.lockfileFolder, (_constants || _load_constants()).NPM_SHRINKWRAP_FILENAME))) { + _this6.reporter.warn(_this6.reporter.lang('shrinkwrapWarning')); + } + + // warn if we have an npm lockfile + if (yield (_fs || _load_fs()).exists(path.join(_this6.config.lockfileFolder, (_constants || _load_constants()).NPM_LOCK_FILENAME))) { + _this6.reporter.warn(_this6.reporter.lang('npmLockfileWarning')); + } + + if (_this6.config.plugnplayEnabled) { + _this6.reporter.info(_this6.reporter.lang('plugnplaySuggestV2L1')); + _this6.reporter.info(_this6.reporter.lang('plugnplaySuggestV2L2')); + } + + let flattenedTopLevelPatterns = []; + const steps = []; + + var _ref13 = yield _this6.fetchRequestFromCwd(); + + const depRequests = _ref13.requests, + rawPatterns = _ref13.patterns, + ignorePatterns = _ref13.ignorePatterns, + workspaceLayout = _ref13.workspaceLayout, + manifest = _ref13.manifest; + + let topLevelPatterns = []; + + const artifacts = yield _this6.integrityChecker.getArtifacts(); + if (artifacts) { + _this6.linker.setArtifacts(artifacts); + _this6.scripts.setArtifacts(artifacts); + } + + if ((_packageCompatibility || _load_packageCompatibility()).shouldCheck(manifest, _this6.flags)) { + steps.push((() => { + var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { + _this6.reporter.step(curr, total, _this6.reporter.lang('checkingManifest'), emoji.get('mag')); + yield _this6.checkCompatibility(); + }); + + return function (_x, _x2) { + return _ref14.apply(this, arguments); + }; + })()); + } + + const audit = new (_audit || _load_audit()).default(_this6.config, _this6.reporter, { groups: (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES }); + let auditFoundProblems = false; + + steps.push(function (curr, total) { + return (0, (_hooks || _load_hooks()).callThroughHook)('resolveStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + _this6.reporter.step(curr, total, _this6.reporter.lang('resolvingPackages'), emoji.get('mag')); + yield _this6.resolver.init(_this6.prepareRequests(depRequests), { + isFlat: _this6.flags.flat, + isFrozen: _this6.flags.frozenLockfile, + workspaceLayout + }); + topLevelPatterns = _this6.preparePatterns(rawPatterns); + flattenedTopLevelPatterns = yield _this6.flatten(topLevelPatterns); + return { bailout: !_this6.flags.audit && (yield _this6.bailout(topLevelPatterns, workspaceLayout)) }; + })); + }); + + if (_this6.flags.audit) { + steps.push(function (curr, total) { + return (0, (_hooks || _load_hooks()).callThroughHook)('auditStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + _this6.reporter.step(curr, total, _this6.reporter.lang('auditRunning'), emoji.get('mag')); + if (_this6.flags.offline) { + _this6.reporter.warn(_this6.reporter.lang('auditOffline')); + return { bailout: false }; + } + const preparedManifests = yield _this6.prepareManifests(); + // $FlowFixMe - Flow considers `m` in the map operation to be "mixed", so does not recognize `m.object` + const mergedManifest = Object.assign({}, ...Object.values(preparedManifests).map(function (m) { + return m.object; + })); + const auditVulnerabilityCounts = yield audit.performAudit(mergedManifest, _this6.lockfile, _this6.resolver, _this6.linker, topLevelPatterns); + auditFoundProblems = auditVulnerabilityCounts.info || auditVulnerabilityCounts.low || auditVulnerabilityCounts.moderate || auditVulnerabilityCounts.high || auditVulnerabilityCounts.critical; + return { bailout: yield _this6.bailout(topLevelPatterns, workspaceLayout) }; + })); + }); + } + + steps.push(function (curr, total) { + return (0, (_hooks || _load_hooks()).callThroughHook)('fetchStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + _this6.markIgnored(ignorePatterns); + _this6.reporter.step(curr, total, _this6.reporter.lang('fetchingPackages'), emoji.get('truck')); + const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this6.resolver.getManifests(), _this6.config); + _this6.resolver.updateManifests(manifests); + yield (_packageCompatibility || _load_packageCompatibility()).check(_this6.resolver.getManifests(), _this6.config, _this6.flags.ignoreEngines); + })); + }); + + steps.push(function (curr, total) { + return (0, (_hooks || _load_hooks()).callThroughHook)('linkStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // remove integrity hash to make this operation atomic + yield _this6.integrityChecker.removeIntegrityFile(); + _this6.reporter.step(curr, total, _this6.reporter.lang('linkingDependencies'), emoji.get('link')); + flattenedTopLevelPatterns = _this6.preparePatternsForLinking(flattenedTopLevelPatterns, manifest, _this6.config.lockfileFolder === _this6.config.cwd); + yield _this6.linker.init(flattenedTopLevelPatterns, workspaceLayout, { + linkDuplicates: _this6.flags.linkDuplicates, + ignoreOptional: _this6.flags.ignoreOptional + }); + })); + }); + + if (_this6.config.plugnplayEnabled) { + steps.push(function (curr, total) { + return (0, (_hooks || _load_hooks()).callThroughHook)('pnpStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const pnpPath = `${_this6.config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`; + + const code = yield (0, (_generatePnpMap || _load_generatePnpMap()).generatePnpMap)(_this6.config, flattenedTopLevelPatterns, { + resolver: _this6.resolver, + reporter: _this6.reporter, + targetPath: pnpPath, + workspaceLayout + }); + + try { + const file = yield (_fs || _load_fs()).readFile(pnpPath); + if (file === code) { + return; + } + } catch (error) {} + + yield (_fs || _load_fs()).writeFile(pnpPath, code); + yield (_fs || _load_fs()).chmod(pnpPath, 0o755); + })); + }); + } + + steps.push(function (curr, total) { + return (0, (_hooks || _load_hooks()).callThroughHook)('buildStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + _this6.reporter.step(curr, total, _this6.flags.force ? _this6.reporter.lang('rebuildingPackages') : _this6.reporter.lang('buildingFreshPackages'), emoji.get('hammer')); + + if (_this6.config.ignoreScripts) { + _this6.reporter.warn(_this6.reporter.lang('ignoredScripts')); + } else { + yield _this6.scripts.init(flattenedTopLevelPatterns); + } + })); + }); + + if (_this6.flags.har) { + steps.push((() => { + var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { + const formattedDate = new Date().toISOString().replace(/:/g, '-'); + const filename = `yarn-install_${formattedDate}.har`; + _this6.reporter.step(curr, total, _this6.reporter.lang('savingHar', filename), emoji.get('black_circle_for_record')); + yield _this6.config.requestManager.saveHar(filename); + }); + + return function (_x3, _x4) { + return _ref21.apply(this, arguments); + }; + })()); + } + + if (yield _this6.shouldClean()) { + steps.push((() => { + var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { + _this6.reporter.step(curr, total, _this6.reporter.lang('cleaningModules'), emoji.get('recycle')); + yield (0, (_autoclean || _load_autoclean()).clean)(_this6.config, _this6.reporter); + }); + + return function (_x5, _x6) { + return _ref22.apply(this, arguments); + }; + })()); + } + + let currentStep = 0; + for (var _iterator11 = steps, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { + var _ref23; + + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref23 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref23 = _i11.value; + } + + const step = _ref23; + + const stepResult = yield step(++currentStep, steps.length); + if (stepResult && stepResult.bailout) { + if (_this6.flags.audit) { + audit.summary(); + } + if (auditFoundProblems) { + _this6.reporter.warn(_this6.reporter.lang('auditRunAuditForDetails')); + } + _this6.maybeOutputUpdate(); + return flattenedTopLevelPatterns; + } + } + + // fin! + if (_this6.flags.audit) { + audit.summary(); + } + if (auditFoundProblems) { + _this6.reporter.warn(_this6.reporter.lang('auditRunAuditForDetails')); + } + yield _this6.saveLockfileAndIntegrity(topLevelPatterns, workspaceLayout); + yield _this6.persistChanges(); + _this6.maybeOutputUpdate(); + _this6.config.requestManager.clearCache(); + return flattenedTopLevelPatterns; + })(); + } + + checkCompatibility() { + var _this7 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _ref24 = yield _this7.fetchRequestFromCwd(); + + const manifest = _ref24.manifest; + + yield (_packageCompatibility || _load_packageCompatibility()).checkOne(manifest, _this7.config, _this7.flags.ignoreEngines); + })(); + } + + persistChanges() { + var _this8 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // get all the different registry manifests in this folder + const manifests = yield _this8.config.getRootManifests(); + + if (yield _this8.applyChanges(manifests)) { + yield _this8.config.saveRootManifests(manifests); + } + })(); + } + + applyChanges(manifests) { + let hasChanged = false; + + if (this.config.plugnplayPersist) { + const object = manifests.npm.object; + + + if (typeof object.installConfig !== 'object') { + object.installConfig = {}; + } + + if (this.config.plugnplayEnabled && object.installConfig.pnp !== true) { + object.installConfig.pnp = true; + hasChanged = true; + } else if (!this.config.plugnplayEnabled && typeof object.installConfig.pnp !== 'undefined') { + delete object.installConfig.pnp; + hasChanged = true; + } + + if (Object.keys(object.installConfig).length === 0) { + delete object.installConfig; + } + } + + return Promise.resolve(hasChanged); + } + + /** + * Check if we should run the cleaning step. + */ + + shouldClean() { + return (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).CLEAN_FILENAME)); + } + + /** + * TODO + */ + + flatten(patterns) { + var _this9 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (!_this9.flags.flat) { + return patterns; + } + + const flattenedPatterns = []; + + for (var _iterator12 = _this9.resolver.getAllDependencyNamesByLevelOrder(patterns), _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { + var _ref25; + + if (_isArray12) { + if (_i12 >= _iterator12.length) break; + _ref25 = _iterator12[_i12++]; + } else { + _i12 = _iterator12.next(); + if (_i12.done) break; + _ref25 = _i12.value; + } + + const name = _ref25; + + const infos = _this9.resolver.getAllInfoForPackageName(name).filter(function (manifest) { + const ref = manifest._reference; + invariant(ref, 'expected package reference'); + return !ref.ignore; + }); + + if (infos.length === 0) { + continue; + } + + if (infos.length === 1) { + // single version of this package + // take out a single pattern as multiple patterns may have resolved to this package + flattenedPatterns.push(_this9.resolver.patternsByPackage[name][0]); + continue; + } + + const options = infos.map(function (info) { + const ref = info._reference; + invariant(ref, 'expected reference'); + return { + // TODO `and is required by {PARENT}`, + name: _this9.reporter.lang('manualVersionResolutionOption', ref.patterns.join(', '), info.version), + + value: info.version + }; + }); + const versions = infos.map(function (info) { + return info.version; + }); + let version; + + const resolutionVersion = _this9.resolutions[name]; + if (resolutionVersion && versions.indexOf(resolutionVersion) >= 0) { + // use json `resolution` version + version = resolutionVersion; + } else { + version = yield _this9.reporter.select(_this9.reporter.lang('manualVersionResolution', name), _this9.reporter.lang('answer'), options); + _this9.resolutions[name] = version; + } + + flattenedPatterns.push(_this9.resolver.collapseAllVersionsOfPackage(name, version)); + } + + // save resolutions to their appropriate root manifest + if (Object.keys(_this9.resolutions).length) { + const manifests = yield _this9.config.getRootManifests(); + + for (const name in _this9.resolutions) { + const version = _this9.resolutions[name]; + + const patterns = _this9.resolver.patternsByPackage[name]; + if (!patterns) { + continue; + } + + let manifest; + for (var _iterator13 = patterns, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { + var _ref26; + + if (_isArray13) { + if (_i13 >= _iterator13.length) break; + _ref26 = _iterator13[_i13++]; + } else { + _i13 = _iterator13.next(); + if (_i13.done) break; + _ref26 = _i13.value; + } + + const pattern = _ref26; + + manifest = _this9.resolver.getResolvedPattern(pattern); + if (manifest) { + break; + } + } + invariant(manifest, 'expected manifest'); + + const ref = manifest._reference; + invariant(ref, 'expected reference'); + + const object = manifests[ref.registry].object; + object.resolutions = object.resolutions || {}; + object.resolutions[name] = version; + } + + yield _this9.config.saveRootManifests(manifests); + } + + return flattenedPatterns; + })(); + } + + /** + * Remove offline tarballs that are no longer required + */ + + pruneOfflineMirror(lockfile) { + var _this10 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const mirror = _this10.config.getOfflineMirrorPath(); + if (!mirror) { + return; + } + + const requiredTarballs = new Set(); + for (const dependency in lockfile) { + const resolved = lockfile[dependency].resolved; + if (resolved) { + const basename = path.basename(resolved.split('#')[0]); + if (dependency[0] === '@' && basename[0] !== '@') { + requiredTarballs.add(`${dependency.split('/')[0]}-${basename}`); + } + requiredTarballs.add(basename); + } + } + + const mirrorFiles = yield (_fs || _load_fs()).walk(mirror); + for (var _iterator14 = mirrorFiles, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { + var _ref27; + + if (_isArray14) { + if (_i14 >= _iterator14.length) break; + _ref27 = _iterator14[_i14++]; + } else { + _i14 = _iterator14.next(); + if (_i14.done) break; + _ref27 = _i14.value; + } + + const file = _ref27; + + const isTarball = path.extname(file.basename) === '.tgz'; + // if using experimental-pack-script-packages-in-mirror flag, don't unlink prebuilt packages + const hasPrebuiltPackage = file.relative.startsWith('prebuilt/'); + if (isTarball && !hasPrebuiltPackage && !requiredTarballs.has(file.basename)) { + yield (_fs || _load_fs()).unlink(file.absolute); + } + } + })(); + } + + /** + * Save updated integrity and lockfiles. + */ + + saveLockfileAndIntegrity(patterns, workspaceLayout) { + var _this11 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const resolvedPatterns = {}; + Object.keys(_this11.resolver.patterns).forEach(function (pattern) { + if (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern)) { + resolvedPatterns[pattern] = _this11.resolver.patterns[pattern]; + } + }); + + // TODO this code is duplicated in a few places, need a common way to filter out workspace patterns from lockfile + patterns = patterns.filter(function (p) { + return !workspaceLayout || !workspaceLayout.getManifestByPattern(p); + }); + + const lockfileBasedOnResolver = _this11.lockfile.getLockfile(resolvedPatterns); + + if (_this11.config.pruneOfflineMirror) { + yield _this11.pruneOfflineMirror(lockfileBasedOnResolver); + } + + // write integrity hash + if (!_this11.config.plugnplayEnabled) { + yield _this11.integrityChecker.save(patterns, lockfileBasedOnResolver, _this11.flags, workspaceLayout, _this11.scripts.getArtifacts()); + } + + // --no-lockfile or --pure-lockfile or --frozen-lockfile + if (_this11.flags.lockfile === false || _this11.flags.pureLockfile || _this11.flags.frozenLockfile) { + return; + } + + const lockFileHasAllPatterns = patterns.every(function (p) { + return _this11.lockfile.getLocked(p); + }); + const lockfilePatternsMatch = Object.keys(_this11.lockfile.cache || {}).every(function (p) { + return lockfileBasedOnResolver[p]; + }); + const resolverPatternsAreSameAsInLockfile = Object.keys(lockfileBasedOnResolver).every(function (pattern) { + const manifest = _this11.lockfile.getLocked(pattern); + return manifest && manifest.resolved === lockfileBasedOnResolver[pattern].resolved && deepEqual(manifest.prebuiltVariants, lockfileBasedOnResolver[pattern].prebuiltVariants); + }); + const integrityPatternsAreSameAsInLockfile = Object.keys(lockfileBasedOnResolver).every(function (pattern) { + const existingIntegrityInfo = lockfileBasedOnResolver[pattern].integrity; + if (!existingIntegrityInfo) { + // if this entry does not have an integrity, no need to re-write the lockfile because of it + return true; + } + const manifest = _this11.lockfile.getLocked(pattern); + if (manifest && manifest.integrity) { + const manifestIntegrity = ssri.stringify(manifest.integrity); + return manifestIntegrity === existingIntegrityInfo; + } + return false; + }); + + // remove command is followed by install with force, lockfile will be rewritten in any case then + if (!_this11.flags.force && _this11.lockfile.parseResultType === 'success' && lockFileHasAllPatterns && lockfilePatternsMatch && resolverPatternsAreSameAsInLockfile && integrityPatternsAreSameAsInLockfile && patterns.length) { + return; + } + + // build lockfile location + const loc = path.join(_this11.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME); + + // write lockfile + const lockSource = (0, (_lockfile2 || _load_lockfile2()).stringify)(lockfileBasedOnResolver, false, _this11.config.enableLockfileVersions); + yield (_fs || _load_fs()).writeFilePreservingEol(loc, lockSource); + + _this11._logSuccessSaveLockfile(); + })(); + } + + _logSuccessSaveLockfile() { + this.reporter.success(this.reporter.lang('savedLockfile')); + } + + /** + * Load the dependency graph of the current install. Only does package resolving and wont write to the cwd. + */ + hydrate(ignoreUnusedPatterns) { + var _this12 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const request = yield _this12.fetchRequestFromCwd([], ignoreUnusedPatterns); + const depRequests = request.requests, + rawPatterns = request.patterns, + ignorePatterns = request.ignorePatterns, + workspaceLayout = request.workspaceLayout; + + + yield _this12.resolver.init(depRequests, { + isFlat: _this12.flags.flat, + isFrozen: _this12.flags.frozenLockfile, + workspaceLayout + }); + yield _this12.flatten(rawPatterns); + _this12.markIgnored(ignorePatterns); + + // fetch packages, should hit cache most of the time + const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this12.resolver.getManifests(), _this12.config); + _this12.resolver.updateManifests(manifests); + yield (_packageCompatibility || _load_packageCompatibility()).check(_this12.resolver.getManifests(), _this12.config, _this12.flags.ignoreEngines); + + // expand minimal manifests + for (var _iterator15 = _this12.resolver.getManifests(), _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { + var _ref28; + + if (_isArray15) { + if (_i15 >= _iterator15.length) break; + _ref28 = _iterator15[_i15++]; + } else { + _i15 = _iterator15.next(); + if (_i15.done) break; + _ref28 = _i15.value; + } + + const manifest = _ref28; + + const ref = manifest._reference; + invariant(ref, 'expected reference'); + const type = ref.remote.type; + // link specifier won't ever hit cache + + let loc = ''; + if (type === 'link') { + continue; + } else if (type === 'workspace') { + if (!ref.remote.reference) { + continue; + } + loc = ref.remote.reference; + } else { + loc = _this12.config.generateModuleCachePath(ref); + } + const newPkg = yield _this12.config.readManifest(loc); + yield _this12.resolver.updateManifest(ref, newPkg); + } + + return request; + })(); + } + + /** + * Check for updates every day and output a nag message if there's a newer version. + */ + + checkUpdate() { + if (this.config.nonInteractive) { + // don't show upgrade dialog on CI or non-TTY terminals + return; + } + + // don't check if disabled + if (this.config.getOption('disable-self-update-check')) { + return; + } + + // only check for updates once a day + const lastUpdateCheck = Number(this.config.getOption('lastUpdateCheck')) || 0; + if (lastUpdateCheck && Date.now() - lastUpdateCheck < ONE_DAY) { + return; + } + + // don't bug for updates on tagged releases + if ((_yarnVersion || _load_yarnVersion()).version.indexOf('-') >= 0) { + return; + } + + this._checkUpdate().catch(() => { + // swallow errors + }); + } + + _checkUpdate() { + var _this13 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + let latestVersion = yield _this13.config.requestManager.request({ + url: (_constants || _load_constants()).SELF_UPDATE_VERSION_URL + }); + invariant(typeof latestVersion === 'string', 'expected string'); + latestVersion = latestVersion.trim(); + if (!semver.valid(latestVersion)) { + return; + } + + // ensure we only check for updates periodically + _this13.config.registries.yarn.saveHomeConfig({ + lastUpdateCheck: Date.now() + }); + + if (semver.gt(latestVersion, (_yarnVersion || _load_yarnVersion()).version)) { + const installationMethod = yield (0, (_yarnVersion || _load_yarnVersion()).getInstallationMethod)(); + _this13.maybeOutputUpdate = function () { + _this13.reporter.warn(_this13.reporter.lang('yarnOutdated', latestVersion, (_yarnVersion || _load_yarnVersion()).version)); + + const command = getUpdateCommand(installationMethod); + if (command) { + _this13.reporter.info(_this13.reporter.lang('yarnOutdatedCommand')); + _this13.reporter.command(command); + } else { + const installer = getUpdateInstaller(installationMethod); + if (installer) { + _this13.reporter.info(_this13.reporter.lang('yarnOutdatedInstaller', installer)); + } + } + }; + } + })(); + } + + /** + * Method to override with a possible upgrade message. + */ + + maybeOutputUpdate() {} +} + +exports.Install = Install; +function hasWrapper(commander, args) { + return true; +} + +function setFlags(commander) { + commander.description('Yarn install is used to install all dependencies for a project.'); + commander.usage('install [flags]'); + commander.option('-A, --audit', 'Run vulnerability audit on installed packages'); + commander.option('-g, --global', 'DEPRECATED'); + commander.option('-S, --save', 'DEPRECATED - save package to your `dependencies`'); + commander.option('-D, --save-dev', 'DEPRECATED - save package to your `devDependencies`'); + commander.option('-P, --save-peer', 'DEPRECATED - save package to your `peerDependencies`'); + commander.option('-O, --save-optional', 'DEPRECATED - save package to your `optionalDependencies`'); + commander.option('-E, --save-exact', 'DEPRECATED'); + commander.option('-T, --save-tilde', 'DEPRECATED'); +} + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(52); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); return it; }; + /***/ }), -/* 27 */ +/* 36 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SubjectSubscriber; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subject; }); +/* unused harmony export AnonymousSubject */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__ = __webpack_require__(189); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__ = __webpack_require__(422); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__ = __webpack_require__(321); +/** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */ + + + + + + + +var SubjectSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubjectSubscriber, _super); + function SubjectSubscriber(destination) { + var _this = _super.call(this, destination) || this; + _this.destination = destination; + return _this; + } + return SubjectSubscriber; +}(__WEBPACK_IMPORTED_MODULE_2__Subscriber__["a" /* Subscriber */])); + +var Subject = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__["a" /* 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 __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* 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 __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* 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 __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* 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 __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); + } + else { + return _super.prototype._trySubscribe.call(this, subscriber); + } + }; + Subject.prototype._subscribe = function (subscriber) { + if (this.closed) { + throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); + } + else if (this.hasError) { + subscriber.error(this.thrownError); + return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY; + } + else if (this.isStopped) { + subscriber.complete(); + return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY; + } + else { + this.observers.push(subscriber); + return new __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__["a" /* SubjectSubscription */](this, subscriber); + } + }; + Subject.prototype.asObservable = function () { + var observable = new __WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */](); + observable.source = this; + return observable; + }; + Subject.create = function (destination, source) { + return new AnonymousSubject(destination, source); + }; + return Subject; +}(__WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */])); + +var AnonymousSubject = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY; + } + }; + return AnonymousSubject; +}(Subject)); + +//# sourceMappingURL=Subject.js.map + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.normalizePattern = normalizePattern; + +/** + * Explode and normalize a pattern into its name and range. + */ + +function normalizePattern(pattern) { + let hasVersion = false; + let range = 'latest'; + let name = pattern; + + // if we're a scope then remove the @ and add it back later + let isScoped = false; + if (name[0] === '@') { + isScoped = true; + name = name.slice(1); + } + + // take first part as the name + const parts = name.split('@'); + if (parts.length > 1) { + name = parts.shift(); + range = parts.join('@'); + + if (range) { + hasVersion = true; + } else { + range = '*'; + } + } + + // add back @ scope suffix + if (isScoped) { + name = `@${name}`; + } + + return { name, range, hasVersion }; +} + +/***/ }), +/* 38 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** @@ -4397,7 +7734,7 @@ module.exports = function(it){ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.17.4'; + var VERSION = '4.17.10'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -4528,7 +7865,6 @@ module.exports = function(it){ /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, - reLeadingDot = /^\./, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** @@ -4628,8 +7964,8 @@ module.exports = function(it){ reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)', - rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; @@ -4822,6 +8158,14 @@ module.exports = function(it){ /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); @@ -4836,34 +8180,6 @@ module.exports = function(it){ /*--------------------------------------------------------------------------*/ - /** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ - function addMapEntry(map, pair) { - // Don't return `map.set` because it's not chainable in IE 11. - map.set(pair[0], pair[1]); - return map; - } - - /** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ - function addSetEntry(set, value) { - // Don't return `set.add` because it's not chainable in IE 11. - set.add(value); - return set; - } - /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. @@ -5630,6 +8946,20 @@ module.exports = function(it){ return result; } + /** + * Gets the value at `key`, unless `key` is "__proto__". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function safeGet(object, key) { + return key == '__proto__' + ? undefined + : object[key]; + } + /** * Converts `set` to an array of its values. * @@ -7062,7 +10392,7 @@ module.exports = function(it){ if (!cloneableTags[tag]) { return object ? value : {}; } - result = initCloneByTag(value, tag, baseClone, isDeep); + result = initCloneByTag(value, tag, isDeep); } } // Check for circular references and return its corresponding clone. @@ -7073,6 +10403,22 @@ module.exports = function(it){ } stack.set(value, result); + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + + return result; + } + + if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + + return result; + } + var keysFunc = isFull ? (isFlat ? getAllKeysIn : getAllKeys) : (isFlat ? keysIn : keys); @@ -8000,7 +11346,7 @@ module.exports = function(it){ } else { var newValue = customizer - ? customizer(object[key], srcValue, (key + ''), object, source, stack) + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { @@ -8027,8 +11373,8 @@ module.exports = function(it){ * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = object[key], - srcValue = source[key], + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { @@ -8936,20 +12282,6 @@ module.exports = function(it){ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } - /** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned map. - */ - function cloneMap(map, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map); - return arrayReduce(array, addMapEntry, new map.constructor); - } - /** * Creates a clone of `regexp`. * @@ -8963,20 +12295,6 @@ module.exports = function(it){ return result; } - /** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned set. - */ - function cloneSet(set, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set); - return arrayReduce(array, addSetEntry, new set.constructor); - } - /** * Creates a clone of the `symbol` object. * @@ -10571,7 +13889,7 @@ module.exports = function(it){ */ function initCloneArray(array) { var length = array.length, - result = array.constructor(length); + result = new array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { @@ -10598,16 +13916,15 @@ module.exports = function(it){ * Initializes an object clone based on its `toStringTag`. * * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. * * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. - * @param {Function} cloneFunc The function to clone values. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ - function initCloneByTag(object, tag, cloneFunc, isDeep) { + function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: @@ -10626,7 +13943,7 @@ module.exports = function(it){ return cloneTypedArray(object, isDeep); case mapTag: - return cloneMap(object, isDeep, cloneFunc); + return new Ctor; case numberTag: case stringTag: @@ -10636,7 +13953,7 @@ module.exports = function(it){ return cloneRegExp(object); case setTag: - return cloneSet(object, isDeep, cloneFunc); + return new Ctor; case symbolTag: return cloneSymbol(object); @@ -10683,10 +14000,13 @@ module.exports = function(it){ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { + var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); } /** @@ -11136,11 +14456,11 @@ module.exports = function(it){ */ var stringToPath = memoizeCapped(function(string) { var result = []; - if (reLeadingDot.test(string)) { + if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } - string.replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); @@ -14748,9 +18068,11 @@ module.exports = function(it){ function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, - result = wait - timeSinceLastCall; + timeWaiting = wait - timeSinceLastCall; - return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; } function shouldInvoke(time) { @@ -17182,9 +20504,35 @@ module.exports = function(it){ * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var defaults = baseRest(function(args) { - args.push(undefined, customDefaultsAssignIn); - return apply(assignInWith, undefined, args); + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; }); /** @@ -17581,6 +20929,11 @@ module.exports = function(it){ * // => { '1': 'c', '2': 'b' } */ var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + result[value] = key; }, constant(identity)); @@ -17611,6 +20964,11 @@ module.exports = function(it){ * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + if (hasOwnProperty.call(result, value)) { result[value].push(key); } else { @@ -21469,1201 +24827,406 @@ module.exports = function(it){ } }.call(this)); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(163)(module))) /***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { +/* 39 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return EMPTY; }); +/* harmony export (immutable) */ __webpack_exports__["a"] = empty; +/* unused harmony export emptyScheduled */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */ - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.wrapLifecycle = exports.run = exports.install = exports.Install = undefined; - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(29)); +var EMPTY = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return subscriber.complete(); }); +function empty(scheduler) { + return scheduler ? emptyScheduled(scheduler) : EMPTY; } - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); +function emptyScheduled(scheduler) { + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); }); } +//# sourceMappingURL=empty.js.map -let install = exports.install = (() => { - var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile) { - yield wrapLifecycle(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const install = new Install(flags, config, reporter, lockfile); - yield install.init(); - })); - }); - - return function install(_x17, _x18, _x19, _x20) { - return _ref11.apply(this, arguments); - }; -})(); - -let run = exports.run = (() => { - var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - let lockfile; - let error = 'installCommandRenamed'; - if (flags.lockfile === false) { - lockfile = new (_lockfile || _load_lockfile()).default(); - } else { - lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); - } - - if (args.length) { - const exampleArgs = args.slice(); - - if (flags.saveDev) { - exampleArgs.push('--dev'); - } - if (flags.savePeer) { - exampleArgs.push('--peer'); - } - if (flags.saveOptional) { - exampleArgs.push('--optional'); - } - if (flags.saveExact) { - exampleArgs.push('--exact'); - } - if (flags.saveTilde) { - exampleArgs.push('--tilde'); - } - let command = 'add'; - if (flags.global) { - error = 'globalFlagRemoved'; - command = 'global add'; - } - throw new (_errors || _load_errors()).MessageError(reporter.lang(error, `yarn ${command} ${exampleArgs.join(' ')}`)); - } - - yield install(config, reporter, flags, lockfile); - }); - - return function run(_x21, _x22, _x23, _x24) { - return _ref13.apply(this, arguments); - }; -})(); - -let wrapLifecycle = exports.wrapLifecycle = (() => { - var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags, factory) { - yield config.executeLifecycleScript('preinstall'); - - yield factory(); - - // npm behaviour, seems kinda funky but yay compatibility - yield config.executeLifecycleScript('install'); - yield config.executeLifecycleScript('postinstall'); - - if (!config.production) { - if (!config.disablePrepublish) { - yield config.executeLifecycleScript('prepublish'); - } - yield config.executeLifecycleScript('prepare'); - } - }); - - return function wrapLifecycle(_x25, _x26, _x27) { - return _ref14.apply(this, arguments); - }; -})(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _index; - -function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(169)); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -var _integrityChecker; - -function _load_integrityChecker() { - return _integrityChecker = _interopRequireDefault(__webpack_require__(160)); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(12)); -} - -var _lockfile2; - -function _load_lockfile2() { - return _lockfile2 = __webpack_require__(12); -} - -var _packageFetcher; - -function _load_packageFetcher() { - return _packageFetcher = _interopRequireWildcard(__webpack_require__(266)); -} - -var _packageInstallScripts; - -function _load_packageInstallScripts() { - return _packageInstallScripts = _interopRequireDefault(__webpack_require__(421)); -} - -var _packageCompatibility; - -function _load_packageCompatibility() { - return _packageCompatibility = _interopRequireWildcard(__webpack_require__(265)); -} - -var _packageResolver; - -function _load_packageResolver() { - return _packageResolver = _interopRequireDefault(__webpack_require__(267)); -} - -var _packageLinker; - -function _load_packageLinker() { - return _packageLinker = _interopRequireDefault(__webpack_require__(161)); -} - -var _index2; - -function _load_index2() { - return _index2 = __webpack_require__(35); -} - -var _index3; - -function _load_index3() { - return _index3 = __webpack_require__(36); -} - -var _autoclean; - -function _load_autoclean() { - return _autoclean = __webpack_require__(256); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); -} - -var _normalizePattern; - -function _load_normalizePattern() { - return _normalizePattern = __webpack_require__(31); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(18)); -} - -var _yarnVersion; - -function _load_yarnVersion() { - return _yarnVersion = __webpack_require__(91); -} - -var _workspaceLayout; - -function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(81)); -} - -var _resolutionMap; - -function _load_resolutionMap() { - return _resolutionMap = _interopRequireDefault(__webpack_require__(270)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const emoji = __webpack_require__(301); - -const invariant = __webpack_require__(6); -const path = __webpack_require__(0); -const semver = __webpack_require__(17); -const uuid = __webpack_require__(89); - -const ONE_DAY = 1000 * 60 * 60 * 24; - -/** - * Try and detect the installation method for Yarn and provide a command to update it with. - */ - -function getUpdateCommand(installationMethod) { - if (installationMethod === 'tar') { - return `curl -o- -L ${(_constants || _load_constants()).YARN_INSTALLER_SH} | bash`; - } - - if (installationMethod === 'homebrew') { - return 'brew upgrade yarn'; - } - - if (installationMethod === 'deb') { - return 'sudo apt-get update && sudo apt-get install yarn'; - } - - if (installationMethod === 'rpm') { - return 'sudo yum install yarn'; - } - - if (installationMethod === 'npm') { - return 'npm install --global yarn'; - } - - if (installationMethod === 'chocolatey') { - return 'choco upgrade yarn'; - } - - if (installationMethod === 'apk') { - return 'apk update && apk add -u yarn'; - } - - return null; -} - -function getUpdateInstaller(installationMethod) { - // Windows - if (installationMethod === 'msi') { - return (_constants || _load_constants()).YARN_INSTALLER_MSI; - } - - return null; -} - -function normalizeFlags(config, rawFlags) { - const flags = { - // install - har: !!rawFlags.har, - ignorePlatform: !!rawFlags.ignorePlatform, - ignoreEngines: !!rawFlags.ignoreEngines, - ignoreScripts: !!rawFlags.ignoreScripts, - ignoreOptional: !!rawFlags.ignoreOptional, - force: !!rawFlags.force, - flat: !!rawFlags.flat, - lockfile: rawFlags.lockfile !== false, - pureLockfile: !!rawFlags.pureLockfile, - skipIntegrityCheck: !!rawFlags.skipIntegrityCheck, - frozenLockfile: !!rawFlags.frozenLockfile, - linkDuplicates: !!rawFlags.linkDuplicates, - checkFiles: !!rawFlags.checkFiles, - - // add - peer: !!rawFlags.peer, - dev: !!rawFlags.dev, - optional: !!rawFlags.optional, - exact: !!rawFlags.exact, - tilde: !!rawFlags.tilde, - ignoreWorkspaceRootCheck: !!rawFlags.ignoreWorkspaceRootCheck, - - // outdated, update-interactive - includeWorkspaceDeps: !!rawFlags.includeWorkspaceDeps, - - // remove, update - workspaceRootIsCwd: rawFlags.workspaceRootIsCwd !== false - }; - - if (config.getOption('ignore-scripts')) { - flags.ignoreScripts = true; - } - - if (config.getOption('ignore-platform')) { - flags.ignorePlatform = true; - } - - if (config.getOption('ignore-engines')) { - flags.ignoreEngines = true; - } - - if (config.getOption('ignore-optional')) { - flags.ignoreOptional = true; - } - - if (config.getOption('force')) { - flags.force = true; - } - - return flags; -} - -class Install { - constructor(flags, config, reporter, lockfile) { - this.rootManifestRegistries = []; - this.rootPatternsToOrigin = (0, (_map || _load_map()).default)(); - this.lockfile = lockfile; - this.reporter = reporter; - this.config = config; - this.flags = normalizeFlags(config, flags); - this.resolutions = (0, (_map || _load_map()).default)(); // Legacy resolutions field used for flat install mode - this.resolutionMap = new (_resolutionMap || _load_resolutionMap()).default(config); // Selective resolutions for nested dependencies - this.resolver = new (_packageResolver || _load_packageResolver()).default(config, lockfile, this.resolutionMap); - this.integrityChecker = new (_integrityChecker || _load_integrityChecker()).default(config); - this.linker = new (_packageLinker || _load_packageLinker()).default(config, this.resolver); - this.scripts = new (_packageInstallScripts || _load_packageInstallScripts()).default(config, this.resolver, this.flags.force); - } - - /** - * Create a list of dependency requests from the current directories manifests. - */ - - fetchRequestFromCwd() { - var _this = this; - - let excludePatterns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - let ignoreUnusedPatterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const patterns = []; - const deps = []; - let resolutionDeps = []; - const manifest = {}; - - const ignorePatterns = []; - const usedPatterns = []; - let workspaceLayout; - - // some commands should always run in the context of the entire workspace - const cwd = _this.flags.includeWorkspaceDeps || _this.flags.workspaceRootIsCwd ? _this.config.lockfileFolder : _this.config.cwd; - - // non-workspaces are always root, otherwise check for workspace root - const cwdIsRoot = !_this.config.workspaceRootFolder || _this.config.lockfileFolder === cwd; - - // exclude package names that are in install args - const excludeNames = []; - for (const pattern of excludePatterns) { - // can't extract a package name from this - if ((0, (_index3 || _load_index3()).getExoticResolver)(pattern)) { - continue; - } - - // extract the name - const parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern); - excludeNames.push(parts.name); - } - - const stripExcluded = function (manifest) { - for (const exclude of excludeNames) { - if (manifest.dependencies && manifest.dependencies[exclude]) { - delete manifest.dependencies[exclude]; - } - if (manifest.devDependencies && manifest.devDependencies[exclude]) { - delete manifest.devDependencies[exclude]; - } - if (manifest.optionalDependencies && manifest.optionalDependencies[exclude]) { - delete manifest.optionalDependencies[exclude]; - } - } - }; - - for (const registry of Object.keys((_index2 || _load_index2()).registries)) { - const filename = (_index2 || _load_index2()).registries[registry].filename; - - const loc = path.join(cwd, filename); - if (!(yield (_fs || _load_fs()).exists(loc))) { - continue; - } - - _this.rootManifestRegistries.push(registry); - - const projectManifestJson = yield _this.config.readJson(loc); - yield (0, (_index || _load_index()).default)(projectManifestJson, cwd, _this.config, cwdIsRoot); - - Object.assign(_this.resolutions, projectManifestJson.resolutions); - Object.assign(manifest, projectManifestJson); - - _this.resolutionMap.init(_this.resolutions); - for (const packageName of Object.keys(_this.resolutionMap.resolutionsByPackage)) { - for (const _ref of _this.resolutionMap.resolutionsByPackage[packageName]) { - const pattern = _ref.pattern; - - resolutionDeps = [...resolutionDeps, { registry, pattern, optional: false, hint: 'resolution' }]; - } - } - - const pushDeps = function (depType, manifest, _ref2, isUsed) { - let hint = _ref2.hint, - optional = _ref2.optional; - - if (ignoreUnusedPatterns && !isUsed) { - return; - } - // We only take unused dependencies into consideration to get deterministic hoisting. - // Since flat mode doesn't care about hoisting and everything is top level and specified then we can safely - // leave these out. - if (_this.flags.flat && !isUsed) { - return; - } - const depMap = manifest[depType]; - for (const name in depMap) { - if (excludeNames.indexOf(name) >= 0) { - continue; - } - - let pattern = name; - if (!_this.lockfile.getLocked(pattern)) { - // when we use --save we save the dependency to the lockfile with just the name rather than the - // version combo - pattern += '@' + depMap[name]; - } - - // normalization made sure packages are mentioned only once - if (isUsed) { - usedPatterns.push(pattern); - } else { - ignorePatterns.push(pattern); - } - - _this.rootPatternsToOrigin[pattern] = depType; - patterns.push(pattern); - deps.push({ pattern, registry, hint, optional, workspaceName: manifest.name, workspaceLoc: manifest._loc }); - } - }; - - pushDeps('dependencies', projectManifestJson, { hint: null, optional: false }, true); - pushDeps('devDependencies', projectManifestJson, { hint: 'dev', optional: false }, !_this.config.production); - pushDeps('optionalDependencies', projectManifestJson, { hint: 'optional', optional: true }, true); - - if (_this.config.workspaceRootFolder) { - const workspaceLoc = cwdIsRoot ? loc : path.join(_this.config.lockfileFolder, filename); - const workspacesRoot = path.dirname(workspaceLoc); - - let workspaceManifestJson = projectManifestJson; - if (!cwdIsRoot) { - // the manifest we read before was a child workspace, so get the root - workspaceManifestJson = yield _this.config.readJson(workspaceLoc); - yield (0, (_index || _load_index()).default)(workspaceManifestJson, workspacesRoot, _this.config, true); - } - - const workspaces = yield _this.config.resolveWorkspaces(workspacesRoot, workspaceManifestJson); - workspaceLayout = new (_workspaceLayout || _load_workspaceLayout()).default(workspaces, _this.config); - - // add virtual manifest that depends on all workspaces, this way package hoisters and resolvers will work fine - const workspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.dependencies); - for (const workspaceName of Object.keys(workspaces)) { - const workspaceManifest = workspaces[workspaceName].manifest; - workspaceDependencies[workspaceName] = workspaceManifest.version; - - // include dependencies from all workspaces - if (_this.flags.includeWorkspaceDeps) { - pushDeps('dependencies', workspaceManifest, { hint: null, optional: false }, true); - pushDeps('devDependencies', workspaceManifest, { hint: 'dev', optional: false }, !_this.config.production); - pushDeps('optionalDependencies', workspaceManifest, { hint: 'optional', optional: true }, true); - } - } - const virtualDependencyManifest = { - _uid: '', - name: `workspace-aggregator-${uuid.v4()}`, - version: '1.0.0', - _registry: 'npm', - _loc: workspacesRoot, - dependencies: workspaceDependencies, - devDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.devDependencies), - optionalDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.optionalDependencies) - }; - workspaceLayout.virtualManifestName = virtualDependencyManifest.name; - const virtualDep = {}; - virtualDep[virtualDependencyManifest.name] = virtualDependencyManifest.version; - workspaces[virtualDependencyManifest.name] = { loc: workspacesRoot, manifest: virtualDependencyManifest }; - - // ensure dependencies that should be excluded are stripped from the correct manifest - stripExcluded(cwdIsRoot ? virtualDependencyManifest : workspaces[projectManifestJson.name].manifest); - - pushDeps('workspaces', { workspaces: virtualDep }, { hint: 'workspaces', optional: false }, true); - } - - break; - } - - // inherit root flat flag - if (manifest.flat) { - _this.flags.flat = true; - } - - return { - requests: [...resolutionDeps, ...deps], - patterns, - manifest, - usedPatterns, - ignorePatterns, - workspaceLayout - }; - })(); - } - - /** - * TODO description - */ - - prepareRequests(requests) { - return requests; - } - - preparePatterns(patterns) { - return patterns; - } - - bailout(patterns, workspaceLayout) { - var _this2 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (_this2.flags.skipIntegrityCheck || _this2.flags.force) { - return false; - } - const lockfileCache = _this2.lockfile.cache; - if (!lockfileCache) { - return false; - } - const lockfileClean = _this2.lockfile.parseResultType === 'success'; - const match = yield _this2.integrityChecker.check(patterns, lockfileCache, _this2.flags, workspaceLayout); - if (_this2.flags.frozenLockfile && (!lockfileClean || match.missingPatterns.length > 0)) { - throw new (_errors || _load_errors()).MessageError(_this2.reporter.lang('frozenLockfileError')); - } - - const haveLockfile = yield (_fs || _load_fs()).exists(path.join(_this2.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); - - if (match.integrityMatches && haveLockfile && lockfileClean) { - _this2.reporter.success(_this2.reporter.lang('upToDate')); - return true; - } - - if (match.integrityFileMissing && haveLockfile) { - // Integrity file missing, force script installations - _this2.scripts.setForce(true); - return false; - } - - if (match.hardRefreshRequired) { - // e.g. node version doesn't match, force script installations - _this2.scripts.setForce(true); - return false; - } - - if (!patterns.length && !match.integrityFileMissing) { - _this2.reporter.success(_this2.reporter.lang('nothingToInstall')); - yield _this2.createEmptyManifestFolders(); - yield _this2.saveLockfileAndIntegrity(patterns, workspaceLayout); - return true; - } - - return false; - })(); - } - - /** - * Produce empty folders for all used root manifests. - */ - - createEmptyManifestFolders() { - var _this3 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (_this3.config.modulesFolder) { - // already created - return; - } - - for (const registryName of _this3.rootManifestRegistries) { - const folder = _this3.config.registries[registryName].folder; - - yield (_fs || _load_fs()).mkdirp(path.join(_this3.config.lockfileFolder, folder)); - } - })(); - } - - /** - * TODO description - */ - - markIgnored(patterns) { - for (const pattern of patterns) { - const manifest = this.resolver.getStrictResolvedPattern(pattern); - const ref = manifest._reference; - invariant(ref, 'expected package reference'); - - // just mark the package as ignored. if the package is used by a required package, the hoister - // will take care of that. - ref.ignore = true; - } - } - - /** - * TODO description - */ - - init() { - var _this4 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this4.checkUpdate(); - - // warn if we have a shrinkwrap - if (yield (_fs || _load_fs()).exists(path.join(_this4.config.lockfileFolder, 'npm-shrinkwrap.json'))) { - _this4.reporter.warn(_this4.reporter.lang('shrinkwrapWarning')); - } - - let flattenedTopLevelPatterns = []; - const steps = []; - - var _ref3 = yield _this4.fetchRequestFromCwd(); - - const depRequests = _ref3.requests, - rawPatterns = _ref3.patterns, - ignorePatterns = _ref3.ignorePatterns, - workspaceLayout = _ref3.workspaceLayout, - manifest = _ref3.manifest; - - let topLevelPatterns = []; - - const artifacts = yield _this4.integrityChecker.getArtifacts(); - if (artifacts) { - _this4.linker.setArtifacts(artifacts); - _this4.scripts.setArtifacts(artifacts); - } - - if (!_this4.flags.ignoreEngines && typeof manifest.engines === 'object') { - steps.push((() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this4.reporter.step(curr, total, _this4.reporter.lang('checkingManifest'), emoji.get('mag')); - yield (_packageCompatibility || _load_packageCompatibility()).checkOne((0, (_extends2 || _load_extends()).default)({ _reference: {} }, manifest), _this4.config, _this4.flags.ignoreEngines); - }); - - return function (_x3, _x4) { - return _ref4.apply(this, arguments); - }; - })()); - } - - steps.push((() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this4.reporter.step(curr, total, _this4.reporter.lang('resolvingPackages'), emoji.get('mag')); - _this4.resolutionMap.setTopLevelPatterns(rawPatterns); - yield _this4.resolver.init(_this4.prepareRequests(depRequests), { - isFlat: _this4.flags.flat, - isFrozen: _this4.flags.frozenLockfile, - workspaceLayout - }); - topLevelPatterns = _this4.preparePatterns(rawPatterns); - flattenedTopLevelPatterns = yield _this4.flatten(topLevelPatterns); - return { bailout: yield _this4.bailout(topLevelPatterns, workspaceLayout) }; - }); - - return function (_x5, _x6) { - return _ref5.apply(this, arguments); - }; - })()); - - steps.push((() => { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this4.markIgnored(ignorePatterns); - _this4.reporter.step(curr, total, _this4.reporter.lang('fetchingPackages'), emoji.get('truck')); - const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this4.resolver.getManifests(), _this4.config); - _this4.resolver.updateManifests(manifests); - yield (_packageCompatibility || _load_packageCompatibility()).check(_this4.resolver.getManifests(), _this4.config, _this4.flags.ignoreEngines); - }); - - return function (_x7, _x8) { - return _ref6.apply(this, arguments); - }; - })()); - - steps.push((() => { - var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - // remove integrity hash to make this operation atomic - yield _this4.integrityChecker.removeIntegrityFile(); - _this4.reporter.step(curr, total, _this4.reporter.lang('linkingDependencies'), emoji.get('link')); - yield _this4.linker.init(flattenedTopLevelPatterns, workspaceLayout, { - linkDuplicates: _this4.flags.linkDuplicates, - ignoreOptional: _this4.flags.ignoreOptional - }); - }); - - return function (_x9, _x10) { - return _ref7.apply(this, arguments); - }; - })()); - - steps.push((() => { - var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this4.reporter.step(curr, total, _this4.flags.force ? _this4.reporter.lang('rebuildingPackages') : _this4.reporter.lang('buildingFreshPackages'), emoji.get('page_with_curl')); - - if (_this4.flags.ignoreScripts) { - _this4.reporter.warn(_this4.reporter.lang('ignoredScripts')); - } else { - yield _this4.scripts.init(flattenedTopLevelPatterns); - } - }); - - return function (_x11, _x12) { - return _ref8.apply(this, arguments); - }; - })()); - - if (_this4.flags.har) { - steps.push((() => { - var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - const formattedDate = new Date().toISOString().replace(/:/g, '-'); - const filename = `yarn-install_${formattedDate}.har`; - _this4.reporter.step(curr, total, _this4.reporter.lang('savingHar', filename), emoji.get('black_circle_for_record')); - yield _this4.config.requestManager.saveHar(filename); - }); - - return function (_x13, _x14) { - return _ref9.apply(this, arguments); - }; - })()); - } - - if (yield _this4.shouldClean()) { - steps.push((() => { - var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { - _this4.reporter.step(curr, total, _this4.reporter.lang('cleaningModules'), emoji.get('recycle')); - yield (0, (_autoclean || _load_autoclean()).clean)(_this4.config, _this4.reporter); - }); - - return function (_x15, _x16) { - return _ref10.apply(this, arguments); - }; - })()); - } - - let currentStep = 0; - for (const step of steps) { - const stepResult = yield step(++currentStep, steps.length); - if (stepResult && stepResult.bailout) { - _this4.maybeOutputUpdate(); - return flattenedTopLevelPatterns; - } - } - - // fin! - // The second condition is to make sure lockfile can be updated when running `remove` command. - if (topLevelPatterns.length || (yield (_fs || _load_fs()).exists(path.join(_this4.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)))) { - yield _this4.saveLockfileAndIntegrity(topLevelPatterns, workspaceLayout); - } else { - _this4.reporter.info(_this4.reporter.lang('notSavedLockfileNoDependencies')); - } - _this4.maybeOutputUpdate(); - _this4.config.requestManager.clearCache(); - return flattenedTopLevelPatterns; - })(); - } - - /** - * Check if we should run the cleaning step. - */ - - shouldClean() { - return (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).CLEAN_FILENAME)); - } - - /** - * TODO - */ - - flatten(patterns) { - var _this5 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (!_this5.flags.flat) { - return patterns; - } - - const flattenedPatterns = []; - - for (const name of _this5.resolver.getAllDependencyNamesByLevelOrder(patterns)) { - const infos = _this5.resolver.getAllInfoForPackageName(name).filter(function (manifest) { - const ref = manifest._reference; - invariant(ref, 'expected package reference'); - return !ref.ignore; - }); - - if (infos.length === 0) { - continue; - } - - if (infos.length === 1) { - // single version of this package - // take out a single pattern as multiple patterns may have resolved to this package - flattenedPatterns.push(_this5.resolver.patternsByPackage[name][0]); - continue; - } - - const options = infos.map(function (info) { - const ref = info._reference; - invariant(ref, 'expected reference'); - return { - // TODO `and is required by {PARENT}`, - name: _this5.reporter.lang('manualVersionResolutionOption', ref.patterns.join(', '), info.version), - - value: info.version - }; - }); - const versions = infos.map(function (info) { - return info.version; - }); - let version; - - const resolutionVersion = _this5.resolutions[name]; - if (resolutionVersion && versions.indexOf(resolutionVersion) >= 0) { - // use json `resolution` version - version = resolutionVersion; - } else { - version = yield _this5.reporter.select(_this5.reporter.lang('manualVersionResolution', name), _this5.reporter.lang('answer'), options); - _this5.resolutions[name] = version; - } - - flattenedPatterns.push(_this5.resolver.collapseAllVersionsOfPackage(name, version)); - } - - // save resolutions to their appropriate root manifest - if (Object.keys(_this5.resolutions).length) { - const manifests = yield _this5.config.getRootManifests(); - - for (const name in _this5.resolutions) { - const version = _this5.resolutions[name]; - - const patterns = _this5.resolver.patternsByPackage[name]; - if (!patterns) { - continue; - } - - let manifest; - for (const pattern of patterns) { - manifest = _this5.resolver.getResolvedPattern(pattern); - if (manifest) { - break; - } - } - invariant(manifest, 'expected manifest'); - - const ref = manifest._reference; - invariant(ref, 'expected reference'); - - const object = manifests[ref.registry].object; - object.resolutions = object.resolutions || {}; - object.resolutions[name] = version; - } - - yield _this5.config.saveRootManifests(manifests); - } - - return flattenedPatterns; - })(); - } - - /** - * Remove offline tarballs that are no longer required - */ - - pruneOfflineMirror(lockfile) { - var _this6 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const mirror = _this6.config.getOfflineMirrorPath(); - if (!mirror) { - return; - } - - const requiredTarballs = new Set(); - for (const dependency in lockfile) { - const resolved = lockfile[dependency].resolved; - if (resolved) { - const basename = path.basename(resolved.split('#')[0]); - if (dependency[0] === '@' && basename[0] !== '@') { - requiredTarballs.add(`${dependency.split('/')[0]}-${basename}`); - } - requiredTarballs.add(basename); - } - } - - const mirrorFiles = yield (_fs || _load_fs()).walk(mirror); - for (const file of mirrorFiles) { - const isTarball = path.extname(file.basename) === '.tgz'; - if (isTarball && !requiredTarballs.has(file.basename)) { - yield (_fs || _load_fs()).unlink(file.absolute); - } - } - })(); - } - - /** - * Save updated integrity and lockfiles. - */ - - saveLockfileAndIntegrity(patterns, workspaceLayout) { - var _this7 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const resolvedPatterns = {}; - Object.keys(_this7.resolver.patterns).forEach(function (pattern) { - if (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern)) { - resolvedPatterns[pattern] = _this7.resolver.patterns[pattern]; - } - }); - - // TODO this code is duplicated in a few places, need a common way to filter out workspace patterns from lockfile - patterns = patterns.filter(function (p) { - return !workspaceLayout || !workspaceLayout.getManifestByPattern(p); - }); - - const lockfileBasedOnResolver = _this7.lockfile.getLockfile(resolvedPatterns); - - if (_this7.config.pruneOfflineMirror) { - yield _this7.pruneOfflineMirror(lockfileBasedOnResolver); - } - - // write integrity hash - yield _this7.integrityChecker.save(patterns, lockfileBasedOnResolver, _this7.flags, workspaceLayout, _this7.scripts.getArtifacts()); - - // --no-lockfile or --pure-lockfile or --frozen-lockfile flag - if (_this7.flags.lockfile === false || _this7.flags.pureLockfile || _this7.flags.frozenLockfile) { - return; - } - - const lockFileHasAllPatterns = patterns.every(function (p) { - return _this7.lockfile.getLocked(p); - }); - const lockfilePatternsMatch = Object.keys(_this7.lockfile.cache || {}).every(function (p) { - return lockfileBasedOnResolver[p]; - }); - const resolverPatternsAreSameAsInLockfile = Object.keys(lockfileBasedOnResolver).every(function (pattern) { - const manifest = _this7.lockfile.getLocked(pattern); - return manifest && manifest.resolved === lockfileBasedOnResolver[pattern].resolved; - }); - - // remove command is followed by install with force, lockfile will be rewritten in any case then - if (!_this7.flags.force && _this7.lockfile.parseResultType === 'success' && lockFileHasAllPatterns && lockfilePatternsMatch && resolverPatternsAreSameAsInLockfile && patterns.length) { - return; - } - - // build lockfile location - const loc = path.join(_this7.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME); - - // write lockfile - const lockSource = (0, (_lockfile2 || _load_lockfile2()).stringify)(lockfileBasedOnResolver, false, _this7.config.enableLockfileVersions); - yield (_fs || _load_fs()).writeFilePreservingEol(loc, lockSource); - - _this7._logSuccessSaveLockfile(); - })(); - } - - _logSuccessSaveLockfile() { - this.reporter.success(this.reporter.lang('savedLockfile')); - } - - /** - * Load the dependency graph of the current install. Only does package resolving and wont write to the cwd. - */ - hydrate(ignoreUnusedPatterns) { - var _this8 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const request = yield _this8.fetchRequestFromCwd([], ignoreUnusedPatterns); - const depRequests = request.requests, - rawPatterns = request.patterns, - ignorePatterns = request.ignorePatterns, - workspaceLayout = request.workspaceLayout; - - - yield _this8.resolver.init(depRequests, { - isFlat: _this8.flags.flat, - isFrozen: _this8.flags.frozenLockfile, - workspaceLayout - }); - yield _this8.flatten(rawPatterns); - _this8.markIgnored(ignorePatterns); - - // fetch packages, should hit cache most of the time - const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this8.resolver.getManifests(), _this8.config); - _this8.resolver.updateManifests(manifests); - yield (_packageCompatibility || _load_packageCompatibility()).check(_this8.resolver.getManifests(), _this8.config, _this8.flags.ignoreEngines); - - // expand minimal manifests - for (const manifest of _this8.resolver.getManifests()) { - const ref = manifest._reference; - invariant(ref, 'expected reference'); - const type = ref.remote.type; - // link specifier won't ever hit cache - - let loc = ''; - if (type === 'link') { - continue; - } else if (type === 'workspace') { - if (!ref.remote.reference) { - continue; - } - loc = ref.remote.reference; - } else { - loc = _this8.config.generateHardModulePath(ref); - } - const newPkg = yield _this8.config.readManifest(loc); - yield _this8.resolver.updateManifest(ref, newPkg); - } - - return request; - })(); - } - - /** - * Check for updates every day and output a nag message if there's a newer version. - */ - - checkUpdate() { - if (this.config.nonInteractive) { - // don't show upgrade dialog on CI or non-TTY terminals - return; - } - - // don't check if disabled - if (this.config.getOption('disable-self-update-check')) { - return; - } - - // only check for updates once a day - const lastUpdateCheck = Number(this.config.getOption('lastUpdateCheck')) || 0; - if (lastUpdateCheck && Date.now() - lastUpdateCheck < ONE_DAY) { - return; - } - - // don't bug for updates on tagged releases - if ((_yarnVersion || _load_yarnVersion()).version.indexOf('-') >= 0) { - return; - } - - this._checkUpdate().catch(() => { - // swallow errors - }); - } - - _checkUpdate() { - var _this9 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let latestVersion = yield _this9.config.requestManager.request({ - url: (_constants || _load_constants()).SELF_UPDATE_VERSION_URL - }); - invariant(typeof latestVersion === 'string', 'expected string'); - latestVersion = latestVersion.trim(); - if (!semver.valid(latestVersion)) { - return; - } - - // ensure we only check for updates periodically - _this9.config.registries.yarn.saveHomeConfig({ - lastUpdateCheck: Date.now() - }); - - if (semver.gt(latestVersion, (_yarnVersion || _load_yarnVersion()).version)) { - const installationMethod = yield (0, (_yarnVersion || _load_yarnVersion()).getInstallationMethod)(); - _this9.maybeOutputUpdate = function () { - _this9.reporter.warn(_this9.reporter.lang('yarnOutdated', latestVersion, (_yarnVersion || _load_yarnVersion()).version)); - - const command = getUpdateCommand(installationMethod); - if (command) { - _this9.reporter.info(_this9.reporter.lang('yarnOutdatedCommand')); - _this9.reporter.command(command); - } else { - const installer = getUpdateInstaller(installationMethod); - if (installer) { - _this9.reporter.info(_this9.reporter.lang('yarnOutdatedInstaller', installer)); - } - } - }; - } - })(); - } - - /** - * Method to override with a possible upgrade message. - */ - - maybeOutputUpdate() {} -} - -exports.Install = Install; -function hasWrapper(commander, args) { - return true; -} - -function setFlags(commander) { - commander.usage('install [flags]'); - commander.option('-g, --global', 'DEPRECATED'); - commander.option('-S, --save', 'DEPRECATED - save package to your `dependencies`'); - commander.option('-D, --save-dev', 'DEPRECATED - save package to your `devDependencies`'); - commander.option('-P, --save-peer', 'DEPRECATED - save package to your `peerDependencies`'); - commander.option('-O, --save-optional', 'DEPRECATED - save package to your `optionalDependencies`'); - commander.option('-E, --save-exact', 'DEPRECATED'); - commander.option('-T, --save-tilde', 'DEPRECATED'); -} /***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { +/* 40 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return async; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AsyncAction__ = __webpack_require__(149); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(150); +/** PURE_IMPORTS_START _AsyncAction,_AsyncScheduler PURE_IMPORTS_END */ -exports.__esModule = true; +var async = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__["a" /* AsyncScheduler */](__WEBPACK_IMPORTED_MODULE_0__AsyncAction__["a" /* AsyncAction */]); +//# sourceMappingURL=async.js.map -var _assign = __webpack_require__(454); - -var _assign2 = _interopRequireDefault(_assign); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = _assign2.default || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; -}; /***/ }), -/* 30 */ +/* 41 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", 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 + + +/***/ }), +/* 42 */ /***/ (function(module, exports, __webpack_require__) { -var dP = __webpack_require__(38) - , createDesc = __webpack_require__(84); -module.exports = __webpack_require__(33) ? function(object, key, value){ +var dP = __webpack_require__(72); +var createDesc = __webpack_require__(132); +module.exports = __webpack_require__(51) ? function (object, key, value) { return dP.f(object, key, createDesc(1, value)); -} : function(object, key, value){ +} : function (object, key, value) { object[key] = value; return object; }; + /***/ }), -/* 31 */ +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + + +function isNothing(subject) { + return (typeof subject === 'undefined') || (subject === null); +} + + +function isObject(subject) { + return (typeof subject === 'object') && (subject !== null); +} + + +function toArray(sequence) { + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + + return [ sequence ]; +} + + +function extend(target, source) { + var index, length, key, sourceKeys; + + if (source) { + sourceKeys = Object.keys(source); + + for (index = 0, length = sourceKeys.length; index < length; index += 1) { + key = sourceKeys[index]; + target[key] = source[key]; + } + } + + return target; +} + + +function repeat(string, count) { + var result = '', cycle; + + for (cycle = 0; cycle < count; cycle += 1) { + result += string; + } + + return result; +} + + +function isNegativeZero(number) { + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); +} + + +module.exports.isNothing = isNothing; +module.exports.isObject = isObject; +module.exports.toArray = toArray; +module.exports.repeat = repeat; +module.exports.isNegativeZero = isNegativeZero; +module.exports.extend = extend; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/*eslint-disable max-len*/ + +var common = __webpack_require__(43); +var YAMLException = __webpack_require__(54); +var Type = __webpack_require__(10); + + +function compileList(schema, name, result) { + var exclude = []; + + schema.include.forEach(function (includedSchema) { + result = compileList(includedSchema, name, result); + }); + + schema[name].forEach(function (currentType) { + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { + exclude.push(previousIndex); + } + }); + + result.push(currentType); + }); + + return result.filter(function (type, index) { + return exclude.indexOf(index) === -1; + }); +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {} + }, index, length; + + function collectType(type) { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} + + +function Schema(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + + this.implicit.forEach(function (type) { + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + }); + + this.compiledImplicit = compileList(this, 'implicit', []); + this.compiledExplicit = compileList(this, 'explicit', []); + this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); +} + + +Schema.DEFAULT = null; + + +Schema.create = function createSchema() { + var schemas, types; + + switch (arguments.length) { + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; + + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; + + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); + } + + schemas = common.toArray(schemas); + types = common.toArray(types); + + if (!schemas.every(function (schema) { return schema instanceof Schema; })) { + throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); + } + + if (!types.every(function (type) { return type instanceof Type; })) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + return new Schema({ + include: schemas, + explicit: types + }); +}; + + +module.exports = Schema; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +/* eslint-disable node/no-deprecated-api */ +var buffer = __webpack_require__(64) +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) +} + + +/***/ }), +/* 46 */ +/***/ (function(module, exports) { + +module.exports = require("os"); + +/***/ }), +/* 47 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = map; +/* unused harmony export MapOperator */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=map.js.map + + +/***/ }), +/* 48 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return errorObject; }); +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +var errorObject = { e: {} }; +//# sourceMappingURL=errorObject.js.map + + +/***/ }), +/* 49 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = isScheduler; +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +function isScheduler(value) { + return value && typeof value.schedule === 'function'; +} +//# sourceMappingURL=isScheduler.js.map + + +/***/ }), +/* 50 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22672,185 +25235,218 @@ module.exports = __webpack_require__(33) ? function(object, key, value){ Object.defineProperty(exports, "__esModule", { value: true }); -exports.normalizePattern = normalizePattern; +exports.wait = wait; +exports.promisify = promisify; +exports.queue = queue; +function wait(delay) { + return new Promise(resolve => { + setTimeout(resolve, delay); + }); +} -/** - * Explode and normalize a pattern into its name and range. - */ +function promisify(fn, firstData) { + return function (...args) { + return new Promise(function (resolve, reject) { + args.push(function (err, ...result) { + let res = result; -function normalizePattern(pattern) { - let hasVersion = false; - let range = 'latest'; - let name = pattern; + if (result.length <= 1) { + res = result[0]; + } - // if we're a scope then remove the @ and add it back later - let isScoped = false; - if (name[0] === '@') { - isScoped = true; - name = name.slice(1); + if (firstData) { + res = err; + err = null; + } + + if (err) { + reject(err); + } else { + resolve(res); + } + }); + + fn.apply(null, args); + }); + }; +} + +function queue(arr, promiseProducer, concurrency = Infinity) { + concurrency = Math.min(concurrency, arr.length); + + // clone + arr = arr.slice(); + + const results = []; + let total = arr.length; + if (!total) { + return Promise.resolve(results); } - // take first part as the name - const parts = name.split('@'); - if (parts.length > 1) { - name = parts.shift(); - range = parts.join('@'); - - if (range) { - hasVersion = true; - } else { - range = '*'; + return new Promise((resolve, reject) => { + for (let i = 0; i < concurrency; i++) { + next(); } - } - // add back @ scope suffix - if (isScoped) { - name = `@${name}`; - } + function next() { + const item = arr.shift(); + const promise = promiseProducer(item); - return { name, range, hasVersion }; + promise.then(function (result) { + results.push(result); + + total--; + if (total === 0) { + resolve(results); + } else { + if (arr.length) { + next(); + } + } + }, reject); + } + }); } /***/ }), -/* 32 */ +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(112)(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), +/* 53 */ /***/ (function(module, exports) { module.exports = {}; -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -// Thank's IE8 for his funny defineProperty -module.exports = !__webpack_require__(83)(function(){ - return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; -}); /***/ }), -/* 34 */ +/* 54 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; +// YAML error class. http://stackoverflow.com/questions/8458984 +// -var escapeStringRegexp = __webpack_require__(207); -var ansiStyles = __webpack_require__(557); -var stripAnsi = __webpack_require__(216); -var hasAnsi = __webpack_require__(532); -var supportsColor = __webpack_require__(560); -var defineProps = Object.defineProperties; -var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); -function Chalk(options) { - // detect mode if not set manually - this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled; +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } } -// use bright blue on Windows as the normal blue color is illegible -if (isSimpleWindowsTerm) { - ansiStyles.blue.open = '\u001b[94m'; -} -var styles = (function () { - var ret = {}; +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; - Object.keys(ansiStyles).forEach(function (key) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); - ret[key] = { - get: function () { - return build.call(this, this._styles.concat(key)); - } - }; - }); +YAMLException.prototype.toString = function toString(compact) { + var result = this.name + ': '; - return ret; -})(); + result += this.reason || '(unknown reason)'; -var proto = defineProps(function chalk() {}, styles); + if (!compact && this.mark) { + result += ' ' + this.mark.toString(); + } -function build(_styles) { - var builder = function () { - return applyStyle.apply(builder, arguments); - }; + return result; +}; - builder._styles = _styles; - builder.enabled = this.enabled; - // __proto__ is used because we must return a function, but there is - // no way to create a function with a different prototype. - /* eslint-disable no-proto */ - builder.__proto__ = proto; - return builder; -} - -function applyStyle() { - // support varags, but simply cast to string in case there's only one arg - var args = arguments; - var argsLen = args.length; - var str = argsLen !== 0 && String(arguments[0]); - - if (argsLen > 1) { - // don't slice `arguments`, it prevents v8 optimizations - for (var a = 1; a < argsLen; a++) { - str += ' ' + args[a]; - } - } - - if (!this.enabled || !str) { - return str; - } - - var nestedStyles = this._styles; - var i = nestedStyles.length; - - // 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. - var originalDim = ansiStyles.dim.open; - if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { - ansiStyles.dim.open = ''; - } - - while (i--) { - var code = ansiStyles[nestedStyles[i]]; - - // 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; - } - - // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. - ansiStyles.dim.open = originalDim; - - return str; -} - -function init() { - var ret = {}; - - Object.keys(styles).forEach(function (name) { - ret[name] = { - get: function () { - return build.call(this, [name]); - } - }; - }); - - return ret; -} - -defineProps(Chalk.prototype, init()); - -module.exports = new Chalk(); -module.exports.styles = ansiStyles; -module.exports.hasColor = hasAnsi; -module.exports.stripColor = stripAnsi; -module.exports.supportsColor = supportsColor; +module.exports = YAMLException; /***/ }), -/* 35 */ +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + + + + +var Schema = __webpack_require__(44); + + +module.exports = new Schema({ + include: [ + __webpack_require__(143) + ], + implicit: [ + __webpack_require__(299), + __webpack_require__(292) + ], + explicit: [ + __webpack_require__(284), + __webpack_require__(294), + __webpack_require__(295), + __webpack_require__(297) + ] +}); + + +/***/ }), +/* 56 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = tryCatch; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__errorObject__ = __webpack_require__(48); +/** PURE_IMPORTS_START _errorObject PURE_IMPORTS_END */ + +var tryCatchTarget; +function tryCatcher() { + try { + return tryCatchTarget.apply(this, arguments); + } + catch (e) { + __WEBPACK_IMPORTED_MODULE_0__errorObject__["a" /* errorObject */].e = e; + return __WEBPACK_IMPORTED_MODULE_0__errorObject__["a" /* errorObject */]; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} +//# sourceMappingURL=tryCatch.js.map + + +/***/ }), +/* 57 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22864,13 +25460,13 @@ exports.registryNames = exports.registries = undefined; var _yarnRegistry; function _load_yarnRegistry() { - return _yarnRegistry = _interopRequireDefault(__webpack_require__(424)); + return _yarnRegistry = _interopRequireDefault(__webpack_require__(559)); } var _npmRegistry; function _load_npmRegistry() { - return _npmRegistry = _interopRequireDefault(__webpack_require__(52)); + return _npmRegistry = _interopRequireDefault(__webpack_require__(88)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -22883,7 +25479,7 @@ const registries = exports.registries = { const registryNames = exports.registryNames = Object.keys(registries); /***/ }), -/* 36 */ +/* 58 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -22892,6428 +25488,1279 @@ const registryNames = exports.registryNames = Object.keys(registries); Object.defineProperty(exports, "__esModule", { value: true }); -exports.hostedGit = exports.registries = undefined; -exports.getExoticResolver = getExoticResolver; -exports.hostedGitFragmentToGitUrl = hostedGitFragmentToGitUrl; +exports.exec = exports.queue = undefined; +exports.forkp = forkp; +exports.spawnp = spawnp; +exports.forwardSignalToSpawnedProcesses = forwardSignalToSpawnedProcesses; +exports.spawn = spawn; -var _baseResolver; +var _constants; -function _load_baseResolver() { - return _baseResolver = _interopRequireDefault(__webpack_require__(95)); +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); } -var _npmResolver; +var _blockingQueue; -function _load_npmResolver() { - return _npmResolver = _interopRequireDefault(__webpack_require__(166)); +function _load_blockingQueue() { + return _blockingQueue = _interopRequireDefault(__webpack_require__(110)); } -var _yarnResolver; +var _errors; -function _load_yarnResolver() { - return _yarnResolver = _interopRequireDefault(__webpack_require__(273)); +function _load_errors() { + return _errors = __webpack_require__(6); } -var _gitResolver; +var _promise; -function _load_gitResolver() { - return _gitResolver = _interopRequireDefault(__webpack_require__(96)); -} - -var _tarballResolver; - -function _load_tarballResolver() { - return _tarballResolver = _interopRequireDefault(__webpack_require__(437)); -} - -var _githubResolver; - -function _load_githubResolver() { - return _githubResolver = _interopRequireDefault(__webpack_require__(271)); -} - -var _fileResolver; - -function _load_fileResolver() { - return _fileResolver = _interopRequireDefault(__webpack_require__(164)); -} - -var _linkResolver; - -function _load_linkResolver() { - return _linkResolver = _interopRequireDefault(__webpack_require__(272)); -} - -var _gitlabResolver; - -function _load_gitlabResolver() { - return _gitlabResolver = _interopRequireDefault(__webpack_require__(435)); -} - -var _gistResolver; - -function _load_gistResolver() { - return _gistResolver = _interopRequireDefault(__webpack_require__(165)); -} - -var _bitbucketResolver; - -function _load_bitbucketResolver() { - return _bitbucketResolver = _interopRequireDefault(__webpack_require__(434)); -} - -var _hostedGitResolver; - -function _load_hostedGitResolver() { - return _hostedGitResolver = __webpack_require__(79); -} - -var _registryResolver; - -function _load_registryResolver() { - return _registryResolver = _interopRequireDefault(__webpack_require__(436)); +function _load_promise() { + return _promise = __webpack_require__(50); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const registries = exports.registries = { - npm: (_npmResolver || _load_npmResolver()).default, - yarn: (_yarnResolver || _load_yarnResolver()).default -}; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -// +/* global child_process$spawnOpts */ -const exotics = new Set([(_gitResolver || _load_gitResolver()).default, (_tarballResolver || _load_tarballResolver()).default, (_githubResolver || _load_githubResolver()).default, (_fileResolver || _load_fileResolver()).default, (_linkResolver || _load_linkResolver()).default, (_gitlabResolver || _load_gitlabResolver()).default, (_gistResolver || _load_gistResolver()).default, (_bitbucketResolver || _load_bitbucketResolver()).default]); +const child = __webpack_require__(331); -function getExoticResolver(pattern) { - for (const Resolver of exotics) { - if (Resolver.isVersion(pattern)) { - return Resolver; - } - } - return null; +const queue = exports.queue = new (_blockingQueue || _load_blockingQueue()).default('child', (_constants || _load_constants()).CHILD_CONCURRENCY); + +// TODO: this uid check is kinda whack +let uid = 0; + +const exec = exports.exec = (0, (_promise || _load_promise()).promisify)(child.exec); + +function forkp(program, args, opts) { + return new Promise((resolve, reject) => { + const proc = child.fork(program, args, opts); + + proc.on('error', error => { + reject(error); + }); + + proc.on('close', exitCode => { + resolve(exitCode); + }); + }); } -// +function spawnp(program, args, opts) { + return new Promise((resolve, reject) => { + const proc = child.spawn(program, args, opts); -const hostedGit = exports.hostedGit = { - github: (_githubResolver || _load_githubResolver()).default, - gitlab: (_gitlabResolver || _load_gitlabResolver()).default, - bitbucket: (_bitbucketResolver || _load_bitbucketResolver()).default -}; + proc.on('error', error => { + reject(error); + }); -function hostedGitFragmentToGitUrl(fragment, reporter) { - for (const key in hostedGit) { - const Resolver = hostedGit[key]; - if (Resolver.isVersion(fragment)) { - return Resolver.getGitHTTPUrl((0, (_hostedGitResolver || _load_hostedGitResolver()).explodeHostedGitFragment)(fragment, reporter)); - } - } - - return fragment; + proc.on('close', exitCode => { + resolve(exitCode); + }); + }); } -// +const spawnedProcesses = {}; -for (const key in registries) { - var _class, _temp; +function forwardSignalToSpawnedProcesses(signal) { + for (var _iterator = Object.keys(spawnedProcesses), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; - const RegistryResolver = registries[key]; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } - exotics.add((_temp = _class = class extends (_registryResolver || _load_registryResolver()).default {}, _class.protocol = key, _class.factory = RegistryResolver, _temp)); + const key = _ref; + + spawnedProcesses[key].kill(signal); + } +} + +function spawn(program, args, opts = {}, onData) { + const key = opts.cwd || String(++uid); + return queue.push(key, () => new Promise((resolve, reject) => { + const proc = child.spawn(program, args, opts); + spawnedProcesses[key] = proc; + + let processingDone = false; + let processClosed = false; + let err = null; + + let stdout = ''; + + proc.on('error', err => { + if (err.code === 'ENOENT') { + reject(new (_errors || _load_errors()).ProcessSpawnError(`Couldn't find the binary ${program}`, err.code, program)); + } else { + reject(err); + } + }); + + function updateStdout(chunk) { + stdout += chunk; + if (onData) { + onData(chunk); + } + } + + function finish() { + delete spawnedProcesses[key]; + if (err) { + reject(err); + } else { + resolve(stdout.trim()); + } + } + + if (typeof opts.process === 'function') { + opts.process(proc, updateStdout, reject, function () { + if (processClosed) { + finish(); + } else { + processingDone = true; + } + }); + } else { + if (proc.stderr) { + proc.stderr.on('data', updateStdout); + } + + if (proc.stdout) { + proc.stdout.on('data', updateStdout); + } + + processingDone = true; + } + + proc.on('close', (code, signal) => { + if (signal || code >= 1) { + err = new (_errors || _load_errors()).ProcessTermError(['Command failed.', signal ? `Exit signal: ${signal}` : `Exit code: ${code}`, `Command: ${program}`, `Arguments: ${args.join(' ')}`, `Directory: ${opts.cwd || process.cwd()}`, `Output:\n${stdout.trim()}`].join('\n')); + err.EXIT_SIGNAL = signal; + err.EXIT_CODE = code; + } + + if (processingDone || err) { + finish(); + } else { + processClosed = true; + } + }); + })); } /***/ }), -/* 37 */ +/* 59 */ /***/ (function(module, exports, __webpack_require__) { -// optional / simple context binding -var aFunction = __webpack_require__(63); -module.exports = function(fn, that, length){ - aFunction(fn); - if(that === undefined)return fn; - switch(length){ - case 1: return function(a){ - return fn.call(that, a); - }; - case 2: return function(a, b){ - return fn.call(that, a, b); - }; - case 3: return function(a, b, c){ - return fn.call(that, a, b, c); +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +exports.default = function (rootCommandName, subCommands, usage = []) { + let run = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + const subName = (0, (_misc || _load_misc()).camelCase)(args.shift() || ''); + if (subName && subCommands[subName]) { + const command = subCommands[subName]; + const res = yield command(config, reporter, flags, args); + if (res !== false) { + return Promise.resolve(); + } + } + + if (usage && usage.length) { + reporter.error(`${reporter.lang('usage')}:`); + for (var _iterator = usage, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + const msg = _ref2; + + reporter.error(`yarn ${rootCommandName} ${msg}`); + } + } + return Promise.reject(new (_errors || _load_errors()).MessageError(reporter.lang('invalidCommand', subCommandNames.join(', ')))); + }); + + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); }; + })(); + + const subCommandNames = Object.keys(subCommands).map((_misc || _load_misc()).hyphenate); + + function setFlags(commander) { + commander.usage(`${rootCommandName} [${subCommandNames.join('|')}] [flags]`); } - return function(/* ...args */){ - return fn.apply(that, arguments); - }; + + function hasWrapper(commander, args) { + return true; + } + + const examples = usage.map(cmd => { + return `${rootCommandName} ${cmd}`; + }); + + return { run, setFlags, hasWrapper, examples }; }; +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _misc; + +function _load_misc() { + return _misc = __webpack_require__(18); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /***/ }), -/* 38 */ +/* 60 */ /***/ (function(module, exports, __webpack_require__) { -var anObject = __webpack_require__(26) - , IE8_DOM_DEFINE = __webpack_require__(185) - , toPrimitive = __webpack_require__(200) - , dP = Object.defineProperty; +var global = __webpack_require__(17); +var core = __webpack_require__(31); +var ctx = __webpack_require__(70); +var hide = __webpack_require__(42); +var has = __webpack_require__(71); +var PROTOTYPE = 'prototype'; -exports.f = __webpack_require__(33) ? Object.defineProperty : function defineProperty(O, P, Attributes){ - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if(IE8_DOM_DEFINE)try { - return dP(O, P, Attributes); - } catch(e){ /* empty */ } - if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); - if('value' in Attributes)O[P] = Attributes.value; - return O; +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var IS_WRAP = type & $export.W; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE]; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; + var key, own, out; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + if (own && has(exports, key)) continue; + // export native or passed + out = own ? target[key] : source[key]; + // prevent global pollution for namespaces + exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] + // bind timers to global for call from export context + : IS_BIND && own ? ctx(out, global) + // wrap global constructors for prevent change them in library + : IS_WRAP && target[key] == out ? (function (C) { + var F = function (a, b, c) { + if (this instanceof C) { + switch (arguments.length) { + case 0: return new C(); + case 1: return new C(a); + case 2: return new C(a, b); + } return new C(a, b, c); + } return C.apply(this, arguments); + }; + F[PROTOTYPE] = C[PROTOTYPE]; + return F; + // make static versions for prototype methods + })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% + if (IS_PROTO) { + (exports.virtual || (exports.virtual = {}))[key] = out; + // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% + if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); + } + } }; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; + /***/ }), -/* 39 */ +/* 61 */ /***/ (function(module, exports, __webpack_require__) { try { - var util = __webpack_require__(2); + var util = __webpack_require__(3); if (typeof util.inherits !== 'function') throw ''; module.exports = util.inherits; } catch (e) { - module.exports = __webpack_require__(214); + module.exports = __webpack_require__(275); } /***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { +/* 62 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = from; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isPromise__ = __webpack_require__(445); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArrayLike__ = __webpack_require__(442); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isInteropObservable__ = __webpack_require__(928); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isIterable__ = __webpack_require__(929); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fromArray__ = __webpack_require__(85); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__fromPromise__ = __webpack_require__(830); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__fromIterable__ = __webpack_require__(828); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__fromObservable__ = __webpack_require__(829); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util_subscribeTo__ = __webpack_require__(446); +/** PURE_IMPORTS_START _Observable,_util_isPromise,_util_isArrayLike,_util_isInteropObservable,_util_isIterable,_fromArray,_fromPromise,_fromIterable,_fromObservable,_util_subscribeTo PURE_IMPORTS_END */ -;(function (undefined) { - var objectTypes = { - 'function': true, - 'object': true - }; - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - var Rx = { - internals: {}, - config: { - Promise: root.Promise - }, - helpers: { } - }; - // Defaults - var noop = Rx.helpers.noop = function () { }, - identity = Rx.helpers.identity = function (x) { return x; }, - defaultNow = Rx.helpers.defaultNow = Date.now, - defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); }, - defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); }, - defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); }, - defaultError = Rx.helpers.defaultError = function (err) { throw err; }, - isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.subscribe !== 'function' && typeof p.then === 'function'; }, - isFunction = Rx.helpers.isFunction = (function () { - var isFn = function (value) { - return typeof value == 'function' || false; - }; - // fallback for older versions of Chrome and Safari - if (isFn(/x/)) { - isFn = function(value) { - return typeof value == 'function' && toString.call(value) == '[object Function]'; - }; - } - return isFn; - }()); - function cloneArray(arr) { for(var a = [], i = 0, len = arr.length; i < len; i++) { a.push(arr[i]); } return a;} - - var errorObj = {e: {}}; - - function tryCatcherGen(tryCatchTarget) { - return function tryCatcher() { - try { - return tryCatchTarget.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } - }; - } - - var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { - if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } - return tryCatcherGen(fn); - }; - - function thrower(e) { - throw e; - } - - Rx.config.longStackSupport = false; - var hasStacks = false, stacks = tryCatch(function () { throw new Error(); })(); - hasStacks = !!stacks.e && !!stacks.e.stack; - - // All code after this point will be filtered from stack traces reported by RxJS - var rStartingLine = captureLine(), rFileName; - - var STACK_JUMP_SEPARATOR = 'From previous event:'; - - function makeStackTraceLong(error, observable) { - // If possible, transform the error stack trace by removing Node and RxJS - // cruft, then concatenating with the stack trace of `observable`. - if (hasStacks && - observable.stack && - typeof error === 'object' && - error !== null && - error.stack && - error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1 - ) { - var stacks = []; - for (var o = observable; !!o; o = o.source) { - if (o.stack) { - stacks.unshift(o.stack); +function from(input, scheduler) { + if (!scheduler) { + if (input instanceof __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */]) { + return input; } - } - stacks.unshift(error.stack); - - var concatedStacks = stacks.join('\n' + STACK_JUMP_SEPARATOR + '\n'); - error.stack = filterStackString(concatedStacks); + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__util_subscribeTo__["a" /* subscribeTo */])(input)); } - } - - function filterStackString(stackString) { - var lines = stackString.split('\n'), desiredLines = []; - for (var i = 0, len = lines.length; i < len; i++) { - var line = lines[i]; - - if (!isInternalFrame(line) && !isNodeFrame(line) && line) { - desiredLines.push(line); - } - } - return desiredLines.join('\n'); - } - - function isInternalFrame(stackLine) { - var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine); - if (!fileNameAndLineNumber) { - return false; - } - var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1]; - - return fileName === rFileName && - lineNumber >= rStartingLine && - lineNumber <= rEndingLine; - } - - function isNodeFrame(stackLine) { - return stackLine.indexOf('(module.js:') !== -1 || - stackLine.indexOf('(node.js:') !== -1; - } - - function captureLine() { - if (!hasStacks) { return; } - - try { - throw new Error(); - } catch (e) { - var lines = e.stack.split('\n'); - var firstLine = lines[0].indexOf('@') > 0 ? lines[1] : lines[2]; - var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine); - if (!fileNameAndLineNumber) { return; } - - rFileName = fileNameAndLineNumber[0]; - return fileNameAndLineNumber[1]; - } - } - - function getFileNameAndLineNumber(stackLine) { - // Named functions: 'at functionName (filename:lineNumber:columnNumber)' - var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine); - if (attempt1) { return [attempt1[1], Number(attempt1[2])]; } - - // Anonymous functions: 'at filename:lineNumber:columnNumber' - var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine); - if (attempt2) { return [attempt2[1], Number(attempt2[2])]; } - - // Firefox style: 'function@filename:lineNumber or @filename:lineNumber' - var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine); - if (attempt3) { return [attempt3[1], Number(attempt3[2])]; } - } - - var EmptyError = Rx.EmptyError = function() { - this.message = 'Sequence contains no elements.'; - Error.call(this); - }; - EmptyError.prototype = Object.create(Error.prototype); - EmptyError.prototype.name = 'EmptyError'; - - var ObjectDisposedError = Rx.ObjectDisposedError = function() { - this.message = 'Object has been disposed'; - Error.call(this); - }; - ObjectDisposedError.prototype = Object.create(Error.prototype); - ObjectDisposedError.prototype.name = 'ObjectDisposedError'; - - var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () { - this.message = 'Argument out of range'; - Error.call(this); - }; - ArgumentOutOfRangeError.prototype = Object.create(Error.prototype); - ArgumentOutOfRangeError.prototype.name = 'ArgumentOutOfRangeError'; - - var NotSupportedError = Rx.NotSupportedError = function (message) { - this.message = message || 'This operation is not supported'; - Error.call(this); - }; - NotSupportedError.prototype = Object.create(Error.prototype); - NotSupportedError.prototype.name = 'NotSupportedError'; - - var NotImplementedError = Rx.NotImplementedError = function (message) { - this.message = message || 'This operation is not implemented'; - Error.call(this); - }; - NotImplementedError.prototype = Object.create(Error.prototype); - NotImplementedError.prototype.name = 'NotImplementedError'; - - var notImplemented = Rx.helpers.notImplemented = function () { - throw new NotImplementedError(); - }; - - var notSupported = Rx.helpers.notSupported = function () { - throw new NotSupportedError(); - }; - - // Shim in iterator support - var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) || - '_es6shim_iterator_'; - // Bug for mozilla version - if (root.Set && typeof new root.Set()['@@iterator'] === 'function') { - $iterator$ = '@@iterator'; - } - - var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined }; - - var isIterable = Rx.helpers.isIterable = function (o) { - return o && o[$iterator$] !== undefined; - }; - - var isArrayLike = Rx.helpers.isArrayLike = function (o) { - return o && o.length !== undefined; - }; - - Rx.helpers.iterator = $iterator$; - - var bindCallback = Rx.internals.bindCallback = function (func, thisArg, argCount) { - if (typeof thisArg === 'undefined') { return func; } - switch(argCount) { - case 0: - return function() { - return func.call(thisArg) - }; - case 1: - return function(arg) { - return func.call(thisArg, arg); - }; - case 2: - return function(value, index) { - return func.call(thisArg, value, index); - }; - case 3: - return function(value, index, collection) { - return func.call(thisArg, value, index, collection); - }; - } - - return function() { - return func.apply(thisArg, arguments); - }; - }; - - /** Used to determine if values are of the language type Object */ - var dontEnums = ['toString', - 'toLocaleString', - 'valueOf', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'constructor'], - dontEnumsLength = dontEnums.length; - -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dateTag] = typedArrayTags[errorTag] = -typedArrayTags[funcTag] = typedArrayTags[mapTag] = -typedArrayTags[numberTag] = typedArrayTags[objectTag] = -typedArrayTags[regexpTag] = typedArrayTags[setTag] = -typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; - -var objectProto = Object.prototype, - hasOwnProperty = objectProto.hasOwnProperty, - objToString = objectProto.toString, - MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; - -var keys = Object.keys || (function() { - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'), - dontEnums = [ - 'toString', - 'toLocaleString', - 'valueOf', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'constructor' - ], - dontEnumsLength = dontEnums.length; - - return function(obj) { - if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { - throw new TypeError('Object.keys called on non-object'); - } - - var result = [], prop, i; - - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); + if (input != null) { + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isInteropObservable__["a" /* isInteropObservable */])(input)) { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__fromObservable__["a" /* fromObservable */])(input, scheduler); } - } - - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); - } + else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isPromise__["a" /* isPromise */])(input)) { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__fromPromise__["a" /* fromPromise */])(input, scheduler); + } + else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArrayLike__["a" /* isArrayLike */])(input)) { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__fromArray__["a" /* fromArray */])(input, scheduler); + } + else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isIterable__["a" /* isIterable */])(input) || typeof input === 'string') { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__fromIterable__["a" /* fromIterable */])(input, scheduler); } - } - return result; - }; - }()); - -function equalObjects(object, other, equalFunc, isLoose, stackA, stackB) { - var objProps = keys(object), - objLength = objProps.length, - othProps = keys(other), - othLength = othProps.length; - - if (objLength !== othLength && !isLoose) { - return false; - } - var index = objLength, key; - while (index--) { - key = objProps[index]; - if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { - return false; } - } - var skipCtor = isLoose; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key], - result; - - if (!(result === undefined ? equalFunc(objValue, othValue, isLoose, stackA, stackB) : result)) { - return false; - } - skipCtor || (skipCtor = key === 'constructor'); - } - if (!skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - if (objCtor !== othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor === 'function' && objCtor instanceof objCtor && - typeof othCtor === 'function' && othCtor instanceof othCtor)) { - return false; - } - } - return true; + throw new TypeError((input !== null && typeof input || input) + ' is not observable'); } +//# sourceMappingURL=from.js.map -function equalByTag(object, other, tag) { - switch (tag) { - case boolTag: - case dateTag: - return +object === +other; - - case errorTag: - return object.name === other.name && object.message === other.message; - - case numberTag: - return (object !== +object) ? - other !== +other : - object === +other; - - case regexpTag: - case stringTag: - return object === (other + ''); - } - return false; -} - -var isObject = Rx.internals.isObject = function(value) { - var type = typeof value; - return !!value && (type === 'object' || type === 'function'); -}; - -function isObjectLike(value) { - return !!value && typeof value === 'object'; -} - -function isLength(value) { - return typeof value === 'number' && value > -1 && value % 1 === 0 && value <= MAX_SAFE_INTEGER; -} - -var isHostObject = (function() { - try { - Object({ 'toString': 0 } + ''); - } catch(e) { - return function() { return false; }; - } - return function(value) { - return typeof value.toString !== 'function' && typeof (value + '') === 'string'; - }; -}()); - -function isTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; -} - -var isArray = Array.isArray || function(value) { - return isObjectLike(value) && isLength(value.length) && objToString.call(value) === arrayTag; -}; - -function arraySome (array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; -} - -function equalArrays(array, other, equalFunc, isLoose, stackA, stackB) { - var index = -1, - arrLength = array.length, - othLength = other.length; - - if (arrLength !== othLength && !(isLoose && othLength > arrLength)) { - return false; - } - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index], - result; - - if (result !== undefined) { - if (result) { - continue; - } - return false; - } - // Recursively compare arrays (susceptible to call stack limits). - if (isLoose) { - if (!arraySome(other, function(othValue) { - return arrValue === othValue || equalFunc(arrValue, othValue, isLoose, stackA, stackB); - })) { - return false; - } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, isLoose, stackA, stackB))) { - return false; - } - } - return true; -} - -function baseIsEqualDeep(object, other, equalFunc, isLoose, stackA, stackB) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = arrayTag, - othTag = arrayTag; - - if (!objIsArr) { - objTag = objToString.call(object); - if (objTag === argsTag) { - objTag = objectTag; - } else if (objTag !== objectTag) { - objIsArr = isTypedArray(object); - } - } - if (!othIsArr) { - othTag = objToString.call(other); - if (othTag === argsTag) { - othTag = objectTag; - } - } - var objIsObj = objTag === objectTag && !isHostObject(object), - othIsObj = othTag === objectTag && !isHostObject(other), - isSameTag = objTag === othTag; - - if (isSameTag && !(objIsArr || objIsObj)) { - return equalByTag(object, other, objTag); - } - if (!isLoose) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, isLoose, stackA, stackB); - } - } - if (!isSameTag) { - return false; - } - // Assume cyclic values are equal. - // For more information on detecting circular references see https://es5.github.io/#JO. - stackA || (stackA = []); - stackB || (stackB = []); - - var length = stackA.length; - while (length--) { - if (stackA[length] === object) { - return stackB[length] === other; - } - } - // Add `object` and `other` to the stack of traversed objects. - stackA.push(object); - stackB.push(other); - - var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, isLoose, stackA, stackB); - - stackA.pop(); - stackB.pop(); - - return result; -} - -function baseIsEqual(value, other, isLoose, stackA, stackB) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, baseIsEqual, isLoose, stackA, stackB); -} - -var isEqual = Rx.internals.isEqual = function (value, other) { - return baseIsEqual(value, other); -}; - - var hasProp = {}.hasOwnProperty, - slice = Array.prototype.slice; - - var inherits = Rx.internals.inherits = function (child, parent) { - function __() { this.constructor = child; } - __.prototype = parent.prototype; - child.prototype = new __(); - }; - - var addProperties = Rx.internals.addProperties = function (obj) { - for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); } - for (var idx = 0, ln = sources.length; idx < ln; idx++) { - var source = sources[idx]; - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }; - - // Rx Utils - var addRef = Rx.internals.addRef = function (xs, r) { - return new AnonymousObservable(function (observer) { - return new BinaryDisposable(r.getDisposable(), xs.subscribe(observer)); - }); - }; - - function arrayInitialize(count, factory) { - var a = new Array(count); - for (var i = 0; i < count; i++) { - a[i] = factory(); - } - return a; - } - - /** - * Represents a group of disposable resources that are disposed together. - * @constructor - */ - var CompositeDisposable = Rx.CompositeDisposable = function () { - var args = [], i, len; - if (Array.isArray(arguments[0])) { - args = arguments[0]; - } else { - len = arguments.length; - args = new Array(len); - for(i = 0; i < len; i++) { args[i] = arguments[i]; } - } - this.disposables = args; - this.isDisposed = false; - this.length = args.length; - }; - - var CompositeDisposablePrototype = CompositeDisposable.prototype; - - /** - * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. - * @param {Mixed} item Disposable to add. - */ - CompositeDisposablePrototype.add = function (item) { - if (this.isDisposed) { - item.dispose(); - } else { - this.disposables.push(item); - this.length++; - } - }; - - /** - * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. - * @param {Mixed} item Disposable to remove. - * @returns {Boolean} true if found; false otherwise. - */ - CompositeDisposablePrototype.remove = function (item) { - var shouldDispose = false; - if (!this.isDisposed) { - var idx = this.disposables.indexOf(item); - if (idx !== -1) { - shouldDispose = true; - this.disposables.splice(idx, 1); - this.length--; - item.dispose(); - } - } - return shouldDispose; - }; - - /** - * Disposes all disposables in the group and removes them from the group. - */ - CompositeDisposablePrototype.dispose = function () { - if (!this.isDisposed) { - this.isDisposed = true; - var len = this.disposables.length, currentDisposables = new Array(len); - for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; } - this.disposables = []; - this.length = 0; - - for (i = 0; i < len; i++) { - currentDisposables[i].dispose(); - } - } - }; - - /** - * Provides a set of static methods for creating Disposables. - * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. - */ - var Disposable = Rx.Disposable = function (action) { - this.isDisposed = false; - this.action = action || noop; - }; - - /** Performs the task of cleaning up resources. */ - Disposable.prototype.dispose = function () { - if (!this.isDisposed) { - this.action(); - this.isDisposed = true; - } - }; - - /** - * Creates a disposable object that invokes the specified action when disposed. - * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. - * @return {Disposable} The disposable object that runs the given action upon disposal. - */ - var disposableCreate = Disposable.create = function (action) { return new Disposable(action); }; - - /** - * Gets the disposable that does nothing when disposed. - */ - var disposableEmpty = Disposable.empty = { dispose: noop }; - - /** - * Validates whether the given object is a disposable - * @param {Object} Object to test whether it has a dispose method - * @returns {Boolean} true if a disposable object, else false. - */ - var isDisposable = Disposable.isDisposable = function (d) { - return d && isFunction(d.dispose); - }; - - var checkDisposed = Disposable.checkDisposed = function (disposable) { - if (disposable.isDisposed) { throw new ObjectDisposedError(); } - }; - - var disposableFixup = Disposable._fixup = function (result) { - return isDisposable(result) ? result : disposableEmpty; - }; - - // Single assignment - var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () { - this.isDisposed = false; - this.current = null; - }; - SingleAssignmentDisposable.prototype.getDisposable = function () { - return this.current; - }; - SingleAssignmentDisposable.prototype.setDisposable = function (value) { - if (this.current) { throw new Error('Disposable has already been assigned'); } - var shouldDispose = this.isDisposed; - !shouldDispose && (this.current = value); - shouldDispose && value && value.dispose(); - }; - SingleAssignmentDisposable.prototype.dispose = function () { - if (!this.isDisposed) { - this.isDisposed = true; - var old = this.current; - this.current = null; - old && old.dispose(); - } - }; - - // Multiple assignment disposable - var SerialDisposable = Rx.SerialDisposable = function () { - this.isDisposed = false; - this.current = null; - }; - SerialDisposable.prototype.getDisposable = function () { - return this.current; - }; - SerialDisposable.prototype.setDisposable = function (value) { - var shouldDispose = this.isDisposed; - if (!shouldDispose) { - var old = this.current; - this.current = value; - } - old && old.dispose(); - shouldDispose && value && value.dispose(); - }; - SerialDisposable.prototype.dispose = function () { - if (!this.isDisposed) { - this.isDisposed = true; - var old = this.current; - this.current = null; - } - old && old.dispose(); - }; - - var BinaryDisposable = Rx.BinaryDisposable = function (first, second) { - this._first = first; - this._second = second; - this.isDisposed = false; - }; - - BinaryDisposable.prototype.dispose = function () { - if (!this.isDisposed) { - this.isDisposed = true; - var old1 = this._first; - this._first = null; - old1 && old1.dispose(); - var old2 = this._second; - this._second = null; - old2 && old2.dispose(); - } - }; - - var NAryDisposable = Rx.NAryDisposable = function (disposables) { - this._disposables = disposables; - this.isDisposed = false; - }; - - NAryDisposable.prototype.dispose = function () { - if (!this.isDisposed) { - this.isDisposed = true; - for (var i = 0, len = this._disposables.length; i < len; i++) { - this._disposables[i].dispose(); - } - this._disposables.length = 0; - } - }; - - /** - * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. - */ - var RefCountDisposable = Rx.RefCountDisposable = (function () { - - function InnerDisposable(disposable) { - this.disposable = disposable; - this.disposable.count++; - this.isInnerDisposed = false; - } - - InnerDisposable.prototype.dispose = function () { - if (!this.disposable.isDisposed && !this.isInnerDisposed) { - this.isInnerDisposed = true; - this.disposable.count--; - if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) { - this.disposable.isDisposed = true; - this.disposable.underlyingDisposable.dispose(); - } - } - }; - - /** - * Initializes a new instance of the RefCountDisposable with the specified disposable. - * @constructor - * @param {Disposable} disposable Underlying disposable. - */ - function RefCountDisposable(disposable) { - this.underlyingDisposable = disposable; - this.isDisposed = false; - this.isPrimaryDisposed = false; - this.count = 0; - } - - /** - * Disposes the underlying disposable only when all dependent disposables have been disposed - */ - RefCountDisposable.prototype.dispose = function () { - if (!this.isDisposed && !this.isPrimaryDisposed) { - this.isPrimaryDisposed = true; - if (this.count === 0) { - this.isDisposed = true; - this.underlyingDisposable.dispose(); - } - } - }; - - /** - * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable. - * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime. - */ - RefCountDisposable.prototype.getDisposable = function () { - return this.isDisposed ? disposableEmpty : new InnerDisposable(this); - }; - - return RefCountDisposable; - })(); - - function ScheduledDisposable(scheduler, disposable) { - this.scheduler = scheduler; - this.disposable = disposable; - this.isDisposed = false; - } - - function scheduleItem(s, self) { - if (!self.isDisposed) { - self.isDisposed = true; - self.disposable.dispose(); - } - } - - ScheduledDisposable.prototype.dispose = function () { - this.scheduler.schedule(this, scheduleItem); - }; - - var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) { - this.scheduler = scheduler; - this.state = state; - this.action = action; - this.dueTime = dueTime; - this.comparer = comparer || defaultSubComparer; - this.disposable = new SingleAssignmentDisposable(); - }; - - ScheduledItem.prototype.invoke = function () { - this.disposable.setDisposable(this.invokeCore()); - }; - - ScheduledItem.prototype.compareTo = function (other) { - return this.comparer(this.dueTime, other.dueTime); - }; - - ScheduledItem.prototype.isCancelled = function () { - return this.disposable.isDisposed; - }; - - ScheduledItem.prototype.invokeCore = function () { - return disposableFixup(this.action(this.scheduler, this.state)); - }; - - /** Provides a set of static properties to access commonly used schedulers. */ - var Scheduler = Rx.Scheduler = (function () { - - function Scheduler() { } - - /** Determines whether the given object is a scheduler */ - Scheduler.isScheduler = function (s) { - return s instanceof Scheduler; - }; - - var schedulerProto = Scheduler.prototype; - - /** - * Schedules an action to be executed. - * @param state State passed to the action to be executed. - * @param {Function} action Action to be executed. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.schedule = function (state, action) { - throw new NotImplementedError(); - }; - - /** - * Schedules an action to be executed after dueTime. - * @param state State passed to the action to be executed. - * @param {Function} action Action to be executed. - * @param {Number} dueTime Relative time after which to execute the action. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleFuture = function (state, dueTime, action) { - var dt = dueTime; - dt instanceof Date && (dt = dt - this.now()); - dt = Scheduler.normalize(dt); - - if (dt === 0) { return this.schedule(state, action); } - - return this._scheduleFuture(state, dt, action); - }; - - schedulerProto._scheduleFuture = function (state, dueTime, action) { - throw new NotImplementedError(); - }; - - /** Gets the current time according to the local machine's system clock. */ - Scheduler.now = defaultNow; - - /** Gets the current time according to the local machine's system clock. */ - Scheduler.prototype.now = defaultNow; - - /** - * Normalizes the specified TimeSpan value to a positive value. - * @param {Number} timeSpan The time span value to normalize. - * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0 - */ - Scheduler.normalize = function (timeSpan) { - timeSpan < 0 && (timeSpan = 0); - return timeSpan; - }; - - return Scheduler; - }()); - - var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler; - - (function (schedulerProto) { - - function invokeRecImmediate(scheduler, pair) { - var state = pair[0], action = pair[1], group = new CompositeDisposable(); - action(state, innerAction); - return group; - - function innerAction(state2) { - var isAdded = false, isDone = false; - - var d = scheduler.schedule(state2, scheduleWork); - if (!isDone) { - group.add(d); - isAdded = true; - } - - function scheduleWork(_, state3) { - if (isAdded) { - group.remove(d); - } else { - isDone = true; - } - action(state3, innerAction); - return disposableEmpty; - } - } - } - - function invokeRecDate(scheduler, pair) { - var state = pair[0], action = pair[1], group = new CompositeDisposable(); - action(state, innerAction); - return group; - - function innerAction(state2, dueTime1) { - var isAdded = false, isDone = false; - - var d = scheduler.scheduleFuture(state2, dueTime1, scheduleWork); - if (!isDone) { - group.add(d); - isAdded = true; - } - - function scheduleWork(_, state3) { - if (isAdded) { - group.remove(d); - } else { - isDone = true; - } - action(state3, innerAction); - return disposableEmpty; - } - } - } - - /** - * Schedules an action to be executed recursively. - * @param {Mixed} state State passed to the action to be executed. - * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleRecursive = function (state, action) { - return this.schedule([state, action], invokeRecImmediate); - }; - - /** - * Schedules an action to be executed recursively after a specified relative or absolute due time. - * @param {Mixed} state State passed to the action to be executed. - * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. - * @param {Number | Date} dueTime Relative or absolute time after which to execute the action for the first time. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleRecursiveFuture = function (state, dueTime, action) { - return this.scheduleFuture([state, action], dueTime, invokeRecDate); - }; - - }(Scheduler.prototype)); - - (function (schedulerProto) { - - /** - * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. - * @param {Mixed} state Initial state passed to the action upon the first iteration. - * @param {Number} period Period for running the work periodically. - * @param {Function} action Action to be executed, potentially updating the state. - * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). - */ - schedulerProto.schedulePeriodic = function(state, period, action) { - if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); } - period = normalizeTime(period); - var s = state, id = root.setInterval(function () { s = action(s); }, period); - return disposableCreate(function () { root.clearInterval(id); }); - }; - - }(Scheduler.prototype)); - - (function (schedulerProto) { - /** - * Returns a scheduler that wraps the original scheduler, adding exception handling for scheduled actions. - * @param {Function} handler Handler that's run if an exception is caught. The exception will be rethrown if the handler returns false. - * @returns {Scheduler} Wrapper around the original scheduler, enforcing exception handling. - */ - schedulerProto.catchError = schedulerProto['catch'] = function (handler) { - return new CatchScheduler(this, handler); - }; - }(Scheduler.prototype)); - - var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () { - function createTick(self) { - return function tick(command, recurse) { - recurse(0, self._period); - var state = tryCatch(self._action)(self._state); - if (state === errorObj) { - self._cancel.dispose(); - thrower(state.e); - } - self._state = state; - }; - } - - function SchedulePeriodicRecursive(scheduler, state, period, action) { - this._scheduler = scheduler; - this._state = state; - this._period = period; - this._action = action; - } - - SchedulePeriodicRecursive.prototype.start = function () { - var d = new SingleAssignmentDisposable(); - this._cancel = d; - d.setDisposable(this._scheduler.scheduleRecursiveFuture(0, this._period, createTick(this))); - - return d; - }; - - return SchedulePeriodicRecursive; - }()); - - /** Gets a scheduler that schedules work immediately on the current thread. */ - var ImmediateScheduler = (function (__super__) { - inherits(ImmediateScheduler, __super__); - function ImmediateScheduler() { - __super__.call(this); - } - - ImmediateScheduler.prototype.schedule = function (state, action) { - return disposableFixup(action(this, state)); - }; - - return ImmediateScheduler; - }(Scheduler)); - - var immediateScheduler = Scheduler.immediate = new ImmediateScheduler(); - - /** - * Gets a scheduler that schedules work as soon as possible on the current thread. - */ - var CurrentThreadScheduler = (function (__super__) { - var queue; - - function runTrampoline () { - while (queue.length > 0) { - var item = queue.dequeue(); - !item.isCancelled() && item.invoke(); - } - } - - inherits(CurrentThreadScheduler, __super__); - function CurrentThreadScheduler() { - __super__.call(this); - } - - CurrentThreadScheduler.prototype.schedule = function (state, action) { - var si = new ScheduledItem(this, state, action, this.now()); - - if (!queue) { - queue = new PriorityQueue(4); - queue.enqueue(si); - - var result = tryCatch(runTrampoline)(); - queue = null; - if (result === errorObj) { thrower(result.e); } - } else { - queue.enqueue(si); - } - return si.disposable; - }; - - CurrentThreadScheduler.prototype.scheduleRequired = function () { return !queue; }; - - return CurrentThreadScheduler; - }(Scheduler)); - - var currentThreadScheduler = Scheduler.currentThread = new CurrentThreadScheduler(); - - var scheduleMethod, clearMethod; - - var localTimer = (function () { - var localSetTimeout, localClearTimeout = noop; - if (!!root.setTimeout) { - localSetTimeout = root.setTimeout; - localClearTimeout = root.clearTimeout; - } else if (!!root.WScript) { - localSetTimeout = function (fn, time) { - root.WScript.Sleep(time); - fn(); - }; - } else { - throw new NotSupportedError(); - } - - return { - setTimeout: localSetTimeout, - clearTimeout: localClearTimeout - }; - }()); - var localSetTimeout = localTimer.setTimeout, - localClearTimeout = localTimer.clearTimeout; - - (function () { - - var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false; - - clearMethod = function (handle) { - delete tasksByHandle[handle]; - }; - - function runTask(handle) { - if (currentlyRunning) { - localSetTimeout(function () { runTask(handle); }, 0); - } else { - var task = tasksByHandle[handle]; - if (task) { - currentlyRunning = true; - var result = tryCatch(task)(); - clearMethod(handle); - currentlyRunning = false; - if (result === errorObj) { thrower(result.e); } - } - } - } - - var reNative = new RegExp('^' + - String(toString) - .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') - .replace(/toString| for [^\]]+/g, '.*?') + '$' - ); - - var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' && - !reNative.test(setImmediate) && setImmediate; - - function postMessageSupported () { - // Ensure not in a worker - if (!root.postMessage || root.importScripts) { return false; } - var isAsync = false, oldHandler = root.onmessage; - // Test for async - root.onmessage = function () { isAsync = true; }; - root.postMessage('', '*'); - root.onmessage = oldHandler; - - return isAsync; - } - - // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout - if (isFunction(setImmediate)) { - scheduleMethod = function (action) { - var id = nextHandle++; - tasksByHandle[id] = action; - setImmediate(function () { runTask(id); }); - - return id; - }; - } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { - scheduleMethod = function (action) { - var id = nextHandle++; - tasksByHandle[id] = action; - process.nextTick(function () { runTask(id); }); - - return id; - }; - } else if (postMessageSupported()) { - var MSG_PREFIX = 'ms.rx.schedule' + Math.random(); - - var onGlobalPostMessage = function (event) { - // Only if we're a match to avoid any other global events - if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) { - runTask(event.data.substring(MSG_PREFIX.length)); - } - }; - - root.addEventListener('message', onGlobalPostMessage, false); - - scheduleMethod = function (action) { - var id = nextHandle++; - tasksByHandle[id] = action; - root.postMessage(MSG_PREFIX + id, '*'); - return id; - }; - } else if (!!root.MessageChannel) { - var channel = new root.MessageChannel(); - - channel.port1.onmessage = function (e) { runTask(e.data); }; - - scheduleMethod = function (action) { - var id = nextHandle++; - tasksByHandle[id] = action; - channel.port2.postMessage(id); - return id; - }; - } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) { - - scheduleMethod = function (action) { - var scriptElement = root.document.createElement('script'); - var id = nextHandle++; - tasksByHandle[id] = action; - - scriptElement.onreadystatechange = function () { - runTask(id); - scriptElement.onreadystatechange = null; - scriptElement.parentNode.removeChild(scriptElement); - scriptElement = null; - }; - root.document.documentElement.appendChild(scriptElement); - return id; - }; - - } else { - scheduleMethod = function (action) { - var id = nextHandle++; - tasksByHandle[id] = action; - localSetTimeout(function () { - runTask(id); - }, 0); - - return id; - }; - } - }()); - - /** - * Gets a scheduler that schedules work via a timed callback based upon platform. - */ - var DefaultScheduler = (function (__super__) { - inherits(DefaultScheduler, __super__); - function DefaultScheduler() { - __super__.call(this); - } - - function scheduleAction(disposable, action, scheduler, state) { - return function schedule() { - disposable.setDisposable(Disposable._fixup(action(scheduler, state))); - }; - } - - function ClearDisposable(id) { - this._id = id; - this.isDisposed = false; - } - - ClearDisposable.prototype.dispose = function () { - if (!this.isDisposed) { - this.isDisposed = true; - clearMethod(this._id); - } - }; - - function LocalClearDisposable(id) { - this._id = id; - this.isDisposed = false; - } - - LocalClearDisposable.prototype.dispose = function () { - if (!this.isDisposed) { - this.isDisposed = true; - localClearTimeout(this._id); - } - }; - - DefaultScheduler.prototype.schedule = function (state, action) { - var disposable = new SingleAssignmentDisposable(), - id = scheduleMethod(scheduleAction(disposable, action, this, state)); - return new BinaryDisposable(disposable, new ClearDisposable(id)); - }; - - DefaultScheduler.prototype._scheduleFuture = function (state, dueTime, action) { - if (dueTime === 0) { return this.schedule(state, action); } - var disposable = new SingleAssignmentDisposable(), - id = localSetTimeout(scheduleAction(disposable, action, this, state), dueTime); - return new BinaryDisposable(disposable, new LocalClearDisposable(id)); - }; - - function scheduleLongRunning(state, action, disposable) { - return function () { action(state, disposable); }; - } - - DefaultScheduler.prototype.scheduleLongRunning = function (state, action) { - var disposable = disposableCreate(noop); - scheduleMethod(scheduleLongRunning(state, action, disposable)); - return disposable; - }; - - return DefaultScheduler; - }(Scheduler)); - - var defaultScheduler = Scheduler['default'] = Scheduler.async = new DefaultScheduler(); - - var CatchScheduler = (function (__super__) { - inherits(CatchScheduler, __super__); - - function CatchScheduler(scheduler, handler) { - this._scheduler = scheduler; - this._handler = handler; - this._recursiveOriginal = null; - this._recursiveWrapper = null; - __super__.call(this); - } - - CatchScheduler.prototype.schedule = function (state, action) { - return this._scheduler.schedule(state, this._wrap(action)); - }; - - CatchScheduler.prototype._scheduleFuture = function (state, dueTime, action) { - return this._scheduler.schedule(state, dueTime, this._wrap(action)); - }; - - CatchScheduler.prototype.now = function () { return this._scheduler.now(); }; - - CatchScheduler.prototype._clone = function (scheduler) { - return new CatchScheduler(scheduler, this._handler); - }; - - CatchScheduler.prototype._wrap = function (action) { - var parent = this; - return function (self, state) { - var res = tryCatch(action)(parent._getRecursiveWrapper(self), state); - if (res === errorObj) { - if (!parent._handler(res.e)) { thrower(res.e); } - return disposableEmpty; - } - return disposableFixup(res); - }; - }; - - CatchScheduler.prototype._getRecursiveWrapper = function (scheduler) { - if (this._recursiveOriginal !== scheduler) { - this._recursiveOriginal = scheduler; - var wrapper = this._clone(scheduler); - wrapper._recursiveOriginal = scheduler; - wrapper._recursiveWrapper = wrapper; - this._recursiveWrapper = wrapper; - } - return this._recursiveWrapper; - }; - - CatchScheduler.prototype.schedulePeriodic = function (state, period, action) { - var self = this, failed = false, d = new SingleAssignmentDisposable(); - - d.setDisposable(this._scheduler.schedulePeriodic(state, period, function (state1) { - if (failed) { return null; } - var res = tryCatch(action)(state1); - if (res === errorObj) { - failed = true; - if (!self._handler(res.e)) { thrower(res.e); } - d.dispose(); - return null; - } - return res; - })); - - return d; - }; - - return CatchScheduler; - }(Scheduler)); - - function IndexedItem(id, value) { - this.id = id; - this.value = value; - } - - IndexedItem.prototype.compareTo = function (other) { - var c = this.value.compareTo(other.value); - c === 0 && (c = this.id - other.id); - return c; - }; - - var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) { - this.items = new Array(capacity); - this.length = 0; - }; - - var priorityProto = PriorityQueue.prototype; - priorityProto.isHigherPriority = function (left, right) { - return this.items[left].compareTo(this.items[right]) < 0; - }; - - priorityProto.percolate = function (index) { - if (index >= this.length || index < 0) { return; } - var parent = index - 1 >> 1; - if (parent < 0 || parent === index) { return; } - if (this.isHigherPriority(index, parent)) { - var temp = this.items[index]; - this.items[index] = this.items[parent]; - this.items[parent] = temp; - this.percolate(parent); - } - }; - - priorityProto.heapify = function (index) { - +index || (index = 0); - if (index >= this.length || index < 0) { return; } - var left = 2 * index + 1, - right = 2 * index + 2, - first = index; - if (left < this.length && this.isHigherPriority(left, first)) { - first = left; - } - if (right < this.length && this.isHigherPriority(right, first)) { - first = right; - } - if (first !== index) { - var temp = this.items[index]; - this.items[index] = this.items[first]; - this.items[first] = temp; - this.heapify(first); - } - }; - - priorityProto.peek = function () { return this.items[0].value; }; - - priorityProto.removeAt = function (index) { - this.items[index] = this.items[--this.length]; - this.items[this.length] = undefined; - this.heapify(); - }; - - priorityProto.dequeue = function () { - var result = this.peek(); - this.removeAt(0); - return result; - }; - - priorityProto.enqueue = function (item) { - var index = this.length++; - this.items[index] = new IndexedItem(PriorityQueue.count++, item); - this.percolate(index); - }; - - priorityProto.remove = function (item) { - for (var i = 0; i < this.length; i++) { - if (this.items[i].value === item) { - this.removeAt(i); - return true; - } - } - return false; - }; - PriorityQueue.count = 0; - - /** - * Represents a notification to an observer. - */ - var Notification = Rx.Notification = (function () { - function Notification() { - - } - - Notification.prototype._accept = function (onNext, onError, onCompleted) { - throw new NotImplementedError(); - }; - - Notification.prototype._acceptObserver = function (onNext, onError, onCompleted) { - throw new NotImplementedError(); - }; - - /** - * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. - * @param {Function | Observer} observerOrOnNext Function to invoke for an OnNext notification or Observer to invoke the notification on.. - * @param {Function} onError Function to invoke for an OnError notification. - * @param {Function} onCompleted Function to invoke for an OnCompleted notification. - * @returns {Any} Result produced by the observation. - */ - Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) { - return observerOrOnNext && typeof observerOrOnNext === 'object' ? - this._acceptObserver(observerOrOnNext) : - this._accept(observerOrOnNext, onError, onCompleted); - }; - - /** - * Returns an observable sequence with a single notification. - * - * @memberOf Notifications - * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on. - * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription. - */ - Notification.prototype.toObservable = function (scheduler) { - var self = this; - isScheduler(scheduler) || (scheduler = immediateScheduler); - return new AnonymousObservable(function (o) { - return scheduler.schedule(self, function (_, notification) { - notification._acceptObserver(o); - notification.kind === 'N' && o.onCompleted(); - }); - }); - }; - - return Notification; - })(); - - var OnNextNotification = (function (__super__) { - inherits(OnNextNotification, __super__); - function OnNextNotification(value) { - this.value = value; - this.kind = 'N'; - } - - OnNextNotification.prototype._accept = function (onNext) { - return onNext(this.value); - }; - - OnNextNotification.prototype._acceptObserver = function (o) { - return o.onNext(this.value); - }; - - OnNextNotification.prototype.toString = function () { - return 'OnNext(' + this.value + ')'; - }; - - return OnNextNotification; - }(Notification)); - - var OnErrorNotification = (function (__super__) { - inherits(OnErrorNotification, __super__); - function OnErrorNotification(error) { - this.error = error; - this.kind = 'E'; - } - - OnErrorNotification.prototype._accept = function (onNext, onError) { - return onError(this.error); - }; - - OnErrorNotification.prototype._acceptObserver = function (o) { - return o.onError(this.error); - }; - - OnErrorNotification.prototype.toString = function () { - return 'OnError(' + this.error + ')'; - }; - - return OnErrorNotification; - }(Notification)); - - var OnCompletedNotification = (function (__super__) { - inherits(OnCompletedNotification, __super__); - function OnCompletedNotification() { - this.kind = 'C'; - } - - OnCompletedNotification.prototype._accept = function (onNext, onError, onCompleted) { - return onCompleted(); - }; - - OnCompletedNotification.prototype._acceptObserver = function (o) { - return o.onCompleted(); - }; - - OnCompletedNotification.prototype.toString = function () { - return 'OnCompleted()'; - }; - - return OnCompletedNotification; - }(Notification)); - - /** - * Creates an object that represents an OnNext notification to an observer. - * @param {Any} value The value contained in the notification. - * @returns {Notification} The OnNext notification containing the value. - */ - var notificationCreateOnNext = Notification.createOnNext = function (value) { - return new OnNextNotification(value); - }; - - /** - * Creates an object that represents an OnError notification to an observer. - * @param {Any} error The exception contained in the notification. - * @returns {Notification} The OnError notification containing the exception. - */ - var notificationCreateOnError = Notification.createOnError = function (error) { - return new OnErrorNotification(error); - }; - - /** - * Creates an object that represents an OnCompleted notification to an observer. - * @returns {Notification} The OnCompleted notification. - */ - var notificationCreateOnCompleted = Notification.createOnCompleted = function () { - return new OnCompletedNotification(); - }; - - /** - * Supports push-style iteration over an observable sequence. - */ - var Observer = Rx.Observer = function () { }; - - /** - * Creates a notification callback from an observer. - * @returns The action that forwards its input notification to the underlying observer. - */ - Observer.prototype.toNotifier = function () { - var observer = this; - return function (n) { return n.accept(observer); }; - }; - - /** - * Hides the identity of an observer. - * @returns An observer that hides the identity of the specified observer. - */ - Observer.prototype.asObserver = function () { - var self = this; - return new AnonymousObserver( - function (x) { self.onNext(x); }, - function (err) { self.onError(err); }, - function () { self.onCompleted(); }); - }; - - /** - * Checks access to the observer for grammar violations. This includes checking for multiple OnError or OnCompleted calls, as well as reentrancy in any of the observer methods. - * If a violation is detected, an Error is thrown from the offending observer method call. - * @returns An observer that checks callbacks invocations against the observer grammar and, if the checks pass, forwards those to the specified observer. - */ - Observer.prototype.checked = function () { return new CheckedObserver(this); }; - - /** - * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions. - * @param {Function} [onNext] Observer's OnNext action implementation. - * @param {Function} [onError] Observer's OnError action implementation. - * @param {Function} [onCompleted] Observer's OnCompleted action implementation. - * @returns {Observer} The observer object implemented using the given actions. - */ - var observerCreate = Observer.create = function (onNext, onError, onCompleted) { - onNext || (onNext = noop); - onError || (onError = defaultError); - onCompleted || (onCompleted = noop); - return new AnonymousObserver(onNext, onError, onCompleted); - }; - - /** - * Creates an observer from a notification callback. - * @param {Function} handler Action that handles a notification. - * @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives. - */ - Observer.fromNotifier = function (handler, thisArg) { - var cb = bindCallback(handler, thisArg, 1); - return new AnonymousObserver(function (x) { - return cb(notificationCreateOnNext(x)); - }, function (e) { - return cb(notificationCreateOnError(e)); - }, function () { - return cb(notificationCreateOnCompleted()); - }); - }; - - /** - * Schedules the invocation of observer methods on the given scheduler. - * @param {Scheduler} scheduler Scheduler to schedule observer messages on. - * @returns {Observer} Observer whose messages are scheduled on the given scheduler. - */ - Observer.prototype.notifyOn = function (scheduler) { - return new ObserveOnObserver(scheduler, this); - }; - - Observer.prototype.makeSafe = function(disposable) { - return new AnonymousSafeObserver(this._onNext, this._onError, this._onCompleted, disposable); - }; - - /** - * Abstract base class for implementations of the Observer class. - * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages. - */ - var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) { - inherits(AbstractObserver, __super__); - - /** - * Creates a new observer in a non-stopped state. - */ - function AbstractObserver() { - this.isStopped = false; - } - - // Must be implemented by other observers - AbstractObserver.prototype.next = notImplemented; - AbstractObserver.prototype.error = notImplemented; - AbstractObserver.prototype.completed = notImplemented; - - /** - * Notifies the observer of a new element in the sequence. - * @param {Any} value Next element in the sequence. - */ - AbstractObserver.prototype.onNext = function (value) { - !this.isStopped && this.next(value); - }; - - /** - * Notifies the observer that an exception has occurred. - * @param {Any} error The error that has occurred. - */ - AbstractObserver.prototype.onError = function (error) { - if (!this.isStopped) { - this.isStopped = true; - this.error(error); - } - }; - - /** - * Notifies the observer of the end of the sequence. - */ - AbstractObserver.prototype.onCompleted = function () { - if (!this.isStopped) { - this.isStopped = true; - this.completed(); - } - }; - - /** - * Disposes the observer, causing it to transition to the stopped state. - */ - AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; - - AbstractObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.error(e); - return true; - } - - return false; - }; - - return AbstractObserver; - }(Observer)); - - /** - * Class to create an Observer instance from delegate-based implementations of the on* methods. - */ - var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) { - inherits(AnonymousObserver, __super__); - - /** - * Creates an observer from the specified OnNext, OnError, and OnCompleted actions. - * @param {Any} onNext Observer's OnNext action implementation. - * @param {Any} onError Observer's OnError action implementation. - * @param {Any} onCompleted Observer's OnCompleted action implementation. - */ - function AnonymousObserver(onNext, onError, onCompleted) { - __super__.call(this); - this._onNext = onNext; - this._onError = onError; - this._onCompleted = onCompleted; - } - - /** - * Calls the onNext action. - * @param {Any} value Next element in the sequence. - */ - AnonymousObserver.prototype.next = function (value) { - this._onNext(value); - }; - - /** - * Calls the onError action. - * @param {Any} error The error that has occurred. - */ - AnonymousObserver.prototype.error = function (error) { - this._onError(error); - }; - - /** - * Calls the onCompleted action. - */ - AnonymousObserver.prototype.completed = function () { - this._onCompleted(); - }; - - return AnonymousObserver; - }(AbstractObserver)); - - var CheckedObserver = (function (__super__) { - inherits(CheckedObserver, __super__); - - function CheckedObserver(observer) { - __super__.call(this); - this._observer = observer; - this._state = 0; // 0 - idle, 1 - busy, 2 - done - } - - var CheckedObserverPrototype = CheckedObserver.prototype; - - CheckedObserverPrototype.onNext = function (value) { - this.checkAccess(); - var res = tryCatch(this._observer.onNext).call(this._observer, value); - this._state = 0; - res === errorObj && thrower(res.e); - }; - - CheckedObserverPrototype.onError = function (err) { - this.checkAccess(); - var res = tryCatch(this._observer.onError).call(this._observer, err); - this._state = 2; - res === errorObj && thrower(res.e); - }; - - CheckedObserverPrototype.onCompleted = function () { - this.checkAccess(); - var res = tryCatch(this._observer.onCompleted).call(this._observer); - this._state = 2; - res === errorObj && thrower(res.e); - }; - - CheckedObserverPrototype.checkAccess = function () { - if (this._state === 1) { throw new Error('Re-entrancy detected'); } - if (this._state === 2) { throw new Error('Observer completed'); } - if (this._state === 0) { this._state = 1; } - }; - - return CheckedObserver; - }(Observer)); - - var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) { - inherits(ScheduledObserver, __super__); - - function ScheduledObserver(scheduler, observer) { - __super__.call(this); - this.scheduler = scheduler; - this.observer = observer; - this.isAcquired = false; - this.hasFaulted = false; - this.queue = []; - this.disposable = new SerialDisposable(); - } - - function enqueueNext(observer, x) { return function () { observer.onNext(x); }; } - function enqueueError(observer, e) { return function () { observer.onError(e); }; } - function enqueueCompleted(observer) { return function () { observer.onCompleted(); }; } - - ScheduledObserver.prototype.next = function (x) { - this.queue.push(enqueueNext(this.observer, x)); - }; - - ScheduledObserver.prototype.error = function (e) { - this.queue.push(enqueueError(this.observer, e)); - }; - - ScheduledObserver.prototype.completed = function () { - this.queue.push(enqueueCompleted(this.observer)); - }; - - - function scheduleMethod(state, recurse) { - var work; - if (state.queue.length > 0) { - work = state.queue.shift(); - } else { - state.isAcquired = false; - return; - } - var res = tryCatch(work)(); - if (res === errorObj) { - state.queue = []; - state.hasFaulted = true; - return thrower(res.e); - } - recurse(state); - } - - ScheduledObserver.prototype.ensureActive = function () { - var isOwner = false; - if (!this.hasFaulted && this.queue.length > 0) { - isOwner = !this.isAcquired; - this.isAcquired = true; - } - isOwner && - this.disposable.setDisposable(this.scheduler.scheduleRecursive(this, scheduleMethod)); - }; - - ScheduledObserver.prototype.dispose = function () { - __super__.prototype.dispose.call(this); - this.disposable.dispose(); - }; - - return ScheduledObserver; - }(AbstractObserver)); - - var ObserveOnObserver = (function (__super__) { - inherits(ObserveOnObserver, __super__); - - function ObserveOnObserver(scheduler, observer, cancel) { - __super__.call(this, scheduler, observer); - this._cancel = cancel; - } - - ObserveOnObserver.prototype.next = function (value) { - __super__.prototype.next.call(this, value); - this.ensureActive(); - }; - - ObserveOnObserver.prototype.error = function (e) { - __super__.prototype.error.call(this, e); - this.ensureActive(); - }; - - ObserveOnObserver.prototype.completed = function () { - __super__.prototype.completed.call(this); - this.ensureActive(); - }; - - ObserveOnObserver.prototype.dispose = function () { - __super__.prototype.dispose.call(this); - this._cancel && this._cancel.dispose(); - this._cancel = null; - }; - - return ObserveOnObserver; - })(ScheduledObserver); - - var observableProto; - - /** - * Represents a push-style collection. - */ - var Observable = Rx.Observable = (function () { - - function makeSubscribe(self, subscribe) { - return function (o) { - var oldOnError = o.onError; - o.onError = function (e) { - makeStackTraceLong(e, self); - oldOnError.call(o, e); - }; - - return subscribe.call(self, o); - }; - } - - function Observable() { - if (Rx.config.longStackSupport && hasStacks) { - var oldSubscribe = this._subscribe; - var e = tryCatch(thrower)(new Error()).e; - this.stack = e.stack.substring(e.stack.indexOf('\n') + 1); - this._subscribe = makeSubscribe(this, oldSubscribe); - } - } - - observableProto = Observable.prototype; - - /** - * Determines whether the given object is an Observable - * @param {Any} An object to determine whether it is an Observable - * @returns {Boolean} true if an Observable, else false. - */ - Observable.isObservable = function (o) { - return o && isFunction(o.subscribe); - }; - - /** - * Subscribes an o to the observable sequence. - * @param {Mixed} [oOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. - * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. - * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. - * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions. - */ - observableProto.subscribe = observableProto.forEach = function (oOrOnNext, onError, onCompleted) { - return this._subscribe(typeof oOrOnNext === 'object' ? - oOrOnNext : - observerCreate(oOrOnNext, onError, onCompleted)); - }; - - /** - * Subscribes to the next value in the sequence with an optional "this" argument. - * @param {Function} onNext The function to invoke on each element in the observable sequence. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. - */ - observableProto.subscribeOnNext = function (onNext, thisArg) { - return this._subscribe(observerCreate(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext)); - }; - - /** - * Subscribes to an exceptional condition in the sequence with an optional "this" argument. - * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. - */ - observableProto.subscribeOnError = function (onError, thisArg) { - return this._subscribe(observerCreate(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError)); - }; - - /** - * Subscribes to the next value in the sequence with an optional "this" argument. - * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. - */ - observableProto.subscribeOnCompleted = function (onCompleted, thisArg) { - return this._subscribe(observerCreate(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted)); - }; - - return Observable; - })(); - - var ObservableBase = Rx.ObservableBase = (function (__super__) { - inherits(ObservableBase, __super__); - - function fixSubscriber(subscriber) { - return subscriber && isFunction(subscriber.dispose) ? subscriber : - isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty; - } - - function setDisposable(s, state) { - var ado = state[0], self = state[1]; - var sub = tryCatch(self.subscribeCore).call(self, ado); - if (sub === errorObj && !ado.fail(errorObj.e)) { thrower(errorObj.e); } - ado.setDisposable(fixSubscriber(sub)); - } - - function ObservableBase() { - __super__.call(this); - } - - ObservableBase.prototype._subscribe = function (o) { - var ado = new AutoDetachObserver(o), state = [ado, this]; - - if (currentThreadScheduler.scheduleRequired()) { - currentThreadScheduler.schedule(state, setDisposable); - } else { - setDisposable(null, state); - } - return ado; - }; - - ObservableBase.prototype.subscribeCore = notImplemented; - - return ObservableBase; - }(Observable)); - -var FlatMapObservable = Rx.FlatMapObservable = (function(__super__) { - - inherits(FlatMapObservable, __super__); - - function FlatMapObservable(source, selector, resultSelector, thisArg) { - this.resultSelector = isFunction(resultSelector) ? resultSelector : null; - this.selector = bindCallback(isFunction(selector) ? selector : function() { return selector; }, thisArg, 3); - this.source = source; - __super__.call(this); - } - - FlatMapObservable.prototype.subscribeCore = function(o) { - return this.source.subscribe(new InnerObserver(o, this.selector, this.resultSelector, this)); - }; - - inherits(InnerObserver, AbstractObserver); - function InnerObserver(observer, selector, resultSelector, source) { - this.i = 0; - this.selector = selector; - this.resultSelector = resultSelector; - this.source = source; - this.o = observer; - AbstractObserver.call(this); - } - - InnerObserver.prototype._wrapResult = function(result, x, i) { - return this.resultSelector ? - result.map(function(y, i2) { return this.resultSelector(x, y, i, i2); }, this) : - result; - }; - - InnerObserver.prototype.next = function(x) { - var i = this.i++; - var result = tryCatch(this.selector)(x, i, this.source); - if (result === errorObj) { return this.o.onError(result.e); } - - isPromise(result) && (result = observableFromPromise(result)); - (isArrayLike(result) || isIterable(result)) && (result = Observable.from(result)); - this.o.onNext(this._wrapResult(result, x, i)); - }; - - InnerObserver.prototype.error = function(e) { this.o.onError(e); }; - - InnerObserver.prototype.completed = function() { this.o.onCompleted(); }; - - return FlatMapObservable; - -}(ObservableBase)); - - var Enumerable = Rx.internals.Enumerable = function () { }; - - function IsDisposedDisposable(state) { - this._s = state; - this.isDisposed = false; - } - - IsDisposedDisposable.prototype.dispose = function () { - if (!this.isDisposed) { - this.isDisposed = true; - this._s.isDisposed = true; - } - }; - - var ConcatEnumerableObservable = (function(__super__) { - inherits(ConcatEnumerableObservable, __super__); - function ConcatEnumerableObservable(sources) { - this.sources = sources; - __super__.call(this); - } - - function scheduleMethod(state, recurse) { - if (state.isDisposed) { return; } - var currentItem = tryCatch(state.e.next).call(state.e); - if (currentItem === errorObj) { return state.o.onError(currentItem.e); } - if (currentItem.done) { return state.o.onCompleted(); } - - // Check if promise - var currentValue = currentItem.value; - isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); - - var d = new SingleAssignmentDisposable(); - state.subscription.setDisposable(d); - d.setDisposable(currentValue.subscribe(new InnerObserver(state, recurse))); - } - - ConcatEnumerableObservable.prototype.subscribeCore = function (o) { - var subscription = new SerialDisposable(); - var state = { - isDisposed: false, - o: o, - subscription: subscription, - e: this.sources[$iterator$]() - }; - - var cancelable = currentThreadScheduler.scheduleRecursive(state, scheduleMethod); - return new NAryDisposable([subscription, cancelable, new IsDisposedDisposable(state)]); - }; - - function InnerObserver(state, recurse) { - this._state = state; - this._recurse = recurse; - AbstractObserver.call(this); - } - - inherits(InnerObserver, AbstractObserver); - - InnerObserver.prototype.next = function (x) { this._state.o.onNext(x); }; - InnerObserver.prototype.error = function (e) { this._state.o.onError(e); }; - InnerObserver.prototype.completed = function () { this._recurse(this._state); }; - - return ConcatEnumerableObservable; - }(ObservableBase)); - - Enumerable.prototype.concat = function () { - return new ConcatEnumerableObservable(this); - }; - - var CatchErrorObservable = (function(__super__) { - function CatchErrorObservable(sources) { - this.sources = sources; - __super__.call(this); - } - - inherits(CatchErrorObservable, __super__); - - function scheduleMethod(state, recurse) { - if (state.isDisposed) { return; } - var currentItem = tryCatch(state.e.next).call(state.e); - if (currentItem === errorObj) { return state.o.onError(currentItem.e); } - if (currentItem.done) { return state.lastError !== null ? state.o.onError(state.lastError) : state.o.onCompleted(); } - - var currentValue = currentItem.value; - isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); - - var d = new SingleAssignmentDisposable(); - state.subscription.setDisposable(d); - d.setDisposable(currentValue.subscribe(new InnerObserver(state, recurse))); - } - - CatchErrorObservable.prototype.subscribeCore = function (o) { - var subscription = new SerialDisposable(); - var state = { - isDisposed: false, - e: this.sources[$iterator$](), - subscription: subscription, - lastError: null, - o: o - }; - - var cancelable = currentThreadScheduler.scheduleRecursive(state, scheduleMethod); - return new NAryDisposable([subscription, cancelable, new IsDisposedDisposable(state)]); - }; - - function InnerObserver(state, recurse) { - this._state = state; - this._recurse = recurse; - AbstractObserver.call(this); - } - - inherits(InnerObserver, AbstractObserver); - - InnerObserver.prototype.next = function (x) { this._state.o.onNext(x); }; - InnerObserver.prototype.error = function (e) { this._state.lastError = e; this._recurse(this._state); }; - InnerObserver.prototype.completed = function () { this._state.o.onCompleted(); }; - - return CatchErrorObservable; - }(ObservableBase)); - - Enumerable.prototype.catchError = function () { - return new CatchErrorObservable(this); - }; - - var RepeatEnumerable = (function (__super__) { - inherits(RepeatEnumerable, __super__); - function RepeatEnumerable(v, c) { - this.v = v; - this.c = c == null ? -1 : c; - } - - RepeatEnumerable.prototype[$iterator$] = function () { - return new RepeatEnumerator(this); - }; - - function RepeatEnumerator(p) { - this.v = p.v; - this.l = p.c; - } - - RepeatEnumerator.prototype.next = function () { - if (this.l === 0) { return doneEnumerator; } - if (this.l > 0) { this.l--; } - return { done: false, value: this.v }; - }; - - return RepeatEnumerable; - }(Enumerable)); - - var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { - return new RepeatEnumerable(value, repeatCount); - }; - - var OfEnumerable = (function(__super__) { - inherits(OfEnumerable, __super__); - function OfEnumerable(s, fn, thisArg) { - this.s = s; - this.fn = fn ? bindCallback(fn, thisArg, 3) : null; - } - OfEnumerable.prototype[$iterator$] = function () { - return new OfEnumerator(this); - }; - - function OfEnumerator(p) { - this.i = -1; - this.s = p.s; - this.l = this.s.length; - this.fn = p.fn; - } - - OfEnumerator.prototype.next = function () { - return ++this.i < this.l ? - { done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } : - doneEnumerator; - }; - - return OfEnumerable; - }(Enumerable)); - - var enumerableOf = Enumerable.of = function (source, selector, thisArg) { - return new OfEnumerable(source, selector, thisArg); - }; - -var ObserveOnObservable = (function (__super__) { - inherits(ObserveOnObservable, __super__); - function ObserveOnObservable(source, s) { - this.source = source; - this._s = s; - __super__.call(this); - } - - ObserveOnObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new ObserveOnObserver(this._s, o)); - }; - - return ObserveOnObservable; -}(ObservableBase)); - - /** - * Wraps the source sequence in order to run its observer callbacks on the specified scheduler. - * - * This only invokes observer callbacks on a scheduler. In case the subscription and/or unsubscription actions have side-effects - * that require to be run on a scheduler, use subscribeOn. - * - * @param {Scheduler} scheduler Scheduler to notify observers on. - * @returns {Observable} The source sequence whose observations happen on the specified scheduler. - */ - observableProto.observeOn = function (scheduler) { - return new ObserveOnObservable(this, scheduler); - }; - - var SubscribeOnObservable = (function (__super__) { - inherits(SubscribeOnObservable, __super__); - function SubscribeOnObservable(source, s) { - this.source = source; - this._s = s; - __super__.call(this); - } - - function scheduleMethod(scheduler, state) { - var source = state[0], d = state[1], o = state[2]; - d.setDisposable(new ScheduledDisposable(scheduler, source.subscribe(o))); - } - - SubscribeOnObservable.prototype.subscribeCore = function (o) { - var m = new SingleAssignmentDisposable(), d = new SerialDisposable(); - d.setDisposable(m); - m.setDisposable(this._s.schedule([this.source, d, o], scheduleMethod)); - return d; - }; - - return SubscribeOnObservable; - }(ObservableBase)); - - /** - * Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler. This operation is not commonly used; - * see the remarks section for more information on the distinction between subscribeOn and observeOn. - - * This only performs the side-effects of subscription and unsubscription on the specified scheduler. In order to invoke observer - * callbacks on a scheduler, use observeOn. - - * @param {Scheduler} scheduler Scheduler to perform subscription and unsubscription actions on. - * @returns {Observable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. - */ - observableProto.subscribeOn = function (scheduler) { - return new SubscribeOnObservable(this, scheduler); - }; - - var FromPromiseObservable = (function(__super__) { - inherits(FromPromiseObservable, __super__); - function FromPromiseObservable(p, s) { - this._p = p; - this._s = s; - __super__.call(this); - } - - function scheduleNext(s, state) { - var o = state[0], data = state[1]; - o.onNext(data); - o.onCompleted(); - } - - function scheduleError(s, state) { - var o = state[0], err = state[1]; - o.onError(err); - } - - FromPromiseObservable.prototype.subscribeCore = function(o) { - var sad = new SingleAssignmentDisposable(), self = this, p = this._p; - - if (isFunction(p)) { - p = tryCatch(p)(); - if (p === errorObj) { - o.onError(p.e); - return sad; - } - } - - p - .then(function (data) { - sad.setDisposable(self._s.schedule([o, data], scheduleNext)); - }, function (err) { - sad.setDisposable(self._s.schedule([o, err], scheduleError)); - }); - - return sad; - }; - - return FromPromiseObservable; - }(ObservableBase)); - - /** - * Converts a Promise to an Observable sequence - * @param {Promise} An ES6 Compliant promise. - * @returns {Observable} An Observable sequence which wraps the existing promise success and failure. - */ - var observableFromPromise = Observable.fromPromise = function (promise, scheduler) { - scheduler || (scheduler = defaultScheduler); - return new FromPromiseObservable(promise, scheduler); - }; - - /* - * Converts an existing observable sequence to an ES6 Compatible Promise - * @example - * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); - * - * // With config - * Rx.config.Promise = RSVP.Promise; - * var promise = Rx.Observable.return(42).toPromise(); - * @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. - * @returns {Promise} An ES6 compatible promise with the last value from the observable sequence. - */ - observableProto.toPromise = function (promiseCtor) { - promiseCtor || (promiseCtor = Rx.config.Promise); - if (!promiseCtor) { throw new NotSupportedError('Promise type not provided nor in Rx.config.Promise'); } - var source = this; - return new promiseCtor(function (resolve, reject) { - // No cancellation can be done - var value; - source.subscribe(function (v) { - value = v; - }, reject, function () { - resolve(value); - }); - }); - }; - - var ToArrayObservable = (function(__super__) { - inherits(ToArrayObservable, __super__); - function ToArrayObservable(source) { - this.source = source; - __super__.call(this); - } - - ToArrayObservable.prototype.subscribeCore = function(o) { - return this.source.subscribe(new InnerObserver(o)); - }; - - inherits(InnerObserver, AbstractObserver); - function InnerObserver(o) { - this.o = o; - this.a = []; - AbstractObserver.call(this); - } - - InnerObserver.prototype.next = function (x) { this.a.push(x); }; - InnerObserver.prototype.error = function (e) { this.o.onError(e); }; - InnerObserver.prototype.completed = function () { this.o.onNext(this.a); this.o.onCompleted(); }; - - return ToArrayObservable; - }(ObservableBase)); - - /** - * Creates an array from an observable sequence. - * @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence. - */ - observableProto.toArray = function () { - return new ToArrayObservable(this); - }; - - /** - * Creates an observable sequence from a specified subscribe method implementation. - * @example - * var res = Rx.Observable.create(function (observer) { return function () { } ); - * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } ); - * var res = Rx.Observable.create(function (observer) { } ); - * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. - * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. - */ - Observable.create = function (subscribe, parent) { - return new AnonymousObservable(subscribe, parent); - }; - - var Defer = (function(__super__) { - inherits(Defer, __super__); - function Defer(factory) { - this._f = factory; - __super__.call(this); - } - - Defer.prototype.subscribeCore = function (o) { - var result = tryCatch(this._f)(); - if (result === errorObj) { return observableThrow(result.e).subscribe(o);} - isPromise(result) && (result = observableFromPromise(result)); - return result.subscribe(o); - }; - - return Defer; - }(ObservableBase)); - - /** - * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. - * - * @example - * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); }); - * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise. - * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function. - */ - var observableDefer = Observable.defer = function (observableFactory) { - return new Defer(observableFactory); - }; - - var EmptyObservable = (function(__super__) { - inherits(EmptyObservable, __super__); - function EmptyObservable(scheduler) { - this.scheduler = scheduler; - __super__.call(this); - } - - EmptyObservable.prototype.subscribeCore = function (observer) { - var sink = new EmptySink(observer, this.scheduler); - return sink.run(); - }; - - function EmptySink(observer, scheduler) { - this.observer = observer; - this.scheduler = scheduler; - } - - function scheduleItem(s, state) { - state.onCompleted(); - return disposableEmpty; - } - - EmptySink.prototype.run = function () { - var state = this.observer; - return this.scheduler === immediateScheduler ? - scheduleItem(null, state) : - this.scheduler.schedule(state, scheduleItem); - }; - - return EmptyObservable; - }(ObservableBase)); - - var EMPTY_OBSERVABLE = new EmptyObservable(immediateScheduler); - - /** - * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. - * - * @example - * var res = Rx.Observable.empty(); - * var res = Rx.Observable.empty(Rx.Scheduler.timeout); - * @param {Scheduler} [scheduler] Scheduler to send the termination call on. - * @returns {Observable} An observable sequence with no elements. - */ - var observableEmpty = Observable.empty = function (scheduler) { - isScheduler(scheduler) || (scheduler = immediateScheduler); - return scheduler === immediateScheduler ? EMPTY_OBSERVABLE : new EmptyObservable(scheduler); - }; - - var FromObservable = (function(__super__) { - inherits(FromObservable, __super__); - function FromObservable(iterable, fn, scheduler) { - this._iterable = iterable; - this._fn = fn; - this._scheduler = scheduler; - __super__.call(this); - } - - function createScheduleMethod(o, it, fn) { - return function loopRecursive(i, recurse) { - var next = tryCatch(it.next).call(it); - if (next === errorObj) { return o.onError(next.e); } - if (next.done) { return o.onCompleted(); } - - var result = next.value; - - if (isFunction(fn)) { - result = tryCatch(fn)(result, i); - if (result === errorObj) { return o.onError(result.e); } - } - - o.onNext(result); - recurse(i + 1); - }; - } - - FromObservable.prototype.subscribeCore = function (o) { - var list = Object(this._iterable), - it = getIterable(list); - - return this._scheduler.scheduleRecursive(0, createScheduleMethod(o, it, this._fn)); - }; - - return FromObservable; - }(ObservableBase)); - - var maxSafeInteger = Math.pow(2, 53) - 1; - - function StringIterable(s) { - this._s = s; - } - - StringIterable.prototype[$iterator$] = function () { - return new StringIterator(this._s); - }; - - function StringIterator(s) { - this._s = s; - this._l = s.length; - this._i = 0; - } - - StringIterator.prototype[$iterator$] = function () { - return this; - }; - - StringIterator.prototype.next = function () { - return this._i < this._l ? { done: false, value: this._s.charAt(this._i++) } : doneEnumerator; - }; - - function ArrayIterable(a) { - this._a = a; - } - - ArrayIterable.prototype[$iterator$] = function () { - return new ArrayIterator(this._a); - }; - - function ArrayIterator(a) { - this._a = a; - this._l = toLength(a); - this._i = 0; - } - - ArrayIterator.prototype[$iterator$] = function () { - return this; - }; - - ArrayIterator.prototype.next = function () { - return this._i < this._l ? { done: false, value: this._a[this._i++] } : doneEnumerator; - }; - - function numberIsFinite(value) { - return typeof value === 'number' && root.isFinite(value); - } - - function isNan(n) { - return n !== n; - } - - function getIterable(o) { - var i = o[$iterator$], it; - if (!i && typeof o === 'string') { - it = new StringIterable(o); - return it[$iterator$](); - } - if (!i && o.length !== undefined) { - it = new ArrayIterable(o); - return it[$iterator$](); - } - if (!i) { throw new TypeError('Object is not iterable'); } - return o[$iterator$](); - } - - function sign(value) { - var number = +value; - if (number === 0) { return number; } - if (isNaN(number)) { return number; } - return number < 0 ? -1 : 1; - } - - function toLength(o) { - var len = +o.length; - if (isNaN(len)) { return 0; } - if (len === 0 || !numberIsFinite(len)) { return len; } - len = sign(len) * Math.floor(Math.abs(len)); - if (len <= 0) { return 0; } - if (len > maxSafeInteger) { return maxSafeInteger; } - return len; - } - - /** - * This method creates a new Observable sequence from an array-like or iterable object. - * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence. - * @param {Function} [mapFn] Map function to call on every element of the array. - * @param {Any} [thisArg] The context to use calling the mapFn if provided. - * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. - */ - var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) { - if (iterable == null) { - throw new Error('iterable cannot be null.') - } - if (mapFn && !isFunction(mapFn)) { - throw new Error('mapFn when provided must be a function'); - } - if (mapFn) { - var mapper = bindCallback(mapFn, thisArg, 2); - } - isScheduler(scheduler) || (scheduler = currentThreadScheduler); - return new FromObservable(iterable, mapper, scheduler); - } - - var FromArrayObservable = (function(__super__) { - inherits(FromArrayObservable, __super__); - function FromArrayObservable(args, scheduler) { - this._args = args; - this._scheduler = scheduler; - __super__.call(this); - } - - function scheduleMethod(o, args) { - var len = args.length; - return function loopRecursive (i, recurse) { - if (i < len) { - o.onNext(args[i]); - recurse(i + 1); - } else { - o.onCompleted(); - } - }; - } - - FromArrayObservable.prototype.subscribeCore = function (o) { - return this._scheduler.scheduleRecursive(0, scheduleMethod(o, this._args)); - }; - - return FromArrayObservable; - }(ObservableBase)); - - /** - * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. - * @deprecated use Observable.from or Observable.of - * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. - * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence. - */ - var observableFromArray = Observable.fromArray = function (array, scheduler) { - isScheduler(scheduler) || (scheduler = currentThreadScheduler); - return new FromArrayObservable(array, scheduler) - }; - - var GenerateObservable = (function (__super__) { - inherits(GenerateObservable, __super__); - function GenerateObservable(state, cndFn, itrFn, resFn, s) { - this._initialState = state; - this._cndFn = cndFn; - this._itrFn = itrFn; - this._resFn = resFn; - this._s = s; - __super__.call(this); - } - - function scheduleRecursive(state, recurse) { - if (state.first) { - state.first = false; - } else { - state.newState = tryCatch(state.self._itrFn)(state.newState); - if (state.newState === errorObj) { return state.o.onError(state.newState.e); } - } - var hasResult = tryCatch(state.self._cndFn)(state.newState); - if (hasResult === errorObj) { return state.o.onError(hasResult.e); } - if (hasResult) { - var result = tryCatch(state.self._resFn)(state.newState); - if (result === errorObj) { return state.o.onError(result.e); } - state.o.onNext(result); - recurse(state); - } else { - state.o.onCompleted(); - } - } - - GenerateObservable.prototype.subscribeCore = function (o) { - var state = { - o: o, - self: this, - first: true, - newState: this._initialState - }; - return this._s.scheduleRecursive(state, scheduleRecursive); - }; - - return GenerateObservable; - }(ObservableBase)); - - /** - * Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler to send out observer messages. - * - * @example - * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }); - * var res = Rx.Observable.generate(0, function (x) { return x < 10; }, function (x) { return x + 1; }, function (x) { return x; }, Rx.Scheduler.timeout); - * @param {Mixed} initialState Initial state. - * @param {Function} condition Condition to terminate generation (upon returning false). - * @param {Function} iterate Iteration step function. - * @param {Function} resultSelector Selector function for results produced in the sequence. - * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not provided, defaults to Scheduler.currentThread. - * @returns {Observable} The generated sequence. - */ - Observable.generate = function (initialState, condition, iterate, resultSelector, scheduler) { - isScheduler(scheduler) || (scheduler = currentThreadScheduler); - return new GenerateObservable(initialState, condition, iterate, resultSelector, scheduler); - }; - - var NeverObservable = (function(__super__) { - inherits(NeverObservable, __super__); - function NeverObservable() { - __super__.call(this); - } - - NeverObservable.prototype.subscribeCore = function (observer) { - return disposableEmpty; - }; - - return NeverObservable; - }(ObservableBase)); - - var NEVER_OBSERVABLE = new NeverObservable(); - - /** - * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). - * @returns {Observable} An observable sequence whose observers will never get called. - */ - var observableNever = Observable.never = function () { - return NEVER_OBSERVABLE; - }; - - function observableOf (scheduler, array) { - isScheduler(scheduler) || (scheduler = currentThreadScheduler); - return new FromArrayObservable(array, scheduler); - } - - /** - * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. - * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. - */ - Observable.of = function () { - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - return new FromArrayObservable(args, currentThreadScheduler); - }; - - /** - * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. - * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments. - * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. - */ - Observable.ofWithScheduler = function (scheduler) { - var len = arguments.length, args = new Array(len - 1); - for(var i = 1; i < len; i++) { args[i - 1] = arguments[i]; } - return new FromArrayObservable(args, scheduler); - }; - - var PairsObservable = (function(__super__) { - inherits(PairsObservable, __super__); - function PairsObservable(o, scheduler) { - this._o = o; - this._keys = Object.keys(o); - this._scheduler = scheduler; - __super__.call(this); - } - - function scheduleMethod(o, obj, keys) { - return function loopRecursive(i, recurse) { - if (i < keys.length) { - var key = keys[i]; - o.onNext([key, obj[key]]); - recurse(i + 1); - } else { - o.onCompleted(); - } - }; - } - - PairsObservable.prototype.subscribeCore = function (o) { - return this._scheduler.scheduleRecursive(0, scheduleMethod(o, this._o, this._keys)); - }; - - return PairsObservable; - }(ObservableBase)); - - /** - * Convert an object into an observable sequence of [key, value] pairs. - * @param {Object} obj The object to inspect. - * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. - * @returns {Observable} An observable sequence of [key, value] pairs from the object. - */ - Observable.pairs = function (obj, scheduler) { - scheduler || (scheduler = currentThreadScheduler); - return new PairsObservable(obj, scheduler); - }; - - var RangeObservable = (function(__super__) { - inherits(RangeObservable, __super__); - function RangeObservable(start, count, scheduler) { - this.start = start; - this.rangeCount = count; - this.scheduler = scheduler; - __super__.call(this); - } - - function loopRecursive(start, count, o) { - return function loop (i, recurse) { - if (i < count) { - o.onNext(start + i); - recurse(i + 1); - } else { - o.onCompleted(); - } - }; - } - - RangeObservable.prototype.subscribeCore = function (o) { - return this.scheduler.scheduleRecursive( - 0, - loopRecursive(this.start, this.rangeCount, o) - ); - }; - - return RangeObservable; - }(ObservableBase)); - - /** - * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. - * @param {Number} start The value of the first integer in the sequence. - * @param {Number} count The number of sequential integers to generate. - * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread. - * @returns {Observable} An observable sequence that contains a range of sequential integral numbers. - */ - Observable.range = function (start, count, scheduler) { - isScheduler(scheduler) || (scheduler = currentThreadScheduler); - return new RangeObservable(start, count, scheduler); - }; - - var RepeatObservable = (function(__super__) { - inherits(RepeatObservable, __super__); - function RepeatObservable(value, repeatCount, scheduler) { - this.value = value; - this.repeatCount = repeatCount == null ? -1 : repeatCount; - this.scheduler = scheduler; - __super__.call(this); - } - - RepeatObservable.prototype.subscribeCore = function (observer) { - var sink = new RepeatSink(observer, this); - return sink.run(); - }; - - return RepeatObservable; - }(ObservableBase)); - - function RepeatSink(observer, parent) { - this.observer = observer; - this.parent = parent; - } - - RepeatSink.prototype.run = function () { - var observer = this.observer, value = this.parent.value; - function loopRecursive(i, recurse) { - if (i === -1 || i > 0) { - observer.onNext(value); - i > 0 && i--; - } - if (i === 0) { return observer.onCompleted(); } - recurse(i); - } - - return this.parent.scheduler.scheduleRecursive(this.parent.repeatCount, loopRecursive); - }; - - /** - * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. - * @param {Mixed} value Element to repeat. - * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely. - * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate. - * @returns {Observable} An observable sequence that repeats the given element the specified number of times. - */ - Observable.repeat = function (value, repeatCount, scheduler) { - isScheduler(scheduler) || (scheduler = currentThreadScheduler); - return new RepeatObservable(value, repeatCount, scheduler); - }; - - var JustObservable = (function(__super__) { - inherits(JustObservable, __super__); - function JustObservable(value, scheduler) { - this._value = value; - this._scheduler = scheduler; - __super__.call(this); - } - - JustObservable.prototype.subscribeCore = function (o) { - var state = [this._value, o]; - return this._scheduler === immediateScheduler ? - scheduleItem(null, state) : - this._scheduler.schedule(state, scheduleItem); - }; - - function scheduleItem(s, state) { - var value = state[0], observer = state[1]; - observer.onNext(value); - observer.onCompleted(); - return disposableEmpty; - } - - return JustObservable; - }(ObservableBase)); - - /** - * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. - * There is an alias called 'just' or browsers 0) { - this.parent.handleSubscribe(this.parent.q.shift()); - } else { - this.parent.activeCount--; - this.parent.done && this.parent.activeCount === 0 && this.parent.o.onCompleted(); - } - }; - - return MergeObserver; - }(AbstractObserver)); - - /** - * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. - * Or merges two observable sequences into a single observable sequence. - * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. - * @returns {Observable} The observable sequence that merges the elements of the inner sequences. - */ - observableProto.merge = function (maxConcurrentOrOther) { - return typeof maxConcurrentOrOther !== 'number' ? - observableMerge(this, maxConcurrentOrOther) : - new MergeObservable(this, maxConcurrentOrOther); - }; - - /** - * Merges all the observable sequences into a single observable sequence. - * The scheduler is optional and if not specified, the immediate scheduler is used. - * @returns {Observable} The observable sequence that merges the elements of the observable sequences. - */ - var observableMerge = Observable.merge = function () { - var scheduler, sources = [], i, len = arguments.length; - if (!arguments[0]) { - scheduler = immediateScheduler; - for(i = 1; i < len; i++) { sources.push(arguments[i]); } - } else if (isScheduler(arguments[0])) { - scheduler = arguments[0]; - for(i = 1; i < len; i++) { sources.push(arguments[i]); } - } else { - scheduler = immediateScheduler; - for(i = 0; i < len; i++) { sources.push(arguments[i]); } - } - if (Array.isArray(sources[0])) { - sources = sources[0]; - } - return observableOf(scheduler, sources).mergeAll(); - }; - - var CompositeError = Rx.CompositeError = function(errors) { - this.innerErrors = errors; - this.message = 'This contains multiple errors. Check the innerErrors'; - Error.call(this); - }; - CompositeError.prototype = Object.create(Error.prototype); - CompositeError.prototype.name = 'CompositeError'; - - var MergeDelayErrorObservable = (function(__super__) { - inherits(MergeDelayErrorObservable, __super__); - function MergeDelayErrorObservable(source) { - this.source = source; - __super__.call(this); - } - - MergeDelayErrorObservable.prototype.subscribeCore = function (o) { - var group = new CompositeDisposable(), - m = new SingleAssignmentDisposable(), - state = { isStopped: false, errors: [], o: o }; - - group.add(m); - m.setDisposable(this.source.subscribe(new MergeDelayErrorObserver(group, state))); - - return group; - }; - - return MergeDelayErrorObservable; - }(ObservableBase)); - - var MergeDelayErrorObserver = (function(__super__) { - inherits(MergeDelayErrorObserver, __super__); - function MergeDelayErrorObserver(group, state) { - this._group = group; - this._state = state; - __super__.call(this); - } - - function setCompletion(o, errors) { - if (errors.length === 0) { - o.onCompleted(); - } else if (errors.length === 1) { - o.onError(errors[0]); - } else { - o.onError(new CompositeError(errors)); - } - } - - MergeDelayErrorObserver.prototype.next = function (x) { - var inner = new SingleAssignmentDisposable(); - this._group.add(inner); - - // Check for promises support - isPromise(x) && (x = observableFromPromise(x)); - inner.setDisposable(x.subscribe(new InnerObserver(inner, this._group, this._state))); - }; - - MergeDelayErrorObserver.prototype.error = function (e) { - this._state.errors.push(e); - this._state.isStopped = true; - this._group.length === 1 && setCompletion(this._state.o, this._state.errors); - }; - - MergeDelayErrorObserver.prototype.completed = function () { - this._state.isStopped = true; - this._group.length === 1 && setCompletion(this._state.o, this._state.errors); - }; - - inherits(InnerObserver, __super__); - function InnerObserver(inner, group, state) { - this._inner = inner; - this._group = group; - this._state = state; - __super__.call(this); - } - - InnerObserver.prototype.next = function (x) { this._state.o.onNext(x); }; - InnerObserver.prototype.error = function (e) { - this._state.errors.push(e); - this._group.remove(this._inner); - this._state.isStopped && this._group.length === 1 && setCompletion(this._state.o, this._state.errors); - }; - InnerObserver.prototype.completed = function () { - this._group.remove(this._inner); - this._state.isStopped && this._group.length === 1 && setCompletion(this._state.o, this._state.errors); - }; - - return MergeDelayErrorObserver; - }(AbstractObserver)); - - /** - * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to - * receive all successfully emitted items from all of the source Observables without being interrupted by - * an error notification from one of them. - * - * This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an - * error via the Observer's onError, mergeDelayError will refrain from propagating that - * error notification until all of the merged Observables have finished emitting items. - * @param {Array | Arguments} args Arguments or an array to merge. - * @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable - */ - Observable.mergeDelayError = function() { - var args; - if (Array.isArray(arguments[0])) { - args = arguments[0]; - } else { - var len = arguments.length; - args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - } - var source = observableOf(null, args); - return new MergeDelayErrorObservable(source); - }; - - var MergeAllObservable = (function (__super__) { - inherits(MergeAllObservable, __super__); - - function MergeAllObservable(source) { - this.source = source; - __super__.call(this); - } - - MergeAllObservable.prototype.subscribeCore = function (o) { - var g = new CompositeDisposable(), m = new SingleAssignmentDisposable(); - g.add(m); - m.setDisposable(this.source.subscribe(new MergeAllObserver(o, g))); - return g; - }; - - return MergeAllObservable; - }(ObservableBase)); - - var MergeAllObserver = (function (__super__) { - function MergeAllObserver(o, g) { - this.o = o; - this.g = g; - this.done = false; - __super__.call(this); - } - - inherits(MergeAllObserver, __super__); - - MergeAllObserver.prototype.next = function(innerSource) { - var sad = new SingleAssignmentDisposable(); - this.g.add(sad); - isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); - sad.setDisposable(innerSource.subscribe(new InnerObserver(this, sad))); - }; - - MergeAllObserver.prototype.error = function (e) { - this.o.onError(e); - }; - - MergeAllObserver.prototype.completed = function () { - this.done = true; - this.g.length === 1 && this.o.onCompleted(); - }; - - function InnerObserver(parent, sad) { - this.parent = parent; - this.sad = sad; - __super__.call(this); - } - - inherits(InnerObserver, __super__); - - InnerObserver.prototype.next = function (x) { - this.parent.o.onNext(x); - }; - InnerObserver.prototype.error = function (e) { - this.parent.o.onError(e); - }; - InnerObserver.prototype.completed = function () { - this.parent.g.remove(this.sad); - this.parent.done && this.parent.g.length === 1 && this.parent.o.onCompleted(); - }; - - return MergeAllObserver; - }(AbstractObserver)); - - /** - * Merges an observable sequence of observable sequences into an observable sequence. - * @returns {Observable} The observable sequence that merges the elements of the inner sequences. - */ - observableProto.mergeAll = function () { - return new MergeAllObservable(this); - }; - - /** - * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. - * @param {Observable} second Second observable sequence used to produce results after the first sequence terminates. - * @returns {Observable} An observable sequence that concatenates the first and second sequence, even if the first sequence terminates exceptionally. - */ - observableProto.onErrorResumeNext = function (second) { - if (!second) { throw new Error('Second observable is required'); } - return onErrorResumeNext([this, second]); - }; - - var OnErrorResumeNextObservable = (function(__super__) { - inherits(OnErrorResumeNextObservable, __super__); - function OnErrorResumeNextObservable(sources) { - this.sources = sources; - __super__.call(this); - } - - function scheduleMethod(state, recurse) { - if (state.pos < state.sources.length) { - var current = state.sources[state.pos++]; - isPromise(current) && (current = observableFromPromise(current)); - var d = new SingleAssignmentDisposable(); - state.subscription.setDisposable(d); - d.setDisposable(current.subscribe(new OnErrorResumeNextObserver(state, recurse))); - } else { - state.o.onCompleted(); - } - } - - OnErrorResumeNextObservable.prototype.subscribeCore = function (o) { - var subscription = new SerialDisposable(), - state = {pos: 0, subscription: subscription, o: o, sources: this.sources }, - cancellable = immediateScheduler.scheduleRecursive(state, scheduleMethod); - - return new BinaryDisposable(subscription, cancellable); - }; - - return OnErrorResumeNextObservable; - }(ObservableBase)); - - var OnErrorResumeNextObserver = (function(__super__) { - inherits(OnErrorResumeNextObserver, __super__); - function OnErrorResumeNextObserver(state, recurse) { - this._state = state; - this._recurse = recurse; - __super__.call(this); - } - - OnErrorResumeNextObserver.prototype.next = function (x) { this._state.o.onNext(x); }; - OnErrorResumeNextObserver.prototype.error = function () { this._recurse(this._state); }; - OnErrorResumeNextObserver.prototype.completed = function () { this._recurse(this._state); }; - - return OnErrorResumeNextObserver; - }(AbstractObserver)); - - /** - * Continues an observable sequence that is terminated normally or by an exception with the next observable sequence. - * @returns {Observable} An observable sequence that concatenates the source sequences, even if a sequence terminates exceptionally. - */ - var onErrorResumeNext = Observable.onErrorResumeNext = function () { - var sources = []; - if (Array.isArray(arguments[0])) { - sources = arguments[0]; - } else { - var len = arguments.length; - sources = new Array(len); - for(var i = 0; i < len; i++) { sources[i] = arguments[i]; } - } - return new OnErrorResumeNextObservable(sources); - }; - - var SkipUntilObservable = (function(__super__) { - inherits(SkipUntilObservable, __super__); - - function SkipUntilObservable(source, other) { - this._s = source; - this._o = isPromise(other) ? observableFromPromise(other) : other; - this._open = false; - __super__.call(this); - } - - SkipUntilObservable.prototype.subscribeCore = function(o) { - var leftSubscription = new SingleAssignmentDisposable(); - leftSubscription.setDisposable(this._s.subscribe(new SkipUntilSourceObserver(o, this))); - - isPromise(this._o) && (this._o = observableFromPromise(this._o)); - - var rightSubscription = new SingleAssignmentDisposable(); - rightSubscription.setDisposable(this._o.subscribe(new SkipUntilOtherObserver(o, this, rightSubscription))); - - return new BinaryDisposable(leftSubscription, rightSubscription); - }; - - return SkipUntilObservable; - }(ObservableBase)); - - var SkipUntilSourceObserver = (function(__super__) { - inherits(SkipUntilSourceObserver, __super__); - function SkipUntilSourceObserver(o, p) { - this._o = o; - this._p = p; - __super__.call(this); - } - - SkipUntilSourceObserver.prototype.next = function (x) { - this._p._open && this._o.onNext(x); - }; - - SkipUntilSourceObserver.prototype.error = function (err) { - this._o.onError(err); - }; - - SkipUntilSourceObserver.prototype.onCompleted = function () { - this._p._open && this._o.onCompleted(); - }; - - return SkipUntilSourceObserver; - }(AbstractObserver)); - - var SkipUntilOtherObserver = (function(__super__) { - inherits(SkipUntilOtherObserver, __super__); - function SkipUntilOtherObserver(o, p, r) { - this._o = o; - this._p = p; - this._r = r; - __super__.call(this); - } - - SkipUntilOtherObserver.prototype.next = function () { - this._p._open = true; - this._r.dispose(); - }; - - SkipUntilOtherObserver.prototype.error = function (err) { - this._o.onError(err); - }; - - SkipUntilOtherObserver.prototype.onCompleted = function () { - this._r.dispose(); - }; - - return SkipUntilOtherObserver; - }(AbstractObserver)); - - /** - * Returns the values from the source observable sequence only after the other observable sequence produces a value. - * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence. - * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. - */ - observableProto.skipUntil = function (other) { - return new SkipUntilObservable(this, other); - }; - - var SwitchObservable = (function(__super__) { - inherits(SwitchObservable, __super__); - function SwitchObservable(source) { - this.source = source; - __super__.call(this); - } - - SwitchObservable.prototype.subscribeCore = function (o) { - var inner = new SerialDisposable(), s = this.source.subscribe(new SwitchObserver(o, inner)); - return new BinaryDisposable(s, inner); - }; - - inherits(SwitchObserver, AbstractObserver); - function SwitchObserver(o, inner) { - this.o = o; - this.inner = inner; - this.stopped = false; - this.latest = 0; - this.hasLatest = false; - AbstractObserver.call(this); - } - - SwitchObserver.prototype.next = function (innerSource) { - var d = new SingleAssignmentDisposable(), id = ++this.latest; - this.hasLatest = true; - this.inner.setDisposable(d); - isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); - d.setDisposable(innerSource.subscribe(new InnerObserver(this, id))); - }; - - SwitchObserver.prototype.error = function (e) { - this.o.onError(e); - }; - - SwitchObserver.prototype.completed = function () { - this.stopped = true; - !this.hasLatest && this.o.onCompleted(); - }; - - inherits(InnerObserver, AbstractObserver); - function InnerObserver(parent, id) { - this.parent = parent; - this.id = id; - AbstractObserver.call(this); - } - InnerObserver.prototype.next = function (x) { - this.parent.latest === this.id && this.parent.o.onNext(x); - }; - - InnerObserver.prototype.error = function (e) { - this.parent.latest === this.id && this.parent.o.onError(e); - }; - - InnerObserver.prototype.completed = function () { - if (this.parent.latest === this.id) { - this.parent.hasLatest = false; - this.parent.stopped && this.parent.o.onCompleted(); - } - }; - - return SwitchObservable; - }(ObservableBase)); - - /** - * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. - * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ - observableProto['switch'] = observableProto.switchLatest = function () { - return new SwitchObservable(this); - }; - - var TakeUntilObservable = (function(__super__) { - inherits(TakeUntilObservable, __super__); - - function TakeUntilObservable(source, other) { - this.source = source; - this.other = isPromise(other) ? observableFromPromise(other) : other; - __super__.call(this); - } - - TakeUntilObservable.prototype.subscribeCore = function(o) { - return new BinaryDisposable( - this.source.subscribe(o), - this.other.subscribe(new TakeUntilObserver(o)) - ); - }; - - return TakeUntilObservable; - }(ObservableBase)); - - var TakeUntilObserver = (function(__super__) { - inherits(TakeUntilObserver, __super__); - function TakeUntilObserver(o) { - this._o = o; - __super__.call(this); - } - - TakeUntilObserver.prototype.next = function () { - this._o.onCompleted(); - }; - - TakeUntilObserver.prototype.error = function (err) { - this._o.onError(err); - }; - - TakeUntilObserver.prototype.onCompleted = noop; - - return TakeUntilObserver; - }(AbstractObserver)); - - /** - * Returns the values from the source observable sequence until the other observable sequence produces a value. - * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence. - * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. - */ - observableProto.takeUntil = function (other) { - return new TakeUntilObservable(this, other); - }; - - function falseFactory() { return false; } - function argumentsToArray() { - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - return args; - } - - var WithLatestFromObservable = (function(__super__) { - inherits(WithLatestFromObservable, __super__); - function WithLatestFromObservable(source, sources, resultSelector) { - this._s = source; - this._ss = sources; - this._cb = resultSelector; - __super__.call(this); - } - - WithLatestFromObservable.prototype.subscribeCore = function (o) { - var len = this._ss.length; - var state = { - hasValue: arrayInitialize(len, falseFactory), - hasValueAll: false, - values: new Array(len) - }; - - var n = this._ss.length, subscriptions = new Array(n + 1); - for (var i = 0; i < n; i++) { - var other = this._ss[i], sad = new SingleAssignmentDisposable(); - isPromise(other) && (other = observableFromPromise(other)); - sad.setDisposable(other.subscribe(new WithLatestFromOtherObserver(o, i, state))); - subscriptions[i] = sad; - } - - var outerSad = new SingleAssignmentDisposable(); - outerSad.setDisposable(this._s.subscribe(new WithLatestFromSourceObserver(o, this._cb, state))); - subscriptions[n] = outerSad; - - return new NAryDisposable(subscriptions); - }; - - return WithLatestFromObservable; - }(ObservableBase)); - - var WithLatestFromOtherObserver = (function (__super__) { - inherits(WithLatestFromOtherObserver, __super__); - function WithLatestFromOtherObserver(o, i, state) { - this._o = o; - this._i = i; - this._state = state; - __super__.call(this); - } - - WithLatestFromOtherObserver.prototype.next = function (x) { - this._state.values[this._i] = x; - this._state.hasValue[this._i] = true; - this._state.hasValueAll = this._state.hasValue.every(identity); - }; - - WithLatestFromOtherObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - WithLatestFromOtherObserver.prototype.completed = noop; - - return WithLatestFromOtherObserver; - }(AbstractObserver)); - - var WithLatestFromSourceObserver = (function (__super__) { - inherits(WithLatestFromSourceObserver, __super__); - function WithLatestFromSourceObserver(o, cb, state) { - this._o = o; - this._cb = cb; - this._state = state; - __super__.call(this); - } - - WithLatestFromSourceObserver.prototype.next = function (x) { - var allValues = [x].concat(this._state.values); - if (!this._state.hasValueAll) { return; } - var res = tryCatch(this._cb).apply(null, allValues); - if (res === errorObj) { return this._o.onError(res.e); } - this._o.onNext(res); - }; - - WithLatestFromSourceObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - WithLatestFromSourceObserver.prototype.completed = function () { - this._o.onCompleted(); - }; - - return WithLatestFromSourceObserver; - }(AbstractObserver)); - - /** - * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element. - * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - observableProto.withLatestFrom = function () { - if (arguments.length === 0) { throw new Error('invalid arguments'); } - - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; - Array.isArray(args[0]) && (args = args[0]); - - return new WithLatestFromObservable(this, args, resultSelector); - }; - - function falseFactory() { return false; } - function emptyArrayFactory() { return []; } - - var ZipObservable = (function(__super__) { - inherits(ZipObservable, __super__); - function ZipObservable(sources, resultSelector) { - this._s = sources; - this._cb = resultSelector; - __super__.call(this); - } - - ZipObservable.prototype.subscribeCore = function(observer) { - var n = this._s.length, - subscriptions = new Array(n), - done = arrayInitialize(n, falseFactory), - q = arrayInitialize(n, emptyArrayFactory); - - for (var i = 0; i < n; i++) { - var source = this._s[i], sad = new SingleAssignmentDisposable(); - subscriptions[i] = sad; - isPromise(source) && (source = observableFromPromise(source)); - sad.setDisposable(source.subscribe(new ZipObserver(observer, i, this, q, done))); - } - - return new NAryDisposable(subscriptions); - }; - - return ZipObservable; - }(ObservableBase)); - - var ZipObserver = (function (__super__) { - inherits(ZipObserver, __super__); - function ZipObserver(o, i, p, q, d) { - this._o = o; - this._i = i; - this._p = p; - this._q = q; - this._d = d; - __super__.call(this); - } - - function notEmpty(x) { return x.length > 0; } - function shiftEach(x) { return x.shift(); } - function notTheSame(i) { - return function (x, j) { - return j !== i; - }; - } - - ZipObserver.prototype.next = function (x) { - this._q[this._i].push(x); - if (this._q.every(notEmpty)) { - var queuedValues = this._q.map(shiftEach); - var res = tryCatch(this._p._cb).apply(null, queuedValues); - if (res === errorObj) { return this._o.onError(res.e); } - this._o.onNext(res); - } else if (this._d.filter(notTheSame(this._i)).every(identity)) { - this._o.onCompleted(); - } - }; - - ZipObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - ZipObserver.prototype.completed = function () { - this._d[this._i] = true; - this._d.every(identity) && this._o.onCompleted(); - }; - - return ZipObserver; - }(AbstractObserver)); - - /** - * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. - * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args. - * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function. - */ - observableProto.zip = function () { - if (arguments.length === 0) { throw new Error('invalid arguments'); } - - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; - Array.isArray(args[0]) && (args = args[0]); - - var parent = this; - args.unshift(parent); - - return new ZipObservable(args, resultSelector); - }; - - /** - * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. - * @param arguments Observable sources. - * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources. - * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - Observable.zip = function () { - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - if (Array.isArray(args[0])) { - args = isFunction(args[1]) ? args[0].concat(args[1]) : args[0]; - } - var first = args.shift(); - return first.zip.apply(first, args); - }; - -function falseFactory() { return false; } -function emptyArrayFactory() { return []; } -function argumentsToArray() { - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - return args; -} - -var ZipIterableObservable = (function(__super__) { - inherits(ZipIterableObservable, __super__); - function ZipIterableObservable(sources, cb) { - this.sources = sources; - this._cb = cb; - __super__.call(this); - } - - ZipIterableObservable.prototype.subscribeCore = function (o) { - var sources = this.sources, len = sources.length, subscriptions = new Array(len); - - var state = { - q: arrayInitialize(len, emptyArrayFactory), - done: arrayInitialize(len, falseFactory), - cb: this._cb, - o: o - }; - - for (var i = 0; i < len; i++) { - (function (i) { - var source = sources[i], sad = new SingleAssignmentDisposable(); - (isArrayLike(source) || isIterable(source)) && (source = observableFrom(source)); - - subscriptions[i] = sad; - sad.setDisposable(source.subscribe(new ZipIterableObserver(state, i))); - }(i)); - } - - return new NAryDisposable(subscriptions); - }; - - return ZipIterableObservable; -}(ObservableBase)); - -var ZipIterableObserver = (function (__super__) { - inherits(ZipIterableObserver, __super__); - function ZipIterableObserver(s, i) { - this._s = s; - this._i = i; - __super__.call(this); - } - - function notEmpty(x) { return x.length > 0; } - function shiftEach(x) { return x.shift(); } - function notTheSame(i) { - return function (x, j) { - return j !== i; - }; - } - - ZipIterableObserver.prototype.next = function (x) { - this._s.q[this._i].push(x); - if (this._s.q.every(notEmpty)) { - var queuedValues = this._s.q.map(shiftEach), - res = tryCatch(this._s.cb).apply(null, queuedValues); - if (res === errorObj) { return this._s.o.onError(res.e); } - this._s.o.onNext(res); - } else if (this._s.done.filter(notTheSame(this._i)).every(identity)) { - this._s.o.onCompleted(); - } - }; - - ZipIterableObserver.prototype.error = function (e) { this._s.o.onError(e); }; - - ZipIterableObserver.prototype.completed = function () { - this._s.done[this._i] = true; - this._s.done.every(identity) && this._s.o.onCompleted(); - }; - - return ZipIterableObserver; -}(AbstractObserver)); - -/** - * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. - * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args. - * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function. - */ -observableProto.zipIterable = function () { - if (arguments.length === 0) { throw new Error('invalid arguments'); } - - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; - - var parent = this; - args.unshift(parent); - return new ZipIterableObservable(args, resultSelector); -}; - - function asObservable(source) { - return function subscribe(o) { return source.subscribe(o); }; - } - - /** - * Hides the identity of an observable sequence. - * @returns {Observable} An observable sequence that hides the identity of the source sequence. - */ - observableProto.asObservable = function () { - return new AnonymousObservable(asObservable(this), this); - }; - - function toArray(x) { return x.toArray(); } - function notEmpty(x) { return x.length > 0; } - - /** - * Projects each element of an observable sequence into zero or more buffers which are produced based on element count information. - * @param {Number} count Length of each buffer. - * @param {Number} [skip] Number of elements to skip between creation of consecutive buffers. If not provided, defaults to the count. - * @returns {Observable} An observable sequence of buffers. - */ - observableProto.bufferWithCount = observableProto.bufferCount = function (count, skip) { - typeof skip !== 'number' && (skip = count); - return this.windowWithCount(count, skip) - .flatMap(toArray) - .filter(notEmpty); - }; - - var DematerializeObservable = (function (__super__) { - inherits(DematerializeObservable, __super__); - function DematerializeObservable(source) { - this.source = source; - __super__.call(this); - } - - DematerializeObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new DematerializeObserver(o)); - }; - - return DematerializeObservable; - }(ObservableBase)); - - var DematerializeObserver = (function (__super__) { - inherits(DematerializeObserver, __super__); - - function DematerializeObserver(o) { - this._o = o; - __super__.call(this); - } - - DematerializeObserver.prototype.next = function (x) { x.accept(this._o); }; - DematerializeObserver.prototype.error = function (e) { this._o.onError(e); }; - DematerializeObserver.prototype.completed = function () { this._o.onCompleted(); }; - - return DematerializeObserver; - }(AbstractObserver)); - - /** - * Dematerializes the explicit notification values of an observable sequence as implicit notifications. - * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. - */ - observableProto.dematerialize = function () { - return new DematerializeObservable(this); - }; - - var DistinctUntilChangedObservable = (function(__super__) { - inherits(DistinctUntilChangedObservable, __super__); - function DistinctUntilChangedObservable(source, keyFn, comparer) { - this.source = source; - this.keyFn = keyFn; - this.comparer = comparer; - __super__.call(this); - } - - DistinctUntilChangedObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new DistinctUntilChangedObserver(o, this.keyFn, this.comparer)); - }; - - return DistinctUntilChangedObservable; - }(ObservableBase)); - - var DistinctUntilChangedObserver = (function(__super__) { - inherits(DistinctUntilChangedObserver, __super__); - function DistinctUntilChangedObserver(o, keyFn, comparer) { - this.o = o; - this.keyFn = keyFn; - this.comparer = comparer; - this.hasCurrentKey = false; - this.currentKey = null; - __super__.call(this); - } - - DistinctUntilChangedObserver.prototype.next = function (x) { - var key = x, comparerEquals; - if (isFunction(this.keyFn)) { - key = tryCatch(this.keyFn)(x); - if (key === errorObj) { return this.o.onError(key.e); } - } - if (this.hasCurrentKey) { - comparerEquals = tryCatch(this.comparer)(this.currentKey, key); - if (comparerEquals === errorObj) { return this.o.onError(comparerEquals.e); } - } - if (!this.hasCurrentKey || !comparerEquals) { - this.hasCurrentKey = true; - this.currentKey = key; - this.o.onNext(x); - } - }; - DistinctUntilChangedObserver.prototype.error = function(e) { - this.o.onError(e); - }; - DistinctUntilChangedObserver.prototype.completed = function () { - this.o.onCompleted(); - }; - - return DistinctUntilChangedObserver; - }(AbstractObserver)); - - /** - * Returns an observable sequence that contains only distinct contiguous elements according to the keyFn and the comparer. - * @param {Function} [keyFn] A function to compute the comparison key for each element. If not provided, it projects the value. - * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. - * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. - */ - observableProto.distinctUntilChanged = function (keyFn, comparer) { - comparer || (comparer = defaultComparer); - return new DistinctUntilChangedObservable(this, keyFn, comparer); - }; - - var TapObservable = (function(__super__) { - inherits(TapObservable,__super__); - function TapObservable(source, observerOrOnNext, onError, onCompleted) { - this.source = source; - this._oN = observerOrOnNext; - this._oE = onError; - this._oC = onCompleted; - __super__.call(this); - } - - TapObservable.prototype.subscribeCore = function(o) { - return this.source.subscribe(new InnerObserver(o, this)); - }; - - inherits(InnerObserver, AbstractObserver); - function InnerObserver(o, p) { - this.o = o; - this.t = !p._oN || isFunction(p._oN) ? - observerCreate(p._oN || noop, p._oE || noop, p._oC || noop) : - p._oN; - this.isStopped = false; - AbstractObserver.call(this); - } - InnerObserver.prototype.next = function(x) { - var res = tryCatch(this.t.onNext).call(this.t, x); - if (res === errorObj) { this.o.onError(res.e); } - this.o.onNext(x); - }; - InnerObserver.prototype.error = function(err) { - var res = tryCatch(this.t.onError).call(this.t, err); - if (res === errorObj) { return this.o.onError(res.e); } - this.o.onError(err); - }; - InnerObserver.prototype.completed = function() { - var res = tryCatch(this.t.onCompleted).call(this.t); - if (res === errorObj) { return this.o.onError(res.e); } - this.o.onCompleted(); - }; - - return TapObservable; - }(ObservableBase)); - - /** - * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. - * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. - * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an o. - * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. - * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. - * @returns {Observable} The source sequence with the side-effecting behavior applied. - */ - observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) { - return new TapObservable(this, observerOrOnNext, onError, onCompleted); - }; - - /** - * Invokes an action for each element in the observable sequence. - * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. - * @param {Function} onNext Action to invoke for each element in the observable sequence. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} The source sequence with the side-effecting behavior applied. - */ - observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) { - return this.tap(typeof thisArg !== 'undefined' ? function (x) { onNext.call(thisArg, x); } : onNext); - }; - - /** - * Invokes an action upon exceptional termination of the observable sequence. - * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. - * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} The source sequence with the side-effecting behavior applied. - */ - observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) { - return this.tap(noop, typeof thisArg !== 'undefined' ? function (e) { onError.call(thisArg, e); } : onError); - }; - - /** - * Invokes an action upon graceful termination of the observable sequence. - * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. - * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} The source sequence with the side-effecting behavior applied. - */ - observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) { - return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted); - }; - - var FinallyObservable = (function (__super__) { - inherits(FinallyObservable, __super__); - function FinallyObservable(source, fn, thisArg) { - this.source = source; - this._fn = bindCallback(fn, thisArg, 0); - __super__.call(this); - } - - FinallyObservable.prototype.subscribeCore = function (o) { - var d = tryCatch(this.source.subscribe).call(this.source, o); - if (d === errorObj) { - this._fn(); - thrower(d.e); - } - - return new FinallyDisposable(d, this._fn); - }; - - function FinallyDisposable(s, fn) { - this.isDisposed = false; - this._s = s; - this._fn = fn; - } - FinallyDisposable.prototype.dispose = function () { - if (!this.isDisposed) { - var res = tryCatch(this._s.dispose).call(this._s); - this._fn(); - res === errorObj && thrower(res.e); - } - }; - - return FinallyObservable; - - }(ObservableBase)); - - /** - * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. - * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. - * @returns {Observable} Source sequence with the action-invoking termination behavior applied. - */ - observableProto['finally'] = function (action, thisArg) { - return new FinallyObservable(this, action, thisArg); - }; - - var IgnoreElementsObservable = (function(__super__) { - inherits(IgnoreElementsObservable, __super__); - - function IgnoreElementsObservable(source) { - this.source = source; - __super__.call(this); - } - - IgnoreElementsObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new InnerObserver(o)); - }; - - function InnerObserver(o) { - this.o = o; - this.isStopped = false; - } - InnerObserver.prototype.onNext = noop; - InnerObserver.prototype.onError = function (err) { - if(!this.isStopped) { - this.isStopped = true; - this.o.onError(err); - } - }; - InnerObserver.prototype.onCompleted = function () { - if(!this.isStopped) { - this.isStopped = true; - this.o.onCompleted(); - } - }; - InnerObserver.prototype.dispose = function() { this.isStopped = true; }; - InnerObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.observer.onError(e); - return true; - } - - return false; - }; - - return IgnoreElementsObservable; - }(ObservableBase)); - - /** - * Ignores all elements in an observable sequence leaving only the termination messages. - * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence. - */ - observableProto.ignoreElements = function () { - return new IgnoreElementsObservable(this); - }; - - var MaterializeObservable = (function (__super__) { - inherits(MaterializeObservable, __super__); - function MaterializeObservable(source, fn) { - this.source = source; - __super__.call(this); - } - - MaterializeObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new MaterializeObserver(o)); - }; - - return MaterializeObservable; - }(ObservableBase)); - - var MaterializeObserver = (function (__super__) { - inherits(MaterializeObserver, __super__); - - function MaterializeObserver(o) { - this._o = o; - __super__.call(this); - } - - MaterializeObserver.prototype.next = function (x) { this._o.onNext(notificationCreateOnNext(x)) }; - MaterializeObserver.prototype.error = function (e) { this._o.onNext(notificationCreateOnError(e)); this._o.onCompleted(); }; - MaterializeObserver.prototype.completed = function () { this._o.onNext(notificationCreateOnCompleted()); this._o.onCompleted(); }; - - return MaterializeObserver; - }(AbstractObserver)); - - /** - * Materializes the implicit notifications of an observable sequence as explicit notification values. - * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence. - */ - observableProto.materialize = function () { - return new MaterializeObservable(this); - }; - - /** - * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely. - * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely. - * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly. - */ - observableProto.repeat = function (repeatCount) { - return enumerableRepeat(this, repeatCount).concat(); - }; - - /** - * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely. - * Note if you encounter an error and want it to retry once, then you must use .retry(2); - * - * @example - * var res = retried = retry.repeat(); - * var res = retried = retry.repeat(2); - * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely. - * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. - */ - observableProto.retry = function (retryCount) { - return enumerableRepeat(this, retryCount).catchError(); - }; - - function repeat(value) { - return { - '@@iterator': function () { - return { - next: function () { - return { done: false, value: value }; - } - }; - } - }; - } - - var RetryWhenObservable = (function(__super__) { - function createDisposable(state) { - return { - isDisposed: false, - dispose: function () { - if (!this.isDisposed) { - this.isDisposed = true; - state.isDisposed = true; - } - } - }; - } - - function RetryWhenObservable(source, notifier) { - this.source = source; - this._notifier = notifier; - __super__.call(this); - } - - inherits(RetryWhenObservable, __super__); - - RetryWhenObservable.prototype.subscribeCore = function (o) { - var exceptions = new Subject(), - notifier = new Subject(), - handled = this._notifier(exceptions), - notificationDisposable = handled.subscribe(notifier); - - var e = this.source['@@iterator'](); - - var state = { isDisposed: false }, - lastError, - subscription = new SerialDisposable(); - var cancelable = currentThreadScheduler.scheduleRecursive(null, function (_, recurse) { - if (state.isDisposed) { return; } - var currentItem = e.next(); - - if (currentItem.done) { - if (lastError) { - o.onError(lastError); - } else { - o.onCompleted(); - } - return; - } - - // Check if promise - var currentValue = currentItem.value; - isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); - - var outer = new SingleAssignmentDisposable(); - var inner = new SingleAssignmentDisposable(); - subscription.setDisposable(new BinaryDisposable(inner, outer)); - outer.setDisposable(currentValue.subscribe( - function(x) { o.onNext(x); }, - function (exn) { - inner.setDisposable(notifier.subscribe(recurse, function(ex) { - o.onError(ex); - }, function() { - o.onCompleted(); - })); - - exceptions.onNext(exn); - outer.dispose(); - }, - function() { o.onCompleted(); })); - }); - - return new NAryDisposable([notificationDisposable, subscription, cancelable, createDisposable(state)]); - }; - - return RetryWhenObservable; - }(ObservableBase)); - - observableProto.retryWhen = function (notifier) { - return new RetryWhenObservable(repeat(this), notifier); - }; - - function repeat(value) { - return { - '@@iterator': function () { - return { - next: function () { - return { done: false, value: value }; - } - }; - } - }; - } - - var RepeatWhenObservable = (function(__super__) { - function createDisposable(state) { - return { - isDisposed: false, - dispose: function () { - if (!this.isDisposed) { - this.isDisposed = true; - state.isDisposed = true; - } - } - }; - } - - function RepeatWhenObservable(source, notifier) { - this.source = source; - this._notifier = notifier; - __super__.call(this); - } - - inherits(RepeatWhenObservable, __super__); - - RepeatWhenObservable.prototype.subscribeCore = function (o) { - var completions = new Subject(), - notifier = new Subject(), - handled = this._notifier(completions), - notificationDisposable = handled.subscribe(notifier); - - var e = this.source['@@iterator'](); - - var state = { isDisposed: false }, - lastError, - subscription = new SerialDisposable(); - var cancelable = currentThreadScheduler.scheduleRecursive(null, function (_, recurse) { - if (state.isDisposed) { return; } - var currentItem = e.next(); - - if (currentItem.done) { - if (lastError) { - o.onError(lastError); - } else { - o.onCompleted(); - } - return; - } - - // Check if promise - var currentValue = currentItem.value; - isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); - - var outer = new SingleAssignmentDisposable(); - var inner = new SingleAssignmentDisposable(); - subscription.setDisposable(new BinaryDisposable(inner, outer)); - outer.setDisposable(currentValue.subscribe( - function(x) { o.onNext(x); }, - function (exn) { o.onError(exn); }, - function() { - inner.setDisposable(notifier.subscribe(recurse, function(ex) { - o.onError(ex); - }, function() { - o.onCompleted(); - })); - - completions.onNext(null); - outer.dispose(); - })); - }); - - return new NAryDisposable([notificationDisposable, subscription, cancelable, createDisposable(state)]); - }; - - return RepeatWhenObservable; - }(ObservableBase)); - - observableProto.repeatWhen = function (notifier) { - return new RepeatWhenObservable(repeat(this), notifier); - }; - - var ScanObservable = (function(__super__) { - inherits(ScanObservable, __super__); - function ScanObservable(source, accumulator, hasSeed, seed) { - this.source = source; - this.accumulator = accumulator; - this.hasSeed = hasSeed; - this.seed = seed; - __super__.call(this); - } - - ScanObservable.prototype.subscribeCore = function(o) { - return this.source.subscribe(new ScanObserver(o,this)); - }; - - return ScanObservable; - }(ObservableBase)); - - var ScanObserver = (function (__super__) { - inherits(ScanObserver, __super__); - function ScanObserver(o, parent) { - this._o = o; - this._p = parent; - this._fn = parent.accumulator; - this._hs = parent.hasSeed; - this._s = parent.seed; - this._ha = false; - this._a = null; - this._hv = false; - this._i = 0; - __super__.call(this); - } - - ScanObserver.prototype.next = function (x) { - !this._hv && (this._hv = true); - if (this._ha) { - this._a = tryCatch(this._fn)(this._a, x, this._i, this._p); - } else { - this._a = this._hs ? tryCatch(this._fn)(this._s, x, this._i, this._p) : x; - this._ha = true; - } - if (this._a === errorObj) { return this._o.onError(this._a.e); } - this._o.onNext(this._a); - this._i++; - }; - - ScanObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - ScanObserver.prototype.completed = function () { - !this._hv && this._hs && this._o.onNext(this._s); - this._o.onCompleted(); - }; - - return ScanObserver; - }(AbstractObserver)); - - /** - * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. - * For aggregation behavior with no intermediate results, see Observable.aggregate. - * @param {Mixed} [seed] The initial accumulator value. - * @param {Function} accumulator An accumulator function to be invoked on each element. - * @returns {Observable} An observable sequence containing the accumulated values. - */ - observableProto.scan = function () { - var hasSeed = false, seed, accumulator = arguments[0]; - if (arguments.length === 2) { - hasSeed = true; - seed = arguments[1]; - } - return new ScanObservable(this, accumulator, hasSeed, seed); - }; - - var SkipLastObservable = (function (__super__) { - inherits(SkipLastObservable, __super__); - function SkipLastObservable(source, c) { - this.source = source; - this._c = c; - __super__.call(this); - } - - SkipLastObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new SkipLastObserver(o, this._c)); - }; - - return SkipLastObservable; - }(ObservableBase)); - - var SkipLastObserver = (function (__super__) { - inherits(SkipLastObserver, __super__); - function SkipLastObserver(o, c) { - this._o = o; - this._c = c; - this._q = []; - __super__.call(this); - } - - SkipLastObserver.prototype.next = function (x) { - this._q.push(x); - this._q.length > this._c && this._o.onNext(this._q.shift()); - }; - - SkipLastObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - SkipLastObserver.prototype.completed = function () { - this._o.onCompleted(); - }; - - return SkipLastObserver; - }(AbstractObserver)); - - /** - * Bypasses a specified number of elements at the end of an observable sequence. - * @description - * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are - * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. - * @param count Number of elements to bypass at the end of the source sequence. - * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end. - */ - observableProto.skipLast = function (count) { - if (count < 0) { throw new ArgumentOutOfRangeError(); } - return new SkipLastObservable(this, count); - }; - - /** - * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend. - * @example - * var res = source.startWith(1, 2, 3); - * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3); - * @param {Arguments} args The specified values to prepend to the observable sequence - * @returns {Observable} The source sequence prepended with the specified values. - */ - observableProto.startWith = function () { - var values, scheduler, start = 0; - if (!!arguments.length && isScheduler(arguments[0])) { - scheduler = arguments[0]; - start = 1; - } else { - scheduler = immediateScheduler; - } - for(var args = [], i = start, len = arguments.length; i < len; i++) { args.push(arguments[i]); } - return observableConcat.apply(null, [observableFromArray(args, scheduler), this]); - }; - - var TakeLastObserver = (function (__super__) { - inherits(TakeLastObserver, __super__); - function TakeLastObserver(o, c) { - this._o = o; - this._c = c; - this._q = []; - __super__.call(this); - } - - TakeLastObserver.prototype.next = function (x) { - this._q.push(x); - this._q.length > this._c && this._q.shift(); - }; - - TakeLastObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - TakeLastObserver.prototype.completed = function () { - while (this._q.length > 0) { this._o.onNext(this._q.shift()); } - this._o.onCompleted(); - }; - - return TakeLastObserver; - }(AbstractObserver)); - - /** - * Returns a specified number of contiguous elements from the end of an observable sequence. - * @description - * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of - * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. - * @param {Number} count Number of elements to take from the end of the source sequence. - * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence. - */ - observableProto.takeLast = function (count) { - if (count < 0) { throw new ArgumentOutOfRangeError(); } - var source = this; - return new AnonymousObservable(function (o) { - return source.subscribe(new TakeLastObserver(o, count)); - }, source); - }; - - var TakeLastBufferObserver = (function (__super__) { - inherits(TakeLastBufferObserver, __super__); - function TakeLastBufferObserver(o, c) { - this._o = o; - this._c = c; - this._q = []; - __super__.call(this); - } - - TakeLastBufferObserver.prototype.next = function (x) { - this._q.push(x); - this._q.length > this._c && this._q.shift(); - }; - - TakeLastBufferObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - TakeLastBufferObserver.prototype.completed = function () { - this._o.onNext(this._q); - this._o.onCompleted(); - }; - - return TakeLastBufferObserver; - }(AbstractObserver)); - - /** - * Returns an array with the specified number of contiguous elements from the end of an observable sequence. - * - * @description - * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the - * source sequence, this buffer is produced on the result sequence. - * @param {Number} count Number of elements to take from the end of the source sequence. - * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence. - */ - observableProto.takeLastBuffer = function (count) { - if (count < 0) { throw new ArgumentOutOfRangeError(); } - var source = this; - return new AnonymousObservable(function (o) { - return source.subscribe(new TakeLastBufferObserver(o, count)); - }, source); - }; - - /** - * Projects each element of an observable sequence into zero or more windows which are produced based on element count information. - * @param {Number} count Length of each window. - * @param {Number} [skip] Number of elements to skip between creation of consecutive windows. If not specified, defaults to the count. - * @returns {Observable} An observable sequence of windows. - */ - observableProto.windowWithCount = observableProto.windowCount = function (count, skip) { - var source = this; - +count || (count = 0); - Math.abs(count) === Infinity && (count = 0); - if (count <= 0) { throw new ArgumentOutOfRangeError(); } - skip == null && (skip = count); - +skip || (skip = 0); - Math.abs(skip) === Infinity && (skip = 0); - - if (skip <= 0) { throw new ArgumentOutOfRangeError(); } - return new AnonymousObservable(function (observer) { - var m = new SingleAssignmentDisposable(), - refCountDisposable = new RefCountDisposable(m), - n = 0, - q = []; - - function createWindow () { - var s = new Subject(); - q.push(s); - observer.onNext(addRef(s, refCountDisposable)); - } - - createWindow(); - - m.setDisposable(source.subscribe( - function (x) { - for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } - var c = n - count + 1; - c >= 0 && c % skip === 0 && q.shift().onCompleted(); - ++n % skip === 0 && createWindow(); - }, - function (e) { - while (q.length > 0) { q.shift().onError(e); } - observer.onError(e); - }, - function () { - while (q.length > 0) { q.shift().onCompleted(); } - observer.onCompleted(); - } - )); - return refCountDisposable; - }, source); - }; - -observableProto.flatMapConcat = observableProto.concatMap = function(selector, resultSelector, thisArg) { - return new FlatMapObservable(this, selector, resultSelector, thisArg).merge(1); -}; - /** - * Projects each notification of an observable sequence to an observable sequence and concats the resulting observable sequences into one observable sequence. - * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element. - * @param {Function} onError A transform function to apply when an error occurs in the source sequence. - * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached. - * @param {Any} [thisArg] An optional "this" to use to invoke each transform. - * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. - */ - observableProto.concatMapObserver = observableProto.selectConcatObserver = function(onNext, onError, onCompleted, thisArg) { - var source = this, - onNextFunc = bindCallback(onNext, thisArg, 2), - onErrorFunc = bindCallback(onError, thisArg, 1), - onCompletedFunc = bindCallback(onCompleted, thisArg, 0); - return new AnonymousObservable(function (observer) { - var index = 0; - return source.subscribe( - function (x) { - var result; - try { - result = onNextFunc(x, index++); - } catch (e) { - observer.onError(e); - return; - } - isPromise(result) && (result = observableFromPromise(result)); - observer.onNext(result); - }, - function (err) { - var result; - try { - result = onErrorFunc(err); - } catch (e) { - observer.onError(e); - return; - } - isPromise(result) && (result = observableFromPromise(result)); - observer.onNext(result); - observer.onCompleted(); - }, - function () { - var result; - try { - result = onCompletedFunc(); - } catch (e) { - observer.onError(e); - return; - } - isPromise(result) && (result = observableFromPromise(result)); - observer.onNext(result); - observer.onCompleted(); - }); - }, this).concatAll(); - }; - - var DefaultIfEmptyObserver = (function (__super__) { - inherits(DefaultIfEmptyObserver, __super__); - function DefaultIfEmptyObserver(o, d) { - this._o = o; - this._d = d; - this._f = false; - __super__.call(this); - } - - DefaultIfEmptyObserver.prototype.next = function (x) { - this._f = true; - this._o.onNext(x); - }; - - DefaultIfEmptyObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - DefaultIfEmptyObserver.prototype.completed = function () { - !this._f && this._o.onNext(this._d); - this._o.onCompleted(); - }; - - return DefaultIfEmptyObserver; - }(AbstractObserver)); - - /** - * Returns the elements of the specified sequence or the specified value in a singleton sequence if the sequence is empty. - * - * var res = obs = xs.defaultIfEmpty(); - * 2 - obs = xs.defaultIfEmpty(false); - * - * @memberOf Observable# - * @param defaultValue The value to return if the sequence is empty. If not provided, this defaults to null. - * @returns {Observable} An observable sequence that contains the specified default value if the source is empty; otherwise, the elements of the source itself. - */ - observableProto.defaultIfEmpty = function (defaultValue) { - var source = this; - defaultValue === undefined && (defaultValue = null); - return new AnonymousObservable(function (o) { - return source.subscribe(new DefaultIfEmptyObserver(o, defaultValue)); - }, source); - }; - - // Swap out for Array.findIndex - function arrayIndexOfComparer(array, item, comparer) { - for (var i = 0, len = array.length; i < len; i++) { - if (comparer(array[i], item)) { return i; } - } - return -1; - } - - function HashSet(comparer) { - this.comparer = comparer; - this.set = []; - } - HashSet.prototype.push = function(value) { - var retValue = arrayIndexOfComparer(this.set, value, this.comparer) === -1; - retValue && this.set.push(value); - return retValue; - }; - - var DistinctObservable = (function (__super__) { - inherits(DistinctObservable, __super__); - function DistinctObservable(source, keyFn, cmpFn) { - this.source = source; - this._keyFn = keyFn; - this._cmpFn = cmpFn; - __super__.call(this); - } - - DistinctObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new DistinctObserver(o, this._keyFn, this._cmpFn)); - }; - - return DistinctObservable; - }(ObservableBase)); - - var DistinctObserver = (function (__super__) { - inherits(DistinctObserver, __super__); - function DistinctObserver(o, keyFn, cmpFn) { - this._o = o; - this._keyFn = keyFn; - this._h = new HashSet(cmpFn); - __super__.call(this); - } - - DistinctObserver.prototype.next = function (x) { - var key = x; - if (isFunction(this._keyFn)) { - key = tryCatch(this._keyFn)(x); - if (key === errorObj) { return this._o.onError(key.e); } - } - this._h.push(key) && this._o.onNext(x); - }; - - DistinctObserver.prototype.error = function (e) { this._o.onError(e); }; - DistinctObserver.prototype.completed = function () { this._o.onCompleted(); }; - - return DistinctObserver; - }(AbstractObserver)); - - /** - * Returns an observable sequence that contains only distinct elements according to the keySelector and the comparer. - * Usage of this operator should be considered carefully due to the maintenance of an internal lookup structure which can grow large. - * - * @example - * var res = obs = xs.distinct(); - * 2 - obs = xs.distinct(function (x) { return x.id; }); - * 2 - obs = xs.distinct(function (x) { return x.id; }, function (a,b) { return a === b; }); - * @param {Function} [keySelector] A function to compute the comparison key for each element. - * @param {Function} [comparer] Used to compare items in the collection. - * @returns {Observable} An observable sequence only containing the distinct elements, based on a computed key value, from the source sequence. - */ - observableProto.distinct = function (keySelector, comparer) { - comparer || (comparer = defaultComparer); - return new DistinctObservable(this, keySelector, comparer); - }; - - var MapObservable = (function (__super__) { - inherits(MapObservable, __super__); - - function MapObservable(source, selector, thisArg) { - this.source = source; - this.selector = bindCallback(selector, thisArg, 3); - __super__.call(this); - } - - function innerMap(selector, self) { - return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); }; - } - - MapObservable.prototype.internalMap = function (selector, thisArg) { - return new MapObservable(this.source, innerMap(selector, this), thisArg); - }; - - MapObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new InnerObserver(o, this.selector, this)); - }; - - inherits(InnerObserver, AbstractObserver); - function InnerObserver(o, selector, source) { - this.o = o; - this.selector = selector; - this.source = source; - this.i = 0; - AbstractObserver.call(this); - } - - InnerObserver.prototype.next = function(x) { - var result = tryCatch(this.selector)(x, this.i++, this.source); - if (result === errorObj) { return this.o.onError(result.e); } - this.o.onNext(result); - }; - - InnerObserver.prototype.error = function (e) { - this.o.onError(e); - }; - - InnerObserver.prototype.completed = function () { - this.o.onCompleted(); - }; - - return MapObservable; - - }(ObservableBase)); - - /** - * Projects each element of an observable sequence into a new form by incorporating the element's index. - * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source. - */ - observableProto.map = observableProto.select = function (selector, thisArg) { - var selectorFn = typeof selector === 'function' ? selector : function () { return selector; }; - return this instanceof MapObservable ? - this.internalMap(selectorFn, thisArg) : - new MapObservable(this, selectorFn, thisArg); - }; - - function plucker(args, len) { - return function mapper(x) { - var currentProp = x; - for (var i = 0; i < len; i++) { - var p = currentProp[args[i]]; - if (typeof p !== 'undefined') { - currentProp = p; - } else { - return undefined; - } - } - return currentProp; - }; - } - - /** - * Retrieves the value of a specified nested property from all elements in - * the Observable sequence. - * @param {Arguments} arguments The nested properties to pluck. - * @returns {Observable} Returns a new Observable sequence of property values. - */ - observableProto.pluck = function () { - var len = arguments.length, args = new Array(len); - if (len === 0) { throw new Error('List of properties cannot be empty.'); } - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - return this.map(plucker(args, len)); - }; - - /** - * Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. - * @param {Function} onNext A transform function to apply to each element; the second parameter of the function represents the index of the source element. - * @param {Function} onError A transform function to apply when an error occurs in the source sequence. - * @param {Function} onCompleted A transform function to apply when the end of the source sequence is reached. - * @param {Any} [thisArg] An optional "this" to use to invoke each transform. - * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function corresponding to each notification in the input sequence. - */ - observableProto.flatMapObserver = observableProto.selectManyObserver = function (onNext, onError, onCompleted, thisArg) { - var source = this; - return new AnonymousObservable(function (observer) { - var index = 0; - - return source.subscribe( - function (x) { - var result; - try { - result = onNext.call(thisArg, x, index++); - } catch (e) { - observer.onError(e); - return; - } - isPromise(result) && (result = observableFromPromise(result)); - observer.onNext(result); - }, - function (err) { - var result; - try { - result = onError.call(thisArg, err); - } catch (e) { - observer.onError(e); - return; - } - isPromise(result) && (result = observableFromPromise(result)); - observer.onNext(result); - observer.onCompleted(); - }, - function () { - var result; - try { - result = onCompleted.call(thisArg); - } catch (e) { - observer.onError(e); - return; - } - isPromise(result) && (result = observableFromPromise(result)); - observer.onNext(result); - observer.onCompleted(); - }); - }, source).mergeAll(); - }; - -observableProto.flatMap = observableProto.selectMany = observableProto.mergeMap = function(selector, resultSelector, thisArg) { - return new FlatMapObservable(this, selector, resultSelector, thisArg).mergeAll(); -}; - -observableProto.flatMapLatest = observableProto.switchMap = function(selector, resultSelector, thisArg) { - return new FlatMapObservable(this, selector, resultSelector, thisArg).switchLatest(); -}; - - var SkipObservable = (function(__super__) { - inherits(SkipObservable, __super__); - function SkipObservable(source, count) { - this.source = source; - this._count = count; - __super__.call(this); - } - - SkipObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new SkipObserver(o, this._count)); - }; - - function SkipObserver(o, c) { - this._o = o; - this._r = c; - AbstractObserver.call(this); - } - - inherits(SkipObserver, AbstractObserver); - - SkipObserver.prototype.next = function (x) { - if (this._r <= 0) { - this._o.onNext(x); - } else { - this._r--; - } - }; - SkipObserver.prototype.error = function(e) { this._o.onError(e); }; - SkipObserver.prototype.completed = function() { this._o.onCompleted(); }; - - return SkipObservable; - }(ObservableBase)); - - /** - * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. - * @param {Number} count The number of elements to skip before returning the remaining elements. - * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence. - */ - observableProto.skip = function (count) { - if (count < 0) { throw new ArgumentOutOfRangeError(); } - return new SkipObservable(this, count); - }; - - var SkipWhileObservable = (function (__super__) { - inherits(SkipWhileObservable, __super__); - function SkipWhileObservable(source, fn) { - this.source = source; - this._fn = fn; - __super__.call(this); - } - - SkipWhileObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new SkipWhileObserver(o, this)); - }; - - return SkipWhileObservable; - }(ObservableBase)); - - var SkipWhileObserver = (function (__super__) { - inherits(SkipWhileObserver, __super__); - - function SkipWhileObserver(o, p) { - this._o = o; - this._p = p; - this._i = 0; - this._r = false; - __super__.call(this); - } - - SkipWhileObserver.prototype.next = function (x) { - if (!this._r) { - var res = tryCatch(this._p._fn)(x, this._i++, this._p); - if (res === errorObj) { return this._o.onError(res.e); } - this._r = !res; - } - this._r && this._o.onNext(x); - }; - SkipWhileObserver.prototype.error = function (e) { this._o.onError(e); }; - SkipWhileObserver.prototype.completed = function () { this._o.onCompleted(); }; - - return SkipWhileObserver; - }(AbstractObserver)); - - /** - * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. - * The element's index is used in the logic of the predicate function. - * - * var res = source.skipWhile(function (value) { return value < 10; }); - * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; }); - * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. - */ - observableProto.skipWhile = function (predicate, thisArg) { - var fn = bindCallback(predicate, thisArg, 3); - return new SkipWhileObservable(this, fn); - }; - - var TakeObservable = (function(__super__) { - inherits(TakeObservable, __super__); - function TakeObservable(source, count) { - this.source = source; - this._count = count; - __super__.call(this); - } - - TakeObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new TakeObserver(o, this._count)); - }; - - function TakeObserver(o, c) { - this._o = o; - this._c = c; - this._r = c; - AbstractObserver.call(this); - } - - inherits(TakeObserver, AbstractObserver); - - TakeObserver.prototype.next = function (x) { - if (this._r-- > 0) { - this._o.onNext(x); - this._r <= 0 && this._o.onCompleted(); - } - }; - - TakeObserver.prototype.error = function (e) { this._o.onError(e); }; - TakeObserver.prototype.completed = function () { this._o.onCompleted(); }; - - return TakeObservable; - }(ObservableBase)); - - /** - * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). - * @param {Number} count The number of elements to return. - * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case a === match[1])) { return } + this.algorithm = match[1] + this.digest = match[2] + + const rawOpts = match[3] + this.options = rawOpts ? rawOpts.slice(1).split('?') : [] + } + hexDigest () { + return this.digest && Buffer.from(this.digest, 'base64').toString('hex') + } + toJSON () { + return this.toString() + } + toString (opts) { + if (opts && opts.strict) { + // Strict mode enforces the standard as close to the foot of the + // letter as it can. + if (!( + // The spec has very restricted productions for algorithms. + // https://www.w3.org/TR/CSP2/#source-list-syntax + SPEC_ALGORITHMS.some(x => x === this.algorithm) && + // Usually, if someone insists on using a "different" base64, we + // leave it as-is, since there's multiple standards, and the + // specified is not a URL-safe variant. + // https://www.w3.org/TR/CSP2/#base64_value + this.digest.match(BASE64_REGEX) && + // Option syntax is strictly visual chars. + // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-option-expression + // https://tools.ietf.org/html/rfc5234#appendix-B.1 + (this.options || []).every(opt => opt.match(VCHAR_REGEX)) + )) { + return '' + } + } + const options = this.options && this.options.length + ? `?${this.options.join('?')}` + : '' + return `${this.algorithm}-${this.digest}${options}` + } +} + +class Integrity { + get isIntegrity () { return true } + toJSON () { + return this.toString() + } + toString (opts) { + opts = opts || {} + let sep = opts.sep || ' ' + if (opts.strict) { + // Entries must be separated by whitespace, according to spec. + sep = sep.replace(/\S+/g, ' ') + } + return Object.keys(this).map(k => { + return this[k].map(hash => { + return Hash.prototype.toString.call(hash, opts) + }).filter(x => x.length).join(sep) + }).filter(x => x.length).join(sep) + } + concat (integrity, opts) { + const other = typeof integrity === 'string' + ? integrity + : stringify(integrity, opts) + return parse(`${this.toString(opts)} ${other}`, opts) + } + hexDigest () { + return parse(this, {single: true}).hexDigest() + } + match (integrity, opts) { + const other = parse(integrity, opts) + const algo = other.pickAlgorithm(opts) + return ( + this[algo] && + other[algo] && + this[algo].find(hash => + other[algo].find(otherhash => + hash.digest === otherhash.digest + ) + ) + ) || false + } + pickAlgorithm (opts) { + const pickAlgorithm = (opts && opts.pickAlgorithm) || getPrioritizedHash + const keys = Object.keys(this) + if (!keys.length) { + throw new Error(`No algorithms available for ${ + JSON.stringify(this.toString()) + }`) + } + return keys.reduce((acc, algo) => { + return pickAlgorithm(acc, algo) || acc + }) + } +} + +module.exports.parse = parse +function parse (sri, opts) { + opts = opts || {} + if (typeof sri === 'string') { + return _parse(sri, opts) + } else if (sri.algorithm && sri.digest) { + const fullSri = new Integrity() + fullSri[sri.algorithm] = [sri] + return _parse(stringify(fullSri, opts), opts) + } else { + return _parse(stringify(sri, opts), opts) + } +} + +function _parse (integrity, opts) { + // 3.4.3. Parse metadata + // https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata + if (opts.single) { + return new Hash(integrity, opts) + } + return integrity.trim().split(/\s+/).reduce((acc, string) => { + const hash = new Hash(string, opts) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) + } + return acc + }, new Integrity()) +} + +module.exports.stringify = stringify +function stringify (obj, opts) { + if (obj.algorithm && obj.digest) { + return Hash.prototype.toString.call(obj, opts) + } else if (typeof obj === 'string') { + return stringify(parse(obj, opts), opts) + } else { + return Integrity.prototype.toString.call(obj, opts) + } +} + +module.exports.fromHex = fromHex +function fromHex (hexDigest, algorithm, opts) { + const optString = (opts && opts.options && opts.options.length) + ? `?${opts.options.join('?')}` + : '' + return parse( + `${algorithm}-${ + Buffer.from(hexDigest, 'hex').toString('base64') + }${optString}`, opts + ) +} + +module.exports.fromData = fromData +function fromData (data, opts) { + opts = opts || {} + const algorithms = opts.algorithms || ['sha512'] + const optString = opts.options && opts.options.length + ? `?${opts.options.join('?')}` + : '' + return algorithms.reduce((acc, algo) => { + const digest = crypto.createHash(algo).update(data).digest('base64') + const hash = new Hash( + `${algo}-${digest}${optString}`, + opts + ) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) + } + return acc + }, new Integrity()) +} + +module.exports.fromStream = fromStream +function fromStream (stream, opts) { + opts = opts || {} + const P = opts.Promise || Promise + const istream = integrityStream(opts) + return new P((resolve, reject) => { + stream.pipe(istream) + stream.on('error', reject) + istream.on('error', reject) + let sri + istream.on('integrity', s => { sri = s }) + istream.on('end', () => resolve(sri)) + istream.on('data', () => {}) + }) +} + +module.exports.checkData = checkData +function checkData (data, sri, opts) { + opts = opts || {} + sri = parse(sri, opts) + if (!Object.keys(sri).length) { + if (opts.error) { + throw Object.assign( + new Error('No valid integrity hashes to check against'), { + code: 'EINTEGRITY' + } + ) + } else { + return false + } + } + const algorithm = sri.pickAlgorithm(opts) + const digest = crypto.createHash(algorithm).update(data).digest('base64') + const newSri = parse({algorithm, digest}) + const match = newSri.match(sri, opts) + if (match || !opts.error) { + return match + } else if (typeof opts.size === 'number' && (data.length !== opts.size)) { + const err = new Error(`data size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${data.length}`) + err.code = 'EBADSIZE' + err.found = data.length + err.expected = opts.size + err.sri = sri + throw err + } else { + const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`) + err.code = 'EINTEGRITY' + err.found = newSri + err.expected = sri + err.algorithm = algorithm + err.sri = sri + throw err + } +} + +module.exports.checkStream = checkStream +function checkStream (stream, sri, opts) { + opts = opts || {} + const P = opts.Promise || Promise + const checker = integrityStream(Object.assign({}, opts, { + integrity: sri + })) + return new P((resolve, reject) => { + stream.pipe(checker) + stream.on('error', reject) + checker.on('error', reject) + let sri + checker.on('verified', s => { sri = s }) + checker.on('end', () => resolve(sri)) + checker.on('data', () => {}) + }) +} + +module.exports.integrityStream = integrityStream +function integrityStream (opts) { + opts = opts || {} + // For verification + const sri = opts.integrity && parse(opts.integrity, opts) + const goodSri = sri && Object.keys(sri).length + const algorithm = goodSri && sri.pickAlgorithm(opts) + const digests = goodSri && sri[algorithm] + // Calculating stream + const algorithms = Array.from( + new Set( + (opts.algorithms || ['sha512']) + .concat(algorithm ? [algorithm] : []) + ) + ) + const hashes = algorithms.map(crypto.createHash) + let streamSize = 0 + const stream = new Transform({ + transform (chunk, enc, cb) { + streamSize += chunk.length + hashes.forEach(h => h.update(chunk, enc)) + cb(null, chunk, enc) + } + }).on('end', () => { + const optString = (opts.options && opts.options.length) + ? `?${opts.options.join('?')}` + : '' + const newSri = parse(hashes.map((h, i) => { + return `${algorithms[i]}-${h.digest('base64')}${optString}` + }).join(' '), opts) + // Integrity verification mode + const match = goodSri && newSri.match(sri, opts) + if (typeof opts.size === 'number' && streamSize !== opts.size) { + const err = new Error(`stream size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${streamSize}`) + err.code = 'EBADSIZE' + err.found = streamSize + err.expected = opts.size + err.sri = sri + stream.emit('error', err) + } else if (opts.integrity && !match) { + const err = new Error(`${sri} integrity checksum failed when using ${algorithm}: wanted ${digests} but got ${newSri}. (${streamSize} bytes)`) + err.code = 'EINTEGRITY' + err.found = newSri + err.expected = digests + err.algorithm = algorithm + err.sri = sri + stream.emit('error', err) + } else { + stream.emit('size', streamSize) + stream.emit('integrity', newSri) + match && stream.emit('verified', match) + } + }) + return stream +} + +module.exports.create = createIntegrity +function createIntegrity (opts) { + opts = opts || {} + const algorithms = opts.algorithms || ['sha512'] + const optString = opts.options && opts.options.length + ? `?${opts.options.join('?')}` + : '' + + const hashes = algorithms.map(crypto.createHash) + + return { + update: function (chunk, enc) { + hashes.forEach(h => h.update(chunk, enc)) + return this + }, + digest: function (enc) { + const integrity = algorithms.reduce((acc, algo) => { + const digest = hashes.shift().digest('base64') + const hash = new Hash( + `${algo}-${digest}${optString}`, + opts + ) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) + } + return acc + }, new Integrity()) + + return integrity + } + } +} + +const NODE_HASHES = new Set(crypto.getHashes()) + +// This is a Best Effortâ„ĸ at a reasonable priority for hash algos +const DEFAULT_PRIORITY = [ + 'md5', 'whirlpool', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', + // TODO - it's unclear _which_ of these Node will actually use as its name + // for the algorithm, so we guesswork it based on the OpenSSL names. + 'sha3', + 'sha3-256', 'sha3-384', 'sha3-512', + 'sha3_256', 'sha3_384', 'sha3_512' +].filter(algo => NODE_HASHES.has(algo)) + +function getPrioritizedHash (algo1, algo2) { + return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase()) + ? algo1 + : algo2 +} + + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2011 Mark Cavage All rights reserved. + +// If you have no idea what ASN.1 or BER is, see this: +// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc + +var Ber = __webpack_require__(514); + + + +// --- Exported API + +module.exports = { + + Ber: Ber, + + BerReader: Ber.Reader, + + BerWriter: Ber.Writer + +}; + + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.home = undefined; + +var _rootUser; + +function _load_rootUser() { + return _rootUser = _interopRequireDefault(__webpack_require__(223)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const path = __webpack_require__(0); + +const home = exports.home = __webpack_require__(46).homedir(); + +const userHomeDir = (_rootUser || _load_rootUser()).default ? path.resolve('/usr/local/share') : home; + +exports.default = userHomeDir; + +/***/ }), +/* 68 */ +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; + + +/***/ }), +/* 69 */ /***/ (function(module, exports) { var toString = {}.toString; -module.exports = function(it){ +module.exports = function (it) { return toString.call(it).slice(8, -1); }; + /***/ }), -/* 43 */ +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__(68); +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; + + +/***/ }), +/* 71 */ /***/ (function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; -module.exports = function(it, key){ +module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; -/***/ }), -/* 44 */ -/***/ (function(module, exports) { -module.exports = function(it){ - return typeof it === 'object' ? it !== null : typeof it === 'function'; +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(35); +var IE8_DOM_DEFINE = __webpack_require__(238); +var toPrimitive = __webpack_require__(255); +var dP = Object.defineProperty; + +exports.f = __webpack_require__(51) ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; }; + /***/ }), -/* 45 */ +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// JS-YAML's default schema for `load` function. +// It is not described in the YAML specification. +// +// This schema is based on JS-YAML's default safe schema and includes +// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. +// +// Also this schema is used as default base schema at `Schema.create` function. + + + + + +var Schema = __webpack_require__(44); + + +module.exports = Schema.DEFAULT = new Schema({ + include: [ + __webpack_require__(55) + ], + explicit: [ + __webpack_require__(290), + __webpack_require__(289), + __webpack_require__(288) + ] +}); + + +/***/ }), +/* 74 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. -var assert = __webpack_require__(11); -var util = __webpack_require__(2); +var assert = __webpack_require__(16); +var util = __webpack_require__(3); function FingerprintFormatError(fp, format) { if (Error.captureStackTrace) @@ -29397,20 +26844,21 @@ module.exports = { /***/ }), -/* 46 */ +/* 75 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = Signature; -var assert = __webpack_require__(11); -var algs = __webpack_require__(22); -var crypto = __webpack_require__(8); -var errs = __webpack_require__(45); -var utils = __webpack_require__(19); -var asn1 = __webpack_require__(50); -var SSHBuffer = __webpack_require__(146); +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var crypto = __webpack_require__(11); +var errs = __webpack_require__(74); +var utils = __webpack_require__(26); +var asn1 = __webpack_require__(66); +var SSHBuffer = __webpack_require__(159); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var SignatureParseError = errs.SignatureParseError; @@ -29543,7 +26991,7 @@ Signature.prototype.toString = function (format) { Signature.parse = function (data, type, format) { if (typeof (data) === 'string') - data = new Buffer(data, 'base64'); + data = Buffer.from(data, 'base64'); assert.buffer(data, 'data'); assert.string(format, 'format'); assert.string(type, 'type'); @@ -29715,16201 +27163,8 @@ Signature._oldVersionDetect = function (obj) { }; -/***/ }), -/* 47 */ -/***/ (function(module, exports) { - -module.exports = require("events"); - -/***/ }), -/* 48 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.exec = exports.queue = undefined; -exports.forkp = forkp; -exports.spawnp = spawnp; -exports.forwardSignalToSpawnedProcesses = forwardSignalToSpawnedProcesses; -exports.spawn = spawn; - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); -} - -var _blockingQueue; - -function _load_blockingQueue() { - return _blockingQueue = _interopRequireDefault(__webpack_require__(80)); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -var _promise; - -function _load_promise() { - return _promise = __webpack_require__(53); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -/* global child_process$spawnOpts */ - -const child = __webpack_require__(150); - -const queue = exports.queue = new (_blockingQueue || _load_blockingQueue()).default('child', (_constants || _load_constants()).CHILD_CONCURRENCY); - -// TODO: this uid check is kinda whack -let uid = 0; - -const exec = exports.exec = (0, (_promise || _load_promise()).promisify)(child.exec); - -function forkp(program, args, opts) { - return new Promise((resolve, reject) => { - const proc = child.fork(program, args, opts); - - proc.on('error', error => { - reject(error); - }); - - proc.on('close', exitCode => { - resolve(exitCode); - }); - }); -} - -function spawnp(program, args, opts) { - return new Promise((resolve, reject) => { - const proc = child.spawn(program, args, opts); - - proc.on('error', error => { - reject(error); - }); - - proc.on('close', exitCode => { - resolve(exitCode); - }); - }); -} - -const spawnedProcesses = {}; - -function forwardSignalToSpawnedProcesses(signal) { - for (const key of Object.keys(spawnedProcesses)) { - spawnedProcesses[key].kill(signal); - } -} - -function spawn(program, args) { - let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - let onData = arguments[3]; - - const key = opts.cwd || String(++uid); - return queue.push(key, () => new Promise((resolve, reject) => { - const proc = child.spawn(program, args, opts); - spawnedProcesses[key] = proc; - - let processingDone = false; - let processClosed = false; - let err = null; - - let stdout = ''; - - proc.on('error', err => { - if (err.code === 'ENOENT') { - reject(new (_errors || _load_errors()).ProcessSpawnError(`Couldn't find the binary ${program}`, err.code, program)); - } else { - reject(err); - } - }); - - function updateStdout(chunk) { - stdout += chunk; - if (onData) { - onData(chunk); - } - } - - function finish() { - delete spawnedProcesses[key]; - if (err) { - reject(err); - } else { - resolve(stdout.trim()); - } - } - - if (typeof opts.process === 'function') { - opts.process(proc, updateStdout, reject, function () { - if (processClosed) { - finish(); - } else { - processingDone = true; - } - }); - } else { - if (proc.stderr) { - proc.stderr.on('data', updateStdout); - } - - if (proc.stdout) { - proc.stdout.on('data', updateStdout); - } - - processingDone = true; - } - - proc.on('close', (code, signal) => { - if (signal || code >= 1) { - err = new (_errors || _load_errors()).ProcessTermError(['Command failed.', signal ? `Exit signal: ${signal}` : `Exit code: ${code}`, `Command: ${program}`, `Arguments: ${args.join(' ')}`, `Directory: ${opts.cwd || process.cwd()}`, `Output:\n${stdout.trim()}`].join('\n')); - err.EXIT_SIGNAL = signal; - err.EXIT_CODE = code; - } - - if (processingDone || err) { - finish(); - } else { - processClosed = true; - } - }); - })); -} - -/***/ }), -/* 49 */ -/***/ (function(module, exports) { - -module.exports = require("http"); - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2011 Mark Cavage All rights reserved. - -// If you have no idea what ASN.1 or BER is, see this: -// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc - -var Ber = __webpack_require__(381); - - - -///--- Exported API - -module.exports = { - - Ber: Ber, - - BerReader: Ber.Reader, - - BerWriter: Ber.Writer - -}; - - -/***/ }), -/* 51 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); -} - -exports.default = function (rootCommandName, subCommands) { - let run = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const subName = (0, (_misc || _load_misc()).camelCase)(args.shift() || ''); - if (subName && subCommands[subName]) { - const command = subCommands[subName]; - const res = yield command(config, reporter, flags, args); - if (res !== false) { - return Promise.resolve(); - } - } - - if (usage && usage.length) { - reporter.error(`${reporter.lang('usage')}:`); - for (const msg of usage) { - reporter.error(`yarn ${rootCommandName} ${msg}`); - } - } - return Promise.reject(new (_errors || _load_errors()).MessageError(reporter.lang('invalidCommand', subCommandNames.join(', ')))); - }); - - return function run(_x2, _x3, _x4, _x5) { - return _ref.apply(this, arguments); - }; - })(); - - let usage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; - - const subCommandNames = Object.keys(subCommands).map((_misc || _load_misc()).hyphenate); - - function setFlags(commander) { - commander.usage(`${rootCommandName} [${subCommandNames.join('|')}] [flags]`); - } - - function hasWrapper(commander, args) { - return true; - } - - const examples = usage.map(cmd => { - return `${rootCommandName} ${cmd}`; - }); - - return { run, setFlags, hasWrapper, examples }; -}; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -var _misc; - -function _load_misc() { - return _misc = __webpack_require__(10); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), -/* 52 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SCOPE_SEPARATOR = undefined; - -var _slicedToArray2; - -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(15)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(7); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); -} - -var _npmResolver; - -function _load_npmResolver() { - return _npmResolver = _interopRequireDefault(__webpack_require__(166)); -} - -var _envReplace; - -function _load_envReplace() { - return _envReplace = _interopRequireDefault(__webpack_require__(439)); -} - -var _baseRegistry; - -function _load_baseRegistry() { - return _baseRegistry = _interopRequireDefault(__webpack_require__(423)); -} - -var _misc; - -function _load_misc() { - return _misc = __webpack_require__(10); -} - -var _path; - -function _load_path() { - return _path = __webpack_require__(279); -} - -var _normalizeUrl; - -function _load_normalizeUrl() { - return _normalizeUrl = _interopRequireDefault(__webpack_require__(593)); -} - -var _userHomeDir; - -function _load_userHomeDir() { - return _userHomeDir = _interopRequireDefault(__webpack_require__(62)); -} - -var _userHomeDir2; - -function _load_userHomeDir2() { - return _userHomeDir2 = __webpack_require__(62); -} - -var _path2; - -function _load_path2() { - return _path2 = _interopRequireDefault(__webpack_require__(0)); -} - -var _url; - -function _load_url() { - return _url = _interopRequireDefault(__webpack_require__(14)); -} - -var _ini; - -function _load_ini() { - return _ini = _interopRequireDefault(__webpack_require__(542)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const DEFAULT_REGISTRY = 'https://registry.npmjs.org/'; -const REGEX_REGISTRY_HTTP_PROTOCOL = /^https?:/i; -const REGEX_REGISTRY_PREFIX = /^(https?:)?\/\//i; -const REGEX_REGISTRY_SUFFIX = /registry\/?$/; - -const SCOPE_SEPARATOR = exports.SCOPE_SEPARATOR = '%2f'; -// All scoped package names are of the format `@scope%2fpkg` from the use of NpmRegistry.escapeName -// `(?:^|\/)` Match either the start of the string or a `/` but don't capture -// `[^\/?]+?` Match any character that is not '/' or '?' and capture, up until the first occurance of: -// `(?=%2f|\/)` Match SCOPE_SEPARATOR, the escaped '/', or a raw `/` and don't capture -// The reason for matching a plain `/` is NPM registry being inconsistent about escaping `/` in -// scoped package names: when you're fetching a tarball, it is not escaped, when you want info -// about the package, it is escaped. -const SCOPED_PKG_REGEXP = /(?:^|\/)(@[^\/?]+?)(?=%2f|\/)/; - -// TODO: Use the method from src/cli/commands/global.js for this instead -function getGlobalPrefix() { - if (process.env.PREFIX) { - return process.env.PREFIX; - } else if (process.platform === 'win32') { - // c:\node\node.exe --> prefix=c:\node\ - return (_path2 || _load_path2()).default.dirname(process.execPath); - } else { - // /usr/local/bin/node --> prefix=/usr/local - let prefix = (_path2 || _load_path2()).default.dirname((_path2 || _load_path2()).default.dirname(process.execPath)); - - // destdir only is respected on Unix - if (process.env.DESTDIR) { - prefix = (_path2 || _load_path2()).default.join(process.env.DESTDIR, prefix); - } - - return prefix; - } -} - -const PATH_CONFIG_OPTIONS = new Set(['cache', 'cafile', 'prefix', 'userconfig']); - -function isPathConfigOption(key) { - return PATH_CONFIG_OPTIONS.has(key); -} - -function normalizePath(val) { - if (val === undefined) { - return undefined; - } - - if (typeof val !== 'string') { - val = String(val); - } - - return (0, (_path || _load_path()).resolveWithHome)(val); -} - -class NpmRegistry extends (_baseRegistry || _load_baseRegistry()).default { - constructor(cwd, registries, requestManager, reporter) { - super(cwd, registries, requestManager, reporter); - this.folder = 'node_modules'; - } - - static escapeName(name) { - // scoped packages contain slashes and the npm registry expects them to be escaped - return name.replace('/', SCOPE_SEPARATOR); - } - - isScopedPackage(packageIdent) { - return SCOPED_PKG_REGEXP.test(packageIdent); - } - - getRequestUrl(registry, pathname) { - const isUrl = REGEX_REGISTRY_PREFIX.test(pathname); - - if (isUrl) { - return pathname; - } else { - return (_url || _load_url()).default.resolve((0, (_misc || _load_misc()).addSuffix)(registry, '/'), pathname); - } - } - - isRequestToRegistry(requestUrl, registryUrl) { - const normalizedRequestUrl = (0, (_normalizeUrl || _load_normalizeUrl()).default)(requestUrl); - const normalizedRegistryUrl = (0, (_normalizeUrl || _load_normalizeUrl()).default)(registryUrl); - const requestParsed = (_url || _load_url()).default.parse(normalizedRequestUrl); - const registryParsed = (_url || _load_url()).default.parse(normalizedRegistryUrl); - const requestHost = requestParsed.host || ''; - const registryHost = registryParsed.host || ''; - const requestPath = requestParsed.path || ''; - const registryPath = registryParsed.path || ''; - const customHostSuffix = this.getRegistryOrGlobalOption(registryUrl, 'custom-host-suffix'); - - return requestHost === registryHost && (requestPath.startsWith(registryPath) || - // For some registries, the package path does not prefix with the registry path - typeof customHostSuffix === 'string' && requestHost.endsWith(customHostSuffix)); - } - - request(pathname) { - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let packageName = arguments[2]; - - // packageName needs to be escaped when if it is passed - const packageIdent = packageName && NpmRegistry.escapeName(packageName) || pathname; - const registry = this.getRegistry(packageIdent); - const requestUrl = this.getRequestUrl(registry, pathname); - - const alwaysAuth = this.getRegistryOrGlobalOption(registry, 'always-auth'); - - const headers = Object.assign({ - Accept: 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' - }, opts.headers); - - const isToRegistry = this.isRequestToRegistry(requestUrl, registry); - - // this.token must be checked to account for publish requests on non-scopped packages - if (this.token || isToRegistry && (alwaysAuth || this.isScopedPackage(packageIdent))) { - const authorization = this.getAuth(packageIdent); - if (authorization) { - headers.authorization = authorization; - } - } - - return this.requestManager.request({ - url: requestUrl, - method: opts.method, - body: opts.body, - auth: opts.auth, - headers, - json: !opts.buffer, - buffer: opts.buffer, - process: opts.process, - gzip: true - }); - } - - checkOutdated(config, name, range) { - var _this = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const req = yield _this.request(NpmRegistry.escapeName(name), { - headers: { Accept: 'application/json' } - }); - if (!req) { - throw new Error('couldnt find ' + name); - } - - const repository = req.repository, - homepage = req.homepage; - - const url = homepage || repository && repository.url || ''; - - return { - latest: req['dist-tags'].latest, - wanted: (yield (_npmResolver || _load_npmResolver()).default.findVersionInRegistryResponse(config, range, req)).version, - url - }; - })(); - } - - getPossibleConfigLocations(filename, reporter) { - var _this2 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // npmrc --> ./.npmrc, ~/.npmrc, ${prefix}/etc/npmrc - const localfile = '.' + filename; - const possibles = [[false, (_path2 || _load_path2()).default.join(_this2.cwd, localfile)], [true, _this2.config.userconfig || (_path2 || _load_path2()).default.join((_userHomeDir || _load_userHomeDir()).default, localfile)], [false, (_path2 || _load_path2()).default.join(getGlobalPrefix(), 'etc', filename)]]; - - // When home directory for global install is different from where $HOME/npmrc is stored, - // E.g. /usr/local/share vs /root on linux machines, check the additional location - if ((_userHomeDir2 || _load_userHomeDir2()).home !== (_userHomeDir || _load_userHomeDir()).default) { - possibles.push([true, (_path2 || _load_path2()).default.join((_userHomeDir2 || _load_userHomeDir2()).home, localfile)]); - } - - // npmrc --> ../.npmrc, ../../.npmrc, etc. - const foldersFromRootToCwd = (0, (_path || _load_path()).getPosixPath)(_this2.cwd).split('/'); - while (foldersFromRootToCwd.length > 1) { - possibles.push([false, (_path2 || _load_path2()).default.join(foldersFromRootToCwd.join((_path2 || _load_path2()).default.sep), localfile)]); - foldersFromRootToCwd.pop(); - } - - const actuals = []; - for (const _ref of possibles) { - var _ref2 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref, 2); - - const isHome = _ref2[0]; - const loc = _ref2[1]; - - reporter.verbose(reporter.lang('configPossibleFile', loc)); - if (yield (_fs || _load_fs()).exists(loc)) { - reporter.verbose(reporter.lang('configFileFound', loc)); - actuals.push([isHome, loc, yield (_fs || _load_fs()).readFile(loc)]); - } - } - return actuals; - })(); - } - - static getConfigEnv() { - let env = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : process.env; - - // To match NPM's behavior, HOME is always the user's home directory. - const overrideEnv = { - HOME: (_userHomeDir2 || _load_userHomeDir2()).home - }; - return Object.assign({}, env, overrideEnv); - } - - static normalizeConfig(config) { - const env = NpmRegistry.getConfigEnv(); - config = (_baseRegistry || _load_baseRegistry()).default.normalizeConfig(config); - - for (const key in config) { - config[key] = (0, (_envReplace || _load_envReplace()).default)(config[key], env); - if (isPathConfigOption(key)) { - config[key] = normalizePath(config[key]); - } - } - - return config; - } - - loadConfig() { - var _this3 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // docs: https://docs.npmjs.com/misc/config - _this3.mergeEnv('npm_config_'); - - for (const _ref3 of yield _this3.getPossibleConfigLocations('npmrc', _this3.reporter)) { - var _ref4 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref3, 3); - - const loc = _ref4[1]; - const file = _ref4[2]; - - const config = NpmRegistry.normalizeConfig((_ini || _load_ini()).default.parse(file)); - - // normalize offline mirror path relative to the current npmrc - const offlineLoc = config['yarn-offline-mirror']; - // don't normalize if we already have a mirror path - if (!_this3.config['yarn-offline-mirror'] && offlineLoc) { - const mirrorLoc = config['yarn-offline-mirror'] = (_path2 || _load_path2()).default.resolve((_path2 || _load_path2()).default.dirname(loc), offlineLoc); - yield (_fs || _load_fs()).mkdirp(mirrorLoc); - } - - _this3.config = Object.assign({}, config, _this3.config); - } - })(); - } - - getScope(packageIdent) { - const match = packageIdent.match(SCOPED_PKG_REGEXP); - return match && match[1] || ''; - } - - getRegistry(packageIdent) { - // Try extracting registry from the url, then scoped registry, and default registry - if (packageIdent.match(REGEX_REGISTRY_PREFIX)) { - const availableRegistries = this.getAvailableRegistries(); - const registry = availableRegistries.find(registry => packageIdent.startsWith(registry)); - if (registry) { - return String(registry); - } - } - - for (const scope of [this.getScope(packageIdent), '']) { - const registry = this.getScopedOption(scope, 'registry') || this.registries.yarn.getScopedOption(scope, 'registry'); - if (registry) { - return String(registry); - } - } - - return DEFAULT_REGISTRY; - } - - getAuth(packageIdent) { - if (this.token) { - return this.token; - } - - const baseRegistry = this.getRegistry(packageIdent); - const registries = [baseRegistry]; - - // If sending a request to the Yarn registry, we must also send it the auth token for the npm registry - if (baseRegistry === (_constants || _load_constants()).YARN_REGISTRY) { - registries.push(DEFAULT_REGISTRY); - } - - for (const registry of registries) { - // Check for bearer token. - const authToken = this.getRegistryOrGlobalOption(registry, '_authToken'); - if (authToken) { - return `Bearer ${String(authToken)}`; - } - - // Check for basic auth token. - const auth = this.getRegistryOrGlobalOption(registry, '_auth'); - if (auth) { - return `Basic ${String(auth)}`; - } - - // Check for basic username/password auth. - const username = this.getRegistryOrGlobalOption(registry, 'username'); - const password = this.getRegistryOrGlobalOption(registry, '_password'); - if (username && password) { - const pw = new Buffer(String(password), 'base64').toString(); - return 'Basic ' + new Buffer(String(username) + ':' + pw).toString('base64'); - } - } - - return ''; - } - - getScopedOption(scope, option) { - return this.getOption(scope + (scope ? ':' : '') + option); - } - - getRegistryOption(registry, option) { - const pre = REGEX_REGISTRY_HTTP_PROTOCOL; - const suf = REGEX_REGISTRY_SUFFIX; - - // When registry is used config scope, the trailing '/' is required - const reg = (0, (_misc || _load_misc()).addSuffix)(registry, '/'); - - // 1st attempt, try to get option for the given registry URL - // 2nd attempt, remove the 'https?:' prefix of the registry URL - // 3nd attempt, remove the 'registry/?' suffix of the registry URL - return this.getScopedOption(reg, option) || pre.test(reg) && this.getRegistryOption(reg.replace(pre, ''), option) || suf.test(reg) && this.getRegistryOption(reg.replace(suf, ''), option); - } - - getRegistryOrGlobalOption(registry, option) { - return this.getRegistryOption(registry, option) || this.getOption(option); - } -} -exports.default = NpmRegistry; -NpmRegistry.filename = 'package.json'; - -/***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.wait = wait; -exports.promisify = promisify; -exports.queue = queue; -function wait(delay) { - return new Promise(resolve => { - setTimeout(resolve, delay); - }); -} - -function promisify(fn, firstData) { - return function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return new Promise(function (resolve, reject) { - args.push(function (err) { - for (var _len2 = arguments.length, result = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - result[_key2 - 1] = arguments[_key2]; - } - - let res = result; - - if (result.length <= 1) { - res = result[0]; - } - - if (firstData) { - res = err; - err = null; - } - - if (err) { - reject(err); - } else { - resolve(res); - } - }); - - fn.apply(null, args); - }); - }; -} - -function queue(arr, promiseProducer) { - let concurrency = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity; - - concurrency = Math.min(concurrency, arr.length); - - // clone - arr = arr.slice(); - - const results = []; - let total = arr.length; - if (!total) { - return Promise.resolve(results); - } - - return new Promise((resolve, reject) => { - for (let i = 0; i < concurrency; i++) { - next(); - } - - function next() { - const item = arr.shift(); - const promise = promiseProducer(item); - - promise.then(function (result) { - results.push(result); - - total--; - if (total === 0) { - resolve(results); - } else { - if (arr.length) { - next(); - } - } - }, reject); - } - }); -} - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * Base prompt implementation - * Should be extended by prompt types. - */ - -var _ = __webpack_require__(27); -var chalk = __webpack_require__(34); -var runAsync = __webpack_require__(143); -var Choices = __webpack_require__(544); -var ScreenManager = __webpack_require__(555); - -var Prompt = module.exports = function (question, rl, answers) { - // Setup instance defaults property - _.assign(this, { - answers: answers, - status: 'pending' - }); - - // Set defaults prompt options - this.opt = _.defaults(_.clone(question), { - validate: function () { - return true; - }, - filter: function (val) { - return val; - }, - when: function () { - return true; - } - }); - - // Check to make sure prompt requirements are there - if (!this.opt.message) { - this.throwParamError('message'); - } - if (!this.opt.name) { - this.throwParamError('name'); - } - - // Normalize choices - if (Array.isArray(this.opt.choices)) { - this.opt.choices = new Choices(this.opt.choices, answers); - } - - this.rl = rl; - this.screen = new ScreenManager(this.rl); -}; - -/** - * Start the Inquiry session and manage output value filtering - * @return {Promise} - */ - -Prompt.prototype.run = function () { - return new Promise(function (resolve) { - this._run(function (value) { - resolve(value); - }); - }.bind(this)); -}; - -// default noop (this one should be overwritten in prompts) -Prompt.prototype._run = function (cb) { - cb(); -}; - -/** - * Throw an error telling a required parameter is missing - * @param {String} name Name of the missing param - * @return {Throw Error} - */ - -Prompt.prototype.throwParamError = function (name) { - throw new Error('You must provide a `' + name + '` parameter'); -}; - -/** - * Called when the UI closes. Override to do any specific cleanup necessary - */ -Prompt.prototype.close = function () { - this.screen.releaseCursor(); -}; - -/** - * Run the provided validation method each time a submit event occur. - * @param {Rx.Observable} submit - submit event flow - * @return {Object} Object containing two observables: `success` and `error` - */ -Prompt.prototype.handleSubmitEvents = function (submit) { - var self = this; - var validate = runAsync(this.opt.validate); - var filter = runAsync(this.opt.filter); - var validation = submit.flatMap(function (value) { - return filter(value).then(function (filteredValue) { - return validate(filteredValue, self.answers).then(function (isValid) { - return {isValid: isValid, value: filteredValue}; - }, function (err) { - return {isValid: err}; - }); - }, function (err) { - return {isValid: err}; - }); - }).share(); - - var success = validation - .filter(function (state) { - return state.isValid === true; - }) - .take(1); - - var error = validation - .filter(function (state) { - return state.isValid !== true; - }) - .takeUntil(success); - - return { - success: success, - error: error - }; -}; - -/** - * Generate the prompt question string - * @return {String} prompt question string - */ - -Prompt.prototype.getQuestion = function () { - var message = chalk.green('?') + ' ' + chalk.bold(this.opt.message) + ' '; - - // Append the default if available, and if question isn't answered - if (this.opt.default != null && this.status !== 'answered') { - message += chalk.dim('(' + this.opt.default + ') '); - } - - return message; -}; - - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var rx = __webpack_require__(144); - -function normalizeKeypressEvents(value, key) { - return {value: value, key: key || {}}; -} - -module.exports = function (rl) { - var keypress = rx.Observable.fromEvent(rl.input, 'keypress', normalizeKeypressEvents) - .filter(function (e) { - // Ignore `enter` key. On the readline, we only care about the `line` event. - return e.key.name !== 'enter' && e.key.name !== 'return'; - }); - - return { - line: rx.Observable.fromEvent(rl, 'line'), - keypress: keypress, - - normalizedUpKey: keypress.filter(function (e) { - return e.key.name === 'up' || e.key.name === 'k' || (e.key.name === 'p' && e.key.ctrl); - }).share(), - - normalizedDownKey: keypress.filter(function (e) { - return e.key.name === 'down' || e.key.name === 'j' || (e.key.name === 'n' && e.key.ctrl); - }).share(), - - numberKey: keypress.filter(function (e) { - return e.value && '123456789'.indexOf(e.value) >= 0; - }).map(function (e) { - return Number(e.value); - }).share(), - - spaceKey: keypress.filter(function (e) { - return e.key && e.key.name === 'space'; - }).share(), - - aKey: keypress.filter(function (e) { - return e.key && e.key.name === 'a'; - }).share(), - - iKey: keypress.filter(function (e) { - return e.key && e.key.name === 'i'; - }).share() - }; -}; - - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -(function(){ - - // Copyright (c) 2005 Tom Wu - // All Rights Reserved. - // See "LICENSE" for details. - - // Basic JavaScript BN library - subset useful for RSA encryption. - - // Bits per digit - var dbits; - - // JavaScript engine analysis - var canary = 0xdeadbeefcafe; - var j_lm = ((canary&0xffffff)==0xefcafe); - - // (public) Constructor - function BigInteger(a,b,c) { - if(a != null) - if("number" == typeof a) this.fromNumber(a,b,c); - else if(b == null && "string" != typeof a) this.fromString(a,256); - else this.fromString(a,b); - } - - // return new, unset BigInteger - function nbi() { return new BigInteger(null); } - - // am: Compute w_j += (x*this_i), propagate carries, - // c is initial carry, returns final carry. - // c < 3*dvalue, x < 2*dvalue, this_i < dvalue - // We need to select the fastest one that works in this environment. - - // am1: use a single mult and divide to get the high bits, - // max digit bits should be 26 because - // max internal value = 2*dvalue^2-2*dvalue (< 2^53) - function am1(i,x,w,j,c,n) { - while(--n >= 0) { - var v = x*this[i++]+w[j]+c; - c = Math.floor(v/0x4000000); - w[j++] = v&0x3ffffff; - } - return c; - } - // am2 avoids a big mult-and-extract completely. - // Max digit bits should be <= 30 because we do bitwise ops - // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) - function am2(i,x,w,j,c,n) { - var xl = x&0x7fff, xh = x>>15; - while(--n >= 0) { - var l = this[i]&0x7fff; - var h = this[i++]>>15; - var m = xh*l+h*xl; - l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); - c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); - w[j++] = l&0x3fffffff; - } - return c; - } - // Alternately, set max digit bits to 28 since some - // browsers slow down when dealing with 32-bit numbers. - function am3(i,x,w,j,c,n) { - var xl = x&0x3fff, xh = x>>14; - while(--n >= 0) { - var l = this[i]&0x3fff; - var h = this[i++]>>14; - var m = xh*l+h*xl; - l = xl*l+((m&0x3fff)<<14)+w[j]+c; - c = (l>>28)+(m>>14)+xh*h; - w[j++] = l&0xfffffff; - } - return c; - } - var inBrowser = typeof navigator !== "undefined"; - if(inBrowser && j_lm && (navigator.appName == "Microsoft Internet Explorer")) { - BigInteger.prototype.am = am2; - dbits = 30; - } - else if(inBrowser && j_lm && (navigator.appName != "Netscape")) { - BigInteger.prototype.am = am1; - dbits = 26; - } - else { // Mozilla/Netscape seems to prefer am3 - BigInteger.prototype.am = am3; - dbits = 28; - } - - BigInteger.prototype.DB = dbits; - BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i]; - r.t = this.t; - r.s = this.s; - } - - // (protected) set from integer value x, -DV <= x < DV - function bnpFromInt(x) { - this.t = 1; - this.s = (x<0)?-1:0; - if(x > 0) this[0] = x; - else if(x < -1) this[0] = x+this.DV; - else this.t = 0; - } - - // return bigint initialized to value - function nbv(i) { var r = nbi(); r.fromInt(i); return r; } - - // (protected) set from string and radix - function bnpFromString(s,b) { - var k; - if(b == 16) k = 4; - else if(b == 8) k = 3; - else if(b == 256) k = 8; // byte array - else if(b == 2) k = 1; - else if(b == 32) k = 5; - else if(b == 4) k = 2; - else { this.fromRadix(s,b); return; } - this.t = 0; - this.s = 0; - var i = s.length, mi = false, sh = 0; - while(--i >= 0) { - var x = (k==8)?s[i]&0xff:intAt(s,i); - if(x < 0) { - if(s.charAt(i) == "-") mi = true; - continue; - } - mi = false; - if(sh == 0) - this[this.t++] = x; - else if(sh+k > this.DB) { - this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); - } - else - this[this.t-1] |= x<= this.DB) sh -= this.DB; - } - if(k == 8 && (s[0]&0x80) != 0) { - this.s = -1; - if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t; - } - - // (public) return string representation in given radix - function bnToString(b) { - if(this.s < 0) return "-"+this.negate().toString(b); - var k; - if(b == 16) k = 4; - else if(b == 8) k = 3; - else if(b == 2) k = 1; - else if(b == 32) k = 5; - else if(b == 4) k = 2; - else return this.toRadix(b); - var km = (1< 0) { - if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); } - while(i >= 0) { - if(p < k) { - d = (this[i]&((1<>(p+=this.DB-k); - } - else { - d = (this[i]>>(p-=k))&km; - if(p <= 0) { p += this.DB; --i; } - } - if(d > 0) m = true; - if(m) r += int2char(d); - } - } - return m?r:"0"; - } - - // (public) -this - function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } - - // (public) |this| - function bnAbs() { return (this.s<0)?this.negate():this; } - - // (public) return + if this > a, - if this < a, 0 if equal - function bnCompareTo(a) { - var r = this.s-a.s; - if(r != 0) return r; - var i = this.t; - r = i-a.t; - if(r != 0) return (this.s<0)?-r:r; - while(--i >= 0) if((r=this[i]-a[i]) != 0) return r; - return 0; - } - - // returns bit length of the integer x - function nbits(x) { - var r = 1, t; - if((t=x>>>16) != 0) { x = t; r += 16; } - if((t=x>>8) != 0) { x = t; r += 8; } - if((t=x>>4) != 0) { x = t; r += 4; } - if((t=x>>2) != 0) { x = t; r += 2; } - if((t=x>>1) != 0) { x = t; r += 1; } - return r; - } - - // (public) return the number of bits in "this" - function bnBitLength() { - if(this.t <= 0) return 0; - return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM)); - } - - // (protected) r = this << n*DB - function bnpDLShiftTo(n,r) { - var i; - for(i = this.t-1; i >= 0; --i) r[i+n] = this[i]; - for(i = n-1; i >= 0; --i) r[i] = 0; - r.t = this.t+n; - r.s = this.s; - } - - // (protected) r = this >> n*DB - function bnpDRShiftTo(n,r) { - for(var i = n; i < this.t; ++i) r[i-n] = this[i]; - r.t = Math.max(this.t-n,0); - r.s = this.s; - } - - // (protected) r = this << n - function bnpLShiftTo(n,r) { - var bs = n%this.DB; - var cbs = this.DB-bs; - var bm = (1<= 0; --i) { - r[i+ds+1] = (this[i]>>cbs)|c; - c = (this[i]&bm)<= 0; --i) r[i] = 0; - r[ds] = c; - r.t = this.t+ds+1; - r.s = this.s; - r.clamp(); - } - - // (protected) r = this >> n - function bnpRShiftTo(n,r) { - r.s = this.s; - var ds = Math.floor(n/this.DB); - if(ds >= this.t) { r.t = 0; return; } - var bs = n%this.DB; - var cbs = this.DB-bs; - var bm = (1<>bs; - for(var i = ds+1; i < this.t; ++i) { - r[i-ds-1] |= (this[i]&bm)<>bs; - } - if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB; - } - if(a.t < this.t) { - c -= a.s; - while(i < this.t) { - c += this[i]; - r[i++] = c&this.DM; - c >>= this.DB; - } - c += this.s; - } - else { - c += this.s; - while(i < a.t) { - c -= a[i]; - r[i++] = c&this.DM; - c >>= this.DB; - } - c -= a.s; - } - r.s = (c<0)?-1:0; - if(c < -1) r[i++] = this.DV+c; - else if(c > 0) r[i++] = c; - r.t = i; - r.clamp(); - } - - // (protected) r = this * a, r != this,a (HAC 14.12) - // "this" should be the larger one if appropriate. - function bnpMultiplyTo(a,r) { - var x = this.abs(), y = a.abs(); - var i = x.t; - r.t = i+y.t; - while(--i >= 0) r[i] = 0; - for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t); - r.s = 0; - r.clamp(); - if(this.s != a.s) BigInteger.ZERO.subTo(r,r); - } - - // (protected) r = this^2, r != this (HAC 14.16) - function bnpSquareTo(r) { - var x = this.abs(); - var i = r.t = 2*x.t; - while(--i >= 0) r[i] = 0; - for(i = 0; i < x.t-1; ++i) { - var c = x.am(i,x[i],r,2*i,0,1); - if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { - r[i+x.t] -= x.DV; - r[i+x.t+1] = 1; - } - } - if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); - r.s = 0; - r.clamp(); - } - - // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) - // r != q, this != m. q or r may be null. - function bnpDivRemTo(m,q,r) { - var pm = m.abs(); - if(pm.t <= 0) return; - var pt = this.abs(); - if(pt.t < pm.t) { - if(q != null) q.fromInt(0); - if(r != null) this.copyTo(r); - return; - } - if(r == null) r = nbi(); - var y = nbi(), ts = this.s, ms = m.s; - var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus - if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } - else { pm.copyTo(y); pt.copyTo(r); } - var ys = y.t; - var y0 = y[ys-1]; - if(y0 == 0) return; - var yt = y0*(1<1)?y[ys-2]>>this.F2:0); - var d1 = this.FV/yt, d2 = (1<= 0) { - r[r.t++] = 1; - r.subTo(t,r); - } - BigInteger.ONE.dlShiftTo(ys,t); - t.subTo(y,y); // "negative" y so we can replace sub with am later - while(y.t < ys) y[y.t++] = 0; - while(--j >= 0) { - // Estimate quotient digit - var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2); - if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out - y.dlShiftTo(j,t); - r.subTo(t,r); - while(r[i] < --qd) r.subTo(t,r); - } - } - if(q != null) { - r.drShiftTo(ys,q); - if(ts != ms) BigInteger.ZERO.subTo(q,q); - } - r.t = ys; - r.clamp(); - if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder - if(ts < 0) BigInteger.ZERO.subTo(r,r); - } - - // (public) this mod a - function bnMod(a) { - var r = nbi(); - this.abs().divRemTo(a,null,r); - if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); - return r; - } - - // Modular reduction using "classic" algorithm - function Classic(m) { this.m = m; } - function cConvert(x) { - if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); - else return x; - } - function cRevert(x) { return x; } - function cReduce(x) { x.divRemTo(this.m,null,x); } - function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } - function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - - Classic.prototype.convert = cConvert; - Classic.prototype.revert = cRevert; - Classic.prototype.reduce = cReduce; - Classic.prototype.mulTo = cMulTo; - Classic.prototype.sqrTo = cSqrTo; - - // (protected) return "-1/this % 2^DB"; useful for Mont. reduction - // justification: - // xy == 1 (mod m) - // xy = 1+km - // xy(2-xy) = (1+km)(1-km) - // x[y(2-xy)] = 1-k^2m^2 - // x[y(2-xy)] == 1 (mod m^2) - // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 - // should reduce x and y(2-xy) by m^2 at each step to keep size bounded. - // JS multiply "overflows" differently from C/C++, so care is needed here. - function bnpInvDigit() { - if(this.t < 1) return 0; - var x = this[0]; - if((x&1) == 0) return 0; - var y = x&3; // y == 1/x mod 2^2 - y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 - y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 - y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 - // last step - calculate inverse mod DV directly; - // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints - y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits - // we really want the negative inverse, and -DV < y < DV - return (y>0)?this.DV-y:-y; - } - - // Montgomery reduction - function Montgomery(m) { - this.m = m; - this.mp = m.invDigit(); - this.mpl = this.mp&0x7fff; - this.mph = this.mp>>15; - this.um = (1<<(m.DB-15))-1; - this.mt2 = 2*m.t; - } - - // xR mod m - function montConvert(x) { - var r = nbi(); - x.abs().dlShiftTo(this.m.t,r); - r.divRemTo(this.m,null,r); - if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); - return r; - } - - // x/R mod m - function montRevert(x) { - var r = nbi(); - x.copyTo(r); - this.reduce(r); - return r; - } - - // x = x/R mod m (HAC 14.32) - function montReduce(x) { - while(x.t <= this.mt2) // pad x so am has enough room later - x[x.t++] = 0; - for(var i = 0; i < this.m.t; ++i) { - // faster way of calculating u0 = x[i]*mp mod DV - var j = x[i]&0x7fff; - var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; - // use am to combine the multiply-shift-add into one call - j = i+this.m.t; - x[j] += this.m.am(0,u0,x,i,0,this.m.t); - // propagate carry - while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } - } - x.clamp(); - x.drShiftTo(this.m.t,x); - if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); - } - - // r = "x^2/R mod m"; x != r - function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - - // r = "xy/R mod m"; x,y != r - function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } - - Montgomery.prototype.convert = montConvert; - Montgomery.prototype.revert = montRevert; - Montgomery.prototype.reduce = montReduce; - Montgomery.prototype.mulTo = montMulTo; - Montgomery.prototype.sqrTo = montSqrTo; - - // (protected) true iff this is even - function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; } - - // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) - function bnpExp(e,z) { - if(e > 0xffffffff || e < 1) return BigInteger.ONE; - var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; - g.copyTo(r); - while(--i >= 0) { - z.sqrTo(r,r2); - if((e&(1< 0) z.mulTo(r2,g,r); - else { var t = r; r = r2; r2 = t; } - } - return z.revert(r); - } - - // (public) this^e % m, 0 <= e < 2^32 - function bnModPowInt(e,m) { - var z; - if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); - return this.exp(e,z); - } - - // protected - BigInteger.prototype.copyTo = bnpCopyTo; - BigInteger.prototype.fromInt = bnpFromInt; - BigInteger.prototype.fromString = bnpFromString; - BigInteger.prototype.clamp = bnpClamp; - BigInteger.prototype.dlShiftTo = bnpDLShiftTo; - BigInteger.prototype.drShiftTo = bnpDRShiftTo; - BigInteger.prototype.lShiftTo = bnpLShiftTo; - BigInteger.prototype.rShiftTo = bnpRShiftTo; - BigInteger.prototype.subTo = bnpSubTo; - BigInteger.prototype.multiplyTo = bnpMultiplyTo; - BigInteger.prototype.squareTo = bnpSquareTo; - BigInteger.prototype.divRemTo = bnpDivRemTo; - BigInteger.prototype.invDigit = bnpInvDigit; - BigInteger.prototype.isEven = bnpIsEven; - BigInteger.prototype.exp = bnpExp; - - // public - BigInteger.prototype.toString = bnToString; - BigInteger.prototype.negate = bnNegate; - BigInteger.prototype.abs = bnAbs; - BigInteger.prototype.compareTo = bnCompareTo; - BigInteger.prototype.bitLength = bnBitLength; - BigInteger.prototype.mod = bnMod; - BigInteger.prototype.modPowInt = bnModPowInt; - - // "constants" - BigInteger.ZERO = nbv(0); - BigInteger.ONE = nbv(1); - - // Copyright (c) 2005-2009 Tom Wu - // All Rights Reserved. - // See "LICENSE" for details. - - // Extended JavaScript BN functions, required for RSA private ops. - - // Version 1.1: new BigInteger("0", 10) returns "proper" zero - // Version 1.2: square() API, isProbablePrime fix - - // (public) - function bnClone() { var r = nbi(); this.copyTo(r); return r; } - - // (public) return value as integer - function bnIntValue() { - if(this.s < 0) { - if(this.t == 1) return this[0]-this.DV; - else if(this.t == 0) return -1; - } - else if(this.t == 1) return this[0]; - else if(this.t == 0) return 0; - // assumes 16 < DB < 32 - return ((this[1]&((1<<(32-this.DB))-1))<>24; } - - // (public) return value as short (assumes DB>=16) - function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; } - - // (protected) return x s.t. r^x < DV - function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); } - - // (public) 0 if this == 0, 1 if this > 0 - function bnSigNum() { - if(this.s < 0) return -1; - else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0; - else return 1; - } - - // (protected) convert to radix string - function bnpToRadix(b) { - if(b == null) b = 10; - if(this.signum() == 0 || b < 2 || b > 36) return "0"; - var cs = this.chunkSize(b); - var a = Math.pow(b,cs); - var d = nbv(a), y = nbi(), z = nbi(), r = ""; - this.divRemTo(d,y,z); - while(y.signum() > 0) { - r = (a+z.intValue()).toString(b).substr(1) + r; - y.divRemTo(d,y,z); - } - return z.intValue().toString(b) + r; - } - - // (protected) convert from radix string - function bnpFromRadix(s,b) { - this.fromInt(0); - if(b == null) b = 10; - var cs = this.chunkSize(b); - var d = Math.pow(b,cs), mi = false, j = 0, w = 0; - for(var i = 0; i < s.length; ++i) { - var x = intAt(s,i); - if(x < 0) { - if(s.charAt(i) == "-" && this.signum() == 0) mi = true; - continue; - } - w = b*w+x; - if(++j >= cs) { - this.dMultiply(d); - this.dAddOffset(w,0); - j = 0; - w = 0; - } - } - if(j > 0) { - this.dMultiply(Math.pow(b,j)); - this.dAddOffset(w,0); - } - if(mi) BigInteger.ZERO.subTo(this,this); - } - - // (protected) alternate constructor - function bnpFromNumber(a,b,c) { - if("number" == typeof b) { - // new BigInteger(int,int,RNG) - if(a < 2) this.fromInt(1); - else { - this.fromNumber(a,c); - if(!this.testBit(a-1)) // force MSB set - this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); - if(this.isEven()) this.dAddOffset(1,0); // force odd - while(!this.isProbablePrime(b)) { - this.dAddOffset(2,0); - if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); - } - } - } - else { - // new BigInteger(int,RNG) - var x = new Array(), t = a&7; - x.length = (a>>3)+1; - b.nextBytes(x); - if(t > 0) x[0] &= ((1< 0) { - if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p) - r[k++] = d|(this.s<<(this.DB-p)); - while(i >= 0) { - if(p < 8) { - d = (this[i]&((1<>(p+=this.DB-8); - } - else { - d = (this[i]>>(p-=8))&0xff; - if(p <= 0) { p += this.DB; --i; } - } - if((d&0x80) != 0) d |= -256; - if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; - if(k > 0 || d != this.s) r[k++] = d; - } - } - return r; - } - - function bnEquals(a) { return(this.compareTo(a)==0); } - function bnMin(a) { return(this.compareTo(a)<0)?this:a; } - function bnMax(a) { return(this.compareTo(a)>0)?this:a; } - - // (protected) r = this op a (bitwise) - function bnpBitwiseTo(a,op,r) { - var i, f, m = Math.min(a.t,this.t); - for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]); - if(a.t < this.t) { - f = a.s&this.DM; - for(i = m; i < this.t; ++i) r[i] = op(this[i],f); - r.t = this.t; - } - else { - f = this.s&this.DM; - for(i = m; i < a.t; ++i) r[i] = op(f,a[i]); - r.t = a.t; - } - r.s = op(this.s,a.s); - r.clamp(); - } - - // (public) this & a - function op_and(x,y) { return x&y; } - function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } - - // (public) this | a - function op_or(x,y) { return x|y; } - function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } - - // (public) this ^ a - function op_xor(x,y) { return x^y; } - function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } - - // (public) this & ~a - function op_andnot(x,y) { return x&~y; } - function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } - - // (public) ~this - function bnNot() { - var r = nbi(); - for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i]; - r.t = this.t; - r.s = ~this.s; - return r; - } - - // (public) this << n - function bnShiftLeft(n) { - var r = nbi(); - if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); - return r; - } - - // (public) this >> n - function bnShiftRight(n) { - var r = nbi(); - if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); - return r; - } - - // return index of lowest 1-bit in x, x < 2^31 - function lbit(x) { - if(x == 0) return -1; - var r = 0; - if((x&0xffff) == 0) { x >>= 16; r += 16; } - if((x&0xff) == 0) { x >>= 8; r += 8; } - if((x&0xf) == 0) { x >>= 4; r += 4; } - if((x&3) == 0) { x >>= 2; r += 2; } - if((x&1) == 0) ++r; - return r; - } - - // (public) returns index of lowest 1-bit (or -1 if none) - function bnGetLowestSetBit() { - for(var i = 0; i < this.t; ++i) - if(this[i] != 0) return i*this.DB+lbit(this[i]); - if(this.s < 0) return this.t*this.DB; - return -1; - } - - // return number of 1 bits in x - function cbit(x) { - var r = 0; - while(x != 0) { x &= x-1; ++r; } - return r; - } - - // (public) return number of set bits - function bnBitCount() { - var r = 0, x = this.s&this.DM; - for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x); - return r; - } - - // (public) true iff nth bit is set - function bnTestBit(n) { - var j = Math.floor(n/this.DB); - if(j >= this.t) return(this.s!=0); - return((this[j]&(1<<(n%this.DB)))!=0); - } - - // (protected) this op (1<>= this.DB; - } - if(a.t < this.t) { - c += a.s; - while(i < this.t) { - c += this[i]; - r[i++] = c&this.DM; - c >>= this.DB; - } - c += this.s; - } - else { - c += this.s; - while(i < a.t) { - c += a[i]; - r[i++] = c&this.DM; - c >>= this.DB; - } - c += a.s; - } - r.s = (c<0)?-1:0; - if(c > 0) r[i++] = c; - else if(c < -1) r[i++] = this.DV+c; - r.t = i; - r.clamp(); - } - - // (public) this + a - function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } - - // (public) this - a - function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } - - // (public) this * a - function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } - - // (public) this^2 - function bnSquare() { var r = nbi(); this.squareTo(r); return r; } - - // (public) this / a - function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } - - // (public) this % a - function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } - - // (public) [this/a,this%a] - function bnDivideAndRemainder(a) { - var q = nbi(), r = nbi(); - this.divRemTo(a,q,r); - return new Array(q,r); - } - - // (protected) this *= n, this >= 0, 1 < n < DV - function bnpDMultiply(n) { - this[this.t] = this.am(0,n-1,this,0,0,this.t); - ++this.t; - this.clamp(); - } - - // (protected) this += n << w words, this >= 0 - function bnpDAddOffset(n,w) { - if(n == 0) return; - while(this.t <= w) this[this.t++] = 0; - this[w] += n; - while(this[w] >= this.DV) { - this[w] -= this.DV; - if(++w >= this.t) this[this.t++] = 0; - ++this[w]; - } - } - - // A "null" reducer - function NullExp() {} - function nNop(x) { return x; } - function nMulTo(x,y,r) { x.multiplyTo(y,r); } - function nSqrTo(x,r) { x.squareTo(r); } - - NullExp.prototype.convert = nNop; - NullExp.prototype.revert = nNop; - NullExp.prototype.mulTo = nMulTo; - NullExp.prototype.sqrTo = nSqrTo; - - // (public) this^e - function bnPow(e) { return this.exp(e,new NullExp()); } - - // (protected) r = lower n words of "this * a", a.t <= n - // "this" should be the larger one if appropriate. - function bnpMultiplyLowerTo(a,n,r) { - var i = Math.min(this.t+a.t,n); - r.s = 0; // assumes a,this >= 0 - r.t = i; - while(i > 0) r[--i] = 0; - var j; - for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t); - for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i); - r.clamp(); - } - - // (protected) r = "this * a" without lower n words, n > 0 - // "this" should be the larger one if appropriate. - function bnpMultiplyUpperTo(a,n,r) { - --n; - var i = r.t = this.t+a.t-n; - r.s = 0; // assumes a,this >= 0 - while(--i >= 0) r[i] = 0; - for(i = Math.max(n-this.t,0); i < a.t; ++i) - r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n); - r.clamp(); - r.drShiftTo(1,r); - } - - // Barrett modular reduction - function Barrett(m) { - // setup Barrett - this.r2 = nbi(); - this.q3 = nbi(); - BigInteger.ONE.dlShiftTo(2*m.t,this.r2); - this.mu = this.r2.divide(m); - this.m = m; - } - - function barrettConvert(x) { - if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); - else if(x.compareTo(this.m) < 0) return x; - else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } - } - - function barrettRevert(x) { return x; } - - // x = x mod m (HAC 14.42) - function barrettReduce(x) { - x.drShiftTo(this.m.t-1,this.r2); - if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } - this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3); - this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2); - while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); - x.subTo(this.r2,x); - while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); - } - - // r = x^2 mod m; x != r - function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } - - // r = x*y mod m; x,y != r - function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } - - Barrett.prototype.convert = barrettConvert; - Barrett.prototype.revert = barrettRevert; - Barrett.prototype.reduce = barrettReduce; - Barrett.prototype.mulTo = barrettMulTo; - Barrett.prototype.sqrTo = barrettSqrTo; - - // (public) this^e % m (HAC 14.85) - function bnModPow(e,m) { - var i = e.bitLength(), k, r = nbv(1), z; - if(i <= 0) return r; - else if(i < 18) k = 1; - else if(i < 48) k = 3; - else if(i < 144) k = 4; - else if(i < 768) k = 5; - else k = 6; - if(i < 8) - z = new Classic(m); - else if(m.isEven()) - z = new Barrett(m); - else - z = new Montgomery(m); - - // precomputation - var g = new Array(), n = 3, k1 = k-1, km = (1< 1) { - var g2 = nbi(); - z.sqrTo(g[1],g2); - while(n <= km) { - g[n] = nbi(); - z.mulTo(g2,g[n-2],g[n]); - n += 2; - } - } - - var j = e.t-1, w, is1 = true, r2 = nbi(), t; - i = nbits(e[j])-1; - while(j >= 0) { - if(i >= k1) w = (e[j]>>(i-k1))&km; - else { - w = (e[j]&((1<<(i+1))-1))<<(k1-i); - if(j > 0) w |= e[j-1]>>(this.DB+i-k1); - } - - n = k; - while((w&1) == 0) { w >>= 1; --n; } - if((i -= n) < 0) { i += this.DB; --j; } - if(is1) { // ret == 1, don't bother squaring or multiplying it - g[w].copyTo(r); - is1 = false; - } - else { - while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } - if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } - z.mulTo(r2,g[w],r); - } - - while(j >= 0 && (e[j]&(1< 0) { - x.rShiftTo(g,x); - y.rShiftTo(g,y); - } - while(x.signum() > 0) { - if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); - if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); - if(x.compareTo(y) >= 0) { - x.subTo(y,x); - x.rShiftTo(1,x); - } - else { - y.subTo(x,y); - y.rShiftTo(1,y); - } - } - if(g > 0) y.lShiftTo(g,y); - return y; - } - - // (protected) this % n, n < 2^26 - function bnpModInt(n) { - if(n <= 0) return 0; - var d = this.DV%n, r = (this.s<0)?n-1:0; - if(this.t > 0) - if(d == 0) r = this[0]%n; - else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n; - return r; - } - - // (public) 1/this % m (HAC 14.61) - function bnModInverse(m) { - var ac = m.isEven(); - if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; - var u = m.clone(), v = this.clone(); - var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); - while(u.signum() != 0) { - while(u.isEven()) { - u.rShiftTo(1,u); - if(ac) { - if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } - a.rShiftTo(1,a); - } - else if(!b.isEven()) b.subTo(m,b); - b.rShiftTo(1,b); - } - while(v.isEven()) { - v.rShiftTo(1,v); - if(ac) { - if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } - c.rShiftTo(1,c); - } - else if(!d.isEven()) d.subTo(m,d); - d.rShiftTo(1,d); - } - if(u.compareTo(v) >= 0) { - u.subTo(v,u); - if(ac) a.subTo(c,a); - b.subTo(d,b); - } - else { - v.subTo(u,v); - if(ac) c.subTo(a,c); - d.subTo(b,d); - } - } - if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; - if(d.compareTo(m) >= 0) return d.subtract(m); - if(d.signum() < 0) d.addTo(m,d); else return d; - if(d.signum() < 0) return d.add(m); else return d; - } - - var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]; - var lplim = (1<<26)/lowprimes[lowprimes.length-1]; - - // (public) test primality with certainty >= 1-.5^t - function bnIsProbablePrime(t) { - var i, x = this.abs(); - if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) { - for(i = 0; i < lowprimes.length; ++i) - if(x[0] == lowprimes[i]) return true; - return false; - } - if(x.isEven()) return false; - i = 1; - while(i < lowprimes.length) { - var m = lowprimes[i], j = i+1; - while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; - m = x.modInt(m); - while(i < j) if(m%lowprimes[i++] == 0) return false; - } - return x.millerRabin(t); - } - - // (protected) true if probably prime (HAC 4.24, Miller-Rabin) - function bnpMillerRabin(t) { - var n1 = this.subtract(BigInteger.ONE); - var k = n1.getLowestSetBit(); - if(k <= 0) return false; - var r = n1.shiftRight(k); - t = (t+1)>>1; - if(t > lowprimes.length) t = lowprimes.length; - var a = nbi(); - for(var i = 0; i < t; ++i) { - //Pick bases at random, instead of starting at 2 - a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]); - var y = a.modPow(r,this); - if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { - var j = 1; - while(j++ < k && y.compareTo(n1) != 0) { - y = y.modPowInt(2,this); - if(y.compareTo(BigInteger.ONE) == 0) return false; - } - if(y.compareTo(n1) != 0) return false; - } - } - return true; - } - - // protected - BigInteger.prototype.chunkSize = bnpChunkSize; - BigInteger.prototype.toRadix = bnpToRadix; - BigInteger.prototype.fromRadix = bnpFromRadix; - BigInteger.prototype.fromNumber = bnpFromNumber; - BigInteger.prototype.bitwiseTo = bnpBitwiseTo; - BigInteger.prototype.changeBit = bnpChangeBit; - BigInteger.prototype.addTo = bnpAddTo; - BigInteger.prototype.dMultiply = bnpDMultiply; - BigInteger.prototype.dAddOffset = bnpDAddOffset; - BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; - BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; - BigInteger.prototype.modInt = bnpModInt; - BigInteger.prototype.millerRabin = bnpMillerRabin; - - // public - BigInteger.prototype.clone = bnClone; - BigInteger.prototype.intValue = bnIntValue; - BigInteger.prototype.byteValue = bnByteValue; - BigInteger.prototype.shortValue = bnShortValue; - BigInteger.prototype.signum = bnSigNum; - BigInteger.prototype.toByteArray = bnToByteArray; - BigInteger.prototype.equals = bnEquals; - BigInteger.prototype.min = bnMin; - BigInteger.prototype.max = bnMax; - BigInteger.prototype.and = bnAnd; - BigInteger.prototype.or = bnOr; - BigInteger.prototype.xor = bnXor; - BigInteger.prototype.andNot = bnAndNot; - BigInteger.prototype.not = bnNot; - BigInteger.prototype.shiftLeft = bnShiftLeft; - BigInteger.prototype.shiftRight = bnShiftRight; - BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; - BigInteger.prototype.bitCount = bnBitCount; - BigInteger.prototype.testBit = bnTestBit; - BigInteger.prototype.setBit = bnSetBit; - BigInteger.prototype.clearBit = bnClearBit; - BigInteger.prototype.flipBit = bnFlipBit; - BigInteger.prototype.add = bnAdd; - BigInteger.prototype.subtract = bnSubtract; - BigInteger.prototype.multiply = bnMultiply; - BigInteger.prototype.divide = bnDivide; - BigInteger.prototype.remainder = bnRemainder; - BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; - BigInteger.prototype.modPow = bnModPow; - BigInteger.prototype.modInverse = bnModInverse; - BigInteger.prototype.pow = bnPow; - BigInteger.prototype.gcd = bnGCD; - BigInteger.prototype.isProbablePrime = bnIsProbablePrime; - - // JSBN-specific extension - BigInteger.prototype.square = bnSquare; - - // Expose the Barrett function - BigInteger.prototype.Barrett = Barrett - - // BigInteger interfaces not implemented in jsbn: - - // BigInteger(int signum, byte[] magnitude) - // double doubleValue() - // float floatValue() - // int hashCode() - // long longValue() - // static BigInteger valueOf(long val) - - // Random number generator - requires a PRNG backend, e.g. prng4.js - - // For best results, put code like - // - // in your main HTML document. - - var rng_state; - var rng_pool; - var rng_pptr; - - // Mix in a 32-bit integer into the pool - function rng_seed_int(x) { - rng_pool[rng_pptr++] ^= x & 255; - rng_pool[rng_pptr++] ^= (x >> 8) & 255; - rng_pool[rng_pptr++] ^= (x >> 16) & 255; - rng_pool[rng_pptr++] ^= (x >> 24) & 255; - if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; - } - - // Mix in the current time (w/milliseconds) into the pool - function rng_seed_time() { - rng_seed_int(new Date().getTime()); - } - - // Initialize the pool with junk if needed. - if(rng_pool == null) { - rng_pool = new Array(); - rng_pptr = 0; - var t; - if(typeof window !== "undefined" && window.crypto) { - if (window.crypto.getRandomValues) { - // Use webcrypto if available - var ua = new Uint8Array(32); - window.crypto.getRandomValues(ua); - for(t = 0; t < 32; ++t) - rng_pool[rng_pptr++] = ua[t]; - } - else if(navigator.appName == "Netscape" && navigator.appVersion < "5") { - // Extract entropy (256 bits) from NS4 RNG if available - var z = window.crypto.random(32); - for(t = 0; t < z.length; ++t) - rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; - } - } - while(rng_pptr < rng_psize) { // extract some randomness from Math.random() - t = Math.floor(65536 * Math.random()); - rng_pool[rng_pptr++] = t >>> 8; - rng_pool[rng_pptr++] = t & 255; - } - rng_pptr = 0; - rng_seed_time(); - //rng_seed_int(window.screenX); - //rng_seed_int(window.screenY); - } - - function rng_get_byte() { - if(rng_state == null) { - rng_seed_time(); - rng_state = prng_newstate(); - rng_state.init(rng_pool); - for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) - rng_pool[rng_pptr] = 0; - rng_pptr = 0; - //rng_pool = null; - } - // TODO: allow reseeding after first request - return rng_state.next(); - } - - function rng_get_bytes(ba) { - var i; - for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); - } - - function SecureRandom() {} - - SecureRandom.prototype.nextBytes = rng_get_bytes; - - // prng4.js - uses Arcfour as a PRNG - - function Arcfour() { - this.i = 0; - this.j = 0; - this.S = new Array(); - } - - // Initialize arcfour context from key, an array of ints, each from [0..255] - function ARC4init(key) { - var i, j, t; - for(i = 0; i < 256; ++i) - this.S[i] = i; - j = 0; - for(i = 0; i < 256; ++i) { - j = (j + this.S[i] + key[i % key.length]) & 255; - t = this.S[i]; - this.S[i] = this.S[j]; - this.S[j] = t; - } - this.i = 0; - this.j = 0; - } - - function ARC4next() { - var t; - this.i = (this.i + 1) & 255; - this.j = (this.j + this.S[this.i]) & 255; - t = this.S[this.i]; - this.S[this.i] = this.S[this.j]; - this.S[this.j] = t; - return this.S[(t + this.S[this.i]) & 255]; - } - - Arcfour.prototype.init = ARC4init; - Arcfour.prototype.next = ARC4next; - - // Plug in your RNG constructor here - function prng_newstate() { - return new Arcfour(); - } - - // Pool size must be a multiple of 4 and greater than 32. - // An array of bytes the size of the pool will be passed to init() - var rng_psize = 256; - - BigInteger.SecureRandom = SecureRandom; - BigInteger.BigInteger = BigInteger; - if (true) { - exports = module.exports = BigInteger; - } else { - this.BigInteger = BigInteger; - this.SecureRandom = SecureRandom; - } - -}).call(this); - - -/***/ }), -/* 57 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = __webpack_require__(0) -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __webpack_require__(175) - -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, '\\$&') -} - - -/***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = { - read: read, - write: write -}; - -var assert = __webpack_require__(11); -var asn1 = __webpack_require__(50); -var crypto = __webpack_require__(8); -var algs = __webpack_require__(22); -var utils = __webpack_require__(19); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); - -var pkcs1 = __webpack_require__(228); -var pkcs8 = __webpack_require__(118); -var sshpriv = __webpack_require__(145); -var rfc4253 = __webpack_require__(75); - -var errors = __webpack_require__(45); - -/* - * For reading we support both PKCS#1 and PKCS#8. If we find a private key, - * we just take the public component of it and use that. - */ -function read(buf, options, forceType) { - var input = buf; - if (typeof (buf) !== 'string') { - assert.buffer(buf, 'buf'); - buf = buf.toString('ascii'); - } - - var lines = buf.trim().split('\n'); - - var m = lines[0].match(/*JSSTYLED*/ - /[-]+[ ]*BEGIN ([A-Z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); - assert.ok(m, 'invalid PEM header'); - - var m2 = lines[lines.length - 1].match(/*JSSTYLED*/ - /[-]+[ ]*END ([A-Z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); - assert.ok(m2, 'invalid PEM footer'); - - /* Begin and end banners must match key type */ - assert.equal(m[2], m2[2]); - var type = m[2].toLowerCase(); - - var alg; - if (m[1]) { - /* They also must match algorithms, if given */ - assert.equal(m[1], m2[1], 'PEM header and footer mismatch'); - alg = m[1].trim(); - } - - var headers = {}; - while (true) { - lines = lines.slice(1); - m = lines[0].match(/*JSSTYLED*/ - /^([A-Za-z0-9-]+): (.+)$/); - if (!m) - break; - headers[m[1].toLowerCase()] = m[2]; - } - - var cipher, key, iv; - if (headers['proc-type']) { - var parts = headers['proc-type'].split(','); - if (parts[0] === '4' && parts[1] === 'ENCRYPTED') { - if (typeof (options.passphrase) === 'string') { - options.passphrase = new Buffer( - options.passphrase, 'utf-8'); - } - if (!Buffer.isBuffer(options.passphrase)) { - throw (new errors.KeyEncryptedError( - options.filename, 'PEM')); - } else { - parts = headers['dek-info'].split(','); - assert.ok(parts.length === 2); - cipher = parts[0].toLowerCase(); - iv = new Buffer(parts[1], 'hex'); - key = utils.opensslKeyDeriv(cipher, iv, - options.passphrase, 1).key; - } - } - } - - /* Chop off the first and last lines */ - lines = lines.slice(0, -1).join(''); - buf = new Buffer(lines, 'base64'); - - if (cipher && key && iv) { - var cipherStream = crypto.createDecipheriv(cipher, key, iv); - var chunk, chunks = []; - cipherStream.once('error', function (e) { - if (e.toString().indexOf('bad decrypt') !== -1) { - throw (new Error('Incorrect passphrase ' + - 'supplied, could not decrypt key')); - } - throw (e); - }); - cipherStream.write(buf); - cipherStream.end(); - while ((chunk = cipherStream.read()) !== null) - chunks.push(chunk); - buf = Buffer.concat(chunks); - } - - /* The new OpenSSH internal format abuses PEM headers */ - if (alg && alg.toLowerCase() === 'openssh') - return (sshpriv.readSSHPrivate(type, buf, options)); - if (alg && alg.toLowerCase() === 'ssh2') - return (rfc4253.readType(type, buf, options)); - - var der = new asn1.BerReader(buf); - der.originalInput = input; - - /* - * All of the PEM file types start with a sequence tag, so chop it - * off here - */ - der.readSequence(); - - /* PKCS#1 type keys name an algorithm in the banner explicitly */ - if (alg) { - if (forceType) - assert.strictEqual(forceType, 'pkcs1'); - return (pkcs1.readPkcs1(alg, type, der)); - } else { - if (forceType) - assert.strictEqual(forceType, 'pkcs8'); - return (pkcs8.readPkcs8(alg, type, der)); - } -} - -function write(key, options, type) { - assert.object(key); - - var alg = {'ecdsa': 'EC', 'rsa': 'RSA', 'dsa': 'DSA'}[key.type]; - var header; - - var der = new asn1.BerWriter(); - - if (PrivateKey.isPrivateKey(key)) { - if (type && type === 'pkcs8') { - header = 'PRIVATE KEY'; - pkcs8.writePkcs8(der, key); - } else { - if (type) - assert.strictEqual(type, 'pkcs1'); - header = alg + ' PRIVATE KEY'; - pkcs1.writePkcs1(der, key); - } - - } else if (Key.isKey(key)) { - if (type && type === 'pkcs1') { - header = alg + ' PUBLIC KEY'; - pkcs1.writePkcs1(der, key); - } else { - if (type) - assert.strictEqual(type, 'pkcs8'); - header = 'PUBLIC KEY'; - pkcs8.writePkcs8(der, key); - } - - } else { - throw (new Error('key is not a Key or PrivateKey')); - } - - var tmp = der.buffer.toString('base64'); - var len = tmp.length + (tmp.length / 64) + - 18 + 16 + header.length*2 + 10; - var buf = new Buffer(len); - var o = 0; - o += buf.write('-----BEGIN ' + header + '-----\n', o); - for (var i = 0; i < tmp.length; ) { - var limit = i + 64; - if (limit > tmp.length) - limit = tmp.length; - o += buf.write(tmp.slice(i, limit), o); - buf[o++] = 10; - i = limit; - } - o += buf.write('-----END ' + header + '-----\n', o); - - return (buf.slice(0, o)); -} - - -/***/ }), -/* 59 */ -/***/ (function(module, exports) { - -module.exports = require("net"); - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - - -module.exports = { - copy: copy, - checkDataType: checkDataType, - checkDataTypes: checkDataTypes, - coerceToTypes: coerceToTypes, - toHash: toHash, - getProperty: getProperty, - escapeQuotes: escapeQuotes, - ucs2length: __webpack_require__(349), - varOccurences: varOccurences, - varReplace: varReplace, - cleanUpCode: cleanUpCode, - cleanUpVarErrors: cleanUpVarErrors, - schemaHasRules: schemaHasRules, - schemaHasRulesExcept: schemaHasRulesExcept, - stableStringify: __webpack_require__(221), - toQuotedString: toQuotedString, - getPathExpr: getPathExpr, - getPath: getPath, - getData: getData, - unescapeFragment: unescapeFragment, - escapeFragment: escapeFragment, - escapeJsonPointer: escapeJsonPointer -}; - - -function copy(o, to) { - to = to || {}; - for (var key in o) to[key] = o[key]; - return to; -} - - -function checkDataType(dataType, data, negate) { - var EQUAL = negate ? ' !== ' : ' === ' - , AND = negate ? ' || ' : ' && ' - , OK = negate ? '!' : '' - , NOT = negate ? '' : '!'; - switch (dataType) { - case 'null': return data + EQUAL + 'null'; - case 'array': return OK + 'Array.isArray(' + data + ')'; - case 'object': return '(' + OK + data + AND + - 'typeof ' + data + EQUAL + '"object"' + AND + - NOT + 'Array.isArray(' + data + '))'; - case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + - NOT + '(' + data + ' % 1)' + - AND + data + EQUAL + data + ')'; - default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; - } -} - - -function checkDataTypes(dataTypes, data) { - switch (dataTypes.length) { - case 1: return checkDataType(dataTypes[0], data, true); - default: - var code = ''; - var types = toHash(dataTypes); - if (types.array && types.object) { - code = types.null ? '(': '(!' + data + ' || '; - code += 'typeof ' + data + ' !== "object")'; - delete types.null; - delete types.array; - delete types.object; - } - if (types.number) delete types.integer; - for (var t in types) - code += (code ? ' && ' : '' ) + checkDataType(t, data, true); - - return code; - } -} - - -var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); -function coerceToTypes(optionCoerceTypes, dataTypes) { - if (Array.isArray(dataTypes)) { - var types = []; - for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); - return paths[lvl - up]; - } - - if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); - data = 'data' + ((lvl - up) || ''); - if (!jsonPointer) return data; - } - - var expr = data; - var segments = jsonPointer.split('/'); - for (var i=0; i 0 ? floor : ceil)(it); -}; - -/***/ }), -/* 70 */ -/***/ (function(module, exports, __webpack_require__) { - -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = __webpack_require__(127) - , defined = __webpack_require__(64); -module.exports = function(it){ - return IObject(defined(it)); -}; - -/***/ }), -/* 71 */ -/***/ (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__(5) -var rp = __webpack_require__(112) -var minimatch = __webpack_require__(57) -var Minimatch = minimatch.Minimatch -var inherits = __webpack_require__(39) -var EE = __webpack_require__(47).EventEmitter -var path = __webpack_require__(0) -var assert = __webpack_require__(20) -var isAbsolute = __webpack_require__(73) -var globSync = __webpack_require__(211) -var common = __webpack_require__(113) -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = __webpack_require__(213) -var util = __webpack_require__(2) -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = __webpack_require__(72) - -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) -} - - -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { - -var wrappy = __webpack_require__(90) -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 -} - - -/***/ }), -/* 73 */ -/***/ (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; - - -/***/ }), -/* 74 */ -/***/ (function(module, exports, __webpack_require__) { - -var Stream = __webpack_require__(25); -if (process.env.READABLE_STREAM === 'disable' && Stream) { - module.exports = Stream; - exports = module.exports = Stream.Readable; - exports.Readable = Stream.Readable; - exports.Writable = Stream.Writable; - exports.Duplex = Stream.Duplex; - exports.Transform = Stream.Transform; - exports.PassThrough = Stream.PassThrough; - exports.Stream = Stream; -} else { - exports = module.exports = __webpack_require__(308); - exports.Stream = Stream || exports; - exports.Readable = exports; - exports.Writable = __webpack_require__(310); - exports.Duplex = __webpack_require__(87); - exports.Transform = __webpack_require__(309); - exports.PassThrough = __webpack_require__(612); -} - - -/***/ }), -/* 75 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = { - read: read.bind(undefined, false, undefined), - readType: read.bind(undefined, false), - write: write, - /* semi-private api, used by sshpk-agent */ - readPartial: read.bind(undefined, true), - - /* shared with ssh format */ - readInternal: read, - keyTypeToAlg: keyTypeToAlg, - algToKeyType: algToKeyType -}; - -var assert = __webpack_require__(11); -var algs = __webpack_require__(22); -var utils = __webpack_require__(19); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); -var SSHBuffer = __webpack_require__(146); - -function algToKeyType(alg) { - assert.string(alg); - if (alg === 'ssh-dss') - return ('dsa'); - else if (alg === 'ssh-rsa') - return ('rsa'); - else if (alg === 'ssh-ed25519') - return ('ed25519'); - else if (alg === 'ssh-curve25519') - return ('curve25519'); - else if (alg.match(/^ecdsa-sha2-/)) - return ('ecdsa'); - else - throw (new Error('Unknown algorithm ' + alg)); -} - -function keyTypeToAlg(key) { - assert.object(key); - if (key.type === 'dsa') - return ('ssh-dss'); - else if (key.type === 'rsa') - return ('ssh-rsa'); - else if (key.type === 'ed25519') - return ('ssh-ed25519'); - else if (key.type === 'curve25519') - return ('ssh-curve25519'); - else if (key.type === 'ecdsa') - return ('ecdsa-sha2-' + key.part.curve.data.toString()); - else - throw (new Error('Unknown key type ' + key.type)); -} - -function read(partial, type, buf, options) { - if (typeof (buf) === 'string') - buf = new Buffer(buf); - assert.buffer(buf, 'buf'); - - var key = {}; - - var parts = key.parts = []; - var sshbuf = new SSHBuffer({buffer: buf}); - - var alg = sshbuf.readString(); - assert.ok(!sshbuf.atEnd(), 'key must have at least one part'); - - key.type = algToKeyType(alg); - - var partCount = algs.info[key.type].parts.length; - if (type && type === 'private') - partCount = algs.privInfo[key.type].parts.length; - - while (!sshbuf.atEnd() && parts.length < partCount) - parts.push(sshbuf.readPart()); - while (!partial && !sshbuf.atEnd()) - parts.push(sshbuf.readPart()); - - assert.ok(parts.length >= 1, - 'key must have at least one part'); - assert.ok(partial || sshbuf.atEnd(), - 'leftover bytes at end of key'); - - var Constructor = Key; - var algInfo = algs.info[key.type]; - if (type === 'private' || algInfo.parts.length !== parts.length) { - algInfo = algs.privInfo[key.type]; - Constructor = PrivateKey; - } - assert.strictEqual(algInfo.parts.length, parts.length); - - if (key.type === 'ecdsa') { - var res = /^ecdsa-sha2-(.+)$/.exec(alg); - assert.ok(res !== null); - assert.strictEqual(res[1], parts[0].data.toString()); - } - - var normalized = true; - for (var i = 0; i < algInfo.parts.length; ++i) { - parts[i].name = algInfo.parts[i]; - if (parts[i].name !== 'curve' && - algInfo.normalize !== false) { - var p = parts[i]; - var nd = utils.mpNormalize(p.data); - if (nd !== p.data) { - p.data = nd; - normalized = false; - } - } - } - - if (normalized) - key._rfc4253Cache = sshbuf.toBuffer(); - - if (partial && typeof (partial) === 'object') { - partial.remainder = sshbuf.remainder(); - partial.consumed = sshbuf._offset; - } - - return (new Constructor(key)); -} - -function write(key, options) { - assert.object(key); - - var alg = keyTypeToAlg(key); - var i; - - var algInfo = algs.info[key.type]; - if (PrivateKey.isPrivateKey(key)) - algInfo = algs.privInfo[key.type]; - var parts = algInfo.parts; - - var buf = new SSHBuffer({}); - - buf.writeString(alg); - - for (i = 0; i < parts.length; ++i) { - var data = key.part[parts[i]].data; - if (algInfo.normalize !== false) - data = utils.mpNormalize(data); - buf.writeBuffer(data); - } - - return (buf.toBuffer()); -} - - /***/ }), /* 76 */ -/***/ (function(module, exports) { - -module.exports = require("tty"); - -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (str) { - let fileLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'lockfile'; - - str = (0, (_stripBom || _load_stripBom()).default)(str); - return hasMergeConflicts(str) ? parseWithConflict(str, fileLoc) : { type: 'success', object: parse(str, fileLoc) }; -}; - -var _util; - -function _load_util() { - return _util = _interopRequireDefault(__webpack_require__(2)); -} - -var _invariant; - -function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(6)); -} - -var _stripBom; - -function _load_stripBom() { - return _stripBom = _interopRequireDefault(__webpack_require__(120)); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(7); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(18)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* eslint quotes: 0 */ - -const VERSION_REGEX = /^yarn lockfile v(\d+)$/; - -const TOKEN_TYPES = { - boolean: 'BOOLEAN', - string: 'STRING', - identifier: 'IDENTIFIER', - eof: 'EOF', - colon: 'COLON', - newline: 'NEWLINE', - comment: 'COMMENT', - indent: 'INDENT', - invalid: 'INVALID', - number: 'NUMBER', - comma: 'COMMA' -}; - -const VALID_PROP_VALUE_TOKENS = [TOKEN_TYPES.boolean, TOKEN_TYPES.string, TOKEN_TYPES.number]; - -function isValidPropValueToken(token) { - return VALID_PROP_VALUE_TOKENS.indexOf(token.type) >= 0; -} - -function* tokenise(input) { - let lastNewline = false; - let line = 1; - let col = 0; - - function buildToken(type, value) { - return { line, col, type, value }; - } - - while (input.length) { - let chop = 0; - - if (input[0] === '\n' || input[0] === '\r') { - chop++; - // If this is a \r\n line, ignore both chars but only add one new line - if (input[1] === '\n') { - chop++; - } - line++; - col = 0; - yield buildToken(TOKEN_TYPES.newline); - } else if (input[0] === '#') { - chop++; - - let val = ''; - while (input[chop] !== '\n') { - val += input[chop]; - chop++; - } - yield buildToken(TOKEN_TYPES.comment, val); - } else if (input[0] === ' ') { - if (lastNewline) { - let indent = ''; - for (let i = 0; input[i] === ' '; i++) { - indent += input[i]; - } - - if (indent.length % 2) { - throw new TypeError('Invalid number of spaces'); - } else { - chop = indent.length; - yield buildToken(TOKEN_TYPES.indent, indent.length / 2); - } - } else { - chop++; - } - } else if (input[0] === '"') { - let val = ''; - - for (let i = 0;; i++) { - const currentChar = input[i]; - val += currentChar; - - if (i > 0 && currentChar === '"') { - const isEscaped = input[i - 1] === '\\' && input[i - 2] !== '\\'; - if (!isEscaped) { - break; - } - } - } - - chop = val.length; - - try { - yield buildToken(TOKEN_TYPES.string, JSON.parse(val)); - } catch (err) { - if (err instanceof SyntaxError) { - yield buildToken(TOKEN_TYPES.invalid); - } else { - throw err; - } - } - } else if (/^[0-9]/.test(input)) { - let val = ''; - for (let i = 0; /^[0-9]$/.test(input[i]); i++) { - val += input[i]; - } - chop = val.length; - - yield buildToken(TOKEN_TYPES.number, +val); - } else if (/^true/.test(input)) { - yield buildToken(TOKEN_TYPES.boolean, true); - chop = 4; - } else if (/^false/.test(input)) { - yield buildToken(TOKEN_TYPES.boolean, false); - chop = 5; - } else if (input[0] === ':') { - yield buildToken(TOKEN_TYPES.colon); - chop++; - } else if (input[0] === ',') { - yield buildToken(TOKEN_TYPES.comma); - chop++; - } else if (/^[a-zA-Z\/-]/g.test(input)) { - let name = ''; - for (let i = 0; i < input.length; i++) { - const char = input[i]; - if (char === ':' || char === ' ' || char === '\n' || char === '\r' || char === ',') { - break; - } else { - name += char; - } - } - chop = name.length; - - yield buildToken(TOKEN_TYPES.string, name); - } else { - yield buildToken(TOKEN_TYPES.invalid); - } - - if (!chop) { - // will trigger infinite recursion - yield buildToken(TOKEN_TYPES.invalid); - } - - col += chop; - lastNewline = input[0] === '\n' || input[0] === '\r' && input[1] === '\n'; - input = input.slice(chop); - } - - yield buildToken(TOKEN_TYPES.eof); -} - -class Parser { - constructor(input) { - let fileLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'lockfile'; - - this.comments = []; - this.tokens = tokenise(input); - this.fileLoc = fileLoc; - } - - onComment(token) { - const value = token.value; - (0, (_invariant || _load_invariant()).default)(typeof value === 'string', 'expected token value to be a string'); - - const comment = value.trim(); - - const versionMatch = comment.match(VERSION_REGEX); - if (versionMatch) { - const version = +versionMatch[1]; - if (version > (_constants || _load_constants()).LOCKFILE_VERSION) { - throw new (_errors || _load_errors()).MessageError(`Can't install from a lockfile of version ${version} as you're on an old yarn version that only supports ` + `versions up to ${(_constants || _load_constants()).LOCKFILE_VERSION}. Run \`$ yarn self-update\` to upgrade to the latest version.`); - } - } - - this.comments.push(comment); - } - - next() { - const item = this.tokens.next(); - (0, (_invariant || _load_invariant()).default)(item, 'expected a token'); - - const done = item.done, - value = item.value; - - if (done || !value) { - throw new Error('No more tokens'); - } else if (value.type === TOKEN_TYPES.comment) { - this.onComment(value); - return this.next(); - } else { - return this.token = value; - } - } - - unexpected() { - let msg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Unexpected token'; - - throw new SyntaxError(`${msg} ${this.token.line}:${this.token.col} in ${this.fileLoc}`); - } - - expect(tokType) { - if (this.token.type === tokType) { - this.next(); - } else { - this.unexpected(); - } - } - - eat(tokType) { - if (this.token.type === tokType) { - this.next(); - return true; - } else { - return false; - } - } - - parse() { - let indent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - - const obj = (0, (_map || _load_map()).default)(); - - while (true) { - const propToken = this.token; - - if (propToken.type === TOKEN_TYPES.newline) { - const nextToken = this.next(); - if (!indent) { - // if we have 0 indentation then the next token doesn't matter - continue; - } - - if (nextToken.type !== TOKEN_TYPES.indent) { - // if we have no indentation after a newline then we've gone down a level - break; - } - - if (nextToken.value === indent) { - // all is good, the indent is on our level - this.next(); - } else { - // the indentation is less than our level - break; - } - } else if (propToken.type === TOKEN_TYPES.indent) { - if (propToken.value === indent) { - this.next(); - } else { - break; - } - } else if (propToken.type === TOKEN_TYPES.eof) { - break; - } else if (propToken.type === TOKEN_TYPES.string) { - // property key - const key = propToken.value; - (0, (_invariant || _load_invariant()).default)(key, 'Expected a key'); - - const keys = [key]; - this.next(); - - // support multiple keys - while (this.token.type === TOKEN_TYPES.comma) { - this.next(); // skip comma - - const keyToken = this.token; - if (keyToken.type !== TOKEN_TYPES.string) { - this.unexpected('Expected string'); - } - - const key = keyToken.value; - (0, (_invariant || _load_invariant()).default)(key, 'Expected a key'); - keys.push(key); - this.next(); - } - - const valToken = this.token; - - if (valToken.type === TOKEN_TYPES.colon) { - // object - this.next(); - - // parse object - const val = this.parse(indent + 1); - - for (const key of keys) { - obj[key] = val; - } - - if (indent && this.token.type !== TOKEN_TYPES.indent) { - break; - } - } else if (isValidPropValueToken(valToken)) { - // plain value - for (const key of keys) { - obj[key] = valToken.value; - } - - this.next(); - } else { - this.unexpected('Invalid value type'); - } - } else { - this.unexpected(`Unknown token: ${(_util || _load_util()).default.inspect(propToken)}`); - } - } - - return obj; - } -} - -const MERGE_CONFLICT_ANCESTOR = '|||||||'; -const MERGE_CONFLICT_END = '>>>>>>>'; -const MERGE_CONFLICT_SEP = '======='; -const MERGE_CONFLICT_START = '<<<<<<<'; - -/** - * Extract the two versions of the lockfile from a merge conflict. - */ -function extractConflictVariants(str) { - const variants = [[], []]; - const lines = str.split(/\r?\n/g); - let skip = false; - - while (lines.length) { - const line = lines.shift(); - if (line.startsWith(MERGE_CONFLICT_START)) { - // get the first variant - while (lines.length) { - const conflictLine = lines.shift(); - if (conflictLine === MERGE_CONFLICT_SEP) { - skip = false; - break; - } else if (skip || conflictLine.startsWith(MERGE_CONFLICT_ANCESTOR)) { - skip = true; - continue; - } else { - variants[0].push(conflictLine); - } - } - - // get the second variant - while (lines.length) { - const conflictLine = lines.shift(); - if (conflictLine.startsWith(MERGE_CONFLICT_END)) { - break; - } else { - variants[1].push(conflictLine); - } - } - } else { - variants[0].push(line); - variants[1].push(line); - } - } - - return [variants[0].join('\n'), variants[1].join('\n')]; -} - -/** - * Check if a lockfile has merge conflicts. - */ -function hasMergeConflicts(str) { - return str.includes(MERGE_CONFLICT_START) && str.includes(MERGE_CONFLICT_SEP) && str.includes(MERGE_CONFLICT_END); -} - -/** - * Parse the lockfile. - */ -function parse(str, fileLoc) { - const parser = new Parser(str, fileLoc); - parser.next(); - return parser.parse(); -} - -/** - * Parse and merge the two variants in a conflicted lockfile. - */ -function parseWithConflict(str, fileLoc) { - const variants = extractConflictVariants(str); - try { - return { type: 'merge', object: Object.assign({}, parse(variants[0], fileLoc), parse(variants[1], fileLoc)) }; - } catch (err) { - if (err instanceof SyntaxError) { - return { type: 'conflict', object: {} }; - } else { - throw err; - } - } -} - -/***/ }), -/* 78 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); -} - -exports.stringifyLangArgs = stringifyLangArgs; - -var _format; - -function _load_format() { - return _format = __webpack_require__(268); -} - -var _index; - -function _load_index() { - return _index = _interopRequireWildcard(__webpack_require__(269)); -} - -var _isCi; - -function _load_isCi() { - return _isCi = _interopRequireDefault(__webpack_require__(217)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* eslint no-unused-vars: 0 */ - -const util = __webpack_require__(2); -const EventEmitter = __webpack_require__(47).EventEmitter; - -function stringifyLangArgs(args) { - return args.map(function (val) { - if (val != null && val.inspect) { - return val.inspect(); - } else { - try { - const str = JSON.stringify(val) || val + ''; - // should match all "u001b" that follow an odd number of backslashes and convert them to ESC - // we do this because the JSON.stringify process has escaped these characters - return str.replace(/((?:^|[^\\])(?:\\{2})*)\\u001[bB]/g, '$1\u001b'); - } catch (e) { - return util.inspect(val); - } - } - }); -} - -class BaseReporter { - constructor() { - let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - const lang = 'en'; - this.language = lang; - - this.stdout = opts.stdout || process.stdout; - this.stderr = opts.stderr || process.stderr; - this.stdin = opts.stdin || this._getStandardInput(); - this.emoji = !!opts.emoji; - this.noProgress = !!opts.noProgress || (_isCi || _load_isCi()).default; - this.isVerbose = !!opts.verbose; - - // $FlowFixMe: this is valid! - this.isTTY = this.stdout.isTTY; - - this.peakMemory = 0; - this.startTime = Date.now(); - this.format = (_format || _load_format()).defaultFormatter; - } - - lang(key) { - const msg = (_index || _load_index())[this.language][key] || (_index || _load_index()).en[key]; - if (!msg) { - throw new ReferenceError(`Unknown language key ${key}`); - } - - // stringify args - - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - const stringifiedArgs = stringifyLangArgs(args); - - // replace $0 placeholders with args - return msg.replace(/\$(\d+)/g, (str, i) => { - return stringifiedArgs[i]; - }); - } - - /** - * `stringifyLangArgs` run `JSON.stringify` on strings too causing - * them to appear quoted. This marks them as "raw" and prevents - * the quiating and escaping - */ - rawText(str) { - return { - inspect() { - return str; - } - }; - } - - verbose(msg) { - if (this.isVerbose) { - this._verbose(msg); - } - } - - verboseInspect(val) { - if (this.isVerbose) { - this._verboseInspect(val); - } - } - - _verbose(msg) {} - _verboseInspect(val) {} - - _getStandardInput() { - let standardInput; - - // Accessing stdin in a win32 headless process (e.g., Visual Studio) may throw an exception. - try { - standardInput = process.stdin; - } catch (e) { - console.warn(e.message); - delete process.stdin; - // $FlowFixMe: this is valid! - process.stdin = new EventEmitter(); - standardInput = process.stdin; - } - - return standardInput; - } - - initPeakMemoryCounter() { - this.checkPeakMemory(); - this.peakMemoryInterval = setInterval(() => { - this.checkPeakMemory(); - }, 1000); - // $FlowFixMe: Node's setInterval returns a Timeout, not a Number - this.peakMemoryInterval.unref(); - } - - checkPeakMemory() { - var _process$memoryUsage = process.memoryUsage(); - - const heapTotal = _process$memoryUsage.heapTotal; - - if (heapTotal > this.peakMemory) { - this.peakMemory = heapTotal; - } - } - - close() { - if (this.peakMemoryInterval) { - clearInterval(this.peakMemoryInterval); - this.peakMemoryInterval = null; - } - } - - getTotalTime() { - return Date.now() - this.startTime; - } - - // TODO - list(key, items, hints) {} - - // Outputs basic tree structure to console - tree(key, obj) {} - - // called whenever we begin a step in the CLI. - step(current, total, message, emoji) {} - - // a error message has been triggered. this however does not always meant an abrupt - // program end. - error(message) {} - - // an info message has been triggered. this provides things like stats and diagnostics. - info(message) {} - - // a warning message has been triggered. - warn(message) {} - - // a success message has been triggered. - success(message) {} - - // a simple log message - // TODO: rethink the {force} parameter. In the meantime, please don't use it (cf comments in #4143). - log(message) { - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$force = _ref.force; - - let force = _ref$force === undefined ? false : _ref$force; - } - - // a shell command has been executed - command(command) {} - - // inspect and pretty-print any value - inspect(value) {} - - // the screen shown at the very start of the CLI - header(command, pkg) {} - - // the screen shown at the very end of the CLI - footer(showPeakMemory) {} - - // - table(head, body) {} - - // render an activity spinner and return a function that will trigger an update - activity() { - return { - tick(name) {}, - end() {} - }; - } - - // - activitySet(total, workers) { - return { - spinners: Array(workers).fill({ - clear() {}, - setPrefix() {}, - tick() {}, - end() {} - }), - end() {} - }; - } - - // - question(question) { - let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - return Promise.reject(new Error('Not implemented')); - } - - // - questionAffirm(question) { - var _this = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const condition = true; // trick eslint - - while (condition) { - let answer = yield _this.question(question); - answer = answer.toLowerCase(); - - if (answer === 'y' || answer === 'yes') { - return true; - } - if (answer === 'n' || answer === 'no') { - return false; - } - - _this.error('Invalid answer for question'); - } - - return false; - })(); - } - - // prompt the user to select an option from an array - select(header, question, options) { - return Promise.reject(new Error('Not implemented')); - } - - // render a progress bar and return a function which when called will trigger an update - progress(total) { - return function () {}; - } - - // utility function to disable progress bar - disableProgress() { - this.noProgress = true; - } - - // - prompt(message, choices) { - let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - return Promise.reject(new Error('Not implemented')); - } -} -exports.default = BaseReporter; - -/***/ }), -/* 79 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); -} - -exports.explodeHostedGitFragment = explodeHostedGitFragment; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(35); -} - -var _gitResolver; - -function _load_gitResolver() { - return _gitResolver = _interopRequireDefault(__webpack_require__(96)); -} - -var _exoticResolver; - -function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(61)); -} - -var _git; - -function _load_git() { - return _git = _interopRequireDefault(__webpack_require__(167)); -} - -var _guessName; - -function _load_guessName() { - return _guessName = _interopRequireDefault(__webpack_require__(168)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function explodeHostedGitFragment(fragment, reporter) { - const preParts = fragment.split('@'); - if (preParts.length > 2) { - fragment = preParts[1] + '@' + preParts[2]; - } - - const parts = fragment.split(':'); - - if (parts.length == 3) { - // protocol + host + folder - parts[1] = parts[1].indexOf('//') >= 0 ? parts[1].substr(2) : parts[1]; - fragment = parts[1] + '/' + parts[2]; - } else if (parts.length == 2) { - if (parts[0].indexOf('@') == -1) { - // protocol + host - fragment = parts[1]; - } else { - // host + folder - fragment = parts[0] + '/' + parts[1]; - } - } else if (parts.length == 1) { - fragment = parts[0]; - } else { - throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidHostedGitFragment', fragment)); - } - - const userParts = fragment.split('/'); - - if (userParts.length >= 2) { - if (userParts[0].indexOf('@') >= 0) { - userParts.shift(); - } - - const user = userParts.shift(); - const repoParts = userParts.join('/').split(/(?:[.]git)?#(.*)/); - - if (repoParts.length <= 3) { - return { - user, - repo: repoParts[0].replace('.git', ''), - hash: repoParts[1] || '' - }; - } - } - - throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidHostedGitFragment', fragment)); -} - -class HostedGitResolver extends (_exoticResolver || _load_exoticResolver()).default { - constructor(request, fragment) { - super(request, fragment); - - const exploded = this.exploded = explodeHostedGitFragment(fragment, this.reporter); - const user = exploded.user, - repo = exploded.repo, - hash = exploded.hash; - - this.user = user; - this.repo = repo; - this.hash = hash; - } - - static getTarballUrl(exploded, commit) { - exploded; - commit; - throw new Error('Not implemented'); - } - - static getGitHTTPUrl(exploded) { - exploded; - throw new Error('Not implemented'); - } - - static getGitHTTPBaseUrl(exploded) { - exploded; - throw new Error('Not implemented'); - } - - static getGitSSHUrl(exploded) { - exploded; - throw new Error('Not implemented'); - } - - static getHTTPFileUrl(exploded, filename, commit) { - exploded; - filename; - commit; - throw new Error('Not implemented'); - } - - getRefOverHTTP(url) { - var _this = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url); - const client = new (_git || _load_git()).default(_this.config, gitUrl, _this.hash); - - let out = yield _this.config.requestManager.request({ - url: `${url}/info/refs?service=git-upload-pack`, - queue: _this.resolver.fetchingQueue - }); - - if (out) { - // clean up output - let lines = out.trim().split('\n'); - - // remove first two lines which contains compatibility info etc - lines = lines.slice(2); - - // remove last line which contains the terminator "0000" - lines.pop(); - - // remove line lengths from start of each line - lines = lines.map(function (line) { - return line.slice(4); - }); - - out = lines.join('\n'); - } else { - throw new Error(_this.reporter.lang('hostedGitResolveError')); - } - - return client.setRefHosted(out); - })(); - } - - resolveOverHTTP(url) { - var _this2 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const commit = yield _this2.getRefOverHTTP(url); - const config = _this2.config; - - - const tarballUrl = _this2.constructor.getTarballUrl(_this2.exploded, commit); - - const tryRegistry = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) { - const filename = (_index || _load_index()).registries[registry].filename; - - const href = _this2.constructor.getHTTPFileUrl(_this2.exploded, filename, commit); - const file = yield config.requestManager.request({ - url: href, - queue: _this2.resolver.fetchingQueue - }); - if (!file) { - return null; - } - - const json = yield config.readJson(href, function () { - return JSON.parse(file); - }); - json._uid = commit; - json._remote = { - resolved: tarballUrl, - type: 'tarball', - reference: tarballUrl, - registry - }; - return json; - }); - - return function tryRegistry(_x) { - return _ref.apply(this, arguments); - }; - })(); - - const file = yield tryRegistry(_this2.registry); - if (file) { - return file; - } - - for (const registry in (_index || _load_index()).registries) { - if (registry === _this2.registry) { - continue; - } - - const file = yield tryRegistry(registry); - if (file) { - return file; - } - } - - return { - name: (0, (_guessName || _load_guessName()).default)(url), - version: '0.0.0', - _uid: commit, - _remote: { - resolved: tarballUrl, - type: 'tarball', - reference: tarballUrl, - registry: 'npm', - hash: undefined - } - }; - })(); - } - - hasHTTPCapability(url) { - var _this3 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - return (yield _this3.config.requestManager.request({ - url, - method: 'HEAD', - queue: _this3.resolver.fetchingQueue, - followRedirect: false - })) !== false; - })(); - } - - resolve() { - var _this4 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // If we already have the tarball, just return it without having to make any HTTP requests. - const shrunk = _this4.request.getLocked('tarball'); - if (shrunk) { - return shrunk; - } - - const httpUrl = _this4.constructor.getGitHTTPUrl(_this4.exploded); - const httpBaseUrl = _this4.constructor.getGitHTTPBaseUrl(_this4.exploded); - const sshUrl = _this4.constructor.getGitSSHUrl(_this4.exploded); - - // If we can access the files over HTTP then we should as it's MUCH faster than git - // archive and tarball unarchiving. The HTTP API is only available for public repos - // though. - if (yield _this4.hasHTTPCapability(httpBaseUrl)) { - return _this4.resolveOverHTTP(httpUrl); - } - - // If the url is accessible over git archive then we should immediately delegate to - // the git resolver. - // - // NOTE: Here we use a different url than when we delegate to the git resolver later on. - // This is because `git archive` requires access over ssh and github only allows that - // if you have write permissions - const sshGitUrl = (_git || _load_git()).default.npmUrlToGitUrl(sshUrl); - if (yield (_git || _load_git()).default.hasArchiveCapability(sshGitUrl)) { - const archiveClient = new (_git || _load_git()).default(_this4.config, sshGitUrl, _this4.hash); - const commit = yield archiveClient.init(); - return _this4.fork((_gitResolver || _load_gitResolver()).default, true, `${sshUrl}#${commit}`); - } - - // fallback to the plain git resolver - return _this4.fork((_gitResolver || _load_gitResolver()).default, true, sshUrl); - })(); - } -} -exports.default = HostedGitResolver; - -/***/ }), -/* 80 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _map; - -function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(18)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const debug = __webpack_require__(205)('yarn'); - -class BlockingQueue { - constructor(alias) { - let maxConcurrency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity; - - this.concurrencyQueue = []; - this.maxConcurrency = maxConcurrency; - this.runningCount = 0; - this.warnedStuck = false; - this.alias = alias; - this.first = true; - - this.running = (0, (_map || _load_map()).default)(); - this.queue = (0, (_map || _load_map()).default)(); - - this.stuckTick = this.stuckTick.bind(this); - } - - stillActive() { - if (this.stuckTimer) { - clearTimeout(this.stuckTimer); - } - - this.stuckTimer = setTimeout(this.stuckTick, 5000); - - // We need to check the existense of unref because of https://github.com/facebook/jest/issues/4559 - // $FlowFixMe: Node's setInterval returns a Timeout, not a Number - this.stuckTimer.unref && this.stuckTimer.unref(); - } - - stuckTick() { - if (this.runningCount === 1) { - this.warnedStuck = true; - debug(`The ${JSON.stringify(this.alias)} blocking queue may be stuck. 5 seconds ` + `without any activity with 1 worker: ${Object.keys(this.running)[0]}`); - } - } - - push(key, factory) { - if (this.first) { - this.first = false; - } else { - this.stillActive(); - } - - return new Promise((resolve, reject) => { - // we're already running so push ourselves to the queue - const queue = this.queue[key] = this.queue[key] || []; - queue.push({ factory, resolve, reject }); - - if (!this.running[key]) { - this.shift(key); - } - }); - } - - shift(key) { - if (this.running[key]) { - delete this.running[key]; - this.runningCount--; - clearTimeout(this.stuckTimer); - - if (this.warnedStuck) { - this.warnedStuck = false; - debug(`${JSON.stringify(this.alias)} blocking queue finally resolved. Nothing to worry about.`); - } - } - - const queue = this.queue[key]; - if (!queue) { - return; - } - - var _queue$shift = queue.shift(); - - const resolve = _queue$shift.resolve, - reject = _queue$shift.reject, - factory = _queue$shift.factory; - - if (!queue.length) { - delete this.queue[key]; - } - - const next = () => { - this.shift(key); - this.shiftConcurrencyQueue(); - }; - - const run = () => { - this.running[key] = true; - this.runningCount++; - - factory().then(function (val) { - resolve(val); - next(); - return null; - }).catch(function (err) { - reject(err); - next(); - }); - }; - - this.maybePushConcurrencyQueue(run); - } - - maybePushConcurrencyQueue(run) { - if (this.runningCount < this.maxConcurrency) { - run(); - } else { - this.concurrencyQueue.push(run); - } - } - - shiftConcurrencyQueue() { - if (this.runningCount < this.maxConcurrency) { - const fn = this.concurrencyQueue.shift(); - if (fn) { - fn(); - } - } - } -} -exports.default = BlockingQueue; - -/***/ }), -/* 81 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _normalizePattern2; - -function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(31); -} - -const semver = __webpack_require__(17); - -class WorkspaceLayout { - constructor(workspaces, config) { - this.workspaces = workspaces; - this.config = config; - } - - getWorkspaceManifest(key) { - return this.workspaces[key]; - } - - getManifestByPattern(pattern) { - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern); - - const name = _normalizePattern.name, - range = _normalizePattern.range; - - const workspace = this.getWorkspaceManifest(name); - if (!workspace || !semver.satisfies(workspace.manifest.version, range, this.config.looseSemver)) { - return null; - } - return workspace; - } -} -exports.default = WorkspaceLayout; - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -// getting tag from 19.1.3.6 Object.prototype.toString() -var cof = __webpack_require__(42) - , TAG = __webpack_require__(9)('toStringTag') - // ES3 wrong here - , ARG = cof(function(){ return arguments; }()) == 'Arguments'; - -// fallback for IE11 Script Access Denied error -var tryGet = function(it, key){ - try { - return it[key]; - } catch(e){ /* empty */ } -}; - -module.exports = function(it){ - var O, T, B; - return it === undefined ? 'Undefined' : it === null ? 'Null' - // @@toStringTag case - : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T - // builtinTag case - : ARG ? cof(O) - // ES3 arguments fallback - : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; -}; - -/***/ }), -/* 83 */ -/***/ (function(module, exports) { - -module.exports = function(exec){ - try { - return !!exec(); - } catch(e){ - return true; - } -}; - -/***/ }), -/* 84 */ -/***/ (function(module, exports) { - -module.exports = function(bitmap, value){ - return { - enumerable : !(bitmap & 1), - configurable: !(bitmap & 2), - writable : !(bitmap & 4), - value : value - }; -}; - -/***/ }), -/* 85 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.15 ToLength -var toInteger = __webpack_require__(69) - , min = Math.min; -module.exports = function(it){ - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; - -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $at = __webpack_require__(198)(true); - -// 21.1.3.27 String.prototype[@@iterator]() -__webpack_require__(102)(String, 'String', function(iterated){ - this._t = String(iterated); // target - this._i = 0; // next index -// 21.1.5.2.1 %StringIteratorPrototype%.next() -}, function(){ - var O = this._t - , index = this._i - , point; - if(index >= O.length)return {value: undefined, done: true}; - point = $at(O, index); - this._i += point.length; - return {value: point, done: false}; -}); - -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - - - -/**/ - -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var processNextTick = __webpack_require__(225); -/**/ - -/**/ -var util = __webpack_require__(110); -util.inherits = __webpack_require__(39); -/**/ - -var Readable = __webpack_require__(308); -var Writable = __webpack_require__(310); - -util.inherits(Duplex, Readable); - -var keys = objectKeys(Writable.prototype); -for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - processNextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} - -/***/ }), -/* 88 */ -/***/ (function(module, exports, __webpack_require__) { - -var buffer = __webpack_require__(121) - -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer -} else { - // Copy properties from require('buffer') - Object.keys(buffer).forEach(function (prop) { - exports[prop] = buffer[prop] - }) - exports.Buffer = SafeBuffer -} - -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} - -// Copy static methods from Buffer -Object.keys(Buffer).forEach(function (prop) { - SafeBuffer[prop] = Buffer[prop] -}) - -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) -} - - -/***/ }), -/* 89 */ -/***/ (function(module, exports, __webpack_require__) { - -var v1 = __webpack_require__(667); -var v4 = __webpack_require__(668); - -var uuid = v4; -uuid.v1 = v1; -uuid.v4 = v4; - -module.exports = uuid; - - -/***/ }), -/* 90 */ -/***/ (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 - } -} - - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getInstallationMethod = exports.version = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); -} - -let getInstallationMethod = exports.getInstallationMethod = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let installationMethod = originalInstallationMethod; - - // If there's a package.json in the parent directory, it could have an - // override for the installation method, so we should prefer that over - // whatever was originally in Yarn's package.json. This is the case with - // systems such as Homebrew, which take the tarball and modify the - // installation method so we're aware of the fact that Yarn was installed via - // Homebrew (so things like update notifications can point out the correct - // command to upgrade). - try { - const manifestPath = (_path || _load_path()).default.join(__dirname, '..', 'package.json'); - if ((_fs2 || _load_fs2()).default.existsSync(manifestPath)) { - // non-async version is deprecated - const manifest = yield (0, (_fs || _load_fs()).readJson)(manifestPath); - if (manifest.installationMethod) { - installationMethod = manifest.installationMethod; - } - } - } catch (e) { - // Ignore any errors; this is not critical functionality. - } - return installationMethod; - }); - - return function getInstallationMethod() { - return _ref.apply(this, arguments); - }; -})(); - -var _fs; - -function _load_fs() { - return _fs = __webpack_require__(4); -} - -var _fs2; - -function _load_fs2() { - return _fs2 = _interopRequireDefault(__webpack_require__(5)); -} - -var _path; - -function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(0)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// This will be bundled directly in the .js file for production builds -var _require = __webpack_require__(149); /** - * Determines the current version of Yarn itself. - * - */ - -const version = _require.version, - originalInstallationMethod = _require.installationMethod; -exports.version = version; - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.getBinFolder = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); -} - -let updateCwd = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { - yield (_fs || _load_fs()).mkdirp(config.globalFolder); - - yield config.init({ - cwd: config.globalFolder, - binLinks: true, - globalFolder: config.globalFolder, - cacheFolder: config._cacheRootFolder, - linkFolder: config.linkFolder - }); - }); - - return function updateCwd(_x) { - return _ref.apply(this, arguments); - }; -})(); - -let getBins = (() => { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { - // build up list of registry folders to search for binaries - const dirs = []; - for (const registryName of Object.keys((_index || _load_index()).registries)) { - const registry = config.registries[registryName]; - dirs.push(registry.loc); - } - - // build up list of binary files - const paths = new Set(); - for (const dir of dirs) { - const binDir = path.join(dir, '.bin'); - if (!(yield (_fs || _load_fs()).exists(binDir))) { - continue; - } - - for (const name of yield (_fs || _load_fs()).readdir(binDir)) { - paths.add(path.join(binDir, name)); - } - } - return paths; - }); - - return function getBins(_x2) { - return _ref2.apply(this, arguments); - }; -})(); - -let getGlobalPrefix = (() => { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { - if (flags.prefix) { - return flags.prefix; - } else if (config.getOption('prefix', true)) { - return String(config.getOption('prefix', true)); - } else if (process.env.PREFIX) { - return process.env.PREFIX; - } - - const potentialPrefixFolders = [(_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX]; - if (process.platform === 'win32') { - // %LOCALAPPDATA%\Yarn --> C:\Users\Alice\AppData\Local\Yarn - if (process.env.LOCALAPPDATA) { - potentialPrefixFolders.unshift(path.join(process.env.LOCALAPPDATA, 'Yarn')); - } - } else { - potentialPrefixFolders.unshift((_constants || _load_constants()).POSIX_GLOBAL_PREFIX); - } - - const binFolders = potentialPrefixFolders.map(function (prefix) { - return path.join(prefix, 'bin'); - }); - const prefixFolderQueryResult = yield (_fs || _load_fs()).getFirstSuitableFolder(binFolders); - const prefix = prefixFolderQueryResult.folder && path.dirname(prefixFolderQueryResult.folder); - - if (!prefix) { - config.reporter.warn(config.reporter.lang('noGlobalFolder', prefixFolderQueryResult.skipped.map(function (item) { - return path.dirname(item.folder); - }).join(', '))); - - return (_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX; - } - - return prefix; - }); - - return function getGlobalPrefix(_x3, _x4) { - return _ref3.apply(this, arguments); - }; -})(); - -let getBinFolder = exports.getBinFolder = (() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { - const prefix = yield getGlobalPrefix(config, flags); - return path.resolve(prefix, 'bin'); - }); - - return function getBinFolder(_x5, _x6) { - return _ref4.apply(this, arguments); - }; -})(); - -let initUpdateBins = (() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags) { - const beforeBins = yield getBins(config); - const binFolder = yield getBinFolder(config, flags); - - function throwPermError(err, dest) { - if (err.code === 'EACCES') { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noPermission', dest)); - } else { - throw err; - } - } - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - try { - yield (_fs || _load_fs()).mkdirp(binFolder); - } catch (err) { - throwPermError(err, binFolder); - } - - const afterBins = yield getBins(config); - - // remove old bins - for (const src of beforeBins) { - if (afterBins.has(src)) { - // not old - continue; - } - - // remove old bin - const dest = path.join(binFolder, path.basename(src)); - try { - yield (_fs || _load_fs()).unlink(dest); - } catch (err) { - throwPermError(err, dest); - } - } - - // add new bins - for (const src of afterBins) { - if (beforeBins.has(src)) { - // already inserted - continue; - } - - // insert new bin - const dest = path.join(binFolder, path.basename(src)); - try { - yield (_fs || _load_fs()).unlink(dest); - yield (0, (_packageLinker || _load_packageLinker()).linkBin)(src, dest); - if (process.platform === 'win32' && dest.indexOf('.cmd') !== -1) { - yield (_fs || _load_fs()).rename(dest + '.cmd', dest); - } - } catch (err) { - throwPermError(err, dest); - } - } - }); - }); - - return function initUpdateBins(_x7, _x8, _x9) { - return _ref5.apply(this, arguments); - }; -})(); - -let list = (() => { - var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - yield updateCwd(config); - - // install so we get hard file paths - const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); - const install = new (_install || _load_install()).Install({ skipIntegrityCheck: true }, config, new (_baseReporter || _load_baseReporter()).default(), lockfile); - const patterns = yield install.init(); - - // dump global modules - for (const pattern of patterns) { - const manifest = install.resolver.getStrictResolvedPattern(pattern); - ls(manifest, reporter, false); - } - }); - - return function list(_x10, _x11, _x12, _x13) { - return _ref7.apply(this, arguments); - }; -})(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(35); -} - -var _baseReporter; - -function _load_baseReporter() { - return _baseReporter = _interopRequireDefault(__webpack_require__(78)); -} - -var _buildSubCommands2; - -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(51)); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(12)); -} - -var _install; - -function _load_install() { - return _install = __webpack_require__(28); -} - -var _add; - -function _load_add() { - return _add = __webpack_require__(122); -} - -var _remove; - -function _load_remove() { - return _remove = __webpack_require__(260); -} - -var _upgrade; - -function _load_upgrade() { - return _upgrade = __webpack_require__(159); -} - -var _upgradeInteractive; - -function _load_upgradeInteractive() { - return _upgradeInteractive = __webpack_require__(262); -} - -var _packageLinker; - -function _load_packageLinker() { - return _packageLinker = __webpack_require__(161); -} - -var _constants; - -function _load_constants() { - return _constants = __webpack_require__(7); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -class GlobalAdd extends (_add || _load_add()).Add { - constructor(args, flags, config, reporter, lockfile) { - super(args, flags, config, reporter, lockfile); - - this.linker.setTopLevelBinLinking(false); - } - - maybeOutputSaveTree() { - for (const pattern of this.addedPatterns) { - const manifest = this.resolver.getStrictResolvedPattern(pattern); - ls(manifest, this.reporter, true); - } - return Promise.resolve(); - } - - _logSuccessSaveLockfile() { - // noop - } -} - -const path = __webpack_require__(0); - -function hasWrapper(flags, args) { - return args[0] !== 'bin' && args[0] !== 'dir'; -} - -function ls(manifest, reporter, saved) { - const bins = manifest.bin ? Object.keys(manifest.bin) : []; - const human = `${manifest.name}@${manifest.version}`; - if (bins.length) { - if (saved) { - reporter.success(reporter.lang('packageInstalledWithBinaries', human)); - } else { - reporter.info(reporter.lang('packageHasBinaries', human)); - } - reporter.list(`bins-${manifest.name}`, bins); - } else if (saved) { - reporter.warn(reporter.lang('packageHasNoBinaries', human)); - } -} - -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('global', { - add(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield updateCwd(config); - - const updateBins = yield initUpdateBins(config, reporter, flags); - if (args.indexOf('yarn') !== -1) { - reporter.warn(reporter.lang('packageContainsYarnAsGlobal')); - } - - // install module - const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); - const install = new GlobalAdd(args, flags, config, reporter, lockfile); - yield install.init(); - - // link binaries - yield updateBins(); - })(); - }, - - bin(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - reporter.log((yield getBinFolder(config, flags)), { force: true }); - })(); - }, - - dir(config, reporter, flags, args) { - reporter.log(config.globalFolder, { force: true }); - return Promise.resolve(); - }, - - ls(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - reporter.warn(`\`yarn global ls\` is deprecated. Please use \`yarn global list\`.`); - yield list(config, reporter, flags, args); - })(); - }, - - list(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield list(config, reporter, flags, args); - })(); - }, - - remove(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield updateCwd(config); - - const updateBins = yield initUpdateBins(config, reporter, flags); - - // remove module - yield (0, (_remove || _load_remove()).run)(config, reporter, flags, args); - - // remove binaries - yield updateBins(); - })(); - }, - - upgrade(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield updateCwd(config); - - const updateBins = yield initUpdateBins(config, reporter, flags); - - // upgrade module - yield (0, (_upgrade || _load_upgrade()).run)(config, reporter, flags, args); - - // update binaries - yield updateBins(); - })(); - }, - - upgradeInteractive(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield updateCwd(config); - - const updateBins = yield initUpdateBins(config, reporter, flags); - - // upgrade module - yield (0, (_upgradeInteractive || _load_upgradeInteractive()).run)(config, reporter, flags, args); - - // update binaries - yield updateBins(); - })(); - } -}); - -const run = _buildSubCommands.run, - _setFlags = _buildSubCommands.setFlags; -exports.run = run; -function setFlags(commander) { - _setFlags(commander); - commander.option('--prefix ', 'bin prefix to use to install binaries'); -} - -/***/ }), -/* 93 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.getToken = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); -} - -let getCredentials = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) { - var _config$registries$ya = config.registries.yarn.config; - let username = _config$registries$ya.username, - email = _config$registries$ya.email; - - - if (username) { - reporter.info(`${reporter.lang('npmUsername')}: ${username}`); - } else { - username = yield reporter.question(reporter.lang('npmUsername')); - if (!username) { - return null; - } - } - - if (email) { - reporter.info(`${reporter.lang('npmEmail')}: ${email}`); - } else { - email = yield reporter.question(reporter.lang('npmEmail')); - if (!email) { - return null; - } - } - - yield config.registries.yarn.saveHomeConfig({ username, email }); - - return { username, email }; - }); - - return function getCredentials(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); - -let getToken = exports.getToken = (() => { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) { - let name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; - - const auth = config.registries.npm.getAuth(name); - if (auth) { - config.registries.npm.setToken(auth); - return function revoke() { - reporter.info(reporter.lang('notRevokingConfigToken')); - return Promise.resolve(); - }; - } - - const env = process.env.YARN_AUTH_TOKEN || process.env.NPM_AUTH_TOKEN; - if (env) { - config.registries.npm.setToken(`Bearer ${env}`); - return function revoke() { - reporter.info(reporter.lang('notRevokingEnvToken')); - return Promise.resolve(); - }; - } - - // - const creds = yield getCredentials(config, reporter); - if (!creds) { - reporter.warn(reporter.lang('loginAsPublic')); - return function revoke() { - reporter.info(reporter.lang('noTokenToRevoke')); - return Promise.resolve(); - }; - } - - const username = creds.username, - email = creds.email; - - const password = yield reporter.question(reporter.lang('npmPassword'), { - password: true, - required: true - }); - - // - const userobj = { - _id: `org.couchdb.user:${username}`, - name: username, - password, - email, - type: 'user', - roles: [], - date: new Date().toISOString() - }; - - // - const res = yield config.registries.npm.request(`-/user/org.couchdb.user:${encodeURIComponent(username)}`, { - method: 'PUT', - body: userobj, - auth: { username, password, email } - }); - - if (res && res.ok) { - reporter.success(reporter.lang('loggedIn')); - - const token = res.token; - config.registries.npm.setToken(`Bearer ${token}`); - - return (() => { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - reporter.success(reporter.lang('revokedToken')); - yield config.registries.npm.request(`-/user/token/${token}`, { - method: 'DELETE' - }); - }); - - function revoke() { - return _ref3.apply(this, arguments); - } - - return revoke; - })(); - } else { - throw new (_errors || _load_errors()).MessageError(reporter.lang('incorrectCredentials')); - } - }); - - return function getToken(_x3, _x4) { - return _ref2.apply(this, arguments); - }; -})(); - -let run = exports.run = (() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - yield getCredentials(config, reporter); - }); - - return function run(_x6, _x7, _x8, _x9) { - return _ref4.apply(this, arguments); - }; -})(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function hasWrapper(commander, args) { - return true; -} - -function setFlags(commander) {} - -/***/ }), -/* 94 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); -} - -var _path; - -function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(0)); -} - -var _invariant; - -function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(6)); -} - -var _semver; - -function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(17)); -} - -var _validate; - -function _load_validate() { - return _validate = __webpack_require__(98); -} - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(12)); -} - -var _packageReference; - -function _load_packageReference() { - return _packageReference = _interopRequireDefault(__webpack_require__(422)); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(36); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); -} - -var _version; - -function _load_version() { - return _version = _interopRequireWildcard(__webpack_require__(172)); -} - -var _workspaceResolver; - -function _load_workspaceResolver() { - return _workspaceResolver = _interopRequireDefault(__webpack_require__(433)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); -} - -var _normalizePattern4; - -function _load_normalizePattern() { - return _normalizePattern4 = __webpack_require__(31); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const micromatch = __webpack_require__(114); - -class PackageRequest { - constructor(req, resolver) { - this.parentRequest = req.parentRequest; - this.parentNames = req.parentNames || []; - this.lockfile = resolver.lockfile; - this.registry = req.registry; - this.reporter = resolver.reporter; - this.resolver = resolver; - this.optional = req.optional; - this.pattern = req.pattern; - this.config = resolver.config; - this.foundInfo = null; - - resolver.usedRegistries.add(req.registry); - } - - getLocked(remoteType) { - // always prioritise root lockfile - const shrunk = this.lockfile.getLocked(this.pattern); - - if (shrunk && shrunk.resolved) { - const resolvedParts = (_version || _load_version()).explodeHashedUrl(shrunk.resolved); - - // Detect Git protocols (git://HOST/PATH or git+PROTOCOL://HOST/PATH) - const preferredRemoteType = /^git(\+[a-z0-9]+)?:\/\//.test(resolvedParts.url) ? 'git' : remoteType; - - return { - name: shrunk.name, - version: shrunk.version, - _uid: shrunk.uid, - _remote: { - resolved: shrunk.resolved, - type: preferredRemoteType, - reference: resolvedParts.url, - hash: resolvedParts.hash, - registry: shrunk.registry - }, - optionalDependencies: shrunk.optionalDependencies, - dependencies: shrunk.dependencies - }; - } else { - return null; - } - } - - /** - * If the input pattern matches a registry one then attempt to find it on the registry. - * Otherwise fork off to an exotic resolver if one matches. - */ - - findVersionOnRegistry(pattern) { - var _this = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref = yield _this.normalize(pattern); - - const range = _ref.range, - name = _ref.name; - - - const exoticResolver = (0, (_index || _load_index()).getExoticResolver)(range); - if (exoticResolver) { - let data = yield _this.findExoticVersionInfo(exoticResolver, range); - - // clone data as we're manipulating it in place and this could be resolved multiple - // times - data = Object.assign({}, data); - - // this is so the returned package response uses the overridden name. ie. if the - // package's actual name is `bar`, but it's been specified in the manifest like: - // "foo": "http://foo.com/bar.tar.gz" - // then we use the foo name - data.name = name; - return data; - } - - const Resolver = _this.getRegistryResolver(); - const resolver = new Resolver(_this, name, range); - return resolver.resolve(); - })(); - } - - /** - * Get the registry resolver associated with this package request. - */ - - getRegistryResolver() { - const Resolver = (_index || _load_index()).registries[this.registry]; - if (Resolver) { - return Resolver; - } else { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('unknownRegistryResolver', this.registry)); - } - } - - normalizeRange(pattern) { - var _this2 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (pattern.indexOf(':') > -1 || pattern.indexOf('@') > -1 || (0, (_index || _load_index()).getExoticResolver)(pattern)) { - return pattern; - } - - if (!(_semver || _load_semver()).default.validRange(pattern)) { - try { - if (yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(_this2.config.cwd, pattern, (_constants || _load_constants()).NODE_PACKAGE_JSON))) { - _this2.reporter.warn(_this2.reporter.lang('implicitFileDeprecated', pattern)); - return `file:${pattern}`; - } - } catch (err) { - // pass - } - } - - return pattern; - })(); - } - - normalize(pattern) { - var _this3 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _normalizePattern = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern); - - const name = _normalizePattern.name, - range = _normalizePattern.range, - hasVersion = _normalizePattern.hasVersion; - - const newRange = yield _this3.normalizeRange(range); - return { name, range: newRange, hasVersion }; - })(); - } - - /** - * Construct an exotic resolver instance with the input `ExoticResolver` and `range`. - */ - - findExoticVersionInfo(ExoticResolver, range) { - const resolver = new ExoticResolver(this, range); - return resolver.resolve(); - } - - /** - * If the current pattern matches an exotic resolver then delegate to it or else try - * the registry. - */ - - findVersionInfo() { - const exoticResolver = (0, (_index || _load_index()).getExoticResolver)(this.pattern); - if (exoticResolver) { - return this.findExoticVersionInfo(exoticResolver, this.pattern); - } else if ((_workspaceResolver || _load_workspaceResolver()).default.isWorkspace(this.pattern, this.resolver.workspaceLayout)) { - (0, (_invariant || _load_invariant()).default)(this.resolver.workspaceLayout, 'expected workspaceLayout'); - const resolver = new (_workspaceResolver || _load_workspaceResolver()).default(this, this.pattern, this.resolver.workspaceLayout); - return resolver.resolve(); - } else { - return this.findVersionOnRegistry(this.pattern); - } - } - - reportResolvedRangeMatch(info, resolved) {} - - /** - * Do the final resolve of a package that had a match with an existing version. - * After all unique versions have been discovered, so the best available version - * is found. - */ - resolveToExistingVersion(info) { - // get final resolved version - var _normalizePattern2 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(this.pattern); - - const range = _normalizePattern2.range, - name = _normalizePattern2.name; - - const solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; - const resolved = this.resolver.getHighestRangeVersionMatch(name, solvedRange, info); - (0, (_invariant || _load_invariant()).default)(resolved, 'should have a resolved reference'); - - this.reportResolvedRangeMatch(info, resolved); - const ref = resolved._reference; - (0, (_invariant || _load_invariant()).default)(ref, 'Resolved package info has no package reference'); - ref.addRequest(this); - ref.addPattern(this.pattern, resolved); - ref.addOptional(this.optional); - } - - /** - * TODO description - */ - find(_ref2) { - var _this4 = this; - - let fresh = _ref2.fresh, - frozen = _ref2.frozen; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // find version info for this package pattern - const info = yield _this4.findVersionInfo(); - - info.fresh = fresh; - (0, (_validate || _load_validate()).cleanDependencies)(info, false, _this4.reporter, function () { - // swallow warnings - }); - - // check if while we were resolving this dep we've already resolved one that satisfies - // the same range - - var _normalizePattern3 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(_this4.pattern); - - const range = _normalizePattern3.range, - name = _normalizePattern3.name; - - const solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; - const resolved = !info.fresh || frozen ? _this4.resolver.getExactVersionMatch(name, solvedRange, info) : _this4.resolver.getHighestRangeVersionMatch(name, solvedRange, info); - - if (resolved) { - _this4.resolver.reportPackageWithExistingVersion(_this4, info); - return; - } - - if (info.flat && !_this4.resolver.flat) { - throw new (_errors || _load_errors()).MessageError(_this4.reporter.lang('flatGlobalError')); - } - - // validate version info - PackageRequest.validateVersionInfo(info, _this4.reporter); - - // - const remote = info._remote; - (0, (_invariant || _load_invariant()).default)(remote, 'Missing remote'); - - // set package reference - const ref = new (_packageReference || _load_packageReference()).default(_this4, info, remote); - ref.addPattern(_this4.pattern, info); - ref.addOptional(_this4.optional); - ref.setFresh(fresh); - info._reference = ref; - info._remote = remote; - // start installation of dependencies - const promises = []; - const deps = []; - const parentNames = [..._this4.parentNames, name]; - // normal deps - for (const depName in info.dependencies) { - const depPattern = depName + '@' + info.dependencies[depName]; - deps.push(depPattern); - promises.push(_this4.resolver.find({ - pattern: depPattern, - registry: remote.registry, - // dependencies of optional dependencies should themselves be optional - optional: _this4.optional, - parentRequest: _this4, - parentNames - })); - } - - // optional deps - for (const depName in info.optionalDependencies) { - const depPattern = depName + '@' + info.optionalDependencies[depName]; - deps.push(depPattern); - promises.push(_this4.resolver.find({ - pattern: depPattern, - registry: remote.registry, - optional: true, - parentRequest: _this4, - parentNames - })); - } - if (remote.type === 'workspace' && !_this4.config.production) { - // workspaces support dev dependencies - for (const depName in info.devDependencies) { - const depPattern = depName + '@' + info.devDependencies[depName]; - deps.push(depPattern); - promises.push(_this4.resolver.find({ - pattern: depPattern, - registry: remote.registry, - optional: false, - parentRequest: _this4, - parentNames - })); - } - } - - for (const promise of promises) { - yield promise; - } - - ref.addDependencies(deps); - - // Now that we have all dependencies, it's safe to propagate optional - for (const otherRequest of ref.requests.slice(1)) { - ref.addOptional(otherRequest.optional); - } - })(); - } - - /** - * TODO description - */ - - static validateVersionInfo(info, reporter) { - // human readable name to use in errors - const human = `${info.name}@${info.version}`; - - info.version = PackageRequest.getPackageVersion(info); - - for (const key of (_constants || _load_constants()).REQUIRED_PACKAGE_KEYS) { - if (!info[key]) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('missingRequiredPackageKey', human, key)); - } - } - } - - /** - * Returns the package version if present, else defaults to the uid - */ - - static getPackageVersion(info) { - // TODO possibly reconsider this behaviour - return info.version === undefined ? info._uid : info.version; - } - - /** - * Gets all of the outdated packages and sorts them appropriately - */ - - static getOutdatedPackages(lockfile, install, config, reporter, filterByPatterns, flags) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _ref3 = yield install.fetchRequestFromCwd(); - - const reqPatterns = _ref3.requests, - workspaceLayout = _ref3.workspaceLayout; - - // Filter out workspace patterns if necessary - - let depReqPatterns = workspaceLayout ? reqPatterns.filter(function (p) { - return !workspaceLayout.getManifestByPattern(p.pattern); - }) : reqPatterns; - - // filter the list down to just the packages requested. - // prevents us from having to query the metadata for all packages. - if (filterByPatterns && filterByPatterns.length) { - const filterByNames = filterByPatterns.map(function (pattern) { - return (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern).name; - }); - depReqPatterns = depReqPatterns.filter(function (dep) { - return filterByNames.indexOf((0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(dep.pattern).name) >= 0 || flags && flags.pattern && micromatch.contains((0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(dep.pattern).name, flags.pattern); - }); - } - - const deps = yield Promise.all(depReqPatterns.map((() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref5) { - let pattern = _ref5.pattern, - hint = _ref5.hint, - workspaceName = _ref5.workspaceName, - workspaceLoc = _ref5.workspaceLoc; - - const locked = lockfile.getLocked(pattern); - if (!locked) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('lockfileOutdated')); - } - - const name = locked.name, - current = locked.version; - - let latest = ''; - let wanted = ''; - let url = ''; - - const normalized = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern); - - if ((0, (_index || _load_index()).getExoticResolver)(pattern) || (0, (_index || _load_index()).getExoticResolver)(normalized.range)) { - latest = wanted = 'exotic'; - url = normalized.range; - } else { - const registry = config.registries[locked.registry]; - - var _ref6 = yield registry.checkOutdated(config, name, normalized.range); - - latest = _ref6.latest; - wanted = _ref6.wanted; - url = _ref6.url; - } - - return { - name, - current, - wanted, - latest, - url, - hint, - range: normalized.range, - upgradeTo: '', - workspaceName: workspaceName || '', - workspaceLoc: workspaceLoc || '' - }; - }); - - return function (_x) { - return _ref4.apply(this, arguments); - }; - })())); - - // Make sure to always output `exotic` versions to be compatible with npm - const isDepOld = function (_ref7) { - let current = _ref7.current, - latest = _ref7.latest, - wanted = _ref7.wanted; - return latest === 'exotic' || (_semver || _load_semver()).default.lt(current, wanted) || (_semver || _load_semver()).default.lt(current, latest); - }; - const orderByName = function (depA, depB) { - return depA.name.localeCompare(depB.name); - }; - return deps.filter(isDepOld).sort(orderByName); - })(); - } -} -exports.default = PackageRequest; - -/***/ }), -/* 95 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -class BaseResolver { - constructor(request, fragment) { - this.resolver = request.resolver; - this.reporter = request.reporter; - this.fragment = fragment; - this.registry = request.registry; - this.request = request; - this.pattern = request.pattern; - this.config = request.config; - } - - fork(Resolver, resolveArg) { - for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } - - const resolver = new Resolver(this.request, ...args); - resolver.registry = this.registry; - return resolver.resolve(resolveArg); - } - - resolve(resolveArg) { - throw new Error('Not implemented'); - } -} -exports.default = BaseResolver; - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(36); -} - -var _misc; - -function _load_misc() { - return _misc = _interopRequireWildcard(__webpack_require__(10)); -} - -var _version; - -function _load_version() { - return _version = _interopRequireWildcard(__webpack_require__(172)); -} - -var _guessName; - -function _load_guessName() { - return _guessName = _interopRequireDefault(__webpack_require__(168)); -} - -var _index2; - -function _load_index2() { - return _index2 = __webpack_require__(35); -} - -var _exoticResolver; - -function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(61)); -} - -var _git; - -function _load_git() { - return _git = _interopRequireDefault(__webpack_require__(167)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const urlParse = __webpack_require__(14).parse; - -const GIT_PROTOCOL_PATTERN = /git\+.+:/; - -// we purposefully omit https and http as those are only valid if they end in the .git extension -const GIT_PROTOCOLS = ['git:', 'ssh:']; - -const GIT_HOSTS = ['github.com', 'gitlab.com', 'bitbucket.com', 'bitbucket.org']; - -class GitResolver extends (_exoticResolver || _load_exoticResolver()).default { - constructor(request, fragment) { - super(request, fragment); - - var _versionUtil$explodeH = (_version || _load_version()).explodeHashedUrl(fragment); - - const url = _versionUtil$explodeH.url, - hash = _versionUtil$explodeH.hash; - - this.url = url; - this.hash = hash; - } - - static isVersion(pattern) { - const parts = urlParse(pattern); - - // this pattern hasn't been exploded yet, we'll hit this code path again later once - // we've been normalized #59 - if (!parts.protocol) { - return false; - } - - const pathname = parts.pathname; - if (pathname && pathname.endsWith('.git')) { - // ends in .git - return true; - } - - if (GIT_PROTOCOL_PATTERN.test(parts.protocol)) { - return true; - } - - if (GIT_PROTOCOLS.indexOf(parts.protocol) >= 0) { - return true; - } - - if (parts.hostname && parts.path) { - const path = parts.path; - if (GIT_HOSTS.indexOf(parts.hostname) >= 0) { - // only if dependency is pointing to a git repo, - // e.g. facebook/flow and not file in a git repo facebook/flow/archive/v1.0.0.tar.gz - return path.split('/').filter(p => !!p).length === 2; - } - } - - return false; - } - - resolve(forked) { - var _this = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let tryRegistry = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) { - const filename = (_index2 || _load_index2()).registries[registry].filename; - - const file = yield client.getFile(filename); - if (!file) { - return null; - } - - const json = yield config.readJson(`${url}/${filename}`, function () { - return JSON.parse(file); - }); - json._uid = commit; - json._remote = { - resolved: `${url}#${commit}`, - type: 'git', - reference: url, - hash: commit, - registry - }; - return json; - }); - - return function tryRegistry(_x) { - return _ref.apply(this, arguments); - }; - })(); - - const url = _this.url; - - // shortcut for hosted git. we will fallback to a GitResolver if the hosted git - // optimisations fail which the `forked` flag indicates so we don't get into an - // infinite loop - - const parts = urlParse(url); - if (false) { - // check if this git url uses any of the hostnames defined in our hosted git resolvers - for (const name in (_index || _load_index()).hostedGit) { - const Resolver = (_index || _load_index()).hostedGit[name]; - if (Resolver.hostname !== parts.hostname) { - continue; - } - - // we have a match! clean up the pathname of url artifacts - let pathname = parts.pathname; - pathname = (_misc || _load_misc()).removePrefix(pathname, '/'); // remove prefixed slash - pathname = (_misc || _load_misc()).removeSuffix(pathname, '.git'); // remove .git suffix if present - - const url = `${pathname}${_this.hash ? '#' + decodeURIComponent(_this.hash) : ''}`; - return _this.fork(Resolver, false, url); - } - } - - // get from lockfile - const shrunk = _this.request.getLocked('git'); - if (shrunk) { - return shrunk; - } - - const config = _this.config; - - - const gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url); - const client = new (_git || _load_git()).default(config, gitUrl, _this.hash); - const commit = yield client.init(); - - const file = yield tryRegistry(_this.registry); - if (file) { - return file; - } - - for (const registry in (_index2 || _load_index2()).registries) { - if (registry === _this.registry) { - continue; - } - - const file = yield tryRegistry(registry); - if (file) { - return file; - } - } - - return { - // This is just the default, it can be overridden with key of dependencies - name: (0, (_guessName || _load_guessName()).default)(url), - version: '0.0.0', - _uid: commit, - _remote: { - resolved: `${url}#${commit}`, - type: 'git', - reference: url, - hash: commit, - registry: 'npm' - } - }; - })(); - } -} -exports.default = GitResolver; - -/***/ }), -/* 97 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.execCommand = exports.execFromManifest = exports.executeLifecycleScript = exports.makeEnv = undefined; - -var _slicedToArray2; - -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(15)); -} - -var _extends2; - -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(29)); -} - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); -} - -let makeEnv = exports.makeEnv = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (stage, cwd, config) { - const env = (0, (_extends2 || _load_extends()).default)({ - NODE: process.execPath - }, process.env); - - // Merge in the `env` object specified in .yarnrc - const customEnv = config.getOption('env'); - if (customEnv && typeof customEnv === 'object') { - Object.assign(env, customEnv); - } - - env.npm_lifecycle_event = stage; - env.npm_node_execpath = env.NODE; - env.npm_execpath = env.npm_execpath || process.mainModule.filename; - - // Set the env to production for npm compat if production mode. - // https://github.com/npm/npm/blob/30d75e738b9cb7a6a3f9b50e971adcbe63458ed3/lib/utils/lifecycle.js#L336 - if (config.production) { - env.NODE_ENV = 'production'; - } - - // Note: npm_config_argv environment variable contains output of nopt - command-line - // parser used by npm. Since we use other parser, we just roughly emulate it's output. (See: #684) - env.npm_config_argv = JSON.stringify({ - remain: [], - cooked: config.commandName === 'run' ? [config.commandName, stage] : [config.commandName], - original: process.argv.slice(2) - }); - - const manifest = yield config.maybeReadManifest(cwd); - if (manifest) { - if (manifest.scripts && Object.prototype.hasOwnProperty.call(manifest.scripts, stage)) { - env.npm_lifecycle_script = manifest.scripts[stage]; - } - - // add npm_package_* - const queue = [['', manifest]]; - while (queue.length) { - var _queue$pop = queue.pop(), - _queue$pop2 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_queue$pop, 2); - - const key = _queue$pop2[0], - val = _queue$pop2[1]; - - if (key[0] === '_') { - continue; - } - - if (typeof val === 'object') { - for (const subKey in val) { - const completeKey = [key, subKey].filter(function (part) { - return !!part; - }).join('_'); - queue.push([completeKey, val[subKey]]); - } - } else if (IGNORE_MANIFEST_KEYS.indexOf(key) < 0) { - let cleanVal = String(val); - if (cleanVal.indexOf('\n') >= 0) { - cleanVal = JSON.stringify(cleanVal); - } - - //replacing invalid chars with underscore - const cleanKey = key.replace(/[^a-zA-Z0-9_]/g, '_'); - - env[`npm_package_${cleanKey}`] = cleanVal; - } - } - } - - // add npm_config_* - const keys = new Set([...Object.keys(config.registries.yarn.config), ...Object.keys(config.registries.npm.config)]); - for (const key of keys) { - if (key.match(/:_/) || IGNORE_CONFIG_KEYS.indexOf(key) >= 0) { - continue; - } - - let val = config.getOption(key); - - if (!val) { - val = ''; - } else if (typeof val === 'number') { - val = '' + val; - } else if (typeof val !== 'string') { - val = JSON.stringify(val); - } - - if (val.indexOf('\n') >= 0) { - val = JSON.stringify(val); - } - - const cleanKey = key.replace(/^_+/, ''); - const envKey = `npm_config_${cleanKey}`.replace(/[^a-zA-Z0-9_]/g, '_'); - env[envKey] = val; - } - - // split up the path - const envPath = env[(_constants || _load_constants()).ENV_PATH_KEY]; - const pathParts = envPath ? envPath.split(path.delimiter) : []; - - // Include node-gyp version that was bundled with the current Node.js version, - // if available. - pathParts.unshift(path.join(path.dirname(process.execPath), 'node_modules', 'npm', 'bin', 'node-gyp-bin')); - pathParts.unshift(path.join(path.dirname(process.execPath), '..', 'lib', 'node_modules', 'npm', 'bin', 'node-gyp-bin')); - - // Add global bin folder if it is not present already, as some packages depend - // on a globally-installed version of node-gyp. - const globalBin = yield (0, (_global || _load_global()).getBinFolder)(config, {}); - if (pathParts.indexOf(globalBin) === -1) { - pathParts.unshift(globalBin); - } - - // add .bin folders to PATH - for (const registry of Object.keys((_index || _load_index()).registries)) { - const binFolder = path.join(config.registries[registry].folder, '.bin'); - pathParts.unshift(path.join(config.linkFolder, binFolder)); - pathParts.unshift(path.join(cwd, binFolder)); - } - - if (config.scriptsPrependNodePath) { - pathParts.unshift(path.join(path.dirname(process.execPath))); - } - - // join path back together - env[(_constants || _load_constants()).ENV_PATH_KEY] = pathParts.join(path.delimiter); - - return env; - }); - - return function makeEnv(_x, _x2, _x3) { - return _ref.apply(this, arguments); - }; -})(); - -let executeLifecycleScript = exports.executeLifecycleScript = (() => { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (stage, config, cwd, cmd, spinner) { - // if we don't have a spinner then pipe everything to the terminal - const stdio = spinner ? undefined : 'inherit'; - - const env = yield makeEnv(stage, cwd, config); - - yield checkForGypIfNeeded(config, cmd, env[(_constants || _load_constants()).ENV_PATH_KEY].split(path.delimiter)); - - // get shell - if (process.platform === 'win32') { - // handle windows run scripts starting with a relative path - cmd = (0, (_fixCmdWinSlashes || _load_fixCmdWinSlashes()).fixCmdWinSlashes)(cmd); - } - - let updateProgress; - if (spinner) { - updateProgress = function (data) { - const dataStr = data.toString() // turn buffer into string - .trim(); // trim whitespace - - invariant(spinner && spinner.tick, 'We should have spinner and its ticker here'); - if (dataStr) { - spinner.tick(dataStr - // Only get the last line - .substr(dataStr.lastIndexOf('\n') + 1) - // change tabs to spaces as they can interfere with the console - .replace(/\t/g, ' ')); - } - }; - } - const stdout = yield (_child || _load_child()).spawn(cmd, [], { shell: true, cwd, env, stdio }, updateProgress); - - return { cwd, command: cmd, stdout }; - }); - - return function executeLifecycleScript(_x4, _x5, _x6, _x7, _x8) { - return _ref2.apply(this, arguments); - }; -})(); - -let _checkForGyp = (() => { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, paths) { - const reporter = config.reporter; - - // Check every directory in the PATH - - const allChecks = yield Promise.all(paths.map(function (dir) { - return (0, (_fs || _load_fs()).exists)(path.join(dir, 'node-gyp')); - })); - if (allChecks.some(Boolean)) { - // node-gyp is available somewhere - return; - } - - reporter.info(reporter.lang('packageRequiresNodeGyp')); - - try { - yield (0, (_global || _load_global()).run)(config, reporter, {}, ['add', 'node-gyp']); - } catch (e) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('nodeGypAutoInstallFailed', e.message)); - } - }); - - return function _checkForGyp(_x9, _x10) { - return _ref3.apply(this, arguments); - }; -})(); - -let execFromManifest = exports.execFromManifest = (() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, commandName, cwd) { - const pkg = yield config.maybeReadManifest(cwd); - if (!pkg || !pkg.scripts) { - return; - } - - const cmd = pkg.scripts[commandName]; - if (cmd) { - yield execCommand(commandName, config, cmd, cwd); - } - }); - - return function execFromManifest(_x11, _x12, _x13) { - return _ref4.apply(this, arguments); - }; -})(); - -let execCommand = exports.execCommand = (() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (stage, config, cmd, cwd) { - const reporter = config.reporter; - - try { - reporter.command(cmd); - yield executeLifecycleScript(stage, config, cwd, cmd); - return Promise.resolve(); - } catch (err) { - if (err instanceof (_errors || _load_errors()).ProcessTermError) { - throw new (_errors || _load_errors()).MessageError(err.EXIT_SIGNAL ? reporter.lang('commandFailedWithSignal', err.EXIT_SIGNAL) : reporter.lang('commandFailedWithCode', err.EXIT_CODE)); - } else { - throw err; - } - } - }); - - return function execCommand(_x14, _x15, _x16, _x17) { - return _ref5.apply(this, arguments); - }; -})(); - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); -} - -var _child; - -function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(48)); -} - -var _fs; - -function _load_fs() { - return _fs = __webpack_require__(4); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(36); -} - -var _fixCmdWinSlashes; - -function _load_fixCmdWinSlashes() { - return _fixCmdWinSlashes = __webpack_require__(440); -} - -var _global; - -function _load_global() { - return _global = __webpack_require__(92); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const invariant = __webpack_require__(6); - -const path = __webpack_require__(0); - -const IGNORE_MANIFEST_KEYS = ['readme']; - -// We treat these configs as internal, thus not expose them to process.env. -// This helps us avoid some gyp issues when building native modules. -// See https://github.com/yarnpkg/yarn/issues/2286. -const IGNORE_CONFIG_KEYS = ['lastUpdateCheck']; - -exports.default = executeLifecycleScript; - - -let checkGypPromise = null; -/** - * Special case: Some packages depend on node-gyp, but don't specify this in - * their package.json dependencies. They assume that node-gyp is available - * globally. We need to detect this case and show an error message. - */ -function checkForGypIfNeeded(config, cmd, paths) { - if (cmd.substr(0, cmd.indexOf(' ')) !== 'node-gyp') { - return Promise.resolve(); - } - - // Ensure this only runs once, rather than multiple times in parallel. - if (!checkGypPromise) { - checkGypPromise = _checkForGyp(config, paths); - } - return checkGypPromise; -} - -/***/ }), -/* 98 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _slicedToArray2; - -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(15)); -} - -exports.isValidPackageName = isValidPackageName; - -exports.default = function (info, isRoot, reporter, warn) { - if (isRoot) { - for (const key in (_typos || _load_typos()).default) { - if (key in info) { - warn(reporter.lang('manifestPotentialTypo', key, (_typos || _load_typos()).default[key])); - } - } - } - - // validate name - const name = info.name; - - if (typeof name === 'string') { - if (isRoot && isBuiltinModule(name)) { - warn(reporter.lang('manifestBuiltinModule', name)); - } - - // cannot start with a dot - if (name[0] === '.') { - throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameDot')); - } - - // cannot contain the following characters - if (!isValidPackageName(name)) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameIllegalChars')); - } - - // cannot equal node_modules or favicon.ico - const lower = name.toLowerCase(); - if (lower === 'node_modules' || lower === 'favicon.ico') { - throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameBlacklisted')); - } - } - - // validate license - if (isRoot && !info.private) { - if (typeof info.license === 'string') { - const license = info.license.replace(/\*$/g, ''); - if (!(0, (_util || _load_util()).isValidLicense)(license)) { - warn(reporter.lang('manifestLicenseInvalid')); - } - } else { - warn(reporter.lang('manifestLicenseNone')); - } - } - - // validate strings - for (const key of strings) { - const val = info[key]; - if (val && typeof val !== 'string') { - throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestStringExpected', key)); - } - } - - cleanDependencies(info, isRoot, reporter, warn); -}; - -exports.cleanDependencies = cleanDependencies; - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -var _util; - -function _load_util() { - return _util = __webpack_require__(170); -} - -var _typos; - -function _load_typos() { - return _typos = _interopRequireDefault(__webpack_require__(447)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const isBuiltinModule = __webpack_require__(562); - -const strings = ['name', 'version']; - -const dependencyKeys = [ -// npm registry will include optionalDependencies in dependencies and we'll want to dedupe them from the -// other fields first -'optionalDependencies', - -// it's seemingly common to include a dependency in dependencies and devDependencies of the same name but -// different ranges, this can cause a lot of issues with our determinism and the behaviour of npm is -// currently unspecified. -'dependencies', 'devDependencies']; - -function isValidName(name) { - return !name.match(/[\/@\s\+%:]/) && encodeURIComponent(name) === name; -} - -function isValidScopedName(name) { - if (name[0] !== '@') { - return false; - } - - const parts = name.slice(1).split('/'); - return parts.length === 2 && isValidName(parts[0]) && isValidName(parts[1]); -} - -function isValidPackageName(name) { - return isValidName(name) || isValidScopedName(name); -} - -function cleanDependencies(info, isRoot, reporter, warn) { - // get dependency objects - const depTypes = []; - for (const type of dependencyKeys) { - const deps = info[type]; - if (!deps || typeof deps !== 'object') { - continue; - } - depTypes.push([type, deps]); - } - - // aggregate all non-trivial deps (not '' or '*') - const nonTrivialDeps = new Map(); - for (const _ref of depTypes) { - var _ref2 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref, 2); - - const type = _ref2[0]; - const deps = _ref2[1]; - - for (const name of Object.keys(deps)) { - const version = deps[name]; - if (!nonTrivialDeps.has(name) && version && version !== '*') { - nonTrivialDeps.set(name, { type, version }); - } - } - } - - // overwrite first dep of package with non-trivial version, remove the rest - const setDeps = new Set(); - for (const _ref3 of depTypes) { - var _ref4 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref3, 2); - - const type = _ref4[0]; - const deps = _ref4[1]; - - for (const name of Object.keys(deps)) { - let version = deps[name]; - - const dep = nonTrivialDeps.get(name); - if (dep) { - if (version && version !== '*' && version !== dep.version && isRoot) { - // only throw a warning when at the root - warn(reporter.lang('manifestDependencyCollision', dep.type, name, dep.version, type, version)); - } - version = dep.version; - } - - if (setDeps.has(name)) { - delete deps[name]; - } else { - deps[name] = version; - setDeps.add(name); - } - } - } -} - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _from = __webpack_require__(451); - -var _from2 = _interopRequireDefault(_from); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (arr) { - return Array.isArray(arr) ? arr : (0, _from2.default)(arr); -}; - -/***/ }), -/* 100 */ -/***/ (function(module, exports) { - -// IE 8- don't enum bug keys -module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' -).split(','); - -/***/ }), -/* 101 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(13).document && document.documentElement; - -/***/ }), -/* 102 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var LIBRARY = __webpack_require__(103) - , $export = __webpack_require__(66) - , redefine = __webpack_require__(195) - , hide = __webpack_require__(30) - , has = __webpack_require__(43) - , Iterators = __webpack_require__(32) - , $iterCreate = __webpack_require__(187) - , setToStringTag = __webpack_require__(67) - , getPrototypeOf = __webpack_require__(192) - , ITERATOR = __webpack_require__(9)('iterator') - , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` - , FF_ITERATOR = '@@iterator' - , KEYS = 'keys' - , VALUES = 'values'; - -var returnThis = function(){ return this; }; - -module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ - $iterCreate(Constructor, NAME, next); - var getMethod = function(kind){ - if(!BUGGY && kind in proto)return proto[kind]; - switch(kind){ - case KEYS: return function keys(){ return new Constructor(this, kind); }; - case VALUES: return function values(){ return new Constructor(this, kind); }; - } return function entries(){ return new Constructor(this, kind); }; - }; - var TAG = NAME + ' Iterator' - , DEF_VALUES = DEFAULT == VALUES - , VALUES_BUG = false - , proto = Base.prototype - , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] - , $default = $native || getMethod(DEFAULT) - , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined - , $anyNative = NAME == 'Array' ? proto.entries || $native : $native - , methods, key, IteratorPrototype; - // Fix native - if($anyNative){ - IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); - if(IteratorPrototype !== Object.prototype){ - // Set @@toStringTag to native iterators - setToStringTag(IteratorPrototype, TAG, true); - // fix for some old engines - if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); - } - } - // fix Array#{values, @@iterator}.name in V8 / FF - if(DEF_VALUES && $native && $native.name !== VALUES){ - VALUES_BUG = true; - $default = function values(){ return $native.call(this); }; - } - // Define iterator - if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ - hide(proto, ITERATOR, $default); - } - // Plug for library - Iterators[NAME] = $default; - Iterators[TAG] = returnThis; - if(DEFAULT){ - methods = { - values: DEF_VALUES ? $default : getMethod(VALUES), - keys: IS_SET ? $default : getMethod(KEYS), - entries: $entries - }; - if(FORCED)for(key in methods){ - if(!(key in proto))redefine(proto, key, methods[key]); - } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); - } - return methods; -}; - -/***/ }), -/* 103 */ -/***/ (function(module, exports) { - -module.exports = true; - -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(13) - , SHARED = '__core-js_shared__' - , store = global[SHARED] || (global[SHARED] = {}); -module.exports = function(key){ - return store[key] || (store[key] = {}); -}; - -/***/ }), -/* 105 */ -/***/ (function(module, exports, __webpack_require__) { - -var ctx = __webpack_require__(37) - , invoke = __webpack_require__(186) - , html = __webpack_require__(101) - , cel = __webpack_require__(65) - , global = __webpack_require__(13) - , process = global.process - , setTask = global.setImmediate - , clearTask = global.clearImmediate - , MessageChannel = global.MessageChannel - , counter = 0 - , queue = {} - , ONREADYSTATECHANGE = 'onreadystatechange' - , defer, channel, port; -var run = function(){ - var id = +this; - if(queue.hasOwnProperty(id)){ - var fn = queue[id]; - delete queue[id]; - fn(); - } -}; -var listener = function(event){ - run.call(event.data); -}; -// Node.js 0.9+ & IE10+ has setImmediate, otherwise: -if(!setTask || !clearTask){ - setTask = function setImmediate(fn){ - var args = [], i = 1; - while(arguments.length > i)args.push(arguments[i++]); - queue[++counter] = function(){ - invoke(typeof fn == 'function' ? fn : Function(fn), args); - }; - defer(counter); - return counter; - }; - clearTask = function clearImmediate(id){ - delete queue[id]; - }; - // Node.js 0.8- - if(__webpack_require__(42)(process) == 'process'){ - defer = function(id){ - process.nextTick(ctx(run, id, 1)); - }; - // Browsers with MessageChannel, includes WebWorkers - } else if(MessageChannel){ - channel = new MessageChannel; - port = channel.port2; - channel.port1.onmessage = listener; - defer = ctx(port.postMessage, port, 1); - // Browsers with postMessage, skip WebWorkers - // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ - defer = function(id){ - global.postMessage(id + '', '*'); - }; - global.addEventListener('message', listener, false); - // IE8- - } else if(ONREADYSTATECHANGE in cel('script')){ - defer = function(id){ - html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ - html.removeChild(this); - run.call(id); - }; - }; - // Rest old browsers - } else { - defer = function(id){ - setTimeout(ctx(run, id, 1), 0); - }; - } -} -module.exports = { - set: setTask, - clear: clearTask -}; - -/***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.13 ToObject(argument) -var defined = __webpack_require__(64); -module.exports = function(it){ - return Object(defined(it)); -}; - -/***/ }), -/* 107 */ -/***/ (function(module, exports) { - -var id = 0 - , px = Math.random(); -module.exports = function(key){ - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -var classof = __webpack_require__(82) - , ITERATOR = __webpack_require__(9)('iterator') - , Iterators = __webpack_require__(32); -module.exports = __webpack_require__(21).getIteratorMethod = function(it){ - if(it != undefined)return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; -}; - -/***/ }), -/* 109 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(201); -var global = __webpack_require__(13) - , hide = __webpack_require__(30) - , Iterators = __webpack_require__(32) - , TO_STRING_TAG = __webpack_require__(9)('toStringTag'); - -for(var collections = ['NodeList', 'DOMTokenList', 'MediaList', 'StyleSheetList', 'CSSRuleList'], i = 0; i < 5; i++){ - var NAME = collections[i] - , Collection = global[NAME] - , proto = Collection && Collection.prototype; - if(proto && !proto[TO_STRING_TAG])hide(proto, TO_STRING_TAG, NAME); - Iterators[NAME] = Iterators.Array; -} - -/***/ }), -/* 110 */ -/***/ (function(module, exports) { - -// 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. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. - -function isArray(arg) { - if (Array.isArray) { - return Array.isArray(arg); - } - return objectToString(arg) === '[object Array]'; -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = Buffer.isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} - - -/***/ }), -/* 111 */ -/***/ (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__(224); - -/** - * 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; -} - - -/***/ }), -/* 112 */ -/***/ (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__(5) -var origRealpath = fs.realpath -var origRealpathSync = fs.realpathSync - -var version = process.version -var ok = /^v[0-5]\./.test(version) -var old = __webpack_require__(210) - -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 -} - - -/***/ }), -/* 113 */ -/***/ (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__(0) -var minimatch = __webpack_require__(57) -var isAbsolute = __webpack_require__(73) -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)) - }) -} - - -/***/ }), -/* 114 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * micromatch - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - - - -var expand = __webpack_require__(585); -var utils = __webpack_require__(223); - -/** - * The main function. Pass an array of filepaths, - * and a string or array of glob patterns - * - * @param {Array|String} `files` - * @param {Array|String} `patterns` - * @param {Object} `opts` - * @return {Array} Array of matches - */ - -function micromatch(files, patterns, opts) { - if (!files || !patterns) return []; - opts = opts || {}; - - if (typeof opts.cache === 'undefined') { - opts.cache = true; - } - - if (!Array.isArray(patterns)) { - return match(files, patterns, opts); - } - - var len = patterns.length, i = 0; - var omit = [], keep = []; - - while (len--) { - var glob = patterns[i++]; - if (typeof glob === 'string' && glob.charCodeAt(0) === 33 /* ! */) { - omit.push.apply(omit, match(files, glob.slice(1), opts)); - } else { - keep.push.apply(keep, match(files, glob, opts)); - } - } - return utils.diff(keep, omit); -} - -/** - * Return an array of files that match the given glob pattern. - * - * This function is called by the main `micromatch` function If you only - * need to pass a single pattern you might get very minor speed improvements - * using this function. - * - * @param {Array} `files` - * @param {String} `pattern` - * @param {Object} `options` - * @return {Array} - */ - -function match(files, pattern, opts) { - if (utils.typeOf(files) !== 'string' && !Array.isArray(files)) { - throw new Error(msg('match', 'files', 'a string or array')); - } - - files = utils.arrayify(files); - opts = opts || {}; - - var negate = opts.negate || false; - var orig = pattern; - - if (typeof pattern === 'string') { - negate = pattern.charAt(0) === '!'; - if (negate) { - pattern = pattern.slice(1); - } - - // we need to remove the character regardless, - // so the above logic is still needed - if (opts.nonegate === true) { - negate = false; - } - } - - var _isMatch = matcher(pattern, opts); - var len = files.length, i = 0; - var res = []; - - while (i < len) { - var file = files[i++]; - var fp = utils.unixify(file, opts); - - if (!_isMatch(fp)) { continue; } - res.push(fp); - } - - if (res.length === 0) { - if (opts.failglob === true) { - throw new Error('micromatch.match() found no matches for: "' + orig + '".'); - } - - if (opts.nonull || opts.nullglob) { - res.push(utils.unescapeGlob(orig)); - } - } - - // if `negate` was defined, diff negated files - if (negate) { res = utils.diff(files, res); } - - // if `ignore` was defined, diff ignored filed - if (opts.ignore && opts.ignore.length) { - pattern = opts.ignore; - opts = utils.omit(opts, ['ignore']); - res = utils.diff(res, micromatch(res, pattern, opts)); - } - - if (opts.nodupes) { - return utils.unique(res); - } - return res; -} - -/** - * Returns a function that takes a glob pattern or array of glob patterns - * to be used with `Array#filter()`. (Internally this function generates - * the matching function using the [matcher] method). - * - * ```js - * var fn = mm.filter('[a-c]'); - * ['a', 'b', 'c', 'd', 'e'].filter(fn); - * //=> ['a', 'b', 'c'] - * ``` - * @param {String|Array} `patterns` Can be a glob or array of globs. - * @param {Options} `opts` Options to pass to the [matcher] method. - * @return {Function} Filter function to be passed to `Array#filter()`. - */ - -function filter(patterns, opts) { - if (!Array.isArray(patterns) && typeof patterns !== 'string') { - throw new TypeError(msg('filter', 'patterns', 'a string or array')); - } - - patterns = utils.arrayify(patterns); - var len = patterns.length, i = 0; - var patternMatchers = Array(len); - while (i < len) { - patternMatchers[i] = matcher(patterns[i++], opts); - } - - return function(fp) { - if (fp == null) return []; - var len = patternMatchers.length, i = 0; - var res = true; - - fp = utils.unixify(fp, opts); - while (i < len) { - var fn = patternMatchers[i++]; - if (!fn(fp)) { - res = false; - break; - } - } - return res; - }; -} - -/** - * Returns true if the filepath contains the given - * pattern. Can also return a function for matching. - * - * ```js - * isMatch('foo.md', '*.md', {}); - * //=> true - * - * isMatch('*.md', {})('foo.md') - * //=> true - * ``` - * @param {String} `fp` - * @param {String} `pattern` - * @param {Object} `opts` - * @return {Boolean} - */ - -function isMatch(fp, pattern, opts) { - if (typeof fp !== 'string') { - throw new TypeError(msg('isMatch', 'filepath', 'a string')); - } - - fp = utils.unixify(fp, opts); - if (utils.typeOf(pattern) === 'object') { - return matcher(fp, pattern); - } - return matcher(pattern, opts)(fp); -} - -/** - * Returns true if the filepath matches the - * given pattern. - */ - -function contains(fp, pattern, opts) { - if (typeof fp !== 'string') { - throw new TypeError(msg('contains', 'pattern', 'a string')); - } - - opts = opts || {}; - opts.contains = (pattern !== ''); - fp = utils.unixify(fp, opts); - - if (opts.contains && !utils.isGlob(pattern)) { - return fp.indexOf(pattern) !== -1; - } - return matcher(pattern, opts)(fp); -} - -/** - * Returns true if a file path matches any of the - * given patterns. - * - * @param {String} `fp` The filepath to test. - * @param {String|Array} `patterns` Glob patterns to use. - * @param {Object} `opts` Options to pass to the `matcher()` function. - * @return {String} - */ - -function any(fp, patterns, opts) { - if (!Array.isArray(patterns) && typeof patterns !== 'string') { - throw new TypeError(msg('any', 'patterns', 'a string or array')); - } - - patterns = utils.arrayify(patterns); - var len = patterns.length; - - fp = utils.unixify(fp, opts); - while (len--) { - var isMatch = matcher(patterns[len], opts); - if (isMatch(fp)) { - return true; - } - } - return false; -} - -/** - * Filter the keys of an object with the given `glob` pattern - * and `options` - * - * @param {Object} `object` - * @param {Pattern} `object` - * @return {Array} - */ - -function matchKeys(obj, glob, options) { - if (utils.typeOf(obj) !== 'object') { - throw new TypeError(msg('matchKeys', 'first argument', 'an object')); - } - - var fn = matcher(glob, options); - var res = {}; - - for (var key in obj) { - if (obj.hasOwnProperty(key) && fn(key)) { - res[key] = obj[key]; - } - } - return res; -} - -/** - * Return a function for matching based on the - * given `pattern` and `options`. - * - * @param {String} `pattern` - * @param {Object} `options` - * @return {Function} - */ - -function matcher(pattern, opts) { - // pattern is a function - if (typeof pattern === 'function') { - return pattern; - } - // pattern is a regex - if (pattern instanceof RegExp) { - return function(fp) { - return pattern.test(fp); - }; - } - - if (typeof pattern !== 'string') { - throw new TypeError(msg('matcher', 'pattern', 'a string, regex, or function')); - } - - // strings, all the way down... - pattern = utils.unixify(pattern, opts); - - // pattern is a non-glob string - if (!utils.isGlob(pattern)) { - return utils.matchPath(pattern, opts); - } - // pattern is a glob string - var re = makeRe(pattern, opts); - - // `matchBase` is defined - if (opts && opts.matchBase) { - return utils.hasFilename(re, opts); - } - // `matchBase` is not defined - return function(fp) { - fp = utils.unixify(fp, opts); - return re.test(fp); - }; -} - -/** - * Create and cache a regular expression for matching - * file paths. - * - * If the leading character in the `glob` is `!`, a negation - * regex is returned. - * - * @param {String} `glob` - * @param {Object} `options` - * @return {RegExp} - */ - -function toRegex(glob, options) { - // clone options to prevent mutating the original object - var opts = Object.create(options || {}); - var flags = opts.flags || ''; - if (opts.nocase && flags.indexOf('i') === -1) { - flags += 'i'; - } - - var parsed = expand(glob, opts); - - // pass in tokens to avoid parsing more than once - opts.negated = opts.negated || parsed.negated; - opts.negate = opts.negated; - glob = wrapGlob(parsed.pattern, opts); - var re; - - try { - re = new RegExp(glob, flags); - return re; - } catch (err) { - err.reason = 'micromatch invalid regex: (' + re + ')'; - if (opts.strict) throw new SyntaxError(err); - } - - // we're only here if a bad pattern was used and the user - // passed `options.silent`, so match nothing - return /$^/; -} - -/** - * Create the regex to do the matching. If the leading - * character in the `glob` is `!` a negation regex is returned. - * - * @param {String} `glob` - * @param {Boolean} `negate` - */ - -function wrapGlob(glob, opts) { - var prefix = (opts && !opts.contains) ? '^' : ''; - var after = (opts && !opts.contains) ? '$' : ''; - glob = ('(?:' + glob + ')' + after); - if (opts && opts.negate) { - return prefix + ('(?!^' + glob + ').*$'); - } - return prefix + glob; -} - -/** - * Create and cache a regular expression for matching file paths. - * If the leading character in the `glob` is `!`, a negation - * regex is returned. - * - * @param {String} `glob` - * @param {Object} `options` - * @return {RegExp} - */ - -function makeRe(glob, opts) { - if (utils.typeOf(glob) !== 'string') { - throw new Error(msg('makeRe', 'glob', 'a string')); - } - return utils.cache(toRegex, glob, opts); -} - -/** - * Make error messages consistent. Follows this format: - * - * ```js - * msg(methodName, argNumber, nativeType); - * // example: - * msg('matchKeys', 'first', 'an object'); - * ``` - * - * @param {String} `method` - * @param {String} `num` - * @param {String} `type` - * @return {String} - */ - -function msg(method, what, type) { - return 'micromatch.' + method + '(): ' + what + ' should be ' + type + '.'; -} - -/** - * Public methods - */ - -/* eslint no-multi-spaces: 0 */ -micromatch.any = any; -micromatch.braces = micromatch.braceExpand = utils.braces; -micromatch.contains = contains; -micromatch.expand = expand; -micromatch.filter = filter; -micromatch.isMatch = isMatch; -micromatch.makeRe = makeRe; -micromatch.match = match; -micromatch.matcher = matcher; -micromatch.matchKeys = matchKeys; - -/** - * Expose `micromatch` - */ - -module.exports = micromatch; - - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -var path = __webpack_require__(0); -var fs = __webpack_require__(5); -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; -}; - - -/***/ }), -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2016 Joyent, Inc. - -module.exports = Certificate; - -var assert = __webpack_require__(11); -var algs = __webpack_require__(22); -var crypto = __webpack_require__(8); -var Fingerprint = __webpack_require__(117); -var Signature = __webpack_require__(46); -var errs = __webpack_require__(45); -var util = __webpack_require__(2); -var utils = __webpack_require__(19); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); -var Identity = __webpack_require__(119); - -var formats = {}; -formats['openssh'] = __webpack_require__(650); -formats['x509'] = __webpack_require__(323); -formats['pem'] = __webpack_require__(651); - -var CertificateParseError = errs.CertificateParseError; -var InvalidAlgorithmError = errs.InvalidAlgorithmError; - -function Certificate(opts) { - assert.object(opts, 'options'); - assert.arrayOfObject(opts.subjects, 'options.subjects'); - utils.assertCompatible(opts.subjects[0], Identity, [1, 0], - 'options.subjects'); - utils.assertCompatible(opts.subjectKey, Key, [1, 0], - 'options.subjectKey'); - utils.assertCompatible(opts.issuer, Identity, [1, 0], 'options.issuer'); - if (opts.issuerKey !== undefined) { - utils.assertCompatible(opts.issuerKey, Key, [1, 0], - 'options.issuerKey'); - } - assert.object(opts.signatures, 'options.signatures'); - assert.buffer(opts.serial, 'options.serial'); - assert.date(opts.validFrom, 'options.validFrom'); - assert.date(opts.validUntil, 'optons.validUntil'); - - assert.optionalArrayOfString(opts.purposes, 'options.purposes'); - - this._hashCache = {}; - - this.subjects = opts.subjects; - this.issuer = opts.issuer; - this.subjectKey = opts.subjectKey; - this.issuerKey = opts.issuerKey; - this.signatures = opts.signatures; - this.serial = opts.serial; - this.validFrom = opts.validFrom; - this.validUntil = opts.validUntil; - this.purposes = opts.purposes; -} - -Certificate.formats = formats; - -Certificate.prototype.toBuffer = function (format, options) { - if (format === undefined) - format = 'x509'; - assert.string(format, 'format'); - assert.object(formats[format], 'formats[format]'); - assert.optionalObject(options, 'options'); - - return (formats[format].write(this, options)); -}; - -Certificate.prototype.toString = function (format, options) { - if (format === undefined) - format = 'pem'; - return (this.toBuffer(format, options).toString()); -}; - -Certificate.prototype.fingerprint = function (algo) { - if (algo === undefined) - algo = 'sha256'; - assert.string(algo, 'algorithm'); - var opts = { - type: 'certificate', - hash: this.hash(algo), - algorithm: algo - }; - return (new Fingerprint(opts)); -}; - -Certificate.prototype.hash = function (algo) { - assert.string(algo, 'algorithm'); - algo = algo.toLowerCase(); - if (algs.hashAlgs[algo] === undefined) - throw (new InvalidAlgorithmError(algo)); - - if (this._hashCache[algo]) - return (this._hashCache[algo]); - - var hash = crypto.createHash(algo). - update(this.toBuffer('x509')).digest(); - this._hashCache[algo] = hash; - return (hash); -}; - -Certificate.prototype.isExpired = function (when) { - if (when === undefined) - when = new Date(); - return (!((when.getTime() >= this.validFrom.getTime()) && - (when.getTime() < this.validUntil.getTime()))); -}; - -Certificate.prototype.isSignedBy = function (issuerCert) { - utils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer'); - - if (!this.issuer.equals(issuerCert.subjects[0])) - return (false); - if (this.issuer.purposes && this.issuer.purposes.length > 0 && - this.issuer.purposes.indexOf('ca') === -1) { - return (false); - } - - return (this.isSignedByKey(issuerCert.subjectKey)); -}; - -Certificate.prototype.isSignedByKey = function (issuerKey) { - utils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey'); - - if (this.issuerKey !== undefined) { - return (this.issuerKey. - fingerprint('sha512').matches(issuerKey)); - } - - var fmt = Object.keys(this.signatures)[0]; - var valid = formats[fmt].verify(this, issuerKey); - if (valid) - this.issuerKey = issuerKey; - return (valid); -}; - -Certificate.prototype.signWith = function (key) { - utils.assertCompatible(key, PrivateKey, [1, 2], 'key'); - var fmts = Object.keys(formats); - var didOne = false; - for (var i = 0; i < fmts.length; ++i) { - if (fmts[i] !== 'pem') { - var ret = formats[fmts[i]].sign(this, key); - if (ret === true) - didOne = true; - } - } - if (!didOne) { - throw (new Error('Failed to sign the certificate for any ' + - 'available certificate formats')); - } -}; - -Certificate.createSelfSigned = function (subjectOrSubjects, key, options) { - var subjects; - if (Array.isArray(subjectOrSubjects)) - subjects = subjectOrSubjects; - else - subjects = [subjectOrSubjects]; - - assert.arrayOfObject(subjects); - subjects.forEach(function (subject) { - utils.assertCompatible(subject, Identity, [1, 0], 'subject'); - }); - - utils.assertCompatible(key, PrivateKey, [1, 2], 'private key'); - - assert.optionalObject(options, 'options'); - if (options === undefined) - options = {}; - assert.optionalObject(options.validFrom, 'options.validFrom'); - assert.optionalObject(options.validUntil, 'options.validUntil'); - var validFrom = options.validFrom; - var validUntil = options.validUntil; - if (validFrom === undefined) - validFrom = new Date(); - if (validUntil === undefined) { - assert.optionalNumber(options.lifetime, 'options.lifetime'); - var lifetime = options.lifetime; - if (lifetime === undefined) - lifetime = 10*365*24*3600; - validUntil = new Date(); - validUntil.setTime(validUntil.getTime() + lifetime*1000); - } - assert.optionalBuffer(options.serial, 'options.serial'); - var serial = options.serial; - if (serial === undefined) - serial = new Buffer('0000000000000001', 'hex'); - - var purposes = options.purposes; - if (purposes === undefined) - purposes = []; - - if (purposes.indexOf('signature') === -1) - purposes.push('signature'); - - /* Self-signed certs are always CAs. */ - if (purposes.indexOf('ca') === -1) - purposes.push('ca'); - if (purposes.indexOf('crl') === -1) - purposes.push('crl'); - - /* - * If we weren't explicitly given any other purposes, do the sensible - * thing and add some basic ones depending on the subject type. - */ - if (purposes.length <= 3) { - var hostSubjects = subjects.filter(function (subject) { - return (subject.type === 'host'); - }); - var userSubjects = subjects.filter(function (subject) { - return (subject.type === 'user'); - }); - if (hostSubjects.length > 0) { - if (purposes.indexOf('serverAuth') === -1) - purposes.push('serverAuth'); - } - if (userSubjects.length > 0) { - if (purposes.indexOf('clientAuth') === -1) - purposes.push('clientAuth'); - } - if (userSubjects.length > 0 || hostSubjects.length > 0) { - if (purposes.indexOf('keyAgreement') === -1) - purposes.push('keyAgreement'); - if (key.type === 'rsa' && - purposes.indexOf('encryption') === -1) - purposes.push('encryption'); - } - } - - var cert = new Certificate({ - subjects: subjects, - issuer: subjects[0], - subjectKey: key.toPublic(), - issuerKey: key.toPublic(), - signatures: {}, - serial: serial, - validFrom: validFrom, - validUntil: validUntil, - purposes: purposes - }); - cert.signWith(key); - - return (cert); -}; - -Certificate.create = - function (subjectOrSubjects, key, issuer, issuerKey, options) { - var subjects; - if (Array.isArray(subjectOrSubjects)) - subjects = subjectOrSubjects; - else - subjects = [subjectOrSubjects]; - - assert.arrayOfObject(subjects); - subjects.forEach(function (subject) { - utils.assertCompatible(subject, Identity, [1, 0], 'subject'); - }); - - utils.assertCompatible(key, Key, [1, 0], 'key'); - if (PrivateKey.isPrivateKey(key)) - key = key.toPublic(); - utils.assertCompatible(issuer, Identity, [1, 0], 'issuer'); - utils.assertCompatible(issuerKey, PrivateKey, [1, 2], 'issuer key'); - - assert.optionalObject(options, 'options'); - if (options === undefined) - options = {}; - assert.optionalObject(options.validFrom, 'options.validFrom'); - assert.optionalObject(options.validUntil, 'options.validUntil'); - var validFrom = options.validFrom; - var validUntil = options.validUntil; - if (validFrom === undefined) - validFrom = new Date(); - if (validUntil === undefined) { - assert.optionalNumber(options.lifetime, 'options.lifetime'); - var lifetime = options.lifetime; - if (lifetime === undefined) - lifetime = 10*365*24*3600; - validUntil = new Date(); - validUntil.setTime(validUntil.getTime() + lifetime*1000); - } - assert.optionalBuffer(options.serial, 'options.serial'); - var serial = options.serial; - if (serial === undefined) - serial = new Buffer('0000000000000001', 'hex'); - - var purposes = options.purposes; - if (purposes === undefined) - purposes = []; - - if (purposes.indexOf('signature') === -1) - purposes.push('signature'); - - if (options.ca === true) { - if (purposes.indexOf('ca') === -1) - purposes.push('ca'); - if (purposes.indexOf('crl') === -1) - purposes.push('crl'); - } - - var hostSubjects = subjects.filter(function (subject) { - return (subject.type === 'host'); - }); - var userSubjects = subjects.filter(function (subject) { - return (subject.type === 'user'); - }); - if (hostSubjects.length > 0) { - if (purposes.indexOf('serverAuth') === -1) - purposes.push('serverAuth'); - } - if (userSubjects.length > 0) { - if (purposes.indexOf('clientAuth') === -1) - purposes.push('clientAuth'); - } - if (userSubjects.length > 0 || hostSubjects.length > 0) { - if (purposes.indexOf('keyAgreement') === -1) - purposes.push('keyAgreement'); - if (key.type === 'rsa' && - purposes.indexOf('encryption') === -1) - purposes.push('encryption'); - } - - var cert = new Certificate({ - subjects: subjects, - issuer: issuer, - subjectKey: key, - issuerKey: issuerKey.toPublic(), - signatures: {}, - serial: serial, - validFrom: validFrom, - validUntil: validUntil, - purposes: purposes - }); - cert.signWith(issuerKey); - - return (cert); -}; - -Certificate.parse = function (data, format, options) { - if (typeof (data) !== 'string') - assert.buffer(data, 'data'); - if (format === undefined) - format = 'auto'; - assert.string(format, 'format'); - if (typeof (options) === 'string') - options = { filename: options }; - assert.optionalObject(options, 'options'); - if (options === undefined) - options = {}; - assert.optionalString(options.filename, 'options.filename'); - if (options.filename === undefined) - options.filename = '(unnamed)'; - - assert.object(formats[format], 'formats[format]'); - - try { - var k = formats[format].read(data, options); - return (k); - } catch (e) { - throw (new CertificateParseError(options.filename, format, e)); - } -}; - -Certificate.isCertificate = function (obj, ver) { - return (utils.isCompatible(obj, Certificate, ver)); -}; - -/* - * API versions for Certificate: - * [1,0] -- initial ver - */ -Certificate.prototype._sshpkApiVersion = [1, 0]; - -Certificate._oldVersionDetect = function (obj) { - return ([1, 0]); -}; - - -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = Fingerprint; - -var assert = __webpack_require__(11); -var algs = __webpack_require__(22); -var crypto = __webpack_require__(8); -var errs = __webpack_require__(45); -var Key = __webpack_require__(23); -var Certificate = __webpack_require__(116); -var utils = __webpack_require__(19); - -var FingerprintFormatError = errs.FingerprintFormatError; -var InvalidAlgorithmError = errs.InvalidAlgorithmError; - -function Fingerprint(opts) { - assert.object(opts, 'options'); - assert.string(opts.type, 'options.type'); - assert.buffer(opts.hash, 'options.hash'); - assert.string(opts.algorithm, 'options.algorithm'); - - this.algorithm = opts.algorithm.toLowerCase(); - if (algs.hashAlgs[this.algorithm] !== true) - throw (new InvalidAlgorithmError(this.algorithm)); - - this.hash = opts.hash; - this.type = opts.type; -} - -Fingerprint.prototype.toString = function (format) { - if (format === undefined) { - if (this.algorithm === 'md5') - format = 'hex'; - else - format = 'base64'; - } - assert.string(format); - - switch (format) { - case 'hex': - return (addColons(this.hash.toString('hex'))); - case 'base64': - return (sshBase64Format(this.algorithm, - this.hash.toString('base64'))); - default: - throw (new FingerprintFormatError(undefined, format)); - } -}; - -Fingerprint.prototype.matches = function (other) { - assert.object(other, 'key or certificate'); - if (this.type === 'key') { - utils.assertCompatible(other, Key, [1, 0], 'key'); - } else { - utils.assertCompatible(other, Certificate, [1, 0], - 'certificate'); - } - - var theirHash = other.hash(this.algorithm); - var theirHash2 = crypto.createHash(this.algorithm). - update(theirHash).digest('base64'); - - if (this.hash2 === undefined) - this.hash2 = crypto.createHash(this.algorithm). - update(this.hash).digest('base64'); - - return (this.hash2 === theirHash2); -}; - -Fingerprint.parse = function (fp, options) { - assert.string(fp, 'fingerprint'); - - var alg, hash, enAlgs; - if (Array.isArray(options)) { - enAlgs = options; - options = {}; - } - assert.optionalObject(options, 'options'); - if (options === undefined) - options = {}; - if (options.enAlgs !== undefined) - enAlgs = options.enAlgs; - assert.optionalArrayOfString(enAlgs, 'algorithms'); - - var parts = fp.split(':'); - if (parts.length == 2) { - alg = parts[0].toLowerCase(); - /*JSSTYLED*/ - var base64RE = /^[A-Za-z0-9+\/=]+$/; - if (!base64RE.test(parts[1])) - throw (new FingerprintFormatError(fp)); - try { - hash = new Buffer(parts[1], 'base64'); - } catch (e) { - throw (new FingerprintFormatError(fp)); - } - } else if (parts.length > 2) { - alg = 'md5'; - if (parts[0].toLowerCase() === 'md5') - parts = parts.slice(1); - parts = parts.join(''); - /*JSSTYLED*/ - var md5RE = /^[a-fA-F0-9]+$/; - if (!md5RE.test(parts)) - throw (new FingerprintFormatError(fp)); - try { - hash = new Buffer(parts, 'hex'); - } catch (e) { - throw (new FingerprintFormatError(fp)); - } - } - - if (alg === undefined) - throw (new FingerprintFormatError(fp)); - - if (algs.hashAlgs[alg] === undefined) - throw (new InvalidAlgorithmError(alg)); - - if (enAlgs !== undefined) { - enAlgs = enAlgs.map(function (a) { return a.toLowerCase(); }); - if (enAlgs.indexOf(alg) === -1) - throw (new InvalidAlgorithmError(alg)); - } - - return (new Fingerprint({ - algorithm: alg, - hash: hash, - type: options.type || 'key' - })); -}; - -function addColons(s) { - /*JSSTYLED*/ - return (s.replace(/(.{2})(?=.)/g, '$1:')); -} - -function base64Strip(s) { - /*JSSTYLED*/ - return (s.replace(/=*$/, '')); -} - -function sshBase64Format(alg, h) { - return (alg.toUpperCase() + ':' + base64Strip(h)); -} - -Fingerprint.isFingerprint = function (obj, ver) { - return (utils.isCompatible(obj, Fingerprint, ver)); -}; - -/* - * API versions for Fingerprint: - * [1,0] -- initial ver - * [1,1] -- first tagged ver - */ -Fingerprint.prototype._sshpkApiVersion = [1, 1]; - -Fingerprint._oldVersionDetect = function (obj) { - assert.func(obj.toString); - assert.func(obj.matches); - return ([1, 0]); -}; - - -/***/ }), -/* 118 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = { - read: read, - readPkcs8: readPkcs8, - write: write, - writePkcs8: writePkcs8, - - readECDSACurve: readECDSACurve, - writeECDSACurve: writeECDSACurve -}; - -var assert = __webpack_require__(11); -var asn1 = __webpack_require__(50); -var algs = __webpack_require__(22); -var utils = __webpack_require__(19); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); -var pem = __webpack_require__(58); - -function read(buf, options) { - return (pem.read(buf, options, 'pkcs8')); -} - -function write(key, options) { - return (pem.write(key, options, 'pkcs8')); -} - -/* Helper to read in a single mpint */ -function readMPInt(der, nm) { - assert.strictEqual(der.peek(), asn1.Ber.Integer, - nm + ' is not an Integer'); - return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); -} - -function readPkcs8(alg, type, der) { - /* Private keys in pkcs#8 format have a weird extra int */ - if (der.peek() === asn1.Ber.Integer) { - assert.strictEqual(type, 'private', - 'unexpected Integer at start of public key'); - der.readString(asn1.Ber.Integer, true); - } - - der.readSequence(); - var next = der.offset + der.length; - - var oid = der.readOID(); - switch (oid) { - case '1.2.840.113549.1.1.1': - der._offset = next; - if (type === 'public') - return (readPkcs8RSAPublic(der)); - else - return (readPkcs8RSAPrivate(der)); - case '1.2.840.10040.4.1': - if (type === 'public') - return (readPkcs8DSAPublic(der)); - else - return (readPkcs8DSAPrivate(der)); - case '1.2.840.10045.2.1': - if (type === 'public') - return (readPkcs8ECDSAPublic(der)); - else - return (readPkcs8ECDSAPrivate(der)); - default: - throw (new Error('Unknown key type OID ' + oid)); - } -} - -function readPkcs8RSAPublic(der) { - // bit string sequence - der.readSequence(asn1.Ber.BitString); - der.readByte(); - der.readSequence(); - - // modulus - var n = readMPInt(der, 'modulus'); - var e = readMPInt(der, 'exponent'); - - // now, make the key - var key = { - type: 'rsa', - source: der.originalInput, - parts: [ - { name: 'e', data: e }, - { name: 'n', data: n } - ] - }; - - return (new Key(key)); -} - -function readPkcs8RSAPrivate(der) { - der.readSequence(asn1.Ber.OctetString); - der.readSequence(); - - var ver = readMPInt(der, 'version'); - assert.equal(ver[0], 0x0, 'unknown RSA private key version'); - - // modulus then public exponent - var n = readMPInt(der, 'modulus'); - var e = readMPInt(der, 'public exponent'); - var d = readMPInt(der, 'private exponent'); - var p = readMPInt(der, 'prime1'); - var q = readMPInt(der, 'prime2'); - var dmodp = readMPInt(der, 'exponent1'); - var dmodq = readMPInt(der, 'exponent2'); - var iqmp = readMPInt(der, 'iqmp'); - - // now, make the key - var key = { - type: 'rsa', - parts: [ - { name: 'n', data: n }, - { name: 'e', data: e }, - { name: 'd', data: d }, - { name: 'iqmp', data: iqmp }, - { name: 'p', data: p }, - { name: 'q', data: q }, - { name: 'dmodp', data: dmodp }, - { name: 'dmodq', data: dmodq } - ] - }; - - return (new PrivateKey(key)); -} - -function readPkcs8DSAPublic(der) { - der.readSequence(); - - var p = readMPInt(der, 'p'); - var q = readMPInt(der, 'q'); - var g = readMPInt(der, 'g'); - - // bit string sequence - der.readSequence(asn1.Ber.BitString); - der.readByte(); - - var y = readMPInt(der, 'y'); - - // now, make the key - var key = { - type: 'dsa', - parts: [ - { name: 'p', data: p }, - { name: 'q', data: q }, - { name: 'g', data: g }, - { name: 'y', data: y } - ] - }; - - return (new Key(key)); -} - -function readPkcs8DSAPrivate(der) { - der.readSequence(); - - var p = readMPInt(der, 'p'); - var q = readMPInt(der, 'q'); - var g = readMPInt(der, 'g'); - - der.readSequence(asn1.Ber.OctetString); - var x = readMPInt(der, 'x'); - - /* The pkcs#8 format does not include the public key */ - var y = utils.calculateDSAPublic(g, p, x); - - var key = { - type: 'dsa', - parts: [ - { name: 'p', data: p }, - { name: 'q', data: q }, - { name: 'g', data: g }, - { name: 'y', data: y }, - { name: 'x', data: x } - ] - }; - - return (new PrivateKey(key)); -} - -function readECDSACurve(der) { - var curveName, curveNames; - var j, c, cd; - - if (der.peek() === asn1.Ber.OID) { - var oid = der.readOID(); - - curveNames = Object.keys(algs.curves); - for (j = 0; j < curveNames.length; ++j) { - c = curveNames[j]; - cd = algs.curves[c]; - if (cd.pkcs8oid === oid) { - curveName = c; - break; - } - } - - } else { - // ECParameters sequence - der.readSequence(); - var version = der.readString(asn1.Ber.Integer, true); - assert.strictEqual(version[0], 1, 'ECDSA key not version 1'); - - var curve = {}; - - // FieldID sequence - der.readSequence(); - var fieldTypeOid = der.readOID(); - assert.strictEqual(fieldTypeOid, '1.2.840.10045.1.1', - 'ECDSA key is not from a prime-field'); - var p = curve.p = utils.mpNormalize( - der.readString(asn1.Ber.Integer, true)); - /* - * p always starts with a 1 bit, so count the zeros to get its - * real size. - */ - curve.size = p.length * 8 - utils.countZeros(p); - - // Curve sequence - der.readSequence(); - curve.a = utils.mpNormalize( - der.readString(asn1.Ber.OctetString, true)); - curve.b = utils.mpNormalize( - der.readString(asn1.Ber.OctetString, true)); - if (der.peek() === asn1.Ber.BitString) - curve.s = der.readString(asn1.Ber.BitString, true); - - // Combined Gx and Gy - curve.G = der.readString(asn1.Ber.OctetString, true); - assert.strictEqual(curve.G[0], 0x4, - 'uncompressed G is required'); - - curve.n = utils.mpNormalize( - der.readString(asn1.Ber.Integer, true)); - curve.h = utils.mpNormalize( - der.readString(asn1.Ber.Integer, true)); - assert.strictEqual(curve.h[0], 0x1, 'a cofactor=1 curve is ' + - 'required'); - - curveNames = Object.keys(algs.curves); - var ks = Object.keys(curve); - for (j = 0; j < curveNames.length; ++j) { - c = curveNames[j]; - cd = algs.curves[c]; - var equal = true; - for (var i = 0; i < ks.length; ++i) { - var k = ks[i]; - if (cd[k] === undefined) - continue; - if (typeof (cd[k]) === 'object' && - cd[k].equals !== undefined) { - if (!cd[k].equals(curve[k])) { - equal = false; - break; - } - } else if (Buffer.isBuffer(cd[k])) { - if (cd[k].toString('binary') - !== curve[k].toString('binary')) { - equal = false; - break; - } - } else { - if (cd[k] !== curve[k]) { - equal = false; - break; - } - } - } - if (equal) { - curveName = c; - break; - } - } - } - return (curveName); -} - -function readPkcs8ECDSAPrivate(der) { - var curveName = readECDSACurve(der); - assert.string(curveName, 'a known elliptic curve'); - - der.readSequence(asn1.Ber.OctetString); - der.readSequence(); - - var version = readMPInt(der, 'version'); - assert.equal(version[0], 1, 'unknown version of ECDSA key'); - - var d = der.readString(asn1.Ber.OctetString, true); - der.readSequence(0xa1); - - var Q = der.readString(asn1.Ber.BitString, true); - Q = utils.ecNormalize(Q); - - var key = { - type: 'ecdsa', - parts: [ - { name: 'curve', data: new Buffer(curveName) }, - { name: 'Q', data: Q }, - { name: 'd', data: d } - ] - }; - - return (new PrivateKey(key)); -} - -function readPkcs8ECDSAPublic(der) { - var curveName = readECDSACurve(der); - assert.string(curveName, 'a known elliptic curve'); - - var Q = der.readString(asn1.Ber.BitString, true); - Q = utils.ecNormalize(Q); - - var key = { - type: 'ecdsa', - parts: [ - { name: 'curve', data: new Buffer(curveName) }, - { name: 'Q', data: Q } - ] - }; - - return (new Key(key)); -} - -function writePkcs8(der, key) { - der.startSequence(); - - if (PrivateKey.isPrivateKey(key)) { - var sillyInt = new Buffer(1); - sillyInt[0] = 0x0; - der.writeBuffer(sillyInt, asn1.Ber.Integer); - } - - der.startSequence(); - switch (key.type) { - case 'rsa': - der.writeOID('1.2.840.113549.1.1.1'); - if (PrivateKey.isPrivateKey(key)) - writePkcs8RSAPrivate(key, der); - else - writePkcs8RSAPublic(key, der); - break; - case 'dsa': - der.writeOID('1.2.840.10040.4.1'); - if (PrivateKey.isPrivateKey(key)) - writePkcs8DSAPrivate(key, der); - else - writePkcs8DSAPublic(key, der); - break; - case 'ecdsa': - der.writeOID('1.2.840.10045.2.1'); - if (PrivateKey.isPrivateKey(key)) - writePkcs8ECDSAPrivate(key, der); - else - writePkcs8ECDSAPublic(key, der); - break; - default: - throw (new Error('Unsupported key type: ' + key.type)); - } - - der.endSequence(); -} - -function writePkcs8RSAPrivate(key, der) { - der.writeNull(); - der.endSequence(); - - der.startSequence(asn1.Ber.OctetString); - der.startSequence(); - - var version = new Buffer(1); - version[0] = 0; - der.writeBuffer(version, asn1.Ber.Integer); - - der.writeBuffer(key.part.n.data, asn1.Ber.Integer); - der.writeBuffer(key.part.e.data, asn1.Ber.Integer); - der.writeBuffer(key.part.d.data, asn1.Ber.Integer); - der.writeBuffer(key.part.p.data, asn1.Ber.Integer); - der.writeBuffer(key.part.q.data, asn1.Ber.Integer); - if (!key.part.dmodp || !key.part.dmodq) - utils.addRSAMissing(key); - der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer); - der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer); - der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer); - - der.endSequence(); - der.endSequence(); -} - -function writePkcs8RSAPublic(key, der) { - der.writeNull(); - der.endSequence(); - - der.startSequence(asn1.Ber.BitString); - der.writeByte(0x00); - - der.startSequence(); - der.writeBuffer(key.part.n.data, asn1.Ber.Integer); - der.writeBuffer(key.part.e.data, asn1.Ber.Integer); - der.endSequence(); - - der.endSequence(); -} - -function writePkcs8DSAPrivate(key, der) { - der.startSequence(); - der.writeBuffer(key.part.p.data, asn1.Ber.Integer); - der.writeBuffer(key.part.q.data, asn1.Ber.Integer); - der.writeBuffer(key.part.g.data, asn1.Ber.Integer); - der.endSequence(); - - der.endSequence(); - - der.startSequence(asn1.Ber.OctetString); - der.writeBuffer(key.part.x.data, asn1.Ber.Integer); - der.endSequence(); -} - -function writePkcs8DSAPublic(key, der) { - der.startSequence(); - der.writeBuffer(key.part.p.data, asn1.Ber.Integer); - der.writeBuffer(key.part.q.data, asn1.Ber.Integer); - der.writeBuffer(key.part.g.data, asn1.Ber.Integer); - der.endSequence(); - der.endSequence(); - - der.startSequence(asn1.Ber.BitString); - der.writeByte(0x00); - der.writeBuffer(key.part.y.data, asn1.Ber.Integer); - der.endSequence(); -} - -function writeECDSACurve(key, der) { - var curve = algs.curves[key.curve]; - if (curve.pkcs8oid) { - /* This one has a name in pkcs#8, so just write the oid */ - der.writeOID(curve.pkcs8oid); - - } else { - // ECParameters sequence - der.startSequence(); - - var version = new Buffer(1); - version.writeUInt8(1, 0); - der.writeBuffer(version, asn1.Ber.Integer); - - // FieldID sequence - der.startSequence(); - der.writeOID('1.2.840.10045.1.1'); // prime-field - der.writeBuffer(curve.p, asn1.Ber.Integer); - der.endSequence(); - - // Curve sequence - der.startSequence(); - var a = curve.p; - if (a[0] === 0x0) - a = a.slice(1); - der.writeBuffer(a, asn1.Ber.OctetString); - der.writeBuffer(curve.b, asn1.Ber.OctetString); - der.writeBuffer(curve.s, asn1.Ber.BitString); - der.endSequence(); - - der.writeBuffer(curve.G, asn1.Ber.OctetString); - der.writeBuffer(curve.n, asn1.Ber.Integer); - var h = curve.h; - if (!h) { - h = new Buffer(1); - h[0] = 1; - } - der.writeBuffer(h, asn1.Ber.Integer); - - // ECParameters - der.endSequence(); - } -} - -function writePkcs8ECDSAPublic(key, der) { - writeECDSACurve(key, der); - der.endSequence(); - - var Q = utils.ecNormalize(key.part.Q.data, true); - der.writeBuffer(Q, asn1.Ber.BitString); -} - -function writePkcs8ECDSAPrivate(key, der) { - writeECDSACurve(key, der); - der.endSequence(); - - der.startSequence(asn1.Ber.OctetString); - der.startSequence(); - - var version = new Buffer(1); - version[0] = 1; - der.writeBuffer(version, asn1.Ber.Integer); - - der.writeBuffer(key.part.d.data, asn1.Ber.OctetString); - - der.startSequence(0xa1); - var Q = utils.ecNormalize(key.part.Q.data, true); - der.writeBuffer(Q, asn1.Ber.BitString); - der.endSequence(); - - der.endSequence(); - der.endSequence(); -} - - -/***/ }), -/* 119 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2017 Joyent, Inc. - -module.exports = Identity; - -var assert = __webpack_require__(11); -var algs = __webpack_require__(22); -var crypto = __webpack_require__(8); -var Fingerprint = __webpack_require__(117); -var Signature = __webpack_require__(46); -var errs = __webpack_require__(45); -var util = __webpack_require__(2); -var utils = __webpack_require__(19); -var asn1 = __webpack_require__(50); - -/*JSSTYLED*/ -var DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i; - -var oids = {}; -oids.cn = '2.5.4.3'; -oids.o = '2.5.4.10'; -oids.ou = '2.5.4.11'; -oids.l = '2.5.4.7'; -oids.s = '2.5.4.8'; -oids.c = '2.5.4.6'; -oids.sn = '2.5.4.4'; -oids.dc = '0.9.2342.19200300.100.1.25'; -oids.uid = '0.9.2342.19200300.100.1.1'; -oids.mail = '0.9.2342.19200300.100.1.3'; - -var unoids = {}; -Object.keys(oids).forEach(function (k) { - unoids[oids[k]] = k; -}); - -function Identity(opts) { - var self = this; - assert.object(opts, 'options'); - assert.arrayOfObject(opts.components, 'options.components'); - this.components = opts.components; - this.componentLookup = {}; - this.components.forEach(function (c) { - if (c.name && !c.oid) - c.oid = oids[c.name]; - if (c.oid && !c.name) - c.name = unoids[c.oid]; - if (self.componentLookup[c.name] === undefined) - self.componentLookup[c.name] = []; - self.componentLookup[c.name].push(c); - }); - if (this.componentLookup.cn && this.componentLookup.cn.length > 0) { - this.cn = this.componentLookup.cn[0].value; - } - assert.optionalString(opts.type, 'options.type'); - if (opts.type === undefined) { - if (this.components.length === 1 && - this.componentLookup.cn && - this.componentLookup.cn.length === 1 && - this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { - this.type = 'host'; - this.hostname = this.componentLookup.cn[0].value; - - } else if (this.componentLookup.dc && - this.components.length === this.componentLookup.dc.length) { - this.type = 'host'; - this.hostname = this.componentLookup.dc.map( - function (c) { - return (c.value); - }).join('.'); - - } else if (this.componentLookup.uid && - this.components.length === - this.componentLookup.uid.length) { - this.type = 'user'; - this.uid = this.componentLookup.uid[0].value; - - } else if (this.componentLookup.cn && - this.componentLookup.cn.length === 1 && - this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { - this.type = 'host'; - this.hostname = this.componentLookup.cn[0].value; - - } else if (this.componentLookup.uid && - this.componentLookup.uid.length === 1) { - this.type = 'user'; - this.uid = this.componentLookup.uid[0].value; - - } else if (this.componentLookup.mail && - this.componentLookup.mail.length === 1) { - this.type = 'email'; - this.email = this.componentLookup.mail[0].value; - - } else if (this.componentLookup.cn && - this.componentLookup.cn.length === 1) { - this.type = 'user'; - this.uid = this.componentLookup.cn[0].value; - - } else { - this.type = 'unknown'; - } - } else { - this.type = opts.type; - if (this.type === 'host') - this.hostname = opts.hostname; - else if (this.type === 'user') - this.uid = opts.uid; - else if (this.type === 'email') - this.email = opts.email; - else - throw (new Error('Unknown type ' + this.type)); - } -} - -Identity.prototype.toString = function () { - return (this.components.map(function (c) { - return (c.name.toUpperCase() + '=' + c.value); - }).join(', ')); -}; - -/* - * These are from X.680 -- PrintableString allowed chars are in section 37.4 - * table 8. Spec for IA5Strings is "1,6 + SPACE + DEL" where 1 refers to - * ISO IR #001 (standard ASCII control characters) and 6 refers to ISO IR #006 - * (the basic ASCII character set). - */ -/* JSSTYLED */ -var NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\/:=?-]/; -/* JSSTYLED */ -var NOT_IA5 = /[^\x00-\x7f]/; - -Identity.prototype.toAsn1 = function (der, tag) { - der.startSequence(tag); - this.components.forEach(function (c) { - der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set); - der.startSequence(); - der.writeOID(c.oid); - /* - * If we fit in a PrintableString, use that. Otherwise use an - * IA5String or UTF8String. - */ - if (c.value.match(NOT_IA5)) { - var v = new Buffer(c.value, 'utf8'); - der.writeBuffer(v, asn1.Ber.Utf8String); - } else if (c.value.match(NOT_PRINTABLE)) { - der.writeString(c.value, asn1.Ber.IA5String); - } else { - der.writeString(c.value, asn1.Ber.PrintableString); - } - der.endSequence(); - der.endSequence(); - }); - der.endSequence(); -}; - -function globMatch(a, b) { - if (a === '**' || b === '**') - return (true); - var aParts = a.split('.'); - var bParts = b.split('.'); - if (aParts.length !== bParts.length) - return (false); - for (var i = 0; i < aParts.length; ++i) { - if (aParts[i] === '*' || bParts[i] === '*') - continue; - if (aParts[i] !== bParts[i]) - return (false); - } - return (true); -} - -Identity.prototype.equals = function (other) { - if (!Identity.isIdentity(other, [1, 0])) - return (false); - if (other.components.length !== this.components.length) - return (false); - for (var i = 0; i < this.components.length; ++i) { - if (this.components[i].oid !== other.components[i].oid) - return (false); - if (!globMatch(this.components[i].value, - other.components[i].value)) { - return (false); - } - } - return (true); -}; - -Identity.forHost = function (hostname) { - assert.string(hostname, 'hostname'); - return (new Identity({ - type: 'host', - hostname: hostname, - components: [ { name: 'cn', value: hostname } ] - })); -}; - -Identity.forUser = function (uid) { - assert.string(uid, 'uid'); - return (new Identity({ - type: 'user', - uid: uid, - components: [ { name: 'uid', value: uid } ] - })); -}; - -Identity.forEmail = function (email) { - assert.string(email, 'email'); - return (new Identity({ - type: 'email', - email: email, - components: [ { name: 'mail', value: email } ] - })); -}; - -Identity.parseDN = function (dn) { - assert.string(dn, 'dn'); - var parts = dn.split(','); - var cmps = parts.map(function (c) { - c = c.trim(); - var eqPos = c.indexOf('='); - var name = c.slice(0, eqPos).toLowerCase(); - var value = c.slice(eqPos + 1); - return ({ name: name, value: value }); - }); - return (new Identity({ components: cmps })); -}; - -Identity.parseAsn1 = function (der, top) { - var components = []; - der.readSequence(top); - var end = der.offset + der.length; - while (der.offset < end) { - der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set); - var after = der.offset + der.length; - der.readSequence(); - var oid = der.readOID(); - var type = der.peek(); - var value; - switch (type) { - case asn1.Ber.PrintableString: - case asn1.Ber.IA5String: - case asn1.Ber.OctetString: - case asn1.Ber.T61String: - value = der.readString(type); - break; - case asn1.Ber.Utf8String: - value = der.readString(type, true); - value = value.toString('utf8'); - break; - case asn1.Ber.CharacterString: - case asn1.Ber.BMPString: - value = der.readString(type, true); - value = value.toString('utf16le'); - break; - default: - throw (new Error('Unknown asn1 type ' + type)); - } - components.push({ oid: oid, value: value }); - der._offset = after; - } - der._offset = end; - return (new Identity({ - components: components - })); -}; - -Identity.isIdentity = function (obj, ver) { - return (utils.isCompatible(obj, Identity, ver)); -}; - -/* - * API versions for Identity: - * [1,0] -- initial ver - */ -Identity.prototype._sshpkApiVersion = [1, 0]; - -Identity._oldVersionDetect = function (obj) { - return ([1, 0]); -}; - - -/***/ }), -/* 120 */ -/***/ (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; -}; - - -/***/ }), -/* 121 */ -/***/ (function(module, exports) { - -module.exports = require("buffer"); - -/***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.Add = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); -} - -let run = exports.run = (() => { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (!args.length) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('missingAddDependencies')); - } - - const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); - - yield (0, (_install || _load_install()).wrapLifecycle)(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const install = new Add(args, flags, config, reporter, lockfile); - yield install.init(); - })); - }); - - return function run(_x, _x2, _x3, _x4) { - return _ref2.apply(this, arguments); - }; -})(); - -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; - -var _lockfile; - -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(12)); -} - -var _normalizePattern2; - -function _load_normalizePattern() { - return _normalizePattern2 = __webpack_require__(31); -} - -var _workspaceLayout; - -function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(81)); -} - -var _index; - -function _load_index() { - return _index = __webpack_require__(36); -} - -var _list; - -function _load_list() { - return _list = __webpack_require__(259); -} - -var _install; - -function _load_install() { - return _install = __webpack_require__(28); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); -} - -var _invariant; - -function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(6)); -} - -var _path; - -function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(0)); -} - -var _semver; - -function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(17)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -class Add extends (_install || _load_install()).Install { - constructor(args, flags, config, reporter, lockfile) { - super(flags, config, reporter, lockfile); - this.args = args; - // only one flag is supported, so we can figure out which one was passed to `yarn add` - this.flagToOrigin = [flags.dev && 'devDependencies', flags.optional && 'optionalDependencies', flags.peer && 'peerDependencies', 'dependencies'].filter(Boolean).shift(); - } - - /** - * TODO - */ - - prepareRequests(requests) { - const requestsWithArgs = requests.slice(); - - for (const pattern of this.args) { - requestsWithArgs.push({ - pattern, - registry: 'npm', - optional: false - }); - } - return requestsWithArgs; - } - - /** - * returns version for a pattern based on Manifest - */ - getPatternVersion(pattern, pkg) { - const tilde = this.flags.tilde; - const configPrefix = String(this.config.getOption('save-prefix')); - const exact = this.flags.exact || Boolean(this.config.getOption('save-exact')) || configPrefix === ''; - - var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern); - - const hasVersion = _normalizePattern.hasVersion, - range = _normalizePattern.range; - - let version; - - if ((0, (_index || _load_index()).getExoticResolver)(pattern)) { - // wasn't a name/range tuple so this is just a raw exotic pattern - version = pattern; - } else if (hasVersion && range && ((_semver || _load_semver()).default.satisfies(pkg.version, range) || (0, (_index || _load_index()).getExoticResolver)(range))) { - // if the user specified a range then use it verbatim - version = range; - } else { - let prefix; - if (tilde) { - prefix = '~'; - } else if (exact) { - prefix = ''; - } else { - prefix = configPrefix || '^'; - } - - version = `${prefix}${pkg.version}`; - } - return version; - } - - preparePatterns(patterns) { - const preparedPatterns = patterns.slice(); - for (const pattern of this.resolver.dedupePatterns(this.args)) { - const pkg = this.resolver.getResolvedPattern(pattern); - (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${pattern}`); - const version = this.getPatternVersion(pattern, pkg); - const newPattern = `${pkg.name}@${version}`; - preparedPatterns.push(newPattern); - this.addedPatterns.push(newPattern); - if (newPattern === pattern) { - continue; - } - this.resolver.replacePattern(pattern, newPattern); - } - return preparedPatterns; - } - - bailout(patterns, workspaceLayout) { - var _this = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const lockfileCache = _this.lockfile.cache; - if (!lockfileCache) { - return false; - } - const match = yield _this.integrityChecker.check(patterns, lockfileCache, _this.flags, workspaceLayout); - const haveLockfile = yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(_this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); - if (match.integrityFileMissing && haveLockfile) { - // Integrity file missing, force script installations - _this.scripts.setForce(true); - } - return false; - })(); - } - - /** - * Description - */ - - init() { - var _this2 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const isWorkspaceRoot = _this2.config.workspaceRootFolder && _this2.config.cwd === _this2.config.workspaceRootFolder; - - // running "yarn add something" in a workspace root is often a mistake - if (isWorkspaceRoot && !_this2.flags.ignoreWorkspaceRootCheck) { - throw new (_errors || _load_errors()).MessageError(_this2.reporter.lang('workspacesAddRootCheck')); - } - - _this2.addedPatterns = []; - const patterns = yield (_install || _load_install()).Install.prototype.init.call(_this2); - yield _this2.maybeOutputSaveTree(patterns); - yield _this2.savePackages(); - return patterns; - })(); - } - - /** - * Description - */ - - fetchRequestFromCwd() { - return (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(this, this.args); - } - - /** - * Output a tree of any newly added dependencies. - */ - - maybeOutputSaveTree(patterns) { - var _this3 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // don't limit the shown tree depth - const opts = { - reqDepth: 0 - }; - - var _ref = yield (0, (_list || _load_list()).buildTree)(_this3.resolver, _this3.linker, patterns, opts, true, true); - - const trees = _ref.trees, - count = _ref.count; - - _this3.reporter.success(count === 1 ? _this3.reporter.lang('savedNewDependency') : _this3.reporter.lang('savedNewDependencies', count)); - _this3.reporter.tree('newDependencies', trees); - })(); - } - - /** - * Save added packages to manifest if any of the --save flags were used. - */ - - savePackages() { - var _this4 = this; - - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // fill rootPatternsToOrigin without `excludePatterns` - yield (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(_this4); - const patternOrigins = Object.keys(_this4.rootPatternsToOrigin); - - // get all the different registry manifests in this folder - const manifests = yield _this4.config.getRootManifests(); - - // add new patterns to their appropriate registry manifest - for (const pattern of _this4.addedPatterns) { - const pkg = _this4.resolver.getResolvedPattern(pattern); - (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${pattern}`); - const version = _this4.getPatternVersion(pattern, pkg); - const ref = pkg._reference; - (0, (_invariant || _load_invariant()).default)(ref, 'expected package reference'); - // lookup the package to determine dependency type; used during `yarn upgrade` - const depType = patternOrigins.reduce(function (acc, prev) { - if (prev.indexOf(`${pkg.name}@`) === 0) { - return _this4.rootPatternsToOrigin[prev]; - } - return acc; - }, null); - - // depType is calculated when `yarn upgrade` command is used - const target = depType || _this4.flagToOrigin; - - // add it to manifest - const object = manifests[ref.registry].object; - - - object[target] = object[target] || {}; - object[target][pkg.name] = version; - - if (target !== _this4.flagToOrigin) { - _this4.reporter.warn(_this4.reporter.lang('moduleAlreadyInManifest', pkg.name, depType, _this4.flagToOrigin)); - } - } - - yield _this4.config.saveRootManifests(manifests); - })(); - } -} - -exports.Add = Add; -function hasWrapper(commander) { - return true; -} - -function setFlags(commander) { - commander.usage('add [packages ...] [flags]'); - commander.option('-W, --ignore-workspace-root-check', 'required to run yarn add inside a workspace root'); - commander.option('-D, --dev', 'save package to your `devDependencies`'); - commander.option('-P, --peer', 'save package to your `peerDependencies`'); - commander.option('-O, --optional', 'save package to your `optionalDependencies`'); - commander.option('-E, --exact', 'install exact version'); - commander.option('-T, --tilde', 'install most recent release with the same minor version'); -} - -/***/ }), -/* 123 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); -} - -var _index; - -function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(169)); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const path = __webpack_require__(0); -/* eslint no-unused-vars: 0 */ - -class BaseFetcher { - constructor(dest, remote, config) { - this.reporter = config.reporter; - this.packageName = remote.packageName; - this.reference = remote.reference; - this.registry = remote.registry; - this.hash = remote.hash; - this.remote = remote; - this.config = config; - this.dest = dest; - } - - setupMirrorFromCache() { - // fetcher subclasses may use this to perform actions such as copying over a cached tarball to the offline - // mirror etc - return Promise.resolve(); - } - - _fetch() { - return Promise.reject(new Error('Not implemented')); - } - - fetch(defaultManifest) { - var _this = this; - - const dest = this.dest; - - return (_fs || _load_fs()).lockQueue.push(dest, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield (_fs || _load_fs()).mkdirp(dest); - - // fetch package and get the hash - - var _ref2 = yield _this._fetch(); - - const hash = _ref2.hash; - - - const pkg = yield (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - // load the new normalized manifest - try { - return yield _this.config.readManifest(dest, _this.registry); - } catch (e) { - if (e.code === 'ENOENT' && defaultManifest) { - return (0, (_index || _load_index()).default)(defaultManifest, dest, _this.config, false); - } else { - throw e; - } - } - })(); - - yield (_fs || _load_fs()).writeFile(path.join(dest, (_constants || _load_constants()).METADATA_FILENAME), JSON.stringify({ - manifest: pkg, - artifacts: [], - remote: _this.remote, - registry: _this.registry, - hash - }, null, ' ')); - - return { - hash, - dest, - package: pkg, - cached: false - }; - })); - } -} -exports.default = BaseFetcher; - -/***/ }), -/* 124 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.hash = hash; -const crypto = __webpack_require__(8); -const stream = __webpack_require__(25); - -function hash(content) { - let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md5'; - - return crypto.createHash(type).update(content).digest('hex'); -} - -class HashStream extends stream.Transform { - constructor(options) { - super(options); - this._hash = crypto.createHash('sha1'); - this._updated = false; - } - - _transform(chunk, encoding, callback) { - this._updated = true; - this._hash.update(chunk); - callback(null, chunk); - } - - getHash() { - return this._hash.digest('hex'); - } - - test(sum) { - return this._updated && sum === this.getHash(); - } -} -exports.HashStream = HashStream; - -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -// Load modules - -var Http = __webpack_require__(49); -var Hoek = __webpack_require__(134); - - -// Declare internals - -var internals = {}; - -exports.wrap = function (error, statusCode, message) { - - Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object'); - return (error.isBoom ? error : internals.initialize(error, statusCode || 500, message)); -}; - - -exports.create = function (statusCode, message, data) { - - return internals.create(statusCode, message, data, exports.create); -}; - -internals.create = function (statusCode, message, data, ctor) { - - var error = new Error(message ? message : undefined); // Avoids settings null message - Error.captureStackTrace(error, ctor); // Filter the stack to our external API - error.data = data || null; - internals.initialize(error, statusCode); - return error; -}; - -internals.initialize = function (error, statusCode, message) { - - var numberCode = parseInt(statusCode, 10); - Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode); - - error.isBoom = true; - error.isServer = numberCode >= 500; - - if (!error.hasOwnProperty('data')) { - error.data = null; - } - - error.output = { - statusCode: numberCode, - payload: {}, - headers: {} - }; - - error.reformat = internals.reformat; - error.reformat(); - - if (!message && - !error.message) { - - message = error.output.payload.error; - } - - if (message) { - error.message = (message + (error.message ? ': ' + error.message : '')); - } - - return error; -}; - - -internals.reformat = function () { - - this.output.payload.statusCode = this.output.statusCode; - this.output.payload.error = Http.STATUS_CODES[this.output.statusCode] || 'Unknown'; - - if (this.output.statusCode === 500) { - this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user - } - else if (this.message) { - this.output.payload.message = this.message; - } -}; - - -// 4xx Client Errors - -exports.badRequest = function (message, data) { - - return internals.create(400, message, data, exports.badRequest); -}; - - -exports.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[]) - - var err = internals.create(401, message, undefined, exports.unauthorized); - - if (!scheme) { - return err; - } - - var wwwAuthenticate = ''; - var i = 0; - var il = 0; - - if (typeof scheme === 'string') { - - // function (message, scheme, attributes) - - wwwAuthenticate = scheme; - - if (attributes || message) { - err.output.payload.attributes = {}; - } - - if (attributes) { - var names = Object.keys(attributes); - for (i = 0, il = names.length; i < il; ++i) { - var name = names[i]; - if (i) { - wwwAuthenticate += ','; - } - - var value = attributes[name]; - if (value === null || - value === undefined) { // Value can be zero - - value = ''; - } - wwwAuthenticate += ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"'; - err.output.payload.attributes[name] = value; - } - } - - if (message) { - if (attributes) { - wwwAuthenticate += ','; - } - wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"'; - err.output.payload.attributes.error = message; - } - else { - err.isMissing = true; - } - } - else { - - // function (message, wwwAuthenticate[]) - - var wwwArray = scheme; - for (i = 0, il = wwwArray.length; i < il; ++i) { - if (i) { - wwwAuthenticate += ', '; - } - - wwwAuthenticate += wwwArray[i]; - } - } - - err.output.headers['WWW-Authenticate'] = wwwAuthenticate; - - return err; -}; - - -exports.forbidden = function (message, data) { - - return internals.create(403, message, data, exports.forbidden); -}; - - -exports.notFound = function (message, data) { - - return internals.create(404, message, data, exports.notFound); -}; - - -exports.methodNotAllowed = function (message, data) { - - return internals.create(405, message, data, exports.methodNotAllowed); -}; - - -exports.notAcceptable = function (message, data) { - - return internals.create(406, message, data, exports.notAcceptable); -}; - - -exports.proxyAuthRequired = function (message, data) { - - return internals.create(407, message, data, exports.proxyAuthRequired); -}; - - -exports.clientTimeout = function (message, data) { - - return internals.create(408, message, data, exports.clientTimeout); -}; - - -exports.conflict = function (message, data) { - - return internals.create(409, message, data, exports.conflict); -}; - - -exports.resourceGone = function (message, data) { - - return internals.create(410, message, data, exports.resourceGone); -}; - - -exports.lengthRequired = function (message, data) { - - return internals.create(411, message, data, exports.lengthRequired); -}; - - -exports.preconditionFailed = function (message, data) { - - return internals.create(412, message, data, exports.preconditionFailed); -}; - - -exports.entityTooLarge = function (message, data) { - - return internals.create(413, message, data, exports.entityTooLarge); -}; - - -exports.uriTooLong = function (message, data) { - - return internals.create(414, message, data, exports.uriTooLong); -}; - - -exports.unsupportedMediaType = function (message, data) { - - return internals.create(415, message, data, exports.unsupportedMediaType); -}; - - -exports.rangeNotSatisfiable = function (message, data) { - - return internals.create(416, message, data, exports.rangeNotSatisfiable); -}; - - -exports.expectationFailed = function (message, data) { - - return internals.create(417, message, data, exports.expectationFailed); -}; - -exports.badData = function (message, data) { - - return internals.create(422, message, data, exports.badData); -}; - - -exports.preconditionRequired = function (message, data) { - - return internals.create(428, message, data, exports.preconditionRequired); -}; - - -exports.tooManyRequests = function (message, data) { - - return internals.create(429, message, data, exports.tooManyRequests); -}; - - -// 5xx Server Errors - -exports.internal = function (message, data, statusCode) { - - return internals.serverError(message, data, statusCode, exports.internal); -}; - -internals.serverError = function (message, data, statusCode, ctor) { - - var error; - if (data instanceof Error) { - error = exports.wrap(data, statusCode, message); - } else { - error = internals.create(statusCode || 500, message, undefined, ctor); - error.data = data; - } - - return error; -}; - - -exports.notImplemented = function (message, data) { - - return internals.serverError(message, data, 501, exports.notImplemented); -}; - - -exports.badGateway = function (message, data) { - - return internals.serverError(message, data, 502, exports.badGateway); -}; - - -exports.serverTimeout = function (message, data) { - - return internals.serverError(message, data, 503, exports.serverTimeout); -}; - - -exports.gatewayTimeout = function (message, data) { - - return internals.serverError(message, data, 504, exports.gatewayTimeout); -}; - - -exports.badImplementation = function (message, data) { - - var err = internals.serverError(message, data, 500, exports.badImplementation); - err.isDeveloperError = true; - return err; -}; - - -/***/ }), -/* 126 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const escapeStringRegexp = __webpack_require__(207); -const ansiStyles = __webpack_require__(374); -const supportsColor = __webpack_require__(460); - -const template = __webpack_require__(461); - -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 = supportsColor ? supportsColor.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], key); - } - }; -} - -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], 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], model); - }; - } - }; -} - -const proto = Object.defineProperties(() => {}, styles); - -function build(_styles, key) { - const builder = function () { - return applyStyle.apply(builder, arguments); - }; - - builder._styles = _styles; - - 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 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 = supportsColor; - - -/***/ }), -/* 127 */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = __webpack_require__(42); -module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ - return cof(it) == 'String' ? it.split('') : Object(it); -}; - -/***/ }), -/* 128 */ -/***/ (function(module, exports, __webpack_require__) { - -// check on default Array iterator -var Iterators = __webpack_require__(32) - , ITERATOR = __webpack_require__(9)('iterator') - , ArrayProto = Array.prototype; - -module.exports = function(it){ - return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); -}; - -/***/ }), -/* 129 */ -/***/ (function(module, exports, __webpack_require__) { - -// call something on iterator step with safe closing on error -var anObject = __webpack_require__(26); -module.exports = function(iterator, fn, value, entries){ - try { - return entries ? fn(anObject(value)[0], value[1]) : fn(value); - // 7.4.6 IteratorClose(iterator, completion) - } catch(e){ - var ret = iterator['return']; - if(ret !== undefined)anObject(ret.call(iterator)); - throw e; - } -}; - -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { - -var ITERATOR = __webpack_require__(9)('iterator') - , SAFE_CLOSING = false; - -try { - var riter = [7][ITERATOR](); - riter['return'] = function(){ SAFE_CLOSING = true; }; - Array.from(riter, function(){ throw 2; }); -} catch(e){ /* empty */ } - -module.exports = function(exec, skipClosing){ - if(!skipClosing && !SAFE_CLOSING)return false; - var safe = false; - try { - var arr = [7] - , iter = arr[ITERATOR](); - iter.next = function(){ return {done: safe = true}; }; - arr[ITERATOR] = function(){ return iter; }; - exec(arr); - } catch(e){ /* empty */ } - return safe; -}; - -/***/ }), -/* 131 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = __webpack_require__(193) - , enumBugKeys = __webpack_require__(100); - -module.exports = Object.keys || function keys(O){ - return $keys(O, enumBugKeys); -}; - -/***/ }), -/* 132 */ -/***/ (function(module, exports, __webpack_require__) { - -// Basic Javascript Elliptic Curve implementation -// Ported loosely from BouncyCastle's Java EC code -// Only Fp curves implemented for now - -// Requires jsbn.js and jsbn2.js -var BigInteger = __webpack_require__(56).BigInteger -var Barrett = BigInteger.prototype.Barrett - -// ---------------- -// ECFieldElementFp - -// constructor -function ECFieldElementFp(q,x) { - this.x = x; - // TODO if(x.compareTo(q) >= 0) error - this.q = q; -} - -function feFpEquals(other) { - if(other == this) return true; - return (this.q.equals(other.q) && this.x.equals(other.x)); -} - -function feFpToBigInteger() { - return this.x; -} - -function feFpNegate() { - return new ECFieldElementFp(this.q, this.x.negate().mod(this.q)); -} - -function feFpAdd(b) { - return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q)); -} - -function feFpSubtract(b) { - return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q)); -} - -function feFpMultiply(b) { - return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q)); -} - -function feFpSquare() { - return new ECFieldElementFp(this.q, this.x.square().mod(this.q)); -} - -function feFpDivide(b) { - return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q)); -} - -ECFieldElementFp.prototype.equals = feFpEquals; -ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger; -ECFieldElementFp.prototype.negate = feFpNegate; -ECFieldElementFp.prototype.add = feFpAdd; -ECFieldElementFp.prototype.subtract = feFpSubtract; -ECFieldElementFp.prototype.multiply = feFpMultiply; -ECFieldElementFp.prototype.square = feFpSquare; -ECFieldElementFp.prototype.divide = feFpDivide; - -// ---------------- -// ECPointFp - -// constructor -function ECPointFp(curve,x,y,z) { - this.curve = curve; - this.x = x; - this.y = y; - // Projective coordinates: either zinv == null or z * zinv == 1 - // z and zinv are just BigIntegers, not fieldElements - if(z == null) { - this.z = BigInteger.ONE; - } - else { - this.z = z; - } - this.zinv = null; - //TODO: compression flag -} - -function pointFpGetX() { - if(this.zinv == null) { - this.zinv = this.z.modInverse(this.curve.q); - } - var r = this.x.toBigInteger().multiply(this.zinv); - this.curve.reduce(r); - return this.curve.fromBigInteger(r); -} - -function pointFpGetY() { - if(this.zinv == null) { - this.zinv = this.z.modInverse(this.curve.q); - } - var r = this.y.toBigInteger().multiply(this.zinv); - this.curve.reduce(r); - return this.curve.fromBigInteger(r); -} - -function pointFpEquals(other) { - if(other == this) return true; - if(this.isInfinity()) return other.isInfinity(); - if(other.isInfinity()) return this.isInfinity(); - var u, v; - // u = Y2 * Z1 - Y1 * Z2 - u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q); - if(!u.equals(BigInteger.ZERO)) return false; - // v = X2 * Z1 - X1 * Z2 - v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q); - return v.equals(BigInteger.ZERO); -} - -function pointFpIsInfinity() { - if((this.x == null) && (this.y == null)) return true; - return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO); -} - -function pointFpNegate() { - return new ECPointFp(this.curve, this.x, this.y.negate(), this.z); -} - -function pointFpAdd(b) { - if(this.isInfinity()) return b; - if(b.isInfinity()) return this; - - // u = Y2 * Z1 - Y1 * Z2 - var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q); - // v = X2 * Z1 - X1 * Z2 - var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q); - - if(BigInteger.ZERO.equals(v)) { - if(BigInteger.ZERO.equals(u)) { - return this.twice(); // this == b, so double - } - return this.curve.getInfinity(); // this = -b, so infinity - } - - var THREE = new BigInteger("3"); - var x1 = this.x.toBigInteger(); - var y1 = this.y.toBigInteger(); - var x2 = b.x.toBigInteger(); - var y2 = b.y.toBigInteger(); - - var v2 = v.square(); - var v3 = v2.multiply(v); - var x1v2 = x1.multiply(v2); - var zu2 = u.square().multiply(this.z); - - // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3) - var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q); - // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3 - var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q); - // z3 = v^3 * z1 * z2 - var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q); - - return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); -} - -function pointFpTwice() { - if(this.isInfinity()) return this; - if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity(); - - // TODO: optimized handling of constants - var THREE = new BigInteger("3"); - var x1 = this.x.toBigInteger(); - var y1 = this.y.toBigInteger(); - - var y1z1 = y1.multiply(this.z); - var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q); - var a = this.curve.a.toBigInteger(); - - // w = 3 * x1^2 + a * z1^2 - var w = x1.square().multiply(THREE); - if(!BigInteger.ZERO.equals(a)) { - w = w.add(this.z.square().multiply(a)); - } - w = w.mod(this.curve.q); - //this.curve.reduce(w); - // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1) - var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q); - // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3 - var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q); - // z3 = 8 * (y1 * z1)^3 - var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q); - - return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); -} - -// Simple NAF (Non-Adjacent Form) multiplication algorithm -// TODO: modularize the multiplication algorithm -function pointFpMultiply(k) { - if(this.isInfinity()) return this; - if(k.signum() == 0) return this.curve.getInfinity(); - - var e = k; - var h = e.multiply(new BigInteger("3")); - - var neg = this.negate(); - var R = this; - - var i; - for(i = h.bitLength() - 2; i > 0; --i) { - R = R.twice(); - - var hBit = h.testBit(i); - var eBit = e.testBit(i); - - if (hBit != eBit) { - R = R.add(hBit ? this : neg); - } - } - - return R; -} - -// Compute this*j + x*k (simultaneous multiplication) -function pointFpMultiplyTwo(j,x,k) { - var i; - if(j.bitLength() > k.bitLength()) - i = j.bitLength() - 1; - else - i = k.bitLength() - 1; - - var R = this.curve.getInfinity(); - var both = this.add(x); - while(i >= 0) { - R = R.twice(); - if(j.testBit(i)) { - if(k.testBit(i)) { - R = R.add(both); - } - else { - R = R.add(this); - } - } - else { - if(k.testBit(i)) { - R = R.add(x); - } - } - --i; - } - - return R; -} - -ECPointFp.prototype.getX = pointFpGetX; -ECPointFp.prototype.getY = pointFpGetY; -ECPointFp.prototype.equals = pointFpEquals; -ECPointFp.prototype.isInfinity = pointFpIsInfinity; -ECPointFp.prototype.negate = pointFpNegate; -ECPointFp.prototype.add = pointFpAdd; -ECPointFp.prototype.twice = pointFpTwice; -ECPointFp.prototype.multiply = pointFpMultiply; -ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo; - -// ---------------- -// ECCurveFp - -// constructor -function ECCurveFp(q,a,b) { - this.q = q; - this.a = this.fromBigInteger(a); - this.b = this.fromBigInteger(b); - this.infinity = new ECPointFp(this, null, null); - this.reducer = new Barrett(this.q); -} - -function curveFpGetQ() { - return this.q; -} - -function curveFpGetA() { - return this.a; -} - -function curveFpGetB() { - return this.b; -} - -function curveFpEquals(other) { - if(other == this) return true; - return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b)); -} - -function curveFpGetInfinity() { - return this.infinity; -} - -function curveFpFromBigInteger(x) { - return new ECFieldElementFp(this.q, x); -} - -function curveReduce(x) { - this.reducer.reduce(x); -} - -// for now, work with hex strings because they're easier in JS -function curveFpDecodePointHex(s) { - switch(parseInt(s.substr(0,2), 16)) { // first byte - case 0: - return this.infinity; - case 2: - case 3: - // point compression not supported yet - return null; - case 4: - case 6: - case 7: - var len = (s.length - 2) / 2; - var xHex = s.substr(2, len); - var yHex = s.substr(len+2, len); - - return new ECPointFp(this, - this.fromBigInteger(new BigInteger(xHex, 16)), - this.fromBigInteger(new BigInteger(yHex, 16))); - - default: // unsupported - return null; - } -} - -function curveFpEncodePointHex(p) { - if (p.isInfinity()) return "00"; - var xHex = p.getX().toBigInteger().toString(16); - var yHex = p.getY().toBigInteger().toString(16); - var oLen = this.getQ().toString(16).length; - if ((oLen % 2) != 0) oLen++; - while (xHex.length < oLen) { - xHex = "0" + xHex; - } - while (yHex.length < oLen) { - yHex = "0" + yHex; - } - return "04" + xHex + yHex; -} - -ECCurveFp.prototype.getQ = curveFpGetQ; -ECCurveFp.prototype.getA = curveFpGetA; -ECCurveFp.prototype.getB = curveFpGetB; -ECCurveFp.prototype.equals = curveFpEquals; -ECCurveFp.prototype.getInfinity = curveFpGetInfinity; -ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger; -ECCurveFp.prototype.reduce = curveReduce; -//ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex; -ECCurveFp.prototype.encodePointHex = curveFpEncodePointHex; - -// from: https://github.com/kaielvin/jsbn-ec-point-compression -ECCurveFp.prototype.decodePointHex = function(s) -{ - var yIsEven; - switch(parseInt(s.substr(0,2), 16)) { // first byte - case 0: - return this.infinity; - case 2: - yIsEven = false; - case 3: - if(yIsEven == undefined) yIsEven = true; - var len = s.length - 2; - var xHex = s.substr(2, len); - var x = this.fromBigInteger(new BigInteger(xHex,16)); - var alpha = x.multiply(x.square().add(this.getA())).add(this.getB()); - var beta = alpha.sqrt(); - - if (beta == null) throw "Invalid point compression"; - - var betaValue = beta.toBigInteger(); - if (betaValue.testBit(0) != yIsEven) - { - // Use the other root - beta = this.fromBigInteger(this.getQ().subtract(betaValue)); - } - return new ECPointFp(this,x,beta); - case 4: - case 6: - case 7: - var len = (s.length - 2) / 2; - var xHex = s.substr(2, len); - var yHex = s.substr(len+2, len); - - return new ECPointFp(this, - this.fromBigInteger(new BigInteger(xHex, 16)), - this.fromBigInteger(new BigInteger(yHex, 16))); - - default: // unsupported - return null; - } -} -ECCurveFp.prototype.encodeCompressedPointHex = function(p) -{ - if (p.isInfinity()) return "00"; - var xHex = p.getX().toBigInteger().toString(16); - var oLen = this.getQ().toString(16).length; - if ((oLen % 2) != 0) oLen++; - while (xHex.length < oLen) - xHex = "0" + xHex; - var yPrefix; - if(p.getY().toBigInteger().isEven()) yPrefix = "02"; - else yPrefix = "03"; - - return yPrefix + xHex; -} - - -ECFieldElementFp.prototype.getR = function() -{ - if(this.r != undefined) return this.r; - - this.r = null; - var bitLength = this.q.bitLength(); - if (bitLength > 128) - { - var firstWord = this.q.shiftRight(bitLength - 64); - if (firstWord.intValue() == -1) - { - this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q); - } - } - return this.r; -} -ECFieldElementFp.prototype.modMult = function(x1,x2) -{ - return this.modReduce(x1.multiply(x2)); -} -ECFieldElementFp.prototype.modReduce = function(x) -{ - if (this.getR() != null) - { - var qLen = q.bitLength(); - while (x.bitLength() > (qLen + 1)) - { - var u = x.shiftRight(qLen); - var v = x.subtract(u.shiftLeft(qLen)); - if (!this.getR().equals(BigInteger.ONE)) - { - u = u.multiply(this.getR()); - } - x = u.add(v); - } - while (x.compareTo(q) >= 0) - { - x = x.subtract(q); - } - } - else - { - x = x.mod(q); - } - return x; -} -ECFieldElementFp.prototype.sqrt = function() -{ - if (!this.q.testBit(0)) throw "unsupported"; - - // p mod 4 == 3 - if (this.q.testBit(1)) - { - var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q)); - return z.square().equals(this) ? z : null; - } - - // p mod 4 == 1 - var qMinusOne = this.q.subtract(BigInteger.ONE); - - var legendreExponent = qMinusOne.shiftRight(1); - if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE))) - { - return null; - } - - var u = qMinusOne.shiftRight(2); - var k = u.shiftLeft(1).add(BigInteger.ONE); - - var Q = this.x; - var fourQ = modDouble(modDouble(Q)); - - var U, V; - do - { - var P; - do - { - P = new BigInteger(this.q.bitLength(), new SecureRandom()); - } - while (P.compareTo(this.q) >= 0 - || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne))); - - var result = this.lucasSequence(P, Q, k); - U = result[0]; - V = result[1]; - - if (this.modMult(V, V).equals(fourQ)) - { - // Integer division by 2, mod q - if (V.testBit(0)) - { - V = V.add(q); - } - - V = V.shiftRight(1); - - return new ECFieldElementFp(q,V); - } - } - while (U.equals(BigInteger.ONE) || U.equals(qMinusOne)); - - return null; -} -ECFieldElementFp.prototype.lucasSequence = function(P,Q,k) -{ - var n = k.bitLength(); - var s = k.getLowestSetBit(); - - var Uh = BigInteger.ONE; - var Vl = BigInteger.TWO; - var Vh = P; - var Ql = BigInteger.ONE; - var Qh = BigInteger.ONE; - - for (var j = n - 1; j >= s + 1; --j) - { - Ql = this.modMult(Ql, Qh); - - if (k.testBit(j)) - { - Qh = this.modMult(Ql, Q); - Uh = this.modMult(Uh, Vh); - Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); - Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1))); - } - else - { - Qh = Ql; - Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); - Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); - Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); - } - } - - Ql = this.modMult(Ql, Qh); - Qh = this.modMult(Ql, Q); - Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); - Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); - Ql = this.modMult(Ql, Qh); - - for (var j = 1; j <= s; ++j) - { - Uh = this.modMult(Uh, Vl); - Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); - Ql = this.modMult(Ql, Ql); - } - - return [ Uh, Vl ]; -} - -var exports = { - ECCurveFp: ECCurveFp, - ECPointFp: ECPointFp, - ECFieldElementFp: ECFieldElementFp -} - -module.exports = exports - - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -// Load modules - -var Sntp = __webpack_require__(318); -var Boom = __webpack_require__(125); - - -// Declare internals - -var internals = {}; - - -exports.version = function () { - - return __webpack_require__(536).version; -}; - - -exports.limits = { - maxMatchLength: 4096 // Limit the length of uris and headers to avoid a DoS attack on string matching -}; - - -// Extract host and port from request - -// $1 $2 -internals.hostHeaderRegex = /^(?:(?:\r\n)?\s)*((?:[^:]+)|(?:\[[^\]]+\]))(?::(\d+))?(?:(?:\r\n)?\s)*$/; // (IPv4, hostname)|(IPv6) - - -exports.parseHost = function (req, hostHeaderName) { - - hostHeaderName = (hostHeaderName ? hostHeaderName.toLowerCase() : 'host'); - var hostHeader = req.headers[hostHeaderName]; - if (!hostHeader) { - return null; - } - - if (hostHeader.length > exports.limits.maxMatchLength) { - return null; - } - - var hostParts = hostHeader.match(internals.hostHeaderRegex); - if (!hostParts) { - return null; - } - - return { - name: hostParts[1], - port: (hostParts[2] ? hostParts[2] : (req.connection && req.connection.encrypted ? 443 : 80)) - }; -}; - - -// Parse Content-Type header content - -exports.parseContentType = function (header) { - - if (!header) { - return ''; - } - - return header.split(';')[0].trim().toLowerCase(); -}; - - -// Convert node's to request configuration object - -exports.parseRequest = function (req, options) { - - if (!req.headers) { - return req; - } - - // Obtain host and port information - - var host; - if (!options.host || - !options.port) { - - host = exports.parseHost(req, options.hostHeaderName); - if (!host) { - return new Error('Invalid Host header'); - } - } - - var request = { - method: req.method, - url: req.url, - host: options.host || host.name, - port: options.port || host.port, - authorization: req.headers.authorization, - contentType: req.headers['content-type'] || '' - }; - - return request; -}; - - -exports.now = function (localtimeOffsetMsec) { - - return Sntp.now() + (localtimeOffsetMsec || 0); -}; - - -exports.nowSecs = function (localtimeOffsetMsec) { - - return Math.floor(exports.now(localtimeOffsetMsec) / 1000); -}; - - -internals.authHeaderRegex = /^(\w+)(?:\s+(.*))?$/; // Header: scheme[ something] -internals.attributeRegex = /^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/; // !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9 - - -// Parse Hawk HTTP Authorization header - -exports.parseAuthorizationHeader = function (header, keys) { - - keys = keys || ['id', 'ts', 'nonce', 'hash', 'ext', 'mac', 'app', 'dlg']; - - if (!header) { - return Boom.unauthorized(null, 'Hawk'); - } - - if (header.length > exports.limits.maxMatchLength) { - return Boom.badRequest('Header length too long'); - } - - var headerParts = header.match(internals.authHeaderRegex); - if (!headerParts) { - return Boom.badRequest('Invalid header syntax'); - } - - var scheme = headerParts[1]; - if (scheme.toLowerCase() !== 'hawk') { - return Boom.unauthorized(null, 'Hawk'); - } - - var attributesString = headerParts[2]; - if (!attributesString) { - return Boom.badRequest('Invalid header syntax'); - } - - var attributes = {}; - var errorMessage = ''; - var verify = attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g, function ($0, $1, $2) { - - // Check valid attribute names - - if (keys.indexOf($1) === -1) { - errorMessage = 'Unknown attribute: ' + $1; - return; - } - - // Allowed attribute value characters - - if ($2.match(internals.attributeRegex) === null) { - errorMessage = 'Bad attribute value: ' + $1; - return; - } - - // Check for duplicates - - if (attributes.hasOwnProperty($1)) { - errorMessage = 'Duplicate attribute: ' + $1; - return; - } - - attributes[$1] = $2; - return ''; - }); - - if (verify !== '') { - return Boom.badRequest(errorMessage || 'Bad header format'); - } - - return attributes; -}; - - -exports.unauthorized = function (message, attributes) { - - return Boom.unauthorized(message, 'Hawk', attributes); -}; - - - -/***/ }), -/* 134 */ -/***/ (function(module, exports, __webpack_require__) { - -// Load modules - -var Crypto = __webpack_require__(8); -var Path = __webpack_require__(0); -var Util = __webpack_require__(2); -var Escape = __webpack_require__(537); - - -// Declare internals - -var internals = {}; - - -// Clone object or array - -exports.clone = function (obj, seen) { - - if (typeof obj !== 'object' || - obj === null) { - - return obj; - } - - seen = seen || { orig: [], copy: [] }; - - var lookup = seen.orig.indexOf(obj); - if (lookup !== -1) { - return seen.copy[lookup]; - } - - var newObj; - var cloneDeep = false; - - if (!Array.isArray(obj)) { - if (Buffer.isBuffer(obj)) { - newObj = new Buffer(obj); - } - else if (obj instanceof Date) { - newObj = new Date(obj.getTime()); - } - else if (obj instanceof RegExp) { - newObj = new RegExp(obj); - } - else { - var proto = Object.getPrototypeOf(obj); - if (proto && - proto.isImmutable) { - - newObj = obj; - } - else { - newObj = Object.create(proto); - cloneDeep = true; - } - } - } - else { - newObj = []; - cloneDeep = true; - } - - seen.orig.push(obj); - seen.copy.push(newObj); - - if (cloneDeep) { - var keys = Object.getOwnPropertyNames(obj); - for (var i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; - var descriptor = Object.getOwnPropertyDescriptor(obj, key); - if (descriptor && - (descriptor.get || - descriptor.set)) { - - Object.defineProperty(newObj, key, descriptor); - } - else { - newObj[key] = exports.clone(obj[key], seen); - } - } - } - - return newObj; -}; - - -// Merge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied -/*eslint-disable */ -exports.merge = function (target, source, isNullOverride /* = true */, isMergeArrays /* = true */) { -/*eslint-enable */ - exports.assert(target && typeof target === 'object', 'Invalid target value: must be an object'); - exports.assert(source === null || source === undefined || typeof source === 'object', 'Invalid source value: must be null, undefined, or an object'); - - if (!source) { - return target; - } - - if (Array.isArray(source)) { - exports.assert(Array.isArray(target), 'Cannot merge array onto an object'); - if (isMergeArrays === false) { // isMergeArrays defaults to true - target.length = 0; // Must not change target assignment - } - - for (var i = 0, il = source.length; i < il; ++i) { - target.push(exports.clone(source[i])); - } - - return target; - } - - var keys = Object.keys(source); - for (var k = 0, kl = keys.length; k < kl; ++k) { - var key = keys[k]; - var value = source[key]; - if (value && - typeof value === 'object') { - - if (!target[key] || - typeof target[key] !== 'object' || - (Array.isArray(target[key]) ^ Array.isArray(value)) || - value instanceof Date || - Buffer.isBuffer(value) || - value instanceof RegExp) { - - target[key] = exports.clone(value); - } - else { - exports.merge(target[key], value, isNullOverride, isMergeArrays); - } - } - else { - if (value !== null && - value !== undefined) { // Explicit to preserve empty strings - - target[key] = value; - } - else if (isNullOverride !== false) { // Defaults to true - target[key] = value; - } - } - } - - return target; -}; - - -// Apply options to a copy of the defaults - -exports.applyToDefaults = function (defaults, options, isNullOverride) { - - exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object'); - exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object'); - - if (!options) { // If no options, return null - return null; - } - - var copy = exports.clone(defaults); - - if (options === true) { // If options is set to true, use defaults - return copy; - } - - return exports.merge(copy, options, isNullOverride === true, false); -}; - - -// Clone an object except for the listed keys which are shallow copied - -exports.cloneWithShallow = function (source, keys) { - - if (!source || - typeof source !== 'object') { - - return source; - } - - var storage = internals.store(source, keys); // Move shallow copy items to storage - var copy = exports.clone(source); // Deep copy the rest - internals.restore(copy, source, storage); // Shallow copy the stored items and restore - return copy; -}; - - -internals.store = function (source, keys) { - - var storage = {}; - for (var i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; - var value = exports.reach(source, key); - if (value !== undefined) { - storage[key] = value; - internals.reachSet(source, key, undefined); - } - } - - return storage; -}; - - -internals.restore = function (copy, source, storage) { - - var keys = Object.keys(storage); - for (var i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; - internals.reachSet(copy, key, storage[key]); - internals.reachSet(source, key, storage[key]); - } -}; - - -internals.reachSet = function (obj, key, value) { - - var path = key.split('.'); - var ref = obj; - for (var i = 0, il = path.length; i < il; ++i) { - var segment = path[i]; - if (i + 1 === il) { - ref[segment] = value; - } - - ref = ref[segment]; - } -}; - - -// Apply options to defaults except for the listed keys which are shallow copied from option without merging - -exports.applyToDefaultsWithShallow = function (defaults, options, keys) { - - exports.assert(defaults && typeof defaults === 'object', 'Invalid defaults value: must be an object'); - exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object'); - exports.assert(keys && Array.isArray(keys), 'Invalid keys'); - - if (!options) { // If no options, return null - return null; - } - - var copy = exports.cloneWithShallow(defaults, keys); - - if (options === true) { // If options is set to true, use defaults - return copy; - } - - var storage = internals.store(options, keys); // Move shallow copy items to storage - exports.merge(copy, options, false, false); // Deep copy the rest - internals.restore(copy, options, storage); // Shallow copy the stored items and restore - return copy; -}; - - -// Deep object or array comparison - -exports.deepEqual = function (obj, ref, options, seen) { - - options = options || { prototype: true }; - - var type = typeof obj; - - if (type !== typeof ref) { - return false; - } - - if (type !== 'object' || - obj === null || - ref === null) { - - if (obj === ref) { // Copied from Deep-eql, copyright(c) 2013 Jake Luer, jake@alogicalparadox.com, MIT Licensed, https://github.com/chaijs/deep-eql - return obj !== 0 || 1 / obj === 1 / ref; // -0 / +0 - } - - return obj !== obj && ref !== ref; // NaN - } - - seen = seen || []; - if (seen.indexOf(obj) !== -1) { - return true; // If previous comparison failed, it would have stopped execution - } - - seen.push(obj); - - if (Array.isArray(obj)) { - if (!Array.isArray(ref)) { - return false; - } - - if (!options.part && obj.length !== ref.length) { - return false; - } - - for (var i = 0, il = obj.length; i < il; ++i) { - if (options.part) { - var found = false; - for (var r = 0, rl = ref.length; r < rl; ++r) { - if (exports.deepEqual(obj[i], ref[r], options, seen)) { - found = true; - break; - } - } - - return found; - } - - if (!exports.deepEqual(obj[i], ref[i], options, seen)) { - return false; - } - } - - return true; - } - - if (Buffer.isBuffer(obj)) { - if (!Buffer.isBuffer(ref)) { - return false; - } - - if (obj.length !== ref.length) { - return false; - } - - for (var j = 0, jl = obj.length; j < jl; ++j) { - if (obj[j] !== ref[j]) { - return false; - } - } - - return true; - } - - if (obj instanceof Date) { - return (ref instanceof Date && obj.getTime() === ref.getTime()); - } - - if (obj instanceof RegExp) { - return (ref instanceof RegExp && obj.toString() === ref.toString()); - } - - if (options.prototype) { - if (Object.getPrototypeOf(obj) !== Object.getPrototypeOf(ref)) { - return false; - } - } - - var keys = Object.getOwnPropertyNames(obj); - - if (!options.part && keys.length !== Object.getOwnPropertyNames(ref).length) { - return false; - } - - for (var k = 0, kl = keys.length; k < kl; ++k) { - var key = keys[k]; - var descriptor = Object.getOwnPropertyDescriptor(obj, key); - if (descriptor.get) { - if (!exports.deepEqual(descriptor, Object.getOwnPropertyDescriptor(ref, key), options, seen)) { - return false; - } - } - else if (!exports.deepEqual(obj[key], ref[key], options, seen)) { - return false; - } - } - - return true; -}; - - -// Remove duplicate items from array - -exports.unique = function (array, key) { - - var index = {}; - var result = []; - - for (var i = 0, il = array.length; i < il; ++i) { - var id = (key ? array[i][key] : array[i]); - if (index[id] !== true) { - - result.push(array[i]); - index[id] = true; - } - } - - return result; -}; - - -// Convert array into object - -exports.mapToObject = function (array, key) { - - if (!array) { - return null; - } - - var obj = {}; - for (var i = 0, il = array.length; i < il; ++i) { - if (key) { - if (array[i][key]) { - obj[array[i][key]] = true; - } - } - else { - obj[array[i]] = true; - } - } - - return obj; -}; - - -// Find the common unique items in two arrays - -exports.intersect = function (array1, array2, justFirst) { - - if (!array1 || !array2) { - return []; - } - - var common = []; - var hash = (Array.isArray(array1) ? exports.mapToObject(array1) : array1); - var found = {}; - for (var i = 0, il = array2.length; i < il; ++i) { - if (hash[array2[i]] && !found[array2[i]]) { - if (justFirst) { - return array2[i]; - } - - common.push(array2[i]); - found[array2[i]] = true; - } - } - - return (justFirst ? null : common); -}; - - -// Test if the reference contains the values - -exports.contain = function (ref, values, options) { - - /* - string -> string(s) - array -> item(s) - object -> key(s) - object -> object (key:value) - */ - - var valuePairs = null; - if (typeof ref === 'object' && - typeof values === 'object' && - !Array.isArray(ref) && - !Array.isArray(values)) { - - valuePairs = values; - values = Object.keys(values); - } - else { - values = [].concat(values); - } - - options = options || {}; // deep, once, only, part - - exports.assert(arguments.length >= 2, 'Insufficient arguments'); - exports.assert(typeof ref === 'string' || typeof ref === 'object', 'Reference must be string or an object'); - exports.assert(values.length, 'Values array cannot be empty'); - - var compare, compareFlags; - if (options.deep) { - compare = exports.deepEqual; - - var hasOnly = options.hasOwnProperty('only'), hasPart = options.hasOwnProperty('part'); - - compareFlags = { - prototype: hasOnly ? options.only : hasPart ? !options.part : false, - part: hasOnly ? !options.only : hasPart ? options.part : true - }; - } - else { - compare = function (a, b) { - - return a === b; - }; - } - - var misses = false; - var matches = new Array(values.length); - for (var i = 0, il = matches.length; i < il; ++i) { - matches[i] = 0; - } - - if (typeof ref === 'string') { - var pattern = '('; - for (i = 0, il = values.length; i < il; ++i) { - var value = values[i]; - exports.assert(typeof value === 'string', 'Cannot compare string reference to non-string value'); - pattern += (i ? '|' : '') + exports.escapeRegex(value); - } - - var regex = new RegExp(pattern + ')', 'g'); - var leftovers = ref.replace(regex, function ($0, $1) { - - var index = values.indexOf($1); - ++matches[index]; - return ''; // Remove from string - }); - - misses = !!leftovers; - } - else if (Array.isArray(ref)) { - for (i = 0, il = ref.length; i < il; ++i) { - for (var j = 0, jl = values.length, matched = false; j < jl && matched === false; ++j) { - matched = compare(values[j], ref[i], compareFlags) && j; - } - - if (matched !== false) { - ++matches[matched]; - } - else { - misses = true; - } - } - } - else { - var keys = Object.keys(ref); - for (i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; - var pos = values.indexOf(key); - if (pos !== -1) { - if (valuePairs && - !compare(valuePairs[key], ref[key], compareFlags)) { - - return false; - } - - ++matches[pos]; - } - else { - misses = true; - } - } - } - - var result = false; - for (i = 0, il = matches.length; i < il; ++i) { - result = result || !!matches[i]; - if ((options.once && matches[i] > 1) || - (!options.part && !matches[i])) { - - return false; - } - } - - if (options.only && - misses) { - - return false; - } - - return result; -}; - - -// Flatten array - -exports.flatten = function (array, target) { - - var result = target || []; - - for (var i = 0, il = array.length; i < il; ++i) { - if (Array.isArray(array[i])) { - exports.flatten(array[i], result); - } - else { - result.push(array[i]); - } - } - - return result; -}; - - -// Convert an object key chain string ('a.b.c') to reference (object[a][b][c]) - -exports.reach = function (obj, chain, options) { - - if (chain === false || - chain === null || - typeof chain === 'undefined') { - - return obj; - } - - options = options || {}; - if (typeof options === 'string') { - options = { separator: options }; - } - - var path = chain.split(options.separator || '.'); - var ref = obj; - for (var i = 0, il = path.length; i < il; ++i) { - var key = path[i]; - if (key[0] === '-' && Array.isArray(ref)) { - key = key.slice(1, key.length); - key = ref.length - key; - } - - if (!ref || - !ref.hasOwnProperty(key) || - (typeof ref !== 'object' && options.functions === false)) { // Only object and function can have properties - - exports.assert(!options.strict || i + 1 === il, 'Missing segment', key, 'in reach path ', chain); - exports.assert(typeof ref === 'object' || options.functions === true || typeof ref !== 'function', 'Invalid segment', key, 'in reach path ', chain); - ref = options.default; - break; - } - - ref = ref[key]; - } - - return ref; -}; - - -exports.reachTemplate = function (obj, template, options) { - - return template.replace(/{([^}]+)}/g, function ($0, chain) { - - var value = exports.reach(obj, chain, options); - return (value === undefined || value === null ? '' : value); - }); -}; - - -exports.formatStack = function (stack) { - - var trace = []; - for (var i = 0, il = stack.length; i < il; ++i) { - var item = stack[i]; - trace.push([item.getFileName(), item.getLineNumber(), item.getColumnNumber(), item.getFunctionName(), item.isConstructor()]); - } - - return trace; -}; - - -exports.formatTrace = function (trace) { - - var display = []; - - for (var i = 0, il = trace.length; i < il; ++i) { - var row = trace[i]; - display.push((row[4] ? 'new ' : '') + row[3] + ' (' + row[0] + ':' + row[1] + ':' + row[2] + ')'); - } - - return display; -}; - - -exports.callStack = function (slice) { - - // http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi - - var v8 = Error.prepareStackTrace; - Error.prepareStackTrace = function (err, stack) { - - return stack; - }; - - var capture = {}; - Error.captureStackTrace(capture, arguments.callee); /*eslint no-caller:0 */ - var stack = capture.stack; - - Error.prepareStackTrace = v8; - - var trace = exports.formatStack(stack); - - if (slice) { - return trace.slice(slice); - } - - return trace; -}; - - -exports.displayStack = function (slice) { - - var trace = exports.callStack(slice === undefined ? 1 : slice + 1); - - return exports.formatTrace(trace); -}; - - -exports.abortThrow = false; - - -exports.abort = function (message, hideStack) { - - if (process.env.NODE_ENV === 'test' || exports.abortThrow === true) { - throw new Error(message || 'Unknown error'); - } - - var stack = ''; - if (!hideStack) { - stack = exports.displayStack(1).join('\n\t'); - } - console.log('ABORT: ' + message + '\n\t' + stack); - process.exit(1); -}; - - -exports.assert = function (condition /*, msg1, msg2, msg3 */) { - - if (condition) { - return; - } - - if (arguments.length === 2 && arguments[1] instanceof Error) { - throw arguments[1]; - } - - var msgs = []; - for (var i = 1, il = arguments.length; i < il; ++i) { - if (arguments[i] !== '') { - msgs.push(arguments[i]); // Avoids Array.slice arguments leak, allowing for V8 optimizations - } - } - - msgs = msgs.map(function (msg) { - - return typeof msg === 'string' ? msg : msg instanceof Error ? msg.message : exports.stringify(msg); - }); - throw new Error(msgs.join(' ') || 'Unknown error'); -}; - - -exports.Timer = function () { - - this.ts = 0; - this.reset(); -}; - - -exports.Timer.prototype.reset = function () { - - this.ts = Date.now(); -}; - - -exports.Timer.prototype.elapsed = function () { - - return Date.now() - this.ts; -}; - - -exports.Bench = function () { - - this.ts = 0; - this.reset(); -}; - - -exports.Bench.prototype.reset = function () { - - this.ts = exports.Bench.now(); -}; - - -exports.Bench.prototype.elapsed = function () { - - return exports.Bench.now() - this.ts; -}; - - -exports.Bench.now = function () { - - var ts = process.hrtime(); - return (ts[0] * 1e3) + (ts[1] / 1e6); -}; - - -// Escape string for Regex construction - -exports.escapeRegex = function (string) { - - // Escape ^$.*+-?=!:|\/()[]{}, - return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&'); -}; - - -// Base64url (RFC 4648) encode - -exports.base64urlEncode = function (value, encoding) { - - var buf = (Buffer.isBuffer(value) ? value : new Buffer(value, encoding || 'binary')); - return buf.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, ''); -}; - - -// Base64url (RFC 4648) decode - -exports.base64urlDecode = function (value, encoding) { - - if (value && - !/^[\w\-]*$/.test(value)) { - - return new Error('Invalid character'); - } - - try { - var buf = new Buffer(value, 'base64'); - return (encoding === 'buffer' ? buf : buf.toString(encoding || 'binary')); - } - catch (err) { - return err; - } -}; - - -// Escape attribute value for use in HTTP header - -exports.escapeHeaderAttribute = function (attribute) { - - // Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, " - - exports.assert(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(attribute), 'Bad attribute value (' + attribute + ')'); - - return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); // Escape quotes and slash -}; - - -exports.escapeHtml = function (string) { - - return Escape.escapeHtml(string); -}; - - -exports.escapeJavaScript = function (string) { - - return Escape.escapeJavaScript(string); -}; - - -exports.nextTick = function (callback) { - - return function () { - - var args = arguments; - process.nextTick(function () { - - callback.apply(null, args); - }); - }; -}; - - -exports.once = function (method) { - - if (method._hoekOnce) { - return method; - } - - var once = false; - var wrapped = function () { - - if (!once) { - once = true; - method.apply(null, arguments); - } - }; - - wrapped._hoekOnce = true; - - return wrapped; -}; - - -exports.isAbsolutePath = function (path, platform) { - - if (!path) { - return false; - } - - if (Path.isAbsolute) { // node >= 0.11 - return Path.isAbsolute(path); - } - - platform = platform || process.platform; - - // Unix - - if (platform !== 'win32') { - return path[0] === '/'; - } - - // Windows - - return !!/^(?:[a-zA-Z]:[\\\/])|(?:[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/])/.test(path); // C:\ or \\something\something -}; - - -exports.isInteger = function (value) { - - return (typeof value === 'number' && - parseFloat(value) === parseInt(value, 10) && - !isNaN(value)); -}; - - -exports.ignore = function () { }; - - -exports.inherits = Util.inherits; - - -exports.format = Util.format; - - -exports.transform = function (source, transform, options) { - - exports.assert(source === null || source === undefined || typeof source === 'object' || Array.isArray(source), 'Invalid source object: must be null, undefined, an object, or an array'); - - if (Array.isArray(source)) { - var results = []; - for (var i = 0, il = source.length; i < il; ++i) { - results.push(exports.transform(source[i], transform, options)); - } - return results; - } - - var result = {}; - var keys = Object.keys(transform); - - for (var k = 0, kl = keys.length; k < kl; ++k) { - var key = keys[k]; - var path = key.split('.'); - var sourcePath = transform[key]; - - exports.assert(typeof sourcePath === 'string', 'All mappings must be "." delineated strings'); - - var segment; - var res = result; - - while (path.length > 1) { - segment = path.shift(); - if (!res[segment]) { - res[segment] = {}; - } - res = res[segment]; - } - segment = path.shift(); - res[segment] = exports.reach(source, sourcePath, options); - } - - return result; -}; - - -exports.uniqueFilename = function (path, extension) { - - if (extension) { - extension = extension[0] !== '.' ? '.' + extension : extension; - } - else { - extension = ''; - } - - path = Path.resolve(path); - var name = [Date.now(), process.pid, Crypto.randomBytes(8).toString('hex')].join('-') + extension; - return Path.join(path, name); -}; - - -exports.stringify = function () { - - try { - return JSON.stringify.apply(null, arguments); - } - catch (err) { - return '[Cannot display object: ' + err.message + ']'; - } -}; - - -exports.shallow = function (source) { - - var target = {}; - var keys = Object.keys(source); - for (var i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; - target[key] = source[key]; - } - - return target; -}; - - -/***/ }), -/* 135 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2012 Joyent, Inc. All rights reserved. - -var assert = __webpack_require__(136); -var sshpk = __webpack_require__(229); -var util = __webpack_require__(2); - -var HASH_ALGOS = { - 'sha1': true, - 'sha256': true, - 'sha512': true -}; - -var PK_ALGOS = { - 'rsa': true, - 'dsa': true, - 'ecdsa': true -}; - -function HttpSignatureError(message, caller) { - if (Error.captureStackTrace) - Error.captureStackTrace(this, caller || HttpSignatureError); - - this.message = message; - this.name = caller.name; -} -util.inherits(HttpSignatureError, Error); - -function InvalidAlgorithmError(message) { - HttpSignatureError.call(this, message, InvalidAlgorithmError); -} -util.inherits(InvalidAlgorithmError, HttpSignatureError); - -function validateAlgorithm(algorithm) { - var alg = algorithm.toLowerCase().split('-'); - - if (alg.length !== 2) { - throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' + - 'valid algorithm')); - } - - if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) { - throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' + - 'are not supported')); - } - - if (!HASH_ALGOS[alg[1]]) { - throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' + - 'supported hash algorithm')); - } - - return (alg); -} - -///--- API - -module.exports = { - - HASH_ALGOS: HASH_ALGOS, - PK_ALGOS: PK_ALGOS, - - HttpSignatureError: HttpSignatureError, - InvalidAlgorithmError: InvalidAlgorithmError, - - validateAlgorithm: validateAlgorithm, - - /** - * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file. - * - * The intent of this module is to interoperate with OpenSSL only, - * specifically the node crypto module's `verify` method. - * - * @param {String} key an OpenSSH public key. - * @return {String} PEM encoded form of the RSA public key. - * @throws {TypeError} on bad input. - * @throws {Error} on invalid ssh key formatted data. - */ - sshKeyToPEM: function sshKeyToPEM(key) { - assert.string(key, 'ssh_key'); - - var k = sshpk.parseKey(key, 'ssh'); - return (k.toString('pem')); - }, - - - /** - * Generates an OpenSSH fingerprint from an ssh public key. - * - * @param {String} key an OpenSSH public key. - * @return {String} key fingerprint. - * @throws {TypeError} on bad input. - * @throws {Error} if what you passed doesn't look like an ssh public key. - */ - fingerprint: function fingerprint(key) { - assert.string(key, 'ssh_key'); - - var k = sshpk.parseKey(key, 'ssh'); - return (k.fingerprint('md5').toString('hex')); - }, - - /** - * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa) - * - * The reverse of the above function. - */ - pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) { - assert.equal('string', typeof (pem), 'typeof pem'); - - var k = sshpk.parseKey(pem, 'pem'); - k.comment = comment; - return (k.toString('ssh')); - } -}; - - -/***/ }), -/* 136 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright (c) 2012, Mark Cavage. All rights reserved. -// Copyright 2015 Joyent, Inc. - -var assert = __webpack_require__(20); -var Stream = __webpack_require__(25).Stream; -var util = __webpack_require__(2); - - -///--- Globals - -/* JSSTYLED */ -var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; - - -///--- Internal - -function _capitalize(str) { - return (str.charAt(0).toUpperCase() + str.slice(1)); -} - -function _toss(name, expected, oper, arg, actual) { - throw new assert.AssertionError({ - message: util.format('%s (%s) is required', name, expected), - actual: (actual === undefined) ? typeof (arg) : actual(arg), - expected: expected, - operator: oper || '===', - stackStartFunction: _toss.caller - }); -} - -function _getClass(arg) { - return (Object.prototype.toString.call(arg).slice(8, -1)); -} - -function noop() { - // Why even bother with asserts? -} - - -///--- Exports - -var types = { - bool: { - check: function (arg) { return typeof (arg) === 'boolean'; } - }, - func: { - check: function (arg) { return typeof (arg) === 'function'; } - }, - string: { - check: function (arg) { return typeof (arg) === 'string'; } - }, - object: { - check: function (arg) { - return typeof (arg) === 'object' && arg !== null; - } - }, - number: { - check: function (arg) { - return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); - } - }, - buffer: { - check: function (arg) { return Buffer.isBuffer(arg); }, - operator: 'Buffer.isBuffer' - }, - array: { - check: function (arg) { return Array.isArray(arg); }, - operator: 'Array.isArray' - }, - stream: { - check: function (arg) { return arg instanceof Stream; }, - operator: 'instanceof', - actual: _getClass - }, - date: { - check: function (arg) { return arg instanceof Date; }, - operator: 'instanceof', - actual: _getClass - }, - regexp: { - check: function (arg) { return arg instanceof RegExp; }, - operator: 'instanceof', - actual: _getClass - }, - uuid: { - check: function (arg) { - return typeof (arg) === 'string' && UUID_REGEXP.test(arg); - }, - operator: 'isUUID' - } -}; - -function _setExports(ndebug) { - var keys = Object.keys(types); - var out; - - /* re-export standard assert */ - if (process.env.NODE_NDEBUG) { - out = noop; - } else { - out = function (arg, msg) { - if (!arg) { - _toss(msg, 'true', arg); - } - }; - } - - /* standard checks */ - keys.forEach(function (k) { - if (ndebug) { - out[k] = noop; - return; - } - var type = types[k]; - out[k] = function (arg, msg) { - if (!type.check(arg)) { - _toss(msg, k, type.operator, arg, type.actual); - } - }; - }); - - /* optional checks */ - keys.forEach(function (k) { - var name = 'optional' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - out[name] = function (arg, msg) { - if (arg === undefined || arg === null) { - return; - } - if (!type.check(arg)) { - _toss(msg, k, type.operator, arg, type.actual); - } - }; - }); - - /* arrayOf checks */ - keys.forEach(function (k) { - var name = 'arrayOf' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - var expected = '[' + k + ']'; - out[name] = function (arg, msg) { - if (!Array.isArray(arg)) { - _toss(msg, expected, type.operator, arg, type.actual); - } - var i; - for (i = 0; i < arg.length; i++) { - if (!type.check(arg[i])) { - _toss(msg, expected, type.operator, arg, type.actual); - } - } - }; - }); - - /* optionalArrayOf checks */ - keys.forEach(function (k) { - var name = 'optionalArrayOf' + _capitalize(k); - if (ndebug) { - out[name] = noop; - return; - } - var type = types[k]; - var expected = '[' + k + ']'; - out[name] = function (arg, msg) { - if (arg === undefined || arg === null) { - return; - } - if (!Array.isArray(arg)) { - _toss(msg, expected, type.operator, arg, type.actual); - } - var i; - for (i = 0; i < arg.length; i++) { - if (!type.check(arg[i])) { - _toss(msg, expected, type.operator, arg, type.actual); - } - } - }; - }); - - /* re-export built-in assertions */ - Object.keys(assert).forEach(function (k) { - if (k === 'AssertionError') { - out[k] = assert[k]; - return; - } - if (ndebug) { - out[k] = noop; - return; - } - out[k] = assert[k]; - }); - - /* export ourselves (for unit tests _only_) */ - out._setExports = _setExports; - - return out; -} - -module.exports = _setExports(process.env.NODE_NDEBUG); - - -/***/ }), -/* 137 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var chalk = __webpack_require__(34); -var figures = __webpack_require__(209); - -/** - * Separator object - * Used to space/separate choices group - * @constructor - * @param {String} line Separation line content (facultative) - */ - -var Separator = module.exports = function (line) { - this.type = 'separator'; - this.line = chalk.dim(line || new Array(15).join(figures.line)); -}; - -/** - * Helper function returning false if object is a separator - * @param {Object} obj object to test against - * @return {Boolean} `false` if object is a separator - */ - -Separator.exclude = function (obj) { - return obj.type !== 'separator'; -}; - -/** - * Stringify separator - * @return {String} the separator display string - */ - -Separator.prototype.toString = function () { - return this.line; -}; - - -/***/ }), -/* 138 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _ = __webpack_require__(27); -var chalk = __webpack_require__(34); - -/** - * The paginator keep trakcs of a pointer index in a list and return - * a subset of the choices if the list is too long. - */ - -var Paginator = module.exports = function () { - this.pointer = 0; - this.lastIndex = 0; -}; - -Paginator.prototype.paginate = function (output, active, pageSize) { - pageSize = pageSize || 7; - var middleOfList = Math.floor(pageSize / 2); - var lines = output.split('\n'); - - // Make sure there's enough lines to paginate - if (lines.length <= pageSize) { - return output; - } - - // Move the pointer only when the user go down and limit it to the middle of the list - if (this.pointer < middleOfList && this.lastIndex < active && active - this.lastIndex < pageSize) { - this.pointer = Math.min(middleOfList, this.pointer + active - this.lastIndex); - } - this.lastIndex = active; - - // Duplicate the lines so it give an infinite list look - var infinite = _.flatten([lines, lines, lines]); - var topIndex = Math.max(0, active + lines.length - this.pointer); - - var section = infinite.splice(topIndex, pageSize).join('\n'); - return section + '\n' + chalk.dim('(Move up and down to reveal more choices)'); -}; - - -/***/ }), -/* 139 */ -/***/ (function(module, exports) { - -/*! - * is-extglob - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -module.exports = function isExtglob(str) { - return typeof str === 'string' - && /[@?!+*]\(/.test(str); -}; - - -/***/ }), -/* 140 */ -/***/ (function(module, exports, __webpack_require__) { - -/*! - * is-glob - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - -var isExtglob = __webpack_require__(139); - -module.exports = function isGlob(str) { - return typeof str === 'string' - && (/[*!?{}(|)[\]]/.test(str) - || isExtglob(str)); -}; - -/***/ }), -/* 141 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * @fileOverview - * Core operations on curve 25519 required for the higher level modules. - */ - -/* - * Copyright (c) 2007, 2013, 2014 Michele Bini - * Copyright (c) 2014 Mega Limited - * under the MIT License. - * - * Authors: Guy K. Kloss, Michele Bini - * - * You should have received a copy of the license along with this program. - */ - -var crypto = __webpack_require__(8); - - /** - * @exports jodid25519/core - * Core operations on curve 25519 required for the higher level modules. - * - * @description - * Core operations on curve 25519 required for the higher level modules. - * - *

- * This core code is extracted from Michele Bini's curve255.js implementation, - * which is used as a base for Curve25519 ECDH and Ed25519 EdDSA operations. - *

- */ - var ns = {}; - - function _setbit(n, c, v) { - var i = c >> 4; - var a = n[i]; - a = a + (1 << (c & 0xf)) * v; - n[i] = a; - } - - function _getbit(n, c) { - return (n[c >> 4] >> (c & 0xf)) & 1; - } - - function _ZERO() { - return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - } - - function _ONE() { - return [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - } - - // Basepoint. - function _BASE() { - return [9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - } - - // return -1, 0, +1 when a is less than, equal, or greater than b - function _bigintcmp(a, b) { - // The following code is a bit tricky to avoid code branching - var c, abs_r, mask; - var r = 0; - for (c = 15; c >= 0; c--) { - var x = a[c]; - var y = b[c]; - r = r + (x - y) * (1 - r * r); - // http://graphics.stanford.edu/~seander/bithacks.html#IntegerAbs - // correct for [-294967295, 294967295] - mask = r >> 31; - abs_r = (r + mask) ^ mask; - // http://stackoverflow.com/questions/596467/how-do-i-convert-a-number-to-an-integer-in-javascript - // this rounds towards zero - r = ~~((r << 1) / (abs_r + 1)); - } - return r; - } - - function _bigintadd(a, b) { - var r = []; - var v; - r[0] = (v = a[0] + b[0]) & 0xffff; - r[1] = (v = (v >>> 16) + a[1] + b[1]) & 0xffff; - r[2] = (v = (v >>> 16) + a[2] + b[2]) & 0xffff; - r[3] = (v = (v >>> 16) + a[3] + b[3]) & 0xffff; - r[4] = (v = (v >>> 16) + a[4] + b[4]) & 0xffff; - r[5] = (v = (v >>> 16) + a[5] + b[5]) & 0xffff; - r[6] = (v = (v >>> 16) + a[6] + b[6]) & 0xffff; - r[7] = (v = (v >>> 16) + a[7] + b[7]) & 0xffff; - r[8] = (v = (v >>> 16) + a[8] + b[8]) & 0xffff; - r[9] = (v = (v >>> 16) + a[9] + b[9]) & 0xffff; - r[10] = (v = (v >>> 16) + a[10] + b[10]) & 0xffff; - r[11] = (v = (v >>> 16) + a[11] + b[11]) & 0xffff; - r[12] = (v = (v >>> 16) + a[12] + b[12]) & 0xffff; - r[13] = (v = (v >>> 16) + a[13] + b[13]) & 0xffff; - r[14] = (v = (v >>> 16) + a[14] + b[14]) & 0xffff; - r[15] = (v >>> 16) + a[15] + b[15]; - return r; - } - - function _bigintsub(a, b) { - var r = []; - var v; - r[0] = (v = 0x80000 + a[0] - b[0]) & 0xffff; - r[1] = (v = (v >>> 16) + 0x7fff8 + a[1] - b[1]) & 0xffff; - r[2] = (v = (v >>> 16) + 0x7fff8 + a[2] - b[2]) & 0xffff; - r[3] = (v = (v >>> 16) + 0x7fff8 + a[3] - b[3]) & 0xffff; - r[4] = (v = (v >>> 16) + 0x7fff8 + a[4] - b[4]) & 0xffff; - r[5] = (v = (v >>> 16) + 0x7fff8 + a[5] - b[5]) & 0xffff; - r[6] = (v = (v >>> 16) + 0x7fff8 + a[6] - b[6]) & 0xffff; - r[7] = (v = (v >>> 16) + 0x7fff8 + a[7] - b[7]) & 0xffff; - r[8] = (v = (v >>> 16) + 0x7fff8 + a[8] - b[8]) & 0xffff; - r[9] = (v = (v >>> 16) + 0x7fff8 + a[9] - b[9]) & 0xffff; - r[10] = (v = (v >>> 16) + 0x7fff8 + a[10] - b[10]) & 0xffff; - r[11] = (v = (v >>> 16) + 0x7fff8 + a[11] - b[11]) & 0xffff; - r[12] = (v = (v >>> 16) + 0x7fff8 + a[12] - b[12]) & 0xffff; - r[13] = (v = (v >>> 16) + 0x7fff8 + a[13] - b[13]) & 0xffff; - r[14] = (v = (v >>> 16) + 0x7fff8 + a[14] - b[14]) & 0xffff; - r[15] = (v >>> 16) - 8 + a[15] - b[15]; - return r; - } - - function _sqr8h(a7, a6, a5, a4, a3, a2, a1, a0) { - // 'division by 0x10000' can not be replaced by '>> 16' because - // more than 32 bits of precision are needed similarly - // 'multiplication by 2' cannot be replaced by '<< 1' - var r = []; - var v; - r[0] = (v = a0 * a0) & 0xffff; - r[1] = (v = (0 | (v / 0x10000)) + 2 * a0 * a1) & 0xffff; - r[2] = (v = (0 | (v / 0x10000)) + 2 * a0 * a2 + a1 * a1) & 0xffff; - r[3] = (v = (0 | (v / 0x10000)) + 2 * a0 * a3 + 2 * a1 * a2) & 0xffff; - r[4] = (v = (0 | (v / 0x10000)) + 2 * a0 * a4 + 2 * a1 * a3 + a2 - * a2) & 0xffff; - r[5] = (v = (0 | (v / 0x10000)) + 2 * a0 * a5 + 2 * a1 * a4 + 2 - * a2 * a3) & 0xffff; - r[6] = (v = (0 | (v / 0x10000)) + 2 * a0 * a6 + 2 * a1 * a5 + 2 - * a2 * a4 + a3 * a3) & 0xffff; - r[7] = (v = (0 | (v / 0x10000)) + 2 * a0 * a7 + 2 * a1 * a6 + 2 - * a2 * a5 + 2 * a3 * a4) & 0xffff; - r[8] = (v = (0 | (v / 0x10000)) + 2 * a1 * a7 + 2 * a2 * a6 + 2 - * a3 * a5 + a4 * a4) & 0xffff; - r[9] = (v = (0 | (v / 0x10000)) + 2 * a2 * a7 + 2 * a3 * a6 + 2 - * a4 * a5) & 0xffff; - r[10] = (v = (0 | (v / 0x10000)) + 2 * a3 * a7 + 2 * a4 * a6 - + a5 * a5) & 0xffff; - r[11] = (v = (0 | (v / 0x10000)) + 2 * a4 * a7 + 2 * a5 * a6) & 0xffff; - r[12] = (v = (0 | (v / 0x10000)) + 2 * a5 * a7 + a6 * a6) & 0xffff; - r[13] = (v = (0 | (v / 0x10000)) + 2 * a6 * a7) & 0xffff; - r[14] = (v = (0 | (v / 0x10000)) + a7 * a7) & 0xffff; - r[15] = 0 | (v / 0x10000); - return r; - } - - function _sqrmodp(a) { - var x = _sqr8h(a[15], a[14], a[13], a[12], a[11], a[10], a[9], - a[8]); - var z = _sqr8h(a[7], a[6], a[5], a[4], a[3], a[2], a[1], a[0]); - var y = _sqr8h(a[15] + a[7], a[14] + a[6], a[13] + a[5], a[12] - + a[4], - a[11] + a[3], a[10] + a[2], a[9] + a[1], a[8] - + a[0]); - var r = []; - var v; - r[0] = (v = 0x800000 + z[0] + (y[8] - x[8] - z[8] + x[0] - 0x80) - * 38) & 0xffff; - r[1] = (v = 0x7fff80 + (v >>> 16) + z[1] - + (y[9] - x[9] - z[9] + x[1]) * 38) & 0xffff; - r[2] = (v = 0x7fff80 + (v >>> 16) + z[2] - + (y[10] - x[10] - z[10] + x[2]) * 38) & 0xffff; - r[3] = (v = 0x7fff80 + (v >>> 16) + z[3] - + (y[11] - x[11] - z[11] + x[3]) * 38) & 0xffff; - r[4] = (v = 0x7fff80 + (v >>> 16) + z[4] - + (y[12] - x[12] - z[12] + x[4]) * 38) & 0xffff; - r[5] = (v = 0x7fff80 + (v >>> 16) + z[5] - + (y[13] - x[13] - z[13] + x[5]) * 38) & 0xffff; - r[6] = (v = 0x7fff80 + (v >>> 16) + z[6] - + (y[14] - x[14] - z[14] + x[6]) * 38) & 0xffff; - r[7] = (v = 0x7fff80 + (v >>> 16) + z[7] - + (y[15] - x[15] - z[15] + x[7]) * 38) & 0xffff; - r[8] = (v = 0x7fff80 + (v >>> 16) + z[8] + y[0] - x[0] - z[0] - + x[8] * 38) & 0xffff; - r[9] = (v = 0x7fff80 + (v >>> 16) + z[9] + y[1] - x[1] - z[1] - + x[9] * 38) & 0xffff; - r[10] = (v = 0x7fff80 + (v >>> 16) + z[10] + y[2] - x[2] - z[2] - + x[10] * 38) & 0xffff; - r[11] = (v = 0x7fff80 + (v >>> 16) + z[11] + y[3] - x[3] - z[3] - + x[11] * 38) & 0xffff; - r[12] = (v = 0x7fff80 + (v >>> 16) + z[12] + y[4] - x[4] - z[4] - + x[12] * 38) & 0xffff; - r[13] = (v = 0x7fff80 + (v >>> 16) + z[13] + y[5] - x[5] - z[5] - + x[13] * 38) & 0xffff; - r[14] = (v = 0x7fff80 + (v >>> 16) + z[14] + y[6] - x[6] - z[6] - + x[14] * 38) & 0xffff; - r[15] = 0x7fff80 + (v >>> 16) + z[15] + y[7] - x[7] - z[7] - + x[15] * 38; - _reduce(r); - return r; - } - - function _mul8h(a7, a6, a5, a4, a3, a2, a1, a0, b7, b6, b5, b4, b3, - b2, b1, b0) { - // 'division by 0x10000' can not be replaced by '>> 16' because - // more than 32 bits of precision are needed - var r = []; - var v; - r[0] = (v = a0 * b0) & 0xffff; - r[1] = (v = (0 | (v / 0x10000)) + a0 * b1 + a1 * b0) & 0xffff; - r[2] = (v = (0 | (v / 0x10000)) + a0 * b2 + a1 * b1 + a2 * b0) & 0xffff; - r[3] = (v = (0 | (v / 0x10000)) + a0 * b3 + a1 * b2 + a2 * b1 - + a3 * b0) & 0xffff; - r[4] = (v = (0 | (v / 0x10000)) + a0 * b4 + a1 * b3 + a2 * b2 - + a3 * b1 + a4 * b0) & 0xffff; - r[5] = (v = (0 | (v / 0x10000)) + a0 * b5 + a1 * b4 + a2 * b3 - + a3 * b2 + a4 * b1 + a5 * b0) & 0xffff; - r[6] = (v = (0 | (v / 0x10000)) + a0 * b6 + a1 * b5 + a2 * b4 - + a3 * b3 + a4 * b2 + a5 * b1 + a6 * b0) & 0xffff; - r[7] = (v = (0 | (v / 0x10000)) + a0 * b7 + a1 * b6 + a2 * b5 - + a3 * b4 + a4 * b3 + a5 * b2 + a6 * b1 + a7 * b0) & 0xffff; - r[8] = (v = (0 | (v / 0x10000)) + a1 * b7 + a2 * b6 + a3 * b5 - + a4 * b4 + a5 * b3 + a6 * b2 + a7 * b1) & 0xffff; - r[9] = (v = (0 | (v / 0x10000)) + a2 * b7 + a3 * b6 + a4 * b5 - + a5 * b4 + a6 * b3 + a7 * b2) & 0xffff; - r[10] = (v = (0 | (v / 0x10000)) + a3 * b7 + a4 * b6 + a5 * b5 - + a6 * b4 + a7 * b3) & 0xffff; - r[11] = (v = (0 | (v / 0x10000)) + a4 * b7 + a5 * b6 + a6 * b5 - + a7 * b4) & 0xffff; - r[12] = (v = (0 | (v / 0x10000)) + a5 * b7 + a6 * b6 + a7 * b5) & 0xffff; - r[13] = (v = (0 | (v / 0x10000)) + a6 * b7 + a7 * b6) & 0xffff; - r[14] = (v = (0 | (v / 0x10000)) + a7 * b7) & 0xffff; - r[15] = (0 | (v / 0x10000)); - return r; - } - - function _mulmodp(a, b) { - // Karatsuba multiplication scheme: x*y = (b^2+b)*x1*y1 - - // b*(x1-x0)*(y1-y0) + (b+1)*x0*y0 - var x = _mul8h(a[15], a[14], a[13], a[12], a[11], a[10], a[9], - a[8], b[15], b[14], b[13], b[12], b[11], b[10], - b[9], b[8]); - var z = _mul8h(a[7], a[6], a[5], a[4], a[3], a[2], a[1], a[0], - b[7], b[6], b[5], b[4], b[3], b[2], b[1], b[0]); - var y = _mul8h(a[15] + a[7], a[14] + a[6], a[13] + a[5], a[12] - + a[4], - a[11] + a[3], a[10] + a[2], a[9] + a[1], a[8] - + a[0], - b[15] + b[7], b[14] + b[6], b[13] + b[5], b[12] - + b[4], - b[11] + b[3], b[10] + b[2], b[9] + b[1], b[8] - + b[0]); - var r = []; - var v; - r[0] = (v = 0x800000 + z[0] + (y[8] - x[8] - z[8] + x[0] - 0x80) - * 38) & 0xffff; - r[1] = (v = 0x7fff80 + (v >>> 16) + z[1] - + (y[9] - x[9] - z[9] + x[1]) * 38) & 0xffff; - r[2] = (v = 0x7fff80 + (v >>> 16) + z[2] - + (y[10] - x[10] - z[10] + x[2]) * 38) & 0xffff; - r[3] = (v = 0x7fff80 + (v >>> 16) + z[3] - + (y[11] - x[11] - z[11] + x[3]) * 38) & 0xffff; - r[4] = (v = 0x7fff80 + (v >>> 16) + z[4] - + (y[12] - x[12] - z[12] + x[4]) * 38) & 0xffff; - r[5] = (v = 0x7fff80 + (v >>> 16) + z[5] - + (y[13] - x[13] - z[13] + x[5]) * 38) & 0xffff; - r[6] = (v = 0x7fff80 + (v >>> 16) + z[6] - + (y[14] - x[14] - z[14] + x[6]) * 38) & 0xffff; - r[7] = (v = 0x7fff80 + (v >>> 16) + z[7] - + (y[15] - x[15] - z[15] + x[7]) * 38) & 0xffff; - r[8] = (v = 0x7fff80 + (v >>> 16) + z[8] + y[0] - x[0] - z[0] - + x[8] * 38) & 0xffff; - r[9] = (v = 0x7fff80 + (v >>> 16) + z[9] + y[1] - x[1] - z[1] - + x[9] * 38) & 0xffff; - r[10] = (v = 0x7fff80 + (v >>> 16) + z[10] + y[2] - x[2] - z[2] - + x[10] * 38) & 0xffff; - r[11] = (v = 0x7fff80 + (v >>> 16) + z[11] + y[3] - x[3] - z[3] - + x[11] * 38) & 0xffff; - r[12] = (v = 0x7fff80 + (v >>> 16) + z[12] + y[4] - x[4] - z[4] - + x[12] * 38) & 0xffff; - r[13] = (v = 0x7fff80 + (v >>> 16) + z[13] + y[5] - x[5] - z[5] - + x[13] * 38) & 0xffff; - r[14] = (v = 0x7fff80 + (v >>> 16) + z[14] + y[6] - x[6] - z[6] - + x[14] * 38) & 0xffff; - r[15] = 0x7fff80 + (v >>> 16) + z[15] + y[7] - x[7] - z[7] - + x[15] * 38; - _reduce(r); - return r; - } - - function _reduce(arr) { - var aCopy = arr.slice(0); - var choice = [arr, aCopy]; - var v = arr[15]; - // Use the dummy copy instead of just returning to be more constant time. - var a = choice[(v < 0x8000) & 1]; - a[15] = v & 0x7fff; - // >32-bits of precision are required here so '/ 0x8000' can not be - // replaced by the arithmetic equivalent '>>> 15' - v = (0 | (v / 0x8000)) * 19; - a[0] = (v += a[0]) & 0xffff; - v = v >>> 16; - a[1] = (v += a[1]) & 0xffff; - v = v >>> 16; - a[2] = (v += a[2]) & 0xffff; - v = v >>> 16; - a[3] = (v += a[3]) & 0xffff; - v = v >>> 16; - a[4] = (v += a[4]) & 0xffff; - v = v >>> 16; - a[5] = (v += a[5]) & 0xffff; - v = v >>> 16; - a[6] = (v += a[6]) & 0xffff; - v = v >>> 16; - a[7] = (v += a[7]) & 0xffff; - v = v >>> 16; - a[8] = (v += a[8]) & 0xffff; - v = v >>> 16; - a[9] = (v += a[9]) & 0xffff; - v = v >>> 16; - a[10] = (v += a[10]) & 0xffff; - v = v >>> 16; - a[11] = (v += a[11]) & 0xffff; - v = v >>> 16; - a[12] = (v += a[12]) & 0xffff; - v = v >>> 16; - a[13] = (v += a[13]) & 0xffff; - v = v >>> 16; - a[14] = (v += a[14]) & 0xffff; - v = v >>> 16; - a[15] += v; - } - - function _addmodp(a, b) { - var r = []; - var v; - r[0] = (v = ((0 | (a[15] >>> 15)) + (0 | (b[15] >>> 15))) * 19 - + a[0] + b[0]) & 0xffff; - r[1] = (v = (v >>> 16) + a[1] + b[1]) & 0xffff; - r[2] = (v = (v >>> 16) + a[2] + b[2]) & 0xffff; - r[3] = (v = (v >>> 16) + a[3] + b[3]) & 0xffff; - r[4] = (v = (v >>> 16) + a[4] + b[4]) & 0xffff; - r[5] = (v = (v >>> 16) + a[5] + b[5]) & 0xffff; - r[6] = (v = (v >>> 16) + a[6] + b[6]) & 0xffff; - r[7] = (v = (v >>> 16) + a[7] + b[7]) & 0xffff; - r[8] = (v = (v >>> 16) + a[8] + b[8]) & 0xffff; - r[9] = (v = (v >>> 16) + a[9] + b[9]) & 0xffff; - r[10] = (v = (v >>> 16) + a[10] + b[10]) & 0xffff; - r[11] = (v = (v >>> 16) + a[11] + b[11]) & 0xffff; - r[12] = (v = (v >>> 16) + a[12] + b[12]) & 0xffff; - r[13] = (v = (v >>> 16) + a[13] + b[13]) & 0xffff; - r[14] = (v = (v >>> 16) + a[14] + b[14]) & 0xffff; - r[15] = (v >>> 16) + (a[15] & 0x7fff) + (b[15] & 0x7fff); - return r; - } - - function _submodp(a, b) { - var r = []; - var v; - r[0] = (v = 0x80000 - + ((0 | (a[15] >>> 15)) - (0 | (b[15] >>> 15)) - 1) - * 19 + a[0] - b[0]) & 0xffff; - r[1] = (v = (v >>> 16) + 0x7fff8 + a[1] - b[1]) & 0xffff; - r[2] = (v = (v >>> 16) + 0x7fff8 + a[2] - b[2]) & 0xffff; - r[3] = (v = (v >>> 16) + 0x7fff8 + a[3] - b[3]) & 0xffff; - r[4] = (v = (v >>> 16) + 0x7fff8 + a[4] - b[4]) & 0xffff; - r[5] = (v = (v >>> 16) + 0x7fff8 + a[5] - b[5]) & 0xffff; - r[6] = (v = (v >>> 16) + 0x7fff8 + a[6] - b[6]) & 0xffff; - r[7] = (v = (v >>> 16) + 0x7fff8 + a[7] - b[7]) & 0xffff; - r[8] = (v = (v >>> 16) + 0x7fff8 + a[8] - b[8]) & 0xffff; - r[9] = (v = (v >>> 16) + 0x7fff8 + a[9] - b[9]) & 0xffff; - r[10] = (v = (v >>> 16) + 0x7fff8 + a[10] - b[10]) & 0xffff; - r[11] = (v = (v >>> 16) + 0x7fff8 + a[11] - b[11]) & 0xffff; - r[12] = (v = (v >>> 16) + 0x7fff8 + a[12] - b[12]) & 0xffff; - r[13] = (v = (v >>> 16) + 0x7fff8 + a[13] - b[13]) & 0xffff; - r[14] = (v = (v >>> 16) + 0x7fff8 + a[14] - b[14]) & 0xffff; - r[15] = (v >>> 16) + 0x7ff8 + (a[15] & 0x7fff) - - (b[15] & 0x7fff); - return r; - } - - function _invmodp(a) { - var c = a; - var i = 250; - while (--i) { - a = _sqrmodp(a); - a = _mulmodp(a, c); - } - a = _sqrmodp(a); - a = _sqrmodp(a); - a = _mulmodp(a, c); - a = _sqrmodp(a); - a = _sqrmodp(a); - a = _mulmodp(a, c); - a = _sqrmodp(a); - a = _mulmodp(a, c); - return a; - } - - function _mulasmall(a) { - // 'division by 0x10000' can not be replaced by '>> 16' because - // more than 32 bits of precision are needed - var m = 121665; - var r = []; - var v; - r[0] = (v = a[0] * m) & 0xffff; - r[1] = (v = (0 | (v / 0x10000)) + a[1] * m) & 0xffff; - r[2] = (v = (0 | (v / 0x10000)) + a[2] * m) & 0xffff; - r[3] = (v = (0 | (v / 0x10000)) + a[3] * m) & 0xffff; - r[4] = (v = (0 | (v / 0x10000)) + a[4] * m) & 0xffff; - r[5] = (v = (0 | (v / 0x10000)) + a[5] * m) & 0xffff; - r[6] = (v = (0 | (v / 0x10000)) + a[6] * m) & 0xffff; - r[7] = (v = (0 | (v / 0x10000)) + a[7] * m) & 0xffff; - r[8] = (v = (0 | (v / 0x10000)) + a[8] * m) & 0xffff; - r[9] = (v = (0 | (v / 0x10000)) + a[9] * m) & 0xffff; - r[10] = (v = (0 | (v / 0x10000)) + a[10] * m) & 0xffff; - r[11] = (v = (0 | (v / 0x10000)) + a[11] * m) & 0xffff; - r[12] = (v = (0 | (v / 0x10000)) + a[12] * m) & 0xffff; - r[13] = (v = (0 | (v / 0x10000)) + a[13] * m) & 0xffff; - r[14] = (v = (0 | (v / 0x10000)) + a[14] * m) & 0xffff; - r[15] = (0 | (v / 0x10000)) + a[15] * m; - _reduce(r); - return r; - } - - function _dbl(x, z) { - var x_2, z_2, m, n, o; - m = _sqrmodp(_addmodp(x, z)); - n = _sqrmodp(_submodp(x, z)); - o = _submodp(m, n); - x_2 = _mulmodp(n, m); - z_2 = _mulmodp(_addmodp(_mulasmall(o), m), o); - return [x_2, z_2]; - } - - function _sum(x, z, x_p, z_p, x_1) { - var x_3, z_3, p, q; - p = _mulmodp(_submodp(x, z), _addmodp(x_p, z_p)); - q = _mulmodp(_addmodp(x, z), _submodp(x_p, z_p)); - x_3 = _sqrmodp(_addmodp(p, q)); - z_3 = _mulmodp(_sqrmodp(_submodp(p, q)), x_1); - return [x_3, z_3]; - } - - function _generateKey(curve25519) { - var buffer = crypto.randomBytes(32); - - // For Curve25519 DH keys, we need to apply some bit mask on generated - // keys: - // * clear bit 0, 1, 2 of first byte - // * clear bit 7 of last byte - // * set bit 6 of last byte - if (curve25519 === true) { - buffer[0] &= 0xf8; - buffer[31] = (buffer[31] & 0x7f) | 0x40; - } - var result = []; - for (var i = 0; i < buffer.length; i++) { - result.push(String.fromCharCode(buffer[i])); - } - return result.join(''); - } - - // Expose some functions to the outside through this name space. - // Note: This is not part of the public API. - ns.getbit = _getbit; - ns.setbit = _setbit; - ns.addmodp = _addmodp; - ns.invmodp = _invmodp; - ns.mulmodp = _mulmodp; - ns.reduce = _reduce; - ns.dbl = _dbl; - ns.sum = _sum; - ns.ZERO = _ZERO; - ns.ONE = _ONE; - ns.BASE = _BASE; - ns.bigintadd = _bigintadd; - ns.bigintsub = _bigintsub; - ns.bigintcmp = _bigintcmp; - ns.mulmodp = _mulmodp; - ns.sqrmodp = _sqrmodp; - ns.generateKey = _generateKey; - - -module.exports = ns; - - -/***/ }), -/* 142 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * @fileOverview - * A collection of general utility functions.. - */ - -/* - * Copyright (c) 2011, 2012, 2014 Ron Garret - * Copyright (c) 2007, 2013, 2014 Michele Bini - * Copyright (c) 2014 Mega Limited - * under the MIT License. - * - * Authors: Guy K. Kloss, Michele Bini, Ron Garret - * - * You should have received a copy of the license along with this program. - */ - -var core = __webpack_require__(141); - - /** - * @exports jodid25519/utils - * A collection of general utility functions.. - * - * @description - * A collection of general utility functions.. - */ - var ns = {}; - - var _HEXCHARS = "0123456789abcdef"; - - function _hexencode(vector) { - var result = []; - for (var i = vector.length - 1; i >= 0; i--) { - var value = vector[i]; - result.push(_HEXCHARS.substr((value >>> 12) & 0x0f, 1)); - result.push(_HEXCHARS.substr((value >>> 8) & 0x0f, 1)); - result.push(_HEXCHARS.substr((value >>> 4) & 0x0f, 1)); - result.push(_HEXCHARS.substr(value & 0x0f, 1)); - } - return result.join(''); - } - - function _hexdecode(vector) { - var result = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - for (var i = vector.length - 1, l = 0; i >= 0; i -= 4) { - result[l] = (_HEXCHARS.indexOf(vector.charAt(i))) - | (_HEXCHARS.indexOf(vector.charAt(i - 1)) << 4) - | (_HEXCHARS.indexOf(vector.charAt(i - 2)) << 8) - | (_HEXCHARS.indexOf(vector.charAt(i - 3)) << 12); - l++; - } - return result; - } - - var _BASE32CHARS = "abcdefghijklmnopqrstuvwxyz234567"; - - var _BASE32VALUES = (function () { - var result = {}; - for (var i = 0; i < _BASE32CHARS.length; i++) { - result[_BASE32CHARS.charAt(i)] = i; - } - return result; - })(); - - function _base32encode(n) { - var c; - var r = ""; - for (c = 0; c < 255; c += 5) { - r = _BASE32CHARS.substr(core.getbit(n, c) - + (core.getbit(n, c + 1) << 1) - + (core.getbit(n, c + 2) << 2) - + (core.getbit(n, c + 3) << 3) - + (core.getbit(n, c + 4) << 4), 1) - + r; - } - return r; - } - - function _base32decode(n) { - var c = 0; - var r = core.ZERO(); - var l = n.length; - for (c = 0; (l > 0) && (c < 255); c += 5) { - l--; - var v = _BASE32VALUES[n.substr(l, 1)]; - core.setbit(r, c, v & 1); - v >>= 1; - core.setbit(r, c + 1, v & 1); - v >>= 1; - core.setbit(r, c + 2, v & 1); - v >>= 1; - core.setbit(r, c + 3, v & 1); - v >>= 1; - core.setbit(r, c + 4, v & 1); - } - return r; - } - - function _map(f, l) { - var result = new Array(l.length); - for (var i = 0; i < l.length; i++) { - result[i] = f(l[i]); - } - return result; - } - - function _chr(n) { - return String.fromCharCode(n); - } - - function _ord(c) { - return c.charCodeAt(0); - } - - function _bytes2string(bytes) { - return _map(_chr, bytes).join(''); - } - - function _string2bytes(s) { - return _map(_ord, s); - } - - - // Expose some functions to the outside through this name space. - - /** - * Encodes an array of unsigned 8-bit integers to a hex string. - * - * @function - * @param vector {array} - * Array containing the byte values. - * @returns {string} - * String containing vector in a hexadecimal representation. - */ - ns.hexEncode = _hexencode; - - - /** - * Decodes a hex string to an array of unsigned 8-bit integers. - * - * @function - * @param vector {string} - * String containing vector in a hexadecimal representation. - * @returns {array} - * Array containing the byte values. - */ - ns.hexDecode = _hexdecode; - - - /** - * Encodes an array of unsigned 8-bit integers using base32 encoding. - * - * @function - * @param vector {array} - * Array containing the byte values. - * @returns {string} - * String containing vector in a hexadecimal representation. - */ - ns.base32encode = _base32encode; - - - /** - * Decodes a base32 encoded string to an array of unsigned 8-bit integers. - * - * @function - * @param vector {string} - * String containing vector in a hexadecimal representation. - * @returns {array} - * Array containing the byte values. - */ - ns.base32decode = _base32decode; - - - /** - * Converts an unsigned 8-bit integer array representation to a byte string. - * - * @function - * @param vector {array} - * Array containing the byte values. - * @returns {string} - * Byte string representation of vector. - */ - ns.bytes2string = _bytes2string; - - - /** - * Converts a byte string representation to an array of unsigned - * 8-bit integers. - * - * @function - * @param vector {array} - * Array containing the byte values. - * @returns {string} - * Byte string representation of vector. - */ - ns.string2bytes = _string2bytes; - -module.exports = ns; - - -/***/ }), -/* 143 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var isPromise = __webpack_require__(570); - -/** - * Return a function that will run a function asynchronously or synchronously - * - * example: - * runAsync(wrappedFunction, callback)(...args); - * - * @param {Function} func Function to run - * @param {Function} cb Callback function passed the `func` returned value - * @return {Function(arguments)} Arguments to pass to `func`. This function will in turn - * return a Promise (Node >= 0.12) or call the callbacks. - */ - -var runAsync = module.exports = function (func, cb) { - cb = cb || function () {}; - - return function () { - var async = false; - var args = arguments; - - var promise = new Promise(function (resolve, reject) { - var answer = func.apply({ - async: function () { - async = true; - return function (err, value) { - if (err) { - reject(err); - } else { - resolve(value); - } - }; - } - }, Array.prototype.slice.call(args)); - - if (!async) { - if (isPromise(answer)) { - answer.then(resolve, reject); - } else { - resolve(answer); - } - } - }); - - promise.then(cb.bind(null, null), cb); - - return promise; - } -}; - -runAsync.cb = function (func, cb) { - return runAsync(function () { - var args = Array.prototype.slice.call(arguments); - if (args.length === func.length - 1) { - args.push(this.async()); - } - return func.apply(this, args); - }, cb); -}; - - -/***/ }), -/* 144 */ -/***/ (function(module, exports, __webpack_require__) { - -var Rx = __webpack_require__(40); -__webpack_require__(634); -__webpack_require__(635); -__webpack_require__(636); -__webpack_require__(315); -__webpack_require__(637); -__webpack_require__(638); -__webpack_require__(639); -__webpack_require__(640); -__webpack_require__(316); -__webpack_require__(641); -__webpack_require__(642); - -module.exports = Rx; - - -/***/ }), -/* 145 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = { - read: read, - readSSHPrivate: readSSHPrivate, - write: write -}; - -var assert = __webpack_require__(11); -var asn1 = __webpack_require__(50); -var algs = __webpack_require__(22); -var utils = __webpack_require__(19); -var crypto = __webpack_require__(8); - -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); -var pem = __webpack_require__(58); -var rfc4253 = __webpack_require__(75); -var SSHBuffer = __webpack_require__(146); -var errors = __webpack_require__(45); - -var bcrypt; - -function read(buf, options) { - return (pem.read(buf, options)); -} - -var MAGIC = 'openssh-key-v1'; - -function readSSHPrivate(type, buf, options) { - buf = new SSHBuffer({buffer: buf}); - - var magic = buf.readCString(); - assert.strictEqual(magic, MAGIC, 'bad magic string'); - - var cipher = buf.readString(); - var kdf = buf.readString(); - var kdfOpts = buf.readBuffer(); - - var nkeys = buf.readInt(); - if (nkeys !== 1) { - throw (new Error('OpenSSH-format key file contains ' + - 'multiple keys: this is unsupported.')); - } - - var pubKey = buf.readBuffer(); - - if (type === 'public') { - assert.ok(buf.atEnd(), 'excess bytes left after key'); - return (rfc4253.read(pubKey)); - } - - var privKeyBlob = buf.readBuffer(); - assert.ok(buf.atEnd(), 'excess bytes left after key'); - - var kdfOptsBuf = new SSHBuffer({ buffer: kdfOpts }); - switch (kdf) { - case 'none': - if (cipher !== 'none') { - throw (new Error('OpenSSH-format key uses KDF "none" ' + - 'but specifies a cipher other than "none"')); - } - break; - case 'bcrypt': - var salt = kdfOptsBuf.readBuffer(); - var rounds = kdfOptsBuf.readInt(); - var cinf = utils.opensshCipherInfo(cipher); - if (bcrypt === undefined) { - bcrypt = __webpack_require__(281); - } - - if (typeof (options.passphrase) === 'string') { - options.passphrase = new Buffer(options.passphrase, - 'utf-8'); - } - if (!Buffer.isBuffer(options.passphrase)) { - throw (new errors.KeyEncryptedError( - options.filename, 'OpenSSH')); - } - - var pass = new Uint8Array(options.passphrase); - var salti = new Uint8Array(salt); - /* Use the pbkdf to derive both the key and the IV. */ - var out = new Uint8Array(cinf.keySize + cinf.blockSize); - var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length, - out, out.length, rounds); - if (res !== 0) { - throw (new Error('bcrypt_pbkdf function returned ' + - 'failure, parameters invalid')); - } - out = new Buffer(out); - var ckey = out.slice(0, cinf.keySize); - var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize); - var cipherStream = crypto.createDecipheriv(cinf.opensslName, - ckey, iv); - cipherStream.setAutoPadding(false); - var chunk, chunks = []; - cipherStream.once('error', function (e) { - if (e.toString().indexOf('bad decrypt') !== -1) { - throw (new Error('Incorrect passphrase ' + - 'supplied, could not decrypt key')); - } - throw (e); - }); - cipherStream.write(privKeyBlob); - cipherStream.end(); - while ((chunk = cipherStream.read()) !== null) - chunks.push(chunk); - privKeyBlob = Buffer.concat(chunks); - break; - default: - throw (new Error( - 'OpenSSH-format key uses unknown KDF "' + kdf + '"')); - } - - buf = new SSHBuffer({buffer: privKeyBlob}); - - var checkInt1 = buf.readInt(); - var checkInt2 = buf.readInt(); - if (checkInt1 !== checkInt2) { - throw (new Error('Incorrect passphrase supplied, could not ' + - 'decrypt key')); - } - - var ret = {}; - var key = rfc4253.readInternal(ret, 'private', buf.remainder()); - - buf.skip(ret.consumed); - - var comment = buf.readString(); - key.comment = comment; - - return (key); -} - -function write(key, options) { - var pubKey; - if (PrivateKey.isPrivateKey(key)) - pubKey = key.toPublic(); - else - pubKey = key; - - var cipher = 'none'; - var kdf = 'none'; - var kdfopts = new Buffer(0); - var cinf = { blockSize: 8 }; - var passphrase; - if (options !== undefined) { - passphrase = options.passphrase; - if (typeof (passphrase) === 'string') - passphrase = new Buffer(passphrase, 'utf-8'); - if (passphrase !== undefined) { - assert.buffer(passphrase, 'options.passphrase'); - assert.optionalString(options.cipher, 'options.cipher'); - cipher = options.cipher; - if (cipher === undefined) - cipher = 'aes128-ctr'; - cinf = utils.opensshCipherInfo(cipher); - kdf = 'bcrypt'; - } - } - - var privBuf; - if (PrivateKey.isPrivateKey(key)) { - privBuf = new SSHBuffer({}); - var checkInt = crypto.randomBytes(4).readUInt32BE(0); - privBuf.writeInt(checkInt); - privBuf.writeInt(checkInt); - privBuf.write(key.toBuffer('rfc4253')); - privBuf.writeString(key.comment || ''); - - var n = 1; - while (privBuf._offset % cinf.blockSize !== 0) - privBuf.writeChar(n++); - privBuf = privBuf.toBuffer(); - } - - switch (kdf) { - case 'none': - break; - case 'bcrypt': - var salt = crypto.randomBytes(16); - var rounds = 16; - var kdfssh = new SSHBuffer({}); - kdfssh.writeBuffer(salt); - kdfssh.writeInt(rounds); - kdfopts = kdfssh.toBuffer(); - - if (bcrypt === undefined) { - bcrypt = __webpack_require__(281); - } - var pass = new Uint8Array(passphrase); - var salti = new Uint8Array(salt); - /* Use the pbkdf to derive both the key and the IV. */ - var out = new Uint8Array(cinf.keySize + cinf.blockSize); - var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length, - out, out.length, rounds); - if (res !== 0) { - throw (new Error('bcrypt_pbkdf function returned ' + - 'failure, parameters invalid')); - } - out = new Buffer(out); - var ckey = out.slice(0, cinf.keySize); - var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize); - - var cipherStream = crypto.createCipheriv(cinf.opensslName, - ckey, iv); - cipherStream.setAutoPadding(false); - var chunk, chunks = []; - cipherStream.once('error', function (e) { - throw (e); - }); - cipherStream.write(privBuf); - cipherStream.end(); - while ((chunk = cipherStream.read()) !== null) - chunks.push(chunk); - privBuf = Buffer.concat(chunks); - break; - default: - throw (new Error('Unsupported kdf ' + kdf)); - } - - var buf = new SSHBuffer({}); - - buf.writeCString(MAGIC); - buf.writeString(cipher); /* cipher */ - buf.writeString(kdf); /* kdf */ - buf.writeBuffer(kdfopts); /* kdfoptions */ - - buf.writeInt(1); /* nkeys */ - buf.writeBuffer(pubKey.toBuffer('rfc4253')); - - if (privBuf) - buf.writeBuffer(privBuf); - - buf = buf.toBuffer(); - - var header; - if (PrivateKey.isPrivateKey(key)) - header = 'OPENSSH PRIVATE KEY'; - else - header = 'OPENSSH PUBLIC KEY'; - - var tmp = buf.toString('base64'); - var len = tmp.length + (tmp.length / 70) + - 18 + 16 + header.length*2 + 10; - buf = new Buffer(len); - var o = 0; - o += buf.write('-----BEGIN ' + header + '-----\n', o); - for (var i = 0; i < tmp.length; ) { - var limit = i + 70; - if (limit > tmp.length) - limit = tmp.length; - o += buf.write(tmp.slice(i, limit), o); - buf[o++] = 10; - i = limit; - } - o += buf.write('-----END ' + header + '-----\n', o); - - return (buf.slice(0, o)); -} - - -/***/ }), -/* 146 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2015 Joyent, Inc. - -module.exports = SSHBuffer; - -var assert = __webpack_require__(11); - -function SSHBuffer(opts) { - assert.object(opts, 'options'); - if (opts.buffer !== undefined) - assert.buffer(opts.buffer, 'options.buffer'); - - this._size = opts.buffer ? opts.buffer.length : 1024; - this._buffer = opts.buffer || (new Buffer(this._size)); - this._offset = 0; -} - -SSHBuffer.prototype.toBuffer = function () { - return (this._buffer.slice(0, this._offset)); -}; - -SSHBuffer.prototype.atEnd = function () { - return (this._offset >= this._buffer.length); -}; - -SSHBuffer.prototype.remainder = function () { - return (this._buffer.slice(this._offset)); -}; - -SSHBuffer.prototype.skip = function (n) { - this._offset += n; -}; - -SSHBuffer.prototype.expand = function () { - this._size *= 2; - var buf = new Buffer(this._size); - this._buffer.copy(buf, 0); - this._buffer = buf; -}; - -SSHBuffer.prototype.readPart = function () { - return ({data: this.readBuffer()}); -}; - -SSHBuffer.prototype.readBuffer = function () { - var len = this._buffer.readUInt32BE(this._offset); - this._offset += 4; - assert.ok(this._offset + len <= this._buffer.length, - 'length out of bounds at +0x' + this._offset.toString(16) + - ' (data truncated?)'); - var buf = this._buffer.slice(this._offset, this._offset + len); - this._offset += len; - return (buf); -}; - -SSHBuffer.prototype.readString = function () { - return (this.readBuffer().toString()); -}; - -SSHBuffer.prototype.readCString = function () { - var offset = this._offset; - while (offset < this._buffer.length && - this._buffer[offset] !== 0x00) - offset++; - assert.ok(offset < this._buffer.length, 'c string does not terminate'); - var str = this._buffer.slice(this._offset, offset).toString(); - this._offset = offset + 1; - return (str); -}; - -SSHBuffer.prototype.readInt = function () { - var v = this._buffer.readUInt32BE(this._offset); - this._offset += 4; - return (v); -}; - -SSHBuffer.prototype.readInt64 = function () { - assert.ok(this._offset + 8 < this._buffer.length, - 'buffer not long enough to read Int64'); - var v = this._buffer.slice(this._offset, this._offset + 8); - this._offset += 8; - return (v); -}; - -SSHBuffer.prototype.readChar = function () { - var v = this._buffer[this._offset++]; - return (v); -}; - -SSHBuffer.prototype.writeBuffer = function (buf) { - while (this._offset + 4 + buf.length > this._size) - this.expand(); - this._buffer.writeUInt32BE(buf.length, this._offset); - this._offset += 4; - buf.copy(this._buffer, this._offset); - this._offset += buf.length; -}; - -SSHBuffer.prototype.writeString = function (str) { - this.writeBuffer(new Buffer(str, 'utf8')); -}; - -SSHBuffer.prototype.writeCString = function (str) { - while (this._offset + 1 + str.length > this._size) - this.expand(); - this._buffer.write(str, this._offset); - this._offset += str.length; - this._buffer[this._offset++] = 0; -}; - -SSHBuffer.prototype.writeInt = function (v) { - while (this._offset + 4 > this._size) - this.expand(); - this._buffer.writeUInt32BE(v, this._offset); - this._offset += 4; -}; - -SSHBuffer.prototype.writeInt64 = function (v) { - assert.buffer(v, 'value'); - if (v.length > 8) { - var lead = v.slice(0, v.length - 8); - for (var i = 0; i < lead.length; ++i) { - assert.strictEqual(lead[i], 0, - 'must fit in 64 bits of precision'); - } - v = v.slice(v.length - 8, v.length); - } - while (this._offset + 8 > this._size) - this.expand(); - v.copy(this._buffer, this._offset); - this._offset += 8; -}; - -SSHBuffer.prototype.writeChar = function (v) { - while (this._offset + 1 > this._size) - this.expand(); - this._buffer[this._offset++] = v; -}; - -SSHBuffer.prototype.writePart = function (p) { - this.writeBuffer(p.data); -}; - -SSHBuffer.prototype.write = function (buf) { - while (this._offset + buf.length > this._size) - this.expand(); - buf.copy(this._buffer, this._offset); - this._offset += buf.length; -}; - - -/***/ }), -/* 147 */ -/***/ (function(module, exports, __webpack_require__) { - -var chownr = __webpack_require__(462) -var tar = __webpack_require__(325) -var pump = __webpack_require__(304) -var mkdirp = __webpack_require__(115) -var fs = __webpack_require__(5) -var path = __webpack_require__(0) -var os = __webpack_require__(41) - -var win32 = os.platform() === 'win32' - -var noop = function () {} - -var echo = function (name) { - return name -} - -var normalize = !win32 ? echo : function (name) { - return name.replace(/\\/g, '/').replace(/:/g, '_') -} - -var statAll = function (fs, stat, cwd, ignore, entries, sort) { - var queue = entries || ['.'] - - return function loop (callback) { - if (!queue.length) return callback() - var next = queue.shift() - var nextAbs = path.join(cwd, next) - - stat(nextAbs, function (err, stat) { - if (err) return callback(err) - - if (!stat.isDirectory()) return callback(null, next, stat) - - fs.readdir(nextAbs, function (err, files) { - if (err) return callback(err) - - if (sort) files.sort() - for (var i = 0; i < files.length; i++) { - if (!ignore(path.join(cwd, next, files[i]))) queue.push(path.join(next, files[i])) - } - - callback(null, next, stat) - }) - }) - } -} - -var strip = function (map, level) { - return function (header) { - header.name = header.name.split('/').slice(level).join('/') - - var linkname = header.linkname - if (linkname && (header.type === 'link' || path.isAbsolute(linkname))) { - header.linkname = linkname.split('/').slice(level).join('/') - } - - return map(header) - } -} - -exports.pack = function (cwd, opts) { - if (!cwd) cwd = '.' - if (!opts) opts = {} - - var xfs = opts.fs || fs - var ignore = opts.ignore || opts.filter || noop - var map = opts.map || noop - var mapStream = opts.mapStream || echo - var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd, ignore, opts.entries, opts.sort) - var strict = opts.strict !== false - var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask() - var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0 - var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0 - var pack = opts.pack || tar.pack() - - if (opts.strip) map = strip(map, opts.strip) - - if (opts.readable) { - dmode |= parseInt(555, 8) - fmode |= parseInt(444, 8) - } - if (opts.writable) { - dmode |= parseInt(333, 8) - fmode |= parseInt(222, 8) - } - - var onsymlink = function (filename, header) { - xfs.readlink(path.join(cwd, filename), function (err, linkname) { - if (err) return pack.destroy(err) - header.linkname = normalize(linkname) - pack.entry(header, onnextentry) - }) - } - - var onstat = function (err, filename, stat) { - if (err) return pack.destroy(err) - if (!filename) return pack.finalize() - - if (stat.isSocket()) return onnextentry() // tar does not support sockets... - - var header = { - name: normalize(filename), - mode: (stat.mode | (stat.isDirectory() ? dmode : fmode)) & umask, - mtime: stat.mtime, - size: stat.size, - type: 'file', - uid: stat.uid, - gid: stat.gid - } - - if (stat.isDirectory()) { - header.size = 0 - header.type = 'directory' - header = map(header) || header - return pack.entry(header, onnextentry) - } - - if (stat.isSymbolicLink()) { - header.size = 0 - header.type = 'symlink' - header = map(header) || header - return onsymlink(filename, header) - } - - // TODO: add fifo etc... - - header = map(header) || header - - if (!stat.isFile()) { - if (strict) return pack.destroy(new Error('unsupported type for ' + filename)) - return onnextentry() - } - - var entry = pack.entry(header, onnextentry) - if (!entry) return - - var rs = mapStream(xfs.createReadStream(path.join(cwd, filename)), header) - - rs.on('error', function (err) { // always forward errors on destroy - entry.destroy(err) - }) - - pump(rs, entry) - } - - var onnextentry = function (err) { - if (err) return pack.destroy(err) - statNext(onstat) - } - - onnextentry() - - return pack -} - -var head = function (list) { - return list.length ? list[list.length - 1] : null -} - -var processGetuid = function () { - return process.getuid ? process.getuid() : -1 -} - -var processUmask = function () { - return process.umask ? process.umask() : 0 -} - -exports.extract = function (cwd, opts) { - if (!cwd) cwd = '.' - if (!opts) opts = {} - - var xfs = opts.fs || fs - var ignore = opts.ignore || opts.filter || noop - var map = opts.map || noop - var mapStream = opts.mapStream || echo - var own = opts.chown !== false && !win32 && processGetuid() === 0 - var extract = opts.extract || tar.extract() - var stack = [] - var now = new Date() - var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask() - var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0 - var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0 - var strict = opts.strict !== false - - if (opts.strip) map = strip(map, opts.strip) - - if (opts.readable) { - dmode |= parseInt(555, 8) - fmode |= parseInt(444, 8) - } - if (opts.writable) { - dmode |= parseInt(333, 8) - fmode |= parseInt(222, 8) - } - - var utimesParent = function (name, cb) { // we just set the mtime on the parent dir again everytime we write an entry - var top - while ((top = head(stack)) && name.slice(0, top[0].length) !== top[0]) stack.pop() - if (!top) return cb() - xfs.utimes(top[0], now, top[1], cb) - } - - var utimes = function (name, header, cb) { - if (opts.utimes === false) return cb() - - if (header.type === 'directory') return xfs.utimes(name, now, header.mtime, cb) - if (header.type === 'symlink') return utimesParent(name, cb) // TODO: how to set mtime on link? - - xfs.utimes(name, now, header.mtime, function (err) { - if (err) return cb(err) - utimesParent(name, cb) - }) - } - - var chperm = function (name, header, cb) { - var link = header.type === 'symlink' - var chmod = link ? xfs.lchmod : xfs.chmod - var chown = link ? xfs.lchown : xfs.chown - - if (!chmod) return cb() - - var mode = (header.mode | (header.type === 'directory' ? dmode : fmode)) & umask - chmod(name, mode, function (err) { - if (err) return cb(err) - if (!own) return cb() - if (!chown) return cb() - chown(name, header.uid, header.gid, cb) - }) - } - - extract.on('entry', function (header, stream, next) { - header = map(header) || header - header.name = normalize(header.name) - var name = path.join(cwd, path.join('/', header.name)) - - if (ignore(name, header)) { - stream.resume() - return next() - } - - var stat = function (err) { - if (err) return next(err) - utimes(name, header, function (err) { - if (err) return next(err) - if (win32) return next() - chperm(name, header, next) - }) - } - - var onsymlink = function () { - if (win32) return next() // skip symlinks on win for now before it can be tested - xfs.unlink(name, function () { - xfs.symlink(header.linkname, name, stat) - }) - } - - var onlink = function () { - if (win32) return next() // skip links on win for now before it can be tested - xfs.unlink(name, function () { - var srcpath = path.resolve(cwd, header.linkname) - - xfs.link(srcpath, name, function (err) { - if (err && err.code === 'EPERM' && opts.hardlinkAsFilesFallback) { - stream = xfs.createReadStream(srcpath) - return onfile() - } - - stat(err) - }) - }) - } - - var onfile = function () { - var ws = xfs.createWriteStream(name) - var rs = mapStream(stream, header) - - ws.on('error', function (err) { // always forward errors on destroy - rs.destroy(err) - }) - - pump(rs, ws, function (err) { - if (err) return next(err) - ws.on('close', stat) - }) - } - - if (header.type === 'directory') { - stack.push([name, header.mtime]) - return mkdirfix(name, { - fs: xfs, own: own, uid: header.uid, gid: header.gid - }, stat) - } - - mkdirfix(path.dirname(name), { - fs: xfs, own: own, uid: header.uid, gid: header.gid - }, function (err) { - if (err) return next(err) - - switch (header.type) { - case 'file': return onfile() - case 'link': return onlink() - case 'symlink': return onsymlink() - } - - if (strict) return next(new Error('unsupported type for ' + name + ' (' + header.type + ')')) - - stream.resume() - next() - }) - }) - - return extract -} - -function mkdirfix (name, opts, cb) { - mkdirp(name, {fs: opts.xfs}, function (err, made) { - if (!err && made && opts.own) { - chownr(made, opts.uid, opts.gid, cb) - } else { - cb(err) - } - }) -} - - -/***/ }), -/* 148 */ /***/ (function(module, exports, __webpack_require__) { (function(nacl) { @@ -48288,7 +29543,7 @@ nacl.setPRNG = function(fn) { }); } else if (true) { // Node.js. - crypto = __webpack_require__(8); + crypto = __webpack_require__(11); if (crypto && crypto.randomBytes) { nacl.setPRNG(function(x, n) { var i, v = crypto.randomBytes(n); @@ -48303,174 +29558,17142 @@ nacl.setPRNG = function(fn) { /***/ }), -/* 149 */ +/* 77 */ /***/ (function(module, exports) { +module.exports = require("events"); + +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hostedGit = exports.registries = undefined; +exports.getExoticResolver = getExoticResolver; +exports.hostedGitFragmentToGitUrl = hostedGitFragmentToGitUrl; + +var _baseResolver; + +function _load_baseResolver() { + return _baseResolver = _interopRequireDefault(__webpack_require__(123)); +} + +var _npmResolver; + +function _load_npmResolver() { + return _npmResolver = _interopRequireDefault(__webpack_require__(217)); +} + +var _yarnResolver; + +function _load_yarnResolver() { + return _yarnResolver = _interopRequireDefault(__webpack_require__(576)); +} + +var _gitResolver; + +function _load_gitResolver() { + return _gitResolver = _interopRequireDefault(__webpack_require__(124)); +} + +var _tarballResolver; + +function _load_tarballResolver() { + return _tarballResolver = _interopRequireDefault(__webpack_require__(574)); +} + +var _githubResolver; + +function _load_githubResolver() { + return _githubResolver = _interopRequireDefault(__webpack_require__(367)); +} + +var _fileResolver; + +function _load_fileResolver() { + return _fileResolver = _interopRequireDefault(__webpack_require__(215)); +} + +var _linkResolver; + +function _load_linkResolver() { + return _linkResolver = _interopRequireDefault(__webpack_require__(368)); +} + +var _gitlabResolver; + +function _load_gitlabResolver() { + return _gitlabResolver = _interopRequireDefault(__webpack_require__(572)); +} + +var _gistResolver; + +function _load_gistResolver() { + return _gistResolver = _interopRequireDefault(__webpack_require__(216)); +} + +var _bitbucketResolver; + +function _load_bitbucketResolver() { + return _bitbucketResolver = _interopRequireDefault(__webpack_require__(571)); +} + +var _hostedGitResolver; + +function _load_hostedGitResolver() { + return _hostedGitResolver = __webpack_require__(109); +} + +var _registryResolver; + +function _load_registryResolver() { + return _registryResolver = _interopRequireDefault(__webpack_require__(573)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const registries = exports.registries = { + npm: (_npmResolver || _load_npmResolver()).default, + yarn: (_yarnResolver || _load_yarnResolver()).default +}; + +// + +const exotics = new Set([(_gitResolver || _load_gitResolver()).default, (_tarballResolver || _load_tarballResolver()).default, (_githubResolver || _load_githubResolver()).default, (_fileResolver || _load_fileResolver()).default, (_linkResolver || _load_linkResolver()).default, (_gitlabResolver || _load_gitlabResolver()).default, (_gistResolver || _load_gistResolver()).default, (_bitbucketResolver || _load_bitbucketResolver()).default]); + +function getExoticResolver(pattern) { + for (var _iterator = exotics, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const Resolver = _ref; + + if (Resolver.isVersion(pattern)) { + return Resolver; + } + } + return null; +} + +// + +const hostedGit = exports.hostedGit = { + github: (_githubResolver || _load_githubResolver()).default, + gitlab: (_gitlabResolver || _load_gitlabResolver()).default, + bitbucket: (_bitbucketResolver || _load_bitbucketResolver()).default +}; + +function hostedGitFragmentToGitUrl(fragment, reporter) { + for (const key in hostedGit) { + const Resolver = hostedGit[key]; + if (Resolver.isVersion(fragment)) { + return Resolver.getGitHTTPUrl((0, (_hostedGitResolver || _load_hostedGitResolver()).explodeHostedGitFragment)(fragment, reporter)); + } + } + + return fragment; +} + +// + +for (const key in registries) { + var _class, _temp; + + const RegistryResolver = registries[key]; + + exotics.add((_temp = _class = class extends (_registryResolver || _load_registryResolver()).default {}, _class.protocol = key, _class.factory = RegistryResolver, _temp)); +} + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * Base prompt implementation + * Should be extended by prompt types. + */ + +var _ = __webpack_require__(38); +var chalk = __webpack_require__(30); +var runAsync = __webpack_require__(181); +var { filter, flatMap, share, take, takeUntil } = __webpack_require__(63); +var Choices = __webpack_require__(686); +var ScreenManager = __webpack_require__(697); + +class Prompt { + constructor(question, rl, answers) { + // Setup instance defaults property + _.assign(this, { + answers: answers, + status: 'pending' + }); + + // Set defaults prompt options + this.opt = _.defaults(_.clone(question), { + validate: () => true, + filter: val => val, + when: () => true, + suffix: '', + prefix: chalk.green('?') + }); + + // Make sure name is present + if (!this.opt.name) { + this.throwParamError('name'); + } + + // Set default message if no message defined + if (!this.opt.message) { + this.opt.message = this.opt.name + ':'; + } + + // Normalize choices + if (Array.isArray(this.opt.choices)) { + this.opt.choices = new Choices(this.opt.choices, answers); + } + + this.rl = rl; + this.screen = new ScreenManager(this.rl); + } + + /** + * Start the Inquiry session and manage output value filtering + * @return {Promise} + */ + + run() { + return new Promise(resolve => { + this._run(value => resolve(value)); + }); + } + + // Default noop (this one should be overwritten in prompts) + _run(cb) { + cb(); + } + + /** + * Throw an error telling a required parameter is missing + * @param {String} name Name of the missing param + * @return {Throw Error} + */ + + throwParamError(name) { + throw new Error('You must provide a `' + name + '` parameter'); + } + + /** + * Called when the UI closes. Override to do any specific cleanup necessary + */ + close() { + this.screen.releaseCursor(); + } + + /** + * Run the provided validation method each time a submit event occur. + * @param {Rx.Observable} submit - submit event flow + * @return {Object} Object containing two observables: `success` and `error` + */ + handleSubmitEvents(submit) { + var self = this; + var validate = runAsync(this.opt.validate); + var asyncFilter = runAsync(this.opt.filter); + var validation = submit.pipe( + flatMap(value => + asyncFilter(value, self.answers).then( + filteredValue => + validate(filteredValue, self.answers).then( + isValid => ({ isValid: isValid, value: filteredValue }), + err => ({ isValid: err }) + ), + err => ({ isValid: err }) + ) + ), + share() + ); + + var success = validation.pipe( + filter(state => state.isValid === true), + take(1) + ); + var error = validation.pipe( + filter(state => state.isValid !== true), + takeUntil(success) + ); + + return { + success: success, + error: error + }; + } + + /** + * Generate the prompt question string + * @return {String} prompt question string + */ + + getQuestion() { + var message = + this.opt.prefix + + ' ' + + chalk.bold(this.opt.message) + + this.opt.suffix + + chalk.reset(' '); + + // Append the default if available, and if question isn't answered + if (this.opt.default != null && this.status !== 'answered') { + // If default password is supplied, hide it + if (this.opt.type === 'password') { + message += chalk.italic.dim('[hidden] '); + } else { + message += chalk.dim('(' + this.opt.default + ') '); + } + } + + return message; + } +} + +module.exports = Prompt; + + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var { fromEvent } = __webpack_require__(182); +var { filter, map, share } = __webpack_require__(63); + +function normalizeKeypressEvents(value, key) { + return { value: value, key: key || {} }; +} + +module.exports = function(rl) { + var keypress = fromEvent(rl.input, 'keypress', normalizeKeypressEvents) + // Ignore `enter` key. On the readline, we only care about the `line` event. + .pipe(filter(({ key }) => key.name !== 'enter' && key.name !== 'return')); + + return { + line: fromEvent(rl, 'line'), + keypress: keypress, + + normalizedUpKey: keypress.pipe( + filter( + ({ key }) => + key.name === 'up' || key.name === 'k' || (key.name === 'p' && key.ctrl) + ), + share() + ), + + normalizedDownKey: keypress.pipe( + filter( + ({ key }) => + key.name === 'down' || key.name === 'j' || (key.name === 'n' && key.ctrl) + ), + share() + ), + + numberKey: keypress.pipe( + filter(e => e.value && '123456789'.indexOf(e.value) >= 0), + map(e => Number(e.value)), + share() + ), + + spaceKey: keypress.pipe( + filter(({ key }) => key && key.name === 'space'), + share() + ), + aKey: keypress.pipe( + filter(({ key }) => key && key.name === 'a'), + share() + ), + iKey: keypress.pipe( + filter(({ key }) => key && key.name === 'i'), + share() + ) + }; +}; + + +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { + +(function(){ + + // Copyright (c) 2005 Tom Wu + // All Rights Reserved. + // See "LICENSE" for details. + + // Basic JavaScript BN library - subset useful for RSA encryption. + + // Bits per digit + var dbits; + + // JavaScript engine analysis + var canary = 0xdeadbeefcafe; + var j_lm = ((canary&0xffffff)==0xefcafe); + + // (public) Constructor + function BigInteger(a,b,c) { + if(a != null) + if("number" == typeof a) this.fromNumber(a,b,c); + else if(b == null && "string" != typeof a) this.fromString(a,256); + else this.fromString(a,b); + } + + // return new, unset BigInteger + function nbi() { return new BigInteger(null); } + + // am: Compute w_j += (x*this_i), propagate carries, + // c is initial carry, returns final carry. + // c < 3*dvalue, x < 2*dvalue, this_i < dvalue + // We need to select the fastest one that works in this environment. + + // am1: use a single mult and divide to get the high bits, + // max digit bits should be 26 because + // max internal value = 2*dvalue^2-2*dvalue (< 2^53) + function am1(i,x,w,j,c,n) { + while(--n >= 0) { + var v = x*this[i++]+w[j]+c; + c = Math.floor(v/0x4000000); + w[j++] = v&0x3ffffff; + } + return c; + } + // am2 avoids a big mult-and-extract completely. + // Max digit bits should be <= 30 because we do bitwise ops + // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) + function am2(i,x,w,j,c,n) { + var xl = x&0x7fff, xh = x>>15; + while(--n >= 0) { + var l = this[i]&0x7fff; + var h = this[i++]>>15; + var m = xh*l+h*xl; + l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); + c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); + w[j++] = l&0x3fffffff; + } + return c; + } + // Alternately, set max digit bits to 28 since some + // browsers slow down when dealing with 32-bit numbers. + function am3(i,x,w,j,c,n) { + var xl = x&0x3fff, xh = x>>14; + while(--n >= 0) { + var l = this[i]&0x3fff; + var h = this[i++]>>14; + var m = xh*l+h*xl; + l = xl*l+((m&0x3fff)<<14)+w[j]+c; + c = (l>>28)+(m>>14)+xh*h; + w[j++] = l&0xfffffff; + } + return c; + } + var inBrowser = typeof navigator !== "undefined"; + if(inBrowser && j_lm && (navigator.appName == "Microsoft Internet Explorer")) { + BigInteger.prototype.am = am2; + dbits = 30; + } + else if(inBrowser && j_lm && (navigator.appName != "Netscape")) { + BigInteger.prototype.am = am1; + dbits = 26; + } + else { // Mozilla/Netscape seems to prefer am3 + BigInteger.prototype.am = am3; + dbits = 28; + } + + BigInteger.prototype.DB = dbits; + BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i]; + r.t = this.t; + r.s = this.s; + } + + // (protected) set from integer value x, -DV <= x < DV + function bnpFromInt(x) { + this.t = 1; + this.s = (x<0)?-1:0; + if(x > 0) this[0] = x; + else if(x < -1) this[0] = x+this.DV; + else this.t = 0; + } + + // return bigint initialized to value + function nbv(i) { var r = nbi(); r.fromInt(i); return r; } + + // (protected) set from string and radix + function bnpFromString(s,b) { + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 256) k = 8; // byte array + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else { this.fromRadix(s,b); return; } + this.t = 0; + this.s = 0; + var i = s.length, mi = false, sh = 0; + while(--i >= 0) { + var x = (k==8)?s[i]&0xff:intAt(s,i); + if(x < 0) { + if(s.charAt(i) == "-") mi = true; + continue; + } + mi = false; + if(sh == 0) + this[this.t++] = x; + else if(sh+k > this.DB) { + this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); + } + else + this[this.t-1] |= x<= this.DB) sh -= this.DB; + } + if(k == 8 && (s[0]&0x80) != 0) { + this.s = -1; + if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t; + } + + // (public) return string representation in given radix + function bnToString(b) { + if(this.s < 0) return "-"+this.negate().toString(b); + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else return this.toRadix(b); + var km = (1< 0) { + if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); } + while(i >= 0) { + if(p < k) { + d = (this[i]&((1<>(p+=this.DB-k); + } + else { + d = (this[i]>>(p-=k))&km; + if(p <= 0) { p += this.DB; --i; } + } + if(d > 0) m = true; + if(m) r += int2char(d); + } + } + return m?r:"0"; + } + + // (public) -this + function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } + + // (public) |this| + function bnAbs() { return (this.s<0)?this.negate():this; } + + // (public) return + if this > a, - if this < a, 0 if equal + function bnCompareTo(a) { + var r = this.s-a.s; + if(r != 0) return r; + var i = this.t; + r = i-a.t; + if(r != 0) return (this.s<0)?-r:r; + while(--i >= 0) if((r=this[i]-a[i]) != 0) return r; + return 0; + } + + // returns bit length of the integer x + function nbits(x) { + var r = 1, t; + if((t=x>>>16) != 0) { x = t; r += 16; } + if((t=x>>8) != 0) { x = t; r += 8; } + if((t=x>>4) != 0) { x = t; r += 4; } + if((t=x>>2) != 0) { x = t; r += 2; } + if((t=x>>1) != 0) { x = t; r += 1; } + return r; + } + + // (public) return the number of bits in "this" + function bnBitLength() { + if(this.t <= 0) return 0; + return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM)); + } + + // (protected) r = this << n*DB + function bnpDLShiftTo(n,r) { + var i; + for(i = this.t-1; i >= 0; --i) r[i+n] = this[i]; + for(i = n-1; i >= 0; --i) r[i] = 0; + r.t = this.t+n; + r.s = this.s; + } + + // (protected) r = this >> n*DB + function bnpDRShiftTo(n,r) { + for(var i = n; i < this.t; ++i) r[i-n] = this[i]; + r.t = Math.max(this.t-n,0); + r.s = this.s; + } + + // (protected) r = this << n + function bnpLShiftTo(n,r) { + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<= 0; --i) { + r[i+ds+1] = (this[i]>>cbs)|c; + c = (this[i]&bm)<= 0; --i) r[i] = 0; + r[ds] = c; + r.t = this.t+ds+1; + r.s = this.s; + r.clamp(); + } + + // (protected) r = this >> n + function bnpRShiftTo(n,r) { + r.s = this.s; + var ds = Math.floor(n/this.DB); + if(ds >= this.t) { r.t = 0; return; } + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<>bs; + for(var i = ds+1; i < this.t; ++i) { + r[i-ds-1] |= (this[i]&bm)<>bs; + } + if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB; + } + if(a.t < this.t) { + c -= a.s; + while(i < this.t) { + c += this[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += this.s; + } + else { + c += this.s; + while(i < a.t) { + c -= a[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c -= a.s; + } + r.s = (c<0)?-1:0; + if(c < -1) r[i++] = this.DV+c; + else if(c > 0) r[i++] = c; + r.t = i; + r.clamp(); + } + + // (protected) r = this * a, r != this,a (HAC 14.12) + // "this" should be the larger one if appropriate. + function bnpMultiplyTo(a,r) { + var x = this.abs(), y = a.abs(); + var i = x.t; + r.t = i+y.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t); + r.s = 0; + r.clamp(); + if(this.s != a.s) BigInteger.ZERO.subTo(r,r); + } + + // (protected) r = this^2, r != this (HAC 14.16) + function bnpSquareTo(r) { + var x = this.abs(); + var i = r.t = 2*x.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < x.t-1; ++i) { + var c = x.am(i,x[i],r,2*i,0,1); + if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { + r[i+x.t] -= x.DV; + r[i+x.t+1] = 1; + } + } + if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); + r.s = 0; + r.clamp(); + } + + // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) + // r != q, this != m. q or r may be null. + function bnpDivRemTo(m,q,r) { + var pm = m.abs(); + if(pm.t <= 0) return; + var pt = this.abs(); + if(pt.t < pm.t) { + if(q != null) q.fromInt(0); + if(r != null) this.copyTo(r); + return; + } + if(r == null) r = nbi(); + var y = nbi(), ts = this.s, ms = m.s; + var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus + if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } + else { pm.copyTo(y); pt.copyTo(r); } + var ys = y.t; + var y0 = y[ys-1]; + if(y0 == 0) return; + var yt = y0*(1<1)?y[ys-2]>>this.F2:0); + var d1 = this.FV/yt, d2 = (1<= 0) { + r[r.t++] = 1; + r.subTo(t,r); + } + BigInteger.ONE.dlShiftTo(ys,t); + t.subTo(y,y); // "negative" y so we can replace sub with am later + while(y.t < ys) y[y.t++] = 0; + while(--j >= 0) { + // Estimate quotient digit + var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2); + if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out + y.dlShiftTo(j,t); + r.subTo(t,r); + while(r[i] < --qd) r.subTo(t,r); + } + } + if(q != null) { + r.drShiftTo(ys,q); + if(ts != ms) BigInteger.ZERO.subTo(q,q); + } + r.t = ys; + r.clamp(); + if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder + if(ts < 0) BigInteger.ZERO.subTo(r,r); + } + + // (public) this mod a + function bnMod(a) { + var r = nbi(); + this.abs().divRemTo(a,null,r); + if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); + return r; + } + + // Modular reduction using "classic" algorithm + function Classic(m) { this.m = m; } + function cConvert(x) { + if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); + else return x; + } + function cRevert(x) { return x; } + function cReduce(x) { x.divRemTo(this.m,null,x); } + function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + + Classic.prototype.convert = cConvert; + Classic.prototype.revert = cRevert; + Classic.prototype.reduce = cReduce; + Classic.prototype.mulTo = cMulTo; + Classic.prototype.sqrTo = cSqrTo; + + // (protected) return "-1/this % 2^DB"; useful for Mont. reduction + // justification: + // xy == 1 (mod m) + // xy = 1+km + // xy(2-xy) = (1+km)(1-km) + // x[y(2-xy)] = 1-k^2m^2 + // x[y(2-xy)] == 1 (mod m^2) + // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 + // should reduce x and y(2-xy) by m^2 at each step to keep size bounded. + // JS multiply "overflows" differently from C/C++, so care is needed here. + function bnpInvDigit() { + if(this.t < 1) return 0; + var x = this[0]; + if((x&1) == 0) return 0; + var y = x&3; // y == 1/x mod 2^2 + y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 + y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 + y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 + // last step - calculate inverse mod DV directly; + // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints + y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits + // we really want the negative inverse, and -DV < y < DV + return (y>0)?this.DV-y:-y; + } + + // Montgomery reduction + function Montgomery(m) { + this.m = m; + this.mp = m.invDigit(); + this.mpl = this.mp&0x7fff; + this.mph = this.mp>>15; + this.um = (1<<(m.DB-15))-1; + this.mt2 = 2*m.t; + } + + // xR mod m + function montConvert(x) { + var r = nbi(); + x.abs().dlShiftTo(this.m.t,r); + r.divRemTo(this.m,null,r); + if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); + return r; + } + + // x/R mod m + function montRevert(x) { + var r = nbi(); + x.copyTo(r); + this.reduce(r); + return r; + } + + // x = x/R mod m (HAC 14.32) + function montReduce(x) { + while(x.t <= this.mt2) // pad x so am has enough room later + x[x.t++] = 0; + for(var i = 0; i < this.m.t; ++i) { + // faster way of calculating u0 = x[i]*mp mod DV + var j = x[i]&0x7fff; + var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; + // use am to combine the multiply-shift-add into one call + j = i+this.m.t; + x[j] += this.m.am(0,u0,x,i,0,this.m.t); + // propagate carry + while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } + } + x.clamp(); + x.drShiftTo(this.m.t,x); + if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); + } + + // r = "x^2/R mod m"; x != r + function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + + // r = "xy/R mod m"; x,y != r + function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + + Montgomery.prototype.convert = montConvert; + Montgomery.prototype.revert = montRevert; + Montgomery.prototype.reduce = montReduce; + Montgomery.prototype.mulTo = montMulTo; + Montgomery.prototype.sqrTo = montSqrTo; + + // (protected) true iff this is even + function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; } + + // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) + function bnpExp(e,z) { + if(e > 0xffffffff || e < 1) return BigInteger.ONE; + var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; + g.copyTo(r); + while(--i >= 0) { + z.sqrTo(r,r2); + if((e&(1< 0) z.mulTo(r2,g,r); + else { var t = r; r = r2; r2 = t; } + } + return z.revert(r); + } + + // (public) this^e % m, 0 <= e < 2^32 + function bnModPowInt(e,m) { + var z; + if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); + return this.exp(e,z); + } + + // protected + BigInteger.prototype.copyTo = bnpCopyTo; + BigInteger.prototype.fromInt = bnpFromInt; + BigInteger.prototype.fromString = bnpFromString; + BigInteger.prototype.clamp = bnpClamp; + BigInteger.prototype.dlShiftTo = bnpDLShiftTo; + BigInteger.prototype.drShiftTo = bnpDRShiftTo; + BigInteger.prototype.lShiftTo = bnpLShiftTo; + BigInteger.prototype.rShiftTo = bnpRShiftTo; + BigInteger.prototype.subTo = bnpSubTo; + BigInteger.prototype.multiplyTo = bnpMultiplyTo; + BigInteger.prototype.squareTo = bnpSquareTo; + BigInteger.prototype.divRemTo = bnpDivRemTo; + BigInteger.prototype.invDigit = bnpInvDigit; + BigInteger.prototype.isEven = bnpIsEven; + BigInteger.prototype.exp = bnpExp; + + // public + BigInteger.prototype.toString = bnToString; + BigInteger.prototype.negate = bnNegate; + BigInteger.prototype.abs = bnAbs; + BigInteger.prototype.compareTo = bnCompareTo; + BigInteger.prototype.bitLength = bnBitLength; + BigInteger.prototype.mod = bnMod; + BigInteger.prototype.modPowInt = bnModPowInt; + + // "constants" + BigInteger.ZERO = nbv(0); + BigInteger.ONE = nbv(1); + + // Copyright (c) 2005-2009 Tom Wu + // All Rights Reserved. + // See "LICENSE" for details. + + // Extended JavaScript BN functions, required for RSA private ops. + + // Version 1.1: new BigInteger("0", 10) returns "proper" zero + // Version 1.2: square() API, isProbablePrime fix + + // (public) + function bnClone() { var r = nbi(); this.copyTo(r); return r; } + + // (public) return value as integer + function bnIntValue() { + if(this.s < 0) { + if(this.t == 1) return this[0]-this.DV; + else if(this.t == 0) return -1; + } + else if(this.t == 1) return this[0]; + else if(this.t == 0) return 0; + // assumes 16 < DB < 32 + return ((this[1]&((1<<(32-this.DB))-1))<>24; } + + // (public) return value as short (assumes DB>=16) + function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; } + + // (protected) return x s.t. r^x < DV + function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); } + + // (public) 0 if this == 0, 1 if this > 0 + function bnSigNum() { + if(this.s < 0) return -1; + else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0; + else return 1; + } + + // (protected) convert to radix string + function bnpToRadix(b) { + if(b == null) b = 10; + if(this.signum() == 0 || b < 2 || b > 36) return "0"; + var cs = this.chunkSize(b); + var a = Math.pow(b,cs); + var d = nbv(a), y = nbi(), z = nbi(), r = ""; + this.divRemTo(d,y,z); + while(y.signum() > 0) { + r = (a+z.intValue()).toString(b).substr(1) + r; + y.divRemTo(d,y,z); + } + return z.intValue().toString(b) + r; + } + + // (protected) convert from radix string + function bnpFromRadix(s,b) { + this.fromInt(0); + if(b == null) b = 10; + var cs = this.chunkSize(b); + var d = Math.pow(b,cs), mi = false, j = 0, w = 0; + for(var i = 0; i < s.length; ++i) { + var x = intAt(s,i); + if(x < 0) { + if(s.charAt(i) == "-" && this.signum() == 0) mi = true; + continue; + } + w = b*w+x; + if(++j >= cs) { + this.dMultiply(d); + this.dAddOffset(w,0); + j = 0; + w = 0; + } + } + if(j > 0) { + this.dMultiply(Math.pow(b,j)); + this.dAddOffset(w,0); + } + if(mi) BigInteger.ZERO.subTo(this,this); + } + + // (protected) alternate constructor + function bnpFromNumber(a,b,c) { + if("number" == typeof b) { + // new BigInteger(int,int,RNG) + if(a < 2) this.fromInt(1); + else { + this.fromNumber(a,c); + if(!this.testBit(a-1)) // force MSB set + this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); + if(this.isEven()) this.dAddOffset(1,0); // force odd + while(!this.isProbablePrime(b)) { + this.dAddOffset(2,0); + if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); + } + } + } + else { + // new BigInteger(int,RNG) + var x = new Array(), t = a&7; + x.length = (a>>3)+1; + b.nextBytes(x); + if(t > 0) x[0] &= ((1< 0) { + if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p) + r[k++] = d|(this.s<<(this.DB-p)); + while(i >= 0) { + if(p < 8) { + d = (this[i]&((1<>(p+=this.DB-8); + } + else { + d = (this[i]>>(p-=8))&0xff; + if(p <= 0) { p += this.DB; --i; } + } + if((d&0x80) != 0) d |= -256; + if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; + if(k > 0 || d != this.s) r[k++] = d; + } + } + return r; + } + + function bnEquals(a) { return(this.compareTo(a)==0); } + function bnMin(a) { return(this.compareTo(a)<0)?this:a; } + function bnMax(a) { return(this.compareTo(a)>0)?this:a; } + + // (protected) r = this op a (bitwise) + function bnpBitwiseTo(a,op,r) { + var i, f, m = Math.min(a.t,this.t); + for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]); + if(a.t < this.t) { + f = a.s&this.DM; + for(i = m; i < this.t; ++i) r[i] = op(this[i],f); + r.t = this.t; + } + else { + f = this.s&this.DM; + for(i = m; i < a.t; ++i) r[i] = op(f,a[i]); + r.t = a.t; + } + r.s = op(this.s,a.s); + r.clamp(); + } + + // (public) this & a + function op_and(x,y) { return x&y; } + function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } + + // (public) this | a + function op_or(x,y) { return x|y; } + function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } + + // (public) this ^ a + function op_xor(x,y) { return x^y; } + function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } + + // (public) this & ~a + function op_andnot(x,y) { return x&~y; } + function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } + + // (public) ~this + function bnNot() { + var r = nbi(); + for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i]; + r.t = this.t; + r.s = ~this.s; + return r; + } + + // (public) this << n + function bnShiftLeft(n) { + var r = nbi(); + if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); + return r; + } + + // (public) this >> n + function bnShiftRight(n) { + var r = nbi(); + if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); + return r; + } + + // return index of lowest 1-bit in x, x < 2^31 + function lbit(x) { + if(x == 0) return -1; + var r = 0; + if((x&0xffff) == 0) { x >>= 16; r += 16; } + if((x&0xff) == 0) { x >>= 8; r += 8; } + if((x&0xf) == 0) { x >>= 4; r += 4; } + if((x&3) == 0) { x >>= 2; r += 2; } + if((x&1) == 0) ++r; + return r; + } + + // (public) returns index of lowest 1-bit (or -1 if none) + function bnGetLowestSetBit() { + for(var i = 0; i < this.t; ++i) + if(this[i] != 0) return i*this.DB+lbit(this[i]); + if(this.s < 0) return this.t*this.DB; + return -1; + } + + // return number of 1 bits in x + function cbit(x) { + var r = 0; + while(x != 0) { x &= x-1; ++r; } + return r; + } + + // (public) return number of set bits + function bnBitCount() { + var r = 0, x = this.s&this.DM; + for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x); + return r; + } + + // (public) true iff nth bit is set + function bnTestBit(n) { + var j = Math.floor(n/this.DB); + if(j >= this.t) return(this.s!=0); + return((this[j]&(1<<(n%this.DB)))!=0); + } + + // (protected) this op (1<>= this.DB; + } + if(a.t < this.t) { + c += a.s; + while(i < this.t) { + c += this[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += this.s; + } + else { + c += this.s; + while(i < a.t) { + c += a[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += a.s; + } + r.s = (c<0)?-1:0; + if(c > 0) r[i++] = c; + else if(c < -1) r[i++] = this.DV+c; + r.t = i; + r.clamp(); + } + + // (public) this + a + function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } + + // (public) this - a + function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } + + // (public) this * a + function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } + + // (public) this^2 + function bnSquare() { var r = nbi(); this.squareTo(r); return r; } + + // (public) this / a + function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } + + // (public) this % a + function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } + + // (public) [this/a,this%a] + function bnDivideAndRemainder(a) { + var q = nbi(), r = nbi(); + this.divRemTo(a,q,r); + return new Array(q,r); + } + + // (protected) this *= n, this >= 0, 1 < n < DV + function bnpDMultiply(n) { + this[this.t] = this.am(0,n-1,this,0,0,this.t); + ++this.t; + this.clamp(); + } + + // (protected) this += n << w words, this >= 0 + function bnpDAddOffset(n,w) { + if(n == 0) return; + while(this.t <= w) this[this.t++] = 0; + this[w] += n; + while(this[w] >= this.DV) { + this[w] -= this.DV; + if(++w >= this.t) this[this.t++] = 0; + ++this[w]; + } + } + + // A "null" reducer + function NullExp() {} + function nNop(x) { return x; } + function nMulTo(x,y,r) { x.multiplyTo(y,r); } + function nSqrTo(x,r) { x.squareTo(r); } + + NullExp.prototype.convert = nNop; + NullExp.prototype.revert = nNop; + NullExp.prototype.mulTo = nMulTo; + NullExp.prototype.sqrTo = nSqrTo; + + // (public) this^e + function bnPow(e) { return this.exp(e,new NullExp()); } + + // (protected) r = lower n words of "this * a", a.t <= n + // "this" should be the larger one if appropriate. + function bnpMultiplyLowerTo(a,n,r) { + var i = Math.min(this.t+a.t,n); + r.s = 0; // assumes a,this >= 0 + r.t = i; + while(i > 0) r[--i] = 0; + var j; + for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t); + for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i); + r.clamp(); + } + + // (protected) r = "this * a" without lower n words, n > 0 + // "this" should be the larger one if appropriate. + function bnpMultiplyUpperTo(a,n,r) { + --n; + var i = r.t = this.t+a.t-n; + r.s = 0; // assumes a,this >= 0 + while(--i >= 0) r[i] = 0; + for(i = Math.max(n-this.t,0); i < a.t; ++i) + r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n); + r.clamp(); + r.drShiftTo(1,r); + } + + // Barrett modular reduction + function Barrett(m) { + // setup Barrett + this.r2 = nbi(); + this.q3 = nbi(); + BigInteger.ONE.dlShiftTo(2*m.t,this.r2); + this.mu = this.r2.divide(m); + this.m = m; + } + + function barrettConvert(x) { + if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); + else if(x.compareTo(this.m) < 0) return x; + else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } + } + + function barrettRevert(x) { return x; } + + // x = x mod m (HAC 14.42) + function barrettReduce(x) { + x.drShiftTo(this.m.t-1,this.r2); + if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } + this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3); + this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2); + while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); + x.subTo(this.r2,x); + while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); + } + + // r = x^2 mod m; x != r + function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + + // r = x*y mod m; x,y != r + function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + + Barrett.prototype.convert = barrettConvert; + Barrett.prototype.revert = barrettRevert; + Barrett.prototype.reduce = barrettReduce; + Barrett.prototype.mulTo = barrettMulTo; + Barrett.prototype.sqrTo = barrettSqrTo; + + // (public) this^e % m (HAC 14.85) + function bnModPow(e,m) { + var i = e.bitLength(), k, r = nbv(1), z; + if(i <= 0) return r; + else if(i < 18) k = 1; + else if(i < 48) k = 3; + else if(i < 144) k = 4; + else if(i < 768) k = 5; + else k = 6; + if(i < 8) + z = new Classic(m); + else if(m.isEven()) + z = new Barrett(m); + else + z = new Montgomery(m); + + // precomputation + var g = new Array(), n = 3, k1 = k-1, km = (1< 1) { + var g2 = nbi(); + z.sqrTo(g[1],g2); + while(n <= km) { + g[n] = nbi(); + z.mulTo(g2,g[n-2],g[n]); + n += 2; + } + } + + var j = e.t-1, w, is1 = true, r2 = nbi(), t; + i = nbits(e[j])-1; + while(j >= 0) { + if(i >= k1) w = (e[j]>>(i-k1))&km; + else { + w = (e[j]&((1<<(i+1))-1))<<(k1-i); + if(j > 0) w |= e[j-1]>>(this.DB+i-k1); + } + + n = k; + while((w&1) == 0) { w >>= 1; --n; } + if((i -= n) < 0) { i += this.DB; --j; } + if(is1) { // ret == 1, don't bother squaring or multiplying it + g[w].copyTo(r); + is1 = false; + } + else { + while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } + if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } + z.mulTo(r2,g[w],r); + } + + while(j >= 0 && (e[j]&(1< 0) { + x.rShiftTo(g,x); + y.rShiftTo(g,y); + } + while(x.signum() > 0) { + if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); + if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); + if(x.compareTo(y) >= 0) { + x.subTo(y,x); + x.rShiftTo(1,x); + } + else { + y.subTo(x,y); + y.rShiftTo(1,y); + } + } + if(g > 0) y.lShiftTo(g,y); + return y; + } + + // (protected) this % n, n < 2^26 + function bnpModInt(n) { + if(n <= 0) return 0; + var d = this.DV%n, r = (this.s<0)?n-1:0; + if(this.t > 0) + if(d == 0) r = this[0]%n; + else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n; + return r; + } + + // (public) 1/this % m (HAC 14.61) + function bnModInverse(m) { + var ac = m.isEven(); + if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; + var u = m.clone(), v = this.clone(); + var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); + while(u.signum() != 0) { + while(u.isEven()) { + u.rShiftTo(1,u); + if(ac) { + if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } + a.rShiftTo(1,a); + } + else if(!b.isEven()) b.subTo(m,b); + b.rShiftTo(1,b); + } + while(v.isEven()) { + v.rShiftTo(1,v); + if(ac) { + if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } + c.rShiftTo(1,c); + } + else if(!d.isEven()) d.subTo(m,d); + d.rShiftTo(1,d); + } + if(u.compareTo(v) >= 0) { + u.subTo(v,u); + if(ac) a.subTo(c,a); + b.subTo(d,b); + } + else { + v.subTo(u,v); + if(ac) c.subTo(a,c); + d.subTo(b,d); + } + } + if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; + if(d.compareTo(m) >= 0) return d.subtract(m); + if(d.signum() < 0) d.addTo(m,d); else return d; + if(d.signum() < 0) return d.add(m); else return d; + } + + var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]; + var lplim = (1<<26)/lowprimes[lowprimes.length-1]; + + // (public) test primality with certainty >= 1-.5^t + function bnIsProbablePrime(t) { + var i, x = this.abs(); + if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) { + for(i = 0; i < lowprimes.length; ++i) + if(x[0] == lowprimes[i]) return true; + return false; + } + if(x.isEven()) return false; + i = 1; + while(i < lowprimes.length) { + var m = lowprimes[i], j = i+1; + while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; + m = x.modInt(m); + while(i < j) if(m%lowprimes[i++] == 0) return false; + } + return x.millerRabin(t); + } + + // (protected) true if probably prime (HAC 4.24, Miller-Rabin) + function bnpMillerRabin(t) { + var n1 = this.subtract(BigInteger.ONE); + var k = n1.getLowestSetBit(); + if(k <= 0) return false; + var r = n1.shiftRight(k); + t = (t+1)>>1; + if(t > lowprimes.length) t = lowprimes.length; + var a = nbi(); + for(var i = 0; i < t; ++i) { + //Pick bases at random, instead of starting at 2 + a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]); + var y = a.modPow(r,this); + if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { + var j = 1; + while(j++ < k && y.compareTo(n1) != 0) { + y = y.modPowInt(2,this); + if(y.compareTo(BigInteger.ONE) == 0) return false; + } + if(y.compareTo(n1) != 0) return false; + } + } + return true; + } + + // protected + BigInteger.prototype.chunkSize = bnpChunkSize; + BigInteger.prototype.toRadix = bnpToRadix; + BigInteger.prototype.fromRadix = bnpFromRadix; + BigInteger.prototype.fromNumber = bnpFromNumber; + BigInteger.prototype.bitwiseTo = bnpBitwiseTo; + BigInteger.prototype.changeBit = bnpChangeBit; + BigInteger.prototype.addTo = bnpAddTo; + BigInteger.prototype.dMultiply = bnpDMultiply; + BigInteger.prototype.dAddOffset = bnpDAddOffset; + BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; + BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; + BigInteger.prototype.modInt = bnpModInt; + BigInteger.prototype.millerRabin = bnpMillerRabin; + + // public + BigInteger.prototype.clone = bnClone; + BigInteger.prototype.intValue = bnIntValue; + BigInteger.prototype.byteValue = bnByteValue; + BigInteger.prototype.shortValue = bnShortValue; + BigInteger.prototype.signum = bnSigNum; + BigInteger.prototype.toByteArray = bnToByteArray; + BigInteger.prototype.equals = bnEquals; + BigInteger.prototype.min = bnMin; + BigInteger.prototype.max = bnMax; + BigInteger.prototype.and = bnAnd; + BigInteger.prototype.or = bnOr; + BigInteger.prototype.xor = bnXor; + BigInteger.prototype.andNot = bnAndNot; + BigInteger.prototype.not = bnNot; + BigInteger.prototype.shiftLeft = bnShiftLeft; + BigInteger.prototype.shiftRight = bnShiftRight; + BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; + BigInteger.prototype.bitCount = bnBitCount; + BigInteger.prototype.testBit = bnTestBit; + BigInteger.prototype.setBit = bnSetBit; + BigInteger.prototype.clearBit = bnClearBit; + BigInteger.prototype.flipBit = bnFlipBit; + BigInteger.prototype.add = bnAdd; + BigInteger.prototype.subtract = bnSubtract; + BigInteger.prototype.multiply = bnMultiply; + BigInteger.prototype.divide = bnDivide; + BigInteger.prototype.remainder = bnRemainder; + BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; + BigInteger.prototype.modPow = bnModPow; + BigInteger.prototype.modInverse = bnModInverse; + BigInteger.prototype.pow = bnPow; + BigInteger.prototype.gcd = bnGCD; + BigInteger.prototype.isProbablePrime = bnIsProbablePrime; + + // JSBN-specific extension + BigInteger.prototype.square = bnSquare; + + // Expose the Barrett function + BigInteger.prototype.Barrett = Barrett + + // BigInteger interfaces not implemented in jsbn: + + // BigInteger(int signum, byte[] magnitude) + // double doubleValue() + // float floatValue() + // int hashCode() + // long longValue() + // static BigInteger valueOf(long val) + + // Random number generator - requires a PRNG backend, e.g. prng4.js + + // For best results, put code like + // + // in your main HTML document. + + var rng_state; + var rng_pool; + var rng_pptr; + + // Mix in a 32-bit integer into the pool + function rng_seed_int(x) { + rng_pool[rng_pptr++] ^= x & 255; + rng_pool[rng_pptr++] ^= (x >> 8) & 255; + rng_pool[rng_pptr++] ^= (x >> 16) & 255; + rng_pool[rng_pptr++] ^= (x >> 24) & 255; + if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; + } + + // Mix in the current time (w/milliseconds) into the pool + function rng_seed_time() { + rng_seed_int(new Date().getTime()); + } + + // Initialize the pool with junk if needed. + if(rng_pool == null) { + rng_pool = new Array(); + rng_pptr = 0; + var t; + if(typeof window !== "undefined" && window.crypto) { + if (window.crypto.getRandomValues) { + // Use webcrypto if available + var ua = new Uint8Array(32); + window.crypto.getRandomValues(ua); + for(t = 0; t < 32; ++t) + rng_pool[rng_pptr++] = ua[t]; + } + else if(navigator.appName == "Netscape" && navigator.appVersion < "5") { + // Extract entropy (256 bits) from NS4 RNG if available + var z = window.crypto.random(32); + for(t = 0; t < z.length; ++t) + rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; + } + } + while(rng_pptr < rng_psize) { // extract some randomness from Math.random() + t = Math.floor(65536 * Math.random()); + rng_pool[rng_pptr++] = t >>> 8; + rng_pool[rng_pptr++] = t & 255; + } + rng_pptr = 0; + rng_seed_time(); + //rng_seed_int(window.screenX); + //rng_seed_int(window.screenY); + } + + function rng_get_byte() { + if(rng_state == null) { + rng_seed_time(); + rng_state = prng_newstate(); + rng_state.init(rng_pool); + for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) + rng_pool[rng_pptr] = 0; + rng_pptr = 0; + //rng_pool = null; + } + // TODO: allow reseeding after first request + return rng_state.next(); + } + + function rng_get_bytes(ba) { + var i; + for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); + } + + function SecureRandom() {} + + SecureRandom.prototype.nextBytes = rng_get_bytes; + + // prng4.js - uses Arcfour as a PRNG + + function Arcfour() { + this.i = 0; + this.j = 0; + this.S = new Array(); + } + + // Initialize arcfour context from key, an array of ints, each from [0..255] + function ARC4init(key) { + var i, j, t; + for(i = 0; i < 256; ++i) + this.S[i] = i; + j = 0; + for(i = 0; i < 256; ++i) { + j = (j + this.S[i] + key[i % key.length]) & 255; + t = this.S[i]; + this.S[i] = this.S[j]; + this.S[j] = t; + } + this.i = 0; + this.j = 0; + } + + function ARC4next() { + var t; + this.i = (this.i + 1) & 255; + this.j = (this.j + this.S[this.i]) & 255; + t = this.S[this.i]; + this.S[this.i] = this.S[this.j]; + this.S[this.j] = t; + return this.S[(t + this.S[this.i]) & 255]; + } + + Arcfour.prototype.init = ARC4init; + Arcfour.prototype.next = ARC4next; + + // Plug in your RNG constructor here + function prng_newstate() { + return new Arcfour(); + } + + // Pool size must be a multiple of 4 and greater than 32. + // An array of bytes the size of the pool will be passed to init() + var rng_psize = 256; + + BigInteger.SecureRandom = SecureRandom; + BigInteger.BigInteger = BigInteger; + if (true) { + exports = module.exports = BigInteger; + } else { + this.BigInteger = BigInteger; + this.SecureRandom = SecureRandom; + } + +}).call(this); + + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = { sep: '/' } +try { + path = __webpack_require__(0) +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = __webpack_require__(229) + +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, '\\$&') +} + + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +var wrappy = __webpack_require__(161) +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 +} + + +/***/ }), +/* 84 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return InnerSubscriber; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ + + +var InnerSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); + +//# sourceMappingURL=InnerSubscriber.js.map + + +/***/ }), +/* 85 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = fromArray; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToArray__ = __webpack_require__(447); +/** PURE_IMPORTS_START _Observable,_Subscription,_util_subscribeToArray PURE_IMPORTS_END */ + + + +function fromArray(input, scheduler) { + if (!scheduler) { + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToArray__["a" /* subscribeToArray */])(input)); + } + else { + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { + var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* 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 + + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2015 Joyent, Inc. + module.exports = { - "name": "yarn", - "installationMethod": "unknown", - "version": "1.3.2", - "license": "BSD-2-Clause", - "preferGlobal": true, - "description": "đŸ“Ļ🐈 Fast, reliable, and secure dependency management.", - "dependencies": { - "babel-eslint": "^7.2.3", - "babel-runtime": "^6.0.0", - "bytes": "^2.4.0", - "camelcase": "^4.0.0", - "chalk": "^2.1.0", - "cmd-shim": "^2.0.1", - "commander": "^2.9.0", - "death": "^1.0.0", - "debug": "^2.2.0", - "detect-indent": "^5.0.0", - "dnscache": "^1.0.1", - "eslint-plugin-jest": "^20.0.3", - "eslint-plugin-jsx-a11y": "^6.0.2", - "eslint-plugin-relay": "0.0.8", - "glob": "^7.1.1", - "gunzip-maybe": "^1.4.0", - "ini": "^1.3.4", - "inquirer": "^3.0.1", - "invariant": "^2.2.0", - "is-builtin-module": "^1.0.0", - "is-ci": "^1.0.10", - "is-webpack-bundle": "^1.0.0", - "leven": "^2.0.0", - "loud-rejection": "^1.2.0", - "micromatch": "^2.3.11", - "mkdirp": "^0.5.1", - "node-emoji": "^1.6.1", - "normalize-url": "^1.9.1", - "object-path": "^0.11.2", - "proper-lockfile": "^2.0.0", - "puka": "^1.0.0", - "read": "^1.0.7", - "request": "^2.81.0", - "request-capture-har": "^1.2.2", - "rimraf": "^2.5.0", - "semver": "^5.1.0", - "strip-ansi": "^4.0.0", - "strip-bom": "^3.0.0", - "tar-fs": "^1.15.1", - "tar-stream": "^1.5.2", - "uuid": "^3.0.1", - "v8-compile-cache": "^1.1.0", - "validate-npm-package-license": "^3.0.1", - "yn": "^2.0.0" - }, - "devDependencies": { - "babel-core": "^6.24.1", - "babel-loader": "^6.2.5", - "babel-plugin-array-includes": "^2.0.3", - "babel-plugin-transform-inline-imports-commonjs": "^1.0.0", - "babel-plugin-transform-runtime": "^6.4.3", - "babel-preset-es2015-node4": "^2.1.0", - "babel-preset-node5": "^10.2.0", - "babel-preset-stage-0": "^6.0.0", - "babylon": "^6.5.0", - "commitizen": "^2.9.6", - "cz-conventional-changelog": "^2.0.0", - "eslint": "^4.3.0", - "eslint-config-fb-strict": "^20.1.0-delta.3", - "eslint-plugin-babel": "^4.0.0", - "eslint-plugin-flowtype": "^2.35.0", - "eslint-plugin-jasmine": "^2.6.2", - "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-prettier": "^2.1.2", - "eslint-plugin-react": "^7.1.0", - "eslint-plugin-yarn-internal": "file:scripts/eslint-rules", - "execa": "^0.7.0", - "flow-bin": "^0.52.0", - "gulp": "^3.9.0", - "gulp-babel": "^6.0.0", - "gulp-if": "^2.0.1", - "gulp-newer": "^1.0.0", - "gulp-plumber": "^1.0.1", - "gulp-sourcemaps": "^2.2.0", - "gulp-util": "^3.0.7", - "gulp-watch": "^4.3.5", - "jest": "20.0.4", - "minimatch": "^3.0.4", - "mock-stdin": "^0.3.0", - "prettier": "^1.5.2", - "temp": "^0.8.3", - "webpack": "^2.1.0-beta.25", - "yargs": "^6.3.0" - }, - "engines": { - "node": ">=4.0.0" - }, - "repository": "yarnpkg/yarn", - "bin": { - "yarn": "./bin/yarn.js", - "yarnpkg": "./bin/yarn.js" - }, - "scripts": { - "build": "gulp build", - "build-bundle": "node ./scripts/build-webpack.js", - "build-chocolatey": "powershell ./scripts/build-chocolatey.ps1", - "build-deb": "./scripts/build-deb.sh", - "build-dist": "bash ./scripts/build-dist.sh", - "build-win-installer": "scripts\\build-windows-installer.bat", - "check-lockfile": "./scripts/check-lockfile.sh", - "lint": "eslint . && flow check", - "prettier": "eslint src __tests__ --fix", - "release-branch": "./scripts/release-branch.sh", - "test": "yarn lint && yarn test-only", - "test-ci": "yarn build && yarn test-only", - "test-only": "node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose", - "test-coverage": "node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose", - "watch": "gulp watch", - "commit": "git-cz" - }, - "jest": { - "collectCoverageFrom": [ - "src/**/*.js" - ], - "testEnvironment": "node", - "modulePathIgnorePatterns": [ - "__tests__/fixtures/" - ], - "testPathIgnorePatterns": [ - "__tests__/(fixtures|__mocks__)/", - "updates/", - "/_(temp|mock|install|init|helpers).js$" - ] - }, - "config": { - "commitizen": { - "path": "./node_modules/cz-conventional-changelog" + read: read, + write: write +}; + +var assert = __webpack_require__(16); +var asn1 = __webpack_require__(66); +var crypto = __webpack_require__(11); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var utils = __webpack_require__(26); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(33); + +var pkcs1 = __webpack_require__(327); +var pkcs8 = __webpack_require__(157); +var sshpriv = __webpack_require__(192); +var rfc4253 = __webpack_require__(103); + +var errors = __webpack_require__(74); + +/* + * For reading we support both PKCS#1 and PKCS#8. If we find a private key, + * we just take the public component of it and use that. + */ +function read(buf, options, forceType) { + var input = buf; + if (typeof (buf) !== 'string') { + assert.buffer(buf, 'buf'); + buf = buf.toString('ascii'); + } + + var lines = buf.trim().split('\n'); + + var m = lines[0].match(/*JSSTYLED*/ + /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); + assert.ok(m, 'invalid PEM header'); + + var m2 = lines[lines.length - 1].match(/*JSSTYLED*/ + /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); + assert.ok(m2, 'invalid PEM footer'); + + /* Begin and end banners must match key type */ + assert.equal(m[2], m2[2]); + var type = m[2].toLowerCase(); + + var alg; + if (m[1]) { + /* They also must match algorithms, if given */ + assert.equal(m[1], m2[1], 'PEM header and footer mismatch'); + alg = m[1].trim(); + } + + var headers = {}; + while (true) { + lines = lines.slice(1); + m = lines[0].match(/*JSSTYLED*/ + /^([A-Za-z0-9-]+): (.+)$/); + if (!m) + break; + headers[m[1].toLowerCase()] = m[2]; + } + + var cipher, key, iv; + if (headers['proc-type']) { + var parts = headers['proc-type'].split(','); + if (parts[0] === '4' && parts[1] === 'ENCRYPTED') { + if (typeof (options.passphrase) === 'string') { + options.passphrase = Buffer.from( + options.passphrase, 'utf-8'); + } + if (!Buffer.isBuffer(options.passphrase)) { + throw (new errors.KeyEncryptedError( + options.filename, 'PEM')); + } else { + parts = headers['dek-info'].split(','); + assert.ok(parts.length === 2); + cipher = parts[0].toLowerCase(); + iv = Buffer.from(parts[1], 'hex'); + key = utils.opensslKeyDeriv(cipher, iv, + options.passphrase, 1).key; + } } } + + /* Chop off the first and last lines */ + lines = lines.slice(0, -1).join(''); + buf = Buffer.from(lines, 'base64'); + + if (cipher && key && iv) { + var cipherStream = crypto.createDecipheriv(cipher, key, iv); + var chunk, chunks = []; + cipherStream.once('error', function (e) { + if (e.toString().indexOf('bad decrypt') !== -1) { + throw (new Error('Incorrect passphrase ' + + 'supplied, could not decrypt key')); + } + throw (e); + }); + cipherStream.write(buf); + cipherStream.end(); + while ((chunk = cipherStream.read()) !== null) + chunks.push(chunk); + buf = Buffer.concat(chunks); + } + + /* The new OpenSSH internal format abuses PEM headers */ + if (alg && alg.toLowerCase() === 'openssh') + return (sshpriv.readSSHPrivate(type, buf, options)); + if (alg && alg.toLowerCase() === 'ssh2') + return (rfc4253.readType(type, buf, options)); + + var der = new asn1.BerReader(buf); + der.originalInput = input; + + /* + * All of the PEM file types start with a sequence tag, so chop it + * off here + */ + der.readSequence(); + + /* PKCS#1 type keys name an algorithm in the banner explicitly */ + if (alg) { + if (forceType) + assert.strictEqual(forceType, 'pkcs1'); + return (pkcs1.readPkcs1(alg, type, der)); + } else { + if (forceType) + assert.strictEqual(forceType, 'pkcs8'); + return (pkcs8.readPkcs8(alg, type, der)); + } +} + +function write(key, options, type) { + assert.object(key); + + var alg = { + 'ecdsa': 'EC', + 'rsa': 'RSA', + 'dsa': 'DSA', + 'ed25519': 'EdDSA' + }[key.type]; + var header; + + var der = new asn1.BerWriter(); + + if (PrivateKey.isPrivateKey(key)) { + if (type && type === 'pkcs8') { + header = 'PRIVATE KEY'; + pkcs8.writePkcs8(der, key); + } else { + if (type) + assert.strictEqual(type, 'pkcs1'); + header = alg + ' PRIVATE KEY'; + pkcs1.writePkcs1(der, key); + } + + } else if (Key.isKey(key)) { + if (type && type === 'pkcs1') { + header = alg + ' PUBLIC KEY'; + pkcs1.writePkcs1(der, key); + } else { + if (type) + assert.strictEqual(type, 'pkcs8'); + header = 'PUBLIC KEY'; + pkcs8.writePkcs8(der, key); + } + + } else { + throw (new Error('key is not a Key or PrivateKey')); + } + + var tmp = der.buffer.toString('base64'); + var len = tmp.length + (tmp.length / 64) + + 18 + 16 + header.length*2 + 10; + var buf = Buffer.alloc(len); + var o = 0; + o += buf.write('-----BEGIN ' + header + '-----\n', o); + for (var i = 0; i < tmp.length; ) { + var limit = i + 64; + if (limit > tmp.length) + limit = tmp.length; + o += buf.write(tmp.slice(i, limit), o); + buf[o++] = 10; + i = limit; + } + o += buf.write('-----END ' + header + '-----\n', o); + + return (buf.slice(0, o)); +} + + +/***/ }), +/* 87 */ +/***/ (function(module, exports) { + +module.exports = require("http"); + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SCOPE_SEPARATOR = undefined; + +var _extends2; + +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(21)); +} + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _constants; + +function _load_constants() { + return _constants = __webpack_require__(8); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(4)); +} + +var _npmResolver; + +function _load_npmResolver() { + return _npmResolver = _interopRequireDefault(__webpack_require__(217)); +} + +var _envReplace; + +function _load_envReplace() { + return _envReplace = _interopRequireDefault(__webpack_require__(577)); +} + +var _baseRegistry; + +function _load_baseRegistry() { + return _baseRegistry = _interopRequireDefault(__webpack_require__(558)); +} + +var _misc; + +function _load_misc() { + return _misc = __webpack_require__(18); +} + +var _path; + +function _load_path() { + return _path = __webpack_require__(377); +} + +var _normalizeUrl; + +function _load_normalizeUrl() { + return _normalizeUrl = _interopRequireDefault(__webpack_require__(402)); +} + +var _userHomeDir; + +function _load_userHomeDir() { + return _userHomeDir = _interopRequireDefault(__webpack_require__(67)); +} + +var _userHomeDir2; + +function _load_userHomeDir2() { + return _userHomeDir2 = __webpack_require__(67); +} + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _login; + +function _load_login() { + return _login = __webpack_require__(107); +} + +var _path2; + +function _load_path2() { + return _path2 = _interopRequireDefault(__webpack_require__(0)); +} + +var _url; + +function _load_url() { + return _url = _interopRequireDefault(__webpack_require__(24)); +} + +var _ini; + +function _load_ini() { + return _ini = _interopRequireDefault(__webpack_require__(684)); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const DEFAULT_REGISTRY = 'https://registry.npmjs.org/'; +const REGEX_REGISTRY_ENFORCED_HTTPS = /^https?:\/\/([^\/]+\.)?(yarnpkg\.com|npmjs\.(org|com))(\/|$)/; +const REGEX_REGISTRY_HTTP_PROTOCOL = /^https?:/i; +const REGEX_REGISTRY_PREFIX = /^(https?:)?\/\//i; +const REGEX_REGISTRY_SUFFIX = /registry\/?$/; + +const SCOPE_SEPARATOR = exports.SCOPE_SEPARATOR = '%2f'; +// All scoped package names are of the format `@scope%2fpkg` from the use of NpmRegistry.escapeName +// `(?:^|\/)` Match either the start of the string or a `/` but don't capture +// `[^\/?]+?` Match any character that is not '/' or '?' and capture, up until the first occurrence of: +// `(?=%2f|\/)` Match SCOPE_SEPARATOR, the escaped '/', or a raw `/` and don't capture +// The reason for matching a plain `/` is NPM registry being inconsistent about escaping `/` in +// scoped package names: when you're fetching a tarball, it is not escaped, when you want info +// about the package, it is escaped. +const SCOPED_PKG_REGEXP = /(?:^|\/)(@[^\/?]+?)(?=%2f|\/)/; + +// TODO: Use the method from src/cli/commands/global.js for this instead +function getGlobalPrefix() { + if (process.env.PREFIX) { + return process.env.PREFIX; + } else if (process.platform === 'win32') { + // c:\node\node.exe --> prefix=c:\node\ + return (_path2 || _load_path2()).default.dirname(process.execPath); + } else { + // /usr/local/bin/node --> prefix=/usr/local + let prefix = (_path2 || _load_path2()).default.dirname((_path2 || _load_path2()).default.dirname(process.execPath)); + + // destdir only is respected on Unix + if (process.env.DESTDIR) { + prefix = (_path2 || _load_path2()).default.join(process.env.DESTDIR, prefix); + } + + return prefix; + } +} + +const PATH_CONFIG_OPTIONS = new Set(['cache', 'cafile', 'prefix', 'userconfig']); + +function isPathConfigOption(key) { + return PATH_CONFIG_OPTIONS.has(key); +} + +function normalizePath(val) { + if (val === undefined) { + return undefined; + } + + if (typeof val !== 'string') { + val = String(val); + } + + return (0, (_path || _load_path()).resolveWithHome)(val); +} + +function urlParts(requestUrl) { + const normalizedUrl = (0, (_normalizeUrl || _load_normalizeUrl()).default)(requestUrl); + const parsed = (_url || _load_url()).default.parse(normalizedUrl); + const host = parsed.host || ''; + const path = parsed.path || ''; + return { host, path }; +} + +class NpmRegistry extends (_baseRegistry || _load_baseRegistry()).default { + constructor(cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles) { + super(cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles); + this.folder = 'node_modules'; + } + + static escapeName(name) { + // scoped packages contain slashes and the npm registry expects them to be escaped + return name.replace('/', SCOPE_SEPARATOR); + } + + isScopedPackage(packageIdent) { + return SCOPED_PKG_REGEXP.test(packageIdent); + } + + getRequestUrl(registry, pathname) { + let resolved = pathname; + + if (!REGEX_REGISTRY_PREFIX.test(pathname)) { + resolved = (_url || _load_url()).default.resolve((0, (_misc || _load_misc()).addSuffix)(registry, '/'), pathname); + } + + if (REGEX_REGISTRY_ENFORCED_HTTPS.test(resolved)) { + resolved = resolved.replace(/^http:\/\//, 'https://'); + } + + return resolved; + } + + isRequestToRegistry(requestUrl, registryUrl) { + const request = urlParts(requestUrl); + const registry = urlParts(registryUrl); + const customHostSuffix = this.getRegistryOrGlobalOption(registryUrl, 'custom-host-suffix'); + + const requestToRegistryHost = request.host === registry.host; + const requestToYarn = (_constants || _load_constants()).YARN_REGISTRY.includes(request.host) && DEFAULT_REGISTRY.includes(registry.host); + const requestToRegistryPath = request.path.startsWith(registry.path); + // For some registries, the package path does not prefix with the registry path + const customHostSuffixInUse = typeof customHostSuffix === 'string' && request.host.endsWith(customHostSuffix); + + return (requestToRegistryHost || requestToYarn) && (requestToRegistryPath || customHostSuffixInUse); + } + + request(pathname, opts = {}, packageName) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // packageName needs to be escaped when if it is passed + const packageIdent = packageName && NpmRegistry.escapeName(packageName) || pathname; + const registry = opts.registry || _this.getRegistry(packageIdent); + const requestUrl = _this.getRequestUrl(registry, pathname); + + const alwaysAuth = _this.getRegistryOrGlobalOption(registry, 'always-auth'); + + const headers = (0, (_extends2 || _load_extends()).default)({ + Accept: + // This is to use less bandwidth unless we really need to get the full response. + // See https://github.com/npm/npm-registry-client#requests + opts.unfiltered ? 'application/json' : 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' + }, opts.headers); + + const isToRegistry = _this.isRequestToRegistry(requestUrl, registry) || _this.requestNeedsAuth(requestUrl); + + // this.token must be checked to account for publish requests on non-scoped packages + if (_this.token || isToRegistry && (alwaysAuth || _this.isScopedPackage(packageIdent))) { + const authorization = _this.getAuth(packageIdent); + if (authorization) { + headers.authorization = authorization; + } + } + + if (_this.otp) { + headers['npm-otp'] = _this.otp; + } + + try { + return yield _this.requestManager.request({ + url: requestUrl, + method: opts.method, + body: opts.body, + auth: opts.auth, + headers, + json: !opts.buffer, + buffer: opts.buffer, + process: opts.process, + gzip: true + }); + } catch (error) { + if (error instanceof (_errors || _load_errors()).OneTimePasswordError) { + if (_this.otp) { + throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('incorrectOneTimePassword')); + } + + _this.reporter.info(_this.reporter.lang('twoFactorAuthenticationEnabled')); + _this.otp = yield (0, (_login || _load_login()).getOneTimePassword)(_this.reporter); + + _this.requestManager.clearCache(); + + return _this.request(pathname, opts, packageName); + } else { + throw error; + } + } + })(); + } + + requestNeedsAuth(requestUrl) { + const config = this.config; + const requestParts = urlParts(requestUrl); + return !!Object.keys(config).find(option => { + const parts = option.split(':'); + if (parts.length === 2 && parts[1] === '_authToken' || parts[1] === '_password') { + const registryParts = urlParts(parts[0]); + if (requestParts.host === registryParts.host && requestParts.path.startsWith(registryParts.path)) { + return true; + } + } + return false; + }); + } + + checkOutdated(config, name, range) { + var _this2 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const escapedName = NpmRegistry.escapeName(name); + const req = yield _this2.request(escapedName, { unfiltered: true }); + if (!req) { + throw new Error(`couldn't find ${name}`); + } + + // By default use top level 'repository' and 'homepage' values + let repository = req.repository, + homepage = req.homepage; + + const wantedPkg = yield (_npmResolver || _load_npmResolver()).default.findVersionInRegistryResponse(config, escapedName, range, req); + + // But some local repositories like Verdaccio do not return 'repository' nor 'homepage' + // in top level data structure, so we fallback to wanted package manifest + if (!repository && !homepage) { + repository = wantedPkg.repository; + homepage = wantedPkg.homepage; + } + + let latest = req['dist-tags'].latest; + // In certain cases, registries do not return a 'latest' tag. + if (!latest) { + latest = wantedPkg.version; + } + + const url = homepage || repository && repository.url || ''; + + return { + latest, + wanted: wantedPkg.version, + url + }; + })(); + } + + getPossibleConfigLocations(filename, reporter) { + var _this3 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + let possibles = []; + + for (var _iterator = _this3.extraneousRcFiles.slice().reverse(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const rcFile = _ref; + + possibles.push([false, (_path2 || _load_path2()).default.resolve(process.cwd(), rcFile)]); + } + + if (_this3.enableDefaultRc) { + // npmrc --> ./.npmrc, ~/.npmrc, ${prefix}/etc/npmrc + const localfile = '.' + filename; + possibles = possibles.concat([[false, (_path2 || _load_path2()).default.join(_this3.cwd, localfile)], [true, _this3.config.userconfig || (_path2 || _load_path2()).default.join((_userHomeDir || _load_userHomeDir()).default, localfile)], [false, (_path2 || _load_path2()).default.join(getGlobalPrefix(), 'etc', filename)]]); + + // When home directory for global install is different from where $HOME/npmrc is stored, + // E.g. /usr/local/share vs /root on linux machines, check the additional location + if ((_userHomeDir2 || _load_userHomeDir2()).home !== (_userHomeDir || _load_userHomeDir()).default) { + possibles.push([true, (_path2 || _load_path2()).default.join((_userHomeDir2 || _load_userHomeDir2()).home, localfile)]); + } + + // npmrc --> ../.npmrc, ../../.npmrc, etc. + const foldersFromRootToCwd = (0, (_path || _load_path()).getPosixPath)(_this3.cwd).split('/'); + while (foldersFromRootToCwd.length > 1) { + possibles.push([false, (_path2 || _load_path2()).default.join(foldersFromRootToCwd.join((_path2 || _load_path2()).default.sep), localfile)]); + foldersFromRootToCwd.pop(); + } + } + + const actuals = []; + for (var _iterator2 = possibles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + const _ref2 = _ref3; + const isHome = _ref2[0]; + const loc = _ref2[1]; + + reporter.verbose(reporter.lang('configPossibleFile', loc)); + if (yield (_fs || _load_fs()).exists(loc)) { + reporter.verbose(reporter.lang('configFileFound', loc)); + actuals.push([isHome, loc, yield (_fs || _load_fs()).readFile(loc)]); + } + } + + return actuals; + })(); + } + + static getConfigEnv(env = process.env) { + // To match NPM's behavior, HOME is always the user's home directory. + const overrideEnv = { + HOME: (_userHomeDir2 || _load_userHomeDir2()).home + }; + return Object.assign({}, env, overrideEnv); + } + + static normalizeConfig(config) { + const env = NpmRegistry.getConfigEnv(); + config = (_baseRegistry || _load_baseRegistry()).default.normalizeConfig(config); + + for (const key in config) { + config[key] = (0, (_envReplace || _load_envReplace()).default)(config[key], env); + if (isPathConfigOption(key)) { + config[key] = normalizePath(config[key]); + } + } + + return config; + } + + loadConfig() { + var _this4 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // docs: https://docs.npmjs.com/misc/config + _this4.mergeEnv('npm_config_'); + + for (var _iterator3 = yield _this4.getPossibleConfigLocations('npmrc', _this4.reporter), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref5; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref5 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref5 = _i3.value; + } + + const _ref4 = _ref5; + const loc = _ref4[1]; + const file = _ref4[2]; + + const config = NpmRegistry.normalizeConfig((_ini || _load_ini()).default.parse(file)); + + // normalize offline mirror path relative to the current npmrc + const offlineLoc = config['yarn-offline-mirror']; + // don't normalize if we already have a mirror path + if (!_this4.config['yarn-offline-mirror'] && offlineLoc) { + const mirrorLoc = config['yarn-offline-mirror'] = (_path2 || _load_path2()).default.resolve((_path2 || _load_path2()).default.dirname(loc), offlineLoc); + yield (_fs || _load_fs()).mkdirp(mirrorLoc); + } + + _this4.config = Object.assign({}, config, _this4.config); + } + })(); + } + + getScope(packageIdent) { + const match = packageIdent.match(SCOPED_PKG_REGEXP); + return match && match[1] || ''; + } + + getRegistry(packageIdent) { + // Try extracting registry from the url, then scoped registry, and default registry + if (packageIdent.match(REGEX_REGISTRY_PREFIX)) { + const availableRegistries = this.getAvailableRegistries(); + const registry = availableRegistries.find(registry => packageIdent.startsWith(registry)); + if (registry) { + return String(registry); + } + } + + var _arr = [this.getScope(packageIdent), '']; + for (var _i4 = 0; _i4 < _arr.length; _i4++) { + const scope = _arr[_i4]; + const registry = this.getScopedOption(scope, 'registry') || this.registries.yarn.getScopedOption(scope, 'registry'); + if (registry) { + return String(registry); + } + } + + return DEFAULT_REGISTRY; + } + + getAuthByRegistry(registry) { + // Check for bearer token. + const authToken = this.getRegistryOrGlobalOption(registry, '_authToken'); + if (authToken) { + return `Bearer ${String(authToken)}`; + } + + // Check for basic auth token. + const auth = this.getRegistryOrGlobalOption(registry, '_auth'); + if (auth) { + return `Basic ${String(auth)}`; + } + + // Check for basic username/password auth. + const username = this.getRegistryOrGlobalOption(registry, 'username'); + const password = this.getRegistryOrGlobalOption(registry, '_password'); + if (username && password) { + const pw = Buffer.from(String(password), 'base64').toString(); + return 'Basic ' + Buffer.from(String(username) + ':' + pw).toString('base64'); + } + + return ''; + } + + getAuth(packageIdent) { + if (this.token) { + return this.token; + } + + const baseRegistry = this.getRegistry(packageIdent); + const registries = [baseRegistry]; + + // If sending a request to the Yarn registry, we must also send it the auth token for the npm registry + if (baseRegistry === (_constants || _load_constants()).YARN_REGISTRY) { + registries.push(DEFAULT_REGISTRY); + } + + for (var _iterator4 = registries, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref6; + + if (_isArray4) { + if (_i5 >= _iterator4.length) break; + _ref6 = _iterator4[_i5++]; + } else { + _i5 = _iterator4.next(); + if (_i5.done) break; + _ref6 = _i5.value; + } + + const registry = _ref6; + + const auth = this.getAuthByRegistry(registry); + + if (auth) { + return auth; + } + } + + return ''; + } + + getScopedOption(scope, option) { + return this.getOption(scope + (scope ? ':' : '') + option); + } + + getRegistryOption(registry, option) { + const pre = REGEX_REGISTRY_HTTP_PROTOCOL; + const suf = REGEX_REGISTRY_SUFFIX; + + // When registry is used config scope, the trailing '/' is required + const reg = (0, (_misc || _load_misc()).addSuffix)(registry, '/'); + + // 1st attempt, try to get option for the given registry URL + // 2nd attempt, remove the 'https?:' prefix of the registry URL + // 3nd attempt, remove the 'registry/?' suffix of the registry URL + return this.getScopedOption(reg, option) || pre.test(reg) && this.getRegistryOption(reg.replace(pre, ''), option) || suf.test(reg) && this.getRegistryOption(reg.replace(suf, ''), option); + } + + getRegistryOrGlobalOption(registry, option) { + return this.getRegistryOption(registry, option) || this.getOption(option); + } +} +exports.default = NpmRegistry; +NpmRegistry.filename = 'package.json'; + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _baseResolver; + +function _load_baseResolver() { + return _baseResolver = _interopRequireDefault(__webpack_require__(123)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class ExoticResolver extends (_baseResolver || _load_baseResolver()).default { + + static isVersion(pattern) { + const proto = this.protocol; + if (proto) { + return pattern.startsWith(`${proto}:`); + } else { + throw new Error('No protocol specified'); + } + } +} +exports.default = ExoticResolver; + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _normalizePattern2; + +function _load_normalizePattern() { + return _normalizePattern2 = __webpack_require__(37); +} + +const semver = __webpack_require__(22); + +class WorkspaceLayout { + constructor(workspaces, config) { + this.workspaces = workspaces; + this.config = config; + } + + getWorkspaceManifest(key) { + return this.workspaces[key]; + } + + getManifestByPattern(pattern) { + var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern); + + const name = _normalizePattern.name, + range = _normalizePattern.range; + + const workspace = this.getWorkspaceManifest(name); + if (!workspace || !semver.satisfies(workspace.manifest.version, range, this.config.looseSemver)) { + return null; + } + return workspace; + } +} +exports.default = WorkspaceLayout; + +/***/ }), +/* 91 */ +/***/ (function(module, exports) { + +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(52); +var document = __webpack_require__(17).document; +// typeof document.createElement is 'object' in old IE +var is = isObject(document) && isObject(document.createElement); +module.exports = function (it) { + return is ? document.createElement(it) : {}; +}; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports) { + +module.exports = true; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 25.4.1.5 NewPromiseCapability(C) +var aFunction = __webpack_require__(68); + +function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +} + +module.exports.f = function (C) { + return new PromiseCapability(C); +}; + + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + +var def = __webpack_require__(72).f; +var has = __webpack_require__(71); +var TAG = __webpack_require__(20)('toStringTag'); + +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; + + +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(133)('keys'); +var uid = __webpack_require__(137); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; + + +/***/ }), +/* 97 */ +/***/ (function(module, exports) { + +// 7.1.4 ToInteger +var ceil = Math.ceil; +var floor = Math.floor; +module.exports = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(170); +var defined = __webpack_require__(91); +module.exports = function (it) { + return IObject(defined(it)); +}; + + +/***/ }), +/* 99 */ +/***/ (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__(5) +var rp = __webpack_require__(140) +var minimatch = __webpack_require__(82) +var Minimatch = minimatch.Minimatch +var inherits = __webpack_require__(61) +var EE = __webpack_require__(77).EventEmitter +var path = __webpack_require__(0) +var assert = __webpack_require__(28) +var isAbsolute = __webpack_require__(101) +var globSync = __webpack_require__(272) +var common = __webpack_require__(141) +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = __webpack_require__(274) +var util = __webpack_require__(3) +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = __webpack_require__(83) + +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) +} + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 + + + + + +var Schema = __webpack_require__(44); + + +module.exports = new Schema({ + explicit: [ + __webpack_require__(298), + __webpack_require__(296), + __webpack_require__(291) + ] +}); + + +/***/ }), +/* 101 */ +/***/ (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; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +var Stream = __webpack_require__(23); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = __webpack_require__(406); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = __webpack_require__(408); + exports.Duplex = __webpack_require__(115); + exports.Transform = __webpack_require__(407); + exports.PassThrough = __webpack_require__(792); +} + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2015 Joyent, Inc. + +module.exports = { + read: read.bind(undefined, false, undefined), + readType: read.bind(undefined, false), + write: write, + /* semi-private api, used by sshpk-agent */ + readPartial: read.bind(undefined, true), + + /* shared with ssh format */ + readInternal: read, + keyTypeToAlg: keyTypeToAlg, + algToKeyType: algToKeyType +}; + +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var utils = __webpack_require__(26); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(33); +var SSHBuffer = __webpack_require__(159); + +function algToKeyType(alg) { + assert.string(alg); + if (alg === 'ssh-dss') + return ('dsa'); + else if (alg === 'ssh-rsa') + return ('rsa'); + else if (alg === 'ssh-ed25519') + return ('ed25519'); + else if (alg === 'ssh-curve25519') + return ('curve25519'); + else if (alg.match(/^ecdsa-sha2-/)) + return ('ecdsa'); + else + throw (new Error('Unknown algorithm ' + alg)); +} + +function keyTypeToAlg(key) { + assert.object(key); + if (key.type === 'dsa') + return ('ssh-dss'); + else if (key.type === 'rsa') + return ('ssh-rsa'); + else if (key.type === 'ed25519') + return ('ssh-ed25519'); + else if (key.type === 'curve25519') + return ('ssh-curve25519'); + else if (key.type === 'ecdsa') + return ('ecdsa-sha2-' + key.part.curve.data.toString()); + else + throw (new Error('Unknown key type ' + key.type)); +} + +function read(partial, type, buf, options) { + if (typeof (buf) === 'string') + buf = Buffer.from(buf); + assert.buffer(buf, 'buf'); + + var key = {}; + + var parts = key.parts = []; + var sshbuf = new SSHBuffer({buffer: buf}); + + var alg = sshbuf.readString(); + assert.ok(!sshbuf.atEnd(), 'key must have at least one part'); + + key.type = algToKeyType(alg); + + var partCount = algs.info[key.type].parts.length; + if (type && type === 'private') + partCount = algs.privInfo[key.type].parts.length; + + while (!sshbuf.atEnd() && parts.length < partCount) + parts.push(sshbuf.readPart()); + while (!partial && !sshbuf.atEnd()) + parts.push(sshbuf.readPart()); + + assert.ok(parts.length >= 1, + 'key must have at least one part'); + assert.ok(partial || sshbuf.atEnd(), + 'leftover bytes at end of key'); + + var Constructor = Key; + var algInfo = algs.info[key.type]; + if (type === 'private' || algInfo.parts.length !== parts.length) { + algInfo = algs.privInfo[key.type]; + Constructor = PrivateKey; + } + assert.strictEqual(algInfo.parts.length, parts.length); + + if (key.type === 'ecdsa') { + var res = /^ecdsa-sha2-(.+)$/.exec(alg); + assert.ok(res !== null); + assert.strictEqual(res[1], parts[0].data.toString()); + } + + var normalized = true; + for (var i = 0; i < algInfo.parts.length; ++i) { + var p = parts[i]; + p.name = algInfo.parts[i]; + /* + * OpenSSH stores ed25519 "private" keys as seed + public key + * concat'd together (k followed by A). We want to keep them + * separate for other formats that don't do this. + */ + if (key.type === 'ed25519' && p.name === 'k') + p.data = p.data.slice(0, 32); + + if (p.name !== 'curve' && algInfo.normalize !== false) { + var nd; + if (key.type === 'ed25519') { + nd = utils.zeroPadToLength(p.data, 32); + } else { + nd = utils.mpNormalize(p.data); + } + if (nd.toString('binary') !== + p.data.toString('binary')) { + p.data = nd; + normalized = false; + } + } + } + + if (normalized) + key._rfc4253Cache = sshbuf.toBuffer(); + + if (partial && typeof (partial) === 'object') { + partial.remainder = sshbuf.remainder(); + partial.consumed = sshbuf._offset; + } + + return (new Constructor(key)); +} + +function write(key, options) { + assert.object(key); + + var alg = keyTypeToAlg(key); + var i; + + var algInfo = algs.info[key.type]; + if (PrivateKey.isPrivateKey(key)) + algInfo = algs.privInfo[key.type]; + var parts = algInfo.parts; + + var buf = new SSHBuffer({}); + + buf.writeString(alg); + + for (i = 0; i < parts.length; ++i) { + var data = key.part[parts[i]].data; + if (algInfo.normalize !== false) { + if (key.type === 'ed25519') + data = utils.zeroPadToLength(data, 32); + else + data = utils.mpNormalize(data); + } + if (key.type === 'ed25519' && parts[i] === 'k') + data = Buffer.concat([data, key.part.A.data]); + buf.writeBuffer(data); + } + + return (buf.toBuffer()); +} + + +/***/ }), +/* 104 */ +/***/ (function(module, exports) { + +module.exports = require("tty"); + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (str, fileLoc = 'lockfile') { + str = (0, (_stripBom || _load_stripBom()).default)(str); + return hasMergeConflicts(str) ? parseWithConflict(str, fileLoc) : { type: 'success', object: parse(str, fileLoc) }; +}; + +var _util; + +function _load_util() { + return _util = _interopRequireDefault(__webpack_require__(3)); +} + +var _invariant; + +function _load_invariant() { + return _invariant = _interopRequireDefault(__webpack_require__(9)); +} + +var _stripBom; + +function _load_stripBom() { + return _stripBom = _interopRequireDefault(__webpack_require__(160)); +} + +var _constants; + +function _load_constants() { + return _constants = __webpack_require__(8); +} + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _map; + +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(29)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* eslint quotes: 0 */ + +var _require = __webpack_require__(279); + +const safeLoad = _require.safeLoad, + FAILSAFE_SCHEMA = _require.FAILSAFE_SCHEMA; + + +const VERSION_REGEX = /^yarn lockfile v(\d+)$/; + +const TOKEN_TYPES = { + boolean: 'BOOLEAN', + string: 'STRING', + identifier: 'IDENTIFIER', + eof: 'EOF', + colon: 'COLON', + newline: 'NEWLINE', + comment: 'COMMENT', + indent: 'INDENT', + invalid: 'INVALID', + number: 'NUMBER', + comma: 'COMMA' +}; + +const VALID_PROP_VALUE_TOKENS = [TOKEN_TYPES.boolean, TOKEN_TYPES.string, TOKEN_TYPES.number]; + +function isValidPropValueToken(token) { + return VALID_PROP_VALUE_TOKENS.indexOf(token.type) >= 0; +} + +function* tokenise(input) { + let lastNewline = false; + let line = 1; + let col = 0; + + function buildToken(type, value) { + return { line, col, type, value }; + } + + while (input.length) { + let chop = 0; + + if (input[0] === '\n' || input[0] === '\r') { + chop++; + // If this is a \r\n line, ignore both chars but only add one new line + if (input[1] === '\n') { + chop++; + } + line++; + col = 0; + yield buildToken(TOKEN_TYPES.newline); + } else if (input[0] === '#') { + chop++; + + let nextNewline = input.indexOf('\n', chop); + if (nextNewline === -1) { + nextNewline = input.length; + } + const val = input.substring(chop, nextNewline); + chop = nextNewline; + yield buildToken(TOKEN_TYPES.comment, val); + } else if (input[0] === ' ') { + if (lastNewline) { + let indentSize = 1; + for (let i = 1; input[i] === ' '; i++) { + indentSize++; + } + + if (indentSize % 2) { + throw new TypeError('Invalid number of spaces'); + } else { + chop = indentSize; + yield buildToken(TOKEN_TYPES.indent, indentSize / 2); + } + } else { + chop++; + } + } else if (input[0] === '"') { + let i = 1; + for (; i < input.length; i++) { + if (input[i] === '"') { + const isEscaped = input[i - 1] === '\\' && input[i - 2] !== '\\'; + if (!isEscaped) { + i++; + break; + } + } + } + const val = input.substring(0, i); + + chop = i; + + try { + yield buildToken(TOKEN_TYPES.string, JSON.parse(val)); + } catch (err) { + if (err instanceof SyntaxError) { + yield buildToken(TOKEN_TYPES.invalid); + } else { + throw err; + } + } + } else if (/^[0-9]/.test(input)) { + const val = /^[0-9]+/.exec(input)[0]; + chop = val.length; + + yield buildToken(TOKEN_TYPES.number, +val); + } else if (/^true/.test(input)) { + yield buildToken(TOKEN_TYPES.boolean, true); + chop = 4; + } else if (/^false/.test(input)) { + yield buildToken(TOKEN_TYPES.boolean, false); + chop = 5; + } else if (input[0] === ':') { + yield buildToken(TOKEN_TYPES.colon); + chop++; + } else if (input[0] === ',') { + yield buildToken(TOKEN_TYPES.comma); + chop++; + } else if (/^[a-zA-Z\/.-]/g.test(input)) { + let i = 0; + for (; i < input.length; i++) { + const char = input[i]; + if (char === ':' || char === ' ' || char === '\n' || char === '\r' || char === ',') { + break; + } + } + const name = input.substring(0, i); + chop = i; + + yield buildToken(TOKEN_TYPES.string, name); + } else { + yield buildToken(TOKEN_TYPES.invalid); + } + + if (!chop) { + // will trigger infinite recursion + yield buildToken(TOKEN_TYPES.invalid); + } + + col += chop; + lastNewline = input[0] === '\n' || input[0] === '\r' && input[1] === '\n'; + input = input.slice(chop); + } + + yield buildToken(TOKEN_TYPES.eof); +} + +class Parser { + constructor(input, fileLoc = 'lockfile') { + this.comments = []; + this.tokens = tokenise(input); + this.fileLoc = fileLoc; + } + + onComment(token) { + const value = token.value; + (0, (_invariant || _load_invariant()).default)(typeof value === 'string', 'expected token value to be a string'); + + const comment = value.trim(); + + const versionMatch = comment.match(VERSION_REGEX); + if (versionMatch) { + const version = +versionMatch[1]; + if (version > (_constants || _load_constants()).LOCKFILE_VERSION) { + throw new (_errors || _load_errors()).MessageError(`Can't install from a lockfile of version ${version} as you're on an old yarn version that only supports ` + `versions up to ${(_constants || _load_constants()).LOCKFILE_VERSION}. Run \`$ yarn self-update\` to upgrade to the latest version.`); + } + } + + this.comments.push(comment); + } + + next() { + const item = this.tokens.next(); + (0, (_invariant || _load_invariant()).default)(item, 'expected a token'); + + const done = item.done, + value = item.value; + + if (done || !value) { + throw new Error('No more tokens'); + } else if (value.type === TOKEN_TYPES.comment) { + this.onComment(value); + return this.next(); + } else { + return this.token = value; + } + } + + unexpected(msg = 'Unexpected token') { + throw new SyntaxError(`${msg} ${this.token.line}:${this.token.col} in ${this.fileLoc}`); + } + + expect(tokType) { + if (this.token.type === tokType) { + this.next(); + } else { + this.unexpected(); + } + } + + eat(tokType) { + if (this.token.type === tokType) { + this.next(); + return true; + } else { + return false; + } + } + + parse(indent = 0) { + const obj = (0, (_map || _load_map()).default)(); + + while (true) { + const propToken = this.token; + + if (propToken.type === TOKEN_TYPES.newline) { + const nextToken = this.next(); + if (!indent) { + // if we have 0 indentation then the next token doesn't matter + continue; + } + + if (nextToken.type !== TOKEN_TYPES.indent) { + // if we have no indentation after a newline then we've gone down a level + break; + } + + if (nextToken.value === indent) { + // all is good, the indent is on our level + this.next(); + } else { + // the indentation is less than our level + break; + } + } else if (propToken.type === TOKEN_TYPES.indent) { + if (propToken.value === indent) { + this.next(); + } else { + break; + } + } else if (propToken.type === TOKEN_TYPES.eof) { + break; + } else if (propToken.type === TOKEN_TYPES.string) { + // property key + const key = propToken.value; + (0, (_invariant || _load_invariant()).default)(key, 'Expected a key'); + + const keys = [key]; + this.next(); + + // support multiple keys + while (this.token.type === TOKEN_TYPES.comma) { + this.next(); // skip comma + + const keyToken = this.token; + if (keyToken.type !== TOKEN_TYPES.string) { + this.unexpected('Expected string'); + } + + const key = keyToken.value; + (0, (_invariant || _load_invariant()).default)(key, 'Expected a key'); + keys.push(key); + this.next(); + } + + const wasColon = this.token.type === TOKEN_TYPES.colon; + if (wasColon) { + this.next(); + } + + if (isValidPropValueToken(this.token)) { + // plain value + for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const key = _ref; + + obj[key] = this.token.value; + } + + this.next(); + } else if (wasColon) { + // parse object + const val = this.parse(indent + 1); + + for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + const key = _ref2; + + obj[key] = val; + } + + if (indent && this.token.type !== TOKEN_TYPES.indent) { + break; + } + } else { + this.unexpected('Invalid value type'); + } + } else { + this.unexpected(`Unknown token: ${(_util || _load_util()).default.inspect(propToken)}`); + } + } + + return obj; + } +} + +const MERGE_CONFLICT_ANCESTOR = '|||||||'; +const MERGE_CONFLICT_END = '>>>>>>>'; +const MERGE_CONFLICT_SEP = '======='; +const MERGE_CONFLICT_START = '<<<<<<<'; + +/** + * Extract the two versions of the lockfile from a merge conflict. + */ +function extractConflictVariants(str) { + const variants = [[], []]; + const lines = str.split(/\r?\n/g); + let skip = false; + + while (lines.length) { + const line = lines.shift(); + if (line.startsWith(MERGE_CONFLICT_START)) { + // get the first variant + while (lines.length) { + const conflictLine = lines.shift(); + if (conflictLine === MERGE_CONFLICT_SEP) { + skip = false; + break; + } else if (skip || conflictLine.startsWith(MERGE_CONFLICT_ANCESTOR)) { + skip = true; + continue; + } else { + variants[0].push(conflictLine); + } + } + + // get the second variant + while (lines.length) { + const conflictLine = lines.shift(); + if (conflictLine.startsWith(MERGE_CONFLICT_END)) { + break; + } else { + variants[1].push(conflictLine); + } + } + } else { + variants[0].push(line); + variants[1].push(line); + } + } + + return [variants[0].join('\n'), variants[1].join('\n')]; +} + +/** + * Check if a lockfile has merge conflicts. + */ +function hasMergeConflicts(str) { + return str.includes(MERGE_CONFLICT_START) && str.includes(MERGE_CONFLICT_SEP) && str.includes(MERGE_CONFLICT_END); +} + +/** + * Parse the lockfile. + */ +function parse(str, fileLoc) { + const parser = new Parser(str, fileLoc); + parser.next(); + try { + return parser.parse(); + } catch (error1) { + try { + return safeLoad(str, { + schema: FAILSAFE_SCHEMA + }); + } catch (error2) { + throw error1; + } + } +} + +/** + * Parse and merge the two variants in a conflicted lockfile. + */ +function parseWithConflict(str, fileLoc) { + const variants = extractConflictVariants(str); + try { + return { type: 'merge', object: Object.assign({}, parse(variants[0], fileLoc), parse(variants[1], fileLoc)) }; + } catch (err) { + if (err instanceof SyntaxError) { + return { type: 'conflict', object: {} }; + } else { + throw err; + } + } +} + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + + +module.exports = { + copy: copy, + checkDataType: checkDataType, + checkDataTypes: checkDataTypes, + coerceToTypes: coerceToTypes, + toHash: toHash, + getProperty: getProperty, + escapeQuotes: escapeQuotes, + equal: __webpack_require__(204), + ucs2length: __webpack_require__(480), + varOccurences: varOccurences, + varReplace: varReplace, + cleanUpCode: cleanUpCode, + finalCleanUpCode: finalCleanUpCode, + schemaHasRules: schemaHasRules, + schemaHasRulesExcept: schemaHasRulesExcept, + toQuotedString: toQuotedString, + getPathExpr: getPathExpr, + getPath: getPath, + getData: getData, + unescapeFragment: unescapeFragment, + unescapeJsonPointer: unescapeJsonPointer, + escapeFragment: escapeFragment, + escapeJsonPointer: escapeJsonPointer +}; + + +function copy(o, to) { + to = to || {}; + for (var key in o) to[key] = o[key]; + return to; +} + + +function checkDataType(dataType, data, negate) { + var EQUAL = negate ? ' !== ' : ' === ' + , AND = negate ? ' || ' : ' && ' + , OK = negate ? '!' : '' + , NOT = negate ? '' : '!'; + switch (dataType) { + case 'null': return data + EQUAL + 'null'; + case 'array': return OK + 'Array.isArray(' + data + ')'; + case 'object': return '(' + OK + data + AND + + 'typeof ' + data + EQUAL + '"object"' + AND + + NOT + 'Array.isArray(' + data + '))'; + case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + + NOT + '(' + data + ' % 1)' + + AND + data + EQUAL + data + ')'; + default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; + } +} + + +function checkDataTypes(dataTypes, data) { + switch (dataTypes.length) { + case 1: return checkDataType(dataTypes[0], data, true); + default: + var code = ''; + var types = toHash(dataTypes); + if (types.array && types.object) { + code = types.null ? '(': '(!' + data + ' || '; + code += 'typeof ' + data + ' !== "object")'; + delete types.null; + delete types.array; + delete types.object; + } + if (types.number) delete types.integer; + for (var t in types) + code += (code ? ' && ' : '' ) + checkDataType(t, data, true); + + return code; + } +} + + +var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); +function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types = []; + for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); + return paths[lvl - up]; + } + + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); + data = 'data' + ((lvl - up) || ''); + if (!jsonPointer) return data; + } + + var expr = data; + var segments = jsonPointer.split('/'); + for (var i=0; i { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) { + var _config$registries$ya = config.registries.yarn.config; + let username = _config$registries$ya.username, + email = _config$registries$ya.email; + + + if (username) { + reporter.info(`${reporter.lang('npmUsername')}: ${username}`); + } else { + username = yield reporter.question(reporter.lang('npmUsername')); + if (!username) { + return null; + } + } + + if (email) { + reporter.info(`${reporter.lang('npmEmail')}: ${email}`); + } else { + email = yield reporter.question(reporter.lang('npmEmail')); + if (!email) { + return null; + } + } + + yield config.registries.yarn.saveHomeConfig({ username, email }); + + return { username, email }; + }); + + return function getCredentials(_x, _x2) { + return _ref.apply(this, arguments); + }; +})(); + +let getToken = exports.getToken = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, name = '', flags = {}, registry = '') { + const auth = registry ? config.registries.npm.getAuthByRegistry(registry) : config.registries.npm.getAuth(name); + + if (config.otp) { + config.registries.npm.setOtp(config.otp); + } + + if (auth) { + config.registries.npm.setToken(auth); + return function revoke() { + reporter.info(reporter.lang('notRevokingConfigToken')); + return Promise.resolve(); + }; + } + + const env = process.env.YARN_AUTH_TOKEN || process.env.NPM_AUTH_TOKEN; + if (env) { + config.registries.npm.setToken(`Bearer ${env}`); + return function revoke() { + reporter.info(reporter.lang('notRevokingEnvToken')); + return Promise.resolve(); + }; + } + + // make sure we're not running in non-interactive mode before asking for login + if (flags.nonInteractive || config.nonInteractive) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('nonInteractiveNoToken')); + } + + // + const creds = yield getCredentials(config, reporter); + if (!creds) { + reporter.warn(reporter.lang('loginAsPublic')); + return function revoke() { + reporter.info(reporter.lang('noTokenToRevoke')); + return Promise.resolve(); + }; + } + + const username = creds.username, + email = creds.email; + + const password = yield reporter.question(reporter.lang('npmPassword'), { + password: true, + required: true + }); + + // + const userobj = { + _id: `org.couchdb.user:${username}`, + name: username, + password, + email, + type: 'user', + roles: [], + date: new Date().toISOString() + }; + + // + const res = yield config.registries.npm.request(`-/user/org.couchdb.user:${encodeURIComponent(username)}`, { + method: 'PUT', + registry, + body: userobj, + auth: { username, password, email } + }); + + if (res && res.ok) { + reporter.success(reporter.lang('loggedIn')); + + const token = res.token; + config.registries.npm.setToken(`Bearer ${token}`); + + return (() => { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + reporter.success(reporter.lang('revokedToken')); + yield config.registries.npm.request(`-/user/token/${token}`, { + method: 'DELETE', + registry + }); + }); + + function revoke() { + return _ref3.apply(this, arguments); + } + + return revoke; + })(); + } else { + throw new (_errors || _load_errors()).MessageError(reporter.lang('incorrectCredentials')); + } + }); + + return function getToken(_x3, _x4) { + return _ref2.apply(this, arguments); + }; +})(); + +let run = exports.run = (() => { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + yield getCredentials(config, reporter); + }); + + return function run(_x5, _x6, _x7, _x8) { + return _ref4.apply(this, arguments); + }; +})(); + +exports.getOneTimePassword = getOneTimePassword; +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function getOneTimePassword(reporter) { + return reporter.question(reporter.lang('npmOneTimePassword')); +} + +function hasWrapper(commander, args) { + return true; +} + +function setFlags(commander) { + commander.description('Stores registry username and email.'); +} + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +exports.stringifyLangArgs = stringifyLangArgs; + +var _format; + +function _load_format() { + return _format = __webpack_require__(566); +} + +var _index; + +function _load_index() { + return _index = _interopRequireWildcard(__webpack_require__(568)); +} + +var _isCi; + +function _load_isCi() { + return _isCi = _interopRequireDefault(__webpack_require__(397)); +} + +var _os; + +function _load_os() { + return _os = _interopRequireDefault(__webpack_require__(46)); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* eslint no-unused-vars: 0 */ + +const util = __webpack_require__(3); +const EventEmitter = __webpack_require__(77).EventEmitter; + +function stringifyLangArgs(args) { + return args.map(function (val) { + if (val != null && val.inspect) { + return val.inspect(); + } else { + try { + const str = JSON.stringify(val) || val + ''; + // should match all literal line breaks and + // "u001b" that follow an odd number of backslashes and convert them to ESC + // we do this because the JSON.stringify process has escaped these characters + return str.replace(/((?:^|[^\\])(?:\\{2})*)\\u001[bB]/g, '$1\u001b').replace(/[\\]r[\\]n|([\\])?[\\]n/g, (match, precededBacklash) => { + // precededBacklash not null when "\n" is preceded by a backlash ("\\n") + // match will be "\\n" and we don't replace it with os.EOL + return precededBacklash ? match : (_os || _load_os()).default.EOL; + }); + } catch (e) { + return util.inspect(val); + } + } + }); +} + +class BaseReporter { + constructor(opts = {}) { + const lang = 'en'; + this.language = lang; + + this.stdout = opts.stdout || process.stdout; + this.stderr = opts.stderr || process.stderr; + this.stdin = opts.stdin || this._getStandardInput(); + this.emoji = !!opts.emoji; + this.nonInteractive = !!opts.nonInteractive; + this.noProgress = !!opts.noProgress || (_isCi || _load_isCi()).default; + this.isVerbose = !!opts.verbose; + + // $FlowFixMe: this is valid! + this.isTTY = this.stdout.isTTY; + + this.peakMemory = 0; + this.startTime = Date.now(); + this.format = (_format || _load_format()).defaultFormatter; + } + + lang(key, ...args) { + const msg = (_index || _load_index())[this.language][key] || (_index || _load_index()).en[key]; + if (!msg) { + throw new ReferenceError(`No message defined for language key ${key}`); + } + + // stringify args + const stringifiedArgs = stringifyLangArgs(args); + + // replace $0 placeholders with args + return msg.replace(/\$(\d+)/g, (str, i) => { + return stringifiedArgs[i]; + }); + } + + /** + * `stringifyLangArgs` run `JSON.stringify` on strings too causing + * them to appear quoted. This marks them as "raw" and prevents + * the quoting and escaping + */ + rawText(str) { + return { + inspect() { + return str; + } + }; + } + + verbose(msg) { + if (this.isVerbose) { + this._verbose(msg); + } + } + + verboseInspect(val) { + if (this.isVerbose) { + this._verboseInspect(val); + } + } + + _verbose(msg) {} + _verboseInspect(val) {} + + _getStandardInput() { + let standardInput; + + // Accessing stdin in a win32 headless process (e.g., Visual Studio) may throw an exception. + try { + standardInput = process.stdin; + } catch (e) { + console.warn(e.message); + delete process.stdin; + // $FlowFixMe: this is valid! + process.stdin = new EventEmitter(); + standardInput = process.stdin; + } + + return standardInput; + } + + initPeakMemoryCounter() { + this.checkPeakMemory(); + this.peakMemoryInterval = setInterval(() => { + this.checkPeakMemory(); + }, 1000); + // $FlowFixMe: Node's setInterval returns a Timeout, not a Number + this.peakMemoryInterval.unref(); + } + + checkPeakMemory() { + var _process$memoryUsage = process.memoryUsage(); + + const heapTotal = _process$memoryUsage.heapTotal; + + if (heapTotal > this.peakMemory) { + this.peakMemory = heapTotal; + } + } + + close() { + if (this.peakMemoryInterval) { + clearInterval(this.peakMemoryInterval); + this.peakMemoryInterval = null; + } + } + + getTotalTime() { + return Date.now() - this.startTime; + } + + // TODO + list(key, items, hints) {} + + // Outputs basic tree structure to console + tree(key, obj, { force = false } = {}) {} + + // called whenever we begin a step in the CLI. + step(current, total, message, emoji) {} + + // a error message has been triggered. this however does not always meant an abrupt + // program end. + error(message) {} + + // an info message has been triggered. this provides things like stats and diagnostics. + info(message) {} + + // a warning message has been triggered. + warn(message) {} + + // a success message has been triggered. + success(message) {} + + // a simple log message + // TODO: rethink the {force} parameter. In the meantime, please don't use it (cf comments in #4143). + log(message, { force = false } = {}) {} + + // a shell command has been executed + command(command) {} + + // inspect and pretty-print any value + inspect(value) {} + + // the screen shown at the very start of the CLI + header(command, pkg) {} + + // the screen shown at the very end of the CLI + footer(showPeakMemory) {} + + // a table structure + table(head, body) {} + + // security audit action to resolve advisories + auditAction(recommendation) {} + + // security audit requires manual review + auditManualReview() {} + + // security audit advisory + auditAdvisory(resolution, auditAdvisory) {} + + // summary for security audit report + auditSummary(auditMetadata) {} + + // render an activity spinner and return a function that will trigger an update + activity() { + return { + tick(name) {}, + end() {} + }; + } + + // + activitySet(total, workers) { + return { + spinners: Array(workers).fill({ + clear() {}, + setPrefix() {}, + tick() {}, + end() {} + }), + end() {} + }; + } + + // + question(question, options = {}) { + return Promise.reject(new Error('Not implemented')); + } + + // + questionAffirm(question) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const condition = true; // trick eslint + if (_this.nonInteractive) { + return true; + } + + while (condition) { + let answer = yield _this.question(question); + answer = answer.toLowerCase(); + + if (answer === 'y' || answer === 'yes') { + return true; + } + if (answer === 'n' || answer === 'no') { + return false; + } + + _this.error('Invalid answer for question'); + } + + return false; + })(); + } + + // prompt the user to select an option from an array + select(header, question, options) { + return Promise.reject(new Error('Not implemented')); + } + + // render a progress bar and return a function which when called will trigger an update + progress(total) { + return function () {}; + } + + // utility function to disable progress bar + disableProgress() { + this.noProgress = true; + } + + // + prompt(message, choices, options = {}) { + return Promise.reject(new Error('Not implemented')); + } +} +exports.default = BaseReporter; + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +exports.explodeHostedGitFragment = explodeHostedGitFragment; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _index; + +function _load_index() { + return _index = __webpack_require__(57); +} + +var _gitResolver; + +function _load_gitResolver() { + return _gitResolver = _interopRequireDefault(__webpack_require__(124)); +} + +var _exoticResolver; + +function _load_exoticResolver() { + return _exoticResolver = _interopRequireDefault(__webpack_require__(89)); +} + +var _git; + +function _load_git() { + return _git = _interopRequireDefault(__webpack_require__(219)); +} + +var _guessName; + +function _load_guessName() { + return _guessName = _interopRequireDefault(__webpack_require__(169)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function parseHash(fragment) { + const hashPosition = fragment.indexOf('#'); + return hashPosition === -1 ? '' : fragment.substr(hashPosition + 1); +} + +function explodeHostedGitFragment(fragment, reporter) { + const hash = parseHash(fragment); + + const preParts = fragment.split('@'); + if (preParts.length > 2) { + fragment = preParts[1] + '@' + preParts[2]; + } + + const parts = fragment.replace(/(.*?)#.*/, '$1') // Strip hash + .replace(/.*:(.*)/, '$1') // Strip prefixed protocols + .replace(/.git$/, '') // Strip the .git suffix + .split('/'); + + const user = parts[parts.length - 2]; + const repo = parts[parts.length - 1]; + + if (user === undefined || repo === undefined) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidHostedGitFragment', fragment)); + } + + return { + user, + repo, + hash + }; +} + +class HostedGitResolver extends (_exoticResolver || _load_exoticResolver()).default { + constructor(request, fragment) { + super(request, fragment); + + const exploded = this.exploded = explodeHostedGitFragment(fragment, this.reporter); + const user = exploded.user, + repo = exploded.repo, + hash = exploded.hash; + + this.user = user; + this.repo = repo; + this.hash = hash; + } + + static getTarballUrl(exploded, commit) { + exploded; + commit; + throw new Error('Not implemented'); + } + + static getGitHTTPUrl(exploded) { + exploded; + throw new Error('Not implemented'); + } + + static getGitHTTPBaseUrl(exploded) { + exploded; + throw new Error('Not implemented'); + } + + static getGitSSHUrl(exploded) { + exploded; + throw new Error('Not implemented'); + } + + static getHTTPFileUrl(exploded, filename, commit) { + exploded; + filename; + commit; + throw new Error('Not implemented'); + } + + getRefOverHTTP(url) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url); + const client = new (_git || _load_git()).default(_this.config, gitUrl, _this.hash); + + let out = yield _this.config.requestManager.request({ + url: `${url}/info/refs?service=git-upload-pack`, + queue: _this.resolver.fetchingQueue + }); + + if (out) { + // clean up output + let lines = out.trim().split('\n'); + + // remove first two lines which contains compatibility info etc + lines = lines.slice(2); + + // remove last line which contains the terminator "0000" + lines.pop(); + + // remove line lengths from start of each line + lines = lines.map(function (line) { + return line.slice(4); + }); + + out = lines.join('\n'); + } else { + throw new Error(_this.reporter.lang('hostedGitResolveError')); + } + + return client.setRefHosted(out); + })(); + } + + resolveOverHTTP(url) { + var _this2 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const commit = yield _this2.getRefOverHTTP(url); + const config = _this2.config; + + + const tarballUrl = _this2.constructor.getTarballUrl(_this2.exploded, commit); + + const tryRegistry = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) { + const filename = (_index || _load_index()).registries[registry].filename; + + const href = _this2.constructor.getHTTPFileUrl(_this2.exploded, filename, commit); + const file = yield config.requestManager.request({ + url: href, + queue: _this2.resolver.fetchingQueue + }); + if (!file) { + return null; + } + + const json = yield config.readJson(href, function () { + return JSON.parse(file); + }); + json._uid = commit; + json._remote = { + resolved: tarballUrl, + type: 'tarball', + reference: tarballUrl, + registry + }; + return json; + }); + + return function tryRegistry(_x) { + return _ref.apply(this, arguments); + }; + })(); + + const file = yield tryRegistry(_this2.registry); + if (file) { + return file; + } + + for (const registry in (_index || _load_index()).registries) { + if (registry === _this2.registry) { + continue; + } + + const file = yield tryRegistry(registry); + if (file) { + return file; + } + } + + return { + name: (0, (_guessName || _load_guessName()).default)(url), + version: '0.0.0', + _uid: commit, + _remote: { + resolved: tarballUrl, + type: 'tarball', + reference: tarballUrl, + registry: 'npm', + hash: undefined + } + }; + })(); + } + + hasHTTPCapability(url) { + var _this3 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + return (yield _this3.config.requestManager.request({ + url, + method: 'HEAD', + queue: _this3.resolver.fetchingQueue, + followRedirect: false + })) !== false; + })(); + } + + resolve() { + var _this4 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // If we already have the tarball, just return it without having to make any HTTP requests. + const shrunk = _this4.request.getLocked('tarball'); + if (shrunk) { + return shrunk; + } + + const httpUrl = _this4.constructor.getGitHTTPUrl(_this4.exploded); + const httpBaseUrl = _this4.constructor.getGitHTTPBaseUrl(_this4.exploded); + const sshUrl = _this4.constructor.getGitSSHUrl(_this4.exploded); + + // If we can access the files over HTTP then we should as it's MUCH faster than git + // archive and tarball unarchiving. The HTTP API is only available for public repos + // though. + if (yield _this4.hasHTTPCapability(httpBaseUrl)) { + return _this4.resolveOverHTTP(httpUrl); + } + + // If the url is accessible over git archive then we should immediately delegate to + // the git resolver. + // + // NOTE: Here we use a different url than when we delegate to the git resolver later on. + // This is because `git archive` requires access over ssh and github only allows that + // if you have write permissions + const sshGitUrl = (_git || _load_git()).default.npmUrlToGitUrl(sshUrl); + if (yield (_git || _load_git()).default.hasArchiveCapability(sshGitUrl)) { + const archiveClient = new (_git || _load_git()).default(_this4.config, sshGitUrl, _this4.hash); + const commit = yield archiveClient.init(); + return _this4.fork((_gitResolver || _load_gitResolver()).default, true, `${sshUrl}#${commit}`); + } + + // fallback to the plain git resolver + return _this4.fork((_gitResolver || _load_gitResolver()).default, true, sshUrl); + })(); + } +} +exports.default = HostedGitResolver; + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _map; + +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(29)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const debug = __webpack_require__(266)('yarn'); + +class BlockingQueue { + constructor(alias, maxConcurrency = Infinity) { + this.concurrencyQueue = []; + this.maxConcurrency = maxConcurrency; + this.runningCount = 0; + this.warnedStuck = false; + this.alias = alias; + this.first = true; + + this.running = (0, (_map || _load_map()).default)(); + this.queue = (0, (_map || _load_map()).default)(); + + this.stuckTick = this.stuckTick.bind(this); + } + + stillActive() { + if (this.stuckTimer) { + clearTimeout(this.stuckTimer); + } + + this.stuckTimer = setTimeout(this.stuckTick, 5000); + + // We need to check the existence of unref because of https://github.com/facebook/jest/issues/4559 + // $FlowFixMe: Node's setInterval returns a Timeout, not a Number + this.stuckTimer.unref && this.stuckTimer.unref(); + } + + stuckTick() { + if (this.runningCount === 1) { + this.warnedStuck = true; + debug(`The ${JSON.stringify(this.alias)} blocking queue may be stuck. 5 seconds ` + `without any activity with 1 worker: ${Object.keys(this.running)[0]}`); + } + } + + push(key, factory) { + if (this.first) { + this.first = false; + } else { + this.stillActive(); + } + + return new Promise((resolve, reject) => { + // we're already running so push ourselves to the queue + const queue = this.queue[key] = this.queue[key] || []; + queue.push({ factory, resolve, reject }); + + if (!this.running[key]) { + this.shift(key); + } + }); + } + + shift(key) { + if (this.running[key]) { + delete this.running[key]; + this.runningCount--; + + if (this.stuckTimer) { + clearTimeout(this.stuckTimer); + this.stuckTimer = null; + } + + if (this.warnedStuck) { + this.warnedStuck = false; + debug(`${JSON.stringify(this.alias)} blocking queue finally resolved. Nothing to worry about.`); + } + } + + const queue = this.queue[key]; + if (!queue) { + return; + } + + var _queue$shift = queue.shift(); + + const resolve = _queue$shift.resolve, + reject = _queue$shift.reject, + factory = _queue$shift.factory; + + if (!queue.length) { + delete this.queue[key]; + } + + const next = () => { + this.shift(key); + this.shiftConcurrencyQueue(); + }; + + const run = () => { + this.running[key] = true; + this.runningCount++; + + factory().then(function (val) { + resolve(val); + next(); + return null; + }).catch(function (err) { + reject(err); + next(); + }); + }; + + this.maybePushConcurrencyQueue(run); + } + + maybePushConcurrencyQueue(run) { + if (this.runningCount < this.maxConcurrency) { + run(); + } else { + this.concurrencyQueue.push(run); + } + } + + shiftConcurrencyQueue() { + if (this.runningCount < this.maxConcurrency) { + const fn = this.concurrencyQueue.shift(); + if (fn) { + fn(); + } + } + } +} +exports.default = BlockingQueue; + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.execCommand = exports.execFromManifest = exports.executeLifecycleScript = exports.makeEnv = exports.getWrappersFolder = exports.IGNORE_MANIFEST_KEYS = undefined; + +var _extends2; + +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(21)); +} + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +let getWrappersFolder = exports.getWrappersFolder = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { + if (wrappersFolder) { + return wrappersFolder; + } + + wrappersFolder = yield (_fs || _load_fs()).makeTempDir(); + + yield (0, (_portableScript || _load_portableScript()).makePortableProxyScript)(process.execPath, wrappersFolder, { + proxyBasename: 'node' + }); + + yield (0, (_portableScript || _load_portableScript()).makePortableProxyScript)(process.execPath, wrappersFolder, { + proxyBasename: 'yarn', + prependArguments: [process.argv[1]] + }); + + return wrappersFolder; + }); + + return function getWrappersFolder(_x) { + return _ref.apply(this, arguments); + }; +})(); + +let makeEnv = exports.makeEnv = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (stage, cwd, config) { + const env = (0, (_extends2 || _load_extends()).default)({ + NODE: process.execPath, + INIT_CWD: process.cwd() + }, process.env); + + // Merge in the `env` object specified in .yarnrc + const customEnv = config.getOption('env'); + if (customEnv && typeof customEnv === 'object') { + Object.assign(env, customEnv); + } + + env.npm_lifecycle_event = stage; + env.npm_node_execpath = env.NODE; + env.npm_execpath = env.npm_execpath || process.mainModule && process.mainModule.filename; + + // Set the env to production for npm compat if production mode. + // https://github.com/npm/npm/blob/30d75e738b9cb7a6a3f9b50e971adcbe63458ed3/lib/utils/lifecycle.js#L336 + if (config.production) { + env.NODE_ENV = 'production'; + } + + // Note: npm_config_argv environment variable contains output of nopt - command-line + // parser used by npm. Since we use other parser, we just roughly emulate it's output. (See: #684) + env.npm_config_argv = JSON.stringify({ + remain: [], + cooked: config.commandName === 'run' ? [config.commandName, stage] : [config.commandName], + original: process.argv.slice(2) + }); + + const manifest = yield config.maybeReadManifest(cwd); + if (manifest) { + if (manifest.scripts && Object.prototype.hasOwnProperty.call(manifest.scripts, stage)) { + env.npm_lifecycle_script = manifest.scripts[stage]; + } + + // add npm_package_* + const queue = [['', manifest]]; + while (queue.length) { + var _queue$pop = queue.pop(); + + const key = _queue$pop[0], + val = _queue$pop[1]; + + if (typeof val === 'object') { + for (const subKey in val) { + const fullKey = [key, subKey].filter(Boolean).join('_'); + if (fullKey && fullKey[0] !== '_' && !IGNORE_MANIFEST_KEYS.has(fullKey)) { + queue.push([fullKey, val[subKey]]); + } + } + } else { + let cleanVal = String(val); + if (cleanVal.indexOf('\n') >= 0) { + cleanVal = JSON.stringify(cleanVal); + } + + //replacing invalid chars with underscore + const cleanKey = key.replace(INVALID_CHAR_REGEX, '_'); + + env[`npm_package_${cleanKey}`] = cleanVal; + } + } + } + + // add npm_config_* and npm_package_config_* from yarn config + const keys = new Set([...Object.keys(config.registries.yarn.config), ...Object.keys(config.registries.npm.config)]); + const cleaned = Array.from(keys).filter(function (key) { + return !key.match(/:_/) && IGNORE_CONFIG_KEYS.indexOf(key) === -1; + }).map(function (key) { + let val = config.getOption(key); + if (!val) { + val = ''; + } else if (typeof val === 'number') { + val = '' + val; + } else if (typeof val !== 'string') { + val = JSON.stringify(val); + } + + if (val.indexOf('\n') >= 0) { + val = JSON.stringify(val); + } + return [key, val]; + }); + // add npm_config_* + for (var _iterator = cleaned, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref4; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; + } + + const _ref3 = _ref4; + const key = _ref3[0]; + const val = _ref3[1]; + + const cleanKey = key.replace(/^_+/, ''); + const envKey = `npm_config_${cleanKey}`.replace(INVALID_CHAR_REGEX, '_'); + env[envKey] = val; + } + // add npm_package_config_* + if (manifest && manifest.name) { + const packageConfigPrefix = `${manifest.name}:`; + for (var _iterator2 = cleaned, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref6; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref6 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref6 = _i2.value; + } + + const _ref5 = _ref6; + const key = _ref5[0]; + const val = _ref5[1]; + + if (key.indexOf(packageConfigPrefix) !== 0) { + continue; + } + const cleanKey = key.replace(/^_+/, '').replace(packageConfigPrefix, ''); + const envKey = `npm_package_config_${cleanKey}`.replace(INVALID_CHAR_REGEX, '_'); + env[envKey] = val; + } + } + + // split up the path + const envPath = env[(_constants || _load_constants()).ENV_PATH_KEY]; + const pathParts = envPath ? envPath.split(path.delimiter) : []; + + // Include node-gyp version that was bundled with the current Node.js version, + // if available. + pathParts.unshift(path.join(path.dirname(process.execPath), 'node_modules', 'npm', 'bin', 'node-gyp-bin')); + pathParts.unshift(path.join(path.dirname(process.execPath), '..', 'lib', 'node_modules', 'npm', 'bin', 'node-gyp-bin')); + // Include node-gyp version from homebrew managed npm, if available. + pathParts.unshift(path.join(path.dirname(process.execPath), '..', 'libexec', 'lib', 'node_modules', 'npm', 'bin', 'node-gyp-bin')); + + // Add global bin folder if it is not present already, as some packages depend + // on a globally-installed version of node-gyp. + const globalBin = yield (0, (_global || _load_global()).getBinFolder)(config, {}); + if (pathParts.indexOf(globalBin) === -1) { + pathParts.unshift(globalBin); + } + + // Add node_modules .bin folders to the PATH + for (var _iterator3 = config.registryFolders, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref7; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref7 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref7 = _i3.value; + } + + const registryFolder = _ref7; + + const binFolder = path.join(registryFolder, '.bin'); + if (config.workspacesEnabled && config.workspaceRootFolder) { + pathParts.unshift(path.join(config.workspaceRootFolder, binFolder)); + } + pathParts.unshift(path.join(config.linkFolder, binFolder)); + pathParts.unshift(path.join(cwd, binFolder)); + } + + let pnpFile; + + if (process.versions.pnp) { + pnpFile = (_dynamicRequire || _load_dynamicRequire()).dynamicRequire.resolve('pnpapi'); + } else { + const candidate = `${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`; + if (yield (_fs || _load_fs()).exists(candidate)) { + pnpFile = candidate; + } + } + + if (pnpFile) { + const pnpApi = (0, (_dynamicRequire || _load_dynamicRequire()).dynamicRequire)(pnpFile); + + const packageLocator = pnpApi.findPackageLocator(`${cwd}/`); + const packageInformation = pnpApi.getPackageInformation(packageLocator); + + for (var _iterator4 = packageInformation.packageDependencies.entries(), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref9; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref9 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref9 = _i4.value; + } + + const _ref8 = _ref9; + const name = _ref8[0]; + const reference = _ref8[1]; + + const dependencyInformation = pnpApi.getPackageInformation({ name, reference }); + + if (!dependencyInformation || !dependencyInformation.packageLocation) { + continue; + } + + const binFolder = `${dependencyInformation.packageLocation}/.bin`; + if (yield (_fs || _load_fs()).exists(binFolder)) { + pathParts.unshift(binFolder); + } + } + + // Note that NODE_OPTIONS doesn't support any style of quoting its arguments at the moment + // For this reason, it won't work if the user has a space inside its $PATH + env.NODE_OPTIONS = env.NODE_OPTIONS || ''; + env.NODE_OPTIONS = `--require ${pnpFile} ${env.NODE_OPTIONS}`; + } + + pathParts.unshift((yield getWrappersFolder(config))); + + // join path back together + env[(_constants || _load_constants()).ENV_PATH_KEY] = pathParts.join(path.delimiter); + + return env; + }); + + return function makeEnv(_x2, _x3, _x4) { + return _ref2.apply(this, arguments); + }; +})(); + +let executeLifecycleScript = exports.executeLifecycleScript = (() => { + var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ({ + stage, + config, + cwd, + cmd, + isInteractive, + onProgress, + customShell + }) { + const env = yield makeEnv(stage, cwd, config); + + yield checkForGypIfNeeded(config, cmd, env[(_constants || _load_constants()).ENV_PATH_KEY].split(path.delimiter)); + + if (process.platform === 'win32' && (!customShell || customShell === 'cmd')) { + // handle windows run scripts starting with a relative path + cmd = (0, (_fixCmdWinSlashes || _load_fixCmdWinSlashes()).fixCmdWinSlashes)(cmd); + } + + // By default (non-interactive), pipe everything to the terminal and run child process detached + // as long as it's not Windows (since windows does not have /dev/tty) + let stdio = ['ignore', 'pipe', 'pipe']; + let detached = process.platform !== 'win32'; + + if (isInteractive) { + stdio = 'inherit'; + detached = false; + } + + const shell = customShell || true; + const stdout = yield (_child || _load_child()).spawn(cmd, [], { cwd, env, stdio, detached, shell }, onProgress); + + return { cwd, command: cmd, stdout }; + }); + + return function executeLifecycleScript(_x5) { + return _ref10.apply(this, arguments); + }; +})(); + +let _checkForGyp = (() => { + var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, paths) { + const reporter = config.reporter; + + // Check every directory in the PATH + + const allChecks = yield Promise.all(paths.map(function (dir) { + return (_fs || _load_fs()).exists(path.join(dir, 'node-gyp')); + })); + if (allChecks.some(Boolean)) { + // node-gyp is available somewhere + return; + } + + reporter.info(reporter.lang('packageRequiresNodeGyp')); + + try { + yield (0, (_global || _load_global()).run)(config, reporter, {}, ['add', 'node-gyp']); + } catch (e) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('nodeGypAutoInstallFailed', e.message)); + } + }); + + return function _checkForGyp(_x6, _x7) { + return _ref11.apply(this, arguments); + }; +})(); + +let execFromManifest = exports.execFromManifest = (() => { + var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, commandName, cwd) { + const pkg = yield config.maybeReadManifest(cwd); + if (!pkg || !pkg.scripts) { + return; + } + + const cmd = pkg.scripts[commandName]; + if (cmd) { + yield execCommand({ stage: commandName, config, cmd, cwd, isInteractive: true }); + } + }); + + return function execFromManifest(_x8, _x9, _x10) { + return _ref12.apply(this, arguments); + }; +})(); + +let execCommand = exports.execCommand = (() => { + var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ({ + stage, + config, + cmd, + cwd, + isInteractive, + customShell + }) { + const reporter = config.reporter; + + try { + reporter.command(cmd); + yield executeLifecycleScript({ stage, config, cwd, cmd, isInteractive, customShell }); + return Promise.resolve(); + } catch (err) { + if (err instanceof (_errors || _load_errors()).ProcessTermError) { + const formattedError = new (_errors || _load_errors()).ProcessTermError(err.EXIT_SIGNAL ? reporter.lang('commandFailedWithSignal', err.EXIT_SIGNAL) : reporter.lang('commandFailedWithCode', err.EXIT_CODE)); + formattedError.EXIT_CODE = err.EXIT_CODE; + formattedError.EXIT_SIGNAL = err.EXIT_SIGNAL; + throw formattedError; + } else { + throw err; + } + } + }); + + return function execCommand(_x11) { + return _ref13.apply(this, arguments); + }; +})(); + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _constants; + +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} + +var _child; + +function _load_child() { + return _child = _interopRequireWildcard(__webpack_require__(58)); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(4)); +} + +var _dynamicRequire; + +function _load_dynamicRequire() { + return _dynamicRequire = __webpack_require__(371); +} + +var _portableScript; + +function _load_portableScript() { + return _portableScript = __webpack_require__(589); +} + +var _fixCmdWinSlashes; + +function _load_fixCmdWinSlashes() { + return _fixCmdWinSlashes = __webpack_require__(578); +} + +var _global; + +function _load_global() { + return _global = __webpack_require__(121); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const path = __webpack_require__(0); + +const IGNORE_MANIFEST_KEYS = exports.IGNORE_MANIFEST_KEYS = new Set(['readme', 'notice', 'licenseText', 'activationEvents', 'contributes']); + +// We treat these configs as internal, thus not expose them to process.env. +// This helps us avoid some gyp issues when building native modules. +// See https://github.com/yarnpkg/yarn/issues/2286. +const IGNORE_CONFIG_KEYS = ['lastUpdateCheck']; + +let wrappersFolder = null; + +const INVALID_CHAR_REGEX = /\W/g; + +exports.default = executeLifecycleScript; + + +let checkGypPromise = null; +/** + * Special case: Some packages depend on node-gyp, but don't specify this in + * their package.json dependencies. They assume that node-gyp is available + * globally. We need to detect this case and show an error message. + */ +function checkForGypIfNeeded(config, cmd, paths) { + if (cmd.substr(0, cmd.indexOf(' ')) !== 'node-gyp') { + return Promise.resolve(); + } + + // Ensure this only runs once, rather than multiple times in parallel. + if (!checkGypPromise) { + checkGypPromise = _checkForGyp(config, paths); + } + return checkGypPromise; +} + +/***/ }), +/* 112 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports) { + +// 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. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * micromatch + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + + + +var expand = __webpack_require__(753); +var utils = __webpack_require__(300); + +/** + * The main function. Pass an array of filepaths, + * and a string or array of glob patterns + * + * @param {Array|String} `files` + * @param {Array|String} `patterns` + * @param {Object} `opts` + * @return {Array} Array of matches + */ + +function micromatch(files, patterns, opts) { + if (!files || !patterns) return []; + opts = opts || {}; + + if (typeof opts.cache === 'undefined') { + opts.cache = true; + } + + if (!Array.isArray(patterns)) { + return match(files, patterns, opts); + } + + var len = patterns.length, i = 0; + var omit = [], keep = []; + + while (len--) { + var glob = patterns[i++]; + if (typeof glob === 'string' && glob.charCodeAt(0) === 33 /* ! */) { + omit.push.apply(omit, match(files, glob.slice(1), opts)); + } else { + keep.push.apply(keep, match(files, glob, opts)); + } + } + return utils.diff(keep, omit); +} + +/** + * Return an array of files that match the given glob pattern. + * + * This function is called by the main `micromatch` function If you only + * need to pass a single pattern you might get very minor speed improvements + * using this function. + * + * @param {Array} `files` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Array} + */ + +function match(files, pattern, opts) { + if (utils.typeOf(files) !== 'string' && !Array.isArray(files)) { + throw new Error(msg('match', 'files', 'a string or array')); + } + + files = utils.arrayify(files); + opts = opts || {}; + + var negate = opts.negate || false; + var orig = pattern; + + if (typeof pattern === 'string') { + negate = pattern.charAt(0) === '!'; + if (negate) { + pattern = pattern.slice(1); + } + + // we need to remove the character regardless, + // so the above logic is still needed + if (opts.nonegate === true) { + negate = false; + } + } + + var _isMatch = matcher(pattern, opts); + var len = files.length, i = 0; + var res = []; + + while (i < len) { + var file = files[i++]; + var fp = utils.unixify(file, opts); + + if (!_isMatch(fp)) { continue; } + res.push(fp); + } + + if (res.length === 0) { + if (opts.failglob === true) { + throw new Error('micromatch.match() found no matches for: "' + orig + '".'); + } + + if (opts.nonull || opts.nullglob) { + res.push(utils.unescapeGlob(orig)); + } + } + + // if `negate` was defined, diff negated files + if (negate) { res = utils.diff(files, res); } + + // if `ignore` was defined, diff ignored filed + if (opts.ignore && opts.ignore.length) { + pattern = opts.ignore; + opts = utils.omit(opts, ['ignore']); + res = utils.diff(res, micromatch(res, pattern, opts)); + } + + if (opts.nodupes) { + return utils.unique(res); + } + return res; +} + +/** + * Returns a function that takes a glob pattern or array of glob patterns + * to be used with `Array#filter()`. (Internally this function generates + * the matching function using the [matcher] method). + * + * ```js + * var fn = mm.filter('[a-c]'); + * ['a', 'b', 'c', 'd', 'e'].filter(fn); + * //=> ['a', 'b', 'c'] + * ``` + * @param {String|Array} `patterns` Can be a glob or array of globs. + * @param {Options} `opts` Options to pass to the [matcher] method. + * @return {Function} Filter function to be passed to `Array#filter()`. + */ + +function filter(patterns, opts) { + if (!Array.isArray(patterns) && typeof patterns !== 'string') { + throw new TypeError(msg('filter', 'patterns', 'a string or array')); + } + + patterns = utils.arrayify(patterns); + var len = patterns.length, i = 0; + var patternMatchers = Array(len); + while (i < len) { + patternMatchers[i] = matcher(patterns[i++], opts); + } + + return function(fp) { + if (fp == null) return []; + var len = patternMatchers.length, i = 0; + var res = true; + + fp = utils.unixify(fp, opts); + while (i < len) { + var fn = patternMatchers[i++]; + if (!fn(fp)) { + res = false; + break; + } + } + return res; + }; +} + +/** + * Returns true if the filepath contains the given + * pattern. Can also return a function for matching. + * + * ```js + * isMatch('foo.md', '*.md', {}); + * //=> true + * + * isMatch('*.md', {})('foo.md') + * //=> true + * ``` + * @param {String} `fp` + * @param {String} `pattern` + * @param {Object} `opts` + * @return {Boolean} + */ + +function isMatch(fp, pattern, opts) { + if (typeof fp !== 'string') { + throw new TypeError(msg('isMatch', 'filepath', 'a string')); + } + + fp = utils.unixify(fp, opts); + if (utils.typeOf(pattern) === 'object') { + return matcher(fp, pattern); + } + return matcher(pattern, opts)(fp); +} + +/** + * Returns true if the filepath matches the + * given pattern. + */ + +function contains(fp, pattern, opts) { + if (typeof fp !== 'string') { + throw new TypeError(msg('contains', 'pattern', 'a string')); + } + + opts = opts || {}; + opts.contains = (pattern !== ''); + fp = utils.unixify(fp, opts); + + if (opts.contains && !utils.isGlob(pattern)) { + return fp.indexOf(pattern) !== -1; + } + return matcher(pattern, opts)(fp); +} + +/** + * Returns true if a file path matches any of the + * given patterns. + * + * @param {String} `fp` The filepath to test. + * @param {String|Array} `patterns` Glob patterns to use. + * @param {Object} `opts` Options to pass to the `matcher()` function. + * @return {String} + */ + +function any(fp, patterns, opts) { + if (!Array.isArray(patterns) && typeof patterns !== 'string') { + throw new TypeError(msg('any', 'patterns', 'a string or array')); + } + + patterns = utils.arrayify(patterns); + var len = patterns.length; + + fp = utils.unixify(fp, opts); + while (len--) { + var isMatch = matcher(patterns[len], opts); + if (isMatch(fp)) { + return true; + } + } + return false; +} + +/** + * Filter the keys of an object with the given `glob` pattern + * and `options` + * + * @param {Object} `object` + * @param {Pattern} `object` + * @return {Array} + */ + +function matchKeys(obj, glob, options) { + if (utils.typeOf(obj) !== 'object') { + throw new TypeError(msg('matchKeys', 'first argument', 'an object')); + } + + var fn = matcher(glob, options); + var res = {}; + + for (var key in obj) { + if (obj.hasOwnProperty(key) && fn(key)) { + res[key] = obj[key]; + } + } + return res; +} + +/** + * Return a function for matching based on the + * given `pattern` and `options`. + * + * @param {String} `pattern` + * @param {Object} `options` + * @return {Function} + */ + +function matcher(pattern, opts) { + // pattern is a function + if (typeof pattern === 'function') { + return pattern; + } + // pattern is a regex + if (pattern instanceof RegExp) { + return function(fp) { + return pattern.test(fp); + }; + } + + if (typeof pattern !== 'string') { + throw new TypeError(msg('matcher', 'pattern', 'a string, regex, or function')); + } + + // strings, all the way down... + pattern = utils.unixify(pattern, opts); + + // pattern is a non-glob string + if (!utils.isGlob(pattern)) { + return utils.matchPath(pattern, opts); + } + // pattern is a glob string + var re = makeRe(pattern, opts); + + // `matchBase` is defined + if (opts && opts.matchBase) { + return utils.hasFilename(re, opts); + } + // `matchBase` is not defined + return function(fp) { + fp = utils.unixify(fp, opts); + return re.test(fp); + }; +} + +/** + * Create and cache a regular expression for matching + * file paths. + * + * If the leading character in the `glob` is `!`, a negation + * regex is returned. + * + * @param {String} `glob` + * @param {Object} `options` + * @return {RegExp} + */ + +function toRegex(glob, options) { + // clone options to prevent mutating the original object + var opts = Object.create(options || {}); + var flags = opts.flags || ''; + if (opts.nocase && flags.indexOf('i') === -1) { + flags += 'i'; + } + + var parsed = expand(glob, opts); + + // pass in tokens to avoid parsing more than once + opts.negated = opts.negated || parsed.negated; + opts.negate = opts.negated; + glob = wrapGlob(parsed.pattern, opts); + var re; + + try { + re = new RegExp(glob, flags); + return re; + } catch (err) { + err.reason = 'micromatch invalid regex: (' + re + ')'; + if (opts.strict) throw new SyntaxError(err); + } + + // we're only here if a bad pattern was used and the user + // passed `options.silent`, so match nothing + return /$^/; +} + +/** + * Create the regex to do the matching. If the leading + * character in the `glob` is `!` a negation regex is returned. + * + * @param {String} `glob` + * @param {Boolean} `negate` + */ + +function wrapGlob(glob, opts) { + var prefix = (opts && !opts.contains) ? '^' : ''; + var after = (opts && !opts.contains) ? '$' : ''; + glob = ('(?:' + glob + ')' + after); + if (opts && opts.negate) { + return prefix + ('(?!^' + glob + ').*$'); + } + return prefix + glob; +} + +/** + * Create and cache a regular expression for matching file paths. + * If the leading character in the `glob` is `!`, a negation + * regex is returned. + * + * @param {String} `glob` + * @param {Object} `options` + * @return {RegExp} + */ + +function makeRe(glob, opts) { + if (utils.typeOf(glob) !== 'string') { + throw new Error(msg('makeRe', 'glob', 'a string')); + } + return utils.cache(toRegex, glob, opts); +} + +/** + * Make error messages consistent. Follows this format: + * + * ```js + * msg(methodName, argNumber, nativeType); + * // example: + * msg('matchKeys', 'first', 'an object'); + * ``` + * + * @param {String} `method` + * @param {String} `num` + * @param {String} `type` + * @return {String} + */ + +function msg(method, what, type) { + return 'micromatch.' + method + '(): ' + what + ' should be ' + type + '.'; +} + +/** + * Public methods + */ + +/* eslint no-multi-spaces: 0 */ +micromatch.any = any; +micromatch.braces = micromatch.braceExpand = utils.braces; +micromatch.contains = contains; +micromatch.expand = expand; +micromatch.filter = filter; +micromatch.isMatch = isMatch; +micromatch.makeRe = makeRe; +micromatch.match = match; +micromatch.matcher = matcher; +micromatch.matchKeys = matchKeys; + +/** + * Expose `micromatch` + */ + +module.exports = micromatch; + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 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. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + + + +/**/ + +var pna = __webpack_require__(180); +/**/ + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var util = __webpack_require__(113); +util.inherits = __webpack_require__(61); +/**/ + +var Readable = __webpack_require__(406); +var Writable = __webpack_require__(408); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); }; /***/ }), -/* 150 */ +/* 116 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = multicast; +/* unused harmony export MulticastOperator */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_ConnectableObservable__ = __webpack_require__(423); +/** 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, __WEBPACK_IMPORTED_MODULE_0__observable_ConnectableObservable__["b" /* 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 + + +/***/ }), +/* 117 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return observable; }); +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +var observable = typeof Symbol === 'function' && Symbol.observable || '@@observable'; +//# sourceMappingURL=observable.js.map + + +/***/ }), +/* 118 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = identity; +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +function identity(x) { + return x; +} +//# sourceMappingURL=identity.js.map + + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +var v1 = __webpack_require__(957); +var v4 = __webpack_require__(958); + +var uuid = v4; +uuid.v1 = v1; +uuid.v4 = v4; + +module.exports = uuid; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getInstallationMethod = exports.version = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +let getInstallationMethod = exports.getInstallationMethod = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + let installationMethod = originalInstallationMethod; + + // If there's a package.json in the parent directory, it could have an + // override for the installation method, so we should prefer that over + // whatever was originally in Yarn's package.json. This is the case with + // systems such as Homebrew, which take the tarball and modify the + // installation method so we're aware of the fact that Yarn was installed via + // Homebrew (so things like update notifications can point out the correct + // command to upgrade). + try { + const manifestPath = (_path || _load_path()).default.join(__dirname, '..', 'package.json'); + if ((_fs2 || _load_fs2()).default.existsSync(manifestPath)) { + // non-async version is deprecated + const manifest = yield (0, (_fs || _load_fs()).readJson)(manifestPath); + if (manifest.installationMethod) { + installationMethod = manifest.installationMethod; + } + } + } catch (e) { + // Ignore any errors; this is not critical functionality. + } + return installationMethod; + }); + + return function getInstallationMethod() { + return _ref.apply(this, arguments); + }; +})(); + +var _fs; + +function _load_fs() { + return _fs = __webpack_require__(4); +} + +var _fs2; + +function _load_fs2() { + return _fs2 = _interopRequireDefault(__webpack_require__(5)); +} + +var _path; + +function _load_path() { + return _path = _interopRequireDefault(__webpack_require__(0)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// This will be bundled directly in the .js file for production builds +var _require = __webpack_require__(194); /** + * Determines the current version of Yarn itself. + * + */ + +const version = _require.version, + originalInstallationMethod = _require.installationMethod; +exports.version = version; + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = exports.getBinFolder = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +let updateCwd = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { + yield (_fs || _load_fs()).mkdirp(config.globalFolder); + + yield config.init({ + cwd: config.globalFolder, + offline: config.offline, + binLinks: true, + globalFolder: config.globalFolder, + cacheFolder: config._cacheRootFolder, + linkFolder: config.linkFolder, + enableDefaultRc: config.enableDefaultRc, + extraneousYarnrcFiles: config.extraneousYarnrcFiles + }); + }); + + return function updateCwd(_x) { + return _ref2.apply(this, arguments); + }; +})(); + +let getBins = (() => { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { + // build up list of registry folders to search for binaries + const dirs = []; + for (var _iterator2 = Object.keys((_index || _load_index()).registries), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref4; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref4 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref4 = _i2.value; + } + + const registryName = _ref4; + + const registry = config.registries[registryName]; + dirs.push(registry.loc); + } + + // build up list of binary files + const paths = new Set(); + for (var _iterator3 = dirs, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref5; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref5 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref5 = _i3.value; + } + + const dir = _ref5; + + const binDir = path.join(dir, '.bin'); + if (!(yield (_fs || _load_fs()).exists(binDir))) { + continue; + } + + for (var _iterator4 = yield (_fs || _load_fs()).readdir(binDir), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref6; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref6 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref6 = _i4.value; + } + + const name = _ref6; + + paths.add(path.join(binDir, name)); + } + } + return paths; + }); + + return function getBins(_x2) { + return _ref3.apply(this, arguments); + }; +})(); + +let getGlobalPrefix = (() => { + var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { + if (flags.prefix) { + return flags.prefix; + } else if (config.getOption('prefix', true)) { + return String(config.getOption('prefix', true)); + } else if (process.env.PREFIX) { + return process.env.PREFIX; + } + + const potentialPrefixFolders = [(_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX]; + if (process.platform === 'win32') { + // %LOCALAPPDATA%\Yarn --> C:\Users\Alice\AppData\Local\Yarn + if (process.env.LOCALAPPDATA) { + potentialPrefixFolders.unshift(path.join(process.env.LOCALAPPDATA, 'Yarn')); + } + } else { + potentialPrefixFolders.unshift((_constants || _load_constants()).POSIX_GLOBAL_PREFIX); + } + + const binFolders = potentialPrefixFolders.map(function (prefix) { + return path.join(prefix, 'bin'); + }); + const prefixFolderQueryResult = yield (_fs || _load_fs()).getFirstSuitableFolder(binFolders); + const prefix = prefixFolderQueryResult.folder && path.dirname(prefixFolderQueryResult.folder); + + if (!prefix) { + config.reporter.warn(config.reporter.lang('noGlobalFolder', prefixFolderQueryResult.skipped.map(function (item) { + return path.dirname(item.folder); + }).join(', '))); + + return (_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX; + } + + return prefix; + }); + + return function getGlobalPrefix(_x3, _x4) { + return _ref7.apply(this, arguments); + }; +})(); + +let getBinFolder = exports.getBinFolder = (() => { + var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { + const prefix = yield getGlobalPrefix(config, flags); + return path.resolve(prefix, 'bin'); + }); + + return function getBinFolder(_x5, _x6) { + return _ref8.apply(this, arguments); + }; +})(); + +let initUpdateBins = (() => { + var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags) { + const beforeBins = yield getBins(config); + const binFolder = yield getBinFolder(config, flags); + + function throwPermError(err, dest) { + if (err.code === 'EACCES') { + throw new (_errors || _load_errors()).MessageError(reporter.lang('noPermission', dest)); + } else { + throw err; + } + } + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + try { + yield (_fs || _load_fs()).mkdirp(binFolder); + } catch (err) { + throwPermError(err, binFolder); + } + + const afterBins = yield getBins(config); + + // remove old bins + for (var _iterator5 = beforeBins, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref11; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref11 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref11 = _i5.value; + } + + const src = _ref11; + + if (afterBins.has(src)) { + // not old + continue; + } + + // remove old bin + const dest = path.join(binFolder, path.basename(src)); + try { + yield (_fs || _load_fs()).unlink(dest); + } catch (err) { + throwPermError(err, dest); + } + } + + // add new bins + for (var _iterator6 = afterBins, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref12; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref12 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref12 = _i6.value; + } + + const src = _ref12; + + // insert new bin + const dest = path.join(binFolder, path.basename(src)); + try { + yield (_fs || _load_fs()).unlink(dest); + yield (0, (_packageLinker || _load_packageLinker()).linkBin)(src, dest); + if (process.platform === 'win32' && dest.indexOf('.cmd') !== -1) { + yield (_fs || _load_fs()).rename(dest + '.cmd', dest); + } + } catch (err) { + throwPermError(err, dest); + } + } + }); + }); + + return function initUpdateBins(_x7, _x8, _x9) { + return _ref9.apply(this, arguments); + }; +})(); + +let list = (() => { + var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + yield updateCwd(config); + + // install so we get hard file paths + const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); + const install = new (_install || _load_install()).Install({}, config, new (_baseReporter || _load_baseReporter()).default(), lockfile); + const patterns = yield install.getFlattenedDeps(); + + // dump global modules + for (var _iterator7 = patterns, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref14; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref14 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref14 = _i7.value; + } + + const pattern = _ref14; + + const manifest = install.resolver.getStrictResolvedPattern(pattern); + ls(manifest, reporter, false); + } + }); + + return function list(_x10, _x11, _x12, _x13) { + return _ref13.apply(this, arguments); + }; +})(); + +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _index; + +function _load_index() { + return _index = __webpack_require__(57); +} + +var _baseReporter; + +function _load_baseReporter() { + return _baseReporter = _interopRequireDefault(__webpack_require__(108)); +} + +var _buildSubCommands2; + +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(59)); +} + +var _lockfile; + +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(19)); +} + +var _install; + +function _load_install() { + return _install = __webpack_require__(34); +} + +var _add; + +function _load_add() { + return _add = __webpack_require__(165); +} + +var _remove; + +function _load_remove() { + return _remove = __webpack_require__(359); +} + +var _upgrade; + +function _load_upgrade() { + return _upgrade = __webpack_require__(207); +} + +var _upgradeInteractive; + +function _load_upgradeInteractive() { + return _upgradeInteractive = __webpack_require__(362); +} + +var _packageLinker; + +function _load_packageLinker() { + return _packageLinker = __webpack_require__(211); +} + +var _constants; + +function _load_constants() { + return _constants = __webpack_require__(8); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(4)); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +class GlobalAdd extends (_add || _load_add()).Add { + constructor(args, flags, config, reporter, lockfile) { + super(args, flags, config, reporter, lockfile); + + this.linker.setTopLevelBinLinking(false); + } + + maybeOutputSaveTree() { + for (var _iterator = this.addedPatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const pattern = _ref; + + const manifest = this.resolver.getStrictResolvedPattern(pattern); + ls(manifest, this.reporter, true); + } + return Promise.resolve(); + } + + _logSuccessSaveLockfile() { + // noop + } +} + +const path = __webpack_require__(0); + +function hasWrapper(flags, args) { + return args[0] !== 'bin' && args[0] !== 'dir'; +} + +function ls(manifest, reporter, saved) { + const bins = manifest.bin ? Object.keys(manifest.bin) : []; + const human = `${manifest.name}@${manifest.version}`; + if (bins.length) { + if (saved) { + reporter.success(reporter.lang('packageInstalledWithBinaries', human)); + } else { + reporter.info(reporter.lang('packageHasBinaries', human)); + } + reporter.list(`bins-${manifest.name}`, bins); + } else if (saved) { + reporter.warn(reporter.lang('packageHasNoBinaries', human)); + } +} + +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('global', { + add(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield updateCwd(config); + + const updateBins = yield initUpdateBins(config, reporter, flags); + if (args.indexOf('yarn') !== -1) { + reporter.warn(reporter.lang('packageContainsYarnAsGlobal')); + } + + // install module + const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); + const install = new GlobalAdd(args, flags, config, reporter, lockfile); + yield install.init(); + + // link binaries + yield updateBins(); + })(); + }, + + bin(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + reporter.log((yield getBinFolder(config, flags)), { force: true }); + })(); + }, + + dir(config, reporter, flags, args) { + reporter.log(config.globalFolder, { force: true }); + return Promise.resolve(); + }, + + ls(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + reporter.warn(`\`yarn global ls\` is deprecated. Please use \`yarn global list\`.`); + yield list(config, reporter, flags, args); + })(); + }, + + list(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield list(config, reporter, flags, args); + })(); + }, + + remove(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield updateCwd(config); + + const updateBins = yield initUpdateBins(config, reporter, flags); + + // remove module + yield (0, (_remove || _load_remove()).run)(config, reporter, flags, args); + + // remove binaries + yield updateBins(); + })(); + }, + + upgrade(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield updateCwd(config); + + const updateBins = yield initUpdateBins(config, reporter, flags); + + // upgrade module + yield (0, (_upgrade || _load_upgrade()).run)(config, reporter, flags, args); + + // update binaries + yield updateBins(); + })(); + }, + + upgradeInteractive(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield updateCwd(config); + + const updateBins = yield initUpdateBins(config, reporter, flags); + + // upgrade module + yield (0, (_upgradeInteractive || _load_upgradeInteractive()).run)(config, reporter, flags, args); + + // update binaries + yield updateBins(); + })(); + } +}); + +const run = _buildSubCommands.run, + _setFlags = _buildSubCommands.setFlags; +exports.run = run; +function setFlags(commander) { + _setFlags(commander); + commander.description('Installs packages globally on your operating system.'); + commander.option('--prefix ', 'bin prefix to use to install binaries'); + commander.option('--latest', 'upgrade to the latest version of packages'); +} + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _path; + +function _load_path() { + return _path = _interopRequireDefault(__webpack_require__(0)); +} + +var _invariant; + +function _load_invariant() { + return _invariant = _interopRequireDefault(__webpack_require__(9)); +} + +var _semver; + +function _load_semver() { + return _semver = _interopRequireDefault(__webpack_require__(22)); +} + +var _validate; + +function _load_validate() { + return _validate = __webpack_require__(125); +} + +var _lockfile; + +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(19)); +} + +var _packageReference; + +function _load_packageReference() { + return _packageReference = _interopRequireDefault(__webpack_require__(365)); +} + +var _index; + +function _load_index() { + return _index = __webpack_require__(78); +} + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _constants; + +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} + +var _version; + +function _load_version() { + return _version = _interopRequireWildcard(__webpack_require__(226)); +} + +var _workspaceResolver; + +function _load_workspaceResolver() { + return _workspaceResolver = _interopRequireDefault(__webpack_require__(570)); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(4)); +} + +var _normalizePattern4; + +function _load_normalizePattern() { + return _normalizePattern4 = __webpack_require__(37); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const micromatch = __webpack_require__(114); + +class PackageRequest { + constructor(req, resolver) { + this.parentRequest = req.parentRequest; + this.parentNames = req.parentNames || []; + this.lockfile = resolver.lockfile; + this.registry = req.registry; + this.reporter = resolver.reporter; + this.resolver = resolver; + this.optional = req.optional; + this.hint = req.hint; + this.pattern = req.pattern; + this.config = resolver.config; + this.foundInfo = null; + } + + init() { + this.resolver.usedRegistries.add(this.registry); + } + + getLocked(remoteType) { + // always prioritise root lockfile + const shrunk = this.lockfile.getLocked(this.pattern); + + if (shrunk && shrunk.resolved) { + const resolvedParts = (_version || _load_version()).explodeHashedUrl(shrunk.resolved); + + // Detect Git protocols (git://HOST/PATH or git+PROTOCOL://HOST/PATH) + const preferredRemoteType = /^git(\+[a-z0-9]+)?:\/\//.test(resolvedParts.url) ? 'git' : remoteType; + + return { + name: shrunk.name, + version: shrunk.version, + _uid: shrunk.uid, + _remote: { + resolved: shrunk.resolved, + type: preferredRemoteType, + reference: resolvedParts.url, + hash: resolvedParts.hash, + integrity: shrunk.integrity, + registry: shrunk.registry, + packageName: shrunk.name + }, + optionalDependencies: shrunk.optionalDependencies || {}, + dependencies: shrunk.dependencies || {}, + prebuiltVariants: shrunk.prebuiltVariants || {} + }; + } else { + return null; + } + } + + /** + * If the input pattern matches a registry one then attempt to find it on the registry. + * Otherwise fork off to an exotic resolver if one matches. + */ + + findVersionOnRegistry(pattern) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _ref = yield _this.normalize(pattern); + + const range = _ref.range, + name = _ref.name; + + + const exoticResolver = (0, (_index || _load_index()).getExoticResolver)(range); + if (exoticResolver) { + let data = yield _this.findExoticVersionInfo(exoticResolver, range); + + // clone data as we're manipulating it in place and this could be resolved multiple + // times + data = Object.assign({}, data); + + // this is so the returned package response uses the overridden name. ie. if the + // package's actual name is `bar`, but it's been specified in the manifest like: + // "foo": "http://foo.com/bar.tar.gz" + // then we use the foo name + data.name = name; + return data; + } + + const Resolver = _this.getRegistryResolver(); + const resolver = new Resolver(_this, name, range); + try { + return yield resolver.resolve(); + } catch (err) { + // if it is not an error thrown by yarn and it has a parent request, + // thow a more readable error + if (!(err instanceof (_errors || _load_errors()).MessageError) && _this.parentRequest && _this.parentRequest.pattern) { + throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('requiredPackageNotFoundRegistry', pattern, _this.parentRequest.pattern, _this.registry)); + } + throw err; + } + })(); + } + + /** + * Get the registry resolver associated with this package request. + */ + + getRegistryResolver() { + const Resolver = (_index || _load_index()).registries[this.registry]; + if (Resolver) { + return Resolver; + } else { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('unknownRegistryResolver', this.registry)); + } + } + + normalizeRange(pattern) { + var _this2 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (pattern.indexOf(':') > -1 || pattern.indexOf('@') > -1 || (0, (_index || _load_index()).getExoticResolver)(pattern)) { + return pattern; + } + + if (!(_semver || _load_semver()).default.validRange(pattern)) { + try { + if (yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(_this2.config.cwd, pattern, (_constants || _load_constants()).NODE_PACKAGE_JSON))) { + _this2.reporter.warn(_this2.reporter.lang('implicitFileDeprecated', pattern)); + return `file:${pattern}`; + } + } catch (err) { + // pass + } + } + + return pattern; + })(); + } + + normalize(pattern) { + var _this3 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _normalizePattern = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern); + + const name = _normalizePattern.name, + range = _normalizePattern.range, + hasVersion = _normalizePattern.hasVersion; + + const newRange = yield _this3.normalizeRange(range); + return { name, range: newRange, hasVersion }; + })(); + } + + /** + * Construct an exotic resolver instance with the input `ExoticResolver` and `range`. + */ + + findExoticVersionInfo(ExoticResolver, range) { + const resolver = new ExoticResolver(this, range); + return resolver.resolve(); + } + + /** + * If the current pattern matches an exotic resolver then delegate to it or else try + * the registry. + */ + + findVersionInfo() { + var _this4 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const exoticResolver = (0, (_index || _load_index()).getExoticResolver)(_this4.pattern); + if (exoticResolver) { + return _this4.findExoticVersionInfo(exoticResolver, _this4.pattern); + } else if ((_workspaceResolver || _load_workspaceResolver()).default.isWorkspace(_this4.pattern, _this4.resolver.workspaceLayout)) { + (0, (_invariant || _load_invariant()).default)(_this4.resolver.workspaceLayout, 'expected workspaceLayout'); + const resolver = new (_workspaceResolver || _load_workspaceResolver()).default(_this4, _this4.pattern, _this4.resolver.workspaceLayout); + let manifest; + if (_this4.config.focus && !_this4.pattern.includes(_this4.resolver.workspaceLayout.virtualManifestName) && !_this4.pattern.startsWith(_this4.config.focusedWorkspaceName + '@')) { + const localInfo = _this4.resolver.workspaceLayout.getManifestByPattern(_this4.pattern); + (0, (_invariant || _load_invariant()).default)(localInfo, 'expected local info for ' + _this4.pattern); + const localManifest = localInfo.manifest; + const requestPattern = localManifest.name + '@' + localManifest.version; + manifest = yield _this4.findVersionOnRegistry(requestPattern); + } + return resolver.resolve(manifest); + } else { + return _this4.findVersionOnRegistry(_this4.pattern); + } + })(); + } + + reportResolvedRangeMatch(info, resolved) {} + + /** + * Do the final resolve of a package that had a match with an existing version. + * After all unique versions have been discovered, so the best available version + * is found. + */ + resolveToExistingVersion(info) { + // get final resolved version + var _normalizePattern2 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(this.pattern); + + const range = _normalizePattern2.range, + name = _normalizePattern2.name; + + const solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; + const resolved = this.resolver.getHighestRangeVersionMatch(name, solvedRange, info); + (0, (_invariant || _load_invariant()).default)(resolved, 'should have a resolved reference'); + + this.reportResolvedRangeMatch(info, resolved); + const ref = resolved._reference; + (0, (_invariant || _load_invariant()).default)(ref, 'Resolved package info has no package reference'); + ref.addRequest(this); + ref.addPattern(this.pattern, resolved); + ref.addOptional(this.optional); + } + + /** + * TODO description + */ + find({ fresh, frozen }) { + var _this5 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // find version info for this package pattern + const info = yield _this5.findVersionInfo(); + + if (!(_semver || _load_semver()).default.valid(info.version)) { + throw new (_errors || _load_errors()).MessageError(_this5.reporter.lang('invalidPackageVersion', info.name, info.version)); + } + + info.fresh = fresh; + (0, (_validate || _load_validate()).cleanDependencies)(info, false, _this5.reporter, function () { + // swallow warnings + }); + + // check if while we were resolving this dep we've already resolved one that satisfies + // the same range + + var _normalizePattern3 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(_this5.pattern); + + const range = _normalizePattern3.range, + name = _normalizePattern3.name; + + const solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; + const resolved = !info.fresh || frozen ? _this5.resolver.getExactVersionMatch(name, solvedRange, info) : _this5.resolver.getHighestRangeVersionMatch(name, solvedRange, info); + + if (resolved) { + _this5.resolver.reportPackageWithExistingVersion(_this5, info); + return; + } + + if (info.flat && !_this5.resolver.flat) { + throw new (_errors || _load_errors()).MessageError(_this5.reporter.lang('flatGlobalError', `${info.name}@${info.version}`)); + } + + // validate version info + PackageRequest.validateVersionInfo(info, _this5.reporter); + + // + const remote = info._remote; + (0, (_invariant || _load_invariant()).default)(remote, 'Missing remote'); + + // set package reference + const ref = new (_packageReference || _load_packageReference()).default(_this5, info, remote); + ref.addPattern(_this5.pattern, info); + ref.addOptional(_this5.optional); + ref.setFresh(fresh); + info._reference = ref; + info._remote = remote; + // start installation of dependencies + const promises = []; + const deps = []; + const parentNames = [..._this5.parentNames, name]; + // normal deps + for (const depName in info.dependencies) { + const depPattern = depName + '@' + info.dependencies[depName]; + deps.push(depPattern); + promises.push(_this5.resolver.find({ + pattern: depPattern, + registry: remote.registry, + // dependencies of optional dependencies should themselves be optional + optional: _this5.optional, + parentRequest: _this5, + parentNames + })); + } + + // optional deps + for (const depName in info.optionalDependencies) { + const depPattern = depName + '@' + info.optionalDependencies[depName]; + deps.push(depPattern); + promises.push(_this5.resolver.find({ + hint: 'optional', + pattern: depPattern, + registry: remote.registry, + optional: true, + parentRequest: _this5, + parentNames + })); + } + if (remote.type === 'workspace' && !_this5.config.production) { + // workspaces support dev dependencies + for (const depName in info.devDependencies) { + const depPattern = depName + '@' + info.devDependencies[depName]; + deps.push(depPattern); + promises.push(_this5.resolver.find({ + hint: 'dev', + pattern: depPattern, + registry: remote.registry, + optional: false, + parentRequest: _this5, + parentNames + })); + } + } + + for (var _iterator = promises, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + const promise = _ref2; + + yield promise; + } + + ref.addDependencies(deps); + + // Now that we have all dependencies, it's safe to propagate optional + for (var _iterator2 = ref.requests.slice(1), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + const otherRequest = _ref3; + + ref.addOptional(otherRequest.optional); + } + })(); + } + + /** + * TODO description + */ + + static validateVersionInfo(info, reporter) { + // human readable name to use in errors + const human = `${info.name}@${info.version}`; + + info.version = PackageRequest.getPackageVersion(info); + + for (var _iterator3 = (_constants || _load_constants()).REQUIRED_PACKAGE_KEYS, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + const key = _ref4; + + if (!info[key]) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('missingRequiredPackageKey', human, key)); + } + } + } + + /** + * Returns the package version if present, else defaults to the uid + */ + + static getPackageVersion(info) { + // TODO possibly reconsider this behaviour + return info.version === undefined ? info._uid : info.version; + } + + /** + * Gets all of the outdated packages and sorts them appropriately + */ + + static getOutdatedPackages(lockfile, install, config, reporter, filterByPatterns, flags) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _ref5 = yield install.fetchRequestFromCwd(); + + const reqPatterns = _ref5.requests, + workspaceLayout = _ref5.workspaceLayout; + + // Filter out workspace patterns if necessary + + let depReqPatterns = workspaceLayout ? reqPatterns.filter(function (p) { + return !workspaceLayout.getManifestByPattern(p.pattern); + }) : reqPatterns; + + // filter the list down to just the packages requested. + // prevents us from having to query the metadata for all packages. + if (filterByPatterns && filterByPatterns.length || flags && flags.pattern) { + const filterByNames = filterByPatterns && filterByPatterns.length ? filterByPatterns.map(function (pattern) { + return (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern).name; + }) : []; + depReqPatterns = depReqPatterns.filter(function (dep) { + return filterByNames.indexOf((0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(dep.pattern).name) >= 0 || flags && flags.pattern && micromatch.contains((0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(dep.pattern).name, flags.pattern); + }); + } + + const deps = yield Promise.all(depReqPatterns.map((() => { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ({ pattern, hint, workspaceName, workspaceLoc }) { + const locked = lockfile.getLocked(pattern); + if (!locked) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('lockfileOutdated')); + } + + const name = locked.name, + current = locked.version; + + let latest = ''; + let wanted = ''; + let url = ''; + + const normalized = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern); + + if ((0, (_index || _load_index()).getExoticResolver)(pattern) || (0, (_index || _load_index()).getExoticResolver)(normalized.range)) { + latest = wanted = 'exotic'; + url = normalized.range; + } else { + const registry = config.registries[locked.registry]; + + var _ref7 = yield registry.checkOutdated(config, name, normalized.range); + + latest = _ref7.latest; + wanted = _ref7.wanted; + url = _ref7.url; + } + + return { + name, + current, + wanted, + latest, + url, + hint, + range: normalized.range, + upgradeTo: '', + workspaceName: workspaceName || '', + workspaceLoc: workspaceLoc || '' + }; + }); + + return function (_x) { + return _ref6.apply(this, arguments); + }; + })())); + + // Make sure to always output `exotic` versions to be compatible with npm + const isDepOld = function isDepOld({ current, latest, wanted }) { + return latest === 'exotic' || (_semver || _load_semver()).default.lt(current, wanted) || (_semver || _load_semver()).default.lt(current, latest); + }; + const orderByName = function orderByName(depA, depB) { + return depA.name.localeCompare(depB.name); + }; + return deps.filter(isDepOld).sort(orderByName); + })(); + } +} +exports.default = PackageRequest; + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +class BaseResolver { + constructor(request, fragment) { + this.resolver = request.resolver; + this.reporter = request.reporter; + this.fragment = fragment; + this.registry = request.registry; + this.request = request; + this.pattern = request.pattern; + this.config = request.config; + } + + fork(Resolver, resolveArg, ...args) { + const resolver = new Resolver(this.request, ...args); + resolver.registry = this.registry; + return resolver.resolve(resolveArg); + } + + resolve(resolveArg) { + throw new Error('Not implemented'); + } +} +exports.default = BaseResolver; + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _index; + +function _load_index() { + return _index = __webpack_require__(78); +} + +var _misc; + +function _load_misc() { + return _misc = _interopRequireWildcard(__webpack_require__(18)); +} + +var _version; + +function _load_version() { + return _version = _interopRequireWildcard(__webpack_require__(226)); +} + +var _guessName; + +function _load_guessName() { + return _guessName = _interopRequireDefault(__webpack_require__(169)); +} + +var _index2; + +function _load_index2() { + return _index2 = __webpack_require__(57); +} + +var _exoticResolver; + +function _load_exoticResolver() { + return _exoticResolver = _interopRequireDefault(__webpack_require__(89)); +} + +var _git; + +function _load_git() { + return _git = _interopRequireDefault(__webpack_require__(219)); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const urlParse = __webpack_require__(24).parse; + +const GIT_HOSTS = ['github.com', 'gitlab.com', 'bitbucket.com', 'bitbucket.org']; + +const GIT_PATTERN_MATCHERS = [/^git:/, /^git\+.+:/, /^ssh:/, /^https?:.+\.git$/, /^https?:.+\.git#.+/]; + +class GitResolver extends (_exoticResolver || _load_exoticResolver()).default { + constructor(request, fragment) { + super(request, fragment); + + var _versionUtil$explodeH = (_version || _load_version()).explodeHashedUrl(fragment); + + const url = _versionUtil$explodeH.url, + hash = _versionUtil$explodeH.hash; + + this.url = url; + this.hash = hash; + } + + static isVersion(pattern) { + for (var _iterator = GIT_PATTERN_MATCHERS, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const matcher = _ref; + + if (matcher.test(pattern)) { + return true; + } + } + + var _urlParse = urlParse(pattern); + + const hostname = _urlParse.hostname, + path = _urlParse.path; + + if (hostname && path && GIT_HOSTS.indexOf(hostname) >= 0) { + // only if dependency is pointing to a git repo, + // e.g. facebook/flow and not file in a git repo facebook/flow/archive/v1.0.0.tar.gz + return path.split('/').filter(p => !!p).length === 2; + } + + return false; + } + + resolve(forked) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + let tryRegistry = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) { + const filename = (_index2 || _load_index2()).registries[registry].filename; + + const file = yield client.getFile(filename); + if (!file) { + return null; + } + + const json = yield config.readJson(`${url}/${filename}`, function () { + return JSON.parse(file); + }); + json._uid = commit; + json._remote = { + resolved: `${url}#${commit}`, + type: 'git', + reference: url, + hash: commit, + registry + }; + return json; + }); + + return function tryRegistry(_x) { + return _ref2.apply(this, arguments); + }; + })(); + + const url = _this.url; + + // shortcut for hosted git. we will fallback to a GitResolver if the hosted git + // optimisations fail which the `forked` flag indicates so we don't get into an + // infinite loop + + const parts = urlParse(url); + if (false) { + // check if this git url uses any of the hostnames defined in our hosted git resolvers + for (const name in (_index || _load_index()).hostedGit) { + const Resolver = (_index || _load_index()).hostedGit[name]; + if (Resolver.hostname !== parts.hostname) { + continue; + } + + // we have a match! clean up the pathname of url artifacts + let pathname = parts.pathname; + pathname = (_misc || _load_misc()).removePrefix(pathname, '/'); // remove prefixed slash + pathname = (_misc || _load_misc()).removeSuffix(pathname, '.git'); // remove .git suffix if present + + const url = `${pathname}${_this.hash ? '#' + decodeURIComponent(_this.hash) : ''}`; + return _this.fork(Resolver, false, url); + } + } + + // get from lockfile + const shrunk = _this.request.getLocked('git'); + if (shrunk) { + return shrunk; + } + + const config = _this.config; + + + const gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url); + const client = new (_git || _load_git()).default(config, gitUrl, _this.hash); + const commit = yield client.init(); + + const file = yield tryRegistry(_this.registry); + if (file) { + return file; + } + + for (const registry in (_index2 || _load_index2()).registries) { + if (registry === _this.registry) { + continue; + } + + const file = yield tryRegistry(registry); + if (file) { + return file; + } + } + + return { + // This is just the default, it can be overridden with key of dependencies + name: (0, (_guessName || _load_guessName()).default)(url), + version: '0.0.0', + _uid: commit, + _remote: { + resolved: `${url}#${commit}`, + type: 'git', + reference: url, + hash: commit, + registry: 'npm' + } + }; + })(); + } +} +exports.default = GitResolver; + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isValidPackageName = isValidPackageName; + +exports.default = function (info, isRoot, reporter, warn) { + if (isRoot) { + for (const key in (_typos || _load_typos()).default) { + if (key in info) { + warn(reporter.lang('manifestPotentialTypo', key, (_typos || _load_typos()).default[key])); + } + } + } + + // validate name + const name = info.name; + + if (typeof name === 'string') { + if (isRoot && isBuiltinModule(name)) { + warn(reporter.lang('manifestBuiltinModule', name)); + } + + // cannot start with a dot + if (name[0] === '.') { + throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameDot')); + } + + // cannot contain the following characters + if (!isValidPackageName(name)) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameIllegalChars')); + } + + // cannot equal node_modules or favicon.ico + const lower = name.toLowerCase(); + if (lower === 'node_modules' || lower === 'favicon.ico') { + throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameBlacklisted')); + } + } + + // validate license + if (isRoot && !info.private) { + if (typeof info.license === 'string') { + const license = info.license.replace(/\*$/g, ''); + if (!(0, (_util || _load_util()).isValidLicense)(license)) { + warn(reporter.lang('manifestLicenseInvalid')); + } + } else { + warn(reporter.lang('manifestLicenseNone')); + } + } + + // validate strings + for (var _iterator = strings, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const key = _ref; + + const val = info[key]; + if (val && typeof val !== 'string') { + throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestStringExpected', key)); + } + } + + cleanDependencies(info, isRoot, reporter, warn); +}; + +exports.cleanDependencies = cleanDependencies; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _util; + +function _load_util() { + return _util = __webpack_require__(221); +} + +var _typos; + +function _load_typos() { + return _typos = _interopRequireDefault(__webpack_require__(587)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const isBuiltinModule = __webpack_require__(730); + +const strings = ['name', 'version']; + +const dependencyKeys = [ +// npm registry will include optionalDependencies in dependencies and we'll want to dedupe them from the +// other fields first +'optionalDependencies', + +// it's seemingly common to include a dependency in dependencies and devDependencies of the same name but +// different ranges, this can cause a lot of issues with our determinism and the behaviour of npm is +// currently unspecified. +'dependencies', 'devDependencies']; + +function isValidName(name) { + return !name.match(/[\/@\s\+%:]/) && encodeURIComponent(name) === name; +} + +function isValidScopedName(name) { + if (name[0] !== '@') { + return false; + } + + const parts = name.slice(1).split('/'); + return parts.length === 2 && isValidName(parts[0]) && isValidName(parts[1]); +} + +function isValidPackageName(name) { + return isValidName(name) || isValidScopedName(name); +} + +function cleanDependencies(info, isRoot, reporter, warn) { + // get dependency objects + const depTypes = []; + for (var _iterator2 = dependencyKeys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + const type = _ref2; + + const deps = info[type]; + if (!deps || typeof deps !== 'object') { + continue; + } + depTypes.push([type, deps]); + } + + // aggregate all non-trivial deps (not '' or '*') + const nonTrivialDeps = new Map(); + for (var _iterator3 = depTypes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + const _ref3 = _ref4; + const type = _ref3[0]; + const deps = _ref3[1]; + + for (var _iterator5 = Object.keys(deps), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref7; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref7 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref7 = _i5.value; + } + + const name = _ref7; + + const version = deps[name]; + if (!nonTrivialDeps.has(name) && version && version !== '*') { + nonTrivialDeps.set(name, { type, version }); + } + } + } + + // overwrite first dep of package with non-trivial version, remove the rest + const setDeps = new Set(); + for (var _iterator4 = depTypes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref6; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref6 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref6 = _i4.value; + } + + const _ref5 = _ref6; + const type = _ref5[0]; + const deps = _ref5[1]; + + for (var _iterator6 = Object.keys(deps), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref8; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref8 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref8 = _i6.value; + } + + const name = _ref8; + + let version = deps[name]; + + const dep = nonTrivialDeps.get(name); + if (dep) { + if (version && version !== '*' && version !== dep.version && isRoot) { + // only throw a warning when at the root + warn(reporter.lang('manifestDependencyCollision', dep.type, name, dep.version, type, version)); + } + version = dep.version; + } + + if (setDeps.has(name)) { + delete deps[name]; + } else { + deps[name] = version; + setDeps.add(name); + } + } + } +} + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = __webpack_require__(69); +var TAG = __webpack_require__(20)('toStringTag'); +// ES3 wrong here +var ARG = cof(function () { return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function (it, key) { + try { + return it[key]; + } catch (e) { /* empty */ } +}; + +module.exports = function (it) { + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; + + +/***/ }), +/* 127 */ /***/ (function(module, exports) { -module.exports = require("child_process"); +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +var document = __webpack_require__(17).document; +module.exports = document && document.documentElement; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(93); +var $export = __webpack_require__(60); +var redefine = __webpack_require__(251); +var hide = __webpack_require__(42); +var Iterators = __webpack_require__(53); +var $iterCreate = __webpack_require__(242); +var setToStringTag = __webpack_require__(95); +var getPrototypeOf = __webpack_require__(248); +var ITERATOR = __webpack_require__(20)('iterator'); +var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` +var FF_ITERATOR = '@@iterator'; +var KEYS = 'keys'; +var VALUES = 'values'; + +var returnThis = function () { return this; }; + +module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + $iterCreate(Constructor, NAME, next); + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + switch (kind) { + case KEYS: return function keys() { return new Constructor(this, kind); }; + case VALUES: return function values() { return new Constructor(this, kind); }; + } return function entries() { return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = $native || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; + // Fix native + if ($anyNative) { + IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + $default = function values() { return $native.call(this); }; + } + // Define iterator + if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if (FORCED) for (key in methods) { + if (!(key in proto)) redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; + + +/***/ }), +/* 130 */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } +}; + + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(35); +var isObject = __webpack_require__(52); +var newPromiseCapability = __webpack_require__(94); + +module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; + + +/***/ }), +/* 132 */ +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + +var core = __webpack_require__(31); +var global = __webpack_require__(17); +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || (global[SHARED] = {}); + +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: core.version, + mode: __webpack_require__(93) ? 'pure' : 'global', + copyright: 'Š 2018 Denis Pushkarev (zloirock.ru)' +}); + + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = __webpack_require__(35); +var aFunction = __webpack_require__(68); +var SPECIES = __webpack_require__(20)('species'); +module.exports = function (O, D) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; + + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(70); +var invoke = __webpack_require__(239); +var html = __webpack_require__(128); +var cel = __webpack_require__(92); +var global = __webpack_require__(17); +var process = global.process; +var setTask = global.setImmediate; +var clearTask = global.clearImmediate; +var MessageChannel = global.MessageChannel; +var Dispatch = global.Dispatch; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var defer, channel, port; +var run = function () { + var id = +this; + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function (event) { + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!setTask || !clearTask) { + setTask = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (__webpack_require__(69)(process) == 'process') { + defer = function (id) { + process.nextTick(ctx(run, id, 1)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { + defer = function (id) { + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in cel('script')) { + defer = function (id) { + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.15 ToLength +var toInteger = __webpack_require__(97); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + + +/***/ }), +/* 137 */ +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + + +/***/ }), +/* 138 */ +/***/ (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__(301); + +/** + * Active `debug` instances. + */ +exports.instances = []; + +/** + * 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 = {}; + +/** + * 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) { + + var prevTime; + + 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); + debug.destroy = destroy; + + // env-specific initialization logic for debug instances + if ('function' === typeof exports.init) { + exports.init(debug); + } + + exports.instances.push(debug); + + return debug; +} + +function destroy () { + var index = exports.instances.indexOf(this); + if (index !== -1) { + exports.instances.splice(index, 1); + return true; + } else { + return false; + } +} + +/** + * 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 i; + var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + var len = split.length; + + for (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 + '$')); + } + } + + for (i = 0; i < exports.instances.length; i++) { + var instance = exports.instances[i]; + instance.enabled = exports.enabled(instance.namespace); + } +} + +/** + * 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) { + if (name[name.length - 1] === '*') { + return true; + } + 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; +} + + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +// Basic Javascript Elliptic Curve implementation +// Ported loosely from BouncyCastle's Java EC code +// Only Fp curves implemented for now + +// Requires jsbn.js and jsbn2.js +var BigInteger = __webpack_require__(81).BigInteger +var Barrett = BigInteger.prototype.Barrett + +// ---------------- +// ECFieldElementFp + +// constructor +function ECFieldElementFp(q,x) { + this.x = x; + // TODO if(x.compareTo(q) >= 0) error + this.q = q; +} + +function feFpEquals(other) { + if(other == this) return true; + return (this.q.equals(other.q) && this.x.equals(other.x)); +} + +function feFpToBigInteger() { + return this.x; +} + +function feFpNegate() { + return new ECFieldElementFp(this.q, this.x.negate().mod(this.q)); +} + +function feFpAdd(b) { + return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q)); +} + +function feFpSubtract(b) { + return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q)); +} + +function feFpMultiply(b) { + return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q)); +} + +function feFpSquare() { + return new ECFieldElementFp(this.q, this.x.square().mod(this.q)); +} + +function feFpDivide(b) { + return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q)); +} + +ECFieldElementFp.prototype.equals = feFpEquals; +ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger; +ECFieldElementFp.prototype.negate = feFpNegate; +ECFieldElementFp.prototype.add = feFpAdd; +ECFieldElementFp.prototype.subtract = feFpSubtract; +ECFieldElementFp.prototype.multiply = feFpMultiply; +ECFieldElementFp.prototype.square = feFpSquare; +ECFieldElementFp.prototype.divide = feFpDivide; + +// ---------------- +// ECPointFp + +// constructor +function ECPointFp(curve,x,y,z) { + this.curve = curve; + this.x = x; + this.y = y; + // Projective coordinates: either zinv == null or z * zinv == 1 + // z and zinv are just BigIntegers, not fieldElements + if(z == null) { + this.z = BigInteger.ONE; + } + else { + this.z = z; + } + this.zinv = null; + //TODO: compression flag +} + +function pointFpGetX() { + if(this.zinv == null) { + this.zinv = this.z.modInverse(this.curve.q); + } + var r = this.x.toBigInteger().multiply(this.zinv); + this.curve.reduce(r); + return this.curve.fromBigInteger(r); +} + +function pointFpGetY() { + if(this.zinv == null) { + this.zinv = this.z.modInverse(this.curve.q); + } + var r = this.y.toBigInteger().multiply(this.zinv); + this.curve.reduce(r); + return this.curve.fromBigInteger(r); +} + +function pointFpEquals(other) { + if(other == this) return true; + if(this.isInfinity()) return other.isInfinity(); + if(other.isInfinity()) return this.isInfinity(); + var u, v; + // u = Y2 * Z1 - Y1 * Z2 + u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q); + if(!u.equals(BigInteger.ZERO)) return false; + // v = X2 * Z1 - X1 * Z2 + v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q); + return v.equals(BigInteger.ZERO); +} + +function pointFpIsInfinity() { + if((this.x == null) && (this.y == null)) return true; + return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO); +} + +function pointFpNegate() { + return new ECPointFp(this.curve, this.x, this.y.negate(), this.z); +} + +function pointFpAdd(b) { + if(this.isInfinity()) return b; + if(b.isInfinity()) return this; + + // u = Y2 * Z1 - Y1 * Z2 + var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q); + // v = X2 * Z1 - X1 * Z2 + var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q); + + if(BigInteger.ZERO.equals(v)) { + if(BigInteger.ZERO.equals(u)) { + return this.twice(); // this == b, so double + } + return this.curve.getInfinity(); // this = -b, so infinity + } + + var THREE = new BigInteger("3"); + var x1 = this.x.toBigInteger(); + var y1 = this.y.toBigInteger(); + var x2 = b.x.toBigInteger(); + var y2 = b.y.toBigInteger(); + + var v2 = v.square(); + var v3 = v2.multiply(v); + var x1v2 = x1.multiply(v2); + var zu2 = u.square().multiply(this.z); + + // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3) + var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q); + // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3 + var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q); + // z3 = v^3 * z1 * z2 + var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q); + + return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); +} + +function pointFpTwice() { + if(this.isInfinity()) return this; + if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity(); + + // TODO: optimized handling of constants + var THREE = new BigInteger("3"); + var x1 = this.x.toBigInteger(); + var y1 = this.y.toBigInteger(); + + var y1z1 = y1.multiply(this.z); + var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q); + var a = this.curve.a.toBigInteger(); + + // w = 3 * x1^2 + a * z1^2 + var w = x1.square().multiply(THREE); + if(!BigInteger.ZERO.equals(a)) { + w = w.add(this.z.square().multiply(a)); + } + w = w.mod(this.curve.q); + //this.curve.reduce(w); + // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1) + var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q); + // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3 + var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q); + // z3 = 8 * (y1 * z1)^3 + var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q); + + return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); +} + +// Simple NAF (Non-Adjacent Form) multiplication algorithm +// TODO: modularize the multiplication algorithm +function pointFpMultiply(k) { + if(this.isInfinity()) return this; + if(k.signum() == 0) return this.curve.getInfinity(); + + var e = k; + var h = e.multiply(new BigInteger("3")); + + var neg = this.negate(); + var R = this; + + var i; + for(i = h.bitLength() - 2; i > 0; --i) { + R = R.twice(); + + var hBit = h.testBit(i); + var eBit = e.testBit(i); + + if (hBit != eBit) { + R = R.add(hBit ? this : neg); + } + } + + return R; +} + +// Compute this*j + x*k (simultaneous multiplication) +function pointFpMultiplyTwo(j,x,k) { + var i; + if(j.bitLength() > k.bitLength()) + i = j.bitLength() - 1; + else + i = k.bitLength() - 1; + + var R = this.curve.getInfinity(); + var both = this.add(x); + while(i >= 0) { + R = R.twice(); + if(j.testBit(i)) { + if(k.testBit(i)) { + R = R.add(both); + } + else { + R = R.add(this); + } + } + else { + if(k.testBit(i)) { + R = R.add(x); + } + } + --i; + } + + return R; +} + +ECPointFp.prototype.getX = pointFpGetX; +ECPointFp.prototype.getY = pointFpGetY; +ECPointFp.prototype.equals = pointFpEquals; +ECPointFp.prototype.isInfinity = pointFpIsInfinity; +ECPointFp.prototype.negate = pointFpNegate; +ECPointFp.prototype.add = pointFpAdd; +ECPointFp.prototype.twice = pointFpTwice; +ECPointFp.prototype.multiply = pointFpMultiply; +ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo; + +// ---------------- +// ECCurveFp + +// constructor +function ECCurveFp(q,a,b) { + this.q = q; + this.a = this.fromBigInteger(a); + this.b = this.fromBigInteger(b); + this.infinity = new ECPointFp(this, null, null); + this.reducer = new Barrett(this.q); +} + +function curveFpGetQ() { + return this.q; +} + +function curveFpGetA() { + return this.a; +} + +function curveFpGetB() { + return this.b; +} + +function curveFpEquals(other) { + if(other == this) return true; + return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b)); +} + +function curveFpGetInfinity() { + return this.infinity; +} + +function curveFpFromBigInteger(x) { + return new ECFieldElementFp(this.q, x); +} + +function curveReduce(x) { + this.reducer.reduce(x); +} + +// for now, work with hex strings because they're easier in JS +function curveFpDecodePointHex(s) { + switch(parseInt(s.substr(0,2), 16)) { // first byte + case 0: + return this.infinity; + case 2: + case 3: + // point compression not supported yet + return null; + case 4: + case 6: + case 7: + var len = (s.length - 2) / 2; + var xHex = s.substr(2, len); + var yHex = s.substr(len+2, len); + + return new ECPointFp(this, + this.fromBigInteger(new BigInteger(xHex, 16)), + this.fromBigInteger(new BigInteger(yHex, 16))); + + default: // unsupported + return null; + } +} + +function curveFpEncodePointHex(p) { + if (p.isInfinity()) return "00"; + var xHex = p.getX().toBigInteger().toString(16); + var yHex = p.getY().toBigInteger().toString(16); + var oLen = this.getQ().toString(16).length; + if ((oLen % 2) != 0) oLen++; + while (xHex.length < oLen) { + xHex = "0" + xHex; + } + while (yHex.length < oLen) { + yHex = "0" + yHex; + } + return "04" + xHex + yHex; +} + +ECCurveFp.prototype.getQ = curveFpGetQ; +ECCurveFp.prototype.getA = curveFpGetA; +ECCurveFp.prototype.getB = curveFpGetB; +ECCurveFp.prototype.equals = curveFpEquals; +ECCurveFp.prototype.getInfinity = curveFpGetInfinity; +ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger; +ECCurveFp.prototype.reduce = curveReduce; +//ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex; +ECCurveFp.prototype.encodePointHex = curveFpEncodePointHex; + +// from: https://github.com/kaielvin/jsbn-ec-point-compression +ECCurveFp.prototype.decodePointHex = function(s) +{ + var yIsEven; + switch(parseInt(s.substr(0,2), 16)) { // first byte + case 0: + return this.infinity; + case 2: + yIsEven = false; + case 3: + if(yIsEven == undefined) yIsEven = true; + var len = s.length - 2; + var xHex = s.substr(2, len); + var x = this.fromBigInteger(new BigInteger(xHex,16)); + var alpha = x.multiply(x.square().add(this.getA())).add(this.getB()); + var beta = alpha.sqrt(); + + if (beta == null) throw "Invalid point compression"; + + var betaValue = beta.toBigInteger(); + if (betaValue.testBit(0) != yIsEven) + { + // Use the other root + beta = this.fromBigInteger(this.getQ().subtract(betaValue)); + } + return new ECPointFp(this,x,beta); + case 4: + case 6: + case 7: + var len = (s.length - 2) / 2; + var xHex = s.substr(2, len); + var yHex = s.substr(len+2, len); + + return new ECPointFp(this, + this.fromBigInteger(new BigInteger(xHex, 16)), + this.fromBigInteger(new BigInteger(yHex, 16))); + + default: // unsupported + return null; + } +} +ECCurveFp.prototype.encodeCompressedPointHex = function(p) +{ + if (p.isInfinity()) return "00"; + var xHex = p.getX().toBigInteger().toString(16); + var oLen = this.getQ().toString(16).length; + if ((oLen % 2) != 0) oLen++; + while (xHex.length < oLen) + xHex = "0" + xHex; + var yPrefix; + if(p.getY().toBigInteger().isEven()) yPrefix = "02"; + else yPrefix = "03"; + + return yPrefix + xHex; +} + + +ECFieldElementFp.prototype.getR = function() +{ + if(this.r != undefined) return this.r; + + this.r = null; + var bitLength = this.q.bitLength(); + if (bitLength > 128) + { + var firstWord = this.q.shiftRight(bitLength - 64); + if (firstWord.intValue() == -1) + { + this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q); + } + } + return this.r; +} +ECFieldElementFp.prototype.modMult = function(x1,x2) +{ + return this.modReduce(x1.multiply(x2)); +} +ECFieldElementFp.prototype.modReduce = function(x) +{ + if (this.getR() != null) + { + var qLen = q.bitLength(); + while (x.bitLength() > (qLen + 1)) + { + var u = x.shiftRight(qLen); + var v = x.subtract(u.shiftLeft(qLen)); + if (!this.getR().equals(BigInteger.ONE)) + { + u = u.multiply(this.getR()); + } + x = u.add(v); + } + while (x.compareTo(q) >= 0) + { + x = x.subtract(q); + } + } + else + { + x = x.mod(q); + } + return x; +} +ECFieldElementFp.prototype.sqrt = function() +{ + if (!this.q.testBit(0)) throw "unsupported"; + + // p mod 4 == 3 + if (this.q.testBit(1)) + { + var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q)); + return z.square().equals(this) ? z : null; + } + + // p mod 4 == 1 + var qMinusOne = this.q.subtract(BigInteger.ONE); + + var legendreExponent = qMinusOne.shiftRight(1); + if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE))) + { + return null; + } + + var u = qMinusOne.shiftRight(2); + var k = u.shiftLeft(1).add(BigInteger.ONE); + + var Q = this.x; + var fourQ = modDouble(modDouble(Q)); + + var U, V; + do + { + var P; + do + { + P = new BigInteger(this.q.bitLength(), new SecureRandom()); + } + while (P.compareTo(this.q) >= 0 + || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne))); + + var result = this.lucasSequence(P, Q, k); + U = result[0]; + V = result[1]; + + if (this.modMult(V, V).equals(fourQ)) + { + // Integer division by 2, mod q + if (V.testBit(0)) + { + V = V.add(q); + } + + V = V.shiftRight(1); + + return new ECFieldElementFp(q,V); + } + } + while (U.equals(BigInteger.ONE) || U.equals(qMinusOne)); + + return null; +} +ECFieldElementFp.prototype.lucasSequence = function(P,Q,k) +{ + var n = k.bitLength(); + var s = k.getLowestSetBit(); + + var Uh = BigInteger.ONE; + var Vl = BigInteger.TWO; + var Vh = P; + var Ql = BigInteger.ONE; + var Qh = BigInteger.ONE; + + for (var j = n - 1; j >= s + 1; --j) + { + Ql = this.modMult(Ql, Qh); + + if (k.testBit(j)) + { + Qh = this.modMult(Ql, Q); + Uh = this.modMult(Uh, Vh); + Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); + Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1))); + } + else + { + Qh = Ql; + Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); + Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); + Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); + } + } + + Ql = this.modMult(Ql, Qh); + Qh = this.modMult(Ql, Q); + Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)); + Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))); + Ql = this.modMult(Ql, Qh); + + for (var j = 1; j <= s; ++j) + { + Uh = this.modMult(Uh, Vl); + Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))); + Ql = this.modMult(Ql, Ql); + } + + return [ Uh, Vl ]; +} + +var exports = { + ECCurveFp: ECCurveFp, + ECPointFp: ECPointFp, + ECFieldElementFp: ECFieldElementFp +} + +module.exports = exports + + +/***/ }), +/* 140 */ +/***/ (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__(5) +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync + +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = __webpack_require__(271) + +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 +} + + +/***/ }), +/* 141 */ +/***/ (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__(0) +var minimatch = __webpack_require__(82) +var isAbsolute = __webpack_require__(101) +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)) + }) +} + + +/***/ }), +/* 142 */ +/***/ (function(module, exports) { + + +module.exports = function(det, rec, confidence, name, lang) { + this.confidence = confidence; + this.name = name || rec.name(det); + this.lang = lang; +}; + + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. + + + + + +var Schema = __webpack_require__(44); + + +module.exports = new Schema({ + include: [ + __webpack_require__(144) + ] +}); + + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. + + + + + +var Schema = __webpack_require__(44); + + +module.exports = new Schema({ + include: [ + __webpack_require__(100) + ], + implicit: [ + __webpack_require__(293), + __webpack_require__(285), + __webpack_require__(287), + __webpack_require__(286) + ] +}); + + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +var path = __webpack_require__(0); +var fs = __webpack_require__(5); +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; +}; + + +/***/ }), +/* 146 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = defaultIfEmpty; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=defaultIfEmpty.js.map + + +/***/ }), +/* 147 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = filter; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=filter.js.map + + +/***/ }), +/* 148 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = mergeMap; +/* unused harmony export MergeMapOperator */ +/* unused harmony export MergeMapSubscriber */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_subscribeToResult__ = __webpack_require__(14); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__InnerSubscriber__ = __webpack_require__(84); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map__ = __webpack_require__(47); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__observable_from__ = __webpack_require__(62); +/** PURE_IMPORTS_START tslib,_util_subscribeToResult,_OuterSubscriber,_InnerSubscriber,_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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__observable_from__["a" /* from */])(project(a, i)).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__map__["a" /* 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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) { + var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_3__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined); + var destination = this.destination; + destination.add(innerSubscriber); + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_subscribeToResult__["a" /* subscribeToResult */])(this, ish, value, index, innerSubscriber); + }; + MergeMapSubscriber.prototype._complete = function () { + this.hasCompleted = true; + if (this.active === 0 && this.buffer.length === 0) { + this.destination.complete(); + } + this.unsubscribe(); + }; + 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; +}(__WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__["a" /* OuterSubscriber */])); + +//# sourceMappingURL=mergeMap.js.map + + +/***/ }), +/* 149 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncAction; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Action__ = __webpack_require__(918); +/** PURE_IMPORTS_START tslib,_Action PURE_IMPORTS_END */ + + +var AsyncAction = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; + } + clearInterval(id); + }; + 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; +}(__WEBPACK_IMPORTED_MODULE_1__Action__["a" /* Action */])); + +//# sourceMappingURL=AsyncAction.js.map + + +/***/ }), +/* 150 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncScheduler; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Scheduler__ = __webpack_require__(421); +/** PURE_IMPORTS_START tslib,_Scheduler PURE_IMPORTS_END */ + + +var AsyncScheduler = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsyncScheduler, _super); + function AsyncScheduler(SchedulerAction, now) { + if (now === void 0) { + now = __WEBPACK_IMPORTED_MODULE_1__Scheduler__["a" /* 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; +}(__WEBPACK_IMPORTED_MODULE_1__Scheduler__["a" /* Scheduler */])); + +//# sourceMappingURL=AsyncScheduler.js.map + /***/ }), /* 151 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* unused harmony export getSymbolIterator */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return iterator; }); +/* unused harmony export $$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 + + +/***/ }), +/* 152 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArgumentOutOfRangeError; }); +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +function ArgumentOutOfRangeErrorImpl() { + Error.call(this); + this.message = 'argument out of range'; + this.name = 'ArgumentOutOfRangeError'; + return this; +} +ArgumentOutOfRangeErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype); +var ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl; +//# sourceMappingURL=ArgumentOutOfRangeError.js.map + + +/***/ }), +/* 153 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EmptyError; }); +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +function EmptyErrorImpl() { + Error.call(this); + this.message = 'no elements in sequence'; + this.name = 'EmptyError'; + return this; +} +EmptyErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype); +var EmptyError = EmptyErrorImpl; +//# sourceMappingURL=EmptyError.js.map + + +/***/ }), +/* 154 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = isFunction; +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +function isFunction(x) { + return typeof x === 'function'; +} +//# sourceMappingURL=isFunction.js.map + + +/***/ }), +/* 155 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2016 Joyent, Inc. + +module.exports = Certificate; + +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var crypto = __webpack_require__(11); +var Fingerprint = __webpack_require__(156); +var Signature = __webpack_require__(75); +var errs = __webpack_require__(74); +var util = __webpack_require__(3); +var utils = __webpack_require__(26); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(33); +var Identity = __webpack_require__(158); + +var formats = {}; +formats['openssh'] = __webpack_require__(940); +formats['x509'] = __webpack_require__(457); +formats['pem'] = __webpack_require__(941); + +var CertificateParseError = errs.CertificateParseError; +var InvalidAlgorithmError = errs.InvalidAlgorithmError; + +function Certificate(opts) { + assert.object(opts, 'options'); + assert.arrayOfObject(opts.subjects, 'options.subjects'); + utils.assertCompatible(opts.subjects[0], Identity, [1, 0], + 'options.subjects'); + utils.assertCompatible(opts.subjectKey, Key, [1, 0], + 'options.subjectKey'); + utils.assertCompatible(opts.issuer, Identity, [1, 0], 'options.issuer'); + if (opts.issuerKey !== undefined) { + utils.assertCompatible(opts.issuerKey, Key, [1, 0], + 'options.issuerKey'); + } + assert.object(opts.signatures, 'options.signatures'); + assert.buffer(opts.serial, 'options.serial'); + assert.date(opts.validFrom, 'options.validFrom'); + assert.date(opts.validUntil, 'optons.validUntil'); + + assert.optionalArrayOfString(opts.purposes, 'options.purposes'); + + this._hashCache = {}; + + this.subjects = opts.subjects; + this.issuer = opts.issuer; + this.subjectKey = opts.subjectKey; + this.issuerKey = opts.issuerKey; + this.signatures = opts.signatures; + this.serial = opts.serial; + this.validFrom = opts.validFrom; + this.validUntil = opts.validUntil; + this.purposes = opts.purposes; +} + +Certificate.formats = formats; + +Certificate.prototype.toBuffer = function (format, options) { + if (format === undefined) + format = 'x509'; + assert.string(format, 'format'); + assert.object(formats[format], 'formats[format]'); + assert.optionalObject(options, 'options'); + + return (formats[format].write(this, options)); +}; + +Certificate.prototype.toString = function (format, options) { + if (format === undefined) + format = 'pem'; + return (this.toBuffer(format, options).toString()); +}; + +Certificate.prototype.fingerprint = function (algo) { + if (algo === undefined) + algo = 'sha256'; + assert.string(algo, 'algorithm'); + var opts = { + type: 'certificate', + hash: this.hash(algo), + algorithm: algo + }; + return (new Fingerprint(opts)); +}; + +Certificate.prototype.hash = function (algo) { + assert.string(algo, 'algorithm'); + algo = algo.toLowerCase(); + if (algs.hashAlgs[algo] === undefined) + throw (new InvalidAlgorithmError(algo)); + + if (this._hashCache[algo]) + return (this._hashCache[algo]); + + var hash = crypto.createHash(algo). + update(this.toBuffer('x509')).digest(); + this._hashCache[algo] = hash; + return (hash); +}; + +Certificate.prototype.isExpired = function (when) { + if (when === undefined) + when = new Date(); + return (!((when.getTime() >= this.validFrom.getTime()) && + (when.getTime() < this.validUntil.getTime()))); +}; + +Certificate.prototype.isSignedBy = function (issuerCert) { + utils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer'); + + if (!this.issuer.equals(issuerCert.subjects[0])) + return (false); + if (this.issuer.purposes && this.issuer.purposes.length > 0 && + this.issuer.purposes.indexOf('ca') === -1) { + return (false); + } + + return (this.isSignedByKey(issuerCert.subjectKey)); +}; + +Certificate.prototype.isSignedByKey = function (issuerKey) { + utils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey'); + + if (this.issuerKey !== undefined) { + return (this.issuerKey. + fingerprint('sha512').matches(issuerKey)); + } + + var fmt = Object.keys(this.signatures)[0]; + var valid = formats[fmt].verify(this, issuerKey); + if (valid) + this.issuerKey = issuerKey; + return (valid); +}; + +Certificate.prototype.signWith = function (key) { + utils.assertCompatible(key, PrivateKey, [1, 2], 'key'); + var fmts = Object.keys(formats); + var didOne = false; + for (var i = 0; i < fmts.length; ++i) { + if (fmts[i] !== 'pem') { + var ret = formats[fmts[i]].sign(this, key); + if (ret === true) + didOne = true; + } + } + if (!didOne) { + throw (new Error('Failed to sign the certificate for any ' + + 'available certificate formats')); + } +}; + +Certificate.createSelfSigned = function (subjectOrSubjects, key, options) { + var subjects; + if (Array.isArray(subjectOrSubjects)) + subjects = subjectOrSubjects; + else + subjects = [subjectOrSubjects]; + + assert.arrayOfObject(subjects); + subjects.forEach(function (subject) { + utils.assertCompatible(subject, Identity, [1, 0], 'subject'); + }); + + utils.assertCompatible(key, PrivateKey, [1, 2], 'private key'); + + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalObject(options.validFrom, 'options.validFrom'); + assert.optionalObject(options.validUntil, 'options.validUntil'); + var validFrom = options.validFrom; + var validUntil = options.validUntil; + if (validFrom === undefined) + validFrom = new Date(); + if (validUntil === undefined) { + assert.optionalNumber(options.lifetime, 'options.lifetime'); + var lifetime = options.lifetime; + if (lifetime === undefined) + lifetime = 10*365*24*3600; + validUntil = new Date(); + validUntil.setTime(validUntil.getTime() + lifetime*1000); + } + assert.optionalBuffer(options.serial, 'options.serial'); + var serial = options.serial; + if (serial === undefined) + serial = Buffer.from('0000000000000001', 'hex'); + + var purposes = options.purposes; + if (purposes === undefined) + purposes = []; + + if (purposes.indexOf('signature') === -1) + purposes.push('signature'); + + /* Self-signed certs are always CAs. */ + if (purposes.indexOf('ca') === -1) + purposes.push('ca'); + if (purposes.indexOf('crl') === -1) + purposes.push('crl'); + + /* + * If we weren't explicitly given any other purposes, do the sensible + * thing and add some basic ones depending on the subject type. + */ + if (purposes.length <= 3) { + var hostSubjects = subjects.filter(function (subject) { + return (subject.type === 'host'); + }); + var userSubjects = subjects.filter(function (subject) { + return (subject.type === 'user'); + }); + if (hostSubjects.length > 0) { + if (purposes.indexOf('serverAuth') === -1) + purposes.push('serverAuth'); + } + if (userSubjects.length > 0) { + if (purposes.indexOf('clientAuth') === -1) + purposes.push('clientAuth'); + } + if (userSubjects.length > 0 || hostSubjects.length > 0) { + if (purposes.indexOf('keyAgreement') === -1) + purposes.push('keyAgreement'); + if (key.type === 'rsa' && + purposes.indexOf('encryption') === -1) + purposes.push('encryption'); + } + } + + var cert = new Certificate({ + subjects: subjects, + issuer: subjects[0], + subjectKey: key.toPublic(), + issuerKey: key.toPublic(), + signatures: {}, + serial: serial, + validFrom: validFrom, + validUntil: validUntil, + purposes: purposes + }); + cert.signWith(key); + + return (cert); +}; + +Certificate.create = + function (subjectOrSubjects, key, issuer, issuerKey, options) { + var subjects; + if (Array.isArray(subjectOrSubjects)) + subjects = subjectOrSubjects; + else + subjects = [subjectOrSubjects]; + + assert.arrayOfObject(subjects); + subjects.forEach(function (subject) { + utils.assertCompatible(subject, Identity, [1, 0], 'subject'); + }); + + utils.assertCompatible(key, Key, [1, 0], 'key'); + if (PrivateKey.isPrivateKey(key)) + key = key.toPublic(); + utils.assertCompatible(issuer, Identity, [1, 0], 'issuer'); + utils.assertCompatible(issuerKey, PrivateKey, [1, 2], 'issuer key'); + + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalObject(options.validFrom, 'options.validFrom'); + assert.optionalObject(options.validUntil, 'options.validUntil'); + var validFrom = options.validFrom; + var validUntil = options.validUntil; + if (validFrom === undefined) + validFrom = new Date(); + if (validUntil === undefined) { + assert.optionalNumber(options.lifetime, 'options.lifetime'); + var lifetime = options.lifetime; + if (lifetime === undefined) + lifetime = 10*365*24*3600; + validUntil = new Date(); + validUntil.setTime(validUntil.getTime() + lifetime*1000); + } + assert.optionalBuffer(options.serial, 'options.serial'); + var serial = options.serial; + if (serial === undefined) + serial = Buffer.from('0000000000000001', 'hex'); + + var purposes = options.purposes; + if (purposes === undefined) + purposes = []; + + if (purposes.indexOf('signature') === -1) + purposes.push('signature'); + + if (options.ca === true) { + if (purposes.indexOf('ca') === -1) + purposes.push('ca'); + if (purposes.indexOf('crl') === -1) + purposes.push('crl'); + } + + var hostSubjects = subjects.filter(function (subject) { + return (subject.type === 'host'); + }); + var userSubjects = subjects.filter(function (subject) { + return (subject.type === 'user'); + }); + if (hostSubjects.length > 0) { + if (purposes.indexOf('serverAuth') === -1) + purposes.push('serverAuth'); + } + if (userSubjects.length > 0) { + if (purposes.indexOf('clientAuth') === -1) + purposes.push('clientAuth'); + } + if (userSubjects.length > 0 || hostSubjects.length > 0) { + if (purposes.indexOf('keyAgreement') === -1) + purposes.push('keyAgreement'); + if (key.type === 'rsa' && + purposes.indexOf('encryption') === -1) + purposes.push('encryption'); + } + + var cert = new Certificate({ + subjects: subjects, + issuer: issuer, + subjectKey: key, + issuerKey: issuerKey.toPublic(), + signatures: {}, + serial: serial, + validFrom: validFrom, + validUntil: validUntil, + purposes: purposes + }); + cert.signWith(issuerKey); + + return (cert); +}; + +Certificate.parse = function (data, format, options) { + if (typeof (data) !== 'string') + assert.buffer(data, 'data'); + if (format === undefined) + format = 'auto'; + assert.string(format, 'format'); + if (typeof (options) === 'string') + options = { filename: options }; + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalString(options.filename, 'options.filename'); + if (options.filename === undefined) + options.filename = '(unnamed)'; + + assert.object(formats[format], 'formats[format]'); + + try { + var k = formats[format].read(data, options); + return (k); + } catch (e) { + throw (new CertificateParseError(options.filename, format, e)); + } +}; + +Certificate.isCertificate = function (obj, ver) { + return (utils.isCompatible(obj, Certificate, ver)); +}; + +/* + * API versions for Certificate: + * [1,0] -- initial ver + */ +Certificate.prototype._sshpkApiVersion = [1, 0]; + +Certificate._oldVersionDetect = function (obj) { + return ([1, 0]); +}; + + +/***/ }), +/* 156 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2015 Joyent, Inc. + +module.exports = Fingerprint; + +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var crypto = __webpack_require__(11); +var errs = __webpack_require__(74); +var Key = __webpack_require__(27); +var Certificate = __webpack_require__(155); +var utils = __webpack_require__(26); + +var FingerprintFormatError = errs.FingerprintFormatError; +var InvalidAlgorithmError = errs.InvalidAlgorithmError; + +function Fingerprint(opts) { + assert.object(opts, 'options'); + assert.string(opts.type, 'options.type'); + assert.buffer(opts.hash, 'options.hash'); + assert.string(opts.algorithm, 'options.algorithm'); + + this.algorithm = opts.algorithm.toLowerCase(); + if (algs.hashAlgs[this.algorithm] !== true) + throw (new InvalidAlgorithmError(this.algorithm)); + + this.hash = opts.hash; + this.type = opts.type; +} + +Fingerprint.prototype.toString = function (format) { + if (format === undefined) { + if (this.algorithm === 'md5') + format = 'hex'; + else + format = 'base64'; + } + assert.string(format); + + switch (format) { + case 'hex': + return (addColons(this.hash.toString('hex'))); + case 'base64': + return (sshBase64Format(this.algorithm, + this.hash.toString('base64'))); + default: + throw (new FingerprintFormatError(undefined, format)); + } +}; + +Fingerprint.prototype.matches = function (other) { + assert.object(other, 'key or certificate'); + if (this.type === 'key') { + utils.assertCompatible(other, Key, [1, 0], 'key'); + } else { + utils.assertCompatible(other, Certificate, [1, 0], + 'certificate'); + } + + var theirHash = other.hash(this.algorithm); + var theirHash2 = crypto.createHash(this.algorithm). + update(theirHash).digest('base64'); + + if (this.hash2 === undefined) + this.hash2 = crypto.createHash(this.algorithm). + update(this.hash).digest('base64'); + + return (this.hash2 === theirHash2); +}; + +Fingerprint.parse = function (fp, options) { + assert.string(fp, 'fingerprint'); + + var alg, hash, enAlgs; + if (Array.isArray(options)) { + enAlgs = options; + options = {}; + } + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + if (options.enAlgs !== undefined) + enAlgs = options.enAlgs; + assert.optionalArrayOfString(enAlgs, 'algorithms'); + + var parts = fp.split(':'); + if (parts.length == 2) { + alg = parts[0].toLowerCase(); + /*JSSTYLED*/ + var base64RE = /^[A-Za-z0-9+\/=]+$/; + if (!base64RE.test(parts[1])) + throw (new FingerprintFormatError(fp)); + try { + hash = Buffer.from(parts[1], 'base64'); + } catch (e) { + throw (new FingerprintFormatError(fp)); + } + } else if (parts.length > 2) { + alg = 'md5'; + if (parts[0].toLowerCase() === 'md5') + parts = parts.slice(1); + parts = parts.join(''); + /*JSSTYLED*/ + var md5RE = /^[a-fA-F0-9]+$/; + if (!md5RE.test(parts)) + throw (new FingerprintFormatError(fp)); + try { + hash = Buffer.from(parts, 'hex'); + } catch (e) { + throw (new FingerprintFormatError(fp)); + } + } + + if (alg === undefined) + throw (new FingerprintFormatError(fp)); + + if (algs.hashAlgs[alg] === undefined) + throw (new InvalidAlgorithmError(alg)); + + if (enAlgs !== undefined) { + enAlgs = enAlgs.map(function (a) { return a.toLowerCase(); }); + if (enAlgs.indexOf(alg) === -1) + throw (new InvalidAlgorithmError(alg)); + } + + return (new Fingerprint({ + algorithm: alg, + hash: hash, + type: options.type || 'key' + })); +}; + +function addColons(s) { + /*JSSTYLED*/ + return (s.replace(/(.{2})(?=.)/g, '$1:')); +} + +function base64Strip(s) { + /*JSSTYLED*/ + return (s.replace(/=*$/, '')); +} + +function sshBase64Format(alg, h) { + return (alg.toUpperCase() + ':' + base64Strip(h)); +} + +Fingerprint.isFingerprint = function (obj, ver) { + return (utils.isCompatible(obj, Fingerprint, ver)); +}; + +/* + * API versions for Fingerprint: + * [1,0] -- initial ver + * [1,1] -- first tagged ver + */ +Fingerprint.prototype._sshpkApiVersion = [1, 1]; + +Fingerprint._oldVersionDetect = function (obj) { + assert.func(obj.toString); + assert.func(obj.matches); + return ([1, 0]); +}; + + +/***/ }), +/* 157 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2015 Joyent, Inc. + +module.exports = { + read: read, + readPkcs8: readPkcs8, + write: write, + writePkcs8: writePkcs8, + + readECDSACurve: readECDSACurve, + writeECDSACurve: writeECDSACurve +}; + +var assert = __webpack_require__(16); +var asn1 = __webpack_require__(66); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var utils = __webpack_require__(26); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(33); +var pem = __webpack_require__(86); + +function read(buf, options) { + return (pem.read(buf, options, 'pkcs8')); +} + +function write(key, options) { + return (pem.write(key, options, 'pkcs8')); +} + +/* Helper to read in a single mpint */ +function readMPInt(der, nm) { + assert.strictEqual(der.peek(), asn1.Ber.Integer, + nm + ' is not an Integer'); + return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); +} + +function readPkcs8(alg, type, der) { + /* Private keys in pkcs#8 format have a weird extra int */ + if (der.peek() === asn1.Ber.Integer) { + assert.strictEqual(type, 'private', + 'unexpected Integer at start of public key'); + der.readString(asn1.Ber.Integer, true); + } + + der.readSequence(); + var next = der.offset + der.length; + + var oid = der.readOID(); + switch (oid) { + case '1.2.840.113549.1.1.1': + der._offset = next; + if (type === 'public') + return (readPkcs8RSAPublic(der)); + else + return (readPkcs8RSAPrivate(der)); + case '1.2.840.10040.4.1': + if (type === 'public') + return (readPkcs8DSAPublic(der)); + else + return (readPkcs8DSAPrivate(der)); + case '1.2.840.10045.2.1': + if (type === 'public') + return (readPkcs8ECDSAPublic(der)); + else + return (readPkcs8ECDSAPrivate(der)); + case '1.3.101.112': + if (type === 'public') { + return (readPkcs8EdDSAPublic(der)); + } else { + return (readPkcs8EdDSAPrivate(der)); + } + case '1.3.101.110': + if (type === 'public') { + return (readPkcs8X25519Public(der)); + } else { + return (readPkcs8X25519Private(der)); + } + default: + throw (new Error('Unknown key type OID ' + oid)); + } +} + +function readPkcs8RSAPublic(der) { + // bit string sequence + der.readSequence(asn1.Ber.BitString); + der.readByte(); + der.readSequence(); + + // modulus + var n = readMPInt(der, 'modulus'); + var e = readMPInt(der, 'exponent'); + + // now, make the key + var key = { + type: 'rsa', + source: der.originalInput, + parts: [ + { name: 'e', data: e }, + { name: 'n', data: n } + ] + }; + + return (new Key(key)); +} + +function readPkcs8RSAPrivate(der) { + der.readSequence(asn1.Ber.OctetString); + der.readSequence(); + + var ver = readMPInt(der, 'version'); + assert.equal(ver[0], 0x0, 'unknown RSA private key version'); + + // modulus then public exponent + var n = readMPInt(der, 'modulus'); + var e = readMPInt(der, 'public exponent'); + var d = readMPInt(der, 'private exponent'); + var p = readMPInt(der, 'prime1'); + var q = readMPInt(der, 'prime2'); + var dmodp = readMPInt(der, 'exponent1'); + var dmodq = readMPInt(der, 'exponent2'); + var iqmp = readMPInt(der, 'iqmp'); + + // now, make the key + var key = { + type: 'rsa', + parts: [ + { name: 'n', data: n }, + { name: 'e', data: e }, + { name: 'd', data: d }, + { name: 'iqmp', data: iqmp }, + { name: 'p', data: p }, + { name: 'q', data: q }, + { name: 'dmodp', data: dmodp }, + { name: 'dmodq', data: dmodq } + ] + }; + + return (new PrivateKey(key)); +} + +function readPkcs8DSAPublic(der) { + der.readSequence(); + + var p = readMPInt(der, 'p'); + var q = readMPInt(der, 'q'); + var g = readMPInt(der, 'g'); + + // bit string sequence + der.readSequence(asn1.Ber.BitString); + der.readByte(); + + var y = readMPInt(der, 'y'); + + // now, make the key + var key = { + type: 'dsa', + parts: [ + { name: 'p', data: p }, + { name: 'q', data: q }, + { name: 'g', data: g }, + { name: 'y', data: y } + ] + }; + + return (new Key(key)); +} + +function readPkcs8DSAPrivate(der) { + der.readSequence(); + + var p = readMPInt(der, 'p'); + var q = readMPInt(der, 'q'); + var g = readMPInt(der, 'g'); + + der.readSequence(asn1.Ber.OctetString); + var x = readMPInt(der, 'x'); + + /* The pkcs#8 format does not include the public key */ + var y = utils.calculateDSAPublic(g, p, x); + + var key = { + type: 'dsa', + parts: [ + { name: 'p', data: p }, + { name: 'q', data: q }, + { name: 'g', data: g }, + { name: 'y', data: y }, + { name: 'x', data: x } + ] + }; + + return (new PrivateKey(key)); +} + +function readECDSACurve(der) { + var curveName, curveNames; + var j, c, cd; + + if (der.peek() === asn1.Ber.OID) { + var oid = der.readOID(); + + curveNames = Object.keys(algs.curves); + for (j = 0; j < curveNames.length; ++j) { + c = curveNames[j]; + cd = algs.curves[c]; + if (cd.pkcs8oid === oid) { + curveName = c; + break; + } + } + + } else { + // ECParameters sequence + der.readSequence(); + var version = der.readString(asn1.Ber.Integer, true); + assert.strictEqual(version[0], 1, 'ECDSA key not version 1'); + + var curve = {}; + + // FieldID sequence + der.readSequence(); + var fieldTypeOid = der.readOID(); + assert.strictEqual(fieldTypeOid, '1.2.840.10045.1.1', + 'ECDSA key is not from a prime-field'); + var p = curve.p = utils.mpNormalize( + der.readString(asn1.Ber.Integer, true)); + /* + * p always starts with a 1 bit, so count the zeros to get its + * real size. + */ + curve.size = p.length * 8 - utils.countZeros(p); + + // Curve sequence + der.readSequence(); + curve.a = utils.mpNormalize( + der.readString(asn1.Ber.OctetString, true)); + curve.b = utils.mpNormalize( + der.readString(asn1.Ber.OctetString, true)); + if (der.peek() === asn1.Ber.BitString) + curve.s = der.readString(asn1.Ber.BitString, true); + + // Combined Gx and Gy + curve.G = der.readString(asn1.Ber.OctetString, true); + assert.strictEqual(curve.G[0], 0x4, + 'uncompressed G is required'); + + curve.n = utils.mpNormalize( + der.readString(asn1.Ber.Integer, true)); + curve.h = utils.mpNormalize( + der.readString(asn1.Ber.Integer, true)); + assert.strictEqual(curve.h[0], 0x1, 'a cofactor=1 curve is ' + + 'required'); + + curveNames = Object.keys(algs.curves); + var ks = Object.keys(curve); + for (j = 0; j < curveNames.length; ++j) { + c = curveNames[j]; + cd = algs.curves[c]; + var equal = true; + for (var i = 0; i < ks.length; ++i) { + var k = ks[i]; + if (cd[k] === undefined) + continue; + if (typeof (cd[k]) === 'object' && + cd[k].equals !== undefined) { + if (!cd[k].equals(curve[k])) { + equal = false; + break; + } + } else if (Buffer.isBuffer(cd[k])) { + if (cd[k].toString('binary') + !== curve[k].toString('binary')) { + equal = false; + break; + } + } else { + if (cd[k] !== curve[k]) { + equal = false; + break; + } + } + } + if (equal) { + curveName = c; + break; + } + } + } + return (curveName); +} + +function readPkcs8ECDSAPrivate(der) { + var curveName = readECDSACurve(der); + assert.string(curveName, 'a known elliptic curve'); + + der.readSequence(asn1.Ber.OctetString); + der.readSequence(); + + var version = readMPInt(der, 'version'); + assert.equal(version[0], 1, 'unknown version of ECDSA key'); + + var d = der.readString(asn1.Ber.OctetString, true); + der.readSequence(0xa1); + + var Q = der.readString(asn1.Ber.BitString, true); + Q = utils.ecNormalize(Q); + + var key = { + type: 'ecdsa', + parts: [ + { name: 'curve', data: Buffer.from(curveName) }, + { name: 'Q', data: Q }, + { name: 'd', data: d } + ] + }; + + return (new PrivateKey(key)); +} + +function readPkcs8ECDSAPublic(der) { + var curveName = readECDSACurve(der); + assert.string(curveName, 'a known elliptic curve'); + + var Q = der.readString(asn1.Ber.BitString, true); + Q = utils.ecNormalize(Q); + + var key = { + type: 'ecdsa', + parts: [ + { name: 'curve', data: Buffer.from(curveName) }, + { name: 'Q', data: Q } + ] + }; + + return (new Key(key)); +} + +function readPkcs8EdDSAPublic(der) { + if (der.peek() === 0x00) + der.readByte(); + + var A = utils.readBitString(der); + + var key = { + type: 'ed25519', + parts: [ + { name: 'A', data: utils.zeroPadToLength(A, 32) } + ] + }; + + return (new Key(key)); +} + +function readPkcs8X25519Public(der) { + var A = utils.readBitString(der); + + var key = { + type: 'curve25519', + parts: [ + { name: 'A', data: utils.zeroPadToLength(A, 32) } + ] + }; + + return (new Key(key)); +} + +function readPkcs8EdDSAPrivate(der) { + if (der.peek() === 0x00) + der.readByte(); + + der.readSequence(asn1.Ber.OctetString); + var k = der.readString(asn1.Ber.OctetString, true); + k = utils.zeroPadToLength(k, 32); + + var A; + if (der.peek() === asn1.Ber.BitString) { + A = utils.readBitString(der); + A = utils.zeroPadToLength(A, 32); + } else { + A = utils.calculateED25519Public(k); + } + + var key = { + type: 'ed25519', + parts: [ + { name: 'A', data: utils.zeroPadToLength(A, 32) }, + { name: 'k', data: utils.zeroPadToLength(k, 32) } + ] + }; + + return (new PrivateKey(key)); +} + +function readPkcs8X25519Private(der) { + if (der.peek() === 0x00) + der.readByte(); + + der.readSequence(asn1.Ber.OctetString); + var k = der.readString(asn1.Ber.OctetString, true); + k = utils.zeroPadToLength(k, 32); + + var A = utils.calculateX25519Public(k); + + var key = { + type: 'curve25519', + parts: [ + { name: 'A', data: utils.zeroPadToLength(A, 32) }, + { name: 'k', data: utils.zeroPadToLength(k, 32) } + ] + }; + + return (new PrivateKey(key)); +} + +function writePkcs8(der, key) { + der.startSequence(); + + if (PrivateKey.isPrivateKey(key)) { + var sillyInt = Buffer.from([0]); + der.writeBuffer(sillyInt, asn1.Ber.Integer); + } + + der.startSequence(); + switch (key.type) { + case 'rsa': + der.writeOID('1.2.840.113549.1.1.1'); + if (PrivateKey.isPrivateKey(key)) + writePkcs8RSAPrivate(key, der); + else + writePkcs8RSAPublic(key, der); + break; + case 'dsa': + der.writeOID('1.2.840.10040.4.1'); + if (PrivateKey.isPrivateKey(key)) + writePkcs8DSAPrivate(key, der); + else + writePkcs8DSAPublic(key, der); + break; + case 'ecdsa': + der.writeOID('1.2.840.10045.2.1'); + if (PrivateKey.isPrivateKey(key)) + writePkcs8ECDSAPrivate(key, der); + else + writePkcs8ECDSAPublic(key, der); + break; + case 'ed25519': + der.writeOID('1.3.101.112'); + if (PrivateKey.isPrivateKey(key)) + throw (new Error('Ed25519 private keys in pkcs8 ' + + 'format are not supported')); + writePkcs8EdDSAPublic(key, der); + break; + default: + throw (new Error('Unsupported key type: ' + key.type)); + } + + der.endSequence(); +} + +function writePkcs8RSAPrivate(key, der) { + der.writeNull(); + der.endSequence(); + + der.startSequence(asn1.Ber.OctetString); + der.startSequence(); + + var version = Buffer.from([0]); + der.writeBuffer(version, asn1.Ber.Integer); + + der.writeBuffer(key.part.n.data, asn1.Ber.Integer); + der.writeBuffer(key.part.e.data, asn1.Ber.Integer); + der.writeBuffer(key.part.d.data, asn1.Ber.Integer); + der.writeBuffer(key.part.p.data, asn1.Ber.Integer); + der.writeBuffer(key.part.q.data, asn1.Ber.Integer); + if (!key.part.dmodp || !key.part.dmodq) + utils.addRSAMissing(key); + der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer); + der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer); + der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer); + + der.endSequence(); + der.endSequence(); +} + +function writePkcs8RSAPublic(key, der) { + der.writeNull(); + der.endSequence(); + + der.startSequence(asn1.Ber.BitString); + der.writeByte(0x00); + + der.startSequence(); + der.writeBuffer(key.part.n.data, asn1.Ber.Integer); + der.writeBuffer(key.part.e.data, asn1.Ber.Integer); + der.endSequence(); + + der.endSequence(); +} + +function writePkcs8DSAPrivate(key, der) { + der.startSequence(); + der.writeBuffer(key.part.p.data, asn1.Ber.Integer); + der.writeBuffer(key.part.q.data, asn1.Ber.Integer); + der.writeBuffer(key.part.g.data, asn1.Ber.Integer); + der.endSequence(); + + der.endSequence(); + + der.startSequence(asn1.Ber.OctetString); + der.writeBuffer(key.part.x.data, asn1.Ber.Integer); + der.endSequence(); +} + +function writePkcs8DSAPublic(key, der) { + der.startSequence(); + der.writeBuffer(key.part.p.data, asn1.Ber.Integer); + der.writeBuffer(key.part.q.data, asn1.Ber.Integer); + der.writeBuffer(key.part.g.data, asn1.Ber.Integer); + der.endSequence(); + der.endSequence(); + + der.startSequence(asn1.Ber.BitString); + der.writeByte(0x00); + der.writeBuffer(key.part.y.data, asn1.Ber.Integer); + der.endSequence(); +} + +function writeECDSACurve(key, der) { + var curve = algs.curves[key.curve]; + if (curve.pkcs8oid) { + /* This one has a name in pkcs#8, so just write the oid */ + der.writeOID(curve.pkcs8oid); + + } else { + // ECParameters sequence + der.startSequence(); + + var version = Buffer.from([1]); + der.writeBuffer(version, asn1.Ber.Integer); + + // FieldID sequence + der.startSequence(); + der.writeOID('1.2.840.10045.1.1'); // prime-field + der.writeBuffer(curve.p, asn1.Ber.Integer); + der.endSequence(); + + // Curve sequence + der.startSequence(); + var a = curve.p; + if (a[0] === 0x0) + a = a.slice(1); + der.writeBuffer(a, asn1.Ber.OctetString); + der.writeBuffer(curve.b, asn1.Ber.OctetString); + der.writeBuffer(curve.s, asn1.Ber.BitString); + der.endSequence(); + + der.writeBuffer(curve.G, asn1.Ber.OctetString); + der.writeBuffer(curve.n, asn1.Ber.Integer); + var h = curve.h; + if (!h) { + h = Buffer.from([1]); + } + der.writeBuffer(h, asn1.Ber.Integer); + + // ECParameters + der.endSequence(); + } +} + +function writePkcs8ECDSAPublic(key, der) { + writeECDSACurve(key, der); + der.endSequence(); + + var Q = utils.ecNormalize(key.part.Q.data, true); + der.writeBuffer(Q, asn1.Ber.BitString); +} + +function writePkcs8ECDSAPrivate(key, der) { + writeECDSACurve(key, der); + der.endSequence(); + + der.startSequence(asn1.Ber.OctetString); + der.startSequence(); + + var version = Buffer.from([1]); + der.writeBuffer(version, asn1.Ber.Integer); + + der.writeBuffer(key.part.d.data, asn1.Ber.OctetString); + + der.startSequence(0xa1); + var Q = utils.ecNormalize(key.part.Q.data, true); + der.writeBuffer(Q, asn1.Ber.BitString); + der.endSequence(); + + der.endSequence(); + der.endSequence(); +} + +function writePkcs8EdDSAPublic(key, der) { + der.endSequence(); + + utils.writeBitString(der, key.part.A.data); +} + +function writePkcs8EdDSAPrivate(key, der) { + der.endSequence(); + + var k = utils.mpNormalize(key.part.k.data, true); + der.startSequence(asn1.Ber.OctetString); + der.writeBuffer(k, asn1.Ber.OctetString); + der.endSequence(); +} + + +/***/ }), +/* 158 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2017 Joyent, Inc. + +module.exports = Identity; + +var assert = __webpack_require__(16); +var algs = __webpack_require__(32); +var crypto = __webpack_require__(11); +var Fingerprint = __webpack_require__(156); +var Signature = __webpack_require__(75); +var errs = __webpack_require__(74); +var util = __webpack_require__(3); +var utils = __webpack_require__(26); +var asn1 = __webpack_require__(66); +var Buffer = __webpack_require__(15).Buffer; + +/*JSSTYLED*/ +var DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i; + +var oids = {}; +oids.cn = '2.5.4.3'; +oids.o = '2.5.4.10'; +oids.ou = '2.5.4.11'; +oids.l = '2.5.4.7'; +oids.s = '2.5.4.8'; +oids.c = '2.5.4.6'; +oids.sn = '2.5.4.4'; +oids.dc = '0.9.2342.19200300.100.1.25'; +oids.uid = '0.9.2342.19200300.100.1.1'; +oids.mail = '0.9.2342.19200300.100.1.3'; + +var unoids = {}; +Object.keys(oids).forEach(function (k) { + unoids[oids[k]] = k; +}); + +function Identity(opts) { + var self = this; + assert.object(opts, 'options'); + assert.arrayOfObject(opts.components, 'options.components'); + this.components = opts.components; + this.componentLookup = {}; + this.components.forEach(function (c) { + if (c.name && !c.oid) + c.oid = oids[c.name]; + if (c.oid && !c.name) + c.name = unoids[c.oid]; + if (self.componentLookup[c.name] === undefined) + self.componentLookup[c.name] = []; + self.componentLookup[c.name].push(c); + }); + if (this.componentLookup.cn && this.componentLookup.cn.length > 0) { + this.cn = this.componentLookup.cn[0].value; + } + assert.optionalString(opts.type, 'options.type'); + if (opts.type === undefined) { + if (this.components.length === 1 && + this.componentLookup.cn && + this.componentLookup.cn.length === 1 && + this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { + this.type = 'host'; + this.hostname = this.componentLookup.cn[0].value; + + } else if (this.componentLookup.dc && + this.components.length === this.componentLookup.dc.length) { + this.type = 'host'; + this.hostname = this.componentLookup.dc.map( + function (c) { + return (c.value); + }).join('.'); + + } else if (this.componentLookup.uid && + this.components.length === + this.componentLookup.uid.length) { + this.type = 'user'; + this.uid = this.componentLookup.uid[0].value; + + } else if (this.componentLookup.cn && + this.componentLookup.cn.length === 1 && + this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { + this.type = 'host'; + this.hostname = this.componentLookup.cn[0].value; + + } else if (this.componentLookup.uid && + this.componentLookup.uid.length === 1) { + this.type = 'user'; + this.uid = this.componentLookup.uid[0].value; + + } else if (this.componentLookup.mail && + this.componentLookup.mail.length === 1) { + this.type = 'email'; + this.email = this.componentLookup.mail[0].value; + + } else if (this.componentLookup.cn && + this.componentLookup.cn.length === 1) { + this.type = 'user'; + this.uid = this.componentLookup.cn[0].value; + + } else { + this.type = 'unknown'; + } + } else { + this.type = opts.type; + if (this.type === 'host') + this.hostname = opts.hostname; + else if (this.type === 'user') + this.uid = opts.uid; + else if (this.type === 'email') + this.email = opts.email; + else + throw (new Error('Unknown type ' + this.type)); + } +} + +Identity.prototype.toString = function () { + return (this.components.map(function (c) { + return (c.name.toUpperCase() + '=' + c.value); + }).join(', ')); +}; + +/* + * These are from X.680 -- PrintableString allowed chars are in section 37.4 + * table 8. Spec for IA5Strings is "1,6 + SPACE + DEL" where 1 refers to + * ISO IR #001 (standard ASCII control characters) and 6 refers to ISO IR #006 + * (the basic ASCII character set). + */ +/* JSSTYLED */ +var NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\/:=?-]/; +/* JSSTYLED */ +var NOT_IA5 = /[^\x00-\x7f]/; + +Identity.prototype.toAsn1 = function (der, tag) { + der.startSequence(tag); + this.components.forEach(function (c) { + der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set); + der.startSequence(); + der.writeOID(c.oid); + /* + * If we fit in a PrintableString, use that. Otherwise use an + * IA5String or UTF8String. + * + * If this identity was parsed from a DN, use the ASN.1 types + * from the original representation (otherwise this might not + * be a full match for the original in some validators). + */ + if (c.asn1type === asn1.Ber.Utf8String || + c.value.match(NOT_IA5)) { + var v = Buffer.from(c.value, 'utf8'); + der.writeBuffer(v, asn1.Ber.Utf8String); + + } else if (c.asn1type === asn1.Ber.IA5String || + c.value.match(NOT_PRINTABLE)) { + der.writeString(c.value, asn1.Ber.IA5String); + + } else { + var type = asn1.Ber.PrintableString; + if (c.asn1type !== undefined) + type = c.asn1type; + der.writeString(c.value, type); + } + der.endSequence(); + der.endSequence(); + }); + der.endSequence(); +}; + +function globMatch(a, b) { + if (a === '**' || b === '**') + return (true); + var aParts = a.split('.'); + var bParts = b.split('.'); + if (aParts.length !== bParts.length) + return (false); + for (var i = 0; i < aParts.length; ++i) { + if (aParts[i] === '*' || bParts[i] === '*') + continue; + if (aParts[i] !== bParts[i]) + return (false); + } + return (true); +} + +Identity.prototype.equals = function (other) { + if (!Identity.isIdentity(other, [1, 0])) + return (false); + if (other.components.length !== this.components.length) + return (false); + for (var i = 0; i < this.components.length; ++i) { + if (this.components[i].oid !== other.components[i].oid) + return (false); + if (!globMatch(this.components[i].value, + other.components[i].value)) { + return (false); + } + } + return (true); +}; + +Identity.forHost = function (hostname) { + assert.string(hostname, 'hostname'); + return (new Identity({ + type: 'host', + hostname: hostname, + components: [ { name: 'cn', value: hostname } ] + })); +}; + +Identity.forUser = function (uid) { + assert.string(uid, 'uid'); + return (new Identity({ + type: 'user', + uid: uid, + components: [ { name: 'uid', value: uid } ] + })); +}; + +Identity.forEmail = function (email) { + assert.string(email, 'email'); + return (new Identity({ + type: 'email', + email: email, + components: [ { name: 'mail', value: email } ] + })); +}; + +Identity.parseDN = function (dn) { + assert.string(dn, 'dn'); + var parts = dn.split(','); + var cmps = parts.map(function (c) { + c = c.trim(); + var eqPos = c.indexOf('='); + var name = c.slice(0, eqPos).toLowerCase(); + var value = c.slice(eqPos + 1); + return ({ name: name, value: value }); + }); + return (new Identity({ components: cmps })); +}; + +Identity.parseAsn1 = function (der, top) { + var components = []; + der.readSequence(top); + var end = der.offset + der.length; + while (der.offset < end) { + der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set); + var after = der.offset + der.length; + der.readSequence(); + var oid = der.readOID(); + var type = der.peek(); + var value; + switch (type) { + case asn1.Ber.PrintableString: + case asn1.Ber.IA5String: + case asn1.Ber.OctetString: + case asn1.Ber.T61String: + value = der.readString(type); + break; + case asn1.Ber.Utf8String: + value = der.readString(type, true); + value = value.toString('utf8'); + break; + case asn1.Ber.CharacterString: + case asn1.Ber.BMPString: + value = der.readString(type, true); + value = value.toString('utf16le'); + break; + default: + throw (new Error('Unknown asn1 type ' + type)); + } + components.push({ oid: oid, asn1type: type, value: value }); + der._offset = after; + } + der._offset = end; + return (new Identity({ + components: components + })); +}; + +Identity.isIdentity = function (obj, ver) { + return (utils.isCompatible(obj, Identity, ver)); +}; + +/* + * API versions for Identity: + * [1,0] -- initial ver + */ +Identity.prototype._sshpkApiVersion = [1, 0]; + +Identity._oldVersionDetect = function (obj) { + return ([1, 0]); +}; + + +/***/ }), +/* 159 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2015 Joyent, Inc. + +module.exports = SSHBuffer; + +var assert = __webpack_require__(16); +var Buffer = __webpack_require__(15).Buffer; + +function SSHBuffer(opts) { + assert.object(opts, 'options'); + if (opts.buffer !== undefined) + assert.buffer(opts.buffer, 'options.buffer'); + + this._size = opts.buffer ? opts.buffer.length : 1024; + this._buffer = opts.buffer || Buffer.alloc(this._size); + this._offset = 0; +} + +SSHBuffer.prototype.toBuffer = function () { + return (this._buffer.slice(0, this._offset)); +}; + +SSHBuffer.prototype.atEnd = function () { + return (this._offset >= this._buffer.length); +}; + +SSHBuffer.prototype.remainder = function () { + return (this._buffer.slice(this._offset)); +}; + +SSHBuffer.prototype.skip = function (n) { + this._offset += n; +}; + +SSHBuffer.prototype.expand = function () { + this._size *= 2; + var buf = Buffer.alloc(this._size); + this._buffer.copy(buf, 0); + this._buffer = buf; +}; + +SSHBuffer.prototype.readPart = function () { + return ({data: this.readBuffer()}); +}; + +SSHBuffer.prototype.readBuffer = function () { + var len = this._buffer.readUInt32BE(this._offset); + this._offset += 4; + assert.ok(this._offset + len <= this._buffer.length, + 'length out of bounds at +0x' + this._offset.toString(16) + + ' (data truncated?)'); + var buf = this._buffer.slice(this._offset, this._offset + len); + this._offset += len; + return (buf); +}; + +SSHBuffer.prototype.readString = function () { + return (this.readBuffer().toString()); +}; + +SSHBuffer.prototype.readCString = function () { + var offset = this._offset; + while (offset < this._buffer.length && + this._buffer[offset] !== 0x00) + offset++; + assert.ok(offset < this._buffer.length, 'c string does not terminate'); + var str = this._buffer.slice(this._offset, offset).toString(); + this._offset = offset + 1; + return (str); +}; + +SSHBuffer.prototype.readInt = function () { + var v = this._buffer.readUInt32BE(this._offset); + this._offset += 4; + return (v); +}; + +SSHBuffer.prototype.readInt64 = function () { + assert.ok(this._offset + 8 < this._buffer.length, + 'buffer not long enough to read Int64'); + var v = this._buffer.slice(this._offset, this._offset + 8); + this._offset += 8; + return (v); +}; + +SSHBuffer.prototype.readChar = function () { + var v = this._buffer[this._offset++]; + return (v); +}; + +SSHBuffer.prototype.writeBuffer = function (buf) { + while (this._offset + 4 + buf.length > this._size) + this.expand(); + this._buffer.writeUInt32BE(buf.length, this._offset); + this._offset += 4; + buf.copy(this._buffer, this._offset); + this._offset += buf.length; +}; + +SSHBuffer.prototype.writeString = function (str) { + this.writeBuffer(Buffer.from(str, 'utf8')); +}; + +SSHBuffer.prototype.writeCString = function (str) { + while (this._offset + 1 + str.length > this._size) + this.expand(); + this._buffer.write(str, this._offset); + this._offset += str.length; + this._buffer[this._offset++] = 0; +}; + +SSHBuffer.prototype.writeInt = function (v) { + while (this._offset + 4 > this._size) + this.expand(); + this._buffer.writeUInt32BE(v, this._offset); + this._offset += 4; +}; + +SSHBuffer.prototype.writeInt64 = function (v) { + assert.buffer(v, 'value'); + if (v.length > 8) { + var lead = v.slice(0, v.length - 8); + for (var i = 0; i < lead.length; ++i) { + assert.strictEqual(lead[i], 0, + 'must fit in 64 bits of precision'); + } + v = v.slice(v.length - 8, v.length); + } + while (this._offset + 8 > this._size) + this.expand(); + v.copy(this._buffer, this._offset); + this._offset += 8; +}; + +SSHBuffer.prototype.writeChar = function (v) { + while (this._offset + 1 > this._size) + this.expand(); + this._buffer[this._offset++] = v; +}; + +SSHBuffer.prototype.writePart = function (p) { + this.writeBuffer(p.data); +}; + +SSHBuffer.prototype.write = function (buf) { + while (this._offset + buf.length > this._size) + this.expand(); + buf.copy(this._buffer, this._offset); + this._offset += buf.length; +}; + + +/***/ }), +/* 160 */ +/***/ (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; +}; + + +/***/ }), +/* 161 */ +/***/ (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 + } +} + + +/***/ }), +/* 162 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends2; + +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(21)); +} + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +exports.extractWorkspaces = extractWorkspaces; + +var _executeLifecycleScript; + +function _load_executeLifecycleScript() { + return _executeLifecycleScript = __webpack_require__(111); +} + +var _path; + +function _load_path() { + return _path = __webpack_require__(377); +} + +var _conversion; + +function _load_conversion() { + return _conversion = __webpack_require__(336); +} + +var _index; + +function _load_index() { + return _index = _interopRequireDefault(__webpack_require__(220)); +} + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(4)); +} + +var _constants; + +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} + +var _packageConstraintResolver; + +function _load_packageConstraintResolver() { + return _packageConstraintResolver = _interopRequireDefault(__webpack_require__(555)); +} + +var _requestManager; + +function _load_requestManager() { + return _requestManager = _interopRequireDefault(__webpack_require__(378)); +} + +var _index2; + +function _load_index2() { + return _index2 = __webpack_require__(57); +} + +var _index3; + +function _load_index3() { + return _index3 = __webpack_require__(200); +} + +var _map; + +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(29)); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const crypto = __webpack_require__(11); +const detectIndent = __webpack_require__(635); +const invariant = __webpack_require__(9); +const path = __webpack_require__(0); +const micromatch = __webpack_require__(114); +const isCi = __webpack_require__(397); + +function sortObject(object) { + const sortedObject = {}; + Object.keys(object).sort().forEach(item => { + sortedObject[item] = object[item]; + }); + return sortedObject; +} + +class Config { + constructor(reporter) { + this.constraintResolver = new (_packageConstraintResolver || _load_packageConstraintResolver()).default(this, reporter); + this.requestManager = new (_requestManager || _load_requestManager()).default(reporter); + this.reporter = reporter; + this._init({}); + } + + // + + + // + + + // cache packages in offline mirror folder as new .tgz files + + + // + + + // + + + // + + + // + + + // + + + // + + + // + + + // + + + // + + + // + + + // + + + // Whether we should ignore executing lifecycle scripts + + + // + + + // + + + // + + + // + + + /** + * Execute a promise produced by factory if it doesn't exist in our cache with + * the associated key. + */ + + getCache(key, factory) { + const cached = this.cache[key]; + if (cached) { + return cached; + } + + return this.cache[key] = factory().catch(err => { + this.cache[key] = null; + throw err; + }); + } + + /** + * Get a config option from our yarn config. + */ + + getOption(key, resolve = false) { + const value = this.registries.yarn.getOption(key); + + if (resolve && typeof value === 'string' && value.length) { + return (0, (_path || _load_path()).resolveWithHome)(value); + } + + return value; + } + + /** + * Reduce a list of versions to a single one based on an input range. + */ + + resolveConstraints(versions, range) { + return this.constraintResolver.reduce(versions, range); + } + + /** + * Initialise config. Fetch registry options, find package roots. + */ + + init(opts = {}) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + _this._init(opts); + + _this.workspaceRootFolder = yield _this.findWorkspaceRoot(_this.cwd); + _this.lockfileFolder = _this.workspaceRootFolder || _this.cwd; + + // using focus in a workspace root is not allowed + if (_this.focus && (!_this.workspaceRootFolder || _this.cwd === _this.workspaceRootFolder)) { + throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('workspacesFocusRootCheck')); + } + + if (_this.focus) { + const focusedWorkspaceManifest = yield _this.readRootManifest(); + _this.focusedWorkspaceName = focusedWorkspaceManifest.name; + } + + _this.linkedModules = []; + + let linkedModules; + try { + linkedModules = yield (_fs || _load_fs()).readdir(_this.linkFolder); + } catch (err) { + if (err.code === 'ENOENT') { + linkedModules = []; + } else { + throw err; + } + } + + for (var _iterator = linkedModules, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const dir = _ref; + + const linkedPath = path.join(_this.linkFolder, dir); + + if (dir[0] === '@') { + // it's a scope, not a package + const scopedLinked = yield (_fs || _load_fs()).readdir(linkedPath); + _this.linkedModules.push(...scopedLinked.map(function (scopedDir) { + return path.join(dir, scopedDir); + })); + } else { + _this.linkedModules.push(dir); + } + } + + for (var _iterator2 = Object.keys((_index2 || _load_index2()).registries), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + const key = _ref2; + + const Registry = (_index2 || _load_index2()).registries[key]; + + const extraneousRcFiles = Registry === (_index2 || _load_index2()).registries.yarn ? _this.extraneousYarnrcFiles : []; + + // instantiate registry + const registry = new Registry(_this.cwd, _this.registries, _this.requestManager, _this.reporter, _this.enableDefaultRc, extraneousRcFiles); + yield registry.init({ + registry: opts.registry + }); + + _this.registries[key] = registry; + if (_this.registryFolders.indexOf(registry.folder) === -1) { + _this.registryFolders.push(registry.folder); + } + } + + if (_this.modulesFolder) { + _this.registryFolders = [_this.modulesFolder]; + } + + _this.networkConcurrency = opts.networkConcurrency || Number(_this.getOption('network-concurrency')) || (_constants || _load_constants()).NETWORK_CONCURRENCY; + + _this.childConcurrency = opts.childConcurrency || Number(_this.getOption('child-concurrency')) || Number(process.env.CHILD_CONCURRENCY) || (_constants || _load_constants()).CHILD_CONCURRENCY; + + _this.networkTimeout = opts.networkTimeout || Number(_this.getOption('network-timeout')) || (_constants || _load_constants()).NETWORK_TIMEOUT; + + const httpProxy = opts.httpProxy || _this.getOption('proxy'); + const httpsProxy = opts.httpsProxy || _this.getOption('https-proxy'); + _this.requestManager.setOptions({ + userAgent: String(_this.getOption('user-agent')), + httpProxy: httpProxy === false ? false : String(httpProxy || ''), + httpsProxy: httpsProxy === false ? false : String(httpsProxy || ''), + strictSSL: Boolean(_this.getOption('strict-ssl')), + ca: Array.prototype.concat(opts.ca || _this.getOption('ca') || []).map(String), + cafile: String(opts.cafile || _this.getOption('cafile', true) || ''), + cert: String(opts.cert || _this.getOption('cert') || ''), + key: String(opts.key || _this.getOption('key') || ''), + networkConcurrency: _this.networkConcurrency, + networkTimeout: _this.networkTimeout + }); + + _this.globalFolder = opts.globalFolder || String(_this.getOption('global-folder', true)); + if (_this.globalFolder === 'undefined') { + _this.globalFolder = (_constants || _load_constants()).GLOBAL_MODULE_DIRECTORY; + } + + let cacheRootFolder = opts.cacheFolder || _this.getOption('cache-folder', true); + + if (!cacheRootFolder) { + let preferredCacheFolders = (_constants || _load_constants()).PREFERRED_MODULE_CACHE_DIRECTORIES; + const preferredCacheFolder = opts.preferredCacheFolder || _this.getOption('preferred-cache-folder', true); + + if (preferredCacheFolder) { + preferredCacheFolders = [String(preferredCacheFolder)].concat(preferredCacheFolders); + } + + const cacheFolderQuery = yield (_fs || _load_fs()).getFirstSuitableFolder(preferredCacheFolders, (_fs || _load_fs()).constants.W_OK | (_fs || _load_fs()).constants.X_OK | (_fs || _load_fs()).constants.R_OK // eslint-disable-line no-bitwise + ); + for (var _iterator3 = cacheFolderQuery.skipped, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + const skippedEntry = _ref3; + + _this.reporter.warn(_this.reporter.lang('cacheFolderSkipped', skippedEntry.folder)); + } + + cacheRootFolder = cacheFolderQuery.folder; + if (cacheRootFolder && cacheFolderQuery.skipped.length > 0) { + _this.reporter.warn(_this.reporter.lang('cacheFolderSelected', cacheRootFolder)); + } + } + + if (!cacheRootFolder) { + throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('cacheFolderMissing')); + } else { + _this._cacheRootFolder = String(cacheRootFolder); + } + + const manifest = yield _this.maybeReadManifest(_this.lockfileFolder); + + const plugnplayByEnv = _this.getOption('plugnplay-override'); + if (plugnplayByEnv != null) { + _this.plugnplayEnabled = plugnplayByEnv !== 'false' && plugnplayByEnv !== '0'; + _this.plugnplayPersist = false; + } else if (opts.enablePnp || opts.disablePnp) { + _this.plugnplayEnabled = !!opts.enablePnp; + _this.plugnplayPersist = true; + } else if (manifest && manifest.installConfig && manifest.installConfig.pnp) { + _this.plugnplayEnabled = !!manifest.installConfig.pnp; + _this.plugnplayPersist = false; + } else { + _this.plugnplayEnabled = false; + _this.plugnplayPersist = false; + } + + if (process.platform === 'win32') { + const cacheRootFolderDrive = path.parse(_this._cacheRootFolder).root.toLowerCase(); + const lockfileFolderDrive = path.parse(_this.lockfileFolder).root.toLowerCase(); + + if (cacheRootFolderDrive !== lockfileFolderDrive) { + if (_this.plugnplayEnabled) { + _this.reporter.warn(_this.reporter.lang('plugnplayWindowsSupport')); + } + _this.plugnplayEnabled = false; + _this.plugnplayPersist = false; + } + } + + _this.plugnplayShebang = String(_this.getOption('plugnplay-shebang') || '') || '/usr/bin/env node'; + _this.plugnplayBlacklist = String(_this.getOption('plugnplay-blacklist') || '') || null; + + _this.ignoreScripts = opts.ignoreScripts || Boolean(_this.getOption('ignore-scripts', false)); + + _this.workspacesEnabled = _this.getOption('workspaces-experimental') !== false; + _this.workspacesNohoistEnabled = _this.getOption('workspaces-nohoist-experimental') !== false; + + _this.offlineCacheFolder = String(_this.getOption('offline-cache-folder') || '') || null; + + _this.pruneOfflineMirror = Boolean(_this.getOption('yarn-offline-mirror-pruning')); + _this.enableMetaFolder = Boolean(_this.getOption('enable-meta-folder')); + _this.enableLockfileVersions = Boolean(_this.getOption('yarn-enable-lockfile-versions')); + _this.linkFileDependencies = Boolean(_this.getOption('yarn-link-file-dependencies')); + _this.packBuiltPackages = Boolean(_this.getOption('experimental-pack-script-packages-in-mirror')); + + _this.autoAddIntegrity = !(0, (_conversion || _load_conversion()).boolifyWithDefault)(String(_this.getOption('unsafe-disable-integrity-migration')), true); + + //init & create cacheFolder, tempFolder + _this.cacheFolder = path.join(_this._cacheRootFolder, 'v' + String((_constants || _load_constants()).CACHE_VERSION)); + _this.tempFolder = opts.tempFolder || path.join(_this.cacheFolder, '.tmp'); + yield (_fs || _load_fs()).mkdirp(_this.cacheFolder); + yield (_fs || _load_fs()).mkdirp(_this.tempFolder); + + if (opts.production !== undefined) { + _this.production = Boolean(opts.production); + } else { + _this.production = Boolean(_this.getOption('production')) || process.env.NODE_ENV === 'production' && process.env.NPM_CONFIG_PRODUCTION !== 'false' && process.env.YARN_PRODUCTION !== 'false'; + } + + if (_this.workspaceRootFolder && !_this.workspacesEnabled) { + throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('workspacesDisabled')); + } + })(); + } + + _init(opts) { + this.registryFolders = []; + this.linkedModules = []; + + this.registries = (0, (_map || _load_map()).default)(); + this.cache = (0, (_map || _load_map()).default)(); + + // Ensure the cwd is always an absolute path. + this.cwd = path.resolve(opts.cwd || this.cwd || process.cwd()); + + this.looseSemver = opts.looseSemver == undefined ? true : opts.looseSemver; + + this.commandName = opts.commandName || ''; + + this.enableDefaultRc = opts.enableDefaultRc !== false; + this.extraneousYarnrcFiles = opts.extraneousYarnrcFiles || []; + + this.preferOffline = !!opts.preferOffline; + this.modulesFolder = opts.modulesFolder; + this.linkFolder = opts.linkFolder || (_constants || _load_constants()).LINK_REGISTRY_DIRECTORY; + this.offline = !!opts.offline; + this.binLinks = !!opts.binLinks; + this.updateChecksums = !!opts.updateChecksums; + this.plugnplayUnplugged = []; + this.plugnplayPurgeUnpluggedPackages = false; + + this.ignorePlatform = !!opts.ignorePlatform; + this.ignoreScripts = !!opts.ignoreScripts; + + this.disablePrepublish = !!opts.disablePrepublish; + + // $FlowFixMe$ + this.nonInteractive = !!opts.nonInteractive || isCi || !process.stdout.isTTY; + + this.requestManager.setOptions({ + offline: !!opts.offline && !opts.preferOffline, + captureHar: !!opts.captureHar + }); + + this.focus = !!opts.focus; + this.focusedWorkspaceName = ''; + + this.otp = opts.otp || ''; + } + + /** + * Generate a name suitable as unique filesystem identifier for the specified package. + */ + + generateUniquePackageSlug(pkg) { + let slug = pkg.name; + + slug = slug.replace(/[^@a-z0-9]+/g, '-'); + slug = slug.replace(/^-+|-+$/g, ''); + + if (pkg.registry) { + slug = `${pkg.registry}-${slug}`; + } else { + slug = `unknown-${slug}`; + } + + const hash = pkg.remote.hash; + + + if (pkg.version) { + slug += `-${pkg.version}`; + } + + if (pkg.uid && pkg.version !== pkg.uid) { + slug += `-${pkg.uid}`; + } else if (hash) { + slug += `-${hash}`; + } + + if (pkg.remote.integrity) { + slug += `-integrity`; + } + + return slug; + } + + /** + * Generate an absolute module path. + */ + + generateModuleCachePath(pkg) { + invariant(this.cacheFolder, 'No package root'); + invariant(pkg, 'Undefined package'); + + const slug = this.generateUniquePackageSlug(pkg); + return path.join(this.cacheFolder, slug, 'node_modules', pkg.name); + } + + /** + */ + + getUnpluggedPath() { + return path.join(this.lockfileFolder, '.pnp', 'unplugged'); + } + + /** + */ + + generatePackageUnpluggedPath(pkg) { + const slug = this.generateUniquePackageSlug(pkg); + return path.join(this.getUnpluggedPath(), slug, 'node_modules', pkg.name); + } + + /** + */ + + listUnpluggedPackageFolders() { + var _this2 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const unpluggedPackages = new Map(); + const unpluggedPath = _this2.getUnpluggedPath(); + + if (!(yield (_fs || _load_fs()).exists(unpluggedPath))) { + return unpluggedPackages; + } + + for (var _iterator4 = yield (_fs || _load_fs()).readdir(unpluggedPath), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + const unpluggedName = _ref4; + + const nmListing = yield (_fs || _load_fs()).readdir(path.join(unpluggedPath, unpluggedName, 'node_modules')); + invariant(nmListing.length === 1, 'A single folder should be in the unplugged directory'); + + const target = path.join(unpluggedPath, unpluggedName, `node_modules`, nmListing[0]); + unpluggedPackages.set(unpluggedName, target); + } + + return unpluggedPackages; + })(); + } + + /** + * Execute lifecycle scripts in the specified directory. Ignoring when the --ignore-scripts flag has been + * passed. + */ + + executeLifecycleScript(commandName, cwd) { + if (this.ignoreScripts) { + return Promise.resolve(); + } else { + return (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execFromManifest)(this, commandName, cwd || this.cwd); + } + } + + /** + * Generate an absolute temporary filename location based on the input filename. + */ + + getTemp(filename) { + invariant(this.tempFolder, 'No temp folder'); + return path.join(this.tempFolder, filename); + } + + /** + * Remote packages may be cached in a file system to be available for offline installation. + * Second time the same package needs to be installed it will be loaded from there. + * Given a package's filename, return a path in the offline mirror location. + */ + + getOfflineMirrorPath(packageFilename) { + let mirrorPath; + + var _arr = ['npm', 'yarn']; + for (var _i5 = 0; _i5 < _arr.length; _i5++) { + const key = _arr[_i5]; + const registry = this.registries[key]; + + if (registry == null) { + continue; + } + + const registryMirrorPath = registry.config['yarn-offline-mirror']; + + if (registryMirrorPath === false) { + return null; + } + + if (registryMirrorPath == null) { + continue; + } + + mirrorPath = registryMirrorPath; + } + + if (mirrorPath == null) { + return null; + } + + if (packageFilename == null) { + return mirrorPath; + } + + return path.join(mirrorPath, path.basename(packageFilename)); + } + + /** + * Checker whether the folder input is a valid module folder. We output a yarn metadata + * file when we've successfully setup a folder so use this as a marker. + */ + + isValidModuleDest(dest) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (!(yield (_fs || _load_fs()).exists(dest))) { + return false; + } + + if (!(yield (_fs || _load_fs()).exists(path.join(dest, (_constants || _load_constants()).METADATA_FILENAME)))) { + return false; + } + + return true; + })(); + } + + /** + * Read package metadata and normalized package info. + */ + + readPackageMetadata(dir) { + var _this3 = this; + + return this.getCache(`metadata-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const metadata = yield _this3.readJson(path.join(dir, (_constants || _load_constants()).METADATA_FILENAME)); + const pkg = yield _this3.readManifest(dir, metadata.registry); + + return { + package: pkg, + artifacts: metadata.artifacts || [], + hash: metadata.hash, + remote: metadata.remote, + registry: metadata.registry + }; + })); + } + + /** + * Read normalized package info according yarn-metadata.json + * throw an error if package.json was not found + */ + + readManifest(dir, priorityRegistry, isRoot = false) { + var _this4 = this; + + return this.getCache(`manifest-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const manifest = yield _this4.maybeReadManifest(dir, priorityRegistry, isRoot); + + if (manifest) { + return manifest; + } else { + throw new (_errors || _load_errors()).MessageError(_this4.reporter.lang('couldntFindPackagejson', dir), 'ENOENT'); + } + })); + } + + /** + * try get the manifest file by looking + * 1. manifest file in cache + * 2. manifest file in registry + */ + maybeReadManifest(dir, priorityRegistry, isRoot = false) { + var _this5 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const metadataLoc = path.join(dir, (_constants || _load_constants()).METADATA_FILENAME); + + if (yield (_fs || _load_fs()).exists(metadataLoc)) { + const metadata = yield _this5.readJson(metadataLoc); + + if (!priorityRegistry) { + priorityRegistry = metadata.priorityRegistry; + } + + if (typeof metadata.manifest !== 'undefined') { + return metadata.manifest; + } + } + + if (priorityRegistry) { + const file = yield _this5.tryManifest(dir, priorityRegistry, isRoot); + if (file) { + return file; + } + } + + for (var _iterator5 = Object.keys((_index2 || _load_index2()).registries), _isArray5 = Array.isArray(_iterator5), _i6 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref7; + + if (_isArray5) { + if (_i6 >= _iterator5.length) break; + _ref7 = _iterator5[_i6++]; + } else { + _i6 = _iterator5.next(); + if (_i6.done) break; + _ref7 = _i6.value; + } + + const registry = _ref7; + + if (priorityRegistry === registry) { + continue; + } + + const file = yield _this5.tryManifest(dir, registry, isRoot); + if (file) { + return file; + } + } + + return null; + })(); + } + + /** + * Read the root manifest. + */ + + readRootManifest() { + return this.readManifest(this.cwd, 'npm', true); + } + + /** + * Try and find package info with the input directory and registry. + */ + + tryManifest(dir, registry, isRoot) { + var _this6 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const filename = (_index2 || _load_index2()).registries[registry].filename; + + const loc = path.join(dir, filename); + if (yield (_fs || _load_fs()).exists(loc)) { + const data = yield _this6.readJson(loc); + data._registry = registry; + data._loc = loc; + return (0, (_index || _load_index()).default)(data, dir, _this6, isRoot); + } else { + return null; + } + })(); + } + + findManifest(dir, isRoot) { + var _this7 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + for (var _iterator6 = (_index2 || _load_index2()).registryNames, _isArray6 = Array.isArray(_iterator6), _i7 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref8; + + if (_isArray6) { + if (_i7 >= _iterator6.length) break; + _ref8 = _iterator6[_i7++]; + } else { + _i7 = _iterator6.next(); + if (_i7.done) break; + _ref8 = _i7.value; + } + + const registry = _ref8; + + const manifest = yield _this7.tryManifest(dir, registry, isRoot); + + if (manifest) { + return manifest; + } + } + + return null; + })(); + } + + findWorkspaceRoot(initial) { + var _this8 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + let previous = null; + let current = path.normalize(initial); + if (!(yield (_fs || _load_fs()).exists(current))) { + throw new (_errors || _load_errors()).MessageError(_this8.reporter.lang('folderMissing', current)); + } + + do { + const manifest = yield _this8.findManifest(current, true); + const ws = extractWorkspaces(manifest); + if (ws && ws.packages) { + const relativePath = path.relative(current, initial); + if (relativePath === '' || micromatch([relativePath], ws.packages).length > 0) { + return current; + } else { + return null; + } + } + + previous = current; + current = path.dirname(current); + } while (current !== previous); + + return null; + })(); + } + + resolveWorkspaces(root, rootManifest) { + var _this9 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const workspaces = {}; + if (!_this9.workspacesEnabled) { + return workspaces; + } + + const ws = _this9.getWorkspaces(rootManifest, true); + const patterns = ws && ws.packages ? ws.packages : []; + + if (!Array.isArray(patterns)) { + throw new (_errors || _load_errors()).MessageError(_this9.reporter.lang('workspacesSettingMustBeArray')); + } + + const registryFilenames = (_index2 || _load_index2()).registryNames.map(function (registryName) { + return _this9.registries[registryName].constructor.filename; + }).join('|'); + const trailingPattern = `/+(${registryFilenames})`; + // anything under folder (node_modules) should be ignored, thus use the '**' instead of shallow match "*" + const ignorePatterns = _this9.registryFolders.map(function (folder) { + return `/${folder}/**/+(${registryFilenames})`; + }); + + const files = yield Promise.all(patterns.map(function (pattern) { + return (_fs || _load_fs()).glob(pattern.replace(/\/?$/, trailingPattern), { + cwd: root, + ignore: ignorePatterns.map(function (ignorePattern) { + return pattern.replace(/\/?$/, ignorePattern); + }) + }); + })); + + for (var _iterator7 = new Set([].concat(...files)), _isArray7 = Array.isArray(_iterator7), _i8 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref9; + + if (_isArray7) { + if (_i8 >= _iterator7.length) break; + _ref9 = _iterator7[_i8++]; + } else { + _i8 = _iterator7.next(); + if (_i8.done) break; + _ref9 = _i8.value; + } + + const file = _ref9; + + const loc = path.join(root, path.dirname(file)); + const manifest = yield _this9.findManifest(loc, false); + + if (!manifest) { + continue; + } + + if (!manifest.name) { + _this9.reporter.warn(_this9.reporter.lang('workspaceNameMandatory', loc)); + continue; + } + if (!manifest.version) { + _this9.reporter.warn(_this9.reporter.lang('workspaceVersionMandatory', loc)); + continue; + } + + if (Object.prototype.hasOwnProperty.call(workspaces, manifest.name)) { + throw new (_errors || _load_errors()).MessageError(_this9.reporter.lang('workspaceNameDuplicate', manifest.name)); + } + + workspaces[manifest.name] = { loc, manifest }; + } + + return workspaces; + })(); + } + + // workspaces functions + getWorkspaces(manifest, shouldThrow = false) { + if (!manifest || !this.workspacesEnabled) { + return undefined; + } + + const ws = extractWorkspaces(manifest); + + if (!ws) { + return ws; + } + + // validate eligibility + let wsCopy = (0, (_extends2 || _load_extends()).default)({}, ws); + const warnings = []; + const errors = []; + + // packages + if (wsCopy.packages && wsCopy.packages.length > 0 && !manifest.private) { + errors.push(this.reporter.lang('workspacesRequirePrivateProjects')); + wsCopy = undefined; + } + // nohoist + if (wsCopy && wsCopy.nohoist && wsCopy.nohoist.length > 0) { + if (!this.workspacesNohoistEnabled) { + warnings.push(this.reporter.lang('workspacesNohoistDisabled', manifest.name)); + wsCopy.nohoist = undefined; + } else if (!manifest.private) { + errors.push(this.reporter.lang('workspacesNohoistRequirePrivatePackages', manifest.name)); + wsCopy.nohoist = undefined; + } + } + + if (errors.length > 0 && shouldThrow) { + throw new (_errors || _load_errors()).MessageError(errors.join('\n')); + } + + const msg = errors.concat(warnings).join('\n'); + if (msg.length > 0) { + this.reporter.warn(msg); + } + + return wsCopy; + } + + /** + * Description + */ + + getFolder(pkg) { + let registryName = pkg._registry; + if (!registryName) { + const ref = pkg._reference; + invariant(ref, 'expected reference'); + registryName = ref.registry; + } + return this.registries[registryName].folder; + } + + /** + * Get root manifests. + */ + + getRootManifests() { + var _this10 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const manifests = {}; + for (var _iterator8 = (_index2 || _load_index2()).registryNames, _isArray8 = Array.isArray(_iterator8), _i9 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { + var _ref10; + + if (_isArray8) { + if (_i9 >= _iterator8.length) break; + _ref10 = _iterator8[_i9++]; + } else { + _i9 = _iterator8.next(); + if (_i9.done) break; + _ref10 = _i9.value; + } + + const registryName = _ref10; + + const registry = (_index2 || _load_index2()).registries[registryName]; + const jsonLoc = path.join(_this10.cwd, registry.filename); + + let object = {}; + let exists = false; + let indent; + if (yield (_fs || _load_fs()).exists(jsonLoc)) { + exists = true; + + const info = yield _this10.readJson(jsonLoc, (_fs || _load_fs()).readJsonAndFile); + object = info.object; + indent = detectIndent(info.content).indent || undefined; + } + manifests[registryName] = { loc: jsonLoc, object, exists, indent }; + } + return manifests; + })(); + } + + /** + * Save root manifests. + */ + + saveRootManifests(manifests) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + for (var _iterator9 = (_index2 || _load_index2()).registryNames, _isArray9 = Array.isArray(_iterator9), _i10 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { + var _ref11; + + if (_isArray9) { + if (_i10 >= _iterator9.length) break; + _ref11 = _iterator9[_i10++]; + } else { + _i10 = _iterator9.next(); + if (_i10.done) break; + _ref11 = _i10.value; + } + + const registryName = _ref11; + var _manifests$registryNa = manifests[registryName]; + const loc = _manifests$registryNa.loc, + object = _manifests$registryNa.object, + exists = _manifests$registryNa.exists, + indent = _manifests$registryNa.indent; + + if (!exists && !Object.keys(object).length) { + continue; + } + + for (var _iterator10 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray10 = Array.isArray(_iterator10), _i11 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { + var _ref12; + + if (_isArray10) { + if (_i11 >= _iterator10.length) break; + _ref12 = _iterator10[_i11++]; + } else { + _i11 = _iterator10.next(); + if (_i11.done) break; + _ref12 = _i11.value; + } + + const field = _ref12; + + if (object[field]) { + object[field] = sortObject(object[field]); + } + } + + yield (_fs || _load_fs()).writeFilePreservingEol(loc, JSON.stringify(object, null, indent || (_constants || _load_constants()).DEFAULT_INDENT) + '\n'); + } + })(); + } + + /** + * Call the passed factory (defaults to fs.readJson) and rethrow a pretty error message if it was the result + * of a syntax error. + */ + + readJson(loc, factory = (_fs || _load_fs()).readJson) { + try { + return factory(loc); + } catch (err) { + if (err instanceof SyntaxError) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('jsonError', loc, err.message)); + } else { + throw err; + } + } + } + + static create(opts = {}, reporter = new (_index3 || _load_index3()).NoopReporter()) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const config = new Config(reporter); + yield config.init(opts); + return config; + })(); + } +} + +exports.default = Config; +function extractWorkspaces(manifest) { + if (!manifest || !manifest.workspaces) { + return undefined; + } + + if (Array.isArray(manifest.workspaces)) { + return { packages: manifest.workspaces }; + } + + if (manifest.workspaces.packages && Array.isArray(manifest.workspaces.packages) || manifest.workspaces.nohoist && Array.isArray(manifest.workspaces.nohoist)) { + return manifest.workspaces; + } + + return undefined; +} + +/***/ }), +/* 163 */ +/***/ (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; +}; + + +/***/ }), +/* 164 */ +/***/ (function(module, exports) { + +module.exports = require("net"); + +/***/ }), +/* 165 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = exports.Add = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _extends2; + +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(21)); +} + +let run = exports.run = (() => { + var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (!args.length) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('missingAddDependencies')); + } + + const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); + + yield (0, (_install || _load_install()).wrapLifecycle)(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const install = new Add(args, flags, config, reporter, lockfile); + yield install.init(); + })); + }); + + return function run(_x, _x2, _x3, _x4) { + return _ref7.apply(this, arguments); + }; +})(); + +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; + +var _lockfile; + +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(19)); +} + +var _normalizePattern2; + +function _load_normalizePattern() { + return _normalizePattern2 = __webpack_require__(37); +} + +var _workspaceLayout; + +function _load_workspaceLayout() { + return _workspaceLayout = _interopRequireDefault(__webpack_require__(90)); +} + +var _index; + +function _load_index() { + return _index = __webpack_require__(78); +} + +var _list; + +function _load_list() { + return _list = __webpack_require__(358); +} + +var _install; + +function _load_install() { + return _install = __webpack_require__(34); +} + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _constants; + +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(4)); +} + +var _invariant; + +function _load_invariant() { + return _invariant = _interopRequireDefault(__webpack_require__(9)); +} + +var _path; + +function _load_path() { + return _path = _interopRequireDefault(__webpack_require__(0)); +} + +var _semver; + +function _load_semver() { + return _semver = _interopRequireDefault(__webpack_require__(22)); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const SILENCE_DEPENDENCY_TYPE_WARNINGS = ['upgrade', 'upgrade-interactive']; + +class Add extends (_install || _load_install()).Install { + constructor(args, flags, config, reporter, lockfile) { + const workspaceRootIsCwd = config.cwd === config.lockfileFolder; + const _flags = flags ? (0, (_extends2 || _load_extends()).default)({}, flags, { workspaceRootIsCwd }) : { workspaceRootIsCwd }; + super(_flags, config, reporter, lockfile); + this.args = args; + // only one flag is supported, so we can figure out which one was passed to `yarn add` + this.flagToOrigin = [flags.dev && 'devDependencies', flags.optional && 'optionalDependencies', flags.peer && 'peerDependencies', 'dependencies'].filter(Boolean).shift(); + } + + /** + * TODO + */ + + prepareRequests(requests) { + const requestsWithArgs = requests.slice(); + + for (var _iterator = this.args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const pattern = _ref; + + requestsWithArgs.push({ + pattern, + registry: 'npm', + optional: false + }); + } + return requestsWithArgs; + } + + /** + * returns version for a pattern based on Manifest + */ + getPatternVersion(pattern, pkg) { + const tilde = this.flags.tilde; + const configPrefix = String(this.config.getOption('save-prefix')); + const exact = this.flags.exact || Boolean(this.config.getOption('save-exact')) || configPrefix === ''; + + var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern); + + const hasVersion = _normalizePattern.hasVersion, + range = _normalizePattern.range; + + let version; + + if ((0, (_index || _load_index()).getExoticResolver)(pattern)) { + // wasn't a name/range tuple so this is just a raw exotic pattern + version = pattern; + } else if (hasVersion && range && ((_semver || _load_semver()).default.satisfies(pkg.version, range) || (0, (_index || _load_index()).getExoticResolver)(range))) { + // if the user specified a range then use it verbatim + version = range; + } + + if (!version || (_semver || _load_semver()).default.valid(version)) { + let prefix = configPrefix || '^'; + + if (tilde) { + prefix = '~'; + } else if (version || exact) { + prefix = ''; + } + version = `${prefix}${pkg.version}`; + } + + return version; + } + + preparePatterns(patterns) { + const preparedPatterns = patterns.slice(); + for (var _iterator2 = this.resolver.dedupePatterns(this.args), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + const pattern = _ref2; + + const pkg = this.resolver.getResolvedPattern(pattern); + (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${pattern}`); + const version = this.getPatternVersion(pattern, pkg); + const newPattern = `${pkg.name}@${version}`; + preparedPatterns.push(newPattern); + this.addedPatterns.push(newPattern); + if (newPattern === pattern) { + continue; + } + this.resolver.replacePattern(pattern, newPattern); + } + return preparedPatterns; + } + + preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) { + // remove the newly added patterns if cwd != root and update the in-memory package dependency instead + if (cwdIsRoot) { + return patterns; + } + + let manifest; + const cwdPackage = `${cwdManifest.name}@${cwdManifest.version}`; + try { + manifest = this.resolver.getStrictResolvedPattern(cwdPackage); + } catch (e) { + this.reporter.warn(this.reporter.lang('unknownPackage', cwdPackage)); + return patterns; + } + + let newPatterns = patterns; + this._iterateAddedPackages((pattern, registry, dependencyType, pkgName, version) => { + // remove added package from patterns list + const filtered = newPatterns.filter(p => p !== pattern); + (0, (_invariant || _load_invariant()).default)(newPatterns.length - filtered.length > 0, `expect added pattern '${pattern}' in the list: ${patterns.toString()}`); + newPatterns = filtered; + + // add new package into in-memory manifest so they can be linked properly + manifest[dependencyType] = manifest[dependencyType] || {}; + if (manifest[dependencyType][pkgName] === version) { + // package already existed + return; + } + + // update dependencies in the manifest + (0, (_invariant || _load_invariant()).default)(manifest._reference, 'manifest._reference should not be null'); + const ref = manifest._reference; + + ref['dependencies'] = ref['dependencies'] || []; + ref['dependencies'].push(pattern); + }); + + return newPatterns; + } + + bailout(patterns, workspaceLayout) { + var _this = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const lockfileCache = _this.lockfile.cache; + if (!lockfileCache) { + return false; + } + const match = yield _this.integrityChecker.check(patterns, lockfileCache, _this.flags, workspaceLayout); + const haveLockfile = yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(_this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); + if (match.integrityFileMissing && haveLockfile) { + // Integrity file missing, force script installations + _this.scripts.setForce(true); + } + return false; + })(); + } + + /** + * Description + */ + + init() { + var _this2 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const isWorkspaceRoot = _this2.config.workspaceRootFolder && _this2.config.cwd === _this2.config.workspaceRootFolder; + + // running "yarn add something" in a workspace root is often a mistake + if (isWorkspaceRoot && !_this2.flags.ignoreWorkspaceRootCheck) { + throw new (_errors || _load_errors()).MessageError(_this2.reporter.lang('workspacesAddRootCheck')); + } + + _this2.addedPatterns = []; + const patterns = yield (_install || _load_install()).Install.prototype.init.call(_this2); + yield _this2.maybeOutputSaveTree(patterns); + return patterns; + })(); + } + + applyChanges(manifests) { + var _this3 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield (_install || _load_install()).Install.prototype.applyChanges.call(_this3, manifests); + + // fill rootPatternsToOrigin without `excludePatterns` + yield (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(_this3); + + _this3._iterateAddedPackages(function (pattern, registry, dependencyType, pkgName, version) { + // add it to manifest + const object = manifests[registry].object; + + + object[dependencyType] = object[dependencyType] || {}; + object[dependencyType][pkgName] = version; + if (SILENCE_DEPENDENCY_TYPE_WARNINGS.indexOf(_this3.config.commandName) === -1 && dependencyType !== _this3.flagToOrigin) { + _this3.reporter.warn(_this3.reporter.lang('moduleAlreadyInManifest', pkgName, dependencyType, _this3.flagToOrigin)); + } + }); + + return true; + })(); + } + + /** + * Description + */ + + fetchRequestFromCwd() { + return (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(this, this.args); + } + + /** + * Output a tree of any newly added dependencies. + */ + + maybeOutputSaveTree(patterns) { + var _this4 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // don't limit the shown tree depth + const opts = { + reqDepth: 0 + }; + + // restore the original patterns + const merged = [...patterns, ..._this4.addedPatterns]; + + var _ref3 = yield (0, (_list || _load_list()).buildTree)(_this4.resolver, _this4.linker, merged, opts, true, true); + + const trees = _ref3.trees, + count = _ref3.count; + + + if (count === 1) { + _this4.reporter.success(_this4.reporter.lang('savedNewDependency')); + } else { + _this4.reporter.success(_this4.reporter.lang('savedNewDependencies', count)); + } + + if (!count) { + return; + } + + const resolverPatterns = new Set(); + for (var _iterator3 = patterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + const pattern = _ref4; + + var _ref5 = _this4.resolver.getResolvedPattern(pattern) || {}; + + const version = _ref5.version, + name = _ref5.name; + + resolverPatterns.add(`${name}@${version}`); + } + const directRequireDependencies = trees.filter(function ({ name }) { + return resolverPatterns.has(name); + }); + + _this4.reporter.info(_this4.reporter.lang('directDependencies')); + _this4.reporter.tree('newDirectDependencies', directRequireDependencies); + _this4.reporter.info(_this4.reporter.lang('allDependencies')); + _this4.reporter.tree('newAllDependencies', trees); + })(); + } + + /** + * Save added packages to manifest if any of the --save flags were used. + */ + + savePackages() { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {})(); + } + + _iterateAddedPackages(f) { + const patternOrigins = Object.keys(this.rootPatternsToOrigin); + + // add new patterns to their appropriate registry manifest + for (var _iterator4 = this.addedPatterns, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref6; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref6 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref6 = _i4.value; + } + + const pattern = _ref6; + + const pkg = this.resolver.getResolvedPattern(pattern); + (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${pattern}`); + const version = this.getPatternVersion(pattern, pkg); + const ref = pkg._reference; + (0, (_invariant || _load_invariant()).default)(ref, 'expected package reference'); + // lookup the package to determine dependency type; used during `yarn upgrade` + const depType = patternOrigins.reduce((acc, prev) => { + if (prev.indexOf(`${pkg.name}@`) === 0) { + return this.rootPatternsToOrigin[prev]; + } + return acc; + }, null); + + // depType is calculated when `yarn upgrade` command is used + const target = depType || this.flagToOrigin; + + f(pattern, ref.registry, target, pkg.name, version); + } + } +} + +exports.Add = Add; +function hasWrapper(commander) { + return true; +} + +function setFlags(commander) { + commander.description('Installs a package and any packages that it depends on.'); + commander.usage('add [packages ...] [flags]'); + commander.option('-W, --ignore-workspace-root-check', 'required to run yarn add inside a workspace root'); + commander.option('-D, --dev', 'save package to your `devDependencies`'); + commander.option('-P, --peer', 'save package to your `peerDependencies`'); + commander.option('-O, --optional', 'save package to your `optionalDependencies`'); + commander.option('-E, --exact', 'install exact version'); + commander.option('-T, --tilde', 'install most recent release with the same minor version'); + commander.option('-A, --audit', 'Run vulnerability audit on installed packages'); +} + +/***/ }), +/* 166 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = exports.pack = exports.packTarball = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +let packTarball = exports.packTarball = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, { mapHeader } = {}) { + const pkg = yield config.readRootManifest(); + const bundleDependencies = pkg.bundleDependencies, + main = pkg.main, + onlyFiles = pkg.files; + + // include required files + + let filters = NEVER_IGNORE.slice(); + // include default filters unless `files` is used + if (!onlyFiles) { + filters = filters.concat(DEFAULT_IGNORE); + } + if (main) { + filters = filters.concat((0, (_filter || _load_filter()).ignoreLinesToRegex)(['!/' + main])); + } + + // include bundleDependencies + let bundleDependenciesFiles = []; + if (bundleDependencies) { + for (var _iterator = bundleDependencies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + const dependency = _ref2; + + const dependencyList = depsFor(dependency, config.cwd); + + for (var _iterator2 = dependencyList, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + const dep = _ref3; + + const filesForBundledDep = yield (_fs || _load_fs()).walk(dep.baseDir, null, new Set(FOLDERS_IGNORE)); + bundleDependenciesFiles = bundleDependenciesFiles.concat(filesForBundledDep); + } + } + } + + // `files` field + if (onlyFiles) { + let lines = ['*']; + lines = lines.concat(onlyFiles.map(function (filename) { + return `!${filename}`; + }), onlyFiles.map(function (filename) { + return `!${path.join(filename, '**')}`; + })); + const regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines, './'); + filters = filters.concat(regexes); + } + + const files = yield (_fs || _load_fs()).walk(config.cwd, null, new Set(FOLDERS_IGNORE)); + const dotIgnoreFiles = (0, (_filter || _load_filter()).filterOverridenGitignores)(files); + + // create ignores + for (var _iterator3 = dotIgnoreFiles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + const file = _ref4; + + const raw = yield (_fs || _load_fs()).readFile(file.absolute); + const lines = raw.split('\n'); + + const regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines, path.dirname(file.relative)); + filters = filters.concat(regexes); + } + + // files to definitely keep, takes precedence over ignore filter + const keepFiles = new Set(); + + // files to definitely ignore + const ignoredFiles = new Set(); + + // list of files that didn't match any of our patterns, if a directory in the chain above was matched + // then we should inherit it + const possibleKeepFiles = new Set(); + + // apply filters + (0, (_filter || _load_filter()).sortFilter)(files, filters, keepFiles, possibleKeepFiles, ignoredFiles); + + // add the files for the bundled dependencies to the set of files to keep + for (var _iterator4 = bundleDependenciesFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref5; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref5 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref5 = _i4.value; + } + + const file = _ref5; + + const realPath = yield (_fs || _load_fs()).realpath(config.cwd); + keepFiles.add(path.relative(realPath, file.absolute)); + } + + return packWithIgnoreAndHeaders(config.cwd, function (name) { + const relative = path.relative(config.cwd, name); + // Don't ignore directories, since we need to recurse inside them to check for unignored files. + if (fs2.lstatSync(name).isDirectory()) { + const isParentOfKeptFile = Array.from(keepFiles).some(function (name) { + return !path.relative(relative, name).startsWith('..'); + }); + return !isParentOfKeptFile; + } + // Otherwise, ignore a file if we're not supposed to keep it. + return !keepFiles.has(relative); + }, { mapHeader }); + }); + + return function packTarball(_x) { + return _ref.apply(this, arguments); + }; +})(); + +let pack = exports.pack = (() => { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { + const packer = yield packTarball(config); + const compressor = packer.pipe(new zlib.Gzip()); + + return compressor; + }); + + return function pack(_x2) { + return _ref6.apply(this, arguments); + }; +})(); + +let run = exports.run = (() => { + var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + const pkg = yield config.readRootManifest(); + if (!pkg.name) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('noName')); + } + if (!pkg.version) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('noVersion')); + } + + const normaliseScope = function normaliseScope(name) { + return name[0] === '@' ? name.substr(1).replace('/', '-') : name; + }; + const filename = flags.filename || path.join(config.cwd, `${normaliseScope(pkg.name)}-v${pkg.version}.tgz`); + + yield config.executeLifecycleScript('prepack'); + + const stream = yield pack(config); + + yield new Promise(function (resolve, reject) { + stream.pipe(fs2.createWriteStream(filename)); + stream.on('error', reject); + stream.on('close', resolve); + }); + + yield config.executeLifecycleScript('postpack'); + + reporter.success(reporter.lang('packWroteTarball', filename)); + }); + + return function run(_x3, _x4, _x5, _x6) { + return _ref7.apply(this, arguments); + }; +})(); + +exports.packWithIgnoreAndHeaders = packWithIgnoreAndHeaders; +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(4)); +} + +var _filter; + +function _load_filter() { + return _filter = __webpack_require__(372); +} + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const zlib = __webpack_require__(198); +const path = __webpack_require__(0); +const tar = __webpack_require__(193); +const fs2 = __webpack_require__(5); +const depsFor = __webpack_require__(678); + +const FOLDERS_IGNORE = [ +// never allow version control folders +'.git', 'CVS', '.svn', '.hg', 'node_modules']; + +const DEFAULT_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([...FOLDERS_IGNORE, + +// ignore cruft +'yarn.lock', '.lock-wscript', '.wafpickle-{0..9}', '*.swp', '._*', 'npm-debug.log', 'yarn-error.log', '.npmrc', '.yarnrc', '.npmignore', '.gitignore', '.DS_Store']); + +const NEVER_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([ +// never ignore these files +'!/package.json', '!/readme*', '!/+(license|licence)*', '!/+(changes|changelog|history)*']); + +function packWithIgnoreAndHeaders(cwd, ignoreFunction, { mapHeader } = {}) { + return tar.pack(cwd, { + ignore: ignoreFunction, + map: header => { + const suffix = header.name === '.' ? '' : `/${header.name}`; + header.name = `package${suffix}`; + delete header.uid; + delete header.gid; + return mapHeader ? mapHeader(header) : header; + } + }); +} + +function setFlags(commander) { + commander.description('Creates a compressed gzip archive of package dependencies.'); + commander.option('-f, --filename ', 'filename'); +} + +function hasWrapper(commander, args) { + return true; +} + +/***/ }), +/* 167 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _index; + +function _load_index() { + return _index = _interopRequireDefault(__webpack_require__(220)); +} + +var _constants; + +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(4)); +} + +var _mutex; + +function _load_mutex() { + return _mutex = _interopRequireDefault(__webpack_require__(375)); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* eslint no-unused-vars: 0 */ + +const cmdShim = __webpack_require__(201); +const path = __webpack_require__(0); + +class BaseFetcher { + constructor(dest, remote, config) { + this.reporter = config.reporter; + this.packageName = remote.packageName; + this.reference = remote.reference; + this.registry = remote.registry; + this.hash = remote.hash; + this.remote = remote; + this.config = config; + this.dest = dest; + } + + setupMirrorFromCache() { + // fetcher subclasses may use this to perform actions such as copying over a cached tarball to the offline + // mirror etc + return Promise.resolve(); + } + + _fetch() { + return Promise.reject(new Error('Not implemented')); + } + + fetch(defaultManifest) { + var _this = this; + + return (_fs || _load_fs()).lockQueue.push(this.dest, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield (_fs || _load_fs()).mkdirp(_this.dest); + + // fetch package and get the hash + + var _ref2 = yield _this._fetch(); + + const hash = _ref2.hash; + + + const pkg = yield (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + // load the new normalized manifest + try { + return yield _this.config.readManifest(_this.dest, _this.registry); + } catch (e) { + if (e.code === 'ENOENT' && defaultManifest) { + return (0, (_index || _load_index()).default)(defaultManifest, _this.dest, _this.config, false); + } else { + throw e; + } + } + })(); + + if (pkg.bin) { + for (var _iterator = Object.keys(pkg.bin), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref4; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; + } + + const binName = _ref4; + + const binDest = `${_this.dest}/.bin`; + + // Using any sort of absolute path here would prevent makePortableProxyScript from preserving symlinks when + // calling the binary + const src = path.resolve(_this.dest, pkg.bin[binName]); + + if (yield (_fs || _load_fs()).exists(src)) { + // We ensure that the target is executable + yield (_fs || _load_fs()).chmod(src, 0o755); + } + + yield (_fs || _load_fs()).mkdirp(binDest); + if (process.platform === 'win32') { + const unlockMutex = yield (0, (_mutex || _load_mutex()).default)(src); + try { + yield cmdShim.ifExists(src, `${binDest}/${binName}`, { createPwshFile: false }); + } finally { + unlockMutex(); + } + } else { + yield (_fs || _load_fs()).symlink(src, `${binDest}/${binName}`); + } + } + } + + yield (_fs || _load_fs()).writeFile(path.join(_this.dest, (_constants || _load_constants()).METADATA_FILENAME), JSON.stringify({ + manifest: pkg, + artifacts: [], + remote: _this.remote, + registry: _this.registry, + hash + }, null, ' ')); + + return { + hash, + dest: _this.dest, + package: pkg, + cached: false + }; + })); + } +} +exports.default = BaseFetcher; + +/***/ }), +/* 168 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hash = hash; +const crypto = __webpack_require__(11); +const stream = __webpack_require__(23); + +function hash(content, type = 'md5') { + return crypto.createHash(type).update(content).digest('hex'); +} + +class HashStream extends stream.Transform { + constructor(options) { + super(options); + this._hash = crypto.createHash('sha1'); + this._updated = false; + } + + _transform(chunk, encoding, callback) { + this._updated = true; + this._hash.update(chunk); + callback(null, chunk); + } + + getHash() { + return this._hash.digest('hex'); + } + + test(sum) { + return this._updated && sum === this.getHash(); + } +} +exports.HashStream = HashStream; + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = guessName; + +var _url; + +function _load_url() { + return _url = _interopRequireDefault(__webpack_require__(24)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function cleanup(name) { + name = name.replace(/-\d+\.\d+\.\d+/, ''); + return name.replace(/\.git$|\.zip$|\.tar\.gz$|\.tar\.bz2$/, ''); +} + +function guessNameFallback(source) { + // If cannot parse as url, just return cleaned up last part + const parts = source.split('/'); + return cleanup(parts[parts.length - 1]); +} + +function guessName(source) { + try { + const parsed = (_url || _load_url()).default.parse(source); + + if (!parsed.pathname) { + return guessNameFallback(source); + } + + const parts = parsed.pathname.split('/'); + + // Priority goes to part that ends with .git + for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const part = _ref; + + if (part.match(/\.git$/)) { + return cleanup(part); + } + } + + // Most likely a directory + if (parsed.host == null) { + return cleanup(parts[parts.length - 1]); + } + + // A site like github or gitlab + if (parts.length > 2) { + return cleanup(parts[2]); + } + + // Privately hosted package? + if (parts.length > 1) { + return cleanup(parts[1]); + } + + return guessNameFallback(source); + } catch (e) { + return guessNameFallback(source); + } +} + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__(69); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; + + +/***/ }), +/* 171 */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(249); +var enumBugKeys = __webpack_require__(127); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; + + +/***/ }), +/* 172 */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.13 ToObject(argument) +var defined = __webpack_require__(91); +module.exports = function (it) { + return Object(defined(it)); +}; + + +/***/ }), +/* 173 */ +/***/ (function(module, exports, __webpack_require__) { + +var once = __webpack_require__(83); + +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; + + +/***/ }), +/* 174 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2012 Joyent, Inc. All rights reserved. + +var assert = __webpack_require__(16); +var sshpk = __webpack_require__(328); +var util = __webpack_require__(3); + +var HASH_ALGOS = { + 'sha1': true, + 'sha256': true, + 'sha512': true +}; + +var PK_ALGOS = { + 'rsa': true, + 'dsa': true, + 'ecdsa': true +}; + +function HttpSignatureError(message, caller) { + if (Error.captureStackTrace) + Error.captureStackTrace(this, caller || HttpSignatureError); + + this.message = message; + this.name = caller.name; +} +util.inherits(HttpSignatureError, Error); + +function InvalidAlgorithmError(message) { + HttpSignatureError.call(this, message, InvalidAlgorithmError); +} +util.inherits(InvalidAlgorithmError, HttpSignatureError); + +function validateAlgorithm(algorithm) { + var alg = algorithm.toLowerCase().split('-'); + + if (alg.length !== 2) { + throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' + + 'valid algorithm')); + } + + if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) { + throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' + + 'are not supported')); + } + + if (!HASH_ALGOS[alg[1]]) { + throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' + + 'supported hash algorithm')); + } + + return (alg); +} + +///--- API + +module.exports = { + + HASH_ALGOS: HASH_ALGOS, + PK_ALGOS: PK_ALGOS, + + HttpSignatureError: HttpSignatureError, + InvalidAlgorithmError: InvalidAlgorithmError, + + validateAlgorithm: validateAlgorithm, + + /** + * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file. + * + * The intent of this module is to interoperate with OpenSSL only, + * specifically the node crypto module's `verify` method. + * + * @param {String} key an OpenSSH public key. + * @return {String} PEM encoded form of the RSA public key. + * @throws {TypeError} on bad input. + * @throws {Error} on invalid ssh key formatted data. + */ + sshKeyToPEM: function sshKeyToPEM(key) { + assert.string(key, 'ssh_key'); + + var k = sshpk.parseKey(key, 'ssh'); + return (k.toString('pem')); + }, + + + /** + * Generates an OpenSSH fingerprint from an ssh public key. + * + * @param {String} key an OpenSSH public key. + * @return {String} key fingerprint. + * @throws {TypeError} on bad input. + * @throws {Error} if what you passed doesn't look like an ssh public key. + */ + fingerprint: function fingerprint(key) { + assert.string(key, 'ssh_key'); + + var k = sshpk.parseKey(key, 'ssh'); + return (k.fingerprint('md5').toString('hex')); + }, + + /** + * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa) + * + * The reverse of the above function. + */ + pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) { + assert.equal('string', typeof (pem), 'typeof pem'); + + var k = sshpk.parseKey(pem, 'pem'); + k.comment = comment; + return (k.toString('ssh')); + } +}; + + +/***/ }), +/* 175 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var chalk = __webpack_require__(30); +var figures = __webpack_require__(270); + +/** + * Separator object + * Used to space/separate choices group + * @constructor + * @param {String} line Separation line content (facultative) + */ + +class Separator { + constructor(line) { + this.type = 'separator'; + this.line = chalk.dim(line || new Array(15).join(figures.line)); + } + + /** + * Stringify separator + * @return {String} the separator display string + */ + toString() { + return this.line; + } +} + +/** + * Helper function returning false if object is a separator + * @param {Object} obj object to test against + * @return {Boolean} `false` if object is a separator + */ + +Separator.exclude = function(obj) { + return obj.type !== 'separator'; +}; + +module.exports = Separator; + + +/***/ }), +/* 176 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _ = __webpack_require__(38); +var chalk = __webpack_require__(30); + +/** + * The paginator keeps track of a pointer index in a list and returns + * a subset of the choices if the list is too long. + */ + +class Paginator { + constructor(screen) { + this.pointer = 0; + this.lastIndex = 0; + this.screen = screen; + } + + paginate(output, active, pageSize) { + pageSize = pageSize || 7; + var middleOfList = Math.floor(pageSize / 2); + var lines = output.split('\n'); + + if (this.screen) { + lines = this.screen.breakLines(lines); + active = _.sum(lines.map(lineParts => lineParts.length).splice(0, active)); + lines = _.flatten(lines); + } + + // Make sure there's enough lines to paginate + if (lines.length <= pageSize) { + return output; + } + + // Move the pointer only when the user go down and limit it to the middle of the list + if ( + this.pointer < middleOfList && + this.lastIndex < active && + active - this.lastIndex < pageSize + ) { + this.pointer = Math.min(middleOfList, this.pointer + active - this.lastIndex); + } + this.lastIndex = active; + + // Duplicate the lines so it give an infinite list look + var infinite = _.flatten([lines, lines, lines]); + var topIndex = Math.max(0, active + lines.length - this.pointer); + + var section = infinite.splice(topIndex, pageSize).join('\n'); + return section + '\n' + chalk.dim('(Move up and down to reveal more choices)'); + } +} + +module.exports = Paginator; + + +/***/ }), +/* 177 */ +/***/ (function(module, exports) { + +/*! + * is-extglob + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isExtglob(str) { + return typeof str === 'string' + && /[@?!+*]\(/.test(str); +}; + + +/***/ }), +/* 178 */ +/***/ (function(module, exports, __webpack_require__) { + +/*! + * is-glob + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +var isExtglob = __webpack_require__(177); + +module.exports = function isGlob(str) { + return typeof str === 'string' + && (/[*!?{}(|)[\]]/.test(str) + || isExtglob(str)); +}; + +/***/ }), +/* 179 */ +/***/ (function(module, exports, __webpack_require__) { + +var isBuffer = __webpack_require__(729); +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'; +}; + + +/***/ }), +/* 180 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +if (!process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = { nextTick: nextTick }; +} else { + module.exports = process +} + +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); + } +} + + + +/***/ }), +/* 181 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isPromise = __webpack_require__(741); + +/** + * Return a function that will run a function asynchronously or synchronously + * + * example: + * runAsync(wrappedFunction, callback)(...args); + * + * @param {Function} func Function to run + * @param {Function} cb Callback function passed the `func` returned value + * @return {Function(arguments)} Arguments to pass to `func`. This function will in turn + * return a Promise (Node >= 0.12) or call the callbacks. + */ + +var runAsync = module.exports = function (func, cb) { + cb = cb || function () {}; + + return function () { + var async = false; + var args = arguments; + + var promise = new Promise(function (resolve, reject) { + var answer = func.apply({ + async: function () { + async = true; + return function (err, value) { + if (err) { + reject(err); + } else { + resolve(value); + } + }; + } + }, Array.prototype.slice.call(args)); + + if (!async) { + if (isPromise(answer)) { + answer.then(resolve, reject); + } else { + resolve(answer); + } + } + }); + + promise.then(cb.bind(null, null), cb); + + return promise; + } +}; + +runAsync.cb = function (func, cb) { + return runAsync(function () { + var args = Array.prototype.slice.call(arguments); + if (args.length === func.length - 1) { + args.push(this.async()); + } + return func.apply(this, args); + }, cb); +}; + + +/***/ }), +/* 182 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_Observable__ = __webpack_require__(12); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_Observable__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_observable_ConnectableObservable__ = __webpack_require__(423); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return __WEBPACK_IMPORTED_MODULE_1__internal_observable_ConnectableObservable__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_operators_groupBy__ = __webpack_require__(433); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_operators_groupBy__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internal_symbol_observable__ = __webpack_require__(117); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return __WEBPACK_IMPORTED_MODULE_3__internal_symbol_observable__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_Subject__ = __webpack_require__(36); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_Subject__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__internal_BehaviorSubject__ = __webpack_require__(419); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return __WEBPACK_IMPORTED_MODULE_5__internal_BehaviorSubject__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_ReplaySubject__ = __webpack_require__(308); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return __WEBPACK_IMPORTED_MODULE_6__internal_ReplaySubject__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__internal_AsyncSubject__ = __webpack_require__(183); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return __WEBPACK_IMPORTED_MODULE_7__internal_AsyncSubject__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__internal_scheduler_asap__ = __webpack_require__(438); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "asapScheduler", function() { return __WEBPACK_IMPORTED_MODULE_8__internal_scheduler_asap__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__internal_scheduler_async__ = __webpack_require__(40); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "asyncScheduler", function() { return __WEBPACK_IMPORTED_MODULE_9__internal_scheduler_async__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__internal_scheduler_queue__ = __webpack_require__(439); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "queueScheduler", function() { return __WEBPACK_IMPORTED_MODULE_10__internal_scheduler_queue__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__internal_scheduler_animationFrame__ = __webpack_require__(926); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "animationFrameScheduler", function() { return __WEBPACK_IMPORTED_MODULE_11__internal_scheduler_animationFrame__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__internal_scheduler_VirtualTimeScheduler__ = __webpack_require__(925); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return __WEBPACK_IMPORTED_MODULE_12__internal_scheduler_VirtualTimeScheduler__["a"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return __WEBPACK_IMPORTED_MODULE_12__internal_scheduler_VirtualTimeScheduler__["b"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__internal_Scheduler__ = __webpack_require__(421); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return __WEBPACK_IMPORTED_MODULE_13__internal_Scheduler__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__internal_Subscription__ = __webpack_require__(25); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return __WEBPACK_IMPORTED_MODULE_14__internal_Subscription__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__internal_Subscriber__ = __webpack_require__(7); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return __WEBPACK_IMPORTED_MODULE_15__internal_Subscriber__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__internal_Notification__ = __webpack_require__(184); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return __WEBPACK_IMPORTED_MODULE_16__internal_Notification__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__internal_util_pipe__ = __webpack_require__(324); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return __WEBPACK_IMPORTED_MODULE_17__internal_util_pipe__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__internal_util_noop__ = __webpack_require__(191); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_18__internal_util_noop__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__internal_util_identity__ = __webpack_require__(118); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_19__internal_util_identity__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__internal_util_isObservable__ = __webpack_require__(930); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return __WEBPACK_IMPORTED_MODULE_20__internal_util_isObservable__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__internal_util_ArgumentOutOfRangeError__ = __webpack_require__(152); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return __WEBPACK_IMPORTED_MODULE_21__internal_util_ArgumentOutOfRangeError__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__internal_util_EmptyError__ = __webpack_require__(153); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return __WEBPACK_IMPORTED_MODULE_22__internal_util_EmptyError__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__internal_util_ObjectUnsubscribedError__ = __webpack_require__(189); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return __WEBPACK_IMPORTED_MODULE_23__internal_util_ObjectUnsubscribedError__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__internal_util_UnsubscriptionError__ = __webpack_require__(441); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return __WEBPACK_IMPORTED_MODULE_24__internal_util_UnsubscriptionError__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__internal_util_TimeoutError__ = __webpack_require__(440); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return __WEBPACK_IMPORTED_MODULE_25__internal_util_TimeoutError__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__internal_observable_bindCallback__ = __webpack_require__(823); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return __WEBPACK_IMPORTED_MODULE_26__internal_observable_bindCallback__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__internal_observable_bindNodeCallback__ = __webpack_require__(824); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return __WEBPACK_IMPORTED_MODULE_27__internal_observable_bindNodeCallback__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__internal_observable_combineLatest__ = __webpack_require__(309); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return __WEBPACK_IMPORTED_MODULE_28__internal_observable_combineLatest__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__internal_observable_concat__ = __webpack_require__(186); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return __WEBPACK_IMPORTED_MODULE_29__internal_observable_concat__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__internal_observable_defer__ = __webpack_require__(310); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_30__internal_observable_defer__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__internal_observable_empty__ = __webpack_require__(39); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return __WEBPACK_IMPORTED_MODULE_31__internal_observable_empty__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__internal_observable_forkJoin__ = __webpack_require__(825); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return __WEBPACK_IMPORTED_MODULE_32__internal_observable_forkJoin__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__internal_observable_from__ = __webpack_require__(62); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "from", function() { return __WEBPACK_IMPORTED_MODULE_33__internal_observable_from__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__internal_observable_fromEvent__ = __webpack_require__(826); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return __WEBPACK_IMPORTED_MODULE_34__internal_observable_fromEvent__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__internal_observable_fromEventPattern__ = __webpack_require__(827); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return __WEBPACK_IMPORTED_MODULE_35__internal_observable_fromEventPattern__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__internal_observable_generate__ = __webpack_require__(831); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return __WEBPACK_IMPORTED_MODULE_36__internal_observable_generate__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__internal_observable_iif__ = __webpack_require__(832); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return __WEBPACK_IMPORTED_MODULE_37__internal_observable_iif__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__internal_observable_interval__ = __webpack_require__(833); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return __WEBPACK_IMPORTED_MODULE_38__internal_observable_interval__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__internal_observable_merge__ = __webpack_require__(424); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return __WEBPACK_IMPORTED_MODULE_39__internal_observable_merge__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__internal_observable_never__ = __webpack_require__(425); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "never", function() { return __WEBPACK_IMPORTED_MODULE_40__internal_observable_never__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__internal_observable_of__ = __webpack_require__(311); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "of", function() { return __WEBPACK_IMPORTED_MODULE_41__internal_observable_of__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__internal_observable_onErrorResumeNext__ = __webpack_require__(834); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return __WEBPACK_IMPORTED_MODULE_42__internal_observable_onErrorResumeNext__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__internal_observable_pairs__ = __webpack_require__(835); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_43__internal_observable_pairs__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__internal_observable_race__ = __webpack_require__(426); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return __WEBPACK_IMPORTED_MODULE_44__internal_observable_race__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__internal_observable_range__ = __webpack_require__(836); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_45__internal_observable_range__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__internal_observable_throwError__ = __webpack_require__(313); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return __WEBPACK_IMPORTED_MODULE_46__internal_observable_throwError__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__internal_observable_timer__ = __webpack_require__(427); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return __WEBPACK_IMPORTED_MODULE_47__internal_observable_timer__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__internal_observable_using__ = __webpack_require__(837); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "using", function() { return __WEBPACK_IMPORTED_MODULE_48__internal_observable_using__["a"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__internal_observable_zip__ = __webpack_require__(314); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_49__internal_observable_zip__["a"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return __WEBPACK_IMPORTED_MODULE_31__internal_observable_empty__["b"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return __WEBPACK_IMPORTED_MODULE_40__internal_observable_never__["b"]; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__internal_config__ = __webpack_require__(185); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return __WEBPACK_IMPORTED_MODULE_50__internal_config__["a"]; }); +/** PURE_IMPORTS_START PURE_IMPORTS_END */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +//# sourceMappingURL=index.js.map + + +/***/ }), +/* 183 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncSubject; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(36); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(25); +/** PURE_IMPORTS_START tslib,_Subject,_Subscription PURE_IMPORTS_END */ + + + +var AsyncSubject = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */].EMPTY; + } + else if (this.hasCompleted && this.hasNext) { + subscriber.next(this.value); + subscriber.complete(); + return __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* 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; +}(__WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */])); + +//# sourceMappingURL=AsyncSubject.js.map + + +/***/ }), +/* 184 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Notification; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_empty__ = __webpack_require__(39); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_of__ = __webpack_require__(311); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_throwError__ = __webpack_require__(313); +/** 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__observable_of__["a" /* of */])(this.value); + case 'E': + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_throwError__["a" /* throwError */])(this.error); + case 'C': + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__observable_empty__["a" /* 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 + + +/***/ }), +/* 185 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", 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 + + +/***/ }), +/* 186 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = concat; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isScheduler__ = __webpack_require__(49); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__of__ = __webpack_require__(311); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__from__ = __webpack_require__(62); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__operators_concatAll__ = __webpack_require__(429); +/** 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 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isScheduler__["a" /* isScheduler */])(observables[1]))) { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__from__["a" /* from */])(observables[0]); + } + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__operators_concatAll__["a" /* concatAll */])()(__WEBPACK_IMPORTED_MODULE_1__of__["a" /* of */].apply(void 0, observables)); +} +//# sourceMappingURL=concat.js.map + + +/***/ }), +/* 187 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = reduce; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scan__ = __webpack_require__(317); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__takeLast__ = __webpack_require__(320); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__defaultIfEmpty__ = __webpack_require__(146); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_pipe__ = __webpack_require__(324); +/** PURE_IMPORTS_START _scan,_takeLast,_defaultIfEmpty,_util_pipe PURE_IMPORTS_END */ + + + + +function reduce(accumulator, seed) { + if (arguments.length >= 2) { + return function reduceOperatorFunctionWithSeed(source) { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["a" /* pipe */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__scan__["a" /* scan */])(accumulator, seed), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__takeLast__["a" /* takeLast */])(1), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__defaultIfEmpty__["a" /* defaultIfEmpty */])(seed))(source); + }; + } + return function reduceOperatorFunction(source) { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["a" /* pipe */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__scan__["a" /* scan */])(function (acc, value, index) { return accumulator(acc, value, index + 1); }), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__takeLast__["a" /* takeLast */])(1))(source); + }; +} +//# sourceMappingURL=reduce.js.map + + +/***/ }), +/* 188 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return throwIfEmpty; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tap__ = __webpack_require__(435); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_EmptyError__ = __webpack_require__(153); +/** PURE_IMPORTS_START _tap,_util_EmptyError PURE_IMPORTS_END */ + + +var throwIfEmpty = function (errorFactory) { + if (errorFactory === void 0) { + errorFactory = defaultErrorFactory; + } + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__tap__["a" /* tap */])({ + hasValue: false, + next: function () { this.hasValue = true; }, + complete: function () { + if (!this.hasValue) { + throw errorFactory(); + } + } + }); +}; +function defaultErrorFactory() { + return new __WEBPACK_IMPORTED_MODULE_1__util_EmptyError__["a" /* EmptyError */](); +} +//# sourceMappingURL=throwIfEmpty.js.map + + +/***/ }), +/* 189 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ObjectUnsubscribedError; }); +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +function ObjectUnsubscribedErrorImpl() { + Error.call(this); + this.message = 'object unsubscribed'; + this.name = 'ObjectUnsubscribedError'; + return this; +} +ObjectUnsubscribedErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype); +var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl; +//# sourceMappingURL=ObjectUnsubscribedError.js.map + + +/***/ }), +/* 190 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = isNumeric; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArray__ = __webpack_require__(41); +/** PURE_IMPORTS_START _isArray PURE_IMPORTS_END */ + +function isNumeric(val) { + return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isArray__["a" /* isArray */])(val) && (val - parseFloat(val) + 1) >= 0; +} +//# sourceMappingURL=isNumeric.js.map + + +/***/ }), +/* 191 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = noop; +/** PURE_IMPORTS_START PURE_IMPORTS_END */ +function noop() { } +//# sourceMappingURL=noop.js.map + + +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2015 Joyent, Inc. + +module.exports = { + read: read, + readSSHPrivate: readSSHPrivate, + write: write +}; + +var assert = __webpack_require__(16); +var asn1 = __webpack_require__(66); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var utils = __webpack_require__(26); +var crypto = __webpack_require__(11); + +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(33); +var pem = __webpack_require__(86); +var rfc4253 = __webpack_require__(103); +var SSHBuffer = __webpack_require__(159); +var errors = __webpack_require__(74); + +var bcrypt; + +function read(buf, options) { + return (pem.read(buf, options)); +} + +var MAGIC = 'openssh-key-v1'; + +function readSSHPrivate(type, buf, options) { + buf = new SSHBuffer({buffer: buf}); + + var magic = buf.readCString(); + assert.strictEqual(magic, MAGIC, 'bad magic string'); + + var cipher = buf.readString(); + var kdf = buf.readString(); + var kdfOpts = buf.readBuffer(); + + var nkeys = buf.readInt(); + if (nkeys !== 1) { + throw (new Error('OpenSSH-format key file contains ' + + 'multiple keys: this is unsupported.')); + } + + var pubKey = buf.readBuffer(); + + if (type === 'public') { + assert.ok(buf.atEnd(), 'excess bytes left after key'); + return (rfc4253.read(pubKey)); + } + + var privKeyBlob = buf.readBuffer(); + assert.ok(buf.atEnd(), 'excess bytes left after key'); + + var kdfOptsBuf = new SSHBuffer({ buffer: kdfOpts }); + switch (kdf) { + case 'none': + if (cipher !== 'none') { + throw (new Error('OpenSSH-format key uses KDF "none" ' + + 'but specifies a cipher other than "none"')); + } + break; + case 'bcrypt': + var salt = kdfOptsBuf.readBuffer(); + var rounds = kdfOptsBuf.readInt(); + var cinf = utils.opensshCipherInfo(cipher); + if (bcrypt === undefined) { + bcrypt = __webpack_require__(379); + } + + if (typeof (options.passphrase) === 'string') { + options.passphrase = Buffer.from(options.passphrase, + 'utf-8'); + } + if (!Buffer.isBuffer(options.passphrase)) { + throw (new errors.KeyEncryptedError( + options.filename, 'OpenSSH')); + } + + var pass = new Uint8Array(options.passphrase); + var salti = new Uint8Array(salt); + /* Use the pbkdf to derive both the key and the IV. */ + var out = new Uint8Array(cinf.keySize + cinf.blockSize); + var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length, + out, out.length, rounds); + if (res !== 0) { + throw (new Error('bcrypt_pbkdf function returned ' + + 'failure, parameters invalid')); + } + out = Buffer.from(out); + var ckey = out.slice(0, cinf.keySize); + var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize); + var cipherStream = crypto.createDecipheriv(cinf.opensslName, + ckey, iv); + cipherStream.setAutoPadding(false); + var chunk, chunks = []; + cipherStream.once('error', function (e) { + if (e.toString().indexOf('bad decrypt') !== -1) { + throw (new Error('Incorrect passphrase ' + + 'supplied, could not decrypt key')); + } + throw (e); + }); + cipherStream.write(privKeyBlob); + cipherStream.end(); + while ((chunk = cipherStream.read()) !== null) + chunks.push(chunk); + privKeyBlob = Buffer.concat(chunks); + break; + default: + throw (new Error( + 'OpenSSH-format key uses unknown KDF "' + kdf + '"')); + } + + buf = new SSHBuffer({buffer: privKeyBlob}); + + var checkInt1 = buf.readInt(); + var checkInt2 = buf.readInt(); + if (checkInt1 !== checkInt2) { + throw (new Error('Incorrect passphrase supplied, could not ' + + 'decrypt key')); + } + + var ret = {}; + var key = rfc4253.readInternal(ret, 'private', buf.remainder()); + + buf.skip(ret.consumed); + + var comment = buf.readString(); + key.comment = comment; + + return (key); +} + +function write(key, options) { + var pubKey; + if (PrivateKey.isPrivateKey(key)) + pubKey = key.toPublic(); + else + pubKey = key; + + var cipher = 'none'; + var kdf = 'none'; + var kdfopts = Buffer.alloc(0); + var cinf = { blockSize: 8 }; + var passphrase; + if (options !== undefined) { + passphrase = options.passphrase; + if (typeof (passphrase) === 'string') + passphrase = Buffer.from(passphrase, 'utf-8'); + if (passphrase !== undefined) { + assert.buffer(passphrase, 'options.passphrase'); + assert.optionalString(options.cipher, 'options.cipher'); + cipher = options.cipher; + if (cipher === undefined) + cipher = 'aes128-ctr'; + cinf = utils.opensshCipherInfo(cipher); + kdf = 'bcrypt'; + } + } + + var privBuf; + if (PrivateKey.isPrivateKey(key)) { + privBuf = new SSHBuffer({}); + var checkInt = crypto.randomBytes(4).readUInt32BE(0); + privBuf.writeInt(checkInt); + privBuf.writeInt(checkInt); + privBuf.write(key.toBuffer('rfc4253')); + privBuf.writeString(key.comment || ''); + + var n = 1; + while (privBuf._offset % cinf.blockSize !== 0) + privBuf.writeChar(n++); + privBuf = privBuf.toBuffer(); + } + + switch (kdf) { + case 'none': + break; + case 'bcrypt': + var salt = crypto.randomBytes(16); + var rounds = 16; + var kdfssh = new SSHBuffer({}); + kdfssh.writeBuffer(salt); + kdfssh.writeInt(rounds); + kdfopts = kdfssh.toBuffer(); + + if (bcrypt === undefined) { + bcrypt = __webpack_require__(379); + } + var pass = new Uint8Array(passphrase); + var salti = new Uint8Array(salt); + /* Use the pbkdf to derive both the key and the IV. */ + var out = new Uint8Array(cinf.keySize + cinf.blockSize); + var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length, + out, out.length, rounds); + if (res !== 0) { + throw (new Error('bcrypt_pbkdf function returned ' + + 'failure, parameters invalid')); + } + out = Buffer.from(out); + var ckey = out.slice(0, cinf.keySize); + var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize); + + var cipherStream = crypto.createCipheriv(cinf.opensslName, + ckey, iv); + cipherStream.setAutoPadding(false); + var chunk, chunks = []; + cipherStream.once('error', function (e) { + throw (e); + }); + cipherStream.write(privBuf); + cipherStream.end(); + while ((chunk = cipherStream.read()) !== null) + chunks.push(chunk); + privBuf = Buffer.concat(chunks); + break; + default: + throw (new Error('Unsupported kdf ' + kdf)); + } + + var buf = new SSHBuffer({}); + + buf.writeCString(MAGIC); + buf.writeString(cipher); /* cipher */ + buf.writeString(kdf); /* kdf */ + buf.writeBuffer(kdfopts); /* kdfoptions */ + + buf.writeInt(1); /* nkeys */ + buf.writeBuffer(pubKey.toBuffer('rfc4253')); + + if (privBuf) + buf.writeBuffer(privBuf); + + buf = buf.toBuffer(); + + var header; + if (PrivateKey.isPrivateKey(key)) + header = 'OPENSSH PRIVATE KEY'; + else + header = 'OPENSSH PUBLIC KEY'; + + var tmp = buf.toString('base64'); + var len = tmp.length + (tmp.length / 70) + + 18 + 16 + header.length*2 + 10; + buf = Buffer.alloc(len); + var o = 0; + o += buf.write('-----BEGIN ' + header + '-----\n', o); + for (var i = 0; i < tmp.length; ) { + var limit = i + 70; + if (limit > tmp.length) + limit = tmp.length; + o += buf.write(tmp.slice(i, limit), o); + buf[o++] = 10; + i = limit; + } + o += buf.write('-----END ' + header + '-----\n', o); + + return (buf.slice(0, o)); +} + + +/***/ }), +/* 193 */ +/***/ (function(module, exports, __webpack_require__) { + +var chownr = __webpack_require__(600) +var tar = __webpack_require__(460) +var pump = __webpack_require__(781) +var mkdirp = __webpack_require__(145) +var fs = __webpack_require__(5) +var path = __webpack_require__(0) +var os = __webpack_require__(46) + +var win32 = os.platform() === 'win32' + +var noop = function () {} + +var echo = function (name) { + return name +} + +var normalize = !win32 ? echo : function (name) { + return name.replace(/\\/g, '/').replace(/[:?<>|]/g, '_') +} + +var statAll = function (fs, stat, cwd, ignore, entries, sort) { + var queue = entries || ['.'] + + return function loop (callback) { + if (!queue.length) return callback() + var next = queue.shift() + var nextAbs = path.join(cwd, next) + + stat(nextAbs, function (err, stat) { + if (err) return callback(err) + + if (!stat.isDirectory()) return callback(null, next, stat) + + fs.readdir(nextAbs, function (err, files) { + if (err) return callback(err) + + if (sort) files.sort() + for (var i = 0; i < files.length; i++) { + if (!ignore(path.join(cwd, next, files[i]))) queue.push(path.join(next, files[i])) + } + + callback(null, next, stat) + }) + }) + } +} + +var strip = function (map, level) { + return function (header) { + header.name = header.name.split('/').slice(level).join('/') + + var linkname = header.linkname + if (linkname && (header.type === 'link' || path.isAbsolute(linkname))) { + header.linkname = linkname.split('/').slice(level).join('/') + } + + return map(header) + } +} + +exports.pack = function (cwd, opts) { + if (!cwd) cwd = '.' + if (!opts) opts = {} + + var xfs = opts.fs || fs + var ignore = opts.ignore || opts.filter || noop + var map = opts.map || noop + var mapStream = opts.mapStream || echo + var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd, ignore, opts.entries, opts.sort) + var strict = opts.strict !== false + var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask() + var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0 + var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0 + var pack = opts.pack || tar.pack() + var finish = opts.finish || noop + + if (opts.strip) map = strip(map, opts.strip) + + if (opts.readable) { + dmode |= parseInt(555, 8) + fmode |= parseInt(444, 8) + } + if (opts.writable) { + dmode |= parseInt(333, 8) + fmode |= parseInt(222, 8) + } + + var onsymlink = function (filename, header) { + xfs.readlink(path.join(cwd, filename), function (err, linkname) { + if (err) return pack.destroy(err) + header.linkname = normalize(linkname) + pack.entry(header, onnextentry) + }) + } + + var onstat = function (err, filename, stat) { + if (err) return pack.destroy(err) + if (!filename) { + if (opts.finalize !== false) pack.finalize() + return finish(pack) + } + + if (stat.isSocket()) return onnextentry() // tar does not support sockets... + + var header = { + name: normalize(filename), + mode: (stat.mode | (stat.isDirectory() ? dmode : fmode)) & umask, + mtime: stat.mtime, + size: stat.size, + type: 'file', + uid: stat.uid, + gid: stat.gid + } + + if (stat.isDirectory()) { + header.size = 0 + header.type = 'directory' + header = map(header) || header + return pack.entry(header, onnextentry) + } + + if (stat.isSymbolicLink()) { + header.size = 0 + header.type = 'symlink' + header = map(header) || header + return onsymlink(filename, header) + } + + // TODO: add fifo etc... + + header = map(header) || header + + if (!stat.isFile()) { + if (strict) return pack.destroy(new Error('unsupported type for ' + filename)) + return onnextentry() + } + + var entry = pack.entry(header, onnextentry) + if (!entry) return + + var rs = mapStream(xfs.createReadStream(path.join(cwd, filename)), header) + + rs.on('error', function (err) { // always forward errors on destroy + entry.destroy(err) + }) + + pump(rs, entry) + } + + var onnextentry = function (err) { + if (err) return pack.destroy(err) + statNext(onstat) + } + + onnextentry() + + return pack +} + +var head = function (list) { + return list.length ? list[list.length - 1] : null +} + +var processGetuid = function () { + return process.getuid ? process.getuid() : -1 +} + +var processUmask = function () { + return process.umask ? process.umask() : 0 +} + +exports.extract = function (cwd, opts) { + if (!cwd) cwd = '.' + if (!opts) opts = {} + + var xfs = opts.fs || fs + var ignore = opts.ignore || opts.filter || noop + var map = opts.map || noop + var mapStream = opts.mapStream || echo + var own = opts.chown !== false && !win32 && processGetuid() === 0 + var extract = opts.extract || tar.extract() + var stack = [] + var now = new Date() + var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask() + var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0 + var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0 + var strict = opts.strict !== false + + if (opts.strip) map = strip(map, opts.strip) + + if (opts.readable) { + dmode |= parseInt(555, 8) + fmode |= parseInt(444, 8) + } + if (opts.writable) { + dmode |= parseInt(333, 8) + fmode |= parseInt(222, 8) + } + + var utimesParent = function (name, cb) { // we just set the mtime on the parent dir again everytime we write an entry + var top + while ((top = head(stack)) && name.slice(0, top[0].length) !== top[0]) stack.pop() + if (!top) return cb() + xfs.utimes(top[0], now, top[1], cb) + } + + var utimes = function (name, header, cb) { + if (opts.utimes === false) return cb() + + if (header.type === 'directory') return xfs.utimes(name, now, header.mtime, cb) + if (header.type === 'symlink') return utimesParent(name, cb) // TODO: how to set mtime on link? + + xfs.utimes(name, now, header.mtime, function (err) { + if (err) return cb(err) + utimesParent(name, cb) + }) + } + + var chperm = function (name, header, cb) { + var link = header.type === 'symlink' + var chmod = link ? xfs.lchmod : xfs.chmod + var chown = link ? xfs.lchown : xfs.chown + + if (!chmod) return cb() + + var mode = (header.mode | (header.type === 'directory' ? dmode : fmode)) & umask + chmod(name, mode, function (err) { + if (err) return cb(err) + if (!own) return cb() + if (!chown) return cb() + chown(name, header.uid, header.gid, cb) + }) + } + + extract.on('entry', function (header, stream, next) { + header = map(header) || header + header.name = normalize(header.name) + var name = path.join(cwd, path.join('/', header.name)) + + if (ignore(name, header)) { + stream.resume() + return next() + } + + var stat = function (err) { + if (err) return next(err) + utimes(name, header, function (err) { + if (err) return next(err) + if (win32) return next() + chperm(name, header, next) + }) + } + + var onsymlink = function () { + if (win32) return next() // skip symlinks on win for now before it can be tested + xfs.unlink(name, function () { + xfs.symlink(header.linkname, name, stat) + }) + } + + var onlink = function () { + if (win32) return next() // skip links on win for now before it can be tested + xfs.unlink(name, function () { + var srcpath = path.join(cwd, path.join('/', header.linkname)) + + xfs.link(srcpath, name, function (err) { + if (err && err.code === 'EPERM' && opts.hardlinkAsFilesFallback) { + stream = xfs.createReadStream(srcpath) + return onfile() + } + + stat(err) + }) + }) + } + + var onfile = function () { + var ws = xfs.createWriteStream(name) + var rs = mapStream(stream, header) + + ws.on('error', function (err) { // always forward errors on destroy + rs.destroy(err) + }) + + pump(rs, ws, function (err) { + if (err) return next(err) + ws.on('close', stat) + }) + } + + if (header.type === 'directory') { + stack.push([name, header.mtime]) + return mkdirfix(name, { + fs: xfs, own: own, uid: header.uid, gid: header.gid + }, stat) + } + + var dir = path.dirname(name) + + validate(xfs, dir, path.join(cwd, '.'), function (err, valid) { + if (err) return next(err) + if (!valid) return next(new Error(dir + ' is not a valid path')) + + mkdirfix(dir, { + fs: xfs, own: own, uid: header.uid, gid: header.gid + }, function (err) { + if (err) return next(err) + + switch (header.type) { + case 'file': return onfile() + case 'link': return onlink() + case 'symlink': return onsymlink() + } + + if (strict) return next(new Error('unsupported type for ' + name + ' (' + header.type + ')')) + + stream.resume() + next() + }) + }) + }) + + if (opts.finish) extract.on('finish', opts.finish) + + return extract +} + +function validate (fs, name, root, cb) { + if (name === root) return cb(null, true) + fs.lstat(name, function (err, st) { + if (err && err.code !== 'ENOENT') return cb(err) + if (err || st.isDirectory()) return validate(fs, path.join(name, '..'), root, cb) + cb(null, false) + }) +} + +function mkdirfix (name, opts, cb) { + mkdirp(name, {fs: opts.fs}, function (err, made) { + if (!err && made && opts.own) { + chownr(made, opts.uid, opts.gid, cb) + } else { + cb(err) + } + }) +} + + +/***/ }), +/* 194 */ +/***/ (function(module, exports) { + +module.exports = {"name":"yarn","installationMethod":"unknown","version":"1.21.1","license":"BSD-2-Clause","preferGlobal":true,"description":"đŸ“Ļ🐈 Fast, reliable, and secure dependency management.","dependencies":{"@zkochan/cmd-shim":"^3.1.0","babel-runtime":"^6.26.0","bytes":"^3.0.0","camelcase":"^4.0.0","chalk":"^2.1.0","cli-table3":"^0.4.0","commander":"^2.9.0","death":"^1.0.0","debug":"^3.0.0","deep-equal":"^1.0.1","detect-indent":"^5.0.0","dnscache":"^1.0.1","glob":"^7.1.1","gunzip-maybe":"^1.4.0","hash-for-dep":"^1.2.3","imports-loader":"^0.8.0","ini":"^1.3.4","inquirer":"^6.2.0","invariant":"^2.2.0","is-builtin-module":"^2.0.0","is-ci":"^1.0.10","is-webpack-bundle":"^1.0.0","js-yaml":"^3.13.1","leven":"^2.0.0","loud-rejection":"^1.2.0","micromatch":"^2.3.11","mkdirp":"^0.5.1","node-emoji":"^1.6.1","normalize-url":"^2.0.0","npm-logical-tree":"^1.2.1","object-path":"^0.11.2","proper-lockfile":"^2.0.0","puka":"^1.0.0","read":"^1.0.7","request":"^2.87.0","request-capture-har":"^1.2.2","rimraf":"^2.5.0","semver":"^5.1.0","ssri":"^5.3.0","strip-ansi":"^4.0.0","strip-bom":"^3.0.0","tar-fs":"^1.16.0","tar-stream":"^1.6.1","uuid":"^3.0.1","v8-compile-cache":"^2.0.0","validate-npm-package-license":"^3.0.4","yn":"^2.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-eslint":"^7.2.3","babel-loader":"^6.2.5","babel-plugin-array-includes":"^2.0.3","babel-plugin-inline-import":"^3.0.0","babel-plugin-transform-builtin-extend":"^1.1.2","babel-plugin-transform-inline-imports-commonjs":"^1.0.0","babel-plugin-transform-runtime":"^6.4.3","babel-preset-env":"^1.6.0","babel-preset-flow":"^6.23.0","babel-preset-stage-0":"^6.0.0","babylon":"^6.5.0","commitizen":"^2.9.6","cz-conventional-changelog":"^2.0.0","eslint":"^4.3.0","eslint-config-fb-strict":"^22.0.0","eslint-plugin-babel":"^5.0.0","eslint-plugin-flowtype":"^2.35.0","eslint-plugin-jasmine":"^2.6.2","eslint-plugin-jest":"^21.0.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-prefer-object-spread":"^1.2.1","eslint-plugin-prettier":"^2.1.2","eslint-plugin-react":"^7.1.0","eslint-plugin-relay":"^0.0.28","eslint-plugin-yarn-internal":"file:scripts/eslint-rules","execa":"^0.11.0","fancy-log":"^1.3.2","flow-bin":"^0.66.0","git-release-notes":"^3.0.0","gulp":"^4.0.0","gulp-babel":"^7.0.0","gulp-if":"^2.0.1","gulp-newer":"^1.0.0","gulp-plumber":"^1.0.1","gulp-sourcemaps":"^2.2.0","jest":"^22.4.4","jsinspect":"^0.12.6","minimatch":"^3.0.4","mock-stdin":"^0.3.0","prettier":"^1.5.2","string-replace-loader":"^2.1.1","temp":"^0.8.3","webpack":"^2.1.0-beta.25","yargs":"^6.3.0"},"resolutions":{"sshpk":"^1.14.2"},"engines":{"node":">=4.0.0"},"repository":"yarnpkg/yarn","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"scripts":{"build":"gulp build","build-bundle":"node ./scripts/build-webpack.js","build-chocolatey":"powershell ./scripts/build-chocolatey.ps1","build-deb":"./scripts/build-deb.sh","build-dist":"bash ./scripts/build-dist.sh","build-win-installer":"scripts\\build-windows-installer.bat","changelog":"git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md","dupe-check":"yarn jsinspect ./src","lint":"eslint . && flow check","pkg-tests":"yarn --cwd packages/pkg-tests jest yarn.test.js","prettier":"eslint src __tests__ --fix","release-branch":"./scripts/release-branch.sh","test":"yarn lint && yarn test-only","test-only":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose","test-only-debug":"node --inspect-brk --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --verbose","test-coverage":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose","watch":"gulp watch","commit":"git-cz"},"jest":{"collectCoverageFrom":["src/**/*.js"],"testEnvironment":"node","modulePathIgnorePatterns":["__tests__/fixtures/","packages/pkg-tests/pkg-tests-fixtures","dist/"],"testPathIgnorePatterns":["__tests__/(fixtures|__mocks__)/","updates/","_(temp|mock|install|init|helpers).js$","packages/pkg-tests"]},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}} + +/***/ }), +/* 195 */ /***/ (function(module, exports) { module.exports = require("https"); /***/ }), -/* 152 */ +/* 196 */ /***/ (function(module, exports) { module.exports = require("querystring"); /***/ }), -/* 153 */ +/* 197 */ /***/ (function(module, exports) { module.exports = require("readline"); /***/ }), -/* 154 */ +/* 198 */ +/***/ (function(module, exports) { + +module.exports = require("zlib"); + +/***/ }), +/* 199 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48484,19 +46707,19 @@ exports.default = stringify; var _misc; function _load_misc() { - return _misc = __webpack_require__(10); + return _misc = __webpack_require__(18); } var _constants; function _load_constants() { - return _constants = __webpack_require__(7); + return _constants = __webpack_require__(8); } var _package; function _load_package() { - return _package = __webpack_require__(149); + return _package = __webpack_require__(194); } const NODE_VERSION = process.version; @@ -48518,8 +46741,9 @@ const priorities = { version: 2, uid: 3, resolved: 4, - registry: 5, - dependencies: 6 + integrity: 5, + registry: 6, + dependencies: 7 }; function priorityThenAlphaSort(a, b) { @@ -48552,7 +46776,6 @@ function _stringify(obj, options) { continue; } - // const valKeys = [key]; // get all keys that have the same value equality, we only want this for objects @@ -48565,7 +46788,6 @@ function _stringify(obj, options) { } } - // const keyLine = valKeys.sort((_misc || _load_misc()).sortAlpha).map(maybeWrap).join(', '); if (typeof val === 'string' || typeof val === 'boolean' || typeof val === 'number') { @@ -48605,7 +46827,7 @@ function stringify(obj, noHeader, enableVersions) { } /***/ }), -/* 155 */ +/* 200 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48618,12 +46840,12 @@ Object.defineProperty(exports, "__esModule", { var _consoleReporter; function _load_consoleReporter() { - return _consoleReporter = __webpack_require__(426); + return _consoleReporter = __webpack_require__(561); } Object.defineProperty(exports, 'ConsoleReporter', { enumerable: true, - get: function () { + get: function get() { return _interopRequireDefault(_consoleReporter || _load_consoleReporter()).default; } }); @@ -48631,12 +46853,12 @@ Object.defineProperty(exports, 'ConsoleReporter', { var _bufferReporter; function _load_bufferReporter() { - return _bufferReporter = __webpack_require__(425); + return _bufferReporter = __webpack_require__(560); } Object.defineProperty(exports, 'BufferReporter', { enumerable: true, - get: function () { + get: function get() { return _interopRequireDefault(_bufferReporter || _load_bufferReporter()).default; } }); @@ -48644,12 +46866,12 @@ Object.defineProperty(exports, 'BufferReporter', { var _eventReporter; function _load_eventReporter() { - return _eventReporter = __webpack_require__(430); + return _eventReporter = __webpack_require__(565); } Object.defineProperty(exports, 'EventReporter', { enumerable: true, - get: function () { + get: function get() { return _interopRequireDefault(_eventReporter || _load_eventReporter()).default; } }); @@ -48657,12 +46879,12 @@ Object.defineProperty(exports, 'EventReporter', { var _jsonReporter; function _load_jsonReporter() { - return _jsonReporter = __webpack_require__(163); + return _jsonReporter = __webpack_require__(213); } Object.defineProperty(exports, 'JSONReporter', { enumerable: true, - get: function () { + get: function get() { return _interopRequireDefault(_jsonReporter || _load_jsonReporter()).default; } }); @@ -48670,12 +46892,12 @@ Object.defineProperty(exports, 'JSONReporter', { var _noopReporter; function _load_noopReporter() { - return _noopReporter = __webpack_require__(432); + return _noopReporter = __webpack_require__(569); } Object.defineProperty(exports, 'NoopReporter', { enumerable: true, - get: function () { + get: function get() { return _interopRequireDefault(_noopReporter || _load_noopReporter()).default; } }); @@ -48683,12 +46905,12 @@ Object.defineProperty(exports, 'NoopReporter', { var _baseReporter; function _load_baseReporter() { - return _baseReporter = __webpack_require__(78); + return _baseReporter = __webpack_require__(108); } Object.defineProperty(exports, 'Reporter', { enumerable: true, - get: function () { + get: function get() { return _interopRequireDefault(_baseReporter || _load_baseReporter()).default; } }); @@ -48696,7 +46918,661 @@ Object.defineProperty(exports, 'Reporter', { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/* 156 */ +/* 201 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 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 + +const fs = __webpack_require__(762) + +const mkdir = __webpack_require__(761) +const path = __webpack_require__(0) +const isWindows = __webpack_require__(743) +const shebangExpr = /^#!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/ +const DEFAULT_OPTIONS = { + // Create PowerShell file by default if the option hasn't been specified + createPwshFile: true, + createCmdFile: isWindows() +} + +function cmdShimIfExists (src, to, opts) { + opts = Object.assign({}, DEFAULT_OPTIONS, opts) + return fs.stat(src) + .then(() => cmdShim(src, to, opts)) + .catch(() => {}) +} + +// Try to unlink, but ignore errors. +// Any problems will surface later. +function rm (path) { + return fs.unlink(path).catch(() => {}) +} + +function cmdShim (src, to, opts) { + opts = Object.assign({}, DEFAULT_OPTIONS, opts) + return fs.stat(src) + .then(() => cmdShim_(src, to, opts)) +} + +function cmdShim_ (src, to, opts) { + return Promise.all([ + rm(to), + rm(`${to}.ps1`), + opts.createCmdFile && rm(`${to}.cmd`) + ]) + .then(() => writeShim(src, to, opts)) +} + +function writeShim (src, to, opts) { + opts = Object.assign({}, DEFAULT_OPTIONS, opts) + const defaultArgs = opts.preserveSymlinks ? '--preserve-symlinks' : '' + // 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. + return mkdir(path.dirname(to)) + .then(() => { + return fs.readFile(src, 'utf8') + .then(data => { + const firstLine = data.trim().split(/\r*\n/)[0] + const shebang = firstLine.match(shebangExpr) + if (!shebang) return writeShim_(src, to, Object.assign({}, opts, {args: defaultArgs})) + const prog = shebang[1] + const args = (shebang[2] && ((defaultArgs && (shebang[2] + ' ' + defaultArgs)) || shebang[2])) || defaultArgs + return writeShim_(src, to, Object.assign({}, opts, {prog, args})) + }) + .catch(() => writeShim_(src, to, Object.assign({}, opts, {args: defaultArgs}))) + }) +} + +function writeShim_ (src, to, opts) { + opts = Object.assign({}, DEFAULT_OPTIONS, opts) + let shTarget = path.relative(path.dirname(to), src) + let target = shTarget.split('/').join('\\') + let longProg + let prog = opts.prog + let shProg = prog && prog.split('\\').join('/') + let shLongProg + let pwshProg = shProg && `"${shProg}$exe"` + let pwshLongProg + shTarget = shTarget.split('\\').join('/') + let args = opts.args || '' + let { + win32: nodePath, + posix: shNodePath + } = normalizePathEnvVar(opts.nodePath) + if (!prog) { + prog = `"%~dp0\\${target}"` + shProg = `"$basedir/${shTarget}"` + pwshProg = shProg + args = '' + target = '' + shTarget = '' + } else { + longProg = `"%~dp0\\${prog}.exe"` + shLongProg = '"$basedir/' + prog + '"' + pwshLongProg = `"$basedir/${prog}$exe"` + target = `"%~dp0\\${target}"` + shTarget = `"$basedir/${shTarget}"` + } + + let cmd + if (opts.createCmdFile) { + // @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" %* + // ) + cmd = nodePath ? `@SET NODE_PATH=${nodePath}\r\n` : '' + 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 + + let sh = '#!/bin/sh\n' + 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' + const env = opts.nodePath ? `NODE_PATH="${shNodePath}" ` : '' + + if (shLongProg) { + sh = sh + + 'if [ -x ' + shLongProg + ' ]; then\n' + + ' ' + env + shLongProg + ' ' + args + ' ' + shTarget + ' "$@"\n' + + ' ret=$?\n' + + 'else \n' + + ' ' + env + shProg + ' ' + args + ' ' + shTarget + ' "$@"\n' + + ' ret=$?\n' + + 'fi\n' + + 'exit $ret\n' + } else { + sh = sh + env + shProg + ' ' + args + ' ' + shTarget + ' "$@"\n' + + 'exit $?\n' + } + + // #!/usr/bin/env pwsh + // $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + // + // $ret=0 + // $exe = "" + // if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + // # Fix case when both the Windows and Linux builds of Node + // # are installed in the same directory + // $exe = ".exe" + // } + // if (Test-Path "$basedir/node") { + // & "$basedir/node$exe" "$basedir/node_modules/npm/bin/npm-cli.js" $args + // $ret=$LASTEXITCODE + // } else { + // & "node$exe" "$basedir/node_modules/npm/bin/npm-cli.js" $args + // $ret=$LASTEXITCODE + // } + // exit $ret + let pwsh = '#!/usr/bin/env pwsh\n' + + '$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n' + + '\n' + + '$exe=""\n' + + (opts.nodePath ? '$env_node_path=$env:NODE_PATH\n' + + `$env:NODE_PATH="${nodePath}"\n` : '') + + 'if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {\n' + + ' # Fix case when both the Windows and Linux builds of Node\n' + + ' # are installed in the same directory\n' + + ' $exe=".exe"\n' + + '}' + if (opts.nodePath) { + pwsh = pwsh + + ' else {\n' + + ` $env:NODE_PATH="${shNodePath}"\n` + + '}' + } + pwsh += '\n' + if (shLongProg) { + pwsh = pwsh + + '$ret=0\n' + + `if (Test-Path ${pwshLongProg}) {\n` + + ` & ${pwshLongProg} ${args} ${shTarget} $args\n` + + ' $ret=$LASTEXITCODE\n' + + '} else {\n' + + ` & ${pwshProg} ${args} ${shTarget} $args\n` + + ' $ret=$LASTEXITCODE\n' + + '}\n' + + (opts.nodePath ? '$env:NODE_PATH=$env_node_path\n' : '') + + 'exit $ret\n' + } else { + pwsh = pwsh + + `& ${pwshProg} ${args} ${shTarget} $args\n` + + (opts.nodePath ? '$env:NODE_PATH=$env_node_path\n' : '') + + 'exit $LASTEXITCODE\n' + } + + return Promise.all([ + opts.createCmdFile && fs.writeFile(to + '.cmd', cmd, 'utf8'), + opts.createPwshFile && fs.writeFile(`${to}.ps1`, pwsh, 'utf8'), + fs.writeFile(to, sh, 'utf8') + ]) + .then(() => chmodShim(to, opts)) +} + +function chmodShim (to, {createCmdFile, createPwshFile}) { + return Promise.all([ + fs.chmod(to, 0o755), + createPwshFile && fs.chmod(`${to}.ps1`, 0o755), + createCmdFile && fs.chmod(`${to}.cmd`, 0o755) + ]) +} + +/** + * @param {string|string[]} nodePath + * @returns {{win32:string,posix:string}} + */ +function normalizePathEnvVar (nodePath) { + if (!nodePath) { + return { + win32: nodePath, + posix: nodePath + } + } + let split = (typeof nodePath === 'string' ? nodePath.split(path.delimiter) : Array.from(nodePath)) + let result = {} + for (let i = 0; i < split.length; i++) { + const win32 = split[i].split('/').join('\\') + const posix = isWindows() ? split[i].split('\\').join('/').replace(/^([^:\\/]*):/, (_, $1) => `/mnt/${$1.toLowerCase()}`) : split[i] + + result.win32 = result.win32 ? `${result.win32};${win32}` : win32 + result.posix = result.posix ? `${result.posix}:${posix}` : posix + + result[i] = {win32, posix} + } + return result +} + + +/***/ }), +/* 202 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var resolve = __webpack_require__(203); + +module.exports = { + Validation: errorSubclass(ValidationError), + MissingRef: errorSubclass(MissingRefError) +}; + + +function ValidationError(errors) { + this.message = 'validation failed'; + this.errors = errors; + this.ajv = this.validation = true; +} + + +MissingRefError.message = function (baseId, ref) { + return 'can\'t resolve reference ' + ref + ' from id ' + baseId; +}; + + +function MissingRefError(baseId, ref, message) { + this.message = message || MissingRefError.message(baseId, ref); + this.missingRef = resolve.url(baseId, ref); + this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef)); +} + + +function errorSubclass(Subclass) { + Subclass.prototype = Object.create(Error.prototype); + Subclass.prototype.constructor = Subclass; + return Subclass; +} + + +/***/ }), +/* 203 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var url = __webpack_require__(24) + , equal = __webpack_require__(204) + , util = __webpack_require__(106) + , SchemaObject = __webpack_require__(339) + , traverse = __webpack_require__(503); + +module.exports = resolve; + +resolve.normalizeId = normalizeId; +resolve.fullPath = getFullPath; +resolve.url = resolveUrl; +resolve.ids = resolveIds; +resolve.inlineRef = inlineRef; +resolve.schema = resolveSchema; + +/** + * [resolve and compile the references ($ref)] + * @this Ajv + * @param {Function} compile reference to schema compilation funciton (localCompile) + * @param {Object} root object with information about the root schema for the current schema + * @param {String} ref reference to resolve + * @return {Object|Function} schema object (if the schema can be inlined) or validation function + */ +function resolve(compile, root, ref) { + /* jshint validthis: true */ + var refVal = this._refs[ref]; + if (typeof refVal == 'string') { + if (this._refs[refVal]) refVal = this._refs[refVal]; + else return resolve.call(this, compile, root, refVal); + } + + refVal = refVal || this._schemas[ref]; + if (refVal instanceof SchemaObject) { + return inlineRef(refVal.schema, this._opts.inlineRefs) + ? refVal.schema + : refVal.validate || this._compile(refVal); + } + + var res = resolveSchema.call(this, root, ref); + var schema, v, baseId; + if (res) { + schema = res.schema; + root = res.root; + baseId = res.baseId; + } + + if (schema instanceof SchemaObject) { + v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId); + } else if (schema !== undefined) { + v = inlineRef(schema, this._opts.inlineRefs) + ? schema + : compile.call(this, schema, root, undefined, baseId); + } + + return v; +} + + +/** + * Resolve schema, its root and baseId + * @this Ajv + * @param {Object} root root object with properties schema, refVal, refs + * @param {String} ref reference to resolve + * @return {Object} object with properties schema, root, baseId + */ +function resolveSchema(root, ref) { + /* jshint validthis: true */ + var p = url.parse(ref, false, true) + , refPath = _getFullPath(p) + , baseId = getFullPath(this._getId(root.schema)); + if (refPath !== baseId) { + var id = normalizeId(refPath); + var refVal = this._refs[id]; + if (typeof refVal == 'string') { + return resolveRecursive.call(this, root, refVal, p); + } else if (refVal instanceof SchemaObject) { + if (!refVal.validate) this._compile(refVal); + root = refVal; + } else { + refVal = this._schemas[id]; + if (refVal instanceof SchemaObject) { + if (!refVal.validate) this._compile(refVal); + if (id == normalizeId(ref)) + return { schema: refVal, root: root, baseId: baseId }; + root = refVal; + } else { + return; + } + } + if (!root.schema) return; + baseId = getFullPath(this._getId(root.schema)); + } + return getJsonPointer.call(this, p, baseId, root.schema, root); +} + + +/* @this Ajv */ +function resolveRecursive(root, ref, parsedRef) { + /* jshint validthis: true */ + var res = resolveSchema.call(this, root, ref); + if (res) { + var schema = res.schema; + var baseId = res.baseId; + root = res.root; + var id = this._getId(schema); + if (id) baseId = resolveUrl(baseId, id); + return getJsonPointer.call(this, parsedRef, baseId, schema, root); + } +} + + +var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']); +/* @this Ajv */ +function getJsonPointer(parsedRef, baseId, schema, root) { + /* jshint validthis: true */ + parsedRef.hash = parsedRef.hash || ''; + if (parsedRef.hash.slice(0,2) != '#/') return; + var parts = parsedRef.hash.split('/'); + + for (var i = 1; i < parts.length; i++) { + var part = parts[i]; + if (part) { + part = util.unescapeFragment(part); + schema = schema[part]; + if (schema === undefined) break; + var id; + if (!PREVENT_SCOPE_CHANGE[part]) { + id = this._getId(schema); + if (id) baseId = resolveUrl(baseId, id); + if (schema.$ref) { + var $ref = resolveUrl(baseId, schema.$ref); + var res = resolveSchema.call(this, root, $ref); + if (res) { + schema = res.schema; + root = res.root; + baseId = res.baseId; + } + } + } + } + } + if (schema !== undefined && schema !== root.schema) + return { schema: schema, root: root, baseId: baseId }; +} + + +var SIMPLE_INLINED = util.toHash([ + 'type', 'format', 'pattern', + 'maxLength', 'minLength', + 'maxProperties', 'minProperties', + 'maxItems', 'minItems', + 'maximum', 'minimum', + 'uniqueItems', 'multipleOf', + 'required', 'enum' +]); +function inlineRef(schema, limit) { + if (limit === false) return false; + if (limit === undefined || limit === true) return checkNoRef(schema); + else if (limit) return countKeys(schema) <= limit; +} + + +function checkNoRef(schema) { + var item; + if (Array.isArray(schema)) { + for (var i=0; i All rights reserved. @@ -48704,7 +47580,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de module.exports = { - newInvalidAsn1Error: function(msg) { + newInvalidAsn1Error: function (msg) { var e = new Error(); e.name = 'InvalidAsn1Error'; e.message = msg || ''; @@ -48715,7 +47591,7 @@ module.exports = { /***/ }), -/* 157 */ +/* 206 */ /***/ (function(module, exports) { // Copyright 2011 Mark Cavage All rights reserved. @@ -48757,222 +47633,7 @@ module.exports = { /***/ }), -/* 158 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.pack = exports.packTarball = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); -} - -let packTarball = exports.packTarball = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { - var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let mapHeader = _ref2.mapHeader; - - const pkg = yield config.readRootManifest(); - const bundledDependencies = pkg.bundledDependencies, - main = pkg.main, - onlyFiles = pkg.files; - - // include required files - - let filters = NEVER_IGNORE.slice(); - // include default filters unless `files` is used - if (!onlyFiles) { - filters = filters.concat(DEFAULT_IGNORE); - } - if (main) { - filters = filters.concat((0, (_filter || _load_filter()).ignoreLinesToRegex)(['!/' + main])); - } - - // include bundledDependencies - if (bundledDependencies) { - const folder = config.getFolder(pkg); - filters = (0, (_filter || _load_filter()).ignoreLinesToRegex)(bundledDependencies.map(function (name) { - return `!${folder}/${name}`; - }), '.'); - } - - // `files` field - if (onlyFiles) { - let lines = ['*', // ignore all files except those that are explicitly included with a negation filter - '.*']; - lines = lines.concat(onlyFiles.map(function (filename) { - return `!${filename}`; - }), onlyFiles.map(function (filename) { - return `!${path.join(filename, '**')}`; - })); - const regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines, '.'); - filters = filters.concat(regexes); - } - - const files = yield (_fs || _load_fs()).walk(config.cwd, null, new Set(FOLDERS_IGNORE)); - const dotIgnoreFiles = (0, (_filter || _load_filter()).filterOverridenGitignores)(files); - - // create ignores - for (const file of dotIgnoreFiles) { - const raw = yield (_fs || _load_fs()).readFile(file.absolute); - const lines = raw.split('\n'); - - const regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines, path.dirname(file.relative)); - filters = filters.concat(regexes); - } - - // files to definitely keep, takes precedence over ignore filter - const keepFiles = new Set(); - - // files to definitely ignore - const ignoredFiles = new Set(); - - // list of files that didn't match any of our patterns, if a directory in the chain above was matched - // then we should inherit it - const possibleKeepFiles = new Set(); - - // apply filters - (0, (_filter || _load_filter()).sortFilter)(files, filters, keepFiles, possibleKeepFiles, ignoredFiles); - - const packer = tar.pack(config.cwd, { - ignore: function (name) { - const relative = path.relative(config.cwd, name); - // Don't ignore directories, since we need to recurse inside them to check for unignored files. - if (fs2.lstatSync(name).isDirectory()) { - const isParentOfKeptFile = Array.from(keepFiles).some(function (name) { - return !path.relative(relative, name).startsWith('..'); - }); - return !isParentOfKeptFile; - } - // Otherwise, ignore a file if we're not supposed to keep it. - return !keepFiles.has(relative); - }, - map: function (header) { - const suffix = header.name === '.' ? '' : `/${header.name}`; - header.name = `package${suffix}`; - delete header.uid; - delete header.gid; - return mapHeader ? mapHeader(header) : header; - } - }); - - return packer; - }); - - return function packTarball(_x) { - return _ref.apply(this, arguments); - }; -})(); - -let pack = exports.pack = (() => { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, dir) { - const packer = yield packTarball(config); - const compressor = packer.pipe(new zlib.Gzip()); - - return compressor; - }); - - return function pack(_x3, _x4) { - return _ref3.apply(this, arguments); - }; -})(); - -let run = exports.run = (() => { - var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const pkg = yield config.readRootManifest(); - if (!pkg.name) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noName')); - } - if (!pkg.version) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noVersion')); - } - - const normaliseScope = function (name) { - return name[0] === '@' ? name.substr(1).replace('/', '-') : name; - }; - const filename = flags.filename || path.join(config.cwd, `${normaliseScope(pkg.name)}-v${pkg.version}.tgz`); - - yield config.executeLifecycleScript('prepack'); - - const stream = yield pack(config, config.cwd); - - yield new Promise(function (resolve, reject) { - stream.pipe(fs2.createWriteStream(filename)); - stream.on('error', reject); - stream.on('close', resolve); - }); - - yield config.executeLifecycleScript('postpack'); - - reporter.success(reporter.lang('packWroteTarball', filename)); - }); - - return function run(_x5, _x6, _x7, _x8) { - return _ref4.apply(this, arguments); - }; -})(); - -exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); -} - -var _filter; - -function _load_filter() { - return _filter = __webpack_require__(276); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(3); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const zlib = __webpack_require__(232); -const path = __webpack_require__(0); -const tar = __webpack_require__(147); -const fs2 = __webpack_require__(5); - -const FOLDERS_IGNORE = [ -// never allow version control folders -'.git', 'CVS', '.svn', '.hg', 'node_modules']; - -const DEFAULT_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([...FOLDERS_IGNORE, - -// ignore cruft -'yarn.lock', '.lock-wscript', '.wafpickle-{0..9}', '*.swp', '._*', 'npm-debug.log', 'yarn-error.log', '.npmrc', '.yarnrc', '.npmignore', '.gitignore', '.DS_Store']); - -const NEVER_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([ -// never ignore these files -'!/package.json', '!/readme*', '!/+(license|licence)*', '!/+(changes|changelog|history)*']); - -function setFlags(commander) { - commander.option('-f, --filename ', 'filename'); -} - -function hasWrapper(commander, args) { - return true; -} - -/***/ }), -/* 159 */ +/* 207 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48986,13 +47647,13 @@ exports.getOutdated = exports.run = exports.requireLockfile = undefined; var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } let run = exports.run = (() => { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { let addArgs = []; - const upgradeAll = args.length === 0; + const upgradeAll = args.length === 0 && typeof flags.scope === 'undefined' && typeof flags.pattern === 'undefined'; const addFlags = Object.assign({}, flags, { force: true, ignoreWorkspaceRootCheck: true, @@ -49034,7 +47695,7 @@ let getOutdated = exports.getOutdated = (() => { const outdatedFieldName = flags.latest ? 'latest' : 'wanted'; // ensure scope is of the form `@scope/` - const normalizeScope = function () { + const normalizeScope = function normalizeScope() { if (flags.scope) { if (!flags.scope.startsWith('@')) { flags.scope = '@' + flags.scope; @@ -49046,7 +47707,7 @@ let getOutdated = exports.getOutdated = (() => { } }; - const versionFilter = function (dep) { + const versionFilter = function versionFilter(dep) { return dep.current !== dep[outdatedFieldName]; }; @@ -49080,38 +47741,38 @@ exports.hasWrapper = hasWrapper; var _add; function _load_add() { - return _add = __webpack_require__(122); + return _add = __webpack_require__(165); } var _lockfile; function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(12)); + return _lockfile = _interopRequireDefault(__webpack_require__(19)); } var _packageRequest; function _load_packageRequest() { - return _packageRequest = _interopRequireDefault(__webpack_require__(94)); + return _packageRequest = _interopRequireDefault(__webpack_require__(122)); } var _normalizePattern; function _load_normalizePattern() { - return _normalizePattern = __webpack_require__(31); + return _normalizePattern = __webpack_require__(37); } var _install; function _load_install() { - return _install = __webpack_require__(28); + return _install = __webpack_require__(34); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // used to detect whether a semver range is simple enough to preserve when doing a --latest upgrade. // when not matched, the upgraded version range will default to `^` the same as the `add` command would. -const basicSemverOperatorRegex = new RegExp('^(\\^|~|>|<=|>=)?[^ |&,]+$'); +const basicSemverOperatorRegex = new RegExp('^(\\^|~|>=|<=)?[^ |&,]+$'); // used to detect if a passed parameter is a scope or a package name. @@ -49169,7 +47830,7 @@ function setUserRequestedPackageVersions(deps, args, latest, packagePatterns, re } // this function attempts to determine the range operator on the semver range. -// this will only handle the simple cases of a semver starting with '^', '~', '>', '>=', '<=', or an exact version. +// this will only handle the simple cases of a semver starting with '^', '~', '>=', '<=', or an exact version. // "exotic" semver ranges will not be handled. function getRangeOperator(version) { const result = basicSemverOperatorRegex.exec(version); @@ -49180,7 +47841,7 @@ function getRangeOperator(version) { // If an explicit operator was specified using --exact, --tilde, --caret, then that will take precedence. function buildPatternToUpgradeTo(dep, flags) { if (dep.latest === 'exotic') { - return dep.url; + return `${dep.name}@${dep.url}`; } const toLatest = flags.latest; @@ -49234,6 +47895,7 @@ function cleanLockfile(lockfile, deps, packagePatterns, reporter) { } function setFlags(commander) { + commander.description('Upgrades packages to their latest version based on the specified range.'); commander.usage('upgrade [flags]'); commander.option('-S, --scope ', 'upgrade packages under the specified scope'); commander.option('-L, --latest', 'list the latest version of packages, ignoring version ranges in package.json'); @@ -49241,6 +47903,7 @@ function setFlags(commander) { commander.option('-P, --pattern [pattern]', 'upgrade packages that match pattern'); commander.option('-T, --tilde', 'install most recent release with the same minor version. Only used when --latest is specified.'); commander.option('-C, --caret', 'install most recent release with the same major version. Only used when --latest is specified.'); + commander.option('-A, --audit', 'Run vulnerability audit on installed packages'); } function hasWrapper(commander, args) { @@ -49250,7 +47913,7 @@ function hasWrapper(commander, args) { const requireLockfile = exports.requireLockfile = true; /***/ }), -/* 160 */ +/* 208 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49264,19 +47927,19 @@ exports.integrityErrors = undefined; var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(29)); + return _extends2 = _interopRequireDefault(__webpack_require__(21)); } var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } var _fs; @@ -49288,20 +47951,27 @@ function _load_fs() { var _misc; function _load_misc() { - return _misc = __webpack_require__(10); + return _misc = __webpack_require__(18); +} + +var _packageNameUtils; + +function _load_packageNameUtils() { + return _packageNameUtils = __webpack_require__(222); } var _workspaceLayout; function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(81)); + return _workspaceLayout = _interopRequireDefault(__webpack_require__(90)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const invariant = __webpack_require__(6); +const invariant = __webpack_require__(9); + const path = __webpack_require__(0); const integrityErrors = exports.integrityErrors = { @@ -49312,11 +47982,11 @@ const integrityErrors = exports.integrityErrors = { LINKED_MODULES_DONT_MATCH: 'integrityCheckLinkedModulesDontMatch', PATTERNS_DONT_MATCH: 'integrityPatternsDontMatch', MODULES_FOLDERS_MISSING: 'integrityModulesFoldersMissing', - NODE_VERSION_DOESNT_MATCH: 'integrityNodeDoesntMatch' + SYSTEM_PARAMS_DONT_MATCH: 'integritySystemParamsDontMatch' }; const INTEGRITY_FILE_DEFAULTS = () => ({ - nodeVersion: process.version, + systemParams: (0, (_packageNameUtils || _load_packageNameUtils()).getSystemParams)(), modulesFolders: [], flags: [], linkedModules: [], @@ -49386,11 +48056,7 @@ class InstallationIntegrityChecker { * Get the list of the directories that contain our modules (there might be multiple such folders b/c of workspaces). */ - _getModulesFolders() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - let workspaceLayout = _ref.workspaceLayout; - + _getModulesFolders({ workspaceLayout } = {}) { const locations = []; if (this.config.modulesFolder) { @@ -49400,7 +48066,20 @@ class InstallationIntegrityChecker { } if (workspaceLayout) { - for (const workspaceName of Object.keys(workspaceLayout.workspaces)) { + for (var _iterator = Object.keys(workspaceLayout.workspaces), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const workspaceName = _ref; + const loc = workspaceLayout.workspaces[workspaceName].loc; if (loc) { @@ -49415,18 +48094,28 @@ class InstallationIntegrityChecker { /** * Get a list of the files that are located inside our module folders. */ - _getIntegrityListing() { + _getIntegrityListing({ workspaceLayout } = {}) { var _this2 = this; - var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - let workspaceLayout = _ref2.workspaceLayout; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { const files = []; const recurse = (() => { - var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { - for (const file of yield (_fs || _load_fs()).readdir(dir)) { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { + for (var _iterator2 = yield (_fs || _load_fs()).readdir(dir), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + const file = _ref3; + const entry = path.join(dir, file); const stat = yield (_fs || _load_fs()).lstat(entry); @@ -49438,12 +48127,25 @@ class InstallationIntegrityChecker { } }); - return function recurse(_x3) { - return _ref3.apply(this, arguments); + return function recurse(_x) { + return _ref2.apply(this, arguments); }; })(); - for (const modulesFolder of _this2._getModulesFolders({ workspaceLayout })) { + for (var _iterator3 = _this2._getModulesFolders({ workspaceLayout }), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + const modulesFolder = _ref4; + if (yield (_fs || _load_fs()).exists(modulesFolder)) { yield recurse(modulesFolder); } @@ -49479,7 +48181,20 @@ class InstallationIntegrityChecker { return !workspaceLayout.getManifestByPattern(p); }); - for (const name of Object.keys(workspaceLayout.workspaces)) { + for (var _iterator4 = Object.keys(workspaceLayout.workspaces), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref5; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref5 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref5 = _i4.value; + } + + const name = _ref5; + if (!workspaceLayout.workspaces[name].loc) { continue; } @@ -49487,14 +48202,40 @@ class InstallationIntegrityChecker { const manifest = workspaceLayout.workspaces[name].manifest; if (manifest) { - for (const dependencyType of (_constants || _load_constants()).DEPENDENCY_TYPES) { + for (var _iterator5 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref6; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref6 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref6 = _i5.value; + } + + const dependencyType = _ref6; + const dependencies = manifest[dependencyType]; if (!dependencies) { continue; } - for (const dep of Object.keys(dependencies)) { + for (var _iterator6 = Object.keys(dependencies), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref7; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref7 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref7 = _i6.value; + } + + const dep = _ref7; + result.topLevelPatterns.push(`${dep}@${dependencies[dep]}`); } } @@ -49511,25 +48252,59 @@ class InstallationIntegrityChecker { if (flags.flat) { result.flags.push('flat'); } - if (flags.ignoreScripts) { + + if (_this3.config.ignoreScripts) { result.flags.push('ignoreScripts'); } + if (_this3.config.focus) { + result.flags.push('focus: ' + _this3.config.focusedWorkspaceName); + } if (_this3.config.production) { result.flags.push('production'); } + if (_this3.config.plugnplayEnabled) { + result.flags.push('plugnplay'); + } + const linkedModules = _this3.config.linkedModules; if (linkedModules.length) { result.linkedModules = linkedModules.sort((_misc || _load_misc()).sortAlpha); } - for (const key of Object.keys(lockfile)) { + for (var _iterator7 = Object.keys(lockfile), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref8; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref8 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref8 = _i7.value; + } + + const key = _ref8; + result.lockfileEntries[key] = lockfile[key].resolved || ''; } - for (const modulesFolder of _this3._getModulesFolders({ workspaceLayout })) { + for (var _iterator8 = _this3._getModulesFolders({ workspaceLayout }), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { + var _ref9; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref9 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref9 = _i8.value; + } + + const modulesFolder = _ref9; + if (yield (_fs || _load_fs()).exists(modulesFolder)) { result.modulesFolders.push(path.relative(_this3.config.lockfileFolder, modulesFolder)); } @@ -49568,8 +48343,8 @@ class InstallationIntegrityChecker { return 'LINKED_MODULES_DONT_MATCH'; } - if (actual.nodeVersion !== expected.nodeVersion) { - return 'NODE_VERSION_DOESNT_MATCH'; + if (actual.systemParams !== expected.systemParams) { + return 'SYSTEM_PARAMS_DONT_MATCH'; } let relevantExpectedFlags = expected.flags.slice(); @@ -49587,13 +48362,39 @@ class InstallationIntegrityChecker { return 'PATTERNS_DONT_MATCH'; } - for (const key of Object.keys(actual.lockfileEntries)) { + for (var _iterator9 = Object.keys(actual.lockfileEntries), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { + var _ref10; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref10 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref10 = _i9.value; + } + + const key = _ref10; + if (actual.lockfileEntries[key] !== expected.lockfileEntries[key]) { return 'LOCKFILE_DONT_MATCH'; } } - for (const key of Object.keys(expected.lockfileEntries)) { + for (var _iterator10 = Object.keys(expected.lockfileEntries), _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { + var _ref11; + + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref11 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref11 = _i10.value; + } + + const key = _ref11; + if (actual.lockfileEntries[key] !== expected.lockfileEntries[key]) { return 'LOCKFILE_DONT_MATCH'; } @@ -49649,7 +48450,20 @@ class InstallationIntegrityChecker { if (integrityMatches === 'OK') { invariant(expected, "The integrity shouldn't pass without integrity file"); - for (const modulesFolder of expected.modulesFolders) { + for (var _iterator11 = expected.modulesFolders, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { + var _ref12; + + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref12 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref12 = _i11.value; + } + + const modulesFolder = _ref12; + if (!(yield (_fs || _load_fs()).exists(path.join(_this4.config.lockfileFolder, modulesFolder)))) { integrityMatches = 'MODULES_FOLDERS_MISSING'; } @@ -49661,7 +48475,7 @@ class InstallationIntegrityChecker { integrityMatches: integrityMatches === 'OK', integrityError: integrityMatches === 'OK' ? undefined : integrityMatches, missingPatterns, - hardRefreshRequired: integrityMatches === 'NODE_VERSION_DOESNT_MATCH' + hardRefreshRequired: integrityMatches === 'SYSTEM_PARAMS_DONT_MATCH' }; })(); } @@ -49721,7 +48535,502 @@ class InstallationIntegrityChecker { exports.default = InstallationIntegrityChecker; /***/ }), -/* 161 */ +/* 209 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.testEngine = testEngine; +exports.checkOne = checkOne; +exports.check = check; +exports.shouldCheck = shouldCheck; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _map; + +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(29)); +} + +var _misc; + +function _load_misc() { + return _misc = __webpack_require__(18); +} + +var _yarnVersion; + +function _load_yarnVersion() { + return _yarnVersion = __webpack_require__(120); +} + +var _semver; + +function _load_semver() { + return _semver = __webpack_require__(224); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const semver = __webpack_require__(22); + +const VERSIONS = Object.assign({}, process.versions, { + yarn: (_yarnVersion || _load_yarnVersion()).version +}); + +function isValid(items, actual) { + let isNotWhitelist = true; + let isBlacklist = false; + + for (var _iterator = items, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const item = _ref; + + // blacklist + if (item[0] === '!') { + isBlacklist = true; + + if (actual === item.slice(1)) { + return false; + } + // whitelist + } else { + isNotWhitelist = false; + + if (item === actual) { + return true; + } + } + } + + // npm allows blacklists and whitelists to be mixed. Blacklists with + // whitelisted items should be treated as whitelists. + return isBlacklist && isNotWhitelist; +} + +const aliases = (0, (_map || _load_map()).default)({ + iojs: 'node' // we should probably prompt these libraries to fix this +}); + +const ignore = ['npm', // we'll never satisfy this for obvious reasons +'teleport', // a module bundler used by some modules +'rhino', // once a target for older modules +'cordovaDependencies', // http://bit.ly/2tkUePg +'parcel']; + +function testEngine(name, range, versions, looseSemver) { + const actual = versions[name]; + if (!actual) { + return false; + } + + if (!semver.valid(actual, looseSemver)) { + return false; + } + + if (semver.satisfies(actual, range, looseSemver)) { + return true; + } + + if (name === 'yarn' && (0, (_semver || _load_semver()).satisfiesWithPrereleases)(actual, range, looseSemver)) { + return true; + } + + if (name === 'node' && semver.gt(actual, '1.0.0', looseSemver)) { + // WARNING: this is a massive hack and is super gross but necessary for compatibility + // some modules have the `engines.node` field set to a caret version below semver major v1 + // eg. ^0.12.0. this is problematic as we enforce engines checks and node is now on version >=1 + // to allow this pattern we transform the node version to fake ones in the minor range 10-13 + const major = semver.major(actual, looseSemver); + const fakes = [`0.10.${major}`, `0.11.${major}`, `0.12.${major}`, `0.13.${major}`]; + for (var _iterator2 = fakes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + const actualFake = _ref2; + + if (semver.satisfies(actualFake, range, looseSemver)) { + return true; + } + } + } + + // incompatible version + return false; +} + +function isValidArch(archs) { + return isValid(archs, process.arch); +} + +function isValidPlatform(platforms) { + return isValid(platforms, process.platform); +} + +function checkOne(info, config, ignoreEngines) { + let didIgnore = false; + let didError = false; + const reporter = config.reporter; + const human = `${info.name}@${info.version}`; + + const pushError = msg => { + const ref = info._reference; + + if (ref && ref.optional) { + ref.ignore = true; + ref.incompatible = true; + + reporter.info(`${human}: ${msg}`); + if (!didIgnore) { + reporter.info(reporter.lang('optionalCompatibilityExcluded', human)); + didIgnore = true; + } + } else { + reporter.error(`${human}: ${msg}`); + didError = true; + } + }; + + const os = info.os, + cpu = info.cpu, + engines = info.engines; + + + if (shouldCheckPlatform(os, config.ignorePlatform) && !isValidPlatform(os)) { + pushError(reporter.lang('incompatibleOS', process.platform)); + } + + if (shouldCheckCpu(cpu, config.ignorePlatform) && !isValidArch(cpu)) { + pushError(reporter.lang('incompatibleCPU', process.arch)); + } + + if (shouldCheckEngines(engines, ignoreEngines)) { + for (var _iterator3 = (0, (_misc || _load_misc()).entries)(info.engines), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + const entry = _ref3; + + let name = entry[0]; + const range = entry[1]; + + if (aliases[name]) { + name = aliases[name]; + } + + if (VERSIONS[name]) { + if (!testEngine(name, range, VERSIONS, config.looseSemver)) { + pushError(reporter.lang('incompatibleEngine', name, range, VERSIONS[name])); + } + } else if (ignore.indexOf(name) < 0) { + reporter.warn(`${human}: ${reporter.lang('invalidEngine', name)}`); + } + } + } + + if (didError) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('foundIncompatible')); + } +} + +function check(infos, config, ignoreEngines) { + for (var _iterator4 = infos, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref4; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref4 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref4 = _i4.value; + } + + const info = _ref4; + + checkOne(info, config, ignoreEngines); + } +} + +function shouldCheckCpu(cpu, ignorePlatform) { + return !ignorePlatform && Array.isArray(cpu) && cpu.length > 0; +} + +function shouldCheckPlatform(os, ignorePlatform) { + return !ignorePlatform && Array.isArray(os) && os.length > 0; +} + +function shouldCheckEngines(engines, ignoreEngines) { + return !ignoreEngines && typeof engines === 'object'; +} + +function shouldCheck(manifest, options) { + return shouldCheckCpu(manifest.cpu, options.ignorePlatform) || shouldCheckPlatform(manifest.os, options.ignorePlatform) || shouldCheckEngines(manifest.engines, options.ignoreEngines); +} + +/***/ }), +/* 210 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fetchOneRemote = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +let fetchCache = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest, fetcher, config, remote) { + // $FlowFixMe: This error doesn't make sense + var _ref2 = yield config.readPackageMetadata(dest); + + const hash = _ref2.hash, + pkg = _ref2.package, + cacheRemote = _ref2.remote; + + + const cacheIntegrity = cacheRemote.cacheIntegrity || cacheRemote.integrity; + const cacheHash = cacheRemote.hash; + + if (remote.integrity) { + if (!cacheIntegrity || !ssri.parse(cacheIntegrity).match(remote.integrity)) { + throw new (_errors || _load_errors()).SecurityError(config.reporter.lang('fetchBadIntegrityCache', pkg.name, cacheIntegrity, remote.integrity)); + } + } + + if (remote.hash) { + if (!cacheHash || cacheHash !== remote.hash) { + throw new (_errors || _load_errors()).SecurityError(config.reporter.lang('fetchBadHashCache', pkg.name, cacheHash, remote.hash)); + } + } + + yield fetcher.setupMirrorFromCache(); + return { + package: pkg, + hash, + dest, + cached: true + }; + }); + + return function fetchCache(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); + +let fetchOneRemote = exports.fetchOneRemote = (() => { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (remote, name, version, dest, config) { + // Mock metadata for symlinked dependencies + if (remote.type === 'link') { + const mockPkg = { _uid: '', name: '', version: '0.0.0' }; + return Promise.resolve({ resolved: null, hash: '', dest, package: mockPkg, cached: false }); + } + + const Fetcher = (_index || _load_index())[remote.type]; + if (!Fetcher) { + throw new (_errors || _load_errors()).MessageError(config.reporter.lang('unknownFetcherFor', remote.type)); + } + + const fetcher = new Fetcher(dest, remote, config); + if (yield config.isValidModuleDest(dest)) { + return fetchCache(dest, fetcher, config, remote); + } + + // remove as the module may be invalid + yield (_fs || _load_fs()).unlink(dest); + + try { + return yield fetcher.fetch({ + name, + version + }); + } catch (err) { + try { + yield (_fs || _load_fs()).unlink(dest); + } catch (err2) { + // what do? + } + throw err; + } + }); + + return function fetchOneRemote(_x5, _x6, _x7, _x8, _x9) { + return _ref3.apply(this, arguments); + }; +})(); + +let maybeFetchOne = (() => { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref, config) { + try { + return yield fetchOne(ref, config); + } catch (err) { + if (ref.optional) { + config.reporter.error(err.message); + return null; + } else { + throw err; + } + } + }); + + return function maybeFetchOne(_x10, _x11) { + return _ref4.apply(this, arguments); + }; +})(); + +exports.fetch = fetch; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _index; + +function _load_index() { + return _index = _interopRequireWildcard(__webpack_require__(552)); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(4)); +} + +var _promise; + +function _load_promise() { + return _promise = _interopRequireWildcard(__webpack_require__(50)); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const ssri = __webpack_require__(65); + +function fetchOne(ref, config) { + const dest = config.generateModuleCachePath(ref); + + return fetchOneRemote(ref.remote, ref.name, ref.version, dest, config); +} + +function fetch(pkgs, config) { + const pkgsPerDest = new Map(); + pkgs = pkgs.filter(pkg => { + const ref = pkg._reference; + if (!ref) { + return false; + } + const dest = config.generateModuleCachePath(ref); + const otherPkg = pkgsPerDest.get(dest); + if (otherPkg) { + config.reporter.warn(config.reporter.lang('multiplePackagesCantUnpackInSameDestination', ref.patterns, dest, otherPkg.patterns)); + return false; + } + pkgsPerDest.set(dest, ref); + return true; + }); + const tick = config.reporter.progress(pkgs.length); + + return (_promise || _load_promise()).queue(pkgs, (() => { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg) { + const ref = pkg._reference; + if (!ref) { + return pkg; + } + + const res = yield maybeFetchOne(ref, config); + let newPkg; + + if (res) { + newPkg = res.package; + + // update with new remote + // but only if there was a hash previously as the tarball fetcher does not provide a hash. + if (ref.remote.hash) { + // if the checksum was updated, also update resolved and cache + if (ref.remote.hash !== res.hash && config.updateChecksums) { + const oldHash = ref.remote.hash; + if (ref.remote.resolved) { + ref.remote.resolved = ref.remote.resolved.replace(oldHash, res.hash); + } + ref.config.cache = Object.keys(ref.config.cache).reduce(function (cache, entry) { + const entryWithNewHash = entry.replace(oldHash, res.hash); + cache[entryWithNewHash] = ref.config.cache[entry]; + return cache; + }, {}); + } + ref.remote.hash = res.hash || ref.remote.hash; + } + } + + if (tick) { + tick(); + } + + if (newPkg) { + newPkg._reference = ref; + newPkg._remote = ref.remote; + newPkg.name = pkg.name; + newPkg.fresh = pkg.fresh; + return newPkg; + } + + return pkg; + }); + + return function (_x12) { + return _ref5.apply(this, arguments); + }; + })(), config.networkConcurrency); +} + +/***/ }), +/* 211 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49732,16 +49041,10 @@ Object.defineProperty(exports, "__esModule", { }); exports.linkBin = undefined; -var _slicedToArray2; - -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(15)); -} - var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } let linkBin = exports.linkBin = (() => { @@ -49749,7 +49052,7 @@ let linkBin = exports.linkBin = (() => { if (process.platform === 'win32') { const unlockMutex = yield (0, (_mutex || _load_mutex()).default)(src); try { - yield cmdShim(src, dest); + yield cmdShim(src, dest, { createPwshFile: false }); } finally { unlockMutex(); } @@ -49768,25 +49071,31 @@ let linkBin = exports.linkBin = (() => { var _packageHoister; function _load_packageHoister() { - return _packageHoister = _interopRequireDefault(__webpack_require__(420)); + return _packageHoister = _interopRequireDefault(__webpack_require__(556)); } var _constants; function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(7)); + return _constants = _interopRequireWildcard(__webpack_require__(8)); } var _promise; function _load_promise() { - return _promise = _interopRequireWildcard(__webpack_require__(53)); + return _promise = _interopRequireWildcard(__webpack_require__(50)); +} + +var _normalizePattern2; + +function _load_normalizePattern() { + return _normalizePattern2 = __webpack_require__(37); } var _misc; function _load_misc() { - return _misc = __webpack_require__(10); + return _misc = __webpack_require__(18); } var _fs; @@ -49798,29 +49107,30 @@ function _load_fs() { var _mutex; function _load_mutex() { - return _mutex = _interopRequireDefault(__webpack_require__(442)); + return _mutex = _interopRequireDefault(__webpack_require__(375)); } var _semver; function _load_semver() { - return _semver = __webpack_require__(450); + return _semver = __webpack_require__(224); } var _workspaceLayout; function _load_workspaceLayout() { - return _workspaceLayout = _interopRequireDefault(__webpack_require__(81)); + return _workspaceLayout = _interopRequireDefault(__webpack_require__(90)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const invariant = __webpack_require__(6); +const invariant = __webpack_require__(9); -const cmdShim = (_promise || _load_promise()).promisify(__webpack_require__(465)); +const cmdShim = __webpack_require__(201); const path = __webpack_require__(0); +const semver = __webpack_require__(22); // Concurrency for creating bin links disabled because of the issue #1961 const linkBinConcurrency = 1; @@ -49831,6 +49141,7 @@ class PackageLinker { this.config = config; this.artifacts = {}; this.topLevelBinLinking = true; + this.unplugged = []; } setArtifacts(artifacts) { @@ -49841,23 +49152,35 @@ class PackageLinker { this.topLevelBinLinking = topLevelBinLinking; } - linkSelfDependencies(pkg, pkgLoc, targetBinLoc) { + linkSelfDependencies(pkg, pkgLoc, targetBinLoc, override = false) { return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { targetBinLoc = path.join(targetBinLoc, '.bin'); yield (_fs || _load_fs()).mkdirp(targetBinLoc); targetBinLoc = yield (_fs || _load_fs()).realpath(targetBinLoc); pkgLoc = yield (_fs || _load_fs()).realpath(pkgLoc); - for (const _ref2 of (0, (_misc || _load_misc()).entries)(pkg.bin)) { - var _ref3 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref2, 2); + for (var _iterator = (0, (_misc || _load_misc()).entries)(pkg.bin), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref3; - const scriptName = _ref3[0]; - const scriptCmd = _ref3[1]; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref3 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref3 = _i.value; + } + + const _ref2 = _ref3; + const scriptName = _ref2[0]; + const scriptCmd = _ref2[1]; const dest = path.join(targetBinLoc, scriptName); const src = path.join(pkgLoc, scriptCmd); if (!(yield (_fs || _load_fs()).exists(src))) { - // TODO maybe throw an error - continue; + if (!override) { + // TODO maybe throw an error + continue; + } } yield linkBin(src, dest); } @@ -49877,27 +49200,55 @@ class PackageLinker { invariant(remote, 'Package remote is missing'); // link up `bin scripts` in `dependencies` - for (const pattern of ref.dependencies) { + for (var _iterator2 = ref.dependencies, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref4; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref4 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref4 = _i2.value; + } + + const pattern = _ref4; + const dep = _this.resolver.getStrictResolvedPattern(pattern); if ( - // Missing location means not installed inside node_modules - dep._reference && dep._reference.location && dep.bin && Object.keys(dep.bin).length) { - deps.push({ - dep, - loc: _this.config.generateHardModulePath(dep._reference) - }); + // Missing locations means not installed inside node_modules + dep._reference && dep._reference.locations.length && dep.bin && Object.keys(dep.bin).length) { + const loc = yield _this.findNearestInstalledVersionOfPackage(dep, dir); + deps.push({ dep, loc }); } } // link up the `bin` scripts in bundled dependencies if (pkg.bundleDependencies) { - for (const depName of pkg.bundleDependencies) { - const loc = path.join(_this.config.generateHardModulePath(ref), _this.config.getFolder(pkg), depName); + for (var _iterator3 = pkg.bundleDependencies, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref5; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref5 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref5 = _i3.value; + } + + const depName = _ref5; + + const locs = ref.locations.map(function (loc) { + return path.join(loc, _this.config.getFolder(pkg), depName); + }); try { - const dep = yield _this.config.readManifest(loc, remote.registry); + const dep = yield _this.config.readManifest(locs[0], remote.registry); //all of them should be the same if (dep.bin && Object.keys(dep.bin).length) { - deps.push({ dep, loc }); + deps.push(...locs.map(function (loc) { + return { dep, loc }; + })); } } catch (ex) { if (ex.code !== 'ENOENT') { @@ -49915,36 +49266,108 @@ class PackageLinker { } // write the executables - for (const _ref4 of deps) { - const dep = _ref4.dep, - loc = _ref4.loc; + for (var _iterator4 = deps, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref7; - if (dep._reference && dep._reference.location) { + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref7 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref7 = _i4.value; + } + + const _ref6 = _ref7; + const dep = _ref6.dep, + loc = _ref6.loc; + + if (dep._reference && dep._reference.locations.length) { + invariant(!dep._reference.isPlugnplay, "Plug'n'play packages should not be referenced here"); yield _this.linkSelfDependencies(dep, loc, dir); } } })(); } - getFlatHoistedTree(patterns) { - var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + //find the installation location of ref that would be used in binLoc based on node module resolution + findNearestInstalledVersionOfPackage(pkg, binLoc) { + var _this2 = this; - let ignoreOptional = _ref5.ignoreOptional; + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const ref = pkg._reference; + invariant(ref, 'expected pkg reference for ' + pkg.name); + const moduleFolder = _this2.config.getFolder(pkg); + yield (_fs || _load_fs()).mkdirp(binLoc); + const realBinLoc = yield (_fs || _load_fs()).realpath(binLoc); - const hoister = new (_packageHoister || _load_packageHoister()).default(this.config, this.resolver, { ignoreOptional }); + const allLocations = [...ref.locations]; + const realLocations = yield Promise.all(ref.locations.map(function (loc) { + return (_fs || _load_fs()).realpath(loc); + })); + realLocations.forEach(function (loc) { + return allLocations.indexOf(loc) !== -1 || allLocations.push(loc); + }); + + const locationBinLocPairs = allLocations.map(function (loc) { + return [loc, binLoc]; + }); + if (binLoc !== realBinLoc) { + locationBinLocPairs.push(...allLocations.map(function (loc) { + return [loc, realBinLoc]; + })); + } + + const distancePairs = locationBinLocPairs.map(function ([loc, curBinLoc]) { + let distance = 0; + let curLoc = curBinLoc; + let notFound = false; + + while (path.join(curLoc, ref.name) !== loc && path.join(curLoc, moduleFolder, ref.name) !== loc) { + const next = path.dirname(curLoc); + if (curLoc === next) { + notFound = true; + break; + } + + distance++; + curLoc = next; + } + return notFound ? null : [loc, distance]; + }); + + //remove items where path was not found + const filteredDistancePairs = distancePairs.filter(function (d) { + return d; + }); + filteredDistancePairs; + + invariant(filteredDistancePairs.length > 0, `could not find a copy of ${pkg.name} to link in ${binLoc}`); + + //get smallest distance from package location + const minItem = filteredDistancePairs.reduce(function (min, cur) { + return cur[1] < min[1] ? cur : min; + }); + + invariant(minItem[1] >= 0, 'could not find a target for bin dir of ' + minItem.toString()); + return minItem[0]; + })(); + } + + getFlatHoistedTree(patterns, workspaceLayout, { ignoreOptional } = {}) { + const hoister = new (_packageHoister || _load_packageHoister()).default(this.config, this.resolver, { ignoreOptional, workspaceLayout }); hoister.seed(patterns); + if (this.config.focus) { + hoister.markShallowWorkspaceEntries(); + } return hoister.init(); } - copyModules(patterns, workspaceLayout) { - var _this2 = this; + copyModules(patterns, workspaceLayout, { linkDuplicates, ignoreOptional } = {}) { + var _this3 = this; - var _ref6 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - let linkDuplicates = _ref6.linkDuplicates, - ignoreOptional = _ref6.ignoreOptional; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let flatTree = _this2.getFlatHoistedTree(patterns, { ignoreOptional }); + let flatTree = _this3.getFlatHoistedTree(patterns, workspaceLayout, { ignoreOptional }); // sorted tree makes file creation and copying not to interfere with each other flatTree = flatTree.sort(function (dep1, dep2) { return dep1[0].localeCompare(dep2[0]); @@ -49955,17 +49378,28 @@ class PackageLinker { const copyQueue = new Map(); const hardlinkQueue = new Map(); - const hardlinksEnabled = linkDuplicates && (yield (_fs || _load_fs()).hardlinksWork(_this2.config.cwd)); + const hardlinksEnabled = linkDuplicates && (yield (_fs || _load_fs()).hardlinksWork(_this3.config.cwd)); const copiedSrcs = new Map(); const symlinkPaths = new Map(); - for (const _ref7 of flatTree) { - var _ref8 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref7, 2); + for (var _iterator5 = flatTree, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref9; + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref9 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref9 = _i5.value; + } + + const _ref8 = _ref9; const folder = _ref8[0]; var _ref8$ = _ref8[1]; const pkg = _ref8$.pkg; const loc = _ref8$.loc; + const isShallow = _ref8$.isShallow; const remote = pkg._remote || { type: '' }; const ref = pkg._reference; @@ -49979,29 +49413,48 @@ class PackageLinker { // with a symlink source src = remote.reference; type = 'symlink'; - } else if (workspaceLayout && remote.type === 'workspace') { + } else if (workspaceLayout && remote.type === 'workspace' && !isShallow) { src = remote.reference; type = 'symlink'; - if (dest.indexOf(workspaceLayout.virtualManifestName) !== -1) { - // we don't need to install virtual manifest - continue; - } // to get real path for non hoisted dependencies symlinkPaths.set(dest, src); } else { // backwards compatibility: get build artifacts from metadata // does not apply to symlinked dependencies - const metadata = yield _this2.config.readPackageMetadata(src); - for (const file of metadata.artifacts) { + const metadata = yield _this3.config.readPackageMetadata(src); + for (var _iterator15 = metadata.artifacts, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { + var _ref23; + + if (_isArray15) { + if (_i15 >= _iterator15.length) break; + _ref23 = _iterator15[_i15++]; + } else { + _i15 = _iterator15.next(); + if (_i15.done) break; + _ref23 = _i15.value; + } + + const file = _ref23; + artifactFiles.push(path.join(dest, file)); } } - for (const _ref9 of symlinkPaths.entries()) { - var _ref10 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref9, 2); + for (var _iterator16 = symlinkPaths.entries(), _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) { + var _ref25; - const symlink = _ref10[0]; - const realpath = _ref10[1]; + if (_isArray16) { + if (_i16 >= _iterator16.length) break; + _ref25 = _iterator16[_i16++]; + } else { + _i16 = _iterator16.next(); + if (_i16.done) break; + _ref25 = _i16.value; + } + + const _ref24 = _ref25; + const symlink = _ref24[0]; + const realpath = _ref24[1]; if (dest.indexOf(symlink + path.sep) === 0) { // after hoisting we end up with this structure @@ -50012,18 +49465,48 @@ class PackageLinker { } } - ref.setLocation(dest); + if (_this3.config.plugnplayEnabled) { + ref.isPlugnplay = true; + if (yield _this3._isUnplugged(pkg, ref)) { + dest = _this3.config.generatePackageUnpluggedPath(ref); - const integrityArtifacts = _this2.artifacts[`${pkg.name}@${pkg.version}`]; + // We don't skip the copy if the unplugged package isn't materialized yet + if (yield (_fs || _load_fs()).exists(dest)) { + ref.addLocation(dest); + continue; + } + } else { + ref.addLocation(src); + continue; + } + } + + ref.addLocation(dest); + + const integrityArtifacts = _this3.artifacts[`${pkg.name}@${pkg.version}`]; if (integrityArtifacts) { - for (const file of integrityArtifacts) { + for (var _iterator17 = integrityArtifacts, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : _iterator17[Symbol.iterator]();;) { + var _ref26; + + if (_isArray17) { + if (_i17 >= _iterator17.length) break; + _ref26 = _iterator17[_i17++]; + } else { + _i17 = _iterator17.next(); + if (_i17.done) break; + _ref26 = _i17.value; + } + + const file = _ref26; + artifactFiles.push(path.join(dest, file)); } } const copiedDest = copiedSrcs.get(src); if (!copiedDest) { - if (hardlinksEnabled) { + // no point to hardlink to a symlink + if (hardlinksEnabled && type !== 'symlink') { copiedSrcs.set(src, dest); } copyQueue.set(dest, { @@ -50053,23 +49536,66 @@ class PackageLinker { const scopedPaths = new Set(); const findExtraneousFiles = (() => { - var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (basePath) { - for (const folder of _this2.config.registryFolders) { - const loc = path.join(basePath, folder); + var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (basePath) { + for (var _iterator6 = _this3.config.registryFolders, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref11; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref11 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref11 = _i6.value; + } + + const folder = _ref11; + + const loc = path.resolve(basePath, folder); if (yield (_fs || _load_fs()).exists(loc)) { const files = yield (_fs || _load_fs()).readdir(loc); - for (const file of files) { + for (var _iterator7 = files, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref12; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref12 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref12 = _i7.value; + } + + const file = _ref12; + const filepath = path.join(loc, file); // it's a scope, not a package if (file[0] === '@') { scopedPaths.add(filepath); - for (const subfile of yield (_fs || _load_fs()).readdir(filepath)) { + for (var _iterator8 = yield (_fs || _load_fs()).readdir(filepath), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { + var _ref13; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref13 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref13 = _i8.value; + } + + const subfile = _ref13; + possibleExtraneous.add(path.join(filepath, subfile)); } + } else if (file[0] === '.' && file !== '.bin') { + if (!(yield (_fs || _load_fs()).lstat(filepath)).isDirectory()) { + possibleExtraneous.add(filepath); + } } else { possibleExtraneous.add(filepath); } @@ -50078,14 +49604,27 @@ class PackageLinker { } }); - return function findExtraneousFiles(_x5) { - return _ref11.apply(this, arguments); + return function findExtraneousFiles(_x3) { + return _ref10.apply(this, arguments); }; })(); - yield findExtraneousFiles(_this2.config.lockfileFolder); + yield findExtraneousFiles(_this3.config.lockfileFolder); if (workspaceLayout) { - for (const workspaceName of Object.keys(workspaceLayout.workspaces)) { + for (var _iterator9 = Object.keys(workspaceLayout.workspaces), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { + var _ref14; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref14 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref14 = _i9.value; + } + + const workspaceName = _ref14; + yield findExtraneousFiles(workspaceLayout.workspaces[workspaceName].loc); } } @@ -50100,7 +49639,7 @@ class PackageLinker { let linkedModules; try { - linkedModules = yield (_fs || _load_fs()).readdir(_this2.config.linkFolder); + linkedModules = yield (_fs || _load_fs()).readdir(_this3.config.linkFolder); } catch (err) { if (err.code === 'ENOENT') { linkedModules = []; @@ -50110,8 +49649,21 @@ class PackageLinker { } // TODO: Consolidate this logic with `this.config.linkedModules` logic - for (const entry of linkedModules) { - const entryPath = path.join(_this2.config.linkFolder, entry); + for (var _iterator10 = linkedModules, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { + var _ref15; + + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref15 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref15 = _i10.value; + } + + const entry = _ref15; + + const entryPath = path.join(_this3.config.linkFolder, entry); const stat = yield (_fs || _load_fs()).lstat(entryPath); if (stat.isSymbolicLink()) { @@ -50119,7 +49671,7 @@ class PackageLinker { const entryTarget = yield (_fs || _load_fs()).realpath(entryPath); linkTargets.set(entry, entryTarget); } catch (err) { - _this2.reporter.warn(_this2.reporter.lang('linkTargetMissing', entry)); + _this3.reporter.warn(_this3.reporter.lang('linkTargetMissing', entry)); yield (_fs || _load_fs()).unlink(entryPath); } } else if (stat.isDirectory() && entry[0] === '@') { @@ -50127,7 +49679,20 @@ class PackageLinker { // means we must iterate inside to retrieve the package names it contains const scopeName = entry; - for (const entry2 of yield (_fs || _load_fs()).readdir(entryPath)) { + for (var _iterator18 = yield (_fs || _load_fs()).readdir(entryPath), _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : _iterator18[Symbol.iterator]();;) { + var _ref27; + + if (_isArray18) { + if (_i18 >= _iterator18.length) break; + _ref27 = _iterator18[_i18++]; + } else { + _i18 = _iterator18.next(); + if (_i18.done) break; + _ref27 = _i18.value; + } + + const entry2 = _ref27; + const entryPath2 = path.join(entryPath, entry2); const stat2 = yield (_fs || _load_fs()).lstat(entryPath2); @@ -50137,7 +49702,7 @@ class PackageLinker { const entryTarget = yield (_fs || _load_fs()).realpath(entryPath2); linkTargets.set(packageName, entryTarget); } catch (err) { - _this2.reporter.warn(_this2.reporter.lang('linkTargetMissing', packageName)); + _this3.reporter.warn(_this3.reporter.lang('linkTargetMissing', packageName)); yield (_fs || _load_fs()).unlink(entryPath2); } } @@ -50145,7 +49710,20 @@ class PackageLinker { } } - for (const loc of possibleExtraneous) { + for (var _iterator11 = possibleExtraneous, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { + var _ref16; + + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref16 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref16 = _i11.value; + } + + const loc = _ref16; + let packageName = path.basename(loc); const scopeName = path.basename(path.dirname(loc)); @@ -50161,14 +49739,14 @@ class PackageLinker { // let tick; - yield (_fs || _load_fs()).copyBulk(Array.from(copyQueue.values()), _this2.reporter, { + yield (_fs || _load_fs()).copyBulk(Array.from(copyQueue.values()), _this3.reporter, { possibleExtraneous, artifactFiles, - ignoreBasenames: [(_constants || _load_constants()).METADATA_FILENAME, (_constants || _load_constants()).TARBALL_FILENAME], + ignoreBasenames: [(_constants || _load_constants()).METADATA_FILENAME, (_constants || _load_constants()).TARBALL_FILENAME, '.bin'], - onStart: function (num) { - tick = _this2.reporter.progress(num); + onStart: function onStart(num) { + tick = _this3.reporter.progress(num); }, onProgress(src) { @@ -50177,12 +49755,13 @@ class PackageLinker { } } }); - yield (_fs || _load_fs()).hardlinkBulk(Array.from(hardlinkQueue.values()), _this2.reporter, { + + yield (_fs || _load_fs()).hardlinkBulk(Array.from(hardlinkQueue.values()), _this3.reporter, { possibleExtraneous, artifactFiles, - onStart: function (num) { - tick = _this2.reporter.progress(num); + onStart: function onStart(num) { + tick = _this3.reporter.progress(num); }, onProgress(src) { @@ -50193,13 +49772,39 @@ class PackageLinker { }); // remove all extraneous files that weren't in the tree - for (const loc of possibleExtraneous) { - _this2.reporter.verbose(_this2.reporter.lang('verboseFileRemoveExtraneous', loc)); + for (var _iterator12 = possibleExtraneous, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { + var _ref17; + + if (_isArray12) { + if (_i12 >= _iterator12.length) break; + _ref17 = _iterator12[_i12++]; + } else { + _i12 = _iterator12.next(); + if (_i12.done) break; + _ref17 = _i12.value; + } + + const loc = _ref17; + + _this3.reporter.verbose(_this3.reporter.lang('verboseFileRemoveExtraneous', loc)); yield (_fs || _load_fs()).unlink(loc); } // remove any empty scoped directories - for (const scopedPath of scopedPaths) { + for (var _iterator13 = scopedPaths, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { + var _ref18; + + if (_isArray13) { + if (_i13 >= _iterator13.length) break; + _ref18 = _iterator13[_i13++]; + } else { + _i13 = _iterator13.next(); + if (_i13.done) break; + _ref18 = _i13.value; + } + + const scopedPath = _ref18; + const files = yield (_fs || _load_fs()).readdir(scopedPath); if (files.length === 0) { yield (_fs || _load_fs()).unlink(scopedPath); @@ -50207,95 +49812,216 @@ class PackageLinker { } // create binary links - if (_this2.config.binLinks) { - const topLevelDependencies = _this2.determineTopLevelBinLinks(flatTree); - const tickBin = _this2.reporter.progress(flatTree.length + topLevelDependencies.length); + if (_this3.config.getOption('bin-links') && _this3.config.binLinks !== false) { + const topLevelDependencies = _this3.determineTopLevelBinLinkOrder(flatTree); + const tickBin = _this3.reporter.progress(flatTree.length + topLevelDependencies.length); // create links in transient dependencies yield (_promise || _load_promise()).queue(flatTree, (() => { - var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref13) { - var _ref14 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref13, 2); - - let dest = _ref14[0], - pkg = _ref14[1].pkg; - - if (pkg._reference && pkg._reference.location) { - const binLoc = path.join(dest, _this2.config.getFolder(pkg)); - yield _this2.linkBinDependencies(pkg, binLoc); + var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ([dest, { pkg, isNohoist, parts }]) { + if (pkg._reference && pkg._reference.locations.length && !pkg._reference.isPlugnplay) { + const binLoc = path.join(dest, _this3.config.getFolder(pkg)); + yield _this3.linkBinDependencies(pkg, binLoc); + if (isNohoist) { + // if nohoist, we need to override the binLink to point to the local destination + const parentBinLoc = _this3.getParentBinLoc(parts, flatTree); + yield _this3.linkSelfDependencies(pkg, dest, parentBinLoc, true); + } tickBin(); } + tickBin(); }); - return function (_x6) { - return _ref12.apply(this, arguments); + return function (_x4) { + return _ref19.apply(this, arguments); }; })(), linkBinConcurrency); // create links at top level for all dependencies. yield (_promise || _load_promise()).queue(topLevelDependencies, (() => { - var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref16) { - var _ref17 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref16, 2); - - let dest = _ref17[0], - pkg = _ref17[1]; - - if (pkg._reference && pkg._reference.location && pkg.bin && Object.keys(pkg.bin).length) { - const binLoc = path.join(_this2.config.lockfileFolder, _this2.config.getFolder(pkg)); - yield _this2.linkSelfDependencies(pkg, dest, binLoc); - tickBin(); + var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ([dest, { pkg }]) { + if (pkg._reference && pkg._reference.locations.length && !pkg._reference.isPlugnplay && pkg.bin && Object.keys(pkg.bin).length) { + let binLoc; + if (_this3.config.modulesFolder) { + binLoc = path.join(_this3.config.modulesFolder); + } else { + binLoc = path.join(_this3.config.lockfileFolder, _this3.config.getFolder(pkg)); + } + yield _this3.linkSelfDependencies(pkg, dest, binLoc); } + tickBin(); }); - return function (_x7) { - return _ref15.apply(this, arguments); + return function (_x5) { + return _ref20.apply(this, arguments); }; })(), linkBinConcurrency); } - for (const _ref18 of flatTree) { - var _ref19 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref18, 2); + for (var _iterator14 = flatTree, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { + var _ref22; - const pkg = _ref19[1].pkg; + if (_isArray14) { + if (_i14 >= _iterator14.length) break; + _ref22 = _iterator14[_i14++]; + } else { + _i14 = _iterator14.next(); + if (_i14.done) break; + _ref22 = _i14.value; + } - yield _this2._warnForMissingBundledDependencies(pkg); + const _ref21 = _ref22; + const pkg = _ref21[1].pkg; + + yield _this3._warnForMissingBundledDependencies(pkg); } })(); } - determineTopLevelBinLinks(flatTree) { - const linksToCreate = new Map(); - for (const _ref20 of flatTree) { - var _ref21 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_ref20, 2); + _buildTreeHash(flatTree) { + const hash = new Map(); + for (var _iterator19 = flatTree, _isArray19 = Array.isArray(_iterator19), _i19 = 0, _iterator19 = _isArray19 ? _iterator19 : _iterator19[Symbol.iterator]();;) { + var _ref29; - const dest = _ref21[0]; - var _ref21$ = _ref21[1]; - const pkg = _ref21$.pkg; - const isDirectRequire = _ref21$.isDirectRequire; + if (_isArray19) { + if (_i19 >= _iterator19.length) break; + _ref29 = _iterator19[_i19++]; + } else { + _i19 = _iterator19.next(); + if (_i19.done) break; + _ref29 = _i19.value; + } + + const _ref28 = _ref29; + const dest = _ref28[0]; + const hoistManifest = _ref28[1]; + + const key = hoistManifest.parts.join('#'); + hash.set(key, [dest, hoistManifest]); + } + this._treeHash = hash; + return hash; + } + + getParentBinLoc(parts, flatTree) { + const hash = this._treeHash || this._buildTreeHash(flatTree); + const parent = parts.slice(0, -1).join('#'); + const tuple = hash.get(parent); + if (!tuple) { + throw new Error(`failed to get parent '${parent}' binLoc`); + } + const dest = tuple[0], + hoistManifest = tuple[1]; + + const parentBinLoc = path.join(dest, this.config.getFolder(hoistManifest.pkg)); + + return parentBinLoc; + } + + determineTopLevelBinLinkOrder(flatTree) { + const linksToCreate = new Map(); + for (var _iterator20 = flatTree, _isArray20 = Array.isArray(_iterator20), _i20 = 0, _iterator20 = _isArray20 ? _iterator20 : _iterator20[Symbol.iterator]();;) { + var _ref31; + + if (_isArray20) { + if (_i20 >= _iterator20.length) break; + _ref31 = _iterator20[_i20++]; + } else { + _i20 = _iterator20.next(); + if (_i20.done) break; + _ref31 = _i20.value; + } + + const _ref30 = _ref31; + const dest = _ref30[0]; + const hoistManifest = _ref30[1]; + const pkg = hoistManifest.pkg, + isDirectRequire = hoistManifest.isDirectRequire, + isNohoist = hoistManifest.isNohoist, + isShallow = hoistManifest.isShallow; const name = pkg.name; + // nohoist and shallow packages should not be linked at topLevel bin - if (isDirectRequire || this.topLevelBinLinking && !linksToCreate.has(name)) { - linksToCreate.set(name, [dest, pkg]); + if (!isNohoist && !isShallow && (isDirectRequire || this.topLevelBinLinking && !linksToCreate.has(name))) { + linksToCreate.set(name, [dest, hoistManifest]); } } - return Array.from(linksToCreate.values()); + // Sort the array so that direct dependencies will be linked last. + // Bin links are overwritten if they already exist, so this will cause direct deps to take precedence. + // If someone finds this to be incorrect later, you could also consider sorting descending by + // `linkToCreate.level` which is the dependency tree depth. Direct deps will have level 0 and transitive + // deps will have level > 0. + const transientBins = []; + const topLevelBins = []; + for (var _iterator21 = Array.from(linksToCreate.values()), _isArray21 = Array.isArray(_iterator21), _i21 = 0, _iterator21 = _isArray21 ? _iterator21 : _iterator21[Symbol.iterator]();;) { + var _ref32; + + if (_isArray21) { + if (_i21 >= _iterator21.length) break; + _ref32 = _iterator21[_i21++]; + } else { + _i21 = _iterator21.next(); + if (_i21.done) break; + _ref32 = _i21.value; + } + + const linkToCreate = _ref32; + + if (linkToCreate[1].isDirectRequire) { + topLevelBins.push(linkToCreate); + } else { + transientBins.push(linkToCreate); + } + } + return [...transientBins, ...topLevelBins]; } resolvePeerModules() { - for (const pkg of this.resolver.getManifests()) { + for (var _iterator22 = this.resolver.getManifests(), _isArray22 = Array.isArray(_iterator22), _i22 = 0, _iterator22 = _isArray22 ? _iterator22 : _iterator22[Symbol.iterator]();;) { + var _ref33; + + if (_isArray22) { + if (_i22 >= _iterator22.length) break; + _ref33 = _iterator22[_i22++]; + } else { + _i22 = _iterator22.next(); + if (_i22.done) break; + _ref33 = _i22.value; + } + + const pkg = _ref33; + const peerDeps = pkg.peerDependencies; + const peerDepsMeta = pkg.peerDependenciesMeta; + if (!peerDeps) { continue; } + const ref = pkg._reference; invariant(ref, 'Package reference is missing'); + // TODO: We are taking the "shortest" ref tree but there may be multiple ref trees with the same length const refTree = ref.requests.map(req => req.parentNames).sort((arr1, arr2) => arr1.length - arr2.length)[0]; const getLevelDistance = pkgRef => { let minDistance = Infinity; - for (const req of pkgRef.requests) { + for (var _iterator23 = pkgRef.requests, _isArray23 = Array.isArray(_iterator23), _i23 = 0, _iterator23 = _isArray23 ? _iterator23 : _iterator23[Symbol.iterator]();;) { + var _ref34; + + if (_isArray23) { + if (_i23 >= _iterator23.length) break; + _ref34 = _iterator23[_i23++]; + } else { + _i23 = _iterator23.next(); + if (_i23.done) break; + _ref34 = _i23.value; + } + + const req = _ref34; + const distance = refTree.length - req.parentNames.length; if (distance >= 0 && distance < minDistance && req.parentNames.every((name, idx) => name === refTree[idx])) { @@ -50308,12 +50034,29 @@ class PackageLinker { for (const peerDepName in peerDeps) { const range = peerDeps[peerDepName]; + const meta = peerDepsMeta && peerDepsMeta[peerDepName]; + + const isOptional = !!(meta && meta.optional); + const peerPkgs = this.resolver.getAllInfoForPackageName(peerDepName); let peerError = 'unmetPeer'; let resolvedLevelDistance = Infinity; let resolvedPeerPkg; - for (const peerPkg of peerPkgs) { + for (var _iterator24 = peerPkgs, _isArray24 = Array.isArray(_iterator24), _i24 = 0, _iterator24 = _isArray24 ? _iterator24 : _iterator24[Symbol.iterator]();;) { + var _ref35; + + if (_isArray24) { + if (_i24 >= _iterator24.length) break; + _ref35 = _iterator24[_i24++]; + } else { + _i24 = _iterator24.next(); + if (_i24.done) break; + _ref35 = _i24.value; + } + + const peerPkg = _ref35; + const peerPkgRef = peerPkg._reference; if (!(peerPkgRef && peerPkgRef.patterns)) { continue; @@ -50332,7 +50075,7 @@ class PackageLinker { if (resolvedPeerPkg) { ref.addDependencies(resolvedPeerPkg.patterns); this.reporter.verbose(this.reporter.lang('selectedPeer', `${pkg.name}@${pkg.version}`, `${peerDepName}@${resolvedPeerPkg.version}`, resolvedPeerPkg.level)); - } else { + } else if (!isOptional) { this.reporter.warn(this.reporter.lang(peerError, `${refTree.join(' > ')} > ${pkg.name}@${pkg.version}`, `${peerDepName}@${range}`)); } } @@ -50340,44 +50083,94 @@ class PackageLinker { } _satisfiesPeerDependency(range, version) { - return range === '*' || (0, (_semver || _load_semver()).satisfiesWithPreleases)(version, range, this.config.looseSemver); + return range === '*' || (0, (_semver || _load_semver()).satisfiesWithPrereleases)(version, range, this.config.looseSemver); } _warnForMissingBundledDependencies(pkg) { - var _this3 = this; + var _this4 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { const ref = pkg._reference; + invariant(ref, 'missing package ref ' + pkg.name); if (pkg.bundleDependencies) { - for (const depName of pkg.bundleDependencies) { - const loc = path.join(_this3.config.generateHardModulePath(ref), _this3.config.getFolder(pkg), depName); - if (!(yield (_fs || _load_fs()).exists(loc))) { + for (var _iterator25 = pkg.bundleDependencies, _isArray25 = Array.isArray(_iterator25), _i25 = 0, _iterator25 = _isArray25 ? _iterator25 : _iterator25[Symbol.iterator]();;) { + var _ref36; + + if (_isArray25) { + if (_i25 >= _iterator25.length) break; + _ref36 = _iterator25[_i25++]; + } else { + _i25 = _iterator25.next(); + if (_i25.done) break; + _ref36 = _i25.value; + } + + const depName = _ref36; + + const locs = ref.locations.map(function (loc) { + return path.join(loc, _this4.config.getFolder(pkg), depName); + }); + const locsExist = yield Promise.all(locs.map(function (loc) { + return (_fs || _load_fs()).exists(loc); + })); + if (locsExist.some(function (e) { + return !e; + })) { + //if any of the locs do not exist const pkgHuman = `${pkg.name}@${pkg.version}`; - _this3.reporter.warn(_this3.reporter.lang('missingBundledDependency', pkgHuman, depName)); + _this4.reporter.warn(_this4.reporter.lang('missingBundledDependency', pkgHuman, depName)); } } } })(); } - init(patterns, workspaceLayout) { - var _this4 = this; + _isUnplugged(pkg, ref) { + var _this5 = this; - var _ref22 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - let linkDuplicates = _ref22.linkDuplicates, - ignoreOptional = _ref22.ignoreOptional; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this4.resolvePeerModules(); - yield _this4.copyModules(patterns, workspaceLayout, { linkDuplicates, ignoreOptional }); + // If an unplugged folder exists for the specified package, we simply use it + if (yield (_fs || _load_fs()).exists(_this5.config.generatePackageUnpluggedPath(ref))) { + return true; + } + + // If the package has a postinstall script, we also unplug it (otherwise they would run into the cache) + if (!_this5.config.ignoreScripts && pkg.scripts && (pkg.scripts.preinstall || pkg.scripts.install || pkg.scripts.postinstall)) { + return true; + } + + // Check whether the user explicitly requested for the package to be unplugged + return _this5.unplugged.some(function (patternToUnplug) { + var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(patternToUnplug); + + const name = _normalizePattern.name, + range = _normalizePattern.range, + hasVersion = _normalizePattern.hasVersion; + + const satisfiesSemver = hasVersion ? semver.satisfies(ref.version, range) : true; + return name === ref.name && satisfiesSemver; + }); + })(); + } + + init(patterns, workspaceLayout, { linkDuplicates, ignoreOptional } = {}) { + var _this6 = this; + + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + _this6.resolvePeerModules(); + yield _this6.copyModules(patterns, workspaceLayout, { linkDuplicates, ignoreOptional }); + + if (!_this6.config.plugnplayEnabled) { + yield (_fs || _load_fs()).unlink(`${_this6.config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`); + } })(); } } exports.default = PackageLinker; /***/ }), -/* 162 */ +/* 212 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50394,14 +50187,14 @@ exports.clearNthLine = clearNthLine; var _tty; function _load_tty() { - return _tty = _interopRequireDefault(__webpack_require__(76)); + return _tty = _interopRequireDefault(__webpack_require__(104)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const readline = __webpack_require__(153); +const readline = __webpack_require__(197); -var _require = __webpack_require__(126); +var _require = __webpack_require__(30); const supportsColor = _require.supportsColor; @@ -50468,7 +50261,7 @@ function clearNthLine(stdout, n) { } /***/ }), -/* 163 */ +/* 213 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50481,13 +50274,13 @@ Object.defineProperty(exports, "__esModule", { var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(29)); + return _extends2 = _interopRequireDefault(__webpack_require__(21)); } var _baseReporter; function _load_baseReporter() { - return _baseReporter = _interopRequireDefault(__webpack_require__(78)); + return _baseReporter = _interopRequireDefault(__webpack_require__(108)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -50646,11 +50439,171 @@ class JSONReporter extends (_baseReporter || _load_baseReporter()).default { } }; } + + auditAction(recommendation) { + this._dump('auditAction', recommendation); + } + + auditAdvisory(resolution, auditAdvisory) { + this._dump('auditAdvisory', { resolution, advisory: auditAdvisory }); + } + + auditSummary(auditMetadata) { + this._dump('auditSummary', auditMetadata); + } } exports.default = JSONReporter; /***/ }), -/* 164 */ +/* 214 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.shouldUpdateLockfile = undefined; + +var _semver; + +function _load_semver() { + return _semver = _interopRequireDefault(__webpack_require__(22)); +} + +var _minimatch; + +function _load_minimatch() { + return _minimatch = _interopRequireDefault(__webpack_require__(82)); +} + +var _map; + +function _load_map() { + return _map = _interopRequireDefault(__webpack_require__(29)); +} + +var _normalizePattern2; + +function _load_normalizePattern() { + return _normalizePattern2 = __webpack_require__(37); +} + +var _parsePackagePath; + +function _load_parsePackagePath() { + return _parsePackagePath = _interopRequireDefault(__webpack_require__(376)); +} + +var _parsePackagePath2; + +function _load_parsePackagePath2() { + return _parsePackagePath2 = __webpack_require__(376); +} + +var _resolvers; + +function _load_resolvers() { + return _resolvers = __webpack_require__(78); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const DIRECTORY_SEPARATOR = '/'; +const GLOBAL_NESTED_DEP_PATTERN = '**/'; + +class ResolutionMap { + constructor(config) { + this.resolutionsByPackage = (0, (_map || _load_map()).default)(); + this.config = config; + this.reporter = config.reporter; + this.delayQueue = new Set(); + } + + init(resolutions = {}) { + for (const globPattern in resolutions) { + const info = this.parsePatternInfo(globPattern, resolutions[globPattern]); + + if (info) { + const resolution = this.resolutionsByPackage[info.name] || []; + this.resolutionsByPackage[info.name] = [...resolution, info]; + } + } + } + + addToDelayQueue(req) { + this.delayQueue.add(req); + } + + parsePatternInfo(globPattern, range) { + if (!(0, (_parsePackagePath2 || _load_parsePackagePath2()).isValidPackagePath)(globPattern)) { + this.reporter.warn(this.reporter.lang('invalidResolutionName', globPattern)); + return null; + } + + const directories = (0, (_parsePackagePath || _load_parsePackagePath()).default)(globPattern); + const name = directories.pop(); + + if (!(_semver || _load_semver()).default.validRange(range) && !(0, (_resolvers || _load_resolvers()).getExoticResolver)(range)) { + this.reporter.warn(this.reporter.lang('invalidResolutionVersion', range)); + return null; + } + + // For legacy support of resolutions, replace `name` with `**/name` + if (name === globPattern) { + globPattern = `${GLOBAL_NESTED_DEP_PATTERN}${name}`; + } + + return { + name, + range, + globPattern, + pattern: `${name}@${range}` + }; + } + + find(reqPattern, parentNames) { + var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(reqPattern); + + const name = _normalizePattern.name, + reqRange = _normalizePattern.range; + + const resolutions = this.resolutionsByPackage[name]; + + if (!resolutions) { + return ''; + } + + const modulePath = [...parentNames, name].join(DIRECTORY_SEPARATOR); + + var _ref = resolutions.find(({ globPattern }) => (0, (_minimatch || _load_minimatch()).default)(modulePath, globPattern)) || {}; + + const pattern = _ref.pattern, + range = _ref.range; + + + if (pattern) { + if ((_semver || _load_semver()).default.validRange(reqRange) && (_semver || _load_semver()).default.valid(range) && !(_semver || _load_semver()).default.satisfies(range, reqRange)) { + this.reporter.warn(this.reporter.lang('incompatibleResolutionVersion', pattern, reqPattern)); + } + } + + return pattern; + } +} + +exports.default = ResolutionMap; +const shouldUpdateLockfile = exports.shouldUpdateLockfile = (lockfileEntry, resolutionEntry) => { + if (!lockfileEntry || !resolutionEntry) { + return false; + } + + return lockfileEntry.resolved !== resolutionEntry.remote.resolved; +}; + +/***/ }), +/* 215 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50664,7 +50617,7 @@ exports.FILE_PROTOCOL_PREFIX = undefined; var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } var _path; @@ -50676,31 +50629,31 @@ function _load_path() { var _invariant; function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(6)); + return _invariant = _interopRequireDefault(__webpack_require__(9)); } var _uuid; function _load_uuid() { - return _uuid = _interopRequireDefault(__webpack_require__(89)); + return _uuid = _interopRequireDefault(__webpack_require__(119)); } var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(6); } var _exoticResolver; function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(61)); + return _exoticResolver = _interopRequireDefault(__webpack_require__(89)); } var _misc; function _load_misc() { - return _misc = _interopRequireWildcard(__webpack_require__(10)); + return _misc = _interopRequireWildcard(__webpack_require__(18)); } var _fs; @@ -50747,7 +50700,7 @@ class FileResolver extends (_exoticResolver || _load_exoticResolver()).default { return manifest; } if (!(yield (_fs || _load_fs()).exists(loc))) { - throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('doesntExist', loc)); + throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('doesntExist', loc, _this.pattern.split('@')[0])); } const manifest = yield (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { @@ -50788,7 +50741,7 @@ FileResolver.protocol = 'file'; FileResolver.prefixMatcher = /^\.{1,2}\//; /***/ }), -/* 165 */ +/* 216 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50802,25 +50755,25 @@ exports.explodeGistFragment = explodeGistFragment; var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(6); } var _gitResolver; function _load_gitResolver() { - return _gitResolver = _interopRequireDefault(__webpack_require__(96)); + return _gitResolver = _interopRequireDefault(__webpack_require__(124)); } var _exoticResolver; function _load_exoticResolver() { - return _exoticResolver = _interopRequireDefault(__webpack_require__(61)); + return _exoticResolver = _interopRequireDefault(__webpack_require__(89)); } var _misc; function _load_misc() { - return _misc = _interopRequireWildcard(__webpack_require__(10)); + return _misc = _interopRequireWildcard(__webpack_require__(18)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -50864,7 +50817,7 @@ exports.default = GistResolver; GistResolver.protocol = 'gist'; /***/ }), -/* 166 */ +/* 217 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50877,37 +50830,37 @@ Object.defineProperty(exports, "__esModule", { var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _cache; + +function _load_cache() { + return _cache = __webpack_require__(355); } var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(6); } var _registryResolver; function _load_registryResolver() { - return _registryResolver = _interopRequireDefault(__webpack_require__(438)); + return _registryResolver = _interopRequireDefault(__webpack_require__(575)); } var _npmRegistry; function _load_npmRegistry() { - return _npmRegistry = _interopRequireDefault(__webpack_require__(52)); -} - -var _npmRegistry2; - -function _load_npmRegistry2() { - return _npmRegistry2 = __webpack_require__(52); + return _npmRegistry = _interopRequireDefault(__webpack_require__(88)); } var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(18)); + return _map = _interopRequireDefault(__webpack_require__(29)); } var _fs; @@ -50919,29 +50872,37 @@ function _load_fs() { var _constants; function _load_constants() { - return _constants = __webpack_require__(7); + return _constants = __webpack_require__(8); +} + +var _packageNameUtils; + +function _load_packageNameUtils() { + return _packageNameUtils = __webpack_require__(222); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const inquirer = __webpack_require__(215); - -const tty = __webpack_require__(76); -const invariant = __webpack_require__(6); +const inquirer = __webpack_require__(276); +const tty = __webpack_require__(104); const path = __webpack_require__(0); -const semver = __webpack_require__(17); +const semver = __webpack_require__(22); +const ssri = __webpack_require__(65); -const NPM_REGISTRY = /http[s]:\/\/registry.npmjs.org/g; const NPM_REGISTRY_ID = 'npm'; class NpmResolver extends (_registryResolver || _load_registryResolver()).default { - static findVersionInRegistryResponse(config, range, body, request) { + static findVersionInRegistryResponse(config, name, range, body, request) { return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (!body['dist-tags']) { - throw new (_errors || _load_errors()).MessageError(config.reporter.lang('malformedRegistryResponse', body.name)); + if (body.versions && Object.keys(body.versions).length === 0) { + throw new (_errors || _load_errors()).MessageError(config.reporter.lang('registryNoVersions', body.name)); + } + + if (!body['dist-tags'] || !body.versions) { + throw new (_errors || _load_errors()).MessageError(config.reporter.lang('malformedRegistryResponse', name)); } if (range in body['dist-tags']) { @@ -50972,7 +50933,7 @@ class NpmResolver extends (_registryResolver || _load_registryResolver()).defaul name: 'package', type: 'list', message: config.reporter.lang('chooseVersionFromList', body.name), - choices: Object.keys(body.versions).reverse(), + choices: semver.rsort(Object.keys(body.versions)), pageSize }]); if (response && response.package) { @@ -50983,7 +50944,7 @@ class NpmResolver extends (_registryResolver || _load_registryResolver()).defaul })(); } - resolveRequest() { + resolveRequest(desiredVersion) { var _this = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { @@ -50994,10 +50955,12 @@ class NpmResolver extends (_registryResolver || _load_registryResolver()).defaul } } - const body = yield _this.config.registries.npm.request((_npmRegistry || _load_npmRegistry()).default.escapeName(_this.name)); + const escapedName = (_npmRegistry || _load_npmRegistry()).default.escapeName(_this.name); + const desiredRange = desiredVersion || _this.range; + const body = yield _this.config.registries.npm.request(escapedName); if (body) { - return NpmResolver.findVersionInRegistryResponse(_this.config, _this.range, body, _this.request); + return NpmResolver.findVersionInRegistryResponse(_this.config, escapedName, desiredRange, body, _this.request); } else { return null; } @@ -51008,44 +50971,30 @@ class NpmResolver extends (_registryResolver || _load_registryResolver()).defaul var _this2 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const escapedName = (_npmRegistry || _load_npmRegistry()).default.escapeName(_this2.name); - const scope = _this2.config.registries.npm.getScope(escapedName); - - // find modules of this name - const prefix = scope ? escapedName.split((_npmRegistry2 || _load_npmRegistry2()).SCOPE_SEPARATOR)[1] : `${NPM_REGISTRY_ID}-${_this2.name}-`; - - invariant(_this2.config.cacheFolder, 'expected packages root'); - const cacheFolder = path.join(_this2.config.cacheFolder, scope ? `${NPM_REGISTRY_ID}-${scope}` : ''); - - const files = yield _this2.config.getCache('cachedPackages', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const files = yield (_fs || _load_fs()).readdir(cacheFolder); - const validFiles = []; - - for (const name of files) { - // no hidden files - if (name[0] === '.') { - continue; - } - - // ensure valid module cache - const dir = path.join(cacheFolder, name); - if (yield _this2.config.isValidModuleDest(dir)) { - validFiles.push(name); - } - } - - return validFiles; - })); + const packageDirs = yield _this2.config.getCache('cachedPackages', function () { + return (0, (_cache || _load_cache()).getCachedPackagesDirs)(_this2.config, _this2.config.cacheFolder); + }); const versions = (0, (_map || _load_map()).default)(); - for (const name of files) { - // check if folder starts with our prefix - if (name.indexOf(prefix) !== 0) { - continue; + for (var _iterator = packageDirs, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; } - const dir = path.join(cacheFolder, name); + const dir = _ref; + + // check if folder contains the registry prefix + if (dir.indexOf(`${NPM_REGISTRY_ID}-`) === -1) { + continue; + } // read manifest and validate correct name const pkg = yield _this2.config.readManifest(dir, NPM_REGISTRY_ID); @@ -51077,7 +51026,7 @@ class NpmResolver extends (_registryResolver || _load_registryResolver()).defaul cleanRegistry(url) { if (this.config.getOption('registry') === (_constants || _load_constants()).YARN_REGISTRY) { - return url.replace(NPM_REGISTRY, (_constants || _load_constants()).YARN_REGISTRY); + return url.replace((_constants || _load_constants()).NPM_REGISTRY_RE, (_constants || _load_constants()).YARN_REGISTRY); } else { return url; } @@ -51090,10 +51039,30 @@ class NpmResolver extends (_registryResolver || _load_registryResolver()).defaul // lockfile const shrunk = _this3.request.getLocked('tarball'); if (shrunk) { + if (_this3.config.packBuiltPackages && shrunk.prebuiltVariants && shrunk._remote) { + const prebuiltVariants = shrunk.prebuiltVariants; + const prebuiltName = (0, (_packageNameUtils || _load_packageNameUtils()).getPlatformSpecificPackageFilename)(shrunk); + const offlineMirrorPath = _this3.config.getOfflineMirrorPath(); + if (prebuiltVariants[prebuiltName] && offlineMirrorPath) { + const filename = path.join(offlineMirrorPath, 'prebuilt', prebuiltName + '.tgz'); + const _remote = shrunk._remote; + + if (_remote && (yield (_fs || _load_fs()).exists(filename))) { + _remote.reference = `file:${filename}`; + _remote.hash = prebuiltVariants[prebuiltName]; + _remote.integrity = ssri.fromHex(_remote.hash, 'sha1').toString(); + } + } + } + } + if (shrunk && shrunk._remote && (shrunk._remote.integrity || _this3.config.offline || !_this3.config.autoAddIntegrity)) { + // if the integrity field does not exist, we're not network-restricted, and the + // migration hasn't been disabled, it needs to be created return shrunk; } - const info = yield _this3.resolveRequest(); + const desiredVersion = shrunk && shrunk.version ? shrunk.version : null; + const info = yield _this3.resolveRequest(desiredVersion); if (info == null) { throw new (_errors || _load_errors()).MessageError(_this3.reporter.lang('packageNotFoundRegistry', _this3.name, NPM_REGISTRY_ID)); } @@ -51101,6 +51070,11 @@ class NpmResolver extends (_registryResolver || _load_registryResolver()).defaul const deprecated = info.deprecated, dist = info.dist; + if (shrunk && shrunk._remote) { + shrunk._remote.integrity = dist && dist.integrity ? ssri.parse(dist.integrity) : ssri.fromHex(dist && dist.shasum ? dist.shasum : '', 'sha1'); + return shrunk; + } + if (typeof deprecated === 'string') { let human = `${info.name}@${info.version}`; const parentNames = _this3.request.parentNames; @@ -51116,6 +51090,7 @@ class NpmResolver extends (_registryResolver || _load_registryResolver()).defaul type: 'tarball', reference: _this3.cleanRegistry(dist.tarball), hash: dist.shasum, + integrity: dist.integrity ? ssri.parse(dist.integrity) : ssri.fromHex(dist.shasum, 'sha1'), registry: NPM_REGISTRY_ID, packageName: info.name }; @@ -51131,7 +51106,205 @@ exports.default = NpmResolver; NpmResolver.registry = NPM_REGISTRY_ID; /***/ }), -/* 167 */ +/* 218 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.fileDatesEqual = exports.copyFile = exports.unlink = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +// We want to preserve file timestamps when copying a file, since yarn uses them to decide if a file has +// changed compared to the cache. +// There are some OS specific cases here: +// * On linux, fs.copyFile does not preserve timestamps, but does on OSX and Win. +// * On windows, you must open a file with write permissions to call `fs.futimes`. +// * On OSX you can open with read permissions and still call `fs.futimes`. +let fixTimes = (() => { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (fd, dest, data) { + const doOpen = fd === undefined; + let openfd = fd ? fd : -1; + + if (disableTimestampCorrection === undefined) { + // if timestamps match already, no correction is needed. + // the need to correct timestamps varies based on OS and node versions. + const destStat = yield lstat(dest); + disableTimestampCorrection = fileDatesEqual(destStat.mtime, data.mtime); + } + + if (disableTimestampCorrection) { + return; + } + + if (doOpen) { + try { + openfd = yield open(dest, 'a', data.mode); + } catch (er) { + // file is likely read-only + try { + openfd = yield open(dest, 'r', data.mode); + } catch (err) { + // We can't even open this file for reading. + return; + } + } + } + + try { + if (openfd) { + yield futimes(openfd, data.atime, data.mtime); + } + } catch (er) { + // If `futimes` throws an exception, we probably have a case of a read-only file on Windows. + // In this case we can just return. The incorrect timestamp will just cause that file to be recopied + // on subsequent installs, which will effect yarn performance but not break anything. + } finally { + if (doOpen && openfd) { + yield close(openfd); + } + } + }); + + return function fixTimes(_x7, _x8, _x9) { + return _ref3.apply(this, arguments); + }; +})(); + +// Compare file timestamps. +// Some versions of Node on windows zero the milliseconds when utime is used. + + +var _fs; + +function _load_fs() { + return _fs = _interopRequireDefault(__webpack_require__(5)); +} + +var _promise; + +function _load_promise() { + return _promise = __webpack_require__(50); +} + +var _fs2; + +function _load_fs2() { + return _fs2 = __webpack_require__(4); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +let disableTimestampCorrection = undefined; // OS dependent. will be detected on first file copy. + +// This module serves as a wrapper for file operations that are inconsistant across node and OS versions. + +const readFileBuffer = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.readFile); +const close = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.close); +const lstat = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.lstat); +const open = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.open); +const futimes = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.futimes); + +const write = (0, (_promise || _load_promise()).promisify)((_fs || _load_fs()).default.write); + +const unlink = exports.unlink = (0, (_promise || _load_promise()).promisify)(__webpack_require__(307)); + +/** + * Unlinks the destination to force a recreation. This is needed on case-insensitive file systems + * to force the correct naming when the filename has changed only in character-casing. (Jest -> jest). + */ +const copyFile = exports.copyFile = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data, cleanup) { + // $FlowFixMe: Flow doesn't currently support COPYFILE_FICLONE + const ficloneFlag = (_fs2 || _load_fs2()).constants.COPYFILE_FICLONE || 0; + try { + yield unlink(data.dest); + yield copyFilePoly(data.src, data.dest, ficloneFlag, data); + } finally { + if (cleanup) { + cleanup(); + } + } + }); + + return function copyFile(_x, _x2) { + return _ref.apply(this, arguments); + }; +})(); + +// Node 8.5.0 introduced `fs.copyFile` which is much faster, so use that when available. +// Otherwise we fall back to reading and writing files as buffers. +const copyFilePoly = (src, dest, flags, data) => { + if ((_fs || _load_fs()).default.copyFile) { + return new Promise((resolve, reject) => (_fs || _load_fs()).default.copyFile(src, dest, flags, err => { + if (err) { + reject(err); + } else { + fixTimes(undefined, dest, data).then(() => resolve()).catch(ex => reject(ex)); + } + })); + } else { + return copyWithBuffer(src, dest, flags, data); + } +}; + +const copyWithBuffer = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest, flags, data) { + // Use open -> write -> futimes -> close sequence to avoid opening the file twice: + // one with writeFile and one with utimes + const fd = yield open(dest, 'w', data.mode); + try { + const buffer = yield readFileBuffer(src); + yield write(fd, buffer, 0, buffer.length); + yield fixTimes(fd, dest, data); + } finally { + yield close(fd); + } + }); + + return function copyWithBuffer(_x3, _x4, _x5, _x6) { + return _ref2.apply(this, arguments); + }; +})();const fileDatesEqual = exports.fileDatesEqual = (a, b) => { + const aTime = a.getTime(); + const bTime = b.getTime(); + + if (process.platform !== 'win32') { + return aTime === bTime; + } + + // See https://github.com/nodejs/node/pull/12607 + // Submillisecond times from stat and utimes are truncated on Windows, + // causing a file with mtime 8.0079998 and 8.0081144 to become 8.007 and 8.008 + // and making it impossible to update these files to their correct timestamps. + if (Math.abs(aTime - bTime) <= 1) { + return true; + } + + const aTimeSec = Math.floor(aTime / 1000); + const bTimeSec = Math.floor(bTime / 1000); + + // See https://github.com/nodejs/node/issues/2069 + // Some versions of Node on windows zero the milliseconds when utime is used + // So if any of the time has a milliseconds part of zero we suspect that the + // bug is present and compare only seconds. + if (aTime - aTimeSec * 1000 === 0 || bTime - bTimeSec * 1000 === 0) { + return aTimeSec === bTimeSec; + } + + return aTime === bTime; +}; + +/***/ }), +/* 219 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51141,52 +51314,46 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _slicedToArray2; - -function _load_slicedToArray() { - return _slicedToArray2 = _interopRequireDefault(__webpack_require__(15)); -} - var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(29)); + return _extends2 = _interopRequireDefault(__webpack_require__(21)); } var _invariant; function _load_invariant() { - return _invariant = _interopRequireDefault(__webpack_require__(6)); + return _invariant = _interopRequireDefault(__webpack_require__(9)); } var _string_decoder; function _load_string_decoder() { - return _string_decoder = __webpack_require__(231); + return _string_decoder = __webpack_require__(333); } var _tarFs; function _load_tarFs() { - return _tarFs = _interopRequireDefault(__webpack_require__(147)); + return _tarFs = _interopRequireDefault(__webpack_require__(193)); } var _tarStream; function _load_tarStream() { - return _tarStream = _interopRequireDefault(__webpack_require__(325)); + return _tarStream = _interopRequireDefault(__webpack_require__(460)); } var _url; function _load_url() { - return _url = _interopRequireDefault(__webpack_require__(14)); + return _url = _interopRequireDefault(__webpack_require__(24)); } var _fs; @@ -51198,25 +51365,25 @@ function _load_fs() { var _errors; function _load_errors() { - return _errors = __webpack_require__(3); + return _errors = __webpack_require__(6); } var _gitSpawn; function _load_gitSpawn() { - return _gitSpawn = __webpack_require__(277); + return _gitSpawn = __webpack_require__(373); } var _gitRefResolver; function _load_gitRefResolver() { - return _gitRefResolver = __webpack_require__(441); + return _gitRefResolver = __webpack_require__(581); } var _crypto; function _load_crypto() { - return _crypto = _interopRequireWildcard(__webpack_require__(124)); + return _crypto = _interopRequireWildcard(__webpack_require__(168)); } var _fs2; @@ -51228,7 +51395,13 @@ function _load_fs2() { var _map; function _load_map() { - return _map = _interopRequireDefault(__webpack_require__(18)); + return _map = _interopRequireDefault(__webpack_require__(29)); +} + +var _misc; + +function _load_misc() { + return _misc = __webpack_require__(18); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -51236,11 +51409,19 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const GIT_PROTOCOL_PREFIX = 'git+'; + const SSH_PROTOCOL = 'ssh:'; const SCP_PATH_PREFIX = '/:'; +const FILE_PROTOCOL = 'file:'; +const GIT_VALID_REF_LINE_REGEXP = /^([a-fA-F0-9]+|ref)/; + +const validRef = line => { + return GIT_VALID_REF_LINE_REGEXP.exec(line); +}; const supportsArchiveCache = (0, (_map || _load_map()).default)({ - 'github.com': false }); + 'github.com': false // not support, doubt they will ever support it +}); const handleSpawnError = err => { if (err instanceof (_errors || _load_errors()).ProcessSpawnError) { @@ -51284,17 +51465,15 @@ class Git { * git "URLs" also allow an alternative scp-like syntax, so they're not standard URLs. */ static npmUrlToGitUrl(npmUrl) { - // Expand shortened format first if needed + npmUrl = (0, (_misc || _load_misc()).removePrefix)(npmUrl, GIT_PROTOCOL_PREFIX); + let parsed = (_url || _load_url()).default.parse(npmUrl); const expander = parsed.protocol && SHORTHAND_SERVICES[parsed.protocol]; + if (expander) { parsed = expander(parsed); } - if (parsed.protocol && parsed.protocol.startsWith(GIT_PROTOCOL_PREFIX)) { - parsed.protocol = parsed.protocol.slice(GIT_PROTOCOL_PREFIX.length); - } - // Special case in npm, where ssh:// prefix is stripped to pass scp-like syntax // which in git works as remote path only if there are no slashes before ':'. // See #3146. @@ -51308,10 +51487,18 @@ class Git { }; } + // git local repos are specified as `git+file:` and a filesystem path, not a url. + let repository; + if (parsed.protocol === FILE_PROTOCOL) { + repository = parsed.path; + } else { + repository = (_url || _load_url()).default.format((0, (_extends2 || _load_extends()).default)({}, parsed, { hash: '' })); + } + return { hostname: parsed.hostname || null, - protocol: parsed.protocol || 'file:', - repository: (_url || _load_url()).default.format((0, (_extends2 || _load_extends()).default)({}, parsed, { hash: '' })) + protocol: parsed.protocol || FILE_PROTOCOL, + repository: repository || '' }; } @@ -51347,8 +51534,14 @@ class Git { static repoExists(ref) { return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const isLocal = ref.protocol === FILE_PROTOCOL; + try { - yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '-t', ref.repository]); + if (isLocal) { + yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show-ref', '-t'], { cwd: ref.repository }); + } else { + yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '-t', ref.repository]); + } return true; } catch (err) { handleSpawnError(err); @@ -51380,7 +51573,8 @@ class Git { if (yield Git.repoExists(secureUrl)) { return secureUrl; } else { - throw new (_errors || _load_errors()).SecurityError(reporter.lang('refusingDownloadGitWithoutCommit', ref)); + reporter.warn(reporter.lang('downloadGitWithoutCommit', ref.repository)); + return ref; } } @@ -51389,19 +51583,8 @@ class Git { if (yield Git.repoExists(secureRef)) { return secureRef; } else { - if (yield Git.repoExists(ref)) { - return ref; - } else { - throw new (_errors || _load_errors()).SecurityError(reporter.lang('refusingDownloadHTTPWithoutCommit', ref)); - } - } - } - - if (ref.protocol === 'https:') { - if (yield Git.repoExists(ref)) { + reporter.warn(reporter.lang('downloadHTTPWithoutCommit', ref.repository)); return ref; - } else { - throw new (_errors || _load_errors()).SecurityError(reporter.lang('refusingDownloadHTTPSWithoutCommit', ref)); } } @@ -51484,7 +51667,8 @@ class Git { process(proc, update, reject, done) { const extractor = (_tarFs || _load_tarFs()).default.extract(dest, { dmode: 0o555, // all dirs should be readable - fmode: 0o444 }); + fmode: 0o444 // all files should be readable + }); extractor.on('error', reject); extractor.on('finish', done); @@ -51504,7 +51688,8 @@ class Git { process(proc, resolve, reject, done) { const extractor = (_tarFs || _load_tarFs()).default.extract(dest, { dmode: 0o555, // all dirs should be readable - fmode: 0o444 }); + fmode: 0o444 // all files should be readable + }); extractor.on('error', reject); extractor.on('finish', done); @@ -51528,6 +51713,7 @@ class Git { return (_fs2 || _load_fs2()).lockQueue.push(gitUrl.repository, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { if (yield (_fs2 || _load_fs2()).exists(cwd)) { + yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['fetch', '--tags'], { cwd }); yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['pull'], { cwd }); } else { yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['clone', gitUrl.repository, cwd]); @@ -51634,7 +51820,15 @@ class Git { var _this9 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--tags', '--heads', _this9.gitUrl.repository]); + const isLocal = _this9.gitUrl.protocol === FILE_PROTOCOL; + let stdout; + + if (isLocal) { + stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show-ref', '--tags', '--heads'], { cwd: _this9.gitUrl.repository }); + } else { + stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--tags', '--heads', _this9.gitUrl.repository]); + } + const refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(stdout); return _this9.setRef(refs); })(); @@ -51653,30 +51847,42 @@ class Git { var _this10 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const isLocal = _this10.gitUrl.protocol === FILE_PROTOCOL; + try { - const stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--symref', _this10.gitUrl.repository, 'HEAD']); - const lines = stdout.split('\n'); + let stdout; + if (isLocal) { + stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show-ref', 'HEAD'], { cwd: _this10.gitUrl.repository }); + const refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(stdout); + const sha = refs.values().next().value; + if (sha) { + return { sha, ref: undefined }; + } else { + throw new Error('Unable to find SHA for git HEAD'); + } + } else { + stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--symref', _this10.gitUrl.repository, 'HEAD']); + const lines = stdout.split('\n').filter(validRef); - var _lines$0$split = lines[0].split(/\s+/), - _lines$0$split2 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_lines$0$split, 2); + var _lines$0$split = lines[0].split(/\s+/); - const ref = _lines$0$split2[1]; + const ref = _lines$0$split[1]; - var _lines$1$split = lines[1].split(/\s+/), - _lines$1$split2 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_lines$1$split, 1); + var _lines$1$split = lines[1].split(/\s+/); - const sha = _lines$1$split2[0]; + const sha = _lines$1$split[0]; - return { sha, ref }; + return { sha, ref }; + } } catch (err) { handleSpawnError(err); // older versions of git don't support "--symref" const stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', _this10.gitUrl.repository, 'HEAD']); + const lines = stdout.split('\n').filter(validRef); - var _stdout$split = stdout.split(/\s+/), - _stdout$split2 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_stdout$split, 1); + var _lines$0$split2 = lines[0].split(/\s+/); - const sha = _stdout$split2[0]; + const sha = _lines$0$split2[0]; return { sha, ref: undefined }; } @@ -51697,10 +51903,9 @@ class Git { const revListArgs = ['rev-list', '-n', '1', '--no-abbrev-commit', '--format=oneline', shaToResolve]; const stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(revListArgs, { cwd: _this11.cwd }); - var _stdout$split3 = stdout.split(/\s+/), - _stdout$split4 = (0, (_slicedToArray2 || _load_slicedToArray()).default)(_stdout$split3, 1); + var _stdout$split = stdout.split(/\s+/); - const sha = _stdout$split4[0]; + const sha = _stdout$split[0]; return { sha, ref: undefined }; } catch (err) { @@ -51731,7 +51936,7 @@ class Git { refs }); if (!resolvedResult) { - throw new (_errors || _load_errors()).MessageError(_this12.reporter.lang('couldntFindMatch', version, Object.keys(refs).join(','), _this12.gitUrl.repository)); + throw new (_errors || _load_errors()).MessageError(_this12.reporter.lang('couldntFindMatch', version, Array.from(refs.keys()).join(','), _this12.gitUrl.repository)); } _this12.hash = resolvedResult.sha; @@ -51743,76 +51948,7 @@ class Git { exports.default = Git; /***/ }), -/* 168 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = guessName; - -var _url; - -function _load_url() { - return _url = _interopRequireDefault(__webpack_require__(14)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function cleanup(name) { - name = name.replace(/-\d+\.\d+\.\d+/, ''); - return name.split('.')[0]; -} - -function guessNameFallback(source) { - // If cannot parse as url, just return cleaned up last part - const parts = source.split('/'); - return cleanup(parts[parts.length - 1]); -} - -function guessName(source) { - try { - const parsed = (_url || _load_url()).default.parse(source); - - if (!parsed.pathname) { - return guessNameFallback(source); - } - - const parts = parsed.pathname.split('/'); - - // Priority goes to part that ends with .git - for (const part of parts) { - if (part.match(/\.git$/)) { - return cleanup(part); - } - } - - // Most likely a directory - if (parsed.host == null) { - return cleanup(parts[parts.length - 1]); - } - - // A site like github or gitlab - if (parts.length > 2) { - return cleanup(parts[2]); - } - - // Privately hosted package? - if (parts.length > 1) { - return cleanup(parts[1]); - } - - return guessNameFallback(source); - } catch (e) { - return guessNameFallback(source); - } -} - -/***/ }), -/* 169 */ +/* 220 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51825,25 +51961,25 @@ Object.defineProperty(exports, "__esModule", { var _asyncToGenerator2; function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(1)); + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } var _resolveRelative; function _load_resolveRelative() { - return _resolveRelative = _interopRequireDefault(__webpack_require__(446)); + return _resolveRelative = _interopRequireDefault(__webpack_require__(586)); } var _validate; function _load_validate() { - return _validate = _interopRequireDefault(__webpack_require__(98)); + return _validate = _interopRequireDefault(__webpack_require__(125)); } var _fix; function _load_fix() { - return _fix = _interopRequireDefault(__webpack_require__(443)); + return _fix = _interopRequireDefault(__webpack_require__(583)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -51899,7 +52035,7 @@ exports.default = (() => { })(); /***/ }), -/* 170 */ +/* 221 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51909,6 +52045,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.isValidLicense = isValidLicense; +exports.isValidBin = isValidBin; exports.stringifyPerson = stringifyPerson; exports.parsePerson = parsePerson; exports.normalizePerson = normalizePerson; @@ -51916,12 +52053,20 @@ exports.extractDescription = extractDescription; exports.extractRepositoryUrl = extractRepositoryUrl; -const validateLicense = __webpack_require__(669); +const path = __webpack_require__(0); + +const validateLicense = __webpack_require__(959); + +const PARENT_PATH = /^\.\.([\\\/]|$)/; function isValidLicense(license) { return !!license && validateLicense(license).validForNewPackages; } +function isValidBin(bin) { + return !path.isAbsolute(bin) && !PARENT_PATH.test(path.normalize(bin)); +} + function stringifyPerson(person) { if (!person || typeof person !== 'object') { return person; @@ -52019,7 +52164,31 @@ function extractRepositoryUrl(repository) { } /***/ }), -/* 171 */ +/* 222 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getPlatformSpecificPackageFilename = getPlatformSpecificPackageFilename; +exports.getSystemParams = getSystemParams; +function getPlatformSpecificPackageFilename(pkg) { + // TODO support hash for all subdependencies that have installs scripts + const normalizeScope = name => name[0] === '@' ? name.substr(1).replace('/', '-') : name; + const suffix = getSystemParams(); + return `${normalizeScope(pkg.name)}-v${pkg.version}-${suffix}`; +} + +function getSystemParams() { + // TODO support platform variant for linux + return `${process.platform}-${process.arch}-${process.versions.modules || ''}`; +} + +/***/ }), +/* 223 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52047,7 +52216,206 @@ function isRootUser(uid) { } /***/ }), -/* 172 */ +/* 224 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.satisfiesWithPrereleases = satisfiesWithPrereleases; +exports.diffWithUnstable = diffWithUnstable; + +var _semver; + +function _load_semver() { + return _semver = _interopRequireDefault(__webpack_require__(22)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns whether the given semver version satisfies the given range. Notably this supports + * prerelease versions so that "2.0.0-rc.0" satisfies the range ">=1.0.0", for example. + */ + +function satisfiesWithPrereleases(version, range, loose = false) { + let semverRange; + try { + // $FlowFixMe: Add a definition for the Range class + semverRange = new (_semver || _load_semver()).default.Range(range, loose); + } catch (err) { + return false; + } + + if (!version) { + return false; + } + let semverVersion; + try { + semverVersion = new (_semver || _load_semver()).default.SemVer(version, semverRange.loose); + } catch (err) { + return false; + } + + // A range has multiple sets of comparators. A version must satisfy all comparators in a set + // and at least one set to satisfy the range. + return semverRange.set.some(comparatorSet => { + // node-semver converts ~ and ^ ranges into pairs of >= and < ranges but the upper bounds don't + // properly exclude prerelease versions. For example, "^1.0.0" is converted to ">=1.0.0 <2.0.0", + // which includes "2.0.0-pre" since prerelease versions are lower than their non-prerelease + // counterparts. As a practical workaround we make upper-bound ranges exclude prereleases and + // convert "<2.0.0" to "<2.0.0-0", for example. + comparatorSet = comparatorSet.map(comparator => { + if (comparator.operator !== '<' || !comparator.value || comparator.semver.prerelease.length) { + return comparator; + } + + // "0" is the lowest prerelease version + comparator.semver.inc('pre', 0); + + const comparatorString = comparator.operator + comparator.semver.version; + // $FlowFixMe: Add a definition for the Comparator class + return new (_semver || _load_semver()).default.Comparator(comparatorString, comparator.loose); + }); + + return !comparatorSet.some(comparator => !comparator.test(semverVersion)); + }); +} + +const PRE_RELEASES = { + major: 'premajor', + minor: 'preminor', + patch: 'prepatch' +}; + +/** + * Returns the difference between two versions as a semantic string representation. + * Similar to the `diff` method in node-semver, but it also accounts for unstable versions, + * like 0.x.x or 0.0.x. + */ + +function diffWithUnstable(version1, version2) { + if ((_semver || _load_semver()).default.eq(version1, version2) === false) { + const v1 = (_semver || _load_semver()).default.parse(version1); + const v2 = (_semver || _load_semver()).default.parse(version2); + + if (v1 != null && v2 != null) { + const isPreRelease = v1.prerelease.length > 0 || v2.prerelease.length > 0; + const preMajor = v1.major === 0 || v2.major === 0; + const preMinor = preMajor && (v1.minor === 0 || v2.minor === 0); + + let diff = null; + + if (v1.major !== v2.major) { + diff = 'major'; + } else if (v1.minor !== v2.minor) { + if (preMajor) { + // If the major version number is zero (0.x.x), treat a change + // of the minor version number as a major change. + diff = 'major'; + } else { + diff = 'minor'; + } + } else if (v1.patch !== v2.patch) { + if (preMinor) { + // If the major & minor version numbers are zero (0.0.x), treat a change + // of the patch version number as a major change. + diff = 'major'; + } else if (preMajor) { + // If the major version number is zero (0.x.x), treat a change + // of the patch version number as a minor change. + diff = 'minor'; + } else { + diff = 'patch'; + } + } + + if (isPreRelease) { + if (diff != null) { + diff = PRE_RELEASES[diff]; + } else { + diff = 'prerelease'; + } + } + + return diff; + } + } + + return null; +} + +/***/ }), +/* 225 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getDataDir = getDataDir; +exports.getCacheDir = getCacheDir; +exports.getConfigDir = getConfigDir; +const path = __webpack_require__(0); +const userHome = __webpack_require__(67).default; + +const FALLBACK_CONFIG_DIR = path.join(userHome, '.config', 'yarn'); +const FALLBACK_CACHE_DIR = path.join(userHome, '.cache', 'yarn'); + +function getDataDir() { + if (process.platform === 'win32') { + const WIN32_APPDATA_DIR = getLocalAppDataDir(); + return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path.join(WIN32_APPDATA_DIR, 'Data'); + } else if (process.env.XDG_DATA_HOME) { + return path.join(process.env.XDG_DATA_HOME, 'yarn'); + } else { + // This could arguably be ~/Library/Application Support/Yarn on Macs, + // but that feels unintuitive for a cli tool + + // Instead, use our prior fallback. Some day this could be + // path.join(userHome, '.local', 'share', 'yarn') + // or return path.join(WIN32_APPDATA_DIR, 'Data') on win32 + return FALLBACK_CONFIG_DIR; + } +} + +function getCacheDir() { + if (process.platform === 'win32') { + // process.env.TEMP also exists, but most apps put caches here + return path.join(getLocalAppDataDir() || path.join(userHome, 'AppData', 'Local', 'Yarn'), 'Cache'); + } else if (process.env.XDG_CACHE_HOME) { + return path.join(process.env.XDG_CACHE_HOME, 'yarn'); + } else if (process.platform === 'darwin') { + return path.join(userHome, 'Library', 'Caches', 'Yarn'); + } else { + return FALLBACK_CACHE_DIR; + } +} + +function getConfigDir() { + if (process.platform === 'win32') { + // Use our prior fallback. Some day this could be + // return path.join(WIN32_APPDATA_DIR, 'Config') + const WIN32_APPDATA_DIR = getLocalAppDataDir(); + return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path.join(WIN32_APPDATA_DIR, 'Config'); + } else if (process.env.XDG_CONFIG_HOME) { + return path.join(process.env.XDG_CONFIG_HOME, 'yarn'); + } else { + return FALLBACK_CONFIG_DIR; + } +} + +function getLocalAppDataDir() { + return process.env.LOCALAPPDATA ? path.join(process.env.LOCALAPPDATA, 'Yarn') : null; +} + +/***/ }), +/* 226 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52067,14 +52435,16 @@ function explodeHashedUrl(url) { } /***/ }), -/* 173 */ +/* 227 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = { "default": __webpack_require__(180), __esModule: true }; +module.exports = { "default": __webpack_require__(233), __esModule: true }; /***/ }), -/* 174 */ -/***/ (function(module, exports) { +/* 228 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; module.exports = balanced; function balanced(a, b, str) { @@ -52137,11 +52507,11 @@ function range(a, b, str) { /***/ }), -/* 175 */ +/* 229 */ /***/ (function(module, exports, __webpack_require__) { -var concatMap = __webpack_require__(179); -var balanced = __webpack_require__(174); +var concatMap = __webpack_require__(232); +var balanced = __webpack_require__(228); module.exports = expandTop; @@ -52344,122 +52714,7 @@ function expand(str, isTop) { /***/ }), -/* 176 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var buffer = __webpack_require__(121); -var Buffer = buffer.Buffer; -var SlowBuffer = buffer.SlowBuffer; -var MAX_LEN = buffer.kMaxLength || 2147483647; -exports.alloc = function alloc(size, fill, encoding) { - if (typeof Buffer.alloc === 'function') { - return Buffer.alloc(size, fill, encoding); - } - if (typeof encoding === 'number') { - throw new TypeError('encoding must not be number'); - } - if (typeof size !== 'number') { - throw new TypeError('size must be a number'); - } - if (size > MAX_LEN) { - throw new RangeError('size is too large'); - } - var enc = encoding; - var _fill = fill; - if (_fill === undefined) { - enc = undefined; - _fill = 0; - } - var buf = new Buffer(size); - if (typeof _fill === 'string') { - var fillBuf = new Buffer(_fill, enc); - var flen = fillBuf.length; - var i = -1; - while (++i < size) { - buf[i] = fillBuf[i % flen]; - } - } else { - buf.fill(_fill); - } - return buf; -} -exports.allocUnsafe = function allocUnsafe(size) { - if (typeof Buffer.allocUnsafe === 'function') { - return Buffer.allocUnsafe(size); - } - if (typeof size !== 'number') { - throw new TypeError('size must be a number'); - } - if (size > MAX_LEN) { - throw new RangeError('size is too large'); - } - return new Buffer(size); -} -exports.from = function from(value, encodingOrOffset, length) { - if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) { - return Buffer.from(value, encodingOrOffset, length); - } - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number'); - } - if (typeof value === 'string') { - return new Buffer(value, encodingOrOffset); - } - if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { - var offset = encodingOrOffset; - if (arguments.length === 1) { - return new Buffer(value); - } - if (typeof offset === 'undefined') { - offset = 0; - } - var len = length; - if (typeof len === 'undefined') { - len = value.byteLength - offset; - } - if (offset >= value.byteLength) { - throw new RangeError('\'offset\' is out of bounds'); - } - if (len > value.byteLength - offset) { - throw new RangeError('\'length\' is out of bounds'); - } - return new Buffer(value.slice(offset, offset + len)); - } - if (Buffer.isBuffer(value)) { - var out = new Buffer(value.length); - value.copy(out, 0, 0, value.length); - return out; - } - if (value) { - if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) { - return new Buffer(value); - } - if (value.type === 'Buffer' && Array.isArray(value.data)) { - return new Buffer(value.data); - } - } - - throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.'); -} -exports.allocUnsafeSlow = function allocUnsafeSlow(size) { - if (typeof Buffer.allocUnsafeSlow === 'function') { - return Buffer.allocUnsafeSlow(size); - } - if (typeof size !== 'number') { - throw new TypeError('size must be a number'); - } - if (size >= MAX_LEN) { - throw new RangeError('size is too large'); - } - return new SlowBuffer(size); -} - - -/***/ }), -/* 177 */ +/* 230 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52530,7 +52785,7 @@ module.exports = function (str) { /***/ }), -/* 178 */ +/* 231 */ /***/ (function(module, exports) { function Caseless (dict) { @@ -52603,7 +52858,7 @@ module.exports.httpify = function (resp, headers) { /***/ }), -/* 179 */ +/* 232 */ /***/ (function(module, exports) { module.exports = function (xs, fn) { @@ -52622,103 +52877,113 @@ var isArray = Array.isArray || function (xs) { /***/ }), -/* 180 */ +/* 233 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(202); -__webpack_require__(86); -__webpack_require__(109); -__webpack_require__(203); -module.exports = __webpack_require__(21).Promise; +__webpack_require__(259); +__webpack_require__(261); +__webpack_require__(264); +__webpack_require__(260); +__webpack_require__(262); +__webpack_require__(263); +module.exports = __webpack_require__(31).Promise; + /***/ }), -/* 181 */ +/* 234 */ /***/ (function(module, exports) { -module.exports = function(){ /* empty */ }; +module.exports = function () { /* empty */ }; + /***/ }), -/* 182 */ +/* 235 */ /***/ (function(module, exports) { -module.exports = function(it, Constructor, name, forbiddenField){ - if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ +module.exports = function (it, Constructor, name, forbiddenField) { + if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { throw TypeError(name + ': incorrect invocation!'); } return it; }; + /***/ }), -/* 183 */ +/* 236 */ /***/ (function(module, exports, __webpack_require__) { // false -> Array#indexOf // true -> Array#includes -var toIObject = __webpack_require__(70) - , toLength = __webpack_require__(85) - , toIndex = __webpack_require__(199); -module.exports = function(IS_INCLUDES){ - return function($this, el, fromIndex){ - var O = toIObject($this) - , length = toLength(O.length) - , index = toIndex(fromIndex, length) - , value; +var toIObject = __webpack_require__(98); +var toLength = __webpack_require__(136); +var toAbsoluteIndex = __webpack_require__(254); +module.exports = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; // Array#includes uses SameValueZero equality algorithm - if(IS_INCLUDES && el != el)while(length > index){ + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; - if(value != value)return true; - // Array#toIndex ignores holes, Array#includes - not - } else for(;length > index; index++)if(IS_INCLUDES || index in O){ - if(O[index] === el)return IS_INCLUDES || index || 0; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) if (IS_INCLUDES || index in O) { + if (O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; + /***/ }), -/* 184 */ +/* 237 */ /***/ (function(module, exports, __webpack_require__) { -var ctx = __webpack_require__(37) - , call = __webpack_require__(129) - , isArrayIter = __webpack_require__(128) - , anObject = __webpack_require__(26) - , toLength = __webpack_require__(85) - , getIterFn = __webpack_require__(108) - , BREAK = {} - , RETURN = {}; -var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ - var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable) - , f = ctx(fn, that, entries ? 2 : 1) - , index = 0 - , length, step, iterator, result; - if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); +var ctx = __webpack_require__(70); +var call = __webpack_require__(241); +var isArrayIter = __webpack_require__(240); +var anObject = __webpack_require__(35); +var toLength = __webpack_require__(136); +var getIterFn = __webpack_require__(257); +var BREAK = {}; +var RETURN = {}; +var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { + var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); + var f = ctx(fn, that, entries ? 2 : 1); + var index = 0; + var length, step, iterator, result; + if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); // fast case for arrays with default iterator - if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); - if(result === BREAK || result === RETURN)return result; - } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + if (result === BREAK || result === RETURN) return result; + } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { result = call(iterator, f, step.value, entries); - if(result === BREAK || result === RETURN)return result; + if (result === BREAK || result === RETURN) return result; } }; -exports.BREAK = BREAK; +exports.BREAK = BREAK; exports.RETURN = RETURN; + /***/ }), -/* 185 */ +/* 238 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = !__webpack_require__(33) && !__webpack_require__(83)(function(){ - return Object.defineProperty(__webpack_require__(65)('div'), 'a', {get: function(){ return 7; }}).a != 7; +module.exports = !__webpack_require__(51) && !__webpack_require__(112)(function () { + return Object.defineProperty(__webpack_require__(92)('div'), 'a', { get: function () { return 7; } }).a != 7; }); + /***/ }), -/* 186 */ +/* 239 */ /***/ (function(module, exports) { // fast apply, http://jsperf.lnkit.com/fast-apply/5 -module.exports = function(fn, args, that){ +module.exports = function (fn, args, that) { var un = that === undefined; - switch(args.length){ + switch (args.length) { case 0: return un ? fn() : fn.call(that); case 1: return un ? fn(args[0]) @@ -52729,84 +52994,148 @@ module.exports = function(fn, args, that){ : fn.call(that, args[0], args[1], args[2]); case 4: return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); - } return fn.apply(that, args); + } return fn.apply(that, args); }; + /***/ }), -/* 187 */ +/* 240 */ +/***/ (function(module, exports, __webpack_require__) { + +// check on default Array iterator +var Iterators = __webpack_require__(53); +var ITERATOR = __webpack_require__(20)('iterator'); +var ArrayProto = Array.prototype; + +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; + + +/***/ }), +/* 241 */ +/***/ (function(module, exports, __webpack_require__) { + +// call something on iterator step with safe closing on error +var anObject = __webpack_require__(35); +module.exports = function (iterator, fn, value, entries) { + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (e) { + var ret = iterator['return']; + if (ret !== undefined) anObject(ret.call(iterator)); + throw e; + } +}; + + +/***/ }), +/* 242 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var create = __webpack_require__(190) - , descriptor = __webpack_require__(84) - , setToStringTag = __webpack_require__(67) - , IteratorPrototype = {}; +var create = __webpack_require__(246); +var descriptor = __webpack_require__(132); +var setToStringTag = __webpack_require__(95); +var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -__webpack_require__(30)(IteratorPrototype, __webpack_require__(9)('iterator'), function(){ return this; }); +__webpack_require__(42)(IteratorPrototype, __webpack_require__(20)('iterator'), function () { return this; }); -module.exports = function(Constructor, NAME, next){ - Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); +module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); setToStringTag(Constructor, NAME + ' Iterator'); }; -/***/ }), -/* 188 */ -/***/ (function(module, exports) { - -module.exports = function(done, value){ - return {value: value, done: !!done}; -}; /***/ }), -/* 189 */ +/* 243 */ /***/ (function(module, exports, __webpack_require__) { -var global = __webpack_require__(13) - , macrotask = __webpack_require__(105).set - , Observer = global.MutationObserver || global.WebKitMutationObserver - , process = global.process - , Promise = global.Promise - , isNode = __webpack_require__(42)(process) == 'process'; +var ITERATOR = __webpack_require__(20)('iterator'); +var SAFE_CLOSING = false; -module.exports = function(){ +try { + var riter = [7][ITERATOR](); + riter['return'] = function () { SAFE_CLOSING = true; }; + // eslint-disable-next-line no-throw-literal + Array.from(riter, function () { throw 2; }); +} catch (e) { /* empty */ } + +module.exports = function (exec, skipClosing) { + if (!skipClosing && !SAFE_CLOSING) return false; + var safe = false; + try { + var arr = [7]; + var iter = arr[ITERATOR](); + iter.next = function () { return { done: safe = true }; }; + arr[ITERATOR] = function () { return iter; }; + exec(arr); + } catch (e) { /* empty */ } + return safe; +}; + + +/***/ }), +/* 244 */ +/***/ (function(module, exports) { + +module.exports = function (done, value) { + return { value: value, done: !!done }; +}; + + +/***/ }), +/* 245 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(17); +var macrotask = __webpack_require__(135).set; +var Observer = global.MutationObserver || global.WebKitMutationObserver; +var process = global.process; +var Promise = global.Promise; +var isNode = __webpack_require__(69)(process) == 'process'; + +module.exports = function () { var head, last, notify; - var flush = function(){ + var flush = function () { var parent, fn; - if(isNode && (parent = process.domain))parent.exit(); - while(head){ - fn = head.fn; + if (isNode && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; head = head.next; try { fn(); - } catch(e){ - if(head)notify(); + } catch (e) { + if (head) notify(); else last = undefined; throw e; } } last = undefined; - if(parent)parent.enter(); + if (parent) parent.enter(); }; // Node.js - if(isNode){ - notify = function(){ + if (isNode) { + notify = function () { process.nextTick(flush); }; - // browsers with MutationObserver - } else if(Observer){ - var toggle = true - , node = document.createTextNode(''); - new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new - notify = function(){ + // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 + } else if (Observer && !(global.navigator && global.navigator.standalone)) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { node.data = toggle = !toggle; }; // environments with maybe non-completely correct, but existent Promise - } else if(Promise && Promise.resolve){ - var promise = Promise.resolve(); - notify = function(){ + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + var promise = Promise.resolve(undefined); + notify = function () { promise.then(flush); }; // for other environments - macrotask based on: @@ -52816,44 +53145,45 @@ module.exports = function(){ // - onreadystatechange // - setTimeout } else { - notify = function(){ + notify = function () { // strange IE + webpack dev server bug - use .call(global) macrotask.call(global, flush); }; } - return function(fn){ - var task = {fn: fn, next: undefined}; - if(last)last.next = task; - if(!head){ + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { head = task; notify(); } last = task; }; }; + /***/ }), -/* 190 */ +/* 246 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = __webpack_require__(26) - , dPs = __webpack_require__(191) - , enumBugKeys = __webpack_require__(100) - , IE_PROTO = __webpack_require__(68)('IE_PROTO') - , Empty = function(){ /* empty */ } - , PROTOTYPE = 'prototype'; +var anObject = __webpack_require__(35); +var dPs = __webpack_require__(247); +var enumBugKeys = __webpack_require__(127); +var IE_PROTO = __webpack_require__(96)('IE_PROTO'); +var Empty = function () { /* empty */ }; +var PROTOTYPE = 'prototype'; // Create object with fake `null` prototype: use iframe Object with cleared prototype -var createDict = function(){ +var createDict = function () { // Thrash, waste and sodomy: IE GC bug - var iframe = __webpack_require__(65)('iframe') - , i = enumBugKeys.length - , lt = '<' - , gt = '>' - , iframeDocument; + var iframe = __webpack_require__(92)('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; iframe.style.display = 'none'; - __webpack_require__(101).appendChild(iframe); + __webpack_require__(128).appendChild(iframe); iframe.src = 'javascript:'; // eslint-disable-line no-script-url // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); @@ -52862,15 +53192,15 @@ var createDict = function(){ iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); iframeDocument.close(); createDict = iframeDocument.F; - while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; + while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; return createDict(); }; -module.exports = Object.create || function create(O, Properties){ +module.exports = Object.create || function create(O, Properties) { var result; - if(O !== null){ + if (O !== null) { Empty[PROTOTYPE] = anObject(O); - result = new Empty; + result = new Empty(); Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; @@ -52880,129 +53210,122 @@ module.exports = Object.create || function create(O, Properties){ /***/ }), -/* 191 */ +/* 247 */ /***/ (function(module, exports, __webpack_require__) { -var dP = __webpack_require__(38) - , anObject = __webpack_require__(26) - , getKeys = __webpack_require__(131); +var dP = __webpack_require__(72); +var anObject = __webpack_require__(35); +var getKeys = __webpack_require__(171); -module.exports = __webpack_require__(33) ? Object.defineProperties : function defineProperties(O, Properties){ +module.exports = __webpack_require__(51) ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); - var keys = getKeys(Properties) - , length = keys.length - , i = 0 - , P; - while(length > i)dP.f(O, P = keys[i++], Properties[P]); + var keys = getKeys(Properties); + var length = keys.length; + var i = 0; + var P; + while (length > i) dP.f(O, P = keys[i++], Properties[P]); return O; }; + /***/ }), -/* 192 */ +/* 248 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) -var has = __webpack_require__(43) - , toObject = __webpack_require__(106) - , IE_PROTO = __webpack_require__(68)('IE_PROTO') - , ObjectProto = Object.prototype; +var has = __webpack_require__(71); +var toObject = __webpack_require__(172); +var IE_PROTO = __webpack_require__(96)('IE_PROTO'); +var ObjectProto = Object.prototype; -module.exports = Object.getPrototypeOf || function(O){ +module.exports = Object.getPrototypeOf || function (O) { O = toObject(O); - if(has(O, IE_PROTO))return O[IE_PROTO]; - if(typeof O.constructor == 'function' && O instanceof O.constructor){ + if (has(O, IE_PROTO)) return O[IE_PROTO]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; + /***/ }), -/* 193 */ +/* 249 */ /***/ (function(module, exports, __webpack_require__) { -var has = __webpack_require__(43) - , toIObject = __webpack_require__(70) - , arrayIndexOf = __webpack_require__(183)(false) - , IE_PROTO = __webpack_require__(68)('IE_PROTO'); +var has = __webpack_require__(71); +var toIObject = __webpack_require__(98); +var arrayIndexOf = __webpack_require__(236)(false); +var IE_PROTO = __webpack_require__(96)('IE_PROTO'); -module.exports = function(object, names){ - var O = toIObject(object) - , i = 0 - , result = [] - , key; - for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); +module.exports = function (object, names) { + var O = toIObject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); // Don't enum bug & hidden keys - while(names.length > i)if(has(O, key = names[i++])){ + while (names.length > i) if (has(O, key = names[i++])) { ~arrayIndexOf(result, key) || result.push(key); } return result; }; + /***/ }), -/* 194 */ +/* 250 */ /***/ (function(module, exports, __webpack_require__) { -var hide = __webpack_require__(30); -module.exports = function(target, src, safe){ - for(var key in src){ - if(safe && target[key])target[key] = src[key]; +var hide = __webpack_require__(42); +module.exports = function (target, src, safe) { + for (var key in src) { + if (safe && target[key]) target[key] = src[key]; else hide(target, key, src[key]); } return target; }; + /***/ }), -/* 195 */ +/* 251 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = __webpack_require__(30); +module.exports = __webpack_require__(42); + /***/ }), -/* 196 */ +/* 252 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var global = __webpack_require__(13) - , core = __webpack_require__(21) - , dP = __webpack_require__(38) - , DESCRIPTORS = __webpack_require__(33) - , SPECIES = __webpack_require__(9)('species'); +var global = __webpack_require__(17); +var core = __webpack_require__(31); +var dP = __webpack_require__(72); +var DESCRIPTORS = __webpack_require__(51); +var SPECIES = __webpack_require__(20)('species'); -module.exports = function(KEY){ +module.exports = function (KEY) { var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; - if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, { + if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { configurable: true, - get: function(){ return this; } + get: function () { return this; } }); }; -/***/ }), -/* 197 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.3.20 SpeciesConstructor(O, defaultConstructor) -var anObject = __webpack_require__(26) - , aFunction = __webpack_require__(63) - , SPECIES = __webpack_require__(9)('species'); -module.exports = function(O, D){ - var C = anObject(O).constructor, S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); -}; /***/ }), -/* 198 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { -var toInteger = __webpack_require__(69) - , defined = __webpack_require__(64); +var toInteger = __webpack_require__(97); +var defined = __webpack_require__(91); // true -> String#at // false -> String#codePointAt -module.exports = function(TO_STRING){ - return function(that, pos){ - var s = String(defined(that)) - , i = toInteger(pos) - , l = s.length - , a, b; - if(i < 0 || i >= l)return TO_STRING ? '' : undefined; +module.exports = function (TO_STRING) { + return function (that, pos) { + var s = String(defined(that)); + var i = toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a @@ -53010,65 +53333,92 @@ module.exports = function(TO_STRING){ }; }; + /***/ }), -/* 199 */ +/* 254 */ /***/ (function(module, exports, __webpack_require__) { -var toInteger = __webpack_require__(69) - , max = Math.max - , min = Math.min; -module.exports = function(index, length){ +var toInteger = __webpack_require__(97); +var max = Math.max; +var min = Math.min; +module.exports = function (index, length) { index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; + /***/ }), -/* 200 */ +/* 255 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = __webpack_require__(44); +var isObject = __webpack_require__(52); // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string -module.exports = function(it, S){ - if(!isObject(it))return it; +module.exports = function (it, S) { + if (!isObject(it)) return it; var fn, val; - if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; - if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; - if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; throw TypeError("Can't convert object to primitive value"); }; + /***/ }), -/* 201 */ +/* 256 */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(17); +var navigator = global.navigator; + +module.exports = navigator && navigator.userAgent || ''; + + +/***/ }), +/* 257 */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(126); +var ITERATOR = __webpack_require__(20)('iterator'); +var Iterators = __webpack_require__(53); +module.exports = __webpack_require__(31).getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; + + +/***/ }), +/* 258 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var addToUnscopables = __webpack_require__(181) - , step = __webpack_require__(188) - , Iterators = __webpack_require__(32) - , toIObject = __webpack_require__(70); +var addToUnscopables = __webpack_require__(234); +var step = __webpack_require__(244); +var Iterators = __webpack_require__(53); +var toIObject = __webpack_require__(98); // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() -module.exports = __webpack_require__(102)(Array, 'Array', function(iterated, kind){ +module.exports = __webpack_require__(129)(Array, 'Array', function (iterated, kind) { this._t = toIObject(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() -}, function(){ - var O = this._t - , kind = this._k - , index = this._i++; - if(!O || index >= O.length){ +}, function () { + var O = this._t; + var kind = this._k; + var index = this._i++; + if (!O || index >= O.length) { this._t = undefined; return step(1); } - if(kind == 'keys' )return step(0, index); - if(kind == 'values')return step(0, O[index]); + if (kind == 'keys') return step(0, index); + if (kind == 'values') return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); @@ -53079,186 +53429,173 @@ addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); + /***/ }), -/* 202 */ +/* 259 */ /***/ (function(module, exports) { /***/ }), -/* 203 */ +/* 260 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var LIBRARY = __webpack_require__(103) - , global = __webpack_require__(13) - , ctx = __webpack_require__(37) - , classof = __webpack_require__(82) - , $export = __webpack_require__(66) - , isObject = __webpack_require__(44) - , aFunction = __webpack_require__(63) - , anInstance = __webpack_require__(182) - , forOf = __webpack_require__(184) - , speciesConstructor = __webpack_require__(197) - , task = __webpack_require__(105).set - , microtask = __webpack_require__(189)() - , PROMISE = 'Promise' - , TypeError = global.TypeError - , process = global.process - , $Promise = global[PROMISE] - , process = global.process - , isNode = classof(process) == 'process' - , empty = function(){ /* empty */ } - , Internal, GenericPromiseCapability, Wrapper; +var LIBRARY = __webpack_require__(93); +var global = __webpack_require__(17); +var ctx = __webpack_require__(70); +var classof = __webpack_require__(126); +var $export = __webpack_require__(60); +var isObject = __webpack_require__(52); +var aFunction = __webpack_require__(68); +var anInstance = __webpack_require__(235); +var forOf = __webpack_require__(237); +var speciesConstructor = __webpack_require__(134); +var task = __webpack_require__(135).set; +var microtask = __webpack_require__(245)(); +var newPromiseCapabilityModule = __webpack_require__(94); +var perform = __webpack_require__(130); +var userAgent = __webpack_require__(256); +var promiseResolve = __webpack_require__(131); +var PROMISE = 'Promise'; +var TypeError = global.TypeError; +var process = global.process; +var versions = process && process.versions; +var v8 = versions && versions.v8 || ''; +var $Promise = global[PROMISE]; +var isNode = classof(process) == 'process'; +var empty = function () { /* empty */ }; +var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; +var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; -var USE_NATIVE = !!function(){ +var USE_NATIVE = !!function () { try { // correct subclassing with @@species support - var promise = $Promise.resolve(1) - , FakePromise = (promise.constructor = {})[__webpack_require__(9)('species')] = function(exec){ exec(empty, empty); }; + var promise = $Promise.resolve(1); + var FakePromise = (promise.constructor = {})[__webpack_require__(20)('species')] = function (exec) { + exec(empty, empty); + }; // unhandled rejections tracking support, NodeJS Promise without it fails @@species test - return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; - } catch(e){ /* empty */ } + return (isNode || typeof PromiseRejectionEvent == 'function') + && promise.then(empty) instanceof FakePromise + // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // we can't detect it synchronously, so just check versions + && v8.indexOf('6.6') !== 0 + && userAgent.indexOf('Chrome/66') === -1; + } catch (e) { /* empty */ } }(); // helpers -var sameConstructor = function(a, b){ - // with library wrapper special case - return a === b || a === $Promise && b === Wrapper; -}; -var isThenable = function(it){ +var isThenable = function (it) { var then; return isObject(it) && typeof (then = it.then) == 'function' ? then : false; }; -var newPromiseCapability = function(C){ - return sameConstructor($Promise, C) - ? new PromiseCapability(C) - : new GenericPromiseCapability(C); -}; -var PromiseCapability = GenericPromiseCapability = function(C){ - var resolve, reject; - this.promise = new C(function($$resolve, $$reject){ - if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor'); - resolve = $$resolve; - reject = $$reject; - }); - this.resolve = aFunction(resolve); - this.reject = aFunction(reject); -}; -var perform = function(exec){ - try { - exec(); - } catch(e){ - return {error: e}; - } -}; -var notify = function(promise, isReject){ - if(promise._n)return; +var notify = function (promise, isReject) { + if (promise._n) return; promise._n = true; var chain = promise._c; - microtask(function(){ - var value = promise._v - , ok = promise._s == 1 - , i = 0; - var run = function(reaction){ - var handler = ok ? reaction.ok : reaction.fail - , resolve = reaction.resolve - , reject = reaction.reject - , domain = reaction.domain - , result, then; + microtask(function () { + var value = promise._v; + var ok = promise._s == 1; + var i = 0; + var run = function (reaction) { + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then, exited; try { - if(handler){ - if(!ok){ - if(promise._h == 2)onHandleUnhandled(promise); + if (handler) { + if (!ok) { + if (promise._h == 2) onHandleUnhandled(promise); promise._h = 1; } - if(handler === true)result = value; + if (handler === true) result = value; else { - if(domain)domain.enter(); - result = handler(value); - if(domain)domain.exit(); + if (domain) domain.enter(); + result = handler(value); // may throw + if (domain) { + domain.exit(); + exited = true; + } } - if(result === reaction.promise){ + if (result === reaction.promise) { reject(TypeError('Promise-chain cycle')); - } else if(then = isThenable(result)){ + } else if (then = isThenable(result)) { then.call(result, resolve, reject); } else resolve(result); } else reject(value); - } catch(e){ + } catch (e) { + if (domain && !exited) domain.exit(); reject(e); } }; - while(chain.length > i)run(chain[i++]); // variable length - can't use forEach + while (chain.length > i) run(chain[i++]); // variable length - can't use forEach promise._c = []; promise._n = false; - if(isReject && !promise._h)onUnhandled(promise); + if (isReject && !promise._h) onUnhandled(promise); }); }; -var onUnhandled = function(promise){ - task.call(global, function(){ - var value = promise._v - , abrupt, handler, console; - if(isUnhandled(promise)){ - abrupt = perform(function(){ - if(isNode){ +var onUnhandled = function (promise) { + task.call(global, function () { + var value = promise._v; + var unhandled = isUnhandled(promise); + var result, handler, console; + if (unhandled) { + result = perform(function () { + if (isNode) { process.emit('unhandledRejection', value, promise); - } else if(handler = global.onunhandledrejection){ - handler({promise: promise, reason: value}); - } else if((console = global.console) && console.error){ + } else if (handler = global.onunhandledrejection) { + handler({ promise: promise, reason: value }); + } else if ((console = global.console) && console.error) { console.error('Unhandled promise rejection', value); } }); // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should promise._h = isNode || isUnhandled(promise) ? 2 : 1; } promise._a = undefined; - if(abrupt)throw abrupt.error; + if (unhandled && result.e) throw result.v; }); }; -var isUnhandled = function(promise){ - if(promise._h == 1)return false; - var chain = promise._a || promise._c - , i = 0 - , reaction; - while(chain.length > i){ - reaction = chain[i++]; - if(reaction.fail || !isUnhandled(reaction.promise))return false; - } return true; +var isUnhandled = function (promise) { + return promise._h !== 1 && (promise._a || promise._c).length === 0; }; -var onHandleUnhandled = function(promise){ - task.call(global, function(){ +var onHandleUnhandled = function (promise) { + task.call(global, function () { var handler; - if(isNode){ + if (isNode) { process.emit('rejectionHandled', promise); - } else if(handler = global.onrejectionhandled){ - handler({promise: promise, reason: promise._v}); + } else if (handler = global.onrejectionhandled) { + handler({ promise: promise, reason: promise._v }); } }); }; -var $reject = function(value){ +var $reject = function (value) { var promise = this; - if(promise._d)return; + if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap promise._v = value; promise._s = 2; - if(!promise._a)promise._a = promise._c.slice(); + if (!promise._a) promise._a = promise._c.slice(); notify(promise, true); }; -var $resolve = function(value){ - var promise = this - , then; - if(promise._d)return; +var $resolve = function (value) { + var promise = this; + var then; + if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap try { - if(promise === value)throw TypeError("Promise can't be resolved itself"); - if(then = isThenable(value)){ - microtask(function(){ - var wrapper = {_w: promise, _d: false}; // wrap + if (promise === value) throw TypeError("Promise can't be resolved itself"); + if (then = isThenable(value)) { + microtask(function () { + var wrapper = { _w: promise, _d: false }; // wrap try { then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); - } catch(e){ + } catch (e) { $reject.call(wrapper, e); } }); @@ -53267,25 +53604,26 @@ var $resolve = function(value){ promise._s = 1; notify(promise, false); } - } catch(e){ - $reject.call({_w: promise, _d: false}, e); // wrap + } catch (e) { + $reject.call({ _w: promise, _d: false }, e); // wrap } }; // constructor polyfill -if(!USE_NATIVE){ +if (!USE_NATIVE) { // 25.4.3.1 Promise(executor) - $Promise = function Promise(executor){ + $Promise = function Promise(executor) { anInstance(this, $Promise, PROMISE, '_h'); aFunction(executor); Internal.call(this); try { executor(ctx($resolve, this, 1), ctx($reject, this, 1)); - } catch(err){ + } catch (err) { $reject.call(this, err); } }; - Internal = function Promise(executor){ + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { this._c = []; // <- awaiting reactions this._a = undefined; // <- checked in isUnhandled reactions this._s = 0; // <- state @@ -53294,104 +53632,200 @@ if(!USE_NATIVE){ this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled this._n = false; // <- notify }; - Internal.prototype = __webpack_require__(194)($Promise.prototype, { + Internal.prototype = __webpack_require__(250)($Promise.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) - then: function then(onFulfilled, onRejected){ - var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); - reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; - reaction.fail = typeof onRejected == 'function' && onRejected; + then: function then(onFulfilled, onRejected) { + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; reaction.domain = isNode ? process.domain : undefined; this._c.push(reaction); - if(this._a)this._a.push(reaction); - if(this._s)notify(this, false); + if (this._a) this._a.push(reaction); + if (this._s) notify(this, false); return reaction.promise; }, // 25.4.5.1 Promise.prototype.catch(onRejected) - 'catch': function(onRejected){ + 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); - PromiseCapability = function(){ - var promise = new Internal; + OwnPromiseCapability = function () { + var promise = new Internal(); this.promise = promise; this.resolve = ctx($resolve, promise, 1); - this.reject = ctx($reject, promise, 1); + this.reject = ctx($reject, promise, 1); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === $Promise || C === Wrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); }; } -$export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise}); -__webpack_require__(67)($Promise, PROMISE); -__webpack_require__(196)(PROMISE); -Wrapper = __webpack_require__(21)[PROMISE]; +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); +__webpack_require__(95)($Promise, PROMISE); +__webpack_require__(252)(PROMISE); +Wrapper = __webpack_require__(31)[PROMISE]; // statics $export($export.S + $export.F * !USE_NATIVE, PROMISE, { // 25.4.4.5 Promise.reject(r) - reject: function reject(r){ - var capability = newPromiseCapability(this) - , $$reject = capability.reject; + reject: function reject(r) { + var capability = newPromiseCapability(this); + var $$reject = capability.reject; $$reject(r); return capability.promise; } }); $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { // 25.4.4.6 Promise.resolve(x) - resolve: function resolve(x){ - // instanceof instead of internal slot check because we should fix it without replacement native Promise core - if(x instanceof $Promise && sameConstructor(x.constructor, this))return x; - var capability = newPromiseCapability(this) - , $$resolve = capability.resolve; - $$resolve(x); - return capability.promise; + resolve: function resolve(x) { + return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); } }); -$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(130)(function(iter){ +$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(243)(function (iter) { $Promise.all(iter)['catch'](empty); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) - all: function all(iterable){ - var C = this - , capability = newPromiseCapability(C) - , resolve = capability.resolve - , reject = capability.reject; - var abrupt = perform(function(){ - var values = [] - , index = 0 - , remaining = 1; - forOf(iterable, false, function(promise){ - var $index = index++ - , alreadyCalled = false; + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var values = []; + var index = 0; + var remaining = 1; + forOf(iterable, false, function (promise) { + var $index = index++; + var alreadyCalled = false; values.push(undefined); remaining++; - C.resolve(promise).then(function(value){ - if(alreadyCalled)return; - alreadyCalled = true; + C.resolve(promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; values[$index] = value; --remaining || resolve(values); }, reject); }); --remaining || resolve(values); }); - if(abrupt)reject(abrupt.error); + if (result.e) reject(result.v); return capability.promise; }, // 25.4.4.4 Promise.race(iterable) - race: function race(iterable){ - var C = this - , capability = newPromiseCapability(C) - , reject = capability.reject; - var abrupt = perform(function(){ - forOf(iterable, false, function(promise){ + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + forOf(iterable, false, function (promise) { C.resolve(promise).then(capability.resolve, reject); }); }); - if(abrupt)reject(abrupt.error); + if (result.e) reject(result.v); return capability.promise; } }); + /***/ }), -/* 204 */ +/* 261 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $at = __webpack_require__(253)(true); + +// 21.1.3.27 String.prototype[@@iterator]() +__webpack_require__(129)(String, 'String', function (iterated) { + this._t = String(iterated); // target + this._i = 0; // next index +// 21.1.5.2.1 %StringIteratorPrototype%.next() +}, function () { + var O = this._t; + var index = this._i; + var point; + if (index >= O.length) return { value: undefined, done: true }; + point = $at(O, index); + this._i += point.length; + return { value: point, done: false }; +}); + + +/***/ }), +/* 262 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// https://github.com/tc39/proposal-promise-finally + +var $export = __webpack_require__(60); +var core = __webpack_require__(31); +var global = __webpack_require__(17); +var speciesConstructor = __webpack_require__(134); +var promiseResolve = __webpack_require__(131); + +$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { + var C = speciesConstructor(this, core.Promise || global.Promise); + var isFunction = typeof onFinally == 'function'; + return this.then( + isFunction ? function (x) { + return promiseResolve(C, onFinally()).then(function () { return x; }); + } : onFinally, + isFunction ? function (e) { + return promiseResolve(C, onFinally()).then(function () { throw e; }); + } : onFinally + ); +} }); + + +/***/ }), +/* 263 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-promise-try +var $export = __webpack_require__(60); +var newPromiseCapability = __webpack_require__(94); +var perform = __webpack_require__(130); + +$export($export.S, 'Promise', { 'try': function (callbackfn) { + var promiseCapability = newPromiseCapability.f(this); + var result = perform(callbackfn); + (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); + return promiseCapability.promise; +} }); + + +/***/ }), +/* 264 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(258); +var global = __webpack_require__(17); +var hide = __webpack_require__(42); +var Iterators = __webpack_require__(53); +var TO_STRING_TAG = __webpack_require__(20)('toStringTag'); + +var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + + 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + + 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + + 'TextTrackList,TouchList').split(','); + +for (var i = 0; i < DOMIterables.length; i++) { + var NAME = DOMIterables[i]; + var Collection = global[NAME]; + var proto = Collection && Collection.prototype; + if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = Iterators.Array; +} + + +/***/ }), +/* 265 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53400,7 +53834,7 @@ $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(130)(functio * Expose `debug()` as the module. */ -exports = module.exports = __webpack_require__(111); +exports = module.exports = __webpack_require__(138); exports.log = log; exports.formatArgs = formatArgs; exports.save = save; @@ -53416,12 +53850,17 @@ exports.storage = 'undefined' != typeof chrome */ exports.colors = [ - 'lightseagreen', - 'forestgreen', - 'goldenrod', - 'dodgerblue', - 'darkorchid', - 'crimson' + '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', + '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', + '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', + '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', + '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', + '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', + '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', + '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', + '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', + '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', + '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** @@ -53440,6 +53879,11 @@ function useColors() { return true; } + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + // is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || @@ -53582,7 +54026,7 @@ function localstorage() { /***/ }), -/* 205 */ +/* 266 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53590,23 +54034,23 @@ function localstorage() { * treat as a browser. */ -if (typeof process !== 'undefined' && process.type === 'renderer') { - module.exports = __webpack_require__(204); +if (typeof process === 'undefined' || process.type === 'renderer') { + module.exports = __webpack_require__(265); } else { - module.exports = __webpack_require__(206); + module.exports = __webpack_require__(267); } /***/ }), -/* 206 */ +/* 267 */ /***/ (function(module, exports, __webpack_require__) { /** * Module dependencies. */ -var tty = __webpack_require__(76); -var util = __webpack_require__(2); +var tty = __webpack_require__(104); +var util = __webpack_require__(3); /** * This is the Node.js implementation of `debug()`. @@ -53614,7 +54058,7 @@ var util = __webpack_require__(2); * Expose `debug()` as the module. */ -exports = module.exports = __webpack_require__(111); +exports = module.exports = __webpack_require__(138); exports.init = init; exports.log = log; exports.formatArgs = formatArgs; @@ -53626,7 +54070,22 @@ exports.useColors = useColors; * Colors. */ -exports.colors = [6, 2, 3, 4, 5, 1]; +exports.colors = [ 6, 2, 3, 4, 5, 1 ]; + +try { + var supportsColor = __webpack_require__(330); + if (supportsColor && supportsColor.level >= 2) { + exports.colors = [ + 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, + 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, + 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 214, 215, 220, 221 + ]; + } +} catch (err) { + // swallow - we only care if `supports-color` is available; it doesn't have to be. +} /** * Build up the default `inspectOpts` object from the environment variables. @@ -53654,23 +54113,6 @@ exports.inspectOpts = Object.keys(process.env).filter(function (key) { 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`. */ @@ -53678,7 +54120,7 @@ var stream = 1 === fd ? process.stdout : function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) - : tty.isatty(fd); + : tty.isatty(process.stderr.fd); } /** @@ -53688,7 +54130,9 @@ function useColors() { exports.formatters.o = function(v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) - .replace(/\s*\n\s*/g, ' '); + .split('\n').map(function(str) { + return str.trim() + }).join(' '); }; /** @@ -53712,22 +54156,30 @@ function formatArgs(args) { if (useColors) { var c = this.color; - var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m'; + var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c); + var prefix = ' ' + colorCode + ';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'); + args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m'); } else { - args[0] = new Date().toUTCString() - + ' ' + name + ' ' + args[0]; + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } else { + return new Date().toISOString() + ' '; } } /** - * Invokes `util.format()` with the specified arguments and writes to `stream`. + * Invokes `util.format()` with the specified arguments and writes to stderr. */ function log() { - return stream.write(util.format.apply(util, arguments) + '\n'); + return process.stderr.write(util.format.apply(util, arguments) + '\n'); } /** @@ -53758,74 +54210,6 @@ 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__(5); - stream = new fs.SyncWriteStream(fd, { autoClose: false }); - stream._type = 'fs'; - break; - - case 'PIPE': - case 'TCP': - var net = __webpack_require__(59); - 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. * @@ -53850,25 +54234,6721 @@ exports.enable(load()); /***/ }), -/* 207 */ +/* 268 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +(function webpackUniversalModuleDefinition(root, factory) { +/* istanbul ignore next */ + if(true) + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); +/* istanbul ignore next */ + else if(typeof exports === 'object') + exports["esprima"] = factory(); + else + root["esprima"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/* istanbul ignore if */ +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } -var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + /* + Copyright JS Foundation and other contributors, https://js.foundation/ + + 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. + + 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 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. + */ + Object.defineProperty(exports, "__esModule", { value: true }); + var comment_handler_1 = __webpack_require__(1); + var jsx_parser_1 = __webpack_require__(3); + var parser_1 = __webpack_require__(8); + var tokenizer_1 = __webpack_require__(15); + function parse(code, options, delegate) { + var commentHandler = null; + var proxyDelegate = function (node, metadata) { + if (delegate) { + delegate(node, metadata); + } + if (commentHandler) { + commentHandler.visit(node, metadata); + } + }; + var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null; + var collectComment = false; + if (options) { + collectComment = (typeof options.comment === 'boolean' && options.comment); + var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment); + if (collectComment || attachComment) { + commentHandler = new comment_handler_1.CommentHandler(); + commentHandler.attach = attachComment; + options.comment = true; + parserDelegate = proxyDelegate; + } + } + var isModule = false; + if (options && typeof options.sourceType === 'string') { + isModule = (options.sourceType === 'module'); + } + var parser; + if (options && typeof options.jsx === 'boolean' && options.jsx) { + parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); + } + else { + parser = new parser_1.Parser(code, options, parserDelegate); + } + var program = isModule ? parser.parseModule() : parser.parseScript(); + var ast = program; + if (collectComment && commentHandler) { + ast.comments = commentHandler.comments; + } + if (parser.config.tokens) { + ast.tokens = parser.tokens; + } + if (parser.config.tolerant) { + ast.errors = parser.errorHandler.errors; + } + return ast; } + exports.parse = parse; + function parseModule(code, options, delegate) { + var parsingOptions = options || {}; + parsingOptions.sourceType = 'module'; + return parse(code, parsingOptions, delegate); + } + exports.parseModule = parseModule; + function parseScript(code, options, delegate) { + var parsingOptions = options || {}; + parsingOptions.sourceType = 'script'; + return parse(code, parsingOptions, delegate); + } + exports.parseScript = parseScript; + function tokenize(code, options, delegate) { + var tokenizer = new tokenizer_1.Tokenizer(code, options); + var tokens; + tokens = []; + try { + while (true) { + var token = tokenizer.getNextToken(); + if (!token) { + break; + } + if (delegate) { + token = delegate(token); + } + tokens.push(token); + } + } + catch (e) { + tokenizer.errorHandler.tolerate(e); + } + if (tokenizer.errorHandler.tolerant) { + tokens.errors = tokenizer.errors(); + } + return tokens; + } + exports.tokenize = tokenize; + var syntax_1 = __webpack_require__(2); + exports.Syntax = syntax_1.Syntax; + // Sync with *.json manifests. + exports.version = '4.0.1'; - return str.replace(matchOperatorsRe, '\\$&'); -}; +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var syntax_1 = __webpack_require__(2); + var CommentHandler = (function () { + function CommentHandler() { + this.attach = false; + this.comments = []; + this.stack = []; + this.leading = []; + this.trailing = []; + } + CommentHandler.prototype.insertInnerComments = function (node, metadata) { + // innnerComments for properties empty block + // `function a() {/** comments **\/}` + if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) { + var innerComments = []; + for (var i = this.leading.length - 1; i >= 0; --i) { + var entry = this.leading[i]; + if (metadata.end.offset >= entry.start) { + innerComments.unshift(entry.comment); + this.leading.splice(i, 1); + this.trailing.splice(i, 1); + } + } + if (innerComments.length) { + node.innerComments = innerComments; + } + } + }; + CommentHandler.prototype.findTrailingComments = function (metadata) { + var trailingComments = []; + if (this.trailing.length > 0) { + for (var i = this.trailing.length - 1; i >= 0; --i) { + var entry_1 = this.trailing[i]; + if (entry_1.start >= metadata.end.offset) { + trailingComments.unshift(entry_1.comment); + } + } + this.trailing.length = 0; + return trailingComments; + } + var entry = this.stack[this.stack.length - 1]; + if (entry && entry.node.trailingComments) { + var firstComment = entry.node.trailingComments[0]; + if (firstComment && firstComment.range[0] >= metadata.end.offset) { + trailingComments = entry.node.trailingComments; + delete entry.node.trailingComments; + } + } + return trailingComments; + }; + CommentHandler.prototype.findLeadingComments = function (metadata) { + var leadingComments = []; + var target; + while (this.stack.length > 0) { + var entry = this.stack[this.stack.length - 1]; + if (entry && entry.start >= metadata.start.offset) { + target = entry.node; + this.stack.pop(); + } + else { + break; + } + } + if (target) { + var count = target.leadingComments ? target.leadingComments.length : 0; + for (var i = count - 1; i >= 0; --i) { + var comment = target.leadingComments[i]; + if (comment.range[1] <= metadata.start.offset) { + leadingComments.unshift(comment); + target.leadingComments.splice(i, 1); + } + } + if (target.leadingComments && target.leadingComments.length === 0) { + delete target.leadingComments; + } + return leadingComments; + } + for (var i = this.leading.length - 1; i >= 0; --i) { + var entry = this.leading[i]; + if (entry.start <= metadata.start.offset) { + leadingComments.unshift(entry.comment); + this.leading.splice(i, 1); + } + } + return leadingComments; + }; + CommentHandler.prototype.visitNode = function (node, metadata) { + if (node.type === syntax_1.Syntax.Program && node.body.length > 0) { + return; + } + this.insertInnerComments(node, metadata); + var trailingComments = this.findTrailingComments(metadata); + var leadingComments = this.findLeadingComments(metadata); + if (leadingComments.length > 0) { + node.leadingComments = leadingComments; + } + if (trailingComments.length > 0) { + node.trailingComments = trailingComments; + } + this.stack.push({ + node: node, + start: metadata.start.offset + }); + }; + CommentHandler.prototype.visitComment = function (node, metadata) { + var type = (node.type[0] === 'L') ? 'Line' : 'Block'; + var comment = { + type: type, + value: node.value + }; + if (node.range) { + comment.range = node.range; + } + if (node.loc) { + comment.loc = node.loc; + } + this.comments.push(comment); + if (this.attach) { + var entry = { + comment: { + type: type, + value: node.value, + range: [metadata.start.offset, metadata.end.offset] + }, + start: metadata.start.offset + }; + if (node.loc) { + entry.comment.loc = node.loc; + } + node.type = type; + this.leading.push(entry); + this.trailing.push(entry); + } + }; + CommentHandler.prototype.visit = function (node, metadata) { + if (node.type === 'LineComment') { + this.visitComment(node, metadata); + } + else if (node.type === 'BlockComment') { + this.visitComment(node, metadata); + } + else if (this.attach) { + this.visitNode(node, metadata); + } + }; + return CommentHandler; + }()); + exports.CommentHandler = CommentHandler; + + +/***/ }, +/* 2 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Syntax = { + AssignmentExpression: 'AssignmentExpression', + AssignmentPattern: 'AssignmentPattern', + ArrayExpression: 'ArrayExpression', + ArrayPattern: 'ArrayPattern', + ArrowFunctionExpression: 'ArrowFunctionExpression', + AwaitExpression: 'AwaitExpression', + BlockStatement: 'BlockStatement', + BinaryExpression: 'BinaryExpression', + BreakStatement: 'BreakStatement', + CallExpression: 'CallExpression', + CatchClause: 'CatchClause', + ClassBody: 'ClassBody', + ClassDeclaration: 'ClassDeclaration', + ClassExpression: 'ClassExpression', + ConditionalExpression: 'ConditionalExpression', + ContinueStatement: 'ContinueStatement', + DoWhileStatement: 'DoWhileStatement', + DebuggerStatement: 'DebuggerStatement', + EmptyStatement: 'EmptyStatement', + ExportAllDeclaration: 'ExportAllDeclaration', + ExportDefaultDeclaration: 'ExportDefaultDeclaration', + ExportNamedDeclaration: 'ExportNamedDeclaration', + ExportSpecifier: 'ExportSpecifier', + ExpressionStatement: 'ExpressionStatement', + ForStatement: 'ForStatement', + ForOfStatement: 'ForOfStatement', + ForInStatement: 'ForInStatement', + FunctionDeclaration: 'FunctionDeclaration', + FunctionExpression: 'FunctionExpression', + Identifier: 'Identifier', + IfStatement: 'IfStatement', + ImportDeclaration: 'ImportDeclaration', + ImportDefaultSpecifier: 'ImportDefaultSpecifier', + ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', + ImportSpecifier: 'ImportSpecifier', + Literal: 'Literal', + LabeledStatement: 'LabeledStatement', + LogicalExpression: 'LogicalExpression', + MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', + MethodDefinition: 'MethodDefinition', + NewExpression: 'NewExpression', + ObjectExpression: 'ObjectExpression', + ObjectPattern: 'ObjectPattern', + Program: 'Program', + Property: 'Property', + RestElement: 'RestElement', + ReturnStatement: 'ReturnStatement', + SequenceExpression: 'SequenceExpression', + SpreadElement: 'SpreadElement', + Super: 'Super', + SwitchCase: 'SwitchCase', + SwitchStatement: 'SwitchStatement', + TaggedTemplateExpression: 'TaggedTemplateExpression', + TemplateElement: 'TemplateElement', + TemplateLiteral: 'TemplateLiteral', + ThisExpression: 'ThisExpression', + ThrowStatement: 'ThrowStatement', + TryStatement: 'TryStatement', + UnaryExpression: 'UnaryExpression', + UpdateExpression: 'UpdateExpression', + VariableDeclaration: 'VariableDeclaration', + VariableDeclarator: 'VariableDeclarator', + WhileStatement: 'WhileStatement', + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' + }; + + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; +/* istanbul ignore next */ + 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 character_1 = __webpack_require__(4); + var JSXNode = __webpack_require__(5); + var jsx_syntax_1 = __webpack_require__(6); + var Node = __webpack_require__(7); + var parser_1 = __webpack_require__(8); + var token_1 = __webpack_require__(13); + var xhtml_entities_1 = __webpack_require__(14); + token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier'; + token_1.TokenName[101 /* Text */] = 'JSXText'; + // Fully qualified element name, e.g. returns "svg:path" + function getQualifiedElementName(elementName) { + var qualifiedName; + switch (elementName.type) { + case jsx_syntax_1.JSXSyntax.JSXIdentifier: + var id = elementName; + qualifiedName = id.name; + break; + case jsx_syntax_1.JSXSyntax.JSXNamespacedName: + var ns = elementName; + qualifiedName = getQualifiedElementName(ns.namespace) + ':' + + getQualifiedElementName(ns.name); + break; + case jsx_syntax_1.JSXSyntax.JSXMemberExpression: + var expr = elementName; + qualifiedName = getQualifiedElementName(expr.object) + '.' + + getQualifiedElementName(expr.property); + break; + /* istanbul ignore next */ + default: + break; + } + return qualifiedName; + } + var JSXParser = (function (_super) { + __extends(JSXParser, _super); + function JSXParser(code, options, delegate) { + return _super.call(this, code, options, delegate) || this; + } + JSXParser.prototype.parsePrimaryExpression = function () { + return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this); + }; + JSXParser.prototype.startJSX = function () { + // Unwind the scanner before the lookahead token. + this.scanner.index = this.startMarker.index; + this.scanner.lineNumber = this.startMarker.line; + this.scanner.lineStart = this.startMarker.index - this.startMarker.column; + }; + JSXParser.prototype.finishJSX = function () { + // Prime the next lookahead. + this.nextToken(); + }; + JSXParser.prototype.reenterJSX = function () { + this.startJSX(); + this.expectJSX('}'); + // Pop the closing '}' added from the lookahead. + if (this.config.tokens) { + this.tokens.pop(); + } + }; + JSXParser.prototype.createJSXNode = function () { + this.collectComments(); + return { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + }; + JSXParser.prototype.createJSXChildNode = function () { + return { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + }; + JSXParser.prototype.scanXHTMLEntity = function (quote) { + var result = '&'; + var valid = true; + var terminated = false; + var numeric = false; + var hex = false; + while (!this.scanner.eof() && valid && !terminated) { + var ch = this.scanner.source[this.scanner.index]; + if (ch === quote) { + break; + } + terminated = (ch === ';'); + result += ch; + ++this.scanner.index; + if (!terminated) { + switch (result.length) { + case 2: + // e.g. '{' + numeric = (ch === '#'); + break; + case 3: + if (numeric) { + // e.g. 'A' + hex = (ch === 'x'); + valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0)); + numeric = numeric && !hex; + } + break; + default: + valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0))); + valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0))); + break; + } + } + } + if (valid && terminated && result.length > 2) { + // e.g. 'A' becomes just '#x41' + var str = result.substr(1, result.length - 2); + if (numeric && str.length > 1) { + result = String.fromCharCode(parseInt(str.substr(1), 10)); + } + else if (hex && str.length > 2) { + result = String.fromCharCode(parseInt('0' + str.substr(1), 16)); + } + else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) { + result = xhtml_entities_1.XHTMLEntities[str]; + } + } + return result; + }; + // Scan the next JSX token. This replaces Scanner#lex when in JSX mode. + JSXParser.prototype.lexJSX = function () { + var cp = this.scanner.source.charCodeAt(this.scanner.index); + // < > / : = { } + if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) { + var value = this.scanner.source[this.scanner.index++]; + return { + type: 7 /* Punctuator */, + value: value, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: this.scanner.index - 1, + end: this.scanner.index + }; + } + // " ' + if (cp === 34 || cp === 39) { + var start = this.scanner.index; + var quote = this.scanner.source[this.scanner.index++]; + var str = ''; + while (!this.scanner.eof()) { + var ch = this.scanner.source[this.scanner.index++]; + if (ch === quote) { + break; + } + else if (ch === '&') { + str += this.scanXHTMLEntity(quote); + } + else { + str += ch; + } + } + return { + type: 8 /* StringLiteral */, + value: str, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + } + // ... or . + if (cp === 46) { + var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1); + var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2); + var value = (n1 === 46 && n2 === 46) ? '...' : '.'; + var start = this.scanner.index; + this.scanner.index += value.length; + return { + type: 7 /* Punctuator */, + value: value, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + } + // ` + if (cp === 96) { + // Only placeholder, since it will be rescanned as a real assignment expression. + return { + type: 10 /* Template */, + value: '', + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: this.scanner.index, + end: this.scanner.index + }; + } + // Identifer can not contain backslash (char code 92). + if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) { + var start = this.scanner.index; + ++this.scanner.index; + while (!this.scanner.eof()) { + var ch = this.scanner.source.charCodeAt(this.scanner.index); + if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) { + ++this.scanner.index; + } + else if (ch === 45) { + // Hyphen (char code 45) can be part of an identifier. + ++this.scanner.index; + } + else { + break; + } + } + var id = this.scanner.source.slice(start, this.scanner.index); + return { + type: 100 /* Identifier */, + value: id, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + } + return this.scanner.lex(); + }; + JSXParser.prototype.nextJSXToken = function () { + this.collectComments(); + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + var token = this.lexJSX(); + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + if (this.config.tokens) { + this.tokens.push(this.convertToken(token)); + } + return token; + }; + JSXParser.prototype.nextJSXText = function () { + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + var start = this.scanner.index; + var text = ''; + while (!this.scanner.eof()) { + var ch = this.scanner.source[this.scanner.index]; + if (ch === '{' || ch === '<') { + break; + } + ++this.scanner.index; + text += ch; + if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { + ++this.scanner.lineNumber; + if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') { + ++this.scanner.index; + } + this.scanner.lineStart = this.scanner.index; + } + } + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + var token = { + type: 101 /* Text */, + value: text, + lineNumber: this.scanner.lineNumber, + lineStart: this.scanner.lineStart, + start: start, + end: this.scanner.index + }; + if ((text.length > 0) && this.config.tokens) { + this.tokens.push(this.convertToken(token)); + } + return token; + }; + JSXParser.prototype.peekJSXToken = function () { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.lexJSX(); + this.scanner.restoreState(state); + return next; + }; + // Expect the next JSX token to match the specified punctuator. + // If not, an exception will be thrown. + JSXParser.prototype.expectJSX = function (value) { + var token = this.nextJSXToken(); + if (token.type !== 7 /* Punctuator */ || token.value !== value) { + this.throwUnexpectedToken(token); + } + }; + // Return true if the next JSX token matches the specified punctuator. + JSXParser.prototype.matchJSX = function (value) { + var next = this.peekJSXToken(); + return next.type === 7 /* Punctuator */ && next.value === value; + }; + JSXParser.prototype.parseJSXIdentifier = function () { + var node = this.createJSXNode(); + var token = this.nextJSXToken(); + if (token.type !== 100 /* Identifier */) { + this.throwUnexpectedToken(token); + } + return this.finalize(node, new JSXNode.JSXIdentifier(token.value)); + }; + JSXParser.prototype.parseJSXElementName = function () { + var node = this.createJSXNode(); + var elementName = this.parseJSXIdentifier(); + if (this.matchJSX(':')) { + var namespace = elementName; + this.expectJSX(':'); + var name_1 = this.parseJSXIdentifier(); + elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1)); + } + else if (this.matchJSX('.')) { + while (this.matchJSX('.')) { + var object = elementName; + this.expectJSX('.'); + var property = this.parseJSXIdentifier(); + elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property)); + } + } + return elementName; + }; + JSXParser.prototype.parseJSXAttributeName = function () { + var node = this.createJSXNode(); + var attributeName; + var identifier = this.parseJSXIdentifier(); + if (this.matchJSX(':')) { + var namespace = identifier; + this.expectJSX(':'); + var name_2 = this.parseJSXIdentifier(); + attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2)); + } + else { + attributeName = identifier; + } + return attributeName; + }; + JSXParser.prototype.parseJSXStringLiteralAttribute = function () { + var node = this.createJSXNode(); + var token = this.nextJSXToken(); + if (token.type !== 8 /* StringLiteral */) { + this.throwUnexpectedToken(token); + } + var raw = this.getTokenRaw(token); + return this.finalize(node, new Node.Literal(token.value, raw)); + }; + JSXParser.prototype.parseJSXExpressionAttribute = function () { + var node = this.createJSXNode(); + this.expectJSX('{'); + this.finishJSX(); + if (this.match('}')) { + this.tolerateError('JSX attributes must only be assigned a non-empty expression'); + } + var expression = this.parseAssignmentExpression(); + this.reenterJSX(); + return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); + }; + JSXParser.prototype.parseJSXAttributeValue = function () { + return this.matchJSX('{') ? this.parseJSXExpressionAttribute() : + this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute(); + }; + JSXParser.prototype.parseJSXNameValueAttribute = function () { + var node = this.createJSXNode(); + var name = this.parseJSXAttributeName(); + var value = null; + if (this.matchJSX('=')) { + this.expectJSX('='); + value = this.parseJSXAttributeValue(); + } + return this.finalize(node, new JSXNode.JSXAttribute(name, value)); + }; + JSXParser.prototype.parseJSXSpreadAttribute = function () { + var node = this.createJSXNode(); + this.expectJSX('{'); + this.expectJSX('...'); + this.finishJSX(); + var argument = this.parseAssignmentExpression(); + this.reenterJSX(); + return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument)); + }; + JSXParser.prototype.parseJSXAttributes = function () { + var attributes = []; + while (!this.matchJSX('/') && !this.matchJSX('>')) { + var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() : + this.parseJSXNameValueAttribute(); + attributes.push(attribute); + } + return attributes; + }; + JSXParser.prototype.parseJSXOpeningElement = function () { + var node = this.createJSXNode(); + this.expectJSX('<'); + var name = this.parseJSXElementName(); + var attributes = this.parseJSXAttributes(); + var selfClosing = this.matchJSX('/'); + if (selfClosing) { + this.expectJSX('/'); + } + this.expectJSX('>'); + return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); + }; + JSXParser.prototype.parseJSXBoundaryElement = function () { + var node = this.createJSXNode(); + this.expectJSX('<'); + if (this.matchJSX('/')) { + this.expectJSX('/'); + var name_3 = this.parseJSXElementName(); + this.expectJSX('>'); + return this.finalize(node, new JSXNode.JSXClosingElement(name_3)); + } + var name = this.parseJSXElementName(); + var attributes = this.parseJSXAttributes(); + var selfClosing = this.matchJSX('/'); + if (selfClosing) { + this.expectJSX('/'); + } + this.expectJSX('>'); + return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); + }; + JSXParser.prototype.parseJSXEmptyExpression = function () { + var node = this.createJSXChildNode(); + this.collectComments(); + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + return this.finalize(node, new JSXNode.JSXEmptyExpression()); + }; + JSXParser.prototype.parseJSXExpressionContainer = function () { + var node = this.createJSXNode(); + this.expectJSX('{'); + var expression; + if (this.matchJSX('}')) { + expression = this.parseJSXEmptyExpression(); + this.expectJSX('}'); + } + else { + this.finishJSX(); + expression = this.parseAssignmentExpression(); + this.reenterJSX(); + } + return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); + }; + JSXParser.prototype.parseJSXChildren = function () { + var children = []; + while (!this.scanner.eof()) { + var node = this.createJSXChildNode(); + var token = this.nextJSXText(); + if (token.start < token.end) { + var raw = this.getTokenRaw(token); + var child = this.finalize(node, new JSXNode.JSXText(token.value, raw)); + children.push(child); + } + if (this.scanner.source[this.scanner.index] === '{') { + var container = this.parseJSXExpressionContainer(); + children.push(container); + } + else { + break; + } + } + return children; + }; + JSXParser.prototype.parseComplexJSXElement = function (el) { + var stack = []; + while (!this.scanner.eof()) { + el.children = el.children.concat(this.parseJSXChildren()); + var node = this.createJSXChildNode(); + var element = this.parseJSXBoundaryElement(); + if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) { + var opening = element; + if (opening.selfClosing) { + var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null)); + el.children.push(child); + } + else { + stack.push(el); + el = { node: node, opening: opening, closing: null, children: [] }; + } + } + if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) { + el.closing = element; + var open_1 = getQualifiedElementName(el.opening.name); + var close_1 = getQualifiedElementName(el.closing.name); + if (open_1 !== close_1) { + this.tolerateError('Expected corresponding JSX closing tag for %0', open_1); + } + if (stack.length > 0) { + var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing)); + el = stack[stack.length - 1]; + el.children.push(child); + stack.pop(); + } + else { + break; + } + } + } + return el; + }; + JSXParser.prototype.parseJSXElement = function () { + var node = this.createJSXNode(); + var opening = this.parseJSXOpeningElement(); + var children = []; + var closing = null; + if (!opening.selfClosing) { + var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children }); + children = el.children; + closing = el.closing; + } + return this.finalize(node, new JSXNode.JSXElement(opening, children, closing)); + }; + JSXParser.prototype.parseJSXRoot = function () { + // Pop the opening '<' added from the lookahead. + if (this.config.tokens) { + this.tokens.pop(); + } + this.startJSX(); + var element = this.parseJSXElement(); + this.finishJSX(); + return element; + }; + JSXParser.prototype.isStartOfExpression = function () { + return _super.prototype.isStartOfExpression.call(this) || this.match('<'); + }; + return JSXParser; + }(parser_1.Parser)); + exports.JSXParser = JSXParser; + + +/***/ }, +/* 4 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + // See also tools/generate-unicode-regex.js. + var Regex = { + // Unicode v8.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, + // Unicode v8.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ + }; + exports.Character = { + /* tslint:disable:no-bitwise */ + fromCodePoint: function (cp) { + return (cp < 0x10000) ? String.fromCharCode(cp) : + String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) + + String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023)); + }, + // https://tc39.github.io/ecma262/#sec-white-space + isWhiteSpace: function (cp) { + return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) || + (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0); + }, + // https://tc39.github.io/ecma262/#sec-line-terminators + isLineTerminator: function (cp) { + return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029); + }, + // https://tc39.github.io/ecma262/#sec-names-and-keywords + isIdentifierStart: function (cp) { + return (cp === 0x24) || (cp === 0x5F) || + (cp >= 0x41 && cp <= 0x5A) || + (cp >= 0x61 && cp <= 0x7A) || + (cp === 0x5C) || + ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp))); + }, + isIdentifierPart: function (cp) { + return (cp === 0x24) || (cp === 0x5F) || + (cp >= 0x41 && cp <= 0x5A) || + (cp >= 0x61 && cp <= 0x7A) || + (cp >= 0x30 && cp <= 0x39) || + (cp === 0x5C) || + ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp))); + }, + // https://tc39.github.io/ecma262/#sec-literals-numeric-literals + isDecimalDigit: function (cp) { + return (cp >= 0x30 && cp <= 0x39); // 0..9 + }, + isHexDigit: function (cp) { + return (cp >= 0x30 && cp <= 0x39) || + (cp >= 0x41 && cp <= 0x46) || + (cp >= 0x61 && cp <= 0x66); // a..f + }, + isOctalDigit: function (cp) { + return (cp >= 0x30 && cp <= 0x37); // 0..7 + } + }; + + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var jsx_syntax_1 = __webpack_require__(6); + /* tslint:disable:max-classes-per-file */ + var JSXClosingElement = (function () { + function JSXClosingElement(name) { + this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement; + this.name = name; + } + return JSXClosingElement; + }()); + exports.JSXClosingElement = JSXClosingElement; + var JSXElement = (function () { + function JSXElement(openingElement, children, closingElement) { + this.type = jsx_syntax_1.JSXSyntax.JSXElement; + this.openingElement = openingElement; + this.children = children; + this.closingElement = closingElement; + } + return JSXElement; + }()); + exports.JSXElement = JSXElement; + var JSXEmptyExpression = (function () { + function JSXEmptyExpression() { + this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression; + } + return JSXEmptyExpression; + }()); + exports.JSXEmptyExpression = JSXEmptyExpression; + var JSXExpressionContainer = (function () { + function JSXExpressionContainer(expression) { + this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer; + this.expression = expression; + } + return JSXExpressionContainer; + }()); + exports.JSXExpressionContainer = JSXExpressionContainer; + var JSXIdentifier = (function () { + function JSXIdentifier(name) { + this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier; + this.name = name; + } + return JSXIdentifier; + }()); + exports.JSXIdentifier = JSXIdentifier; + var JSXMemberExpression = (function () { + function JSXMemberExpression(object, property) { + this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression; + this.object = object; + this.property = property; + } + return JSXMemberExpression; + }()); + exports.JSXMemberExpression = JSXMemberExpression; + var JSXAttribute = (function () { + function JSXAttribute(name, value) { + this.type = jsx_syntax_1.JSXSyntax.JSXAttribute; + this.name = name; + this.value = value; + } + return JSXAttribute; + }()); + exports.JSXAttribute = JSXAttribute; + var JSXNamespacedName = (function () { + function JSXNamespacedName(namespace, name) { + this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName; + this.namespace = namespace; + this.name = name; + } + return JSXNamespacedName; + }()); + exports.JSXNamespacedName = JSXNamespacedName; + var JSXOpeningElement = (function () { + function JSXOpeningElement(name, selfClosing, attributes) { + this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement; + this.name = name; + this.selfClosing = selfClosing; + this.attributes = attributes; + } + return JSXOpeningElement; + }()); + exports.JSXOpeningElement = JSXOpeningElement; + var JSXSpreadAttribute = (function () { + function JSXSpreadAttribute(argument) { + this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute; + this.argument = argument; + } + return JSXSpreadAttribute; + }()); + exports.JSXSpreadAttribute = JSXSpreadAttribute; + var JSXText = (function () { + function JSXText(value, raw) { + this.type = jsx_syntax_1.JSXSyntax.JSXText; + this.value = value; + this.raw = raw; + } + return JSXText; + }()); + exports.JSXText = JSXText; + + +/***/ }, +/* 6 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.JSXSyntax = { + JSXAttribute: 'JSXAttribute', + JSXClosingElement: 'JSXClosingElement', + JSXElement: 'JSXElement', + JSXEmptyExpression: 'JSXEmptyExpression', + JSXExpressionContainer: 'JSXExpressionContainer', + JSXIdentifier: 'JSXIdentifier', + JSXMemberExpression: 'JSXMemberExpression', + JSXNamespacedName: 'JSXNamespacedName', + JSXOpeningElement: 'JSXOpeningElement', + JSXSpreadAttribute: 'JSXSpreadAttribute', + JSXText: 'JSXText' + }; + + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var syntax_1 = __webpack_require__(2); + /* tslint:disable:max-classes-per-file */ + var ArrayExpression = (function () { + function ArrayExpression(elements) { + this.type = syntax_1.Syntax.ArrayExpression; + this.elements = elements; + } + return ArrayExpression; + }()); + exports.ArrayExpression = ArrayExpression; + var ArrayPattern = (function () { + function ArrayPattern(elements) { + this.type = syntax_1.Syntax.ArrayPattern; + this.elements = elements; + } + return ArrayPattern; + }()); + exports.ArrayPattern = ArrayPattern; + var ArrowFunctionExpression = (function () { + function ArrowFunctionExpression(params, body, expression) { + this.type = syntax_1.Syntax.ArrowFunctionExpression; + this.id = null; + this.params = params; + this.body = body; + this.generator = false; + this.expression = expression; + this.async = false; + } + return ArrowFunctionExpression; + }()); + exports.ArrowFunctionExpression = ArrowFunctionExpression; + var AssignmentExpression = (function () { + function AssignmentExpression(operator, left, right) { + this.type = syntax_1.Syntax.AssignmentExpression; + this.operator = operator; + this.left = left; + this.right = right; + } + return AssignmentExpression; + }()); + exports.AssignmentExpression = AssignmentExpression; + var AssignmentPattern = (function () { + function AssignmentPattern(left, right) { + this.type = syntax_1.Syntax.AssignmentPattern; + this.left = left; + this.right = right; + } + return AssignmentPattern; + }()); + exports.AssignmentPattern = AssignmentPattern; + var AsyncArrowFunctionExpression = (function () { + function AsyncArrowFunctionExpression(params, body, expression) { + this.type = syntax_1.Syntax.ArrowFunctionExpression; + this.id = null; + this.params = params; + this.body = body; + this.generator = false; + this.expression = expression; + this.async = true; + } + return AsyncArrowFunctionExpression; + }()); + exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression; + var AsyncFunctionDeclaration = (function () { + function AsyncFunctionDeclaration(id, params, body) { + this.type = syntax_1.Syntax.FunctionDeclaration; + this.id = id; + this.params = params; + this.body = body; + this.generator = false; + this.expression = false; + this.async = true; + } + return AsyncFunctionDeclaration; + }()); + exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration; + var AsyncFunctionExpression = (function () { + function AsyncFunctionExpression(id, params, body) { + this.type = syntax_1.Syntax.FunctionExpression; + this.id = id; + this.params = params; + this.body = body; + this.generator = false; + this.expression = false; + this.async = true; + } + return AsyncFunctionExpression; + }()); + exports.AsyncFunctionExpression = AsyncFunctionExpression; + var AwaitExpression = (function () { + function AwaitExpression(argument) { + this.type = syntax_1.Syntax.AwaitExpression; + this.argument = argument; + } + return AwaitExpression; + }()); + exports.AwaitExpression = AwaitExpression; + var BinaryExpression = (function () { + function BinaryExpression(operator, left, right) { + var logical = (operator === '||' || operator === '&&'); + this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression; + this.operator = operator; + this.left = left; + this.right = right; + } + return BinaryExpression; + }()); + exports.BinaryExpression = BinaryExpression; + var BlockStatement = (function () { + function BlockStatement(body) { + this.type = syntax_1.Syntax.BlockStatement; + this.body = body; + } + return BlockStatement; + }()); + exports.BlockStatement = BlockStatement; + var BreakStatement = (function () { + function BreakStatement(label) { + this.type = syntax_1.Syntax.BreakStatement; + this.label = label; + } + return BreakStatement; + }()); + exports.BreakStatement = BreakStatement; + var CallExpression = (function () { + function CallExpression(callee, args) { + this.type = syntax_1.Syntax.CallExpression; + this.callee = callee; + this.arguments = args; + } + return CallExpression; + }()); + exports.CallExpression = CallExpression; + var CatchClause = (function () { + function CatchClause(param, body) { + this.type = syntax_1.Syntax.CatchClause; + this.param = param; + this.body = body; + } + return CatchClause; + }()); + exports.CatchClause = CatchClause; + var ClassBody = (function () { + function ClassBody(body) { + this.type = syntax_1.Syntax.ClassBody; + this.body = body; + } + return ClassBody; + }()); + exports.ClassBody = ClassBody; + var ClassDeclaration = (function () { + function ClassDeclaration(id, superClass, body) { + this.type = syntax_1.Syntax.ClassDeclaration; + this.id = id; + this.superClass = superClass; + this.body = body; + } + return ClassDeclaration; + }()); + exports.ClassDeclaration = ClassDeclaration; + var ClassExpression = (function () { + function ClassExpression(id, superClass, body) { + this.type = syntax_1.Syntax.ClassExpression; + this.id = id; + this.superClass = superClass; + this.body = body; + } + return ClassExpression; + }()); + exports.ClassExpression = ClassExpression; + var ComputedMemberExpression = (function () { + function ComputedMemberExpression(object, property) { + this.type = syntax_1.Syntax.MemberExpression; + this.computed = true; + this.object = object; + this.property = property; + } + return ComputedMemberExpression; + }()); + exports.ComputedMemberExpression = ComputedMemberExpression; + var ConditionalExpression = (function () { + function ConditionalExpression(test, consequent, alternate) { + this.type = syntax_1.Syntax.ConditionalExpression; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + } + return ConditionalExpression; + }()); + exports.ConditionalExpression = ConditionalExpression; + var ContinueStatement = (function () { + function ContinueStatement(label) { + this.type = syntax_1.Syntax.ContinueStatement; + this.label = label; + } + return ContinueStatement; + }()); + exports.ContinueStatement = ContinueStatement; + var DebuggerStatement = (function () { + function DebuggerStatement() { + this.type = syntax_1.Syntax.DebuggerStatement; + } + return DebuggerStatement; + }()); + exports.DebuggerStatement = DebuggerStatement; + var Directive = (function () { + function Directive(expression, directive) { + this.type = syntax_1.Syntax.ExpressionStatement; + this.expression = expression; + this.directive = directive; + } + return Directive; + }()); + exports.Directive = Directive; + var DoWhileStatement = (function () { + function DoWhileStatement(body, test) { + this.type = syntax_1.Syntax.DoWhileStatement; + this.body = body; + this.test = test; + } + return DoWhileStatement; + }()); + exports.DoWhileStatement = DoWhileStatement; + var EmptyStatement = (function () { + function EmptyStatement() { + this.type = syntax_1.Syntax.EmptyStatement; + } + return EmptyStatement; + }()); + exports.EmptyStatement = EmptyStatement; + var ExportAllDeclaration = (function () { + function ExportAllDeclaration(source) { + this.type = syntax_1.Syntax.ExportAllDeclaration; + this.source = source; + } + return ExportAllDeclaration; + }()); + exports.ExportAllDeclaration = ExportAllDeclaration; + var ExportDefaultDeclaration = (function () { + function ExportDefaultDeclaration(declaration) { + this.type = syntax_1.Syntax.ExportDefaultDeclaration; + this.declaration = declaration; + } + return ExportDefaultDeclaration; + }()); + exports.ExportDefaultDeclaration = ExportDefaultDeclaration; + var ExportNamedDeclaration = (function () { + function ExportNamedDeclaration(declaration, specifiers, source) { + this.type = syntax_1.Syntax.ExportNamedDeclaration; + this.declaration = declaration; + this.specifiers = specifiers; + this.source = source; + } + return ExportNamedDeclaration; + }()); + exports.ExportNamedDeclaration = ExportNamedDeclaration; + var ExportSpecifier = (function () { + function ExportSpecifier(local, exported) { + this.type = syntax_1.Syntax.ExportSpecifier; + this.exported = exported; + this.local = local; + } + return ExportSpecifier; + }()); + exports.ExportSpecifier = ExportSpecifier; + var ExpressionStatement = (function () { + function ExpressionStatement(expression) { + this.type = syntax_1.Syntax.ExpressionStatement; + this.expression = expression; + } + return ExpressionStatement; + }()); + exports.ExpressionStatement = ExpressionStatement; + var ForInStatement = (function () { + function ForInStatement(left, right, body) { + this.type = syntax_1.Syntax.ForInStatement; + this.left = left; + this.right = right; + this.body = body; + this.each = false; + } + return ForInStatement; + }()); + exports.ForInStatement = ForInStatement; + var ForOfStatement = (function () { + function ForOfStatement(left, right, body) { + this.type = syntax_1.Syntax.ForOfStatement; + this.left = left; + this.right = right; + this.body = body; + } + return ForOfStatement; + }()); + exports.ForOfStatement = ForOfStatement; + var ForStatement = (function () { + function ForStatement(init, test, update, body) { + this.type = syntax_1.Syntax.ForStatement; + this.init = init; + this.test = test; + this.update = update; + this.body = body; + } + return ForStatement; + }()); + exports.ForStatement = ForStatement; + var FunctionDeclaration = (function () { + function FunctionDeclaration(id, params, body, generator) { + this.type = syntax_1.Syntax.FunctionDeclaration; + this.id = id; + this.params = params; + this.body = body; + this.generator = generator; + this.expression = false; + this.async = false; + } + return FunctionDeclaration; + }()); + exports.FunctionDeclaration = FunctionDeclaration; + var FunctionExpression = (function () { + function FunctionExpression(id, params, body, generator) { + this.type = syntax_1.Syntax.FunctionExpression; + this.id = id; + this.params = params; + this.body = body; + this.generator = generator; + this.expression = false; + this.async = false; + } + return FunctionExpression; + }()); + exports.FunctionExpression = FunctionExpression; + var Identifier = (function () { + function Identifier(name) { + this.type = syntax_1.Syntax.Identifier; + this.name = name; + } + return Identifier; + }()); + exports.Identifier = Identifier; + var IfStatement = (function () { + function IfStatement(test, consequent, alternate) { + this.type = syntax_1.Syntax.IfStatement; + this.test = test; + this.consequent = consequent; + this.alternate = alternate; + } + return IfStatement; + }()); + exports.IfStatement = IfStatement; + var ImportDeclaration = (function () { + function ImportDeclaration(specifiers, source) { + this.type = syntax_1.Syntax.ImportDeclaration; + this.specifiers = specifiers; + this.source = source; + } + return ImportDeclaration; + }()); + exports.ImportDeclaration = ImportDeclaration; + var ImportDefaultSpecifier = (function () { + function ImportDefaultSpecifier(local) { + this.type = syntax_1.Syntax.ImportDefaultSpecifier; + this.local = local; + } + return ImportDefaultSpecifier; + }()); + exports.ImportDefaultSpecifier = ImportDefaultSpecifier; + var ImportNamespaceSpecifier = (function () { + function ImportNamespaceSpecifier(local) { + this.type = syntax_1.Syntax.ImportNamespaceSpecifier; + this.local = local; + } + return ImportNamespaceSpecifier; + }()); + exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; + var ImportSpecifier = (function () { + function ImportSpecifier(local, imported) { + this.type = syntax_1.Syntax.ImportSpecifier; + this.local = local; + this.imported = imported; + } + return ImportSpecifier; + }()); + exports.ImportSpecifier = ImportSpecifier; + var LabeledStatement = (function () { + function LabeledStatement(label, body) { + this.type = syntax_1.Syntax.LabeledStatement; + this.label = label; + this.body = body; + } + return LabeledStatement; + }()); + exports.LabeledStatement = LabeledStatement; + var Literal = (function () { + function Literal(value, raw) { + this.type = syntax_1.Syntax.Literal; + this.value = value; + this.raw = raw; + } + return Literal; + }()); + exports.Literal = Literal; + var MetaProperty = (function () { + function MetaProperty(meta, property) { + this.type = syntax_1.Syntax.MetaProperty; + this.meta = meta; + this.property = property; + } + return MetaProperty; + }()); + exports.MetaProperty = MetaProperty; + var MethodDefinition = (function () { + function MethodDefinition(key, computed, value, kind, isStatic) { + this.type = syntax_1.Syntax.MethodDefinition; + this.key = key; + this.computed = computed; + this.value = value; + this.kind = kind; + this.static = isStatic; + } + return MethodDefinition; + }()); + exports.MethodDefinition = MethodDefinition; + var Module = (function () { + function Module(body) { + this.type = syntax_1.Syntax.Program; + this.body = body; + this.sourceType = 'module'; + } + return Module; + }()); + exports.Module = Module; + var NewExpression = (function () { + function NewExpression(callee, args) { + this.type = syntax_1.Syntax.NewExpression; + this.callee = callee; + this.arguments = args; + } + return NewExpression; + }()); + exports.NewExpression = NewExpression; + var ObjectExpression = (function () { + function ObjectExpression(properties) { + this.type = syntax_1.Syntax.ObjectExpression; + this.properties = properties; + } + return ObjectExpression; + }()); + exports.ObjectExpression = ObjectExpression; + var ObjectPattern = (function () { + function ObjectPattern(properties) { + this.type = syntax_1.Syntax.ObjectPattern; + this.properties = properties; + } + return ObjectPattern; + }()); + exports.ObjectPattern = ObjectPattern; + var Property = (function () { + function Property(kind, key, computed, value, method, shorthand) { + this.type = syntax_1.Syntax.Property; + this.key = key; + this.computed = computed; + this.value = value; + this.kind = kind; + this.method = method; + this.shorthand = shorthand; + } + return Property; + }()); + exports.Property = Property; + var RegexLiteral = (function () { + function RegexLiteral(value, raw, pattern, flags) { + this.type = syntax_1.Syntax.Literal; + this.value = value; + this.raw = raw; + this.regex = { pattern: pattern, flags: flags }; + } + return RegexLiteral; + }()); + exports.RegexLiteral = RegexLiteral; + var RestElement = (function () { + function RestElement(argument) { + this.type = syntax_1.Syntax.RestElement; + this.argument = argument; + } + return RestElement; + }()); + exports.RestElement = RestElement; + var ReturnStatement = (function () { + function ReturnStatement(argument) { + this.type = syntax_1.Syntax.ReturnStatement; + this.argument = argument; + } + return ReturnStatement; + }()); + exports.ReturnStatement = ReturnStatement; + var Script = (function () { + function Script(body) { + this.type = syntax_1.Syntax.Program; + this.body = body; + this.sourceType = 'script'; + } + return Script; + }()); + exports.Script = Script; + var SequenceExpression = (function () { + function SequenceExpression(expressions) { + this.type = syntax_1.Syntax.SequenceExpression; + this.expressions = expressions; + } + return SequenceExpression; + }()); + exports.SequenceExpression = SequenceExpression; + var SpreadElement = (function () { + function SpreadElement(argument) { + this.type = syntax_1.Syntax.SpreadElement; + this.argument = argument; + } + return SpreadElement; + }()); + exports.SpreadElement = SpreadElement; + var StaticMemberExpression = (function () { + function StaticMemberExpression(object, property) { + this.type = syntax_1.Syntax.MemberExpression; + this.computed = false; + this.object = object; + this.property = property; + } + return StaticMemberExpression; + }()); + exports.StaticMemberExpression = StaticMemberExpression; + var Super = (function () { + function Super() { + this.type = syntax_1.Syntax.Super; + } + return Super; + }()); + exports.Super = Super; + var SwitchCase = (function () { + function SwitchCase(test, consequent) { + this.type = syntax_1.Syntax.SwitchCase; + this.test = test; + this.consequent = consequent; + } + return SwitchCase; + }()); + exports.SwitchCase = SwitchCase; + var SwitchStatement = (function () { + function SwitchStatement(discriminant, cases) { + this.type = syntax_1.Syntax.SwitchStatement; + this.discriminant = discriminant; + this.cases = cases; + } + return SwitchStatement; + }()); + exports.SwitchStatement = SwitchStatement; + var TaggedTemplateExpression = (function () { + function TaggedTemplateExpression(tag, quasi) { + this.type = syntax_1.Syntax.TaggedTemplateExpression; + this.tag = tag; + this.quasi = quasi; + } + return TaggedTemplateExpression; + }()); + exports.TaggedTemplateExpression = TaggedTemplateExpression; + var TemplateElement = (function () { + function TemplateElement(value, tail) { + this.type = syntax_1.Syntax.TemplateElement; + this.value = value; + this.tail = tail; + } + return TemplateElement; + }()); + exports.TemplateElement = TemplateElement; + var TemplateLiteral = (function () { + function TemplateLiteral(quasis, expressions) { + this.type = syntax_1.Syntax.TemplateLiteral; + this.quasis = quasis; + this.expressions = expressions; + } + return TemplateLiteral; + }()); + exports.TemplateLiteral = TemplateLiteral; + var ThisExpression = (function () { + function ThisExpression() { + this.type = syntax_1.Syntax.ThisExpression; + } + return ThisExpression; + }()); + exports.ThisExpression = ThisExpression; + var ThrowStatement = (function () { + function ThrowStatement(argument) { + this.type = syntax_1.Syntax.ThrowStatement; + this.argument = argument; + } + return ThrowStatement; + }()); + exports.ThrowStatement = ThrowStatement; + var TryStatement = (function () { + function TryStatement(block, handler, finalizer) { + this.type = syntax_1.Syntax.TryStatement; + this.block = block; + this.handler = handler; + this.finalizer = finalizer; + } + return TryStatement; + }()); + exports.TryStatement = TryStatement; + var UnaryExpression = (function () { + function UnaryExpression(operator, argument) { + this.type = syntax_1.Syntax.UnaryExpression; + this.operator = operator; + this.argument = argument; + this.prefix = true; + } + return UnaryExpression; + }()); + exports.UnaryExpression = UnaryExpression; + var UpdateExpression = (function () { + function UpdateExpression(operator, argument, prefix) { + this.type = syntax_1.Syntax.UpdateExpression; + this.operator = operator; + this.argument = argument; + this.prefix = prefix; + } + return UpdateExpression; + }()); + exports.UpdateExpression = UpdateExpression; + var VariableDeclaration = (function () { + function VariableDeclaration(declarations, kind) { + this.type = syntax_1.Syntax.VariableDeclaration; + this.declarations = declarations; + this.kind = kind; + } + return VariableDeclaration; + }()); + exports.VariableDeclaration = VariableDeclaration; + var VariableDeclarator = (function () { + function VariableDeclarator(id, init) { + this.type = syntax_1.Syntax.VariableDeclarator; + this.id = id; + this.init = init; + } + return VariableDeclarator; + }()); + exports.VariableDeclarator = VariableDeclarator; + var WhileStatement = (function () { + function WhileStatement(test, body) { + this.type = syntax_1.Syntax.WhileStatement; + this.test = test; + this.body = body; + } + return WhileStatement; + }()); + exports.WhileStatement = WhileStatement; + var WithStatement = (function () { + function WithStatement(object, body) { + this.type = syntax_1.Syntax.WithStatement; + this.object = object; + this.body = body; + } + return WithStatement; + }()); + exports.WithStatement = WithStatement; + var YieldExpression = (function () { + function YieldExpression(argument, delegate) { + this.type = syntax_1.Syntax.YieldExpression; + this.argument = argument; + this.delegate = delegate; + } + return YieldExpression; + }()); + exports.YieldExpression = YieldExpression; + + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var assert_1 = __webpack_require__(9); + var error_handler_1 = __webpack_require__(10); + var messages_1 = __webpack_require__(11); + var Node = __webpack_require__(7); + var scanner_1 = __webpack_require__(12); + var syntax_1 = __webpack_require__(2); + var token_1 = __webpack_require__(13); + var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder'; + var Parser = (function () { + function Parser(code, options, delegate) { + if (options === void 0) { options = {}; } + this.config = { + range: (typeof options.range === 'boolean') && options.range, + loc: (typeof options.loc === 'boolean') && options.loc, + source: null, + tokens: (typeof options.tokens === 'boolean') && options.tokens, + comment: (typeof options.comment === 'boolean') && options.comment, + tolerant: (typeof options.tolerant === 'boolean') && options.tolerant + }; + if (this.config.loc && options.source && options.source !== null) { + this.config.source = String(options.source); + } + this.delegate = delegate; + this.errorHandler = new error_handler_1.ErrorHandler(); + this.errorHandler.tolerant = this.config.tolerant; + this.scanner = new scanner_1.Scanner(code, this.errorHandler); + this.scanner.trackComment = this.config.comment; + this.operatorPrecedence = { + ')': 0, + ';': 0, + ',': 0, + '=': 0, + ']': 0, + '||': 1, + '&&': 2, + '|': 3, + '^': 4, + '&': 5, + '==': 6, + '!=': 6, + '===': 6, + '!==': 6, + '<': 7, + '>': 7, + '<=': 7, + '>=': 7, + '<<': 8, + '>>': 8, + '>>>': 8, + '+': 9, + '-': 9, + '*': 11, + '/': 11, + '%': 11 + }; + this.lookahead = { + type: 2 /* EOF */, + value: '', + lineNumber: this.scanner.lineNumber, + lineStart: 0, + start: 0, + end: 0 + }; + this.hasLineTerminator = false; + this.context = { + isModule: false, + await: false, + allowIn: true, + allowStrictDirective: true, + allowYield: true, + firstCoverInitializedNameError: null, + isAssignmentTarget: false, + isBindingElement: false, + inFunctionBody: false, + inIteration: false, + inSwitch: false, + labelSet: {}, + strict: false + }; + this.tokens = []; + this.startMarker = { + index: 0, + line: this.scanner.lineNumber, + column: 0 + }; + this.lastMarker = { + index: 0, + line: this.scanner.lineNumber, + column: 0 + }; + this.nextToken(); + this.lastMarker = { + index: this.scanner.index, + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + }; + } + Parser.prototype.throwError = function (messageFormat) { + var values = []; + for (var _i = 1; _i < arguments.length; _i++) { + values[_i - 1] = arguments[_i]; + } + var args = Array.prototype.slice.call(arguments, 1); + var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { + assert_1.assert(idx < args.length, 'Message reference must be in range'); + return args[idx]; + }); + var index = this.lastMarker.index; + var line = this.lastMarker.line; + var column = this.lastMarker.column + 1; + throw this.errorHandler.createError(index, line, column, msg); + }; + Parser.prototype.tolerateError = function (messageFormat) { + var values = []; + for (var _i = 1; _i < arguments.length; _i++) { + values[_i - 1] = arguments[_i]; + } + var args = Array.prototype.slice.call(arguments, 1); + var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { + assert_1.assert(idx < args.length, 'Message reference must be in range'); + return args[idx]; + }); + var index = this.lastMarker.index; + var line = this.scanner.lineNumber; + var column = this.lastMarker.column + 1; + this.errorHandler.tolerateError(index, line, column, msg); + }; + // Throw an exception because of the token. + Parser.prototype.unexpectedTokenError = function (token, message) { + var msg = message || messages_1.Messages.UnexpectedToken; + var value; + if (token) { + if (!message) { + msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS : + (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier : + (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber : + (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString : + (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate : + messages_1.Messages.UnexpectedToken; + if (token.type === 4 /* Keyword */) { + if (this.scanner.isFutureReservedWord(token.value)) { + msg = messages_1.Messages.UnexpectedReserved; + } + else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) { + msg = messages_1.Messages.StrictReservedWord; + } + } + } + value = token.value; + } + else { + value = 'ILLEGAL'; + } + msg = msg.replace('%0', value); + if (token && typeof token.lineNumber === 'number') { + var index = token.start; + var line = token.lineNumber; + var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column; + var column = token.start - lastMarkerLineStart + 1; + return this.errorHandler.createError(index, line, column, msg); + } + else { + var index = this.lastMarker.index; + var line = this.lastMarker.line; + var column = this.lastMarker.column + 1; + return this.errorHandler.createError(index, line, column, msg); + } + }; + Parser.prototype.throwUnexpectedToken = function (token, message) { + throw this.unexpectedTokenError(token, message); + }; + Parser.prototype.tolerateUnexpectedToken = function (token, message) { + this.errorHandler.tolerate(this.unexpectedTokenError(token, message)); + }; + Parser.prototype.collectComments = function () { + if (!this.config.comment) { + this.scanner.scanComments(); + } + else { + var comments = this.scanner.scanComments(); + if (comments.length > 0 && this.delegate) { + for (var i = 0; i < comments.length; ++i) { + var e = comments[i]; + var node = void 0; + node = { + type: e.multiLine ? 'BlockComment' : 'LineComment', + value: this.scanner.source.slice(e.slice[0], e.slice[1]) + }; + if (this.config.range) { + node.range = e.range; + } + if (this.config.loc) { + node.loc = e.loc; + } + var metadata = { + start: { + line: e.loc.start.line, + column: e.loc.start.column, + offset: e.range[0] + }, + end: { + line: e.loc.end.line, + column: e.loc.end.column, + offset: e.range[1] + } + }; + this.delegate(node, metadata); + } + } + } + }; + // From internal representation to an external structure + Parser.prototype.getTokenRaw = function (token) { + return this.scanner.source.slice(token.start, token.end); + }; + Parser.prototype.convertToken = function (token) { + var t = { + type: token_1.TokenName[token.type], + value: this.getTokenRaw(token) + }; + if (this.config.range) { + t.range = [token.start, token.end]; + } + if (this.config.loc) { + t.loc = { + start: { + line: this.startMarker.line, + column: this.startMarker.column + }, + end: { + line: this.scanner.lineNumber, + column: this.scanner.index - this.scanner.lineStart + } + }; + } + if (token.type === 9 /* RegularExpression */) { + var pattern = token.pattern; + var flags = token.flags; + t.regex = { pattern: pattern, flags: flags }; + } + return t; + }; + Parser.prototype.nextToken = function () { + var token = this.lookahead; + this.lastMarker.index = this.scanner.index; + this.lastMarker.line = this.scanner.lineNumber; + this.lastMarker.column = this.scanner.index - this.scanner.lineStart; + this.collectComments(); + if (this.scanner.index !== this.startMarker.index) { + this.startMarker.index = this.scanner.index; + this.startMarker.line = this.scanner.lineNumber; + this.startMarker.column = this.scanner.index - this.scanner.lineStart; + } + var next = this.scanner.lex(); + this.hasLineTerminator = (token.lineNumber !== next.lineNumber); + if (next && this.context.strict && next.type === 3 /* Identifier */) { + if (this.scanner.isStrictModeReservedWord(next.value)) { + next.type = 4 /* Keyword */; + } + } + this.lookahead = next; + if (this.config.tokens && next.type !== 2 /* EOF */) { + this.tokens.push(this.convertToken(next)); + } + return token; + }; + Parser.prototype.nextRegexToken = function () { + this.collectComments(); + var token = this.scanner.scanRegExp(); + if (this.config.tokens) { + // Pop the previous token, '/' or '/=' + // This is added from the lookahead token. + this.tokens.pop(); + this.tokens.push(this.convertToken(token)); + } + // Prime the next lookahead. + this.lookahead = token; + this.nextToken(); + return token; + }; + Parser.prototype.createNode = function () { + return { + index: this.startMarker.index, + line: this.startMarker.line, + column: this.startMarker.column + }; + }; + Parser.prototype.startNode = function (token, lastLineStart) { + if (lastLineStart === void 0) { lastLineStart = 0; } + var column = token.start - token.lineStart; + var line = token.lineNumber; + if (column < 0) { + column += lastLineStart; + line--; + } + return { + index: token.start, + line: line, + column: column + }; + }; + Parser.prototype.finalize = function (marker, node) { + if (this.config.range) { + node.range = [marker.index, this.lastMarker.index]; + } + if (this.config.loc) { + node.loc = { + start: { + line: marker.line, + column: marker.column, + }, + end: { + line: this.lastMarker.line, + column: this.lastMarker.column + } + }; + if (this.config.source) { + node.loc.source = this.config.source; + } + } + if (this.delegate) { + var metadata = { + start: { + line: marker.line, + column: marker.column, + offset: marker.index + }, + end: { + line: this.lastMarker.line, + column: this.lastMarker.column, + offset: this.lastMarker.index + } + }; + this.delegate(node, metadata); + } + return node; + }; + // Expect the next token to match the specified punctuator. + // If not, an exception will be thrown. + Parser.prototype.expect = function (value) { + var token = this.nextToken(); + if (token.type !== 7 /* Punctuator */ || token.value !== value) { + this.throwUnexpectedToken(token); + } + }; + // Quietly expect a comma when in tolerant mode, otherwise delegates to expect(). + Parser.prototype.expectCommaSeparator = function () { + if (this.config.tolerant) { + var token = this.lookahead; + if (token.type === 7 /* Punctuator */ && token.value === ',') { + this.nextToken(); + } + else if (token.type === 7 /* Punctuator */ && token.value === ';') { + this.nextToken(); + this.tolerateUnexpectedToken(token); + } + else { + this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken); + } + } + else { + this.expect(','); + } + }; + // Expect the next token to match the specified keyword. + // If not, an exception will be thrown. + Parser.prototype.expectKeyword = function (keyword) { + var token = this.nextToken(); + if (token.type !== 4 /* Keyword */ || token.value !== keyword) { + this.throwUnexpectedToken(token); + } + }; + // Return true if the next token matches the specified punctuator. + Parser.prototype.match = function (value) { + return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value; + }; + // Return true if the next token matches the specified keyword + Parser.prototype.matchKeyword = function (keyword) { + return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword; + }; + // Return true if the next token matches the specified contextual keyword + // (where an identifier is sometimes a keyword depending on the context) + Parser.prototype.matchContextualKeyword = function (keyword) { + return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword; + }; + // Return true if the next token is an assignment operator + Parser.prototype.matchAssign = function () { + if (this.lookahead.type !== 7 /* Punctuator */) { + return false; + } + var op = this.lookahead.value; + return op === '=' || + op === '*=' || + op === '**=' || + op === '/=' || + op === '%=' || + op === '+=' || + op === '-=' || + op === '<<=' || + op === '>>=' || + op === '>>>=' || + op === '&=' || + op === '^=' || + op === '|='; + }; + // Cover grammar support. + // + // When an assignment expression position starts with an left parenthesis, the determination of the type + // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead) + // or the first comma. This situation also defers the determination of all the expressions nested in the pair. + // + // There are three productions that can be parsed in a parentheses pair that needs to be determined + // after the outermost pair is closed. They are: + // + // 1. AssignmentExpression + // 2. BindingElements + // 3. AssignmentTargets + // + // In order to avoid exponential backtracking, we use two flags to denote if the production can be + // binding element or assignment target. + // + // The three productions have the relationship: + // + // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression + // + // with a single exception that CoverInitializedName when used directly in an Expression, generates + // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the + // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair. + // + // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not + // effect the current flags. This means the production the parser parses is only used as an expression. Therefore + // the CoverInitializedName check is conducted. + // + // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates + // the flags outside of the parser. This means the production the parser parses is used as a part of a potential + // pattern. The CoverInitializedName check is deferred. + Parser.prototype.isolateCoverGrammar = function (parseFunction) { + var previousIsBindingElement = this.context.isBindingElement; + var previousIsAssignmentTarget = this.context.isAssignmentTarget; + var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; + this.context.isBindingElement = true; + this.context.isAssignmentTarget = true; + this.context.firstCoverInitializedNameError = null; + var result = parseFunction.call(this); + if (this.context.firstCoverInitializedNameError !== null) { + this.throwUnexpectedToken(this.context.firstCoverInitializedNameError); + } + this.context.isBindingElement = previousIsBindingElement; + this.context.isAssignmentTarget = previousIsAssignmentTarget; + this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError; + return result; + }; + Parser.prototype.inheritCoverGrammar = function (parseFunction) { + var previousIsBindingElement = this.context.isBindingElement; + var previousIsAssignmentTarget = this.context.isAssignmentTarget; + var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; + this.context.isBindingElement = true; + this.context.isAssignmentTarget = true; + this.context.firstCoverInitializedNameError = null; + var result = parseFunction.call(this); + this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement; + this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget; + this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError; + return result; + }; + Parser.prototype.consumeSemicolon = function () { + if (this.match(';')) { + this.nextToken(); + } + else if (!this.hasLineTerminator) { + if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) { + this.throwUnexpectedToken(this.lookahead); + } + this.lastMarker.index = this.startMarker.index; + this.lastMarker.line = this.startMarker.line; + this.lastMarker.column = this.startMarker.column; + } + }; + // https://tc39.github.io/ecma262/#sec-primary-expression + Parser.prototype.parsePrimaryExpression = function () { + var node = this.createNode(); + var expr; + var token, raw; + switch (this.lookahead.type) { + case 3 /* Identifier */: + if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') { + this.tolerateUnexpectedToken(this.lookahead); + } + expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value)); + break; + case 6 /* NumericLiteral */: + case 8 /* StringLiteral */: + if (this.context.strict && this.lookahead.octal) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(token.value, raw)); + break; + case 1 /* BooleanLiteral */: + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(token.value === 'true', raw)); + break; + case 5 /* NullLiteral */: + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + token = this.nextToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.Literal(null, raw)); + break; + case 10 /* Template */: + expr = this.parseTemplateLiteral(); + break; + case 7 /* Punctuator */: + switch (this.lookahead.value) { + case '(': + this.context.isBindingElement = false; + expr = this.inheritCoverGrammar(this.parseGroupExpression); + break; + case '[': + expr = this.inheritCoverGrammar(this.parseArrayInitializer); + break; + case '{': + expr = this.inheritCoverGrammar(this.parseObjectInitializer); + break; + case '/': + case '/=': + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + this.scanner.index = this.startMarker.index; + token = this.nextRegexToken(); + raw = this.getTokenRaw(token); + expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags)); + break; + default: + expr = this.throwUnexpectedToken(this.nextToken()); + } + break; + case 4 /* Keyword */: + if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) { + expr = this.parseIdentifierName(); + } + else if (!this.context.strict && this.matchKeyword('let')) { + expr = this.finalize(node, new Node.Identifier(this.nextToken().value)); + } + else { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + if (this.matchKeyword('function')) { + expr = this.parseFunctionExpression(); + } + else if (this.matchKeyword('this')) { + this.nextToken(); + expr = this.finalize(node, new Node.ThisExpression()); + } + else if (this.matchKeyword('class')) { + expr = this.parseClassExpression(); + } + else { + expr = this.throwUnexpectedToken(this.nextToken()); + } + } + break; + default: + expr = this.throwUnexpectedToken(this.nextToken()); + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-array-initializer + Parser.prototype.parseSpreadElement = function () { + var node = this.createNode(); + this.expect('...'); + var arg = this.inheritCoverGrammar(this.parseAssignmentExpression); + return this.finalize(node, new Node.SpreadElement(arg)); + }; + Parser.prototype.parseArrayInitializer = function () { + var node = this.createNode(); + var elements = []; + this.expect('['); + while (!this.match(']')) { + if (this.match(',')) { + this.nextToken(); + elements.push(null); + } + else if (this.match('...')) { + var element = this.parseSpreadElement(); + if (!this.match(']')) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + this.expect(','); + } + elements.push(element); + } + else { + elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); + if (!this.match(']')) { + this.expect(','); + } + } + } + this.expect(']'); + return this.finalize(node, new Node.ArrayExpression(elements)); + }; + // https://tc39.github.io/ecma262/#sec-object-initializer + Parser.prototype.parsePropertyMethod = function (params) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = params.simple; + var body = this.isolateCoverGrammar(this.parseFunctionSourceElements); + if (this.context.strict && params.firstRestricted) { + this.tolerateUnexpectedToken(params.firstRestricted, params.message); + } + if (this.context.strict && params.stricted) { + this.tolerateUnexpectedToken(params.stricted, params.message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + return body; + }; + Parser.prototype.parsePropertyMethodFunction = function () { + var isGenerator = false; + var node = this.createNode(); + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var params = this.parseFormalParameters(); + var method = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); + }; + Parser.prototype.parsePropertyMethodAsyncFunction = function () { + var node = this.createNode(); + var previousAllowYield = this.context.allowYield; + var previousAwait = this.context.await; + this.context.allowYield = false; + this.context.await = true; + var params = this.parseFormalParameters(); + var method = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + this.context.await = previousAwait; + return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method)); + }; + Parser.prototype.parseObjectPropertyKey = function () { + var node = this.createNode(); + var token = this.nextToken(); + var key; + switch (token.type) { + case 8 /* StringLiteral */: + case 6 /* NumericLiteral */: + if (this.context.strict && token.octal) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral); + } + var raw = this.getTokenRaw(token); + key = this.finalize(node, new Node.Literal(token.value, raw)); + break; + case 3 /* Identifier */: + case 1 /* BooleanLiteral */: + case 5 /* NullLiteral */: + case 4 /* Keyword */: + key = this.finalize(node, new Node.Identifier(token.value)); + break; + case 7 /* Punctuator */: + if (token.value === '[') { + key = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.expect(']'); + } + else { + key = this.throwUnexpectedToken(token); + } + break; + default: + key = this.throwUnexpectedToken(token); + } + return key; + }; + Parser.prototype.isPropertyKey = function (key, value) { + return (key.type === syntax_1.Syntax.Identifier && key.name === value) || + (key.type === syntax_1.Syntax.Literal && key.value === value); + }; + Parser.prototype.parseObjectProperty = function (hasProto) { + var node = this.createNode(); + var token = this.lookahead; + var kind; + var key = null; + var value = null; + var computed = false; + var method = false; + var shorthand = false; + var isAsync = false; + if (token.type === 3 /* Identifier */) { + var id = token.value; + this.nextToken(); + computed = this.match('['); + isAsync = !this.hasLineTerminator && (id === 'async') && + !this.match(':') && !this.match('(') && !this.match('*') && !this.match(','); + key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id)); + } + else if (this.match('*')) { + this.nextToken(); + } + else { + computed = this.match('['); + key = this.parseObjectPropertyKey(); + } + var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); + if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) { + kind = 'get'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + this.context.allowYield = false; + value = this.parseGetterMethod(); + } + else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) { + kind = 'set'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseSetterMethod(); + } + else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { + kind = 'init'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseGeneratorMethod(); + method = true; + } + else { + if (!key) { + this.throwUnexpectedToken(this.lookahead); + } + kind = 'init'; + if (this.match(':') && !isAsync) { + if (!computed && this.isPropertyKey(key, '__proto__')) { + if (hasProto.value) { + this.tolerateError(messages_1.Messages.DuplicateProtoProperty); + } + hasProto.value = true; + } + this.nextToken(); + value = this.inheritCoverGrammar(this.parseAssignmentExpression); + } + else if (this.match('(')) { + value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); + method = true; + } + else if (token.type === 3 /* Identifier */) { + var id = this.finalize(node, new Node.Identifier(token.value)); + if (this.match('=')) { + this.context.firstCoverInitializedNameError = this.lookahead; + this.nextToken(); + shorthand = true; + var init = this.isolateCoverGrammar(this.parseAssignmentExpression); + value = this.finalize(node, new Node.AssignmentPattern(id, init)); + } + else { + shorthand = true; + value = id; + } + } + else { + this.throwUnexpectedToken(this.nextToken()); + } + } + return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand)); + }; + Parser.prototype.parseObjectInitializer = function () { + var node = this.createNode(); + this.expect('{'); + var properties = []; + var hasProto = { value: false }; + while (!this.match('}')) { + properties.push(this.parseObjectProperty(hasProto)); + if (!this.match('}')) { + this.expectCommaSeparator(); + } + } + this.expect('}'); + return this.finalize(node, new Node.ObjectExpression(properties)); + }; + // https://tc39.github.io/ecma262/#sec-template-literals + Parser.prototype.parseTemplateHead = function () { + assert_1.assert(this.lookahead.head, 'Template literal must start with a template head'); + var node = this.createNode(); + var token = this.nextToken(); + var raw = token.value; + var cooked = token.cooked; + return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); + }; + Parser.prototype.parseTemplateElement = function () { + if (this.lookahead.type !== 10 /* Template */) { + this.throwUnexpectedToken(); + } + var node = this.createNode(); + var token = this.nextToken(); + var raw = token.value; + var cooked = token.cooked; + return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); + }; + Parser.prototype.parseTemplateLiteral = function () { + var node = this.createNode(); + var expressions = []; + var quasis = []; + var quasi = this.parseTemplateHead(); + quasis.push(quasi); + while (!quasi.tail) { + expressions.push(this.parseExpression()); + quasi = this.parseTemplateElement(); + quasis.push(quasi); + } + return this.finalize(node, new Node.TemplateLiteral(quasis, expressions)); + }; + // https://tc39.github.io/ecma262/#sec-grouping-operator + Parser.prototype.reinterpretExpressionAsPattern = function (expr) { + switch (expr.type) { + case syntax_1.Syntax.Identifier: + case syntax_1.Syntax.MemberExpression: + case syntax_1.Syntax.RestElement: + case syntax_1.Syntax.AssignmentPattern: + break; + case syntax_1.Syntax.SpreadElement: + expr.type = syntax_1.Syntax.RestElement; + this.reinterpretExpressionAsPattern(expr.argument); + break; + case syntax_1.Syntax.ArrayExpression: + expr.type = syntax_1.Syntax.ArrayPattern; + for (var i = 0; i < expr.elements.length; i++) { + if (expr.elements[i] !== null) { + this.reinterpretExpressionAsPattern(expr.elements[i]); + } + } + break; + case syntax_1.Syntax.ObjectExpression: + expr.type = syntax_1.Syntax.ObjectPattern; + for (var i = 0; i < expr.properties.length; i++) { + this.reinterpretExpressionAsPattern(expr.properties[i].value); + } + break; + case syntax_1.Syntax.AssignmentExpression: + expr.type = syntax_1.Syntax.AssignmentPattern; + delete expr.operator; + this.reinterpretExpressionAsPattern(expr.left); + break; + default: + // Allow other node type for tolerant parsing. + break; + } + }; + Parser.prototype.parseGroupExpression = function () { + var expr; + this.expect('('); + if (this.match(')')) { + this.nextToken(); + if (!this.match('=>')) { + this.expect('=>'); + } + expr = { + type: ArrowParameterPlaceHolder, + params: [], + async: false + }; + } + else { + var startToken = this.lookahead; + var params = []; + if (this.match('...')) { + expr = this.parseRestElement(params); + this.expect(')'); + if (!this.match('=>')) { + this.expect('=>'); + } + expr = { + type: ArrowParameterPlaceHolder, + params: [expr], + async: false + }; + } + else { + var arrow = false; + this.context.isBindingElement = true; + expr = this.inheritCoverGrammar(this.parseAssignmentExpression); + if (this.match(',')) { + var expressions = []; + this.context.isAssignmentTarget = false; + expressions.push(expr); + while (this.lookahead.type !== 2 /* EOF */) { + if (!this.match(',')) { + break; + } + this.nextToken(); + if (this.match(')')) { + this.nextToken(); + for (var i = 0; i < expressions.length; i++) { + this.reinterpretExpressionAsPattern(expressions[i]); + } + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: expressions, + async: false + }; + } + else if (this.match('...')) { + if (!this.context.isBindingElement) { + this.throwUnexpectedToken(this.lookahead); + } + expressions.push(this.parseRestElement(params)); + this.expect(')'); + if (!this.match('=>')) { + this.expect('=>'); + } + this.context.isBindingElement = false; + for (var i = 0; i < expressions.length; i++) { + this.reinterpretExpressionAsPattern(expressions[i]); + } + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: expressions, + async: false + }; + } + else { + expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); + } + if (arrow) { + break; + } + } + if (!arrow) { + expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + } + } + if (!arrow) { + this.expect(')'); + if (this.match('=>')) { + if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') { + arrow = true; + expr = { + type: ArrowParameterPlaceHolder, + params: [expr], + async: false + }; + } + if (!arrow) { + if (!this.context.isBindingElement) { + this.throwUnexpectedToken(this.lookahead); + } + if (expr.type === syntax_1.Syntax.SequenceExpression) { + for (var i = 0; i < expr.expressions.length; i++) { + this.reinterpretExpressionAsPattern(expr.expressions[i]); + } + } + else { + this.reinterpretExpressionAsPattern(expr); + } + var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]); + expr = { + type: ArrowParameterPlaceHolder, + params: parameters, + async: false + }; + } + } + this.context.isBindingElement = false; + } + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions + Parser.prototype.parseArguments = function () { + this.expect('('); + var args = []; + if (!this.match(')')) { + while (true) { + var expr = this.match('...') ? this.parseSpreadElement() : + this.isolateCoverGrammar(this.parseAssignmentExpression); + args.push(expr); + if (this.match(')')) { + break; + } + this.expectCommaSeparator(); + if (this.match(')')) { + break; + } + } + } + this.expect(')'); + return args; + }; + Parser.prototype.isIdentifierName = function (token) { + return token.type === 3 /* Identifier */ || + token.type === 4 /* Keyword */ || + token.type === 1 /* BooleanLiteral */ || + token.type === 5 /* NullLiteral */; + }; + Parser.prototype.parseIdentifierName = function () { + var node = this.createNode(); + var token = this.nextToken(); + if (!this.isIdentifierName(token)) { + this.throwUnexpectedToken(token); + } + return this.finalize(node, new Node.Identifier(token.value)); + }; + Parser.prototype.parseNewExpression = function () { + var node = this.createNode(); + var id = this.parseIdentifierName(); + assert_1.assert(id.name === 'new', 'New expression must start with `new`'); + var expr; + if (this.match('.')) { + this.nextToken(); + if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') { + var property = this.parseIdentifierName(); + expr = new Node.MetaProperty(id, property); + } + else { + this.throwUnexpectedToken(this.lookahead); + } + } + else { + var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); + var args = this.match('(') ? this.parseArguments() : []; + expr = new Node.NewExpression(callee, args); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + return this.finalize(node, expr); + }; + Parser.prototype.parseAsyncArgument = function () { + var arg = this.parseAssignmentExpression(); + this.context.firstCoverInitializedNameError = null; + return arg; + }; + Parser.prototype.parseAsyncArguments = function () { + this.expect('('); + var args = []; + if (!this.match(')')) { + while (true) { + var expr = this.match('...') ? this.parseSpreadElement() : + this.isolateCoverGrammar(this.parseAsyncArgument); + args.push(expr); + if (this.match(')')) { + break; + } + this.expectCommaSeparator(); + if (this.match(')')) { + break; + } + } + } + this.expect(')'); + return args; + }; + Parser.prototype.parseLeftHandSideExpressionAllowCall = function () { + var startToken = this.lookahead; + var maybeAsync = this.matchContextualKeyword('async'); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + var expr; + if (this.matchKeyword('super') && this.context.inFunctionBody) { + expr = this.createNode(); + this.nextToken(); + expr = this.finalize(expr, new Node.Super()); + if (!this.match('(') && !this.match('.') && !this.match('[')) { + this.throwUnexpectedToken(this.lookahead); + } + } + else { + expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); + } + while (true) { + if (this.match('.')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('.'); + var property = this.parseIdentifierName(); + expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property)); + } + else if (this.match('(')) { + var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber); + this.context.isBindingElement = false; + this.context.isAssignmentTarget = false; + var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments(); + expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args)); + if (asyncArrow && this.match('=>')) { + for (var i = 0; i < args.length; ++i) { + this.reinterpretExpressionAsPattern(args[i]); + } + expr = { + type: ArrowParameterPlaceHolder, + params: args, + async: true + }; + } + } + else if (this.match('[')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('['); + var property = this.isolateCoverGrammar(this.parseExpression); + this.expect(']'); + expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property)); + } + else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { + var quasi = this.parseTemplateLiteral(); + expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi)); + } + else { + break; + } + } + this.context.allowIn = previousAllowIn; + return expr; + }; + Parser.prototype.parseSuper = function () { + var node = this.createNode(); + this.expectKeyword('super'); + if (!this.match('[') && !this.match('.')) { + this.throwUnexpectedToken(this.lookahead); + } + return this.finalize(node, new Node.Super()); + }; + Parser.prototype.parseLeftHandSideExpression = function () { + assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.'); + var node = this.startNode(this.lookahead); + var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() : + this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); + while (true) { + if (this.match('[')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('['); + var property = this.isolateCoverGrammar(this.parseExpression); + this.expect(']'); + expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property)); + } + else if (this.match('.')) { + this.context.isBindingElement = false; + this.context.isAssignmentTarget = true; + this.expect('.'); + var property = this.parseIdentifierName(); + expr = this.finalize(node, new Node.StaticMemberExpression(expr, property)); + } + else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { + var quasi = this.parseTemplateLiteral(); + expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi)); + } + else { + break; + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-update-expressions + Parser.prototype.parseUpdateExpression = function () { + var expr; + var startToken = this.lookahead; + if (this.match('++') || this.match('--')) { + var node = this.startNode(startToken); + var token = this.nextToken(); + expr = this.inheritCoverGrammar(this.parseUnaryExpression); + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { + this.tolerateError(messages_1.Messages.StrictLHSPrefix); + } + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + var prefix = true; + expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix)); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + else { + expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) { + if (this.match('++') || this.match('--')) { + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { + this.tolerateError(messages_1.Messages.StrictLHSPostfix); + } + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var operator = this.nextToken().value; + var prefix = false; + expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix)); + } + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-unary-operators + Parser.prototype.parseAwaitExpression = function () { + var node = this.createNode(); + this.nextToken(); + var argument = this.parseUnaryExpression(); + return this.finalize(node, new Node.AwaitExpression(argument)); + }; + Parser.prototype.parseUnaryExpression = function () { + var expr; + if (this.match('+') || this.match('-') || this.match('~') || this.match('!') || + this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) { + var node = this.startNode(this.lookahead); + var token = this.nextToken(); + expr = this.inheritCoverGrammar(this.parseUnaryExpression); + expr = this.finalize(node, new Node.UnaryExpression(token.value, expr)); + if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) { + this.tolerateError(messages_1.Messages.StrictDelete); + } + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + else if (this.context.await && this.matchContextualKeyword('await')) { + expr = this.parseAwaitExpression(); + } + else { + expr = this.parseUpdateExpression(); + } + return expr; + }; + Parser.prototype.parseExponentiationExpression = function () { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseUnaryExpression); + if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) { + this.nextToken(); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var left = expr; + var right = this.isolateCoverGrammar(this.parseExponentiationExpression); + expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right)); + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-exp-operator + // https://tc39.github.io/ecma262/#sec-multiplicative-operators + // https://tc39.github.io/ecma262/#sec-additive-operators + // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators + // https://tc39.github.io/ecma262/#sec-relational-operators + // https://tc39.github.io/ecma262/#sec-equality-operators + // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators + // https://tc39.github.io/ecma262/#sec-binary-logical-operators + Parser.prototype.binaryPrecedence = function (token) { + var op = token.value; + var precedence; + if (token.type === 7 /* Punctuator */) { + precedence = this.operatorPrecedence[op] || 0; + } + else if (token.type === 4 /* Keyword */) { + precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0; + } + else { + precedence = 0; + } + return precedence; + }; + Parser.prototype.parseBinaryExpression = function () { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseExponentiationExpression); + var token = this.lookahead; + var prec = this.binaryPrecedence(token); + if (prec > 0) { + this.nextToken(); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var markers = [startToken, this.lookahead]; + var left = expr; + var right = this.isolateCoverGrammar(this.parseExponentiationExpression); + var stack = [left, token.value, right]; + var precedences = [prec]; + while (true) { + prec = this.binaryPrecedence(this.lookahead); + if (prec <= 0) { + break; + } + // Reduce: make a binary expression from the three topmost entries. + while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) { + right = stack.pop(); + var operator = stack.pop(); + precedences.pop(); + left = stack.pop(); + markers.pop(); + var node = this.startNode(markers[markers.length - 1]); + stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right))); + } + // Shift. + stack.push(this.nextToken().value); + precedences.push(prec); + markers.push(this.lookahead); + stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression)); + } + // Final reduce to clean-up the stack. + var i = stack.length - 1; + expr = stack[i]; + var lastMarker = markers.pop(); + while (i > 1) { + var marker = markers.pop(); + var lastLineStart = lastMarker && lastMarker.lineStart; + var node = this.startNode(marker, lastLineStart); + var operator = stack[i - 1]; + expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr)); + i -= 2; + lastMarker = marker; + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-conditional-operator + Parser.prototype.parseConditionalExpression = function () { + var startToken = this.lookahead; + var expr = this.inheritCoverGrammar(this.parseBinaryExpression); + if (this.match('?')) { + this.nextToken(); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.context.allowIn = previousAllowIn; + this.expect(':'); + var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); + expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-assignment-operators + Parser.prototype.checkPatternParam = function (options, param) { + switch (param.type) { + case syntax_1.Syntax.Identifier: + this.validateParam(options, param, param.name); + break; + case syntax_1.Syntax.RestElement: + this.checkPatternParam(options, param.argument); + break; + case syntax_1.Syntax.AssignmentPattern: + this.checkPatternParam(options, param.left); + break; + case syntax_1.Syntax.ArrayPattern: + for (var i = 0; i < param.elements.length; i++) { + if (param.elements[i] !== null) { + this.checkPatternParam(options, param.elements[i]); + } + } + break; + case syntax_1.Syntax.ObjectPattern: + for (var i = 0; i < param.properties.length; i++) { + this.checkPatternParam(options, param.properties[i].value); + } + break; + default: + break; + } + options.simple = options.simple && (param instanceof Node.Identifier); + }; + Parser.prototype.reinterpretAsCoverFormalsList = function (expr) { + var params = [expr]; + var options; + var asyncArrow = false; + switch (expr.type) { + case syntax_1.Syntax.Identifier: + break; + case ArrowParameterPlaceHolder: + params = expr.params; + asyncArrow = expr.async; + break; + default: + return null; + } + options = { + simple: true, + paramSet: {} + }; + for (var i = 0; i < params.length; ++i) { + var param = params[i]; + if (param.type === syntax_1.Syntax.AssignmentPattern) { + if (param.right.type === syntax_1.Syntax.YieldExpression) { + if (param.right.argument) { + this.throwUnexpectedToken(this.lookahead); + } + param.right.type = syntax_1.Syntax.Identifier; + param.right.name = 'yield'; + delete param.right.argument; + delete param.right.delegate; + } + } + else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') { + this.throwUnexpectedToken(this.lookahead); + } + this.checkPatternParam(options, param); + params[i] = param; + } + if (this.context.strict || !this.context.allowYield) { + for (var i = 0; i < params.length; ++i) { + var param = params[i]; + if (param.type === syntax_1.Syntax.YieldExpression) { + this.throwUnexpectedToken(this.lookahead); + } + } + } + if (options.message === messages_1.Messages.StrictParamDupe) { + var token = this.context.strict ? options.stricted : options.firstRestricted; + this.throwUnexpectedToken(token, options.message); + } + return { + simple: options.simple, + params: params, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; + }; + Parser.prototype.parseAssignmentExpression = function () { + var expr; + if (!this.context.allowYield && this.matchKeyword('yield')) { + expr = this.parseYieldExpression(); + } + else { + var startToken = this.lookahead; + var token = startToken; + expr = this.parseConditionalExpression(); + if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') { + if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) { + var arg = this.parsePrimaryExpression(); + this.reinterpretExpressionAsPattern(arg); + expr = { + type: ArrowParameterPlaceHolder, + params: [arg], + async: true + }; + } + } + if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) { + // https://tc39.github.io/ecma262/#sec-arrow-function-definitions + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + var isAsync = expr.async; + var list = this.reinterpretAsCoverFormalsList(expr); + if (list) { + if (this.hasLineTerminator) { + this.tolerateUnexpectedToken(this.lookahead); + } + this.context.firstCoverInitializedNameError = null; + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = list.simple; + var previousAllowYield = this.context.allowYield; + var previousAwait = this.context.await; + this.context.allowYield = true; + this.context.await = isAsync; + var node = this.startNode(startToken); + this.expect('=>'); + var body = void 0; + if (this.match('{')) { + var previousAllowIn = this.context.allowIn; + this.context.allowIn = true; + body = this.parseFunctionSourceElements(); + this.context.allowIn = previousAllowIn; + } + else { + body = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + var expression = body.type !== syntax_1.Syntax.BlockStatement; + if (this.context.strict && list.firstRestricted) { + this.throwUnexpectedToken(list.firstRestricted, list.message); + } + if (this.context.strict && list.stricted) { + this.tolerateUnexpectedToken(list.stricted, list.message); + } + expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) : + this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression)); + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.allowYield = previousAllowYield; + this.context.await = previousAwait; + } + } + else { + if (this.matchAssign()) { + if (!this.context.isAssignmentTarget) { + this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); + } + if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) { + var id = expr; + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment); + } + if (this.scanner.isStrictModeReservedWord(id.name)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } + } + if (!this.match('=')) { + this.context.isAssignmentTarget = false; + this.context.isBindingElement = false; + } + else { + this.reinterpretExpressionAsPattern(expr); + } + token = this.nextToken(); + var operator = token.value; + var right = this.isolateCoverGrammar(this.parseAssignmentExpression); + expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right)); + this.context.firstCoverInitializedNameError = null; + } + } + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-comma-operator + Parser.prototype.parseExpression = function () { + var startToken = this.lookahead; + var expr = this.isolateCoverGrammar(this.parseAssignmentExpression); + if (this.match(',')) { + var expressions = []; + expressions.push(expr); + while (this.lookahead.type !== 2 /* EOF */) { + if (!this.match(',')) { + break; + } + this.nextToken(); + expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); + } + expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); + } + return expr; + }; + // https://tc39.github.io/ecma262/#sec-block + Parser.prototype.parseStatementListItem = function () { + var statement; + this.context.isAssignmentTarget = true; + this.context.isBindingElement = true; + if (this.lookahead.type === 4 /* Keyword */) { + switch (this.lookahead.value) { + case 'export': + if (!this.context.isModule) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration); + } + statement = this.parseExportDeclaration(); + break; + case 'import': + if (!this.context.isModule) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration); + } + statement = this.parseImportDeclaration(); + break; + case 'const': + statement = this.parseLexicalDeclaration({ inFor: false }); + break; + case 'function': + statement = this.parseFunctionDeclaration(); + break; + case 'class': + statement = this.parseClassDeclaration(); + break; + case 'let': + statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement(); + break; + default: + statement = this.parseStatement(); + break; + } + } + else { + statement = this.parseStatement(); + } + return statement; + }; + Parser.prototype.parseBlock = function () { + var node = this.createNode(); + this.expect('{'); + var block = []; + while (true) { + if (this.match('}')) { + break; + } + block.push(this.parseStatementListItem()); + } + this.expect('}'); + return this.finalize(node, new Node.BlockStatement(block)); + }; + // https://tc39.github.io/ecma262/#sec-let-and-const-declarations + Parser.prototype.parseLexicalBinding = function (kind, options) { + var node = this.createNode(); + var params = []; + var id = this.parsePattern(params, kind); + if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateError(messages_1.Messages.StrictVarName); + } + } + var init = null; + if (kind === 'const') { + if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) { + if (this.match('=')) { + this.nextToken(); + init = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + else { + this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const'); + } + } + } + else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) { + this.expect('='); + init = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + return this.finalize(node, new Node.VariableDeclarator(id, init)); + }; + Parser.prototype.parseBindingList = function (kind, options) { + var list = [this.parseLexicalBinding(kind, options)]; + while (this.match(',')) { + this.nextToken(); + list.push(this.parseLexicalBinding(kind, options)); + } + return list; + }; + Parser.prototype.isLexicalDeclaration = function () { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.scanner.lex(); + this.scanner.restoreState(state); + return (next.type === 3 /* Identifier */) || + (next.type === 7 /* Punctuator */ && next.value === '[') || + (next.type === 7 /* Punctuator */ && next.value === '{') || + (next.type === 4 /* Keyword */ && next.value === 'let') || + (next.type === 4 /* Keyword */ && next.value === 'yield'); + }; + Parser.prototype.parseLexicalDeclaration = function (options) { + var node = this.createNode(); + var kind = this.nextToken().value; + assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const'); + var declarations = this.parseBindingList(kind, options); + this.consumeSemicolon(); + return this.finalize(node, new Node.VariableDeclaration(declarations, kind)); + }; + // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns + Parser.prototype.parseBindingRestElement = function (params, kind) { + var node = this.createNode(); + this.expect('...'); + var arg = this.parsePattern(params, kind); + return this.finalize(node, new Node.RestElement(arg)); + }; + Parser.prototype.parseArrayPattern = function (params, kind) { + var node = this.createNode(); + this.expect('['); + var elements = []; + while (!this.match(']')) { + if (this.match(',')) { + this.nextToken(); + elements.push(null); + } + else { + if (this.match('...')) { + elements.push(this.parseBindingRestElement(params, kind)); + break; + } + else { + elements.push(this.parsePatternWithDefault(params, kind)); + } + if (!this.match(']')) { + this.expect(','); + } + } + } + this.expect(']'); + return this.finalize(node, new Node.ArrayPattern(elements)); + }; + Parser.prototype.parsePropertyPattern = function (params, kind) { + var node = this.createNode(); + var computed = false; + var shorthand = false; + var method = false; + var key; + var value; + if (this.lookahead.type === 3 /* Identifier */) { + var keyToken = this.lookahead; + key = this.parseVariableIdentifier(); + var init = this.finalize(node, new Node.Identifier(keyToken.value)); + if (this.match('=')) { + params.push(keyToken); + shorthand = true; + this.nextToken(); + var expr = this.parseAssignmentExpression(); + value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr)); + } + else if (!this.match(':')) { + params.push(keyToken); + shorthand = true; + value = init; + } + else { + this.expect(':'); + value = this.parsePatternWithDefault(params, kind); + } + } + else { + computed = this.match('['); + key = this.parseObjectPropertyKey(); + this.expect(':'); + value = this.parsePatternWithDefault(params, kind); + } + return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand)); + }; + Parser.prototype.parseObjectPattern = function (params, kind) { + var node = this.createNode(); + var properties = []; + this.expect('{'); + while (!this.match('}')) { + properties.push(this.parsePropertyPattern(params, kind)); + if (!this.match('}')) { + this.expect(','); + } + } + this.expect('}'); + return this.finalize(node, new Node.ObjectPattern(properties)); + }; + Parser.prototype.parsePattern = function (params, kind) { + var pattern; + if (this.match('[')) { + pattern = this.parseArrayPattern(params, kind); + } + else if (this.match('{')) { + pattern = this.parseObjectPattern(params, kind); + } + else { + if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) { + this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding); + } + params.push(this.lookahead); + pattern = this.parseVariableIdentifier(kind); + } + return pattern; + }; + Parser.prototype.parsePatternWithDefault = function (params, kind) { + var startToken = this.lookahead; + var pattern = this.parsePattern(params, kind); + if (this.match('=')) { + this.nextToken(); + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var right = this.isolateCoverGrammar(this.parseAssignmentExpression); + this.context.allowYield = previousAllowYield; + pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right)); + } + return pattern; + }; + // https://tc39.github.io/ecma262/#sec-variable-statement + Parser.prototype.parseVariableIdentifier = function (kind) { + var node = this.createNode(); + var token = this.nextToken(); + if (token.type === 4 /* Keyword */ && token.value === 'yield') { + if (this.context.strict) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } + else if (!this.context.allowYield) { + this.throwUnexpectedToken(token); + } + } + else if (token.type !== 3 /* Identifier */) { + if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); + } + else { + if (this.context.strict || token.value !== 'let' || kind !== 'var') { + this.throwUnexpectedToken(token); + } + } + } + else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') { + this.tolerateUnexpectedToken(token); + } + return this.finalize(node, new Node.Identifier(token.value)); + }; + Parser.prototype.parseVariableDeclaration = function (options) { + var node = this.createNode(); + var params = []; + var id = this.parsePattern(params, 'var'); + if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(id.name)) { + this.tolerateError(messages_1.Messages.StrictVarName); + } + } + var init = null; + if (this.match('=')) { + this.nextToken(); + init = this.isolateCoverGrammar(this.parseAssignmentExpression); + } + else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) { + this.expect('='); + } + return this.finalize(node, new Node.VariableDeclarator(id, init)); + }; + Parser.prototype.parseVariableDeclarationList = function (options) { + var opt = { inFor: options.inFor }; + var list = []; + list.push(this.parseVariableDeclaration(opt)); + while (this.match(',')) { + this.nextToken(); + list.push(this.parseVariableDeclaration(opt)); + } + return list; + }; + Parser.prototype.parseVariableStatement = function () { + var node = this.createNode(); + this.expectKeyword('var'); + var declarations = this.parseVariableDeclarationList({ inFor: false }); + this.consumeSemicolon(); + return this.finalize(node, new Node.VariableDeclaration(declarations, 'var')); + }; + // https://tc39.github.io/ecma262/#sec-empty-statement + Parser.prototype.parseEmptyStatement = function () { + var node = this.createNode(); + this.expect(';'); + return this.finalize(node, new Node.EmptyStatement()); + }; + // https://tc39.github.io/ecma262/#sec-expression-statement + Parser.prototype.parseExpressionStatement = function () { + var node = this.createNode(); + var expr = this.parseExpression(); + this.consumeSemicolon(); + return this.finalize(node, new Node.ExpressionStatement(expr)); + }; + // https://tc39.github.io/ecma262/#sec-if-statement + Parser.prototype.parseIfClause = function () { + if (this.context.strict && this.matchKeyword('function')) { + this.tolerateError(messages_1.Messages.StrictFunction); + } + return this.parseStatement(); + }; + Parser.prototype.parseIfStatement = function () { + var node = this.createNode(); + var consequent; + var alternate = null; + this.expectKeyword('if'); + this.expect('('); + var test = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + consequent = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + consequent = this.parseIfClause(); + if (this.matchKeyword('else')) { + this.nextToken(); + alternate = this.parseIfClause(); + } + } + return this.finalize(node, new Node.IfStatement(test, consequent, alternate)); + }; + // https://tc39.github.io/ecma262/#sec-do-while-statement + Parser.prototype.parseDoWhileStatement = function () { + var node = this.createNode(); + this.expectKeyword('do'); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + var body = this.parseStatement(); + this.context.inIteration = previousInIteration; + this.expectKeyword('while'); + this.expect('('); + var test = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + } + else { + this.expect(')'); + if (this.match(';')) { + this.nextToken(); + } + } + return this.finalize(node, new Node.DoWhileStatement(body, test)); + }; + // https://tc39.github.io/ecma262/#sec-while-statement + Parser.prototype.parseWhileStatement = function () { + var node = this.createNode(); + var body; + this.expectKeyword('while'); + this.expect('('); + var test = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + body = this.parseStatement(); + this.context.inIteration = previousInIteration; + } + return this.finalize(node, new Node.WhileStatement(test, body)); + }; + // https://tc39.github.io/ecma262/#sec-for-statement + // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements + Parser.prototype.parseForStatement = function () { + var init = null; + var test = null; + var update = null; + var forIn = true; + var left, right; + var node = this.createNode(); + this.expectKeyword('for'); + this.expect('('); + if (this.match(';')) { + this.nextToken(); + } + else { + if (this.matchKeyword('var')) { + init = this.createNode(); + this.nextToken(); + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + var declarations = this.parseVariableDeclarationList({ inFor: true }); + this.context.allowIn = previousAllowIn; + if (declarations.length === 1 && this.matchKeyword('in')) { + var decl = declarations[0]; + if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) { + this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in'); + } + init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); + this.nextToken(); + left = init; + right = this.parseExpression(); + init = null; + } + else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { + init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); + this.nextToken(); + left = init; + right = this.parseAssignmentExpression(); + init = null; + forIn = false; + } + else { + init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); + this.expect(';'); + } + } + else if (this.matchKeyword('const') || this.matchKeyword('let')) { + init = this.createNode(); + var kind = this.nextToken().value; + if (!this.context.strict && this.lookahead.value === 'in') { + init = this.finalize(init, new Node.Identifier(kind)); + this.nextToken(); + left = init; + right = this.parseExpression(); + init = null; + } + else { + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + var declarations = this.parseBindingList(kind, { inFor: true }); + this.context.allowIn = previousAllowIn; + if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) { + init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + this.nextToken(); + left = init; + right = this.parseExpression(); + init = null; + } + else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { + init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + this.nextToken(); + left = init; + right = this.parseAssignmentExpression(); + init = null; + forIn = false; + } + else { + this.consumeSemicolon(); + init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); + } + } + } + else { + var initStartToken = this.lookahead; + var previousAllowIn = this.context.allowIn; + this.context.allowIn = false; + init = this.inheritCoverGrammar(this.parseAssignmentExpression); + this.context.allowIn = previousAllowIn; + if (this.matchKeyword('in')) { + if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { + this.tolerateError(messages_1.Messages.InvalidLHSInForIn); + } + this.nextToken(); + this.reinterpretExpressionAsPattern(init); + left = init; + right = this.parseExpression(); + init = null; + } + else if (this.matchContextualKeyword('of')) { + if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { + this.tolerateError(messages_1.Messages.InvalidLHSInForLoop); + } + this.nextToken(); + this.reinterpretExpressionAsPattern(init); + left = init; + right = this.parseAssignmentExpression(); + init = null; + forIn = false; + } + else { + if (this.match(',')) { + var initSeq = [init]; + while (this.match(',')) { + this.nextToken(); + initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); + } + init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq)); + } + this.expect(';'); + } + } + } + if (typeof left === 'undefined') { + if (!this.match(';')) { + test = this.parseExpression(); + } + this.expect(';'); + if (!this.match(')')) { + update = this.parseExpression(); + } + } + var body; + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + var previousInIteration = this.context.inIteration; + this.context.inIteration = true; + body = this.isolateCoverGrammar(this.parseStatement); + this.context.inIteration = previousInIteration; + } + return (typeof left === 'undefined') ? + this.finalize(node, new Node.ForStatement(init, test, update, body)) : + forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : + this.finalize(node, new Node.ForOfStatement(left, right, body)); + }; + // https://tc39.github.io/ecma262/#sec-continue-statement + Parser.prototype.parseContinueStatement = function () { + var node = this.createNode(); + this.expectKeyword('continue'); + var label = null; + if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { + var id = this.parseVariableIdentifier(); + label = id; + var key = '$' + id.name; + if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.UnknownLabel, id.name); + } + } + this.consumeSemicolon(); + if (label === null && !this.context.inIteration) { + this.throwError(messages_1.Messages.IllegalContinue); + } + return this.finalize(node, new Node.ContinueStatement(label)); + }; + // https://tc39.github.io/ecma262/#sec-break-statement + Parser.prototype.parseBreakStatement = function () { + var node = this.createNode(); + this.expectKeyword('break'); + var label = null; + if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { + var id = this.parseVariableIdentifier(); + var key = '$' + id.name; + if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.UnknownLabel, id.name); + } + label = id; + } + this.consumeSemicolon(); + if (label === null && !this.context.inIteration && !this.context.inSwitch) { + this.throwError(messages_1.Messages.IllegalBreak); + } + return this.finalize(node, new Node.BreakStatement(label)); + }; + // https://tc39.github.io/ecma262/#sec-return-statement + Parser.prototype.parseReturnStatement = function () { + if (!this.context.inFunctionBody) { + this.tolerateError(messages_1.Messages.IllegalReturn); + } + var node = this.createNode(); + this.expectKeyword('return'); + var hasArgument = (!this.match(';') && !this.match('}') && + !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */) || + this.lookahead.type === 8 /* StringLiteral */ || + this.lookahead.type === 10 /* Template */; + var argument = hasArgument ? this.parseExpression() : null; + this.consumeSemicolon(); + return this.finalize(node, new Node.ReturnStatement(argument)); + }; + // https://tc39.github.io/ecma262/#sec-with-statement + Parser.prototype.parseWithStatement = function () { + if (this.context.strict) { + this.tolerateError(messages_1.Messages.StrictModeWith); + } + var node = this.createNode(); + var body; + this.expectKeyword('with'); + this.expect('('); + var object = this.parseExpression(); + if (!this.match(')') && this.config.tolerant) { + this.tolerateUnexpectedToken(this.nextToken()); + body = this.finalize(this.createNode(), new Node.EmptyStatement()); + } + else { + this.expect(')'); + body = this.parseStatement(); + } + return this.finalize(node, new Node.WithStatement(object, body)); + }; + // https://tc39.github.io/ecma262/#sec-switch-statement + Parser.prototype.parseSwitchCase = function () { + var node = this.createNode(); + var test; + if (this.matchKeyword('default')) { + this.nextToken(); + test = null; + } + else { + this.expectKeyword('case'); + test = this.parseExpression(); + } + this.expect(':'); + var consequent = []; + while (true) { + if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) { + break; + } + consequent.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.SwitchCase(test, consequent)); + }; + Parser.prototype.parseSwitchStatement = function () { + var node = this.createNode(); + this.expectKeyword('switch'); + this.expect('('); + var discriminant = this.parseExpression(); + this.expect(')'); + var previousInSwitch = this.context.inSwitch; + this.context.inSwitch = true; + var cases = []; + var defaultFound = false; + this.expect('{'); + while (true) { + if (this.match('}')) { + break; + } + var clause = this.parseSwitchCase(); + if (clause.test === null) { + if (defaultFound) { + this.throwError(messages_1.Messages.MultipleDefaultsInSwitch); + } + defaultFound = true; + } + cases.push(clause); + } + this.expect('}'); + this.context.inSwitch = previousInSwitch; + return this.finalize(node, new Node.SwitchStatement(discriminant, cases)); + }; + // https://tc39.github.io/ecma262/#sec-labelled-statements + Parser.prototype.parseLabelledStatement = function () { + var node = this.createNode(); + var expr = this.parseExpression(); + var statement; + if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) { + this.nextToken(); + var id = expr; + var key = '$' + id.name; + if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { + this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name); + } + this.context.labelSet[key] = true; + var body = void 0; + if (this.matchKeyword('class')) { + this.tolerateUnexpectedToken(this.lookahead); + body = this.parseClassDeclaration(); + } + else if (this.matchKeyword('function')) { + var token = this.lookahead; + var declaration = this.parseFunctionDeclaration(); + if (this.context.strict) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction); + } + else if (declaration.generator) { + this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext); + } + body = declaration; + } + else { + body = this.parseStatement(); + } + delete this.context.labelSet[key]; + statement = new Node.LabeledStatement(id, body); + } + else { + this.consumeSemicolon(); + statement = new Node.ExpressionStatement(expr); + } + return this.finalize(node, statement); + }; + // https://tc39.github.io/ecma262/#sec-throw-statement + Parser.prototype.parseThrowStatement = function () { + var node = this.createNode(); + this.expectKeyword('throw'); + if (this.hasLineTerminator) { + this.throwError(messages_1.Messages.NewlineAfterThrow); + } + var argument = this.parseExpression(); + this.consumeSemicolon(); + return this.finalize(node, new Node.ThrowStatement(argument)); + }; + // https://tc39.github.io/ecma262/#sec-try-statement + Parser.prototype.parseCatchClause = function () { + var node = this.createNode(); + this.expectKeyword('catch'); + this.expect('('); + if (this.match(')')) { + this.throwUnexpectedToken(this.lookahead); + } + var params = []; + var param = this.parsePattern(params); + var paramMap = {}; + for (var i = 0; i < params.length; i++) { + var key = '$' + params[i].value; + if (Object.prototype.hasOwnProperty.call(paramMap, key)) { + this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value); + } + paramMap[key] = true; + } + if (this.context.strict && param.type === syntax_1.Syntax.Identifier) { + if (this.scanner.isRestrictedWord(param.name)) { + this.tolerateError(messages_1.Messages.StrictCatchVariable); + } + } + this.expect(')'); + var body = this.parseBlock(); + return this.finalize(node, new Node.CatchClause(param, body)); + }; + Parser.prototype.parseFinallyClause = function () { + this.expectKeyword('finally'); + return this.parseBlock(); + }; + Parser.prototype.parseTryStatement = function () { + var node = this.createNode(); + this.expectKeyword('try'); + var block = this.parseBlock(); + var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null; + var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null; + if (!handler && !finalizer) { + this.throwError(messages_1.Messages.NoCatchOrFinally); + } + return this.finalize(node, new Node.TryStatement(block, handler, finalizer)); + }; + // https://tc39.github.io/ecma262/#sec-debugger-statement + Parser.prototype.parseDebuggerStatement = function () { + var node = this.createNode(); + this.expectKeyword('debugger'); + this.consumeSemicolon(); + return this.finalize(node, new Node.DebuggerStatement()); + }; + // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations + Parser.prototype.parseStatement = function () { + var statement; + switch (this.lookahead.type) { + case 1 /* BooleanLiteral */: + case 5 /* NullLiteral */: + case 6 /* NumericLiteral */: + case 8 /* StringLiteral */: + case 10 /* Template */: + case 9 /* RegularExpression */: + statement = this.parseExpressionStatement(); + break; + case 7 /* Punctuator */: + var value = this.lookahead.value; + if (value === '{') { + statement = this.parseBlock(); + } + else if (value === '(') { + statement = this.parseExpressionStatement(); + } + else if (value === ';') { + statement = this.parseEmptyStatement(); + } + else { + statement = this.parseExpressionStatement(); + } + break; + case 3 /* Identifier */: + statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement(); + break; + case 4 /* Keyword */: + switch (this.lookahead.value) { + case 'break': + statement = this.parseBreakStatement(); + break; + case 'continue': + statement = this.parseContinueStatement(); + break; + case 'debugger': + statement = this.parseDebuggerStatement(); + break; + case 'do': + statement = this.parseDoWhileStatement(); + break; + case 'for': + statement = this.parseForStatement(); + break; + case 'function': + statement = this.parseFunctionDeclaration(); + break; + case 'if': + statement = this.parseIfStatement(); + break; + case 'return': + statement = this.parseReturnStatement(); + break; + case 'switch': + statement = this.parseSwitchStatement(); + break; + case 'throw': + statement = this.parseThrowStatement(); + break; + case 'try': + statement = this.parseTryStatement(); + break; + case 'var': + statement = this.parseVariableStatement(); + break; + case 'while': + statement = this.parseWhileStatement(); + break; + case 'with': + statement = this.parseWithStatement(); + break; + default: + statement = this.parseExpressionStatement(); + break; + } + break; + default: + statement = this.throwUnexpectedToken(this.lookahead); + } + return statement; + }; + // https://tc39.github.io/ecma262/#sec-function-definitions + Parser.prototype.parseFunctionSourceElements = function () { + var node = this.createNode(); + this.expect('{'); + var body = this.parseDirectivePrologues(); + var previousLabelSet = this.context.labelSet; + var previousInIteration = this.context.inIteration; + var previousInSwitch = this.context.inSwitch; + var previousInFunctionBody = this.context.inFunctionBody; + this.context.labelSet = {}; + this.context.inIteration = false; + this.context.inSwitch = false; + this.context.inFunctionBody = true; + while (this.lookahead.type !== 2 /* EOF */) { + if (this.match('}')) { + break; + } + body.push(this.parseStatementListItem()); + } + this.expect('}'); + this.context.labelSet = previousLabelSet; + this.context.inIteration = previousInIteration; + this.context.inSwitch = previousInSwitch; + this.context.inFunctionBody = previousInFunctionBody; + return this.finalize(node, new Node.BlockStatement(body)); + }; + Parser.prototype.validateParam = function (options, param, name) { + var key = '$' + name; + if (this.context.strict) { + if (this.scanner.isRestrictedWord(name)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamName; + } + if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamDupe; + } + } + else if (!options.firstRestricted) { + if (this.scanner.isRestrictedWord(name)) { + options.firstRestricted = param; + options.message = messages_1.Messages.StrictParamName; + } + else if (this.scanner.isStrictModeReservedWord(name)) { + options.firstRestricted = param; + options.message = messages_1.Messages.StrictReservedWord; + } + else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { + options.stricted = param; + options.message = messages_1.Messages.StrictParamDupe; + } + } + /* istanbul ignore next */ + if (typeof Object.defineProperty === 'function') { + Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true }); + } + else { + options.paramSet[key] = true; + } + }; + Parser.prototype.parseRestElement = function (params) { + var node = this.createNode(); + this.expect('...'); + var arg = this.parsePattern(params); + if (this.match('=')) { + this.throwError(messages_1.Messages.DefaultRestParameter); + } + if (!this.match(')')) { + this.throwError(messages_1.Messages.ParameterAfterRestParameter); + } + return this.finalize(node, new Node.RestElement(arg)); + }; + Parser.prototype.parseFormalParameter = function (options) { + var params = []; + var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params); + for (var i = 0; i < params.length; i++) { + this.validateParam(options, params[i], params[i].value); + } + options.simple = options.simple && (param instanceof Node.Identifier); + options.params.push(param); + }; + Parser.prototype.parseFormalParameters = function (firstRestricted) { + var options; + options = { + simple: true, + params: [], + firstRestricted: firstRestricted + }; + this.expect('('); + if (!this.match(')')) { + options.paramSet = {}; + while (this.lookahead.type !== 2 /* EOF */) { + this.parseFormalParameter(options); + if (this.match(')')) { + break; + } + this.expect(','); + if (this.match(')')) { + break; + } + } + } + this.expect(')'); + return { + simple: options.simple, + params: options.params, + stricted: options.stricted, + firstRestricted: options.firstRestricted, + message: options.message + }; + }; + Parser.prototype.matchAsyncFunction = function () { + var match = this.matchContextualKeyword('async'); + if (match) { + var state = this.scanner.saveState(); + this.scanner.scanComments(); + var next = this.scanner.lex(); + this.scanner.restoreState(state); + match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function'); + } + return match; + }; + Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) { + var node = this.createNode(); + var isAsync = this.matchContextualKeyword('async'); + if (isAsync) { + this.nextToken(); + } + this.expectKeyword('function'); + var isGenerator = isAsync ? false : this.match('*'); + if (isGenerator) { + this.nextToken(); + } + var message; + var id = null; + var firstRestricted = null; + if (!identifierIsOptional || !this.match('(')) { + var token = this.lookahead; + id = this.parseVariableIdentifier(); + if (this.context.strict) { + if (this.scanner.isRestrictedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); + } + } + else { + if (this.scanner.isRestrictedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictFunctionName; + } + else if (this.scanner.isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictReservedWord; + } + } + } + var previousAllowAwait = this.context.await; + var previousAllowYield = this.context.allowYield; + this.context.await = isAsync; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(firstRestricted); + var params = formalParameters.params; + var stricted = formalParameters.stricted; + firstRestricted = formalParameters.firstRestricted; + if (formalParameters.message) { + message = formalParameters.message; + } + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = formalParameters.simple; + var body = this.parseFunctionSourceElements(); + if (this.context.strict && firstRestricted) { + this.throwUnexpectedToken(firstRestricted, message); + } + if (this.context.strict && stricted) { + this.tolerateUnexpectedToken(stricted, message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.await = previousAllowAwait; + this.context.allowYield = previousAllowYield; + return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : + this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator)); + }; + Parser.prototype.parseFunctionExpression = function () { + var node = this.createNode(); + var isAsync = this.matchContextualKeyword('async'); + if (isAsync) { + this.nextToken(); + } + this.expectKeyword('function'); + var isGenerator = isAsync ? false : this.match('*'); + if (isGenerator) { + this.nextToken(); + } + var message; + var id = null; + var firstRestricted; + var previousAllowAwait = this.context.await; + var previousAllowYield = this.context.allowYield; + this.context.await = isAsync; + this.context.allowYield = !isGenerator; + if (!this.match('(')) { + var token = this.lookahead; + id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier(); + if (this.context.strict) { + if (this.scanner.isRestrictedWord(token.value)) { + this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); + } + } + else { + if (this.scanner.isRestrictedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictFunctionName; + } + else if (this.scanner.isStrictModeReservedWord(token.value)) { + firstRestricted = token; + message = messages_1.Messages.StrictReservedWord; + } + } + } + var formalParameters = this.parseFormalParameters(firstRestricted); + var params = formalParameters.params; + var stricted = formalParameters.stricted; + firstRestricted = formalParameters.firstRestricted; + if (formalParameters.message) { + message = formalParameters.message; + } + var previousStrict = this.context.strict; + var previousAllowStrictDirective = this.context.allowStrictDirective; + this.context.allowStrictDirective = formalParameters.simple; + var body = this.parseFunctionSourceElements(); + if (this.context.strict && firstRestricted) { + this.throwUnexpectedToken(firstRestricted, message); + } + if (this.context.strict && stricted) { + this.tolerateUnexpectedToken(stricted, message); + } + this.context.strict = previousStrict; + this.context.allowStrictDirective = previousAllowStrictDirective; + this.context.await = previousAllowAwait; + this.context.allowYield = previousAllowYield; + return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : + this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator)); + }; + // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive + Parser.prototype.parseDirective = function () { + var token = this.lookahead; + var node = this.createNode(); + var expr = this.parseExpression(); + var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null; + this.consumeSemicolon(); + return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr)); + }; + Parser.prototype.parseDirectivePrologues = function () { + var firstRestricted = null; + var body = []; + while (true) { + var token = this.lookahead; + if (token.type !== 8 /* StringLiteral */) { + break; + } + var statement = this.parseDirective(); + body.push(statement); + var directive = statement.directive; + if (typeof directive !== 'string') { + break; + } + if (directive === 'use strict') { + this.context.strict = true; + if (firstRestricted) { + this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral); + } + if (!this.context.allowStrictDirective) { + this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective); + } + } + else { + if (!firstRestricted && token.octal) { + firstRestricted = token; + } + } + } + return body; + }; + // https://tc39.github.io/ecma262/#sec-method-definitions + Parser.prototype.qualifiedPropertyName = function (token) { + switch (token.type) { + case 3 /* Identifier */: + case 8 /* StringLiteral */: + case 1 /* BooleanLiteral */: + case 5 /* NullLiteral */: + case 6 /* NumericLiteral */: + case 4 /* Keyword */: + return true; + case 7 /* Punctuator */: + return token.value === '['; + default: + break; + } + return false; + }; + Parser.prototype.parseGetterMethod = function () { + var node = this.createNode(); + var isGenerator = false; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(); + if (formalParameters.params.length > 0) { + this.tolerateError(messages_1.Messages.BadGetterArity); + } + var method = this.parsePropertyMethod(formalParameters); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); + }; + Parser.prototype.parseSetterMethod = function () { + var node = this.createNode(); + var isGenerator = false; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = !isGenerator; + var formalParameters = this.parseFormalParameters(); + if (formalParameters.params.length !== 1) { + this.tolerateError(messages_1.Messages.BadSetterArity); + } + else if (formalParameters.params[0] instanceof Node.RestElement) { + this.tolerateError(messages_1.Messages.BadSetterRestParameter); + } + var method = this.parsePropertyMethod(formalParameters); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); + }; + Parser.prototype.parseGeneratorMethod = function () { + var node = this.createNode(); + var isGenerator = true; + var previousAllowYield = this.context.allowYield; + this.context.allowYield = true; + var params = this.parseFormalParameters(); + this.context.allowYield = false; + var method = this.parsePropertyMethod(params); + this.context.allowYield = previousAllowYield; + return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); + }; + // https://tc39.github.io/ecma262/#sec-generator-function-definitions + Parser.prototype.isStartOfExpression = function () { + var start = true; + var value = this.lookahead.value; + switch (this.lookahead.type) { + case 7 /* Punctuator */: + start = (value === '[') || (value === '(') || (value === '{') || + (value === '+') || (value === '-') || + (value === '!') || (value === '~') || + (value === '++') || (value === '--') || + (value === '/') || (value === '/='); // regular expression literal + break; + case 4 /* Keyword */: + start = (value === 'class') || (value === 'delete') || + (value === 'function') || (value === 'let') || (value === 'new') || + (value === 'super') || (value === 'this') || (value === 'typeof') || + (value === 'void') || (value === 'yield'); + break; + default: + break; + } + return start; + }; + Parser.prototype.parseYieldExpression = function () { + var node = this.createNode(); + this.expectKeyword('yield'); + var argument = null; + var delegate = false; + if (!this.hasLineTerminator) { + var previousAllowYield = this.context.allowYield; + this.context.allowYield = false; + delegate = this.match('*'); + if (delegate) { + this.nextToken(); + argument = this.parseAssignmentExpression(); + } + else if (this.isStartOfExpression()) { + argument = this.parseAssignmentExpression(); + } + this.context.allowYield = previousAllowYield; + } + return this.finalize(node, new Node.YieldExpression(argument, delegate)); + }; + // https://tc39.github.io/ecma262/#sec-class-definitions + Parser.prototype.parseClassElement = function (hasConstructor) { + var token = this.lookahead; + var node = this.createNode(); + var kind = ''; + var key = null; + var value = null; + var computed = false; + var method = false; + var isStatic = false; + var isAsync = false; + if (this.match('*')) { + this.nextToken(); + } + else { + computed = this.match('['); + key = this.parseObjectPropertyKey(); + var id = key; + if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) { + token = this.lookahead; + isStatic = true; + computed = this.match('['); + if (this.match('*')) { + this.nextToken(); + } + else { + key = this.parseObjectPropertyKey(); + } + } + if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) { + var punctuator = this.lookahead.value; + if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') { + isAsync = true; + token = this.lookahead; + key = this.parseObjectPropertyKey(); + if (token.type === 3 /* Identifier */ && token.value === 'constructor') { + this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync); + } + } + } + } + var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); + if (token.type === 3 /* Identifier */) { + if (token.value === 'get' && lookaheadPropertyKey) { + kind = 'get'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + this.context.allowYield = false; + value = this.parseGetterMethod(); + } + else if (token.value === 'set' && lookaheadPropertyKey) { + kind = 'set'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseSetterMethod(); + } + } + else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { + kind = 'init'; + computed = this.match('['); + key = this.parseObjectPropertyKey(); + value = this.parseGeneratorMethod(); + method = true; + } + if (!kind && key && this.match('(')) { + kind = 'init'; + value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); + method = true; + } + if (!kind) { + this.throwUnexpectedToken(this.lookahead); + } + if (kind === 'init') { + kind = 'method'; + } + if (!computed) { + if (isStatic && this.isPropertyKey(key, 'prototype')) { + this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype); + } + if (!isStatic && this.isPropertyKey(key, 'constructor')) { + if (kind !== 'method' || !method || (value && value.generator)) { + this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod); + } + if (hasConstructor.value) { + this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor); + } + else { + hasConstructor.value = true; + } + kind = 'constructor'; + } + } + return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic)); + }; + Parser.prototype.parseClassElementList = function () { + var body = []; + var hasConstructor = { value: false }; + this.expect('{'); + while (!this.match('}')) { + if (this.match(';')) { + this.nextToken(); + } + else { + body.push(this.parseClassElement(hasConstructor)); + } + } + this.expect('}'); + return body; + }; + Parser.prototype.parseClassBody = function () { + var node = this.createNode(); + var elementList = this.parseClassElementList(); + return this.finalize(node, new Node.ClassBody(elementList)); + }; + Parser.prototype.parseClassDeclaration = function (identifierIsOptional) { + var node = this.createNode(); + var previousStrict = this.context.strict; + this.context.strict = true; + this.expectKeyword('class'); + var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier(); + var superClass = null; + if (this.matchKeyword('extends')) { + this.nextToken(); + superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + } + var classBody = this.parseClassBody(); + this.context.strict = previousStrict; + return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); + }; + Parser.prototype.parseClassExpression = function () { + var node = this.createNode(); + var previousStrict = this.context.strict; + this.context.strict = true; + this.expectKeyword('class'); + var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null; + var superClass = null; + if (this.matchKeyword('extends')) { + this.nextToken(); + superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); + } + var classBody = this.parseClassBody(); + this.context.strict = previousStrict; + return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); + }; + // https://tc39.github.io/ecma262/#sec-scripts + // https://tc39.github.io/ecma262/#sec-modules + Parser.prototype.parseModule = function () { + this.context.strict = true; + this.context.isModule = true; + this.scanner.isModule = true; + var node = this.createNode(); + var body = this.parseDirectivePrologues(); + while (this.lookahead.type !== 2 /* EOF */) { + body.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.Module(body)); + }; + Parser.prototype.parseScript = function () { + var node = this.createNode(); + var body = this.parseDirectivePrologues(); + while (this.lookahead.type !== 2 /* EOF */) { + body.push(this.parseStatementListItem()); + } + return this.finalize(node, new Node.Script(body)); + }; + // https://tc39.github.io/ecma262/#sec-imports + Parser.prototype.parseModuleSpecifier = function () { + var node = this.createNode(); + if (this.lookahead.type !== 8 /* StringLiteral */) { + this.throwError(messages_1.Messages.InvalidModuleSpecifier); + } + var token = this.nextToken(); + var raw = this.getTokenRaw(token); + return this.finalize(node, new Node.Literal(token.value, raw)); + }; + // import {} ...; + Parser.prototype.parseImportSpecifier = function () { + var node = this.createNode(); + var imported; + var local; + if (this.lookahead.type === 3 /* Identifier */) { + imported = this.parseVariableIdentifier(); + local = imported; + if (this.matchContextualKeyword('as')) { + this.nextToken(); + local = this.parseVariableIdentifier(); + } + } + else { + imported = this.parseIdentifierName(); + local = imported; + if (this.matchContextualKeyword('as')) { + this.nextToken(); + local = this.parseVariableIdentifier(); + } + else { + this.throwUnexpectedToken(this.nextToken()); + } + } + return this.finalize(node, new Node.ImportSpecifier(local, imported)); + }; + // {foo, bar as bas} + Parser.prototype.parseNamedImports = function () { + this.expect('{'); + var specifiers = []; + while (!this.match('}')) { + specifiers.push(this.parseImportSpecifier()); + if (!this.match('}')) { + this.expect(','); + } + } + this.expect('}'); + return specifiers; + }; + // import ...; + Parser.prototype.parseImportDefaultSpecifier = function () { + var node = this.createNode(); + var local = this.parseIdentifierName(); + return this.finalize(node, new Node.ImportDefaultSpecifier(local)); + }; + // import <* as foo> ...; + Parser.prototype.parseImportNamespaceSpecifier = function () { + var node = this.createNode(); + this.expect('*'); + if (!this.matchContextualKeyword('as')) { + this.throwError(messages_1.Messages.NoAsAfterImportNamespace); + } + this.nextToken(); + var local = this.parseIdentifierName(); + return this.finalize(node, new Node.ImportNamespaceSpecifier(local)); + }; + Parser.prototype.parseImportDeclaration = function () { + if (this.context.inFunctionBody) { + this.throwError(messages_1.Messages.IllegalImportDeclaration); + } + var node = this.createNode(); + this.expectKeyword('import'); + var src; + var specifiers = []; + if (this.lookahead.type === 8 /* StringLiteral */) { + // import 'foo'; + src = this.parseModuleSpecifier(); + } + else { + if (this.match('{')) { + // import {bar} + specifiers = specifiers.concat(this.parseNamedImports()); + } + else if (this.match('*')) { + // import * as foo + specifiers.push(this.parseImportNamespaceSpecifier()); + } + else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) { + // import foo + specifiers.push(this.parseImportDefaultSpecifier()); + if (this.match(',')) { + this.nextToken(); + if (this.match('*')) { + // import foo, * as foo + specifiers.push(this.parseImportNamespaceSpecifier()); + } + else if (this.match('{')) { + // import foo, {bar} + specifiers = specifiers.concat(this.parseNamedImports()); + } + else { + this.throwUnexpectedToken(this.lookahead); + } + } + } + else { + this.throwUnexpectedToken(this.nextToken()); + } + if (!this.matchContextualKeyword('from')) { + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + this.nextToken(); + src = this.parseModuleSpecifier(); + } + this.consumeSemicolon(); + return this.finalize(node, new Node.ImportDeclaration(specifiers, src)); + }; + // https://tc39.github.io/ecma262/#sec-exports + Parser.prototype.parseExportSpecifier = function () { + var node = this.createNode(); + var local = this.parseIdentifierName(); + var exported = local; + if (this.matchContextualKeyword('as')) { + this.nextToken(); + exported = this.parseIdentifierName(); + } + return this.finalize(node, new Node.ExportSpecifier(local, exported)); + }; + Parser.prototype.parseExportDeclaration = function () { + if (this.context.inFunctionBody) { + this.throwError(messages_1.Messages.IllegalExportDeclaration); + } + var node = this.createNode(); + this.expectKeyword('export'); + var exportDeclaration; + if (this.matchKeyword('default')) { + // export default ... + this.nextToken(); + if (this.matchKeyword('function')) { + // export default function foo () {} + // export default function () {} + var declaration = this.parseFunctionDeclaration(true); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + else if (this.matchKeyword('class')) { + // export default class foo {} + var declaration = this.parseClassDeclaration(true); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + else if (this.matchContextualKeyword('async')) { + // export default async function f () {} + // export default async function () {} + // export default async x => x + var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression(); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + else { + if (this.matchContextualKeyword('from')) { + this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value); + } + // export default {}; + // export default []; + // export default (1 + 2); + var declaration = this.match('{') ? this.parseObjectInitializer() : + this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression(); + this.consumeSemicolon(); + exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); + } + } + else if (this.match('*')) { + // export * from 'foo'; + this.nextToken(); + if (!this.matchContextualKeyword('from')) { + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + this.nextToken(); + var src = this.parseModuleSpecifier(); + this.consumeSemicolon(); + exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src)); + } + else if (this.lookahead.type === 4 /* Keyword */) { + // export var f = 1; + var declaration = void 0; + switch (this.lookahead.value) { + case 'let': + case 'const': + declaration = this.parseLexicalDeclaration({ inFor: false }); + break; + case 'var': + case 'class': + case 'function': + declaration = this.parseStatementListItem(); + break; + default: + this.throwUnexpectedToken(this.lookahead); + } + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + } + else if (this.matchAsyncFunction()) { + var declaration = this.parseFunctionDeclaration(); + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); + } + else { + var specifiers = []; + var source = null; + var isExportFromIdentifier = false; + this.expect('{'); + while (!this.match('}')) { + isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default'); + specifiers.push(this.parseExportSpecifier()); + if (!this.match('}')) { + this.expect(','); + } + } + this.expect('}'); + if (this.matchContextualKeyword('from')) { + // export {default} from 'foo'; + // export {foo} from 'foo'; + this.nextToken(); + source = this.parseModuleSpecifier(); + this.consumeSemicolon(); + } + else if (isExportFromIdentifier) { + // export {default}; // missing fromClause + var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; + this.throwError(message, this.lookahead.value); + } + else { + // export {foo}; + this.consumeSemicolon(); + } + exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source)); + } + return exportDeclaration; + }; + return Parser; + }()); + exports.Parser = Parser; + + +/***/ }, +/* 9 */ +/***/ function(module, exports) { + + "use strict"; + // Ensure the condition is true, otherwise throw an error. + // This is only to have a better contract semantic, i.e. another safety net + // to catch a logic error. The condition shall be fulfilled in normal case. + // Do NOT use this to enforce a certain condition on any user input. + Object.defineProperty(exports, "__esModule", { value: true }); + function assert(condition, message) { + /* istanbul ignore if */ + if (!condition) { + throw new Error('ASSERT: ' + message); + } + } + exports.assert = assert; + + +/***/ }, +/* 10 */ +/***/ function(module, exports) { + + "use strict"; + /* tslint:disable:max-classes-per-file */ + Object.defineProperty(exports, "__esModule", { value: true }); + var ErrorHandler = (function () { + function ErrorHandler() { + this.errors = []; + this.tolerant = false; + } + ErrorHandler.prototype.recordError = function (error) { + this.errors.push(error); + }; + ErrorHandler.prototype.tolerate = function (error) { + if (this.tolerant) { + this.recordError(error); + } + else { + throw error; + } + }; + ErrorHandler.prototype.constructError = function (msg, column) { + var error = new Error(msg); + try { + throw error; + } + catch (base) { + /* istanbul ignore else */ + if (Object.create && Object.defineProperty) { + error = Object.create(base); + Object.defineProperty(error, 'column', { value: column }); + } + } + /* istanbul ignore next */ + return error; + }; + ErrorHandler.prototype.createError = function (index, line, col, description) { + var msg = 'Line ' + line + ': ' + description; + var error = this.constructError(msg, col); + error.index = index; + error.lineNumber = line; + error.description = description; + return error; + }; + ErrorHandler.prototype.throwError = function (index, line, col, description) { + throw this.createError(index, line, col, description); + }; + ErrorHandler.prototype.tolerateError = function (index, line, col, description) { + var error = this.createError(index, line, col, description); + if (this.tolerant) { + this.recordError(error); + } + else { + throw error; + } + }; + return ErrorHandler; + }()); + exports.ErrorHandler = ErrorHandler; + + +/***/ }, +/* 11 */ +/***/ function(module, exports) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + // Error messages should be identical to V8. + exports.Messages = { + BadGetterArity: 'Getter must not have any formal parameters', + BadSetterArity: 'Setter must have exactly one formal parameter', + BadSetterRestParameter: 'Setter function argument must not be a rest parameter', + ConstructorIsAsync: 'Class constructor may not be an async method', + ConstructorSpecialMethod: 'Class constructor may not be an accessor', + DeclarationMissingInitializer: 'Missing initializer in %0 declaration', + DefaultRestParameter: 'Unexpected token =', + DuplicateBinding: 'Duplicate binding %0', + DuplicateConstructor: 'A class may only have one constructor', + DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals', + ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer', + GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts', + IllegalBreak: 'Illegal break statement', + IllegalContinue: 'Illegal continue statement', + IllegalExportDeclaration: 'Unexpected token', + IllegalImportDeclaration: 'Unexpected token', + IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list', + IllegalReturn: 'Illegal return statement', + InvalidEscapedReservedWord: 'Keyword must not contain escaped characters', + InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence', + InvalidLHSInAssignment: 'Invalid left-hand side in assignment', + InvalidLHSInForIn: 'Invalid left-hand side in for-in', + InvalidLHSInForLoop: 'Invalid left-hand side in for-loop', + InvalidModuleSpecifier: 'Unexpected token', + InvalidRegExp: 'Invalid regular expression', + LetInLexicalBinding: 'let is disallowed as a lexically bound name', + MissingFromClause: 'Unexpected token', + MultipleDefaultsInSwitch: 'More than one default clause in switch statement', + NewlineAfterThrow: 'Illegal newline after throw', + NoAsAfterImportNamespace: 'Unexpected token', + NoCatchOrFinally: 'Missing catch or finally after try', + ParameterAfterRestParameter: 'Rest parameter must be last formal parameter', + Redeclaration: '%0 \'%1\' has already been declared', + StaticPrototype: 'Classes may not have static property named prototype', + StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', + StrictDelete: 'Delete of an unqualified identifier in strict mode.', + StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block', + StrictFunctionName: 'Function name may not be eval or arguments in strict mode', + StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', + StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', + StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', + StrictModeWith: 'Strict mode code may not include a with statement', + StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', + StrictParamDupe: 'Strict mode function may not have duplicate parameter names', + StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', + StrictReservedWord: 'Use of future reserved word in strict mode', + StrictVarName: 'Variable name may not be eval or arguments in strict mode', + TemplateOctalLiteral: 'Octal literals are not allowed in template strings.', + UnexpectedEOS: 'Unexpected end of input', + UnexpectedIdentifier: 'Unexpected identifier', + UnexpectedNumber: 'Unexpected number', + UnexpectedReserved: 'Unexpected reserved word', + UnexpectedString: 'Unexpected string', + UnexpectedTemplate: 'Unexpected quasi %0', + UnexpectedToken: 'Unexpected token %0', + UnexpectedTokenIllegal: 'Unexpected token ILLEGAL', + UnknownLabel: 'Undefined label \'%0\'', + UnterminatedRegExp: 'Invalid regular expression: missing /' + }; + + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var assert_1 = __webpack_require__(9); + var character_1 = __webpack_require__(4); + var messages_1 = __webpack_require__(11); + function hexValue(ch) { + return '0123456789abcdef'.indexOf(ch.toLowerCase()); + } + function octalValue(ch) { + return '01234567'.indexOf(ch); + } + var Scanner = (function () { + function Scanner(code, handler) { + this.source = code; + this.errorHandler = handler; + this.trackComment = false; + this.isModule = false; + this.length = code.length; + this.index = 0; + this.lineNumber = (code.length > 0) ? 1 : 0; + this.lineStart = 0; + this.curlyStack = []; + } + Scanner.prototype.saveState = function () { + return { + index: this.index, + lineNumber: this.lineNumber, + lineStart: this.lineStart + }; + }; + Scanner.prototype.restoreState = function (state) { + this.index = state.index; + this.lineNumber = state.lineNumber; + this.lineStart = state.lineStart; + }; + Scanner.prototype.eof = function () { + return this.index >= this.length; + }; + Scanner.prototype.throwUnexpectedToken = function (message) { + if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } + return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); + }; + Scanner.prototype.tolerateUnexpectedToken = function (message) { + if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } + this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); + }; + // https://tc39.github.io/ecma262/#sec-comments + Scanner.prototype.skipSingleLineComment = function (offset) { + var comments = []; + var start, loc; + if (this.trackComment) { + comments = []; + start = this.index - offset; + loc = { + start: { + line: this.lineNumber, + column: this.index - this.lineStart - offset + }, + end: {} + }; + } + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + ++this.index; + if (character_1.Character.isLineTerminator(ch)) { + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart - 1 + }; + var entry = { + multiLine: false, + slice: [start + offset, this.index - 1], + range: [start, this.index - 1], + loc: loc + }; + comments.push(entry); + } + if (ch === 13 && this.source.charCodeAt(this.index) === 10) { + ++this.index; + } + ++this.lineNumber; + this.lineStart = this.index; + return comments; + } + } + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: false, + slice: [start + offset, this.index], + range: [start, this.index], + loc: loc + }; + comments.push(entry); + } + return comments; + }; + Scanner.prototype.skipMultiLineComment = function () { + var comments = []; + var start, loc; + if (this.trackComment) { + comments = []; + start = this.index - 2; + loc = { + start: { + line: this.lineNumber, + column: this.index - this.lineStart - 2 + }, + end: {} + }; + } + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + if (character_1.Character.isLineTerminator(ch)) { + if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) { + ++this.index; + } + ++this.lineNumber; + ++this.index; + this.lineStart = this.index; + } + else if (ch === 0x2A) { + // Block comment ends with '*/'. + if (this.source.charCodeAt(this.index + 1) === 0x2F) { + this.index += 2; + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: true, + slice: [start + 2, this.index - 2], + range: [start, this.index], + loc: loc + }; + comments.push(entry); + } + return comments; + } + ++this.index; + } + else { + ++this.index; + } + } + // Ran off the end of the file - the whole thing is a comment + if (this.trackComment) { + loc.end = { + line: this.lineNumber, + column: this.index - this.lineStart + }; + var entry = { + multiLine: true, + slice: [start + 2, this.index], + range: [start, this.index], + loc: loc + }; + comments.push(entry); + } + this.tolerateUnexpectedToken(); + return comments; + }; + Scanner.prototype.scanComments = function () { + var comments; + if (this.trackComment) { + comments = []; + } + var start = (this.index === 0); + while (!this.eof()) { + var ch = this.source.charCodeAt(this.index); + if (character_1.Character.isWhiteSpace(ch)) { + ++this.index; + } + else if (character_1.Character.isLineTerminator(ch)) { + ++this.index; + if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) { + ++this.index; + } + ++this.lineNumber; + this.lineStart = this.index; + start = true; + } + else if (ch === 0x2F) { + ch = this.source.charCodeAt(this.index + 1); + if (ch === 0x2F) { + this.index += 2; + var comment = this.skipSingleLineComment(2); + if (this.trackComment) { + comments = comments.concat(comment); + } + start = true; + } + else if (ch === 0x2A) { + this.index += 2; + var comment = this.skipMultiLineComment(); + if (this.trackComment) { + comments = comments.concat(comment); + } + } + else { + break; + } + } + else if (start && ch === 0x2D) { + // U+003E is '>' + if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) { + // '-->' is a single-line comment + this.index += 3; + var comment = this.skipSingleLineComment(3); + if (this.trackComment) { + comments = comments.concat(comment); + } + } + else { + break; + } + } + else if (ch === 0x3C && !this.isModule) { + if (this.source.slice(this.index + 1, this.index + 4) === '!--') { + this.index += 4; // ` {a:{y:1,b:{x:2}}} // use a filter to return the keys that have to be deleted. Object.keys(out).filter(function (k, _, __) { - if (!out[k] || typeof out[k] !== "object" || Array.isArray(out[k])) return false + if (!out[k] || + typeof out[k] !== 'object' || + Array.isArray(out[k])) { + return false + } // see if the parent section is also an object. // if so, add it to that, and mark this one for deletion var parts = dotSplit(k) - , p = out - , l = parts.pop() - , nl = l.replace(/\\\./g, '.') + var p = out + var l = parts.pop() + var nl = l.replace(/\\\./g, '.') parts.forEach(function (part, _, __) { - if (!p[part] || typeof p[part] !== "object") p[part] = {} + if (!p[part] || typeof p[part] !== 'object') p[part] = {} p = p[part] }) - if (p === out && nl === l) return false + if (p === out && nl === l) { + return false + } p[nl] = out[k] return true }).forEach(function (del, _, __) { @@ -99893,64 +115553,66 @@ function decode (str) { } function isQuoted (val) { - return (val.charAt(0) === "\"" && val.slice(-1) === "\"") - || (val.charAt(0) === "'" && val.slice(-1) === "'") + return (val.charAt(0) === '"' && val.slice(-1) === '"') || + (val.charAt(0) === "'" && val.slice(-1) === "'") } function safe (val) { - return ( typeof val !== "string" - || val.match(/[=\r\n]/) - || val.match(/^\[/) - || (val.length > 1 - && isQuoted(val)) - || val !== val.trim() ) - ? JSON.stringify(val) - : val.replace(/;/g, '\\;').replace(/#/g, "\\#") + return (typeof val !== 'string' || + val.match(/[=\r\n]/) || + val.match(/^\[/) || + (val.length > 1 && + isQuoted(val)) || + val !== val.trim()) + ? JSON.stringify(val) + : val.replace(/;/g, '\\;').replace(/#/g, '\\#') } function unsafe (val, doUnesc) { - val = (val || "").trim() + val = (val || '').trim() if (isQuoted(val)) { // remove the single quotes before calling JSON.parse if (val.charAt(0) === "'") { - val = val.substr(1, val.length - 2); + val = val.substr(1, val.length - 2) } try { val = JSON.parse(val) } catch (_) {} } else { // walk the val to find the first not-escaped ; character var esc = false - var unesc = ""; + var unesc = '' for (var i = 0, l = val.length; i < l; i++) { var c = val.charAt(i) if (esc) { - if ("\\;#".indexOf(c) !== -1) + if ('\\;#'.indexOf(c) !== -1) { unesc += c - else - unesc += "\\" + c + } else { + unesc += '\\' + c + } esc = false - } else if (";#".indexOf(c) !== -1) { + } else if (';#'.indexOf(c) !== -1) { break - } else if (c === "\\") { + } else if (c === '\\') { esc = true } else { unesc += c } } - if (esc) - unesc += "\\" - return unesc + if (esc) { + unesc += '\\' + } + return unesc.trim() } return val } /***/ }), -/* 543 */ +/* 685 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _ = __webpack_require__(27); +var _ = __webpack_require__(38); /** * Choice object @@ -99960,42 +115622,44 @@ var _ = __webpack_require__(27); * at least one of `value` or `name` property */ -var Choice = module.exports = function (val, answers) { - // Don't process Choice and Separator object - if (val instanceof Choice || val.type === 'separator') { - return val; - } +module.exports = class Choice { + constructor(val, answers) { + // Don't process Choice and Separator object + if (val instanceof Choice || val.type === 'separator') { + return val; + } - if (_.isString(val)) { - this.name = val; - this.value = val; - this.short = val; - } else { - _.extend(this, val, { - name: val.name || val.value, - value: 'value' in val ? val.value : val.name, - short: val.short || val.name || val.value - }); - } + if (_.isString(val)) { + this.name = val; + this.value = val; + this.short = val; + } else { + _.extend(this, val, { + name: val.name || val.value, + value: 'value' in val ? val.value : val.name, + short: val.short || val.name || val.value + }); + } - if (_.isFunction(val.disabled)) { - this.disabled = val.disabled(answers); - } else { - this.disabled = val.disabled; + if (_.isFunction(val.disabled)) { + this.disabled = val.disabled(answers); + } else { + this.disabled = val.disabled; + } } }; /***/ }), -/* 544 */ +/* 686 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var assert = __webpack_require__(20); -var _ = __webpack_require__(27); -var Separator = __webpack_require__(137); -var Choice = __webpack_require__(543); +var assert = __webpack_require__(28); +var _ = __webpack_require__(38); +var Separator = __webpack_require__(175); +var Choice = __webpack_require__(685); /** * Choices collection @@ -100004,304 +115668,319 @@ var Choice = __webpack_require__(543); * @param {Array} choices All `choice` to keep in the collection */ -var Choices = module.exports = function (choices, answers) { - this.choices = choices.map(function (val) { - if (val.type === 'separator') { - if (!(val instanceof Separator)) { - val = new Separator(val.line); +module.exports = class Choices { + constructor(choices, answers) { + this.choices = choices.map(val => { + if (val.type === 'separator') { + if (!(val instanceof Separator)) { + val = new Separator(val.line); + } + return val; } - return val; - } - return new Choice(val, answers); - }); - - this.realChoices = this.choices - .filter(Separator.exclude) - .filter(function (item) { - return !item.disabled; + return new Choice(val, answers); }); - Object.defineProperty(this, 'length', { - get: function () { - return this.choices.length; - }, - set: function (val) { - this.choices.length = val; - } - }); + this.realChoices = this.choices + .filter(Separator.exclude) + .filter(item => !item.disabled); - Object.defineProperty(this, 'realLength', { - get: function () { - return this.realChoices.length; - }, - set: function () { - throw new Error('Cannot set `realLength` of a Choices collection'); - } - }); -}; + Object.defineProperty(this, 'length', { + get() { + return this.choices.length; + }, + set(val) { + this.choices.length = val; + } + }); -/** - * Get a valid choice from the collection - * @param {Number} selector The selected choice index - * @return {Choice|Undefined} Return the matched choice or undefined - */ + Object.defineProperty(this, 'realLength', { + get() { + return this.realChoices.length; + }, + set() { + throw new Error('Cannot set `realLength` of a Choices collection'); + } + }); + } -Choices.prototype.getChoice = function (selector) { - assert(_.isNumber(selector)); - return this.realChoices[selector]; -}; + /** + * Get a valid choice from the collection + * @param {Number} selector The selected choice index + * @return {Choice|Undefined} Return the matched choice or undefined + */ -/** - * Get a raw element from the collection - * @param {Number} selector The selected index value - * @return {Choice|Undefined} Return the matched choice or undefined - */ + getChoice(selector) { + assert(_.isNumber(selector)); + return this.realChoices[selector]; + } -Choices.prototype.get = function (selector) { - assert(_.isNumber(selector)); - return this.choices[selector]; -}; + /** + * Get a raw element from the collection + * @param {Number} selector The selected index value + * @return {Choice|Undefined} Return the matched choice or undefined + */ -/** - * Match the valid choices against a where clause - * @param {Object} whereClause Lodash `where` clause - * @return {Array} Matching choices or empty array - */ + get(selector) { + assert(_.isNumber(selector)); + return this.choices[selector]; + } -Choices.prototype.where = function (whereClause) { - return _.filter(this.realChoices, whereClause); -}; + /** + * Match the valid choices against a where clause + * @param {Object} whereClause Lodash `where` clause + * @return {Array} Matching choices or empty array + */ -/** - * Pluck a particular key from the choices - * @param {String} propertyName Property name to select - * @return {Array} Selected properties - */ + where(whereClause) { + return _.filter(this.realChoices, whereClause); + } -Choices.prototype.pluck = function (propertyName) { - return _.map(this.realChoices, propertyName); -}; + /** + * Pluck a particular key from the choices + * @param {String} propertyName Property name to select + * @return {Array} Selected properties + */ -// Expose usual Array methods -Choices.prototype.indexOf = function () { - return this.choices.indexOf.apply(this.choices, arguments); -}; -Choices.prototype.forEach = function () { - return this.choices.forEach.apply(this.choices, arguments); -}; -Choices.prototype.filter = function () { - return this.choices.filter.apply(this.choices, arguments); -}; -Choices.prototype.find = function (func) { - return _.find(this.choices, func); -}; -Choices.prototype.push = function () { - var objs = _.map(arguments, function (val) { - return new Choice(val); - }); - this.choices.push.apply(this.choices, objs); - this.realChoices = this.choices.filter(Separator.exclude); - return this.choices; + pluck(propertyName) { + return _.map(this.realChoices, propertyName); + } + + // Expose usual Array methods + indexOf() { + return this.choices.indexOf.apply(this.choices, arguments); + } + + forEach() { + return this.choices.forEach.apply(this.choices, arguments); + } + + filter() { + return this.choices.filter.apply(this.choices, arguments); + } + + find(func) { + return _.find(this.choices, func); + } + + push() { + var objs = _.map(arguments, val => new Choice(val)); + this.choices.push.apply(this.choices, objs); + this.realChoices = this.choices.filter(Separator.exclude); + return this.choices; + } }; /***/ }), -/* 545 */ +/* 687 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + /** * `list` type prompt */ -var _ = __webpack_require__(27); -var util = __webpack_require__(2); -var chalk = __webpack_require__(34); -var cliCursor = __webpack_require__(282); -var figures = __webpack_require__(209); -var Base = __webpack_require__(54); -var observe = __webpack_require__(55); -var Paginator = __webpack_require__(138); +var _ = __webpack_require__(38); +var chalk = __webpack_require__(30); +var cliCursor = __webpack_require__(381); +var figures = __webpack_require__(270); +var { map, takeUntil } = __webpack_require__(63); +var Base = __webpack_require__(79); +var observe = __webpack_require__(80); +var Paginator = __webpack_require__(176); -/** - * Module exports - */ +class CheckboxPrompt extends Base { + constructor(questions, rl, answers) { + super(questions, rl, answers); -module.exports = Prompt; + if (!this.opt.choices) { + this.throwParamError('choices'); + } -/** - * Constructor - */ + if (_.isArray(this.opt.default)) { + this.opt.choices.forEach(function(choice) { + if (this.opt.default.indexOf(choice.value) >= 0) { + choice.checked = true; + } + }, this); + } -function Prompt() { - Base.apply(this, arguments); + this.pointer = 0; + this.firstRender = true; - if (!this.opt.choices) { - this.throwParamError('choices'); + // Make sure no default is set (so it won't be printed) + this.opt.default = null; + + this.paginator = new Paginator(this.screen); } - if (_.isArray(this.opt.default)) { - this.opt.choices.forEach(function (choice) { - if (this.opt.default.indexOf(choice.value) >= 0) { - choice.checked = true; - } - }, this); + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ + + _run(cb) { + this.done = cb; + + var events = observe(this.rl); + + var validation = this.handleSubmitEvents( + events.line.pipe(map(this.getCurrentValue.bind(this))) + ); + validation.success.forEach(this.onEnd.bind(this)); + validation.error.forEach(this.onError.bind(this)); + + events.normalizedUpKey + .pipe(takeUntil(validation.success)) + .forEach(this.onUpKey.bind(this)); + events.normalizedDownKey + .pipe(takeUntil(validation.success)) + .forEach(this.onDownKey.bind(this)); + events.numberKey + .pipe(takeUntil(validation.success)) + .forEach(this.onNumberKey.bind(this)); + events.spaceKey + .pipe(takeUntil(validation.success)) + .forEach(this.onSpaceKey.bind(this)); + events.aKey.pipe(takeUntil(validation.success)).forEach(this.onAllKey.bind(this)); + events.iKey.pipe(takeUntil(validation.success)).forEach(this.onInverseKey.bind(this)); + + // Init the prompt + cliCursor.hide(); + this.render(); + this.firstRender = false; + + return this; } - this.pointer = 0; - this.firstRender = true; + /** + * Render the prompt to screen + * @return {CheckboxPrompt} self + */ - // Make sure no default is set (so it won't be printed) - this.opt.default = null; + render(error) { + // Render question + var message = this.getQuestion(); + var bottomContent = ''; - this.paginator = new Paginator(); -} -util.inherits(Prompt, Base); + if (this.firstRender) { + message += + '(Press ' + + chalk.cyan.bold('') + + ' to select, ' + + chalk.cyan.bold('') + + ' to toggle all, ' + + chalk.cyan.bold('') + + ' to invert selection)'; + } -/** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ + // Render choices or answer depending on the state + if (this.status === 'answered') { + message += chalk.cyan(this.selection.join(', ')); + } else { + var choicesStr = renderChoices(this.opt.choices, this.pointer); + var indexPosition = this.opt.choices.indexOf( + this.opt.choices.getChoice(this.pointer) + ); + message += + '\n' + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize); + } -Prompt.prototype._run = function (cb) { - this.done = cb; + if (error) { + bottomContent = chalk.red('>> ') + error; + } - var events = observe(this.rl); - - var validation = this.handleSubmitEvents( - events.line.map(this.getCurrentValue.bind(this)) - ); - validation.success.forEach(this.onEnd.bind(this)); - validation.error.forEach(this.onError.bind(this)); - - events.normalizedUpKey.takeUntil(validation.success).forEach(this.onUpKey.bind(this)); - events.normalizedDownKey.takeUntil(validation.success).forEach(this.onDownKey.bind(this)); - events.numberKey.takeUntil(validation.success).forEach(this.onNumberKey.bind(this)); - events.spaceKey.takeUntil(validation.success).forEach(this.onSpaceKey.bind(this)); - events.aKey.takeUntil(validation.success).forEach(this.onAllKey.bind(this)); - events.iKey.takeUntil(validation.success).forEach(this.onInverseKey.bind(this)); - - // Init the prompt - cliCursor.hide(); - this.render(); - this.firstRender = false; - - return this; -}; - -/** - * Render the prompt to screen - * @return {Prompt} self - */ - -Prompt.prototype.render = function (error) { - // Render question - var message = this.getQuestion(); - var bottomContent = ''; - - if (this.firstRender) { - message += '(Press ' + chalk.cyan.bold('') + ' to select, ' + chalk.cyan.bold('') + ' to toggle all, ' + chalk.cyan.bold('') + ' to inverse selection)'; + this.screen.render(message, bottomContent); } - // Render choices or answer depending on the state - if (this.status === 'answered') { - message += chalk.cyan(this.selection.join(', ')); - } else { - var choicesStr = renderChoices(this.opt.choices, this.pointer); - var indexPosition = this.opt.choices.indexOf(this.opt.choices.getChoice(this.pointer)); - message += '\n' + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize); + /** + * When user press `enter` key + */ + + onEnd(state) { + this.status = 'answered'; + + // Rerender prompt (and clean subline error) + this.render(); + + this.screen.done(); + cliCursor.show(); + this.done(state.value); } - if (error) { - bottomContent = chalk.red('>> ') + error; + onError(state) { + this.render(state.isValid); } - this.screen.render(message, bottomContent); -}; + getCurrentValue() { + var choices = this.opt.choices.filter(function(choice) { + return Boolean(choice.checked) && !choice.disabled; + }); -/** - * When user press `enter` key - */ + this.selection = _.map(choices, 'short'); + return _.map(choices, 'value'); + } -Prompt.prototype.onEnd = function (state) { - this.status = 'answered'; + onUpKey() { + var len = this.opt.choices.realLength; + this.pointer = this.pointer > 0 ? this.pointer - 1 : len - 1; + this.render(); + } - // Rerender prompt (and clean subline error) - this.render(); + onDownKey() { + var len = this.opt.choices.realLength; + this.pointer = this.pointer < len - 1 ? this.pointer + 1 : 0; + this.render(); + } - this.screen.done(); - cliCursor.show(); - this.done(state.value); -}; + onNumberKey(input) { + if (input <= this.opt.choices.realLength) { + this.pointer = input - 1; + this.toggleChoice(this.pointer); + } + this.render(); + } -Prompt.prototype.onError = function (state) { - this.render(state.isValid); -}; - -Prompt.prototype.getCurrentValue = function () { - var choices = this.opt.choices.filter(function (choice) { - return Boolean(choice.checked) && !choice.disabled; - }); - - this.selection = _.map(choices, 'short'); - return _.map(choices, 'value'); -}; - -Prompt.prototype.onUpKey = function () { - var len = this.opt.choices.realLength; - this.pointer = (this.pointer > 0) ? this.pointer - 1 : len - 1; - this.render(); -}; - -Prompt.prototype.onDownKey = function () { - var len = this.opt.choices.realLength; - this.pointer = (this.pointer < len - 1) ? this.pointer + 1 : 0; - this.render(); -}; - -Prompt.prototype.onNumberKey = function (input) { - if (input <= this.opt.choices.realLength) { - this.pointer = input - 1; + onSpaceKey() { this.toggleChoice(this.pointer); + this.render(); } - this.render(); -}; -Prompt.prototype.onSpaceKey = function () { - this.toggleChoice(this.pointer); - this.render(); -}; + onAllKey() { + var shouldBeChecked = Boolean( + this.opt.choices.find(function(choice) { + return choice.type !== 'separator' && !choice.checked; + }) + ); -Prompt.prototype.onAllKey = function () { - var shouldBeChecked = Boolean(this.opt.choices.find(function (choice) { - return choice.type !== 'separator' && !choice.checked; - })); + this.opt.choices.forEach(function(choice) { + if (choice.type !== 'separator') { + choice.checked = shouldBeChecked; + } + }); - this.opt.choices.forEach(function (choice) { - if (choice.type !== 'separator') { - choice.checked = shouldBeChecked; - } - }); - - this.render(); -}; - -Prompt.prototype.onInverseKey = function () { - this.opt.choices.forEach(function (choice) { - if (choice.type !== 'separator') { - choice.checked = !choice.checked; - } - }); - - this.render(); -}; - -Prompt.prototype.toggleChoice = function (index) { - var item = this.opt.choices.getChoice(index); - if (item !== undefined) { - this.opt.choices.getChoice(index).checked = !item.checked; + this.render(); } -}; + + onInverseKey() { + this.opt.choices.forEach(function(choice) { + if (choice.type !== 'separator') { + choice.checked = !choice.checked; + } + }); + + this.render(); + } + + toggleChoice(index) { + var item = this.opt.choices.getChoice(index); + if (item !== undefined) { + this.opt.choices.getChoice(index).checked = !item.checked; + } + } +} /** * Function for rendering checkbox choices @@ -100313,7 +115992,7 @@ function renderChoices(choices, pointer) { var output = ''; var separatorOffset = 0; - choices.forEach(function (choice, i) { + choices.forEach(function(choice, i) { if (choice.type === 'separator') { separatorOffset++; output += ' ' + choice + '\n'; @@ -100325,9 +116004,12 @@ function renderChoices(choices, pointer) { output += ' - ' + choice.name; output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')'; } else { - var isSelected = (i - separatorOffset === pointer); - output += isSelected ? chalk.cyan(figures.pointer) : ' '; - output += getCheckbox(choice.checked) + ' ' + choice.name; + var line = getCheckbox(choice.checked) + ' ' + choice.name; + if (i - separatorOffset === pointer) { + output += chalk.cyan(figures.pointer + line); + } else { + output += ' ' + line; + } } output += '\n'; @@ -100346,473 +116028,466 @@ function getCheckbox(checked) { return checked ? chalk.green(figures.radioOn) : figures.radioOff; } +module.exports = CheckboxPrompt; + /***/ }), -/* 546 */ +/* 688 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + /** * `confirm` type prompt */ -var _ = __webpack_require__(27); -var util = __webpack_require__(2); -var chalk = __webpack_require__(34); -var Base = __webpack_require__(54); -var observe = __webpack_require__(55); +var _ = __webpack_require__(38); +var chalk = __webpack_require__(30); +var { take, takeUntil } = __webpack_require__(63); +var Base = __webpack_require__(79); +var observe = __webpack_require__(80); -/** - * Module exports - */ +class ConfirmPrompt extends Base { + constructor(questions, rl, answers) { + super(questions, rl, answers); -module.exports = Prompt; + var rawDefault = true; -/** - * Constructor - */ - -function Prompt() { - Base.apply(this, arguments); - - var rawDefault = true; - - _.extend(this.opt, { - filter: function (input) { - var value = rawDefault; - if (input != null && input !== '') { - value = /^y(es)?/i.test(input); + _.extend(this.opt, { + filter: function(input) { + var value = rawDefault; + if (input != null && input !== '') { + value = /^y(es)?/i.test(input); + } + return value; } - return value; + }); + + if (_.isBoolean(this.opt.default)) { + rawDefault = this.opt.default; } - }); - if (_.isBoolean(this.opt.default)) { - rawDefault = this.opt.default; + this.opt.default = rawDefault ? 'Y/n' : 'y/N'; + + return this; } - this.opt.default = rawDefault ? 'Y/n' : 'y/N'; + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ - return this; + _run(cb) { + this.done = cb; + + // Once user confirm (enter key) + var events = observe(this.rl); + events.keypress.pipe(takeUntil(events.line)).forEach(this.onKeypress.bind(this)); + + events.line.pipe(take(1)).forEach(this.onEnd.bind(this)); + + // Init + this.render(); + + return this; + } + + /** + * Render the prompt to screen + * @return {ConfirmPrompt} self + */ + + render(answer) { + var message = this.getQuestion(); + + if (typeof answer === 'boolean') { + message += chalk.cyan(answer ? 'Yes' : 'No'); + } else { + message += this.rl.line; + } + + this.screen.render(message); + + return this; + } + + /** + * When user press `enter` key + */ + + onEnd(input) { + this.status = 'answered'; + + var output = this.opt.filter(input); + this.render(output); + + this.screen.done(); + this.done(output); + } + + /** + * When user press a key + */ + + onKeypress() { + this.render(); + } } -util.inherits(Prompt, Base); -/** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - -Prompt.prototype._run = function (cb) { - this.done = cb; - - // Once user confirm (enter key) - var events = observe(this.rl); - events.keypress.takeUntil(events.line).forEach(this.onKeypress.bind(this)); - - events.line.take(1).forEach(this.onEnd.bind(this)); - - // Init - this.render(); - - return this; -}; - -/** - * Render the prompt to screen - * @return {Prompt} self - */ - -Prompt.prototype.render = function (answer) { - var message = this.getQuestion(); - - if (typeof answer === 'boolean') { - message += chalk.cyan(answer ? 'Yes' : 'No'); - } else { - message += this.rl.line; - } - - this.screen.render(message); - - return this; -}; - -/** - * When user press `enter` key - */ - -Prompt.prototype.onEnd = function (input) { - this.status = 'answered'; - - var output = this.opt.filter(input); - this.render(output); - - this.screen.done(); - this.done(output); -}; - -/** - * When user press a key - */ - -Prompt.prototype.onKeypress = function () { - this.render(); -}; +module.exports = ConfirmPrompt; /***/ }), -/* 547 */ +/* 689 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + /** * `editor` type prompt */ -var util = __webpack_require__(2); -var chalk = __webpack_require__(34); -var ExternalEditor = __webpack_require__(496); -var Base = __webpack_require__(54); -var observe = __webpack_require__(55); -var rx = __webpack_require__(144); +var chalk = __webpack_require__(30); +var editAsync = __webpack_require__(709).editAsync; +var Base = __webpack_require__(79); +var observe = __webpack_require__(80); +var { Subject } = __webpack_require__(182); -/** - * Module exports - */ +class EditorPrompt extends Base { + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ -module.exports = Prompt; + _run(cb) { + this.done = cb; -/** - * Constructor - */ + this.editorResult = new Subject(); -function Prompt() { - return Base.apply(this, arguments); + // Open Editor on "line" (Enter Key) + var events = observe(this.rl); + this.lineSubscription = events.line.subscribe(this.startExternalEditor.bind(this)); + + // Trigger Validation when editor closes + var validation = this.handleSubmitEvents(this.editorResult); + validation.success.forEach(this.onEnd.bind(this)); + validation.error.forEach(this.onError.bind(this)); + + // Prevents default from being printed on screen (can look weird with multiple lines) + this.currentText = this.opt.default; + this.opt.default = null; + + // Init + this.render(); + + return this; + } + + /** + * Render the prompt to screen + * @return {EditorPrompt} self + */ + + render(error) { + var bottomContent = ''; + var message = this.getQuestion(); + + if (this.status === 'answered') { + message += chalk.dim('Received'); + } else { + message += chalk.dim('Press to launch your preferred editor.'); + } + + if (error) { + bottomContent = chalk.red('>> ') + error; + } + + this.screen.render(message, bottomContent); + } + + /** + * Launch $EDITOR on user press enter + */ + + startExternalEditor() { + // Pause Readline to prevent stdin and stdout from being modified while the editor is showing + this.rl.pause(); + editAsync(this.currentText, this.endExternalEditor.bind(this)); + } + + endExternalEditor(error, result) { + this.rl.resume(); + if (error) { + this.editorResult.error(error); + } else { + this.editorResult.next(result); + } + } + + onEnd(state) { + this.editorResult.unsubscribe(); + this.lineSubscription.unsubscribe(); + this.answer = state.value; + this.status = 'answered'; + // Re-render prompt + this.render(); + this.screen.done(); + this.done(this.answer); + } + + onError(state) { + this.render(state.isValid); + } } -util.inherits(Prompt, Base); -/** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - -Prompt.prototype._run = function (cb) { - this.done = cb; - - this.editorResult = new rx.Subject(); - - // Open Editor on "line" (Enter Key) - var events = observe(this.rl); - this.lineSubscription = events.line.forEach(this.startExternalEditor.bind(this)); - - // Trigger Validation when editor closes - var validation = this.handleSubmitEvents(this.editorResult); - validation.success.forEach(this.onEnd.bind(this)); - validation.error.forEach(this.onError.bind(this)); - - // Prevents default from being printed on screen (can look weird with multiple lines) - this.currentText = this.opt.default; - this.opt.default = null; - - // Init - this.render(); - - return this; -}; - -/** - * Render the prompt to screen - * @return {Prompt} self - */ - -Prompt.prototype.render = function (error) { - var bottomContent = ''; - var message = this.getQuestion(); - - if (this.status === 'answered') { - message += chalk.dim('Received'); - } else { - message += chalk.dim('Press to launch your preferred editor.'); - } - - if (error) { - bottomContent = chalk.red('>> ') + error; - } - - this.screen.render(message, bottomContent); -}; - -/** - * Launch $EDITOR on user press enter - */ - -Prompt.prototype.startExternalEditor = function () { - // Pause Readline to prevent stdin and stdout from being modified while the editor is showing - this.rl.pause(); - ExternalEditor.editAsync(this.currentText, this.endExternalEditor.bind(this)); -}; - -Prompt.prototype.endExternalEditor = function (error, result) { - this.rl.resume(); - if (error) { - this.editorResult.onError(error); - } else { - this.editorResult.onNext(result); - } -}; - -Prompt.prototype.onEnd = function (state) { - this.editorResult.dispose(); - this.lineSubscription.dispose(); - this.answer = state.value; - this.status = 'answered'; - // Re-render prompt - this.render(); - this.screen.done(); - this.done(this.answer); -}; - -Prompt.prototype.onError = function (state) { - this.render(state.isValid); -}; +module.exports = EditorPrompt; /***/ }), -/* 548 */ +/* 690 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + /** * `rawlist` type prompt */ -var _ = __webpack_require__(27); -var util = __webpack_require__(2); -var chalk = __webpack_require__(34); -var Base = __webpack_require__(54); -var Separator = __webpack_require__(137); -var observe = __webpack_require__(55); -var Paginator = __webpack_require__(138); +var _ = __webpack_require__(38); +var chalk = __webpack_require__(30); +var { map, takeUntil } = __webpack_require__(63); +var Base = __webpack_require__(79); +var Separator = __webpack_require__(175); +var observe = __webpack_require__(80); +var Paginator = __webpack_require__(176); -/** - * Module exports - */ +class ExpandPrompt extends Base { + constructor(questions, rl, answers) { + super(questions, rl, answers); -module.exports = Prompt; - -/** - * Constructor - */ - -function Prompt() { - Base.apply(this, arguments); - - if (!this.opt.choices) { - this.throwParamError('choices'); - } - - this.validateChoices(this.opt.choices); - - // Add the default `help` (/expand) option - this.opt.choices.push({ - key: 'h', - name: 'Help, list all options', - value: 'help' - }); - - this.opt.validate = function (choice) { - if (choice == null) { - return 'Please enter a valid command'; + if (!this.opt.choices) { + this.throwParamError('choices'); } - return choice !== 'help'; - }; + this.validateChoices(this.opt.choices); - // Setup the default string (capitalize the default key) - this.opt.default = this.generateChoicesString(this.opt.choices, this.opt.default); + // Add the default `help` (/expand) option + this.opt.choices.push({ + key: 'h', + name: 'Help, list all options', + value: 'help' + }); - this.paginator = new Paginator(); -} -util.inherits(Prompt, Base); + this.opt.validate = choice => { + if (choice == null) { + return 'Please enter a valid command'; + } -/** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ + return choice !== 'help'; + }; -Prompt.prototype._run = function (cb) { - this.done = cb; + // Setup the default string (capitalize the default key) + this.opt.default = this.generateChoicesString(this.opt.choices, this.opt.default); - // Save user answer and update prompt to show selected option. - var events = observe(this.rl); - var validation = this.handleSubmitEvents( - events.line.map(this.getCurrentValue.bind(this)) - ); - validation.success.forEach(this.onSubmit.bind(this)); - validation.error.forEach(this.onError.bind(this)); - this.keypressObs = events.keypress.takeUntil(validation.success) - .forEach(this.onKeypress.bind(this)); - - // Init the prompt - this.render(); - - return this; -}; - -/** - * Render the prompt to screen - * @return {Prompt} self - */ - -Prompt.prototype.render = function (error, hint) { - var message = this.getQuestion(); - var bottomContent = ''; - - if (this.status === 'answered') { - message += chalk.cyan(this.answer); - } else if (this.status === 'expanded') { - var choicesStr = renderChoices(this.opt.choices, this.selectedKey); - message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize); - message += '\n Answer: '; + this.paginator = new Paginator(this.screen); } - message += this.rl.line; + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ - if (error) { - bottomContent = chalk.red('>> ') + error; + _run(cb) { + this.done = cb; + + // Save user answer and update prompt to show selected option. + var events = observe(this.rl); + var validation = this.handleSubmitEvents( + events.line.pipe(map(this.getCurrentValue.bind(this))) + ); + validation.success.forEach(this.onSubmit.bind(this)); + validation.error.forEach(this.onError.bind(this)); + this.keypressObs = events.keypress + .pipe(takeUntil(validation.success)) + .forEach(this.onKeypress.bind(this)); + + // Init the prompt + this.render(); + + return this; } - if (hint) { - bottomContent = chalk.cyan('>> ') + hint; + /** + * Render the prompt to screen + * @return {ExpandPrompt} self + */ + + render(error, hint) { + var message = this.getQuestion(); + var bottomContent = ''; + + if (this.status === 'answered') { + message += chalk.cyan(this.answer); + } else if (this.status === 'expanded') { + var choicesStr = renderChoices(this.opt.choices, this.selectedKey); + message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize); + message += '\n Answer: '; + } + + message += this.rl.line; + + if (error) { + bottomContent = chalk.red('>> ') + error; + } + + if (hint) { + bottomContent = chalk.cyan('>> ') + hint; + } + + this.screen.render(message, bottomContent); } - this.screen.render(message, bottomContent); -}; + getCurrentValue(input) { + if (!input) { + input = this.rawDefault; + } + var selected = this.opt.choices.where({ key: input.toLowerCase().trim() })[0]; + if (!selected) { + return null; + } -Prompt.prototype.getCurrentValue = function (input) { - if (!input) { - input = this.rawDefault; - } - var selected = this.opt.choices.where({key: input.toLowerCase().trim()})[0]; - if (!selected) { - return null; + return selected.value; } - return selected.value; -}; + /** + * Generate the prompt choices string + * @return {String} Choices string + */ -/** - * Generate the prompt choices string - * @return {String} Choices string - */ + getChoices() { + var output = ''; -Prompt.prototype.getChoices = function () { - var output = ''; + this.opt.choices.forEach(choice => { + output += '\n '; - this.opt.choices.forEach(function (choice) { - output += '\n '; + if (choice.type === 'separator') { + output += ' ' + choice; + return; + } - if (choice.type === 'separator') { - output += ' ' + choice; + var choiceStr = choice.key + ') ' + choice.name; + if (this.selectedKey === choice.key) { + choiceStr = chalk.cyan(choiceStr); + } + output += choiceStr; + }); + + return output; + } + + onError(state) { + if (state.value === 'help') { + this.selectedKey = ''; + this.status = 'expanded'; + this.render(); return; } + this.render(state.isValid); + } - var choiceStr = choice.key + ') ' + choice.name; - if (this.selectedKey === choice.key) { - choiceStr = chalk.cyan(choiceStr); - } - output += choiceStr; - }.bind(this)); + /** + * When user press `enter` key + */ - return output; -}; + onSubmit(state) { + this.status = 'answered'; + var choice = this.opt.choices.where({ value: state.value })[0]; + this.answer = choice.short || choice.name; -Prompt.prototype.onError = function (state) { - if (state.value === 'help') { - this.selectedKey = ''; - this.status = 'expanded'; + // Re-render prompt this.render(); - return; + this.screen.done(); + this.done(state.value); } - this.render(state.isValid); -}; -/** - * When user press `enter` key - */ + /** + * When user press a key + */ -Prompt.prototype.onSubmit = function (state) { - this.status = 'answered'; - var choice = this.opt.choices.where({value: state.value})[0]; - this.answer = choice.short || choice.name; - - // Re-render prompt - this.render(); - this.screen.done(); - this.done(state.value); -}; - -/** - * When user press a key - */ - -Prompt.prototype.onKeypress = function () { - this.selectedKey = this.rl.line.toLowerCase(); - var selected = this.opt.choices.where({key: this.selectedKey})[0]; - if (this.status === 'expanded') { - this.render(); - } else { - this.render(null, selected ? selected.name : null); - } -}; - -/** - * Validate the choices - * @param {Array} choices - */ - -Prompt.prototype.validateChoices = function (choices) { - var formatError; - var errors = []; - var keymap = {}; - choices.filter(Separator.exclude).forEach(function (choice) { - if (!choice.key || choice.key.length !== 1) { - formatError = true; + onKeypress() { + this.selectedKey = this.rl.line.toLowerCase(); + var selected = this.opt.choices.where({ key: this.selectedKey })[0]; + if (this.status === 'expanded') { + this.render(); + } else { + this.render(null, selected ? selected.name : null); } - if (keymap[choice.key]) { - errors.push(choice.key); + } + + /** + * Validate the choices + * @param {Array} choices + */ + + validateChoices(choices) { + var formatError; + var errors = []; + var keymap = {}; + choices.filter(Separator.exclude).forEach(choice => { + if (!choice.key || choice.key.length !== 1) { + formatError = true; + } + if (keymap[choice.key]) { + errors.push(choice.key); + } + keymap[choice.key] = true; + choice.key = String(choice.key).toLowerCase(); + }); + + if (formatError) { + throw new Error( + 'Format error: `key` param must be a single letter and is required.' + ); } - keymap[choice.key] = true; - choice.key = String(choice.key).toLowerCase(); - }); + if (keymap.h) { + throw new Error( + 'Reserved key error: `key` param cannot be `h` - this value is reserved.' + ); + } + if (errors.length) { + throw new Error( + 'Duplicate key error: `key` param must be unique. Duplicates: ' + + _.uniq(errors).join(', ') + ); + } + } - if (formatError) { - throw new Error('Format error: `key` param must be a single letter and is required.'); + /** + * Generate a string out of the choices keys + * @param {Array} choices + * @param {Number|String} default - the choice index or name to capitalize + * @return {String} The rendered choices key string + */ + generateChoicesString(choices, defaultChoice) { + var defIndex = choices.realLength - 1; + if (_.isNumber(defaultChoice) && this.opt.choices.getChoice(defaultChoice)) { + defIndex = defaultChoice; + } else if (_.isString(defaultChoice)) { + let index = _.findIndex( + choices.realChoices, + ({ value }) => value === defaultChoice + ); + defIndex = index === -1 ? defIndex : index; + } + var defStr = this.opt.choices.pluck('key'); + this.rawDefault = defStr[defIndex]; + defStr[defIndex] = String(defStr[defIndex]).toUpperCase(); + return defStr.join(''); } - if (keymap.h) { - throw new Error('Reserved key error: `key` param cannot be `h` - this value is reserved.'); - } - if (errors.length) { - throw new Error('Duplicate key error: `key` param must be unique. Duplicates: ' + - _.uniq(errors).join(', ')); - } -}; - -/** - * Generate a string out of the choices keys - * @param {Array} choices - * @param {Number} defaultIndex - the choice index to capitalize - * @return {String} The rendered choices key string - */ -Prompt.prototype.generateChoicesString = function (choices, defaultIndex) { - var defIndex = choices.realLength - 1; - if (_.isNumber(defaultIndex) && this.opt.choices.getChoice(defaultIndex)) { - defIndex = defaultIndex; - } - var defStr = this.opt.choices.pluck('key'); - this.rawDefault = defStr[defIndex]; - defStr[defIndex] = String(defStr[defIndex]).toUpperCase(); - return defStr.join(''); -}; +} /** * Function for rendering checkbox choices @@ -100823,7 +116498,7 @@ Prompt.prototype.generateChoicesString = function (choices, defaultIndex) { function renderChoices(choices, pointer) { var output = ''; - choices.forEach(function (choice) { + choices.forEach(choice => { output += '\n '; if (choice.type === 'separator') { @@ -100841,273 +116516,159 @@ function renderChoices(choices, pointer) { return output; } - -/***/ }), -/* 549 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * `input` type prompt - */ - -var util = __webpack_require__(2); -var chalk = __webpack_require__(34); -var Base = __webpack_require__(54); -var observe = __webpack_require__(55); - -/** - * Module exports - */ - -module.exports = Prompt; - -/** - * Constructor - */ - -function Prompt() { - return Base.apply(this, arguments); -} -util.inherits(Prompt, Base); - -/** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - -Prompt.prototype._run = function (cb) { - this.done = cb; - - // Once user confirm (enter key) - var events = observe(this.rl); - var submit = events.line.map(this.filterInput.bind(this)); - - var validation = this.handleSubmitEvents(submit); - validation.success.forEach(this.onEnd.bind(this)); - validation.error.forEach(this.onError.bind(this)); - - events.keypress.takeUntil(validation.success).forEach(this.onKeypress.bind(this)); - - // Init - this.render(); - - return this; -}; - -/** - * Render the prompt to screen - * @return {Prompt} self - */ - -Prompt.prototype.render = function (error) { - var bottomContent = ''; - var message = this.getQuestion(); - - if (this.status === 'answered') { - message += chalk.cyan(this.answer); - } else { - message += this.rl.line; - } - - if (error) { - bottomContent = chalk.red('>> ') + error; - } - - this.screen.render(message, bottomContent); -}; - -/** - * When user press `enter` key - */ - -Prompt.prototype.filterInput = function (input) { - if (!input) { - return this.opt.default == null ? '' : this.opt.default; - } - return input; -}; - -Prompt.prototype.onEnd = function (state) { - this.answer = state.value; - this.status = 'answered'; - - // Re-render prompt - this.render(); - - this.screen.done(); - this.done(state.value); -}; - -Prompt.prototype.onError = function (state) { - this.render(state.isValid); -}; - -/** - * When user press a key - */ - -Prompt.prototype.onKeypress = function () { - this.render(); -}; +module.exports = ExpandPrompt; /***/ }), -/* 550 */ +/* 691 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + /** * `list` type prompt */ -var _ = __webpack_require__(27); -var util = __webpack_require__(2); -var chalk = __webpack_require__(34); -var figures = __webpack_require__(209); -var cliCursor = __webpack_require__(282); -var runAsync = __webpack_require__(143); -var Base = __webpack_require__(54); -var observe = __webpack_require__(55); -var Paginator = __webpack_require__(138); +var _ = __webpack_require__(38); +var chalk = __webpack_require__(30); +var figures = __webpack_require__(270); +var cliCursor = __webpack_require__(381); +var runAsync = __webpack_require__(181); +var { flatMap, map, take, takeUntil } = __webpack_require__(63); +var Base = __webpack_require__(79); +var observe = __webpack_require__(80); +var Paginator = __webpack_require__(176); -/** - * Module exports - */ +class ListPrompt extends Base { + constructor(questions, rl, answers) { + super(questions, rl, answers); -module.exports = Prompt; + if (!this.opt.choices) { + this.throwParamError('choices'); + } -/** - * Constructor - */ + this.firstRender = true; + this.selected = 0; -function Prompt() { - Base.apply(this, arguments); + var def = this.opt.default; - if (!this.opt.choices) { - this.throwParamError('choices'); + // If def is a Number, then use as index. Otherwise, check for value. + if (_.isNumber(def) && def >= 0 && def < this.opt.choices.realLength) { + this.selected = def; + } else if (!_.isNumber(def) && def != null) { + let index = _.findIndex(this.opt.choices.realChoices, ({ value }) => value === def); + this.selected = Math.max(index, 0); + } + + // Make sure no default is set (so it won't be printed) + this.opt.default = null; + + this.paginator = new Paginator(this.screen); } - this.firstRender = true; - this.selected = 0; + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ - var def = this.opt.default; + _run(cb) { + this.done = cb; - // Default being a Number - if (_.isNumber(def) && def >= 0 && def < this.opt.choices.realLength) { - this.selected = def; + var self = this; + + var events = observe(this.rl); + events.normalizedUpKey.pipe(takeUntil(events.line)).forEach(this.onUpKey.bind(this)); + events.normalizedDownKey + .pipe(takeUntil(events.line)) + .forEach(this.onDownKey.bind(this)); + events.numberKey.pipe(takeUntil(events.line)).forEach(this.onNumberKey.bind(this)); + events.line + .pipe( + take(1), + map(this.getCurrentValue.bind(this)), + flatMap(value => runAsync(self.opt.filter)(value).catch(err => err)) + ) + .forEach(this.onSubmit.bind(this)); + + // Init the prompt + cliCursor.hide(); + this.render(); + + return this; } - // Default being a String - if (_.isString(def)) { - this.selected = this.opt.choices.pluck('value').indexOf(def); + /** + * Render the prompt to screen + * @return {ListPrompt} self + */ + + render() { + // Render question + var message = this.getQuestion(); + + if (this.firstRender) { + message += chalk.dim('(Use arrow keys)'); + } + + // Render choices or answer depending on the state + if (this.status === 'answered') { + message += chalk.cyan(this.opt.choices.getChoice(this.selected).short); + } else { + var choicesStr = listRender(this.opt.choices, this.selected); + var indexPosition = this.opt.choices.indexOf( + this.opt.choices.getChoice(this.selected) + ); + message += + '\n' + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize); + } + + this.firstRender = false; + + this.screen.render(message); } - // Make sure no default is set (so it won't be printed) - this.opt.default = null; + /** + * When user press `enter` key + */ - this.paginator = new Paginator(); + onSubmit(value) { + this.status = 'answered'; + + // Rerender prompt + this.render(); + + this.screen.done(); + cliCursor.show(); + this.done(value); + } + + getCurrentValue() { + return this.opt.choices.getChoice(this.selected).value; + } + + /** + * When user press a key + */ + onUpKey() { + var len = this.opt.choices.realLength; + this.selected = this.selected > 0 ? this.selected - 1 : len - 1; + this.render(); + } + + onDownKey() { + var len = this.opt.choices.realLength; + this.selected = this.selected < len - 1 ? this.selected + 1 : 0; + this.render(); + } + + onNumberKey(input) { + if (input <= this.opt.choices.realLength) { + this.selected = input - 1; + } + this.render(); + } } -util.inherits(Prompt, Base); - -/** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - -Prompt.prototype._run = function (cb) { - this.done = cb; - - var self = this; - - var events = observe(this.rl); - events.normalizedUpKey.takeUntil(events.line).forEach(this.onUpKey.bind(this)); - events.normalizedDownKey.takeUntil(events.line).forEach(this.onDownKey.bind(this)); - events.numberKey.takeUntil(events.line).forEach(this.onNumberKey.bind(this)); - events.line - .take(1) - .map(this.getCurrentValue.bind(this)) - .flatMap(function (value) { - return runAsync(self.opt.filter)(value).catch(function (err) { - return err; - }); - }) - .forEach(this.onSubmit.bind(this)); - - // Init the prompt - cliCursor.hide(); - this.render(); - - return this; -}; - -/** - * Render the prompt to screen - * @return {Prompt} self - */ - -Prompt.prototype.render = function () { - // Render question - var message = this.getQuestion(); - - if (this.firstRender) { - message += chalk.dim('(Use arrow keys)'); - } - - // Render choices or answer depending on the state - if (this.status === 'answered') { - message += chalk.cyan(this.opt.choices.getChoice(this.selected).short); - } else { - var choicesStr = listRender(this.opt.choices, this.selected); - var indexPosition = this.opt.choices.indexOf(this.opt.choices.getChoice(this.selected)); - message += '\n' + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize); - } - - this.firstRender = false; - - this.screen.render(message); -}; - -/** - * When user press `enter` key - */ - -Prompt.prototype.onSubmit = function (value) { - this.status = 'answered'; - - // Rerender prompt - this.render(); - - this.screen.done(); - cliCursor.show(); - this.done(value); -}; - -Prompt.prototype.getCurrentValue = function () { - return this.opt.choices.getChoice(this.selected).value; -}; - -/** - * When user press a key - */ -Prompt.prototype.onUpKey = function () { - var len = this.opt.choices.realLength; - this.selected = (this.selected > 0) ? this.selected - 1 : len - 1; - this.render(); -}; - -Prompt.prototype.onDownKey = function () { - var len = this.opt.choices.realLength; - this.selected = (this.selected < len - 1) ? this.selected + 1 : 0; - this.render(); -}; - -Prompt.prototype.onNumberKey = function (input) { - if (input <= this.opt.choices.realLength) { - this.selected = input - 1; - } - this.render(); -}; /** * Function for rendering list choices @@ -101118,7 +116679,7 @@ function listRender(choices, pointer) { var output = ''; var separatorOffset = 0; - choices.forEach(function (choice, i) { + choices.forEach((choice, i) => { if (choice.type === 'separator') { separatorOffset++; output += ' ' + choice + '\n'; @@ -101133,7 +116694,7 @@ function listRender(choices, pointer) { return; } - var isSelected = (i - separatorOffset === pointer); + var isSelected = i - separatorOffset === pointer; var line = (isSelected ? figures.pointer + ' ' : ' ') + choice.name; if (isSelected) { line = chalk.cyan(line); @@ -101144,281 +116705,314 @@ function listRender(choices, pointer) { return output.replace(/\n$/, ''); } +module.exports = ListPrompt; + /***/ }), -/* 551 */ +/* 692 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + +/** + * `input` type prompt + */ + +var Input = __webpack_require__(392); + +/** + * Extention of the Input prompt specifically for use with number inputs. + */ + +class NumberPrompt extends Input { + filterInput(input) { + if (input && typeof input === 'string') { + input = input.trim(); + // Match a number in the input + let numberMatch = input.match(/(^-?\d+|^\d+\.\d*|^\d*\.\d+)(e\d+)?$/); + // If a number is found, return that input. + if (numberMatch) { + return Number(numberMatch[0]); + } + } + // If the input was invalid return the default value. + return this.opt.default == null ? NaN : this.opt.default; + } +} + +module.exports = NumberPrompt; + + +/***/ }), +/* 693 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + /** * `password` type prompt */ -var util = __webpack_require__(2); -var chalk = __webpack_require__(34); -var Base = __webpack_require__(54); -var observe = __webpack_require__(55); +var chalk = __webpack_require__(30); +var { map, takeUntil } = __webpack_require__(63); +var Base = __webpack_require__(79); +var observe = __webpack_require__(80); -function mask(input) { +function mask(input, maskChar) { input = String(input); + maskChar = typeof maskChar === 'string' ? maskChar : '*'; if (input.length === 0) { return ''; } - return new Array(input.length + 1).join('*'); + return new Array(input.length + 1).join(maskChar); } -/** - * Module exports - */ +class PasswordPrompt extends Base { + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ -module.exports = Prompt; + _run(cb) { + this.done = cb; -/** - * Constructor - */ + var events = observe(this.rl); -function Prompt() { - return Base.apply(this, arguments); + // Once user confirm (enter key) + var submit = events.line.pipe(map(this.filterInput.bind(this))); + + var validation = this.handleSubmitEvents(submit); + validation.success.forEach(this.onEnd.bind(this)); + validation.error.forEach(this.onError.bind(this)); + + if (this.opt.mask) { + events.keypress + .pipe(takeUntil(validation.success)) + .forEach(this.onKeypress.bind(this)); + } + + // Init + this.render(); + + return this; + } + + /** + * Render the prompt to screen + * @return {PasswordPrompt} self + */ + + render(error) { + var message = this.getQuestion(); + var bottomContent = ''; + + if (this.status === 'answered') { + message += this.opt.mask + ? chalk.cyan(mask(this.answer, this.opt.mask)) + : chalk.italic.dim('[hidden]'); + } else if (this.opt.mask) { + message += mask(this.rl.line || '', this.opt.mask); + } else { + message += chalk.italic.dim('[input is hidden] '); + } + + if (error) { + bottomContent = '\n' + chalk.red('>> ') + error; + } + + this.screen.render(message, bottomContent); + } + + /** + * When user press `enter` key + */ + + filterInput(input) { + if (!input) { + return this.opt.default == null ? '' : this.opt.default; + } + return input; + } + + onEnd(state) { + this.status = 'answered'; + this.answer = state.value; + + // Re-render prompt + this.render(); + + this.screen.done(); + this.done(state.value); + } + + onError(state) { + this.render(state.isValid); + } + + onKeypress() { + this.render(); + } } -util.inherits(Prompt, Base); -/** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - -Prompt.prototype._run = function (cb) { - this.done = cb; - - var events = observe(this.rl); - - // Once user confirm (enter key) - var submit = events.line.map(this.filterInput.bind(this)); - - var validation = this.handleSubmitEvents(submit); - validation.success.forEach(this.onEnd.bind(this)); - validation.error.forEach(this.onError.bind(this)); - - events.keypress.takeUntil(validation.success).forEach(this.onKeypress.bind(this)); - - // Init - this.render(); - - return this; -}; - -/** - * Render the prompt to screen - * @return {Prompt} self - */ - -Prompt.prototype.render = function (error) { - var message = this.getQuestion(); - var bottomContent = ''; - - if (this.status === 'answered') { - message += chalk.cyan(mask(this.answer)); - } else { - message += mask(this.rl.line || ''); - } - - if (error) { - bottomContent = '\n' + chalk.red('>> ') + error; - } - - this.screen.render(message, bottomContent); -}; - -/** - * When user press `enter` key - */ - -Prompt.prototype.filterInput = function (input) { - if (!input) { - return this.opt.default == null ? '' : this.opt.default; - } - return input; -}; - -Prompt.prototype.onEnd = function (state) { - this.status = 'answered'; - this.answer = state.value; - - // Re-render prompt - this.render(); - - this.screen.done(); - this.done(state.value); -}; - -Prompt.prototype.onError = function (state) { - this.render(state.isValid); - this.rl.output.unmute(); -}; - -/** - * When user type - */ - -Prompt.prototype.onKeypress = function () { - this.render(); -}; +module.exports = PasswordPrompt; /***/ }), -/* 552 */ +/* 694 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + /** * `rawlist` type prompt */ -var _ = __webpack_require__(27); -var util = __webpack_require__(2); -var chalk = __webpack_require__(34); -var Base = __webpack_require__(54); -var Separator = __webpack_require__(137); -var observe = __webpack_require__(55); -var Paginator = __webpack_require__(138); +var _ = __webpack_require__(38); +var chalk = __webpack_require__(30); +var { map, takeUntil } = __webpack_require__(63); +var Base = __webpack_require__(79); +var Separator = __webpack_require__(175); +var observe = __webpack_require__(80); +var Paginator = __webpack_require__(176); -/** - * Module exports - */ +class RawListPrompt extends Base { + constructor(questions, rl, answers) { + super(questions, rl, answers); -module.exports = Prompt; - -/** - * Constructor - */ - -function Prompt() { - Base.apply(this, arguments); - - if (!this.opt.choices) { - this.throwParamError('choices'); - } - - this.opt.validChoices = this.opt.choices.filter(Separator.exclude); - - this.selected = 0; - this.rawDefault = 0; - - _.extend(this.opt, { - validate: function (val) { - return val != null; + if (!this.opt.choices) { + this.throwParamError('choices'); } - }); - var def = this.opt.default; - if (_.isNumber(def) && def >= 0 && def < this.opt.choices.realLength) { - this.selected = this.rawDefault = def; + this.opt.validChoices = this.opt.choices.filter(Separator.exclude); + + this.selected = 0; + this.rawDefault = 0; + + _.extend(this.opt, { + validate: function(val) { + return val != null; + } + }); + + var def = this.opt.default; + if (_.isNumber(def) && def >= 0 && def < this.opt.choices.realLength) { + this.selected = def; + this.rawDefault = def; + } else if (!_.isNumber(def) && def != null) { + let index = _.findIndex(this.opt.choices.realChoices, ({ value }) => value === def); + let safeIndex = Math.max(index, 0); + this.selected = safeIndex; + this.rawDefault = safeIndex; + } + + // Make sure no default is set (so it won't be printed) + this.opt.default = null; + + this.paginator = new Paginator(); } - // Make sure no default is set (so it won't be printed) - this.opt.default = null; + /** + * Start the Inquiry session + * @param {Function} cb Callback when prompt is done + * @return {this} + */ - this.paginator = new Paginator(); + _run(cb) { + this.done = cb; + + // Once user confirm (enter key) + var events = observe(this.rl); + var submit = events.line.pipe(map(this.getCurrentValue.bind(this))); + + var validation = this.handleSubmitEvents(submit); + validation.success.forEach(this.onEnd.bind(this)); + validation.error.forEach(this.onError.bind(this)); + + events.keypress + .pipe(takeUntil(validation.success)) + .forEach(this.onKeypress.bind(this)); + + // Init the prompt + this.render(); + + return this; + } + + /** + * Render the prompt to screen + * @return {RawListPrompt} self + */ + + render(error) { + // Render question + var message = this.getQuestion(); + var bottomContent = ''; + + if (this.status === 'answered') { + message += chalk.cyan(this.answer); + } else { + var choicesStr = renderChoices(this.opt.choices, this.selected); + message += this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize); + message += '\n Answer: '; + } + + message += this.rl.line; + + if (error) { + bottomContent = '\n' + chalk.red('>> ') + error; + } + + this.screen.render(message, bottomContent); + } + + /** + * When user press `enter` key + */ + + getCurrentValue(index) { + if (index == null || index === '') { + index = this.rawDefault; + } else { + index -= 1; + } + + var choice = this.opt.choices.getChoice(index); + return choice ? choice.value : null; + } + + onEnd(state) { + this.status = 'answered'; + this.answer = state.value; + + // Re-render prompt + this.render(); + + this.screen.done(); + this.done(state.value); + } + + onError() { + this.render('Please enter a valid index'); + } + + /** + * When user press a key + */ + + onKeypress() { + var index = this.rl.line.length ? Number(this.rl.line) - 1 : 0; + + if (this.opt.choices.getChoice(index)) { + this.selected = index; + } else { + this.selected = undefined; + } + + this.render(); + } } -util.inherits(Prompt, Base); - -/** - * Start the Inquiry session - * @param {Function} cb Callback when prompt is done - * @return {this} - */ - -Prompt.prototype._run = function (cb) { - this.done = cb; - - // Once user confirm (enter key) - var events = observe(this.rl); - var submit = events.line.map(this.getCurrentValue.bind(this)); - - var validation = this.handleSubmitEvents(submit); - validation.success.forEach(this.onEnd.bind(this)); - validation.error.forEach(this.onError.bind(this)); - - events.keypress.takeUntil(validation.success).forEach(this.onKeypress.bind(this)); - - // Init the prompt - this.render(); - - return this; -}; - -/** - * Render the prompt to screen - * @return {Prompt} self - */ - -Prompt.prototype.render = function (error) { - // Render question - var message = this.getQuestion(); - var bottomContent = ''; - - if (this.status === 'answered') { - message += chalk.cyan(this.answer); - } else { - var choicesStr = renderChoices(this.opt.choices, this.selected); - message += this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize); - message += '\n Answer: '; - } - - message += this.rl.line; - - if (error) { - bottomContent = '\n' + chalk.red('>> ') + error; - } - - this.screen.render(message, bottomContent); -}; - -/** - * When user press `enter` key - */ - -Prompt.prototype.getCurrentValue = function (index) { - if (index == null || index === '') { - index = this.rawDefault; - } else { - index -= 1; - } - - var choice = this.opt.choices.getChoice(index); - return choice ? choice.value : null; -}; - -Prompt.prototype.onEnd = function (state) { - this.status = 'answered'; - this.answer = state.value; - - // Re-render prompt - this.render(); - - this.screen.done(); - this.done(state.value); -}; - -Prompt.prototype.onError = function () { - this.render('Please enter a valid index'); -}; - -/** - * When user press a key - */ - -Prompt.prototype.onKeypress = function () { - var index = this.rl.line.length ? Number(this.rl.line) - 1 : 0; - - if (this.opt.choices.getChoice(index)) { - this.selected = index; - } else { - this.selected = undefined; - } - - this.render(); -}; /** * Function for rendering list choices @@ -101430,7 +117024,7 @@ function renderChoices(choices, pointer) { var output = ''; var separatorOffset = 0; - choices.forEach(function (choice, i) { + choices.forEach(function(choice, i) { output += '\n '; if (choice.type === 'separator') { @@ -101440,7 +117034,7 @@ function renderChoices(choices, pointer) { } var index = i - separatorOffset; - var display = (index + 1) + ') ' + choice.name; + var display = index + 1 + ') ' + choice.name; if (index === pointer) { display = chalk.cyan(display); } @@ -101450,251 +117044,256 @@ function renderChoices(choices, pointer) { return output; } +module.exports = RawListPrompt; + /***/ }), -/* 553 */ +/* 695 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + /** * Sticky bottom bar user interface */ -var util = __webpack_require__(2); -var through = __webpack_require__(660); -var Base = __webpack_require__(293); -var rlUtils = __webpack_require__(294); -var _ = __webpack_require__(27); +var through = __webpack_require__(953); +var Base = __webpack_require__(393); +var rlUtils = __webpack_require__(394); +var _ = __webpack_require__(38); -/** - * Module exports - */ +class BottomBar extends Base { + constructor(opt) { + opt = opt || {}; -module.exports = Prompt; + super(opt); -/** - * Constructor - */ - -function Prompt(opt) { - opt || (opt = {}); - - Base.apply(this, arguments); - - this.log = through(this.writeLog.bind(this)); - this.bottomBar = opt.bottomBar || ''; - this.render(); -} -util.inherits(Prompt, Base); - -/** - * Render the prompt to screen - * @return {Prompt} self - */ - -Prompt.prototype.render = function () { - this.write(this.bottomBar); - return this; -}; - -Prompt.prototype.clean = function () { - rlUtils.clearLine(this.rl, this.bottomBar.split('\n').length); - return this; -}; - -/** - * Update the bottom bar content and rerender - * @param {String} bottomBar Bottom bar content - * @return {Prompt} self - */ - -Prompt.prototype.updateBottomBar = function (bottomBar) { - this.bottomBar = bottomBar; - rlUtils.clearLine(this.rl, 1); - this.rl.output.unmute(); - this.clean().render(); - this.rl.output.mute(); - return this; -}; - -/** - * Write out log data - * @param {String} data - The log data to be output - * @return {Prompt} self - */ - -Prompt.prototype.writeLog = function (data) { - this.rl.output.unmute(); - this.clean(); - this.rl.output.write(this.enforceLF(data.toString())); - this.render(); - this.rl.output.mute(); - return this; -}; - -/** - * Make sure line end on a line feed - * @param {String} str Input string - * @return {String} The input string with a final line feed - */ - -Prompt.prototype.enforceLF = function (str) { - return str.match(/[\r\n]$/) ? str : str + '\n'; -}; - -/** - * Helper for writing message in Prompt - * @param {Prompt} prompt - The Prompt object that extends tty - * @param {String} message - The message to be output - */ -Prompt.prototype.write = function (message) { - var msgLines = message.split(/\n/); - this.height = msgLines.length; - - // Write message to screen and setPrompt to control backspace - this.rl.setPrompt(_.last(msgLines)); - - if (this.rl.output.rows === 0 && this.rl.output.columns === 0) { - /* When it's a tty through serial port there's no terminal info and the render will malfunction, - so we need enforce the cursor to locate to the leftmost position for rendering. */ - rlUtils.left(this.rl, message.length + this.rl.line.length); + this.log = through(this.writeLog.bind(this)); + this.bottomBar = opt.bottomBar || ''; + this.render(); } - this.rl.output.write(message); -}; + + /** + * Render the prompt to screen + * @return {BottomBar} self + */ + + render() { + this.write(this.bottomBar); + return this; + } + + clean() { + rlUtils.clearLine(this.rl, this.bottomBar.split('\n').length); + return this; + } + + /** + * Update the bottom bar content and rerender + * @param {String} bottomBar Bottom bar content + * @return {BottomBar} self + */ + + updateBottomBar(bottomBar) { + rlUtils.clearLine(this.rl, 1); + this.rl.output.unmute(); + this.clean(); + this.bottomBar = bottomBar; + this.render(); + this.rl.output.mute(); + return this; + } + + /** + * Write out log data + * @param {String} data - The log data to be output + * @return {BottomBar} self + */ + + writeLog(data) { + this.rl.output.unmute(); + this.clean(); + this.rl.output.write(this.enforceLF(data.toString())); + this.render(); + this.rl.output.mute(); + return this; + } + + /** + * Make sure line end on a line feed + * @param {String} str Input string + * @return {String} The input string with a final line feed + */ + + enforceLF(str) { + return str.match(/[\r\n]$/) ? str : str + '\n'; + } + + /** + * Helper for writing message in Prompt + * @param {BottomBar} prompt - The Prompt object that extends tty + * @param {String} message - The message to be output + */ + write(message) { + var msgLines = message.split(/\n/); + this.height = msgLines.length; + + // Write message to screen and setPrompt to control backspace + this.rl.setPrompt(_.last(msgLines)); + + if (this.rl.output.rows === 0 && this.rl.output.columns === 0) { + /* When it's a tty through serial port there's no terminal info and the render will malfunction, + so we need enforce the cursor to locate to the leftmost position for rendering. */ + rlUtils.left(this.rl, message.length + this.rl.line.length); + } + this.rl.output.write(message); + } +} + +module.exports = BottomBar; /***/ }), -/* 554 */ +/* 696 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _ = __webpack_require__(27); -var rx = __webpack_require__(144); -var util = __webpack_require__(2); -var runAsync = __webpack_require__(143); -var utils = __webpack_require__(556); -var Base = __webpack_require__(293); +var _ = __webpack_require__(38); +var { defer, empty, from, of } = __webpack_require__(182); +var { concatMap, filter, publish, reduce } = __webpack_require__(63); +var runAsync = __webpack_require__(181); +var utils = __webpack_require__(698); +var Base = __webpack_require__(393); /** * Base interface class other can inherits from */ -var PromptUI = module.exports = function (prompts, opt) { - Base.call(this, opt); - this.prompts = prompts; -}; -util.inherits(PromptUI, Base); - -PromptUI.prototype.run = function (questions) { - // Keep global reference to the answers - this.answers = {}; - - // Make sure questions is an array. - if (_.isPlainObject(questions)) { - questions = [questions]; +class PromptUI extends Base { + constructor(prompts, opt) { + super(opt); + this.prompts = prompts; } - // Create an observable, unless we received one as parameter. - // Note: As this is a public interface, we cannot do an instanceof check as we won't - // be using the exact same object in memory. - var obs = _.isArray(questions) ? rx.Observable.from(questions) : questions; + run(questions) { + // Keep global reference to the answers + this.answers = {}; - this.process = obs - .concatMap(this.processQuestion.bind(this)) - // `publish` creates a hot Observable. It prevents duplicating prompts. - .publish(); + // Make sure questions is an array. + if (_.isPlainObject(questions)) { + questions = [questions]; + } - this.process.connect(); + // Create an observable, unless we received one as parameter. + // Note: As this is a public interface, we cannot do an instanceof check as we won't + // be using the exact same object in memory. + var obs = _.isArray(questions) ? from(questions) : questions; - return this.process - .reduce(function (answers, answer) { - _.set(this.answers, answer.name, answer.answer); - return this.answers; - }.bind(this), {}) - .toPromise(Promise) - .then(this.onCompletion.bind(this)); -}; + this.process = obs.pipe( + concatMap(this.processQuestion.bind(this)), + publish() // Creates a hot Observable. It prevents duplicating prompts. + ); -/** - * Once all prompt are over - */ + this.process.connect(); -PromptUI.prototype.onCompletion = function (answers) { - this.close(); - - return answers; -}; - -PromptUI.prototype.processQuestion = function (question) { - question = _.clone(question); - return rx.Observable.defer(function () { - var obs = rx.Observable.of(question); - - return obs - .concatMap(this.setDefaultType.bind(this)) - .concatMap(this.filterIfRunnable.bind(this)) - .concatMap(utils.fetchAsyncQuestionProperty.bind(null, question, 'message', this.answers)) - .concatMap(utils.fetchAsyncQuestionProperty.bind(null, question, 'default', this.answers)) - .concatMap(utils.fetchAsyncQuestionProperty.bind(null, question, 'choices', this.answers)) - .concatMap(this.fetchAnswer.bind(this)); - }.bind(this)); -}; - -PromptUI.prototype.fetchAnswer = function (question) { - var Prompt = this.prompts[question.type]; - this.activePrompt = new Prompt(question, this.rl, this.answers); - return rx.Observable.defer(function () { - return rx.Observable.fromPromise(this.activePrompt.run().then(function (answer) { - return {name: question.name, answer: answer}; - })); - }.bind(this)); -}; - -PromptUI.prototype.setDefaultType = function (question) { - // Default type to input - if (!this.prompts[question.type]) { - question.type = 'input'; - } - return rx.Observable.defer(function () { - return rx.Observable.return(question); - }); -}; - -PromptUI.prototype.filterIfRunnable = function (question) { - if (question.when === false) { - return rx.Observable.empty(); + return this.process + .pipe( + reduce((answers, answer) => { + _.set(this.answers, answer.name, answer.answer); + return this.answers; + }, {}) + ) + .toPromise(Promise) + .then(this.onCompletion.bind(this)); } - if (!_.isFunction(question.when)) { - return rx.Observable.return(question); + /** + * Once all prompt are over + */ + + onCompletion() { + this.close(); + + return this.answers; } - var answers = this.answers; - return rx.Observable.defer(function () { - return rx.Observable.fromPromise( - runAsync(question.when)(answers).then(function (shouldRun) { - if (shouldRun) { - return question; - } - }) - ).filter(function (val) { - return val != null; + processQuestion(question) { + question = _.clone(question); + return defer(() => { + var obs = of(question); + + return obs.pipe( + concatMap(this.setDefaultType.bind(this)), + concatMap(this.filterIfRunnable.bind(this)), + concatMap(() => + utils.fetchAsyncQuestionProperty(question, 'message', this.answers) + ), + concatMap(() => + utils.fetchAsyncQuestionProperty(question, 'default', this.answers) + ), + concatMap(() => + utils.fetchAsyncQuestionProperty(question, 'choices', this.answers) + ), + concatMap(this.fetchAnswer.bind(this)) + ); }); - }); -}; + } + + fetchAnswer(question) { + var Prompt = this.prompts[question.type]; + this.activePrompt = new Prompt(question, this.rl, this.answers); + return defer(() => + from( + this.activePrompt.run().then(answer => ({ name: question.name, answer: answer })) + ) + ); + } + + setDefaultType(question) { + // Default type to input + if (!this.prompts[question.type]) { + question.type = 'input'; + } + return defer(() => of(question)); + } + + filterIfRunnable(question) { + if (question.when === false) { + return empty(); + } + + if (!_.isFunction(question.when)) { + return of(question); + } + + var answers = this.answers; + return defer(() => + from( + runAsync(question.when)(answers).then(shouldRun => { + if (shouldRun) { + return question; + } + }) + ).pipe(filter(val => val != null)) + ); + } +} + +module.exports = PromptUI; /***/ }), -/* 555 */ +/* 697 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _ = __webpack_require__(27); -var util = __webpack_require__(294); -var cliWidth = __webpack_require__(464); -var stripAnsi = __webpack_require__(216); -var stringWidth = __webpack_require__(559); +var _ = __webpack_require__(38); +var util = __webpack_require__(394); +var cliWidth = __webpack_require__(606); +var stripAnsi = __webpack_require__(329); +var stringWidth = __webpack_require__(728); function height(content) { return content.split('\n').length; @@ -101704,137 +117303,140 @@ function lastLine(content) { return _.last(content.split('\n')); } -var ScreenManager = module.exports = function (rl) { - // These variables are keeping information to allow correct prompt re-rendering - this.height = 0; - this.extraLinesUnderPrompt = 0; +class ScreenManager { + constructor(rl) { + // These variables are keeping information to allow correct prompt re-rendering + this.height = 0; + this.extraLinesUnderPrompt = 0; - this.rl = rl; -}; - -ScreenManager.prototype.render = function (content, bottomContent) { - this.rl.output.unmute(); - this.clean(this.extraLinesUnderPrompt); - - /** - * Write message to screen and setPrompt to control backspace - */ - - var promptLine = lastLine(content); - var rawPromptLine = stripAnsi(promptLine); - - // Remove the rl.line from our prompt. We can't rely on the content of - // rl.line (mainly because of the password prompt), so just rely on it's - // length. - var prompt = promptLine; - if (this.rl.line.length) { - prompt = prompt.slice(0, -this.rl.line.length); - } - this.rl.setPrompt(prompt); - - // setPrompt will change cursor position, now we can get correct value - var cursorPos = this.rl._getCursorPos(); - var width = this.normalizedCliWidth(); - - content = forceLineReturn(content, width); - if (bottomContent) { - bottomContent = forceLineReturn(bottomContent, width); - } - // Manually insert an extra line if we're at the end of the line. - // This prevent the cursor from appearing at the beginning of the - // current line. - if (rawPromptLine.length % width === 0) { - content += '\n'; - } - var fullContent = content + (bottomContent ? '\n' + bottomContent : ''); - this.rl.output.write(fullContent); - - /** - * Re-adjust the cursor at the correct position. - */ - - // We need to consider parts of the prompt under the cursor as part of the bottom - // content in order to correctly cleanup and re-render. - var promptLineUpDiff = Math.floor(rawPromptLine.length / width) - cursorPos.rows; - var bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0); - if (bottomContentHeight > 0) { - util.up(this.rl, bottomContentHeight); + this.rl = rl; } - // Reset cursor at the beginning of the line - util.left(this.rl, stringWidth(lastLine(fullContent))); + render(content, bottomContent) { + this.rl.output.unmute(); + this.clean(this.extraLinesUnderPrompt); - // Adjust cursor on the right - util.right(this.rl, cursorPos.cols); + /** + * Write message to screen and setPrompt to control backspace + */ - /** - * Set up state for next re-rendering - */ - this.extraLinesUnderPrompt = bottomContentHeight; - this.height = height(fullContent); + var promptLine = lastLine(content); + var rawPromptLine = stripAnsi(promptLine); - this.rl.output.mute(); -}; + // Remove the rl.line from our prompt. We can't rely on the content of + // rl.line (mainly because of the password prompt), so just rely on it's + // length. + var prompt = rawPromptLine; + if (this.rl.line.length) { + prompt = prompt.slice(0, -this.rl.line.length); + } + this.rl.setPrompt(prompt); -ScreenManager.prototype.clean = function (extraLines) { - if (extraLines > 0) { - util.down(this.rl, extraLines); + // SetPrompt will change cursor position, now we can get correct value + var cursorPos = this.rl._getCursorPos(); + var width = this.normalizedCliWidth(); + + content = this.forceLineReturn(content, width); + if (bottomContent) { + bottomContent = this.forceLineReturn(bottomContent, width); + } + // Manually insert an extra line if we're at the end of the line. + // This prevent the cursor from appearing at the beginning of the + // current line. + if (rawPromptLine.length % width === 0) { + content += '\n'; + } + var fullContent = content + (bottomContent ? '\n' + bottomContent : ''); + this.rl.output.write(fullContent); + + /** + * Re-adjust the cursor at the correct position. + */ + + // We need to consider parts of the prompt under the cursor as part of the bottom + // content in order to correctly cleanup and re-render. + var promptLineUpDiff = Math.floor(rawPromptLine.length / width) - cursorPos.rows; + var bottomContentHeight = + promptLineUpDiff + (bottomContent ? height(bottomContent) : 0); + if (bottomContentHeight > 0) { + util.up(this.rl, bottomContentHeight); + } + + // Reset cursor at the beginning of the line + util.left(this.rl, stringWidth(lastLine(fullContent))); + + // Adjust cursor on the right + if (cursorPos.cols > 0) { + util.right(this.rl, cursorPos.cols); + } + + /** + * Set up state for next re-rendering + */ + this.extraLinesUnderPrompt = bottomContentHeight; + this.height = height(fullContent); + + this.rl.output.mute(); } - util.clearLine(this.rl, this.height); -}; -ScreenManager.prototype.done = function () { - this.rl.setPrompt(''); - this.rl.output.unmute(); - this.rl.output.write('\n'); -}; - -ScreenManager.prototype.releaseCursor = function () { - if (this.extraLinesUnderPrompt > 0) { - util.down(this.rl, this.extraLinesUnderPrompt); + clean(extraLines) { + if (extraLines > 0) { + util.down(this.rl, extraLines); + } + util.clearLine(this.rl, this.height); } -}; -ScreenManager.prototype.normalizedCliWidth = function () { - var width = cliWidth({ - defaultWidth: 80, - output: this.rl.output - }); - if (process.platform === 'win32') { - return width - 1; + done() { + this.rl.setPrompt(''); + this.rl.output.unmute(); + this.rl.output.write('\n'); } - return width; -}; -function breakLines(lines, width) { - // Break lines who're longuer than the cli width so we can normalize the natural line - // returns behavior accross terminals. - var regex = new RegExp( - '(?:(?:\\033[[0-9;]*m)*.?){1,' + width + '}', - 'g' - ); - return lines.map(function (line) { - var chunk = line.match(regex); - // last match is always empty - chunk.pop(); - return chunk || ''; - }); + releaseCursor() { + if (this.extraLinesUnderPrompt > 0) { + util.down(this.rl, this.extraLinesUnderPrompt); + } + } + + normalizedCliWidth() { + var width = cliWidth({ + defaultWidth: 80, + output: this.rl.output + }); + return width; + } + + breakLines(lines, width) { + // Break lines who're longer than the cli width so we can normalize the natural line + // returns behavior across terminals. + width = width || this.normalizedCliWidth(); + var regex = new RegExp('(?:(?:\\033[[0-9;]*m)*.?){1,' + width + '}', 'g'); + return lines.map(line => { + var chunk = line.match(regex); + // Last match is always empty + chunk.pop(); + return chunk || ''; + }); + } + + forceLineReturn(content, width) { + width = width || this.normalizedCliWidth(); + return _.flatten(this.breakLines(content.split('\n'), width)).join('\n'); + } } -function forceLineReturn(content, width) { - return _.flatten(breakLines(content.split('\n'), width)).join('\n'); -} +module.exports = ScreenManager; /***/ }), -/* 556 */ +/* 698 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _ = __webpack_require__(27); -var rx = __webpack_require__(144); -var runAsync = __webpack_require__(143); +var _ = __webpack_require__(38); +var { from, of } = __webpack_require__(182); +var runAsync = __webpack_require__(181); /** * Resolve a question property value if it is passed as a function. @@ -101842,16 +117444,16 @@ var runAsync = __webpack_require__(143); * @param {Object} question - Question object * @param {String} prop - Property to fetch name * @param {Object} answers - Answers object - * @return {rx.Obsersable} - Observable emitting once value is known + * @return {Rx.Observable} - Observable emitting once value is known */ -exports.fetchAsyncQuestionProperty = function (question, prop, answers) { +exports.fetchAsyncQuestionProperty = function(question, prop, answers) { if (!_.isFunction(question[prop])) { - return rx.Observable.return(question); + return of(question); } - return rx.Observable.fromPromise(runAsync(question[prop])(answers) - .then(function (value) { + return from( + runAsync(question[prop])(answers).then(value => { question[prop] = value; return question; }) @@ -101860,80 +117462,5278 @@ exports.fetchAsyncQuestionProperty = function (question, prop, answers) { /***/ }), -/* 557 */ +/* 699 */ +/***/ (function(module, exports, __webpack_require__) { + +var util = __webpack_require__(3), + Match = __webpack_require__ (142); + + +/** + * This is a superclass for the individual detectors for + * each of the detectable members of the ISO 2022 family + * of encodings. + */ + +function ISO_2022() {} + +ISO_2022.prototype.match = function(det) { + + /** + * Matching function shared among the 2022 detectors JP, CN and KR + * Counts up the number of legal an unrecognized escape sequences in + * the sample of text, and computes a score based on the total number & + * the proportion that fit the encoding. + * + * + * @param text the byte buffer containing text to analyse + * @param textLen the size of the text in the byte. + * @param escapeSequences the byte escape sequences to test for. + * @return match quality, in the range of 0-100. + */ + + var i, j; + var escN; + var hits = 0; + var misses = 0; + var shifts = 0; + var quality; + + // TODO: refactor me + var text = det.fInputBytes; + var textLen = det.fInputLen; + + scanInput: + for (i = 0; i < textLen; i++) { + if (text[i] == 0x1b) { + checkEscapes: + for (escN = 0; escN < this.escapeSequences.length; escN++) { + var seq = this.escapeSequences[escN]; + + if ((textLen - i) < seq.length) + continue checkEscapes; + + for (j = 1; j < seq.length; j++) + if (seq[j] != text[i + j]) + continue checkEscapes; + + + hits++; + i += seq.length - 1; + continue scanInput; + } + + misses++; + } + + // Shift in/out + if (text[i] == 0x0e || text[i] == 0x0f) + shifts++; + + } + + if (hits == 0) + return null; + + // + // Initial quality is based on relative proportion of recongized vs. + // unrecognized escape sequences. + // All good: quality = 100; + // half or less good: quality = 0; + // linear inbetween. + quality = (100 * hits - 100 * misses) / (hits + misses); + + // Back off quality if there were too few escape sequences seen. + // Include shifts in this computation, so that KR does not get penalized + // for having only a single Escape sequence, but many shifts. + if (hits + shifts < 5) + quality -= (5 - (hits + shifts)) * 10; + + return quality <= 0 ? null : new Match(det, this, quality); +}; + +module.exports.ISO_2022_JP = function() { + this.name = function() { + return 'ISO-2022-JP'; + }; + this.escapeSequences = [ + [ 0x1b, 0x24, 0x28, 0x43 ], // KS X 1001:1992 + [ 0x1b, 0x24, 0x28, 0x44 ], // JIS X 212-1990 + [ 0x1b, 0x24, 0x40 ], // JIS C 6226-1978 + [ 0x1b, 0x24, 0x41 ], // GB 2312-80 + [ 0x1b, 0x24, 0x42 ], // JIS X 208-1983 + [ 0x1b, 0x26, 0x40 ], // JIS X 208 1990, 1997 + [ 0x1b, 0x28, 0x42 ], // ASCII + [ 0x1b, 0x28, 0x48 ], // JIS-Roman + [ 0x1b, 0x28, 0x49 ], // Half-width katakana + [ 0x1b, 0x28, 0x4a ], // JIS-Roman + [ 0x1b, 0x2e, 0x41 ], // ISO 8859-1 + [ 0x1b, 0x2e, 0x46 ] // ISO 8859-7 + ]; +}; +util.inherits(module.exports.ISO_2022_JP, ISO_2022); + + + +module.exports.ISO_2022_KR = function() { + this.name = function() { + return 'ISO-2022-KR'; + }; + this.escapeSequences = [ + [ 0x1b, 0x24, 0x29, 0x43 ] + ]; +}; +util.inherits(module.exports.ISO_2022_KR, ISO_2022); + + + +module.exports.ISO_2022_CN = function() { + this.name = function() { + return 'ISO-2022-CN'; + }; + this.escapeSequences = [ + [ 0x1b, 0x24, 0x29, 0x41 ], // GB 2312-80 + [ 0x1b, 0x24, 0x29, 0x47 ], // CNS 11643-1992 Plane 1 + [ 0x1b, 0x24, 0x2A, 0x48 ], // CNS 11643-1992 Plane 2 + [ 0x1b, 0x24, 0x29, 0x45 ], // ISO-IR-165 + [ 0x1b, 0x24, 0x2B, 0x49 ], // CNS 11643-1992 Plane 3 + [ 0x1b, 0x24, 0x2B, 0x4A ], // CNS 11643-1992 Plane 4 + [ 0x1b, 0x24, 0x2B, 0x4B ], // CNS 11643-1992 Plane 5 + [ 0x1b, 0x24, 0x2B, 0x4C ], // CNS 11643-1992 Plane 6 + [ 0x1b, 0x24, 0x2B, 0x4D ], // CNS 11643-1992 Plane 7 + [ 0x1b, 0x4e ], // SS2 + [ 0x1b, 0x4f ] // SS3 + ]; +}; +util.inherits(module.exports.ISO_2022_CN, ISO_2022); + + +/***/ }), +/* 700 */ +/***/ (function(module, exports, __webpack_require__) { + +var util = __webpack_require__(3), + Match = __webpack_require__ (142); + +/** + * Binary search implementation (recursive) + */ +function binarySearch(arr, searchValue) { + function find(arr, searchValue, left, right) { + if (right < left) + return -1; + + /* + int mid = mid = (left + right) / 2; + There is a bug in the above line; + Joshua Bloch suggests the following replacement: + */ + var mid = Math.floor((left + right) >>> 1); + if (searchValue > arr[mid]) + return find(arr, searchValue, mid + 1, right); + + if (searchValue < arr[mid]) + return find(arr, searchValue, left, mid - 1); + + return mid; + }; + + return find(arr, searchValue, 0, arr.length - 1); +}; + +// 'Character' iterated character class. +// Recognizers for specific mbcs encodings make their 'characters' available +// by providing a nextChar() function that fills in an instance of iteratedChar +// with the next char from the input. +// The returned characters are not converted to Unicode, but remain as the raw +// bytes (concatenated into an int) from the codepage data. +// +// For Asian charsets, use the raw input rather than the input that has been +// stripped of markup. Detection only considers multi-byte chars, effectively +// stripping markup anyway, and double byte chars do occur in markup too. +// +function IteratedChar() { + + this.charValue = 0; // 1-4 bytes from the raw input data + this.index = 0; + this.nextIndex = 0; + this.error = false; + this.done = false; + + this.reset = function() { + this.charValue = 0; + this.index = -1; + this.nextIndex = 0; + this.error = false; + this.done = false; + }; + + this.nextByte = function(det) { + if (this.nextIndex >= det.fRawLength) { + this.done = true; + return -1; + } + var byteValue = det.fRawInput[this.nextIndex++] & 0x00ff; + return byteValue; + }; +}; + + + +/** + * Asian double or multi-byte - charsets. + * Match is determined mostly by the input data adhering to the + * encoding scheme for the charset, and, optionally, + * frequency-of-occurence of characters. + */ + +function mbcs() {}; + +/** + * Test the match of this charset with the input text data + * which is obtained via the CharsetDetector object. + * + * @param det The CharsetDetector, which contains the input text + * to be checked for being in this charset. + * @return Two values packed into one int (Damn java, anyhow) + * bits 0-7: the match confidence, ranging from 0-100 + * bits 8-15: The match reason, an enum-like value. + */ +mbcs.prototype.match = function(det) { + + var singleByteCharCount = 0, //TODO Do we really need this? + doubleByteCharCount = 0, + commonCharCount = 0, + badCharCount = 0, + totalCharCount = 0, + confidence = 0; + + var iter = new IteratedChar(); + + detectBlock: { + for (iter.reset(); this.nextChar(iter, det);) { + totalCharCount++; + if (iter.error) { + badCharCount++; + } else { + var cv = iter.charValue & 0xFFFFFFFF; + + if (cv <= 0xff) { + singleByteCharCount++; + } else { + doubleByteCharCount++; + if (this.commonChars != null) { + // NOTE: This assumes that there are no 4-byte common chars. + if (binarySearch(this.commonChars, cv) >= 0) { + commonCharCount++; + } + } + } + } + if (badCharCount >= 2 && badCharCount * 5 >= doubleByteCharCount) { + // console.log('its here!') + // Bail out early if the byte data is not matching the encoding scheme. + break detectBlock; + } + } + + if (doubleByteCharCount <= 10 && badCharCount== 0) { + // Not many multi-byte chars. + if (doubleByteCharCount == 0 && totalCharCount < 10) { + // There weren't any multibyte sequences, and there was a low density of non-ASCII single bytes. + // We don't have enough data to have any confidence. + // Statistical analysis of single byte non-ASCII charcters would probably help here. + confidence = 0; + } + else { + // ASCII or ISO file? It's probably not our encoding, + // but is not incompatible with our encoding, so don't give it a zero. + confidence = 10; + } + break detectBlock; + } + + // + // No match if there are too many characters that don't fit the encoding scheme. + // (should we have zero tolerance for these?) + // + if (doubleByteCharCount < 20 * badCharCount) { + confidence = 0; + break detectBlock; + } + + if (this.commonChars == null) { + // We have no statistics on frequently occuring characters. + // Assess confidence purely on having a reasonable number of + // multi-byte characters (the more the better + confidence = 30 + doubleByteCharCount - 20 * badCharCount; + if (confidence > 100) { + confidence = 100; + } + } else { + // + // Frequency of occurence statistics exist. + // + var maxVal = Math.log(parseFloat(doubleByteCharCount) / 4); + var scaleFactor = 90.0 / maxVal; + confidence = Math.floor(Math.log(commonCharCount + 1) * scaleFactor + 10); + confidence = Math.min(confidence, 100); + } + } // end of detectBlock: + + return confidence == 0 ? null : new Match(det, this, confidence); +}; + +/** + * Get the next character (however many bytes it is) from the input data + * Subclasses for specific charset encodings must implement this function + * to get characters according to the rules of their encoding scheme. + * + * This function is not a method of class iteratedChar only because + * that would require a lot of extra derived classes, which is awkward. + * @param it The iteratedChar 'struct' into which the returned char is placed. + * @param det The charset detector, which is needed to get at the input byte data + * being iterated over. + * @return True if a character was returned, false at end of input. + */ + +mbcs.prototype.nextChar = function(iter, det) {}; + + + +/** + * Shift-JIS charset recognizer. + */ +module.exports.sjis = function() { + this.name = function() { + return 'Shift-JIS'; + }; + this.language = function() { + return 'ja'; + }; + + // TODO: This set of data comes from the character frequency- + // of-occurence analysis tool. The data needs to be moved + // into a resource and loaded from there. + this.commonChars = [ + 0x8140, 0x8141, 0x8142, 0x8145, 0x815b, 0x8169, 0x816a, 0x8175, 0x8176, 0x82a0, + 0x82a2, 0x82a4, 0x82a9, 0x82aa, 0x82ab, 0x82ad, 0x82af, 0x82b1, 0x82b3, 0x82b5, + 0x82b7, 0x82bd, 0x82be, 0x82c1, 0x82c4, 0x82c5, 0x82c6, 0x82c8, 0x82c9, 0x82cc, + 0x82cd, 0x82dc, 0x82e0, 0x82e7, 0x82e8, 0x82e9, 0x82ea, 0x82f0, 0x82f1, 0x8341, + 0x8343, 0x834e, 0x834f, 0x8358, 0x835e, 0x8362, 0x8367, 0x8375, 0x8376, 0x8389, + 0x838a, 0x838b, 0x838d, 0x8393, 0x8e96, 0x93fa, 0x95aa + ]; + + this.nextChar = function(iter, det) { + iter.index = iter.nextIndex; + iter.error = false; + + var firstByte; + firstByte = iter.charValue = iter.nextByte(det); + if (firstByte < 0) + return false; + + if (firstByte <= 0x7f || (firstByte > 0xa0 && firstByte <= 0xdf)) + return true; + + var secondByte = iter.nextByte(det); + if (secondByte < 0) + return false; + + iter.charValue = (firstByte << 8) | secondByte; + if (! ((secondByte >= 0x40 && secondByte <= 0x7f) || (secondByte >= 0x80 && secondByte <= 0xff))) { + // Illegal second byte value. + iter.error = true; + } + return true; + }; +}; +util.inherits(module.exports.sjis, mbcs); + + + +/** + * Big5 charset recognizer. + */ +module.exports.big5 = function() { + this.name = function() { + return 'Big5'; + }; + this.language = function() { + return 'zh'; + }; + // TODO: This set of data comes from the character frequency- + // of-occurence analysis tool. The data needs to be moved + // into a resource and loaded from there. + this.commonChars = [ + 0xa140, 0xa141, 0xa142, 0xa143, 0xa147, 0xa149, 0xa175, 0xa176, 0xa440, 0xa446, + 0xa447, 0xa448, 0xa451, 0xa454, 0xa457, 0xa464, 0xa46a, 0xa46c, 0xa477, 0xa4a3, + 0xa4a4, 0xa4a7, 0xa4c1, 0xa4ce, 0xa4d1, 0xa4df, 0xa4e8, 0xa4fd, 0xa540, 0xa548, + 0xa558, 0xa569, 0xa5cd, 0xa5e7, 0xa657, 0xa661, 0xa662, 0xa668, 0xa670, 0xa6a8, + 0xa6b3, 0xa6b9, 0xa6d3, 0xa6db, 0xa6e6, 0xa6f2, 0xa740, 0xa751, 0xa759, 0xa7da, + 0xa8a3, 0xa8a5, 0xa8ad, 0xa8d1, 0xa8d3, 0xa8e4, 0xa8fc, 0xa9c0, 0xa9d2, 0xa9f3, + 0xaa6b, 0xaaba, 0xaabe, 0xaacc, 0xaafc, 0xac47, 0xac4f, 0xacb0, 0xacd2, 0xad59, + 0xaec9, 0xafe0, 0xb0ea, 0xb16f, 0xb2b3, 0xb2c4, 0xb36f, 0xb44c, 0xb44e, 0xb54c, + 0xb5a5, 0xb5bd, 0xb5d0, 0xb5d8, 0xb671, 0xb7ed, 0xb867, 0xb944, 0xbad8, 0xbb44, + 0xbba1, 0xbdd1, 0xc2c4, 0xc3b9, 0xc440, 0xc45f + ]; + this.nextChar = function(iter, det) { + iter.index = iter.nextIndex; + iter.error = false; + + var firstByte = iter.charValue = iter.nextByte(det); + + if (firstByte < 0) + return false; + + // single byte character. + if (firstByte <= 0x7f || firstByte == 0xff) + return true; + + var secondByte = iter.nextByte(det); + + if (secondByte < 0) + return false; + + iter.charValue = (iter.charValue << 8) | secondByte; + + if (secondByte < 0x40 || secondByte == 0x7f || secondByte == 0xff) + iter.error = true; + + return true; + }; +}; +util.inherits(module.exports.big5, mbcs); + + + +/** + * EUC charset recognizers. One abstract class that provides the common function + * for getting the next character according to the EUC encoding scheme, + * and nested derived classes for EUC_KR, EUC_JP, EUC_CN. + * + * Get the next character value for EUC based encodings. + * Character 'value' is simply the raw bytes that make up the character + * packed into an int. + */ +function eucNextChar(iter, det) { + iter.index = iter.nextIndex; + iter.error = false; + var firstByte = 0; + var secondByte = 0; + var thirdByte = 0; + //int fourthByte = 0; + buildChar: { + firstByte = iter.charValue = iter.nextByte(det); + if (firstByte < 0) { + // Ran off the end of the input data + iter.done = true; + break buildChar; + } + if (firstByte <= 0x8d) { + // single byte char + break buildChar; + } + secondByte = iter.nextByte(det); + iter.charValue = (iter.charValue << 8) | secondByte; + if (firstByte >= 0xA1 && firstByte <= 0xfe) { + // Two byte Char + if (secondByte < 0xa1) { + iter.error = true; + } + break buildChar; + } + if (firstByte == 0x8e) { + // Code Set 2. + // In EUC-JP, total char size is 2 bytes, only one byte of actual char value. + // In EUC-TW, total char size is 4 bytes, three bytes contribute to char value. + // We don't know which we've got. + // Treat it like EUC-JP. If the data really was EUC-TW, the following two + // bytes will look like a well formed 2 byte char. + if (secondByte < 0xa1) { + iter.error = true; + } + break buildChar; + } + if (firstByte == 0x8f) { + // Code set 3. + // Three byte total char size, two bytes of actual char value. + thirdByte = iter.nextByte(det); + iter.charValue = (iter.charValue << 8) | thirdByte; + if (thirdByte < 0xa1) { + iter.error = true; + } + } + } + return iter.done == false; +}; + + + +/** + * The charset recognize for EUC-JP. A singleton instance of this class + * is created and kept by the public CharsetDetector class + */ +module.exports.euc_jp = function() { + this.name = function() { + return 'EUC-JP'; + }; + this.language = function() { + return 'ja'; + }; + + // TODO: This set of data comes from the character frequency- + // of-occurence analysis tool. The data needs to be moved + // into a resource and loaded from there. + this.commonChars = [ + 0xa1a1, 0xa1a2, 0xa1a3, 0xa1a6, 0xa1bc, 0xa1ca, 0xa1cb, 0xa1d6, 0xa1d7, 0xa4a2, + 0xa4a4, 0xa4a6, 0xa4a8, 0xa4aa, 0xa4ab, 0xa4ac, 0xa4ad, 0xa4af, 0xa4b1, 0xa4b3, + 0xa4b5, 0xa4b7, 0xa4b9, 0xa4bb, 0xa4bd, 0xa4bf, 0xa4c0, 0xa4c1, 0xa4c3, 0xa4c4, + 0xa4c6, 0xa4c7, 0xa4c8, 0xa4c9, 0xa4ca, 0xa4cb, 0xa4ce, 0xa4cf, 0xa4d0, 0xa4de, + 0xa4df, 0xa4e1, 0xa4e2, 0xa4e4, 0xa4e8, 0xa4e9, 0xa4ea, 0xa4eb, 0xa4ec, 0xa4ef, + 0xa4f2, 0xa4f3, 0xa5a2, 0xa5a3, 0xa5a4, 0xa5a6, 0xa5a7, 0xa5aa, 0xa5ad, 0xa5af, + 0xa5b0, 0xa5b3, 0xa5b5, 0xa5b7, 0xa5b8, 0xa5b9, 0xa5bf, 0xa5c3, 0xa5c6, 0xa5c7, + 0xa5c8, 0xa5c9, 0xa5cb, 0xa5d0, 0xa5d5, 0xa5d6, 0xa5d7, 0xa5de, 0xa5e0, 0xa5e1, + 0xa5e5, 0xa5e9, 0xa5ea, 0xa5eb, 0xa5ec, 0xa5ed, 0xa5f3, 0xb8a9, 0xb9d4, 0xbaee, + 0xbbc8, 0xbef0, 0xbfb7, 0xc4ea, 0xc6fc, 0xc7bd, 0xcab8, 0xcaf3, 0xcbdc, 0xcdd1 + ]; + + this.nextChar = eucNextChar; +}; +util.inherits(module.exports.euc_jp, mbcs); + + + +/** + * The charset recognize for EUC-KR. A singleton instance of this class + * is created and kept by the public CharsetDetector class + */ +module.exports.euc_kr = function() { + this.name = function() { + return 'EUC-KR'; + }; + this.language = function() { + return 'ko'; + }; + + // TODO: This set of data comes from the character frequency- + // of-occurence analysis tool. The data needs to be moved + // into a resource and loaded from there. + this.commonChars = [ + 0xb0a1, 0xb0b3, 0xb0c5, 0xb0cd, 0xb0d4, 0xb0e6, 0xb0ed, 0xb0f8, 0xb0fa, 0xb0fc, + 0xb1b8, 0xb1b9, 0xb1c7, 0xb1d7, 0xb1e2, 0xb3aa, 0xb3bb, 0xb4c2, 0xb4cf, 0xb4d9, + 0xb4eb, 0xb5a5, 0xb5b5, 0xb5bf, 0xb5c7, 0xb5e9, 0xb6f3, 0xb7af, 0xb7c2, 0xb7ce, + 0xb8a6, 0xb8ae, 0xb8b6, 0xb8b8, 0xb8bb, 0xb8e9, 0xb9ab, 0xb9ae, 0xb9cc, 0xb9ce, + 0xb9fd, 0xbab8, 0xbace, 0xbad0, 0xbaf1, 0xbbe7, 0xbbf3, 0xbbfd, 0xbcad, 0xbcba, + 0xbcd2, 0xbcf6, 0xbdba, 0xbdc0, 0xbdc3, 0xbdc5, 0xbec6, 0xbec8, 0xbedf, 0xbeee, + 0xbef8, 0xbefa, 0xbfa1, 0xbfa9, 0xbfc0, 0xbfe4, 0xbfeb, 0xbfec, 0xbff8, 0xc0a7, + 0xc0af, 0xc0b8, 0xc0ba, 0xc0bb, 0xc0bd, 0xc0c7, 0xc0cc, 0xc0ce, 0xc0cf, 0xc0d6, + 0xc0da, 0xc0e5, 0xc0fb, 0xc0fc, 0xc1a4, 0xc1a6, 0xc1b6, 0xc1d6, 0xc1df, 0xc1f6, + 0xc1f8, 0xc4a1, 0xc5cd, 0xc6ae, 0xc7cf, 0xc7d1, 0xc7d2, 0xc7d8, 0xc7e5, 0xc8ad + ]; + + this.nextChar = eucNextChar; +}; +util.inherits(module.exports.euc_kr, mbcs); + + + +/** + * GB-18030 recognizer. Uses simplified Chinese statistics. + */ +module.exports.gb_18030 = function() { + this.name = function() { + return 'GB18030'; + }; + this.language = function() { + return 'zh'; + }; + + /* + * Get the next character value for EUC based encodings. + * Character 'value' is simply the raw bytes that make up the character + * packed into an int. + */ + this.nextChar = function(iter, det) { + iter.index = iter.nextIndex; + iter.error = false; + var firstByte = 0; + var secondByte = 0; + var thirdByte = 0; + var fourthByte = 0; + buildChar: { + firstByte = iter.charValue = iter.nextByte(det); + if (firstByte < 0) { + // Ran off the end of the input data + iter.done = true; + break buildChar; + } + if (firstByte <= 0x80) { + // single byte char + break buildChar; + } + secondByte = iter.nextByte(det); + iter.charValue = (iter.charValue << 8) | secondByte; + if (firstByte >= 0x81 && firstByte <= 0xFE) { + // Two byte Char + if ((secondByte >= 0x40 && secondByte <= 0x7E) || (secondByte >=80 && secondByte <= 0xFE)) { + break buildChar; + } + // Four byte char + if (secondByte >= 0x30 && secondByte <= 0x39) { + thirdByte = iter.nextByte(det); + if (thirdByte >= 0x81 && thirdByte <= 0xFE) { + fourthByte = iter.nextByte(det); + if (fourthByte >= 0x30 && fourthByte <= 0x39) { + iter.charValue = (iter.charValue << 16) | (thirdByte << 8) | fourthByte; + break buildChar; + } + } + } + iter.error = true; + break buildChar; + } + } + return iter.done == false; + }; + + // TODO: This set of data comes from the character frequency- + // of-occurence analysis tool. The data needs to be moved + // into a resource and loaded from there. + this.commonChars = [ + 0xa1a1, 0xa1a2, 0xa1a3, 0xa1a4, 0xa1b0, 0xa1b1, 0xa1f1, 0xa1f3, 0xa3a1, 0xa3ac, + 0xa3ba, 0xb1a8, 0xb1b8, 0xb1be, 0xb2bb, 0xb3c9, 0xb3f6, 0xb4f3, 0xb5bd, 0xb5c4, + 0xb5e3, 0xb6af, 0xb6d4, 0xb6e0, 0xb7a2, 0xb7a8, 0xb7bd, 0xb7d6, 0xb7dd, 0xb8b4, + 0xb8df, 0xb8f6, 0xb9ab, 0xb9c9, 0xb9d8, 0xb9fa, 0xb9fd, 0xbacd, 0xbba7, 0xbbd6, + 0xbbe1, 0xbbfa, 0xbcbc, 0xbcdb, 0xbcfe, 0xbdcc, 0xbecd, 0xbedd, 0xbfb4, 0xbfc6, + 0xbfc9, 0xc0b4, 0xc0ed, 0xc1cb, 0xc2db, 0xc3c7, 0xc4dc, 0xc4ea, 0xc5cc, 0xc6f7, + 0xc7f8, 0xc8ab, 0xc8cb, 0xc8d5, 0xc8e7, 0xc9cf, 0xc9fa, 0xcab1, 0xcab5, 0xcac7, + 0xcad0, 0xcad6, 0xcaf5, 0xcafd, 0xccec, 0xcdf8, 0xceaa, 0xcec4, 0xced2, 0xcee5, + 0xcfb5, 0xcfc2, 0xcfd6, 0xd0c2, 0xd0c5, 0xd0d0, 0xd0d4, 0xd1a7, 0xd2aa, 0xd2b2, + 0xd2b5, 0xd2bb, 0xd2d4, 0xd3c3, 0xd3d0, 0xd3fd, 0xd4c2, 0xd4da, 0xd5e2, 0xd6d0 + ]; +}; +util.inherits(module.exports.gb_18030, mbcs); + + +/***/ }), +/* 701 */ +/***/ (function(module, exports, __webpack_require__) { + +var util = __webpack_require__(3), + Match = __webpack_require__ (142); + +/** + * This class recognizes single-byte encodings. Because the encoding scheme is so + * simple, language statistics are used to do the matching. + */ + +function NGramParser(theNgramList, theByteMap) { + var N_GRAM_MASK = 0xFFFFFF; + + this.byteIndex = 0; + this.ngram = 0; + + this.ngramList = theNgramList; + this.byteMap = theByteMap; + + this.ngramCount = 0; + this.hitCount = 0; + + this.spaceChar; + + /* + * Binary search for value in table, which must have exactly 64 entries. + */ + this.search = function(table, value) { + var index = 0; + + if (table[index + 32] <= value) index += 32; + if (table[index + 16] <= value) index += 16; + if (table[index + 8] <= value) index += 8; + if (table[index + 4] <= value) index += 4; + if (table[index + 2] <= value) index += 2; + if (table[index + 1] <= value) index += 1; + if (table[index] > value) index -= 1; + + if (index < 0 || table[index] != value) + return -1; + + return index; + }; + + this.lookup = function(thisNgram) { + this.ngramCount += 1; + if (this.search(this.ngramList, thisNgram) >= 0) { + this.hitCount += 1; + } + }; + + this.addByte = function(b) { + this.ngram = ((this.ngram << 8) + (b & 0xFF)) & N_GRAM_MASK; + this.lookup(this.ngram); + } + + this.nextByte = function(det) { + if (this.byteIndex >= det.fInputLen) + return -1; + + return det.fInputBytes[this.byteIndex++] & 0xFF; + } + + this.parse = function(det, spaceCh) { + var b, ignoreSpace = false; + this.spaceChar = spaceCh; + + while ((b = this.nextByte(det)) >= 0) { + var mb = this.byteMap[b]; + + // TODO: 0x20 might not be a space in all character sets... + if (mb != 0) { + if (!(mb == this.spaceChar && ignoreSpace)) { + this.addByte(mb); + } + + ignoreSpace = (mb == this.spaceChar); + } + } + + // TODO: Is this OK? The buffer could have ended in the middle of a word... + this.addByte(this.spaceChar); + + var rawPercent = this.hitCount / this.ngramCount; + + // TODO - This is a bit of a hack to take care of a case + // were we were getting a confidence of 135... + if (rawPercent > 0.33) + return 98; + + return Math.floor(rawPercent * 300.0); + }; +}; + +function NGramsPlusLang(la, ng) { + this.fLang = la; + this.fNGrams = ng; +}; + +function sbcs() {}; +sbcs.prototype.spaceChar = 0x20; +sbcs.prototype.ngrams = function() {}; +sbcs.prototype.byteMap = function() {}; +sbcs.prototype.match = function(det) { + + var ngrams = this.ngrams(); + var multiple = (Array.isArray(ngrams) && ngrams[0] instanceof NGramsPlusLang); + + if (!multiple) { + var parser = new NGramParser(ngrams, this.byteMap()); + var confidence = parser.parse(det, this.spaceChar); + return confidence <= 0 ? null : new Match(det, this, confidence); + } + + var bestConfidenceSoFar = -1; + var lang = null; + + for (var i = ngrams.length - 1; i >= 0; i--) { + var ngl = ngrams[i]; + + var parser = new NGramParser(ngl.fNGrams, this.byteMap()); + var confidence = parser.parse(det, this.spaceChar); + if (confidence > bestConfidenceSoFar) { + bestConfidenceSoFar = confidence; + lang = ngl.fLang; + } + } + + var name = this.name(det); + return bestConfidenceSoFar <= 0 ? null : new Match(det, this, bestConfidenceSoFar, name, lang); +}; + + +module.exports.ISO_8859_1 = function() { + this.byteMap = function() { + return [ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0xAA, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0xB5, 0x20, 0x20, + 0x20, 0x20, 0xBA, 0x20, 0x20, 0x20, 0x20, 0x20, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20, + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20, + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF + ]; + }; + + this.ngrams = function() { + return [ + new NGramsPlusLang('da', [ + 0x206166, 0x206174, 0x206465, 0x20656E, 0x206572, 0x20666F, 0x206861, 0x206920, + 0x206D65, 0x206F67, 0x2070E5, 0x207369, 0x207374, 0x207469, 0x207669, 0x616620, + 0x616E20, 0x616E64, 0x617220, 0x617420, 0x646520, 0x64656E, 0x646572, 0x646574, + 0x652073, 0x656420, 0x656465, 0x656E20, 0x656E64, 0x657220, 0x657265, 0x657320, + 0x657420, 0x666F72, 0x676520, 0x67656E, 0x676572, 0x696765, 0x696C20, 0x696E67, + 0x6B6520, 0x6B6B65, 0x6C6572, 0x6C6967, 0x6C6C65, 0x6D6564, 0x6E6465, 0x6E6520, + 0x6E6720, 0x6E6765, 0x6F6720, 0x6F6D20, 0x6F7220, 0x70E520, 0x722064, 0x722065, + 0x722073, 0x726520, 0x737465, 0x742073, 0x746520, 0x746572, 0x74696C, 0x766572 + ]), + new NGramsPlusLang('de', [ + 0x20616E, 0x206175, 0x206265, 0x206461, 0x206465, 0x206469, 0x206569, 0x206765, + 0x206861, 0x20696E, 0x206D69, 0x207363, 0x207365, 0x20756E, 0x207665, 0x20766F, + 0x207765, 0x207A75, 0x626572, 0x636820, 0x636865, 0x636874, 0x646173, 0x64656E, + 0x646572, 0x646965, 0x652064, 0x652073, 0x65696E, 0x656974, 0x656E20, 0x657220, + 0x657320, 0x67656E, 0x68656E, 0x687420, 0x696368, 0x696520, 0x696E20, 0x696E65, + 0x697420, 0x6C6963, 0x6C6C65, 0x6E2061, 0x6E2064, 0x6E2073, 0x6E6420, 0x6E6465, + 0x6E6520, 0x6E6720, 0x6E6765, 0x6E7465, 0x722064, 0x726465, 0x726569, 0x736368, + 0x737465, 0x742064, 0x746520, 0x74656E, 0x746572, 0x756E64, 0x756E67, 0x766572 + ]), + new NGramsPlusLang('en', [ + 0x206120, 0x20616E, 0x206265, 0x20636F, 0x20666F, 0x206861, 0x206865, 0x20696E, + 0x206D61, 0x206F66, 0x207072, 0x207265, 0x207361, 0x207374, 0x207468, 0x20746F, + 0x207768, 0x616964, 0x616C20, 0x616E20, 0x616E64, 0x617320, 0x617420, 0x617465, + 0x617469, 0x642061, 0x642074, 0x652061, 0x652073, 0x652074, 0x656420, 0x656E74, + 0x657220, 0x657320, 0x666F72, 0x686174, 0x686520, 0x686572, 0x696420, 0x696E20, + 0x696E67, 0x696F6E, 0x697320, 0x6E2061, 0x6E2074, 0x6E6420, 0x6E6720, 0x6E7420, + 0x6F6620, 0x6F6E20, 0x6F7220, 0x726520, 0x727320, 0x732061, 0x732074, 0x736169, + 0x737420, 0x742074, 0x746572, 0x746861, 0x746865, 0x74696F, 0x746F20, 0x747320 + ]), + new NGramsPlusLang('es', [ + 0x206120, 0x206361, 0x20636F, 0x206465, 0x20656C, 0x20656E, 0x206573, 0x20696E, + 0x206C61, 0x206C6F, 0x207061, 0x20706F, 0x207072, 0x207175, 0x207265, 0x207365, + 0x20756E, 0x207920, 0x612063, 0x612064, 0x612065, 0x61206C, 0x612070, 0x616369, + 0x61646F, 0x616C20, 0x617220, 0x617320, 0x6369F3, 0x636F6E, 0x646520, 0x64656C, + 0x646F20, 0x652064, 0x652065, 0x65206C, 0x656C20, 0x656E20, 0x656E74, 0x657320, + 0x657374, 0x69656E, 0x69F36E, 0x6C6120, 0x6C6F73, 0x6E2065, 0x6E7465, 0x6F2064, + 0x6F2065, 0x6F6E20, 0x6F7220, 0x6F7320, 0x706172, 0x717565, 0x726120, 0x726573, + 0x732064, 0x732065, 0x732070, 0x736520, 0x746520, 0x746F20, 0x756520, 0xF36E20 + ]), + new NGramsPlusLang('fr', [ + 0x206175, 0x20636F, 0x206461, 0x206465, 0x206475, 0x20656E, 0x206574, 0x206C61, + 0x206C65, 0x207061, 0x20706F, 0x207072, 0x207175, 0x207365, 0x20736F, 0x20756E, + 0x20E020, 0x616E74, 0x617469, 0x636520, 0x636F6E, 0x646520, 0x646573, 0x647520, + 0x652061, 0x652063, 0x652064, 0x652065, 0x65206C, 0x652070, 0x652073, 0x656E20, + 0x656E74, 0x657220, 0x657320, 0x657420, 0x657572, 0x696F6E, 0x697320, 0x697420, + 0x6C6120, 0x6C6520, 0x6C6573, 0x6D656E, 0x6E2064, 0x6E6520, 0x6E7320, 0x6E7420, + 0x6F6E20, 0x6F6E74, 0x6F7572, 0x717565, 0x72206C, 0x726520, 0x732061, 0x732064, + 0x732065, 0x73206C, 0x732070, 0x742064, 0x746520, 0x74696F, 0x756520, 0x757220 + ]), + new NGramsPlusLang('it', [ + 0x20616C, 0x206368, 0x20636F, 0x206465, 0x206469, 0x206520, 0x20696C, 0x20696E, + 0x206C61, 0x207065, 0x207072, 0x20756E, 0x612063, 0x612064, 0x612070, 0x612073, + 0x61746F, 0x636865, 0x636F6E, 0x64656C, 0x646920, 0x652061, 0x652063, 0x652064, + 0x652069, 0x65206C, 0x652070, 0x652073, 0x656C20, 0x656C6C, 0x656E74, 0x657220, + 0x686520, 0x692061, 0x692063, 0x692064, 0x692073, 0x696120, 0x696C20, 0x696E20, + 0x696F6E, 0x6C6120, 0x6C6520, 0x6C6920, 0x6C6C61, 0x6E6520, 0x6E6920, 0x6E6F20, + 0x6E7465, 0x6F2061, 0x6F2064, 0x6F2069, 0x6F2073, 0x6F6E20, 0x6F6E65, 0x706572, + 0x726120, 0x726520, 0x736920, 0x746120, 0x746520, 0x746920, 0x746F20, 0x7A696F + ]), + new NGramsPlusLang('nl', [ + 0x20616C, 0x206265, 0x206461, 0x206465, 0x206469, 0x206565, 0x20656E, 0x206765, + 0x206865, 0x20696E, 0x206D61, 0x206D65, 0x206F70, 0x207465, 0x207661, 0x207665, + 0x20766F, 0x207765, 0x207A69, 0x61616E, 0x616172, 0x616E20, 0x616E64, 0x617220, + 0x617420, 0x636874, 0x646520, 0x64656E, 0x646572, 0x652062, 0x652076, 0x65656E, + 0x656572, 0x656E20, 0x657220, 0x657273, 0x657420, 0x67656E, 0x686574, 0x696520, + 0x696E20, 0x696E67, 0x697320, 0x6E2062, 0x6E2064, 0x6E2065, 0x6E2068, 0x6E206F, + 0x6E2076, 0x6E6465, 0x6E6720, 0x6F6E64, 0x6F6F72, 0x6F7020, 0x6F7220, 0x736368, + 0x737465, 0x742064, 0x746520, 0x74656E, 0x746572, 0x76616E, 0x766572, 0x766F6F + ]), + new NGramsPlusLang('no', [ + 0x206174, 0x206176, 0x206465, 0x20656E, 0x206572, 0x20666F, 0x206861, 0x206920, + 0x206D65, 0x206F67, 0x2070E5, 0x207365, 0x20736B, 0x20736F, 0x207374, 0x207469, + 0x207669, 0x20E520, 0x616E64, 0x617220, 0x617420, 0x646520, 0x64656E, 0x646574, + 0x652073, 0x656420, 0x656E20, 0x656E65, 0x657220, 0x657265, 0x657420, 0x657474, + 0x666F72, 0x67656E, 0x696B6B, 0x696C20, 0x696E67, 0x6B6520, 0x6B6B65, 0x6C6520, + 0x6C6C65, 0x6D6564, 0x6D656E, 0x6E2073, 0x6E6520, 0x6E6720, 0x6E6765, 0x6E6E65, + 0x6F6720, 0x6F6D20, 0x6F7220, 0x70E520, 0x722073, 0x726520, 0x736F6D, 0x737465, + 0x742073, 0x746520, 0x74656E, 0x746572, 0x74696C, 0x747420, 0x747465, 0x766572 + ]), + new NGramsPlusLang('pt', [ + 0x206120, 0x20636F, 0x206461, 0x206465, 0x20646F, 0x206520, 0x206573, 0x206D61, + 0x206E6F, 0x206F20, 0x207061, 0x20706F, 0x207072, 0x207175, 0x207265, 0x207365, + 0x20756D, 0x612061, 0x612063, 0x612064, 0x612070, 0x616465, 0x61646F, 0x616C20, + 0x617220, 0x617261, 0x617320, 0x636F6D, 0x636F6E, 0x646120, 0x646520, 0x646F20, + 0x646F73, 0x652061, 0x652064, 0x656D20, 0x656E74, 0x657320, 0x657374, 0x696120, + 0x696361, 0x6D656E, 0x6E7465, 0x6E746F, 0x6F2061, 0x6F2063, 0x6F2064, 0x6F2065, + 0x6F2070, 0x6F7320, 0x706172, 0x717565, 0x726120, 0x726573, 0x732061, 0x732064, + 0x732065, 0x732070, 0x737461, 0x746520, 0x746F20, 0x756520, 0xE36F20, 0xE7E36F + ]), + new NGramsPlusLang('sv', [ + 0x206174, 0x206176, 0x206465, 0x20656E, 0x2066F6, 0x206861, 0x206920, 0x20696E, + 0x206B6F, 0x206D65, 0x206F63, 0x2070E5, 0x20736B, 0x20736F, 0x207374, 0x207469, + 0x207661, 0x207669, 0x20E472, 0x616465, 0x616E20, 0x616E64, 0x617220, 0x617474, + 0x636820, 0x646520, 0x64656E, 0x646572, 0x646574, 0x656420, 0x656E20, 0x657220, + 0x657420, 0x66F672, 0x67656E, 0x696C6C, 0x696E67, 0x6B6120, 0x6C6C20, 0x6D6564, + 0x6E2073, 0x6E6120, 0x6E6465, 0x6E6720, 0x6E6765, 0x6E696E, 0x6F6368, 0x6F6D20, + 0x6F6E20, 0x70E520, 0x722061, 0x722073, 0x726120, 0x736B61, 0x736F6D, 0x742073, + 0x746120, 0x746520, 0x746572, 0x74696C, 0x747420, 0x766172, 0xE47220, 0xF67220, + ]) + ]; + }; + + this.name = function(det) { + return (det && det.fC1Bytes) ? 'windows-1252' : 'ISO-8859-1'; + }; +}; +util.inherits(module.exports.ISO_8859_1, sbcs); + + +module.exports.ISO_8859_2 = function() { + this.byteMap = function() { + return [ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0xB1, 0x20, 0xB3, 0x20, 0xB5, 0xB6, 0x20, + 0x20, 0xB9, 0xBA, 0xBB, 0xBC, 0x20, 0xBE, 0xBF, + 0x20, 0xB1, 0x20, 0xB3, 0x20, 0xB5, 0xB6, 0xB7, + 0x20, 0xB9, 0xBA, 0xBB, 0xBC, 0x20, 0xBE, 0xBF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20, + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20, + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0x20 + ]; + } + + this.ngrams = function() { + return [ + new NGramsPlusLang('cs', [ + 0x206120, 0x206279, 0x20646F, 0x206A65, 0x206E61, 0x206E65, 0x206F20, 0x206F64, + 0x20706F, 0x207072, 0x2070F8, 0x20726F, 0x207365, 0x20736F, 0x207374, 0x20746F, + 0x207620, 0x207679, 0x207A61, 0x612070, 0x636520, 0x636820, 0x652070, 0x652073, + 0x652076, 0x656D20, 0x656EED, 0x686F20, 0x686F64, 0x697374, 0x6A6520, 0x6B7465, + 0x6C6520, 0x6C6920, 0x6E6120, 0x6EE920, 0x6EEC20, 0x6EED20, 0x6F2070, 0x6F646E, + 0x6F6A69, 0x6F7374, 0x6F7520, 0x6F7661, 0x706F64, 0x706F6A, 0x70726F, 0x70F865, + 0x736520, 0x736F75, 0x737461, 0x737469, 0x73746E, 0x746572, 0x746EED, 0x746F20, + 0x752070, 0xBE6520, 0xE16EED, 0xE9686F, 0xED2070, 0xED2073, 0xED6D20, 0xF86564, + ]), + new NGramsPlusLang('hu', [ + 0x206120, 0x20617A, 0x206265, 0x206567, 0x20656C, 0x206665, 0x206861, 0x20686F, + 0x206973, 0x206B65, 0x206B69, 0x206BF6, 0x206C65, 0x206D61, 0x206D65, 0x206D69, + 0x206E65, 0x20737A, 0x207465, 0x20E973, 0x612061, 0x61206B, 0x61206D, 0x612073, + 0x616B20, 0x616E20, 0x617A20, 0x62616E, 0x62656E, 0x656779, 0x656B20, 0x656C20, + 0x656C65, 0x656D20, 0x656E20, 0x657265, 0x657420, 0x657465, 0x657474, 0x677920, + 0x686F67, 0x696E74, 0x697320, 0x6B2061, 0x6BF67A, 0x6D6567, 0x6D696E, 0x6E2061, + 0x6E616B, 0x6E656B, 0x6E656D, 0x6E7420, 0x6F6779, 0x732061, 0x737A65, 0x737A74, + 0x737AE1, 0x73E967, 0x742061, 0x747420, 0x74E173, 0x7A6572, 0xE16E20, 0xE97320, + ]), + new NGramsPlusLang('pl', [ + 0x20637A, 0x20646F, 0x206920, 0x206A65, 0x206B6F, 0x206D61, 0x206D69, 0x206E61, + 0x206E69, 0x206F64, 0x20706F, 0x207072, 0x207369, 0x207720, 0x207769, 0x207779, + 0x207A20, 0x207A61, 0x612070, 0x612077, 0x616E69, 0x636820, 0x637A65, 0x637A79, + 0x646F20, 0x647A69, 0x652070, 0x652073, 0x652077, 0x65207A, 0x65676F, 0x656A20, + 0x656D20, 0x656E69, 0x676F20, 0x696120, 0x696520, 0x69656A, 0x6B6120, 0x6B6920, + 0x6B6965, 0x6D6965, 0x6E6120, 0x6E6961, 0x6E6965, 0x6F2070, 0x6F7761, 0x6F7769, + 0x706F6C, 0x707261, 0x70726F, 0x70727A, 0x727A65, 0x727A79, 0x7369EA, 0x736B69, + 0x737461, 0x776965, 0x796368, 0x796D20, 0x7A6520, 0x7A6965, 0x7A7920, 0xF37720, + ]), + new NGramsPlusLang('ro', [ + 0x206120, 0x206163, 0x206361, 0x206365, 0x20636F, 0x206375, 0x206465, 0x206469, + 0x206C61, 0x206D61, 0x207065, 0x207072, 0x207365, 0x2073E3, 0x20756E, 0x20BA69, + 0x20EE6E, 0x612063, 0x612064, 0x617265, 0x617420, 0x617465, 0x617520, 0x636172, + 0x636F6E, 0x637520, 0x63E320, 0x646520, 0x652061, 0x652063, 0x652064, 0x652070, + 0x652073, 0x656120, 0x656920, 0x656C65, 0x656E74, 0x657374, 0x692061, 0x692063, + 0x692064, 0x692070, 0x696520, 0x696920, 0x696E20, 0x6C6120, 0x6C6520, 0x6C6F72, + 0x6C7569, 0x6E6520, 0x6E7472, 0x6F7220, 0x70656E, 0x726520, 0x726561, 0x727520, + 0x73E320, 0x746520, 0x747275, 0x74E320, 0x756920, 0x756C20, 0xBA6920, 0xEE6E20, + ]) + ]; + }; + + this.name = function(det) { + return (det && det.fC1Bytes) ? 'windows-1250' : 'ISO-8859-2'; + }; +}; +util.inherits(module.exports.ISO_8859_2, sbcs); + + +module.exports.ISO_8859_5 = function() { + this.byteMap = function() { + return [ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0x20, 0xFE, 0xFF, + 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, + 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, + 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0x20, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0x20, 0xFE, 0xFF + ]; + }; + + this.ngrams = function() { + return [ + 0x20D220, 0x20D2DE, 0x20D4DE, 0x20D7D0, 0x20D820, 0x20DAD0, 0x20DADE, 0x20DDD0, + 0x20DDD5, 0x20DED1, 0x20DFDE, 0x20DFE0, 0x20E0D0, 0x20E1DE, 0x20E1E2, 0x20E2DE, + 0x20E7E2, 0x20EDE2, 0xD0DDD8, 0xD0E2EC, 0xD3DE20, 0xD5DBEC, 0xD5DDD8, 0xD5E1E2, + 0xD5E220, 0xD820DF, 0xD8D520, 0xD8D820, 0xD8EF20, 0xDBD5DD, 0xDBD820, 0xDBECDD, + 0xDDD020, 0xDDD520, 0xDDD8D5, 0xDDD8EF, 0xDDDE20, 0xDDDED2, 0xDE20D2, 0xDE20DF, + 0xDE20E1, 0xDED220, 0xDED2D0, 0xDED3DE, 0xDED920, 0xDEDBEC, 0xDEDC20, 0xDEE1E2, + 0xDFDEDB, 0xDFE0D5, 0xDFE0D8, 0xDFE0DE, 0xE0D0D2, 0xE0D5D4, 0xE1E2D0, 0xE1E2D2, + 0xE1E2D8, 0xE1EF20, 0xE2D5DB, 0xE2DE20, 0xE2DEE0, 0xE2EC20, 0xE7E2DE, 0xEBE520 + ]; + }; + + this.name = function(det) { + return 'ISO-8859-5'; + }; + + this.language = function() { + return 'ru'; + }; +}; +util.inherits(module.exports.ISO_8859_5, sbcs); + + +module.exports.ISO_8859_6 = function() { + this.byteMap = function() { + return [ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, + 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, + 0xD8, 0xD9, 0xDA, 0x20, 0x20, 0x20, 0x20, 0x20, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 + ]; + }; + + this.ngrams = function() { + return [ + 0x20C7E4, 0x20C7E6, 0x20C8C7, 0x20D9E4, 0x20E1EA, 0x20E4E4, 0x20E5E6, 0x20E8C7, + 0xC720C7, 0xC7C120, 0xC7CA20, 0xC7D120, 0xC7E420, 0xC7E4C3, 0xC7E4C7, 0xC7E4C8, + 0xC7E4CA, 0xC7E4CC, 0xC7E4CD, 0xC7E4CF, 0xC7E4D3, 0xC7E4D9, 0xC7E4E2, 0xC7E4E5, + 0xC7E4E8, 0xC7E4EA, 0xC7E520, 0xC7E620, 0xC7E6CA, 0xC820C7, 0xC920C7, 0xC920E1, + 0xC920E4, 0xC920E5, 0xC920E8, 0xCA20C7, 0xCF20C7, 0xCFC920, 0xD120C7, 0xD1C920, + 0xD320C7, 0xD920C7, 0xD9E4E9, 0xE1EA20, 0xE420C7, 0xE4C920, 0xE4E920, 0xE4EA20, + 0xE520C7, 0xE5C720, 0xE5C920, 0xE5E620, 0xE620C7, 0xE720C7, 0xE7C720, 0xE8C7E4, + 0xE8E620, 0xE920C7, 0xEA20C7, 0xEA20E5, 0xEA20E8, 0xEAC920, 0xEAD120, 0xEAE620 + ]; + }; + + this.name = function(det) { + return 'ISO-8859-6'; + }; + + this.language = function() { + return 'ar'; + }; +}; +util.inherits(module.exports.ISO_8859_6, sbcs); + + +module.exports.ISO_8859_7 = function() { + this.byteMap = function() { + return [ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0xA1, 0xA2, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xDC, 0x20, + 0xDD, 0xDE, 0xDF, 0x20, 0xFC, 0x20, 0xFD, 0xFE, + 0xC0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0x20, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + 0xF8, 0xF9, 0xFA, 0xFB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0x20 + ]; + }; + + this.ngrams = function() { + return [ + 0x20E1ED, 0x20E1F0, 0x20E3E9, 0x20E4E9, 0x20E5F0, 0x20E720, 0x20EAE1, 0x20ECE5, + 0x20EDE1, 0x20EF20, 0x20F0E1, 0x20F0EF, 0x20F0F1, 0x20F3F4, 0x20F3F5, 0x20F4E7, + 0x20F4EF, 0xDFE120, 0xE120E1, 0xE120F4, 0xE1E920, 0xE1ED20, 0xE1F0FC, 0xE1F220, + 0xE3E9E1, 0xE5E920, 0xE5F220, 0xE720F4, 0xE7ED20, 0xE7F220, 0xE920F4, 0xE9E120, + 0xE9EADE, 0xE9F220, 0xEAE1E9, 0xEAE1F4, 0xECE520, 0xED20E1, 0xED20E5, 0xED20F0, + 0xEDE120, 0xEFF220, 0xEFF520, 0xF0EFF5, 0xF0F1EF, 0xF0FC20, 0xF220E1, 0xF220E5, + 0xF220EA, 0xF220F0, 0xF220F4, 0xF3E520, 0xF3E720, 0xF3F4EF, 0xF4E120, 0xF4E1E9, + 0xF4E7ED, 0xF4E7F2, 0xF4E9EA, 0xF4EF20, 0xF4EFF5, 0xF4F9ED, 0xF9ED20, 0xFEED20 + ]; + }; + + this.name = function(det) { + return (det && det.fC1Bytes) ? 'windows-1253' : 'ISO-8859-7'; + }; + + this.language = function() { + return 'el'; + }; +}; +util.inherits(module.exports.ISO_8859_7, sbcs); + +module.exports.ISO_8859_8 = function() { + + this.byteMap = function() { + return [ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0xB5, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + 0xF8, 0xF9, 0xFA, 0x20, 0x20, 0x20, 0x20, 0x20 + ]; + }; + + this.ngrams = function() { + return [ + new NGramsPlusLang('he', [ + 0x20E0E5, 0x20E0E7, 0x20E0E9, 0x20E0FA, 0x20E1E9, 0x20E1EE, 0x20E4E0, 0x20E4E5, + 0x20E4E9, 0x20E4EE, 0x20E4F2, 0x20E4F9, 0x20E4FA, 0x20ECE0, 0x20ECE4, 0x20EEE0, + 0x20F2EC, 0x20F9EC, 0xE0FA20, 0xE420E0, 0xE420E1, 0xE420E4, 0xE420EC, 0xE420EE, + 0xE420F9, 0xE4E5E0, 0xE5E020, 0xE5ED20, 0xE5EF20, 0xE5F820, 0xE5FA20, 0xE920E4, + 0xE9E420, 0xE9E5FA, 0xE9E9ED, 0xE9ED20, 0xE9EF20, 0xE9F820, 0xE9FA20, 0xEC20E0, + 0xEC20E4, 0xECE020, 0xECE420, 0xED20E0, 0xED20E1, 0xED20E4, 0xED20EC, 0xED20EE, + 0xED20F9, 0xEEE420, 0xEF20E4, 0xF0E420, 0xF0E920, 0xF0E9ED, 0xF2EC20, 0xF820E4, + 0xF8E9ED, 0xF9EC20, 0xFA20E0, 0xFA20E1, 0xFA20E4, 0xFA20EC, 0xFA20EE, 0xFA20F9, + ]), + new NGramsPlusLang('he', [ + 0x20E0E5, 0x20E0EC, 0x20E4E9, 0x20E4EC, 0x20E4EE, 0x20E4F0, 0x20E9F0, 0x20ECF2, + 0x20ECF9, 0x20EDE5, 0x20EDE9, 0x20EFE5, 0x20EFE9, 0x20F8E5, 0x20F8E9, 0x20FAE0, + 0x20FAE5, 0x20FAE9, 0xE020E4, 0xE020EC, 0xE020ED, 0xE020FA, 0xE0E420, 0xE0E5E4, + 0xE0EC20, 0xE0EE20, 0xE120E4, 0xE120ED, 0xE120FA, 0xE420E4, 0xE420E9, 0xE420EC, + 0xE420ED, 0xE420EF, 0xE420F8, 0xE420FA, 0xE4EC20, 0xE5E020, 0xE5E420, 0xE7E020, + 0xE9E020, 0xE9E120, 0xE9E420, 0xEC20E4, 0xEC20ED, 0xEC20FA, 0xECF220, 0xECF920, + 0xEDE9E9, 0xEDE9F0, 0xEDE9F8, 0xEE20E4, 0xEE20ED, 0xEE20FA, 0xEEE120, 0xEEE420, + 0xF2E420, 0xF920E4, 0xF920ED, 0xF920FA, 0xF9E420, 0xFAE020, 0xFAE420, 0xFAE5E9, + ]) + ]; + }; + + this.name = function(det) { + return (det && det.fC1Bytes) ? 'windows-1255' : 'ISO-8859-8'; + }; + + this.language = function() { + return 'he'; + }; + +}; +util.inherits(module.exports.ISO_8859_8, sbcs); + + +module.exports.ISO_8859_9 = function() { + this.byteMap = function() { + return [ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0xAA, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0xB5, 0x20, 0x20, + 0x20, 0x20, 0xBA, 0x20, 0x20, 0x20, 0x20, 0x20, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20, + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0x69, 0xFE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20, + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF + ]; + }; + + this.ngrams = function() { + return [ + 0x206261, 0x206269, 0x206275, 0x206461, 0x206465, 0x206765, 0x206861, 0x20696C, + 0x206B61, 0x206B6F, 0x206D61, 0x206F6C, 0x207361, 0x207461, 0x207665, 0x207961, + 0x612062, 0x616B20, 0x616C61, 0x616D61, 0x616E20, 0x616EFD, 0x617220, 0x617261, + 0x6172FD, 0x6173FD, 0x617961, 0x626972, 0x646120, 0x646520, 0x646920, 0x652062, + 0x65206B, 0x656469, 0x656E20, 0x657220, 0x657269, 0x657369, 0x696C65, 0x696E20, + 0x696E69, 0x697220, 0x6C616E, 0x6C6172, 0x6C6520, 0x6C6572, 0x6E2061, 0x6E2062, + 0x6E206B, 0x6E6461, 0x6E6465, 0x6E6520, 0x6E6920, 0x6E696E, 0x6EFD20, 0x72696E, + 0x72FD6E, 0x766520, 0x796120, 0x796F72, 0xFD6E20, 0xFD6E64, 0xFD6EFD, 0xFDF0FD + ]; + }; + + this.name = function(det) { + return (det && det.fC1Bytes) ? 'windows-1254' : 'ISO-8859-9'; + }; + + this.language = function() { + return 'tr'; + }; +}; +util.inherits(module.exports.ISO_8859_9, sbcs); + + +module.exports.windows_1251 = function() { + this.byteMap = function() { + return [ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x90, 0x83, 0x20, 0x83, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x9A, 0x20, 0x9C, 0x9D, 0x9E, 0x9F, + 0x90, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x9A, 0x20, 0x9C, 0x9D, 0x9E, 0x9F, + 0x20, 0xA2, 0xA2, 0xBC, 0x20, 0xB4, 0x20, 0x20, + 0xB8, 0x20, 0xBA, 0x20, 0x20, 0x20, 0x20, 0xBF, + 0x20, 0x20, 0xB3, 0xB3, 0xB4, 0xB5, 0x20, 0x20, + 0xB8, 0x20, 0xBA, 0x20, 0xBC, 0xBE, 0xBE, 0xBF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, + 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF + ]; + }; + + this.ngrams = function() { + return [ + 0x20E220, 0x20E2EE, 0x20E4EE, 0x20E7E0, 0x20E820, 0x20EAE0, 0x20EAEE, 0x20EDE0, + 0x20EDE5, 0x20EEE1, 0x20EFEE, 0x20EFF0, 0x20F0E0, 0x20F1EE, 0x20F1F2, 0x20F2EE, + 0x20F7F2, 0x20FDF2, 0xE0EDE8, 0xE0F2FC, 0xE3EE20, 0xE5EBFC, 0xE5EDE8, 0xE5F1F2, + 0xE5F220, 0xE820EF, 0xE8E520, 0xE8E820, 0xE8FF20, 0xEBE5ED, 0xEBE820, 0xEBFCED, + 0xEDE020, 0xEDE520, 0xEDE8E5, 0xEDE8FF, 0xEDEE20, 0xEDEEE2, 0xEE20E2, 0xEE20EF, + 0xEE20F1, 0xEEE220, 0xEEE2E0, 0xEEE3EE, 0xEEE920, 0xEEEBFC, 0xEEEC20, 0xEEF1F2, + 0xEFEEEB, 0xEFF0E5, 0xEFF0E8, 0xEFF0EE, 0xF0E0E2, 0xF0E5E4, 0xF1F2E0, 0xF1F2E2, + 0xF1F2E8, 0xF1FF20, 0xF2E5EB, 0xF2EE20, 0xF2EEF0, 0xF2FC20, 0xF7F2EE, 0xFBF520 + ]; + }; + + this.name = function(det) { + return 'windows-1251'; + }; + + this.language = function() { + return 'ru'; + }; +}; +util.inherits(module.exports.windows_1251, sbcs); + + +module.exports.windows_1256 = function() { + this.byteMap = function() { + return [ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x81, 0x20, 0x83, 0x20, 0x20, 0x20, 0x20, + 0x88, 0x20, 0x8A, 0x20, 0x9C, 0x8D, 0x8E, 0x8F, + 0x90, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x98, 0x20, 0x9A, 0x20, 0x9C, 0x20, 0x20, 0x9F, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0xAA, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0xB5, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, + 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0x20, + 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, + 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, + 0x20, 0x20, 0x20, 0x20, 0xF4, 0x20, 0x20, 0x20, + 0x20, 0xF9, 0x20, 0xFB, 0xFC, 0x20, 0x20, 0xFF + ]; + }; + + this.ngrams = function() { + return [ + 0x20C7E1, 0x20C7E4, 0x20C8C7, 0x20DAE1, 0x20DDED, 0x20E1E1, 0x20E3E4, 0x20E6C7, + 0xC720C7, 0xC7C120, 0xC7CA20, 0xC7D120, 0xC7E120, 0xC7E1C3, 0xC7E1C7, 0xC7E1C8, + 0xC7E1CA, 0xC7E1CC, 0xC7E1CD, 0xC7E1CF, 0xC7E1D3, 0xC7E1DA, 0xC7E1DE, 0xC7E1E3, + 0xC7E1E6, 0xC7E1ED, 0xC7E320, 0xC7E420, 0xC7E4CA, 0xC820C7, 0xC920C7, 0xC920DD, + 0xC920E1, 0xC920E3, 0xC920E6, 0xCA20C7, 0xCF20C7, 0xCFC920, 0xD120C7, 0xD1C920, + 0xD320C7, 0xDA20C7, 0xDAE1EC, 0xDDED20, 0xE120C7, 0xE1C920, 0xE1EC20, 0xE1ED20, + 0xE320C7, 0xE3C720, 0xE3C920, 0xE3E420, 0xE420C7, 0xE520C7, 0xE5C720, 0xE6C7E1, + 0xE6E420, 0xEC20C7, 0xED20C7, 0xED20E3, 0xED20E6, 0xEDC920, 0xEDD120, 0xEDE420 + ]; + }; + + this.name = function(det) { + return 'windows-1256'; + }; + + this.language = function() { + return 'ar'; + }; +}; +util.inherits(module.exports.windows_1256, sbcs); + + +module.exports.KOI8_R = function() { + this.byteMap = function() { + return [ + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, + 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, + 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0xA3, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0xA3, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, + 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, + 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, + 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, + 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, + 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, + 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF + ]; + }; + + this.ngrams = function() { + return [ + 0x20C4CF, 0x20C920, 0x20CBC1, 0x20CBCF, 0x20CEC1, 0x20CEC5, 0x20CFC2, 0x20D0CF, + 0x20D0D2, 0x20D2C1, 0x20D3CF, 0x20D3D4, 0x20D4CF, 0x20D720, 0x20D7CF, 0x20DAC1, + 0x20DCD4, 0x20DED4, 0xC1CEC9, 0xC1D4D8, 0xC5CCD8, 0xC5CEC9, 0xC5D3D4, 0xC5D420, + 0xC7CF20, 0xC920D0, 0xC9C520, 0xC9C920, 0xC9D120, 0xCCC5CE, 0xCCC920, 0xCCD8CE, + 0xCEC120, 0xCEC520, 0xCEC9C5, 0xCEC9D1, 0xCECF20, 0xCECFD7, 0xCF20D0, 0xCF20D3, + 0xCF20D7, 0xCFC7CF, 0xCFCA20, 0xCFCCD8, 0xCFCD20, 0xCFD3D4, 0xCFD720, 0xCFD7C1, + 0xD0CFCC, 0xD0D2C5, 0xD0D2C9, 0xD0D2CF, 0xD2C1D7, 0xD2C5C4, 0xD3D120, 0xD3D4C1, + 0xD3D4C9, 0xD3D4D7, 0xD4C5CC, 0xD4CF20, 0xD4CFD2, 0xD4D820, 0xD9C820, 0xDED4CF + ]; + }; + + this.name = function(det) { + return 'KOI8-R'; + }; + + this.language = function() { + return 'ru'; + }; +}; +util.inherits(module.exports.KOI8_R, sbcs); + + +/* +module.exports.ISO_8859_7 = function() { + this.byteMap = function() { + return [ + + ]; + }; + + this.ngrams = function() { + return [ + + ]; + }; + + this.name = function(det) { + if (typeof det == 'undefined') + return 'ISO-8859-7'; + return det.fC1Bytes ? 'windows-1253' : 'ISO-8859-7'; + }; + + this.language = function() { + return 'el'; + }; +}; +util.inherits(module.exports.ISO_8859_7, sbcs); +*/ + + + +/***/ }), +/* 702 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(module) { -function assembleStyles () { - var styles = { - modifiers: { - reset: [0, 0], - bold: [1, 22], // 21 isn't widely supported and 22 does the same thing - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - colors: { - 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] - }, - bgColors: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49] - } - }; +var util = __webpack_require__(3), + Match = __webpack_require__ (142); - // fix humans - styles.colors.grey = styles.colors.gray; +/** + * This class matches UTF-16 and UTF-32, both big- and little-endian. The + * BOM will be used if it is present. + */ +module.exports.UTF_16BE = function() { + this.name = function() { + return 'UTF-16BE'; + }; + this.match = function(det) { + var input = det.fRawInput; - Object.keys(styles).forEach(function (groupName) { - var group = styles[groupName]; + if (input.length >= 2 && ((input[0] & 0xff) == 0xfe && (input[1] & 0xff) == 0xff)) { + return new Match(det, this, 100); // confidence = 100 + } - Object.keys(group).forEach(function (styleName) { - var style = group[styleName]; + // TODO: Do some statistics to check for unsigned UTF-16BE + return null; + }; +}; - styles[styleName] = group[styleName] = { - open: '\u001b[' + style[0] + 'm', - close: '\u001b[' + style[1] + 'm' - }; - }); +module.exports.UTF_16LE = function() { + this.name = function() { + return 'UTF-16LE'; + }; + this.match = function(det) { + var input = det.fRawInput; - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - }); + if (input.length >= 2 && ((input[0] & 0xff) == 0xff && (input[1] & 0xff) == 0xfe)) { + // LE BOM is present. + if (input.length >= 4 && input[2] == 0x00 && input[3] == 0x00) { + // It is probably UTF-32 LE, not UTF-16 + return null; + } + return new Match(det, this, 100); // confidence = 100 + } - return styles; -} + // TODO: Do some statistics to check for unsigned UTF-16LE + return null; + } +}; -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); +function UTF_32() {}; +UTF_32.prototype.match = function(det) { + var input = det.fRawInput, + limit = (det.fRawLength / 4) * 4, + numValid = 0, + numInvalid = 0, + hasBOM = false, + confidence = 0; + + if (limit == 0) { + return null; + } + + if (this.getChar(input, 0) == 0x0000FEFF) { + hasBOM = true; + } + + for (var i = 0; i < limit; i += 4) { + var ch = this.getChar(input, i); + + if (ch < 0 || ch >= 0x10FFFF || (ch >= 0xD800 && ch <= 0xDFFF)) { + numInvalid += 1; + } else { + numValid += 1; + } + } + + // Cook up some sort of confidence score, based on presence of a BOM + // and the existence of valid and/or invalid multi-byte sequences. + if (hasBOM && numInvalid == 0) { + confidence = 100; + } else if (hasBOM && numValid > numInvalid * 10) { + confidence = 80; + } else if (numValid > 3 && numInvalid == 0) { + confidence = 100; + } else if (numValid > 0 && numInvalid == 0) { + confidence = 80; + } else if (numValid > numInvalid * 10) { + // Probably corrupt UTF-32BE data. Valid sequences aren't likely by chance. + confidence = 25; + } + + // return confidence == 0 ? null : new CharsetMatch(det, this, confidence); + return confidence == 0 ? null : new Match(det, this, confidence); +}; + +module.exports.UTF_32BE = function() { + this.name = function() { + return 'UTF-32BE'; + }; + this.getChar = function(input, index) { + return (input[index + 0] & 0xff) << 24 | (input[index + 1] & 0xff) << 16 | + (input[index + 2] & 0xff) << 8 | (input[index + 3] & 0xff); + }; +}; +util.inherits(module.exports.UTF_32BE, UTF_32); + +module.exports.UTF_32LE = function() { + this.name = function() { + return 'UTF-32LE'; + }; + this.getChar = function(input, index) { + return (input[index + 3] & 0xff) << 24 | (input[index + 2] & 0xff) << 16 | + (input[index + 1] & 0xff) << 8 | (input[index + 0] & 0xff); + }; +}; +util.inherits(module.exports.UTF_32LE, UTF_32); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module))) /***/ }), -/* 558 */ +/* 703 */ +/***/ (function(module, exports, __webpack_require__) { + + +var Match = __webpack_require__ (142); + +/** + * Charset recognizer for UTF-8 + */ +module.exports = function() { + this.name = function() { + return 'UTF-8'; + }; + this.match = function(det) { + + var hasBOM = false, + numValid = 0, + numInvalid = 0, + input = det.fRawInput, + trailBytes = 0, + confidence; + + if (det.fRawLength >= 3 && + (input[0] & 0xff) == 0xef && (input[1] & 0xff) == 0xbb && (input[2] & 0xff) == 0xbf) { + hasBOM = true; + } + + // Scan for multi-byte sequences + for (var i = 0; i < det.fRawLength; i++) { + var b = input[i]; + if ((b & 0x80) == 0) + continue; // ASCII + + // Hi bit on char found. Figure out how long the sequence should be + if ((b & 0x0e0) == 0x0c0) { + trailBytes = 1; + } else if ((b & 0x0f0) == 0x0e0) { + trailBytes = 2; + } else if ((b & 0x0f8) == 0xf0) { + trailBytes = 3; + } else { + numInvalid++; + if (numInvalid > 5) + break; + trailBytes = 0; + } + + // Verify that we've got the right number of trail bytes in the sequence + for (;;) { + i++; + if (i >= det.fRawLength) + break; + + if ((input[i] & 0xc0) != 0x080) { + numInvalid++; + break; + } + if (--trailBytes == 0) { + numValid++; + break; + } + } + } + + // Cook up some sort of confidence score, based on presense of a BOM + // and the existence of valid and/or invalid multi-byte sequences. + confidence = 0; + if (hasBOM && numInvalid == 0) + confidence = 100; + else if (hasBOM && numValid > numInvalid * 10) + confidence = 80; + else if (numValid > 3 && numInvalid == 0) + confidence = 100; + else if (numValid > 0 && numInvalid == 0) + confidence = 80; + else if (numValid == 0 && numInvalid == 0) + // Plain ASCII. + confidence = 10; + else if (numValid > numInvalid * 10) + // Probably corruput utf-8 data. Valid sequences aren't likely by chance. + confidence = 25; + else + return null + + return new Match(det, this, confidence); + }; +}; + + +/***/ }), +/* 704 */ +/***/ (function(module, exports, __webpack_require__) { + + +var fs = __webpack_require__(5); + +var utf8 = __webpack_require__(703), + unicode = __webpack_require__(702), + mbcs = __webpack_require__(700), + sbcs = __webpack_require__(701), + iso2022 = __webpack_require__(699); + +var self = this; + +var recognisers = [ + new utf8, + new unicode.UTF_16BE, + new unicode.UTF_16LE, + new unicode.UTF_32BE, + new unicode.UTF_32LE, + new mbcs.sjis, + new mbcs.big5, + new mbcs.euc_jp, + new mbcs.euc_kr, + new mbcs.gb_18030, + new iso2022.ISO_2022_JP, + new iso2022.ISO_2022_KR, + new iso2022.ISO_2022_CN, + new sbcs.ISO_8859_1, + new sbcs.ISO_8859_2, + new sbcs.ISO_8859_5, + new sbcs.ISO_8859_6, + new sbcs.ISO_8859_7, + new sbcs.ISO_8859_8, + new sbcs.ISO_8859_9, + new sbcs.windows_1251, + new sbcs.windows_1256, + new sbcs.KOI8_R +]; + +module.exports.detect = function(buffer, opts) { + + // Tally up the byte occurence statistics. + var fByteStats = []; + for (var i = 0; i < 256; i++) + fByteStats[i] = 0; + + for (var i = buffer.length - 1; i >= 0; i--) + fByteStats[buffer[i] & 0x00ff]++; + + var fC1Bytes = false; + for (var i = 0x80; i <= 0x9F; i += 1) { + if (fByteStats[i] != 0) { + fC1Bytes = true; + break; + } + } + + var context = { + fByteStats: fByteStats, + fC1Bytes: fC1Bytes, + fRawInput: buffer, + fRawLength: buffer.length, + fInputBytes: buffer, + fInputLen: buffer.length + }; + + var matches = recognisers.map(function(rec) { + return rec.match(context); + }).filter(function(match) { + return !!match; + }).sort(function(a, b) { + return b.confidence - a.confidence; + }); + + if (opts && opts.returnAllMatches === true) { + return matches; + } + else { + return matches.length > 0 ? matches[0].name : null; + } +}; + +module.exports.detectFile = function(filepath, opts, cb) { + if (typeof opts === 'function') { + cb = opts; + opts = undefined; + } + + var fd; + + var handler = function(err, buffer) { + if (fd) { + fs.closeSync(fd); + } + + if (err) return cb(err, null); + cb(null, self.detect(buffer, opts)); + }; + + if (opts && opts.sampleSize) { + fd = fs.openSync(filepath, 'r'), + sample = Buffer.allocUnsafe(opts.sampleSize); + + fs.read(fd, sample, 0, opts.sampleSize, null, function(err) { + handler(err, sample); + }); + return; + } + + fs.readFile(filepath, handler); +}; + +module.exports.detectFileSync = function(filepath, opts) { + if (opts && opts.sampleSize) { + var fd = fs.openSync(filepath, 'r'), + sample = Buffer.allocUnsafe(opts.sampleSize); + + fs.readSync(fd, sample, 0, opts.sampleSize); + fs.closeSync(fd); + return self.detect(sample, opts); + } + + return self.detect(fs.readFileSync(filepath), opts); +}; + +// Wrappers for the previous functions to return all encodings +module.exports.detectAll = function(buffer, opts) { + if (typeof opts !== 'object') { + opts = {}; + } + opts.returnAllMatches = true; + return self.detect(buffer, opts); +} + +module.exports.detectFileAll = function(filepath, opts, cb) { + if (typeof opts === 'function') { + cb = opts; + opts = undefined; + } + if (typeof opts !== 'object') { + opts = {}; + } + opts.returnAllMatches = true; + self.detectFile(filepath, opts, cb); +} + +module.exports.detectFileAllSync = function(filepath, opts) { + if (typeof opts !== 'object') { + opts = {}; + } + opts.returnAllMatches = true; + return self.detectFileSync(filepath, opts); +} + + +/***/ }), +/* 705 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/*** + * Node External Editor + * + * Kevin Gravier + * MIT 2018 + */ +var __extends = (this && this.__extends) || (function () { + 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); + } + 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 CreateFileError = /** @class */ (function (_super) { + __extends(CreateFileError, _super); + function CreateFileError(originalError) { + var _newTarget = this.constructor; + var _this = _super.call(this, "Failed to create temporary file for editor") || this; + _this.originalError = originalError; + var proto = _newTarget.prototype; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(_this, proto); + } + else { + _this.__proto__ = _newTarget.prototype; + } + return _this; + } + return CreateFileError; +}(Error)); +exports.CreateFileError = CreateFileError; + + +/***/ }), +/* 706 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/*** + * Node External Editor + * + * Kevin Gravier + * MIT 2018 + */ +var __extends = (this && this.__extends) || (function () { + 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); + } + 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 LaunchEditorError = /** @class */ (function (_super) { + __extends(LaunchEditorError, _super); + function LaunchEditorError(originalError) { + var _newTarget = this.constructor; + var _this = _super.call(this, "Failed launch editor") || this; + _this.originalError = originalError; + var proto = _newTarget.prototype; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(_this, proto); + } + else { + _this.__proto__ = _newTarget.prototype; + } + return _this; + } + return LaunchEditorError; +}(Error)); +exports.LaunchEditorError = LaunchEditorError; + + +/***/ }), +/* 707 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/*** + * Node External Editor + * + * Kevin Gravier + * MIT 2018 + */ +var __extends = (this && this.__extends) || (function () { + 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); + } + 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 ReadFileError = /** @class */ (function (_super) { + __extends(ReadFileError, _super); + function ReadFileError(originalError) { + var _newTarget = this.constructor; + var _this = _super.call(this, "Failed to read temporary file") || this; + _this.originalError = originalError; + var proto = _newTarget.prototype; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(_this, proto); + } + else { + _this.__proto__ = _newTarget.prototype; + } + return _this; + } + return ReadFileError; +}(Error)); +exports.ReadFileError = ReadFileError; + + +/***/ }), +/* 708 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/*** + * Node External Editor + * + * Kevin Gravier + * MIT 2018 + */ +var __extends = (this && this.__extends) || (function () { + 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); + } + 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 RemoveFileError = /** @class */ (function (_super) { + __extends(RemoveFileError, _super); + function RemoveFileError(originalError) { + var _newTarget = this.constructor; + var _this = _super.call(this, "Failed to cleanup temporary file") || this; + _this.originalError = originalError; + var proto = _newTarget.prototype; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(_this, proto); + } + else { + _this.__proto__ = _newTarget.prototype; + } + return _this; + } + return RemoveFileError; +}(Error)); +exports.RemoveFileError = RemoveFileError; + + +/***/ }), +/* 709 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/*** + * Node External Editor + * + * Kevin Gravier + * MIT 2018 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var chardet_1 = __webpack_require__(704); +var child_process_1 = __webpack_require__(331); +var fs_1 = __webpack_require__(5); +var iconv_lite_1 = __webpack_require__(726); +var tmp_1 = __webpack_require__(954); +var CreateFileError_1 = __webpack_require__(705); +exports.CreateFileError = CreateFileError_1.CreateFileError; +var LaunchEditorError_1 = __webpack_require__(706); +exports.LaunchEditorError = LaunchEditorError_1.LaunchEditorError; +var ReadFileError_1 = __webpack_require__(707); +exports.ReadFileError = ReadFileError_1.ReadFileError; +var RemoveFileError_1 = __webpack_require__(708); +exports.RemoveFileError = RemoveFileError_1.RemoveFileError; +function edit(text) { + if (text === void 0) { text = ""; } + var editor = new ExternalEditor(text); + editor.run(); + editor.cleanup(); + return editor.text; +} +exports.edit = edit; +function editAsync(text, callback) { + if (text === void 0) { text = ""; } + var editor = new ExternalEditor(text); + editor.runAsync(function (err, result) { + if (err) { + setImmediate(callback, err, null); + } + else { + try { + editor.cleanup(); + setImmediate(callback, null, result); + } + catch (cleanupError) { + setImmediate(callback, cleanupError, null); + } + } + }); +} +exports.editAsync = editAsync; +var ExternalEditor = /** @class */ (function () { + function ExternalEditor(text) { + if (text === void 0) { text = ""; } + this.text = ""; + this.text = text; + this.determineEditor(); + this.createTemporaryFile(); + } + ExternalEditor.splitStringBySpace = function (str) { + var pieces = []; + var currentString = ""; + for (var strIndex = 0; strIndex < str.length; strIndex++) { + var currentLetter = str[strIndex]; + if (strIndex > 0 && currentLetter === " " && str[strIndex - 1] !== "\\" && currentString.length > 0) { + pieces.push(currentString); + currentString = ""; + } + else { + currentString += currentLetter; + } + } + if (currentString.length > 0) { + pieces.push(currentString); + } + return pieces; + }; + Object.defineProperty(ExternalEditor.prototype, "temp_file", { + get: function () { + console.log("DEPRECATED: temp_file. Use tempFile moving forward."); + return this.tempFile; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ExternalEditor.prototype, "last_exit_status", { + get: function () { + console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward."); + return this.lastExitStatus; + }, + enumerable: true, + configurable: true + }); + ExternalEditor.prototype.run = function () { + this.launchEditor(); + this.readTemporaryFile(); + return this.text; + }; + ExternalEditor.prototype.runAsync = function (callback) { + var _this = this; + try { + this.launchEditorAsync(function () { + try { + _this.readTemporaryFile(); + setImmediate(callback, null, _this.text); + } + catch (readError) { + setImmediate(callback, readError, null); + } + }); + } + catch (launchError) { + setImmediate(callback, launchError, null); + } + }; + ExternalEditor.prototype.cleanup = function () { + this.removeTemporaryFile(); + }; + ExternalEditor.prototype.determineEditor = function () { + var editor = process.env.VISUAL ? process.env.VISUAL : + process.env.EDITOR ? process.env.EDITOR : + /^win/.test(process.platform) ? "notepad" : + "vim"; + var editorOpts = ExternalEditor.splitStringBySpace(editor).map(function (piece) { return piece.replace("\\ ", " "); }); + var bin = editorOpts.shift(); + this.editor = { args: editorOpts, bin: bin }; + }; + ExternalEditor.prototype.createTemporaryFile = function () { + try { + this.tempFile = tmp_1.tmpNameSync({}); + fs_1.writeFileSync(this.tempFile, this.text, { encoding: "utf8" }); + } + catch (createFileError) { + throw new CreateFileError_1.CreateFileError(createFileError); + } + }; + ExternalEditor.prototype.readTemporaryFile = function () { + try { + var tempFileBuffer = fs_1.readFileSync(this.tempFile); + if (tempFileBuffer.length === 0) { + this.text = ""; + } + else { + var encoding = chardet_1.detect(tempFileBuffer).toString(); + if (!iconv_lite_1.encodingExists(encoding)) { + // Probably a bad idea, but will at least prevent crashing + encoding = "utf8"; + } + this.text = iconv_lite_1.decode(tempFileBuffer, encoding); + } + } + catch (readFileError) { + throw new ReadFileError_1.ReadFileError(readFileError); + } + }; + ExternalEditor.prototype.removeTemporaryFile = function () { + try { + fs_1.unlinkSync(this.tempFile); + } + catch (removeFileError) { + throw new RemoveFileError_1.RemoveFileError(removeFileError); + } + }; + ExternalEditor.prototype.launchEditor = function () { + try { + var editorProcess = child_process_1.spawnSync(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" }); + this.lastExitStatus = editorProcess.status; + } + catch (launchError) { + throw new LaunchEditorError_1.LaunchEditorError(launchError); + } + }; + ExternalEditor.prototype.launchEditorAsync = function (callback) { + var _this = this; + try { + var editorProcess = child_process_1.spawn(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" }); + editorProcess.on("exit", function (code) { + _this.lastExitStatus = code; + setImmediate(callback); + }); + } + catch (launchError) { + throw new LaunchEditorError_1.LaunchEditorError(launchError); + } + }; + return ExternalEditor; +}()); +exports.ExternalEditor = ExternalEditor; + + +/***/ }), +/* 710 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Buffer = __webpack_require__(15).Buffer; + +// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. +// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. +// To save memory and loading time, we read table files only when requested. + +exports._dbcs = DBCSCodec; + +var UNASSIGNED = -1, + GB18030_CODE = -2, + SEQ_START = -10, + NODE_START = -1000, + UNASSIGNED_NODE = new Array(0x100), + DEF_CHAR = -1; + +for (var i = 0; i < 0x100; i++) + UNASSIGNED_NODE[i] = UNASSIGNED; + + +// Class DBCSCodec reads and initializes mapping tables. +function DBCSCodec(codecOptions, iconv) { + this.encodingName = codecOptions.encodingName; + if (!codecOptions) + throw new Error("DBCS codec is called without the data.") + if (!codecOptions.table) + throw new Error("Encoding '" + this.encodingName + "' has no data."); + + // Load tables. + var mappingTable = codecOptions.table(); + + + // Decode tables: MBCS -> Unicode. + + // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. + // Trie root is decodeTables[0]. + // Values: >= 0 -> unicode character code. can be > 0xFFFF + // == UNASSIGNED -> unknown/unassigned sequence. + // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. + // <= NODE_START -> index of the next node in our trie to process next byte. + // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. + this.decodeTables = []; + this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. + + // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. + this.decodeTableSeq = []; + + // Actual mapping tables consist of chunks. Use them to fill up decode tables. + for (var i = 0; i < mappingTable.length; i++) + this._addDecodeChunk(mappingTable[i]); + + this.defaultCharUnicode = iconv.defaultCharUnicode; + + + // Encode tables: Unicode -> DBCS. + + // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. + // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. + // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). + // == UNASSIGNED -> no conversion found. Output a default char. + // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. + this.encodeTable = []; + + // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of + // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key + // means end of sequence (needed when one sequence is a strict subsequence of another). + // Objects are kept separately from encodeTable to increase performance. + this.encodeTableSeq = []; + + // Some chars can be decoded, but need not be encoded. + var skipEncodeChars = {}; + if (codecOptions.encodeSkipVals) + for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { + var val = codecOptions.encodeSkipVals[i]; + if (typeof val === 'number') + skipEncodeChars[val] = true; + else + for (var j = val.from; j <= val.to; j++) + skipEncodeChars[j] = true; + } + + // Use decode trie to recursively fill out encode tables. + this._fillEncodeTable(0, 0, skipEncodeChars); + + // Add more encoding pairs when needed. + if (codecOptions.encodeAdd) { + for (var uChar in codecOptions.encodeAdd) + if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) + this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); + } + + this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; + if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; + if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); + + + // Load & create GB18030 tables when needed. + if (typeof codecOptions.gb18030 === 'function') { + this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. + + // Add GB18030 decode tables. + var thirdByteNodeIdx = this.decodeTables.length; + var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0); + + var fourthByteNodeIdx = this.decodeTables.length; + var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0); + + for (var i = 0x81; i <= 0xFE; i++) { + var secondByteNodeIdx = NODE_START - this.decodeTables[0][i]; + var secondByteNode = this.decodeTables[secondByteNodeIdx]; + for (var j = 0x30; j <= 0x39; j++) + secondByteNode[j] = NODE_START - thirdByteNodeIdx; + } + for (var i = 0x81; i <= 0xFE; i++) + thirdByteNode[i] = NODE_START - fourthByteNodeIdx; + for (var i = 0x30; i <= 0x39; i++) + fourthByteNode[i] = GB18030_CODE + } +} + +DBCSCodec.prototype.encoder = DBCSEncoder; +DBCSCodec.prototype.decoder = DBCSDecoder; + +// Decoder helpers +DBCSCodec.prototype._getDecodeTrieNode = function(addr) { + var bytes = []; + for (; addr > 0; addr >>= 8) + bytes.push(addr & 0xFF); + if (bytes.length == 0) + bytes.push(0); + + var node = this.decodeTables[0]; + for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. + var val = node[bytes[i]]; + + if (val == UNASSIGNED) { // Create new node. + node[bytes[i]] = NODE_START - this.decodeTables.length; + this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); + } + else if (val <= NODE_START) { // Existing node. + node = this.decodeTables[NODE_START - val]; + } + else + throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); + } + return node; +} + + +DBCSCodec.prototype._addDecodeChunk = function(chunk) { + // First element of chunk is the hex mbcs code where we start. + var curAddr = parseInt(chunk[0], 16); + + // Choose the decoding node where we'll write our chars. + var writeTable = this._getDecodeTrieNode(curAddr); + curAddr = curAddr & 0xFF; + + // Write all other elements of the chunk to the table. + for (var k = 1; k < chunk.length; k++) { + var part = chunk[k]; + if (typeof part === "string") { // String, write as-is. + for (var l = 0; l < part.length;) { + var code = part.charCodeAt(l++); + if (0xD800 <= code && code < 0xDC00) { // Decode surrogate + var codeTrail = part.charCodeAt(l++); + if (0xDC00 <= codeTrail && codeTrail < 0xE000) + writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); + else + throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); + } + else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) + var len = 0xFFF - code + 2; + var seq = []; + for (var m = 0; m < len; m++) + seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. + + writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; + this.decodeTableSeq.push(seq); + } + else + writeTable[curAddr++] = code; // Basic char + } + } + else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. + var charCode = writeTable[curAddr - 1] + 1; + for (var l = 0; l < part; l++) + writeTable[curAddr++] = charCode++; + } + else + throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); + } + if (curAddr > 0xFF) + throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); +} + +// Encoder helpers +DBCSCodec.prototype._getEncodeBucket = function(uCode) { + var high = uCode >> 8; // This could be > 0xFF because of astral characters. + if (this.encodeTable[high] === undefined) + this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. + return this.encodeTable[high]; +} + +DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; + if (bucket[low] <= SEQ_START) + this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. + else if (bucket[low] == UNASSIGNED) + bucket[low] = dbcsCode; +} + +DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { + + // Get the root of character tree according to first character of the sequence. + var uCode = seq[0]; + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; + + var node; + if (bucket[low] <= SEQ_START) { + // There's already a sequence with - use it. + node = this.encodeTableSeq[SEQ_START-bucket[low]]; + } + else { + // There was no sequence object - allocate a new one. + node = {}; + if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. + bucket[low] = SEQ_START - this.encodeTableSeq.length; + this.encodeTableSeq.push(node); + } + + // Traverse the character tree, allocating new nodes as needed. + for (var j = 1; j < seq.length-1; j++) { + var oldVal = node[uCode]; + if (typeof oldVal === 'object') + node = oldVal; + else { + node = node[uCode] = {} + if (oldVal !== undefined) + node[DEF_CHAR] = oldVal + } + } + + // Set the leaf to given dbcsCode. + uCode = seq[seq.length-1]; + node[uCode] = dbcsCode; +} + +DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { + var node = this.decodeTables[nodeIdx]; + for (var i = 0; i < 0x100; i++) { + var uCode = node[i]; + var mbCode = prefix + i; + if (skipEncodeChars[mbCode]) + continue; + + if (uCode >= 0) + this._setEncodeChar(uCode, mbCode); + else if (uCode <= NODE_START) + this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars); + else if (uCode <= SEQ_START) + this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); + } +} + + + +// == Encoder ================================================================== + +function DBCSEncoder(options, codec) { + // Encoder state + this.leadSurrogate = -1; + this.seqObj = undefined; + + // Static data + this.encodeTable = codec.encodeTable; + this.encodeTableSeq = codec.encodeTableSeq; + this.defaultCharSingleByte = codec.defCharSB; + this.gb18030 = codec.gb18030; +} + +DBCSEncoder.prototype.write = function(str) { + var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), + leadSurrogate = this.leadSurrogate, + seqObj = this.seqObj, nextChar = -1, + i = 0, j = 0; + + while (true) { + // 0. Get next character. + if (nextChar === -1) { + if (i == str.length) break; + var uCode = str.charCodeAt(i++); + } + else { + var uCode = nextChar; + nextChar = -1; + } + + // 1. Handle surrogates. + if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. + if (uCode < 0xDC00) { // We've got lead surrogate. + if (leadSurrogate === -1) { + leadSurrogate = uCode; + continue; + } else { + leadSurrogate = uCode; + // Double lead surrogate found. + uCode = UNASSIGNED; + } + } else { // We've got trail surrogate. + if (leadSurrogate !== -1) { + uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); + leadSurrogate = -1; + } else { + // Incomplete surrogate pair - only trail surrogate found. + uCode = UNASSIGNED; + } + + } + } + else if (leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. + leadSurrogate = -1; + } + + // 2. Convert uCode character. + var dbcsCode = UNASSIGNED; + if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence + var resCode = seqObj[uCode]; + if (typeof resCode === 'object') { // Sequence continues. + seqObj = resCode; + continue; + + } else if (typeof resCode == 'number') { // Sequence finished. Write it. + dbcsCode = resCode; + + } else if (resCode == undefined) { // Current character is not part of the sequence. + + // Try default character for this sequence + resCode = seqObj[DEF_CHAR]; + if (resCode !== undefined) { + dbcsCode = resCode; // Found. Write it. + nextChar = uCode; // Current character will be written too in the next iteration. + + } else { + // TODO: What if we have no default? (resCode == undefined) + // Then, we should write first char of the sequence as-is and try the rest recursively. + // Didn't do it for now because no encoding has this situation yet. + // Currently, just skip the sequence and write current char. + } + } + seqObj = undefined; + } + else if (uCode >= 0) { // Regular character + var subtable = this.encodeTable[uCode >> 8]; + if (subtable !== undefined) + dbcsCode = subtable[uCode & 0xFF]; + + if (dbcsCode <= SEQ_START) { // Sequence start + seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; + continue; + } + + if (dbcsCode == UNASSIGNED && this.gb18030) { + // Use GB18030 algorithm to find character(s) to write. + var idx = findIdx(this.gb18030.uChars, uCode); + if (idx != -1) { + var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; + newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; + newBuf[j++] = 0x30 + dbcsCode; + continue; + } + } + } + + // 3. Write dbcsCode character. + if (dbcsCode === UNASSIGNED) + dbcsCode = this.defaultCharSingleByte; + + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else if (dbcsCode < 0x10000) { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + else { + newBuf[j++] = dbcsCode >> 16; + newBuf[j++] = (dbcsCode >> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; + } + } + + this.seqObj = seqObj; + this.leadSurrogate = leadSurrogate; + return newBuf.slice(0, j); +} + +DBCSEncoder.prototype.end = function() { + if (this.leadSurrogate === -1 && this.seqObj === undefined) + return; // All clean. Most often case. + + var newBuf = Buffer.alloc(10), j = 0; + + if (this.seqObj) { // We're in the sequence. + var dbcsCode = this.seqObj[DEF_CHAR]; + if (dbcsCode !== undefined) { // Write beginning of the sequence. + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + } else { + // See todo above. + } + this.seqObj = undefined; + } + + if (this.leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + newBuf[j++] = this.defaultCharSingleByte; + this.leadSurrogate = -1; + } + + return newBuf.slice(0, j); +} + +// Export for testing +DBCSEncoder.prototype.findIdx = findIdx; + + +// == Decoder ================================================================== + +function DBCSDecoder(options, codec) { + // Decoder state + this.nodeIdx = 0; + this.prevBuf = Buffer.alloc(0); + + // Static data + this.decodeTables = codec.decodeTables; + this.decodeTableSeq = codec.decodeTableSeq; + this.defaultCharUnicode = codec.defaultCharUnicode; + this.gb18030 = codec.gb18030; +} + +DBCSDecoder.prototype.write = function(buf) { + var newBuf = Buffer.alloc(buf.length*2), + nodeIdx = this.nodeIdx, + prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length, + seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence. + uCode; + + if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later. + prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]); + + for (var i = 0, j = 0; i < buf.length; i++) { + var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset]; + + // Lookup in current trie node. + var uCode = this.decodeTables[nodeIdx][curByte]; + + if (uCode >= 0) { + // Normal character, just use it. + } + else if (uCode === UNASSIGNED) { // Unknown char. + // TODO: Callback with seq. + //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); + i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle). + uCode = this.defaultCharUnicode.charCodeAt(0); + } + else if (uCode === GB18030_CODE) { + var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset); + var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30); + var idx = findIdx(this.gb18030.gbChars, ptr); + uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; + } + else if (uCode <= NODE_START) { // Go to next trie node. + nodeIdx = NODE_START - uCode; + continue; + } + else if (uCode <= SEQ_START) { // Output a sequence of chars. + var seq = this.decodeTableSeq[SEQ_START - uCode]; + for (var k = 0; k < seq.length - 1; k++) { + uCode = seq[k]; + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; + } + uCode = seq[seq.length-1]; + } + else + throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); + + // Write the character to buffer, handling higher planes using surrogate pair. + if (uCode > 0xFFFF) { + uCode -= 0x10000; + var uCodeLead = 0xD800 + Math.floor(uCode / 0x400); + newBuf[j++] = uCodeLead & 0xFF; + newBuf[j++] = uCodeLead >> 8; + + uCode = 0xDC00 + uCode % 0x400; + } + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; + + // Reset trie node. + nodeIdx = 0; seqStart = i+1; + } + + this.nodeIdx = nodeIdx; + this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset); + return newBuf.slice(0, j).toString('ucs2'); +} + +DBCSDecoder.prototype.end = function() { + var ret = ''; + + // Try to parse all remaining chars. + while (this.prevBuf.length > 0) { + // Skip 1 character in the buffer. + ret += this.defaultCharUnicode; + var buf = this.prevBuf.slice(1); + + // Parse remaining as usual. + this.prevBuf = Buffer.alloc(0); + this.nodeIdx = 0; + if (buf.length > 0) + ret += this.write(buf); + } + + this.nodeIdx = 0; + return ret; +} + +// Binary search for GB18030. Returns largest i such that table[i] <= val. +function findIdx(table, val) { + if (table[0] > val) + return -1; + + var l = 0, r = table.length; + while (l < r-1) { // always table[l] <= val < table[r] + var mid = l + Math.floor((r-l+1)/2); + if (table[mid] <= val) + l = mid; + else + r = mid; + } + return l; +} + + + +/***/ }), +/* 711 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Description of supported double byte encodings and aliases. +// Tables are not require()-d until they are needed to speed up library load. +// require()-s are direct to support Browserify. + +module.exports = { + + // == Japanese/ShiftJIS ==================================================== + // All japanese encodings are based on JIS X set of standards: + // JIS X 0201 - Single-byte encoding of ASCII + ÂĨ + Kana chars at 0xA1-0xDF. + // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. + // Has several variations in 1978, 1983, 1990 and 1997. + // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. + // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. + // 2 planes, first is superset of 0208, second - revised 0212. + // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) + + // Byte encodings are: + // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte + // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. + // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. + // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. + // 0x00-0x7F - lower part of 0201 + // 0x8E, 0xA1-0xDF - upper part of 0201 + // (0xA1-0xFE)x2 - 0208 plane (94x94). + // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). + // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. + // Used as-is in ISO2022 family. + // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, + // 0201-1976 Roman, 0208-1978, 0208-1983. + // * ISO2022-JP-1: Adds esc seq for 0212-1990. + // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. + // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. + // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. + // + // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. + // + // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html + + 'shiftjis': { + type: '_dbcs', + table: function() { return __webpack_require__(721) }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + encodeSkipVals: [{from: 0xED40, to: 0xF940}], + }, + 'csshiftjis': 'shiftjis', + 'mskanji': 'shiftjis', + 'sjis': 'shiftjis', + 'windows31j': 'shiftjis', + 'ms31j': 'shiftjis', + 'xsjis': 'shiftjis', + 'windows932': 'shiftjis', + 'ms932': 'shiftjis', + '932': 'shiftjis', + 'cp932': 'shiftjis', + + 'eucjp': { + type: '_dbcs', + table: function() { return __webpack_require__(719) }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + }, + + // TODO: KDDI extension to Shift_JIS + // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. + // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. + + + // == Chinese/GBK ========================================================== + // http://en.wikipedia.org/wiki/GBK + // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder + + // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 + 'gb2312': 'cp936', + 'gb231280': 'cp936', + 'gb23121980': 'cp936', + 'csgb2312': 'cp936', + 'csiso58gb231280': 'cp936', + 'euccn': 'cp936', + + // Microsoft's CP936 is a subset and approximation of GBK. + 'windows936': 'cp936', + 'ms936': 'cp936', + '936': 'cp936', + 'cp936': { + type: '_dbcs', + table: function() { return __webpack_require__(277) }, + }, + + // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. + 'gbk': { + type: '_dbcs', + table: function() { return __webpack_require__(277).concat(__webpack_require__(396)) }, + }, + 'xgbk': 'gbk', + 'isoir58': 'gbk', + + // GB18030 is an algorithmic extension of GBK. + // Main source: https://www.w3.org/TR/encoding/#gbk-encoder + // http://icu-project.org/docs/papers/gb18030.html + // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml + // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 + 'gb18030': { + type: '_dbcs', + table: function() { return __webpack_require__(277).concat(__webpack_require__(396)) }, + gb18030: function() { return __webpack_require__(720) }, + encodeSkipVals: [0x80], + encodeAdd: {'â‚Ŧ': 0xA2E3}, + }, + + 'chinese': 'gb18030', + + + // == Korean =============================================================== + // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. + 'windows949': 'cp949', + 'ms949': 'cp949', + '949': 'cp949', + 'cp949': { + type: '_dbcs', + table: function() { return __webpack_require__(718) }, + }, + + 'cseuckr': 'cp949', + 'csksc56011987': 'cp949', + 'euckr': 'cp949', + 'isoir149': 'cp949', + 'korean': 'cp949', + 'ksc56011987': 'cp949', + 'ksc56011989': 'cp949', + 'ksc5601': 'cp949', + + + // == Big5/Taiwan/Hong Kong ================================================ + // There are lots of tables for Big5 and cp950. Please see the following links for history: + // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html + // Variations, in roughly number of defined chars: + // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT + // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ + // * Big5-2003 (Taiwan standard) almost superset of cp950. + // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. + // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. + // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. + // Plus, it has 4 combining sequences. + // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 + // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. + // Implementations are not consistent within browsers; sometimes labeled as just big5. + // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. + // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 + // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. + // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt + // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt + // + // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder + // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. + + 'windows950': 'cp950', + 'ms950': 'cp950', + '950': 'cp950', + 'cp950': { + type: '_dbcs', + table: function() { return __webpack_require__(395) }, + }, + + // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. + 'big5': 'big5hkscs', + 'big5hkscs': { + type: '_dbcs', + table: function() { return __webpack_require__(395).concat(__webpack_require__(717)) }, + encodeSkipVals: [0xa2cc], + }, + + 'cnbig5': 'big5hkscs', + 'csbig5': 'big5hkscs', + 'xxbig5': 'big5hkscs', +}; + + +/***/ }), +/* 712 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Update this array if you add/rename/remove files in this directory. +// We support Browserify by skipping automatic module discovery and requiring modules directly. +var modules = [ + __webpack_require__(713), + __webpack_require__(722), + __webpack_require__(723), + __webpack_require__(714), + __webpack_require__(716), + __webpack_require__(715), + __webpack_require__(710), + __webpack_require__(711), +]; + +// Put all encoding/alias/codec definitions to single object and export it. +for (var i = 0; i < modules.length; i++) { + var module = modules[i]; + for (var enc in module) + if (Object.prototype.hasOwnProperty.call(module, enc)) + exports[enc] = module[enc]; +} + + +/***/ }), +/* 713 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Buffer = __webpack_require__(15).Buffer; + +// Export Node.js internal encodings. + +module.exports = { + // Encodings + utf8: { type: "_internal", bomAware: true}, + cesu8: { type: "_internal", bomAware: true}, + unicode11utf8: "utf8", + + ucs2: { type: "_internal", bomAware: true}, + utf16le: "ucs2", + + binary: { type: "_internal" }, + base64: { type: "_internal" }, + hex: { type: "_internal" }, + + // Codec. + _internal: InternalCodec, +}; + +//------------------------------------------------------------------------------ + +function InternalCodec(codecOptions, iconv) { + this.enc = codecOptions.encodingName; + this.bomAware = codecOptions.bomAware; + + if (this.enc === "base64") + this.encoder = InternalEncoderBase64; + else if (this.enc === "cesu8") { + this.enc = "utf8"; // Use utf8 for decoding. + this.encoder = InternalEncoderCesu8; + + // Add decoder for versions of Node not supporting CESU-8 + if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { + this.decoder = InternalDecoderCesu8; + this.defaultCharUnicode = iconv.defaultCharUnicode; + } + } +} + +InternalCodec.prototype.encoder = InternalEncoder; +InternalCodec.prototype.decoder = InternalDecoder; + +//------------------------------------------------------------------------------ + +// We use node.js internal decoder. Its signature is the same as ours. +var StringDecoder = __webpack_require__(333).StringDecoder; + +if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. + StringDecoder.prototype.end = function() {}; + + +function InternalDecoder(options, codec) { + StringDecoder.call(this, codec.enc); +} + +InternalDecoder.prototype = StringDecoder.prototype; + + +//------------------------------------------------------------------------------ +// Encoder is mostly trivial + +function InternalEncoder(options, codec) { + this.enc = codec.enc; +} + +InternalEncoder.prototype.write = function(str) { + return Buffer.from(str, this.enc); +} + +InternalEncoder.prototype.end = function() { +} + + +//------------------------------------------------------------------------------ +// Except base64 encoder, which must keep its state. + +function InternalEncoderBase64(options, codec) { + this.prevStr = ''; +} + +InternalEncoderBase64.prototype.write = function(str) { + str = this.prevStr + str; + var completeQuads = str.length - (str.length % 4); + this.prevStr = str.slice(completeQuads); + str = str.slice(0, completeQuads); + + return Buffer.from(str, "base64"); +} + +InternalEncoderBase64.prototype.end = function() { + return Buffer.from(this.prevStr, "base64"); +} + + +//------------------------------------------------------------------------------ +// CESU-8 encoder is also special. + +function InternalEncoderCesu8(options, codec) { +} + +InternalEncoderCesu8.prototype.write = function(str) { + var buf = Buffer.alloc(str.length * 3), bufIdx = 0; + for (var i = 0; i < str.length; i++) { + var charCode = str.charCodeAt(i); + // Naive implementation, but it works because CESU-8 is especially easy + // to convert from UTF-16 (which all JS strings are encoded in). + if (charCode < 0x80) + buf[bufIdx++] = charCode; + else if (charCode < 0x800) { + buf[bufIdx++] = 0xC0 + (charCode >>> 6); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + else { // charCode will always be < 0x10000 in javascript. + buf[bufIdx++] = 0xE0 + (charCode >>> 12); + buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + } + return buf.slice(0, bufIdx); +} + +InternalEncoderCesu8.prototype.end = function() { +} + +//------------------------------------------------------------------------------ +// CESU-8 decoder is not implemented in Node v4.0+ + +function InternalDecoderCesu8(options, codec) { + this.acc = 0; + this.contBytes = 0; + this.accBytes = 0; + this.defaultCharUnicode = codec.defaultCharUnicode; +} + +InternalDecoderCesu8.prototype.write = function(buf) { + var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, + res = ''; + for (var i = 0; i < buf.length; i++) { + var curByte = buf[i]; + if ((curByte & 0xC0) !== 0x80) { // Leading byte + if (contBytes > 0) { // Previous code is invalid + res += this.defaultCharUnicode; + contBytes = 0; + } + + if (curByte < 0x80) { // Single-byte code + res += String.fromCharCode(curByte); + } else if (curByte < 0xE0) { // Two-byte code + acc = curByte & 0x1F; + contBytes = 1; accBytes = 1; + } else if (curByte < 0xF0) { // Three-byte code + acc = curByte & 0x0F; + contBytes = 2; accBytes = 1; + } else { // Four or more are not supported for CESU-8. + res += this.defaultCharUnicode; + } + } else { // Continuation byte + if (contBytes > 0) { // We're waiting for it. + acc = (acc << 6) | (curByte & 0x3f); + contBytes--; accBytes++; + if (contBytes === 0) { + // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) + if (accBytes === 2 && acc < 0x80 && acc > 0) + res += this.defaultCharUnicode; + else if (accBytes === 3 && acc < 0x800) + res += this.defaultCharUnicode; + else + // Actually add character. + res += String.fromCharCode(acc); + } + } else { // Unexpected continuation byte + res += this.defaultCharUnicode; + } + } + } + this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; + return res; +} + +InternalDecoderCesu8.prototype.end = function() { + var res = 0; + if (this.contBytes > 0) + res += this.defaultCharUnicode; + return res; +} + + +/***/ }), +/* 714 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Buffer = __webpack_require__(15).Buffer; + +// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that +// correspond to encoded bytes (if 128 - then lower half is ASCII). + +exports._sbcs = SBCSCodec; +function SBCSCodec(codecOptions, iconv) { + if (!codecOptions) + throw new Error("SBCS codec is called without the data.") + + // Prepare char buffer for decoding. + if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) + throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); + + if (codecOptions.chars.length === 128) { + var asciiString = ""; + for (var i = 0; i < 128; i++) + asciiString += String.fromCharCode(i); + codecOptions.chars = asciiString + codecOptions.chars; + } + + this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); + + // Encoding buffer. + var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); + + for (var i = 0; i < codecOptions.chars.length; i++) + encodeBuf[codecOptions.chars.charCodeAt(i)] = i; + + this.encodeBuf = encodeBuf; +} + +SBCSCodec.prototype.encoder = SBCSEncoder; +SBCSCodec.prototype.decoder = SBCSDecoder; + + +function SBCSEncoder(options, codec) { + this.encodeBuf = codec.encodeBuf; +} + +SBCSEncoder.prototype.write = function(str) { + var buf = Buffer.alloc(str.length); + for (var i = 0; i < str.length; i++) + buf[i] = this.encodeBuf[str.charCodeAt(i)]; + + return buf; +} + +SBCSEncoder.prototype.end = function() { +} + + +function SBCSDecoder(options, codec) { + this.decodeBuf = codec.decodeBuf; +} + +SBCSDecoder.prototype.write = function(buf) { + // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. + var decodeBuf = this.decodeBuf; + var newBuf = Buffer.alloc(buf.length*2); + var idx1 = 0, idx2 = 0; + for (var i = 0; i < buf.length; i++) { + idx1 = buf[i]*2; idx2 = i*2; + newBuf[idx2] = decodeBuf[idx1]; + newBuf[idx2+1] = decodeBuf[idx1+1]; + } + return newBuf.toString('ucs2'); +} + +SBCSDecoder.prototype.end = function() { +} + + +/***/ }), +/* 715 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. +module.exports = { + "437": "cp437", + "737": "cp737", + "775": "cp775", + "850": "cp850", + "852": "cp852", + "855": "cp855", + "856": "cp856", + "857": "cp857", + "858": "cp858", + "860": "cp860", + "861": "cp861", + "862": "cp862", + "863": "cp863", + "864": "cp864", + "865": "cp865", + "866": "cp866", + "869": "cp869", + "874": "windows874", + "922": "cp922", + "1046": "cp1046", + "1124": "cp1124", + "1125": "cp1125", + "1129": "cp1129", + "1133": "cp1133", + "1161": "cp1161", + "1162": "cp1162", + "1163": "cp1163", + "1250": "windows1250", + "1251": "windows1251", + "1252": "windows1252", + "1253": "windows1253", + "1254": "windows1254", + "1255": "windows1255", + "1256": "windows1256", + "1257": "windows1257", + "1258": "windows1258", + "28591": "iso88591", + "28592": "iso88592", + "28593": "iso88593", + "28594": "iso88594", + "28595": "iso88595", + "28596": "iso88596", + "28597": "iso88597", + "28598": "iso88598", + "28599": "iso88599", + "28600": "iso885910", + "28601": "iso885911", + "28603": "iso885913", + "28604": "iso885914", + "28605": "iso885915", + "28606": "iso885916", + "windows874": { + "type": "_sbcs", + "chars": "â‚ŦīŋŊīŋŊīŋŊīŋŊâ€ĻīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ‘’“”â€ĸ–—īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÂ ā¸ā¸‚ā¸ƒā¸„ā¸…ā¸†ā¸‡ā¸ˆā¸‰ā¸Šā¸‹ā¸Œā¸ā¸Žā¸ā¸ā¸‘ā¸’ā¸“ā¸”ā¸•ā¸–ā¸—ā¸˜ā¸™ā¸šā¸›ā¸œā¸ā¸žā¸Ÿā¸ ā¸Ąā¸ĸ⏪⏤ā¸Ĩā¸Ļā¸§ā¸¨ā¸Šā¸Ēā¸Ģā¸Ŧā¸­ā¸Žā¸¯ā¸°ā¸ąā¸˛ā¸ŗā¸´ā¸ĩā¸ļā¸ˇā¸¸ā¸šā¸ēīŋŊīŋŊīŋŊīŋŊā¸ŋāš€āšāš‚āšƒāš„āš…āš†āš‡āšˆāš‰āšŠāš‹āšŒāšāšŽāšāšāš‘āš’āš“āš”āš•āš–āš—āš˜āš™āššāš›īŋŊīŋŊīŋŊīŋŊ" + }, + "win874": "windows874", + "cp874": "windows874", + "windows1250": { + "type": "_sbcs", + "chars": "â‚ŦīŋŊ‚īŋŊ„â€Ļ†‡īŋŊ‰Š‚ŚŤÅŊÅšīŋŊ‘’“”â€ĸ–—īŋŊâ„ĸÅĄâ€ēśÅĨÅžÅē ˇ˘Ł¤ĄÂϧ¨ŠŞÂĢÂŦ­ŽÅģÂ°ÂąË›Å‚Â´ÂĩÂļÂˇÂ¸Ä…ÅŸÂģÄŊ˝ĞÅŧŔÁÂĂÄĚĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŎÚŰÜÝÅĸÃŸÅ•ÃĄÃĸăäÄēćçčÊęÃĢÄ›Ã­ÃŽÄÄ‘Å„ÅˆÃŗÃ´Å‘ÃļÃˇÅ™Å¯ÃēÅąÃŧÃŊÅŖË™" + }, + "win1250": "windows1250", + "cp1250": "windows1250", + "windows1251": { + "type": "_sbcs", + "chars": "Đ‚Đƒâ€šŅ“â€žâ€Ļ†‡â‚Ŧâ€°Đ‰â€šĐŠĐŒĐ‹ĐŅ’â€˜â€™â€œâ€â€ĸ–—īŋŊâ„ĸŅ™â€ēŅšŅœŅ›ŅŸÂ ĐŽŅžĐˆÂ¤ŌÂϧЁ©ЄÂĢÂŦÂ­ÂŽĐ‡Â°ÂąĐ†Ņ–Ō‘ÂĩÂļÂˇŅ‘â„–Ņ”ÂģŅ˜Đ…Ņ•Ņ—ĐĐ‘Đ’Đ“Đ”Đ•Đ–Đ—Đ˜Đ™ĐšĐ›ĐœĐĐžĐŸĐ ĐĄĐĸĐŖĐ¤ĐĨĐĻЧШЊĐĒĐĢĐŦĐ­ĐŽĐ¯Đ°ĐąĐ˛ĐŗĐ´ĐĩĐļСиКĐēĐģĐŧĐŊĐžĐŋŅ€ŅŅ‚ŅƒŅ„Ņ…Ņ†Ņ‡ŅˆŅ‰ŅŠŅ‹ŅŒŅŅŽŅ" + }, + "win1251": "windows1251", + "cp1251": "windows1251", + "windows1252": { + "type": "_sbcs", + "chars": "â‚ŦīŋŊ‚ƒ„â€Ļâ€ â€ĄË†â€°Å â€šÅ’īŋŊÅŊīŋŊīŋŊ‘’“”â€ĸ–—˜â„ĸÅĄâ€ēœīŋŊÅžÅ¸Â ÂĄÂĸÂŖÂ¤ÂĨÂϧ¨ŠÂĒÂĢÂŦÂ­ÂŽÂ¯Â°ÂąÂ˛ÂŗÂ´ÂĩÂšÂēÂģÂŧÂŊžÂŋÃ€ÃÃ‚ÃƒÃ„Ã…Ã†Ã‡ÃˆÃ‰ÃŠÃ‹ÃŒÃÃŽÃÃÃ‘Ã’Ã“Ã”Ã•Ã–Ã—Ã˜Ã™ÃšÃ›ÃœÃÃžÃŸÃ ÃĄÃĸÃŖÃ¤ÃĨÃĻçèÊÃĒÃĢÃŦÃ­ÃŽÃ¯Ã°ÃąÃ˛ÃŗÃ´ÃĩÃļÃˇÃ¸ÃšÃēÃģÃŧÃŊÞÃŋ" + }, + "win1252": "windows1252", + "cp1252": "windows1252", + "windows1253": { + "type": "_sbcs", + "chars": "â‚ŦīŋŊ‚ƒ„â€Ļ†‡īŋŊ‰īŋŊ‹īŋŊīŋŊīŋŊīŋŊīŋŊ‘’“”â€ĸ–—īŋŊâ„ĸīŋŊâ€ēīŋŊīŋŊīŋŊīŋŊÂ Î…Î†ÂŖÂ¤ÂĨÂϧ¨ŠīŋŊÂĢÂŦÂ­ÂŽâ€•Â°ÂąÂ˛ÂŗÎ„ÂĩÂļ·ΈΉΊÂģΌÂŊΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡīŋŊÎŖÎ¤ÎĨÎĻΧΨΊÎĒÎĢÎŦÎ­ÎŽÎ¯Î°ÎąÎ˛ÎŗÎ´ÎĩÎļΡθΚÎēÎģÎŧÎŊΞÎŋĪ€ĪĪ‚ĪƒĪ„Ī…Ī†Ī‡ĪˆĪ‰ĪŠĪ‹ĪŒĪĪŽīŋŊ" + }, + "win1253": "windows1253", + "cp1253": "windows1253", + "windows1254": { + "type": "_sbcs", + "chars": "â‚ŦīŋŊ‚ƒ„â€Ļâ€ â€ĄË†â€°Å â€šÅ’īŋŊīŋŊīŋŊīŋŊ‘’“”â€ĸ–—˜â„ĸÅĄâ€ēœīŋŊīŋŊÅ¸Â ÂĄÂĸÂŖÂ¤ÂĨÂϧ¨ŠÂĒÂĢÂŦÂ­ÂŽÂ¯Â°ÂąÂ˛ÂŗÂ´ÂĩÂšÂēÂģÂŧÂŊžÂŋÃ€ÃÃ‚ÃƒÃ„Ã…Ã†Ã‡ÃˆÃ‰ÃŠÃ‹ÃŒÃÃŽÃÄžÃ‘Ã’Ã“Ã”Ã•Ã–Ã—Ã˜Ã™ÃšÃ›ÃœÄ°ÅžÃŸÃ ÃĄÃĸÃŖÃ¤ÃĨÃĻçèÊÃĒÃĢÃŦÃ­ÃŽÃ¯ÄŸÃąÃ˛ÃŗÃ´ÃĩÃļÃˇÃ¸ÃšÃēÃģÃŧÄąÅŸÃŋ" + }, + "win1254": "windows1254", + "cp1254": "windows1254", + "windows1255": { + "type": "_sbcs", + "chars": "â‚ŦīŋŊ‚ƒ„â€Ļ†‡ˆ‰īŋŊ‹īŋŊīŋŊīŋŊīŋŊīŋŊ‘’“”â€ĸ–—˜â„ĸīŋŊâ€ēīŋŊīŋŊīŋŊīŋŊ ¥ÂĸÂŖâ‚ĒÂĨÂϧ¨Š×ÂĢÂŦÂ­ÂŽÂ¯Â°ÂąÂ˛ÂŗÂ´ÂĩÂļÂˇÂ¸ÂšÃˇÂģÂŧÂŊžÂŋÖ°ÖąÖ˛ÖŗÖ´ÖĩÖļÖˇÖ¸ÖšÖēÖģÖŧÖŊÖžÖŋ×€××‚×ƒ×°×ą×˛×ŗ×´īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊאבגדהוזחטיךכלםמןנס×ĸתפ×Ĩ×Ļקר׊×ĒīŋŊīŋŊ‎‏īŋŊ" + }, + "win1255": "windows1255", + "cp1255": "windows1255", + "windows1256": { + "type": "_sbcs", + "chars": "â‚ŦŲžâ€šÆ’â€žâ€Ļâ€ â€ĄË†â€°Ųšâ€šÅ’Ú†Ú˜ÚˆÚ¯â€˜â€™â€œâ€â€ĸ–—کâ„ĸڑâ€ēœ‌‍Úē ،ÂĸÂŖÂ¤ÂĨÂϧ¨ŠڞÂĢÂŦÂ­ÂŽÂ¯Â°ÂąÂ˛ÂŗÂ´ÂĩÂļÂˇÂ¸ÂšØ›ÂģÂŧÂŊÂžØŸÛØĄØĸØŖØ¤ØĨØĻاب؊ØĒØĢØŦØ­ØŽØ¯Ø°ØąØ˛ØŗØ´ØĩØļÃ—ØˇØ¸ØšØēŲ€ŲŲ‚ŲƒÃ Ų„ÃĸŲ…Ų†Ų‡ŲˆÃ§Ã¨ÃŠÃĒÃĢŲ‰ŲŠÃŽÃ¯Ų‹ŲŒŲŲŽÃ´ŲŲÃˇŲ‘ÃšŲ’ÃģÃŧ‎‏ے" + }, + "win1256": "windows1256", + "cp1256": "windows1256", + "windows1257": { + "type": "_sbcs", + "chars": "â‚ŦīŋŊ‚īŋŊ„â€Ļ†‡īŋŊ‰īŋŊ‹īŋŊ¨ˇ¸īŋŊ‘’“”â€ĸ–—īŋŊâ„ĸīŋŊâ€ēīŋŊ¯˛īŋŊ īŋŊÂĸÂŖÂ¤īŋŊÂĻ§ØŠŖÂĢÂŦÂ­ÂŽÃ†Â°ÂąÂ˛ÂŗÂ´ÂĩÂļÂˇÃ¸ÂšÅ—ÂģÂŧÂŊžÃĻĄĎĀĆÄÅĘĒČÉŚĖÄĸÄļÄĒÄģÅ ÅƒÅ…Ã“ÅŒÃ•Ã–Ã—Å˛ÅÅšÅĒÜÅģÅŊßąįāćäÃĨęēčÊÅēėĪĎÄĢÄŧÅĄÅ„Å†ÃŗÅÃĩÃļÃˇÅŗÅ‚Å›ÅĢÃŧÅŧŞ˙" + }, + "win1257": "windows1257", + "cp1257": "windows1257", + "windows1258": { + "type": "_sbcs", + "chars": "â‚ŦīŋŊ‚ƒ„â€Ļ†‡ˆ‰īŋŊ‚ŒīŋŊīŋŊīŋŊīŋŊ‘’“”â€ĸ–—˜â„ĸīŋŊâ€ēœīŋŊīŋŊÅ¸Â ÂĄÂĸÂŖÂ¤ÂĨÂϧ¨ŠÂĒÂĢÂŦÂ­ÂŽÂ¯Â°ÂąÂ˛ÂŗÂ´ÂĩÂšÂēÂģÂŧÂŊžÂŋÃ€ÃÃ‚Ä‚Ã„Ã…Ã†Ã‡ÃˆÃ‰ÃŠÃ‹Ė€ÃÃŽÃÄÃ‘Ė‰Ã“Ã”Æ Ã–Ã—Ã˜Ã™ÃšÃ›ÃœÆ¯ĖƒÃŸÃ ÃĄÃĸăäÃĨÃĻçèÊÃĒÃĢĖÃ­ÃŽÃ¯Ä‘ÃąĖŖÃŗÃ´ÆĄÃļÃˇÃ¸ÃšÃēÃģÃŧưâ‚ĢÃŋ" + }, + "win1258": "windows1258", + "cp1258": "windows1258", + "iso88591": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡ÂĸÂŖÂ¤ÂĨÂϧ¨ŠÂĒÂĢÂŦÂ­ÂŽÂ¯Â°ÂąÂ˛ÂŗÂ´ÂĩÂšÂēÂģÂŧÂŊžÂŋÃ€ÃÃ‚ÃƒÃ„Ã…Ã†Ã‡ÃˆÃ‰ÃŠÃ‹ÃŒÃÃŽÃÃÃ‘Ã’Ã“Ã”Ã•Ã–Ã—Ã˜Ã™ÃšÃ›ÃœÃÃžÃŸÃ ÃĄÃĸÃŖÃ¤ÃĨÃĻçèÊÃĒÃĢÃŦÃ­ÃŽÃ¯Ã°ÃąÃ˛ÃŗÃ´ÃĩÃļÃˇÃ¸ÃšÃēÃģÃŧÃŊÞÃŋ" + }, + "cp28591": "iso88591", + "iso88592": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ÄŊڧ¨ŠŞŤŚ­ÅŊÅģÂ°Ä…Ë›Å‚Â´ÄžÅ›Ë‡Â¸ÅĄÅŸÅĨÅē˝ŞÅŧŔÁÂĂÄĚĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŎÚŰÜÝÅĸÃŸÅ•ÃĄÃĸăäÄēćçčÊęÃĢÄ›Ã­ÃŽÄÄ‘Å„ÅˆÃŗÃ´Å‘ÃļÃˇÅ™Å¯ÃēÅąÃŧÃŊÅŖË™" + }, + "cp28592": "iso88592", + "iso88593": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÄĻË˜ÂŖÂ¤īŋŊĤ§¨İŞĞĴ­īŋŊÅģÂ°Ä§Â˛ÂŗÂ´ÂĩÄĨÂˇÂ¸ÄąÅŸÄŸÄĩÂŊīŋŊÅŧÀÁÂīŋŊÄĊĈÇÈÉÊËÌÍÎÏīŋŊÑÒÓÔĠÖ×ĜÙÚÛÜÅŦÅœÃŸÃ ÃĄÃĸīŋŊäċĉçèÊÃĒÃĢÃŦíÎïīŋŊÃąÃ˛ÃŗÃ´ÄĄÃļÃˇÄÃšÃēÃģÃŧŭŝ˙" + }, + "cp28593": "iso88593", + "iso88594": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨÄ짍ŠĒÄĸÅĻ­ÅŊ¯°ą˛ŗ´ĊÄŧË‡Â¸ÅĄÄ“ÄŖÅ§ÅŠÅžÅ‹Ä€ÃÃ‚ÃƒÃ„Ã…Ã†ÄŽÄŒÃ‰Ä˜Ã‹Ä–ÃÃŽÄĒĐŅŌÄļÃ”Ã•Ã–Ã—Ã˜Å˛ÃšÃ›ÃœÅ¨ÅĒÃŸÄÃĄÃĸÃŖÃ¤ÃĨÃĻįčÊęÃĢėíÎÄĢÄ‘Å†ÅÄˇÃ´ÃĩÃļÃˇÃ¸ÅŗÃēÃģÃŧÅŠÅĢ˙" + }, + "cp28594": "iso88594", + "iso88595": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСĐĸĐŖĐ¤ĐĨĐĻЧШЊĐĒĐĢĐŦĐ­ĐŽĐ¯Đ°ĐąĐ˛ĐŗĐ´ĐĩĐļСиКĐēĐģĐŧĐŊĐžĐŋŅ€ŅŅ‚ŅƒŅ„Ņ…Ņ†Ņ‡ŅˆŅ‰ŅŠŅ‹ŅŒŅŅŽŅâ„–Ņ‘Ņ’Ņ“Ņ”Ņ•Ņ–Ņ—Ņ˜Ņ™ŅšŅ›ŅœÂ§ŅžŅŸ" + }, + "cp28595": "iso88595", + "iso88596": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ īŋŊīŋŊīŋŊ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ،­īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ؛īŋŊīŋŊīŋŊ؟īŋŊØĄØĸØŖØ¤ØĨØĻاب؊ØĒØĢØŦØ­ØŽØ¯Ø°ØąØ˛ØŗØ´ØĩØļØˇØ¸ØšØēīŋŊīŋŊīŋŊīŋŊīŋŊŲ€ŲŲ‚ŲƒŲ„Ų…Ų†Ų‡ŲˆŲ‰ŲŠŲ‹ŲŒŲŲŽŲŲŲ‘Ų’īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ" + }, + "cp28596": "iso88596", + "iso88597": { + "type": "_sbcs", + "chars": "Â€ÂÂ‚ÂƒÂ„Â…Â†Â‡ÂˆÂ‰ÂŠÂ‹ÂŒÂÂŽÂÂÂ‘Â’Â“Â”Â•Â–Â—Â˜Â™ÂšÂ›ÂœÂÂžÂŸÂ â€˜â€™ÂŖâ‚Ŧ₯Âϧ¨ŠÍēÂĢÂŦ­īŋŊâ€•Â°ÂąÂ˛ÂŗÎ„Î…Î†ÂˇÎˆÎ‰ÎŠÂģΌÂŊΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡīŋŊÎŖÎ¤ÎĨÎĻΧΨΊÎĒÎĢÎŦÎ­ÎŽÎ¯Î°ÎąÎ˛ÎŗÎ´ÎĩÎļΡθΚÎēÎģÎŧÎŊΞÎŋĪ€ĪĪ‚ĪƒĪ„Ī…Ī†Ī‡ĪˆĪ‰ĪŠĪ‹ĪŒĪĪŽīŋŊ" + }, + "cp28597": "iso88597", + "iso88598": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ īŋŊÂĸÂŖÂ¤ÂĨÂϧ¨Š×ÂĢÂŦÂ­ÂŽÂ¯Â°ÂąÂ˛ÂŗÂ´ÂĩÂļÂˇÂ¸ÂšÃˇÂģÂŧÂŊžīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ‗אבגדהוזחטיךכלםמןנס×ĸתפ×Ĩ×Ļקר׊×ĒīŋŊīŋŊ‎‏īŋŊ" + }, + "cp28598": "iso88598", + "iso88599": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡ÂĸÂŖÂ¤ÂĨÂϧ¨ŠÂĒÂĢÂŦÂ­ÂŽÂ¯Â°ÂąÂ˛ÂŗÂ´ÂĩÂšÂēÂģÂŧÂŊžÂŋÃ€ÃÃ‚ÃƒÃ„Ã…Ã†Ã‡ÃˆÃ‰ÃŠÃ‹ÃŒÃÃŽÃÄžÃ‘Ã’Ã“Ã”Ã•Ã–Ã—Ã˜Ã™ÃšÃ›ÃœÄ°ÅžÃŸÃ ÃĄÃĸÃŖÃ¤ÃĨÃĻçèÊÃĒÃĢÃŦÃ­ÃŽÃ¯ÄŸÃąÃ˛ÃŗÃ´ÃĩÃļÃˇÃ¸ÃšÃēÃģÃŧÄąÅŸÃŋ" + }, + "cp28599": "iso88599", + "iso885910": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒÄĸÄĒĨÄļ§ÄģĐŠÅĻÅŊ­ÅĒÅŠÂ°Ä…Ä“ÄŖÄĢĊġ¡ÄŧÄ‘ÅĄÅ§Åžâ€•ÅĢÅ‹Ä€ÃÃ‚ÃƒÃ„Ã…Ã†ÄŽÄŒÃ‰Ä˜Ã‹Ä–ÃÃŽÃÃÅ…ÅŒÃ“Ã”Ã•Ã–Å¨Ã˜Å˛ÃšÃ›ÃœÃÃžÃŸÄÃĄÃĸÃŖÃ¤ÃĨÃĻįčÊęÃĢÄ—Ã­ÃŽÃ¯Ã°Å†ÅÃŗÃ´ÃĩÃļÅŠÃ¸ÅŗÃēÃģÃŧÃŊÞĸ" + }, + "cp28600": "iso885910", + "iso885911": { + "type": "_sbcs", + "chars": "Â€ÂÂ‚ÂƒÂ„Â…Â†Â‡ÂˆÂ‰ÂŠÂ‹ÂŒÂÂŽÂÂÂ‘Â’Â“Â”Â•Â–Â—Â˜Â™ÂšÂ›ÂœÂÂžÂŸÂ ā¸ā¸‚ā¸ƒā¸„ā¸…ā¸†ā¸‡ā¸ˆā¸‰ā¸Šā¸‹ā¸Œā¸ā¸Žā¸ā¸ā¸‘ā¸’ā¸“ā¸”ā¸•ā¸–ā¸—ā¸˜ā¸™ā¸šā¸›ā¸œā¸ā¸žā¸Ÿā¸ ā¸Ąā¸ĸ⏪⏤ā¸Ĩā¸Ļā¸§ā¸¨ā¸Šā¸Ēā¸Ģā¸Ŧā¸­ā¸Žā¸¯ā¸°ā¸ąā¸˛ā¸ŗā¸´ā¸ĩā¸ļā¸ˇā¸¸ā¸šā¸ēīŋŊīŋŊīŋŊīŋŊā¸ŋāš€āšāš‚āšƒāš„āš…āš†āš‡āšˆāš‰āšŠāš‹āšŒāšāšŽāšāšāš‘āš’āš“āš”āš•āš–āš—āš˜āš™āššāš›īŋŊīŋŊīŋŊīŋŊ" + }, + "cp28601": "iso885911", + "iso885913": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”ÂĸÂŖÂ¤â€žÂĻ§ØŠŖÂĢÂŦÂ­ÂŽÃ†Â°ÂąÂ˛Âŗâ€œÂĩÂļÂˇÃ¸ÂšÅ—ÂģÂŧÂŊžÃĻĄĎĀĆÄÅĘĒČÉŚĖÄĸÄļÄĒÄģÅ ÅƒÅ…Ã“ÅŒÃ•Ã–Ã—Å˛ÅÅšÅĒÜÅģÅŊßąįāćäÃĨęēčÊÅēėĪĎÄĢÄŧÅĄÅ„Å†ÃŗÅÃĩÃļÃˇÅŗÅ‚Å›ÅĢÃŧÅŧŞ’" + }, + "cp28603": "iso885913", + "iso885914": { + "type": "_sbcs", + "chars": "Â€ÂÂ‚ÂƒÂ„Â…Â†Â‡ÂˆÂ‰ÂŠÂ‹ÂŒÂÂŽÂÂÂ‘Â’Â“Â”Â•Â–Â—Â˜Â™ÂšÂ›ÂœÂÂžÂŸÂ á¸‚á¸ƒÂŖÄŠÄ‹á¸ŠÂ§áē€ÂŠáē‚ḋáģ˛Â­ÂŽÅ¸á¸žá¸ŸÄ ÄĄáš€ášÂļṖáēáš—áēƒáš áģŗáē„áē…ášĄÃ€ÃÃ‚ÃƒÃ„Ã…Ã†Ã‡ÃˆÃ‰ÃŠÃ‹ÃŒÃÃŽÃÅ´Ã‘Ã’Ã“Ã”Ã•Ã–ášĒØÙÚÛÜÝÅļÃŸÃ ÃĄÃĸÃŖÃ¤ÃĨÃĻçèÊÃĒÃĢÃŦíÎïÅĩÃąÃ˛ÃŗÃ´ÃĩÃļášĢøÚÃēÃģÃŧÃŊŎÃŋ" + }, + "cp28604": "iso885914", + "iso885915": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡ÂĸÂŖâ‚ŦÂĨÅ Â§ÅĄÂŠÂĒÂĢÂŦÂ­ÂŽÂ¯Â°ÂąÂ˛ÂŗÅŊÂĩÂļÂˇÅžÂšÂēÂģŒœŸÂŋÃ€ÃÃ‚ÃƒÃ„Ã…Ã†Ã‡ÃˆÃ‰ÃŠÃ‹ÃŒÃÃŽÃÃÃ‘Ã’Ã“Ã”Ã•Ã–Ã—Ã˜Ã™ÃšÃ›ÃœÃÃžÃŸÃ ÃĄÃĸÃŖÃ¤ÃĨÃĻçèÊÃĒÃĢÃŦÃ­ÃŽÃ¯Ã°ÃąÃ˛ÃŗÃ´ÃĩÃļÃˇÃ¸ÃšÃēÃģÃŧÃŊÞÃŋ" + }, + "cp28605": "iso885915", + "iso885916": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁâ‚Ŧâ€žÅ Â§ÅĄÂŠČ˜ÂĢŚ­ÅēÅģÂ°ÂąÄŒÅ‚ÅŊ”ÂļÂˇÅžÄČ™ÂģŒœŸÅŧÃ€ÃÃ‚Ä‚Ã„Ä†Ã†Ã‡ÃˆÃ‰ÃŠÃ‹ÃŒÃÃŽÃÄÅƒÃ’Ã“Ã”ÅÃ–ÅšÅ°Ã™ÃšÃ›ÃœÄ˜ČšÃŸÃ ÃĄÃĸăäćÃĻçèÊÃĒÃĢÃŦÃ­ÃŽÃ¯Ä‘Å„Ã˛ÃŗÃ´Å‘ÃļÅ›ÅąÃšÃēÃģÃŧęțÃŋ" + }, + "cp28606": "iso885916", + "cp437": { + "type": "_sbcs", + "chars": "ÇÃŧÊÃĸäàÃĨçÃĒÃĢèïÎÃŦÄÅÉÃĻÆôÃļÃ˛ÃģÚÃŋÖÜÂĸÂŖÂĨâ‚§Æ’ÃĄÃ­ÃŗÃēÃąÃ‘ÂĒÂēÂŋ⌐ÂŦÂŊÂŧÂĄÂĢÂģ░▒▓│┤╡â•ĸâ•–â••â•Ŗâ•‘â•—â•â•œâ•›â”â””â”´â”Ŧ├─â”ŧ╞╟╚╔╩â•Ļ╠═â•Ŧ╧╨╤â•Ĩ╙╘╒╓â•Ģâ•Ēâ”˜â”Œâ–ˆâ–„â–Œâ–â–€ÎąÃŸÎ“Ī€ÎŖĪƒÂĩĪ„ÎĻÎ˜ÎŠÎ´âˆžĪ†Îĩ∩≡±â‰Ĩâ‰¤âŒ âŒĄÃˇâ‰ˆÂ°âˆ™Âˇâˆšâŋ²■ " + }, + "ibm437": "cp437", + "csibm437": "cp437", + "cp737": { + "type": "_sbcs", + "chars": "Î‘Î’Î“Î”Î•Î–Î—Î˜Î™ÎšÎ›ÎœÎÎžÎŸÎ ÎĄÎŖÎ¤ÎĨÎĻÎ§Î¨ÎŠÎąÎ˛ÎŗÎ´ÎĩÎļΡθΚÎēÎģÎŧÎŊΞÎŋĪ€ĪĪƒĪ‚Ī„Ī…Ī†Ī‡Īˆâ–‘â–’â–“â”‚â”¤â•Ąâ•ĸâ•–â••â•Ŗâ•‘â•—â•â•œâ•›â”â””â”´â”Ŧ├─â”ŧ╞╟╚╔╩â•Ļ╠═â•Ŧ╧╨╤â•Ĩ╙╘╒╓â•Ģâ•Ēâ”˜â”Œâ–ˆâ–„â–Œâ–â–€Ī‰ÎŦÎ­ÎŽĪŠÎ¯ĪŒĪĪ‹ĪŽÎ†ÎˆÎ‰ÎŠÎŒÎŽÎÂąâ‰Ĩ≤ÎĒÎĢÃˇâ‰ˆÂ°âˆ™Âˇâˆšâŋ²■ " + }, + "ibm737": "cp737", + "csibm737": "cp737", + "cp775": { + "type": "_sbcs", + "chars": "ĆÃŧÃŠÄÃ¤ÄŖÃĨćłēŖŗÄĢŚÄÅÉÃĻÆōÃļÄĸÂĸÅšÅ›Ã–ÃœÃ¸ÂŖÃ˜Ã—Â¤Ä€ÄĒÃŗÅģÅŧÅē”ÂĻŠŽÂŦÂŊÂŧŁÂĢÂģâ–‘â–’â–“â”‚â”¤Ä„ÄŒÄ˜Ä–â•Ŗâ•‘â•—â•ÄŽÅ â”â””â”´â”Ŧ├─â”ŧŞÅĒ╚╔╩â•Ļ╠═â•ŦÅŊÄ…ÄÄ™Ä—Ä¯ÅĄÅŗÅĢŞ┘┌█▄▌▐▀ÓßŌŃÃĩÕÂĩńÄļġÄģÄŧÅ†Ä’Å…â€™Â­Âąâ€œÂžÂļÂ§Ãˇâ€žÂ°âˆ™ÂˇÂšÂŗÂ˛â– Â " + }, + "ibm775": "cp775", + "csibm775": "cp775", + "cp850": { + "type": "_sbcs", + "chars": "ÇÃŧÊÃĸäàÃĨçÃĒÃĢèïÎÃŦÄÅÉÃĻÆôÃļÃ˛ÃģÚÃŋÃ–ÃœÃ¸ÂŖÃ˜Ã—Æ’ÃĄÃ­ÃŗÃēÃąÃ‘ÂĒÂēÂŋÂŽÂŦÂŊÂŧÂĄÂĢÂģâ–‘â–’â–“â”‚â”¤ÃÃ‚Ã€ÂŠâ•Ŗâ•‘â•—â•ÂĸÂĨ┐└┴â”Ŧ├─â”ŧÃŖÃƒâ•šâ•”â•Šâ•Ļ╠═â•ŦÂ¤Ã°ÃÃŠÃ‹ÃˆÄąÃÃŽÃâ”˜â”Œâ–ˆâ–„ÂĻÌ▀ÓßÔÒÃĩÕÂĩÞÞÚÛÙÃŊÃÂ¯Â´Â­Âąâ€—ÂžÂļÂ§ÃˇÂ¸Â°Â¨ÂˇÂšÂŗÂ˛â– Â " + }, + "ibm850": "cp850", + "csibm850": "cp850", + "cp852": { + "type": "_sbcs", + "chars": "ÇÃŧÊÃĸäůćçłÃĢŐőÎŚÄĆÉĚÄēôÃļÄŊĞŚśÖÜŤÅĨÅÃ—ÄÃĄÃ­ÃŗÃēĄąÅŊŞĘęÂŦÅēČşÂĢÂģâ–‘â–’â–“â”‚â”¤ÃÃ‚ÄšÅžâ•Ŗâ•‘â•—â•ÅģÅŧ┐└┴â”Ŧ├─â”ŧĂă╚╔╩â•Ļ╠═â•Ŧ¤đĐĎËďŇÍÎě┘┌█▄ÅĸÅŽâ–€Ã“ÃŸÃ”ÅƒÅ„ÅˆÅ ÅĄÅ”ÃšÅ•Å°ÃŊÃÅŖÂ´Â­ËË›Ë‡Ë˜Â§ÃˇÂ¸Â°Â¨Ë™ÅąÅ˜Å™â– Â " + }, + "ibm852": "cp852", + "csibm852": "cp852", + "cp855": { + "type": "_sbcs", + "chars": "Ņ’Đ‚Ņ“ĐƒŅ‘ĐŅ”Đ„Ņ•Đ…Ņ–Đ†Ņ—Đ‡Ņ˜ĐˆŅ™Đ‰ŅšĐŠŅ›Đ‹ŅœĐŒŅžĐŽŅŸĐŅŽĐŽŅŠĐĒĐ°ĐĐąĐ‘Ņ†ĐĻдДĐĩĐ•Ņ„Đ¤ĐŗĐ“ÂĢÂģâ–‘â–’â–“â”‚â”¤Ņ…ĐĨĐ¸Đ˜â•Ŗâ•‘â•—â•ĐšĐ™â”â””â”´â”Ŧ├─â”ŧĐēК╚╔╩â•Ļ╠═â•Ŧ¤ĐģЛĐŧМĐŊНоОĐŋâ”˜â”Œâ–ˆâ–„ĐŸŅâ–€Đ¯Ņ€Đ ŅĐĄŅ‚ĐĸŅƒĐŖĐļĐ–Đ˛Đ’ŅŒĐŦâ„–Â­Ņ‹ĐĢĐˇĐ—ŅˆĐ¨ŅĐ­Ņ‰ĐŠŅ‡Đ§Â§â– Â " + }, + "ibm855": "cp855", + "csibm855": "cp855", + "cp856": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנס×ĸתפ×Ĩ×Ļקר׊×ĒīŋŊÂŖīŋŊ×īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÂŽÂŦÂŊÂŧīŋŊÂĢÂģ░▒▓│┤īŋŊīŋŊīŋŊÂŠâ•Ŗâ•‘â•—â•ÂĸÂĨ┐└┴â”Ŧ├─â”ŧīŋŊīŋŊ╚╔╩â•Ļ╠═â•Ŧ¤īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ┘┌█▄ÂĻīŋŊ▀īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÂĩīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊÂ¯Â´Â­Âąâ€—ÂžÂļÂ§ÃˇÂ¸Â°Â¨ÂˇÂšÂŗÂ˛â– Â " + }, + "ibm856": "cp856", + "csibm856": "cp856", + "cp857": { + "type": "_sbcs", + "chars": "ÇÃŧÊÃĸäàÃĨçÃĒÃĢÃ¨Ã¯ÃŽÄąÃ„Ã…Ã‰ÃĻÆôÃļÃ˛ÃģÃšÄ°Ã–ÃœÃ¸ÂŖÃ˜ÅžÅŸÃĄÃ­ÃŗÃēÃąÃ‘ÄžÄŸÂŋÂŽÂŦÂŊÂŧÂĄÂĢÂģâ–‘â–’â–“â”‚â”¤ÃÃ‚Ã€ÂŠâ•Ŗâ•‘â•—â•ÂĸÂĨ┐└┴â”Ŧ├─â”ŧÃŖÃƒâ•šâ•”â•Šâ•Ļ╠═â•Ŧ¤ÂēÂĒÊËÈīŋŊÍÎÏ┘┌█▄ÂĻÌ▀ÓßÔÒÃĩÕÂĩīŋŊ×ÚÛÙÃŦÃŋÂ¯Â´Â­ÂąīŋŊžÂļÂ§ÃˇÂ¸Â°Â¨ÂˇÂšÂŗÂ˛â– Â " + }, + "ibm857": "cp857", + "csibm857": "cp857", + "cp858": { + "type": "_sbcs", + "chars": "ÇÃŧÊÃĸäàÃĨçÃĒÃĢèïÎÃŦÄÅÉÃĻÆôÃļÃ˛ÃģÚÃŋÃ–ÃœÃ¸ÂŖÃ˜Ã—Æ’ÃĄÃ­ÃŗÃēÃąÃ‘ÂĒÂēÂŋÂŽÂŦÂŊÂŧÂĄÂĢÂģâ–‘â–’â–“â”‚â”¤ÃÃ‚Ã€ÂŠâ•Ŗâ•‘â•—â•ÂĸÂĨ┐└┴â”Ŧ├─â”ŧÃŖÃƒâ•šâ•”â•Šâ•Ļ╠═â•Ŧ¤ðÐÊËÈâ‚ŦÍÎÏ┘┌█▄ÂĻÌ▀ÓßÔÒÃĩÕÂĩÞÞÚÛÙÃŊÃÂ¯Â´Â­Âąâ€—ÂžÂļÂ§ÃˇÂ¸Â°Â¨ÂˇÂšÂŗÂ˛â– Â " + }, + "ibm858": "cp858", + "csibm858": "cp858", + "cp860": { + "type": "_sbcs", + "chars": "ÇÃŧÊÃĸÃŖÃ ÃÃ§ÃĒÊèÍÔÃŦÃÂÉÀÈôÃĩÃ˛ÃšÃšÃŒÃ•ÃœÂĸÂŖÃ™â‚§Ã“ÃĄÃ­ÃŗÃēÃąÃ‘ÂĒÂēÂŋÒÂŦÂŊÂŧÂĄÂĢÂģ░▒▓│┤╡â•ĸâ•–â••â•Ŗâ•‘â•—â•â•œâ•›â”â””â”´â”Ŧ├─â”ŧ╞╟╚╔╩â•Ļ╠═â•Ŧ╧╨╤â•Ĩ╙╘╒╓â•Ģâ•Ēâ”˜â”Œâ–ˆâ–„â–Œâ–â–€ÎąÃŸÎ“Ī€ÎŖĪƒÂĩĪ„ÎĻÎ˜ÎŠÎ´âˆžĪ†Îĩ∩≡±â‰Ĩâ‰¤âŒ âŒĄÃˇâ‰ˆÂ°âˆ™Âˇâˆšâŋ²■ " + }, + "ibm860": "cp860", + "csibm860": "cp860", + "cp861": { + "type": "_sbcs", + "chars": "ÇÃŧÊÃĸäàÃĨçÃĒÃĢèÐðÞÄÅÉÃĻÆôÃļÞÃģÝÃŊÃ–ÃœÃ¸ÂŖÃ˜â‚§Æ’ÃĄÃ­ÃŗÃēÁÍÓÚÂŋ⌐ÂŦÂŊÂŧÂĄÂĢÂģ░▒▓│┤╡â•ĸâ•–â••â•Ŗâ•‘â•—â•â•œâ•›â”â””â”´â”Ŧ├─â”ŧ╞╟╚╔╩â•Ļ╠═â•Ŧ╧╨╤â•Ĩ╙╘╒╓â•Ģâ•Ēâ”˜â”Œâ–ˆâ–„â–Œâ–â–€ÎąÃŸÎ“Ī€ÎŖĪƒÂĩĪ„ÎĻÎ˜ÎŠÎ´âˆžĪ†Îĩ∩≡±â‰Ĩâ‰¤âŒ âŒĄÃˇâ‰ˆÂ°âˆ™Âˇâˆšâŋ²■ " + }, + "ibm861": "cp861", + "csibm861": "cp861", + "cp862": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנס×ĸתפ×Ĩ×Ļקר׊×ĒÂĸÂŖÂĨâ‚§Æ’ÃĄÃ­ÃŗÃēÃąÃ‘ÂĒÂēÂŋ⌐ÂŦÂŊÂŧÂĄÂĢÂģ░▒▓│┤╡â•ĸâ•–â••â•Ŗâ•‘â•—â•â•œâ•›â”â””â”´â”Ŧ├─â”ŧ╞╟╚╔╩â•Ļ╠═â•Ŧ╧╨╤â•Ĩ╙╘╒╓â•Ģâ•Ēâ”˜â”Œâ–ˆâ–„â–Œâ–â–€ÎąÃŸÎ“Ī€ÎŖĪƒÂĩĪ„ÎĻÎ˜ÎŠÎ´âˆžĪ†Îĩ∩≡±â‰Ĩâ‰¤âŒ âŒĄÃˇâ‰ˆÂ°âˆ™Âˇâˆšâŋ²■ " + }, + "ibm862": "cp862", + "csibm862": "cp862", + "cp863": { + "type": "_sbcs", + "chars": "ÇÃŧÊÃĸÂàÂļçÃĒÃĢèïÎ‗À§ÉÈÊôËÏÃģÚ¤ÔÜÂĸÂŖÃ™Ã›Æ’ÂĻÂ´ÃŗÃēÂ¨Â¸ÂŗÂ¯ÃŽâŒÂŦÂŊÂŧžÂĢÂģ░▒▓│┤╡â•ĸâ•–â••â•Ŗâ•‘â•—â•â•œâ•›â”â””â”´â”Ŧ├─â”ŧ╞╟╚╔╩â•Ļ╠═â•Ŧ╧╨╤â•Ĩ╙╘╒╓â•Ģâ•Ēâ”˜â”Œâ–ˆâ–„â–Œâ–â–€ÎąÃŸÎ“Ī€ÎŖĪƒÂĩĪ„ÎĻÎ˜ÎŠÎ´âˆžĪ†Îĩ∩≡±â‰Ĩâ‰¤âŒ âŒĄÃˇâ‰ˆÂ°âˆ™Âˇâˆšâŋ²■ " + }, + "ibm863": "cp863", + "csibm863": "cp863", + "cp864": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$ŲĒ&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│â”ŧ┤â”Ŧâ”œâ”´â”â”Œâ””â”˜Î˛âˆžĪ†ÂąÂŊÂŧ≈ÂĢÂģīģˇīģ¸īŋŊīŋŊīģģīģŧīŋŊ ­īē‚ÂŖÂ¤īē„īŋŊīŋŊīēŽīēīē•ī癨ŒīēīēĄīēĨŲ ŲĄŲĸŲŖŲ¤ŲĨŲĻŲ§Ų¨ŲŠī쑨›īēąīēĩīēšØŸÂĸīē€īēīēƒīē…īģŠīē‹īēīē‘īē“īē—īē›īēŸīēŖīē§īēŠīēĢīē­īē¯īēŗīēˇīēģīēŋīģīģ…īģ‹īģÂĻÂŦÃˇÃ—īģ‰Ų€īģ“īģ—īģ›īģŸīģŖīģ§īģĢīģ­īģ¯īģŗīēŊīģŒīģŽīģīģĄīšŊŲ‘īģĨīģŠīģŦīģ°īģ˛īģīģ•īģĩīģļīģīģ™īģąâ– īŋŊ" + }, + "ibm864": "cp864", + "csibm864": "cp864", + "cp865": { + "type": "_sbcs", + "chars": "ÇÃŧÊÃĸäàÃĨçÃĒÃĢèïÎÃŦÄÅÉÃĻÆôÃļÃ˛ÃģÚÃŋÃ–ÃœÃ¸ÂŖÃ˜â‚§Æ’ÃĄÃ­ÃŗÃēÃąÃ‘ÂĒÂēÂŋ⌐ÂŦÂŊÂŧÂĄÂ̤░▒▓│┤╡â•ĸâ•–â••â•Ŗâ•‘â•—â•â•œâ•›â”â””â”´â”Ŧ├─â”ŧ╞╟╚╔╩â•Ļ╠═â•Ŧ╧╨╤â•Ĩ╙╘╒╓â•Ģâ•Ēâ”˜â”Œâ–ˆâ–„â–Œâ–â–€ÎąÃŸÎ“Ī€ÎŖĪƒÂĩĪ„ÎĻÎ˜ÎŠÎ´âˆžĪ†Îĩ∩≡±â‰Ĩâ‰¤âŒ âŒĄÃˇâ‰ˆÂ°âˆ™Âˇâˆšâŋ²■ " + }, + "ibm865": "cp865", + "csibm865": "cp865", + "cp866": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСĐĸĐŖĐ¤ĐĨĐĻЧШЊĐĒĐĢĐŦĐ­ĐŽĐ¯Đ°ĐąĐ˛ĐŗĐ´ĐĩĐļСиКĐēĐģĐŧĐŊĐžĐŋ░▒▓│┤╡â•ĸâ•–â••â•Ŗâ•‘â•—â•â•œâ•›â”â””â”´â”Ŧ├─â”ŧ╞╟╚╔╩â•Ļ╠═â•Ŧ╧╨╤â•Ĩ╙╘╒╓â•Ģâ•Ēâ”˜â”Œâ–ˆâ–„â–Œâ–â–€Ņ€ŅŅ‚ŅƒŅ„Ņ…Ņ†Ņ‡ŅˆŅ‰ŅŠŅ‹ŅŒŅŅŽŅĐŅ‘Đ„Ņ”Đ‡Ņ—ĐŽŅžÂ°âˆ™Âˇâˆšâ„–Â¤â– Â " + }, + "ibm866": "cp866", + "csibm866": "cp866", + "cp869": { + "type": "_sbcs", + "chars": "īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊΆīŋŊ¡ÂŦÂĻ‘’Έ―ΉΊÎĒΌīŋŊīŋŊΎÎĢÂŠÎÂ˛ÂŗÎŦÂŖÎ­ÎŽÎ¯ĪŠÎĪŒĪÎ‘Î’Î“Î”Î•Î–Î—ÂŊΘΙÂĢÂģâ–‘â–’â–“â”‚â”¤ÎšÎ›ÎœÎâ•Ŗâ•‘â•—â•ÎžÎŸâ”â””â”´â”Ŧ├─â”ŧΠΡ╚╔╩â•Ļ╠═â•ŦÎŖÎ¤ÎĨÎĻÎ§Î¨ÎŠÎąÎ˛Îŗâ”˜â”Œâ–ˆâ–„Î´Îĩ▀ÎļΡθΚÎēÎģÎŧÎŊΞÎŋĪ€ĪĪƒĪ‚Ī„Î„Â­ÂąĪ…Ī†Ī‡Â§ĪˆÎ…Â°Â¨Ī‰Ī‹Î°ĪŽâ– Â " + }, + "ibm869": "cp869", + "csibm869": "cp869", + "cp922": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡ÂĸÂŖÂ¤ÂĨÂϧ¨ŠÂĒÂĢÂŦÂ­ÂŽâ€žÂ°ÂąÂ˛ÂŗÂ´ÂĩÂšÂēÂģÂŧÂŊžÂŋÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝÅŊÃŸÃ ÃĄÃĸÃŖÃ¤ÃĨÃĻçèÊÃĒÃĢÃŦÃ­ÃŽÃ¯ÅĄÃąÃ˛ÃŗÃ´ÃĩÃļÃˇÃ¸ÃšÃēÃģÃŧÃŊÅžÃŋ" + }, + "ibm922": "cp922", + "csibm922": "cp922", + "cp1046": { + "type": "_sbcs", + "chars": "īēˆÃ—ÃˇīŖļīŖĩīŖ´īŖˇīšąÂˆâ– â”‚â”€â”â”Œâ””â”˜īššīšģīšŊīšŋīšˇīēŠīģ°īģŗīģ˛īģŽīģīģīģļīģ¸īģēīģŧ īŖēīŖšīŖ¸Â¤īŖģīē‹īē‘īē—īē›īēŸīēŖØŒÂ­īē§īēŗŲ ŲĄŲĸŲŖŲ¤ŲĨŲĻŲ§Ų¨ŲŠī玨›īēģīēŋī슨Ÿī싨ĄØĸØŖØ¤ØĨØĻاب؊ØĒØĢØŦØ­ØŽØ¯Ø°ØąØ˛ØŗØ´ØĩØļØˇī쇨šØēīģŒīē‚īē„īēŽīģ“Ų€ŲŲ‚ŲƒŲ„Ų…Ų†Ų‡ŲˆŲ‰ŲŠŲ‹ŲŒŲŲŽŲŲŲ‘Ų’īģ—īģ›īģŸīŖŧīģĩīģˇīģšīģģīģŖīģ§īģŦīģŠīŋŊ" + }, + "ibm1046": "cp1046", + "csibm1046": "cp1046", + "cp1124": { + "type": "_sbcs", + "chars": "Â€ÂÂ‚ÂƒÂ„Â…Â†Â‡ÂˆÂ‰ÂŠÂ‹ÂŒÂÂŽÂÂÂ‘Â’Â“Â”Â•Â–Â—Â˜Â™ÂšÂ›ÂœÂÂžÂŸÂ ĐĐ‚ŌĐ„Đ…Đ†Đ‡ĐˆĐ‰ĐŠĐ‹ĐŒÂ­ĐŽĐĐĐ‘Đ’Đ“Đ”Đ•Đ–Đ—Đ˜Đ™ĐšĐ›ĐœĐĐžĐŸĐ ĐĄĐĸĐŖĐ¤ĐĨĐĻЧШЊĐĒĐĢĐŦĐ­ĐŽĐ¯Đ°ĐąĐ˛ĐŗĐ´ĐĩĐļСиКĐēĐģĐŧĐŊĐžĐŋŅ€ŅŅ‚ŅƒŅ„Ņ…Ņ†Ņ‡ŅˆŅ‰ŅŠŅ‹ŅŒŅŅŽŅâ„–Ņ‘Ņ’Ō‘Ņ”Ņ•Ņ–Ņ—Ņ˜Ņ™ŅšŅ›ŅœÂ§ŅžŅŸ" + }, + "ibm1124": "cp1124", + "csibm1124": "cp1124", + "cp1125": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСĐĸĐŖĐ¤ĐĨĐĻЧШЊĐĒĐĢĐŦĐ­ĐŽĐ¯Đ°ĐąĐ˛ĐŗĐ´ĐĩĐļСиКĐēĐģĐŧĐŊĐžĐŋ░▒▓│┤╡â•ĸâ•–â••â•Ŗâ•‘â•—â•â•œâ•›â”â””â”´â”Ŧ├─â”ŧ╞╟╚╔╩â•Ļ╠═â•Ŧ╧╨╤â•Ĩ╙╘╒╓â•Ģâ•Ēâ”˜â”Œâ–ˆâ–„â–Œâ–â–€Ņ€ŅŅ‚ŅƒŅ„Ņ…Ņ†Ņ‡ŅˆŅ‰ŅŠŅ‹ŅŒŅŅŽŅĐŅ‘ŌŌ‘Đ„Ņ”Đ†Ņ–Đ‡Ņ—Âˇâˆšâ„–Â¤â– Â " + }, + "ibm1125": "cp1125", + "csibm1125": "cp1125", + "cp1129": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡ÂĸÂŖÂ¤ÂĨÂϧœŠÂĒÂĢÂŦÂ­ÂŽÂ¯Â°ÂąÂ˛ÂŗÅ¸ÂĩÂļÂˇÅ’ÂšÂēÂģÂŧÂŊžÂŋÃ€ÃÃ‚Ä‚Ã„Ã…Ã†Ã‡ÃˆÃ‰ÃŠÃ‹Ė€ÃÃŽÃÄÃ‘Ė‰Ã“Ã”Æ Ã–Ã—Ã˜Ã™ÃšÃ›ÃœÆ¯ĖƒÃŸÃ ÃĄÃĸăäÃĨÃĻçèÊÃĒÃĢĖÃ­ÃŽÃ¯Ä‘ÃąĖŖÃŗÃ´ÆĄÃļÃˇÃ¸ÃšÃēÃģÃŧưâ‚ĢÃŋ" + }, + "ibm1129": "cp1129", + "csibm1129": "cp1129", + "cp1133": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ āēāē‚āē„āē‡āēˆāēĒāēŠāēāē”āē•āē–āē—āē™āēšāē›āēœāēāēžāēŸāēĄāēĸāēŖāēĨāē§āēĢāē­āēŽīŋŊīŋŊīŋŊāē¯āē°āē˛āēŗāē´āēĩāēļāēˇāē¸āēšāēŧāēąāēģāēŊīŋŊīŋŊīŋŊāģ€āģāģ‚āģƒāģ„āģˆāģ‰āģŠāģ‹āģŒāģāģ†īŋŊāģœāģâ‚­īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊāģāģ‘āģ’āģ“āģ”āģ•āģ–āģ—āģ˜āģ™īŋŊīŋŊÂĸÂŦÂĻīŋŊ" + }, + "ibm1133": "cp1133", + "csibm1133": "cp1133", + "cp1161": { + "type": "_sbcs", + "chars": "īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊāšˆā¸ā¸‚ā¸ƒā¸„ā¸…ā¸†ā¸‡ā¸ˆā¸‰ā¸Šā¸‹ā¸Œā¸ā¸Žā¸ā¸ā¸‘ā¸’ā¸“ā¸”ā¸•ā¸–ā¸—ā¸˜ā¸™ā¸šā¸›ā¸œā¸ā¸žā¸Ÿā¸ ā¸Ąā¸ĸ⏪⏤ā¸Ĩā¸Ļā¸§ā¸¨ā¸Šā¸Ēā¸Ģā¸Ŧā¸­ā¸Žā¸¯ā¸°ā¸ąā¸˛ā¸ŗā¸´ā¸ĩā¸ļā¸ˇā¸¸ā¸šā¸ēāš‰āšŠāš‹â‚Ŧā¸ŋāš€āšāš‚āšƒāš„āš…āš†āš‡āšˆāš‰āšŠāš‹āšŒāšāšŽāšāšāš‘āš’āš“āš”āš•āš–āš—āš˜āš™āššāš›ÂĸÂŦÂĻ " + }, + "ibm1161": "cp1161", + "csibm1161": "cp1161", + "cp1162": { + "type": "_sbcs", + "chars": "â‚Ŧ‚ƒ„â€Ļ†‡ˆ‰Š‹ŒŽ‘’“”â€ĸâ€“â€”Â˜Â™ÂšÂ›ÂœÂÂžÂŸÂ ā¸ā¸‚ā¸ƒā¸„ā¸…ā¸†ā¸‡ā¸ˆā¸‰ā¸Šā¸‹ā¸Œā¸ā¸Žā¸ā¸ā¸‘ā¸’ā¸“ā¸”ā¸•ā¸–ā¸—ā¸˜ā¸™ā¸šā¸›ā¸œā¸ā¸žā¸Ÿā¸ ā¸Ąā¸ĸ⏪⏤ā¸Ĩā¸Ļā¸§ā¸¨ā¸Šā¸Ēā¸Ģā¸Ŧā¸­ā¸Žā¸¯ā¸°ā¸ąā¸˛ā¸ŗā¸´ā¸ĩā¸ļā¸ˇā¸¸ā¸šā¸ēīŋŊīŋŊīŋŊīŋŊā¸ŋāš€āšāš‚āšƒāš„āš…āš†āš‡āšˆāš‰āšŠāš‹āšŒāšāšŽāšāšāš‘āš’āš“āš”āš•āš–āš—āš˜āš™āššāš›īŋŊīŋŊīŋŊīŋŊ" + }, + "ibm1162": "cp1162", + "csibm1162": "cp1162", + "cp1163": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡ÂĸÂŖâ‚ŦÂĨÂϧœŠÂĒÂĢÂŦÂ­ÂŽÂ¯Â°ÂąÂ˛ÂŗÅ¸ÂĩÂļÂˇÅ’ÂšÂēÂģÂŧÂŊžÂŋÃ€ÃÃ‚Ä‚Ã„Ã…Ã†Ã‡ÃˆÃ‰ÃŠÃ‹Ė€ÃÃŽÃÄÃ‘Ė‰Ã“Ã”Æ Ã–Ã—Ã˜Ã™ÃšÃ›ÃœÆ¯ĖƒÃŸÃ ÃĄÃĸăäÃĨÃĻçèÊÃĒÃĢĖÃ­ÃŽÃ¯Ä‘ÃąĖŖÃŗÃ´ÆĄÃļÃˇÃ¸ÃšÃēÃģÃŧưâ‚ĢÃŋ" + }, + "ibm1163": "cp1163", + "csibm1163": "cp1163", + "maccroatian": { + "type": "_sbcs", + "chars": "Ã„Ã…Ã‡Ã‰Ã‘Ã–ÃœÃĄÃ ÃĸÃ¤ÃŖÃĨçÊèÃĒÃĢíÃŦÃŽÃ¯ÃąÃŗÃ˛Ã´ÃļÃĩÃēÚÃģÃŧ†°ÂĸÂŖÂ§â€ĸÂļߎŠâ„ĸ´¨≠ÅŊÃ˜âˆžÂąâ‰¤â‰Ĩ∆Âĩâˆ‚âˆ‘âˆÅĄâˆĢÂĒÂēâ„ĻŞøÂŋÂĄÂŦ√ƒ≈ĆÂĢČâ€ĻÂ Ã€ÃƒÃ•Å’Å“Äâ€”â€œâ€â€˜â€™Ãˇâ—ŠīŋŊ©⁄¤‹â€ēÆÂģâ€“Âˇâ€šâ€žâ€°Ã‚Ä‡ÃÄÃˆÃÃŽÃÃŒÃ“Ã”Ä‘Ã’ÃšÃ›Ã™ÄąË†ËœÂ¯Ī€Ã‹ËšÂ¸ÃŠÃώ" + }, + "maccyrillic": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСĐĸĐŖĐ¤ĐĨĐĻЧШЊĐĒĐĢĐŦĐ­ĐŽĐ¯â€ Â°ÂĸÂŖÂ§â€ĸÂļІ®©â„ĸĐ‚Ņ’â‰ ĐƒŅ“âˆžÂąâ‰¤â‰ĨŅ–Âĩâˆ‚ĐˆĐ„Ņ”Đ‡Ņ—Đ‰Ņ™ĐŠŅšŅ˜Đ…ÂŦ√ƒ≈∆ÂĢÂģâ€ĻÂ Đ‹Ņ›ĐŒŅœŅ•â€“â€”â€œâ€â€˜â€™Ãˇâ€žĐŽŅžĐŅŸâ„–ĐŅ‘ŅĐ°ĐąĐ˛ĐŗĐ´ĐĩĐļСиКĐēĐģĐŧĐŊĐžĐŋŅ€ŅŅ‚ŅƒŅ„Ņ…Ņ†Ņ‡ŅˆŅ‰ŅŠŅ‹ŅŒŅŅŽÂ¤" + }, + "macgreek": { + "type": "_sbcs", + "chars": "Ã„ÂšÂ˛Ã‰ÂŗÃ–ÃœÎ…Ã Ãĸä΄¨çÊèÃĒÃĢÂŖâ„ĸÎïâ€ĸÂŊ‰ôÃļÂĻ­ÚÃģÃŧâ€ Î“Î”Î˜Î›ÎžÎ ÃŸÂŽÂŠÎŖÎǧ≠°·Α±≤â‰ĨÂĨΒΕΖΗΙΚΜÎĻÎĢΨΊÎŦΝÂŦΟΡ≈ΤÂĢÂģâ€Ļ ÎĨÎ§Î†ÎˆÅ“â€“â€•â€œâ€â€˜â€™ÃˇÎ‰ÎŠÎŒÎŽÎ­ÎŽÎ¯ĪŒÎĪÎąÎ˛ĪˆÎ´ÎĩĪ†ÎŗÎˇÎšÎžÎēÎģÎŧÎŊÎŋĪ€ĪŽĪĪƒĪ„Î¸Ī‰Ī‚Ī‡Ī…ÎļĪŠĪ‹ÎÎ°īŋŊ" + }, + "maciceland": { + "type": "_sbcs", + "chars": "Ã„Ã…Ã‡Ã‰Ã‘Ã–ÃœÃĄÃ ÃĸÃ¤ÃŖÃĨçÊèÃĒÃĢíÃŦÃŽÃ¯ÃąÃŗÃ˛Ã´ÃļÃĩÃēÚÃģÃŧݰÂĸÂŖÂ§â€ĸÂļߎŠâ„ĸÂ´Â¨â‰ Ã†Ã˜âˆžÂąâ‰¤â‰ĨÂĨÂĩâˆ‚âˆ‘âˆĪ€âˆĢÂĒÂēâ„ĻÃĻøÂŋÂĄÂŦ√ƒ≈∆ÂĢÂģâ€ĻÂ Ã€ÃƒÃ•Å’Å“â€“â€”â€œâ€â€˜â€™Ãˇâ—ŠÃŋŸ⁄¤ÐðÞÞÃŊÂˇâ€šâ€žâ€°Ã‚ÃŠÃÃ‹ÃˆÃÃŽÃÃŒÃ“Ã”īŋŊÃ’ÃšÃ›Ã™ÄąË†ËœÂ¯Ë˜Ë™ËšÂ¸ËË›Ë‡" + }, + "macroman": { + "type": "_sbcs", + "chars": "Ã„Ã…Ã‡Ã‰Ã‘Ã–ÃœÃĄÃ ÃĸÃ¤ÃŖÃĨçÊèÃĒÃĢíÃŦÃŽÃ¯ÃąÃŗÃ˛Ã´ÃļÃĩÃēÚÃģÃŧ†°ÂĸÂŖÂ§â€ĸÂļߎŠâ„ĸÂ´Â¨â‰ Ã†Ã˜âˆžÂąâ‰¤â‰ĨÂĨÂĩâˆ‚âˆ‘âˆĪ€âˆĢÂĒÂēâ„ĻÃĻøÂŋÂĄÂŦ√ƒ≈∆ÂĢÂģâ€ĻÂ Ã€ÃƒÃ•Å’Å“â€“â€”â€œâ€â€˜â€™Ãˇâ—ŠÃŋŸ⁄¤‚â€ēīŦīŦ‚â€ĄÂˇâ€šâ€žâ€°Ã‚ÃŠÃÃ‹ÃˆÃÃŽÃÃŒÃ“Ã”īŋŊÃ’ÃšÃ›Ã™ÄąË†ËœÂ¯Ë˜Ë™ËšÂ¸ËË›Ë‡" + }, + "macromania": { + "type": "_sbcs", + "chars": "Ã„Ã…Ã‡Ã‰Ã‘Ã–ÃœÃĄÃ ÃĸÃ¤ÃŖÃĨçÊèÃĒÃĢíÃŦÃŽÃ¯ÃąÃŗÃ˛Ã´ÃļÃĩÃēÚÃģÃŧ†°ÂĸÂŖÂ§â€ĸÂļߎŠâ„ĸÂ´Â¨â‰ Ä‚ÅžâˆžÂąâ‰¤â‰ĨÂĨÂĩâˆ‚âˆ‘âˆĪ€âˆĢÂĒÂēâ„ĻăşÂŋÂĄÂŦ√ƒ≈∆ÂĢÂģâ€ĻÂ Ã€ÃƒÃ•Å’Å“â€“â€”â€œâ€â€˜â€™Ãˇâ—ŠÃŋŸ⁄¤‚â€ēÅĸÅŖâ€ĄÂˇâ€šâ€žâ€°Ã‚ÃŠÃÃ‹ÃˆÃÃŽÃÃŒÃ“Ã”īŋŊÃ’ÃšÃ›Ã™ÄąË†ËœÂ¯Ë˜Ë™ËšÂ¸ËË›Ë‡" + }, + "macthai": { + "type": "_sbcs", + "chars": "ÂĢÂģâ€ĻīĸŒīĸīĸ’īĸ•īĸ˜īĸ‹īĸŽīĸ‘īĸ”īĸ—“”īĸ™īŋŊâ€ĸīĸ„īĸ‰īĸ…īĸ†īĸ‡īĸˆīĸŠīĸīĸīĸ“īĸ–‘’īŋŊÂ ā¸ā¸‚ā¸ƒā¸„ā¸…ā¸†ā¸‡ā¸ˆā¸‰ā¸Šā¸‹ā¸Œā¸ā¸Žā¸ā¸ā¸‘ā¸’ā¸“ā¸”ā¸•ā¸–ā¸—ā¸˜ā¸™ā¸šā¸›ā¸œā¸ā¸žā¸Ÿā¸ ā¸Ąā¸ĸ⏪⏤ā¸Ĩā¸Ļā¸§ā¸¨ā¸Šā¸Ēā¸Ģā¸Ŧā¸­ā¸Žā¸¯ā¸°ā¸ąā¸˛ā¸ŗā¸´ā¸ĩā¸ļā¸ˇā¸¸ā¸šā¸ēīģŋ​–—ā¸ŋāš€āšāš‚āšƒāš„āš…āš†āš‡āšˆāš‰āšŠāš‹āšŒāšâ„ĸāšāšāš‘āš’āš“āš”āš•āš–āš—āš˜āš™ÂŽÂŠīŋŊīŋŊīŋŊīŋŊ" + }, + "macturkish": { + "type": "_sbcs", + "chars": "Ã„Ã…Ã‡Ã‰Ã‘Ã–ÃœÃĄÃ ÃĸÃ¤ÃŖÃĨçÊèÃĒÃĢíÃŦÃŽÃ¯ÃąÃŗÃ˛Ã´ÃļÃĩÃēÚÃģÃŧ†°ÂĸÂŖÂ§â€ĸÂļߎŠâ„ĸÂ´Â¨â‰ Ã†Ã˜âˆžÂąâ‰¤â‰ĨÂĨÂĩâˆ‚âˆ‘âˆĪ€âˆĢÂĒÂēâ„ĻÃĻøÂŋÂĄÂŦ√ƒ≈∆ÂĢÂģâ€ĻÂ Ã€ÃƒÃ•Å’Å“â€“â€”â€œâ€â€˜â€™Ãˇâ—ŠÃŋÅ¸ÄžÄŸÄ°ÄąÅžÅŸâ€ĄÂˇâ€šâ€žâ€°Ã‚ÃŠÃÃ‹ÃˆÃÃŽÃÃŒÃ“Ã”īŋŊÒÚÛÙīŋŊˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macukraine": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСĐĸĐŖĐ¤ĐĨĐĻЧШЊĐĒĐĢĐŦĐ­ĐŽĐ¯â€ Â°ŌÂŖÂ§â€ĸÂļІ®©â„ĸĐ‚Ņ’â‰ ĐƒŅ“âˆžÂąâ‰¤â‰ĨŅ–ÂĩŌ‘ĐˆĐ„Ņ”Đ‡Ņ—Đ‰Ņ™ĐŠŅšŅ˜Đ…ÂŦ√ƒ≈∆ÂĢÂģâ€ĻÂ Đ‹Ņ›ĐŒŅœŅ•â€“â€”â€œâ€â€˜â€™Ãˇâ€žĐŽŅžĐŅŸâ„–ĐŅ‘ŅĐ°ĐąĐ˛ĐŗĐ´ĐĩĐļСиКĐēĐģĐŧĐŊĐžĐŋŅ€ŅŅ‚ŅƒŅ„Ņ…Ņ†Ņ‡ŅˆŅ‰ŅŠŅ‹ŅŒŅŅŽÂ¤" + }, + "koi8r": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤â”Ŧ┴â”ŧ▀▄█▌▐░▒▓⌠■∙√≈≤â‰ĨÂ âŒĄÂ°Â˛ÂˇÃˇâ•â•‘â•’Ņ‘â•“â•”â••â•–â•—â•˜â•™â•šâ•›â•œâ•â•žâ•Ÿâ• â•ĄĐâ•ĸâ•Ŗâ•¤â•Ĩâ•Ļ╧╨╩â•Ēâ•Ģâ•ŦÂŠŅŽĐ°ĐąŅ†Đ´ĐĩŅ„ĐŗŅ…Đ¸ĐšĐēĐģĐŧĐŊĐžĐŋŅŅ€ŅŅ‚ŅƒĐļĐ˛ŅŒŅ‹ĐˇŅˆŅŅ‰Ņ‡ŅŠĐŽĐĐ‘ĐĻДЕФГĐĨĐ˜Đ™ĐšĐ›ĐœĐĐžĐŸĐ¯Đ ĐĄĐĸĐŖĐ–Đ’ĐŦĐĢЗШЭЩЧĐĒ" + }, + "koi8u": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤â”Ŧ┴â”ŧ▀▄█▌▐░▒▓⌠■∙√≈≤â‰ĨÂ âŒĄÂ°Â˛ÂˇÃˇâ•â•‘â•’Ņ‘Ņ”â•”Ņ–Ņ—â•—â•˜â•™â•šâ•›Ō‘â•â•žâ•Ÿâ• â•ĄĐĐ„â•ŖĐ†Đ‡â•Ļ╧╨╩â•ĒԐâ•ŦÂŠŅŽĐ°ĐąŅ†Đ´ĐĩŅ„ĐŗŅ…Đ¸ĐšĐēĐģĐŧĐŊĐžĐŋŅŅ€ŅŅ‚ŅƒĐļĐ˛ŅŒŅ‹ĐˇŅˆŅŅ‰Ņ‡ŅŠĐŽĐĐ‘ĐĻДЕФГĐĨĐ˜Đ™ĐšĐ›ĐœĐĐžĐŸĐ¯Đ ĐĄĐĸĐŖĐ–Đ’ĐŦĐĢЗШЭЩЧĐĒ" + }, + "koi8ru": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤â”Ŧ┴â”ŧ▀▄█▌▐░▒▓⌠■∙√≈≤â‰ĨÂ âŒĄÂ°Â˛ÂˇÃˇâ•â•‘â•’Ņ‘Ņ”â•”Ņ–Ņ—â•—â•˜â•™â•šâ•›Ō‘Ņžâ•žâ•Ÿâ• â•ĄĐĐ„â•ŖĐ†Đ‡â•Ļ╧╨╩â•ĒŌĐŽÂŠŅŽĐ°ĐąŅ†Đ´ĐĩŅ„ĐŗŅ…Đ¸ĐšĐēĐģĐŧĐŊĐžĐŋŅŅ€ŅŅ‚ŅƒĐļĐ˛ŅŒŅ‹ĐˇŅˆŅŅ‰Ņ‡ŅŠĐŽĐĐ‘ĐĻДЕФГĐĨĐ˜Đ™ĐšĐ›ĐœĐĐžĐŸĐ¯Đ ĐĄĐĸĐŖĐ–Đ’ĐŦĐĢЗШЭЩЧĐĒ" + }, + "koi8t": { + "type": "_sbcs", + "chars": "Ō›Ō“â€šŌ’â€žâ€Ļ†‡īŋŊâ€°Ōŗâ€šŌ˛ŌˇŌļīŋŊŌšâ€˜â€™â€œâ€â€ĸ–—īŋŊâ„ĸīŋŊâ€ēīŋŊīŋŊīŋŊīŋŊīŋŊĶ¯ĶŽŅ‘Â¤ĶŖÂϧīŋŊīŋŊīŋŊÂĢÂŦ­ŽīŋŊ°¹²ЁīŋŊĶĸÂļ¡īŋŊ№īŋŊÂģīŋŊīŋŊīŋŊÂŠŅŽĐ°ĐąŅ†Đ´ĐĩŅ„ĐŗŅ…Đ¸ĐšĐēĐģĐŧĐŊĐžĐŋŅŅ€ŅŅ‚ŅƒĐļĐ˛ŅŒŅ‹ĐˇŅˆŅŅ‰Ņ‡ŅŠĐŽĐĐ‘ĐĻДЕФГĐĨĐ˜Đ™ĐšĐ›ĐœĐĐžĐŸĐ¯Đ ĐĄĐĸĐŖĐ–Đ’ĐŦĐĢЗШЭЩЧĐĒ" + }, + "armscii8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ īŋŊև։)(ÂģÂĢ—.՝,-֊â€ĻÕœÕ›ÕžÔąÕĄÔ˛ÕĸÔŗÕŖÔ´Õ¤ÔĩÕĨÔļÕĻÔˇÕ§Ô¸Õ¨ÔšÕŠÔēÕĒÔģÕĢÔŧÕŦÔŊÕ­ÔžÕŽÔŋÕ¯Õ€Õ°ÕÕąÕ‚Õ˛ÕƒÕŗÕ„Õ´Õ…ÕĩՆÕļÕ‡ÕˇÕˆÕ¸Õ‰ÕšÕŠÕēՋÕģՌÕŧՍÕŊՎ՞ՏÕŋՐրՑցՒւՓփՔքՕօՖֆ՚īŋŊ" + }, + "rk1048": { + "type": "_sbcs", + "chars": "Đ‚Đƒâ€šŅ“â€žâ€Ļ†‡â‚Ŧâ€°Đ‰â€šĐŠŌšŌēĐŅ’â€˜â€™â€œâ€â€ĸ–—īŋŊâ„ĸŅ™â€ēŅšŌ›ŌģŅŸÂ Ō°ŌąĶ˜Â¤Ķ¨ÂĻÂ§ĐÂŠŌ’ÂĢÂŦÂ­ÂŽŌŽÂ°ÂąĐ†Ņ–ĶŠÂĩÂļÂˇŅ‘â„–Ō“ÂģĶ™ŌĸŌŖŌ¯ĐĐ‘Đ’Đ“Đ”Đ•Đ–Đ—Đ˜Đ™ĐšĐ›ĐœĐĐžĐŸĐ ĐĄĐĸĐŖĐ¤ĐĨĐĻЧШЊĐĒĐĢĐŦĐ­ĐŽĐ¯Đ°ĐąĐ˛ĐŗĐ´ĐĩĐļСиКĐēĐģĐŧĐŊĐžĐŋŅ€ŅŅ‚ŅƒŅ„Ņ…Ņ†Ņ‡ŅˆŅ‰ŅŠŅ‹ŅŒŅŅŽŅ" + }, + "tcvn": { + "type": "_sbcs", + "chars": "\u0000Úáģ¤\u0003áģĒáģŦáģŽ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010áģ¨áģ°áģ˛áģļáģ¸Ãáģ´\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀáēĸÃÁáē áēļáēŦÈáēēáēŧÉáē¸áģ†ÃŒáģˆÄ¨ÃáģŠÃ’áģŽÃ•ÓáģŒáģ˜áģœáģžáģ áģšáģĸÙáģĻŨ ĂÂÊÔƠƯĐăÃĸÃĒÃ´ÆĄÆ°Ä‘áē°Ė€Ė‰ĖƒĖĖŖÃ áēŖÃŖÃĄáēĄáē˛áēąáēŗáēĩáē¯áē´áēŽáēĻáē¨áēĒáē¤áģ€áēˇáē§áēŠáēĢáēĨáē­Ã¨áģ‚áēģáēŊÊáēšáģáģƒáģ…áēŋáģ‡ÃŦáģ‰áģ„áēžáģ’Ċíáģ‹Ã˛áģ”áģÃĩÃŗáģáģ“áģ•áģ—áģ‘áģ™áģáģŸáģĄáģ›áģŖÃšáģ–áģ§ÅŠÃēáģĨáģĢáģ­áģ¯áģŠáģąáģŗáģˇáģšÃŊáģĩáģ" + }, + "georgianacademy": { + "type": "_sbcs", + "chars": "€‚ƒ„â€Ļâ€ â€ĄË†â€°Å â€šÅ’ÂÂŽÂÂâ€˜â€™â€œâ€â€ĸ–—˜â„ĸÅĄâ€ēÅ“ÂÂžÅ¸Â ÂĄÂĸÂŖÂ¤ÂĨÂϧ¨ŠÂĒÂĢÂŦÂ­ÂŽÂ¯Â°ÂąÂ˛ÂŗÂ´ÂĩÂšÂēÂģÂŧÂŊžÂŋაბგდევზთიკლმნოპჟრსáƒĸáƒŖáƒ¤áƒĨáƒĻყშ჊áƒĒáƒĢáƒŦáƒ­áƒŽáƒ¯áƒ°áƒąáƒ˛áƒŗáƒ´áƒĩáƒļçèÊÃĒÃĢÃŦÃ­ÃŽÃ¯Ã°ÃąÃ˛ÃŗÃ´ÃĩÃļÃˇÃ¸ÃšÃēÃģÃŧÃŊÞÃŋ" + }, + "georgianps": { + "type": "_sbcs", + "chars": "€‚ƒ„â€Ļâ€ â€ĄË†â€°Å â€šÅ’ÂÂŽÂÂâ€˜â€™â€œâ€â€ĸ–—˜â„ĸÅĄâ€ēÅ“ÂÂžÅ¸Â ÂĄÂĸÂŖÂ¤ÂĨÂϧ¨ŠÂĒÂĢÂŦÂ­ÂŽÂ¯Â°ÂąÂ˛ÂŗÂ´ÂĩÂšÂēÂģÂŧÂŊžÂŋაბგდევზჱთიკლმნჲოპჟრსáƒĸáƒŗáƒŖáƒ¤áƒĨáƒĻყშ჊áƒĒáƒĢáƒŦჭ჎ჴჯჰáƒĩÃĻçèÊÃĒÃĢÃŦÃ­ÃŽÃ¯Ã°ÃąÃ˛ÃŗÃ´ÃĩÃļÃˇÃ¸ÃšÃēÃģÃŧÃŊÞÃŋ" + }, + "pt154": { + "type": "_sbcs", + "chars": "Ō–Ō’ĶŽŌ“â€žâ€ĻŌļŌŽŌ˛Ō¯Ō ĶĸŌĸԚŌēŌ¸Ō—â€˜â€™â€œâ€â€ĸâ€“â€”ŌŗŌˇŌĄĶŖŌŖŌ›ŌģŌšÂ ĐŽŅžĐˆĶ¨Ō˜Ō°Â§ĐÂŠĶ˜ÂĢÂŦĶ¯ÂŽŌœÂ°ŌąĐ†Ņ–Ō™ĶŠÂļÂˇŅ‘â„–Ķ™ÂģҘŌĒŌĢŌĐĐ‘Đ’Đ“Đ”Đ•Đ–Đ—Đ˜Đ™ĐšĐ›ĐœĐĐžĐŸĐ ĐĄĐĸĐŖĐ¤ĐĨĐĻЧШЊĐĒĐĢĐŦĐ­ĐŽĐ¯Đ°ĐąĐ˛ĐŗĐ´ĐĩĐļСиКĐēĐģĐŧĐŊĐžĐŋŅ€ŅŅ‚ŅƒŅ„Ņ…Ņ†Ņ‡ŅˆŅ‰ŅŠŅ‹ŅŒŅŅŽŅ" + }, + "viscii": { + "type": "_sbcs", + "chars": "\u0000\u0001áē˛\u0003\u0004áē´áēĒ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013áģļ\u0015\u0016\u0017\u0018áģ¸\u001a\u001b\u001c\u001dáģ´\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~áē áēŽáē°áēļáē¤áēĻáē¨áēŦáēŧáē¸áēžáģ€áģ‚áģ„áģ†áģáģ’áģ”áģ–áģ˜áģĸáģšáģœáģžáģŠáģŽáģŒáģˆáģĻŨáģ¤áģ˛Ã•áē¯áēąáēˇáēĨáē§áēŠáē­áēŊáēšáēŋáģáģƒáģ…áģ‡áģ‘áģ“áģ•áģ—áģ Æ áģ™áģáģŸáģ‹áģ°áģ¨áģĒáģŦÆĄá웯¯Ã€ÃÃ‚ÃáēĸĂáēŗáēĩÈÉÊáēēÌÍĨáģŗÄáģŠÃ’ÓÔáēĄáģˇáģĢáģ­Ã™ÃšáģšáģĩÝáģĄÆ°Ã ÃĄÃĸÃŖáēŖÄƒáģ¯áēĢèÊÃĒáēģÃŦíĊáģ‰Ä‘áģąÃ˛ÃŗÃ´ÃĩáģáģáģĨÚÃēÅŠáģ§ÃŊáģŖáģŽ" + }, + "iso646cn": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#ÂĨ%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ" + }, + "iso646jp": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[ÂĨ]^_`abcdefghijklmnopqrstuvwxyz{|}‾īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ" + }, + "hproman8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯ÝÃŊÂ°Ã‡Ã§Ã‘ÃąÂĄÂŋÂ¤ÂŖÂĨ§ƒÂĸÃĸÃĒôÃģÃĄÃŠÃŗÃēÃ Ã¨Ã˛ÃšÃ¤ÃĢÃļÃŧÅÎØÆÃĨíøÃĻÄÃŦÃ–ÃœÃ‰Ã¯ÃŸÃ”ÃÃƒÃŖÃÃ°ÃÃŒÃ“Ã’Ã•ÃĩÅ ÅĄÃšÅ¸ÃŋÃžÃžÂˇÂĩÂļ¾—ÂŧÂŊÂĒÂēÂĢ■ÂģÂąīŋŊ" + }, + "macintosh": { + "type": "_sbcs", + "chars": "Ã„Ã…Ã‡Ã‰Ã‘Ã–ÃœÃĄÃ ÃĸÃ¤ÃŖÃĨçÊèÃĒÃĢíÃŦÃŽÃ¯ÃąÃŗÃ˛Ã´ÃļÃĩÃēÚÃģÃŧ†°ÂĸÂŖÂ§â€ĸÂļߎŠâ„ĸÂ´Â¨â‰ Ã†Ã˜âˆžÂąâ‰¤â‰ĨÂĨÂĩâˆ‚âˆ‘âˆĪ€âˆĢÂĒÂēâ„ĻÃĻøÂŋÂĄÂŦ√ƒ≈∆ÂĢÂģâ€ĻÂ Ã€ÃƒÃ•Å’Å“â€“â€”â€œâ€â€˜â€™Ãˇâ—ŠÃŋŸ⁄¤‚â€ēīŦīŦ‚â€ĄÂˇâ€šâ€žâ€°Ã‚ÃŠÃÃ‹ÃˆÃÃŽÃÃŒÃ“Ã”īŋŊÃ’ÃšÃ›Ã™ÄąË†ËœÂ¯Ë˜Ë™ËšÂ¸ËË›Ë‡" + }, + "ascii": { + "type": "_sbcs", + "chars": "īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊ" + }, + "tis620": { + "type": "_sbcs", + "chars": "īŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊīŋŊā¸ā¸‚ā¸ƒā¸„ā¸…ā¸†ā¸‡ā¸ˆā¸‰ā¸Šā¸‹ā¸Œā¸ā¸Žā¸ā¸ā¸‘ā¸’ā¸“ā¸”ā¸•ā¸–ā¸—ā¸˜ā¸™ā¸šā¸›ā¸œā¸ā¸žā¸Ÿā¸ ā¸Ąā¸ĸ⏪⏤ā¸Ĩā¸Ļā¸§ā¸¨ā¸Šā¸Ēā¸Ģā¸Ŧā¸­ā¸Žā¸¯ā¸°ā¸ąā¸˛ā¸ŗā¸´ā¸ĩā¸ļā¸ˇā¸¸ā¸šā¸ēīŋŊīŋŊīŋŊīŋŊā¸ŋāš€āšāš‚āšƒāš„āš…āš†āš‡āšˆāš‰āšŠāš‹āšŒāšāšŽāšāšāš‘āš’āš“āš”āš•āš–āš—āš˜āš™āššāš›īŋŊīŋŊīŋŊīŋŊ" + } +} + +/***/ }), +/* 716 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Manually added data to be used by sbcs codec in addition to generated one. + +module.exports = { + // Not supported by iconv, not sure why. + "10029": "maccenteuro", + "maccenteuro": { + "type": "_sbcs", + "chars": "Ã„Ä€ÄÃ‰Ä„Ã–ÃœÃĄÄ…ÄŒÃ¤ÄÄ†Ä‡ÃŠÅšÅēÄŽÃ­ÄÄ’Ä“Ä–ÃŗÄ—Ã´ÃļÃĩÃēĚěÃŧâ€ Â°Ä˜ÂŖÂ§â€ĸÂļߎŠâ„ĸÄ™Â¨â‰ ÄŖÄŽÄ¯ÄĒ≤â‰ĨÄĢÄļ∂∑łÄģÄŧÄŊĞĚÄēŅņŃÂŦ√ńŇ∆ÂĢÂģâ€ĻÂ ÅˆÅÃ•Å‘ÅŒâ€“â€”â€œâ€â€˜â€™Ãˇâ—ŠÅÅ”Å•Å˜â€šâ€ēÅ™Å–Å—Å â€šâ€žÅĄÅšÅ›ÃÅ¤ÅĨÍÅŊÅžÅĒÓÔÅĢÅŽÃšÅ¯Å°ÅąÅ˛ÅŗÃÃŊġÅģŁÅŧÄĸˇ" + }, + + "808": "cp808", + "ibm808": "cp808", + "cp808": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСĐĸĐŖĐ¤ĐĨĐĻЧШЊĐĒĐĢĐŦĐ­ĐŽĐ¯Đ°ĐąĐ˛ĐŗĐ´ĐĩĐļСиКĐēĐģĐŧĐŊĐžĐŋ░▒▓│┤╡â•ĸâ•–â••â•Ŗâ•‘â•—â•â•œâ•›â”â””â”´â”Ŧ├─â”ŧ╞╟╚╔╩â•Ļ╠═â•Ŧ╧╨╤â•Ĩ╙╘╒╓â•Ģâ•Ēâ”˜â”Œâ–ˆâ–„â–Œâ–â–€Ņ€ŅŅ‚ŅƒŅ„Ņ…Ņ†Ņ‡ŅˆŅ‰ŅŠŅ‹ŅŒŅŅŽŅĐŅ‘Đ„Ņ”Đ‡Ņ—ĐŽŅžÂ°âˆ™Âˇâˆšâ„–â‚Ŧ■ " + }, + + "mik": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСĐĸĐŖĐ¤ĐĨĐĻЧШЊĐĒĐĢĐŦĐ­ĐŽĐ¯Đ°ĐąĐ˛ĐŗĐ´ĐĩĐļСиКĐēĐģĐŧĐŊĐžĐŋŅ€ŅŅ‚ŅƒŅ„Ņ…Ņ†Ņ‡ŅˆŅ‰ŅŠŅ‹ŅŒŅŅŽŅâ””â”´â”Ŧ├─â”ŧâ•Ŗâ•‘â•šâ•”â•Šâ•Ļ╠═â•Ŧâ”â–‘â–’â–“â”‚â”¤â„–Â§â•—â•â”˜â”Œâ–ˆâ–„â–Œâ–â–€ÎąÃŸÎ“Ī€ÎŖĪƒÂĩĪ„ÎĻÎ˜ÎŠÎ´âˆžĪ†Îĩ∩≡±â‰Ĩâ‰¤âŒ âŒĄÃˇâ‰ˆÂ°âˆ™Âˇâˆšâŋ²■ " + }, + + // Aliases of generated encodings. + "ascii8bit": "ascii", + "usascii": "ascii", + "ansix34": "ascii", + "ansix341968": "ascii", + "ansix341986": "ascii", + "csascii": "ascii", + "cp367": "ascii", + "ibm367": "ascii", + "isoir6": "ascii", + "iso646us": "ascii", + "iso646irv": "ascii", + "us": "ascii", + + "latin1": "iso88591", + "latin2": "iso88592", + "latin3": "iso88593", + "latin4": "iso88594", + "latin5": "iso88599", + "latin6": "iso885910", + "latin7": "iso885913", + "latin8": "iso885914", + "latin9": "iso885915", + "latin10": "iso885916", + + "csisolatin1": "iso88591", + "csisolatin2": "iso88592", + "csisolatin3": "iso88593", + "csisolatin4": "iso88594", + "csisolatincyrillic": "iso88595", + "csisolatinarabic": "iso88596", + "csisolatingreek" : "iso88597", + "csisolatinhebrew": "iso88598", + "csisolatin5": "iso88599", + "csisolatin6": "iso885910", + + "l1": "iso88591", + "l2": "iso88592", + "l3": "iso88593", + "l4": "iso88594", + "l5": "iso88599", + "l6": "iso885910", + "l7": "iso885913", + "l8": "iso885914", + "l9": "iso885915", + "l10": "iso885916", + + "isoir14": "iso646jp", + "isoir57": "iso646cn", + "isoir100": "iso88591", + "isoir101": "iso88592", + "isoir109": "iso88593", + "isoir110": "iso88594", + "isoir144": "iso88595", + "isoir127": "iso88596", + "isoir126": "iso88597", + "isoir138": "iso88598", + "isoir148": "iso88599", + "isoir157": "iso885910", + "isoir166": "tis620", + "isoir179": "iso885913", + "isoir199": "iso885914", + "isoir203": "iso885915", + "isoir226": "iso885916", + + "cp819": "iso88591", + "ibm819": "iso88591", + + "cyrillic": "iso88595", + + "arabic": "iso88596", + "arabic8": "iso88596", + "ecma114": "iso88596", + "asmo708": "iso88596", + + "greek" : "iso88597", + "greek8" : "iso88597", + "ecma118" : "iso88597", + "elot928" : "iso88597", + + "hebrew": "iso88598", + "hebrew8": "iso88598", + + "turkish": "iso88599", + "turkish8": "iso88599", + + "thai": "iso885911", + "thai8": "iso885911", + + "celtic": "iso885914", + "celtic8": "iso885914", + "isoceltic": "iso885914", + + "tis6200": "tis620", + "tis62025291": "tis620", + "tis62025330": "tis620", + + "10000": "macroman", + "10006": "macgreek", + "10007": "maccyrillic", + "10079": "maciceland", + "10081": "macturkish", + + "cspc8codepage437": "cp437", + "cspc775baltic": "cp775", + "cspc850multilingual": "cp850", + "cspcp852": "cp852", + "cspc862latinhebrew": "cp862", + "cpgr": "cp869", + + "msee": "cp1250", + "mscyrl": "cp1251", + "msansi": "cp1252", + "msgreek": "cp1253", + "msturk": "cp1254", + "mshebr": "cp1255", + "msarab": "cp1256", + "winbaltrim": "cp1257", + + "cp20866": "koi8r", + "20866": "koi8r", + "ibm878": "koi8r", + "cskoi8r": "koi8r", + + "cp21866": "koi8u", + "21866": "koi8u", + "ibm1168": "koi8u", + + "strk10482002": "rk1048", + + "tcvn5712": "tcvn", + "tcvn57121": "tcvn", + + "gb198880": "iso646cn", + "cn": "iso646cn", + + "csiso14jisc6220ro": "iso646jp", + "jisc62201969ro": "iso646jp", + "jp": "iso646jp", + + "cshproman8": "hproman8", + "r8": "hproman8", + "roman8": "hproman8", + "xroman8": "hproman8", + "ibm1051": "hproman8", + + "mac": "macintosh", + "csmacintosh": "macintosh", +}; + + + +/***/ }), +/* 717 */ +/***/ (function(module, exports) { + +module.exports = [["8740","䏰䰲䘃ä–Ļ䕸𧉧äĩˇä–ŗđ§˛ąäŗĸđ§ŗ…ãŽ•äœļ䝄䱇䱀đ¤ŠŋđŖ˜—đ§’đĻē‹đ§ƒ’äą—đĒ‘ää—šä˛…đ§ąŦ䴇äĒ¤äšĄđĻŦŖįˆĨđĨŠ”đĄŠŖđŖ¸†đŖŊĄæ™å›ģ"],["8767","įļ•å¤đ¨Žšãˇ´éœ´đ§¯¯å¯›đĄĩžåǤã˜ĨđŠē°åĢ‘åŽˇåŗŧæŽč–“đŠĨ…į‘Ąį’ãĄĩđĄĩ“đŖšžđĻ€ĄãģŦ"],["87a1","đĨŖžãĢĩįĢŧ龗𤅡𨤍đŖ‡Ēđ ĒŠđŖ‰žäŒŠč’„éž–é¯ä¤°č˜“åĸ–éŠéˆ˜į§į¨˛æ™ æ¨Ščĸį‘Œį¯…æž‚į¨Ŧ剏遆ã“Ļį„đĨļšį“†éŋ‡åžŗä¤¯å‘Œä„ąđŖšŽå ˜įОđ§­Ĩ讏䚮đĻēˆä†đĨļ™įŽŽđĸ’ŧéŋˆđĸ“đĸ“‰đĸ“Œéŋ‰č”„đŖ–ģ䂴éŋŠä“Ąđǎŋæ‹įŽéŋ‹"],["8840","㇀",4,"đ „Œã‡…đ ƒ‘đ ƒã‡†ã‡‡đ ƒ‹đĄŋ¨ã‡ˆđ ƒŠã‡‰ã‡Šã‡‹ã‡Œđ „Žã‡ã‡ŽÄ€ÃĮÃ€Ä’ÉĚÈŌÓĮ‘Ã’āŋŋÃŠĖ„áēžāŋŋÃŠĖŒáģ€ÃŠÄÃĄĮŽÃ É‘ēÊěèÄĢíĮÃŦÅÃŗĮ’Ã˛ÅĢÃēĮ”ÚĮ–Į˜Įš"],["88a1","ĮœÃŧāŋŋÃĒĖ„áēŋāŋŋÃĒˌáģÃĒɡ⏚⏛"],["8940","đĒŽŠđĄ……"],["8943","攊"],["8946","ä¸ŊæģéĩŽé‡Ÿ"],["894c","đ§œĩ撑äŧšäŧ¨äž¨å…–å…´å†œå‡¤åŠĄåŠ¨åŒģ华发变å›ĸ媰处备夞头å­ĻåŽžåŽŸå˛šå熿€ģ斉柞栄æĄĨæĩŽį‚ŧį”ĩįē¤įēŦįēēįģ‡įģįģŸįŧ†įŧˇč‰ēč‹č¯č§†čŽžč¯ĸčŊĻčŊ§čŊŽ"],["89a1","ᐑįŗŧįˇæĨ†įĢ‰åˆ§"],["89ab","醌įĸ¸é…žč‚ŧ"],["89b0","贋čƒļđ §§"],["89b5","肟éģ‡äŗéˇ‰é¸Œä°žđЎļ𧀎鸊đĒ„ŗã—"],["89c1","æēščˆžį”™"],["89c5","䤑éŠŦéĒéž™įχđ¨‘Ŧ𡷊𠗐đĸĢĻ两äēäē€äē‡äēŋäģĢäŧˇã‘ŒäžŊ㚈倃傈ã‘Ŋ㒓ã’Ĩ円夅凛å‡ŧ刅äē‰å‰šåŠåŒ§ã—‡åŽŠã•‘åŽ°ã•“å‚åŖã•­ã•˛ãšå’“å’Ŗå’´å’šå“å“¯å”˜å”Ŗå”¨ã–˜å”ŋã–Ĩã–ŋ嗗㗅"],["8a40","đ§ļ„å”Ĩ"],["8a43","𠱂𠴕đĨ„Ģ喐đĸŗ†ã§Ŧ𠍁蹆đ¤ļ¸đŠ“Ĩ䁓𨂾įēđĸ°¸ã¨´äŸ•đ¨…đϧ˛đ¤ˇĒ擝đ ĩŧđ ž´đ ŗ•đĄƒ´æ’čšžđ ē–đ °‹đ Ŋ¤đĸ˛Šđ¨‰–𤓓"],["8a64","đ ĩ†đŠŠđ¨ƒŠäŸ´đ¤ē§đĸŗ‚éĒ˛ãŠ§đŠ—´ãŋ­ã”†đĨ‹‡đП”đ§Ŗˆđĸĩ„éĩŽé •"],["8a76","䏙đĻ‚Ĩæ’´å“ŖđĸĩŒđĸ¯ŠđĄˇã§ģđĄ¯"],["8aa1","đĻ›šđϜ–đ§Ļ æ“ĒđĨ’đ ąƒčš¨đĸ†Ąđ¨­Œđ œą"],["8aac","䠋𠆩ãŋēåĄŗđĸļ"],["8ab2","𤗈đ “ŧđĻ‚—đ ŊŒđ ļ–啚ä‚ģäŽē"],["8abb","äĒ´đĸŠĻ𡂝č†ĒéŖĩđ ļœæšã§žđĸĩčˇ€åšĄæ‘ŧ㚃"],["8ac9","đǘđ ¸‰đĸĢđĸŗ‰"],["8ace","đĄƒˆđŖ§‚ãĻ’ã¨†đ¨Š›ã•¸đĨš‰đĸƒ‡å™’đ ŧąđĸ˛˛đМ ã’ŧæ°Ŋđ¤¸ģ"],["8adf","𧕴đĸē‹đĸˆˆđĒ™›đ¨ŗđ šēđ °´đĻ œįž“đĄƒđĸ ƒđĸ¤šã—ģđĨ‡Ŗđ ēŒđ žđ ēĒãž“đ ŧ°đ ĩ‡đĄ…đ šŒ"],["8af6","đ ēĢđ ŽŠđ ĩˆđĄƒ€đĄ„Ŋãŋšđĸ𖿐˛đ ž­"],["8b40","đŖ´đ§˜šđĸ¯Žđ ĩžđ ĩŋđĸą‘đĸą•㨘đ ē˜đĄƒ‡đ ŧŽđǘ˛đĻ­đ¨ŗ’đ¨ļ™đ¨ŗŠé–Ēå“Œč‹„å–š"],["8b55","đŠģƒé°ĻéĒļ𧝞đĸˇŽį…€č…­čƒŦ尜đĻ•˛č„´ãž—卟đ¨‚Ŋé†ļđ ģē𠸏𠹷đ ģģ㗝đ¤ˇĢã˜‰đ ŗ–åš¯đĸžĩ𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐đĸļ¤åŠ”đĄ€đĄ€žđĄƒĩđĄƒļåžœđ ¸‘"],["8ba1","𧚔𨋍đ žĩđ šģđĨ…žãœƒđ žļ𡆀đĨ‹˜đNJŊ𤧚đĄ ē𤅷đ¨‰ŧåĸ™å‰¨ã˜šđĨœŊįŽ˛å­¨ä €äŦŦéŧ§ä§§é°ŸéŽđĨ­´đŖ„Ŋå—ģã—˛åš‰ä¸¨å¤‚đĄ¯đ¯Ą¸é‘đ ‚†äš›äēģã”žå°ŖåŊ‘åŋ„ãŖē扌æ”ĩæ­ēæ°ĩæ°ēįŦįˆĢä¸ŦįŠ­đ¤ŖŠįŊ’į¤ģįŗšįŊ“đωĒ㓁"],["8bde","đĻ‹č€‚č‚€đϘ’đĻĨ‘åčĄ¤č§đ§ĸ˛čŽ č´é’…é•¸é•ŋ门𨸏éŸĻéĄĩéŖŽéŖžéĨŖđŠ éąŧ鸟é섿­¯ī¤‡ä¸ˇđ ‚‡é˜æˆˇé’ĸ"],["8c40","å€ģæˇžđŠąŗéžĻãˇ‰čĸđ¤…ŽįˇåŗĩäŦ đĨ‡ã•™đĨ´°æ„ĸ𨨲螧é‡ļį†‘æœ™įŽēđŖŠđĒ„‡ã˛‹đĄĻ€äŦįŖ¤į‚å†Žđ¨œä€‰æŠŖđNJēäˆŖč˜đ Š¯į¨ĒđŠĨ‡đ¨ĢĒé•įåŒ¤đĸžé´į›™đ¨§Ŗéž§įŸäēŖäŋ°å‚ŧ丯äŧ—鞨吴įļ‹åĸ’媐đĄļļåē’åē™åŋ‚đĸœ’æ–‹"],["8ca1","đŖšæ¤™æŠƒđŖąŖæŗŋ"],["8ca7","įˆ€đ¤”…įŽŒãģ›đ¤¨“åŦ•į’ščރđĨ˛¤đĨš•įĒ“į¯ŦẃįšŦ苸薗龩čĸéžĒčēšéžĢčŋč•Ÿé§ éˆĄéžŦđ¨ļšđĄŋ䁹äŠĸ娚"],["8cc9","饨æĢä‰ļåœŊ"],["8cce","藖đ¤ĨģčŠŋ𧄍䲁đĻĩ´åĩģđĻŦ•đĻžžéž­éžŽåŽ–éž¯æ›§įš›æš—į§Šãļˆä“ƒđŖ‰–đĸž–䎚ä”ļ"],["8ce6","åŗ•đŖŦščĢšåą¸ã´’đŖ•‘åĩ¸éž˛į…—䕘đ¤ƒŦđĄ¸ŖäąˇãĨ¸ã‘Šđ †¤đĻąčĢŒäž´đ ˆšåĻŋč…Ŧ顖đŠŖēåŧģ"],["8d40","𠮟"],["8d42","đĸ‡đ¨Ĩ­ä„‚äšģ𩁹ãŧ‡éžŗđdžĩäƒ¸ãŸ–ä›ˇđĻą†ä…ŧ𨚲đ§ŋä•­ãŖ”đĨ’šä•Ąä”›äļ‰äąģäĩļä—Ēãŋˆđ¤Ŧã™Ąä“žä’Ŋ䇭崞åĩˆåĩ–ãˇŧ㠏åļ¤åļšã  ã ¸åš‚åēŊåŧĨ垃㤈㤔ã¤ŋãĨæƒ—æ„ŊåŗĨãĻ‰æ†ˇæ†šæ‡ãϏæˆŦ抐æ‹ĨæŒ˜ã§¸åšą"],["8da1","㨃æĸæģæ‡æ‘šãŠ‹æ“€å´•å˜ĄéžŸãĒ—æ–†ãĒŊæ—ŋ晓ãĢ˛æš’ãŦĸæœ–ã­‚æž¤æ €ã­˜æĄŠæĸ„ã­˛ã­ąã­ģ椉æĨƒį‰œæĨ¤æĻŸæĻ…ãŽŧ槖㯝æŠĨæŠ´æŠąæĒ‚ã¯ŦæĒ™ã¯˛æĒĢæĒĩæĢ”æĢļæŽæ¯æ¯Ēæąĩæ˛Ēãŗ‹æ´‚æ´†æ´Ļæļãŗ¯æļ¤æļ࿏•渘渊æē†đ¨§€æēģæģĸæģšéŊŋæģ¨æģŠæŧ¤æŧ´ãĩ†đŖŊæžæžžãĩĒãĩĩᆎ垙ãļŠį€Ŧãļ‘ၐၔၝįŋႉđ ŒĨäã—ąđ ģ˜"],["8e40","đŖģ—åžžđĻģ“į„žđĨŸ ã™ŽæĻĸđ¨¯Šå­´įŠ‰đĨŖĄđŠ“™įŠĨįŠŊđĨĻŦįĒģįǰįĢ‚įĢƒį‡‘đĻ’ä‡Šį̚įĢįĢĒ䇝咞đĨ°įŦ‹į­•įŦŠđĨŒŽđĨŗžįŽĸį­¯čŽœđĨŽ´đĻąŋį¯čĄįŽ’įŽ¸đĨ´ ãļ­đĨąĨ蒒į¯ēį°†į°ĩđĨŗįą„į˛ƒđ¤ĸ‚į˛Ļæ™Ŋđ¤•¸įŗ‰įŗ‡įŗĻįą´įŗŗįŗĩįŗŽ"],["8ea1","įš§ä”đĻš„įĩđĻģ–į’įļ‰įļĢį„ĩįļŗįˇ’𤁗đĻ€Šįˇ¤ã´“įˇĩ𡟹įˇĨđ¨­į¸đĻ„ĄđĻ…šįšŽįē’äŒĢé‘ŦᏧįŊ€įŊįŊ‡į¤ļđĻ‹é§Ąįž—đĻ‘įžŖđĄ™Ąđ ¨ä•œđŖĻ䔃đ¨ŒēįŋēđĻ’‰č€…č€ˆč€č€¨č€¯đĒ‚‡đĻŗƒč€ģč€ŧ聥đĸœ”äωđϘĻđŖˇŖđĻ›¨æœĨ肧𨩈脇脚åĸ°đĸ›ļæąŋđĻ’˜đ¤ž¸æ“§đĄ’Ščˆ˜đĄĄžæŠ“đ¤ŠĨđ¤Ē•ä‘ē舊đ ŦđĻŠ’đŖĩžäŋšđĄ“Ŋč“ĸčĸđĻŦŠđ¤Ļ§đŖ”°đĄŗđŖˇ¸čŠĒ椛đ¯Ļ”䇛"],["8f40","č•‹č‹čŒšđ ¸–đĄž´ã›đŖ…ŊđŖ•šč‰ģč‹ĸ茘đŖē‹đĻļŖđĻŦ…đĻŽ—đŖ—Žãļŋ茝å—Ŧ莅䔋đĻļĨčŽŦčč“ã‘žđĻģ”æŠ—č•šã’–đĻš‚đĸģ¯č‘˜đĨ¯¤č‘ąãˇ“䓤æĒ§č‘ŠđŖ˛ĩįĨ˜č’¨đĻŽ–đĻšˇđĻšƒč“žččޑ䒠蒓蓤đĨ˛‘䉀đĨŗ€ä•ƒč”´å̞đĻē™ä”§č•ŗä”–æžŋ蘖"],["8fa1","đ¨˜Ĩđ¨˜ģ藁𧂈蘂𡖂𧃍đ¯Ļ˛ä•Ēč˜¨ã™ˆđĄĸĸåˇđ§Žšč™žčąđǃ¸čŸŽđĸ°§čžąčŸšč å™Ąč™ŦæĄ–ä˜čĄ…čĄ†đ§— đŖļšđ§—¤čĄžčĸœä™›čĸ´čĸĩæčŖ…įˇđ§œčχčϊčĻĻčĻŠčϧčĻŧđ¨¨Ĩ觧𧤤đ§ĒŊčĒœįž“é‡žčĒđ§Š™įĢŠđ§ŦēđŖžäœ“đ§Ŧ¸į…ŧčŦŒčŦŸđĨ°đĨ•ĨčŦŋ譌譍čĒŠđ¤Šē讐讛čĒ¯đĄ›Ÿä˜•čĄč˛›đ§ĩ”đ§ļđ¯§”ãœĨđ§ĩ“čŗ–đ§ļ˜đ§ļŊč´’č´ƒđĄ¤čŗ›įœč´‘đ¤ŗ‰ãģčĩˇ"],["9040","čļŠđ¨€‚𥀔đ¤ĻŠã­ŧđ¨†ŧ𧄌į̧čē­čēļčģƒé‹”čŧ™čŧ­đ¨Ĩ𨐒čžĨ錃đNJŸđ Ščžŗä¤Ē𨧞đ¨”ŊđŖļģåģ¸đŖ‰ĸčŋšđĒ€”đ¨šŧ𨔁đĸŒĨãĻ€đĻģ—逡đ¨”ŧđ§ĒžéĄđ¨•Ŧ𨘋邨𨜓郄đ¨›Ļ邮éƒŊ酧ãĢ°é†Šé‡„į˛Ŧđ¨¤ŗđĄē‰éˆŽæ˛Ÿé‰é‰ĸđĨ–šéŠšđ¨Ģ†đŖ˛›đ¨ŦŒđĨ—›"],["90a1","đ ´ąéŒŦéĢđ¨ĢĄđ¨¯Ģį‚å̃đ¨Ģĸđ¨ĢĨäĨĨ鉄đ¨¯Ŧ𨰚đ¨¯ŋéŗé‘›čēŧ閅é–ĻéĻ閠æŋļ䊹đĸ™ē𨛘đĄ‰ŧđŖ¸Žä§Ÿæ°œé™ģ隖ä…Ŧ險đĻ앿‡šéšļįŖĩđ¨Ģ éšŊ双äĻĄđϞ¸đ ‰´đϐđŠ‚¯đЃĨđ¤Ģ‘đĄ¤•đŖŒŠéœąč™‚éœļ䨏ä”Ŋ䖅đ¤ĢŠįĩå­éœ›éœđŠ‡•é—å­ŠđЇĢ靟éĨåƒđŖ‚ˇđŖ‚ŧ鞉鞟鞱鞾韀韒韠đĨ‘ŦéŸŽįœđŠŗéŸŋéŸĩ𩐝đ§ĨēäĢ‘é ´é ŗéĄ‹éĄĻãŦŽđ§…ĩãĩ‘đ ˜°đ¤…œ"],["9140","đĨœ†éŖŠéĸˇéŖˆéŖ‡äĢŋđĻ´§đĄ›“å–°éŖĄéŖĻéŖŦ鍸餹𤨩䭲𩡗𩤅é§ĩ騌é¨ģ騐銘đĨœĨã›„đŠ‚ąđŠ¯•éĢ éĢĸđŠŦ…éĢ´ä°ŽéŦ”éŦ­đ¨˜€å€´éŦ´đĻĻ¨ãŖƒđŖŊé­é­€đŠ´žåŠ…đĄĄŖéŽŽđ¤‰‹é°‚é¯ŋ鰌𩹨鷔𩾷đdž’đdžĢđǃĄđĒ„ŖđLJŸéĩžéļƒđĒ„´é¸Žæĸˆ"],["91a1","鷄đĸ…›đdž“đLj đĄ¤ģđLjŗé´šđĒ‚šđNJ´éēéē•éēžéēĸä´´éēĒéē¯đ¤¤éģã­ ã§Ĩ㴝äŧ˛ãžžđ¨°Ģéŧ‚éŧˆäޖ鐤đĻļĸéŧ—éŧ–éŧšåšŸåšŠéŊ…éĻ¸đŠ‚‹éŸ˛č‘ŋéŊĸéŊŠįĢœéžŽįˆ–äŽžđ¤Ĩĩđ¤Ļģį…ˇđ¤§¸đ¤ˆđ¤Š‘įŽžđ¨¯šđĄŖēįϟđ¨Ĩžđ¨¸ļéŠéŗđ¨Š„é‹Ŧ鎁鏋đ¨ĨŦđ¤’šįˆ—ãģĢį˛įŠƒįƒđ¤‘ŗđ¤¸į…žđĄŸ¯į‚ŖđĄĸžđŖ–™ãģ‡đĄĸ…đĨ¯đĄŸ¸ãœĸđĄ›ģđĄ šã›ĄđĄ´đĄŖ‘đĨŊ‹ãœŖđĄ›€å›đ¤¨Ĩ𡏾𡊨"],["9240","𡏆đĄ’ļ蔃đŖšĻ蔃葕đ¤Ļ”đ§…ĨđŖ¸ąđĨ•œđŖģģđ§’ä“´đŖ›ŽđŠĻđĻŧĻæŸšãœŗã°•ãˇ§åĄŦđĄ¤ĸ栐䁗đŖœŋ𤃡𤂋𤄏đϰĄå“‹åšžđϚąåš’đ ŋŸđ Ž¨đ ¸é†đ¨Ŧ“鎜äģ¸å„Ģ㠙đ¤ļäēŧđ ‘Ĩđ ŋäŊ‹äžŠđĨ™‘åЍđ †Ģ𠏋ãĻ™đ ŒŠđ ”ãĩäŧŠđ ‹€đ¨ēŗđ ‰ĩčĢšđ ˆŒäē˜"],["92a1","働儍äžĸäŧƒđ¤¨ŽđŖēŠäŊ‚倎åŦ傁äŋŒäŋĨ偘åƒŧ兙兛兝兞æšļđŖ–•đŖ¸šđŖēŋæĩ˛đĄĸ„đŖē‰å†¨å‡ƒđ — ä“đ ’Ŗđ ’’đ ’‘čĩēđ¨Ēœđ œŽå‰™åŠ¤đ Ąŗå‹ĄéŽä™ēį†Œđ¤ŽŒđ ° đ¤ĻŦđĄƒ¤æ§‘đ ¸į‘šãģžį’™į”į‘–įŽ˜äŽŽđ¤Ēŧđ¤‚åã–„įˆđ¤ƒ‰å–´đ …å“đ ¯†åœé‰é›´éĻ埝垍åŋã˜žåŖ‹åĒ™đ¨Š†đĄ›ēđĄ¯đĄœå¨ŦåĻ¸éŠåŠžåĢå¨’đĨĨ†đĄ§ŗđĄĄĄđ¤Š•ã›ĩæ´…į‘ƒå¨ĄđĨēƒ"],["9340","åĒđ¨¯—đ “é į’ŒđĄŒƒį„…äĨ˛éˆđ¨§ģéŽŊãž å°žå˛žåšžåšˆđĄĻ–đĄĨŧđŖĢŽåģå­đĄ¤ƒđĄ¤„㜁đĄĸ ã›đĄ›žã›“č„Ē𨩇đĄļēđŖ‘˛đ¨Ļ¨åŧŒåŧŽđĄ¤§đĄžĢåŠĢđĄœģå­„č˜”đ§—ŊčĄ æžđĸĄ đĸ˜Ģåŋ›ãē¸đĸ–¯đĸ–žđŠ‚ˆđĻŊŗæ‡€đ €žđ †đĸ˜›æ†™æ†˜æĩđĸ˛›đĸ´‡đ¤›”đŠ…"],["93a1","æ‘ąđ¤™Ĩđĸ­Ē㨊đĸŦĸđŖ‘đŠŖĒđĸš¸æŒˇđĒ‘›æ’ļæŒąæ‘đ¤§Ŗđĸĩ§æŠ¤đĸ˛Ąæģæ•ĢæĨ˛ã¯´đŖ‚ŽđŖŠ­đ¤Ļ‰đŖŠĢå”đŖ‹ đĄŖ™đАŋæ›ŽđŖŠ‰đŖ†ŗã̠䆐đĨ–„đ¨ŦĸđĨ–đĄ›ŧđĨ•›đĨĨįŖŽđŖ„ƒđĄ ĒđŖˆ´ã‘¤đŖˆđŖ†‚đ¤‹‰æšŽđĻ´¤æ™ĢäŽ“æ˜°đ§Ą°đĄˇĢæ™ŖđŖ‹’đŖ‹Ąæ˜žđĨĄ˛ãŖ‘đŖ ēđŖžŧ㎙đŖžĸđŖžį“ãŽ–æžđ¤˜Ēæĸļæ žã¯„æĒžãĄŖđŖŸ•đ¤’‡æ¨ŗæŠ’æĢ‰æŦ…đĄ¤’æ”‘æĸ˜æŠŒã¯—æŠē歗đŖŋ€đŖ˛šéޠ鋞đ¨¯Ēđ¨Ģ‹"],["9440","銉𨀞𨧜鑧æļĨæŧ‹đ¤§Ŧæĩ§đŖŊŋãļæ¸„đ¤€ŧå¨Ŋæ¸ŠåĄ‡æ´¤įĄ‚į„ģ𤌚đ¤‰ļįƒąį‰įŠ‡įŠ”đ¤žđ¤œĨå…šđ¤Ē¤đ —Ģį‘ēđŖģ¸đŖ™Ÿđ¤ŠŠđ¤¤—đĨŋĄãŧ†ãēąđ¤ĢŸđ¨°ŖđŖŧĩ悧ãģŗį“ŒįŧéŽ‡įˇä’ŸđώĒä•‘į–ƒãŊŖđ¤ŗ™đ¤´†ãŊ˜į••ᙺđĒ—†ãŦ™į‘¨đ¨ĢŒđ¤ĻĢđ¤ĻŽãĢģ"],["94a1","ãˇđ¤ŠŽãģŋđ¤§…đ¤Ŗŗé‡ēåœ˛é‚đ¨ĢŖđĄĄ¤åƒŸđĨˆĄđĨ‡§į¸đŖˆ˛įœŽįœįģđ¤š—đŖžãŠžđ¤Ŗ°į¸į’›ãēŋđ¤Ēēđ¤Ģ‡äƒˆđ¤Ē–đφŽéŒ‡đĨ–į žįĸįĸˆįŖ’įįĨ™đ§đĨ›Ŗä„Žįϛ蒖įĻĨ樭đŖģēį¨ēį§´ä…ŽđĄ›Ļ䄲éˆĩį§ąđ ĩŒđ¤ĻŒđ Š™đŖļēđĄŽã–—å•Ģ㕰ãšĒ𠇔𠰍įĢĸ劙đĸ›ĩđĨǝđĨĒœå¨đ ‰›įŖ°å¨ĒđĨ¯†įĢžä‡šįąįą­äˆ‘đĨŽŗđĨēŧđĨēĻįŗđ¤§šđĄž°į˛Žįąŧį˛ŽæĒ˛įˇœį¸‡įˇ“įŊŽđωĄ"],["9540","đĻ…œđ§­ˆįļ—đĨē‚ä‰ĒđĻ­ĩđ ¤–æŸ–đ ŽđŖ—åŸ„đϐ’đĻ¸đ¤ĨĸįŋįŦ§đ  ŦđĨĢŠđĨĩƒįŦŒđĨ¸Žé§Ļč™…éŠŖæ¨œđŖŋã§ĸ𤧡đĻ–­é¨ŸđĻ– č’€đ§„§đĻŗ‘ä“Ē脷䐂胆脉腂đĻž´éŖƒđĻŠ‚č‰ĸč‰ĨđĻŠ‘č‘“đĻļ§č˜đ§ˆ›ådžä…ŋ𡡀åŦĢđĄĸĄåĢ¤đĄŖ˜čš đ¯ĻŧđŖļč ­đ§ĸ娂"],["95a1","襎äŊ…čĸ‡čĸŋčŖĻčĨĨčĨđĨšƒčĨ”đ§ž…đ§ž„đ¨¯ĩđ¨¯™đ¨Žœđ¨§šãē­č’Ŗä›ĩä›ãŸ˛č¨Ŋ訜𩑈åŊéˆĢđ¤Š„æ—”į„Šįƒ„đĄĄ…éĩ­č˛ŸčŗŠđ§ˇœåĻšįŸƒå§°äŽã›”č¸Ēčē§đ¤°‰čŧ°čŊŠä‹´æą˜æžģđĸŒĄäĸ›æŊšæē‹đĄŸšé¯Šãšĩđ¤¤¯é‚ģé‚—å•ąä¤†é†ģ鐄𨩋äĸđ¨Ģŧ鐧𨰝đ¨°ģč“Ĩč¨Ģé–™é–§é–—é––đ¨´´į‘…ãģ‚đ¤Ŗŋ𤩂đ¤Ēãģ§đŖˆĨ随đ¨ģ§đ¨šĻđ¨šĨãģŒđ¤§­đ¤Š¸đŖŋŽį’į‘Ģãģŧ靁𩂰"],["9640","æĄ‡ä¨đŠ‚“đĨŸŸéé¨đ¨Ļ‰đ¨°Ļđ¨Ŧ¯đĻŽžéŠēåŦ‘č­Šä¤ŧįšđ¤ˆ›éž›éąé¤¸đ ŧĻåˇđ¨¯…đ¤Ē˛é ŸđŠ“šé‹ļ𩗗é‡Ĩä“€đ¨­đ¤Š§đ¨­¤éŖœđ¨Š…ãŧ€éˆĒä¤Ĩ萔é¤ģéĨđ§Ŧ†ãˇŊéϛ䭝éĻĒ驜đ¨­ĨđĨŖˆæĒé¨ĄåĢžé¨¯đŠŖąäŽđŠĨˆéĻŧäŽŊ䮗éŊåĄ˛đĄŒ‚å ĸđ¤Ļ¸"],["96a1","đĄ“¨įĄ„đĸœŸđŖļ¸æŖ…ãĩŊ鑘㤧慐đĸžđĸĨĢæ„‡éąéą“éąģé°ĩ鰐é­ŋé¯đŠ¸­éŽŸđLJĩđǃžé´Ąä˛Žđ¤„„é¸˜ä˛°é´Œđdž´đǃ­đǃŗđФ¯éļĨč’ŊđϏ’đĻŋŸđĻŽ‚č—ŧ䔺đĻļ¤đĻē„đώ°č č—ŽđϏ€đŖŸ—đρ¤į§ĸđŖ–œđŖ™€ä¤­đ¤§žãĩĸ鏛銾鍈đ Šŋįĸšé‰ˇé‘äŋ¤ã‘€é¤đĨ•į ŊįĄ”įĸļįĄ‹đĄ—đŖ‡‰đ¤ĨãššäŊ˛æŋšæŋ™į€žį€žå”đ¤†ĩåžģåŖŗåžŠé´–åŸ—į„´ã’¯đ¤†Ŧį‡ĢđĻą€đ¤ž—åŦ¨đĄžĩ𨩉"],["9740","愌åĢŽå¨‹äŠŧ𤒈ãœŦä­ģđ¨§ŧéŽģéŽ¸đĄŖ–đ ŧč‘˛đĻŗ€đĄ“đ¤‹ēđĸ°Ļ𤏁åĻ”đŖļˇđĻįļ¨đĻ…›đĻ‚¤đ¤Ļšđ¤Ļ‹đ¨§ēé‹ĨįĸãģŠį’´đ¨­ŖđĄĸŸãģĄđ¤ĒŗæĢ˜įŗįģãģ–𤨞đ¤Ē”đĄŸ™đ¤ŠĻ𠎧𡐤đ¤§Ĩį‘ˆđ¤¤–į‚Ĩđ¤Ĩļ銄įĻ鍟𠓾錱đ¨ĢŽđ¨¨–éŽ†đ¨¯§đĨ—•ä¤ĩđ¨Ē‚į…Ģ"],["97a1","đ¤Ĩƒđ ŗŋåš¤đ ˜šđ ¯Ģđ ˛¸å”‚į§„đĄŸēįˇžđĄ›‚đ¤ŠđĄĄ’ä”ŽéãœŠđ¨Ģ€đ¤Ļ­åϰđĄĸŋđĄĸƒđ§’„åĒĄã›ĸđŖĩ›ãš°é‰ŸåŠšđ¨ĒđĄĄĸé´ãŗđ Ē´äĒ–ãϊ僴ãĩŠãĩŒđĄŽœį…ĩä‹ģđ¨ˆ˜æ¸đŠƒ¤ä“Ģæĩ—đ§šį§æ˛¯ãŗ–đŖŋ­đŖ¸­æ¸‚æŧŒãĩ¯đ ĩį•‘ãšŧ㓈䚀ãģšäĄąå§„鉎䤞čŊđ¨°œđϝ€å ’åŸˆã›–đĄ‘’įƒžđ¤ĸ𤊹đĸŋŖđĄŠ°đĸŽŊæĸšæĨ§đĄŽ˜đŖ“Ĩđ§¯´đŖ›Ÿđ¨ĒƒđŖŸ–đŖēđ¤˛Ÿæ¨šđŖš­đϞˇčžä“Ÿä“Ž"],["9840","đĻ´ĻđĻĩ‘đϞ‚đĻŋžæŧ—𧄉čŒŊđĄœē菭đϞ€đ§“đĄŸ›åωåĒ‚đĄžŗåŠĄåŠąđĄ¤…đ¤‡ŧ㜭姯đĄœŧã›‡į†ŽéŽæššđ¤ŠĨ劎å¨Ģ𤊓æ¨ĢđŖģšđ§œļđ¤‘›đ¤‹Šį„đ¤‰™đ¨§Ąäž°đĻ´¨åŗ‚đ¤“Žđ§šđ¤ŽŊæ¨Œđ¤‰–đĄŒ„į‚Ļį„ŗđ¤ŠãļĨæŗŸđ¯ Ĩ𤩏įšĨå§Ģå´¯ãˇŗåŊœđ¤ŠđĄŸŸįļ¤čĻ"],["98a1","咅đŖĢēđŖŒ€đ ˆ”åžđ Ŗ•đ ˜™ãŋĨ𡾞đNJļį€ƒđŠ…›åĩ°įŽįŗ“đ¨Š™đА äŋˆįŋ§į‹įŒđ§Ģ´įŒ¸įŒšđĨ›ļįįˆãēŠđ§Ŧ˜éŦį‡ĩđ¤Ŗ˛įĄč‡ļãģŠįœŒã쑿˛ĸå›Ŋį™įžįŸãģĸãģ°ãģ´ãģēį““ãŧŽãŊ“į•‚į•­į•˛į–ãŊŧį—ˆį—œãŋ€į™ãŋ—į™´ãŋœį™ēđ¤Ŋœį†ˆå˜ŖčĻ€åĄŠä€įƒä€šæĄä…ã—›įž˜äĒä¯åąžįžžįŸ‹åŖ˛į ˜į‚šį œä‚¨į šįĄ‡įĄ‘įĄĻ葈đĨ”ĩį¤ŗæ ƒį¤˛ä„ƒ"],["9940","䄉įĻ‘įĻ™čžģፆčžŧ䅧įǑ䆞įĒŧ艹䇄įĢįĢ›ä‡ä¸Ąį­ĸį­Ŧį­ģᰒᰛ䉠ä‰ēįąģį˛œäŠŒį˛¸äŠ”įŗ­čž“įƒ€đ ŗįˇįˇ”įˇįˇŊįžŽįž´įŠŸäŽ—č€ č€ĨįŦšč€Žč€ąč”ãˇŒåž´į‚ č‚ˇčƒŠä­č„ŒįŒĒč„Žč„’į• č„”äãŦšč…–腙腚"],["99a1","䐓å ēč…ŧ膄äĨ膓䐭č†ĨåŸ¯č‡č‡¤č‰”ä’čŠĻč‰ļ苊苘č‹ŋ䒰荗险æĻŠč…įƒĩč‘¤æƒŖč’ˆä”„č’žč“Ąč“¸č”č”¸č•’ä”ģč•¯č•°č— ä•ˇč™˛čš’čš˛č›¯é™…čž‹ä˜†ä˜—čĸŽčŖŋ褤čĨ‡čĻ‘đ§Ĩ§č¨Šč¨¸čĒ”čĒ´čą‘čŗ”čŗ˛č´œäž˜åĄŸčˇƒäŸ­äģŽč¸ēå—˜å”čšąå—ĩčē°ä ˇčģŽčģĸčģ¤čģ­čģ˛čžˇčŋčŋŠčŋŒé€ŗé§„äĸ­éŖ éˆ“䤞鈨鉘é‰Ģ銱銮éŠŋ"],["9a40","鋪é‹Ģ鋺鋴é‹Ŋ鍃鎄鎭äĨ…äĨ‘éēŋ鐗匁鐝鐭鐞äĨĒ鑔鑹锭é–ĸäĻ§é—´é˜ŗä§Ĩ枠䨤靀ä¨ĩéž˛éŸ‚å™”äĢ¤æƒ¨éĸšäŦ™éŖąåĄ„é¤Žé¤™å†´é¤œé¤ˇéĨ‚éĨéĨĸ䭰駅䮝é¨ŧéŦįĒƒé­ŠéŽé¯é¯ąé¯´äą­é° ã¯đĄ¯‚éĩ‰é°ē"],["9aa1","éģžå™éļ“éļŊ鷀éˇŧé“ļčžļéšģéēŦéēąéēŊéģ†é“œéģĸéģąéģ¸į̈éŊ„đ ‚”đ Šˇđ Ž æ¤šé“ƒåĻŦđ “—åĄ€é“ãžšđ —•đ ˜•đ ™ļđĄšēå—į…ŗđ Ģ‚đ Ģđ Žŋå‘Ēđ¯ ģđ ¯‹å’žđ ¯ģđ °ģ𠱓đ ąĨđ ąŧæƒ§đ ˛å™ēđ ˛ĩđ ŗđ ŗ­đ ĩ¯đ ļ˛đ ˇˆæĨ•é°¯čžĨ𠸄𠸎đ ģ—𠞐đ ŧ­đ šŗå° đ žŧå¸‹đĄœđĄđĄļ朞đĄģđĄ‚ˆđĄ‚–ã™‡đĄ‚ŋđĄƒ“đĄ„¯đĄ„ģå¤č’­đĄ‹ŖđĄĩđĄŒļ讁𡕷𡘙𡟃𡟇乸į‚ģ𥠭đĄĨĒ"],["9b40","𡨭𡩅đĄ°Ē𥹰đĄ˛ŦđĄģˆæ‹ƒđĄģ•đĄŧ•į†˜æĄ•đĸ…槊㛈đĸ‰ŧđĸ—đĸēđĸœĒđĸĄąđĸĨč‹ŊđĸĨ§đĸĻ“đĸĢ•čĻĨđĸĢ¨čž đĸŦŽéž¸đĸŦŋ顇éĒŊđĸąŒ"],["9b62","đĸ˛ˆđĸ˛ˇđĨ¯¨đĸ´ˆđĸ´’đĸļˇđĸļ•đĸš‚đĸŊ´đĸŋŒđŖ€ŗđŖĻđŖŒŸđŖžåžąæ™ˆæšŋđ§ŠšđŖ•§đŖ—ŗįˆđ¤ĻēįŸ—đŖ˜šđŖœ–įē‡đ †åĸĩ朎"],["9ba1","椘đŖĒ§đ§™—đĨŋĸđŖ¸‘đŖēšđ§—žđĸ‚šäŖäĒ¸đ¤„™đ¨Ēšđ¤‹Žđ¤Œđ¤€ģđ¤Œ´đ¤Ž–đ¤Š…đ —Šå‡’đ ˜‘åϟđĄē¨ãŽžđŖŗŋđ¤„đ¤“–åžˆđ¤™´ãĻ›đ¤œ¯đ¨—¨đŠ§‰ãĸđĸ‡ƒč­žđ¨­Žé§–𤠒đ¤Ŗģđ¤¨•įˆ‰đ¤Ģ€đ ą¸åĨĨđ¤ēĨ𤾆𠝹čģšđĨ€Ŧ劏åœŋį…ąđĨŠ™đĨ™đŖŊŠđ¤Ē§å–ŧđĨ‘†đĨ‘ŽđĻ­’é‡”ã‘ŗđĨ”ŋ𧘲đĨ•žäœ˜đĨ•ĸđĨ•ĻđĨŸ‡đ¤¤ŋđĨĄåĻã“ģđŖŒæƒžđĨ¤ƒäŧđ¨ĨˆđĨĒŽđĨމđĨ°†đĄļåžĄį…‘æžļđĻ„‚𧰒遖đφ˛đ¤žšč­ĸđϐ‚đĻ‘Š"],["9c40","åĩ›đϝˇčŧļđĻ’„đĄ¤œčĢĒđ¤§ļđĻ’ˆđŖŋ¯đĻ”’䯀đĻ–ŋđϚĩđĸœ›é‘ĨđĨŸĄæ†•å¨§đ¯Ŗäžģåššđ¤”ĄđĻ›ŧäšĒ𤤴陖æļđϞŊ㘘čĨˇđĻž™đĻĄŽđϐ‘đĻĄžį‡ŸđĻŖ‡į­‚đЃ€đ ¨‘đϤĻ鄄đϤšįЅ鎰đϧēé¨Ļđύ­ã™ŸđĻ‘Šđ €Ąįσđύ´đĻ­›å´ŦđŖ”™čđĻŽä›đϞ¤į”ģčĄĨđĻļŽåĸļ"],["9ca1","㜜đĸ–đ§‹đ§‡ãą”𧊀𧊅銁đĸ…ē𧊋錰đ§‹Ļđ¤§æ°šé’Ÿđ§‘đ ģ¸č §čŖĩđĸ¤Ļđ¨‘ŗđĄžąæē¸đ¤¨Ē𥠠ãĻ¤ãššå°į§Ŗä”ŋæšļ𩲭đŠĸ¤čĨƒđ§ŸŒđ§Ą˜å›–äƒŸđĄ˜ŠãĻĄđŖœ¯đ¨ƒ¨đĄ…į†­čĻđ§§đŠ†¨åŠ§ä˛ˇđ§‚¯đ¨ĻĢđ§§Ŋ𧨊đ§Ŧ‹đ§ĩĻđ¤…ēᭃįĨžđ¨€‰æžĩđĒ‹Ÿæ¨ƒđ¨Œ˜åŽĸđϏ‡éŽŋæ ļéđ¨…¯đ¨€ŖđĻĻĩđĄ­đŖˆ¯đ¨ˆåļ…đ¨°°đ¨‚ƒåœ•é Ŗđ¨Ĩ‰åļĢđ¤Ļˆæ–žæ§•叒đ¤ĒĨđŖžã°‘æœļ𨂐𨃴𨄮𡾡𨅏"],["9d40","đ¨†‰đ¨†¯đ¨ˆšđ¨Œ†đ¨Œ¯đ¨ŽŠã—Šđ¨‘¨đ¨šĒäŖēæĻđ¨Ĩ–į ˆé‰•đ¨Ļ¸ä˛đ¨§§äŸđ¨§¨đ¨­†đ¨¯”å§¸đ¨°‰čŧ‹đ¨ŋ…đЃŦį­‘đŠ„đŠ„ŧãˇˇđŠ…žđ¤ĢŠčŋįŠåš‹đŠ“§đŠ—ŠđŠ–°đŠ–¸đМ˛đŠŖ‘đŠĨ‰đŠĨĒ𩧃𩨨đŠŦŽđŠĩšđŠļ›įēŸđŠģ¸đŠŧŖä˛¤é•‡đNJ“į†ĸđĒ‹ŋäļ‘递đĒ—‹äļœđ ˛œčžžå—"],["9da1","čžēđĸ’°čžšđ¤Ē“䔉įšŋæŊ–æĒąäģĒ㓤đ¨ŦŦđ§ĸãœēčē€đĄŸĩ𨀤đ¨­Ŧ𨮙𧨾đϚ¯ãˇĢđ§™•đŖ˛ˇđĨ˜ĩđĨĨ–äēšđĨēđω˜åšŋđ š­č¸Žå­­đŖēˆđ¤˛žæžæ‹đĄŸļđĄĄģ攰嘭đĨąŠåšđĨŒ‘ãˇ†đŠļ˜äąŊå˜ĸ嘞įŊ‰đĨģ˜åĨĩđŖĩ€č°ä¸œđ ŋĒđ ĩ‰đŖšē脗éĩžč´˜į˜ģéą…į™Žįžšé…å˛č…ˆč‹ˇå˜Ĩ脲萘č‚Ŋå—ĒįĨĸ噃吖đ ēã—Žå˜…å—ąæ›ąđ¨‹ĸã˜­į”´å—°å–ēå’—å•˛đ ąđ ˛–åģđĨ…ˆđ šļđĸąĸ"],["9e40","đ ēĸéēĢįĩšå—žđĄĩæŠé­å’”čŗį‡ļé…ļæŧ掚揞啊đĸ­ƒéą˛đĸēŗå†šã“Ÿđ ļ§å†§å‘å”žå”“į™Ļ踭đĻĸŠį–ąč‚ļč „čž†čŖ‡č†ļ萜𡃁ä“ŦįŒ„đ¤œ†åŽčŒ‹đĻĸ“å™ģđĸ›´đ§´¯đ¤†Ŗđ§ĩŗđĻģđ§Šļ酰𡇙鈈đŖŗŧđǚŠđ ēŦđ ģšį‰ĻđĄ˛ĸ䝎đ¤ŋ‚đ§ŋšđ ŋĢäƒē"],["9ea1","éąæ”Ÿđĸļ äŖŗđ¤Ÿ đŠĩŧđ ŋŦ𠸊æĸđ§–Ŗđ ŋ­"],["9ead","đρˆđĄ†‡į†ŖįēŽéĩä¸šä¸„ã•ˇåŦæ˛˛å§ãšŦ㧜åŊãšĨ𤘘åĸšđ¤­Žčˆ­å‘‹åžĒđĨĒ•đ Ĩš"],["9ec5","㊒đĸ‘Ĩį´đŠēŦä´‰é¯­đŖŗžđŠŧ°äą›đ¤žŠđŠ–žđŠŋžč‘œđŖļļ𧊲đĻžŗđŖœ æŒŽį´ĨđŖģˇđŖ¸Ŧã¨Ē逈勌㚴ã™ēä—Šđ ’Žį™€å̰đ ēļįĄēđ§ŧŽåĸ§ä‚ŋå™ŧ鮋åĩ´į™”đǐ´éē…äŗĄį—šãŸģæ„™đŖƒšđ¤˛"],["9ef5","å™đĄŠŠåž§đ¤ĨŖđЏ†åˆ´đ§‚Žã–­æąŠéĩŧ"],["9f40","įą–éŦšåŸžđĄŦåą“æ““đŠ“đόĩ𧅤蚭𠴨đĻ´ĸđ¤Ģĸđ ĩą"],["9f4f","凞đĄŧåļŽéœƒđĄˇ‘éēéŒįŦŸéŦ‚åŗ‘įŽŖæ‰¨æŒĩéĢŋį¯éŦĒįąžéŦŽįą‚ឆ鰕į¯ŧéŦ‰éŧ—鰛𤤞éŊšå•ŗå¯ƒäŋŊéē˜äŋ˛å‰ ã¸†å‹‘坧偖åĻˇå¸’éŸˆéļĢčŊœå‘Šéž´éĨ€éžēåŒŦ愰"],["9fa1","æ¤Ŧ叚鰊鴂ä°ģ陁æĻ€å‚Ļį•†đĄ­é§šå‰ŗ"],["9fae","酙隁酜"],["9fb2","酑đ¨ē—æŋđĻ´ŖæĢŠå˜‘醎į•ē抅đ ŧįįą°đĨ°ĄđŖŗŊ"],["9fc1","đ¤¤™į›–éŽä¸Ēđ ŗ”čŽžčĄ‚"],["9fc9","åąŠæ§€åƒ­åē刟åˇĩäģŽæ°ąđ ‡˛äŧšå’œå“šåŠščļ‚ã—žåŧŒã—ŗ"],["9fdb","歒é…ŧéžĨ鮗頮éĸ´éĒēéē¨éē„į…ēįŦ”"],["9fe7","æ¯ē蠘įŊ¸"],["9feb","嘠đĒ™ŠčšˇéŊ“"],["9ff0","čˇ”čšé¸œč¸æŠ‚đ¨Ŋ踨čšĩįĢ“đ¤Šˇį¨žįŖ˜æŗĒčŠ§į˜‡"],["a040","𨩚éŧĻæŗŽčŸ–į—ƒđNJ˛įĄ“đ¯Ą€č´Œį‹ĸįąčŦ­įŒ‚į“ąčŗĢđ¤Ēģ蘝åžēčĸ ä’ˇ"],["a055","đĄ ģđϏ…"],["a058","芞đĸ”›"],["a05b","æƒŊį™§éĢ—éĩ„鍎鎏čŸĩ"],["a063","č čŗˇįŒŦéœĄéŽ°ã—–įŠ˛ä°‡įą‘éĨŠđĻ…™æ…™ä°„éē–æ…Ŋ"],["a073","坟慯æŠĻ戚拎㊜æ‡ĸåŽĒđŖĩ捤栂㗒"],["a0a1","åĩ—đ¨¯‚čŋšđ¨¸š"],["a0a6","僙đĄĩ†į¤†åŒ˛é˜¸đ ŧģäĨ"],["a0ae","įŸž"],["a0b0","įŗ‚đĨŧšįŗšį¨­čĻ聪įĩį”…ᓞčĻ”čˆšæœŒčĸđ§’†č›į“°č„ƒįœ¤čωđϟŒį•“đĻģ‘čžŠčŸŽč‡ˆčžŒčŠ‰č˛­č­ƒįœĢį“¸č“šã˜ĩæĻ˛čļĻ"],["a0d4","čĻŠį‘¨æļščŸđ¤€‘į“§ãˇ›į…ļæ‚¤æ†œãŗ‘į…ĸæˇ"],["a0e2","įŊąđ¨Ŧ­į‰æƒŠä­žåˆ ã°˜đŖŗ‡đĨģ—đ§™–đĨ”ąđĄĨ„𥋞đФƒđώœđ§‚­åŗđφ­đ¨¨đŖ™ˇđ ƒŽđĻĄ†đ¤ŧŽä•ĸåŦŸđĻŒéŊéēĻđωĢ"],["a3c0","␀",31,"␥"],["c6a1","①",9,"⑴",9,"ⅰ",9,"ä¸ļä¸ŋäē…äē å†‚冖å†Ģ勚匸半åŽļå¤ŠåŽ€åˇ›âŧŗåšŋåģ´åŊåŊĄæ”´æ— į–’į™ļčžĩéšļ¨ˆãƒŊマゝゞ〃äģã€…〆〇ãƒŧīŧģīŧŊâœŊぁ",23],["c740","す",58,"ã‚Ąã‚ĸã‚Ŗã‚¤"],["c7a1","ã‚Ĩ",81,"А",5,"ЁЖ",4],["c840","Л",26,"Ņ‘Đļ",25,"â‡§â†¸â†šã‡đ ƒŒäššđ ‚Šåˆ‚ä’‘"],["c8a1","éž°å†ˆéžąđ§˜‡"],["c8cd","īŋĸīŋ¤īŧ‡īŧ‚ãˆąâ„–â„Ąã‚›ã‚œâē€âē„âē†âē‡âēˆâēŠâēŒâēâē•âēœâēâēĨâē§âēĒâēŦâēŽâēļâēŧâēžâģ†âģŠâģŒâģâģâģ–âģ—âģžâģŖ"],["c8f5","ʃɐɛɔÉĩÅ“Ã¸Å‹ĘŠÉĒ"],["f9fe","īŋ­"],["fa40","𠕇鋛𠗟đŖŋ…č•ŒäŠĩį¯å†ĩ㙉đ¤Ĩ‚đ¨§¤é„đĄ§›č‹ŽđŖŗˆį ŧæ„æ‹Ÿđ¤¤ŗđ¨ĻĒ𠊠đĻŽŗđĄŒ…äžĢđĸ“­å€ˆđĻ´Šđ§Ē„đŖ˜€đ¤Ēąđĸ”“å€Šđ žåž¤đ Ž€đ ‡æģ›đ ŸåŊ儁ã‘ē儎éĄŦãƒč–đ¤Ļ¤đ ’‡å… đŖŽ´å…Ēđ ¯ŋđĸƒŧđ ‹Ĩđĸ”°đ –ŽđŖˆŗđĄĻƒåŽ‚čŊđ –ŗđŖ˛™å†˛å†¸"],["faa1","é´´å‡‰å‡å‡‘ãŗœå‡“đ¤ĒĻ冺å‡ĸå‚å‡­čæ¤žđŖœ­åŊģ刋åˆĻåˆŧåŠĩå‰—åŠ”åŠšå‹…į°•č•‚å‹ č˜đĻŦ“包đ¨Ģžå•‰æģ™đŖž€đ Ĩ”đŖŋŦåŒŗå„đ ¯ĸæŗ‹đĄœĻæ ›į•æŠãēĒãŖŒđĄ›¨į‡ä’ĸ卭却đ¨šĢ卞åŋ𡖖𡘓įŸĻ厓đ¨Ē›åŽ åŽĢåŽŽįŽ§đĨ˛ãŊ™įŽœåå…æą‰äš‰åŸžå™ãĒĢđ Žå đŖŋĢđĸļŖåļđ ąˇå“įšå”Ģ晗æĩ›å‘­đĻ­“đ ĩ´å•å’å’¤äžĻ𡜍đ ģãļ´đ ĩ"],["fb40","đ¨Ļŧđĸš˜å•‡äŗ­å¯į—å–†å–Šå˜…đĄŖ—đ¤€ē䕒đ¤ĩæšŗđĄ‚´å˜ˇæ›đŖŠŠæš¤æš­å™å™įŖąå›ąéž‡åžåœ€å›¯å›­đ¨­Ļã˜ŖđĄ‰å†đ¤†ĨæąŽį‚‹å‚ãšąđĻąžåŸĻđĄ–å ƒđĄ‘”đ¤Ŗå Ļđ¤¯ĩåĄœåĸĒã•ĄåŖ åŖœđĄˆŧåŖģå¯ŋ坃đĒ…đ¤‰¸é“ã–Ąå¤ŸæĸĻ㛃暙"],["fba1","đĄ˜žå¨¤å•“đĄš’č”…å§‰đ ĩŽđϞđĻ´ĒđĄŸœå§™đĄŸģ𡞲đĻļĻæĩąđĄ ¨đĄ›•å§šđĻš…åĒĢåŠŖã›Ļđ¤ĻŠåŠˇãœˆåĒ–į‘ĨåĢ“đĻžĄđĸ•”ãļ…đĄ¤‘ãœ˛đĄš¸åēƒå‹å­ļ斈å­ŧđ§¨Žä€„äĄđ ˆ„å¯•æ… đĄ¨´đĨ§Œđ –Ĩå¯ŗåŽä´å°…đĄ­„å°“įŽå°”đĄ˛ĨđĻŦ¨åą‰äŖå˛…åŗŠåŗ¯åļ‹đĄˇšđĄ¸ˇå´å´˜åĩ†đĄē¤å˛ē厗č‹ŧã ­đ¤¤đĸ‰đĸ…ŗčЇã ļ㯂帎æĒŠåšĩåšēđ¤’ŧđ ŗ“åŽĻäēˇåģåŽ¨đĄąå¸‰åģ´đ¨’‚"],["fc40","åģšåģģãĸ åģŧ栞鐛åŧđ ‡đ¯ĸ”ãĢžäĸŽđĄŒēåŧēđĻĸˆđĸåŊ˜đĸ‘ąåŊŖéžŊđĻšŽåŊ˛é€đ¨¨ļåž§åļļãĩŸđĨ‰đĄŊĒ𧃸đĸ™¨é‡–đ Šžđ¨¨Šæ€ąæš…đĄĄˇãĨŖãˇ‡ã˜šåžđĸž´įĨąãš€æ‚žæ‚¤æ‚ŗđ¤Ļ‚đ¤Ļđ§Š“į’¤åƒĄåĒ æ…¤č¤æ…‚đ¯ĸĻđĻģ’æ†å‡´đ ™–憇åŽĒđŖžˇ"],["fca1","đĸĄŸæ‡“𨮝đŠĨæ‡ã¤˛đĸĻ€đĸŖæ€Ŗæ…œæ”žæŽ‹đ „˜æ‹…đĄ°æ‹•đĸ¸æŦđ¤§Ÿã¨—æ¸æ¸đĄŽŽđĄŸŧ撐枊đĸ¸ļ頔𤂌đĨœæ“Ąæ“Ĩé‘ģãŠĻæē㊗敍æŧ–đ¤¨¨đ¤¨Ŗæ–…æ•­æ•ŸđŖžæ–ĩđ¤Ĩ€äŦˇæ—‘äƒ˜đĄ Šæ— æ—ŖåŋŸđŖ€æ˜˜đŖ‡ˇđŖ‡¸æ™„đŖ†¤đŖ†Ĩ晋đ šĩ晧đĨ‡Ļæ™ŗæ™´đĄ¸ŊđŖˆąđ¨—´đŖ‡ˆđĨŒ“įŸ…đĸŖˇéĻ¤æœ‚đ¤Žœđ¤¨ĄãŦĢæ§ēđŖŸ‚æžæ§æĸđ¤‡đŠƒ­æŸ—ä“Šæ ĸ暐éˆŧ栁đŖĻđĻļ æĄ"],["fd40","đŖ‘¯æ§Ąæ¨‹đ¨ĢŸæĨŗæŖƒđŖ—æ¤æ¤€ã´˛ã¨đŖ˜ŧ㎀æžŦæĨĄđ¨ŠŠä‹ŧæ¤ļæĻ˜ãŽĄđ ‰čŖå‚æ§šđŖ™™đĸ„ĒæŠ…đŖœƒæĒã¯ŗæžąæĢˆđІœã°æŦđ ¤ŖæƒžæŦĩæ­´đĸŸæēĩđŖĢ›đ ŽĩđĄĨ˜ã€åĄđŖ­šæ¯ĄđŖģŧæ¯œæ°ˇđĸ’‹đ¤ŖąđĻ­‘æąščˆĻæąšđŖļŧ䓅đŖļŊ𤆤𤤌𤤀"],["fda1","đŖŗ‰ã›ĨãŗĢđ ´˛éŽƒđŖ‡šđĸ’‘įžæ ˇđĻ´ĨđĻļĄđώ̿ĩœæšŧæŧ„đ¤Ĩŋ𤂅đĻš˛č”ŗđĻŊ´å‡‡æ˛œæ¸čŽđ¨ŦĄæ¸¯đŖ¸¯į‘“đŖž‚į§ŒæšåĒ‘đŖ‹æŋ¸ãœæžđŖ¸°æģē𡒗đ¤€Ŋ䕕鏰æŊ„æŊœãĩŽæŊ´đŠ…°ã´ģæžŸđ¤…„æŋ“𤂑𤅕𤀚đŖŋ°đŖž´đ¤„ŋå‡Ÿđ¤…–đ¤…—đ¤…€đχį‹įžį‚§į‚įƒŒįƒ•įƒ–įƒŸä„„ãˇ¨į†´į†–đ¤‰ˇį„Ģį……åĒˆį…Šį…Žå˛œđ¤Ĩį…éĸ𤋁į„Ŧ𤑚𤨧đ¤¨ĸį†ēđ¨¯¨į‚ŊįˆŽ"],["fe40","é‘‚įˆ•å¤‘é‘ƒįˆ¤éđĨ˜…įˆŽį‰€đ¤Ĩ´æĸŊį‰•į‰—ãš•đŖ„æ æŧŊįŠ‚įŒĒįŒĢđ¤ Ŗđ¨ ĢäŖ­đ¨ „įŒ¨įŒŽįįŽĒđ °ēđύŽį‰į‘‰đ¤‡ĸđĄ›§đ¤¨¤æ˜Ŗã›…đ¤Ļˇđ¤Ļđ¤§ģįˇį•æ¤ƒđ¤¨Ļįšđ —ƒãģ—į‘œđĸĸ­į‘ đ¨ē˛į‘‡į¤į‘ļ莹į‘Ŧãœ°į‘´éąæ¨Ŧį’‚äĨ“đ¤ĒŒ"],["fea1","đ¤…Ÿđ¤Ššđ¨Žå­†đ¨°ƒđĄĸžį“ˆđĄĻˆį”Žį“Šį”žđ¨ģ™đĄŠ‹å¯—đ¨ēŦéŽ…į•į•Šį•§į•Žđ¤ž‚ãŧ„đ¤´“į–Žį‘į–žį–´į˜‚į˜Ŧį™‘į™į™¯į™ļđĻĩįšč‡¯ãŸ¸đϤ‘đϤŽįšĄįšĨįšˇį›ŒđĻžŸč‘ĸđĨ‚đĨ…ŊđĄ¸œįœžįœĻį€æ’¯đĨˆ į˜đŖŠŦįž¯đ¨Ĩ¤đ¨Ĩ¨đĄ›įŸ´į ‰đĄļđ¤¨’æŖŠįĸ¯įŖ‡įŖ“éšĨį¤ŽđĨ— įŖ—ᤴįĸąđ§˜Œčž¸čĸ„đ¨ŦĢđĻ‚ƒđĸ˜œįĻ†č¤€æ¤‚įĻ€đĨĄ—įĻđ§Ŧšį¤ŧįĻŠæ¸Ēđ§„Ļãē¨į§†đŠ„į§”"]] + +/***/ }), +/* 718 */ +/***/ (function(module, exports) { + +module.exports = [["0","\u0000",127],["8141","갂갃갅갆갋",4,"갘갞갟갡ę°ĸę°Ŗę°Ĩ",6,"ę°Žę°˛ę°ŗę°´"],["8161","ę°ĩę°ļę°ˇę°ēę°ģę°Ŋę°žę°ŋ깁",9,"걌걎",5,"걕"],["8181","걖걗걙걚걛걝",18,"ęą˛ęąŗęąĩęąļęąšęąģ",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞ę˛ĸ",5,"ę˛Ģ겭겎겹",6,"ę˛ē겞ę˛ŋęŗ€ęŗ‚ęŗƒęŗ…ęŗ†ęŗ‡ęŗ‰ęŗŠęŗ‹ęŗ",7,"ęŗ–ęŗ˜",7,"ęŗĸęŗŖęŗĨęŗĻęŗŠęŗĢęŗ­ęŗŽęŗ˛ęŗ´ęŗˇ",4,"ęŗžęŗŋ괁괂괃괅괇",4,"괎괐괒괓"],["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"ę´Ēę´Ģę´Ž",5],["8261","ę´ļ괡괚ę´ēę´ģę´Ŋ",6,"ęĩ†ęĩˆęĩŠ",5,"ęĩ‘ęĩ’ęĩ“ęĩ•ęĩ–ęĩ—"],["8281","ęĩ™",7,"ęĩĸęĩ¤",7,"ęĩŽęĩ¯ęĩąęĩ˛ęĩˇęĩ¸ęĩšęĩēęĩžęļ€ęļƒ",4,"ęļŠęļ‹ęļęļŽęļęļ‘",10,"ęļž",5,"ęļĨ",17,"ęļ¸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡ęˇĸ措ęˇĨ",18],["8341","ęˇēęˇģęˇŊ귾긂",5,"긊긌긎",5,"긕",7],["8361","긝",18,"揞揺ę¸ĩę¸ļ긚ę¸ģę¸ŧ"],["8381","ę¸Ŋ긞ę¸ŋ깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞ęšĸęšŖęš¤ęšĻęš§ęšĒęšĢęš­ęšŽęš¯ęšą",6,"ęšēęšž",5,"ęē†",5,"ęē",46,"ęēŋęģęģ‚ęģƒęģ…",6,"ęģŽęģ’",5,"ęģšęģ›ęģ",8],["8441","ęģĻęģ§ęģŠęģĒęģŦęģŽ",5,"ęģĩęģļęģˇęģšęģēęģģęģŊ",8],["8461","ęŧ†ęŧ‰ęŧŠęŧ‹ęŧŒęŧŽęŧęŧ‘",18],["8481","ęŧ¤",7,"ęŧŽęŧ¯ęŧąęŧŗęŧĩ",6,"ęŧžęŊ€ęŊ„ęŊ…ęŊ†ęŊ‡ęŊŠ",5,"ęŊ‘",10,"ęŊž",5,"ęŊĻ",18,"ęŊē",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"ęžēęžģęžŊęžž"],["8541","ęžŋęŋ",5,"ęŋŠęŋŒęŋ",4,"ęŋ•",6,"ęŋ",4],["8561","ęŋĸ",5,"ęŋĒ",5,"ęŋ˛ęŋŗęŋĩęŋļęŋˇęŋš",6,"뀂뀃"],["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끞ëŋ낁낂낃낅",6,"낎낐낒",5,"ë‚›ë‚ë‚žë‚Ŗë‚¤"],["8641","ë‚Ĩë‚Ļ낧ë‚Ē낰낲ë‚ļ낷낹ë‚ēë‚ģë‚Ŋ",6,"냆냊",5,"냒"],["8661","냓냕냖냗냙",6,"냥ëƒĸëƒŖëƒ¤ëƒĻ",10],["8681","냹",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"ë„Ļ넧넩ë„Ēë„Ģ넭",6,"ë„ļë„ē",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"ë…ēë…ģë…Ŋ녾ë…ŋ놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"],["8741","놞",9,"놩",15],["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"],["8781","뇖",5,"뇞뇠",7,"ë‡Ēë‡Ģë‡­ë‡Žë‡¯ë‡ą",7,"ë‡ēë‡ŧ뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눥",18,"ëˆĩ",6,"ëˆŊ",26,"뉙뉚뉛뉝뉞뉟뉡",6,"ë‰Ē",4],["8841","뉯",4,"ë‰ļ",5,"ë‰Ŋ",6,"늆늇늈늊",4],["8861","늏늒늓늕늖늗늛",4,"ëŠĸ늤늧늨늩ëŠĢëŠ­ëŠŽëŠ¯ëŠąëŠ˛ëŠŗëŠĩëŠļ늷"],["8881","늸",15,"닊닋닍닎닏닑닓",4,"ë‹šë‹œë‹žë‹Ÿë‹ ë‹Ąë‹Ŗë‹§ë‹Šë‹Ē닰닱닲ë‹ļë‹ŧë‹Ŋ닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡ëĸëŖ"],["8941","ëĻ덨ëĒëŦë­ë¯ë˛ëŗëĩëļ덷덹",6,"뎂뎆",5,"뎍"],["8961","뎎뎏뎑뎒뎓뎕",10,"ëŽĸ",5,"뎊ëŽĒëŽĢ뎭"],["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡ëĸëŖëĨëĻ돧돊",18,"ëŊ",18,"됑",6,"됙됚됛됝됞됟됡",6,"ëĒëŦ",7,"ëĩ",15],["8a41","둅",10,"둒둓둕둖둗둙",6,"ë‘ĸ둤ë‘Ļ"],["8a61","둧",4,"둭",18,"뒁뒂"],["8a81","뒃",4,"뒉",19,"뒞",5,"ë’Ĩë’Ļ뒧뒩ë’Ēë’Ģ뒭",7,"ë’ļ뒸ë’ē",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡ë“ĸë“Ĩ듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"],["8b41","딞",5,"ë”Ļë”Ģ",4,"ë”˛ë”ŗë”ĩë”ļ딷딹",6,"땂땆"],["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞ë•ĸ",8],["8b81","ë•Ģ",52,"ë–ĸë–Ŗë–Ĩë–Ļ떧떩ë–Ŧë–­ë–Žë–¯ë–˛ë–ļ",4,"떾ë–ŋ뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18],["8c41","똀",15,"똒똓똕똖똗똙",4],["8c61","똞",6,"ë˜Ļ",5,"똭",6,"ë˜ĩ",5],["8c81","ë˜ģ",12,"뙉",26,"ë™Ĩë™Ļ뙧뙩",50,"뚞뚟뚡ëšĸëšŖëšĨ",5,"ëš­ëšŽëš¯ëš°ëš˛",16],["8d41","뛃",16,"뛕",8],["8d61","뛞",17,"ë›ąë›˛ë›ŗë›ĩë›ļ뛷뛹ë›ē"],["8d81","ë›ģ",4,"뜂뜃뜄뜆",33,"ëœĒëœĢ뜭뜮뜱",6,"ëœēëœŧ",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡ëĸëŖëĨëĻ띧띊",6,"띲띴ëļ",5,"띞ëŋ랁랂랃랅",6,"랎랓랔랕랚랛랝랞"],["8e41","랟랡",6,"ëžĒ랮",5,"ëžļ랷랹",8],["8e61","럂",4,"럈럊",19],["8e81","럞",13,"ëŸŽëŸ¯ëŸąëŸ˛ëŸŗëŸĩ",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"ë Ļë §ë Šë Ēë Ģë ­",6,"ë ļë ē",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡ëĄĸëĄŖëĄĨ",6,"륎륰륲",5,"륚ëĄēëĄģëĄŊ",7],["8f41","ëĸ…",7,"ëĸŽ",17],["8f61","ëĸ ",7,"ëĸŠ",6,"ëĸąëĸ˛ëĸŗëĸĩëĸļëĸˇëĸš",4],["8f81","ëĸžëĸŋëŖ‚ëŖ„ëŖ†",5,"ëŖëŖŽëŖëŖ‘ëŖ’ëŖ“ëŖ•",7,"ëŖžëŖ ëŖĸ",5,"ëŖĒëŖĢëŖ­ëŖŽëŖ¯ëŖą",6,"ëŖēëŖŧëŖž",5,"뤅",18,"뤙",6,"뤥",26,"뤞ë¤ŋëĨëĨ‚ëĨƒëĨ…",6,"ëĨëĨŽëĨëĨ’",5],["9041","ëĨšëĨ›ëĨëĨžëĨŸëĨĄ",6,"ëĨĒëĨŦëĨŽ",5,"ëĨļëĨˇëĨšëĨēëĨģëĨŊ"],["9061","ëĨž",5,"ëφëψëĻ‹ëόëĻ",15],["9081","ëϟ",12,"ëĻŽëϝëĻąëϞëĻŗëĻĩ",6,"ëĻžë§€ë§‚",5,"맊맋맍맓",4,"맚맜맟맠ë§ĸë§Ļë§§ë§Šë§Ēë§Ģë§­",6,"ë§ļë§ģ",4,"먂",5,"먉",11,"먖",33,"ë¨ēë¨ģë¨Ŋ먞ë¨ŋ멁멃멄멅멆"],["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"ëŠĻëŠĒ",5],["9161","ëŠ˛ëŠŗëŠĩëŠļ늡늚",9,"ëdžëLjëljëNJëĒ‹ëĒ",5],["9181","ëĒ“",20,"ëĒĒëĒ­ëĒŽëǝëĒąëĒŗ",4,"ëĒēëĒŧëĒž",5,"ëĢ…ë̆ë̇ë̉",14,"ë̚",33,"ëĢŊëĢžëĢŋëŦëŦ‚ëŦƒëŦ…",7,"ëŦŽëŦëŦ’",5,"ëŦ™ëŦšëŦ›ëŦëŦžëŦŸëŦĄ",6],["9241","ëŦ¨ëŦĒëŦŦ",7,"ëŦˇëŦšëŦēëŦŋ",4,"뭆뭈뭊뭋뭌뭎뭑뭒"],["9261","뭓뭕뭖뭗뭙",7,"ë­ĸë­¤",7,"ë­­",4],["9281","ë­˛",21,"뮉뮊뮋뮍뮎뮏뮑",18,"ëŽĨëŽĻ뎧뎊ëŽĒëŽĢ뎭",6,"ëŽĩëŽļ뎸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"ë¯ēë¯ģë¯Ŋ믞밁"],["9341","밃",4,"밊밎밐밒밓밙밚밠밡ë°ĸë°Ŗë°Ļë°¨ë°Ēë°Ģë°Ŧë°Žë°¯ë°˛ë°ŗë°ĩ"],["9361","ë°ļ밡밚",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8],["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"ë˛ĸë˛Ŗë˛Ĩë˛Ļ벊",6,"벲ë˛ļ",5,"벞ë˛ŋëŗëŗ‚ëŗƒëŗ…",7,"ëŗŽëŗ’ëŗ“ëŗ”ëŗ–ëŗ—ëŗ™ëŗšëŗ›ëŗ",22,"ëŗˇëŗšëŗēëŗģëŗŊ"],["9441","ëŗž",5,"봆봈봊",5,"봑봒봓봕",8],["9461","봞",5,"ë´Ĩ",6,"ë´­",12],["9481","ë´ē",5,"ëĩ",6,"ëĩŠëĩ‹ëĩëĩŽëĩëĩ‘",6,"ëĩš",9,"ëĩĨëĩĻëĩ§ëĩŠ",22,"ëļ‚ëļƒëļ…ëļ†ëļ‹",4,"ëļ’ëļ”ëļ–ëļ—ëļ˜ëļ›ëļ",6,"ëļĨ",10,"ëļą",6,"ëļš",24],["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"ëˇĒ",5,"롹"],["9561","ëˇ˛ëˇŗëˇĩëˇļ롡롚",6,"븁븂븄븆",5,"븎븏븑븒븓"],["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟ëšĸëšŖëšĨëšĻ뚧뚊ëšĢ",4,"뚲ëšļ",4,"ëšžëšŋëēëē‚ëēƒëē…",6,"ëēŽëē’",5,"ëēš",13,"ëēŠ",14],["9641","ëē¸",23,"ëģ’ëģ“"],["9661","ëģ•ëģ–ëģ™",6,"ëģĄëģĸëģĻ",5,"ëģ­",8],["9681","ëģļ",10,"ëŧ‚",5,"ëŧŠ",13,"ëŧšëŧž",33,"ëŊ‚ëŊƒëŊ…ëŊ†ëŊ‡ëŊ‰",6,"ëŊ’ëŊ“ëŊ”ëŊ–",44],["9741","랃",16,"뾕",8],["9761","뾞",17,"ëžą",7],["9781","ëžš",11,"ëŋ†",5,"ëŋŽëŋëŋ‘ëŋ’ëŋ“ëŋ•",6,"ëŋëŋžëŋ ëŋĸ",89,"ė€Ŋė€žė€ŋ"],["9841","끀",16,"끒",5,"ė™ėšė›"],["9861","ėėžėŸėĄ",6,"ėĒ",15],["9881","ėē",21,"ė‚’ė‚“ė‚•ė‚–ė‚—ė‚™",6,"ė‚ĸ낤ė‚Ļ",5,"ė‚Žė‚ąė‚˛ė‚ˇ",4,"ė‚žėƒ‚ėƒƒėƒ„ėƒ†ėƒ‡ėƒŠėƒ‹ėƒėƒŽėƒėƒ‘",6,"ėƒšėƒž",5,"ėƒĻėƒ§ėƒŠėƒĒėƒĢ냭",6,"ėƒļ냏ėƒē",5,"ė„ė„‚ė„ƒė„…ė„†ė„‡ė„‰",6,"넑넒넓넔넖",5,"ė„Ąė„ĸė„Ĩė„¨ė„Šė„Ēė„Ģė„Ž"],["9941","넞넺넴ė„ĩ넎ė„ēė„ģė„Ŋė„žė„ŋ녁",6,"ė…Šė…Ž",5,"ė…–ė…—"],["9961","ė…™ė…šė…›ė…",6,"ė…Ļė…Ē",5,"ė…ąė…˛ė…ŗė…ĩė…ļė…ˇė…šė…ēė…ģ"],["9981","ė…ŧ",8,"놆",5,"ė†ė†‘ė†’ė†“ė†•ė†—",4,"ė†žė† ė†ĸ놪놤ė†Ļ놧ė†Ēė†Ģė†­ė†Žė†¯ė†ą",11,"ė†ž",5,"ė‡…ė‡†ė‡‡ė‡‰ė‡Šė‡‹ė‡",6,"뇕뇖뇙",6,"ė‡Ąė‡ĸ뇪ė‡Ĩė‡Ļė‡§ė‡Š",6,"뇞뇴",7,"ė‡žė‡ŋėˆėˆ‚ėˆƒėˆ…",6,"ėˆŽėˆėˆ’",5,"ėˆšėˆ›ėˆėˆžėˆĄėˆĸ눪"],["9a41","눤ėˆĨėˆĻ눧ėˆĒėˆŦėˆŽėˆ°ėˆŗėˆĩ",16],["9a61","뉆뉇뉉",6,"뉒뉓뉕뉖뉗뉙",6,"ė‰Ąė‰ĸ뉪뉤ė‰Ļ"],["9a81","뉧",4,"ė‰Žė‰¯ė‰ąė‰˛ė‰ŗė‰ĩ",6,"ė‰žėŠ€ėŠ‚",5,"늊",5,"ėŠ‘",6,"ėŠ™ėŠšėŠœėŠž",5,"ėŠĻėŠ§ėŠŠėŠĒėŠĢėŠŽ",5,"ėŠļ늏ėŠē",33,"ė‹žė‹Ÿė‹Ąė‹ĸė‹Ĩ",5,"ė‹Žė‹°ė‹˛ė‹ŗė‹´ė‹ĩ닎ė‹ēė‹Ŋė‹žė‹ŋ댁",6,"ėŒŠėŒ‹ėŒŽėŒ"],["9b41","ėŒėŒ‘ėŒ’ėŒ–ėŒ—ėŒ™ėŒšėŒ›ėŒ",6,"ėŒĻ댧ėŒĒ",8],["9b61","댺",17,"ė†",7],["9b81","ėŽ",25,"ėĒėĢė­ėŽė¯ėąėŗ",4,"ėēėģėž",5,"ėŽ…ėŽ†ėŽ‡ėŽ‰ėŽŠėŽ‹ėŽ",50,"ė",22,"ėš"],["9c41","ė›ėėžėĄėŖ",4,"ėĒėĢėŦėŽ",5,"ėļėˇėš",5],["9c61","ėŋ",8,"됉",6,"됑",9],["9c81","됛",8,"ėĨ",6,"ė­ėŽė¯ėąė˛ėŗėĩ",6,"ėž",9,"둉",26,"ė‘Ļė‘§ė‘Šė‘Ēė‘Ģė‘­",6,"ė‘ļ둎둏ė‘ē",5,"뒁",18,"ė’•",6,"ė’",12],["9d41","ė’Ē",13,"ė’šė’ēė’ģė’Ŋ",8],["9d61","듆",25],["9d81","ė“ ",8,"ė“Ē",5,"듞듺ė“ĩė“ļė“ˇė“šė“ģė“ŧė“Ŋė“žė”‚",9,"ė”ė”Žė”ė”‘ė”’ė”“ė”•",6,"ė”",10,"ė”Ēė”Ģė”­ė”Žė”¯ė”ą",6,"ė”ēė”ŧė”ž",5,"ė•†ė•‡ė•‹ė•ė•ė•‘ė•’ė•–ė•šė•›ė•œė•Ÿė•ĸ땪ė•Ĩė•Ļė•§ė•Š",6,"땞ė•ļ",5,"ė•žė•ŋė–ė–‚ė–ƒė–…ė–†ė–ˆė–‰ė–Šė–‹ė–Žė–ė–’ė–“ė–”"],["9e41","ė––ė–™ė–šė–›ė–ė–žė–Ÿė–Ą",7,"ė–Ē",9,"ė–ļ"],["9e61","ė–ˇė–ēė–ŋ",4,"ė—‹ė—ė—ė—’ė—“ė—•ė—–ė——ė—™",6,"ė—ĸė—¤ė—Ļė—§"],["9e81","ė—¨ė—Šė—Ēė—Ģė—¯ė—ąė—˛ė—ŗė—ĩė—¸ė—šė—ēė—ģė˜‚ė˜ƒė˜„ė˜‰ė˜Šė˜‹ė˜ė˜Žė˜ė˜‘",6,"ė˜šė˜",6,"ė˜Ļė˜§ė˜Šė˜Ēė˜Ģė˜¯ė˜ąė˜˛ė˜ļ똏ė˜ēė˜ŧė˜Ŋė˜žė˜ŋė™‚ė™ƒė™…ė™†ė™‡ė™‰",6,"ė™’ė™–",5,"ė™žė™Ÿė™Ą",10,"ė™­ė™Žė™°ė™˛",5,"ė™ēė™ģė™Ŋė™žė™ŋ뚁",6,"ėšŠėšŒėšŽ",5,"ėš–ėš—ėš™ėššėš›ėš",6,"ėšĻ"],["9f41","뚍ėšĒ",5,"뚞뚺ėšĩėšļ뚎ėšģ",4,"뛂뛄뛆",5,"ė›Ž"],["9f61","ė›ė›‘ė›’ė›“ė›•",6,"ė›žė›Ÿė›ĸ",5,"ė›Ēė›Ģė›­ė›Žė›¯ė›ąė›˛"],["9f81","뛺",4,"ė›ēė›ģė›ŧė›ž",5,"ėœ†ėœ‡ėœ‰ėœŠėœ‹ėœ",6,"ėœ–ėœ˜ėœš",5,"ėœĸ뜪ėœĨėœĻėœ§ėœŠ",6,"뜞뜴ėœļėœ¸ėœšėœēėœģėœžėœŋėė‚ėƒė…",4,"ė‹ėŽėė™ėšė›ėėžėŸėĄ",6,"ėŠėĒėŦ",7,"ėļėˇėšėēėģėŋėž€ėžėž‚ėž†ėž‹ėžŒėžėžėž’ėž“ėž•ėž™ėž›",4,"ėžĸėž§",4,"ėžŽėž¯ėžąėž˛ėžŗėžĩėžļėžˇ"],["a041","ėž¸ėžšėžēėžģėžžėŸ‚",5,"ėŸŠėŸ‹ėŸėŸėŸ‘",6,"ėŸ™ėŸšėŸ›ėŸœ"],["a061","ėŸž",5,"ėŸĨėŸĻėŸ§ėŸŠėŸĒėŸĢ럭",13],["a081","ėŸģ",4,"ė ‚ė ƒė …ė †ė ‡ė ‰ė ‹",4,"렒렔렗",4,"ė žė Ÿė Ąė ĸė Ŗė Ĩ",6,"ė Žė °ė ˛",5,"ė šė ēė ģė Ŋė žė ŋėĄ",6,"ėĄŠėĄ‹ėĄŽ",5,"ėĄ•",26,"ėĄ˛ėĄŗėĄĩėĄļėĄˇėĄšėĄģ",4,"ėĸ‚ėĸ„ėĸˆėĸ‰ėĸŠėĸŽ",5,"ėĸ•",7,"ėĸžėĸ ėĸĸėĸŖėĸ¤"],["a141","ėĸĨėĸĻėĸ§ėĸŠ",18,"ėĸžėĸŋ몀몁"],["a161","ėŖ‚ėŖƒėŖ…ėŖ†ėŖ‡ėŖ‰ėŖŠėŖ‹ėŖ",6,"ėŖ–ėŖ˜ėŖš",5,"ėŖĸėŖŖėŖĨ"],["a181","ėŖĻ",14,"ėŖļ",5,"ėŖžėŖŋė¤ė¤‚ė¤ƒė¤‡",4,"ė¤Žã€€ã€ã€‚Âˇâ€Ĩâ€Ļ¨〃­―âˆĨīŧŧâˆŧ‘’“”〔〕〈",9,"ÂąÃ—Ãˇâ‰ â‰¤â‰Ĩâˆžâˆ´Â°â€˛â€ŗâ„ƒâ„Ģīŋ īŋĄīŋĨ♂♀∠âŠĨ⌒∂∇≡≒§â€ģâ˜†â˜…â—‹â—â—Žâ—‡â—†â–Ąâ– â–ŗâ–˛â–Ŋâ–ŧ→←↑↓↔〓â‰Ēâ‰Ģ√âˆŊ∝âˆĩâˆĢâˆŦ∈∋⊆⊇⊂⊃âˆĒ∊∧∨īŋĸ"],["a241","뤐뤒",5,"뤙",18],["a261","뤭",6,"ė¤ĩ",18],["a281","ėĨˆ",7,"ėĨ’ėĨ“ėĨ•ėĨ–ėĨ—ėĨ™",6,"ėĨĸėĨ¤",7,"ėĨ­ėĨŽėĨ¯â‡’⇔∀∃´īŊžË‡Ë˜ËËšË™Â¸Ë›ÂĄÂŋː∮∑∏¤℉‰◁◀▷â–ļ♤♠♡â™Ĩâ™§â™ŖâŠ™â—ˆâ–Ŗâ—â—‘â–’â–¤â–Ĩ▨▧â–Ļ▩♨☏☎☜☞Â↕↗↙↖↘♭♩â™Ēâ™Ŧã‰ŋ㈜№㏇â„ĸã‚ã˜â„Ąâ‚ŦÂŽ"],["a341","ėĨąėĨ˛ėĨŗėĨĩ",6,"ėĨŊ",10,"ėϊėĻ‹ėĻėĻŽėĻ"],["a361","ėĻ‘",6,"ėϚėϜėĻž",16],["a381","ėϝ",16,"ė§‚ė§ƒė§…ė§†ė§‰ė§‹",4,"ė§’ė§”ė§—ė§˜ė§›īŧ",58,"īŋĻīŧŊ",32,"īŋŖ"],["a441","ė§žė§Ÿė§Ąė§Ŗė§Ĩė§Ļė§¨ė§Šė§Ēė§Ģė§Žė§˛",5,"ė§ēė§ģė§Ŋė§žė§ŋė¨ė¨‚ė¨ƒė¨„"],["a461","ė¨…ė¨†ė¨‡ė¨Šė¨Ž",5,"덕덖덗덙",12],["a481","ė¨Ļ덧덍ė¨Ē",28,"ã„ą",93],["a541","ėŠ‡",4,"ėŠŽėŠėŠ‘ėŠ’ėŠ“ėŠ•",6,"ėŠžėŠĸ",5,"ėŠŠėŠĒ"],["a561","ėŠĢ",17,"ėŠž",5,"ėĒ…ėdž"],["a581","ėLJ",16,"ėĒ™",14,"ⅰ",9],["a5b0","Ⅰ",9],["a5c1","Α",16,"ÎŖ",6],["a5e1","Îą",16,"΃",6],["a641","ėǍ",19,"ėĒžėĒŋė́ėĢ‚ė̃ėĢ…"],["a661","ė̆",5,"ėĢŽė̐ėĢ’ėĢ”ėĢ•ėĢ–ėĢ—ė̚",5,"ėĢĄ",6],["a681","ė̍ėĢŠėĢĒėĢĢėĢ­",6,"ėĢĩ",18,"ėŦ‰ėŦŠâ”€â”‚┌┐┘└├â”Ŧ┤┴â”ŧâ”â”ƒâ”â”“â”›â”—â”Ŗâ”ŗâ”Ģâ”ģâ•‹â” â”¯â”¨â”ˇâ”ŋ┝┰â”Ĩ┸╂┒┑┚┙┖┕┎┍┞┟┡â”ĸâ”Ļ┧┩â”Ē┭┮┱┲â”ĩâ”ļ┹â”ēâ”Ŋ┾╀╁╃",7],["a741","ėŦ‹",4,"ėŦ‘ėŦ’ėŦ“ėŦ•ėŦ–ėŦ—ėŦ™",6,"ėŦĸ",7],["a761","ėŦĒ",22,"ė­‚ė­ƒė­„"],["a781","ė­…ė­†ė­‡ė­Šė­‹ė­ė­Žė­ė­‘",6,"ė­šė­›ė­œė­ž",5,"ė­Ĩ",7,"ãŽ•ãŽ–ãŽ—â„“ãŽ˜ã„ãŽŖãŽ¤ãŽĨãŽĻ㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"ãŽē",5,"㎐",4,"â„Ļ㏀㏁㎊㎋㎌㏖㏅㎭㎎㎯㏛㎊ãŽĒãŽĢãŽŦ㏝㏐㏓㏃㏉㏜㏆"],["a841","ė­­",10,"ė­ē",14],["a861","ėŽ‰",18,"ėŽ",6],["a881","ėŽ¤",19,"ėŽš",11,"ÆÐÂĒÄĻ"],["a8a6","IJ"],["a8a8","ÄŋŁØŒÂēÞÅĻŊ"],["a8b1","㉠",27,"ⓐ",25,"①",14,"ÂŊ⅓⅔Âŧ¾⅛⅜⅝⅞"],["a941","띅",14,"띕",10],["a961","ė¯ ė¯Ąė¯ĸ띪ė¯Ĩė¯Ļ띍ė¯Ē",18],["a981","ė¯Ŋ",14,"ė°Žė°ė°‘ė°’ė°“ė°•",6,"ė°žė°Ÿė° ė°Ŗė°¤ÃĻÄ‘Ã°Ä§ÄąÄŗÄ¸Å€Å‚Ã¸Å“ÃŸÃžÅ§Å‹Å‰ãˆ€",27,"⒜",25,"⑴",14,"ÂšÂ˛Âŗâ´âŋ₁₂₃₄"],["aa41","ė°Ĩė°Ļė°Ēė°Ģė°­ė°¯ė°ą",6,"ė°ēė°ŋ",4,"ėą†ėą‡ėą‰ėąŠėą‹ėąėąŽ"],["aa61","ėą",4,"ėą–ėąš",5,"ėąĄėąĸėąŖėąĨėą§ėąŠ",6,"ėąąėą˛"],["aa81","ėąŗėą´ėąļ",29,"ぁ",82],["ab41","ė˛”ė˛•ė˛–ė˛—ė˛šė˛›ė˛ė˛žė˛Ÿė˛Ą",6,"ė˛Ēė˛Ž",5,"ė˛ļė˛ˇė˛š"],["ab61","ė˛ēė˛ģė˛Ŋ",6,"ėŗ†ėŗˆėŗŠ",5,"ėŗ‘ėŗ’ėŗ“ėŗ•",5],["ab81","ėŗ›",8,"ėŗĨ",6,"ėŗ­ėŗŽėŗ¯ėŗą",12,"ã‚Ą",85],["ac41","ėŗžėŗŋ봀봂",5,"ė´Šė´‹ė´ė´Žė´ė´‘",6,"ė´šė´œė´žė´Ÿė´ "],["ac61","ė´Ąė´ĸė´Ŗė´Ĩė´Ļė´§ė´Šė´Ēė´Ģė´­",11,"ė´ē",4],["ac81","ė´ŋ",28,"ėĩėĩžėĩŸĐ",5,"ЁЖ",25],["acd1","а",5,"Ņ‘Đļ",25],["ad41","ėĩĄėĩĸėĩŖėĩĨ",6,"ėĩŽėĩ°ėĩ˛",5,"ėĩš",7],["ad61","ėļ",6,"ėļ‰",10,"ėļ–ėļ—ėļ™ėļšėļ›ėļėļžėļŸ"],["ad81","ėļ ėļĄėļĸėļŖėļĻėļ¨ėļĒ",5,"ėļą",18,"뎅"],["ae41","뎆",5,"ėˇėˇŽėˇėˇ‘",16],["ae61","ėˇĸ",5,"ėˇŠėˇĒėˇĢėˇ­ėˇŽėˇ¯ėˇą",6,"ėˇēėˇŧėˇž",4],["ae81","ė¸ƒė¸…ė¸†ė¸‡ė¸‰ė¸Šė¸‹ė¸",6,"ė¸•ė¸–ė¸—ė¸˜ė¸š",5,"ė¸ĸ돪ė¸Ĩė¸Ļė¸§ė¸Šė¸Ēė¸Ģ"],["af41","ė¸Ŧė¸­ė¸Žė¸¯ė¸˛ė¸´ė¸ļ",19],["af61","ėšŠ",13,"ėššėš›ėšėšžėšĸ",5,"ėšĒėšŦ"],["af81","ėšŽ",5,"ėšļėšˇėššėšēėšģėšŊ",6,"ėē†ėēˆėēŠ",5,"ėē’ėē“ėē•ėē–ėē—ėē™"],["b041","ėēš",5,"ėēĸėēĻ",5,"ėēŽ",12],["b061","ėēģ",5,"ėģ‚",19],["b081","ėģ–",13,"ėģĻėģ§ėģŠėģĒėģ­",6,"ėģļėģē",5,"가각간갇갈갉갊감",7,"같",4,"ę° ę°¤ę°Ŧę°­ę°¯ę°°ę°ąę°¸ę°šę°ŧ걀걋걍걔걘걜거걱건걷걸ęąē검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격ę˛Ēę˛Ŧę˛¯ę˛°ę˛¸ę˛šę˛ģę˛ŧę˛Ŋęŗęŗ„ęŗˆęŗŒęŗ•ęŗ—ęŗ ęŗĄęŗ¤ęŗ§ęŗ¨ęŗĒęŗŦęŗ¯ęŗ°ęŗąęŗŗęŗĩęŗļęŗŧęŗŊ관괄괆"],["b141","ėŧ‚ėŧƒėŧ…ėŧ†ėŧ‡ėŧ‰",6,"ėŧ’ėŧ”ėŧ–",5,"ėŧėŧžėŧŸėŧĄėŧĸėŧŖ"],["b161","ėŧĨ",6,"ėŧŽėŧ˛",5,"ėŧš",11],["b181","ėŊ…",14,"ėŊ–ėŊ—ėŊ™ėŊšėŊ›ėŊ",6,"ėŊĻėŊ¨ėŊĒėŊĢėŊŦ괌괍괏광괘괜괠괩ę´Ŧę´­ę´´ę´ĩę´¸ę´ŧęĩ„ęĩ…ęĩ‡ęĩ‰ęĩęĩ”ęĩ˜ęĩĄęĩŖęĩŦęĩ­ęĩ°ęĩŗęĩ´ęĩĩęĩļęĩģęĩŧęĩŊęĩŋęļęļ‚ęļˆęļ‰ęļŒęļęļœęļęļ¤ęļˇęˇ€ęˇęˇ„ęˇˆęˇęˇ‘ęˇ“ęˇœęˇ ęˇ¤ęˇ¸ęˇšęˇŧęˇŋ글긁금급긋긍긔기긱긴긷길ę¸ē김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡ęšĨꚨꚊęšŦꚰꚸ"],["b241","ėŊ­ėŊŽėŊ¯ėŊ˛ėŊŗėŊĩėŊļėŊˇėŊš",6,"ėžėž‚ėžƒėž„ėž†",5,"ėž"],["b261","ėžŽ",18,"ėžĸ",5,"ėžŠ"],["b281","ėžĒ",5,"ėžą",18,"ėŋ…",6,"ęššęšģęšŧęšŊęē„ęē…ęēŒęēŧęēŊęēžęģ€ęģ„ęģŒęģęģęģęģ‘ęģ˜ęģ™ęģœęģ¨ęģĢęģ­ęģ´ęģ¸ęģŧęŧ‡ęŧˆęŧęŧęŧŦęŧ­ęŧ°ęŧ˛ęŧ´ęŧŧęŧŊęŧŋęŊęŊ‚ęŊƒęŊˆęŊ‰ęŊęŊœęŊęŊ¤ęŊĨęŊšęž€ęž„ęžˆęžęž‘ęž•ęžœęž¸ęžšęžŧęŋ€ęŋ‡ęŋˆęŋ‰ęŋ‹ęŋęŋŽęŋ”ęŋœęŋ¨ęŋŠęŋ°ęŋąęŋ´ęŋ¸ë€€ë€ë€„뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"],["b341","ėŋŒ",19,"ėŋĸėŋŖėŋĨėŋĻėŋ§ėŋŠ"],["b361","ėŋĒ",5,"ėŋ˛ėŋ´ėŋļ",5,"ėŋŊėŋžėŋŋ퀁퀂퀃퀅",5],["b381","퀋",5,"퀒",5,"퀙",19,"끝ëŧëŊ낀낄낌낍낏낑나낙낚난낟날낡ë‚ĸ남납ë‚Ģ",4,"ë‚ąë‚ŗë‚´ë‚ĩ낸ë‚ŧ냄냅냇냈냉냐냑냔냘냠ëƒĨë„ˆë„‰ë„‹ë„Œë„ë„’ë„“ë„˜ë„™ë„›ë„œë„ë„Ŗë„¤ë„Ĩ넨ë„Ŧ넴ë„ĩ넷넸넹녀녁년녈념녑녔녕녘녜녠노녹ë…ŧ놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"],["b441","퀮",5,"í€ļ퀷퀹í€ēí€ģí€Ŋ",6,"큆큈큊",5],["b461","큑큒큓큕큖큗큙",6,"큥",10,"큎큯"],["b481","íąí˛íŗíĩ",6,"큞íŋ킀킂",18,"뇟뇨뇩ë‡Ŧ뇰뇹ë‡ģë‡Ŋ누눅눈눋눌눔눕눗눙눠눴ëˆŧ뉘뉜뉠뉨뉩뉴ë‰ĩë‰ŧëŠ„ëŠ…ëŠ‰ëŠëŠ‘ëŠ”ëŠ˜ëŠ™ëŠšëŠ ëŠĄëŠŖëŠĨëŠĻëŠĒëŠŦ늰늴니닉닌닐닒님닙닛닝ë‹ĸ다ë‹Ĩë‹Ļ단ë‹Ģ",4,"ë‹ŗë‹´ë‹ĩ닷",4,"ë‹ŋ대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤ëĨ"],["b541","킕",14,"í‚Ļ킧킩í‚Ēí‚Ģ킭",5],["b561","í‚ŗí‚ļ킸í‚ē",5,"탂탃탅탆탇탊",5,"탒탖",4],["b581","탛탞탟탡íƒĸíƒŖíƒĨ",6,"탎탲",5,"탚",11,"덧덊ëĢ덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨ëŽŦ도독돈돋돌돎돐돔돕돗동돛돝돠돤돨ëŧ됐되된될됨됩ëĢë´ë‘ë‘‘ë‘”ë‘˜ë‘ ë‘Ąë‘Ŗë‘Ĩë‘Ŧ뒀뒈뒝뒤뒨ë’Ŧë’ĩë’ˇë’šë“€ë“„ë“ˆë“ë“•ë“œë“ë“ ë“Ŗë“¤ë“Ļë“Ŧë“­ë“¯ë“ąë“¸ë””ë”•ë”˜ë”›ë”œë”¤ë”Ĩ딧딨딩ë”Ē따딱딴딸"],["b641","턅",7,"턎",17],["b661","턠",15,"í„˛í„ŗí„ĩí„ļ턷턹í„ģí„ŧí„Ŋ턾"],["b681","í„ŋ텂텆",5,"텎텏텑텒텓텕",6,"텞텠í…ĸ",5,"텩í…Ēí…Ģ텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨ë–Ēë–Ģë–°ë–ąë–ŗë–´ë–ĩë–ģë–ŧë–Ŋ뗀뗄뗌뗍뗏뗐뗑뗘ë—Ŧ또똑똔똘ë˜Ĩë˜Ŧ똴뙈뙤뙨뚜뚝뚠뚤ëšĢëšŦ뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩ëœŦ뜯뜰뜸뜚ëœģë„ëˆëŒë”ë•ë ë¤ë¨ë°ëąëŗëĩëŧëŊ란랄람랍랏랐랑랒랖랗"],["b741","텮",13,"í…Ŋ",6,"톅톆톇톉톊"],["b761","톋",20,"í†ĸí†Ŗí†Ĩí†Ļ톧"],["b781","톩",6,"톲톴í†ļ톷톸톹í†ģí†Ŋ톾í†ŋ퇁",14,"래랙랜랠램랩ëžĢëžŦ랭랴ëžĩ랸럇량ëŸŦ럭런럴ëŸŧëŸŊëŸŋ렀렁렇레렉렌렐렘렙렛렝려ë Ĩë ¨ë Ŧë ´ë ĩ렷렸령례롄롑롓로록론롤ëĄŦëĄ­ëĄ¯ëĄąëĄ¸ëĄŧëĸëĸ¨ëĸ°ëĸ´ëĸ¸ëŖ€ëŖëŖƒëŖ…ëŖŒëŖëŖ”ëŖëŖŸëŖĄëŖ¨ëŖŠëŖŦëŖ°ëŖ¸ëŖšëŖģëŖŊ뤄뤘뤠ë¤ŧë¤ŊëĨ€ëĨ„ëĨŒëĨëĨ‘ëĨ˜ëĨ™ëĨœëĨ ëĨ¨ëĨŠ"],["b841","퇐",7,"퇙",17],["b861","í‡Ģ",8,"í‡ĩí‡ļ퇷퇹",13],["b881","툈툊",5,"툑",24,"ëĨĢëĨ­ëĨ´ëĨĩëĨ¸ëĨŧëĻ„ëĻ…ëχëωëϊëĻëĻŽëĻŦëĻ­ëϰëĻ´ëĻŧëĻŊëĻŋ링마막만많",4,"ë§˜ë§™ë§›ë§ë§žë§Ąë§Ŗë§¤ë§Ĩ맨ë§Ŧë§´ë§ĩ맡맸맚ë§ē먀먁먈먕머먹ë¨ŧ멀멂멈멉멋멍멎멓메멕멘멜멤ëŠĨ늧늨늊늰늹늴늸ëǃëĒ„ëĒ…ëLJënjëǍëĒŠëĒĢëĒŦëǰëǞëǏëĒšëĒģëĒŊëĢ„ë̈ë̘ëĢ™ëĢŧ"],["b941","íˆĒíˆĢíˆŽíˆ¯íˆąíˆ˛íˆŗíˆĩ",6,"툾퉀퉂",5,"퉉퉊퉋퉌"],["b961","퉍",14,"퉝",6,"í‰Ĩí‰Ļ퉧퉨"],["b981","퉩",22,"튂튃튅튆튇튉튊튋튌ëŦ€ëŦ„ëŦëŦëŦ‘ëŦ˜ëŦœëŦ ëŦŠëŦĢëŦ´ëŦĩëŦļëŦ¸ëŦģëŦŧëŦŊëŦžë­„ë­…ë­‡ë­‰ë­ë­ë­ë­”ë­˜ë­Ąë­Ŗë­Ŧ뮈뮌뮐뮤뮨ëŽŦëŽ´ëŽˇë¯€ë¯„ë¯ˆë¯ë¯“ë¯¸ë¯šë¯ŧë¯ŋ밀밂밈밉밋밌밍및밑바",4,"받",4,"ë°¤ë°Ĩ밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"],["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡íŠĸíŠŖíŠĨ",6,"튭"],["ba61","íŠŽíŠ¯íŠ°íŠ˛",5,"íŠēíŠģíŠŊ튾틁틃",4,"틊틌",5],["ba81","틒틓틕틖틗틙틚틛틝",6,"í‹Ļ",9,"í‹˛í‹ŗí‹ĩí‹ļ틷틹í‹ēë˛™ë˛šë˛ ë˛Ąë˛¤ë˛§ë˛¨ë˛°ë˛ąë˛ŗë˛´ë˛ĩë˛ŧë˛Ŋëŗ€ëŗ„ëŗëŗëŗëŗ‘ëŗ•ëŗ˜ëŗœëŗ´ëŗĩëŗļëŗ¸ëŗŧ봄봅봇봉봐봔봤ë´Ŧëĩ€ëĩˆëĩ‰ëĩŒëĩëĩ˜ëĩ™ëĩ¤ëĩ¨ëļ€ëļëļ„ëļ‡ëļˆëļ‰ëļŠëļëļ‘ëļ“ëļ•ëļ™ëļšëļœëļ¤ëļ°ëļ¸ëˇ”ëˇ•ëˇ˜ëˇœëˇŠëˇ°ëˇ´ëˇ¸ë¸€ë¸ƒë¸…ë¸Œë¸ë¸ë¸”ë¸œë¸ë¸Ÿëš„ëš…ëšˆëšŒëšŽëš”ëš•ëš—ëš™ëššëš›ëš ëšĄëš¤"],["bb41","í‹ģ",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞íŒĸíŒŖ"],["bb61","팤íŒĻ팧íŒĒíŒĢíŒ­íŒŽíŒ¯íŒą",6,"íŒē팾",5,"퍆퍇퍈퍉"],["bb81","퍊",31,"뚨ëšĒëš°ëšąëšŗëš´ëšĩëšģëšŧëšŊëē€ëē„ëēŒëēëēëēëē‘ëē˜ëē™ëē¨ëģëģ‘ëģ”ëģ—ëģ˜ëģ ëģŖëģ¤ëģĨëģŦëŧëŧˆëŧ‰ëŧ˜ëŧ™ëŧ›ëŧœëŧëŊ€ëŊëŊ„ëŊˆëŊëŊ‘ëŊ•랔랰ëŋ…ëŋŒëŋëŋëŋ”ëŋœëŋŸëŋĄė€ŧė‘ė˜ėœė ė¨ėŠė‚ė‚‘ė‚”ė‚˜ė‚ ė‚Ąė‚Ŗė‚Ĩė‚Ŧ낭낝낰낺내ė‚ĩė‚ļė‚ŧė‚Ŋė‚ŋėƒ€ėƒėƒ…ėƒˆėƒ‰ėƒŒėƒėƒ˜ėƒ™ėƒ›ėƒœėƒėƒ¤"],["bc41","íĒ",17,"퍞íŋ펁펂펃펅펆펇"],["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"íŽĒíŽŦ펮"],["bc81","펯",4,"íŽĩíŽļ펷펹íŽēíŽģíŽŊ",6,"폆폇폊",5,"폑",5,"ėƒĨ냍ėƒŦ냴ėƒĩėƒˇėƒšė„€ė„„ė„ˆė„ė„•ė„œ",4,"넪네ė„Ļė„§ė„Ŧė„­ė„¯ė„°ė„ąė„ļė„¸ė„šė„ŧė…€ė…ˆė…‰ė…‹ė…Œė…ė…”ė…•ė…˜ė…œė…¤ė…Ĩė…§ė…¨ė…Šė…°ė…´ė…¸ė†…ė†Œė†ė†Žė†ė†”ė†–ė†œė†ė†Ÿė†Ąė†Ĩė†¨ė†Šė†Ŧ놰ė†Ŋė‡„ė‡ˆė‡Œė‡”ė‡—ė‡˜ė‡ ė‡¤ė‡¨ė‡°ė‡ąė‡ŗė‡ŧė‡Ŋėˆ€ėˆ„ėˆŒėˆėˆėˆ‘ėˆ˜ėˆ™ėˆœėˆŸėˆ ėˆ¨ėˆŠėˆĢ눭"],["bd41","폗폙",7,"íĸ폤",7,"íŽí¯íąí˛íŗíĩíļ폷"],["bd61","폸폚íēíģ폾퐀퐂",5,"퐉",13],["bd81","퐗",5,"퐞",25,"ėˆ¯ėˆąėˆ˛ėˆ´ė‰ˆė‰ė‰‘ė‰”ė‰˜ė‰ ė‰Ĩė‰Ŧ뉭뉰뉴ė‰ŧė‰Ŋė‰ŋėŠėŠˆėŠ‰ėŠėŠ˜ėŠ›ėŠėŠ¤ėŠĨ늍ėŠŦ늭늴ėŠĩėŠˇėŠšė‹œė‹ė‹ ė‹Ŗė‹¤ė‹Ģė‹Ŧė‹­ė‹¯ė‹ąė‹ļė‹¸ė‹šė‹ģė‹ŧėŒ€ėŒˆėŒ‰ėŒŒėŒėŒ“ėŒ”ėŒ•ėŒ˜ėŒœėŒ¤ėŒĨėŒ¨ėŒŠė…ė¨ėŠėŦė°ė˛ė¸ėšėŧėŊėŽ„ėŽˆėŽŒė€ė˜ė™ėœėŸė ėĸė¨ėŠė­ė´ėĩė¸ėˆėė¤ėŦ됰"],["be41","퐸",7,"푁푂푃푅",14],["be61","푔",7,"푝푞푟푡í‘ĸí‘Ŗí‘Ĩ",7,"푮푰푱푲"],["be81","í‘ŗ",4,"í‘ēí‘ģí‘Ŋ푾풁풃",4,"풊풌풎",5,"풕",8,"됴ėŧėŊė‘ˆė‘¤ė‘Ĩ둍ė‘Ŧė‘´ė‘ĩė‘šė’€ė’”ė’œė’¸ė’ŧė“Šė“°ė“ąė“´ė“¸ė“ēė“ŋė”€ė”ė”Œė”ė””ė”œė”¨ė”Šė”Ŧė”°ė”¸ė”šė”ģė”Ŋė•„ė•…ė•ˆė•‰ė•Šė•Œė•ė•Žė•“ė•”ė••ė•—ė•˜ė•™ė•ė•žė• ė•Ąė•¤ė•¨ė•°ė•ąė•ŗė•´ė•ĩė•ŧė•Ŋė–€ė–„ė–‡ė–Œė–ė–ė–‘ė–•ė–—ė–˜ė–œė– ė–Šė–´ė–ĩė–¸ė–šė–ģė–ŧė–Ŋė–žė—„",6,"ė—Œė—Ž"],["bf41","풞",10,"í’Ē",14],["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"],["bf81","퓖",5,"퓝퓞퓠",7,"퓩í“Ēí“Ģí“­í“Ží“¯í“ą",6,"퓹í“ēí“ŧė—ė—‘ė—”ė—˜ė— ė—Ąė—Ŗė—Ĩė—Ŧė—­ė—Žė—°ė—´ė—ļė—ˇė—ŧ",5,"ė˜…ė˜†ė˜‡ė˜ˆė˜Œė˜ė˜˜ė˜™ė˜›ė˜œė˜¤ė˜Ĩ똍ė˜Ŧė˜­ė˜Žė˜°ė˜ŗė˜´ė˜ĩė˜ˇė˜šė˜ģė™€ė™ė™„ė™ˆė™ė™‘ė™“ė™”ė™•ė™œė™ė™ ė™Ŧė™¯ė™ąė™¸ė™šė™ŧėš€ėšˆėš‰ėš‹ėšėš”ėš•ėš˜ėšœėš¤ėšĨėš§ėšŠėš°ėšąėš´ėš¸ėššėšēė›€ė›ė›ƒė›…ė›Œė›ė›ė›”ė›œė›ė› ė›Ąė›¨"],["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5],["c061","픞",25],["c081","픸픹í”ēí”ģ픾í”ŋ핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡í•ĸí•Ŗė›Šė›Ŧė›°ė›¸ė›šė›Ŋėœ„ėœ…ėœˆėœŒėœ”ėœ•ėœ—ėœ™ėœ ėœĄėœ¤ėœ¨ėœ°ėœąėœŗėœĩ뜎ėœŧėœŊė€ė„ėŠėŒėėė‘",7,"ėœė ė¨ėĢė´ėĩė¸ėŧėŊėžėžƒėž„ėž…ėž‡ėžˆėž‰ėžŠėžŽėžėž‘ėž”ėž–ėž—ėž˜ėžšėž ėžĄėžŖėž¤ėžĨėžĻėžŦėž­ėž°ėž´ėžŧėžŊėžŋėŸ€ėŸėŸˆėŸ‰ėŸŒėŸŽėŸėŸ˜ėŸėŸ¤ėŸ¨ėŸŦė €ė ė „ė ˆė Š"],["c141","핤í•Ļ핧í•Ēí•Ŧ핮",5,"í•ļ핷핹í•ēí•ģí•Ŋ",6,"햆햊햋"],["c161","햌햍햎햏햑",19,"í–Ļ햧"],["c181","햨",31,"ė ė ‘ė “ė •ė –ė œė ė  ė ¤ė Ŧė ­ė ¯ė ąė ¸ė ŧėĄ€ėĄˆėĄ‰ėĄŒėĄėĄ”ėĄ°ėĄąėĄ´ėĄ¸ėĄēėĸ€ėĸėĸƒėĸ…ėĸ†ėĸ‡ėĸ‹ėĸŒėĸėĸ”ėĸėĸŸėĸĄėĸ¨ėĸŧėĸŊėŖ„ėŖˆėŖŒėŖ”ėŖ•ėŖ—ėŖ™ėŖ ėŖĄėŖ¤ėŖĩėŖŧėŖŊė¤€ė¤„ė¤…ė¤†ė¤Œė¤ė¤ė¤‘ė¤˜ė¤Ŧ뤴ėĨėĨ‘ėĨ”ėĨ˜ėĨ ėĨĄėĨŖėĨŦėĨ°ėĨ´ėĨŧėψėωėόėϐėϘėĻ™ėĻ›ėĻė§€ė§ė§„ė§‡ė§ˆė§Šė§ė§‘ė§“"],["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"í—Ļ헧헩í—Ēí—Ģ헭헮"],["c261","헯",4,"í—ļ헸í—ē",5,"혂혃혅혆혇혉",6,"혒"],["c281","혖",5,"혝혞혟혡í˜ĸí˜Ŗí˜Ĩ",7,"혎",9,"í˜ēí˜ģė§•ė§–ė§™ė§šė§œė§ė§ ė§ĸ매맧ė§Ŧė§­ė§¯ė§°ė§ąė§¸ė§šė§ŧė¨€ė¨ˆė¨‰ė¨‹ė¨Œė¨ė¨”ė¨˜ė¨ŠėŠŒėŠėŠėŠ”ėŠœėŠėŠŸėŠ ėŠĄėŠ¨ėŠŊėĒ„ėǘėĒŧėĒŊėĢ€ėĢ„ė̌ėĢėĢėĢ‘ėĢ“ė̘ėĢ™ėĢ ėĢŦėĢ´ėŦˆėŦėŦ”ėŦ˜ėŦ ėŦĄė­ė­ˆė­‰ė­Œė­ė­˜ė­™ė­ė­¤ė­¸ė­šėŽœėŽ¸ė¯”ė¯¤ė¯§ė¯Šė°Œė°ė°ė°”ė°œė°ė°Ąė°ĸė°§ė°¨ė°Šė°Ŧė°Žė°°ė°¸ė°šė°ģ"],["c341","í˜Ŋ혞í˜ŋ홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4],["c361","í™ĸ",4,"홨í™Ē",5,"í™˛í™ŗí™ĩ",11],["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠íšĸ",5,"횩íšĒė°ŧė°Ŋė°žėą„ėą…ėąˆėąŒėą”ėą•ėą—ėą˜ėą™ėą ėą¤ėąĻėą¨ėą°ėąĩė˛˜ė˛™ė˛œė˛ ė˛¨ė˛Šė˛Ģė˛Ŧ랭랴ė˛ĩ랏ė˛ŧ뺄뺅뺇뺉뺐뺔뺤ėŗŦėŗ°ė´ė´ˆė´‰ė´Œė´ė´˜ė´™ė´›ė´ė´¤ė´¨ė´Ŧė´šėĩœėĩ ėĩ¤ėĩŦėĩ­ėĩ¯ėĩąėĩ¸ėļˆėļ”ėļ•ėļ˜ėļœėļ¤ėļĨėļ§ėļŠėļ°ėˇ„ėˇŒėˇėˇ¨ėˇŦėˇ°ėˇ¸ėˇšėˇģėˇŊė¸„ė¸ˆė¸Œė¸”ė¸™ė¸ ė¸Ąė¸¤ė¸¨ė¸°ė¸ąė¸ŗė¸ĩ"],["c441","íšĢíš­íšŽíš¯íšą",7,"íšēíšŧ",7,"훆훇훉훊훋"],["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡í›ĸí›Ŗí›Ĩí›Ļ훧훩",4],["c481","í›Ží›¯í›ąí›˛í›ŗí›´í›ļ",5,"훾í›ŋ휁휂휃휅",11,"íœ’íœ“íœ”ėš˜ėš™ėšœėšŸėš ėšĄėš¨ėšŠėšĢėš­ėš´ėšĩėš¸ėšŧėē„ėē…ėē‡ėē‰ėēėē‘ėē”ėē˜ėē ėēĄėēŖėē¤ėēĨėēŦėē­ėģėģ¤ėģĨėģ¨ėģĢėģŦėģ´ėģĩėģˇėģ¸ėģšėŧ€ėŧėŧ„ėŧˆėŧėŧ‘ėŧ“ėŧ•ėŧœėŧ ėŧ¤ėŧŦėŧ­ėŧ¯ėŧ°ėŧąėŧ¸ėŊ”ėŊ•ėŊ˜ėŊœėŊ¤ėŊĨėŊ§ėŊŠėŊ°ėŊąėŊ´ėŊ¸ėž€ėž…ėžŒėžĄėž¨ėž°ėŋ„ėŋ ėŋĄėŋ¤ėŋ¨ėŋ°ėŋąėŋŗėŋĩėŋŧ퀀퀄퀑퀘퀭퀴í€ĩ퀸í€ŧ"],["c541","휕휖휗휚휛휝휞휟휡",6,"íœĒíœŦ휮",5,"íœļ휷휹"],["c561","íœēíœģíœŊ",6,"흅흆흈흊",5,"흒흓흕흚",4],["c581","흟íĸ흤íĻ흧흨íĒíĢí­íŽí¯íąí˛íŗíĩ",6,"흞íŋ힀힂",5,"힊힋큄큅큇큉큐큔큘큠íŦ큭큰클íŧíŊ킁키í‚Ĩ킨í‚Ŧ킴í‚ĩ킷킹타탁탄탈탉탐탑탓탔탕태택탠탤íƒŦíƒ­íƒ¯íƒ°íƒąíƒ¸í„í„°í„ąí„´í„¸í„ē텀텁텃텄텅테텍텐텔템텝텟텡텨í…Ŧí…ŧí†„í†ˆí† í†Ąí†¤í†¨í†°í†ąí†ŗí†ĩí†ēí†ŧ퇀퇘퇴퇸툇툉툐íˆŦ툭툰툴íˆŧíˆŊíˆŋ퉁퉈퉜"],["c641","힍힎힏힑",6,"힚힜힞",5],["c6a1","퉤튀튁튄튈튐튑튕튜튠튤íŠŦ튱트특íŠŧíŠŋ틀틂틈틉틋틔틘틜틤í‹Ĩ티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡íŒĨ패팩íŒŦ팰팸팹íŒģíŒŧíŒŊ퍄퍅íŧíŊ펀펄펌펍펏펐펑페펙펜펠펨펩íŽĢ펭펴편íŽŧí„í…íˆí‰íí˜íĄíŖíŦ폭폰폴íŧíŊíŋ퐁"],["c7a1","퐈퐝푀푄표푠푤푭푯푸푚í‘ŧí‘ŋ풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨í“Ŧ퓰퓸í“ģí“Ŋ프픈플픔픕픗í”ŧí”Ŋ핀필핌핍핏핑하학한할í•Ĩ함합í•Ģ항해í•ĩ핸í•ŧ햄햅햇했행햐í–Ĩ허헉헌헐헒험헙헛헝헤í—Ĩ헨í—Ŧ헴í—ĩ헷헹혀혁현혈혐협혓혔형혜혠"],["c8a1","혤혭호혚í˜ŧ홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효íšŦ횰횹íšģ후훅훈훌훑훔훗훙훠훤훨훰í›ĩí›ŧí›Ŋ휀휄휑휘휙휜휠휨휩íœĢ휭휴íœĩ휸íœŧí„í‡í‰íí‘í”í–í—í˜í™í íĄíŖíĨ흊íŦ흰흴íŧíŊ힁히힉힌힐힘힙힛힝"],["caa1","äŧŊäŊŗå‡åƒšåŠ å¯å‘ĩå“Ĩ嘉ǻåŽļ暇æžļæžˇæŸ¯æ­Œį‚į—‚į¨ŧ苛茄街čĸˆč¨ļčŗˆčˇčģģčŋĻ駕åˆģ却各æĒ慤æŽŧįč„ščĻēč§’é–ŖäžƒåˆŠåĸžåĨ¸å§Ļåš˛åššæ‡‡æ€æ†æŸŦæĄŋæž—į™Žįœ‹įŖĩፈįĢŋį°Ąč‚č‰Žč‰ąčĢĢ間äšĢå–æ›ˇæ¸´įĸŖįĢ­č‘›č¤čŽéž¨å‹˜åŽå ĒåĩŒæ„Ÿæ†žæˆĄæ•ĸæŸ‘æŠ„æ¸›į”˜į–ŗį›Ŗįž°į´ē邯鑑鑒鞕"],["cba1","匪å˛Ŧį”˛čƒ›é‰€é–˜å‰›å ˆå§œå˛Ąå´—åēˇåŧēåŊŠæ…ˇæąŸį•ēᖆẠįĩŗįļąįžŒč…”čˆĄč–‘čĨčŦ›é‹ŧ降鱇äģ‹äģˇå€‹å‡ąåĄæ„ˇæ„žæ…¨æ”šæ§Ēæŧ‘į–Ĩįš†į›–įŽ‡čŠĨč“‹ī¤€éŽ§é–‹å–€åŽĸå‘ī¤į˛ŗįžšé†ĩ倨åŽģåą…åˇ¨æ‹’æŽæ“šæ“§æ¸ į‚ŦįĨ›čˇč¸žī¤‚éŊ鉅鋸乾äģļåĨåˇžåģēæ„†æĨ—腹虔蚇éĩé¨Ģäšžå‚‘æ°æĄ€å„‰åŠåŠ’æĒĸ"],["cca1","įžŧ鈐éģ”åŠĢ怯čŋ˛åˆæ†Šæ­æ“Šæ ŧæĒ„æŋ€č†ˆčĻĄéš”å …į‰ŊįŠŦᔄįĩšįš­č‚Ščϋ譴遪éĩ‘抉æąēæŊ”įĩįŧē荪å…ŧæ…ŠįŽčŦ™é‰—鎌äēŦäŋ“倞傞儆勁勍åŋ坰åĸƒåēšåž‘æ…ᅥŦ擎æ•Ŧ景æšģ更æĸ—æļ‡į‚…įƒąį’Ÿį’Ĩį“Šį—™įĄŦįŖŦį̟įĢļįĩ…įļ“耕č€ŋ脛莖č­Ļčŧ•é€•éĄé ƒé ¸éК靍äŋ‚å•“å ēåĨ‘å­Ŗåą†æ‚¸æˆ’æĄ‚æĸ°"],["cda1","æŖ¨æēĒį•Œį™¸įŖŽį¨ŊįŗģįšĢįšŧ計čĒĄč°ŋéšŽéˇ„å¤åŠå‘Šå‘ąå›ē姑孤å°ģåēĢæ‹ˇæ”ˇæ•…æ•˛æš æž¯æ§æ˛Ŋį—ŧįšįžį¨ŋįž”č€ƒč‚Ąč†č‹Ļč‹Ŋ菰藁蠱čĸ´čĒĨī¤ƒčžœéŒŽé›‡éĄ§é̘éŧ“å“­æ–›æ›˛æĸįЀ谎éĩ å›°å¤å´‘昆æĸąæŖæģžį¨čĸžé¯¤æą¨ī¤„éĒ¨äž›å…Ŧå…ąåŠŸå­”åˇĨææ­æ‹ąæŽ§æ”ģį™įŠē蚪č˛ĸéžä¸˛å¯Ąæˆˆæžœį“œ"],["cea1","į§‘č“čLJčĒ˛čˇ¨éŽé‹éĄ†å쓿§¨č—ŋéƒ­ī¤…å† åŽ˜å¯Ŧæ…ŖæŖēæŦžįŒį¯į“˜įŽĄįŊč…č§€č˛Ģ關館刎恝æ‹Ŧé€‚äžŠå…‰åŒĄåŖ™åģŖæ› æ´¸į‚šį‹‚į–į­čƒąé‘›åĻ掛įŊĢäš–å‚€åĄŠåŖžæ€Ēæ„§æ‹æ§é­åŽį´˜č‚ąčŊŸäē¤åƒ‘å’Ŧå–ŦåŦŒåļ åˇ§æ”Ēæ•Žæ ĄæŠ‹į‹ĄįšŽįŸ¯įĩžįŋšč† č•Žč›ŸčŧƒčŊŽéƒŠé¤ƒéŠ•éŽĢ丘久九äģ‡äŋąå…ˇå‹ž"],["cfa1","å€åŖåĨ咎嘔åĩåžĸ寇åļ‡å쐿‡ŧ拘救枸柊構歐毆æ¯Ŧæą‚æēį¸į‹—įŽ–įƒįžŋįŸŠįŠļįĩŋ耉č‡ŧ舅舊苟čĄĸčŦŗčŗŧčģ€é€‘邹鉤éŠļé§’éŠ…éŗŠéˇ—éžœåœ‹åą€čŠéž éžĢéē´å›įĒ˜įž¤čŖ™čģéƒĄå €åąˆæŽ˜įĒŸåŽŽåŧ“įŠšįĒŽčŠŽčēŦå€Ļåˆ¸å‹¸åˇåœˆæ‹ŗæ˛æŦŠæˇƒįœˇåŽĨį—č•¨čšļ闕æœēæĢƒæŊ°čŠ­čģŒéĨ‹ī¤†æ™ˇæ­¸č˛´"],["d0a1","éŦŧåĢ圭åĨŽæ†æ§ģįĒįĄ…įĒēįĢ…įŗžč‘ĩčĻčĩŗé€ĩ閨å‹ģå‡į•‡į­ čŒéˆžī¤ˆæŠ˜å…‹å‰‹åŠ‡æˆŸæŖ˜æĨĩ隙僅劤勤懃斤栚æ§ŋį‘žį­‹čŠščĢčϞčŦščŋ‘éĨ‰ī¤‰äģŠåĻ—æ“’æ˜‘æĒŽį´įρįĻŊ芩衾čĄŋčĨŸī¤ŠéŒĻäŧ‹åŠæ€Ĩæ‰ąæą˛į´šįĩĻäē˜å…ĸįŸœč‚¯äŧäŧŽå…ļ冀嗜器åœģåŸēåŸŧ夔åĨ‡åĻ“å¯„å˛å´ŽåˇąåšžåŋŒæŠ€æ——æ—Ŗ"],["d1a1","æœžæœŸæžæŖ‹æŖ„æŠŸæŦēæ°ŖæąŊæ˛‚æˇ‡įŽ˜įĻįĒᒂᒪᕏį•ŋįĸįŖ¯įĨįĨ‡įĨˆįĨēįŽ•į´€įļēįžˆč€†č€­č‚Œč¨˜č­čąˆčĩˇéŒĄéŒ¤éŖĸéĨ‘騎騏éŠĨéē’įˇŠäŊļå‰æ‹ŽæĄ”é‡‘å–Ģå„ēī¤‹ī¤Œå¨œæ‡Ļī¤æ‹æ‹ŋī¤Ž",5,"邪",4,"čĢžī¤™ī¤šī¤›ī¤œæš–ī¤į…–ī¤žī¤Ÿé›Ŗī¤ ææēå—ī¤ĄæžæĨ æšŗī¤ĸᔎī¤Ĩ"],["d2a1","į´ī¤Ļī¤§čĄ˛å›Šå¨˜ī¤¨",4,"äšƒī¤­å…§åĨˆæŸ°č€ī¤ŽåĨŗåš´æ’šį§ŠåŋĩæŦ拈æģ寧寗åŠĒåĨ´åŧŠæ€’ī¤°ī¤ąī¤˛į‘™ī¤ŗ",5,"é§‘ī¤š",10,"æŋƒīĨ„īĨ…č†ŋčž˛æƒąīĨ†īĨ‡č…ĻīĨˆīĨ‰å°ŋīĨŠ",7,"åĢŠč¨ĨæģᴐīĨ’",5,"čƒŊīĨ˜īĨ™å°ŧæŗĨåŒŋæēē多čŒļ"],["d3a1","业äēļäŊ†å–Žåœ˜åŖ‡åŊ–æ–ˇæ—ϿǀæŽĩæšįŸ­įĢ¯į°žįˇžč›‹čĸ’é„˛é›æ’ģæžžįēį–¸é”å•–åæ†ēæ“”æ›‡æˇĄæš›æŊ­æžšį—°čƒč†Ŋ蕁čσčĢ‡č­šéŒŸæ˛“į•“į­”č¸éå”å ‚åĄ˜åšĸæˆ‡æ’žæŖ į•ļįŗ–čžŗéģ¨äģŖåžˆåŽå¤§å°å˛ąå¸ļåž…æˆ´æ“ĄįŽŗč‡ēčĸ‹č˛¸éšŠéģ›åŽ…åžˇæ‚ŗå€’åˆ€åˆ°åœ–å ĩåĄ—å°Žåą åŗļåļ‹åēĻåž’æ‚ŧæŒ‘æŽ‰æ—æĄƒ"],["d4a1","æŖšæĢ‚æˇ˜æ¸Ąæģ”æŋ¤į‡žį›œįšįĻąį¨ģ萄čĻŠčŗ­čˇŗčšˆé€ƒé€”é“éƒŊ鍍é™ļéŸœæ¯’į€†į‰˜įŠĸį¨įŖįĻŋᝤįē›čŽ€åĸŠæƒ‡æ•Ļæ—Ŋæšžæ˛Œį„žį‡‰čąšé “äš­įǁäģå†Ŧå‡å‹•åŒæ†§æąæĄæŖŸæ´žæŊŧį–ŧįžŗįĢĨčƒ´č‘ŖéŠ…å…œæ–—æœæž“į—˜įĢ‡čŗīĨščą†é€—é ­åą¯č‡€čŠšéé¯éˆåž—åļæŠ™į‡ˆį™ģᭉ藤čŦ„鄧騰喇æ‡ļīĨ›į™Šįž…"],["d5a1","č˜ŋčžēčŖ¸é‚īĨœæ´›įƒ™įžįĩĄčŊīĨé…Ēé§ąīĨžäē‚åĩæŦ„æŦ’į€žįˆ›č˜­é¸žå‰ŒčžŖåĩæ“Ĩæ”ŦæŦ–æŋĢįąƒįēœč—čĨ¤čĻŊæ‹‰č‡˜č Ÿå슿œ—æĩĒį‹ŧį…į‘¯čž‚éƒžäž†å´åž čŠå†ˇæŽ į•ĨäēŽå€†å…Šå‡‰æĸæ¨‘į˛Žį˛ąįŗ§č‰¯čĢ’čŧ›é‡äžļ儎å‹ĩ呂åģŦ慎戞旅æĢšæŋžį¤Ēč—œč Ŗé–­éŠĸéŠĒéē—éģŽåŠ›æ›†æ­ˇį€į¤ĢčŊĸé‚æ†æˆ€æ”ŖæŧŖ"],["d6a1","į…‰į’‰įˇ´č¯č“ŽčŧĻé€ŖéŠå†Ŋåˆ—åŠŖæ´ŒįƒˆčŖ‚å쉿–‚掎æŋ‚į°žįĩäģ¤äŧļ囚īĨŸå˛ēåļ翀œįޞįŦ­įžšįŋŽč†é€žéˆ´é›ļ靈領éŊĄäž‹æž§įĻŽé†´éšˇå‹žīĨ æ’ˆæ“„æĢ“æŊžį€˜įˆį›§č€č˜†č™œčˇ¯čŧ…éœ˛é­¯éˇēéšĩįĸŒįĨŋįļ č‰éŒ„éšŋéē“čĢ–åŖŸåŧ„æœ§į€§į“įą čžå„Ąį€¨į‰ĸįŖŠčŗ‚čŗščŗ´é›ˇäē†åƒšå¯Žåģ–æ–™į‡Žį™‚įž­čŠč“ŧ"],["d7a1","éŧéŦ§éžåŖ˜åЁåąĸæ¨“æˇšæŧį˜ģį´¯į¸ˇč”žč¤¸é¤é™‹åŠ‰æ—’æŸŗæĻ´æĩæēœį€į‰į‘ į•™į˜¤įĄĢčŦŦéĄžå…­æˆŽé™¸äž–å€Ģ崙æˇĒįļ¸čŧĒ型慄栗īĨĄéš†å‹’č‚‹å‡œå‡ŒæĨžį¨œįļžčąé™ĩäŋšåˆŠåŽ˜åå”ŽåąĨ悧李æĸ¨æĩŦįŠį‹¸į†į’ƒīĨĸį—ĸįąŦįŊšįž¸čŽ‰čŖčŖĄé‡Œé‡é›ĸ鯉吝æŊžį‡į’˜č—ēčēĒéšŖéą—é矿ž—æˇ‹įŗč‡¨éœ–į Ŧ"],["d8a1","įĢ‹įŦ į˛’摊į‘Ēį—˛įĸŧįŖ¨éĻŦ魔éēģ寞嚕æŧ č†œčŽĢé‚ˆä¸‡åå¨Šåˇ’åŊŽæ…ĸæŒŊ晊æ›ŧæģŋæŧĢįŖįžžčŦ蔓č ģčŧ“éĨ…é°ģ唜抚æœĢæ˛Ģ茉čĨĒéēäēĄåĻ„åŋ˜åŋ™æœ›įļ˛įŊ”芒čŒĢčŽŊčŧžé‚™åŸ‹åĻšåĒ’å¯æ˜§æžšæĸ…æ¯į…¤įŊĩč˛ˇčŗŖé‚é­…č„ˆč˛Šé™ŒéŠ€éēĨå­Ÿæ°“įŒ›į›˛į›ŸčŒå†ĒčĻ“å…å†•å‹‰æŖ‰æ˛”įœ„įœ įļŋįˇŦéĸéēĩæģ…"],["d9a1","蔑å†Ĩ名å‘Ŋ明暝椧æēŸįšŋįž‘čŒ—č“‚čžŸé…ŠéŠ˜éŗ´čĸ‚䞎冒募姆å¸Ŋæ…•æ‘¸æ‘šæšŽæŸæ¨Ąæ¯æ¯›į‰Ÿį‰Ąį‘įœ¸įŸ›č€—čŠŧ茅čŦ€čŦ¨č˛Œæœ¨æ˛į‰§į›ŽįĻįŠ†éļŠæ­ŋæ˛’å¤ĸæœĻč’™å¯åĸ“åĻ™å쟿æ˜´æŗæ¸ēįŒĢįĢ—č‹—éŒ¨å‹™åˇĢ憎懋戊拇æ’Ģ无æĨ™æ­Ļæ¯‹į„Ąįˇį•įš†čˆžčŒ‚č•ĒčĒŖč˛ŋ霧éĩĄåĸ¨éģ˜å€‘刎åģ問文"],["daa1","æąļį´Šį´‹čžčšŠé–€é›¯å‹ŋæ˛•į‰Šå‘ŗåĒšå°žåĩ‹åŊŒåžŽæœĒæĸļæĨŖæ¸ŧæš„įœ‰įąŗįžŽč–‡čŦŽčŋˇéĄéģ´å˛ˇæ‚ļ愍æ†Ģ敏æ—ģæ—ŧæ°‘æŗ¯įŽŸį‰įˇĄé–”å¯†čœœčŦå‰åšæ‹ææ’˛æœ´æ¨¸æŗŠį€į’žįŽ”į˛•į¸›č†Ščˆļ薄čŋĢ雹駁äŧ´åŠåå›æ‹ŒæŦæ”€æ–‘æ§ƒæŗŽæŊ˜į­į•”į˜ĸᛤį›ŧ᪐įŖģį¤Ŧįĩ†čˆŦ蟠čŋ”é ’éŖ¯å‹ƒæ‹”æ’Ĩ渤æŊ‘"],["dba1","į™ŧ跋醱é‰ĸéĢŽé­ƒå€Ŗå‚åŠåĻ¨å°¨åš‡åŊˇæˆŋ攞斚旁昉枋æĻœæģ‚įŖ…į´Ąč‚Ē膀čˆĢčŠŗč’ĄčšŒč¨ĒčŦ—é‚Ļé˜˛éžå€äŋŗīĨŖåŸšåž˜æ‹œæŽ’æ¯æšƒį„™į›ƒčƒŒčƒščŖ´čŖĩ褙躠čŧŠé…é™Ēäŧ¯äŊ°å¸›æŸæ ĸį™Ŋį™žé­„åšĄæ¨Šį…Šį‡”į•ĒīĨ¤įšč•ƒč—ŠéŖœäŧį­įŊ°é–Ĩå‡Ąå¸†æĸĩæ°žæąŽæŗ›įŠ¯į¯„čŒƒæŗ•įēåƒģåŠˆåŖæ“˜æĒ—į’§į™–"],["dca1","įĸ§č˜—é—ĸ霹īĨĨ卞åŧčŽŠčž¨čž¯é‚ŠåˆĨįžĨ鱉éŧˆä¸™å€‚å…ĩåą›åšˇæ˜žæ˜ēæŸ„æŖ…į‚ŗį”į—…į§‰įĢčŧ§é¤ é¨ˆäŋå Ąå ąå¯ļ晎æ­Ĩ洑æšēæŊŊį¤į”ĢčŠčŖœč¤“č­œčŧ”äŧåƒ•匐卜厓垊服įĻč…ščŒ¯č””č¤‡čφčŧščŧģéĻĨ鰒æœŦäšļäŋ¸åĨ‰å°åŗ¯åŗ°æ§æŖ’įƒŊį†ĸįĢį¸Ģč“Ŧ蜂é€ĸé‹’éŗŗä¸äģ˜äŋ¯å‚…剖副åĻ咐埠å¤ĢåŠĻ"],["dda1","孚å­ĩ富åēœīĨĻæ‰ļæ•ˇæ–§æĩŽæēĨįˆļįŦĻį°ŋįŧļ腐腑膚艀芙莩訃負čŗĻčŗģčĩ´čļēéƒ¨é‡œé˜œé™„é§™éŗ§åŒ—åˆ†åŠå™´åĸŗåĨ”åĨŽåŋŋæ†¤æ‰Žæ˜æąžį„šį›†į˛‰įŗžį´›čŠŦ躁雰īĨ§äŊ›åŧ—åŊŋæ‹‚å´Šæœ‹æŖšįĄŧįšƒéĩŦ丕備匕åŒĒ卑åσåŠĸå燿‚˛æ†Šæ‰‰æ‰šæ–æž‡æĻ§æ¯”æ¯–æ¯—æ¯˜æ˛¸īĨ¨įĩį—ēį ’įĸ‘į§•į§˜į˛ƒįˇ‹įŋĄč‚Ĩ"],["dea1","č„žč‡‚č˛čœščŖ¨čĒšč­Ŧč˛ģé„™éžéŖ›éŧģåšŦåŦĒåŊŦ斌æĒŗæŽ¯æĩœæŋąį€•į‰įŽ­č˛§čŗ“é ģæ†‘æ°ˇč˜é¨äšäē‹äē›äģ•äŧēäŧŧäŊŋäŋŸåƒŋå˛å¸å”†å—Ŗå››åŖĢåĨĸ娑å¯Ģå¯ē射厺å¸Ģ垙思捨斜斯æŸļæŸģæĸ­æ­ģæ˛™æŗ—æ¸Ŗį€‰į…į ‚į¤žįĨ€įĨ į§į¯Šį´—įĩ˛č‚†čˆčŽŽč“‘č›‡čŖŸčŠčŠžčŦčŗœčĩĻčž­é‚ĒéŖŧ駟éēå‰ŠīĨŠæœ”īĨĒ"],["dfa1","傘åˆĒåąąæ•Ŗæą•įŠį”Ŗį–įŽ—č’œé…¸éœ°äšˇæ’’æŽēį…žč–Šä¸‰īĨĢæ‰æŖŽæ¸—čŠŸč”˜čĄĢæˇæžéˆ’éĸ¯ä¸Šå‚ˇåƒå„Ÿå•†å–Ēå˜—å­€å°™åŗ å¸¸åēŠåē å삿ƒŗæĄ‘æŠĄæš˜įˆŊቀዀᛏįĨĨįŽąįŋ”čŖŗč§´čŠŗčąĄčŗžéœœåĄžį’ŊčŗŊ嗇īĨŦįŠĄį´ĸč‰˛į‰˛į”Ÿį”ĨīĨ­įŦ™åĸ…åŖģåļŧåēåēļ垐恕抒æŋæ•æš‘æ›™æ›¸æ –æŖ˛įŠ€į‘žį­ŽįĩŽįˇ–įŊ˛"],["e0a1","čƒĨčˆ’č–¯čĨŋčĒ“é€é‹¤éģéŧ å¤•åĨ­å¸­æƒœæ˜”æ™ŗæžæąæˇ…æŊŸįŸŗįĸŠč“†é‡‹éŒĢäģ™åƒŠå…ˆå–„åŦ‹åŽŖæ‰‡æ•žæ—‹æ¸˛į…Ŋᐁᑄᒇį’ŋį™ŦįĻĒįˇšįš•įž¨č…ēč†ŗčˆšč˜ščŸŦčŠĩčˇŖé¸éŠ‘éĨéĨéŽŽå¨åą‘æĨ”æŗ„æ´Šæ¸Ģ舌薛č¤ģ設čĒĒé›ĒéŊ§å‰ĄæššæŽ˛įē–čŸžč´é–ƒé™æ”æļ‰į‡ŽīĨŽåŸŽå§“åŽŦ性æƒēæˆæ˜Ÿæ™ŸįŒŠįšį››įœį­Ŧ"],["e1a1","聖聲č…ĨčǠ醒䏖å‹ĸæ­˛æ´—į¨…įŦšį´°īĨ¯č˛°åŦå˜¯åĄ‘åŽĩ小少åˇĸ所掃搔昭æĸŗæ˛ŧæļˆæē¯į€Ÿį‚¤į‡’į”Ļį–į–Žį˜™įŦ‘ᝠį°Ģį´ į´šč”Ŧ蕭蘇訴逍遡é‚ĩ銎éŸļ騡äŋ—åąŦ束æļ‘į˛ŸįēŒčŦ–č´–é€Ÿå­ĢåˇŊæč“€éœéŖĄįŽ‡åŽ‹æ‚šæžæˇžč¨ŸčĒĻé€é ŒåˆˇīĨ°į‘įĸŽéŽ–čĄ°é‡—äŋŽå—å—Ŋ囚垂åŖŊåĢ‚åŽˆå˛Ģåŗ€å¸Ĩ愁"],["e2a1","戍手授搜æ”ļ數樚掊水洙æŧąį‡§į‹Šį¸į‡į’˛į˜ĻįĄį§€įŠ—įĢĒį˛šįļįļŦįšĄįžžč„ŠčŒąč’č“šč—Ēčĸ–čĒ°čŽčŧ¸é‚邃é…Ŧ銖銹隋隧隨雖需須éĻ–éĢ“éŦšå”åĄžå¤™å­°åŽŋæˇ‘æŊšį†ŸįĄį’šč‚…čŊåˇĄåž‡åžĒ恂æ—Ŧ栒æĨ¯æŠ“掉æ´ĩæˇŗįŖį›žįžŦį­į´”č„Ŗčˆœč€č“´č•ŖčŠĸčĢ„é†‡éŒžé †éĻ´æˆŒčĄ“čŋ°é‰Ĩ崇崧"],["e3a1","åĩŠį‘Ÿč†č¨æŋ•拞įŋ’č¤ļčĨ˛ä¸žäš˜åƒ§å‹å‡æ‰ŋæ˜‡įšŠč …é™žäžåŒ™å˜ļ始åĒ¤å°¸åąŽåąå¸‚åŧ‘恃æ–Ŋæ˜¯æ™‚æžžæŸ´įŒœįŸĸį¤ēįŋ…č’”č“čĻ–čŠĻ芊čĢĄčą•čąē埴寔åŧæ¯æ‹­æ¤æŽ–æšœį†„į¯’č•č­˜čģžéŖŸéŖžäŧ¸äžäŋĄå‘ģ娠厸æ„ŧ新晨į‡ŧᔺįĨžį´ŗč…Žč‡ŖčŽ˜č–Ē藎蜃訊čēĢ辛īĨąčŋ…å¤ąåޤå¯Ļ悉寊尋åŋƒæ˛"],["e4a1","īĨ˛æˇąį€‹į”ščНčĢļäģ€åīĨŗé›™æ°äēžäŋ„兒啞å¨Ĩåŗ¨æˆ‘į‰™čŠŊčŽĒ蛾衙訝é˜ŋ雅餓鴉éĩå Šå˛ŗåļŊåš„æƒĄæ„•æĄæ¨‚æ¸Ĩ鄂鍔顎鰐éŊˇåŽ‰å˛¸æŒ‰æ™æĄˆįœŧé›éžéĄ”éŽŸæ–ĄčŦčģ‹é–ŧå”ĩå˛Šåˇ–åēĩæš—į™Œč´é—‡åŖ“æŠŧį‹Žé´¨äģ°å¤Žæ€æ˜ģæŽƒį§§é´Ļ厓哀埃崖愛曖æļ¯įĸč‰žéš˜é„厄æ‰ŧ掖æļ˛į¸Šč…‹éĄ"],["e5a1","æĢģįŊŒéļ¯é¸šäšŸå€ģå†ļ夜惚æļ椰įˆēč€ļīĨ´é‡ŽåŧąīĨĩīĨļį´„č‹Ĩ葝č’ģč—ĨčēīĨˇäŊ¯īĨ¸īĨšåŖ¤å­ƒæ™æšæ”˜æ•­æš˜īĨēæĨŠæ¨Ŗæ´‹į€į…Ŧį—’į˜įĻŗįŠ°īĨģįžŠīĨŧčĨ„īĨŊ讓釀é™ŊīĨžé¤Šåœ„åžĄæ–ŧæŧį˜€įĻĻčĒžéϭ魚éŊŦ億æ†ļ抑æĒč‡†åƒå °åŊĻᄉ荀čĢēå­ŧ蘖äŋēå„ŧ嚴åĨ„æŽŠæˇšåļĒæĨ­å††äēˆäŊ™īĨŋīĻ€īρåĻ‚īĻ‚"],["e6a1","īĻƒæ­ŸæąīĻ„į’ĩᤖīĻ…čˆ‡č‰…čŒščŧŋčŊīĻ†é¤˜īχīψīωäēĻīϊ域åŊšæ˜“īĻ‹īόį–Ģįššč­¯īĻé€†éŠ›åšĨ堧姸娟厴īĻŽåģļīĻīĻææŒģīĻ‘æ¤Ŋæ˛‡æ˛ŋæļ޿ˇĩæŧ”īĻ’įƒŸį„ļį…™īĻ“į‡ƒį‡•īĻ”įĄįĄ¯īĻ•į­ĩᎪīϖᏝīĻ—čĄčģŸīϘīĻ™īĻšé‰›īĻ›éŗļīϜīĻīĻžæ‚…æļ…īĻŸį†ąīĻ īĻĄé–ąåŽ­īĻĸīĻŖīĻ¤æŸ“īĻĨį‚Žį„°į°č‰ļ苒"],["e7a1","īĻĻé–ģéĢĨéšŊ曄īϧᇁ葉īύīĻŠåĄ‹īĻĒīĻĢåļ¸åŊąīĻŦ映暎æĨšæĻŽæ°¸æŗŗæ¸ļæŊæŋšį€›į€¯į…į‡Ÿį°īĻ­į‘›īĻŽį“”į›ˆįŠŽįē“īϝīĻ°č‹ąčŠ čŋŽīĻąéˆīĻ˛éœ™īĻŗīĻ´äš‚å€ĒīĻĩåˆˆåĄæ›ŗæą­æŋŠįŒŠįŋįŠĸ芮藝蘂īĻļčŖ”čŠŖč­ŊčąĢīώ銺īĻ¸éœ“é äē”äŧäŋ‰å‚˛åˆåžåŗå—šåĄĸåĸēåĨ§å¨›å¯¤æ‚ŸīĻšæ‡Šæ•–æ—ŋ晤æĸ§æąšæžŗ"],["e8a1","įƒį†Ŧį’į­Ŋ蜈čǤ鰞éŧ‡åą‹æ˛ƒį„įŽ‰éˆēæēĢį‘Ĩį˜ŸįŠŠį¸•č˜Šå…€åŖ…æ“į“Žį”•į™°įŋé‚•雍éĨ”æ¸Ļį“ĻįĒŠįĒĒč‡Ĩč›™č¸č¨›åŠ‰åŽŒåŽ›æĸĄæ¤€æĩŖįŽŠį“įŦįĸ—įˇŠįŋĢč„˜č…•čŽžčąŒé˜Žé ‘æ›°åž€æ—ē枉æąĒįŽ‹å€­å¨ƒæ­ĒįŸŽå¤–åĩŦåˇįŒĨį•īĻēīĻģåƒĨ凚堯夭åĻ–å§šå¯ĨīĻŧīĻŊåļĸ拗搖撓擞īĻžæ›œīĻŋæŠˆī§€į‡ŋᑤ"],["e9a1","įLjįĒ¯įš‡įšžč€€č…°ī§‚čŸ¯čρčŦ é™ī§ƒé‚€éĨ’æ…žæŦ˛æĩ´į¸Ÿč¤Ĩčžąäŋ‘傭冗勇埇åĸ‰åŽšå珿…‚æĻ•æļŒæš§æēļᆔį‘ĸᔍį”ŦčŗčŒ¸č“‰č¸ŠéŽ”éžī§„äēŽäŊ‘åļå„Ēåˆå‹åŗåŽ‡å¯“å°¤æ„šæ†‚æ—´į‰›įŽ—į‘€į›‚įĨįĻ‘įĻšį´†įžŊ芋藕虞čŋ‚遇éƒĩé‡Ē隅雨雊勖åŊ§æ—­æ˜ąæ ¯į…œį¨ļ郁頊äē‘ī§…æŠ’æŽžæžį†‰č€˜čŠ¸č•“"],["eaa1","運隕雲éŸģ蔚éŦąäēį†Šé›„å…ƒåŽŸå“Ąåœ“åœ’åžŖåĒ›åĢ„å¯ƒæ€¨æ„ŋæ´æ˛…æ´šæš˛æēįˆ°įŒŋį‘—č‹‘čĸčŊ…遠é™ĸéĄ˜é´›æœˆčļŠé‰žäŊå‰åƒžåąåœå§”å¨å°‰æ…°æšæ¸­įˆ˛į‘‹įˇ¯čƒƒčŽč‘Ļč”ŋ蝟衛褘čŦ‚é•éŸ‹é­äšŗäž‘å„’å…Ēī§‡å”¯å–Šå­ēåŽĨåšŧåšŊåēžæ‚ æƒŸæ„ˆæ„‰æ„æ”¸æœ‰ī§ˆæŸ”æŸšī§‰æĨĄæĨĸæ˛šæ´§ī§Šæ¸¸ī§‹"],["eba1","æŋĄįŒļįŒˇī§Œį‘œį”ąī§į™’ī§Žī§įļ­č‡žč¸čŖ•čǘčĢ›čĢ­č¸°čš‚éŠé€žéēé…‰é‡‰éŽī§ī§‘å ‰ī§’æ¯“č‚‰č‚˛ī§“ī§”å…åĨĢå°šī§•ī§–æŊ¤įŽ§čƒ¤č´‡ī§—éˆ—é–ī§˜ī§™ī§šī§›čŋæˆŽį€œįĩ¨čžī§œåž æŠæ…‡æŽˇčĒžéŠ€éšąäš™åŸæˇĢč”­é™°éŸŗéŖŽæ–æŗŖé‚‘å‡æ‡‰č†ēéˇšäžå€šå„€åŽœæ„æ‡ŋæ“Ŧæ¤…æ¯…į–‘įŸŖįžŠč‰¤č–čŸģčĄŖčĒŧ"],["eca1","č­°é†ĢäēŒäģĨäŧŠī§ī§žå¤ˇå§¨ī§Ÿåˇ˛åŧ›åŊ›æ€Ąī§ ī§Ąī§ĸī§ŖįˆžįĨī§¤į•°į—ī§Ĩį§ģī§Ļč€Œč€ŗč‚„č‹Ąč‘ī§§ī§¨č˛Ŋč˛ŗé‚‡ī§Šī§Ē骴餌ī§Ģī§Ŧį€ˇį›ŠįŋŠįŋŒįŋŧčŦšäēēäģåˆƒå°ī§­å’Ŋ因å§ģ寅åŧ•åŋæšŽī§Žī§¯įĩĒčŒĩī§°čš“čĒī§ąé­éˇī§˛ī§ŗä¸€äŊšäŊžåŖšæ—Ĩæēĸ逸鎰éĻšäģģåŖŦåĻŠå§™æī§´ī§ĩፔī§ļččŗƒå…Ĩ卄"],["eda1","ī§ˇī§¸ī§šäģå‰Šå­•čŠŋäģ”åˆē咨姉å§ŋå­å­—å­œæŖæ…ˆæģ‹į‚™į…Žįކᓎį–ĩ᪁į´Ģ者č‡Ē茨蔗藉čĢŽčŗ‡é›ŒäŊœå‹ēåšŧæ–Ģ昨įŧႏįˆĩįļŊ芍酌雀éĩ˛å­ąæŖ§æŽ˜æŊēį›žå˛‘æšĢæŊ›įŽ´į°Ēč ļ雜丈äģ—匠場åĸģåŖ¯åĨŦ將叺åē„åŧĩæŽŒæš˛æ–æ¨ŸæĒŖæŦŒæŧŋቆī§ēįį’‹įĢ į˛§č…¸č‡Ÿč‡§čŽŠč‘Ŧč”Ŗč–”č—čŖč´“é†Ŧ長"],["eea1","障再哉在厰才材æ Ŋæĸ“æ¸Ŋæģ“įŊį¸ĄčŖč˛Ąčŧ‰éŊ‹éŊŽįˆ­įŽčĢéŒšäŊ‡äŊŽå„˛å’€å§å畿ŠĩæĩæĨŽæ¨—æ˛Žæ¸šį‹™įŒĒį–ŊįŽ¸į´ĩč‹§čšč‘—č—ˇčŠ›č˛¯čē‡é€™é‚¸é›ŽéŊŸå‹ŖåŠåĢĄå¯‚æ‘˜æ•ĩæģ´į‹„ī§ģįš„įŠįŦ›įąį¸žįŋŸčģčŦĢ躊čĩ¤čˇĄčšŸčŋĒčŋšéŠé‘äŊƒäŊēå‚ŗå…¨å…¸å‰å‰ĒåĄĄåĄŧåĨ å°ˆåą•å웿‚›æˆ°æ “æŽŋæ°ˆæžą"],["efa1","į…Žį į”°į”¸į•‘į™˛į­ŒįŽ‹įŽ­į¯†įēčŠŽčŧžčŊ‰éˆŋ銓éŒĸéĢé›ģ顚éĄĢ餞切æˆĒ折æĩ™į™¤įĢŠį¯€įĩļå å˛žåē—æŧ¸į‚šį˛˜éœ‘鎎éģžæŽĨæ‘ēčļ丁äē•äē­åœåĩ呈姃厚嚀åē­åģˇåžæƒ…æŒēæ”ŋ整旌æ™ļ晸柞æĨ¨æĒ‰æ­Ŗæą€æˇ€æˇ¨æ¸Ÿæšžį€žį‚ĄįŽŽįŊį”ēį›įĸ‡įĻŽį¨‹įŠŊį˛žįļŽč‰‡č¨‚čĢĒ貞鄭酊釘é‰Ļ鋌錠霆靖"],["f0a1","靜頂éŧŽåˆļ劑å•ŧ堤帝åŧŸæ‚Œææĸ¯æŋŸįĨ­įŦŦ臍č–ēčŖŊčĢ¸čš„é†é™¤éš›éœŊ題éŊŠäŋŽå…†å‡‹åŠŠå˜˛åŧ”åŊĢæŽĒ操旊晁æ›ē曚朝æĸæŖ—æ§Ŋæŧ•æŊŽį…§į‡ĨįˆĒį’ĒįœēįĨ–įĨšį§Ÿį¨ įĒ•į˛—įŗŸįĩ„įš°č‚‡č—ģ蚤詔čĒŋčļ™čēé€ é­é‡Ŗé˜ģ雕éŗĨæ—į°‡čļŗéƒå­˜å°Šå’æ‹™įŒå€§åŽ—åžžæ‚°æ…ĢæŖ•æˇ™įŽį¨Žįĩ‚įļœį¸ąč…Ģ"],["f1a1","č¸Ēč¸ĩ鍾鐘äŊååˇĻåē§æŒĢįŊĒä¸ģäŊäžåšå§čƒ„å‘Ē周嗞åĨåŽ™åˇžå욿™æœąæŸąæ Ēæŗ¨æ´˛æšŠæžį‚ˇį į–‡įąŒį´‚į´Ŧįļĸ舟蛛č¨ģčĒ…čĩ°čēŠčŧŗé€ąé…Žé…’鑄駐įĢšį˛ĨäŋŠå„å‡†åŸˆå¯¯åŗģ晙æ¨Ŋæĩšæē–æŋŦį„Œį•¯įĢŖč ĸ逡éĩ雋é§ŋ茁䏭äģ˛čĄ†é‡åŊæĢ›æĨĢæąč‘ēåĸžæ†Žæ›žæ‹¯įƒį”‘į—‡įš’č’¸č­‰č´ˆäš‹åĒ"],["f2a1","å’Ģ地址åŋ—持指摯支旨æ™ēæžæžŗæ­ĸæą æ˛šæŧŦįŸĨį ĨįĨ‰įĨ—į´™č‚ĸč„‚č‡ŗčŠčŠˇčœ˜čnjī§ŧ贄čļžé˛į›´į¨™į¨ˇįš”聎唇嗔åĄĩ振æĸæ™‰æ™‹æĄ­æĻ›æŽ„æ´Ĩæēąįį‘¨į’Ąį•›į–šį›Ąįœžįž‹į§Ļį¸‰į¸č‡ģ蔝čĸ—č¨ēčŗ‘čģĢčž°é€˛éŽ­é™Ŗé™ŗéœ‡äž„åąå§ĒåĢ‰å¸™æĄŽį“†į–žį§Šįǒ膪蛭čŗĒ莌čŋ­æ–Ÿæœ•ī§Ŋ城æŊ—įˇčŧ¯"],["f3a1","éļ集åžĩæ‡˛æž„ä¸”äž˜å€Ÿå‰å—Ÿåĩ¯åˇŽæŦĄæ­¤įŖ‹įŽšī§žčš‰čģŠéŽæ‰æžį€įĒ„éŒ¯é‘ŋéŊĒæ’°æž¯į‡Ļį’¨į“šį̄ᰒįē‚ឞįē˜čޚ贊é‘Ŋ餐éĨŒåˆšå¯Ÿæ“Ļæœ­į´Žåƒ­åƒåĄšæ…˜æ…™æ‡ēæ–ŦįĢ™čŽ’čŽ–å€‰å€Ąå‰ĩå”ąå¨ŧåģ åŊ°æ„´æ•žæ˜Œæ˜ļæšĸ槍æģ„æŧ˛įŒ–į˜ĄįĒ“č„šč‰™č–č’ŧå‚ĩ埰寀寨åŊŠæŽĄį Ļįļĩ菜蔡采é‡ĩ冊æŸĩį­–"],["f4a1","č˛Ŧ凄åĻģæ‚Ŋč™•å€œī§ŋ剔å°ēæ…Ŋæˆšæ‹“æ“˛æ–ĨæģŒį˜ č„Ščš é™ŸéšģäģŸåƒå–˜å¤Šåˇæ“…æŗ‰æˇēįŽ”įŠŋ舛č–Ļčŗ¤č¸éˇé‡§é—Ąé˜ĄéŸ†å‡¸å“˛å–†åžšæ’¤æžˆįļ´čŧŸčŊéĩåƒ‰å°–æ˛žæˇģį”›įžģį°Ŋįą¤čŠščĢ‚å žåĻžå¸–æˇį‰’į–ŠįĢč̜č˛ŧčŧ’åģŗæ™´æˇ¸čŊ菁čĢ‹é‘é¯–ī¨€å‰ƒæ›ŋæļ•æģ¯įˇ čĢĻ逮遞éĢ”åˆå‰ŋ哨憔抄招æĸĸ"],["f5a1","椒æĨšæ¨ĩį‚’į„ĻįĄį¤į¤Žį§’į¨č‚–č‰¸č‹•č‰č•‰č˛‚čļ…é…ĸ醋醮äŋƒå›‘į‡­įŸ—čœ€č§¸å¯¸åŋ–村邨åĸåĄšå¯ĩ悤憁摠į¸Ŋ聰č”Ĩ銃撎å‚Ŧ崔最åĸœæŠŊ推椎æĨ¸æ¨žæšĢįšēį§‹čŠģ萊čĢčļ¨čŋŊ鄒酋醜錐錘鎚雛é¨ļé°ä¸‘į•œįĨįĢēį­‘į¯‰į¸Žč“„čš™čš´čģ¸é€æ˜Ĩæ¤ŋį‘ƒå‡ē朎éģœå……åŋ æ˛–čŸ˛čĄčĄˇæ‚´č†ĩ萃"],["f6a1","č´…å–åšå˜´å¨ļå°ąį‚Šįŋ čšč„†č‡­čļŖé†‰éП鎞側äģ„厠æƒģæ¸Ŧåą¤äžˆå€¤å—¤åŗ™åšŸæĨæĸ”æ˛ģæˇ„į†žį—”į—´į™Ąį¨šįŠ‰įˇ‡įˇģįŊŽč‡´čšŠčŧœé›‰éĻŗéŊ’則勅骭čĻĒ七柒æŧ†äžĩå¯ĸæž•æ˛ˆæĩ¸į›į §é‡éŧčŸ„į§¤į¨ąåŋĢäģ–咤唞åĸŽåĻĨ惰打拖æœļæĨ•čˆĩ陀éĻąé§å€Ŧ卓啄åŧī¨æ‰˜ī¨‚æ“ĸæ™Ģ柝æŋæŋ¯įĸᐏ荗"],["f7a1","鐸呑嘆åĻåŊˆæ†šæ­Žį˜į‚­įļģčĒ•åĨĒč„ĢæŽĸᜈč€Ŋč˛ĒåĄ”æ­æĻģåŽ•å¸‘æš¯ī¨ƒč•Šå…Œå°å¤Ēæ€ æ…‹æŽ†æą°æŗ°įŦžčƒŽč‹”衆邰éĸąī¨„æ“‡æž¤æ’‘æ”„å…ŽååœŸč¨Žæ…ŸæĄļᗛ᭒įĩąé€šå †æ§Œč…ŋč¤Ē退頚偸åĨ—åĻŦ投透éŦĒæ…į‰šé—–åĄåŠ†åˇ´æŠŠæ’­æ“ēæˇæŗĸæ´žįˆŦįļį ´įŊˇčŠ­čˇ›é —åˆ¤å‚æŋį‰ˆį“Ŗč˛ŠčžĻ鈑"],["f8a1","é˜Ēå…Ģ叭捌äŊŠå”„æ‚–æ•—æ˛›æĩŋį‰Œį‹ŊፗčĻ‡č˛åŊ­æžŽįƒšč†¨æ„Žäžŋåæ‰į‰‡į¯‡įˇ¨įŋŠééž­é¨™č˛ļåĒåšŗæž°ččŠ•å åŦ–åšŖåģĸåŧŠæ–ƒč‚ēč”Ŋ閉陛äŊˆåŒ…匍匏咆å“ēåœƒå¸ƒæ€–æŠ›æŠąæ•ī¨†æŗĄæĩĻį–ąį ˛čƒžč„¯č‹žč‘Ąč’˛čĸč¤’逋é‹ĒéŖŊéŽ‘åš…æš´æ›į€‘įˆ†ī¨‡äŋĩå‰ŊåŊĒæ…“杓標æŧ‚į“ĸįĨ¨čĄ¨čąšéŖ‡éŖ„éЃ"],["f9a1","å“į¨ŸæĨ“čĢˇčąŠéĸ¨éĻŽåŊŧæŠĢį–˛įšŽčĸĢéŋ陂匚åŧŧåŋ…æŗŒįŒį•ĸį–‹į­†č‹žéĻäšé€ŧ下äŊ•åŽĻ夏å숿˜°æ˛ŗį‘•荷čĻčŗ€ééœžé°•åŖ‘å­¸č™čŦ”éļ´å¯’æ¨æ‚æ—ąæą—æŧĸæžŖį€šįŊ•įŋ°é–‘é–’é™éŸ“å‰˛čŊ„å‡ŊåĢå’¸å•Ŗå–ŠæĒģæļĩ᎘č‰ĻéŠœé™ˇéššåˆå“ˆį›’č›¤é–¤é—”é™œäēĸäŧ‰å§ŽåĢĻåˇˇæ’æŠ—æ­æĄæ˛†æ¸¯įŧ¸č‚›čˆĒ"],["faa1","ī¨ˆī¨‰é …äēĨå•å’ŗåž“åĨšå­ŠåŽŗæ‡ˆæĨˇæĩˇį€ŖčŸšč§ŖčОç̌邂駭éĒ¸åŠžæ ¸å€–åš¸æč‡čĄŒäēĢ向嚎įĻ鄕éŸŋ餉éĨ—éϙ噓åĸŸč™›č¨ąæ†˛æĢļįģčģ’æ­‡éšĒ驗åĨ•įˆ€čĩĢ靊äŋ”åŗ´åŧĻæ‡¸æ™›æŗĢį‚ĢįŽ„įŽšįžįœŠįįĩƒįĩĸį¸ŖčˆˇčĄ’ī¨Ščŗĸé‰‰éĄ¯å­‘įŠ´čĄ€é å̌äŋ å”夞åŗŊ挞æĩšį‹šč„…脇čŽĸ鋏頰äē¨å…„刑型"],["fba1","åŊĸæŗ‚æģŽį€…įį‚¯į†’įŠį‘ŠčŠčžĸ衡逈é‚ĸéŽŖéĻ¨å…ŽåŊ—æƒ æ…§æšŗč•™čšŠé†¯éž‹äšŽäē’å‘ŧåŖ•åŖēåĨŊå˛ĩåŧ§æˆļ扈昊晧æ¯ĢæĩŠæˇæš–æģ¸æž”æŋ æŋŠįį‹įĨį‘šį“ įš“įĨœįŗŠį¸žčƒĄčŠĻč‘Ģč’ŋ虎號蝴護čąĒéŽŦ頀éĄĨæƒ‘æˆ–é…ˇåŠšæ˜æˇˇæ¸žįŋ魂åŋŊ惚įŦå“„åŧ˜æąžæŗ“æ´Ēįƒ˜į´…č™šč¨Œé´ģ化和åŦ…æ¨ēįĢį•ĩ"],["fca1","įĻįĻžčŠąč¯čŠąč­č˛¨é´ī¨‹æ“´æ”ĢįĸēįĸģįŠĢ丸喚åĨåŽĻåšģæ‚Ŗæ›æ­Ąæ™ĨæĄ“æ¸™į…Ĩį’°į´ˆé‚„éŠŠé°Ĩæ´ģæģ‘įŒžčąé—Šå‡°åšŒåž¨ææƒļ愰慌晃晄æĻĨæŗæšŸæģ‰æŊĸį…Œį’œįš‡į¯į°§č’č—é‘éšéģƒåŒ¯å›žåģģ垊æĸæ‚”æ‡ˇæ™Ļ會æĒœæˇŽæžŽį°įĒįšĒ膾茴蛔čĒ¨čŗ„åŠƒį˛åŽ–æŠĢ鐄哎嚆孝效斅曉æĸŸæļæˇ†"],["fda1","įˆģ肴é…ĩ銍䞯候厚后åŧ喉嗅å¸ŋ垌æœŊį…Ļįé€…å‹›å‹ŗåĄ¤åŖŽį„„į†į‡ģč–°č¨“æšˆč–¨å–§æš„į…Ščąå‰å–™æ¯åŊ™åžŊæŽæš‰į…‡čĢąčŧéēžäŧ‘æēįƒ‹į•Ļč™§æ¤č­Žéˇ¸å…‡å‡ļ匈æ´ļ胸é쑿˜•æŦŖį‚˜į—•åƒåąšį´‡č¨–æŦ æŦŊ歆吸恰æ´Ŋįŋ•čˆˆåƒ–å‡žå–œå™Ģ囍å§ŦåŦ‰å¸Œæ†™æ†˜æˆąæ™žæ›Ļį†™į†šį†ēኧįĻ§į¨€įž˛čŠ°"]] + +/***/ }), +/* 719 */ +/***/ (function(module, exports) { + +module.exports = [["0","\u0000",127],["8ea1","īŊĄ",62],["a1a1"," 、。īŧŒīŧŽãƒģīŧšīŧ›īŧŸīŧã‚›ã‚œÂ´īŊ€Â¨īŧžīŋŖīŧŋãƒŊマゝゞ〃äģã€…〆〇ãƒŧ―‐īŧīŧŧīŊžâˆĨīŊœâ€Ļâ€Ĩ‘’“”īŧˆīŧ‰ã€”〕īŧģīŧŊīŊ›īŊã€ˆ",9,"īŧ‹īŧÂąÃ—Ãˇīŧâ‰ īŧœīŧžâ‰Ļâ‰§âˆžâˆ´â™‚â™€Â°â€˛â€ŗâ„ƒīŋĨīŧ„īŋ īŋĄīŧ…īŧƒīŧ†īŧŠīŧ Â§â˜†â˜…○●◎◇"],["a2a1","â—†â–Ąâ– â–ŗâ–˛â–Ŋâ–ŧâ€ģ〒→←↑↓〓"],["a2ba","∈∋⊆⊇⊂⊃âˆĒ∊"],["a2ca","∧∨īŋĸ⇒⇔∀∃"],["a2dc","∠âŠĨ⌒∂∇≡≒â‰Ēâ‰Ģ√âˆŊ∝âˆĩâˆĢâˆŦ"],["a2f2","â„̉♯♭â™Ē†‡Âļ"],["a2fe","◯"],["a3b0","īŧ",9],["a3c1","īŧĄ",25],["a3e1","īŊ",25],["a4a1","ぁ",82],["a5a1","ã‚Ą",85],["a6a1","Α",16,"ÎŖ",6],["a6c1","Îą",16,"΃",6],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"Ņ‘Đļ",25],["a8a1","─│┌┐┘└├â”Ŧ┤┴â”ŧâ”â”ƒâ”â”“â”›â”—â”Ŗâ”ŗâ”Ģâ”ģâ•‹â” â”¯â”¨â”ˇâ”ŋ┝┰â”Ĩ┸╂"],["ada1","①",19,"Ⅰ",9],["adc0","㍉㌔ãŒĸ㍍㌘㌧㌃ãŒļ㍑㍗㌍ãŒĻãŒŖãŒĢ㍊ãŒģãŽœãŽãŽžãŽŽãŽã„ãŽĄ"],["addf","ãģã€ã€Ÿâ„–ãâ„ĄãŠ¤",4,"ãˆąãˆ˛ãˆšãžãŊãŧ≒≡âˆĢ∮∑√âŠĨ∠∟âŠŋâˆĩ∊âˆĒ"],["b0a1","äēœå”–娃é˜ŋ哀愛挨å§ļé€ĸč‘ĩčŒœįŠæ‚ĒæĄæ¸Ĩ旭č‘ĻčŠĻé¯ĩæĸ“åœ§æ–Ąæ‰ąåޛ姐č™ģéŖ´įĩĸįļžéŽŽæˆ–į˛ŸčĸˇåމåēĩæŒ‰æš—æĄˆé—‡éžæäģĨäŧŠäŊäžå‰å›˛å¤ˇå§”威尉惟意慰易椅į‚ēį•į•°į§ģįļ­įˇ¯čƒƒčŽčĄŖčŦ‚違éēåŒģäē•äēĨåŸŸč‚˛éƒįŖ¯ä¸€åŖąæēĸé€¸į¨˛čŒ¨čŠ‹é°¯å…å°å’Ŋå“Ąå› å§ģåŧ•éŖ˛æˇĢ胤蔭"],["b1a1","é™ĸ陰隠éŸģå‹åŗåŽ‡įƒįžŊčŋ‚雨卯éĩœįĒē丑įĸ“č‡ŧæ¸Ļ嘘唄æŦč”šé°ģå§Ĩ厊æĩĻį“œé–å™‚äē‘é‹é›˛čé¤ŒåĄå–ļåŦ°åŊ࿘ æ›ŗæ „æ°¸æŗŗæ´Šį‘›į›ˆįŠŽé ´č‹ąčĄ›čŠ é‹­æļ˛į–Ģį›Šé§…æ‚ĻčŦčļŠé–˛æĻŽåŽ­å††åœ’å °åĨ„厴åģ￀¨æŽŠæ´æ˛ŋæŧ”į‚Žį„”į…™į‡•įŒŋᏁč‰ļč‹‘č–—é é‰›é´›åĄŠæ–ŧæąšį”Ĩ凚夎åĨĨ垀åŋœ"],["b2a1","æŠŧæ—翍ǿŦ§æŽ´įŽ‹įŋčĨ–é´Ŧ鴎éģ„å˛Ąæ˛–čģå„„åą‹æ†ļ臆æĄļį‰Ąäš™äŋēå¸æŠæ¸ŠįŠéŸŗä¸‹åŒ–äģŽäŊ•äŧŊ䞥äŊŗåŠ å¯å˜‰å¤ǻåŽļå¯Ąį§‘æš‡æžœæžļæ­Œæ˛ŗįĢį‚įĻįĻžį¨ŧįŽ‡čŠąč‹›čŒ„čˇč¯č“čĻčĒ˛å˜Šč˛¨čŋĻ過霞蚊äŋ„åŗ¨æˆ‘į‰™į”ģč‡ĨčŠŊč›žčŗ€é›…é¤“é§•äģ‹äŧšč§Ŗå›žåĄŠåŖŠåģģåŋĢæ€Ē悔æĸ懐戒拐攚"],["b3a1","魁æ™Ļæĸ°æĩˇį°į•Œįš†įĩĩčŠĨčŸšé–‹éšŽč˛å‡ąåŠžå¤–å’ŗåŽŗå´–æ…¨æĻ‚æļ¯įĸč“‹čĄ—芲鎧éǏæĩŦéĻ¨č›™åžŖæŸŋč›ŽéˆŽåŠƒåš‡å„å쓿‹Ąæ’šæ ŧæ ¸æŽģį˛įĸēįŠĢčĻšč§’čĩĢčŧƒéƒ­é–Ŗéš”靊å­Ļ垺æĨŊéĄéĄŽæŽ›įŦ æ¨ĢæŠŋæĸļ鰍æŊŸå‰˛å–æ°æ‹Ŧæ´ģ渇æģ‘葛褐čŊ„且鰚åļ椛æ¨ē鞄æ Ē兜įĢƒč’˛é‡œéŽŒå™›é´¨æ ĸ茅萱"],["b4a1","į˛Ĩåˆˆč‹…į“Ļ䚞䞃冠寒刊勘勧åˇģ喚å Ēå§ĻåŽŒåŽ˜å¯›åš˛åššæ‚Ŗæ„Ÿæ…Ŗæ†žæ›æ•ĸæŸ‘æĄ“æŖēæŦžæ­“æą—æŧĸæž—æŊ…į’°į”˜į›Ŗįœ‹įĢŋįŽĄį°ĄįˇŠįŧļįŋ°č‚č‰Ļ莞čĻŗč̌č˛Ģ還鑑間閑é–ĸé™Ĩ韓館舘丸åĢå˛¸åˇŒįŽŠį™Œįœŧå˛ŠįŋĢ贋雁頑顔願äŧäŧŽåąå–œå™¨åŸēåĨ‡åŦ‰å¯„å˛å¸ŒåšžåŋŒæŽæœē旗æ—ĸæœŸæŖ‹æŖ„"],["b5a1","抟帰毅気æąŊį•ŋįĨˆå­Ŗį¨€į´€åžŊčĻč¨˜č˛´čĩˇčģŒčŧéŖĸ騎éŦŧäē€åŊ儀åĻ“åŽœæˆ¯æŠ€æ“ŦæŦēįŠ į–‘įĨ‡įžŠčŸģčĒŧč­°æŽŦčŠéž å‰åƒå–ĢæĄ”æŠ˜čŠ°į §æĩéģå´åŽĸ脚虐逆丘久äģ‡äŧ‘及吸厎åŧ“æ€Ĩ救æœŊæą‚æą˛æŗŖį¸įƒįŠļįĒŽįŦˆį´šįŗžįĩĻæ—§į‰›åŽģåą…åˇ¨æ‹’æ‹ æŒ™æ¸ č™šč¨ąčˇé‹¸æŧįĻĻ魚äē¨äēĢäēŦ"],["b6a1","䞛䞠僑兇įĢļå…ąå‡ļå”åŒĄåŋåĢå–ŦåĸƒåŗĄåŧˇåŊŠæ€¯ææ­æŒŸæ•™æŠ‹æŗį‹‚į‹­įŸ¯čƒ¸č„…čˆˆč•ŽéƒˇéĄéŸŋéĨ—éКäģ°å‡å°­æšæĨ­åą€æ›˛æĨĩįŽ‰æĄį˛åƒ…å‹¤å‡åˇžéŒĻ斤æŦŖæŦŊᐴįρįĻŊį­‹įˇŠčŠščŒčĄŋčĨŸčŦščŋ‘金吟銀䚝å€ļåĨåŒēį‹—įŽ–įŸŠč‹Ļčē¯é§†é§ˆé§’å…ˇæ„šč™žå–°įŠēåļå¯“é‡éš…ä¸˛æĢ›é‡§åą‘åąˆ"],["b7a1","掘įĒŸæ˛“é´čŊĄįĒĒį†Šéšˆį˛‚æ —įš°æĄ‘éŦ勞君č–Ģč¨“įž¤čģéƒĄåĻčĸˆįĨäŋ‚傞刑兄啓圭įĒ型åĨ‘åŊĸåž„æĩæ…ļæ…§æ†ŠæŽ˛æēæ•Ŧæ™¯æĄ‚æ¸“į•Ļį¨ŊįŗģįĩŒįļ™įš‹įŊĢčŒŽčŠč›č¨ˆčŠŖč­ĻčģŊ頚éļčЏčŋŽé¯¨åŠ‡æˆŸæ’ƒæŋ€éš™æĄå‚‘æŦ æąēæŊ”įŠ´įĩčĄ€č¨Ŗæœˆäģļ倚å€ĻåĨå…ŧåˆ¸å‰Ŗå–§åœå …å̌åģ翆˛æ‡¸æ‹ŗæ˛"],["b8a1","検樊į‰ŊįŠŦįŒŽį ”įĄ¯įĩšįœŒč‚ŠčĻ‹čŦ™čŗĸčģ’遪éĩé™ēéĄ•é¨“éš¸å…ƒåŽŸåŽŗåšģåŧĻæ¸›æēįŽ„įžįĩƒčˆˇč¨€čĢē限䚎個古å‘ŧå›ēå§‘å­¤åˇąåēĢåŧ§æˆ¸æ•…æž¯æš–į‹įŗŠčĸ´č‚ĄčƒĄč°č™ŽčĒ‡čˇ¨éˆˇé›‡éĄ§éŧ“äē”äē’äŧåˆå‘‰åžå¨¯åžŒåžĄæ‚Ÿæĸ§æĒŽį‘šįĸčĒžčĒ¤č­ˇé†äšžé¯‰äē¤äŊŧ䞯候倖光å…ŦåŠŸåŠšå‹žåŽšåŖå‘"],["b9a1","后喉坑åžĸåĨŊ孔孝厏åˇĨåˇ§åˇˇåš¸åēƒåēšåēˇåŧ˜æ’慌抗拘控æ”ģæ˜‚æ™ƒæ›´æ­æ Ąæĸ—æ§‹æąŸæ´ĒæĩŠæ¸¯æēį”˛įš‡įĄŦį¨ŋįŗ į´…į´˜įĩžįļąč€•č€ƒč‚¯č‚ąč…”č†čˆĒ荒行衡čŦ›č˛ĸčŗŧ郊é…ĩ鉱į ŋé‹ŧ閤降項éĻ™é̘é´ģ剛åŠĢåˇåˆåŖ•æ‹ˇæŋ čąĒčŊŸéēšå…‹åˆģ告å›ŊįŠ€é…ˇéĩ éģ’į„æŧ‰č…°į”‘åŋŊ惚éǍዛčžŧ"],["baa1","此頃äģŠå›°å¤åĸžåŠšæ¨æ‡‡æ˜æ˜†æ šæĸ࿎ˇį—•į´ē艮魂äē›äŊå‰å”†åĩ¯åˇĻåˇŽæŸģæ˛™į‘ŗį ‚čŠéŽ–čŖŸååē§æŒĢå‚ĩå‚Ŧå†æœ€å“‰åĄžåĻģ厰åŊŠæ‰æŽĄæ Ŋæ­ŗæ¸ˆįŊé‡‡įŠ€į •į ĻįĨ­æ–Žį´°čœčŖčŧ‰éš›å‰¤åœ¨æįŊĒč˛Ąå†´å‚é˜Ēå ēæĻŠč‚´å’˛å´ŽåŸŧįĸ•éˇēäŊœå‰Šå’‹æžæ˜¨æœ”æŸĩįDŽ᭖į´ĸéŒ¯æĄœéŽ­įŦšåŒ™å†Šåˆˇ"],["bba1","察æ‹ļæ’Žæ“Ļ札æŽēč–Šé›‘įšé¯–æŒéŒ†éŽĢįšŋæ™’ä¸‰å‚˜å‚åąąæƒ¨æ’’æ•ŖæĄŸį‡ĻįŠį”ŖįŽ—įē‚čš•čŽƒčŗ›é…¸é¤æ–ŦæšĢ掋äģ•äģ”äŧēäŊŋåˆēå¸å˛å—Ŗå››åŖĢ始姉å§ŋå­åąå¸‚å¸Ģåŋ—思指支孜斯æ–Ŋ旨枝æ­ĸæ­ģæ°į…įĨ‰į§įŗ¸į´™į´Ģč‚ĸ脂臺čĻ–čŠžčŠŠčŠĻčnjčĢŽčŗ‡čŗœé›ŒéŖŧæ­¯äē‹äŧŧ䞍児字å¯ē慈持時"],["bca1","æŦĄæģ‹æ˛ģįˆžį’Ŋᗔ᪁į¤ēč€Œč€ŗč‡Ēč’”čžžæąéšŋåŧč­˜é´ĢįĢēčģ¸åŽé›Ģä¸ƒåąåŸˇå¤ąåĢ‰åŽ¤æ‚‰æšŋæŧ†į–žčŗĒåŽŸč”€į¯ å˛æŸ´čŠåąĄč•Šį¸žčˆŽå†™å°„æ¨čĩĻæ–œį…Žį¤žį´—者čŦčģŠéŽč›‡é‚Ē借å‹ēå°ē杓įŧįˆĩ酌釈éŒĢč‹Ĩ寂åŧ࿃šä¸ģå–åŽˆæ‰‹æœąæŽŠį‹Šį į¨Žč…ĢčļŖé…’éĻ–å„’å—å‘Ēå¯ŋ授樚įļŦ需囚収周"],["bda1","åŽ—å°ąåˇžäŋŽæ„æ‹žæ´˛į§€į§‹įĩ‚įšįŋ’č‡­čˆŸč’čĄ†čĨ˛čŽčš´čŧ¯é€ąé…‹é…Ŧ集醜äģ€äŊå……ååž“æˆŽæŸ”æąæ¸‹įŖį¸Ļ重銃叔夙åŽŋæˇ‘įĨį¸Žį˛›åĄžį†Ÿå‡ē術čŋ°äŋŠåŗģæ˜ĨįžŦį̪舜é§ŋ准åžĒæ—ŦæĨ¯æŽ‰æˇŗæē–æŊ¤į›žį´”åˇĄéĩ醇順å‡Ļ初所暑曙渚åēļ᎒įŊ˛æ›¸č–¯č—ˇčĢ¸åŠŠå™åĨŗåēåžæ•é‹¤é™¤å‚ˇå„Ÿ"],["bea1","勝匠升åŦå“¨å•†å”ąå˜—åĨ¨åĻžå¨ŧåŽĩ将小少尚åē„åēŠåģ åŊ°æ‰ŋæŠ„æ‹›æŽŒæˇæ˜‡æ˜Œæ˜­æ™ļ杞æĸĸ樟æ¨ĩæ˛ŧæļˆæ¸‰æš˜į„ŧį„Ļį…§į—‡įœįĄį¤įĨĨį§°įĢ įŦ‘į˛§į´šč‚–č–č’‹č•‰čĄčŖŗč¨Ÿč¨ŧčŠ”čŠŗčąĄčŗžé†¤é‰Ļéžé˜éšœéž˜ä¸Šä¸ˆä¸žäš—å†—å‰°åŸŽå ´åŖŒåŦĸå¸¸æƒ…æ“žæĄæ–æĩ„įŠļį•ŗįŠŖč’¸č­˛é†¸éŒ å˜ąåŸ´éŖž"],["bfa1","æ‹­æ¤æŽ–į‡­įš”čˇč‰˛č§ĻéŖŸč•čžąå°ģäŧ¸äŋĄäžĩ唇娠寝寊åŋƒæ…ŽæŒ¯æ–°æ™‹æŖŽæĻ›æĩ¸æˇąį”ŗį–šįœŸįĨžį§Ļį´ŗč‡ŖčŠ¯č–ĒčĻĒč¨ēčēĢ辛進針震äēēäģåˆƒåĄĩåŖŦå°‹į”šå°Ŋ腎訊čŋ…é™Ŗé­įŦĨčĢé ˆé…ĸå›ŗåŽ¨é€—åšåž‚å¸ĨæŽ¨æ°´į‚ŠįĄį˛‹įŋ čĄ°é‚é…”éŒéŒ˜éšį‘žé̄崇åĩŠæ•°æžĸčļ¨é››æŽæ‰æ¤™č…é —é›€čŖž"],["c0a1","æž„æ‘ē寸世į€Ŧį•æ˜¯å‡„åˆļå‹ĸ姓垁性成æ”ŋæ•´æ˜Ÿæ™´æŖ˛æ –æ­Ŗæ¸…į‰˛į”Ÿį››į˛žč–åŖ°čŖŊčĨŋčĒ čĒ“čĢ‹é€é†’é’é™æ–‰į¨Žč„†éšģ席惜戚æ–Ĩæ˜”æžįŸŗįŠįąį¸žč„Šč˛Ŧčĩ¤čˇĄčšŸįĸŠåˆ‡æ‹™æŽĨæ‘‚æŠ˜č¨­įĒƒį¯€čĒŦé›Ēįĩļ舌蝉äģ™å…ˆåƒå åŽŖå°‚å°–åˇæˆĻæ‰‡æ’°æ “æ ´æŗ‰æĩ…洗染æŊœį…Žį…Ŋ旋įŠŋįŽ­įˇš"],["c1a1","įšŠįž¨č…ē舛船č–ĻčŠŽčŗŽčˇĩé¸éˇéŠ­éŠ‘é–ƒéŽŽå‰å–„æŧ¸į„ļ全įĻ…įš•č†ŗįŗŽå™ŒåĄ‘å˛¨æŽĒ曞æ›ŊæĨšį‹™į–į–Žį¤ŽįĨ–į§Ÿį˛—į´ įĩ„č˜‡č¨´é˜ģ遥éŧ åƒ§å‰ĩ双åĸ倉å–ĒåŖŽåĨįˆŊåŽ‹åą¤åŒæƒŖæƒŗæœæŽƒæŒŋæŽģæ“æ—Šæ›šåˇŖæ§æ§Ŋæŧ•į‡Ĩäē‰į—Šį›¸įĒ“įŗŸįˇįļœčĄč‰č˜č‘Ŧč’ŧč—ģčŖ…čĩ°é€é­éŽ—éœœé¨’åƒåĸ—憎"],["c2a1","臓č”ĩ贈造äŋƒå´å‰‡åŗæ¯æ‰æŸæ¸Ŧčļŗé€Ÿäŋ—åąžčŗŠæ—įļšå’čĸ–å…ļ揃存å­Ģ尊損村遜äģ–多å¤Ēæą°čŠ‘å”žå •åĻĨ惰打柁čˆĩæĨ•陀駄騨äŊ“å †å¯žč€å˛ąå¸¯åž…æ€ æ…‹æˆ´æ›ŋæŗ°æģžčƒŽč…ŋ苔čĸ‹č˛¸é€€é€ŽéšŠéģ›é¯›äģŖå°å¤§įŦŦ醍題鷹æģį€§å“啄厅托択拓æ˛ĸæŋ¯įĸ託鐸æŋčĢžčŒ¸å‡§č›¸åĒ"],["c3a1","及äŊ†é”čž°åĨĒ脱åˇŊįĢĒčžŋæŖšč°ˇį‹¸éąˆæ¨ŊčĒ°ä¸šå˜å˜†åĻ担æŽĸæ—Ļæ­ŽæˇĄæš›į‚­įŸ­į̝įŽĒįļģč€Ŋ胆蛋čĒ•é›å›ŖåŖ‡åŧžæ–­æš–æĒ€æŽĩᔎč̇値įŸĨ地åŧ›æĨæ™ēæą į—´į¨šįŊŽč‡´čœ˜é…éĻŗį¯‰į•œįĢšį­‘č“„é€į§ŠįĒ’čŒļåĢĄį€ä¸­äģ˛åŽ™åŋ æŠŊæ˜ŧæŸąæŗ¨č™Ģ襡č¨ģé…Žé‹ŗé§æ¨—į€ĻįŒĒ苧著螝䏁兆凋喋å¯ĩ"],["c4a1","取叺åēåŧ”åŧĩåŊĢåž´æ‡˛æŒ‘æšĸ朝æŊŽį‰’į”ēįœē聴脹腸čļčĒŋč̜čļ…čˇŗéŠšé•ˇé ‚éŗĨå‹…æ—į›´æœ•æ˛ˆįčŗƒéŽŽé™ŗæ´Ĩåĸœæ¤Žæ§ŒčŋŊéŽšį—›é€šåĄšæ ‚æŽ´æ§ģäŊƒæŧŦ柘čžģč”Ļįļ´é”æ¤ŋæŊ°åĒåŖˇåŦŦį´ŦįˆĒåŠé‡Ŗéļ´äē­äŊŽåœåĩå‰ƒč˛žå‘ˆå ¤åŽšå¸åē•åē­åģˇåŧŸæ‚ŒæŠĩæŒē提æĸ¯æą€įĸ‡įĻŽį¨‹įˇ č‰‡č¨‚čĢĻ蹄逓"],["c5a1","邸鄭釘éŧŽæŗĨ摘æ“ĸæ•ĩæģ´įš„įŦ›éŠé‘æēēå“˛åžšæ’¤čŊčŋ­é‰„å…¸åĄĢå¤Šåą•åē—æˇģįēį”œč˛ŧčģĸéĄ›į‚šäŧæŽŋæžąį”°é›ģ兎吐å ĩåĄ—åĻŦåą åž’æ–—æœæ¸Ąį™ģčŸčŗ­é€”éƒŊ鍍į Ĩį ēåŠĒåēĻ土åĨ´æ€’倒党å†Ŧå‡åˆ€å”åĄ”åĄ˜åĨ—厕åŗļå‚ŧæŠ•æ­æąæĄƒæĸŧæŖŸį›—æˇ˜æš¯æļ›į¯į‡ˆåŊ“į—˜įĨˇį­‰į­”į­’įŗ–įĩąåˆ°"],["c6a1","č‘Ŗč•Šč—¤č¨ŽčŦ„čą†č¸é€ƒé€é™é™ļé ­é¨°é—˜åƒå‹•åŒå ‚å°Žæ†§æ’žæ´žįžŗįĢĨčƒ´č„é“éŠ…åŗ é´‡åŒŋåž—åžŗæļœį‰šįŖįĻŋį¯¤æ¯’į‹ŦčĒ­æ ƒæŠĄå‡¸įĒæ¤´åąŠéŗļč‹Ģå¯…é…‰į€žå™¸åą¯æƒ‡æ•Ļæ˛Œčąšéé “呑曇鈍åĨˆé‚Ŗå†…䚍å‡Ē薙čŦŽį˜æē鍋æĨĸéĻ´į¸„į•ˇå—æĨ čģŸé›ŖæąäēŒå°ŧåŧčŋŠåŒ‚čŗ‘č‚‰č™šåģŋæ—Ĩäšŗå…Ĩ"],["c7a1","åĻ‚å°ŋ韮äģģåϊåŋčĒæŋĄįϰįĨĸå¯§č‘ąįŒĢį†ąåš´åŋĩæģæ’šį‡ƒį˛˜äšƒåģŧ䚋埜åšĸ悊æŋƒį´čƒŊ脺č†ŋ螲čĻ—čš¤åˇ´æŠŠæ’­čĻ‡æˇæŗĸæ´žįļį ´åŠ†įŊĩ芭éĻŦäŋŗå샿‹æŽ’æ•—æ¯į›ƒį‰ŒčƒŒč‚ēčŧŠé…å€åŸšåĒ’æĸ…æĨŗį…¤į‹Ŋ螎媞躠é™Ē這čŋį§¤įŸ§čŠäŧ¯å‰Ĩåšæ‹æŸæŗŠį™ŊįŽ”į˛•čˆļ薄čŋĢæ›æŧ įˆ†į¸›čŽĢ駁éēĻ"],["c8a1","å‡ŊįŽąįĄ˛įŽ¸č‚‡į­ˆæĢ¨åšĄč‚Œį•‘į• å…Ģé‰ĸæēŒį™ē醗éĢĒäŧįŊ°æŠœį­é–ĨéŗŠå™ēåĄ™č›¤éšŧäŧ´åˆ¤åŠåå›å¸†æŦ斑æŋæ°žæąŽį‰ˆįŠ¯į­į•”įščˆŦč—Šč˛Šį¯„é‡†į…Šé ’éŖ¯æŒŊ晊į•Ēį›¤įŖč•ƒč›ŽåŒĒ卑åĻåσåē‡åŊŧæ‚˛æ‰‰æ‰šæŠĢæ–æ¯”æŗŒį–˛įšŽįĸ‘į§˜įˇ‹įŊˇč‚ĨčĸĢčĒšč˛ģéŋéžéŖ›æ¨‹į°¸å‚™å°žåžŽæž‡æ¯˜įĩįœ‰įžŽ"],["c9a1","éŧ쿟Šį¨—åŒšį–‹éĢ­åŊĻ膝菱肘åŧŧåŋ…į•ĸį­†é€ŧæĄ§å§ĢåĒ›į´į™žčŦŦäŋĩåŊĒæ¨™æ°ˇæŧ‚į“ĸįĨ¨čĄ¨čŠ•čąšå쟿į—…į§’č‹—éŒ¨é‹˛č’œč›­é°­å“åŊŦ斌æĩœį€•螧躓é ģ敏į“ļ不äģ˜åŸ å¤ĢåŠĻ富冨布å眿€–æ‰ļæ•ˇæ–§æ™ŽæĩŽįˆļįŦĻ腐膚芙譜負čŗĻčĩ´é˜œé™„䞎æ’Ģæ­Ļ舞葡č•Ē部封æĨ“éĸ¨č‘ē蕗äŧå‰¯åžŠåš…æœ"],["caa1","įĻč…šč¤‡čφæˇĩåŧ—æ‰•æ˛¸äģį‰ŠéŽ’åˆ†åģ噴åĸŗæ†¤æ‰Žį„šåĨŽį˛‰įŗžį´›é›°æ–‡čžä¸™äŊĩå…ĩåĄ€åšŖåšŗåŧŠæŸ„ä¸Ļč”Ŋé–‰é™›įąŗé åƒģ媁ᙖįĸ§åˆĨįžĨč”‘įŽ†åå¤‰į‰‡į¯‡įˇ¨čžēčŋ”遍äžŋ勉娊åŧéž­äŋčˆ—é‹Ē圃捕歊į”Ģ誜čŧ”įŠ‚å‹Ÿåĸ“慕戊暎母į°ŋčŠå€Ŗäŋ¸åŒ…å‘†å ąåĨ‰åŽåŗ°åŗ¯å´Šåē–æŠąæ§æ”žæ–šæœ‹"],["cba1","æŗ•æŗĄįƒšį ˛į¸ĢčƒžčŠŗčŒč“Ŧ蜂褒č¨Ē豊é‚Ļ鋒éŖŊéŗŗéĩŦ䚏äēĄå‚å‰–坊åύå¸Ŋåŋ˜åŋ™æˆŋæš´æœ›æŸæŖ’å†’į´Ąč‚Ē膨čŦ€č˛Œč˛ŋé‰žé˜˛å é Ŧ北僕卜åĸ¨æ’˛æœ´į‰§įĻįŠ†é‡Ļå‹ƒæ˛ĄæŽ†å €åšŒåĨ”æœŦįŋģå‡Ąį›†æ‘ŠįŖ¨é­”éēģ埋åĻšæ˜§æžšæ¯Žå“Šæ§™åš•č†œæž•éŽĒæŸžéą’æĄäēĻäŋŖåˆæŠšæœĢæ˛Ģčŋ„äž­įš­éēŋ万æ…ĸæē€"],["cca1","æŧĢ蔓呺æœĒé­…åˇŗįŽ•å˛Ŧå¯†čœœæšŠč“‘į¨”č„ˆåĻ™į˛æ°‘įœ å‹™å¤ĸį„Ąį‰ŸįŸ›éœ§éĩĄæ¤‹åŠŋ娘å†Ĩ名å‘Ŋæ˜Žį›ŸčŋˇéŠ˜éŗ´å§Ēį‰æģ…å…æŖ‰įļŋįˇŦéĸéēēæ‘¸æ¨ĄčŒ‚åĻ„å­Ÿæ¯›įŒ›į›˛įļ˛č€—č’™å„˛æœ¨éģ™į›Žæĸå‹ŋ餅尤æˆģįąžč˛°å•æ‚ļį´‹é–€åŒäšŸå†ļ夜įˆēč€ļ野åŧĨįŸĸ厄åŊšį´„č–Ŧ荺čēé–æŸŗč–Žé‘“æ„‰æ„ˆæ˛šį™’"],["cda1","čĢ­čŧ¸å”¯äŊ‘å„Ē勇友åŽĨåšŊ悠憂揖有柚暧æļŒįŒļįŒˇį”ąįĨčŖ•čĒ˜éŠé‚‘éƒĩé›„čžå¤•äēˆäŊ™ä¸Žčljčŧŋ預傭åšŧåĻ–åŽšå珿šæē擁曜æĨŠæ§˜æ´‹æēļᆔᔍįĒ¯įžŠč€€č‘‰č“‰čρčŦĄč¸ŠéĨé™Ŋ養慞抑æŦ˛æ˛ƒæĩ´įŋŒįŋŧæˇ€įž…čžēčŖ¸æĨ莱é ŧé›ˇæ´›įĩĄčŊé…ĒäšąåĩåĩæŦ„æŋĢ藍蘭čĻ§åˆŠååąĨ李æĸ¨į†į’ƒ"],["cea1","į—ĸčŖčŖĄé‡Œé›ĸé™¸åž‹įŽ‡įĢ‹č‘ŽæŽ į•Ĩ劉æĩæēœį‰į•™įĄĢį˛’éš†įĢœéžäžļæ…Žæ—…č™œäē†äēŽåƒšä¸Ąå‡Œå¯Žæ–™æĸæļŧįŒŸį™‚įž­į¨œįŗ§č‰¯čĢ’éŧ量é™ĩé ˜åŠ›įˇ‘å€ĢåŽ˜æž—æˇ‹į‡įŗč‡¨čŧĒéšŖéą—éēŸį‘ åĄæļ™į´¯éĄžäģ¤äŧļäž‹å†ˇåŠąåļ翀œįޞį¤ŧ苓鈴隷é›ļ霊éē—éŊĸæšĻæ­´åˆ—åŠŖįƒˆčŖ‚å쉿‹æ†æŧŖį…‰į°žįˇ´č¯"],["cfa1","č“Žé€ŖéŒŦ呂魯æĢ“į‚‰čŗ‚čˇ¯éœ˛åŠ´åЁåģŠåŧ„朗æĨŧæĻ”æĩĒæŧį‰ĸį‹ŧį¯­č€čžč‹éƒŽå…­éē“įĻ„č‚‹éŒ˛čĢ–å€­å’ŒčŠąæ­Ēčŗ„č„‡æƒ‘æž éˇ˛äē™äē˜é°čŠĢč—č•¨æ¤€æšžįĸ—č…•"],["d0a1","åŧŒä¸ä¸•ä¸Ē丹ä¸ļä¸ŧä¸ŋ乂乖乘äē‚äē…čąĢäēŠčˆ’åŧäēŽäēžäēŸäē äēĸäē°äēŗäēļäģŽäģäģ„äģ†äģ‚äģ—äģžäģ­äģŸäģˇäŧ‰äŊšäŧ°äŊ›äŊäŊ—äŊ‡äŊļ侈侏侘äŊģäŊŠäŊ°äž‘äŊ¯äž†äž–儘äŋ”äŋŸäŋŽäŋ˜äŋ›äŋ‘äŋšäŋäŋ¤äŋĨ倚倨倔å€Ēå€Ĩ倅äŧœäŋļå€Ąå€Šå€Ŧäŋžäŋ¯å€‘倆偃假會偕偐偈做偖åŦå¸å‚€å‚šå‚…å‚´å‚˛"],["d1a1","åƒ‰åƒŠå‚ŗåƒ‚åƒ–åƒžåƒĨåƒ­åƒŖåƒŽåƒšåƒĩå„‰å„å„‚å„–å„•å„”å„šå„Ąå„ē儎å„ŧå„ģå„ŋ兀兒兌兔å…ĸįĢ¸å…Šå…Ē兎冀冂囘册冉冏冑冓冕冖冤å†Ļå†ĸ冊å†Ēå†Ģå†ŗå†ąå†˛å†°å†ĩå†Ŋå‡…å‡‰å‡›å‡ č™•å‡Šå‡­å‡°å‡ĩ凞刄刋刔刎刧åˆĒåˆŽåˆŗåˆšå‰å‰„å‰‹å‰Œå‰žå‰”å‰Ēå‰´å‰Šå‰ŗå‰ŋå‰ŊåŠåŠ”åŠ’å‰ąåŠˆåŠ‘čž¨"],["d2a1","čž§åŠŦ劭åŠŧåŠĩå‹å‹å‹—å‹žå‹Ŗå‹Ļ骭勠勺å‹ĩå‹¸å‹šåŒ†åŒˆį”¸åŒåŒåŒåŒ•åŒšåŒŖåŒ¯åŒąåŒŗåŒ¸å€å†å…ä¸—å‰åå‡–åžåŠåŽå¤˜åģåˇåŽ‚åŽ–åŽ åŽĻåŽĨ厎厰åŽļåƒį°’é›™åŸæ›ŧį‡ŽåŽå¨å­åē吁åŊ呀åŦ吭åŧ后åļ吊吝呎咏å‘ĩå’Žå‘Ÿå‘ąå‘ˇå‘°å’’å‘ģ咀å‘ļ咄咐咆哇å’ĸ咸å’Ĩå’Ŧ哄哈咨"],["d3a1","å’Ģ哂咤咞å’ŧ哘å“Ĩå“Ļ唏唔å“Ŋ哎哭å“ēå“ĸå”šå•€å•Ŗå•Œå”Žå•œå•…å•–å•—å”¸å”ŗå•å–™å–€å’¯å–Šå–Ÿå•ģ啞喘喞喎å•ŧå–ƒå–Šå–‡å–¨å—šå—…å—Ÿå—„å—œå—¤å—”å˜”å—ˇå˜–å—žå—Ŋå˜›å—šå™Žå™į‡Ÿå˜´å˜ļ嘞嘏å™Ģ噤嘯å™Ŧå™Ē嚆嚀嚊嚠嚔嚏åšĨ嚎åšļ嚴囂åšŧ囁囃囀囈囎囑囓囗囎囚圀å›ŋ圄圉"],["d4a1","圈國圍圓團圖嗇圜åœĻåœˇåœ¸åŽåœģå€ååŠåŸ€åžˆåĄåŋåž‰åž“åž åžŗåž¤åžĒåž°åŸƒåŸ†åŸ”åŸ’åŸ“å ŠåŸ–åŸŖå ‹å ™å åĄ˛å ĄåĄĸåĄ‹åĄ°æ¯€åĄ’å ŊåĄšåĸ…åĸšåĸŸåĸĢåĸēåŖžåĸģåĸ¸åĸŽåŖ…åŖ“åŖ‘åŖ—åŖ™åŖ˜åŖĨ媜媤媟媝åŖēåŖšåŖģåŖŧåŖŊ夂夊夐夛æĸĻå¤Ĩå¤Ŧå¤­å¤˛å¤¸å¤žįĢ’åĨ•åĨåĨŽåĨšåĨ˜åĨĸåĨ åĨ§åĨŦåĨŠ"],["d5a1","åĨ¸åρåĻäŊžäžĢåĻŖåĻ˛å§†å§¨å§œåĻå§™å§šå¨Ĩ娟娑娜娉娚劀åŠŦ劉å¨ĩå¨ļåŠĸåŠĒåǚåĒŧåĒžåĢ‹åĢ‚åĒŊåĢŖåĢ—åĢĻåĢŠåĢ–åĢēåĢģåŦŒåŦ‹åŦ–åŦ˛å̐åŦĒåŦļåŦžå­ƒå­…孀孑孕孚孛å­Ĩå­Šå­°å­ŗå­ĩ學斈å­ē厀厃åŽĻ厸寃寇寉寔寐寤å¯Ļå¯ĸ寞å¯Ĩå¯Ģ寰å¯ļå¯ŗå°…å°‡å°ˆå°å°“å° å°ĸå°¨å°¸å°šåąåą†åąŽåą“"],["d6a1","åąåąå­ąåąŦåąŽäšĸåąļåąšå˛Œå˛‘å˛”åĻ›å˛Ģå˛ģå˛ļå˛ŧå˛ˇåŗ…å˛žåŗ‡åŗ™åŗŠåŗŊåŗēåŗ­åļŒåŗĒ崋崕崗åĩœå´Ÿå´›å´‘å´”å´ĸ崚崙崘åĩŒåĩ’åĩŽåĩ‹åĩŦåĩŗåĩļåļ‡åļ„åļ‚åļĸåļåļŦåļŽåļŊåļåļˇåļŧåˇ‰åˇåˇ“åˇ’åˇ–åˇ›åˇĢ厞åˇĩ帋帚帙帑帛å¸ļå¸ˇåš„åšƒåš€åšŽåš—åš”åšŸåšĸ嚤嚇åšĩåšļåšēéēŧåšŋåē åģåģ‚åģˆåģåģ"],["d7a1","åģ–åģŖåģåģšåģ›åģĸåģĄåģ¨åģŠåģŦåģąåģŗåģ°åģ´åģ¸åģžåŧƒåŧ‰åŊåŊœåŧ‹åŧ‘åŧ–åŧŠåŧ­åŧ¸åŊåŊˆåŊŒåŊŽåŧ¯åŊ‘åŊ–åŊ—åŊ™åŊĄåŊ­åŊŗåŊˇåžƒåž‚åŊŋ垊垈垑垇垞垙垘垠垨垭åžŧåŋ–åŋģåŋ¤åŋ¸åŋąåŋæ‚ŗåŋŋæ€Ąæ æ€™æ€æ€Šæ€Žæ€ąæ€›æ€•æ€Ģæ€Ļ怏æ€ē恚恁æĒæˇæŸæŠæ†ææŖæƒæ¤æ‚æŦæĢ恙悁悍惧悃悚"],["d8a1","æ‚„æ‚›æ‚–æ‚—æ‚’æ‚§æ‚‹æƒĄæ‚¸æƒ æƒ“æ‚´åŋ°æ‚Ŋ惆æ‚ĩ惘慍愕愆æƒļæƒˇæ„€æƒ´æƒēæ„ƒæ„Ąæƒģæƒąæ„æ„Žæ…‡æ„žæ„¨æ„§æ…Šæ„ŋæ„ŧæ„Ŧ愴æ„Ŋæ…‚æ…„æ…ŗæ…ˇæ…˜æ…™æ…šæ…Ģ慴慯æ…Ĩæ…ąæ…Ÿæ…æ…“æ…ĩ憙憖憇æ†Ŧ憔憚憊憑æ†Ģæ†Žæ‡Œæ‡Šæ‡‰æ‡ˇæ‡ˆæ‡ƒæ‡†æ†ē懋įŊšæ‡æ‡Ļæ‡Ŗæ‡ļæ‡ē懴æ‡ŋæ‡Ŋæ‡ŧ懞戀戈戉戍戌戔戛"],["d9a1","æˆžæˆĄæˆĒæˆŽæˆ°æˆ˛æˆŗæ‰æ‰Žæ‰žæ‰Ŗæ‰›æ‰ æ‰¨æ‰ŧ抂抉扞抒抓抖拔抃抔拗拑æŠģ拏æ‹ŋæ‹†æ“”æ‹ˆæ‹œæ‹Œæ‹Šæ‹‚æ‹‡æŠ›æ‹‰æŒŒæ‹Žæ‹ąæŒ§æŒ‚æŒˆæ‹¯æ‹ĩ捐挞捍搜捏掖掎掀æŽĢæļæŽŖæŽæŽ‰æŽŸæŽĩæĢæŠæŽžæŠæ€æ†æŖæ‰æ’æļ揄搖搴搆搓æĻæļ攝搗搨搏摧摯æ‘ļ摎æ”Ē撕撓æ’Ĩæ’Šæ’ˆæ’ŧ"],["daa1","據擒擅擇æ’ģæ“˜æ“‚æ“ąæ“§čˆ‰æ“ æ“ĄæŠŦæ“Ŗæ“¯æ”Ŧæ“ļæ“´æ“˛æ“ē攀æ“Ŋæ”˜æ”œæ”…æ”¤æ”Ŗæ”Ģ攴æ”ĩæ”ˇæ”ļæ”¸į•‹æ•ˆæ•–æ••æ•æ•˜æ•žæ•æ•˛æ•¸æ–‚æ–ƒčŽŠæ–›æ–Ÿæ–Ģæ–ˇæ—ƒæ—†æ—æ—„æ—Œæ—’æ—›æ—™æ— æ—Ąæ—ąæ˛æ˜Šæ˜ƒæ—ģæŗæ˜ĩæ˜ļ昴昜晏晄晉晁晞晝晤晧晨晟æ™ĸ晰暃暈暎暉暄暘暝曁暚曉暞æšŧ"],["dba1","曄暸曖曚曠æ˜ŋæ›Ļ曊曰æ›ĩæ›ˇæœæœ–æœžæœĻ朧霸朎æœŋæœļææœ¸æœˇæ†æžæ æ™æŖæ¤æž‰æ°æžŠæŧæĒ枌枋æžĻæžĄæž…æžˇæŸ¯æž´æŸŦæžŗæŸŠæž¸æŸ¤æŸžæŸæŸĸ柎枚柎柆柧æĒœæ žæĄ†æ ŠæĄ€æĄæ ˛æĄŽæĸŗæ ĢæĄ™æĄŖæĄˇæĄŋæĸŸæĸæĸ­æĸ”æĸæĸ›æĸƒæĒŽæĸšæĄ´æĸĩæĸ æĸ翤æĸæĄžæ¤æŖŠæ¤ˆæŖ˜æ¤ĸæ¤ĻæŖĄæ¤ŒæŖ"],["dca1","æŖ”æŖ§æŖ•æ¤ļæ¤’æ¤„æŖ—æŖŖæ¤ĨæŖšæŖ æŖ¯æ¤¨æ¤Ēæ¤šæ¤Ŗæ¤ĄæŖ†æĨšæĨˇæĨœæĨ¸æĨĢæĨ”æĨžæĨŽæ¤šæĨ´æ¤ŊæĨ™æ¤°æĨĄæĨžæĨæĻæĨǿϞæĻŽæ§æĻŋ槁槓æĻžæ§Žå¯¨æ§Šæ§æĻģæ§ƒæĻ§æ¨ŽæĻ‘æĻ æĻœæĻ•æĻ´æ§žæ§¨æ¨‚樛æ§ŋæŦŠæ§šæ§˛æ§§æ¨…æĻ࿍žæ§­æ¨”æ§Ģ樊樒æĢæ¨Ŗæ¨“æŠ„æ¨ŒæŠ˛æ¨ļ抸抇æŠĸ抙æŠĻ抈樸æ¨ĸæĒæĒæĒ æĒ„æĒĸæĒŖ"],["dda1","æĒ—č˜—æĒģæĢƒæĢ‚æĒ¸æĒŗæĒŦæĢžæĢ‘æĢŸæĒǿ̚æĢĒæĢģæŦ…č˜–æĢēæŦ’æŦ–éŦąæŦŸæŦ¸æŦˇį›œæŦšéŖŽæ­‡æ­ƒæ­‰æ­æ­™æ­”æ­›æ­Ÿæ­Ąæ­¸æ­šæ­ŋ掀掄掃掍掘掕掞掤æŽĒæŽĢæŽ¯æŽ˛æŽąæŽŗæŽˇæŽŧ毆毋毓毟æ¯Ŧæ¯Ģæ¯ŗæ¯¯éēžæ°ˆæ°“æ°”æ°›æ°¤æ°Ŗæąžæą•æąĸæąĒæ˛‚æ˛æ˛šæ˛æ˛›æąžæą¨æąŗæ˛’æ˛æŗ„æŗąæŗ“æ˛Ŋæŗ—æŗ…æŗæ˛Žæ˛ąæ˛ž"],["dea1","æ˛ēæŗ›æŗ¯æŗ™æŗĒæ´ŸčĄæ´ļæ´Ģæ´Ŋ洸洙æ´ĩæ´ŗæ´’æ´ŒæĩŖæļ“æĩ¤æĩšæĩšæĩ™æļ޿ŋ¤æļ…æˇšæ¸•æ¸Šæļĩæˇ‡æˇĻæļ¸æˇ†æˇŦæˇžæˇŒæˇ¨æˇ’æˇ…æˇēæˇ™æˇ¤æˇ•æˇĒæˇŽæ¸­æšŽæ¸Žæ¸™æš˛æšŸæ¸žæ¸ŖæšĢæ¸Ģæšļ暍渟暃æ¸ē暎渤æģŋ渝游æē‚æēĒæē˜æģ‰æēˇæģ“æēŊæē¯æģ„æē˛æģ”æģ•æēæēĨæģ‚æēŸæŊæŧ‘įŒæģŦæģ¸æģžæŧŋæģ˛æŧąæģ¯æŧ˛æģŒ"],["dfa1","æŧžæŧ“æģˇæž†æŊēæŊ¸æžæž€æŊ¯æŊ›æŋŗæŊ­æž‚æŊŧæŊ˜æžŽæž‘æŋ‚æŊĻæžŗæžŖæžĄæž¤æžšæŋ†æžĒæŋŸæŋ•æŋŦæŋ”æŋ˜æŋąæŋŽæŋ›į€‰į€‹æŋēį€‘į€į€æŋžį€›į€šæŊ´į€į€˜į€Ÿį€°į€žį€˛į‘įŖį‚™į‚’į‚¯įƒąį‚Ŧį‚¸į‚ŗį‚ŽįƒŸįƒ‹įƒįƒ™į„‰įƒŊį„œį„™į…Ĩį…•į†ˆį…Ļį…ĸį…Œį…–į…Ŧį†į‡ģᆄᆕᆍį†Ŧį‡—į†šį†žį‡’į‡‰į‡”į‡Žį‡ į‡Ŧᇧį‡ĩį‡ŧ"],["e0a1","į‡šį‡ŋįˆįˆįˆ›įˆ¨įˆ­įˆŦሰሞįˆģįˆŧįˆŋį‰€į‰†į‰‹į‰˜į‰´į‰žįŠ‚įŠįŠ‡įŠ’įŠ–įŠĸįŠ§įŠšįŠ˛į‹ƒį‹†į‹„į‹Žį‹’į‹ĸį‹ į‹Ąį‹šį‹ˇå€įŒ—įŒŠįŒœįŒ–įŒįŒ´įŒ¯įŒŠįŒĨįŒžįŽįéģ˜į—įĒį¨į°į¸įĩįģįēįˆįŽŗįŽįŽģį€įĨįŽįžį’ĸᐅᑝįĨį¸į˛įēį‘•įŋį‘Ÿį‘™į‘į‘œį‘Šį‘°į‘Ŗį‘Ēį‘ļį‘žį’‹į’žį’§į“Šį“į“”įą"],["e1a1","į“ į“Ŗį“§į“Šį“Žį“˛į“°į“ąį“¸į“ˇį”„į”ƒį”…į”Œį”Žį”į”•į”“į”žį”Ļį”Ŧį”ŧį•„į•į•Šį•‰į•›į•†į•šį•Šį•¤į•§į•Ģᕭᕏį•ļį–†į–‡į•´į–Šį–‰į–‚į–”į–šį–į–Ĩį–Ŗį—‚į–ŗį—ƒį–ĩį–Ŋį–¸į–ŧį–ąį—į—Šį—’į—™į—Ŗį—žį—žį—ŋį—ŧį˜į—°į—ēį—˛į—ŗį˜‹į˜į˜‰į˜Ÿį˜§į˜ į˜Ąį˜ĸᘤᘴᘰį˜ģį™‡į™ˆį™†į™œį™˜į™Ąį™ĸį™¨į™Šį™Ēį™§į™Ŧį™°"],["e2a1","ᙞį™ļᙏį™ŧįš€įšƒįšˆįš‹įšŽįš–įš“įš™įššįš°įš´įš¸įššįšēį›‚į›į›–į›’į›žį›Ąį›Ĩį›§į›Ē蘝į›ģįœˆįœ‡įœ„įœŠįœ¤įœžįœĨįœĻįœ›įœˇįœ¸į‡įšį¨įĢį›įĨįŋįžįšįžŽįž‹įž‘įž įžžįž°įžļįžšįžŋįžŧįžŊįžģįŸ‡įŸįŸ—įŸšįŸœįŸŖįŸŽįŸŧį Œį ’į¤Ļį  į¤ĒįĄ…įĸŽįĄ´įĸ†įĄŧįĸšįĸŒįĸŖįĸĩįĸĒįĸ¯įŖ‘᪆᪋᪔įĸžįĸŧįŖ…įŖŠįŖŦ"],["e3a1","ᪧ᪚įŖŊ᪴ᤇᤒᤑᤙį¤Ŧį¤ĢįĨ€įĨ įĨ—įĨŸįĨšįĨ•įĨ“įĨēįĨŋįϊįĻįϧéŊ‹įĻĒįĻŽįĻŗįĻšįĻēᧉ᧕᧧į§Ŧį§Ąį§Ŗį¨ˆį¨į¨˜į¨™į¨ į¨ŸįĻ€į¨ąį¨ģį¨žį¨ˇįŠƒįŠ—įŠ‰įŠĄįŠĸįŠŠéžįŠ°įŠšįŠŊįLjįĒ—įĒ•įǘįĒ–įĒŠį̈įǰįĒļįĢ…įĢ„įĒŋ邃į̇į̊įĢįĢįĢ•įĢ“įĢ™į̚įĢįĢĄįĢĸįĢĻįĢ­į̰įŦ‚įŦįŦŠįŦ†įŦŗįŦ˜įŦ™įŦžįŦĩįŦ¨įŦļ᭐"],["e4a1","į­ēįŦ„į­įŦ‹į­Œį­…į­ĩį­Ĩį­´į­§į­°į­ąį­Ŧį­ŽįŽįŽ˜įŽŸįŽįŽœįŽšįŽ‹įŽ’įŽį­įŽ™į¯‹į¯į¯Œį¯įŽ´į¯†į¯į¯Šį°‘į°”į¯Ļį¯Ĩįą į°€į°‡į°“į¯ŗį¯ˇį°—į°į¯ļį°Ŗį°§į°Ēᰟᰎį°Ģį°ŊįąŒįąƒįą”įąįą€įąįą˜įąŸįą¤įą–įąĨįąŦįąĩឃថឤឭį˛ĸį˛Ģį˛Ąį˛¨į˛ŗį˛˛į˛ąį˛Žį˛šį˛Ŋįŗ€įŗ…įŗ‚įŗ˜įŗ’įŗœįŗĸéŦģẝẞẴįŗļįŗēį´†"],["e5a1","į´‚į´œį´•į´Šįĩ…įĩ‹į´Žį´˛į´ŋį´ĩįĩ†įĩŗįĩ–įĩŽįĩ˛įĩ¨įĩŽįĩįĩŖįļ“įļ‰įĩ›įļįĩŊįļ›įļēįļŽįļŖįļĩᎇįļŊįļĢį¸Ŋįļĸįļ¯įˇœįļ¸įļŸįļ°įˇ˜įˇįˇ¤įˇžįˇģįˇ˛įˇĄį¸…į¸Šį¸Ŗį¸Ąį¸’į¸ąį¸Ÿį¸‰į¸‹į¸ĸįš†įšĻį¸ģį¸ĩį¸šįšƒį¸ˇį¸˛į¸ēįš§įšįš–įšžįš™įššįššįšĒįšŠįšŧįšģįēƒįˇ•įšŊ螎įšŋįēˆįē‰įēŒįē’įēįē“įē”įē–įēŽįē›įēœįŧ¸įŧē"],["e6a1","įŊ…įŊŒįŊįŊŽįŊįŊ‘įŊ•įŊ”įŊ˜įŊŸįŊ įŊ¨įŊŠįŊ§įŊ¸įž‚įž†įžƒįžˆįž‡įžŒįž”įžžįžįžšįžŖįž¯įž˛įžšįžŽįžļįž¸č­ąįŋ…įŋ†įŋŠįŋ•įŋ”įŋĄįŋĻįŋŠįŋŗįŋšéŖœč€†č€„č€‹č€’č€˜č€™č€œč€Ąč€¨č€ŋč€ģ聊聆聒聘聚聟čĸ聍聺聞聰čļ聚čŊčŋč‚„č‚†č‚…č‚›č‚“č‚šč‚­å†č‚Ŧ胛čƒĨčƒ™čƒčƒ„čƒščƒ–č„‰čƒ¯čƒąč„›č„Šč„Ŗč„¯č…‹"],["e7a1","隋腆脾腓腑čƒŧ腱腮č…Ĩč…Ļč…´č†ƒč†ˆč†Šč†€č†‚č† č†•č†¤č†Ŗč…Ÿč†“č†Šč†°č†ĩ膾膸č†Ŋ臀臂č†ē臉臍臑臙臘臈臚臟臠臧č‡ēč‡ģ臾舁舂舅與舊舍舐舖舩čˆĢčˆ¸čˆŗč‰€č‰™č‰˜č‰č‰šč‰Ÿč‰¤č‰ĸ艨č‰Ēč‰Ģ舮艱艷艸艾芍芒čŠĢ芟čŠģčŠŦč‹Ąč‹Ŗč‹Ÿč‹’č‹´č‹ŗč‹ē莓范č‹ģ苹苞茆苜茉苙"],["e8a1","čŒĩčŒ´čŒ–čŒ˛čŒąč€čŒščč…čŒ¯čŒĢ茗茘莅莚čŽĒ莟čŽĸčŽ–čŒŖčŽŽčŽ‡čŽŠčŧčŽĩčŗčĩ莠莉莨菴萓čĢ菎čŊ萃菘萋菁菷萇菠菲萍čĸ萠čŽŊ萸蔆čģ葭čĒčŧ蕚蒄葷č‘Ģ蒭葮蒂葩葆čŦč‘¯č‘ščĩ蓊č‘ĸ蒹č’ŋ蒟蓙蓍č’ģ蓚蓐蓁蓆蓖蒡蔡č“ŋ蓴蔗蔘č”Ŧ蔟蔕蔔č“ŧč•€č•Ŗč•˜č•ˆ"],["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛č—Ē薇薜蕷蕾薐藉č–ē藏薹藐藕藝č—Ĩ藜藹蘊蘓蘋藾č—ē蘆č˜ĸ蘚蘰č˜ŋč™äš•č™”č™Ÿč™§č™ąčš“čšŖčšŠčšĒ蚋蚌čšļčš¯č›„č›†čš°č›‰č ŖčšĢ蛔蛞蛩č›Ŧč›Ÿč››č›¯čœ’čœ†čœˆčœ€čœƒč›ģ蜑蜉蜍蛹蜊蜴čœŋ蜎čœģčœĨ蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"],["eaa1","č“čŖčĒ蠅čžĸčžŸčž‚čž¯čŸ‹čžŊ蟀蟐雖čžĢčŸ„čžŗčŸ‡čŸ†čžģčŸ¯čŸ˛čŸ č č čŸžčŸļ蟷蠎蟒蠑蠖蠕č ĸč Ąč ąč ļč šč §č ģ衄衂衒衙衞čĄĸčĄĢčĸčĄžčĸžčĄĩčĄŊčĸĩ襲čĸ‚čĸ—čĸ’čĸŽčĸ™čĸĸčĸčĸ¤čĸ°čĸŋčĸąčŖƒčŖ„čŖ”čŖ˜čŖ™čŖčŖšč¤‚čŖŧčŖ´čŖ¨čŖ˛č¤„č¤Œč¤Šč¤“čĨƒč¤žč¤Ĩč¤Ēč¤ĢčĨčĨ„č¤ģč¤ļ褸čĨŒč¤čĨ čĨž"],["eba1","čĨĻčĨ¤čĨ­čĨĒčĨ¯čĨ´čĨˇčĨžčσčψčϊčĻ“čϘčĻĄčĻŠčĻĻčĻŦčϝčϞčĻēčĻŊčĻŋ觀觚觜觝觧觴觸訃訖訐訌訛訝č¨Ĩč¨ļ詁詛詒詆詈čŠŧ芭čŠŦčŠĸčĒ…čĒ‚čĒ„čǍčĒĄčĒ‘čĒĨčĒĻčǚčĒŖčĢ„čĢčĢ‚č̚čĢĢčĢŗç̌č̤čĢąčŦ”čĢ čĢĸč̎čĢžčĢ›čŦŒčŦ‡čŦščĢĄčŦ–čŦčŦ—čŦ čŦŗéžĢčŦĻčŦĢčŦžčŦ¨č­č­Œč­č­Žč­‰č­–譛譚č­Ģ"],["eca1","譟č­Ŧ譝譴č­Ŋ讀讌讎讒讓讖讙讚č°ē蹁č°ŋ豈豌豎豐豕čąĸčąŦ蹸čąē貂貉貅貊貍貎貔čąŧč˛˜æˆč˛­č˛Ēč˛Ŋč˛˛č˛ŗč˛Žč˛ļ躈躁躤躪躚čŗŊčŗēčŗģ贄贅贊贇贏贍贐éŊŽč´“čŗč´”č´–čĩ§čĩ­čĩąčĩŗčļčļ™čˇ‚čļžčļē跏跚跖跌跛跋čˇĒčˇĢ莟莪čˇŧ踈踉čˇŋ踝踞踐踟蹂č¸ĩ踰踴蹊"],["eda1","蹇蹉蹌蹐蹈蹙蹤蹠č¸ĒčšŖčš•čšļ蚲čšŧčēčē‡čē…čē„čē‹čēŠčē“čē‘čē”čē™čēĒčēĄčēŦčē°čģ†čēąčēžčģ…čģˆčģ‹čģ›čģŖčģŧčģģčģĢčģžčŧŠčŧ…čŧ•čŧ’čŧ™čŧ“čŧœčŧŸčŧ›čŧŒčŧĻčŧŗčŧģčŧščŊ…čŊ‚čŧžčŊŒčŊ‰čŊ†čŊŽčŊ—čŊœčŊĸčŊŖčŊ¤čžœčžŸčžŖčž­čž¯čžˇčŋščŋĨčŋĸčŋĒčŋ¯é‚‡čŋ´é€…čŋščŋē逑逕逡逍逞逖逋逧é€ļé€ĩ逹čŋ¸"],["eea1","遏遐遑遒逎遉逞遖遘遞遨遯éļ隨遲邂éŊé‚é‚€é‚Šé‚‰é‚é‚¨é‚¯é‚ąé‚ĩéƒĸéƒ¤æ‰ˆéƒ›é„‚é„’é„™é„˛é„°é…Šé…–é…˜é…Ŗé…Ĩé…Šé…ŗé…˛é†‹é†‰é†‚é†ĸé†Ģ醯é†Ēé†ĩ醴é†ē釀釁釉釋釐釖釟釡釛é‡ŧé‡ĩé‡ļ鈞é‡ŋ鈔éˆŦ鈕鈑鉞鉗鉅鉉鉤鉈銕éˆŋ鉋鉐銜銖銓銛鉚鋏銹銷鋩錏é‹ē鍄錮"],["efa1","錙éŒĸ錚錪éŒēéŒĩéŒģ鍜鍠éŧ鍮鍖鎰éŽŦ鎭鎔鎹鏖鏗鏨éĨ鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐éļéĢéĩ鐥éē鑁鑒鑄鑛鑠é‘ĸ鑞é‘Ē鈩鑰é‘ĩ鑷é‘Ŋ鑚é‘ŧ鑾钁é‘ŋ閂閇閊閔閖閘閙閠閨閧閭é–ŧé–ģ閹閾闊æŋļ闃闍闌闕闔闖關闡é—Ĩé—ĸé˜Ąé˜¨é˜Žé˜¯é™‚é™Œé™é™‹é™ˇé™œé™ž"],["f0a1","陝陟é™Ļ陲é™Ŧ隍隘隕隗éšĒ隧隱隲隰隴éšļ隸隹雎雋雉雍čĨé›œéœé›•雚霄霆霈霓霎霑霏霖霙霤éœĒ霰霹éœŊ霾靄靆靈靂靉靜靠靤éĻ靨勒éĢ靱靹鞅éŧ鞁éē鞆鞋鞏鞐鞜鞨éžĻéžŖéžŗéž´éŸƒéŸ†éŸˆéŸ‹éŸœéŸ­éŊéŸ˛į̟éŸļéŸĩ頏頌頸頤頡頷é Ŋ顆顏顋éĄĢéĄ¯éĄ°"],["f1a1","éĄąéĄ´éĄŗéĸĒéĸ¯éĸąéĸļéŖ„éŖƒéŖ†éŖŠéŖĢ餃餉餒餔餘餡餝餞餤餠é¤Ŧ餎é¤Ŋ餞éĨ‚éĨ‰éĨ…éĨéĨ‹éĨ‘éĨ’éĨŒéĨ•éĻ—éϘéĻĨéĻ­éĻŽéĻŧ駟駛駝駘駑駭駮駱駲é§ģ駸騁騏騅é§ĸ騙é¨Ģ騷驅驂驀驃騾驕驍驛驗驟éŠĸéŠĨ銤銊éŠĢéŠĒéĒ­éǰéĒŧéĢ€éĢéĢ‘éĢ“éĢ”éĢžé̟éĢĸéĢŖéĢĻé̝éĢĢéĢŽéĢ´éĢąé̎"],["f2a1","éĢģéŦ†éŦ˜éŦšéŦŸéŦĸéŦŖéŦĨéŦ§éŦ¨éŦŠéŦĒéŦŽéŦ¯éŦ˛é­„é­ƒé­é­é­Žé­‘é­˜é­´éŽ“éŽƒéŽ‘éŽ–éŽ—éŽŸéŽ éŽ¨éŽ´é¯€é¯ŠéŽšé¯†é¯é¯‘é¯’é¯Ŗé¯ĸé¯¤é¯”é¯Ąé°ēé¯˛é¯ąé¯°é°•é°”é°‰é°“é°Œé°†é°ˆé°’é°Šé°„é°Žé°›é°Ĩ鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧éąļéą¸éŗ§éŗŦéŗ°é´‰é´ˆéŗĢ鴃鴆é´Ēé´Ļéļ¯é´Ŗé´Ÿéĩ„é´•é´’éĩé´ŋé´žéĩ†éĩˆ"],["f3a1","éĩéĩžéĩ¤éĩ‘éĩéĩ™éĩ˛éļ‰éļ‡éļĢéĩ¯éĩēéļšéļ¤éļŠéļ˛éˇ„顁éļģéļ¸éļē鷆鷏鷂鷙鷓鷸éˇĻ鎭鎝éˇŊ鸚鸛鸞éšĩéššéšŊéēéēˆéē‹éēŒéē’éē•éē‘éēéēĨéēŠéē¸éēĒéē­éĄéģŒéģŽéģéģéģ”éģœéģžéģéģ éģĨéģ¨éģ¯éģ´éģļéģˇéģšéģģéģŧéģŊéŧ‡éŧˆįšˇéŧ•éŧĄéŧŦéŧžéŊŠéŊ’éŊ”éŊŖéŊŸéŊ éŊĄéŊĻéŊ§éŊŦéŊĒéŊˇéŊ˛éŊļ龕龜龠"],["f4a1","å ¯æ§‡é™į‘¤å‡œį†™"],["f9a1","įēŠč¤œéˆéŠˆč“œäŋ‰į‚ģæ˜ąæŖˆé‹šæ›ģåŊ…丨äģĄäģŧäŧ€äŧƒäŧšäŊ–䞒䞊䞚䞔äŋå€å€ĸäŋŋ倞偆偰偂傔僴僘兊兤冝冞å‡Ŧ刕劜åŠĻå‹€å‹›åŒ€åŒ‡åŒ¤å˛åŽ“åŽ˛åī¨Žå’œå’Šå’Šå“ŋ喆坙åĨåžŦåŸˆåŸ‡ī¨ī¨åĸžåĸ˛å¤‹åĨ“åĨ›åĨåĨŖåϤåĻēå­–å¯€į”¯å¯˜å¯Ŧ尞å˛Ļå˛ēåŗĩå´§åĩ“åĩ‚åĩ­åļ¸åļšåˇåŧĄåŧ´åŊ§åžˇ"],["faa1","åŋžææ‚…æ‚Šæƒžæƒ•æ„ æƒ˛æ„‘æ„ˇæ„°æ†˜æˆ“æŠĻæĩ摠撝擎敎昀昕æ˜ģ昉明昞昤æ™Ĩæ™—æ™™ī¨’æ™ŗæš™æš æš˛æšŋæ›ēæœŽī¤ŠæĻæžģæĄ’æŸ€æ æĄ„æŖī¨“æĨ¨ī¨”æĻ˜æ§ĸ樰æŠĢæŠ†æŠŗæŠžæĢĸæĢ¤æ¯–æ°ŋæąœæ˛†æą¯æŗšæ´„æļ‡æĩ¯æļ–æļŦæˇæˇ¸æˇ˛æˇŧ渚暜渧æ¸ŧæēŋ枈æžĩæŋĩစဇဍႅį‚Ģį„į„„į…œį…†į…‡ī¨•į‡į‡žįŠą"],["fba1","įŠžįŒ¤ī¨–įˇįŽŊį‰į–įŖį’į‡įĩįĻįĒįŠįŽį‘ĸį’‰į’Ÿį”į•¯įš‚įšœįšžįš›įšĻī¨—į†åŠ¯į ĄįĄŽįĄ¤įĄēį¤°ī¨˜ī¨™ī¨šįϔįĻ›įĢ‘į̧įĢĢįŽžī¨įĩˆįĩœįļˇįļ įˇ–įš’įŊ‡įžĄī¨žčŒčĸčŋ菇čļ葈蒴蕓蕙č•Ģī¨Ÿč–°ī¨ ī¨Ąč ‡čŖĩ訒訷詹čǧčĒžč̟ī¨ĸčĢļ譓č­ŋčŗ°čŗ´č´’čĩļčģī¨¤ī¨Ĩ遧郞ī¨Ļ鄕鄧釚"],["fca1","釗釞釭釮釤é‡Ĩ鈆鈐鈊éˆē鉀éˆŧé‰Žé‰™é‰‘éˆšé‰§éŠ§é‰ˇé‰¸é‹§é‹—é‹™é‹ī¨§é‹•é‹ é‹“éŒĨ錡é‹ģī¨¨éŒžé‹ŋéŒéŒ‚é°é—éŽ¤é†éžé¸éąé‘…é‘ˆé–’ī§œī¨Šéšéš¯éœŗéœģ靃靍靏靑靕顗éĄĨī¨Ēī¨Ģ餧ī¨ŦéĻžéŠŽéĢ™é̜é­ĩ魲鮏鮱éŽģ鰀éĩ°éĩĢ鏙éģ‘"],["fcf1","ⅰ",9,"īŋĸīŋ¤īŧ‡īŧ‚"],["8fa2af","˘ˇ¸˙˝¯˛˚īŊžÎ„Î…"],["8fa2c2","ÂĄÂĻÂŋ"],["8fa2eb","ÂēÂĒŠŽâ„ĸ¤№"],["8fa6e1","ΆΈΉΊÎĒ"],["8fa6e7","Ό"],["8fa6e9","ΎÎĢ"],["8fa6ec","Ώ"],["8fa6f1","ÎŦÎ­ÎŽÎ¯ĪŠÎĪŒĪ‚ĪĪ‹Î°ĪŽ"],["8fa7c2","Ђ",10,"ЎЏ"],["8fa7f2","Ņ’",10,"ŅžŅŸ"],["8fa9a1","ÆĐ"],["8fa9a4","ÄĻ"],["8fa9a6","IJ"],["8fa9a8","ŁÄŋ"],["8fa9ab","ŊØŒ"],["8fa9af","ÅĻÞ"],["8fa9c1","ÃĻÄ‘Ã°Ä§ÄąÄŗÄ¸Å‚Å€Å‰Å‹Ã¸Å“ÃŸÅ§Ãž"],["8faaa1","ÁÀÄÂĂĮÄ€Ä„ÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"],["8faaba","ĜĞÄĸĠĤÍÌÏÎĮÄ°ÄĒĎĨĴÄļÄšÄŊÄģŃŇŅÑÓÒÖÔĮ‘ŐŌÕŔŘŖŚŜŠŞŤÅĸÚÙÜÛÅŦĮ“ŰÅĒÅ˛ÅŽÅ¨Į—Į›Į™Į•ŴÝŸÅļÅšÅŊÅģ"],["8faba1","ÃĄÃ Ã¤ÃĸăĮŽÄÄ…ÃĨÃŖÄ‡Ä‰ÄÃ§Ä‹ÄÃŠÃ¨ÃĢÃĒěėēęĮĩĝğ"],["8fabbd","ÄĄÄĨíÃŦïÎĮ"],["8fabc5","ÄĢįĊÄĩġÄēÄžÄŧÅ„ÅˆÅ†ÃąÃŗÃ˛ÃļôĮ’őōÃĩÅ•Å™Å—Å›ÅÅĄÅŸÅĨÅŖÃēÚÃŧÃģÅ­Į”ÅąÅĢÅŗÅ¯ÅŠĮ˜ĮœĮšĮ–ÅĩÃŊÃŋŎÅēÅžÅŧ"],["8fb0a1","ä¸‚ä¸„ä¸…ä¸Œä¸’ä¸Ÿä¸Ŗä¸¤ä¸¨ä¸Ģ与丯丰ä¸ĩäš€äšäš„äš‡äš‘äššäšœäšŖäš¨äšŠäš´äšĩäššäšŋäēäē–äē—äēäē¯äēšäģƒäģäģšäģ›äģ äģĄäģĸäģ¨äģ¯äģąäģŗäģĩäģŊäģžäģŋäŧ€äŧ‚äŧƒäŧˆäŧ‹äŧŒäŧ’äŧ•äŧ–äŧ—äŧ™äŧŽäŧąäŊ äŧŗäŧĩäŧˇäŧšäŧģäŧžäŊ€äŊ‚äŊˆäŊ‰äŊ‹äŊŒäŊ’äŊ”äŊ–äŊ˜äŊŸäŊŖäŊĒäŊŦäŊŽäŊąäŊˇäŊ¸äŊšäŊēäŊŊäŊžäžäž‚äž„"],["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹äžģäžŧäžŊäžžäŋ€äŋäŋ…äŋ†äŋˆäŋ‰äŋ‹äŋŒäŋäŋäŋ’äŋœäŋ äŋĸäŋ°äŋ˛äŋŧäŋŊäŋŋ倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞å€ĸå€§å€Žå€°å€˛å€ŗå€ĩ偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠åĸ偪åĻ偧åĒå­å°åąå€ģ傁傃傄傆傊傎傏傐"],["8fb2a1","傒傓傔傖傛傜傞",4,"å‚Ē傯傰傚å‚ēå‚Ŋ僀僃僄僇僌僎僐僓僔僘僜僝僟åƒĸ僤åƒĻåƒ¨åƒŠåƒ¯åƒąåƒļåƒēåƒžå„ƒå„†å„‡å„ˆå„‹å„Œå„å„Žåƒ˛å„å„—å„™å„›å„œå„å„žå„Ŗå„§å„¨å„Ŧå„­å„¯å„ąå„ŗå„´å„ĩ儸儚兂兊兏兓兕兗兘兟兤å…Ļå…žå†ƒå†„å†‹å†Žå†˜å†å†Ąå†Ŗå†­å†¸å†ēå†ŧ冞å†ŋ凂"],["8fb3a1","凈减凑凒凓凕凘凞å‡ĸå‡Ĩå‡Žå‡˛å‡ŗå‡´å‡ˇåˆåˆ‚åˆ…åˆ’åˆ“åˆ•åˆ–åˆ˜åˆĸåˆ¨åˆąåˆ˛åˆĩåˆŧå‰…å‰‰å‰•å‰—å‰˜å‰šå‰œå‰Ÿå‰ å‰Ąå‰Ļå‰Žå‰ˇå‰¸å‰šåŠ€åŠ‚åŠ…åŠŠåŠŒåŠ“åŠ•åŠ–åŠ—åŠ˜åŠšåŠœåŠ¤åŠĨåŠĻ劧劯劰åŠļ劎劏åŠēåŠģåŠŊå‹€å‹„å‹†å‹ˆå‹Œå‹å‹‘å‹”å‹–å‹›å‹œå‹Ąå‹Ĩ勨勊å‹Ēå‹Ŧå‹°å‹ąå‹´å‹ļå‹ˇåŒ€åŒƒåŒŠåŒ‹"],["8fb4a1","匌匑匓匘匛匜匞匟åŒĨ匧匨匊åŒĢåŒŦ匭匰匞åŒĩåŒŧåŒŊåŒžå‚åŒå‹å™å›åĄåŖåĨåŦå­å˛åšåžåŽƒåŽ‡åŽˆåŽŽåŽ“åŽ”åŽ™åŽåŽĄåŽ¤åŽĒåŽĢåŽ¯åŽ˛åŽ´åŽĩåŽˇåŽ¸åŽēåŽŊ叀叅叏叒叓叕叚叝叞叠åĻ叧åĩå‚å“åšåĄå§å¨åĒå¯åąå´åĩ呃呄呇呍呏呞å‘ĸ呤å‘Ļ呧告å‘Ģ呭呎呴å‘ŋ"],["8fb5a1","å’å’ƒå’…å’ˆå’‰å’å’‘å’•å’–å’œå’Ÿå’Ąå’Ļå’§å’Šå’Ēå’­å’Žå’ąå’ˇå’šå’ēå’ģå’ŋ哆哊响哎哠å“Ēå“Ŧ哯å“ļå“ŧ哞å“ŋ唀唁唅唈唉唌唍唎唕å”Ēå”Ģ唞å”ĩå”ļå”ģå”ŧå”Ŋå•å•‡å•‰å•Šå•å•å•‘å•˜å•šå•›å•žå• å•Ąå•¤å•Ļå•ŋå–å–‚å–†å–ˆå–Žå–å–‘å–’å–“å–”å–—å–Ŗå–¤å–­å–˛å–ŋ嗁嗃嗆嗉嗋嗌嗎嗑嗒"],["8fb6a1","嗓嗗嗘嗛嗞å—ĸå—Šå—ļå—ŋ嘅嘈嘊嘍",5,"嘙å˜Ŧ嘰嘺å˜ĩå˜ˇå˜šå˜ģå˜ŧå˜Ŋå˜ŋå™€å™å™ƒå™„å™†å™‰å™‹å™å™å™”å™žå™ å™Ąå™ĸ噪å™Ļå™Šå™­å™¯å™ąå™˛å™ĩ嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟åšĻ嚧嚨嚊åšĢåšŦåš­åšąåšŗåšˇåšžå›…å›‰å›Šå›‹å›å›å›Œå›å›™å›œå›å›Ÿå›Ąå›¤",4,"å›ąå›Ģ园"],["8fb7a1","å›ļå›ˇåœåœ‚åœ‡åœŠåœŒåœ‘åœ•åœšåœ›åœåœ åœĸ圪圤åœĨ圊åœĒåœŦåœŽåœ¯åœŗåœ´åœŊ圞åœŋ坅坆坌坍坒åĸåĨ坧坨åĢ坭",4,"åŗå´åĩåˇåšåēåģåŧåžåžåžƒåžŒåž”åž—åž™åžšåžœåžåžžåžŸåžĄåž•åž§åž¨åžŠåžŦ垸åžŊ埇埈埌埏埕埝埞埤åŸĻ埧埊埭埰åŸĩåŸļ埸åŸŊ埞åŸŋå ƒå „å ˆå ‰åŸĄ"],["8fb8a1","堌堍堛堞堟堠å Ļå §å ­å ˛å šå ŋåĄ‰åĄŒåĄåĄåĄåĄ•åĄŸåĄĄåĄ¤åĄ§åĄ¨åĄ¸åĄŧåĄŋåĸ€åĸåĸ‡åĸˆåĸ‰åĸŠåĸŒåĸåĸåĸåĸ”åĸ–åĸåĸ åĸĄåĸĸåĸĻåĸŠåĸąåĸ˛åŖ„åĸŧåŖ‚åŖˆåŖåŖŽåŖåŖ’åŖ”åŖ–åŖšåŖåŖĄåŖĸåŖŠåŖŗå¤…å¤†å¤‹å¤Œå¤’å¤“å¤”č™å¤å¤Ąå¤Ŗå¤¤å¤¨å¤¯å¤°å¤ŗå¤ĩå¤ļå¤ŋåĨƒåĨ†åĨ’åĨ“åĨ™åĨ›åĨåĨžåĨŸåĨĄåĨŖåĨĢåĨ­"],["8fb9a1","åĨ¯åĨ˛åĨĩåĨļåĨšåĨģåĨŧåĻ‹åόåĻŽåĻ’åĻ•åĻ—åϟåϤåϧåĻ­åĻŽåϝåϰåĻŗåώåĻēåĻŧå§å§ƒå§„å§ˆå§Šå§å§’å§å§žå§Ÿå§Ŗå§¤å§§å§Žå§¯å§ąå§˛å§´å§ˇå¨€å¨„å¨Œå¨å¨Žå¨’å¨“å¨žå¨Ŗå¨¤å¨§å¨¨å¨Ēå¨­å¨°åŠ„åŠ…åŠ‡åŠˆåŠŒåŠåŠ•åŠžåŠŖåŠĨåŠ§åŠ­åŠˇåŠēåŠģ办åĒ‹åǐåĒ“åĒ–åĒ™åǜåĒžåǟåĒ åĒĸåǧåĒŦåĒąåǞåĒŗåĒĩåǏåĒēåĒģåĒŋ"],["8fbaa1","åĢ„å̆å̈åĢå̚å̜åĢ åĢĨåĢĒåĢŽåĢĩåĢļåĢŊåŦ€åŦåŦˆåŦ—åŦ´åŦ™åŦ›åŦåŦĄåŦĨåŦ­åŦ¸å­å­‹å­Œå­’孖孞孨孎孯å­ŧå­Ŋå­žå­ŋ厁厄历厊厎厐厑厓厔厖厨厊åŽŦåŽ­åŽ¯åŽąåŽ˛åŽˇåŽēåŽŧ寀寁寍寏寖",4,"å¯ å¯¯å¯ąå¯´å¯Ŋå°Œå°—å°žå°Ÿå°Ŗå°Ļå°Šå°Ģå°Ŧå°Žå°°å°˛å°ĩå°ļåą™åąšåąœåąĸåąŖåą§åą¨åąŠ"],["8fbba1","åą­åą°åą´åąĩåąēåąģåąŧåąŊå˛‡å˛ˆå˛Šå˛å˛’å˛å˛Ÿå˛ å˛ĸ垪å˛Ļå˛Ē垞垴å˛ĩå˛ēåŗ‰åŗ‹åŗ’åŗåŗ—åŗŽåŗąåŗ˛åŗ´å´å´†å´å´’å´Ģå´Ŗå´¤å´Ļå´§å´ąå´´å´šå´Ŋå´ŋåĩ‚åĩƒåĩ†åĩˆåĩ•åĩ‘åĩ™åĩŠåĩŸåĩ åĩĄåĩĸåĩ¤åĩĒåĩ­åĩ°åĩšåĩēåĩžåĩŋåļåļƒåļˆåļŠåļ’åļ“åļ”åļ•åļ™åļ›åļŸåļ åļ§åļĢåļ°åļ´åļ¸åļšåˇƒåˇ‡åˇ‹åˇåˇŽåˇ˜åˇ™åˇ åˇ¤"],["8fbca1","åˇŠåˇ¸åˇšå¸€å¸‡å¸å¸’å¸”å¸•å¸˜å¸Ÿå¸ å¸Žå¸¨å¸˛å¸ĩ帞嚋嚐嚉嚑嚖嚘嚛嚜嚞嚨åšĒ",4,"åš°åē€åē‹åēŽåēĸåē¤åēĨåē¨åēĒåēŦåēąåēŗåēŊåēžåēŋåģ†åģŒåģ‹åģŽåģ‘åģ’åģ”åģ•åģœåģžåģĨåģĢåŧ‚åŧ†åŧ‡åŧˆåŧŽåŧ™åŧœåŧåŧĄåŧĸåŧŖåŧ¤åŧ¨åŧĢåŧŦåŧŽåŧ°åŧ´åŧļåŧģåŧŊåŧŋåŊ€åŊ„åŊ…åŊ‡åŊåŊåŊ”åŊ˜åŊ›åŊ åŊŖåŊ¤åŊ§"],["8fbda1","åŊ¯åŊ˛åŊ´åŊĩåŊ¸åŊēåŊŊåŊžåž‰åžåžåž–垜垝åžĸåž§åžĢ垤åžŦåž¯åž°åžąåž¸åŋ„åŋ‡åŋˆåŋ‰åŋ‹åŋ",4,"åŋžåŋĄåŋĸåŋ¨åŋŠåŋĒåŋŦåŋ­åŋŽåŋ¯åŋ˛åŋŗåŋļåŋēåŋŧæ€‡æ€Šæ€æ€“æ€”æ€—æ€˜æ€šæ€Ÿæ€¤æ€­æ€ŗæ€ĩæ€æ‡æˆæ‰æŒæ‘æ”æ–æ—ææĄæ§æąæžæŋ悂悆悈悊悎悑悓悕悘悝悞æ‚ĸ悤æ‚Ĩæ‚¨æ‚°æ‚ąæ‚ˇ"],["8fbea1","æ‚ģ悞惂惄惈惉惊惋惎惏惔惕惙惛惝惞æƒĸæƒĨæƒ˛æƒĩ惸æƒŧæƒŊ愂愇愊愌愐",4,"愖愗愙愜愞æ„ĸæ„Ēæ„Ģæ„°æ„ąæ„ĩæ„ļæ„ˇæ„šæ…æ……æ…†æ…‰æ…žæ… æ…Ŧæ…˛æ…¸æ…ģæ…ŧæ…ŋ憀憁憃憄憋憍憒憓憗憘憜憝憟憠æ†Ĩ憨æ†Ē憭憸憚æ†ŧæ‡€æ‡æ‡‚æ‡Žæ‡æ‡•æ‡œæ‡æ‡žæ‡Ÿæ‡Ąæ‡ĸ懧懊æ‡Ĩ"],["8fbfa1","æ‡Ŧ懭懯戁戃戄戇戓戕戜戠æˆĸæˆŖæˆ§æˆŠæˆĢ戚æˆŊæ‰‚æ‰ƒæ‰„æ‰†æ‰Œæ‰æ‰‘æ‰’æ‰”æ‰–æ‰šæ‰œæ‰¤æ‰­æ‰¯æ‰ŗæ‰ēæ‰Ŋ抍抎抏抐æŠĻæŠ¨æŠŗæŠļæŠˇæŠē択æŠŋ拄拎拕拖拚æ‹Ēæ‹˛æ‹´æ‹ŧæ‹Ŋ挃挄挊挋挍挐挓挖挘挊æŒĒ挭æŒĩæŒļ挚æŒŧ捁捂捃捄捆捊捋捎捒捓捔捘捛æĨæĻæŦæ­æąæ´æĩ"],["8fc0a1","捸æŧæŊæŋ掂掄掇掊掐掔掕掙掚掞掤æŽĻ掭掎掯æŽŊ揁揅揈揎揑揓揔揕揜揠æĨæĒæŦæ˛æŗæĩ揸揚搉搊搐搒搔搘搞搠æĸ搤æĨ搊æĒ搯搰æĩæŊæŋæ‘‹æ‘æ‘‘æ‘’æ‘“æ‘”æ‘šæ‘›æ‘œæ‘æ‘Ÿæ‘ æ‘Ąæ‘Ŗæ‘­æ‘ŗæ‘´æ‘ģæ‘Ŋæ’…æ’‡æ’æ’æ’‘æ’˜æ’™æ’›æ’æ’Ÿæ’Ąæ’Ŗæ’Ļ撨æ’Ŧæ’ŗæ’Ŋæ’žæ’ŋ"],["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤æ“Ĩ擊æ“Ē擭擰æ“ĩæ“ˇæ“ģæ“ŋ攁攄攈攉攊攏攓攔攖攙攛攞攟æ”ĸæ”Ļæ”Šæ”Žæ”࿔翔ŧæ”Ŋ敃敇敉敐敒敔敟敠敧æ•Ģæ•ēæ•Ŋæ–æ–…æ–Šæ–’æ–•æ–˜æ–æ– æ–Ŗæ–Ļæ–Žæ–˛æ–ŗæ–´æ–ŋæ—‚æ—ˆæ—‰æ—Žæ—æ—”æ—–æ—˜æ—Ÿæ—°æ—˛æ—´æ—ĩæ—šæ—žæ—ŋ昀昄昈昉昍昑昒昕昖昝"],["8fc2a1","æ˜žæ˜Ąæ˜ĸæ˜Ŗæ˜¤æ˜Ļ昊æ˜Ēæ˜Ģæ˜Ŧæ˜Žæ˜°æ˜ąæ˜ŗæ˜šæ˜ˇæ™€æ™…æ™†æ™Šæ™Œæ™‘æ™Žæ™—æ™˜æ™™æ™›æ™œæ™ æ™Ąæ›ģæ™Ēæ™Ģæ™Ŧæ™žæ™ŗæ™ĩæ™ŋæ™ˇæ™¸æ™šæ™ģ暀æ™ŧæš‹æšŒæšæšæš’æš™æššæš›æšœæšŸæš æš¤æš­æšąæš˛æšĩæšģæšŋ曀曂曃曈曌曎曏曔曛曟曨æ›Ģæ›Ŧ曎æ›ē朅朇朎朓朙朜朠æœĸæœŗæœžæ…æ‡æˆæŒæ”æ•æ"],["8fc3a1","æĻæŦ李杴æļæģæžæž„æžŽæžæž‘æž“æž–æž˜æž™æž›æž°æžąæž˛æžĩæžģæžŧæžŊæŸšæŸ€æŸ‚æŸƒæŸ…æŸˆæŸ‰æŸ’æŸ—æŸ™æŸœæŸĄæŸĻæŸ°æŸ˛æŸļæŸˇæĄ’æ ”æ ™æ æ Ÿæ ¨æ §æ Ŧæ ­æ ¯æ °æ ąæ ŗæ ģæ ŋæĄ„æĄ…æĄŠæĄŒæĄ•æĄ—æĄ˜æĄ›æĄĢæĄŽ",4,"æĄĩæĄšæĄēæĄģæĄŧæĸ‚æĸ„æĸ†æĸˆæĸ–æĸ˜æĸšæĸœæĸĄæĸŖæĸĨæĸŠæĸĒæĸŽæĸ˛æĸģæŖ…æŖˆæŖŒæŖ"],["8fc4a1","æŖæŖ‘æŖ“æŖ–æŖ™æŖœæŖæŖĨæŖ¨æŖĒæŖĢæŖŦæŖ­æŖ°æŖąæŖĩæŖļæŖģæŖŧæŖŊæ¤†æ¤‰æ¤Šæ¤æ¤‘æ¤“æ¤–æ¤—æ¤ąæ¤ŗæ¤ĩ椸æ¤ģæĨ‚æĨ…æĨ‰æĨŽæĨ—æĨ›æĨŖæĨ¤æĨĨæĨĻæĨ¨æĨŠæĨŦæĨ°æĨąæĨ˛æĨēæĨģæĨŋæĻ€æĻæĻ’æĻ–æĻ˜æĻĄæĻĨæĻϿύæĻ̿ϭæĻ¯æĻˇæĻ¸æĻēæĻŧ槅槈槑槖槗æ§ĸæ§Ĩæ§Žæ§¯æ§ąæ§ŗæ§ĩæ§žæ¨€æ¨æ¨ƒæ¨æ¨‘æ¨•æ¨šæ¨æ¨ æ¨¤æ¨¨æ¨°æ¨˛"],["8fc5a1","æ¨´æ¨ˇæ¨ģ樞æ¨ŋ抅抆抉把抎抐抑抒投抖抛护抧æŠĒæŠąæŠŗæŠžæĒæĒƒæĒ†æĒ‡æĒ‰æĒ‹æĒ‘æĒ›æĒæĒžæĒŸæĒĨæĒ̿ǝæĒ°æĒąæĒ´æĒŊæĒžæĒŋæĢ†æĢ‰æĢˆæĢŒæĢæĢ”æĢ•æĢ–æĢœæĢæĢ¤æĢ§æĢŦæĢ°æĢąæĢ˛æĢŧæĢŊæŦ‚æŦƒæŦ†æŦ‡æŦ‰æŦæŦæŦ‘æŦ—æŦ›æŦžæŦ¤æŦ¨æŦĢæŦŦæŦ¯æŦĩæŦļæŦģæŦŋ歆歊歍歒歖歘歝歠歧æ­Ģæ­Žæ­°æ­ĩæ­Ŋ"],["8fc6a1","歞掂掅掗掛掟掠æŽĸæŽŖæŽ¨æŽŠæŽŦ掭掎掰掸掚æŽŊæŽžæ¯ƒæ¯„æ¯‰æ¯Œæ¯–æ¯šæ¯Ąæ¯Ŗæ¯Ļæ¯§æ¯Žæ¯ąæ¯ˇæ¯šæ¯ŋ氂氄氅氉氍氎氐氒氙氟æ°Ļæ°§æ°¨æ°Ŧæ°Žæ°ŗæ°ĩæ°ļæ°ēæ°ģæ°ŋæąŠæą‹æąæąæą’æą”æą™æą›æąœæąĢæą­æą¯æą´æąļæą¸æąšæąģæ˛…æ˛†æ˛‡æ˛‰æ˛”æ˛•æ˛—æ˛˜æ˛œæ˛Ÿæ˛°æ˛˛æ˛´æŗ‚æŗ†æŗæŗæŗæŗ‘æŗ’æŗ”æŗ–"],["8fc7a1","æŗšæŗœæŗ æŗ§æŗŠæŗĢæŗŦæŗŽæŗ˛æŗ´æ´„æ´‡æ´Šæ´Žæ´æ´‘æ´“æ´šæ´Ļæ´§æ´¨æą§æ´Žæ´¯æ´ąæ´šæ´ŧæ´ŋæĩ—æĩžæĩŸæĩĄæĩĨæĩ§æĩ¯æĩ°æĩŧæļ‚æļ‡æļ‘æļ’æļ”æļ–æļ—æļ˜æļĒæļŦæļ´æļˇæļšæļŊæļŋæˇ„æˇˆæˇŠæˇŽæˇæˇ–æˇ›æˇæˇŸæˇ æˇĸæˇĨæˇŠæˇ¯æˇ°æˇ´æˇļæˇŧ渀渄渞æ¸ĸæ¸§æ¸˛æ¸ļ渚æ¸ģæ¸ŧ暄暅暈暉暋暏暑暒暓暔暗暜暝暞"],["8fc8a1","æšĸæšŖæš¨æšŗæšģæšŊæēæē“æē™æē æē§æē­æēŽæēąæēŗæēģæēŋæģ€æģæģƒæģ‡æģˆæģŠæģæģŽæģæģĢæģ­æģŽæģšæģģæģŊæŧ„æŧˆæŧŠæŧŒæŧæŧ–æŧ˜æŧšæŧ›æŧĻæŧŠæŧĒæŧ¯æŧ°æŧŗæŧļæŧģæŧŧæŧ­æŊæŊ‘æŊ’æŊ“æŊ—æŊ™æŊšæŊæŊžæŊĄæŊĸæŊ¨æŊŦæŊŊæŊžæžƒæž‡æžˆæž‹æžŒæžæžæž’枓枔枖枚枟枠æžĨæžĻ枧枨枎枯枰æžĩæžļæžŧæŋ…æŋ‡æŋˆæŋŠ"],["8fc9a1","æŋšæŋžæŋ¨æŋŠæŋ°æŋĩæŋšæŋŧæŋŊį€€į€…į€†į€‡į€į€—į€ į€Ŗį€¯į€´į€ˇį€šį€ŧįƒį„įˆį‰įŠį‹į”į•įįžįŽį¤įĨįŦįŽįĩįļįžį‚į‚…į‚†į‚”",4,"ႛႤį‚Ģį‚°į‚ąį‚´į‚ˇįƒŠįƒ‘įƒ“įƒ”įƒ•įƒ–įƒ˜įƒœįƒ¤įƒēį„ƒ",4,"į„‹į„Œį„į„žį„ į„Ģį„­į„¯į„°į„ąį„¸į…į……į…†į…‡į…Šį…‹į…į…’į…—į…šį…œį…žį… "],["8fcaa1","į…¨į…šį†€į†…į†‡į†Œį†’į†šį†›į† į†ĸᆝᆰᆞᆺį†ēį†ŋį‡€į‡į‡„į‡‹į‡Œį‡“į‡–į‡™į‡šį‡œį‡¸į‡žįˆ€įˆ‡įˆˆįˆ‰įˆ“įˆ—įˆšįˆįˆŸįˆ¤įˆĢįˆ¯įˆ´įˆ¸įˆšį‰į‰‚į‰ƒį‰…į‰Žį‰į‰į‰“į‰•į‰–į‰šį‰œį‰žį‰ į‰Ŗį‰¨į‰Ģį‰Žį‰¯į‰ąį‰ˇį‰¸į‰ģį‰ŧį‰ŋįŠ„įŠ‰įŠįŠŽįŠ“įŠ›įŠ¨įŠ­įŠŽįŠąįŠ´įŠžį‹į‹‡į‹‰į‹Œį‹•į‹–į‹˜į‹Ÿį‹Ĩዺዴį‹ēį‹ģ"],["8fcba1","į‹žįŒ‚įŒ„įŒ…įŒ‡įŒ‹įŒįŒ’įŒ“įŒ˜įŒ™įŒžįŒĸጤጧግįŒŦįŒąįŒ˛įŒĩįŒēįŒģįŒŊįƒįįį’į–į˜įįžįŸį įĻį§įŠįĢįŦįŽį¯įąįˇįšįŧįŽ€įŽįŽƒįŽ…įŽ†įŽŽįŽįŽ“įŽ•įŽ—įŽ˜įŽœįŽžįŽŸįŽ įŽĸįŽĨįŽĻįŽĒįŽĢįŽ­įŽĩįŽˇįŽšįŽŧįŽŊįŽŋį…į†į‰į‹įŒįį’į“į–į™įįĄįŖįĻį§įŠį´įĩįˇįšįēįģįŊ"],["8fcca1","įŋį€įį„į‡įŠį‘įšį›į¤įĻᐍ",9,"įšį‘€į‘ƒį‘„į‘†į‘‡į‘‹į‘į‘‘į‘’į‘—į‘į‘ĸį‘Ļᑧᑍį‘Ģį‘­į‘Žį‘ąį‘˛į’€į’į’…į’†į’‡į’‰į’į’į’‘į’’į’˜į’™į’šį’œį’Ÿį’ į’Ąį’Ŗį’Ļį’¨į’Šį’Ēį’Ģį’Žį’¯į’ąį’˛į’ĩį’šį’ģį’ŋį“ˆį“‰į“Œį“į““į“˜į“šį“›į“žį“Ÿį“¤į“¨į“Ēį“Ģᓝᓴį“ēį“ģį“ŧį“ŋᔆ"],["8fcda1","į”’į”–į”—į” į”Ąį”¤į”§į”Šį”Ēᔝį”ļį”šį”Ŋį”žį”ŋį•€į•ƒį•‡į•ˆį•Žį•į•’į•—į•žį•Ÿį•Ąį•¯į•ąį•š",5,"į–į–…į–į–’į–“į–•į–™į–œį–ĸᖤᖴį–ēį–ŋį—€į—į—„į—†į—Œį—Žį—į——į—œį—Ÿį— į—Ąį—¤į—§į—Ŧį—Žį—¯į—ąį—šį˜€į˜‚į˜ƒį˜„į˜‡į˜ˆį˜Šį˜Œį˜į˜’į˜“į˜•į˜–į˜™į˜›į˜œį˜į˜žį˜Ŗį˜Ĩį˜Ļį˜Šį˜­į˜˛į˜ŗį˜ĩį˜¸į˜š"],["8fcea1","į˜ēį˜ŧį™Šį™€į™į™ƒį™„į™…į™‰į™‹į™•į™™į™Ÿį™¤į™Ĩį™­į™Žį™¯į™ąį™´įšįš…įšŒįšįš•įš›įšœįšįšŸįš įšĸ",6,"įšĒᚭįšŊį›į›…į›‰į›‹į›Œį›Žį›”į›™į› į›Ļᛍį›Ŧį›°į›ąį›ļį›šį›ŧįœ€įœ†įœŠįœŽįœ’įœ”įœ•įœ—įœ™įœšįœœįœĸįœ¨įœ­įœŽįœ¯įœ´įœĩįœļįœšįœŊįœžį‚į…į†įŠįįŽįį’į–į—įœįžįŸį įĸ"],["8fcfa1","į¤į§įĒįŦį°į˛įŗį´įēįŊįž€įž„įžŒįžįž”įž•įž–įžšįžŸįžĸįž§įžĒįžŽįž¯įžąįžĩįžžįŸƒįŸ‰įŸ‘įŸ’įŸ•įŸ™įŸžįŸŸįŸ įŸ¤įŸĻįŸĒįŸŦįŸ°įŸąįŸ´įŸ¸įŸģį …į †į ‰į į Žį ‘į į Ąį ĸį Ŗį ­į Žį °į ĩį ˇįĄƒįĄ„įĄ‡įĄˆįĄŒįĄŽįĄ’įĄœįĄžįĄ įĄĄįĄŖįĄ¤įĄ¨įĄĒįĄŽįĄēįĄžįĸŠįĸįĸ”įĸ˜įĸĄįĸįĸžįĸŸįĸ¤įĸ¨įĸŦįĸ­įĸ°įĸąįĸ˛įĸŗ"],["8fd0a1","įĸģįĸŊįĸŋįŖ‡įŖˆįŖ‰įŖŒįŖŽįŖ’įŖ“įŖ•įŖ–įŖ¤įŖ›įŖŸįŖ įŖĄįŖĻįŖĒ᪞᪺ᤀįŖļįŖˇįŖēįŖģįŖŋį¤†į¤Œį¤į¤šį¤œį¤žį¤Ÿį¤ į¤Ĩį¤§į¤Šį¤­į¤ąį¤´į¤ĩį¤ģį¤Ŋį¤ŋįĨ„įĨ…įĨ†įĨŠįĨ‹įĨįĨ‘įĨ”įĨ˜įĨ›įĨœįĨ§įĨŠįĨĢįĨ˛įĨšįĨģįĨŧįĨžįĻ‹įόįĻ‘įĻ“įĻ”įĻ•įĻ–įϘįĻ›įϜįĻĄįύįĻŠįĻĢįϝįĻąįĻ´įϏįĻģį§‚į§„į§‡į§ˆį§Šį§į§”į§–į§šį§į§ž"],["8fd1a1","į§ į§ĸį§Ĩį§Ēį§Ģį§­į§ąį§¸į§ŧį¨‚į¨ƒį¨‡į¨‰į¨Šį¨Œį¨‘į¨•į¨›į¨žį¨Ąį¨§į¨Ģ፭፝፰፴į¨ĩį¨¸į¨šį¨ēįŠ„įŠ…įŠ‡įŠˆįŠŒįŠ•įŠ–įŠ™įŠœįŠįŠŸįŠ įŠĨįŠ§įŠĒįŠ­įŠĩįŠ¸įŠžįĒ€įĒ‚įĒ…įdžįNJįĒ‹įǐįĒ‘įĒ”įĒžįĒ įĒŖįĒŦįĒŗįĒĩįĒšįĒģįĒŧį̆į̉į̌įĢŽįĢ‘įĢ›į̍įĢŠįĢĢįĢŦįĢąįĢ´įĢģįĢŊįĢžįŦ‡įŦ”įŦŸįŦŖįŦ§įŦŠįŦĒįŦĢįŦ­įŦŽįŦ¯įŦ°"],["8fd2a1","įŦąįŦ´įŦŊįŦŋį­€į­į­‡į­Žį­•į­ į­¤į­Ļį­Šį­Ēį­­į­¯į­˛į­ŗį­ˇįŽ„įŽ‰įŽŽįŽįŽ‘įŽ–įŽ›įŽžįŽ įŽĨįŽŦįŽ¯įŽ°įŽ˛įŽĩįŽļįŽēįŽģįŽŧįŽŊį¯‚į¯…į¯ˆį¯Šį¯”į¯–į¯—į¯™į¯šį¯›į¯¨į¯Ē᝞᝴į¯ĩį¯¸į¯šį¯ēį¯ŧį¯žį°į°‚į°ƒį°„į°†į°‰į°‹į°Œį°Žį°į°™į°›į° į°Ĩį°Ļį°¨į°Ŧį°ąį°ŗį°´į°ļį°šį°ēįą†įąŠįą•įą‘įą’įą“įą™",5],["8fd3a1","įąĄįąŖįą§įąŠįą­įąŽįą°įą˛įąšįąŧįąŊį˛†į˛‡į˛į˛”į˛žį˛ į˛Ļឰį˛ļណį˛ēį˛ģį˛ŧį˛ŋįŗ„įŗ‡įŗˆįŗ‰įŗįŗįŗ“įŗ”įŗ•įŗ—įŗ™įŗšįŗįŗĻįŗŠįŗĢįŗĩį´ƒį´‡į´ˆį´‰į´į´‘į´’į´“į´–į´į´žį´Ŗį´Ļį´Ēį´­į´ąį´ŧį´Ŋį´žįĩ€įĩįĩ‡įĩˆįĩįĩ‘įĩ“įĩ—įĩ™įĩšįĩœįĩįĩĨįĩ§įĩĒįĩ°įĩ¸įĩēįĩģįĩŋįļįļ‚įļƒįļ…įļ†įļˆįļ‹įļŒįļįļ‘įļ–įļ—įļ"],["8fd4a1","įļžįļĻįļ§įļĒįļŗįļļįļˇįļšįˇ‚",4,"įˇŒįˇįˇŽįˇ—įˇ™į¸€įˇĸįˇĨįˇĻįˇĒįˇĢįˇ­įˇąįˇĩįˇļįˇšįˇēį¸ˆį¸į¸‘į¸•į¸—į¸œį¸į¸ į¸§į¸¨į¸ŦᏭᏝᏺį¸ļį¸ŋįš„įš…įš‡įšŽįšįš’įš˜įšŸįšĄįšĸįšĨįšĢįšŽįš¯įšŗįš¸įšžįēįē†įē‡įēŠįēįē‘įē•įē˜įēšįēįēžįŧŧįŧģįŧŊįŧžįŧŋįŊƒįŊ„įŊ‡įŊįŊ’įŊ“įŊ›įŊœįŊįŊĄįŊŖįŊ¤įŊĨįŊĻįŊ­"],["8fd5a1","įŊąįŊŊįŊžįŊŋįž€įž‹įžįžįžįž‘įž–įž—įžœįžĄįžĸįžĻįžĒįž­įž´įžŧįžŋįŋ€įŋƒįŋˆįŋŽįŋįŋ›įŋŸįŋŖįŋĨįŋ¨įŋŦįŋŽįŋ¯įŋ˛įŋēįŋŊįŋžįŋŋ耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤č€Ļč€Ŧ耮耰耴č€ĩ耷耹č€ēč€ŧ耾聀聄聠聤čĻ聭聹čĩ肁肈肎肜肞č‚Ļ肧č‚Ģ肸肹胈胍胏胒胔胕胗胘胠胭胮"],["8fd6a1","胰胞胺čƒļ胚čƒē胾脃脋脖脗脘脜脞脠脤脧č„Ŧ脰č„ĩč„ēč„ŧč……č…‡č…Šč…Œč…’č…—č… č…Ąč…§č…¨č…Šč…­č…¯č…ˇč†č†č†„č†…č††č†‹č†Žč†–č†˜č†›č†žč†ĸ膮膲膴č†ģ臋臃臅臊臎臏臕臗臛臝臞臡臤č‡Ģč‡Ŧ臰臱臲č‡ĩč‡ļ臸臹č‡Ŋč‡ŋ舀舃舏舓舔舙舚舝舡čˆĸ舨舲舴čˆē艃艄艅艆"],["8fd7a1","č‰‹č‰Žč‰č‰‘č‰–č‰œč‰ č‰Ŗč‰§č‰­č‰´č‰ģč‰Ŋč‰ŋčŠ€čŠčŠƒčŠ„čŠ‡čŠ‰čŠŠčŠŽčŠ‘čŠ”čŠ–čŠ˜čŠščŠ›čŠ čŠĄčŠŖčŠ¤čŠ§čŠ¨čŠŠčŠĒ芮芰芲芴芷čŠēčŠŧ芾čŠŋ苆苐苕苚苠č‹ĸ苤苨č‹Ē苭苝č‹ļ苷č‹Ŋ苾茀茁茇茈茊茋荔茛茝茞茟茡čŒĸčŒŦčŒ­čŒŽčŒ°čŒŗčŒˇčŒēčŒŧčŒŊ荂荃荄荇荍荎荑荕荖荗荰荸"],["8fd8a1","čŊčŋ莀莂莄莆莍莒莔莕莘莙莛莜莝čŽĻ莧莩čŽŦ莾čŽŋ菀菇菉菏菐菑菔菝荓菨čĒčļ菸菹čŧčč†čŠčč‘č•č™čŽ­č¯čšč‘…č‘‡č‘ˆč‘Šč‘č‘č‘‘č‘’č‘–č‘˜č‘™č‘šč‘œč‘ č‘¤č‘Ĩ葧č‘Ē葰葺葴č‘ļ葸č‘ŧč‘Ŋ蒁蒅蒒蒓蒕蒞č’Ļ蒨蒩č’Ēč’¯č’ąč’´č’ēč’Ŋ蒾蓀蓂蓇蓈蓌蓏蓓"],["8fd9a1","蓜蓧č“Ēč“¯č“°č“ąč“˛č“ˇč”˛č“ēč“ģč“Ŋ蔂蔃蔇蔌蔎蔐蔜蔞č”ĸ蔪蔤č”Ĩ蔧č”Ēč”Ģ蔝蔺蔴č”ļč”ŋ蕆蕏",4,"蕖蕙蕜",6,"蕤č•Ģč•¯č•šč•ēč•ģč•Ŋč•ŋ薁薅薆薉薋薌薏薓薘薝薟薠č–ĸč–Ĩ薧薴č–ļ薷薸č–ŧč–Ŋ薾č–ŋ藂藇藊藋藎薭藘藚藟藠č—Ļ藍藭藺č—ļč—ŧ"],["8fdaa1","č—ŋ蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩č˜ļ蘸č˜ēč˜ŧč˜Ŋ虀虂虆虒虓虖虗虘虙虝虠",4,"虩č™Ŧ虝č™ĩč™ļ虷č™ē蚍蚑蚖蚘蚚蚜蚡čšĻčš§čš¨čš­čšąčšŗčš´čšĩ蚷蚸蚹čšŋč›€č›č›ƒč›…č›‘č›’č›•č›—č›šč›œč› č›Ŗč›Ĩ蛧蚈č›ēč›ŧč›Ŋčœ„čœ…čœ‡čœ‹čœŽčœčœčœ“čœ”čœ™čœžčœŸčœĄčœŖ"],["8fdba1","čœ¨čœŽčœ¯čœąčœ˛čœščœēčœŧčœŊ蜾蝀蝃蝅蝍蝘蝝蝡蝤čĨč¯čąč˛čģ螃",6,"čž‹čžŒčžčž“čž•čž—čž˜čž™čžžčž čžŖčž§čžŦ螭螮螱čžĩ螾čžŋ蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟čŸĸ蟪蟤čŸĒčŸĢčŸ­čŸąčŸŗčŸ¸čŸēčŸŋ蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲č ĩ"],["8fdca1","č ēč ŧ衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹čĄģčĸ€čĸ˜čĸščĸ›čĸœčĸŸčĸ čĸ¨čĸĒčĸēčĸŊčĸžčŖ€čŖŠ",4,"čŖ‘čŖ’čŖ“čŖ›čŖžčŖ§čŖ¯čŖ°čŖąčŖĩčŖˇč¤č¤†č¤č¤Žč¤č¤•č¤–č¤˜č¤™č¤šč¤œč¤ č¤Ļ褧褨褰褹褲č¤ĩ褚č¤ē褞čĨ€čĨ‚čĨ…čĨ†čĨ‰čĨčĨ’čĨ—čĨščĨ›čĨœčĨĄčĨĸčĨŖčĨĢčĨŽčĨ°čĨŗčĨĩčĨē"],["8fdda1","čĨģčĨŧčĨŊčωčĻčϐčĻ”čĻ•čĻ›čϜčϟčĻ čĻĨčϰčĻ´čĻĩčĻļčώčĻŧ觔",4,"č§Ĩč§Šč§Ģč§­č§ąč§ŗč§ļč§šč§Ŋč§ŋ訄訅訇訏訑訒訔訕訞訠č¨ĸ訤č¨Ļč¨Ģč¨Ŧ荝č¨ĩ訡č¨Ŋ訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡čŠĨ芧čŠĩčŠļ芡芚čŠēčŠģ芞čŠŋčĒ€čǃčdžčĒ‹čĒčǐčĒ’čĒ–čĒ—čĒ™čǟčǧčĒŠčĒŽčǝčĒŗ"],["8fdea1","čĒļčǎčĒģčĒžč̃č̆č̈č̉č̊čĢ‘čĢ“čĢ”čĢ•čĢ—čĢč̟čĢŦč̰čĢ´čĢĩčĢļčĢŧčĢŋčŦ…čŦ†čŦ‹čŦ‘čŦœčŦžčŦŸčŦŠčŦ­čŦ°čŦˇčŦŧ譂",4,"č­ˆč­’č­“č­”č­™č­č­žč­Ŗč­­č­ļ譸譚č­ŧ譾讁讄讅讋讍讏讔讕讜讞讟谸谹č°Ŋč°žčą…čą‡čą‰čą‹čąčą‘čą“čą”čą—čą˜čą›čąčą™čąŖčą¤čąĻčą¨čąŠčą­čąŗčąĩčąļčąģ豾貆"],["8fdfa1","貇貋貐貒貓貙貛貜貤貹č˛ēčŗ…čŗ†čŗ‰čŗ‹čŗčŗ–čŗ•čŗ™čŗčŗĄčŗ¨čŗŦ躝躰躞čŗĩčŗˇčŗ¸čŗžčŗŋ贁贃贉贒贗贛čĩĨčĩŠčĩŦčĩŽčĩŋčļ‚čļ„čļˆčļčļčļ‘čļ•čļžčļŸčļ čļĻčļĢčļŦčļ¯čļ˛čļĩčļˇčļščļģ跀跅跆跇跈跊跎跑跔跕跗跙跤čˇĨ衧čˇŦ衰čļŧ衹衲衴čˇŊ踁踄踅踆踋踑踔踖踠踡č¸ĸ"],["8fe0a1","菪č¸Ļč¸§č¸ąč¸ŗč¸ļ踡踸踚č¸Ŋ蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡čšĸ蚊čšŦčš­čš¯čš°čšąčšščšēčšģčē‚čēƒčē‰čēčē’čē•čēščē›čēčēžčēĸčē§čēŠčē­čēŽčēŗčēĩčēēčēģčģ€čģčģƒčģ„čģ‡čģčģ‘čģ”čģœčģ¨čģŽčģ°čģąčģˇčģščģēčģ­čŧ€čŧ‚čŧ‡čŧˆčŧčŧčŧ–čŧ—čŧ˜čŧžčŧ čŧĄčŧŖčŧĨčŧ§čŧ¨čŧŦčŧ­čŧŽčŧ´čŧĩčŧļčŧˇčŧēčŊ€čŊ"],["8fe1a1","čŊƒčŊ‡čŊčŊ‘",4,"čŊ˜čŊčŊžčŊĨ辝辠辡辤čžĨčžĻčžĩčžļ螸螞čŋ€čŋčŋ†čŋŠčŋ‹čŋčŋčŋ’čŋ“čŋ•čŋ čŋŖčŋ¤čŋ¨čŋŽčŋąčŋĩčŋļčŋģčŋžé€‚逄逈逌逘逛逨逊逯é€Ēé€Ŧ逭逺逴逎é€ŋ遃遄遌遛遝éĸéĻ遧éŦ遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡é‚ĸé‚Ĩ邰邞邺邴é‚ļé‚Ŋ郌邾郃"],["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟éƒĨ郒éƒļéƒĢ郯郰郴郞éƒŋ鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠é„Ĩé„ĸé„Ŗé„§é„Šé„Žé„¯é„ąé„´é„ļ鄷鄹é„ēé„ŧé„Ŋ酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹é…ēé…ģ醁醃醅醆醊醎醑醓醔醕醘醞醡é†Ļ醨é†Ŧé†­é†Žé†°é†ąé†˛é†ŗé†ļé†ģé†ŧé†Ŋé†ŋ"],["8fe3a1","釂釃釅釓釔釗釙釚釞釤é‡Ĩ釩é‡Ēé‡Ŧ",5,"釷釹é‡ģé‡Ŋéˆ€éˆéˆ„éˆ…éˆ†éˆ‡éˆ‰éˆŠéˆŒéˆéˆ’éˆ“éˆ–éˆ˜éˆœéˆéˆŖéˆ¤éˆĨéˆĻéˆ¨éˆŽéˆ¯éˆ°éˆŗéˆĩéˆļ鈸鈚éˆēéˆŧ鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡é‰Ĩ鉧鉨鉊鉎鉯鉰é‰ĩ",4,"é‰ģé‰ŧé‰Ŋé‰ŋ銈銉銊銍銎銒銗"],["8fe4a1","銙銟銠銤éŠĨ銧銨éŠĢ銝銞éŠļ銸éŠēéŠģéŠŧéŠŊéŠŋ",4,"é‹…é‹†é‹‡é‹ˆé‹‹é‹Œé‹é‹Žé‹é‹“é‹•é‹—é‹˜é‹™é‹œé‹é‹Ÿé‹ é‹Ąé‹Ŗé‹Ĩ鋧鋨é‹Ŧ鋮鋰鋹é‹ģé‹ŋ錀錂錈錍錑錔錕錜錝錞錟錡錤éŒĨ錧錩éŒĒ錺錴éŒļ錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤éĨ鍧鍊éĒé­é¯é°éąéŗé´éļ"],["8fe5a1","éēéŊéŋéŽ€éŽéŽ‚éŽˆéŽŠéŽ‹éŽéŽéŽ’éŽ•éŽ˜éŽ›éŽžéŽĄéŽŖéŽ¤éŽĻ鎨éŽĢ鎴éŽĩéŽļéŽē鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟éĸéĻ鏧鏹鏷鏸éēéģéŊéé‚é„éˆé‰ééŽéé•é–é—éŸéŽé¯éąé˛éŗé´éģéŋéŊé‘ƒé‘…é‘ˆé‘Šé‘Œé‘•é‘™é‘œé‘Ÿé‘Ąé‘Ŗé‘¨é‘Ģé‘­é‘Žé‘¯é‘ąé‘˛é’„é’ƒé•¸é•š"],["8fe6a1","镾閄閈閌閍閎閝閞閟閡é–Ļ閩é–Ģé–Ŧ閴é–ļé–ēé–Ŋé–ŋ闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤é—Ļ阝阞é˜ĸ阤é˜Ĩé˜Ļé˜Ŧé˜ąé˜ŗé˜ˇé˜¸é˜šé˜ēé˜ŧé˜Ŋ陁陒陔陖陗陘陡陮陴é™ģé™ŧ陾é™ŋ隁隂隃隄隉隑隖隚隝隟隤éšĨéšĻéšŠéšŽéš¯éšŗéšē雊雒åļ˛é›˜é›šé›é›žé›Ÿé›Šé›¯é›ąé›ē霂"],["8fe7a1","霃霅霉霚霛霝霡éœĸéœŖéœ¨éœąéœŗééƒéŠéŽéé•é—é˜éšé›éŖé§éĒéŽéŗéļ靷靸éģéŊéŋ鞀鞉鞕鞖鞗鞙鞚鞞鞟éžĸéžŦ鞮鞱鞲éžĩéžļ鞸鞚éžēéžŧ鞾éžŋéŸéŸ„éŸ…éŸ‡éŸ‰éŸŠéŸŒéŸéŸŽéŸéŸ‘éŸ”éŸ—éŸ˜éŸ™éŸéŸžéŸ éŸ›éŸĄéŸ¤éŸ¯éŸąéŸ´éŸˇéŸ¸éŸēé ‡é Šé ™é é Žé ”é –é œé žé  é Ŗé Ļ"],["8fe8a1","é Ģé Žé ¯é °é ˛é ŗé ĩé Ĩ頾顄顇顊顑顒顓顖顗顙顚éĄĸéĄŖéĄĨéĄĻéĄĒéĄŦéĸĢéĸ­éĸŽéĸ°éĸ´éĸˇéĸ¸éĸēéĸģéĸŋéŖ‚éŖ…éŖˆéŖŒéŖĄéŖŖéŖĨéŖĻéŖ§éŖĒéŖŗéŖļ餂餇餈餑餕餖餗餚餛餜餟é¤ĸé¤Ļ餧é¤Ģ餹",4,"餚é¤ēé¤ģé¤ŧéĨ€éĨéĨ†éĨ‡éĨˆéĨéĨŽéĨ”éĨ˜éĨ™éĨ›éĨœéĨžéĨŸéĨ éĻ›éĻéϟéĻĻéϰéĻąéϞéĻĩ"],["8fe9a1","éĻšéĻēéĻŊéĻŋ駃駉駓駔駙駚駜駞駧é§Ēé§Ģé§Ŧé§°é§´é§ĩé§šé§Ŋ駾騂騃騄騋騌騐騑騖騞騠é¨ĸé¨Ŗé¨¤é¨§é¨­é¨Žé¨ŗé¨ĩé¨ļ騸驇驁驄驊驋驌驎驑驔驖驝éĒĒéĒŦéĒŽéǝéǞéĒ´éĒĩéĒļéĒšéĒģéĒžéĒŋé́é̃é̆é̈éĢŽé̐éĢ’éĢ•éĢ–éĢ—éĢ›é̜éĢ é̤éĢĨȩ́éĢŠéĢŦé̞éĢŗéĢĩéĢšéĢēéĢŊéĢŋ",4],["8feaa1","éŦ„éŦ…éŦˆéŦ‰éŦ‹éŦŒéŦéŦŽéŦéŦ’éŦ–éŦ™éŦ›éŦœéŦ éŦĻéŦĢéŦ­éŦŗéŦ´éŦĩéŦˇéŦšéŦēéŦŊé­ˆé­‹é­Œé­•é­–é­—é­›é­žé­Ąé­Ŗé­Ĩé­Ļé­¨é­Ē",4,"é­ŗé­ĩ魡魸魚é­ŋ鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞éŽĻ鎧鎊éŽŦ鎰鎹鎲鎡鎸éŽģéŽŧ鎞éŽŋ鯁鯇鯈鯎鯐鯗鯘鯝鯟é¯Ĩ鯧é¯Ēé¯Ģ靝靺靎靏"],["8feba1","鯚é¯ēé¯Ŋé¯ŋ鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞é°ĸé°Ŗé°Ļ",4,"é°ąé°ĩé°ļé°ˇé°Ŋéąéąƒéą„éą…éą‰éąŠéąŽéąéąéą“éą”éą–éą˜éą›éąéąžéąŸéąŖéąŠéąĒ鱜éąĢ鹨鹎鹰鹲éąĩ鹡éąģéŗĻéŗ˛éŗˇéŗšé´‹é´‚é´‘é´—é´˜é´œé´é´žé´¯é´°é´˛é´ŗé´´é´ēé´ŧéĩ…é´Ŋéĩ‚éĩƒéĩ‡éĩŠéĩ“éĩ”éĩŸéĩŖéĩĸéĩĨéĩŠéĩĒéĩĢéĩ°éĩļéĩˇéĩģ"],["8feca1","éĩŧéĩžéļƒéļ„éļ†éļŠéļéļŽéļ’éļ“éļ•éļ–éļ—éļ˜éļĄéļĒéļŦéļŽéļąéļĩéļšéļŧéļŋ鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠éˇĨ顧顊éˇĢéˇŽéˇ°éˇŗéˇ´éˇžé¸Šé¸‚é¸‡é¸Žé¸é¸‘é¸’é¸•é¸–é¸™é¸œé¸éšēéšģéšŧéē€éē‚éēƒéē„éē…éē‡éēŽéēéē–éē˜éē›éēžéē¤éē¨éēŦéēŽéē¯éē°éēŗéē´éēĩéģ†éģˆéģ‹éģ•éģŸéģ¤éģ§éģŦéģ­éģŽéģ°éģąéģ˛éģĩ"],["8feda1","éģ¸éģŋéŧ‚éŧƒéŧ‰éŧéŧéŧ‘éŧ’éŧ”éŧ–éŧ—éŧ™éŧšéŧ›éŧŸéŧĸéŧĻéŧĒéŧĢéŧ¯éŧąéŧ˛éŧ´éŧˇéŧšéŧēéŧŧéŧŊéŧŋéŊéŊƒ",4,"éŊ“éŊ•éŊ–éŊ—éŊ˜éŊšéŊéŊžéŊ¨éŊŠéŊ­",4,"éŊŗéŊĩéŊēéŊŊ龏龐龑龒龔龖龗龞龡éžĸéžŖéžĨ"]] + +/***/ }), +/* 720 */ +/***/ (function(module, exports) { + +module.exports = {"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]} + +/***/ }), +/* 721 */ +/***/ (function(module, exports) { + +module.exports = [["0","\u0000",128],["a1","īŊĄ",62],["8140"," 、。īŧŒīŧŽãƒģīŧšīŧ›īŧŸīŧã‚›ã‚œÂ´īŊ€Â¨īŧžīŋŖīŧŋãƒŊマゝゞ〃äģã€…〆〇ãƒŧ―‐īŧīŧŧīŊžâˆĨīŊœâ€Ļâ€Ĩ‘’“”īŧˆīŧ‰ã€”〕īŧģīŧŊīŊ›īŊã€ˆ",9,"īŧ‹īŧÂąÃ—"],["8180","Ãˇīŧâ‰ īŧœīŧžâ‰Ļâ‰§âˆžâˆ´â™‚â™€Â°â€˛â€ŗâ„ƒīŋĨīŧ„īŋ īŋĄīŧ…īŧƒīŧ†īŧŠīŧ Â§â˜†â˜…â—‹â—â—Žâ—‡â—†â–Ąâ– â–ŗâ–˛â–Ŋâ–ŧâ€ģ〒→←↑↓〓"],["81b8","∈∋⊆⊇⊂⊃âˆĒ∊"],["81c8","∧∨īŋĸ⇒⇔∀∃"],["81da","∠âŠĨ⌒∂∇≡≒â‰Ēâ‰Ģ√âˆŊ∝âˆĩâˆĢâˆŦ"],["81f0","â„̉♯♭â™Ē†‡Âļ"],["81fc","◯"],["824f","īŧ",9],["8260","īŧĄ",25],["8281","īŊ",25],["829f","ぁ",82],["8340","ã‚Ą",62],["8380","ム",22],["839f","Α",16,"ÎŖ",6],["83bf","Îą",16,"΃",6],["8440","А",5,"ЁЖ",25],["8470","а",5,"Ņ‘Đļ",7],["8480","Đž",17],["849f","─│┌┐┘└├â”Ŧ┤┴â”ŧâ”â”ƒâ”â”“â”›â”—â”Ŗâ”ŗâ”Ģâ”ģâ•‹â” â”¯â”¨â”ˇâ”ŋ┝┰â”Ĩ┸╂"],["8740","①",19,"Ⅰ",9],["875f","㍉㌔ãŒĸ㍍㌘㌧㌃ãŒļ㍑㍗㌍ãŒĻãŒŖãŒĢ㍊ãŒģãŽœãŽãŽžãŽŽãŽã„ãŽĄ"],["877e","ãģ"],["8780","ã€ã€Ÿâ„–ãâ„ĄãŠ¤",4,"ãˆąãˆ˛ãˆšãžãŊãŧ≒≡âˆĢ∮∑√âŠĨ∠∟âŠŋâˆĩ∊âˆĒ"],["889f","äēœå”–娃é˜ŋ哀愛挨å§ļé€ĸč‘ĩčŒœįŠæ‚ĒæĄæ¸Ĩ旭č‘ĻčŠĻé¯ĩæĸ“åœ§æ–Ąæ‰ąåޛ姐č™ģéŖ´įĩĸįļžéŽŽæˆ–į˛ŸčĸˇåމåēĩæŒ‰æš—æĄˆé—‡éžæäģĨäŧŠäŊäžå‰å›˛å¤ˇå§”威尉惟意慰易椅į‚ēį•į•°į§ģįļ­įˇ¯čƒƒčŽčĄŖčŦ‚違éēåŒģäē•äēĨåŸŸč‚˛éƒįŖ¯ä¸€åŖąæēĸé€¸į¨˛čŒ¨čŠ‹é°¯å…å°å’Ŋå“Ąå› å§ģåŧ•éŖ˛æˇĢ胤蔭"],["8940","é™ĸ陰隠éŸģå‹åŗåŽ‡įƒįžŊčŋ‚雨卯éĩœįĒē丑įĸ“č‡ŧæ¸Ļ嘘唄æŦč”šé°ģå§Ĩ厊æĩĻį“œé–å™‚äē‘é‹é›˛čé¤ŒåĄå–ļåŦ°åŊ࿘ æ›ŗæ „æ°¸æŗŗæ´Šį‘›į›ˆįŠŽé ´č‹ąčĄ›čŠ é‹­æļ˛į–Ģį›Šé§…æ‚ĻčŦčļŠé–˛æĻŽåޭ円"],["8980","園堰åĨ„厴åģ￀¨æŽŠæ´æ˛ŋæŧ”į‚Žį„”į…™į‡•įŒŋᏁč‰ļč‹‘č–—é é‰›é´›åĄŠæ–ŧæąšį”Ĩ凚夎åĨĨ垀åŋœæŠŧæ—翍ǿŦ§æŽ´įŽ‹įŋčĨ–é´Ŧ鴎éģ„å˛Ąæ˛–čģå„„åą‹æ†ļ臆æĄļį‰Ąäš™äŋēå¸æŠæ¸ŠįŠéŸŗä¸‹åŒ–äģŽäŊ•äŧŊ䞥äŊŗåŠ å¯å˜‰å¤ǻåŽļå¯Ąį§‘æš‡æžœæžļæ­Œæ˛ŗįĢį‚įĻįĻžį¨ŧįŽ‡čŠąč‹›čŒ„čˇč¯č“čĻčĒ˛å˜Šč˛¨čŋĻ過霞蚊äŋ„åŗ¨æˆ‘į‰™į”ģč‡ĨčŠŊč›žčŗ€é›…é¤“é§•äģ‹äŧšč§Ŗå›žåĄŠåŖŠåģģåŋĢæ€Ē悔æĸ懐戒拐攚"],["8a40","魁æ™Ļæĸ°æĩˇį°į•Œįš†įĩĩčŠĨčŸšé–‹éšŽč˛å‡ąåŠžå¤–å’ŗåŽŗå´–æ…¨æĻ‚æļ¯įĸč“‹čĄ—芲鎧éǏæĩŦéĻ¨č›™åžŖæŸŋč›ŽéˆŽåŠƒåš‡å„å쓿‹Ąæ’šæ ŧæ ¸æŽģį˛įĸēįŠĢčĻšč§’čĩĢčŧƒéƒ­é–Ŗéš”靊å­Ļ垺æĨŊéĄéĄŽæŽ›įŦ æ¨Ģ"],["8a80","æŠŋæĸļ鰍æŊŸå‰˛å–æ°æ‹Ŧæ´ģ渇æģ‘葛褐čŊ„且鰚åļ椛æ¨ē鞄æ Ē兜įĢƒč’˛é‡œéŽŒå™›é´¨æ ĸ茅萱į˛Ĩåˆˆč‹…į“Ļ䚞䞃冠寒刊勘勧åˇģ喚å Ēå§ĻåŽŒåŽ˜å¯›åš˛åššæ‚Ŗæ„Ÿæ…Ŗæ†žæ›æ•ĸæŸ‘æĄ“æŖēæŦžæ­“æą—æŧĸæž—æŊ…į’°į”˜į›Ŗįœ‹įĢŋįŽĄį°ĄįˇŠįŧļįŋ°č‚č‰Ļ莞čĻŗč̌č˛Ģ還鑑間閑é–ĸé™Ĩ韓館舘丸åĢå˛¸åˇŒįŽŠį™Œįœŧå˛ŠįŋĢ贋雁頑顔願äŧäŧŽåąå–œå™¨åŸēåĨ‡åŦ‰å¯„å˛å¸ŒåšžåŋŒæŽæœē旗æ—ĸæœŸæŖ‹æŖ„"],["8b40","抟帰毅気æąŊį•ŋįĨˆå­Ŗį¨€į´€åžŊčĻč¨˜č˛´čĩˇčģŒčŧéŖĸ騎éŦŧäē€åŊ儀åĻ“åŽœæˆ¯æŠ€æ“ŦæŦēįŠ į–‘įĨ‡įžŠčŸģčĒŧč­°æŽŦčŠéž å‰åƒå–ĢæĄ”æŠ˜čŠ°į §æĩéģå´åŽĸ脚虐逆丘久äģ‡äŧ‘及吸厎åŧ“æ€Ĩ救"],["8b80","æœŊæą‚æą˛æŗŖį¸įƒįŠļįĒŽįŦˆį´šįŗžįĩĻæ—§į‰›åŽģåą…åˇ¨æ‹’æ‹ æŒ™æ¸ č™šč¨ąčˇé‹¸æŧįĻĻ魚äē¨äēĢäēŦ䞛䞠僑兇įĢļå…ąå‡ļå”åŒĄåŋåĢå–ŦåĸƒåŗĄåŧˇåŊŠæ€¯ææ­æŒŸæ•™æŠ‹æŗį‹‚į‹­įŸ¯čƒ¸č„…čˆˆč•ŽéƒˇéĄéŸŋéĨ—éКäģ°å‡å°­æšæĨ­åą€æ›˛æĨĩįŽ‰æĄį˛åƒ…å‹¤å‡åˇžéŒĻ斤æŦŖæŦŊᐴįρįĻŊį­‹įˇŠčŠščŒčĄŋčĨŸčŦščŋ‘金吟銀䚝å€ļåĨåŒēį‹—įŽ–įŸŠč‹Ļčē¯é§†é§ˆé§’å…ˇæ„šč™žå–°įŠēåļå¯“é‡éš…ä¸˛æĢ›é‡§åą‘åąˆ"],["8c40","掘įĒŸæ˛“é´čŊĄįĒĒį†Šéšˆį˛‚æ —įš°æĄ‘éŦ勞君č–Ģč¨“įž¤čģéƒĄåĻčĸˆįĨäŋ‚傞刑兄啓圭įĒ型åĨ‘åŊĸåž„æĩæ…ļæ…§æ†ŠæŽ˛æēæ•Ŧæ™¯æĄ‚æ¸“į•Ļį¨ŊįŗģįĩŒįļ™įš‹įŊĢčŒŽčŠč›č¨ˆčŠŖč­ĻčģŊ頚éļčЏčŋŽé¯¨"],["8c80","劇戟撃æŋ€éš™æĄå‚‘æŦ æąēæŊ”įŠ´įĩčĄ€č¨Ŗæœˆäģļ倚å€ĻåĨå…ŧåˆ¸å‰Ŗå–§åœå …å̌åģ翆˛æ‡¸æ‹ŗæ˛æ¤œæ¨Šį‰ŊįŠŦįŒŽį ”įĄ¯įĩšįœŒč‚ŠčĻ‹čŦ™čŗĸčģ’遪éĩé™ēéĄ•é¨“éš¸å…ƒåŽŸåŽŗåšģåŧĻæ¸›æēįŽ„įžįĩƒčˆˇč¨€čĢē限䚎個古å‘ŧå›ēå§‘å­¤åˇąåēĢåŧ§æˆ¸æ•…æž¯æš–į‹įŗŠčĸ´č‚ĄčƒĄč°č™ŽčĒ‡čˇ¨éˆˇé›‡éĄ§éŧ“äē”äē’äŧåˆå‘‰åžå¨¯åžŒåžĄæ‚Ÿæĸ§æĒŽį‘šįĸčĒžčĒ¤č­ˇé†äšžé¯‰äē¤äŊŧ䞯候倖光å…ŦåŠŸåŠšå‹žåŽšåŖå‘"],["8d40","后喉坑åžĸåĨŊ孔孝厏åˇĨåˇ§åˇˇåš¸åēƒåēšåēˇåŧ˜æ’慌抗拘控æ”ģæ˜‚æ™ƒæ›´æ­æ Ąæĸ—æ§‹æąŸæ´ĒæĩŠæ¸¯æēį”˛įš‡įĄŦį¨ŋįŗ į´…į´˜įĩžįļąč€•č€ƒč‚¯č‚ąč…”č†čˆĒ荒行衡čŦ›č˛ĸčŗŧ郊é…ĩ鉱į ŋé‹ŧ閤降"],["8d80","項éĻ™é̘é´ģ剛åŠĢåˇåˆåŖ•æ‹ˇæŋ čąĒčŊŸéēšå…‹åˆģ告å›ŊįŠ€é…ˇéĩ éģ’į„æŧ‰č…°į”‘åŋŊ惚éǍዛčžŧ此頃äģŠå›°å¤åĸžåŠšæ¨æ‡‡æ˜æ˜†æ šæĸ࿎ˇį—•į´ē艮魂äē›äŊå‰å”†åĩ¯åˇĻåˇŽæŸģæ˛™į‘ŗį ‚čŠéŽ–čŖŸååē§æŒĢå‚ĩå‚Ŧå†æœ€å“‰åĄžåĻģ厰åŊŠæ‰æŽĄæ Ŋæ­ŗæ¸ˆįŊé‡‡įŠ€į •į ĻįĨ­æ–Žį´°čœčŖčŧ‰éš›å‰¤åœ¨æįŊĒč˛Ąå†´å‚é˜Ēå ēæĻŠč‚´å’˛å´ŽåŸŧįĸ•éˇēäŊœå‰Šå’‹æžæ˜¨æœ”æŸĩįDŽ᭖į´ĸéŒ¯æĄœéŽ­įŦšåŒ™å†Šåˆˇ"],["8e40","察æ‹ļæ’Žæ“Ļ札æŽēč–Šé›‘įšé¯–æŒéŒ†éŽĢįšŋæ™’ä¸‰å‚˜å‚åąąæƒ¨æ’’æ•ŖæĄŸį‡ĻįŠį”ŖįŽ—įē‚čš•čŽƒčŗ›é…¸é¤æ–ŦæšĢ掋äģ•äģ”äŧēäŊŋåˆēå¸å˛å—Ŗå››åŖĢ始姉å§ŋå­åąå¸‚å¸Ģåŋ—思指支孜斯æ–Ŋ旨枝æ­ĸ"],["8e80","æ­ģæ°į…įĨ‰į§įŗ¸į´™į´Ģč‚ĸ脂臺čĻ–čŠžčŠŠčŠĻčnjčĢŽčŗ‡čŗœé›ŒéŖŧæ­¯äē‹äŧŧ䞍児字å¯ē慈持時æŦĄæģ‹æ˛ģįˆžį’Ŋᗔ᪁į¤ēč€Œč€ŗč‡Ēč’”čžžæąéšŋåŧč­˜é´ĢįĢēčģ¸åŽé›Ģä¸ƒåąåŸˇå¤ąåĢ‰åŽ¤æ‚‰æšŋæŧ†į–žčŗĒåŽŸč”€į¯ å˛æŸ´čŠåąĄč•Šį¸žčˆŽå†™å°„æ¨čĩĻæ–œį…Žį¤žį´—者čŦčģŠéŽč›‡é‚Ē借å‹ēå°ē杓įŧįˆĩ酌釈éŒĢč‹Ĩ寂åŧ࿃šä¸ģå–åŽˆæ‰‹æœąæŽŠį‹Šį į¨Žč…ĢčļŖé…’éĻ–å„’å—å‘Ēå¯ŋ授樚įļŦ需囚収周"],["8f40","åŽ—å°ąåˇžäŋŽæ„æ‹žæ´˛į§€į§‹įĩ‚įšįŋ’č‡­čˆŸč’čĄ†čĨ˛čŽčš´čŧ¯é€ąé…‹é…Ŧ集醜äģ€äŊå……ååž“æˆŽæŸ”æąæ¸‹įŖį¸Ļ重銃叔夙åŽŋæˇ‘įĨį¸Žį˛›åĄžį†Ÿå‡ē術čŋ°äŋŠåŗģæ˜ĨįžŦį̪舜é§ŋ准åžĒæ—ŦæĨ¯æŽ‰æˇŗ"],["8f80","æē–æŊ¤į›žį´”åˇĄéĩ醇順å‡Ļ初所暑曙渚åēļ᎒įŊ˛æ›¸č–¯č—ˇčĢ¸åŠŠå™åĨŗåēåžæ•é‹¤é™¤å‚ˇå„Ÿå‹åŒ å‡åŦå“¨å•†å”ąå˜—åĨ¨åĻžå¨ŧåŽĩ将小少尚åē„åēŠåģ åŊ°æ‰ŋæŠ„æ‹›æŽŒæˇæ˜‡æ˜Œæ˜­æ™ļ杞æĸĸ樟æ¨ĩæ˛ŧæļˆæ¸‰æš˜į„ŧį„Ļį…§į—‡įœįĄį¤įĨĨį§°įĢ įŦ‘į˛§į´šč‚–č–č’‹č•‰čĄčŖŗč¨Ÿč¨ŧčŠ”čŠŗčąĄčŗžé†¤é‰Ļéžé˜éšœéž˜ä¸Šä¸ˆä¸žäš—å†—å‰°åŸŽå ´åŖŒåŦĸå¸¸æƒ…æ“žæĄæ–æĩ„įŠļį•ŗįŠŖč’¸č­˛é†¸éŒ å˜ąåŸ´éŖž"],["9040","æ‹­æ¤æŽ–į‡­įš”čˇč‰˛č§ĻéŖŸč•čžąå°ģäŧ¸äŋĄäžĩ唇娠寝寊åŋƒæ…ŽæŒ¯æ–°æ™‹æŖŽæĻ›æĩ¸æˇąį”ŗį–šįœŸįĨžį§Ļį´ŗč‡ŖčŠ¯č–ĒčĻĒč¨ēčēĢ辛進針震äēēäģåˆƒåĄĩåŖŦå°‹į”šå°Ŋ腎訊čŋ…é™Ŗé­įŦĨčĢé ˆé…ĸå›ŗåŽ¨"],["9080","逗吚垂å¸ĨæŽ¨æ°´į‚ŠįĄį˛‹įŋ čĄ°é‚é…”éŒéŒ˜éšį‘žé̄崇åĩŠæ•°æžĸčļ¨é››æŽæ‰æ¤™č…é —é›€čŖžæž„æ‘ē寸世į€Ŧį•æ˜¯å‡„åˆļå‹ĸ姓垁性成æ”ŋæ•´æ˜Ÿæ™´æŖ˛æ –æ­Ŗæ¸…į‰˛į”Ÿį››į˛žč–åŖ°čŖŊčĨŋčĒ čĒ“čĢ‹é€é†’é’é™æ–‰į¨Žč„†éšģ席惜戚æ–Ĩæ˜”æžįŸŗįŠįąį¸žč„Šč˛Ŧčĩ¤čˇĄčšŸįĸŠåˆ‡æ‹™æŽĨæ‘‚æŠ˜č¨­įĒƒį¯€čĒŦé›Ēįĩļ舌蝉äģ™å…ˆåƒå åŽŖå°‚å°–åˇæˆĻæ‰‡æ’°æ “æ ´æŗ‰æĩ…洗染æŊœį…Žį…Ŋ旋įŠŋįŽ­įˇš"],["9140","įšŠįž¨č…ē舛船č–ĻčŠŽčŗŽčˇĩé¸éˇéŠ­éŠ‘é–ƒéŽŽå‰å–„æŧ¸į„ļ全įĻ…įš•č†ŗįŗŽå™ŒåĄ‘å˛¨æŽĒ曞æ›ŊæĨšį‹™į–į–Žį¤ŽįĨ–į§Ÿį˛—į´ įĩ„č˜‡č¨´é˜ģ遥éŧ åƒ§å‰ĩ双åĸ倉å–ĒåŖŽåĨįˆŊåŽ‹åą¤åŒæƒŖæƒŗæœæŽƒæŒŋæŽģ"],["9180","æ“æ—Šæ›šåˇŖæ§æ§Ŋæŧ•į‡Ĩäē‰į—Šį›¸įĒ“įŗŸįˇįļœčĄč‰č˜č‘Ŧč’ŧč—ģčŖ…čĩ°é€é­éŽ—éœœé¨’åƒåĸ—æ†Žč‡“č”ĩ贈造äŋƒå´å‰‡åŗæ¯æ‰æŸæ¸Ŧčļŗé€Ÿäŋ—åąžčŗŠæ—įļšå’čĸ–å…ļ揃存å­Ģ尊損村遜äģ–多å¤Ēæą°čŠ‘å”žå •åĻĨ惰打柁čˆĩæĨ•陀駄騨äŊ“å †å¯žč€å˛ąå¸¯åž…æ€ æ…‹æˆ´æ›ŋæŗ°æģžčƒŽč…ŋ苔čĸ‹č˛¸é€€é€ŽéšŠéģ›é¯›äģŖå°å¤§įŦŦ醍題鷹æģį€§å“啄厅托択拓æ˛ĸæŋ¯įĸ託鐸æŋčĢžčŒ¸å‡§č›¸åĒ"],["9240","及äŊ†é”čž°åĨĒ脱åˇŊįĢĒčžŋæŖšč°ˇį‹¸éąˆæ¨ŊčĒ°ä¸šå˜å˜†åĻ担æŽĸæ—Ļæ­ŽæˇĄæš›į‚­įŸ­į̝įŽĒįļģč€Ŋ胆蛋čĒ•é›å›ŖåŖ‡åŧžæ–­æš–æĒ€æŽĩᔎč̇値įŸĨ地åŧ›æĨæ™ēæą į—´į¨šįŊŽč‡´čœ˜é…éĻŗį¯‰į•œįĢšį­‘č“„"],["9280","é€į§ŠįĒ’čŒļåĢĄį€ä¸­äģ˛åŽ™åŋ æŠŊæ˜ŧæŸąæŗ¨č™Ģ襡č¨ģé…Žé‹ŗé§æ¨—į€ĻįŒĒ苧著螝䏁兆凋喋å¯ĩ取叺åēåŧ”åŧĩåŊĢåž´æ‡˛æŒ‘æšĸ朝æŊŽį‰’į”ēįœē聴脹腸čļčĒŋč̜čļ…čˇŗéŠšé•ˇé ‚éŗĨå‹…æ—į›´æœ•æ˛ˆįčŗƒéŽŽé™ŗæ´Ĩåĸœæ¤Žæ§ŒčŋŊéŽšį—›é€šåĄšæ ‚æŽ´æ§ģäŊƒæŧŦ柘čžģč”Ļįļ´é”æ¤ŋæŊ°åĒåŖˇåŦŦį´ŦįˆĒåŠé‡Ŗéļ´äē­äŊŽåœåĩå‰ƒč˛žå‘ˆå ¤åŽšå¸åē•åē­åģˇåŧŸæ‚ŒæŠĩæŒē提æĸ¯æą€įĸ‡įĻŽį¨‹įˇ č‰‡č¨‚čĢĻ蹄逓"],["9340","邸鄭釘éŧŽæŗĨ摘æ“ĸæ•ĩæģ´įš„įŦ›éŠé‘æēēå“˛åžšæ’¤čŊčŋ­é‰„å…¸åĄĢå¤Šåą•åē—æˇģįēį”œč˛ŧčģĸéĄ›į‚šäŧæŽŋæžąį”°é›ģ兎吐å ĩåĄ—åĻŦåą åž’æ–—æœæ¸Ąį™ģčŸčŗ­é€”éƒŊ鍍į Ĩį ēåŠĒåēĻ土åĨ´æ€’倒党å†Ŧ"],["9380","å‡åˆ€å”åĄ”åĄ˜åĨ—厕åŗļå‚ŧæŠ•æ­æąæĄƒæĸŧæŖŸį›—æˇ˜æš¯æļ›į¯į‡ˆåŊ“į—˜įĨˇį­‰į­”į­’įŗ–įĩąåˆ°č‘Ŗč•Šč—¤č¨ŽčŦ„čą†č¸é€ƒé€é™é™ļé ­é¨°é—˜åƒå‹•åŒå ‚å°Žæ†§æ’žæ´žįžŗįĢĨčƒ´č„é“éŠ…åŗ é´‡åŒŋåž—åžŗæļœį‰šįŖįĻŋį¯¤æ¯’į‹ŦčĒ­æ ƒæŠĄå‡¸įĒæ¤´åąŠéŗļč‹Ģå¯…é…‰į€žå™¸åą¯æƒ‡æ•Ļæ˛Œčąšéé “呑曇鈍åĨˆé‚Ŗå†…䚍å‡Ē薙čŦŽį˜æē鍋æĨĸéĻ´į¸„į•ˇå—æĨ čģŸé›ŖæąäēŒå°ŧåŧčŋŠåŒ‚čŗ‘č‚‰č™šåģŋæ—Ĩäšŗå…Ĩ"],["9440","åĻ‚å°ŋ韮äģģåϊåŋčĒæŋĄįϰįĨĸå¯§č‘ąįŒĢį†ąåš´åŋĩæģæ’šį‡ƒį˛˜äšƒåģŧ䚋埜åšĸ悊æŋƒį´čƒŊ脺č†ŋ螲čĻ—čš¤åˇ´æŠŠæ’­čĻ‡æˇæŗĸæ´žįļį ´åŠ†įŊĩ芭éĻŦäŋŗå샿‹æŽ’æ•—æ¯į›ƒį‰ŒčƒŒč‚ēčŧŠé…å€åŸšåĒ’æĸ…"],["9480","æĨŗį…¤į‹Ŋ螎媞躠é™Ē這čŋį§¤įŸ§čŠäŧ¯å‰Ĩåšæ‹æŸæŗŠį™ŊįŽ”į˛•čˆļ薄čŋĢæ›æŧ įˆ†į¸›čŽĢ駁éēĻå‡ŊįŽąįĄ˛įŽ¸č‚‡į­ˆæĢ¨åšĄč‚Œį•‘į• å…Ģé‰ĸæēŒį™ē醗éĢĒäŧįŊ°æŠœį­é–ĨéŗŠå™ēåĄ™č›¤éšŧäŧ´åˆ¤åŠåå›å¸†æŦ斑æŋæ°žæąŽį‰ˆįŠ¯į­į•”įščˆŦč—Šč˛Šį¯„é‡†į…Šé ’éŖ¯æŒŊ晊į•Ēį›¤įŖč•ƒč›ŽåŒĒ卑åĻåσåē‡åŊŧæ‚˛æ‰‰æ‰šæŠĢæ–æ¯”æŗŒį–˛įšŽįĸ‘į§˜įˇ‹įŊˇč‚ĨčĸĢčĒšč˛ģéŋéžéŖ›æ¨‹į°¸å‚™å°žåžŽæž‡æ¯˜įĩįœ‰įžŽ"],["9540","éŧ쿟Šį¨—åŒšį–‹éĢ­åŊĻ膝菱肘åŧŧåŋ…į•ĸį­†é€ŧæĄ§å§ĢåĒ›į´į™žčŦŦäŋĩåŊĒæ¨™æ°ˇæŧ‚į“ĸįĨ¨čĄ¨čŠ•čąšå쟿į—…į§’č‹—éŒ¨é‹˛č’œč›­é°­å“åŊŦ斌æĩœį€•螧躓é ģ敏į“ļ不äģ˜åŸ å¤ĢåŠĻ富冨布å眿€–æ‰ļæ•ˇ"],["9580","斧晎æĩŽįˆļįŦĻ腐膚芙譜負čŗĻčĩ´é˜œé™„䞎æ’Ģæ­Ļ舞葡č•Ē部封æĨ“éĸ¨č‘ē蕗äŧå‰¯åžŠåš…æœįĻč…šč¤‡čφæˇĩåŧ—æ‰•æ˛¸äģį‰ŠéŽ’åˆ†åģ噴åĸŗæ†¤æ‰Žį„šåĨŽį˛‰įŗžį´›é›°æ–‡čžä¸™äŊĩå…ĩåĄ€åšŖåšŗåŧŠæŸ„ä¸Ļč”Ŋé–‰é™›įąŗé åƒģ媁ᙖįĸ§åˆĨįžĨč”‘įŽ†åå¤‰į‰‡į¯‡įˇ¨čžēčŋ”遍äžŋ勉娊åŧéž­äŋčˆ—é‹Ē圃捕歊į”Ģ誜čŧ”įŠ‚å‹Ÿåĸ“慕戊暎母į°ŋčŠå€Ŗäŋ¸åŒ…å‘†å ąåĨ‰åŽåŗ°åŗ¯å´Šåē–æŠąæ§æ”žæ–šæœ‹"],["9640","æŗ•æŗĄįƒšį ˛į¸ĢčƒžčŠŗčŒč“Ŧ蜂褒č¨Ē豊é‚Ļ鋒éŖŊéŗŗéĩŦ䚏äēĄå‚å‰–坊åύå¸Ŋåŋ˜åŋ™æˆŋæš´æœ›æŸæŖ’å†’į´Ąč‚Ē膨čŦ€č˛Œč˛ŋé‰žé˜˛å é Ŧ北僕卜åĸ¨æ’˛æœ´į‰§įĻįŠ†é‡Ļå‹ƒæ˛ĄæŽ†å €åšŒåĨ”æœŦįŋģå‡Ąį›†"],["9680","æ‘ŠįŖ¨é­”éēģ埋åĻšæ˜§æžšæ¯Žå“Šæ§™åš•č†œæž•éŽĒæŸžéą’æĄäēĻäŋŖåˆæŠšæœĢæ˛Ģčŋ„äž­įš­éēŋ万æ…ĸæē€æŧĢ蔓呺æœĒé­…åˇŗįŽ•å˛Ŧå¯†čœœæšŠč“‘į¨”č„ˆåĻ™į˛æ°‘įœ å‹™å¤ĸį„Ąį‰ŸįŸ›éœ§éĩĄæ¤‹åŠŋ娘å†Ĩ名å‘Ŋæ˜Žį›ŸčŋˇéŠ˜éŗ´å§Ēį‰æģ…å…æŖ‰įļŋįˇŦéĸéēēæ‘¸æ¨ĄčŒ‚åĻ„å­Ÿæ¯›įŒ›į›˛įļ˛č€—č’™å„˛æœ¨éģ™į›Žæĸå‹ŋ餅尤æˆģįąžč˛°å•æ‚ļį´‹é–€åŒäšŸå†ļ夜įˆēč€ļ野åŧĨįŸĸ厄åŊšį´„č–Ŧ荺čēé–æŸŗč–Žé‘“æ„‰æ„ˆæ˛šį™’"],["9740","čĢ­čŧ¸å”¯äŊ‘å„Ē勇友åŽĨåšŊ悠憂揖有柚暧æļŒįŒļįŒˇį”ąįĨčŖ•čĒ˜éŠé‚‘éƒĩé›„čžå¤•äēˆäŊ™ä¸Žčljčŧŋ預傭åšŧåĻ–åŽšå珿šæē擁曜æĨŠæ§˜æ´‹æēļᆔᔍįĒ¯įžŠč€€č‘‰č“‰čρčŦĄč¸ŠéĨé™Ŋ養慞抑æŦ˛"],["9780","æ˛ƒæĩ´įŋŒįŋŧæˇ€įž…čžēčŖ¸æĨ莱é ŧé›ˇæ´›įĩĄčŊé…ĒäšąåĩåĩæŦ„æŋĢ藍蘭čĻ§åˆŠååąĨ李æĸ¨į†į’ƒį—ĸčŖčŖĄé‡Œé›ĸé™¸åž‹įŽ‡įĢ‹č‘ŽæŽ į•Ĩ劉æĩæēœį‰į•™įĄĢį˛’éš†įĢœéžäžļæ…Žæ—…č™œäē†äēŽåƒšä¸Ąå‡Œå¯Žæ–™æĸæļŧįŒŸį™‚įž­į¨œįŗ§č‰¯čĢ’éŧ量é™ĩé ˜åŠ›įˇ‘å€ĢåŽ˜æž—æˇ‹į‡įŗč‡¨čŧĒéšŖéą—éēŸį‘ åĄæļ™į´¯éĄžäģ¤äŧļäž‹å†ˇåŠąåļ翀œįޞį¤ŧ苓鈴隷é›ļ霊éē—éŊĸæšĻæ­´åˆ—åŠŖįƒˆčŖ‚å쉿‹æ†æŧŖį…‰į°žįˇ´č¯"],["9840","č“Žé€ŖéŒŦ呂魯æĢ“į‚‰čŗ‚čˇ¯éœ˛åŠ´åЁåģŠåŧ„朗æĨŧæĻ”æĩĒæŧį‰ĸį‹ŧį¯­č€čžč‹éƒŽå…­éē“įĻ„č‚‹éŒ˛čĢ–å€­å’ŒčŠąæ­Ēčŗ„č„‡æƒ‘æž éˇ˛äē™äē˜é°čŠĢč—č•¨æ¤€æšžįĸ—č…•"],["989f","åŧŒä¸ä¸•ä¸Ē丹ä¸ļä¸ŧä¸ŋ乂乖乘äē‚äē…čąĢäēŠčˆ’åŧäēŽäēžäēŸäē äēĸäē°äēŗäēļäģŽäģäģ„äģ†äģ‚äģ—äģžäģ­äģŸäģˇäŧ‰äŊšäŧ°äŊ›äŊäŊ—äŊ‡äŊļ侈侏侘äŊģäŊŠäŊ°äž‘äŊ¯äž†äž–儘äŋ”äŋŸäŋŽäŋ˜äŋ›äŋ‘äŋšäŋäŋ¤äŋĨ倚倨倔å€Ēå€Ĩ倅äŧœäŋļå€Ąå€Šå€Ŧäŋžäŋ¯å€‘倆偃假會偕偐偈做偖åŦå¸å‚€å‚šå‚…å‚´å‚˛"],["9940","åƒ‰åƒŠå‚ŗåƒ‚åƒ–åƒžåƒĨåƒ­åƒŖåƒŽåƒšåƒĩå„‰å„å„‚å„–å„•å„”å„šå„Ąå„ē儎å„ŧå„ģå„ŋ兀兒兌兔å…ĸįĢ¸å…Šå…Ē兎冀冂囘册冉冏冑冓冕冖冤å†Ļå†ĸ冊å†Ēå†Ģå†ŗå†ąå†˛å†°å†ĩå†Ŋå‡…å‡‰å‡›å‡ č™•å‡Šå‡­"],["9980","凰å‡ĩ凞刄刋刔刎刧åˆĒåˆŽåˆŗåˆšå‰å‰„å‰‹å‰Œå‰žå‰”å‰Ēå‰´å‰Šå‰ŗå‰ŋå‰ŊåŠåŠ”åŠ’å‰ąåŠˆåŠ‘čž¨čž§åŠŦ劭åŠŧåŠĩå‹å‹å‹—å‹žå‹Ŗå‹Ļ骭勠勺å‹ĩå‹¸å‹šåŒ†åŒˆį”¸åŒåŒåŒåŒ•åŒšåŒŖåŒ¯åŒąåŒŗåŒ¸å€å†å…ä¸—å‰åå‡–åžåŠåŽå¤˜åģåˇåŽ‚åŽ–åŽ åŽĻåŽĨ厎厰åŽļåƒį°’é›™åŸæ›ŧį‡ŽåŽå¨å­åē吁åŊ呀åŦ吭åŧ后åļ吊吝呎咏å‘ĩå’Žå‘Ÿå‘ąå‘ˇå‘°å’’å‘ģ咀å‘ļ咄咐咆哇å’ĸ咸å’Ĩå’Ŧ哄哈咨"],["9a40","å’Ģ哂咤咞å’ŧ哘å“Ĩå“Ļ唏唔å“Ŋ哎哭å“ēå“ĸå”šå•€å•Ŗå•Œå”Žå•œå•…å•–å•—å”¸å”ŗå•å–™å–€å’¯å–Šå–Ÿå•ģ啞喘喞喎å•ŧå–ƒå–Šå–‡å–¨å—šå—…å—Ÿå—„å—œå—¤å—”å˜”å—ˇå˜–å—žå—Ŋå˜›å—šå™Žå™į‡Ÿå˜´å˜ļ嘞嘏"],["9a80","å™Ģ噤嘯å™Ŧå™Ē嚆嚀嚊嚠嚔嚏åšĨ嚎åšļ嚴囂åšŧ囁囃囀囈囎囑囓囗囎囚圀å›ŋ圄圉圈國圍圓團圖嗇圜åœĻåœˇåœ¸åŽåœģå€ååŠåŸ€åžˆåĄåŋåž‰åž“åž åžŗåž¤åžĒåž°åŸƒåŸ†åŸ”åŸ’åŸ“å ŠåŸ–åŸŖå ‹å ™å åĄ˛å ĄåĄĸåĄ‹åĄ°æ¯€åĄ’å ŊåĄšåĸ…åĸšåĸŸåĸĢåĸēåŖžåĸģåĸ¸åĸŽåŖ…åŖ“åŖ‘åŖ—åŖ™åŖ˜åŖĨ媜媤媟媝åŖēåŖšåŖģåŖŧåŖŊ夂夊夐夛æĸĻå¤Ĩå¤Ŧå¤­å¤˛å¤¸å¤žįĢ’åĨ•åĨåĨŽåĨšåĨ˜åĨĸåĨ åĨ§åĨŦåĨŠ"],["9b40","åĨ¸åρåĻäŊžäžĢåĻŖåĻ˛å§†å§¨å§œåĻå§™å§šå¨Ĩ娟娑娜娉娚劀åŠŦ劉å¨ĩå¨ļåŠĸåŠĒåǚåĒŧåĒžåĢ‹åĢ‚åĒŊåĢŖåĢ—åĢĻåĢŠåĢ–åĢēåĢģåŦŒåŦ‹åŦ–åŦ˛å̐åŦĒåŦļåŦžå­ƒå­…孀孑孕孚孛å­Ĩå­Šå­°å­ŗå­ĩ學斈å­ē厀"],["9b80","厃åŽĻ厸寃寇寉寔寐寤å¯Ļå¯ĸ寞å¯Ĩå¯Ģ寰å¯ļå¯ŗå°…å°‡å°ˆå°å°“å° å°ĸå°¨å°¸å°šåąåą†åąŽåą“åąåąå­ąåąŦåąŽäšĸåąļåąšå˛Œå˛‘å˛”åĻ›å˛Ģå˛ģå˛ļå˛ŧå˛ˇåŗ…å˛žåŗ‡åŗ™åŗŠåŗŊåŗēåŗ­åļŒåŗĒ崋崕崗åĩœå´Ÿå´›å´‘å´”å´ĸ崚崙崘åĩŒåĩ’åĩŽåĩ‹åĩŦåĩŗåĩļåļ‡åļ„åļ‚åļĸåļåļŦåļŽåļŊåļåļˇåļŧåˇ‰åˇåˇ“åˇ’åˇ–åˇ›åˇĢ厞åˇĩ帋帚帙帑帛å¸ļå¸ˇåš„åšƒåš€åšŽåš—åš”åšŸåšĸ嚤嚇åšĩåšļåšēéēŧåšŋåē åģåģ‚åģˆåģåģ"],["9c40","åģ–åģŖåģåģšåģ›åģĸåģĄåģ¨åģŠåģŦåģąåģŗåģ°åģ´åģ¸åģžåŧƒåŧ‰åŊåŊœåŧ‹åŧ‘åŧ–åŧŠåŧ­åŧ¸åŊåŊˆåŊŒåŊŽåŧ¯åŊ‘åŊ–åŊ—åŊ™åŊĄåŊ­åŊŗåŊˇåžƒåž‚åŊŋ垊垈垑垇垞垙垘垠垨垭åžŧåŋ–åŋģåŋ¤åŋ¸åŋąåŋæ‚ŗåŋŋæ€Ąæ "],["9c80","æ€™æ€æ€Šæ€Žæ€ąæ€›æ€•æ€Ģæ€Ļ怏æ€ē恚恁æĒæˇæŸæŠæ†ææŖæƒæ¤æ‚æŦæĢæ™æ‚æ‚æƒ§æ‚ƒæ‚šæ‚„æ‚›æ‚–æ‚—æ‚’æ‚§æ‚‹æƒĄæ‚¸æƒ æƒ“æ‚´åŋ°æ‚Ŋ惆æ‚ĩ惘慍愕愆æƒļæƒˇæ„€æƒ´æƒēæ„ƒæ„Ąæƒģæƒąæ„æ„Žæ…‡æ„žæ„¨æ„§æ…Šæ„ŋæ„ŧæ„Ŧ愴æ„Ŋæ…‚æ…„æ…ŗæ…ˇæ…˜æ…™æ…šæ…Ģ慴慯æ…Ĩæ…ąæ…Ÿæ…æ…“æ…ĩ憙憖憇æ†Ŧ憔憚憊憑æ†Ģæ†Žæ‡Œæ‡Šæ‡‰æ‡ˇæ‡ˆæ‡ƒæ‡†æ†ē懋įŊšæ‡æ‡Ļæ‡Ŗæ‡ļæ‡ē懴æ‡ŋæ‡Ŋæ‡ŧ懞戀戈戉戍戌戔戛"],["9d40","æˆžæˆĄæˆĒæˆŽæˆ°æˆ˛æˆŗæ‰æ‰Žæ‰žæ‰Ŗæ‰›æ‰ æ‰¨æ‰ŧ抂抉扞抒抓抖拔抃抔拗拑æŠģ拏æ‹ŋæ‹†æ“”æ‹ˆæ‹œæ‹Œæ‹Šæ‹‚æ‹‡æŠ›æ‹‰æŒŒæ‹Žæ‹ąæŒ§æŒ‚æŒˆæ‹¯æ‹ĩ捐挞捍搜捏掖掎掀æŽĢæļæŽŖæŽæŽ‰æŽŸæŽĩæĢ"],["9d80","æŠæŽžæŠæ€æ†æŖæ‰æ’æļ揄搖搴搆搓æĻæļ攝搗搨搏摧摯æ‘ļ摎æ”Ē撕撓æ’Ĩæ’Šæ’ˆæ’ŧ據擒擅擇æ’ģæ“˜æ“‚æ“ąæ“§čˆ‰æ“ æ“ĄæŠŦæ“Ŗæ“¯æ”Ŧæ“ļæ“´æ“˛æ“ē攀æ“Ŋæ”˜æ”œæ”…æ”¤æ”Ŗæ”Ģ攴æ”ĩæ”ˇæ”ļæ”¸į•‹æ•ˆæ•–æ••æ•æ•˜æ•žæ•æ•˛æ•¸æ–‚æ–ƒčŽŠæ–›æ–Ÿæ–Ģæ–ˇæ—ƒæ—†æ—æ—„æ—Œæ—’æ—›æ—™æ— æ—Ąæ—ąæ˛æ˜Šæ˜ƒæ—ģæŗæ˜ĩæ˜ļ昴昜晏晄晉晁晞晝晤晧晨晟æ™ĸ晰暃暈暎暉暄暘暝曁暚曉暞æšŧ"],["9e40","曄暸曖曚曠æ˜ŋæ›Ļ曊曰æ›ĩæ›ˇæœæœ–æœžæœĻ朧霸朎æœŋæœļææœ¸æœˇæ†æžæ æ™æŖæ¤æž‰æ°æžŠæŧæĒ枌枋æžĻæžĄæž…æžˇæŸ¯æž´æŸŦæžŗæŸŠæž¸æŸ¤æŸžæŸæŸĸ柎枚柎柆柧æĒœæ žæĄ†æ ŠæĄ€æĄæ ˛æĄŽ"],["9e80","æĸŗæ ĢæĄ™æĄŖæĄˇæĄŋæĸŸæĸæĸ­æĸ”æĸæĸ›æĸƒæĒŽæĸšæĄ´æĸĩæĸ æĸ翤æĸæĄžæ¤æŖŠæ¤ˆæŖ˜æ¤ĸæ¤ĻæŖĄæ¤ŒæŖæŖ”æŖ§æŖ•æ¤ļæ¤’æ¤„æŖ—æŖŖæ¤ĨæŖšæŖ æŖ¯æ¤¨æ¤Ēæ¤šæ¤Ŗæ¤ĄæŖ†æĨšæĨˇæĨœæĨ¸æĨĢæĨ”æĨžæĨŽæ¤šæĨ´æ¤ŊæĨ™æ¤°æĨĄæĨžæĨæĻæĨǿϞæĻŽæ§æĻŋ槁槓æĻžæ§Žå¯¨æ§Šæ§æĻģæ§ƒæĻ§æ¨ŽæĻ‘æĻ æĻœæĻ•æĻ´æ§žæ§¨æ¨‚樛æ§ŋæŦŠæ§šæ§˛æ§§æ¨…æĻ࿍žæ§­æ¨”æ§Ģ樊樒æĢæ¨Ŗæ¨“æŠ„æ¨ŒæŠ˛æ¨ļ抸抇æŠĸ抙æŠĻ抈樸æ¨ĸæĒæĒæĒ æĒ„æĒĸæĒŖ"],["9f40","æĒ—č˜—æĒģæĢƒæĢ‚æĒ¸æĒŗæĒŦæĢžæĢ‘æĢŸæĒǿ̚æĢĒæĢģæŦ…č˜–æĢēæŦ’æŦ–éŦąæŦŸæŦ¸æŦˇį›œæŦšéŖŽæ­‡æ­ƒæ­‰æ­æ­™æ­”æ­›æ­Ÿæ­Ąæ­¸æ­šæ­ŋ掀掄掃掍掘掕掞掤æŽĒæŽĢæŽ¯æŽ˛æŽąæŽŗæŽˇæŽŧ毆毋毓毟æ¯Ŧæ¯Ģæ¯ŗæ¯¯"],["9f80","éēžæ°ˆæ°“æ°”æ°›æ°¤æ°Ŗæąžæą•æąĸæąĒæ˛‚æ˛æ˛šæ˛æ˛›æąžæą¨æąŗæ˛’æ˛æŗ„æŗąæŗ“æ˛Ŋæŗ—æŗ…æŗæ˛Žæ˛ąæ˛žæ˛ēæŗ›æŗ¯æŗ™æŗĒæ´ŸčĄæ´ļæ´Ģæ´Ŋ洸洙æ´ĩæ´ŗæ´’æ´ŒæĩŖæļ“æĩ¤æĩšæĩšæĩ™æļ޿ŋ¤æļ…æˇšæ¸•æ¸Šæļĩæˇ‡æˇĻæļ¸æˇ†æˇŦæˇžæˇŒæˇ¨æˇ’æˇ…æˇēæˇ™æˇ¤æˇ•æˇĒæˇŽæ¸­æšŽæ¸Žæ¸™æš˛æšŸæ¸žæ¸ŖæšĢæ¸Ģæšļ暍渟暃æ¸ē暎渤æģŋ渝游æē‚æēĒæē˜æģ‰æēˇæģ“æēŊæē¯æģ„æē˛æģ”æģ•æēæēĨæģ‚æēŸæŊæŧ‘įŒæģŦæģ¸æģžæŧŋæģ˛æŧąæģ¯æŧ˛æģŒ"],["e040","æŧžæŧ“æģˇæž†æŊēæŊ¸æžæž€æŊ¯æŊ›æŋŗæŊ­æž‚æŊŧæŊ˜æžŽæž‘æŋ‚æŊĻæžŗæžŖæžĄæž¤æžšæŋ†æžĒæŋŸæŋ•æŋŦæŋ”æŋ˜æŋąæŋŽæŋ›į€‰į€‹æŋēį€‘į€į€æŋžį€›į€šæŊ´į€į€˜į€Ÿį€°į€žį€˛į‘įŖį‚™į‚’į‚¯įƒąį‚Ŧį‚¸į‚ŗį‚ŽįƒŸįƒ‹įƒ"],["e080","įƒ™į„‰įƒŊį„œį„™į…Ĩį…•į†ˆį…Ļį…ĸį…Œį…–į…Ŧį†į‡ģᆄᆕᆍį†Ŧį‡—į†šį†žį‡’į‡‰į‡”į‡Žį‡ į‡Ŧᇧį‡ĩį‡ŧį‡šį‡ŋįˆįˆįˆ›įˆ¨įˆ­įˆŦሰሞįˆģįˆŧįˆŋį‰€į‰†į‰‹į‰˜į‰´į‰žįŠ‚įŠįŠ‡įŠ’įŠ–įŠĸįŠ§įŠšįŠ˛į‹ƒį‹†į‹„į‹Žį‹’į‹ĸį‹ į‹Ąį‹šį‹ˇå€įŒ—įŒŠįŒœįŒ–įŒįŒ´įŒ¯įŒŠįŒĨįŒžįŽįéģ˜į—įĒį¨į°į¸įĩįģįēįˆįŽŗįŽįŽģį€įĨįŽįžį’ĸᐅᑝįĨį¸į˛įēį‘•įŋį‘Ÿį‘™į‘į‘œį‘Šį‘°į‘Ŗį‘Ēį‘ļį‘žį’‹į’žį’§į“Šį“į“”įą"],["e140","į“ į“Ŗį“§į“Šį“Žį“˛į“°į“ąį“¸į“ˇį”„į”ƒį”…į”Œį”Žį”į”•į”“į”žį”Ļį”Ŧį”ŧį•„į•į•Šį•‰į•›į•†į•šį•Šį•¤į•§į•Ģᕭᕏį•ļį–†į–‡į•´į–Šį–‰į–‚į–”į–šį–į–Ĩį–Ŗį—‚į–ŗį—ƒį–ĩį–Ŋį–¸į–ŧį–ąį—į—Šį—’į—™į—Ŗį—žį—žį—ŋ"],["e180","į—ŧį˜į—°į—ēį—˛į—ŗį˜‹į˜į˜‰į˜Ÿį˜§į˜ į˜Ąį˜ĸᘤᘴᘰį˜ģį™‡į™ˆį™†į™œį™˜į™Ąį™ĸį™¨į™Šį™Ēį™§į™Ŧᙰᙞį™ļᙏį™ŧįš€įšƒįšˆįš‹įšŽįš–įš“įš™įššįš°įš´įš¸įššįšēį›‚į›į›–į›’į›žį›Ąį›Ĩį›§į›Ē蘝į›ģįœˆįœ‡įœ„įœŠįœ¤įœžįœĨįœĻįœ›įœˇįœ¸į‡įšį¨įĢį›įĨįŋįžįšįžŽįž‹įž‘įž įžžįž°įžļįžšįžŋįžŧįžŊįžģįŸ‡įŸįŸ—įŸšįŸœįŸŖįŸŽįŸŧį Œį ’į¤Ļį  į¤ĒįĄ…įĸŽįĄ´įĸ†įĄŧįĸšįĸŒįĸŖįĸĩįĸĒįĸ¯įŖ‘᪆᪋᪔įĸžįĸŧįŖ…įŖŠįŖŦ"],["e240","ᪧ᪚įŖŊ᪴ᤇᤒᤑᤙį¤Ŧį¤ĢįĨ€įĨ įĨ—įĨŸįĨšįĨ•įĨ“įĨēįĨŋįϊįĻįϧéŊ‹įĻĒįĻŽįĻŗįĻšįĻēᧉ᧕᧧į§Ŧį§Ąį§Ŗį¨ˆį¨į¨˜į¨™į¨ į¨ŸįĻ€į¨ąį¨ģį¨žį¨ˇįŠƒįŠ—įŠ‰įŠĄįŠĸįŠŠéžįŠ°įŠšįŠŊįLjįĒ—įĒ•įǘįĒ–įĒŠį̈įǰ"],["e280","įĒļįĢ…įĢ„įĒŋ邃į̇į̊įĢįĢįĢ•įĢ“įĢ™į̚įĢįĢĄįĢĸįĢĻįĢ­į̰įŦ‚įŦįŦŠįŦ†įŦŗįŦ˜įŦ™įŦžįŦĩįŦ¨įŦļ᭐į­ēįŦ„į­įŦ‹į­Œį­…į­ĩį­Ĩį­´į­§į­°į­ąį­Ŧį­ŽįŽįŽ˜įŽŸįŽįŽœįŽšįŽ‹įŽ’įŽį­įŽ™į¯‹į¯į¯Œį¯įŽ´į¯†į¯į¯Šį°‘į°”į¯Ļį¯Ĩįą į°€į°‡į°“į¯ŗį¯ˇį°—į°į¯ļį°Ŗį°§į°Ēᰟᰎį°Ģį°ŊįąŒįąƒįą”įąįą€įąįą˜įąŸįą¤įą–įąĨįąŦįąĩឃថឤឭį˛ĸį˛Ģį˛Ąį˛¨į˛ŗį˛˛į˛ąį˛Žį˛šį˛Ŋįŗ€įŗ…įŗ‚įŗ˜įŗ’įŗœįŗĸéŦģẝẞẴįŗļįŗēį´†"],["e340","į´‚į´œį´•į´Šįĩ…įĩ‹į´Žį´˛į´ŋį´ĩįĩ†įĩŗįĩ–įĩŽįĩ˛įĩ¨įĩŽįĩįĩŖįļ“įļ‰įĩ›įļįĩŊįļ›įļēįļŽįļŖįļĩᎇįļŊįļĢį¸Ŋįļĸįļ¯įˇœįļ¸įļŸįļ°įˇ˜įˇįˇ¤įˇžįˇģįˇ˛įˇĄį¸…į¸Šį¸Ŗį¸Ąį¸’į¸ąį¸Ÿį¸‰į¸‹į¸ĸįš†įšĻį¸ģį¸ĩį¸šįšƒį¸ˇ"],["e380","Ꮮį¸ēįš§įšįš–įšžįš™įššįššįšĒįšŠįšŧįšģįēƒįˇ•įšŊ螎įšŋįēˆįē‰įēŒįē’įēįē“įē”įē–įēŽįē›įēœįŧ¸įŧēįŊ…įŊŒįŊįŊŽįŊįŊ‘įŊ•įŊ”įŊ˜įŊŸįŊ įŊ¨įŊŠįŊ§įŊ¸įž‚įž†įžƒįžˆįž‡įžŒįž”įžžįžįžšįžŖįž¯įž˛įžšįžŽįžļįž¸č­ąįŋ…įŋ†įŋŠįŋ•įŋ”įŋĄįŋĻįŋŠįŋŗįŋšéŖœč€†č€„č€‹č€’č€˜č€™č€œč€Ąč€¨č€ŋč€ģ聊聆聒聘聚聟čĸ聍聺聞聰čļ聚čŊčŋč‚„č‚†č‚…č‚›č‚“č‚šč‚­å†č‚Ŧ胛čƒĨčƒ™čƒčƒ„čƒščƒ–č„‰čƒ¯čƒąč„›č„Šč„Ŗč„¯č…‹"],["e440","隋腆脾腓腑čƒŧ腱腮č…Ĩč…Ļč…´č†ƒč†ˆč†Šč†€č†‚č† č†•č†¤č†Ŗč…Ÿč†“č†Šč†°č†ĩ膾膸č†Ŋ臀臂č†ē臉臍臑臙臘臈臚臟臠臧č‡ēč‡ģ臾舁舂舅與舊舍舐舖舩čˆĢčˆ¸čˆŗč‰€č‰™č‰˜č‰č‰šč‰Ÿč‰¤"],["e480","č‰ĸ艨č‰Ēč‰Ģ舮艱艷艸艾芍芒čŠĢ芟čŠģčŠŦč‹Ąč‹Ŗč‹Ÿč‹’č‹´č‹ŗč‹ē莓范č‹ģ苹苞茆苜茉苙čŒĩčŒ´čŒ–čŒ˛čŒąč€čŒščč…čŒ¯čŒĢ茗茘莅莚čŽĒ莟čŽĸčŽ–čŒŖčŽŽčŽ‡čŽŠčŧčŽĩčŗčĩ莠莉莨菴萓čĢ菎čŊ萃菘萋菁菷萇菠菲萍čĸ萠čŽŊ萸蔆čģ葭čĒčŧ蕚蒄葷č‘Ģ蒭葮蒂葩葆čŦč‘¯č‘ščĩ蓊č‘ĸ蒹č’ŋ蒟蓙蓍č’ģ蓚蓐蓁蓆蓖蒡蔡č“ŋ蓴蔗蔘č”Ŧ蔟蔕蔔č“ŧč•€č•Ŗč•˜č•ˆ"],["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛č—Ē薇薜蕷蕾薐藉č–ē藏薹藐藕藝č—Ĩ藜藹蘊蘓蘋藾č—ē蘆č˜ĸ蘚蘰č˜ŋč™äš•č™”č™Ÿč™§č™ąčš“čšŖčšŠčšĒ蚋蚌čšļčš¯č›„č›†čš°č›‰č ŖčšĢ蛔蛞蛩č›Ŧ"],["e580","č›Ÿč››č›¯čœ’čœ†čœˆčœ€čœƒč›ģ蜑蜉蜍蛹蜊蜴čœŋ蜎čœģčœĨčœŠčœšč čŸč¸čŒčŽč´č—č¨čŽč™č“čŖčĒ蠅čžĸčžŸčž‚čž¯čŸ‹čžŊ蟀蟐雖čžĢčŸ„čžŗčŸ‡čŸ†čžģčŸ¯čŸ˛čŸ č č čŸžčŸļ蟷蠎蟒蠑蠖蠕č ĸč Ąč ąč ļč šč §č ģ衄衂衒衙衞čĄĸčĄĢčĸčĄžčĸžčĄĩčĄŊčĸĩ襲čĸ‚čĸ—čĸ’čĸŽčĸ™čĸĸčĸčĸ¤čĸ°čĸŋčĸąčŖƒčŖ„čŖ”čŖ˜čŖ™čŖčŖšč¤‚čŖŧčŖ´čŖ¨čŖ˛č¤„č¤Œč¤Šč¤“čĨƒč¤žč¤Ĩč¤Ēč¤ĢčĨčĨ„č¤ģč¤ļ褸čĨŒč¤čĨ čĨž"],["e640","čĨĻčĨ¤čĨ­čĨĒčĨ¯čĨ´čĨˇčĨžčσčψčϊčĻ“čϘčĻĄčĻŠčĻĻčĻŦčϝčϞčĻēčĻŊčĻŋ觀觚觜觝觧觴觸訃訖訐訌訛訝č¨Ĩč¨ļ詁詛詒詆詈čŠŧ芭čŠŦčŠĸčĒ…čĒ‚čĒ„čǍčĒĄčĒ‘čĒĨčĒĻčǚčĒŖčĢ„čĢčĢ‚č̚čĢĢčĢŗç̌"],["e680","č̤čĢąčŦ”čĢ čĢĸč̎čĢžčĢ›čŦŒčŦ‡čŦščĢĄčŦ–čŦčŦ—čŦ čŦŗéžĢčŦĻčŦĢčŦžčŦ¨č­č­Œč­č­Žč­‰č­–譛譚č­Ģ譟č­Ŧ譝譴č­Ŋ讀讌讎讒讓讖讙讚č°ē蹁č°ŋ豈豌豎豐豕čąĸčąŦ蹸čąē貂貉貅貊貍貎貔čąŧč˛˜æˆč˛­č˛Ēč˛Ŋč˛˛č˛ŗč˛Žč˛ļ躈躁躤躪躚čŗŊčŗēčŗģ贄贅贊贇贏贍贐éŊŽč´“čŗč´”č´–čĩ§čĩ­čĩąčĩŗčļčļ™čˇ‚čļžčļē跏跚跖跌跛跋čˇĒčˇĢ莟莪čˇŧ踈踉čˇŋ踝踞踐踟蹂č¸ĩ踰踴蹊"],["e740","蹇蹉蹌蹐蹈蹙蹤蹠č¸ĒčšŖčš•čšļ蚲čšŧčēčē‡čē…čē„čē‹čēŠčē“čē‘čē”čē™čēĒčēĄčēŦčē°čģ†čēąčēžčģ…čģˆčģ‹čģ›čģŖčģŧčģģčģĢčģžčŧŠčŧ…čŧ•čŧ’čŧ™čŧ“čŧœčŧŸčŧ›čŧŒčŧĻčŧŗčŧģčŧščŊ…čŊ‚čŧžčŊŒčŊ‰čŊ†čŊŽčŊ—čŊœ"],["e780","čŊĸčŊŖčŊ¤čžœčžŸčžŖčž­čž¯čžˇčŋščŋĨčŋĸčŋĒčŋ¯é‚‡čŋ´é€…čŋščŋē逑逕逡逍逞逖逋逧é€ļé€ĩ逹čŋ¸ééé‘遒逎遉逞遖遘遞遨遯éļ隨遲邂éŊé‚é‚€é‚Šé‚‰é‚é‚¨é‚¯é‚ąé‚ĩéƒĸéƒ¤æ‰ˆéƒ›é„‚é„’é„™é„˛é„°é…Šé…–é…˜é…Ŗé…Ĩé…Šé…ŗé…˛é†‹é†‰é†‚é†ĸé†Ģ醯é†Ēé†ĩ醴é†ē釀釁釉釋釐釖釟釡釛é‡ŧé‡ĩé‡ļ鈞é‡ŋ鈔éˆŦ鈕鈑鉞鉗鉅鉉鉤鉈銕éˆŋ鉋鉐銜銖銓銛鉚鋏銹銷鋩錏é‹ē鍄錮"],["e840","錙éŒĸ錚錪éŒēéŒĩéŒģ鍜鍠éŧ鍮鍖鎰éŽŦ鎭鎔鎹鏖鏗鏨éĨ鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐éļéĢéĩ鐥éē鑁鑒鑄鑛鑠é‘ĸ鑞é‘Ē鈩鑰é‘ĩ鑷é‘Ŋ鑚é‘ŧ鑾钁é‘ŋ閂閇閊閔閖閘閙"],["e880","閠閨閧閭é–ŧé–ģ閹閾闊æŋļ闃闍闌闕闔闖關闡é—Ĩé—ĸé˜Ąé˜¨é˜Žé˜¯é™‚é™Œé™é™‹é™ˇé™œé™žé™é™Ÿé™Ļ陲é™Ŧ隍隘隕隗éšĒ隧隱隲隰隴éšļ隸隹雎雋雉雍čĨé›œéœé›•雚霄霆霈霓霎霑霏霖霙霤éœĒ霰霹éœŊ霾靄靆靈靂靉靜靠靤éĻ靨勒éĢ靱靹鞅éŧ鞁éē鞆鞋鞏鞐鞜鞨éžĻéžŖéžŗéž´éŸƒéŸ†éŸˆéŸ‹éŸœéŸ­éŊéŸ˛į̟éŸļéŸĩ頏頌頸頤頡頷é Ŋ顆顏顋éĄĢéĄ¯éĄ°"],["e940","éĄąéĄ´éĄŗéĸĒéĸ¯éĸąéĸļéŖ„éŖƒéŖ†éŖŠéŖĢ餃餉餒餔餘餡餝餞餤餠é¤Ŧ餎é¤Ŋ餞éĨ‚éĨ‰éĨ…éĨéĨ‹éĨ‘éĨ’éĨŒéĨ•éĻ—éϘéĻĨéĻ­éĻŽéĻŧ駟駛駝駘駑駭駮駱駲é§ģ駸騁騏騅é§ĸ騙é¨Ģ騷驅驂驀驃"],["e980","騾驕驍驛驗驟éŠĸéŠĨ銤銊éŠĢéŠĒéĒ­éǰéĒŧéĢ€éĢéĢ‘éĢ“éĢ”éĢžé̟éĢĸéĢŖéĢĻé̝éĢĢéĢŽéĢ´éĢąé̎éĢģéŦ†éŦ˜éŦšéŦŸéŦĸéŦŖéŦĨéŦ§éŦ¨éŦŠéŦĒéŦŽéŦ¯éŦ˛é­„é­ƒé­é­é­Žé­‘é­˜é­´éŽ“éŽƒéŽ‘éŽ–éŽ—éŽŸéŽ éŽ¨éŽ´é¯€é¯ŠéŽšé¯†é¯é¯‘é¯’é¯Ŗé¯ĸé¯¤é¯”é¯Ąé°ēé¯˛é¯ąé¯°é°•é°”é°‰é°“é°Œé°†é°ˆé°’é°Šé°„é°Žé°›é°Ĩ鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧éąļéą¸éŗ§éŗŦéŗ°é´‰é´ˆéŗĢ鴃鴆é´Ēé´Ļéļ¯é´Ŗé´Ÿéĩ„é´•é´’éĩé´ŋé´žéĩ†éĩˆ"],["ea40","éĩéĩžéĩ¤éĩ‘éĩéĩ™éĩ˛éļ‰éļ‡éļĢéĩ¯éĩēéļšéļ¤éļŠéļ˛éˇ„顁éļģéļ¸éļē鷆鷏鷂鷙鷓鷸éˇĻ鎭鎝éˇŊ鸚鸛鸞éšĩéššéšŊéēéēˆéē‹éēŒéē’éē•éē‘éēéēĨéēŠéē¸éēĒéē­éĄéģŒéģŽéģéģéģ”éģœéģžéģéģ éģĨéģ¨éģ¯"],["ea80","éģ´éģļéģˇéģšéģģéģŧéģŊéŧ‡éŧˆįšˇéŧ•éŧĄéŧŦéŧžéŊŠéŊ’éŊ”éŊŖéŊŸéŊ éŊĄéŊĻéŊ§éŊŦéŊĒéŊˇéŊ˛éŊļéž•éžœéž å ¯æ§‡é™į‘¤å‡œį†™"],["ed40","įēŠč¤œéˆéŠˆč“œäŋ‰į‚ģæ˜ąæŖˆé‹šæ›ģåŊ…丨äģĄäģŧäŧ€äŧƒäŧšäŊ–䞒䞊䞚䞔äŋå€å€ĸäŋŋ倞偆偰偂傔僴僘兊兤冝冞å‡Ŧ刕劜åŠĻå‹€å‹›åŒ€åŒ‡åŒ¤å˛åŽ“åŽ˛åī¨Žå’œå’Šå’Šå“ŋ喆坙åĨåžŦåŸˆåŸ‡ī¨"],["ed80","åĸžåĸ˛å¤‹åĨ“åĨ›åĨåĨŖåϤåĻēå­–å¯€į”¯å¯˜å¯Ŧ尞å˛Ļå˛ēåŗĩå´§åĩ“åĩ‚åĩ­åļ¸åļšåˇåŧĄåŧ´åŊ§åžˇåŋžææ‚…æ‚Šæƒžæƒ•æ„ æƒ˛æ„‘æ„ˇæ„°æ†˜æˆ“æŠĻæĩ摠撝擎敎昀昕æ˜ģ昉明昞昤æ™Ĩæ™—æ™™ī¨’æ™ŗæš™æš æš˛æšŋæ›ēæœŽī¤ŠæĻæžģæĄ’æŸ€æ æĄ„æŖī¨“æĨ¨ī¨”æĻ˜æ§ĸ樰æŠĢæŠ†æŠŗæŠžæĢĸæĢ¤æ¯–æ°ŋæąœæ˛†æą¯æŗšæ´„æļ‡æĩ¯æļ–æļŦæˇæˇ¸æˇ˛æˇŧ渚暜渧æ¸ŧæēŋ枈æžĩæŋĩစဇဍႅį‚Ģį„į„„į…œį…†į…‡ī¨•į‡į‡žįŠą"],["ee40","įŠžįŒ¤ī¨–įˇįŽŊį‰į–įŖį’į‡įĩįĻįĒįŠįŽį‘ĸį’‰į’Ÿį”į•¯įš‚įšœįšžįš›įšĻī¨—į†åŠ¯į ĄįĄŽįĄ¤įĄēį¤°ī¨˜ī¨™ī¨šįϔįĻ›įĢ‘į̧įĢĢįŽžī¨įĩˆįĩœįļˇįļ įˇ–įš’įŊ‡įžĄī¨žčŒčĸčŋ菇čļ葈蒴蕓蕙"],["ee80","č•Ģī¨Ÿč–°ī¨ ī¨Ąč ‡čŖĩ訒訷詹čǧčĒžč̟ī¨ĸčĢļ譓č­ŋčŗ°čŗ´č´’čĩļčģī¨¤ī¨Ĩ遧郞ī¨Ļ鄕鄧釚釗釞釭釮釤é‡Ĩ鈆鈐鈊éˆē鉀éˆŧé‰Žé‰™é‰‘éˆšé‰§éŠ§é‰ˇé‰¸é‹§é‹—é‹™é‹ī¨§é‹•é‹ é‹“éŒĨ錡é‹ģī¨¨éŒžé‹ŋéŒéŒ‚é°é—éŽ¤é†éžé¸éąé‘…é‘ˆé–’ī§œī¨Šéšéš¯éœŗéœģ靃靍靏靑靕顗éĄĨī¨Ēī¨Ģ餧ī¨ŦéĻžéŠŽéĢ™é̜é­ĩ魲鮏鮱éŽģ鰀éĩ°éĩĢ鏙éģ‘"],["eeef","ⅰ",9,"īŋĸīŋ¤īŧ‡īŧ‚"],["f040","",62],["f080","î€ŋ",124],["f140","î‚ŧ",62],["f180","îƒģ",124],["f240","",62],["f280","",124],["f340","",62],["f380","î‰ŗ",124],["f440","",62],["f480","",124],["f540","îŽŦ",62],["f580","îĢ",124],["f640","",62],["f680","",124],["f740","",62],["f780","î•Ŗ",124],["f840","",62],["f880","",124],["f940",""],["fa40","ⅰ",9,"Ⅰ",9,"īŋĸīŋ¤īŧ‡īŧ‚ãˆąâ„–â„ĄâˆĩįēŠč¤œéˆéŠˆč“œäŋ‰į‚ģæ˜ąæŖˆé‹šæ›ģåŊ…丨äģĄäģŧäŧ€äŧƒäŧšäŊ–䞒䞊䞚䞔äŋå€å€ĸäŋŋ倞偆偰偂傔僴僘兊"],["fa80","兤冝冞å‡Ŧ刕劜åŠĻå‹€å‹›åŒ€åŒ‡åŒ¤å˛åŽ“åŽ˛åī¨Žå’œå’Šå’Šå“ŋ喆坙åĨåžŦåŸˆåŸ‡ī¨ī¨åĸžåĸ˛å¤‹åĨ“åĨ›åĨåĨŖåϤåĻēå­–å¯€į”¯å¯˜å¯Ŧ尞å˛Ļå˛ēåŗĩå´§åĩ“åĩ‚åĩ­åļ¸åļšåˇåŧĄåŧ´åŊ§åžˇåŋžææ‚…æ‚Šæƒžæƒ•æ„ æƒ˛æ„‘æ„ˇæ„°æ†˜æˆ“æŠĻæĩ摠撝擎敎昀昕æ˜ģ昉明昞昤æ™Ĩæ™—æ™™ī¨’æ™ŗæš™æš æš˛æšŋæ›ēæœŽī¤ŠæĻæžģæĄ’æŸ€æ æĄ„æŖī¨“æĨ¨ī¨”æĻ˜æ§ĸ樰æŠĢæŠ†æŠŗæŠžæĢĸæĢ¤æ¯–æ°ŋæąœæ˛†æą¯æŗšæ´„æļ‡æĩ¯"],["fb40","æļ–æļŦæˇæˇ¸æˇ˛æˇŧ渚暜渧æ¸ŧæēŋ枈æžĩæŋĩစဇဍႅį‚Ģį„į„„į…œį…†į…‡ī¨•į‡į‡žįŠąįŠžįŒ¤ī¨–įˇįŽŊį‰į–įŖį’į‡įĩįĻįĒįŠįŽį‘ĸį’‰į’Ÿį”į•¯įš‚įšœįšžįš›įšĻī¨—į†åŠ¯į ĄįĄŽįĄ¤įĄēį¤°ī¨˜ī¨™"],["fb80","įϔįĻ›įĢ‘į̧įĢĢįŽžī¨įĩˆįĩœįļˇįļ įˇ–įš’įŊ‡įžĄī¨žčŒčĸčŋ菇čļ葈蒴蕓蕙č•Ģī¨Ÿč–°ī¨ ī¨Ąč ‡čŖĩ訒訷詹čǧčĒžč̟ī¨ĸčĢļ譓č­ŋčŗ°čŗ´č´’čĩļčģī¨¤ī¨Ĩ遧郞ī¨Ļ鄕鄧釚釗釞釭釮釤é‡Ĩ鈆鈐鈊éˆē鉀éˆŧé‰Žé‰™é‰‘éˆšé‰§éŠ§é‰ˇé‰¸é‹§é‹—é‹™é‹ī¨§é‹•é‹ é‹“éŒĨ錡é‹ģī¨¨éŒžé‹ŋéŒéŒ‚é°é—éŽ¤é†éžé¸éąé‘…é‘ˆé–’ī§œī¨Šéšéš¯éœŗéœģ靃靍靏靑靕顗éĄĨī¨Ēī¨Ģ餧ī¨ŦéĻžéŠŽéĢ™"],["fc40","é̜é­ĩ魲鮏鮱éŽģ鰀éĩ°éĩĢ鏙éģ‘"]] + +/***/ }), +/* 722 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Buffer = __webpack_require__(15).Buffer; + +// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js + +// == UTF16-BE codec. ========================================================== + +exports.utf16be = Utf16BECodec; +function Utf16BECodec() { +} + +Utf16BECodec.prototype.encoder = Utf16BEEncoder; +Utf16BECodec.prototype.decoder = Utf16BEDecoder; +Utf16BECodec.prototype.bomAware = true; + + +// -- Encoding + +function Utf16BEEncoder() { +} + +Utf16BEEncoder.prototype.write = function(str) { + var buf = Buffer.from(str, 'ucs2'); + for (var i = 0; i < buf.length; i += 2) { + var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; + } + return buf; +} + +Utf16BEEncoder.prototype.end = function() { +} + + +// -- Decoding + +function Utf16BEDecoder() { + this.overflowByte = -1; +} + +Utf16BEDecoder.prototype.write = function(buf) { + if (buf.length == 0) + return ''; + + var buf2 = Buffer.alloc(buf.length + 1), + i = 0, j = 0; + + if (this.overflowByte !== -1) { + buf2[0] = buf[0]; + buf2[1] = this.overflowByte; + i = 1; j = 2; + } + + for (; i < buf.length-1; i += 2, j+= 2) { + buf2[j] = buf[i+1]; + buf2[j+1] = buf[i]; + } + + this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; + + return buf2.slice(0, j).toString('ucs2'); +} + +Utf16BEDecoder.prototype.end = function() { +} + + +// == UTF-16 codec ============================================================= +// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. +// Defaults to UTF-16LE, as it's prevalent and default in Node. +// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le +// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); + +// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). + +exports.utf16 = Utf16Codec; +function Utf16Codec(codecOptions, iconv) { + this.iconv = iconv; +} + +Utf16Codec.prototype.encoder = Utf16Encoder; +Utf16Codec.prototype.decoder = Utf16Decoder; + + +// -- Encoding (pass-through) + +function Utf16Encoder(options, codec) { + options = options || {}; + if (options.addBOM === undefined) + options.addBOM = true; + this.encoder = codec.iconv.getEncoder('utf-16le', options); +} + +Utf16Encoder.prototype.write = function(str) { + return this.encoder.write(str); +} + +Utf16Encoder.prototype.end = function() { + return this.encoder.end(); +} + + +// -- Decoding + +function Utf16Decoder(options, codec) { + this.decoder = null; + this.initialBytes = []; + this.initialBytesLen = 0; + + this.options = options || {}; + this.iconv = codec.iconv; +} + +Utf16Decoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBytes.push(buf); + this.initialBytesLen += buf.length; + + if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below) + return ''; + + // We have enough bytes -> detect endianness. + var buf = Buffer.concat(this.initialBytes), + encoding = detectEncoding(buf, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + this.initialBytes.length = this.initialBytesLen = 0; + } + + return this.decoder.write(buf); +} + +Utf16Decoder.prototype.end = function() { + if (!this.decoder) { + var buf = Buffer.concat(this.initialBytes), + encoding = detectEncoding(buf, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + + var res = this.decoder.write(buf), + trail = this.decoder.end(); + + return trail ? (res + trail) : res; + } + return this.decoder.end(); +} + +function detectEncoding(buf, defaultEncoding) { + var enc = defaultEncoding || 'utf-16le'; + + if (buf.length >= 2) { + // Check BOM. + if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM + enc = 'utf-16be'; + else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM + enc = 'utf-16le'; + else { + // No BOM found. Try to deduce encoding from initial content. + // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. + // So, we count ASCII as if it was LE or BE, and decide from that. + var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions + _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even. + + for (var i = 0; i < _len; i += 2) { + if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++; + if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++; + } + + if (asciiCharsBE > asciiCharsLE) + enc = 'utf-16be'; + else if (asciiCharsBE < asciiCharsLE) + enc = 'utf-16le'; + } + } + + return enc; +} + + + + +/***/ }), +/* 723 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Buffer = __webpack_require__(15).Buffer; + +// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 +// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 + +exports.utf7 = Utf7Codec; +exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 +function Utf7Codec(codecOptions, iconv) { + this.iconv = iconv; +}; + +Utf7Codec.prototype.encoder = Utf7Encoder; +Utf7Codec.prototype.decoder = Utf7Decoder; +Utf7Codec.prototype.bomAware = true; + + +// -- Encoding + +var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; + +function Utf7Encoder(options, codec) { + this.iconv = codec.iconv; +} + +Utf7Encoder.prototype.write = function(str) { + // Naive implementation. + // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". + return Buffer.from(str.replace(nonDirectChars, function(chunk) { + return "+" + (chunk === '+' ? '' : + this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + + "-"; + }.bind(this))); +} + +Utf7Encoder.prototype.end = function() { +} + + +// -- Decoding + +function Utf7Decoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} + +var base64Regex = /[A-Za-z0-9\/+]/; +var base64Chars = []; +for (var i = 0; i < 256; i++) + base64Chars[i] = base64Regex.test(String.fromCharCode(i)); + +var plusChar = '+'.charCodeAt(0), + minusChar = '-'.charCodeAt(0), + andChar = '&'.charCodeAt(0); + +Utf7Decoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; + + // The decoder is more involved as we must handle chunks in stream. + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '+' + if (buf[i] == plusChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64Chars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" + res += "+"; + } else { + var b64str = base64Accum + buf.slice(lastI, i).toString(); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + if (buf[i] != minusChar) // Minus is absorbed after base64. + i--; + + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + buf.slice(lastI).toString(); + + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); + + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + this.inBase64 = inBase64; + this.base64Accum = base64Accum; + + return res; +} + +Utf7Decoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); + + this.inBase64 = false; + this.base64Accum = ''; + return res; +} + + +// UTF-7-IMAP codec. +// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) +// Differences: +// * Base64 part is started by "&" instead of "+" +// * Direct characters are 0x20-0x7E, except "&" (0x26) +// * In Base64, "," is used instead of "/" +// * Base64 must not be used to represent direct characters. +// * No implicit shift back from Base64 (should always end with '-') +// * String must end in non-shifted position. +// * "-&" while in base64 is not allowed. + + +exports.utf7imap = Utf7IMAPCodec; +function Utf7IMAPCodec(codecOptions, iconv) { + this.iconv = iconv; +}; + +Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; +Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; +Utf7IMAPCodec.prototype.bomAware = true; + + +// -- Encoding + +function Utf7IMAPEncoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = Buffer.alloc(6); + this.base64AccumIdx = 0; +} + +Utf7IMAPEncoder.prototype.write = function(str) { + var inBase64 = this.inBase64, + base64Accum = this.base64Accum, + base64AccumIdx = this.base64AccumIdx, + buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; + + for (var i = 0; i < str.length; i++) { + var uChar = str.charCodeAt(i); + if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. + if (inBase64) { + if (base64AccumIdx > 0) { + bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + base64AccumIdx = 0; + } + + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + inBase64 = false; + } + + if (!inBase64) { + buf[bufIdx++] = uChar; // Write direct character + + if (uChar === andChar) // Ampersand -> '&-' + buf[bufIdx++] = minusChar; + } + + } else { // Non-direct character + if (!inBase64) { + buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. + inBase64 = true; + } + if (inBase64) { + base64Accum[base64AccumIdx++] = uChar >> 8; + base64Accum[base64AccumIdx++] = uChar & 0xFF; + + if (base64AccumIdx == base64Accum.length) { + bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); + base64AccumIdx = 0; + } + } + } + } + + this.inBase64 = inBase64; + this.base64AccumIdx = base64AccumIdx; + + return buf.slice(0, bufIdx); +} + +Utf7IMAPEncoder.prototype.end = function() { + var buf = Buffer.alloc(10), bufIdx = 0; + if (this.inBase64) { + if (this.base64AccumIdx > 0) { + bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + this.base64AccumIdx = 0; + } + + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + this.inBase64 = false; + } + + return buf.slice(0, bufIdx); +} + + +// -- Decoding + +function Utf7IMAPDecoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} + +var base64IMAPChars = base64Chars.slice(); +base64IMAPChars[','.charCodeAt(0)] = true; + +Utf7IMAPDecoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; + + // The decoder is more involved as we must handle chunks in stream. + // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '&' + if (buf[i] == andChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64IMAPChars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" + res += "&"; + } else { + var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/'); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + if (buf[i] != minusChar) // Minus may be absorbed after base64. + i--; + + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/'); + + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); + + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + this.inBase64 = inBase64; + this.base64Accum = base64Accum; + + return res; +} + +Utf7IMAPDecoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); + + this.inBase64 = false; + this.base64Accum = ''; + return res; +} + + + + +/***/ }), +/* 724 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var BOMChar = '\uFEFF'; + +exports.PrependBOM = PrependBOMWrapper +function PrependBOMWrapper(encoder, options) { + this.encoder = encoder; + this.addBOM = true; +} + +PrependBOMWrapper.prototype.write = function(str) { + if (this.addBOM) { + str = BOMChar + str; + this.addBOM = false; + } + + return this.encoder.write(str); +} + +PrependBOMWrapper.prototype.end = function() { + return this.encoder.end(); +} + + +//------------------------------------------------------------------------------ + +exports.StripBOM = StripBOMWrapper; +function StripBOMWrapper(decoder, options) { + this.decoder = decoder; + this.pass = false; + this.options = options || {}; +} + +StripBOMWrapper.prototype.write = function(buf) { + var res = this.decoder.write(buf); + if (this.pass || !res) + return res; + + if (res[0] === BOMChar) { + res = res.slice(1); + if (typeof this.options.stripBOM === 'function') + this.options.stripBOM(); + } + + this.pass = true; + return res; +} + +StripBOMWrapper.prototype.end = function() { + return this.decoder.end(); +} + + + +/***/ }), +/* 725 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Buffer = __webpack_require__(64).Buffer; +// Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer + +// == Extend Node primitives to use iconv-lite ================================= + +module.exports = function (iconv) { + var original = undefined; // Place to keep original methods. + + // Node authors rewrote Buffer internals to make it compatible with + // Uint8Array and we cannot patch key functions since then. + // Note: this does use older Buffer API on a purpose + iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array); + + iconv.extendNodeEncodings = function extendNodeEncodings() { + if (original) return; + original = {}; + + if (!iconv.supportsNodeEncodingsExtension) { + console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node"); + console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility"); + return; + } + + var nodeNativeEncodings = { + 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, + 'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true, + }; + + Buffer.isNativeEncoding = function(enc) { + return enc && nodeNativeEncodings[enc.toLowerCase()]; + } + + // -- SlowBuffer ----------------------------------------------------------- + var SlowBuffer = __webpack_require__(64).SlowBuffer; + + original.SlowBufferToString = SlowBuffer.prototype.toString; + SlowBuffer.prototype.toString = function(encoding, start, end) { + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.SlowBufferToString.call(this, encoding, start, end); + + // Otherwise, use our decoding method. + if (typeof start == 'undefined') start = 0; + if (typeof end == 'undefined') end = this.length; + return iconv.decode(this.slice(start, end), encoding); + } + + original.SlowBufferWrite = SlowBuffer.prototype.write; + SlowBuffer.prototype.write = function(string, offset, length, encoding) { + // Support both (string, offset, length, encoding) + // and the legacy (string, encoding, offset, length) + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length; + length = undefined; + } + } else { // legacy + var swap = encoding; + encoding = offset; + offset = length; + length = swap; + } + + offset = +offset || 0; + var remaining = this.length - offset; + if (!length) { + length = remaining; + } else { + length = +length; + if (length > remaining) { + length = remaining; + } + } + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.SlowBufferWrite.call(this, string, offset, length, encoding); + + if (string.length > 0 && (length < 0 || offset < 0)) + throw new RangeError('attempt to write beyond buffer bounds'); + + // Otherwise, use our encoding method. + var buf = iconv.encode(string, encoding); + if (buf.length < length) length = buf.length; + buf.copy(this, offset, 0, length); + return length; + } + + // -- Buffer --------------------------------------------------------------- + + original.BufferIsEncoding = Buffer.isEncoding; + Buffer.isEncoding = function(encoding) { + return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding); + } + + original.BufferByteLength = Buffer.byteLength; + Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) { + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.BufferByteLength.call(this, str, encoding); + + // Slow, I know, but we don't have a better way yet. + return iconv.encode(str, encoding).length; + } + + original.BufferToString = Buffer.prototype.toString; + Buffer.prototype.toString = function(encoding, start, end) { + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.BufferToString.call(this, encoding, start, end); + + // Otherwise, use our decoding method. + if (typeof start == 'undefined') start = 0; + if (typeof end == 'undefined') end = this.length; + return iconv.decode(this.slice(start, end), encoding); + } + + original.BufferWrite = Buffer.prototype.write; + Buffer.prototype.write = function(string, offset, length, encoding) { + var _offset = offset, _length = length, _encoding = encoding; + // Support both (string, offset, length, encoding) + // and the legacy (string, encoding, offset, length) + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length; + length = undefined; + } + } else { // legacy + var swap = encoding; + encoding = offset; + offset = length; + length = swap; + } + + encoding = String(encoding || 'utf8').toLowerCase(); + + // Use native conversion when possible + if (Buffer.isNativeEncoding(encoding)) + return original.BufferWrite.call(this, string, _offset, _length, _encoding); + + offset = +offset || 0; + var remaining = this.length - offset; + if (!length) { + length = remaining; + } else { + length = +length; + if (length > remaining) { + length = remaining; + } + } + + if (string.length > 0 && (length < 0 || offset < 0)) + throw new RangeError('attempt to write beyond buffer bounds'); + + // Otherwise, use our encoding method. + var buf = iconv.encode(string, encoding); + if (buf.length < length) length = buf.length; + buf.copy(this, offset, 0, length); + return length; + + // TODO: Set _charsWritten. + } + + + // -- Readable ------------------------------------------------------------- + if (iconv.supportsStreams) { + var Readable = __webpack_require__(23).Readable; + + original.ReadableSetEncoding = Readable.prototype.setEncoding; + Readable.prototype.setEncoding = function setEncoding(enc, options) { + // Use our own decoder, it has the same interface. + // We cannot use original function as it doesn't handle BOM-s. + this._readableState.decoder = iconv.getDecoder(enc, options); + this._readableState.encoding = enc; + } + + Readable.prototype.collect = iconv._collect; + } + } + + // Remove iconv-lite Node primitive extensions. + iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() { + if (!iconv.supportsNodeEncodingsExtension) + return; + if (!original) + throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.") + + delete Buffer.isNativeEncoding; + + var SlowBuffer = __webpack_require__(64).SlowBuffer; + + SlowBuffer.prototype.toString = original.SlowBufferToString; + SlowBuffer.prototype.write = original.SlowBufferWrite; + + Buffer.isEncoding = original.BufferIsEncoding; + Buffer.byteLength = original.BufferByteLength; + Buffer.prototype.toString = original.BufferToString; + Buffer.prototype.write = original.BufferWrite; + + if (iconv.supportsStreams) { + var Readable = __webpack_require__(23).Readable; + + Readable.prototype.setEncoding = original.ReadableSetEncoding; + delete Readable.prototype.collect; + } + + original = undefined; + } +} + + +/***/ }), +/* 726 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Some environments don't have global Buffer (e.g. React Native). +// Solution would be installing npm modules "buffer" and "stream" explicitly. +var Buffer = __webpack_require__(15).Buffer; + +var bomHandling = __webpack_require__(724), + iconv = module.exports; + +// All codecs and aliases are kept here, keyed by encoding name/alias. +// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. +iconv.encodings = null; + +// Characters emitted in case of error. +iconv.defaultCharUnicode = 'īŋŊ'; +iconv.defaultCharSingleByte = '?'; + +// Public API. +iconv.encode = function encode(str, encoding, options) { + str = "" + (str || ""); // Ensure string. + + var encoder = iconv.getEncoder(encoding, options); + + var res = encoder.write(str); + var trail = encoder.end(); + + return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; +} + +iconv.decode = function decode(buf, encoding, options) { + if (typeof buf === 'string') { + if (!iconv.skipDecodeWarning) { + console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); + iconv.skipDecodeWarning = true; + } + + buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. + } + + var decoder = iconv.getDecoder(encoding, options); + + var res = decoder.write(buf); + var trail = decoder.end(); + + return trail ? (res + trail) : res; +} + +iconv.encodingExists = function encodingExists(enc) { + try { + iconv.getCodec(enc); + return true; + } catch (e) { + return false; + } +} + +// Legacy aliases to convert functions +iconv.toEncoding = iconv.encode; +iconv.fromEncoding = iconv.decode; + +// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. +iconv._codecDataCache = {}; +iconv.getCodec = function getCodec(encoding) { + if (!iconv.encodings) + iconv.encodings = __webpack_require__(712); // Lazy load all encoding definitions. + + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + var enc = iconv._canonicalizeEncoding(encoding); + + // Traverse iconv.encodings to find actual codec. + var codecOptions = {}; + while (true) { + var codec = iconv._codecDataCache[enc]; + if (codec) + return codec; + + var codecDef = iconv.encodings[enc]; + + switch (typeof codecDef) { + case "string": // Direct alias to other encoding. + enc = codecDef; + break; + + case "object": // Alias with options. Can be layered. + for (var key in codecDef) + codecOptions[key] = codecDef[key]; + + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + enc = codecDef.type; + break; + + case "function": // Codec itself. + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + // The codec function must load all tables and return object with .encoder and .decoder methods. + // It'll be called only once (for each different options object). + codec = new codecDef(codecOptions, iconv); + + iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. + return codec; + + default: + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); + } + } +} + +iconv._canonicalizeEncoding = function(encoding) { + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); +} + +iconv.getEncoder = function getEncoder(encoding, options) { + var codec = iconv.getCodec(encoding), + encoder = new codec.encoder(options, codec); + + if (codec.bomAware && options && options.addBOM) + encoder = new bomHandling.PrependBOM(encoder, options); + + return encoder; +} + +iconv.getDecoder = function getDecoder(encoding, options) { + var codec = iconv.getCodec(encoding), + decoder = new codec.decoder(options, codec); + + if (codec.bomAware && !(options && options.stripBOM === false)) + decoder = new bomHandling.StripBOM(decoder, options); + + return decoder; +} + + +// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json. +var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node; +if (nodeVer) { + + // Load streaming support in Node v0.10+ + var nodeVerArr = nodeVer.split(".").map(Number); + if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) { + __webpack_require__(727)(iconv); + } + + // Load Node primitive extensions. + __webpack_require__(725)(iconv); +} + +if (false) { + console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); +} + + +/***/ }), +/* 727 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Buffer = __webpack_require__(64).Buffer, + Transform = __webpack_require__(23).Transform; + + +// == Exports ================================================================== +module.exports = function(iconv) { + + // Additional Public API. + iconv.encodeStream = function encodeStream(encoding, options) { + return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); + } + + iconv.decodeStream = function decodeStream(encoding, options) { + return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); + } + + iconv.supportsStreams = true; + + + // Not published yet. + iconv.IconvLiteEncoderStream = IconvLiteEncoderStream; + iconv.IconvLiteDecoderStream = IconvLiteDecoderStream; + iconv._collect = IconvLiteDecoderStream.prototype.collect; +}; + + +// == Encoder stream ======================================================= +function IconvLiteEncoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.decodeStrings = false; // We accept only strings, so we don't need to decode them. + Transform.call(this, options); +} + +IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } +}); + +IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { + if (typeof chunk != 'string') + return done(new Error("Iconv encoding stream needs strings as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } +} + +IconvLiteEncoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } +} + +IconvLiteEncoderStream.prototype.collect = function(cb) { + var chunks = []; + this.on('error', cb); + this.on('data', function(chunk) { chunks.push(chunk); }); + this.on('end', function() { + cb(null, Buffer.concat(chunks)); + }); + return this; +} + + +// == Decoder stream ======================================================= +function IconvLiteDecoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.encoding = this.encoding = 'utf8'; // We output strings. + Transform.call(this, options); +} + +IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } +}); + +IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { + if (!Buffer.isBuffer(chunk)) + return done(new Error("Iconv decoding stream needs buffers as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } +} + +IconvLiteDecoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } +} + +IconvLiteDecoderStream.prototype.collect = function(cb) { + var res = ''; + this.on('error', cb); + this.on('data', function(chunk) { res += chunk; }); + this.on('end', function() { + cb(null, res); + }); + return this; +} + + + +/***/ }), +/* 728 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +const stripAnsi = __webpack_require__(329); +const isFullwidthCodePoint = __webpack_require__(736); + +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; +}; + + +/***/ }), +/* 729 */ +/***/ (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)) +} + + +/***/ }), +/* 730 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +const builtinModules = __webpack_require__(731); + +const moduleSet = new Set(builtinModules); + +module.exports = moduleName => { + if (typeof moduleName !== 'string') { + throw new TypeError('Expected a string'); + } + + return moduleSet.has(moduleName); +}; + + +/***/ }), +/* 731 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +const blacklist = [ + 'freelist', + 'sys' +]; + +module.exports = Object.keys(process.binding('natives')) + .filter(x => !/^_|^internal|\//.test(x) && blacklist.indexOf(x) === -1) + .sort(); + + +/***/ }), +/* 732 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function (buf) { + if (!buf || buf.length < 2) return false + return buf[0] === 0x78 && (buf[1] === 1 || buf[1] === 0x9c || buf[1] === 0xda) +} + + +/***/ }), +/* 733 */ +/***/ (function(module, exports) { + +/*! + * is-dotfile + * + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +module.exports = function(str) { + if (str.charCodeAt(0) === 46 /* . */ && str.indexOf('/', 1) === -1) { + return true; + } + var slash = str.lastIndexOf('/'); + return slash !== -1 ? str.charCodeAt(slash + 1) === 46 /* . */ : false; +}; + + +/***/ }), +/* 734 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * is-equal-shallow + * + * Copyright (c) 2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + + + +var isPrimitive = __webpack_require__(740); + +module.exports = function isEqual(a, b) { + if (!a && !b) { return true; } + if (!a && b || a && !b) { return false; } + + var numKeysA = 0, numKeysB = 0, key; + for (key in b) { + numKeysB++; + if (!isPrimitive(b[key]) || !a.hasOwnProperty(key) || (a[key] !== b[key])) { + return false; + } + } + for (key in a) { + numKeysA++; + } + return numKeysA === numKeysB; +}; + + +/***/ }), +/* 735 */ +/***/ (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'); +}; + + +/***/ }), +/* 736 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -101986,238 +122786,7 @@ module.exports = x => { /***/ }), -/* 559 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const stripAnsi = __webpack_require__(216); -const isFullwidthCodePoint = __webpack_require__(558); - -module.exports = str => { - if (typeof str !== 'string' || str.length === 0) { - return 0; - } - - let width = 0; - - str = stripAnsi(str); - - for (let i = 0; i < str.length; i++) { - const code = str.codePointAt(i); - - // ignore control characters - if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) { - continue; - } - - // surrogates - if (code >= 0x10000) { - i++; - } - - if (isFullwidthCodePoint(code)) { - width += 2; - } else { - width++; - } - } - - return width; -}; - - -/***/ }), -/* 560 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var argv = process.argv; - -var terminator = argv.indexOf('--'); -var hasFlag = function (flag) { - flag = '--' + flag; - var pos = argv.indexOf(flag); - return pos !== -1 && (terminator !== -1 ? pos < terminator : true); -}; - -module.exports = (function () { - if ('FORCE_COLOR' in process.env) { - return true; - } - - if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false')) { - return false; - } - - if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - return true; - } - - if (process.stdout && !process.stdout.isTTY) { - return false; - } - - if (process.platform === 'win32') { - return true; - } - - if ('COLORTERM' in process.env) { - return true; - } - - if (process.env.TERM === 'dumb') { - return false; - } - - if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { - return true; - } - - return false; -})(); - - -/***/ }), -/* 561 */ -/***/ (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)) -} - - -/***/ }), -/* 562 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var builtinModules = __webpack_require__(457); - -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return builtinModules.indexOf(str) !== -1; -}; - - -/***/ }), -/* 563 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = function (buf) { - if (!buf || buf.length < 2) return false - return buf[0] === 0x78 && (buf[1] === 1 || buf[1] === 0x9c || buf[1] === 0xda) -} - - -/***/ }), -/* 564 */ -/***/ (function(module, exports) { - -/*! - * is-dotfile - * - * Copyright (c) 2015 Jon Schlinkert, contributors. - * Licensed under the MIT license. - */ - -module.exports = function(str) { - if (str.charCodeAt(0) === 46 /* . */ && str.indexOf('/', 1) === -1) { - return true; - } - - var last = str.lastIndexOf('/'); - return last !== -1 ? str.charCodeAt(last + 1) === 46 /* . */ : false; -}; - - -/***/ }), -/* 565 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * is-equal-shallow - * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. - */ - - - -var isPrimitive = __webpack_require__(296); - -module.exports = function isEqual(a, b) { - if (!a && !b) { return true; } - if (!a && b || a && !b) { return false; } - - var numKeysA = 0, numKeysB = 0, key; - for (key in b) { - numKeysB++; - if (!isPrimitive(b[key]) || !a.hasOwnProperty(key) || (a[key] !== b[key])) { - return false; - } - } - for (key in a) { - numKeysA++; - } - return numKeysA === numKeysB; -}; - - -/***/ }), -/* 566 */ -/***/ (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'); -}; - - -/***/ }), -/* 567 */ +/* 737 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -102240,7 +122809,7 @@ module.exports = function (buf) { /***/ }), -/* 568 */ +/* 738 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -102254,7 +122823,7 @@ module.exports = function (x) { /***/ }), -/* 569 */ +/* 739 */ /***/ (function(module, exports) { /*! @@ -102270,7 +122839,27 @@ module.exports = function isPosixBracket(str) { /***/ }), -/* 570 */ +/* 740 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * is-primitive + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + + + +// see http://jsperf.com/testing-value-is-primitive/7 +module.exports = function isPrimitive(value) { + return value == null || (typeof value !== 'function' && typeof value !== 'object'); +}; + + +/***/ }), +/* 741 */ /***/ (function(module, exports) { module.exports = isPromise; @@ -102281,7 +122870,7 @@ function isPromise(obj) { /***/ }), -/* 571 */ +/* 742 */ /***/ (function(module, exports) { module.exports = isTypedArray @@ -102328,726 +122917,43 @@ function isLooseTypedArray(arr) { /***/ }), -/* 572 */ +/* 743 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -/*! - * isobject +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * is-windows * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License. + * Copyright Š 2015-2018, Jon Schlinkert. + * Released under the MIT License. */ - - -var isArray = __webpack_require__(297); - -module.exports = function isObject(val) { - return val != null && typeof val === 'object' && isArray(val) === false; -}; +(function(factory) { + if (exports && typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = factory(); + } else if (true) { + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else if (typeof window !== 'undefined') { + window.isWindows = factory(); + } else if (typeof global !== 'undefined') { + global.isWindows = factory(); + } else if (typeof self !== 'undefined') { + self.isWindows = factory(); + } else { + this.isWindows = factory(); + } +})(function() { + 'use strict'; + return function isWindows() { + return process && (process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE)); + }; +}); /***/ }), -/* 573 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * @fileOverview - * EC Diffie-Hellman operations on Curve25519. - */ - -/* - * Copyright (c) 2014 Mega Limited - * under the MIT License. - * - * Authors: Guy K. Kloss - * - * You should have received a copy of the license along with this program. - */ - -var core = __webpack_require__(141); -var utils = __webpack_require__(142); -var curve255 = __webpack_require__(220); - - - /** - * @exports jodid25519/dh - * EC Diffie-Hellman operations on Curve25519. - * - * @description - * EC Diffie-Hellman operations on Curve25519. - */ - var ns = {}; - - - function _toString(vector) { - var u = new Uint16Array(vector); - return (new Buffer(new Uint8Array(u.buffer))); - } - - function _fromString(vector) { - if (Buffer.isBuffer(vector)) { - var u = new Uint8Array(vector); - return (new Uint16Array(u.buffer)); - } - - var result = new Array(16); - for (var i = 0, l = 0; i < vector.length; i += 2) { - result[l] = (vector.charCodeAt(i + 1) << 8) | vector.charCodeAt(i); - l++; - } - return result; - } - - - /** - * Computes a key through scalar multiplication of a point on the curve 25519. - * - * This function is used for the DH key-exchange protocol. It computes a - * key based on a secret key with a public component (opponent's public key - * or curve base point if not given) by using scalar multiplication. - * - * Before multiplication, some bit operations are applied to the - * private key to ensure it is a valid Curve25519 secret key. - * It is the user's responsibility to make sure that the private - * key is a uniformly random, secret value. - * - * @function - * @param privateComponent {string} - * Private point as byte string on the curve. - * @param publicComponent {string} - * Public point as byte string on the curve. If not given, the curve's - * base point is used. - * @returns {string} - * Key point as byte string resulting from scalar product. - */ - ns.computeKey = function(privateComponent, publicComponent) { - if (publicComponent) { - return _toString(curve255.curve25519(_fromString(privateComponent), - _fromString(publicComponent))); - } else { - return _toString(curve255.curve25519(_fromString(privateComponent))); - } - }; - - /** - * Computes the public key to a private key on the curve 25519. - * - * Before multiplication, some bit operations are applied to the - * private key to ensure it is a valid Curve25519 secret key. - * It is the user's responsibility to make sure that the private - * key is a uniformly random, secret value. - * - * @function - * @param privateKey {string} - * Private point as byte string on the curve. - * @returns {string} - * Public key point as byte string resulting from scalar product. - */ - ns.publicKey = function(privateKey) { - return _toString(curve255.curve25519(_fromString(privateKey))); - }; - - - /** - * Generates a new random private key of 32 bytes length (256 bit). - * - * @function - * @returns {string} - * Byte string containing a new random private key seed. - */ - ns.generateKey = function() { - return core.generateKey(true); - }; - -module.exports = ns; - - -/***/ }), -/* 574 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/** - * @fileOverview - * Digital signature scheme based on Curve25519 (Ed25519 or EdDSA). - */ - -/* - * Copyright (c) 2011, 2012, 2014 Ron Garret - * Copyright (c) 2014 Mega Limited - * under the MIT License. - * - * Authors: Guy K. Kloss, Ron Garret - * - * You should have received a copy of the license along with this program. - */ - -var core = __webpack_require__(141); -var curve255 = __webpack_require__(220); -var utils = __webpack_require__(142); -var BigInteger = __webpack_require__(56).BigInteger; -var crypto = __webpack_require__(8); - - /** - * @exports jodid25519/eddsa - * Digital signature scheme based on Curve25519 (Ed25519 or EdDSA). - * - * @description - * Digital signature scheme based on Curve25519 (Ed25519 or EdDSA). - * - *

- * This code is adapted from fast-djbec.js, a faster but more complicated - * version of the Ed25519 encryption scheme (as compared to djbec.js). - * It uses two different representations for big integers: The jsbn - * BigInteger class, which can represent arbitrary-length numbers, and a - * special fixed-length representation optimised for 256-bit integers. - * The reason both are needed is that the Ed25519 algorithm requires some - * 512-bit numbers.

- */ - var ns = {}; - - function _bi255(value) { - if (!(this instanceof _bi255)) { - return new _bi255(value); - } - if (typeof value === 'undefined') { - return _ZERO; - } - var c = value.constructor; - if ((c === Array || c === Uint16Array || c === Uint32Array) && (value.length === 16)) { - this.n = value; - } else if ((c === Array) && (value.length === 32)) { - this.n = _bytes2bi255(value).n; - } else if (c === String) { - this.n = utils.hexDecode(value); - } else if (c === Number) { - this.n = [value & 0xffff, - value >> 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - } else if (value instanceof _bi255) { - this.n = value.n.slice(0); // Copy constructor - } else { - throw "Bad argument for bignum: " + value; - } - } - - _bi255.prototype = { - 'toString' : function() { - return utils.hexEncode(this.n); - }, - 'toSource' : function() { - return '_' + utils.hexEncode(this.n); - }, - 'plus' : function(n1) { - return _bi255(core.bigintadd(this.n, n1.n)); - }, - 'minus' : function(n1) { - return _bi255(core.bigintsub(this.n, n1.n)).modq(); - }, - 'times' : function(n1) { - return _bi255(core.mulmodp(this.n, n1.n)); - }, - 'divide' : function(n1) { - return this.times(n1.inv()); - }, - 'sqr' : function() { - return _bi255(core.sqrmodp(this.n)); - }, - 'cmp' : function(n1) { - return core.bigintcmp(this.n, n1.n); - }, - 'equals' : function(n1) { - return this.cmp(n1) === 0; - }, - 'isOdd' : function() { - return (this.n[0] & 1) === 1; - }, - 'shiftLeft' : function(cnt) { - _shiftL(this.n, cnt); - return this; - }, - 'shiftRight' : function(cnt) { - _shiftR(this.n, cnt); - return this; - }, - 'inv' : function() { - return _bi255(core.invmodp(this.n)); - }, - 'pow' : function(e) { - return _bi255(_pow(this.n, e.n)); - }, - 'modq' : function() { - return _modq(this); - }, - 'bytes' : function() { - return _bi255_bytes(this); - } - }; - - function _shiftL(n, cnt) { - var lastcarry = 0; - for (var i = 0; i < 16; i++) { - var carry = n[i] >> (16 - cnt); - n[i] = (n[i] << cnt) & 0xffff | lastcarry; - lastcarry = carry; - } - return n; - } - - function _shiftR(n, cnt) { - var lastcarry = 0; - for (var i = 15; i >= 0; i--) { - var carry = n[i] << (16 - cnt) & 0xffff; - n[i] = (n[i] >> cnt) | lastcarry; - lastcarry = carry; - } - return n; - } - - function _bi255_bytes(n) { - n = _bi255(n); // Make a copy because shiftRight is destructive - var a = new Array(32); - for (var i = 31; i >= 0; i--) { - a[i] = n.n[0] & 0xff; - n.shiftRight(8); - } - return a; - } - - function _bytes2bi255(a) { - var n = _ZERO; - for (var i = 0; i < 32; i++) { - n.shiftLeft(8); - n = n.plus(_bi255(a[i])); - } - return n; - } - - function _pow(n, e) { - var result = core.ONE(); - for (var i = 0; i < 256; i++) { - if (core.getbit(e, i) === 1) { - result = core.mulmodp(result, n); - } - n = core.sqrmodp(n); - } - return result; - } - - var _ZERO = _bi255(0); - var _ONE = _bi255(1); - var _TWO = _bi255(2); - // This is the core prime. - var _Q = _bi255([0xffff - 18, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0x7fff]); - - function _modq(n) { - core.reduce(n.n); - if (n.cmp(_Q) >= 0) { - return _modq(n.minus(_Q)); - } - if (n.cmp(_ZERO) === -1) { - return _modq(n.plus(_Q)); - } else { - return n; - } - } - - // _RECOVERY_EXPONENT = _Q.plus(_bi255(3)).divide(_bi255(8)); - var _RECOVERY_EXPONENT = _bi255('0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe'); - // _D = _Q.minus(_bi255(121665)).divide(_bi255(121666)); - var _D = _bi255('52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3'); - // _I = _TWO.pow(_Q.minus(_ONE).divide(_bi255(4))); - var _I = _bi255('2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0'); - // _L = _TWO.pow(_bi255(252)).plus(_bi255('14def9dea2f79cd65812631a5cf5d3ed')); - var _L = _bi255('1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed'); - var _L_BI = _bi('1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed', 16); - - - // //////////////////////////////////////////////////////////// - - function _isoncurve(p) { - var x = p[0]; - var y = p[1]; - var xsqr = x.sqr(); - var ysqr = y.sqr(); - var v = _D.times(xsqr).times(ysqr); - return ysqr.minus(xsqr).minus(_ONE).minus(v).modq().equals(_ZERO); - } - - function _xrecover(y) { - var ysquared = y.sqr(); - var xx = ysquared.minus(_ONE).divide(_ONE.plus(_D.times(ysquared))); - var x = xx.pow(_RECOVERY_EXPONENT); - if (!(x.times(x).minus(xx).equals(_ZERO))) { - x = x.times(_I); - } - if (x.isOdd()) { - x = _Q.minus(x); - } - return x; - } - - function _x_pt_add(pt1, pt2) { - var x1 = pt1[0]; - var y1 = pt1[1]; - var z1 = pt1[2]; - var t1 = pt1[3]; - var x2 = pt2[0]; - var y2 = pt2[1]; - var z2 = pt2[2]; - var t2 = pt2[3]; - var A = y1.minus(x1).times(y2.plus(x2)); - var B = y1.plus(x1).times(y2.minus(x2)); - var C = z1.times(_TWO).times(t2); - var D = t1.times(_TWO).times(z2); - var E = D.plus(C); - var F = B.minus(A); - var G = B.plus(A); - var H = D.minus(C); - return [E.times(F), G.times(H), F.times(G), E.times(H)]; - } - - function _xpt_double(pt1) { - var x1 = pt1[0]; - var y1 = pt1[1]; - var z1 = pt1[2]; - var A = x1.times(x1); - var B = y1.times(y1); - var C = _TWO.times(z1).times(z1); - var D = _Q.minus(A); - var J = x1.plus(y1); - var E = J.times(J).minus(A).minus(B); - var G = D.plus(B); - var F = G.minus(C); - var H = D.minus(B); - return [E.times(F), G.times(H), F.times(G), E.times(H)]; - } - - function _xpt_mult(pt, n) { - if (n.equals(_ZERO)) { - return [_ZERO, _ONE, _ONE, _ZERO]; - } - var odd = n.isOdd(); - n.shiftRight(1); - var value = _xpt_double(_xpt_mult(pt, n)); - return odd ? _x_pt_add(value, pt) : value; - } - - function _pt_xform(pt) { - var x = pt[0]; - var y = pt[1]; - return [x, y, _ONE, x.times(y)]; - } - - function _pt_unxform(pt) { - var x = pt[0]; - var y = pt[1]; - var z = pt[2]; - var invz = z.inv(); - return [x.times(invz), y.times(invz)]; - } - - function _scalarmult(pt, n) { - return _pt_unxform(_xpt_mult(_pt_xform(pt), n)); - } - - function _bytesgetbit(bytes, n) { - return (bytes[bytes.length - (n >>> 3) - 1] >> (n & 7)) & 1; - } - - function _xpt_mult_bytes(pt, bytes) { - var r = [_ZERO, _ONE, _ONE, _ZERO]; - for (var i = (bytes.length << 3) - 1; i >= 0; i--) { - r = _xpt_double(r); - if (_bytesgetbit(bytes, i) === 1) { - r = _x_pt_add(r, pt); - } - } - return r; - } - - function _scalarmultBytes(pt, bytes) { - return _pt_unxform(_xpt_mult_bytes(_pt_xform(pt), bytes)); - } - - var _by = _bi255(4).divide(_bi255(5)); - var _bx = _xrecover(_by); - var _bp = [_bx, _by]; - - function _encodeint(n) { - return n.bytes(32).reverse(); - } - function _decodeint(b) { - return _bi255(b.slice(0).reverse()); - } - - function _encodepoint(p) { - var v = _encodeint(p[1]); - if (p[0].isOdd()) { - v[31] |= 0x80; - } - return v; - } - - function _decodepoint(v) { - v = v.slice(0); - var signbit = v[31] >> 7; - v[31] &= 127; - var y = _decodeint(v); - var x = _xrecover(y); - if ((x.n[0] & 1) !== signbit) { - x = _Q.minus(x); - } - var p = [x, y]; - if (!_isoncurve(p)) { - throw ('Point is not on curve'); - } - return p; - } - - // ////////////////////////////////////////////////// - - /** - * Factory function to create a suitable BigInteger. - * - * @param value - * The value for the big integer. - * @param base {integer} - * Base of the conversion of elements in ``value``. - * @returns - * A BigInteger object. - */ - function _bi(value, base) { - if (base !== undefined) { - if (base === 256) { - return _bi(utils.string2bytes(value)); - } - return new BigInteger(value, base); - } else if (typeof value === 'string') { - return new BigInteger(value, 10); - } else if ((value instanceof Array) || (value instanceof Uint8Array) - || Buffer.isBuffer(value)) { - return new BigInteger(value); - } else if (typeof value === 'number') { - return new BigInteger(value.toString(), 10); - } else { - throw "Can't convert " + value + " to BigInteger"; - } - } - - function _bi2bytes(n, cnt) { - if (cnt === undefined) { - cnt = (n.bitLength() + 7) >>> 3; - } - var bytes = new Array(cnt); - for (var i = cnt - 1; i >= 0; i--) { - bytes[i] = n[0] & 255; // n.and(0xff); - n = n.shiftRight(8); - } - return bytes; - } - - BigInteger.prototype.bytes = function(n) { - return _bi2bytes(this, n); - }; - - // ///////////////////////////////////////////////////////// - - function _bytehash(s) { - var sha = crypto.createHash('sha512').update(s).digest(); - return _bi2bytes(_bi(sha), 64).reverse(); - } - - function _stringhash(s) { - var sha = crypto.createHash('sha512').update(s).digest(); - return _map(_chr, _bi2bytes(_bi(sha), 64)).join(''); - } - - function _inthash(s) { - // Need a leading 0 to prevent sign extension - return _bi([0].concat(_bytehash(s))); - } - - function _inthash_lo(s) { - return _bi255(_bytehash(s).slice(32, 64)); - } - - function _inthash_mod_l(s) { - return _inthash(s).mod(_L_BI); - } - - function _get_a(sk) { - var a = _inthash_lo(sk); - a.n[0] &= 0xfff8; - a.n[15] &= 0x3fff; - a.n[15] |= 0x4000; - return a; - } - - function _publickey(sk) { - return _encodepoint(_scalarmult(_bp, _get_a(sk))); - } - - function _map(f, l) { - var result = new Array(l.length); - for (var i = 0; i < l.length; i++) { - result[i] = f(l[i]); - } - return result; - } - - function _chr(n) { - return String.fromCharCode(n); - } - - function _ord(c) { - return c.charCodeAt(0); - } - - function _pt_add(p1, p2) { - return _pt_unxform(_x_pt_add(_pt_xform(p1), _pt_xform(p2))); - } - - - // Exports for the API. - - /** - * Checks whether a point is on the curve. - * - * @function - * @param point {string} - * The point to check for in a byte string representation. - * @returns {boolean} - * true if the point is on the curve, false otherwise. - */ - ns.isOnCurve = function(point) { - try { - _isoncurve(_decodepoint(utils.string2bytes(point))); - } catch(e) { - if (e === 'Point is not on curve') { - return false; - } else { - throw e; - } - } - return true; - }; - - - /** - * Computes the EdDSA public key. - * - *

Note: Seeds should be a byte string, not a unicode string containing - * multi-byte characters.

- * - * @function - * @param keySeed {string} - * Private key seed in the form of a byte string. - * @returns {string} - * Public key as byte string computed from the private key seed - * (32 bytes). - */ - ns.publicKey = function(keySeed) { - return utils.bytes2string(_publickey(keySeed)); - }; - - - /** - * Computes an EdDSA signature of a message. - * - *

Notes:

- * - *
    - *
  • Unicode messages need to be converted to a byte representation - * (e. g. UTF-8).
  • - *
  • If `publicKey` is given, and it is *not* a point of the curve, - * the signature will be faulty, but no error will be thrown.
  • - *
- * - * @function - * @param message {string} - * Message in the form of a byte string. - * @param keySeed {string} - * Private key seed in the form of a byte string. - * @param publicKey {string} - * Public key as byte string (if not present, it will be computed from - * the private key seed). - * @returns {string} - * Detached message signature in the form of a byte string (64 bytes). - */ - ns.sign = function(message, keySeed, publicKey) { - if (publicKey === undefined) { - publicKey = _publickey(keySeed); - } else { - publicKey = utils.string2bytes(publicKey); - } - var a = _bi(_get_a(keySeed).toString(), 16); - var hs = _stringhash(keySeed); - var r = _bytehash(hs.slice(32, 64) + message); - var rp = _scalarmultBytes(_bp, r); - var erp = _encodepoint(rp); - r = _bi(r).mod(_bi(1, 10).shiftLeft(512)); - var s = _map(_chr, erp).join('') + _map(_chr, publicKey).join('') + message; - s = _inthash_mod_l(s).multiply(a).add(r).mod(_L_BI); - return utils.bytes2string(erp.concat(_encodeint(s))); - }; - - - /** - * Verifies an EdDSA signature of a message with the public key. - * - *

Note: Unicode messages need to be converted to a byte representation - * (e. g. UTF-8).

- * - * @function - * @param signature {string} - * Message signature in the form of a byte string. Can be detached - * (64 bytes), or attached to be sliced off. - * @param message {string} - * Message in the form of a byte string. - * @param publicKey {string} - * Public key as byte string (if not present, it will be computed from - * the private key seed). - * @returns {boolean} - * true, if the signature verifies. - */ - ns.verify = function(signature, message, publicKey) { - signature = utils.string2bytes(signature.slice(0, 64)); - publicKey = utils.string2bytes(publicKey); - var rpe = signature.slice(0, 32); - var rp = _decodepoint(rpe); - var a = _decodepoint(publicKey); - var s = _decodeint(signature.slice(32, 64)); - var h = _inthash(utils.bytes2string(rpe.concat(publicKey)) + message); - var v1 = _scalarmult(_bp, s); - var value = _scalarmultBytes(a, _bi2bytes(h)); - var v2 = _pt_add(rp, value); - return v1[0].equals(v2[0]) && v1[1].equals(v2[1]); - }; - - - /** - * Generates a new random private key seed of 32 bytes length (256 bit). - * - * @function - * @returns {string} - * Byte string containing a new random private key seed. - */ - ns.generateKeySeed = function() { - return core.generateKey(false); - }; - -module.exports = ns; - - -/***/ }), -/* 575 */ +/* 744 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** @@ -103327,7 +123233,7 @@ return exports; /***/ }), -/* 576 */ +/* 745 */ /***/ (function(module, exports) { exports = module.exports = stringify @@ -103360,466 +123266,19 @@ function serializer(replacer, cycleReplacer) { /***/ }), -/* 577 */ -/***/ (function(module, exports, __webpack_require__) { - -exports.parse = __webpack_require__(578); -exports.stringify = __webpack_require__(579); - - -/***/ }), -/* 578 */ -/***/ (function(module, exports) { - -var at, // The index of the current character - ch, // The current character - escapee = { - '"': '"', - '\\': '\\', - '/': '/', - b: '\b', - f: '\f', - n: '\n', - r: '\r', - t: '\t' - }, - text, - - error = function (m) { - // Call error when something is wrong. - throw { - name: 'SyntaxError', - message: m, - at: at, - text: text - }; - }, - - next = function (c) { - // If a c parameter is provided, verify that it matches the current character. - if (c && c !== ch) { - error("Expected '" + c + "' instead of '" + ch + "'"); - } - - // Get the next character. When there are no more characters, - // return the empty string. - - ch = text.charAt(at); - at += 1; - return ch; - }, - - number = function () { - // Parse a number value. - var number, - string = ''; - - if (ch === '-') { - string = '-'; - next('-'); - } - while (ch >= '0' && ch <= '9') { - string += ch; - next(); - } - if (ch === '.') { - string += '.'; - while (next() && ch >= '0' && ch <= '9') { - string += ch; - } - } - if (ch === 'e' || ch === 'E') { - string += ch; - next(); - if (ch === '-' || ch === '+') { - string += ch; - next(); - } - while (ch >= '0' && ch <= '9') { - string += ch; - next(); - } - } - number = +string; - if (!isFinite(number)) { - error("Bad number"); - } else { - return number; - } - }, - - string = function () { - // Parse a string value. - var hex, - i, - string = '', - uffff; - - // When parsing for string values, we must look for " and \ characters. - if (ch === '"') { - while (next()) { - if (ch === '"') { - next(); - return string; - } else if (ch === '\\') { - next(); - if (ch === 'u') { - uffff = 0; - for (i = 0; i < 4; i += 1) { - hex = parseInt(next(), 16); - if (!isFinite(hex)) { - break; - } - uffff = uffff * 16 + hex; - } - string += String.fromCharCode(uffff); - } else if (typeof escapee[ch] === 'string') { - string += escapee[ch]; - } else { - break; - } - } else { - string += ch; - } - } - } - error("Bad string"); - }, - - white = function () { - -// Skip whitespace. - - while (ch && ch <= ' ') { - next(); - } - }, - - word = function () { - -// true, false, or null. - - switch (ch) { - case 't': - next('t'); - next('r'); - next('u'); - next('e'); - return true; - case 'f': - next('f'); - next('a'); - next('l'); - next('s'); - next('e'); - return false; - case 'n': - next('n'); - next('u'); - next('l'); - next('l'); - return null; - } - error("Unexpected '" + ch + "'"); - }, - - value, // Place holder for the value function. - - array = function () { - -// Parse an array value. - - var array = []; - - if (ch === '[') { - next('['); - white(); - if (ch === ']') { - next(']'); - return array; // empty array - } - while (ch) { - array.push(value()); - white(); - if (ch === ']') { - next(']'); - return array; - } - next(','); - white(); - } - } - error("Bad array"); - }, - - object = function () { - -// Parse an object value. - - var key, - object = {}; - - if (ch === '{') { - next('{'); - white(); - if (ch === '}') { - next('}'); - return object; // empty object - } - while (ch) { - key = string(); - white(); - next(':'); - if (Object.hasOwnProperty.call(object, key)) { - error('Duplicate key "' + key + '"'); - } - object[key] = value(); - white(); - if (ch === '}') { - next('}'); - return object; - } - next(','); - white(); - } - } - error("Bad object"); - }; - -value = function () { - -// Parse a JSON value. It could be an object, an array, a string, a number, -// or a word. - - white(); - switch (ch) { - case '{': - return object(); - case '[': - return array(); - case '"': - return string(); - case '-': - return number(); - default: - return ch >= '0' && ch <= '9' ? number() : word(); - } -}; - -// Return the json_parse function. It will have access to all of the above -// functions and variables. - -module.exports = function (source, reviver) { - var result; - - text = source; - at = 0; - ch = ' '; - result = value(); - white(); - if (ch) { - error("Syntax error"); - } - - // If there is a reviver function, we recursively walk the new structure, - // passing each name/value pair to the reviver function for possible - // transformation, starting with a temporary root object that holds the result - // in an empty key. If there is not a reviver function, we simply return the - // result. - - return typeof reviver === 'function' ? (function walk(holder, key) { - var k, v, value = holder[key]; - if (value && typeof value === 'object') { - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = walk(value, k); - if (v !== undefined) { - value[k] = v; - } else { - delete value[k]; - } - } - } - } - return reviver.call(holder, key, value); - }({'': result}, '')) : result; -}; - - -/***/ }), -/* 579 */ -/***/ (function(module, exports) { - -var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - gap, - indent, - meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }, - rep; - -function quote(string) { - // If the string contains no control characters, no quote characters, and no - // backslash characters, then we can safely slap some quotes around it. - // Otherwise we must also replace the offending characters with safe escape - // sequences. - - escapable.lastIndex = 0; - return escapable.test(string) ? '"' + string.replace(escapable, function (a) { - var c = meta[a]; - return typeof c === 'string' ? c : - '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }) + '"' : '"' + string + '"'; -} - -function str(key, holder) { - // Produce a string from holder[key]. - var i, // The loop counter. - k, // The member key. - v, // The member value. - length, - mind = gap, - partial, - value = holder[key]; - - // If the value has a toJSON method, call it to obtain a replacement value. - if (value && typeof value === 'object' && - typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - - // If we were called with a replacer function, then call the replacer to - // obtain a replacement value. - if (typeof rep === 'function') { - value = rep.call(holder, key, value); - } - - // What happens next depends on the value's type. - switch (typeof value) { - case 'string': - return quote(value); - - case 'number': - // JSON numbers must be finite. Encode non-finite numbers as null. - return isFinite(value) ? String(value) : 'null'; - - case 'boolean': - case 'null': - // If the value is a boolean or null, convert it to a string. Note: - // typeof null does not produce 'null'. The case is included here in - // the remote chance that this gets fixed someday. - return String(value); - - case 'object': - if (!value) return 'null'; - gap += indent; - partial = []; - - // Array.isArray - if (Object.prototype.toString.apply(value) === '[object Array]') { - length = value.length; - for (i = 0; i < length; i += 1) { - partial[i] = str(i, value) || 'null'; - } - - // Join all of the elements together, separated with commas, and - // wrap them in brackets. - v = partial.length === 0 ? '[]' : gap ? - '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : - '[' + partial.join(',') + ']'; - gap = mind; - return v; - } - - // If the replacer is an array, use it to select the members to be - // stringified. - if (rep && typeof rep === 'object') { - length = rep.length; - for (i = 0; i < length; i += 1) { - k = rep[i]; - if (typeof k === 'string') { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - else { - // Otherwise, iterate through all of the keys in the object. - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - - // Join all of the member texts together, separated with commas, - // and wrap them in braces. - - v = partial.length === 0 ? '{}' : gap ? - '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : - '{' + partial.join(',') + '}'; - gap = mind; - return v; - } -} - -module.exports = function (value, replacer, space) { - var i; - gap = ''; - indent = ''; - - // If the space parameter is a number, make an indent string containing that - // many spaces. - if (typeof space === 'number') { - for (i = 0; i < space; i += 1) { - indent += ' '; - } - } - // If the space parameter is a string, it will be used as the indent string. - else if (typeof space === 'string') { - indent = space; - } - - // If there is a replacer, it must be a function or an array. - // Otherwise, throw an error. - rep = replacer; - if (replacer && typeof replacer !== 'function' - && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { - throw new Error('JSON.stringify'); - } - - // Make a fake root object containing our value under the key of ''. - // Return the result of stringifying the value. - return str('', {'': value}); -}; - - -/***/ }), -/* 580 */ +/* 746 */ /***/ (function(module, exports, __webpack_require__) { /* * lib/jsprim.js: utilities for primitive JavaScript types */ -var mod_assert = __webpack_require__(11); -var mod_util = __webpack_require__(2); +var mod_assert = __webpack_require__(16); +var mod_util = __webpack_require__(3); -var mod_extsprintf = __webpack_require__(290); -var mod_verror = __webpack_require__(670); -var mod_jsonschema = __webpack_require__(575); +var mod_extsprintf = __webpack_require__(645); +var mod_verror = __webpack_require__(960); +var mod_jsonschema = __webpack_require__(744); /* * Public interface @@ -104548,7 +124007,7 @@ function mergeObjects(provided, overrides, defaults) /***/ }), -/* 581 */ +/* 747 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -104640,7 +124099,7 @@ module.exports = function (a, b) { /***/ }), -/* 582 */ +/* 748 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {/** @@ -106429,10 +125888,10 @@ function constant(value) { module.exports = baseClone; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(163)(module))) /***/ }), -/* 583 */ +/* 749 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -106443,7 +125902,7 @@ module.exports = baseClone; * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseClone = __webpack_require__(582); +var baseClone = __webpack_require__(748); /** * Creates a shallow clone of `value`. @@ -106477,7 +125936,901 @@ module.exports = clone; /***/ }), -/* 584 */ +/* 750 */ +/***/ (function(module, exports) { + +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var dataViewTag = '[object DataView]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ +function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ +function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + iteratorSymbol = Symbol ? Symbol.iterator : undefined, + propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); +} + +/** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ +function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (iteratorSymbol && value[iteratorSymbol]) { + return iteratorToArray(value[iteratorSymbol]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ +function values(object) { + return object ? baseValues(object, keys(object)) : []; +} + +module.exports = toArray; + + +/***/ }), +/* 751 */ +/***/ (function(module, exports, __webpack_require__) { + +var crypto = __webpack_require__(11) +var max = Math.pow(2, 32) + +module.exports = random +module.exports.cryptographic = true + +function random () { + var buf = crypto + .randomBytes(4) + .toString('hex') + + return parseInt(buf, 16) / max +} + + +/***/ }), +/* 752 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -106551,7 +126904,7 @@ module.exports = chars; /***/ }), -/* 585 */ +/* 753 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -106564,8 +126917,8 @@ module.exports = chars; -var utils = __webpack_require__(223); -var Glob = __webpack_require__(586); +var utils = __webpack_require__(300); +var Glob = __webpack_require__(754); /** * Expose `expand` @@ -106862,14 +127215,14 @@ function globstar(dotfile) { /***/ }), -/* 586 */ +/* 754 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var chars = __webpack_require__(584); -var utils = __webpack_require__(223); +var chars = __webpack_require__(752); +var utils = __webpack_require__(300); /** * Expose `Glob` @@ -107062,8708 +127415,519 @@ function unesc(str) { /***/ }), -/* 587 */ -/***/ (function(module, exports) { +/* 755 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * arr-diff + * + * Copyright (c) 2014 Jon Schlinkert, contributors. + * Licensed under the MIT License + */ + + + +var flatten = __webpack_require__(510); +var slice = [].slice; + +/** + * Return the difference between the first array and + * additional arrays. + * + * ```js + * var diff = require('{%= name %}'); + * + * var a = ['a', 'b', 'c', 'd']; + * var b = ['b', 'c']; + * + * console.log(diff(a, b)) + * //=> ['a', 'd'] + * ``` + * + * @param {Array} `a` + * @param {Array} `b` + * @return {Array} + * @api public + */ + +function diff(arr, arrays) { + var argsLen = arguments.length; + var len = arr.length, i = -1; + var res = [], arrays; + + if (argsLen === 1) { + return arr; + } + + if (argsLen > 2) { + arrays = flatten(slice.call(arguments, 1)); + } + + while (++i < len) { + if (!~arrays.indexOf(arr[i])) { + res.push(arr[i]); + } + } + return res; +} + +/** + * Expose `diff` + */ + +module.exports = diff; -module.exports = { - "application/1d-interleaved-parityfec": { - "source": "iana" - }, - "application/3gpdash-qoe-report+xml": { - "source": "iana" - }, - "application/3gpp-ims+xml": { - "source": "iana" - }, - "application/a2l": { - "source": "iana" - }, - "application/activemessage": { - "source": "iana" - }, - "application/alto-costmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-costmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/alto-directory+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcost+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointcostparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointprop+json": { - "source": "iana", - "compressible": true - }, - "application/alto-endpointpropparams+json": { - "source": "iana", - "compressible": true - }, - "application/alto-error+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmap+json": { - "source": "iana", - "compressible": true - }, - "application/alto-networkmapfilter+json": { - "source": "iana", - "compressible": true - }, - "application/aml": { - "source": "iana" - }, - "application/andrew-inset": { - "source": "iana", - "extensions": [ - "ez" - ] - }, - "application/applefile": { - "source": "iana" - }, - "application/applixware": { - "source": "apache", - "extensions": [ - "aw" - ] - }, - "application/atf": { - "source": "iana" - }, - "application/atfx": { - "source": "iana" - }, - "application/atom+xml": { - "source": "iana", - "compressible": true, - "extensions": [ - "atom" - ] - }, - "application/atomcat+xml": { - "source": "iana", - "extensions": [ - "atomcat" - ] - }, - "application/atomdeleted+xml": { - "source": "iana" - }, - "application/atomicmail": { - "source": "iana" - }, - "application/atomsvc+xml": { - "source": "iana", - "extensions": [ - "atomsvc" - ] - }, - "application/atxml": { - "source": "iana" - }, - "application/auth-policy+xml": { - "source": "iana" - }, - "application/bacnet-xdd+zip": { - "source": "iana" - }, - "application/batch-smtp": { - "source": "iana" - }, - "application/bdoc": { - "compressible": false, - "extensions": [ - "bdoc" - ] - }, - "application/beep+xml": { - "source": "iana" - }, - "application/calendar+json": { - "source": "iana", - "compressible": true - }, - "application/calendar+xml": { - "source": "iana" - }, - "application/call-completion": { - "source": "iana" - }, - "application/cals-1840": { - "source": "iana" - }, - "application/cbor": { - "source": "iana" - }, - "application/ccmp+xml": { - "source": "iana" - }, - "application/ccxml+xml": { - "source": "iana", - "extensions": [ - "ccxml" - ] - }, - "application/cdfx+xml": { - "source": "iana" - }, - "application/cdmi-capability": { - "source": "iana", - "extensions": [ - "cdmia" - ] - }, - "application/cdmi-container": { - "source": "iana", - "extensions": [ - "cdmic" - ] - }, - "application/cdmi-domain": { - "source": "iana", - "extensions": [ - "cdmid" - ] - }, - "application/cdmi-object": { - "source": "iana", - "extensions": [ - "cdmio" - ] - }, - "application/cdmi-queue": { - "source": "iana", - "extensions": [ - "cdmiq" - ] - }, - "application/cdni": { - "source": "iana" - }, - "application/cea": { - "source": "iana" - }, - "application/cea-2018+xml": { - "source": "iana" - }, - "application/cellml+xml": { - "source": "iana" - }, - "application/cfw": { - "source": "iana" - }, - "application/clue_info+xml": { - "source": "iana" - }, - "application/cms": { - "source": "iana" - }, - "application/cnrp+xml": { - "source": "iana" - }, - "application/coap-group+json": { - "source": "iana", - "compressible": true - }, - "application/coap-payload": { - "source": "iana" - }, - "application/commonground": { - "source": "iana" - }, - "application/conference-info+xml": { - "source": "iana" - }, - "application/cose": { - "source": "iana" - }, - "application/cose-key": { - "source": "iana" - }, - "application/cose-key-set": { - "source": "iana" - }, - "application/cpl+xml": { - "source": "iana" - }, - "application/csrattrs": { - "source": "iana" - }, - "application/csta+xml": { - "source": "iana" - }, - "application/cstadata+xml": { - "source": "iana" - }, - "application/csvm+json": { - "source": "iana", - "compressible": true - }, - "application/cu-seeme": { - "source": "apache", - "extensions": [ - "cu" - ] - }, - "application/cybercash": { - "source": "iana" - }, - "application/dart": { - "compressible": true - }, - "application/dash+xml": { - "source": "iana", - "extensions": [ - "mpd" - ] - }, - "application/dashdelta": { - "source": "iana" - }, - "application/davmount+xml": { - "source": "iana", - "extensions": [ - "davmount" - ] - }, - "application/dca-rft": { - "source": "iana" - }, - "application/dcd": { - "source": "iana" - }, - "application/dec-dx": { - "source": "iana" - }, - "application/dialog-info+xml": { - "source": "iana" - }, - "application/dicom": { - "source": "iana" - }, - "application/dicom+json": { - "source": "iana", - "compressible": true - }, - "application/dicom+xml": { - "source": "iana" - }, - "application/dii": { - "source": "iana" - }, - "application/dit": { - "source": "iana" - }, - "application/dns": { - "source": "iana" - }, - "application/docbook+xml": { - "source": "apache", - "extensions": [ - "dbk" - ] - }, - "application/dskpp+xml": { - "source": "iana" - }, - "application/dssc+der": { - "source": "iana", - "extensions": [ - "dssc" - ] - }, - "application/dssc+xml": { - "source": "iana", - "extensions": [ - "xdssc" - ] - }, - "application/dvcs": { - "source": "iana" - }, - "application/ecmascript": { - "source": "iana", - "compressible": true, - "extensions": [ - "ecma" - ] - }, - "application/edi-consent": { - "source": "iana" - }, - "application/edi-x12": { - "source": "iana", - "compressible": false - }, - "application/edifact": { - "source": "iana", - "compressible": false - }, - "application/efi": { - "source": "iana" - }, - "application/emergencycalldata.comment+xml": { - "source": "iana" - }, - "application/emergencycalldata.control+xml": { - "source": "iana" - }, - "application/emergencycalldata.deviceinfo+xml": { - "source": "iana" - }, - "application/emergencycalldata.ecall.msd": { - "source": "iana" - }, - "application/emergencycalldata.providerinfo+xml": { - "source": "iana" - }, - "application/emergencycalldata.serviceinfo+xml": { - "source": "iana" - }, - "application/emergencycalldata.subscriberinfo+xml": { - "source": "iana" - }, - "application/emergencycalldata.veds+xml": { - "source": "iana" - }, - "application/emma+xml": { - "source": "iana", - "extensions": [ - "emma" - ] - }, - "application/emotionml+xml": { - "source": "iana" - }, - "application/encaprtp": { - "source": "iana" - }, - "application/epp+xml": { - "source": "iana" - }, - "application/epub+zip": { - "source": "iana", - "extensions": [ - "epub" - ] - }, - "application/eshop": { - "source": "iana" - }, - "application/exi": { - "source": "iana", - "extensions": [ - "exi" - ] - }, - "application/fastinfoset": { - "source": "iana" - }, - "application/fastsoap": { - "source": "iana" - }, - "application/fdt+xml": { - "source": "iana" - }, - "application/fits": { - "source": "iana" - }, - "application/font-sfnt": { - "source": "iana" - }, - "application/font-tdpfr": { - "source": "iana", - "extensions": [ - "pfr" - ] - }, - "application/font-woff": { - "source": "iana", - "compressible": false, - "extensions": [ - "woff" - ] - }, - "application/font-woff2": { - "compressible": false, - "extensions": [ - "woff2" - ] - }, - "application/framework-attributes+xml": { - "source": "iana" - }, - "application/geo+json": { - "source": "iana", - "compressible": true, - "extensions": [ - "geojson" - ] - }, - "application/geo+json-seq": { - "source": "iana" - }, - "application/gml+xml": { - "source": "iana", - "extensions": [ - "gml" - ] - }, - "application/gpx+xml": { - "source": "apache", - "extensions": [ - "gpx" - ] - }, - "application/gxf": { - "source": "apache", - "extensions": [ - "gxf" - ] - }, - "application/gzip": { - "source": "iana", - "compressible": false - }, - "application/h224": { - "source": "iana" - }, - "application/held+xml": { - "source": "iana" - }, - "application/http": { - "source": "iana" - }, - "application/hyperstudio": { - "source": "iana", - "extensions": [ - "stk" - ] - }, - "application/ibe-key-request+xml": { - "source": "iana" - }, - "application/ibe-pkg-reply+xml": { - "source": "iana" - }, - "application/ibe-pp-data": { - "source": "iana" - }, - "application/iges": { - "source": "iana" - }, - "application/im-iscomposing+xml": { - "source": "iana" - }, - "application/index": { - "source": "iana" - }, - "application/index.cmd": { - "source": "iana" - }, - "application/index.obj": { - "source": "iana" - }, - "application/index.response": { - "source": "iana" - }, - "application/index.vnd": { - "source": "iana" - }, - "application/inkml+xml": { - "source": "iana", - "extensions": [ - "ink", - "inkml" - ] - }, - "application/iotp": { - "source": "iana" - }, - "application/ipfix": { - "source": "iana", - "extensions": [ - "ipfix" - ] - }, - "application/ipp": { - "source": "iana" - }, - "application/isup": { - "source": "iana" - }, - "application/its+xml": { - "source": "iana" - }, - "application/java-archive": { - "source": "apache", - "compressible": false, - "extensions": [ - "jar", - "war", - "ear" - ] - }, - "application/java-serialized-object": { - "source": "apache", - "compressible": false, - "extensions": [ - "ser" - ] - }, - "application/java-vm": { - "source": "apache", - "compressible": false, - "extensions": [ - "class" - ] - }, - "application/javascript": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": [ - "js" - ] - }, - "application/jose": { - "source": "iana" - }, - "application/jose+json": { - "source": "iana", - "compressible": true - }, - "application/jrd+json": { - "source": "iana", - "compressible": true - }, - "application/json": { - "source": "iana", - "charset": "UTF-8", - "compressible": true, - "extensions": [ - "json", - "map" - ] - }, - "application/json-patch+json": { - "source": "iana", - "compressible": true - }, - "application/json-seq": { - "source": "iana" - }, - "application/json5": { - "extensions": [ - "json5" - ] - }, - "application/jsonml+json": { - "source": "apache", - "compressible": true, - "extensions": [ - "jsonml" - ] - }, - "application/jwk+json": { - "source": "iana", - "compressible": true - }, - "application/jwk-set+json": { - "source": "iana", - "compressible": true - }, - "application/jwt": { - "source": "iana" - }, - "application/kpml-request+xml": { - "source": "iana" - }, - "application/kpml-response+xml": { - "source": "iana" - }, - "application/ld+json": { - "source": "iana", - "compressible": true, - "extensions": [ - "jsonld" - ] - }, - "application/lgr+xml": { - "source": "iana" - }, - "application/link-format": { - "source": "iana" - }, - "application/load-control+xml": { - "source": "iana" - }, - "application/lost+xml": { - "source": "iana", - "extensions": [ - "lostxml" - ] - }, - "application/lostsync+xml": { - "source": "iana" - }, - "application/lxf": { - "source": "iana" - }, - "application/mac-binhex40": { - "source": "iana", - "extensions": [ - "hqx" - ] - }, - "application/mac-compactpro": { - "source": "apache", - "extensions": [ - "cpt" - ] - }, - "application/macwriteii": { - "source": "iana" - }, - "application/mads+xml": { - "source": "iana", - "extensions": [ - "mads" - ] - }, - "application/manifest+json": { - "charset": "UTF-8", - "compressible": true, - "extensions": [ - "webmanifest" - ] - }, - "application/marc": { - "source": "iana", - "extensions": [ - "mrc" - ] - }, - "application/marcxml+xml": { - "source": "iana", - "extensions": [ - "mrcx" - ] - }, - "application/mathematica": { - "source": "iana", - "extensions": [ - "ma", - "nb", - "mb" - ] - }, - "application/mathml+xml": { - "source": "iana", - "extensions": [ - "mathml" - ] - }, - "application/mathml-content+xml": { - "source": "iana" - }, - "application/mathml-presentation+xml": { - "source": "iana" - }, - "application/mbms-associated-procedure-description+xml": { - "source": "iana" - }, - "application/mbms-deregister+xml": { - "source": "iana" - }, - "application/mbms-envelope+xml": { - "source": "iana" - }, - "application/mbms-msk+xml": { - "source": "iana" - }, - "application/mbms-msk-response+xml": { - "source": "iana" - }, - "application/mbms-protection-description+xml": { - "source": "iana" - }, - "application/mbms-reception-report+xml": { - "source": "iana" - }, - "application/mbms-register+xml": { - "source": "iana" - }, - "application/mbms-register-response+xml": { - "source": "iana" - }, - "application/mbms-schedule+xml": { - "source": "iana" - }, - "application/mbms-user-service-description+xml": { - "source": "iana" - }, - "application/mbox": { - "source": "iana", - "extensions": [ - "mbox" - ] - }, - "application/media-policy-dataset+xml": { - "source": "iana" - }, - "application/media_control+xml": { - "source": "iana" - }, - "application/mediaservercontrol+xml": { - "source": "iana", - "extensions": [ - "mscml" - ] - }, - "application/merge-patch+json": { - "source": "iana", - "compressible": true - }, - "application/metalink+xml": { - "source": "apache", - "extensions": [ - "metalink" - ] - }, - "application/metalink4+xml": { - "source": "iana", - "extensions": [ - "meta4" - ] - }, - "application/mets+xml": { - "source": "iana", - "extensions": [ - "mets" - ] - }, - "application/mf4": { - "source": "iana" - }, - "application/mikey": { - "source": "iana" - }, - "application/mods+xml": { - "source": "iana", - "extensions": [ - "mods" - ] - }, - "application/moss-keys": { - "source": "iana" - }, - "application/moss-signature": { - "source": "iana" - }, - "application/mosskey-data": { - "source": "iana" - }, - "application/mosskey-request": { - "source": "iana" - }, - "application/mp21": { - "source": "iana", - "extensions": [ - "m21", - "mp21" - ] - }, - "application/mp4": { - "source": "iana", - "extensions": [ - "mp4s", - "m4p" - ] - }, - "application/mpeg4-generic": { - "source": "iana" - }, - "application/mpeg4-iod": { - "source": "iana" - }, - "application/mpeg4-iod-xmt": { - "source": "iana" - }, - "application/mrb-consumer+xml": { - "source": "iana" - }, - "application/mrb-publish+xml": { - "source": "iana" - }, - "application/msc-ivr+xml": { - "source": "iana" - }, - "application/msc-mixer+xml": { - "source": "iana" - }, - "application/msword": { - "source": "iana", - "compressible": false, - "extensions": [ - "doc", - "dot" - ] - }, - "application/mud+json": { - "source": "iana", - "compressible": true - }, - "application/mxf": { - "source": "iana", - "extensions": [ - "mxf" - ] - }, - "application/n-quads": { - "source": "iana" - }, - "application/n-triples": { - "source": "iana" - }, - "application/nasdata": { - "source": "iana" - }, - "application/news-checkgroups": { - "source": "iana" - }, - "application/news-groupinfo": { - "source": "iana" - }, - "application/news-transmission": { - "source": "iana" - }, - "application/nlsml+xml": { - "source": "iana" - }, - "application/nss": { - "source": "iana" - }, - "application/ocsp-request": { - "source": "iana" - }, - "application/ocsp-response": { - "source": "iana" - }, - "application/octet-stream": { - "source": "iana", - "compressible": false, - "extensions": [ - "bin", - "dms", - "lrf", - "mar", - "so", - "dist", - "distz", - "pkg", - "bpk", - "dump", - "elc", - "deploy", - "exe", - "dll", - "deb", - "dmg", - "iso", - "img", - "msi", - "msp", - "msm", - "buffer" - ] - }, - "application/oda": { - "source": "iana", - "extensions": [ - "oda" - ] - }, - "application/odx": { - "source": "iana" - }, - "application/oebps-package+xml": { - "source": "iana", - "extensions": [ - "opf" - ] - }, - "application/ogg": { - "source": "iana", - "compressible": false, - "extensions": [ - "ogx" - ] - }, - "application/omdoc+xml": { - "source": "apache", - "extensions": [ - "omdoc" - ] - }, - "application/onenote": { - "source": "apache", - "extensions": [ - "onetoc", - "onetoc2", - "onetmp", - "onepkg" - ] - }, - "application/oxps": { - "source": "iana", - "extensions": [ - "oxps" - ] - }, - "application/p2p-overlay+xml": { - "source": "iana" - }, - "application/parityfec": { - "source": "iana" - }, - "application/patch-ops-error+xml": { - "source": "iana", - "extensions": [ - "xer" - ] - }, - "application/pdf": { - "source": "iana", - "compressible": false, - "extensions": [ - "pdf" - ] - }, - "application/pdx": { - "source": "iana" - }, - "application/pgp-encrypted": { - "source": "iana", - "compressible": false, - "extensions": [ - "pgp" - ] - }, - "application/pgp-keys": { - "source": "iana" - }, - "application/pgp-signature": { - "source": "iana", - "extensions": [ - "asc", - "sig" - ] - }, - "application/pics-rules": { - "source": "apache", - "extensions": [ - "prf" - ] - }, - "application/pidf+xml": { - "source": "iana" - }, - "application/pidf-diff+xml": { - "source": "iana" - }, - "application/pkcs10": { - "source": "iana", - "extensions": [ - "p10" - ] - }, - "application/pkcs12": { - "source": "iana" - }, - "application/pkcs7-mime": { - "source": "iana", - "extensions": [ - "p7m", - "p7c" - ] - }, - "application/pkcs7-signature": { - "source": "iana", - "extensions": [ - "p7s" - ] - }, - "application/pkcs8": { - "source": "iana", - "extensions": [ - "p8" - ] - }, - "application/pkix-attr-cert": { - "source": "iana", - "extensions": [ - "ac" - ] - }, - "application/pkix-cert": { - "source": "iana", - "extensions": [ - "cer" - ] - }, - "application/pkix-crl": { - "source": "iana", - "extensions": [ - "crl" - ] - }, - "application/pkix-pkipath": { - "source": "iana", - "extensions": [ - "pkipath" - ] - }, - "application/pkixcmp": { - "source": "iana", - "extensions": [ - "pki" - ] - }, - "application/pls+xml": { - "source": "iana", - "extensions": [ - "pls" - ] - }, - "application/poc-settings+xml": { - "source": "iana" - }, - "application/postscript": { - "source": "iana", - "compressible": true, - "extensions": [ - "ai", - "eps", - "ps" - ] - }, - "application/ppsp-tracker+json": { - "source": "iana", - "compressible": true - }, - "application/problem+json": { - "source": "iana", - "compressible": true - }, - "application/problem+xml": { - "source": "iana" - }, - "application/provenance+xml": { - "source": "iana" - }, - "application/prs.alvestrand.titrax-sheet": { - "source": "iana" - }, - "application/prs.cww": { - "source": "iana", - "extensions": [ - "cww" - ] - }, - "application/prs.hpub+zip": { - "source": "iana" - }, - "application/prs.nprend": { - "source": "iana" - }, - "application/prs.plucker": { - "source": "iana" - }, - "application/prs.rdf-xml-crypt": { - "source": "iana" - }, - "application/prs.xsf+xml": { - "source": "iana" - }, - "application/pskc+xml": { - "source": "iana", - "extensions": [ - "pskcxml" - ] - }, - "application/qsig": { - "source": "iana" - }, - "application/raptorfec": { - "source": "iana" - }, - "application/rdap+json": { - "source": "iana", - "compressible": true - }, - "application/rdf+xml": { - "source": "iana", - "compressible": true, - "extensions": [ - "rdf" - ] - }, - "application/reginfo+xml": { - "source": "iana", - "extensions": [ - "rif" - ] - }, - "application/relax-ng-compact-syntax": { - "source": "iana", - "extensions": [ - "rnc" - ] - }, - "application/remote-printing": { - "source": "iana" - }, - "application/reputon+json": { - "source": "iana", - "compressible": true - }, - "application/resource-lists+xml": { - "source": "iana", - "extensions": [ - "rl" - ] - }, - "application/resource-lists-diff+xml": { - "source": "iana", - "extensions": [ - "rld" - ] - }, - "application/rfc+xml": { - "source": "iana" - }, - "application/riscos": { - "source": "iana" - }, - "application/rlmi+xml": { - "source": "iana" - }, - "application/rls-services+xml": { - "source": "iana", - "extensions": [ - "rs" - ] - }, - "application/rpki-ghostbusters": { - "source": "iana", - "extensions": [ - "gbr" - ] - }, - "application/rpki-manifest": { - "source": "iana", - "extensions": [ - "mft" - ] - }, - "application/rpki-roa": { - "source": "iana", - "extensions": [ - "roa" - ] - }, - "application/rpki-updown": { - "source": "iana" - }, - "application/rsd+xml": { - "source": "apache", - "extensions": [ - "rsd" - ] - }, - "application/rss+xml": { - "source": "apache", - "compressible": true, - "extensions": [ - "rss" - ] - }, - "application/rtf": { - "source": "iana", - "compressible": true, - "extensions": [ - "rtf" - ] - }, - "application/rtploopback": { - "source": "iana" - }, - "application/rtx": { - "source": "iana" - }, - "application/samlassertion+xml": { - "source": "iana" - }, - "application/samlmetadata+xml": { - "source": "iana" - }, - "application/sbml+xml": { - "source": "iana", - "extensions": [ - "sbml" - ] - }, - "application/scaip+xml": { - "source": "iana" - }, - "application/scim+json": { - "source": "iana", - "compressible": true - }, - "application/scvp-cv-request": { - "source": "iana", - "extensions": [ - "scq" - ] - }, - "application/scvp-cv-response": { - "source": "iana", - "extensions": [ - "scs" - ] - }, - "application/scvp-vp-request": { - "source": "iana", - "extensions": [ - "spq" - ] - }, - "application/scvp-vp-response": { - "source": "iana", - "extensions": [ - "spp" - ] - }, - "application/sdp": { - "source": "iana", - "extensions": [ - "sdp" - ] - }, - "application/sep+xml": { - "source": "iana" - }, - "application/sep-exi": { - "source": "iana" - }, - "application/session-info": { - "source": "iana" - }, - "application/set-payment": { - "source": "iana" - }, - "application/set-payment-initiation": { - "source": "iana", - "extensions": [ - "setpay" - ] - }, - "application/set-registration": { - "source": "iana" - }, - "application/set-registration-initiation": { - "source": "iana", - "extensions": [ - "setreg" - ] - }, - "application/sgml": { - "source": "iana" - }, - "application/sgml-open-catalog": { - "source": "iana" - }, - "application/shf+xml": { - "source": "iana", - "extensions": [ - "shf" - ] - }, - "application/sieve": { - "source": "iana" - }, - "application/simple-filter+xml": { - "source": "iana" - }, - "application/simple-message-summary": { - "source": "iana" - }, - "application/simplesymbolcontainer": { - "source": "iana" - }, - "application/slate": { - "source": "iana" - }, - "application/smil": { - "source": "iana" - }, - "application/smil+xml": { - "source": "iana", - "extensions": [ - "smi", - "smil" - ] - }, - "application/smpte336m": { - "source": "iana" - }, - "application/soap+fastinfoset": { - "source": "iana" - }, - "application/soap+xml": { - "source": "iana", - "compressible": true - }, - "application/sparql-query": { - "source": "iana", - "extensions": [ - "rq" - ] - }, - "application/sparql-results+xml": { - "source": "iana", - "extensions": [ - "srx" - ] - }, - "application/spirits-event+xml": { - "source": "iana" - }, - "application/sql": { - "source": "iana" - }, - "application/srgs": { - "source": "iana", - "extensions": [ - "gram" - ] - }, - "application/srgs+xml": { - "source": "iana", - "extensions": [ - "grxml" - ] - }, - "application/sru+xml": { - "source": "iana", - "extensions": [ - "sru" - ] - }, - "application/ssdl+xml": { - "source": "apache", - "extensions": [ - "ssdl" - ] - }, - "application/ssml+xml": { - "source": "iana", - "extensions": [ - "ssml" - ] - }, - "application/tamp-apex-update": { - "source": "iana" - }, - "application/tamp-apex-update-confirm": { - "source": "iana" - }, - "application/tamp-community-update": { - "source": "iana" - }, - "application/tamp-community-update-confirm": { - "source": "iana" - }, - "application/tamp-error": { - "source": "iana" - }, - "application/tamp-sequence-adjust": { - "source": "iana" - }, - "application/tamp-sequence-adjust-confirm": { - "source": "iana" - }, - "application/tamp-status-query": { - "source": "iana" - }, - "application/tamp-status-response": { - "source": "iana" - }, - "application/tamp-update": { - "source": "iana" - }, - "application/tamp-update-confirm": { - "source": "iana" - }, - "application/tar": { - "compressible": true - }, - "application/tei+xml": { - "source": "iana", - "extensions": [ - "tei", - "teicorpus" - ] - }, - "application/thraud+xml": { - "source": "iana", - "extensions": [ - "tfi" - ] - }, - "application/timestamp-query": { - "source": "iana" - }, - "application/timestamp-reply": { - "source": "iana" - }, - "application/timestamped-data": { - "source": "iana", - "extensions": [ - "tsd" - ] - }, - "application/trig": { - "source": "iana" - }, - "application/ttml+xml": { - "source": "iana" - }, - "application/tve-trigger": { - "source": "iana" - }, - "application/ulpfec": { - "source": "iana" - }, - "application/urc-grpsheet+xml": { - "source": "iana" - }, - "application/urc-ressheet+xml": { - "source": "iana" - }, - "application/urc-targetdesc+xml": { - "source": "iana" - }, - "application/urc-uisocketdesc+xml": { - "source": "iana" - }, - "application/vcard+json": { - "source": "iana", - "compressible": true - }, - "application/vcard+xml": { - "source": "iana" - }, - "application/vemmi": { - "source": "iana" - }, - "application/vividence.scriptfile": { - "source": "apache" - }, - "application/vnd.3gpp-prose+xml": { - "source": "iana" - }, - "application/vnd.3gpp-prose-pc3ch+xml": { - "source": "iana" - }, - "application/vnd.3gpp.access-transfer-events+xml": { - "source": "iana" - }, - "application/vnd.3gpp.bsf+xml": { - "source": "iana" - }, - "application/vnd.3gpp.mid-call+xml": { - "source": "iana" - }, - "application/vnd.3gpp.pic-bw-large": { - "source": "iana", - "extensions": [ - "plb" - ] - }, - "application/vnd.3gpp.pic-bw-small": { - "source": "iana", - "extensions": [ - "psb" - ] - }, - "application/vnd.3gpp.pic-bw-var": { - "source": "iana", - "extensions": [ - "pvb" - ] - }, - "application/vnd.3gpp.sms": { - "source": "iana" - }, - "application/vnd.3gpp.sms+xml": { - "source": "iana" - }, - "application/vnd.3gpp.srvcc-ext+xml": { - "source": "iana" - }, - "application/vnd.3gpp.srvcc-info+xml": { - "source": "iana" - }, - "application/vnd.3gpp.state-and-event-info+xml": { - "source": "iana" - }, - "application/vnd.3gpp.ussd+xml": { - "source": "iana" - }, - "application/vnd.3gpp2.bcmcsinfo+xml": { - "source": "iana" - }, - "application/vnd.3gpp2.sms": { - "source": "iana" - }, - "application/vnd.3gpp2.tcap": { - "source": "iana", - "extensions": [ - "tcap" - ] - }, - "application/vnd.3lightssoftware.imagescal": { - "source": "iana" - }, - "application/vnd.3m.post-it-notes": { - "source": "iana", - "extensions": [ - "pwn" - ] - }, - "application/vnd.accpac.simply.aso": { - "source": "iana", - "extensions": [ - "aso" - ] - }, - "application/vnd.accpac.simply.imp": { - "source": "iana", - "extensions": [ - "imp" - ] - }, - "application/vnd.acucobol": { - "source": "iana", - "extensions": [ - "acu" - ] - }, - "application/vnd.acucorp": { - "source": "iana", - "extensions": [ - "atc", - "acutc" - ] - }, - "application/vnd.adobe.air-application-installer-package+zip": { - "source": "apache", - "extensions": [ - "air" - ] - }, - "application/vnd.adobe.flash.movie": { - "source": "iana" - }, - "application/vnd.adobe.formscentral.fcdt": { - "source": "iana", - "extensions": [ - "fcdt" - ] - }, - "application/vnd.adobe.fxp": { - "source": "iana", - "extensions": [ - "fxp", - "fxpl" - ] - }, - "application/vnd.adobe.partial-upload": { - "source": "iana" - }, - "application/vnd.adobe.xdp+xml": { - "source": "iana", - "extensions": [ - "xdp" - ] - }, - "application/vnd.adobe.xfdf": { - "source": "iana", - "extensions": [ - "xfdf" - ] - }, - "application/vnd.aether.imp": { - "source": "iana" - }, - "application/vnd.ah-barcode": { - "source": "iana" - }, - "application/vnd.ahead.space": { - "source": "iana", - "extensions": [ - "ahead" - ] - }, - "application/vnd.airzip.filesecure.azf": { - "source": "iana", - "extensions": [ - "azf" - ] - }, - "application/vnd.airzip.filesecure.azs": { - "source": "iana", - "extensions": [ - "azs" - ] - }, - "application/vnd.amazon.ebook": { - "source": "apache", - "extensions": [ - "azw" - ] - }, - "application/vnd.amazon.mobi8-ebook": { - "source": "iana" - }, - "application/vnd.americandynamics.acc": { - "source": "iana", - "extensions": [ - "acc" - ] - }, - "application/vnd.amiga.ami": { - "source": "iana", - "extensions": [ - "ami" - ] - }, - "application/vnd.amundsen.maze+xml": { - "source": "iana" - }, - "application/vnd.android.package-archive": { - "source": "apache", - "compressible": false, - "extensions": [ - "apk" - ] - }, - "application/vnd.anki": { - "source": "iana" - }, - "application/vnd.anser-web-certificate-issue-initiation": { - "source": "iana", - "extensions": [ - "cii" - ] - }, - "application/vnd.anser-web-funds-transfer-initiation": { - "source": "apache", - "extensions": [ - "fti" - ] - }, - "application/vnd.antix.game-component": { - "source": "iana", - "extensions": [ - "atx" - ] - }, - "application/vnd.apache.thrift.binary": { - "source": "iana" - }, - "application/vnd.apache.thrift.compact": { - "source": "iana" - }, - "application/vnd.apache.thrift.json": { - "source": "iana" - }, - "application/vnd.api+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.apothekende.reservation+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.apple.installer+xml": { - "source": "iana", - "extensions": [ - "mpkg" - ] - }, - "application/vnd.apple.mpegurl": { - "source": "iana", - "extensions": [ - "m3u8" - ] - }, - "application/vnd.apple.pkpass": { - "compressible": false, - "extensions": [ - "pkpass" - ] - }, - "application/vnd.arastra.swi": { - "source": "iana" - }, - "application/vnd.aristanetworks.swi": { - "source": "iana", - "extensions": [ - "swi" - ] - }, - "application/vnd.artsquare": { - "source": "iana" - }, - "application/vnd.astraea-software.iota": { - "source": "iana", - "extensions": [ - "iota" - ] - }, - "application/vnd.audiograph": { - "source": "iana", - "extensions": [ - "aep" - ] - }, - "application/vnd.autopackage": { - "source": "iana" - }, - "application/vnd.avistar+xml": { - "source": "iana" - }, - "application/vnd.balsamiq.bmml+xml": { - "source": "iana" - }, - "application/vnd.balsamiq.bmpr": { - "source": "iana" - }, - "application/vnd.bekitzur-stech+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.biopax.rdf+xml": { - "source": "iana" - }, - "application/vnd.blueice.multipass": { - "source": "iana", - "extensions": [ - "mpm" - ] - }, - "application/vnd.bluetooth.ep.oob": { - "source": "iana" - }, - "application/vnd.bluetooth.le.oob": { - "source": "iana" - }, - "application/vnd.bmi": { - "source": "iana", - "extensions": [ - "bmi" - ] - }, - "application/vnd.businessobjects": { - "source": "iana", - "extensions": [ - "rep" - ] - }, - "application/vnd.cab-jscript": { - "source": "iana" - }, - "application/vnd.canon-cpdl": { - "source": "iana" - }, - "application/vnd.canon-lips": { - "source": "iana" - }, - "application/vnd.cendio.thinlinc.clientconf": { - "source": "iana" - }, - "application/vnd.century-systems.tcp_stream": { - "source": "iana" - }, - "application/vnd.chemdraw+xml": { - "source": "iana", - "extensions": [ - "cdxml" - ] - }, - "application/vnd.chess-pgn": { - "source": "iana" - }, - "application/vnd.chipnuts.karaoke-mmd": { - "source": "iana", - "extensions": [ - "mmd" - ] - }, - "application/vnd.cinderella": { - "source": "iana", - "extensions": [ - "cdy" - ] - }, - "application/vnd.cirpack.isdn-ext": { - "source": "iana" - }, - "application/vnd.citationstyles.style+xml": { - "source": "iana" - }, - "application/vnd.claymore": { - "source": "iana", - "extensions": [ - "cla" - ] - }, - "application/vnd.cloanto.rp9": { - "source": "iana", - "extensions": [ - "rp9" - ] - }, - "application/vnd.clonk.c4group": { - "source": "iana", - "extensions": [ - "c4g", - "c4d", - "c4f", - "c4p", - "c4u" - ] - }, - "application/vnd.cluetrust.cartomobile-config": { - "source": "iana", - "extensions": [ - "c11amc" - ] - }, - "application/vnd.cluetrust.cartomobile-config-pkg": { - "source": "iana", - "extensions": [ - "c11amz" - ] - }, - "application/vnd.coffeescript": { - "source": "iana" - }, - "application/vnd.collection+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.doc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.collection.next+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.comicbook+zip": { - "source": "iana" - }, - "application/vnd.commerce-battelle": { - "source": "iana" - }, - "application/vnd.commonspace": { - "source": "iana", - "extensions": [ - "csp" - ] - }, - "application/vnd.contact.cmsg": { - "source": "iana", - "extensions": [ - "cdbcmsg" - ] - }, - "application/vnd.coreos.ignition+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.cosmocaller": { - "source": "iana", - "extensions": [ - "cmc" - ] - }, - "application/vnd.crick.clicker": { - "source": "iana", - "extensions": [ - "clkx" - ] - }, - "application/vnd.crick.clicker.keyboard": { - "source": "iana", - "extensions": [ - "clkk" - ] - }, - "application/vnd.crick.clicker.palette": { - "source": "iana", - "extensions": [ - "clkp" - ] - }, - "application/vnd.crick.clicker.template": { - "source": "iana", - "extensions": [ - "clkt" - ] - }, - "application/vnd.crick.clicker.wordbank": { - "source": "iana", - "extensions": [ - "clkw" - ] - }, - "application/vnd.criticaltools.wbs+xml": { - "source": "iana", - "extensions": [ - "wbs" - ] - }, - "application/vnd.ctc-posml": { - "source": "iana", - "extensions": [ - "pml" - ] - }, - "application/vnd.ctct.ws+xml": { - "source": "iana" - }, - "application/vnd.cups-pdf": { - "source": "iana" - }, - "application/vnd.cups-postscript": { - "source": "iana" - }, - "application/vnd.cups-ppd": { - "source": "iana", - "extensions": [ - "ppd" - ] - }, - "application/vnd.cups-raster": { - "source": "iana" - }, - "application/vnd.cups-raw": { - "source": "iana" - }, - "application/vnd.curl": { - "source": "iana" - }, - "application/vnd.curl.car": { - "source": "apache", - "extensions": [ - "car" - ] - }, - "application/vnd.curl.pcurl": { - "source": "apache", - "extensions": [ - "pcurl" - ] - }, - "application/vnd.cyan.dean.root+xml": { - "source": "iana" - }, - "application/vnd.cybank": { - "source": "iana" - }, - "application/vnd.d2l.coursepackage1p0+zip": { - "source": "iana" - }, - "application/vnd.dart": { - "source": "iana", - "compressible": true, - "extensions": [ - "dart" - ] - }, - "application/vnd.data-vision.rdz": { - "source": "iana", - "extensions": [ - "rdz" - ] - }, - "application/vnd.dataresource+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.debian.binary-package": { - "source": "iana" - }, - "application/vnd.dece.data": { - "source": "iana", - "extensions": [ - "uvf", - "uvvf", - "uvd", - "uvvd" - ] - }, - "application/vnd.dece.ttml+xml": { - "source": "iana", - "extensions": [ - "uvt", - "uvvt" - ] - }, - "application/vnd.dece.unspecified": { - "source": "iana", - "extensions": [ - "uvx", - "uvvx" - ] - }, - "application/vnd.dece.zip": { - "source": "iana", - "extensions": [ - "uvz", - "uvvz" - ] - }, - "application/vnd.denovo.fcselayout-link": { - "source": "iana", - "extensions": [ - "fe_launch" - ] - }, - "application/vnd.desmume-movie": { - "source": "iana" - }, - "application/vnd.desmume.movie": { - "source": "apache" - }, - "application/vnd.dir-bi.plate-dl-nosuffix": { - "source": "iana" - }, - "application/vnd.dm.delegation+xml": { - "source": "iana" - }, - "application/vnd.dna": { - "source": "iana", - "extensions": [ - "dna" - ] - }, - "application/vnd.document+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.dolby.mlp": { - "source": "apache", - "extensions": [ - "mlp" - ] - }, - "application/vnd.dolby.mobile.1": { - "source": "iana" - }, - "application/vnd.dolby.mobile.2": { - "source": "iana" - }, - "application/vnd.doremir.scorecloud-binary-document": { - "source": "iana" - }, - "application/vnd.dpgraph": { - "source": "iana", - "extensions": [ - "dpg" - ] - }, - "application/vnd.dreamfactory": { - "source": "iana", - "extensions": [ - "dfac" - ] - }, - "application/vnd.drive+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ds-keypoint": { - "source": "apache", - "extensions": [ - "kpxx" - ] - }, - "application/vnd.dtg.local": { - "source": "iana" - }, - "application/vnd.dtg.local.flash": { - "source": "iana" - }, - "application/vnd.dtg.local.html": { - "source": "iana" - }, - "application/vnd.dvb.ait": { - "source": "iana", - "extensions": [ - "ait" - ] - }, - "application/vnd.dvb.dvbj": { - "source": "iana" - }, - "application/vnd.dvb.esgcontainer": { - "source": "iana" - }, - "application/vnd.dvb.ipdcdftnotifaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgaccess2": { - "source": "iana" - }, - "application/vnd.dvb.ipdcesgpdd": { - "source": "iana" - }, - "application/vnd.dvb.ipdcroaming": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-base": { - "source": "iana" - }, - "application/vnd.dvb.iptv.alfec-enhancement": { - "source": "iana" - }, - "application/vnd.dvb.notif-aggregate-root+xml": { - "source": "iana" - }, - "application/vnd.dvb.notif-container+xml": { - "source": "iana" - }, - "application/vnd.dvb.notif-generic+xml": { - "source": "iana" - }, - "application/vnd.dvb.notif-ia-msglist+xml": { - "source": "iana" - }, - "application/vnd.dvb.notif-ia-registration-request+xml": { - "source": "iana" - }, - "application/vnd.dvb.notif-ia-registration-response+xml": { - "source": "iana" - }, - "application/vnd.dvb.notif-init+xml": { - "source": "iana" - }, - "application/vnd.dvb.pfr": { - "source": "iana" - }, - "application/vnd.dvb.service": { - "source": "iana", - "extensions": [ - "svc" - ] - }, - "application/vnd.dxr": { - "source": "iana" - }, - "application/vnd.dynageo": { - "source": "iana", - "extensions": [ - "geo" - ] - }, - "application/vnd.dzr": { - "source": "iana" - }, - "application/vnd.easykaraoke.cdgdownload": { - "source": "iana" - }, - "application/vnd.ecdis-update": { - "source": "iana" - }, - "application/vnd.ecowin.chart": { - "source": "iana", - "extensions": [ - "mag" - ] - }, - "application/vnd.ecowin.filerequest": { - "source": "iana" - }, - "application/vnd.ecowin.fileupdate": { - "source": "iana" - }, - "application/vnd.ecowin.series": { - "source": "iana" - }, - "application/vnd.ecowin.seriesrequest": { - "source": "iana" - }, - "application/vnd.ecowin.seriesupdate": { - "source": "iana" - }, - "application/vnd.efi.img": { - "source": "iana" - }, - "application/vnd.efi.iso": { - "source": "iana" - }, - "application/vnd.emclient.accessrequest+xml": { - "source": "iana" - }, - "application/vnd.enliven": { - "source": "iana", - "extensions": [ - "nml" - ] - }, - "application/vnd.enphase.envoy": { - "source": "iana" - }, - "application/vnd.eprints.data+xml": { - "source": "iana" - }, - "application/vnd.epson.esf": { - "source": "iana", - "extensions": [ - "esf" - ] - }, - "application/vnd.epson.msf": { - "source": "iana", - "extensions": [ - "msf" - ] - }, - "application/vnd.epson.quickanime": { - "source": "iana", - "extensions": [ - "qam" - ] - }, - "application/vnd.epson.salt": { - "source": "iana", - "extensions": [ - "slt" - ] - }, - "application/vnd.epson.ssf": { - "source": "iana", - "extensions": [ - "ssf" - ] - }, - "application/vnd.ericsson.quickcall": { - "source": "iana" - }, - "application/vnd.espass-espass+zip": { - "source": "iana" - }, - "application/vnd.eszigno3+xml": { - "source": "iana", - "extensions": [ - "es3", - "et3" - ] - }, - "application/vnd.etsi.aoc+xml": { - "source": "iana" - }, - "application/vnd.etsi.asic-e+zip": { - "source": "iana" - }, - "application/vnd.etsi.asic-s+zip": { - "source": "iana" - }, - "application/vnd.etsi.cug+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvcommand+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvdiscovery+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvprofile+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvsad-bc+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvsad-cod+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvsad-npvr+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvservice+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvsync+xml": { - "source": "iana" - }, - "application/vnd.etsi.iptvueprofile+xml": { - "source": "iana" - }, - "application/vnd.etsi.mcid+xml": { - "source": "iana" - }, - "application/vnd.etsi.mheg5": { - "source": "iana" - }, - "application/vnd.etsi.overload-control-policy-dataset+xml": { - "source": "iana" - }, - "application/vnd.etsi.pstn+xml": { - "source": "iana" - }, - "application/vnd.etsi.sci+xml": { - "source": "iana" - }, - "application/vnd.etsi.simservs+xml": { - "source": "iana" - }, - "application/vnd.etsi.timestamp-token": { - "source": "iana" - }, - "application/vnd.etsi.tsl+xml": { - "source": "iana" - }, - "application/vnd.etsi.tsl.der": { - "source": "iana" - }, - "application/vnd.eudora.data": { - "source": "iana" - }, - "application/vnd.ezpix-album": { - "source": "iana", - "extensions": [ - "ez2" - ] - }, - "application/vnd.ezpix-package": { - "source": "iana", - "extensions": [ - "ez3" - ] - }, - "application/vnd.f-secure.mobile": { - "source": "iana" - }, - "application/vnd.fastcopy-disk-image": { - "source": "iana" - }, - "application/vnd.fdf": { - "source": "iana", - "extensions": [ - "fdf" - ] - }, - "application/vnd.fdsn.mseed": { - "source": "iana", - "extensions": [ - "mseed" - ] - }, - "application/vnd.fdsn.seed": { - "source": "iana", - "extensions": [ - "seed", - "dataless" - ] - }, - "application/vnd.ffsns": { - "source": "iana" - }, - "application/vnd.filmit.zfc": { - "source": "iana" - }, - "application/vnd.fints": { - "source": "iana" - }, - "application/vnd.firemonkeys.cloudcell": { - "source": "iana" - }, - "application/vnd.flographit": { - "source": "iana", - "extensions": [ - "gph" - ] - }, - "application/vnd.fluxtime.clip": { - "source": "iana", - "extensions": [ - "ftc" - ] - }, - "application/vnd.font-fontforge-sfd": { - "source": "iana" - }, - "application/vnd.framemaker": { - "source": "iana", - "extensions": [ - "fm", - "frame", - "maker", - "book" - ] - }, - "application/vnd.frogans.fnc": { - "source": "iana", - "extensions": [ - "fnc" - ] - }, - "application/vnd.frogans.ltf": { - "source": "iana", - "extensions": [ - "ltf" - ] - }, - "application/vnd.fsc.weblaunch": { - "source": "iana", - "extensions": [ - "fsc" - ] - }, - "application/vnd.fujitsu.oasys": { - "source": "iana", - "extensions": [ - "oas" - ] - }, - "application/vnd.fujitsu.oasys2": { - "source": "iana", - "extensions": [ - "oa2" - ] - }, - "application/vnd.fujitsu.oasys3": { - "source": "iana", - "extensions": [ - "oa3" - ] - }, - "application/vnd.fujitsu.oasysgp": { - "source": "iana", - "extensions": [ - "fg5" - ] - }, - "application/vnd.fujitsu.oasysprs": { - "source": "iana", - "extensions": [ - "bh2" - ] - }, - "application/vnd.fujixerox.art-ex": { - "source": "iana" - }, - "application/vnd.fujixerox.art4": { - "source": "iana" - }, - "application/vnd.fujixerox.ddd": { - "source": "iana", - "extensions": [ - "ddd" - ] - }, - "application/vnd.fujixerox.docuworks": { - "source": "iana", - "extensions": [ - "xdw" - ] - }, - "application/vnd.fujixerox.docuworks.binder": { - "source": "iana", - "extensions": [ - "xbd" - ] - }, - "application/vnd.fujixerox.docuworks.container": { - "source": "iana" - }, - "application/vnd.fujixerox.hbpl": { - "source": "iana" - }, - "application/vnd.fut-misnet": { - "source": "iana" - }, - "application/vnd.fuzzysheet": { - "source": "iana", - "extensions": [ - "fzs" - ] - }, - "application/vnd.genomatix.tuxedo": { - "source": "iana", - "extensions": [ - "txd" - ] - }, - "application/vnd.geo+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.geocube+xml": { - "source": "iana" - }, - "application/vnd.geogebra.file": { - "source": "iana", - "extensions": [ - "ggb" - ] - }, - "application/vnd.geogebra.tool": { - "source": "iana", - "extensions": [ - "ggt" - ] - }, - "application/vnd.geometry-explorer": { - "source": "iana", - "extensions": [ - "gex", - "gre" - ] - }, - "application/vnd.geonext": { - "source": "iana", - "extensions": [ - "gxt" - ] - }, - "application/vnd.geoplan": { - "source": "iana", - "extensions": [ - "g2w" - ] - }, - "application/vnd.geospace": { - "source": "iana", - "extensions": [ - "g3w" - ] - }, - "application/vnd.gerber": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt": { - "source": "iana" - }, - "application/vnd.globalplatform.card-content-mgt-response": { - "source": "iana" - }, - "application/vnd.gmx": { - "source": "iana", - "extensions": [ - "gmx" - ] - }, - "application/vnd.google-apps.document": { - "compressible": false, - "extensions": [ - "gdoc" - ] - }, - "application/vnd.google-apps.presentation": { - "compressible": false, - "extensions": [ - "gslides" - ] - }, - "application/vnd.google-apps.spreadsheet": { - "compressible": false, - "extensions": [ - "gsheet" - ] - }, - "application/vnd.google-earth.kml+xml": { - "source": "iana", - "compressible": true, - "extensions": [ - "kml" - ] - }, - "application/vnd.google-earth.kmz": { - "source": "iana", - "compressible": false, - "extensions": [ - "kmz" - ] - }, - "application/vnd.gov.sk.e-form+xml": { - "source": "iana" - }, - "application/vnd.gov.sk.e-form+zip": { - "source": "iana" - }, - "application/vnd.gov.sk.xmldatacontainer+xml": { - "source": "iana" - }, - "application/vnd.grafeq": { - "source": "iana", - "extensions": [ - "gqf", - "gqs" - ] - }, - "application/vnd.gridmp": { - "source": "iana" - }, - "application/vnd.groove-account": { - "source": "iana", - "extensions": [ - "gac" - ] - }, - "application/vnd.groove-help": { - "source": "iana", - "extensions": [ - "ghf" - ] - }, - "application/vnd.groove-identity-message": { - "source": "iana", - "extensions": [ - "gim" - ] - }, - "application/vnd.groove-injector": { - "source": "iana", - "extensions": [ - "grv" - ] - }, - "application/vnd.groove-tool-message": { - "source": "iana", - "extensions": [ - "gtm" - ] - }, - "application/vnd.groove-tool-template": { - "source": "iana", - "extensions": [ - "tpl" - ] - }, - "application/vnd.groove-vcard": { - "source": "iana", - "extensions": [ - "vcg" - ] - }, - "application/vnd.hal+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hal+xml": { - "source": "iana", - "extensions": [ - "hal" - ] - }, - "application/vnd.handheld-entertainment+xml": { - "source": "iana", - "extensions": [ - "zmm" - ] - }, - "application/vnd.hbci": { - "source": "iana", - "extensions": [ - "hbci" - ] - }, - "application/vnd.hc+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hcl-bireports": { - "source": "iana" - }, - "application/vnd.hdt": { - "source": "iana" - }, - "application/vnd.heroku+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hhe.lesson-player": { - "source": "iana", - "extensions": [ - "les" - ] - }, - "application/vnd.hp-hpgl": { - "source": "iana", - "extensions": [ - "hpgl" - ] - }, - "application/vnd.hp-hpid": { - "source": "iana", - "extensions": [ - "hpid" - ] - }, - "application/vnd.hp-hps": { - "source": "iana", - "extensions": [ - "hps" - ] - }, - "application/vnd.hp-jlyt": { - "source": "iana", - "extensions": [ - "jlt" - ] - }, - "application/vnd.hp-pcl": { - "source": "iana", - "extensions": [ - "pcl" - ] - }, - "application/vnd.hp-pclxl": { - "source": "iana", - "extensions": [ - "pclxl" - ] - }, - "application/vnd.httphone": { - "source": "iana" - }, - "application/vnd.hydrostatix.sof-data": { - "source": "iana", - "extensions": [ - "sfd-hdstx" - ] - }, - "application/vnd.hyperdrive+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.hzn-3d-crossword": { - "source": "iana" - }, - "application/vnd.ibm.afplinedata": { - "source": "iana" - }, - "application/vnd.ibm.electronic-media": { - "source": "iana" - }, - "application/vnd.ibm.minipay": { - "source": "iana", - "extensions": [ - "mpy" - ] - }, - "application/vnd.ibm.modcap": { - "source": "iana", - "extensions": [ - "afp", - "listafp", - "list3820" - ] - }, - "application/vnd.ibm.rights-management": { - "source": "iana", - "extensions": [ - "irm" - ] - }, - "application/vnd.ibm.secure-container": { - "source": "iana", - "extensions": [ - "sc" - ] - }, - "application/vnd.iccprofile": { - "source": "iana", - "extensions": [ - "icc", - "icm" - ] - }, - "application/vnd.ieee.1905": { - "source": "iana" - }, - "application/vnd.igloader": { - "source": "iana", - "extensions": [ - "igl" - ] - }, - "application/vnd.imagemeter.image+zip": { - "source": "iana" - }, - "application/vnd.immervision-ivp": { - "source": "iana", - "extensions": [ - "ivp" - ] - }, - "application/vnd.immervision-ivu": { - "source": "iana", - "extensions": [ - "ivu" - ] - }, - "application/vnd.ims.imsccv1p1": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p2": { - "source": "iana" - }, - "application/vnd.ims.imsccv1p3": { - "source": "iana" - }, - "application/vnd.ims.lis.v2.result+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolconsumerprofile+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolproxy.id+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.ims.lti.v2.toolsettings.simple+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.informedcontrol.rms+xml": { - "source": "iana" - }, - "application/vnd.informix-visionary": { - "source": "iana" - }, - "application/vnd.infotech.project": { - "source": "iana" - }, - "application/vnd.infotech.project+xml": { - "source": "iana" - }, - "application/vnd.innopath.wamp.notification": { - "source": "iana" - }, - "application/vnd.insors.igm": { - "source": "iana", - "extensions": [ - "igm" - ] - }, - "application/vnd.intercon.formnet": { - "source": "iana", - "extensions": [ - "xpw", - "xpx" - ] - }, - "application/vnd.intergeo": { - "source": "iana", - "extensions": [ - "i2g" - ] - }, - "application/vnd.intertrust.digibox": { - "source": "iana" - }, - "application/vnd.intertrust.nncp": { - "source": "iana" - }, - "application/vnd.intu.qbo": { - "source": "iana", - "extensions": [ - "qbo" - ] - }, - "application/vnd.intu.qfx": { - "source": "iana", - "extensions": [ - "qfx" - ] - }, - "application/vnd.iptc.g2.catalogitem+xml": { - "source": "iana" - }, - "application/vnd.iptc.g2.conceptitem+xml": { - "source": "iana" - }, - "application/vnd.iptc.g2.knowledgeitem+xml": { - "source": "iana" - }, - "application/vnd.iptc.g2.newsitem+xml": { - "source": "iana" - }, - "application/vnd.iptc.g2.newsmessage+xml": { - "source": "iana" - }, - "application/vnd.iptc.g2.packageitem+xml": { - "source": "iana" - }, - "application/vnd.iptc.g2.planningitem+xml": { - "source": "iana" - }, - "application/vnd.ipunplugged.rcprofile": { - "source": "iana", - "extensions": [ - "rcprofile" - ] - }, - "application/vnd.irepository.package+xml": { - "source": "iana", - "extensions": [ - "irp" - ] - }, - "application/vnd.is-xpr": { - "source": "iana", - "extensions": [ - "xpr" - ] - }, - "application/vnd.isac.fcs": { - "source": "iana", - "extensions": [ - "fcs" - ] - }, - "application/vnd.jam": { - "source": "iana", - "extensions": [ - "jam" - ] - }, - "application/vnd.japannet-directory-service": { - "source": "iana" - }, - "application/vnd.japannet-jpnstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-payment-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-registration": { - "source": "iana" - }, - "application/vnd.japannet-registration-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-setstore-wakeup": { - "source": "iana" - }, - "application/vnd.japannet-verification": { - "source": "iana" - }, - "application/vnd.japannet-verification-wakeup": { - "source": "iana" - }, - "application/vnd.jcp.javame.midlet-rms": { - "source": "iana", - "extensions": [ - "rms" - ] - }, - "application/vnd.jisp": { - "source": "iana", - "extensions": [ - "jisp" - ] - }, - "application/vnd.joost.joda-archive": { - "source": "iana", - "extensions": [ - "joda" - ] - }, - "application/vnd.jsk.isdn-ngn": { - "source": "iana" - }, - "application/vnd.kahootz": { - "source": "iana", - "extensions": [ - "ktz", - "ktr" - ] - }, - "application/vnd.kde.karbon": { - "source": "iana", - "extensions": [ - "karbon" - ] - }, - "application/vnd.kde.kchart": { - "source": "iana", - "extensions": [ - "chrt" - ] - }, - "application/vnd.kde.kformula": { - "source": "iana", - "extensions": [ - "kfo" - ] - }, - "application/vnd.kde.kivio": { - "source": "iana", - "extensions": [ - "flw" - ] - }, - "application/vnd.kde.kontour": { - "source": "iana", - "extensions": [ - "kon" - ] - }, - "application/vnd.kde.kpresenter": { - "source": "iana", - "extensions": [ - "kpr", - "kpt" - ] - }, - "application/vnd.kde.kspread": { - "source": "iana", - "extensions": [ - "ksp" - ] - }, - "application/vnd.kde.kword": { - "source": "iana", - "extensions": [ - "kwd", - "kwt" - ] - }, - "application/vnd.kenameaapp": { - "source": "iana", - "extensions": [ - "htke" - ] - }, - "application/vnd.kidspiration": { - "source": "iana", - "extensions": [ - "kia" - ] - }, - "application/vnd.kinar": { - "source": "iana", - "extensions": [ - "kne", - "knp" - ] - }, - "application/vnd.koan": { - "source": "iana", - "extensions": [ - "skp", - "skd", - "skt", - "skm" - ] - }, - "application/vnd.kodak-descriptor": { - "source": "iana", - "extensions": [ - "sse" - ] - }, - "application/vnd.las.las+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.las.las+xml": { - "source": "iana", - "extensions": [ - "lasxml" - ] - }, - "application/vnd.liberty-request+xml": { - "source": "iana" - }, - "application/vnd.llamagraphics.life-balance.desktop": { - "source": "iana", - "extensions": [ - "lbd" - ] - }, - "application/vnd.llamagraphics.life-balance.exchange+xml": { - "source": "iana", - "extensions": [ - "lbe" - ] - }, - "application/vnd.lotus-1-2-3": { - "source": "iana", - "extensions": [ - "123" - ] - }, - "application/vnd.lotus-approach": { - "source": "iana", - "extensions": [ - "apr" - ] - }, - "application/vnd.lotus-freelance": { - "source": "iana", - "extensions": [ - "pre" - ] - }, - "application/vnd.lotus-notes": { - "source": "iana", - "extensions": [ - "nsf" - ] - }, - "application/vnd.lotus-organizer": { - "source": "iana", - "extensions": [ - "org" - ] - }, - "application/vnd.lotus-screencam": { - "source": "iana", - "extensions": [ - "scm" - ] - }, - "application/vnd.lotus-wordpro": { - "source": "iana", - "extensions": [ - "lwp" - ] - }, - "application/vnd.macports.portpkg": { - "source": "iana", - "extensions": [ - "portpkg" - ] - }, - "application/vnd.mapbox-vector-tile": { - "source": "iana" - }, - "application/vnd.marlin.drm.actiontoken+xml": { - "source": "iana" - }, - "application/vnd.marlin.drm.conftoken+xml": { - "source": "iana" - }, - "application/vnd.marlin.drm.license+xml": { - "source": "iana" - }, - "application/vnd.marlin.drm.mdcf": { - "source": "iana" - }, - "application/vnd.mason+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.maxmind.maxmind-db": { - "source": "iana" - }, - "application/vnd.mcd": { - "source": "iana", - "extensions": [ - "mcd" - ] - }, - "application/vnd.medcalcdata": { - "source": "iana", - "extensions": [ - "mc1" - ] - }, - "application/vnd.mediastation.cdkey": { - "source": "iana", - "extensions": [ - "cdkey" - ] - }, - "application/vnd.meridian-slingshot": { - "source": "iana" - }, - "application/vnd.mfer": { - "source": "iana", - "extensions": [ - "mwf" - ] - }, - "application/vnd.mfmp": { - "source": "iana", - "extensions": [ - "mfm" - ] - }, - "application/vnd.micro+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.micrografx.flo": { - "source": "iana", - "extensions": [ - "flo" - ] - }, - "application/vnd.micrografx.igx": { - "source": "iana", - "extensions": [ - "igx" - ] - }, - "application/vnd.microsoft.portable-executable": { - "source": "iana" - }, - "application/vnd.miele+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.mif": { - "source": "iana", - "extensions": [ - "mif" - ] - }, - "application/vnd.minisoft-hp3000-save": { - "source": "iana" - }, - "application/vnd.mitsubishi.misty-guard.trustweb": { - "source": "iana" - }, - "application/vnd.mobius.daf": { - "source": "iana", - "extensions": [ - "daf" - ] - }, - "application/vnd.mobius.dis": { - "source": "iana", - "extensions": [ - "dis" - ] - }, - "application/vnd.mobius.mbk": { - "source": "iana", - "extensions": [ - "mbk" - ] - }, - "application/vnd.mobius.mqy": { - "source": "iana", - "extensions": [ - "mqy" - ] - }, - "application/vnd.mobius.msl": { - "source": "iana", - "extensions": [ - "msl" - ] - }, - "application/vnd.mobius.plc": { - "source": "iana", - "extensions": [ - "plc" - ] - }, - "application/vnd.mobius.txf": { - "source": "iana", - "extensions": [ - "txf" - ] - }, - "application/vnd.mophun.application": { - "source": "iana", - "extensions": [ - "mpn" - ] - }, - "application/vnd.mophun.certificate": { - "source": "iana", - "extensions": [ - "mpc" - ] - }, - "application/vnd.motorola.flexsuite": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.adsi": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.fis": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.gotap": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.kmr": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.ttc": { - "source": "iana" - }, - "application/vnd.motorola.flexsuite.wem": { - "source": "iana" - }, - "application/vnd.motorola.iprm": { - "source": "iana" - }, - "application/vnd.mozilla.xul+xml": { - "source": "iana", - "compressible": true, - "extensions": [ - "xul" - ] - }, - "application/vnd.ms-3mfdocument": { - "source": "iana" - }, - "application/vnd.ms-artgalry": { - "source": "iana", - "extensions": [ - "cil" - ] - }, - "application/vnd.ms-asf": { - "source": "iana" - }, - "application/vnd.ms-cab-compressed": { - "source": "iana", - "extensions": [ - "cab" - ] - }, - "application/vnd.ms-color.iccprofile": { - "source": "apache" - }, - "application/vnd.ms-excel": { - "source": "iana", - "compressible": false, - "extensions": [ - "xls", - "xlm", - "xla", - "xlc", - "xlt", - "xlw" - ] - }, - "application/vnd.ms-excel.addin.macroenabled.12": { - "source": "iana", - "extensions": [ - "xlam" - ] - }, - "application/vnd.ms-excel.sheet.binary.macroenabled.12": { - "source": "iana", - "extensions": [ - "xlsb" - ] - }, - "application/vnd.ms-excel.sheet.macroenabled.12": { - "source": "iana", - "extensions": [ - "xlsm" - ] - }, - "application/vnd.ms-excel.template.macroenabled.12": { - "source": "iana", - "extensions": [ - "xltm" - ] - }, - "application/vnd.ms-fontobject": { - "source": "iana", - "compressible": true, - "extensions": [ - "eot" - ] - }, - "application/vnd.ms-htmlhelp": { - "source": "iana", - "extensions": [ - "chm" - ] - }, - "application/vnd.ms-ims": { - "source": "iana", - "extensions": [ - "ims" - ] - }, - "application/vnd.ms-lrm": { - "source": "iana", - "extensions": [ - "lrm" - ] - }, - "application/vnd.ms-office.activex+xml": { - "source": "iana" - }, - "application/vnd.ms-officetheme": { - "source": "iana", - "extensions": [ - "thmx" - ] - }, - "application/vnd.ms-opentype": { - "source": "apache", - "compressible": true - }, - "application/vnd.ms-package.obfuscated-opentype": { - "source": "apache" - }, - "application/vnd.ms-pki.seccat": { - "source": "apache", - "extensions": [ - "cat" - ] - }, - "application/vnd.ms-pki.stl": { - "source": "apache", - "extensions": [ - "stl" - ] - }, - "application/vnd.ms-playready.initiator+xml": { - "source": "iana" - }, - "application/vnd.ms-powerpoint": { - "source": "iana", - "compressible": false, - "extensions": [ - "ppt", - "pps", - "pot" - ] - }, - "application/vnd.ms-powerpoint.addin.macroenabled.12": { - "source": "iana", - "extensions": [ - "ppam" - ] - }, - "application/vnd.ms-powerpoint.presentation.macroenabled.12": { - "source": "iana", - "extensions": [ - "pptm" - ] - }, - "application/vnd.ms-powerpoint.slide.macroenabled.12": { - "source": "iana", - "extensions": [ - "sldm" - ] - }, - "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { - "source": "iana", - "extensions": [ - "ppsm" - ] - }, - "application/vnd.ms-powerpoint.template.macroenabled.12": { - "source": "iana", - "extensions": [ - "potm" - ] - }, - "application/vnd.ms-printdevicecapabilities+xml": { - "source": "iana" - }, - "application/vnd.ms-printing.printticket+xml": { - "source": "apache" - }, - "application/vnd.ms-printschematicket+xml": { - "source": "iana" - }, - "application/vnd.ms-project": { - "source": "iana", - "extensions": [ - "mpp", - "mpt" - ] - }, - "application/vnd.ms-tnef": { - "source": "iana" - }, - "application/vnd.ms-windows.devicepairing": { - "source": "iana" - }, - "application/vnd.ms-windows.nwprinting.oob": { - "source": "iana" - }, - "application/vnd.ms-windows.printerpairing": { - "source": "iana" - }, - "application/vnd.ms-windows.wsd.oob": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.lic-resp": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-chlg-req": { - "source": "iana" - }, - "application/vnd.ms-wmdrm.meter-resp": { - "source": "iana" - }, - "application/vnd.ms-word.document.macroenabled.12": { - "source": "iana", - "extensions": [ - "docm" - ] - }, - "application/vnd.ms-word.template.macroenabled.12": { - "source": "iana", - "extensions": [ - "dotm" - ] - }, - "application/vnd.ms-works": { - "source": "iana", - "extensions": [ - "wps", - "wks", - "wcm", - "wdb" - ] - }, - "application/vnd.ms-wpl": { - "source": "iana", - "extensions": [ - "wpl" - ] - }, - "application/vnd.ms-xpsdocument": { - "source": "iana", - "compressible": false, - "extensions": [ - "xps" - ] - }, - "application/vnd.msa-disk-image": { - "source": "iana" - }, - "application/vnd.mseq": { - "source": "iana", - "extensions": [ - "mseq" - ] - }, - "application/vnd.msign": { - "source": "iana" - }, - "application/vnd.multiad.creator": { - "source": "iana" - }, - "application/vnd.multiad.creator.cif": { - "source": "iana" - }, - "application/vnd.music-niff": { - "source": "iana" - }, - "application/vnd.musician": { - "source": "iana", - "extensions": [ - "mus" - ] - }, - "application/vnd.muvee.style": { - "source": "iana", - "extensions": [ - "msty" - ] - }, - "application/vnd.mynfc": { - "source": "iana", - "extensions": [ - "taglet" - ] - }, - "application/vnd.ncd.control": { - "source": "iana" - }, - "application/vnd.ncd.reference": { - "source": "iana" - }, - "application/vnd.nearst.inv+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.nervana": { - "source": "iana" - }, - "application/vnd.netfpx": { - "source": "iana" - }, - "application/vnd.neurolanguage.nlu": { - "source": "iana", - "extensions": [ - "nlu" - ] - }, - "application/vnd.nintendo.nitro.rom": { - "source": "iana" - }, - "application/vnd.nintendo.snes.rom": { - "source": "iana" - }, - "application/vnd.nitf": { - "source": "iana", - "extensions": [ - "ntf", - "nitf" - ] - }, - "application/vnd.noblenet-directory": { - "source": "iana", - "extensions": [ - "nnd" - ] - }, - "application/vnd.noblenet-sealer": { - "source": "iana", - "extensions": [ - "nns" - ] - }, - "application/vnd.noblenet-web": { - "source": "iana", - "extensions": [ - "nnw" - ] - }, - "application/vnd.nokia.catalogs": { - "source": "iana" - }, - "application/vnd.nokia.conml+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.conml+xml": { - "source": "iana" - }, - "application/vnd.nokia.iptv.config+xml": { - "source": "iana" - }, - "application/vnd.nokia.isds-radio-presets": { - "source": "iana" - }, - "application/vnd.nokia.landmark+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.landmark+xml": { - "source": "iana" - }, - "application/vnd.nokia.landmarkcollection+xml": { - "source": "iana" - }, - "application/vnd.nokia.n-gage.ac+xml": { - "source": "iana" - }, - "application/vnd.nokia.n-gage.data": { - "source": "iana", - "extensions": [ - "ngdat" - ] - }, - "application/vnd.nokia.n-gage.symbian.install": { - "source": "iana", - "extensions": [ - "n-gage" - ] - }, - "application/vnd.nokia.ncd": { - "source": "iana" - }, - "application/vnd.nokia.pcd+wbxml": { - "source": "iana" - }, - "application/vnd.nokia.pcd+xml": { - "source": "iana" - }, - "application/vnd.nokia.radio-preset": { - "source": "iana", - "extensions": [ - "rpst" - ] - }, - "application/vnd.nokia.radio-presets": { - "source": "iana", - "extensions": [ - "rpss" - ] - }, - "application/vnd.novadigm.edm": { - "source": "iana", - "extensions": [ - "edm" - ] - }, - "application/vnd.novadigm.edx": { - "source": "iana", - "extensions": [ - "edx" - ] - }, - "application/vnd.novadigm.ext": { - "source": "iana", - "extensions": [ - "ext" - ] - }, - "application/vnd.ntt-local.content-share": { - "source": "iana" - }, - "application/vnd.ntt-local.file-transfer": { - "source": "iana" - }, - "application/vnd.ntt-local.ogw_remote-access": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_remote": { - "source": "iana" - }, - "application/vnd.ntt-local.sip-ta_tcp_stream": { - "source": "iana" - }, - "application/vnd.oasis.opendocument.chart": { - "source": "iana", - "extensions": [ - "odc" - ] - }, - "application/vnd.oasis.opendocument.chart-template": { - "source": "iana", - "extensions": [ - "otc" - ] - }, - "application/vnd.oasis.opendocument.database": { - "source": "iana", - "extensions": [ - "odb" - ] - }, - "application/vnd.oasis.opendocument.formula": { - "source": "iana", - "extensions": [ - "odf" - ] - }, - "application/vnd.oasis.opendocument.formula-template": { - "source": "iana", - "extensions": [ - "odft" - ] - }, - "application/vnd.oasis.opendocument.graphics": { - "source": "iana", - "compressible": false, - "extensions": [ - "odg" - ] - }, - "application/vnd.oasis.opendocument.graphics-template": { - "source": "iana", - "extensions": [ - "otg" - ] - }, - "application/vnd.oasis.opendocument.image": { - "source": "iana", - "extensions": [ - "odi" - ] - }, - "application/vnd.oasis.opendocument.image-template": { - "source": "iana", - "extensions": [ - "oti" - ] - }, - "application/vnd.oasis.opendocument.presentation": { - "source": "iana", - "compressible": false, - "extensions": [ - "odp" - ] - }, - "application/vnd.oasis.opendocument.presentation-template": { - "source": "iana", - "extensions": [ - "otp" - ] - }, - "application/vnd.oasis.opendocument.spreadsheet": { - "source": "iana", - "compressible": false, - "extensions": [ - "ods" - ] - }, - "application/vnd.oasis.opendocument.spreadsheet-template": { - "source": "iana", - "extensions": [ - "ots" - ] - }, - "application/vnd.oasis.opendocument.text": { - "source": "iana", - "compressible": false, - "extensions": [ - "odt" - ] - }, - "application/vnd.oasis.opendocument.text-master": { - "source": "iana", - "extensions": [ - "odm" - ] - }, - "application/vnd.oasis.opendocument.text-template": { - "source": "iana", - "extensions": [ - "ott" - ] - }, - "application/vnd.oasis.opendocument.text-web": { - "source": "iana", - "extensions": [ - "oth" - ] - }, - "application/vnd.obn": { - "source": "iana" - }, - "application/vnd.ocf+cbor": { - "source": "iana" - }, - "application/vnd.oftn.l10n+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oipf.contentaccessdownload+xml": { - "source": "iana" - }, - "application/vnd.oipf.contentaccessstreaming+xml": { - "source": "iana" - }, - "application/vnd.oipf.cspg-hexbinary": { - "source": "iana" - }, - "application/vnd.oipf.dae.svg+xml": { - "source": "iana" - }, - "application/vnd.oipf.dae.xhtml+xml": { - "source": "iana" - }, - "application/vnd.oipf.mippvcontrolmessage+xml": { - "source": "iana" - }, - "application/vnd.oipf.pae.gem": { - "source": "iana" - }, - "application/vnd.oipf.spdiscovery+xml": { - "source": "iana" - }, - "application/vnd.oipf.spdlist+xml": { - "source": "iana" - }, - "application/vnd.oipf.ueprofile+xml": { - "source": "iana" - }, - "application/vnd.oipf.userprofile+xml": { - "source": "iana" - }, - "application/vnd.olpc-sugar": { - "source": "iana", - "extensions": [ - "xo" - ] - }, - "application/vnd.oma-scws-config": { - "source": "iana" - }, - "application/vnd.oma-scws-http-request": { - "source": "iana" - }, - "application/vnd.oma-scws-http-response": { - "source": "iana" - }, - "application/vnd.oma.bcast.associated-procedure-parameter+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.drm-trigger+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.imd+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.ltkm": { - "source": "iana" - }, - "application/vnd.oma.bcast.notification+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.provisioningtrigger": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgboot": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgdd+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.sgdu": { - "source": "iana" - }, - "application/vnd.oma.bcast.simple-symbol-container": { - "source": "iana" - }, - "application/vnd.oma.bcast.smartcard-trigger+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.sprov+xml": { - "source": "iana" - }, - "application/vnd.oma.bcast.stkm": { - "source": "iana" - }, - "application/vnd.oma.cab-address-book+xml": { - "source": "iana" - }, - "application/vnd.oma.cab-feature-handler+xml": { - "source": "iana" - }, - "application/vnd.oma.cab-pcc+xml": { - "source": "iana" - }, - "application/vnd.oma.cab-subs-invite+xml": { - "source": "iana" - }, - "application/vnd.oma.cab-user-prefs+xml": { - "source": "iana" - }, - "application/vnd.oma.dcd": { - "source": "iana" - }, - "application/vnd.oma.dcdc": { - "source": "iana" - }, - "application/vnd.oma.dd2+xml": { - "source": "iana", - "extensions": [ - "dd2" - ] - }, - "application/vnd.oma.drm.risd+xml": { - "source": "iana" - }, - "application/vnd.oma.group-usage-list+xml": { - "source": "iana" - }, - "application/vnd.oma.lwm2m+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.oma.lwm2m+tlv": { - "source": "iana" - }, - "application/vnd.oma.pal+xml": { - "source": "iana" - }, - "application/vnd.oma.poc.detailed-progress-report+xml": { - "source": "iana" - }, - "application/vnd.oma.poc.final-report+xml": { - "source": "iana" - }, - "application/vnd.oma.poc.groups+xml": { - "source": "iana" - }, - "application/vnd.oma.poc.invocation-descriptor+xml": { - "source": "iana" - }, - "application/vnd.oma.poc.optimized-progress-report+xml": { - "source": "iana" - }, - "application/vnd.oma.push": { - "source": "iana" - }, - "application/vnd.oma.scidm.messages+xml": { - "source": "iana" - }, - "application/vnd.oma.xcap-directory+xml": { - "source": "iana" - }, - "application/vnd.omads-email+xml": { - "source": "iana" - }, - "application/vnd.omads-file+xml": { - "source": "iana" - }, - "application/vnd.omads-folder+xml": { - "source": "iana" - }, - "application/vnd.omaloc-supl-init": { - "source": "iana" - }, - "application/vnd.onepager": { - "source": "iana" - }, - "application/vnd.openblox.game+xml": { - "source": "iana" - }, - "application/vnd.openblox.game-binary": { - "source": "iana" - }, - "application/vnd.openeye.oeb": { - "source": "iana" - }, - "application/vnd.openofficeorg.extension": { - "source": "apache", - "extensions": [ - "oxt" - ] - }, - "application/vnd.openstreetmap.data+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.custom-properties+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawing+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.extended-properties+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml-template": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation": { - "source": "iana", - "compressible": false, - "extensions": [ - "pptx" - ] - }, - "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide": { - "source": "iana", - "extensions": [ - "sldx" - ] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { - "source": "iana", - "extensions": [ - "ppsx" - ] - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.template": { - "source": "apache", - "extensions": [ - "potx" - ] - }, - "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml-template": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { - "source": "iana", - "compressible": false, - "extensions": [ - "xlsx" - ] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { - "source": "apache", - "extensions": [ - "xltx" - ] - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.theme+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.themeoverride+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.vmldrawing": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml-template": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { - "source": "iana", - "compressible": false, - "extensions": [ - "docx" - ] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { - "source": "apache", - "extensions": [ - "dotx" - ] - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-package.core-properties+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { - "source": "iana" - }, - "application/vnd.openxmlformats-package.relationships+xml": { - "source": "iana" - }, - "application/vnd.oracle.resource+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.orange.indata": { - "source": "iana" - }, - "application/vnd.osa.netdeploy": { - "source": "iana" - }, - "application/vnd.osgeo.mapguide.package": { - "source": "iana", - "extensions": [ - "mgp" - ] - }, - "application/vnd.osgi.bundle": { - "source": "iana" - }, - "application/vnd.osgi.dp": { - "source": "iana", - "extensions": [ - "dp" - ] - }, - "application/vnd.osgi.subsystem": { - "source": "iana", - "extensions": [ - "esa" - ] - }, - "application/vnd.otps.ct-kip+xml": { - "source": "iana" - }, - "application/vnd.oxli.countgraph": { - "source": "iana" - }, - "application/vnd.pagerduty+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.palm": { - "source": "iana", - "extensions": [ - "pdb", - "pqa", - "oprc" - ] - }, - "application/vnd.panoply": { - "source": "iana" - }, - "application/vnd.paos+xml": { - "source": "iana" - }, - "application/vnd.paos.xml": { - "source": "apache" - }, - "application/vnd.pawaafile": { - "source": "iana", - "extensions": [ - "paw" - ] - }, - "application/vnd.pcos": { - "source": "iana" - }, - "application/vnd.pg.format": { - "source": "iana", - "extensions": [ - "str" - ] - }, - "application/vnd.pg.osasli": { - "source": "iana", - "extensions": [ - "ei6" - ] - }, - "application/vnd.piaccess.application-licence": { - "source": "iana" - }, - "application/vnd.picsel": { - "source": "iana", - "extensions": [ - "efif" - ] - }, - "application/vnd.pmi.widget": { - "source": "iana", - "extensions": [ - "wg" - ] - }, - "application/vnd.poc.group-advertisement+xml": { - "source": "iana" - }, - "application/vnd.pocketlearn": { - "source": "iana", - "extensions": [ - "plf" - ] - }, - "application/vnd.powerbuilder6": { - "source": "iana", - "extensions": [ - "pbd" - ] - }, - "application/vnd.powerbuilder6-s": { - "source": "iana" - }, - "application/vnd.powerbuilder7": { - "source": "iana" - }, - "application/vnd.powerbuilder7-s": { - "source": "iana" - }, - "application/vnd.powerbuilder75": { - "source": "iana" - }, - "application/vnd.powerbuilder75-s": { - "source": "iana" - }, - "application/vnd.preminet": { - "source": "iana" - }, - "application/vnd.previewsystems.box": { - "source": "iana", - "extensions": [ - "box" - ] - }, - "application/vnd.proteus.magazine": { - "source": "iana", - "extensions": [ - "mgz" - ] - }, - "application/vnd.publishare-delta-tree": { - "source": "iana", - "extensions": [ - "qps" - ] - }, - "application/vnd.pvi.ptid1": { - "source": "iana", - "extensions": [ - "ptid" - ] - }, - "application/vnd.pwg-multiplexed": { - "source": "iana" - }, - "application/vnd.pwg-xhtml-print+xml": { - "source": "iana" - }, - "application/vnd.qualcomm.brew-app-res": { - "source": "iana" - }, - "application/vnd.quarantainenet": { - "source": "iana" - }, - "application/vnd.quark.quarkxpress": { - "source": "iana", - "extensions": [ - "qxd", - "qxt", - "qwd", - "qwt", - "qxl", - "qxb" - ] - }, - "application/vnd.quobject-quoxdocument": { - "source": "iana" - }, - "application/vnd.radisys.moml+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-audit+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-audit-conf+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-audit-conn+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-audit-dialog+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-audit-stream+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-conf+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog-base+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog-fax-detect+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog-group+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog-speech+xml": { - "source": "iana" - }, - "application/vnd.radisys.msml-dialog-transform+xml": { - "source": "iana" - }, - "application/vnd.rainstor.data": { - "source": "iana" - }, - "application/vnd.rapid": { - "source": "iana" - }, - "application/vnd.rar": { - "source": "iana" - }, - "application/vnd.realvnc.bed": { - "source": "iana", - "extensions": [ - "bed" - ] - }, - "application/vnd.recordare.musicxml": { - "source": "iana", - "extensions": [ - "mxl" - ] - }, - "application/vnd.recordare.musicxml+xml": { - "source": "iana", - "extensions": [ - "musicxml" - ] - }, - "application/vnd.renlearn.rlprint": { - "source": "iana" - }, - "application/vnd.rig.cryptonote": { - "source": "iana", - "extensions": [ - "cryptonote" - ] - }, - "application/vnd.rim.cod": { - "source": "apache", - "extensions": [ - "cod" - ] - }, - "application/vnd.rn-realmedia": { - "source": "apache", - "extensions": [ - "rm" - ] - }, - "application/vnd.rn-realmedia-vbr": { - "source": "apache", - "extensions": [ - "rmvb" - ] - }, - "application/vnd.route66.link66+xml": { - "source": "iana", - "extensions": [ - "link66" - ] - }, - "application/vnd.rs-274x": { - "source": "iana" - }, - "application/vnd.ruckus.download": { - "source": "iana" - }, - "application/vnd.s3sms": { - "source": "iana" - }, - "application/vnd.sailingtracker.track": { - "source": "iana", - "extensions": [ - "st" - ] - }, - "application/vnd.sbm.cid": { - "source": "iana" - }, - "application/vnd.sbm.mid2": { - "source": "iana" - }, - "application/vnd.scribus": { - "source": "iana" - }, - "application/vnd.sealed.3df": { - "source": "iana" - }, - "application/vnd.sealed.csf": { - "source": "iana" - }, - "application/vnd.sealed.doc": { - "source": "iana" - }, - "application/vnd.sealed.eml": { - "source": "iana" - }, - "application/vnd.sealed.mht": { - "source": "iana" - }, - "application/vnd.sealed.net": { - "source": "iana" - }, - "application/vnd.sealed.ppt": { - "source": "iana" - }, - "application/vnd.sealed.tiff": { - "source": "iana" - }, - "application/vnd.sealed.xls": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.html": { - "source": "iana" - }, - "application/vnd.sealedmedia.softseal.pdf": { - "source": "iana" - }, - "application/vnd.seemail": { - "source": "iana", - "extensions": [ - "see" - ] - }, - "application/vnd.sema": { - "source": "iana", - "extensions": [ - "sema" - ] - }, - "application/vnd.semd": { - "source": "iana", - "extensions": [ - "semd" - ] - }, - "application/vnd.semf": { - "source": "iana", - "extensions": [ - "semf" - ] - }, - "application/vnd.shana.informed.formdata": { - "source": "iana", - "extensions": [ - "ifm" - ] - }, - "application/vnd.shana.informed.formtemplate": { - "source": "iana", - "extensions": [ - "itp" - ] - }, - "application/vnd.shana.informed.interchange": { - "source": "iana", - "extensions": [ - "iif" - ] - }, - "application/vnd.shana.informed.package": { - "source": "iana", - "extensions": [ - "ipk" - ] - }, - "application/vnd.simtech-mindmapper": { - "source": "iana", - "extensions": [ - "twd", - "twds" - ] - }, - "application/vnd.siren+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.smaf": { - "source": "iana", - "extensions": [ - "mmf" - ] - }, - "application/vnd.smart.notebook": { - "source": "iana" - }, - "application/vnd.smart.teacher": { - "source": "iana", - "extensions": [ - "teacher" - ] - }, - "application/vnd.software602.filler.form+xml": { - "source": "iana" - }, - "application/vnd.software602.filler.form-xml-zip": { - "source": "iana" - }, - "application/vnd.solent.sdkm+xml": { - "source": "iana", - "extensions": [ - "sdkm", - "sdkd" - ] - }, - "application/vnd.spotfire.dxp": { - "source": "iana", - "extensions": [ - "dxp" - ] - }, - "application/vnd.spotfire.sfs": { - "source": "iana", - "extensions": [ - "sfs" - ] - }, - "application/vnd.sss-cod": { - "source": "iana" - }, - "application/vnd.sss-dtf": { - "source": "iana" - }, - "application/vnd.sss-ntf": { - "source": "iana" - }, - "application/vnd.stardivision.calc": { - "source": "apache", - "extensions": [ - "sdc" - ] - }, - "application/vnd.stardivision.draw": { - "source": "apache", - "extensions": [ - "sda" - ] - }, - "application/vnd.stardivision.impress": { - "source": "apache", - "extensions": [ - "sdd" - ] - }, - "application/vnd.stardivision.math": { - "source": "apache", - "extensions": [ - "smf" - ] - }, - "application/vnd.stardivision.writer": { - "source": "apache", - "extensions": [ - "sdw", - "vor" - ] - }, - "application/vnd.stardivision.writer-global": { - "source": "apache", - "extensions": [ - "sgl" - ] - }, - "application/vnd.stepmania.package": { - "source": "iana", - "extensions": [ - "smzip" - ] - }, - "application/vnd.stepmania.stepchart": { - "source": "iana", - "extensions": [ - "sm" - ] - }, - "application/vnd.street-stream": { - "source": "iana" - }, - "application/vnd.sun.wadl+xml": { - "source": "iana" - }, - "application/vnd.sun.xml.calc": { - "source": "apache", - "extensions": [ - "sxc" - ] - }, - "application/vnd.sun.xml.calc.template": { - "source": "apache", - "extensions": [ - "stc" - ] - }, - "application/vnd.sun.xml.draw": { - "source": "apache", - "extensions": [ - "sxd" - ] - }, - "application/vnd.sun.xml.draw.template": { - "source": "apache", - "extensions": [ - "std" - ] - }, - "application/vnd.sun.xml.impress": { - "source": "apache", - "extensions": [ - "sxi" - ] - }, - "application/vnd.sun.xml.impress.template": { - "source": "apache", - "extensions": [ - "sti" - ] - }, - "application/vnd.sun.xml.math": { - "source": "apache", - "extensions": [ - "sxm" - ] - }, - "application/vnd.sun.xml.writer": { - "source": "apache", - "extensions": [ - "sxw" - ] - }, - "application/vnd.sun.xml.writer.global": { - "source": "apache", - "extensions": [ - "sxg" - ] - }, - "application/vnd.sun.xml.writer.template": { - "source": "apache", - "extensions": [ - "stw" - ] - }, - "application/vnd.sus-calendar": { - "source": "iana", - "extensions": [ - "sus", - "susp" - ] - }, - "application/vnd.svd": { - "source": "iana", - "extensions": [ - "svd" - ] - }, - "application/vnd.swiftview-ics": { - "source": "iana" - }, - "application/vnd.symbian.install": { - "source": "apache", - "extensions": [ - "sis", - "sisx" - ] - }, - "application/vnd.syncml+xml": { - "source": "iana", - "extensions": [ - "xsm" - ] - }, - "application/vnd.syncml.dm+wbxml": { - "source": "iana", - "extensions": [ - "bdm" - ] - }, - "application/vnd.syncml.dm+xml": { - "source": "iana", - "extensions": [ - "xdm" - ] - }, - "application/vnd.syncml.dm.notification": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmddf+xml": { - "source": "iana" - }, - "application/vnd.syncml.dmtnds+wbxml": { - "source": "iana" - }, - "application/vnd.syncml.dmtnds+xml": { - "source": "iana" - }, - "application/vnd.syncml.ds.notification": { - "source": "iana" - }, - "application/vnd.tableschema+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.tao.intent-module-archive": { - "source": "iana", - "extensions": [ - "tao" - ] - }, - "application/vnd.tcpdump.pcap": { - "source": "iana", - "extensions": [ - "pcap", - "cap", - "dmp" - ] - }, - "application/vnd.tmd.mediaflex.api+xml": { - "source": "iana" - }, - "application/vnd.tml": { - "source": "iana" - }, - "application/vnd.tmobile-livetv": { - "source": "iana", - "extensions": [ - "tmo" - ] - }, - "application/vnd.tri.onesource": { - "source": "iana" - }, - "application/vnd.trid.tpt": { - "source": "iana", - "extensions": [ - "tpt" - ] - }, - "application/vnd.triscape.mxs": { - "source": "iana", - "extensions": [ - "mxs" - ] - }, - "application/vnd.trueapp": { - "source": "iana", - "extensions": [ - "tra" - ] - }, - "application/vnd.truedoc": { - "source": "iana" - }, - "application/vnd.ubisoft.webplayer": { - "source": "iana" - }, - "application/vnd.ufdl": { - "source": "iana", - "extensions": [ - "ufd", - "ufdl" - ] - }, - "application/vnd.uiq.theme": { - "source": "iana", - "extensions": [ - "utz" - ] - }, - "application/vnd.umajin": { - "source": "iana", - "extensions": [ - "umj" - ] - }, - "application/vnd.unity": { - "source": "iana", - "extensions": [ - "unityweb" - ] - }, - "application/vnd.uoml+xml": { - "source": "iana", - "extensions": [ - "uoml" - ] - }, - "application/vnd.uplanet.alert": { - "source": "iana" - }, - "application/vnd.uplanet.alert-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice": { - "source": "iana" - }, - "application/vnd.uplanet.bearer-choice-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop": { - "source": "iana" - }, - "application/vnd.uplanet.cacheop-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.channel": { - "source": "iana" - }, - "application/vnd.uplanet.channel-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.list": { - "source": "iana" - }, - "application/vnd.uplanet.list-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd": { - "source": "iana" - }, - "application/vnd.uplanet.listcmd-wbxml": { - "source": "iana" - }, - "application/vnd.uplanet.signal": { - "source": "iana" - }, - "application/vnd.uri-map": { - "source": "iana" - }, - "application/vnd.valve.source.material": { - "source": "iana" - }, - "application/vnd.vcx": { - "source": "iana", - "extensions": [ - "vcx" - ] - }, - "application/vnd.vd-study": { - "source": "iana" - }, - "application/vnd.vectorworks": { - "source": "iana" - }, - "application/vnd.vel+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.verimatrix.vcas": { - "source": "iana" - }, - "application/vnd.vidsoft.vidconference": { - "source": "iana" - }, - "application/vnd.visio": { - "source": "iana", - "extensions": [ - "vsd", - "vst", - "vss", - "vsw" - ] - }, - "application/vnd.visionary": { - "source": "iana", - "extensions": [ - "vis" - ] - }, - "application/vnd.vividence.scriptfile": { - "source": "iana" - }, - "application/vnd.vsf": { - "source": "iana", - "extensions": [ - "vsf" - ] - }, - "application/vnd.wap.sic": { - "source": "iana" - }, - "application/vnd.wap.slc": { - "source": "iana" - }, - "application/vnd.wap.wbxml": { - "source": "iana", - "extensions": [ - "wbxml" - ] - }, - "application/vnd.wap.wmlc": { - "source": "iana", - "extensions": [ - "wmlc" - ] - }, - "application/vnd.wap.wmlscriptc": { - "source": "iana", - "extensions": [ - "wmlsc" - ] - }, - "application/vnd.webturbo": { - "source": "iana", - "extensions": [ - "wtb" - ] - }, - "application/vnd.wfa.p2p": { - "source": "iana" - }, - "application/vnd.wfa.wsc": { - "source": "iana" - }, - "application/vnd.windows.devicepairing": { - "source": "iana" - }, - "application/vnd.wmc": { - "source": "iana" - }, - "application/vnd.wmf.bootstrap": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica": { - "source": "iana" - }, - "application/vnd.wolfram.mathematica.package": { - "source": "iana" - }, - "application/vnd.wolfram.player": { - "source": "iana", - "extensions": [ - "nbp" - ] - }, - "application/vnd.wordperfect": { - "source": "iana", - "extensions": [ - "wpd" - ] - }, - "application/vnd.wqd": { - "source": "iana", - "extensions": [ - "wqd" - ] - }, - "application/vnd.wrq-hp3000-labelled": { - "source": "iana" - }, - "application/vnd.wt.stf": { - "source": "iana", - "extensions": [ - "stf" - ] - }, - "application/vnd.wv.csp+wbxml": { - "source": "iana" - }, - "application/vnd.wv.csp+xml": { - "source": "iana" - }, - "application/vnd.wv.ssp+xml": { - "source": "iana" - }, - "application/vnd.xacml+json": { - "source": "iana", - "compressible": true - }, - "application/vnd.xara": { - "source": "iana", - "extensions": [ - "xar" - ] - }, - "application/vnd.xfdl": { - "source": "iana", - "extensions": [ - "xfdl" - ] - }, - "application/vnd.xfdl.webform": { - "source": "iana" - }, - "application/vnd.xmi+xml": { - "source": "iana" - }, - "application/vnd.xmpie.cpkg": { - "source": "iana" - }, - "application/vnd.xmpie.dpkg": { - "source": "iana" - }, - "application/vnd.xmpie.plan": { - "source": "iana" - }, - "application/vnd.xmpie.ppkg": { - "source": "iana" - }, - "application/vnd.xmpie.xlim": { - "source": "iana" - }, - "application/vnd.yamaha.hv-dic": { - "source": "iana", - "extensions": [ - "hvd" - ] - }, - "application/vnd.yamaha.hv-script": { - "source": "iana", - "extensions": [ - "hvs" - ] - }, - "application/vnd.yamaha.hv-voice": { - "source": "iana", - "extensions": [ - "hvp" - ] - }, - "application/vnd.yamaha.openscoreformat": { - "source": "iana", - "extensions": [ - "osf" - ] - }, - "application/vnd.yamaha.openscoreformat.osfpvg+xml": { - "source": "iana", - "extensions": [ - "osfpvg" - ] - }, - "application/vnd.yamaha.remote-setup": { - "source": "iana" - }, - "application/vnd.yamaha.smaf-audio": { - "source": "iana", - "extensions": [ - "saf" - ] - }, - "application/vnd.yamaha.smaf-phrase": { - "source": "iana", - "extensions": [ - "spf" - ] - }, - "application/vnd.yamaha.through-ngn": { - "source": "iana" - }, - "application/vnd.yamaha.tunnel-udpencap": { - "source": "iana" - }, - "application/vnd.yaoweme": { - "source": "iana" - }, - "application/vnd.yellowriver-custom-menu": { - "source": "iana", - "extensions": [ - "cmp" - ] - }, - "application/vnd.zul": { - "source": "iana", - "extensions": [ - "zir", - "zirz" - ] - }, - "application/vnd.zzazz.deck+xml": { - "source": "iana", - "extensions": [ - "zaz" - ] - }, - "application/voicexml+xml": { - "source": "iana", - "extensions": [ - "vxml" - ] - }, - "application/vq-rtcpxr": { - "source": "iana" - }, - "application/watcherinfo+xml": { - "source": "iana" - }, - "application/whoispp-query": { - "source": "iana" - }, - "application/whoispp-response": { - "source": "iana" - }, - "application/widget": { - "source": "iana", - "extensions": [ - "wgt" - ] - }, - "application/winhlp": { - "source": "apache", - "extensions": [ - "hlp" - ] - }, - "application/wita": { - "source": "iana" - }, - "application/wordperfect5.1": { - "source": "iana" - }, - "application/wsdl+xml": { - "source": "iana", - "extensions": [ - "wsdl" - ] - }, - "application/wspolicy+xml": { - "source": "iana", - "extensions": [ - "wspolicy" - ] - }, - "application/x-7z-compressed": { - "source": "apache", - "compressible": false, - "extensions": [ - "7z" - ] - }, - "application/x-abiword": { - "source": "apache", - "extensions": [ - "abw" - ] - }, - "application/x-ace-compressed": { - "source": "apache", - "extensions": [ - "ace" - ] - }, - "application/x-amf": { - "source": "apache" - }, - "application/x-apple-diskimage": { - "source": "apache", - "extensions": [ - "dmg" - ] - }, - "application/x-authorware-bin": { - "source": "apache", - "extensions": [ - "aab", - "x32", - "u32", - "vox" - ] - }, - "application/x-authorware-map": { - "source": "apache", - "extensions": [ - "aam" - ] - }, - "application/x-authorware-seg": { - "source": "apache", - "extensions": [ - "aas" - ] - }, - "application/x-bcpio": { - "source": "apache", - "extensions": [ - "bcpio" - ] - }, - "application/x-bdoc": { - "compressible": false, - "extensions": [ - "bdoc" - ] - }, - "application/x-bittorrent": { - "source": "apache", - "extensions": [ - "torrent" - ] - }, - "application/x-blorb": { - "source": "apache", - "extensions": [ - "blb", - "blorb" - ] - }, - "application/x-bzip": { - "source": "apache", - "compressible": false, - "extensions": [ - "bz" - ] - }, - "application/x-bzip2": { - "source": "apache", - "compressible": false, - "extensions": [ - "bz2", - "boz" - ] - }, - "application/x-cbr": { - "source": "apache", - "extensions": [ - "cbr", - "cba", - "cbt", - "cbz", - "cb7" - ] - }, - "application/x-cdlink": { - "source": "apache", - "extensions": [ - "vcd" - ] - }, - "application/x-cfs-compressed": { - "source": "apache", - "extensions": [ - "cfs" - ] - }, - "application/x-chat": { - "source": "apache", - "extensions": [ - "chat" - ] - }, - "application/x-chess-pgn": { - "source": "apache", - "extensions": [ - "pgn" - ] - }, - "application/x-chrome-extension": { - "extensions": [ - "crx" - ] - }, - "application/x-cocoa": { - "source": "nginx", - "extensions": [ - "cco" - ] - }, - "application/x-compress": { - "source": "apache" - }, - "application/x-conference": { - "source": "apache", - "extensions": [ - "nsc" - ] - }, - "application/x-cpio": { - "source": "apache", - "extensions": [ - "cpio" - ] - }, - "application/x-csh": { - "source": "apache", - "extensions": [ - "csh" - ] - }, - "application/x-deb": { - "compressible": false - }, - "application/x-debian-package": { - "source": "apache", - "extensions": [ - "deb", - "udeb" - ] - }, - "application/x-dgc-compressed": { - "source": "apache", - "extensions": [ - "dgc" - ] - }, - "application/x-director": { - "source": "apache", - "extensions": [ - "dir", - "dcr", - "dxr", - "cst", - "cct", - "cxt", - "w3d", - "fgd", - "swa" - ] - }, - "application/x-doom": { - "source": "apache", - "extensions": [ - "wad" - ] - }, - "application/x-dtbncx+xml": { - "source": "apache", - "extensions": [ - "ncx" - ] - }, - "application/x-dtbook+xml": { - "source": "apache", - "extensions": [ - "dtb" - ] - }, - "application/x-dtbresource+xml": { - "source": "apache", - "extensions": [ - "res" - ] - }, - "application/x-dvi": { - "source": "apache", - "compressible": false, - "extensions": [ - "dvi" - ] - }, - "application/x-envoy": { - "source": "apache", - "extensions": [ - "evy" - ] - }, - "application/x-eva": { - "source": "apache", - "extensions": [ - "eva" - ] - }, - "application/x-font-bdf": { - "source": "apache", - "extensions": [ - "bdf" - ] - }, - "application/x-font-dos": { - "source": "apache" - }, - "application/x-font-framemaker": { - "source": "apache" - }, - "application/x-font-ghostscript": { - "source": "apache", - "extensions": [ - "gsf" - ] - }, - "application/x-font-libgrx": { - "source": "apache" - }, - "application/x-font-linux-psf": { - "source": "apache", - "extensions": [ - "psf" - ] - }, - "application/x-font-otf": { - "source": "apache", - "compressible": true, - "extensions": [ - "otf" - ] - }, - "application/x-font-pcf": { - "source": "apache", - "extensions": [ - "pcf" - ] - }, - "application/x-font-snf": { - "source": "apache", - "extensions": [ - "snf" - ] - }, - "application/x-font-speedo": { - "source": "apache" - }, - "application/x-font-sunos-news": { - "source": "apache" - }, - "application/x-font-ttf": { - "source": "apache", - "compressible": true, - "extensions": [ - "ttf", - "ttc" - ] - }, - "application/x-font-type1": { - "source": "apache", - "extensions": [ - "pfa", - "pfb", - "pfm", - "afm" - ] - }, - "application/x-font-vfont": { - "source": "apache" - }, - "application/x-freearc": { - "source": "apache", - "extensions": [ - "arc" - ] - }, - "application/x-futuresplash": { - "source": "apache", - "extensions": [ - "spl" - ] - }, - "application/x-gca-compressed": { - "source": "apache", - "extensions": [ - "gca" - ] - }, - "application/x-glulx": { - "source": "apache", - "extensions": [ - "ulx" - ] - }, - "application/x-gnumeric": { - "source": "apache", - "extensions": [ - "gnumeric" - ] - }, - "application/x-gramps-xml": { - "source": "apache", - "extensions": [ - "gramps" - ] - }, - "application/x-gtar": { - "source": "apache", - "extensions": [ - "gtar" - ] - }, - "application/x-gzip": { - "source": "apache" - }, - "application/x-hdf": { - "source": "apache", - "extensions": [ - "hdf" - ] - }, - "application/x-httpd-php": { - "compressible": true, - "extensions": [ - "php" - ] - }, - "application/x-install-instructions": { - "source": "apache", - "extensions": [ - "install" - ] - }, - "application/x-iso9660-image": { - "source": "apache", - "extensions": [ - "iso" - ] - }, - "application/x-java-archive-diff": { - "source": "nginx", - "extensions": [ - "jardiff" - ] - }, - "application/x-java-jnlp-file": { - "source": "apache", - "compressible": false, - "extensions": [ - "jnlp" - ] - }, - "application/x-javascript": { - "compressible": true - }, - "application/x-latex": { - "source": "apache", - "compressible": false, - "extensions": [ - "latex" - ] - }, - "application/x-lua-bytecode": { - "extensions": [ - "luac" - ] - }, - "application/x-lzh-compressed": { - "source": "apache", - "extensions": [ - "lzh", - "lha" - ] - }, - "application/x-makeself": { - "source": "nginx", - "extensions": [ - "run" - ] - }, - "application/x-mie": { - "source": "apache", - "extensions": [ - "mie" - ] - }, - "application/x-mobipocket-ebook": { - "source": "apache", - "extensions": [ - "prc", - "mobi" - ] - }, - "application/x-mpegurl": { - "compressible": false - }, - "application/x-ms-application": { - "source": "apache", - "extensions": [ - "application" - ] - }, - "application/x-ms-shortcut": { - "source": "apache", - "extensions": [ - "lnk" - ] - }, - "application/x-ms-wmd": { - "source": "apache", - "extensions": [ - "wmd" - ] - }, - "application/x-ms-wmz": { - "source": "apache", - "extensions": [ - "wmz" - ] - }, - "application/x-ms-xbap": { - "source": "apache", - "extensions": [ - "xbap" - ] - }, - "application/x-msaccess": { - "source": "apache", - "extensions": [ - "mdb" - ] - }, - "application/x-msbinder": { - "source": "apache", - "extensions": [ - "obd" - ] - }, - "application/x-mscardfile": { - "source": "apache", - "extensions": [ - "crd" - ] - }, - "application/x-msclip": { - "source": "apache", - "extensions": [ - "clp" - ] - }, - "application/x-msdos-program": { - "extensions": [ - "exe" - ] - }, - "application/x-msdownload": { - "source": "apache", - "extensions": [ - "exe", - "dll", - "com", - "bat", - "msi" - ] - }, - "application/x-msmediaview": { - "source": "apache", - "extensions": [ - "mvb", - "m13", - "m14" - ] - }, - "application/x-msmetafile": { - "source": "apache", - "extensions": [ - "wmf", - "wmz", - "emf", - "emz" - ] - }, - "application/x-msmoney": { - "source": "apache", - "extensions": [ - "mny" - ] - }, - "application/x-mspublisher": { - "source": "apache", - "extensions": [ - "pub" - ] - }, - "application/x-msschedule": { - "source": "apache", - "extensions": [ - "scd" - ] - }, - "application/x-msterminal": { - "source": "apache", - "extensions": [ - "trm" - ] - }, - "application/x-mswrite": { - "source": "apache", - "extensions": [ - "wri" - ] - }, - "application/x-netcdf": { - "source": "apache", - "extensions": [ - "nc", - "cdf" - ] - }, - "application/x-ns-proxy-autoconfig": { - "compressible": true, - "extensions": [ - "pac" - ] - }, - "application/x-nzb": { - "source": "apache", - "extensions": [ - "nzb" - ] - }, - "application/x-perl": { - "source": "nginx", - "extensions": [ - "pl", - "pm" - ] - }, - "application/x-pilot": { - "source": "nginx", - "extensions": [ - "prc", - "pdb" - ] - }, - "application/x-pkcs12": { - "source": "apache", - "compressible": false, - "extensions": [ - "p12", - "pfx" - ] - }, - "application/x-pkcs7-certificates": { - "source": "apache", - "extensions": [ - "p7b", - "spc" - ] - }, - "application/x-pkcs7-certreqresp": { - "source": "apache", - "extensions": [ - "p7r" - ] - }, - "application/x-rar-compressed": { - "source": "apache", - "compressible": false, - "extensions": [ - "rar" - ] - }, - "application/x-redhat-package-manager": { - "source": "nginx", - "extensions": [ - "rpm" - ] - }, - "application/x-research-info-systems": { - "source": "apache", - "extensions": [ - "ris" - ] - }, - "application/x-sea": { - "source": "nginx", - "extensions": [ - "sea" - ] - }, - "application/x-sh": { - "source": "apache", - "compressible": true, - "extensions": [ - "sh" - ] - }, - "application/x-shar": { - "source": "apache", - "extensions": [ - "shar" - ] - }, - "application/x-shockwave-flash": { - "source": "apache", - "compressible": false, - "extensions": [ - "swf" - ] - }, - "application/x-silverlight-app": { - "source": "apache", - "extensions": [ - "xap" - ] - }, - "application/x-sql": { - "source": "apache", - "extensions": [ - "sql" - ] - }, - "application/x-stuffit": { - "source": "apache", - "compressible": false, - "extensions": [ - "sit" - ] - }, - "application/x-stuffitx": { - "source": "apache", - "extensions": [ - "sitx" - ] - }, - "application/x-subrip": { - "source": "apache", - "extensions": [ - "srt" - ] - }, - "application/x-sv4cpio": { - "source": "apache", - "extensions": [ - "sv4cpio" - ] - }, - "application/x-sv4crc": { - "source": "apache", - "extensions": [ - "sv4crc" - ] - }, - "application/x-t3vm-image": { - "source": "apache", - "extensions": [ - "t3" - ] - }, - "application/x-tads": { - "source": "apache", - "extensions": [ - "gam" - ] - }, - "application/x-tar": { - "source": "apache", - "compressible": true, - "extensions": [ - "tar" - ] - }, - "application/x-tcl": { - "source": "apache", - "extensions": [ - "tcl", - "tk" - ] - }, - "application/x-tex": { - "source": "apache", - "extensions": [ - "tex" - ] - }, - "application/x-tex-tfm": { - "source": "apache", - "extensions": [ - "tfm" - ] - }, - "application/x-texinfo": { - "source": "apache", - "extensions": [ - "texinfo", - "texi" - ] - }, - "application/x-tgif": { - "source": "apache", - "extensions": [ - "obj" - ] - }, - "application/x-ustar": { - "source": "apache", - "extensions": [ - "ustar" - ] - }, - "application/x-wais-source": { - "source": "apache", - "extensions": [ - "src" - ] - }, - "application/x-web-app-manifest+json": { - "compressible": true, - "extensions": [ - "webapp" - ] - }, - "application/x-www-form-urlencoded": { - "source": "iana", - "compressible": true - }, - "application/x-x509-ca-cert": { - "source": "apache", - "extensions": [ - "der", - "crt", - "pem" - ] - }, - "application/x-xfig": { - "source": "apache", - "extensions": [ - "fig" - ] - }, - "application/x-xliff+xml": { - "source": "apache", - "extensions": [ - "xlf" - ] - }, - "application/x-xpinstall": { - "source": "apache", - "compressible": false, - "extensions": [ - "xpi" - ] - }, - "application/x-xz": { - "source": "apache", - "extensions": [ - "xz" - ] - }, - "application/x-zmachine": { - "source": "apache", - "extensions": [ - "z1", - "z2", - "z3", - "z4", - "z5", - "z6", - "z7", - "z8" - ] - }, - "application/x400-bp": { - "source": "iana" - }, - "application/xacml+xml": { - "source": "iana" - }, - "application/xaml+xml": { - "source": "apache", - "extensions": [ - "xaml" - ] - }, - "application/xcap-att+xml": { - "source": "iana" - }, - "application/xcap-caps+xml": { - "source": "iana" - }, - "application/xcap-diff+xml": { - "source": "iana", - "extensions": [ - "xdf" - ] - }, - "application/xcap-el+xml": { - "source": "iana" - }, - "application/xcap-error+xml": { - "source": "iana" - }, - "application/xcap-ns+xml": { - "source": "iana" - }, - "application/xcon-conference-info+xml": { - "source": "iana" - }, - "application/xcon-conference-info-diff+xml": { - "source": "iana" - }, - "application/xenc+xml": { - "source": "iana", - "extensions": [ - "xenc" - ] - }, - "application/xhtml+xml": { - "source": "iana", - "compressible": true, - "extensions": [ - "xhtml", - "xht" - ] - }, - "application/xhtml-voice+xml": { - "source": "apache" - }, - "application/xml": { - "source": "iana", - "compressible": true, - "extensions": [ - "xml", - "xsl", - "xsd", - "rng" - ] - }, - "application/xml-dtd": { - "source": "iana", - "compressible": true, - "extensions": [ - "dtd" - ] - }, - "application/xml-external-parsed-entity": { - "source": "iana" - }, - "application/xml-patch+xml": { - "source": "iana" - }, - "application/xmpp+xml": { - "source": "iana" - }, - "application/xop+xml": { - "source": "iana", - "compressible": true, - "extensions": [ - "xop" - ] - }, - "application/xproc+xml": { - "source": "apache", - "extensions": [ - "xpl" - ] - }, - "application/xslt+xml": { - "source": "iana", - "extensions": [ - "xslt" - ] - }, - "application/xspf+xml": { - "source": "apache", - "extensions": [ - "xspf" - ] - }, - "application/xv+xml": { - "source": "iana", - "extensions": [ - "mxml", - "xhvml", - "xvml", - "xvm" - ] - }, - "application/yang": { - "source": "iana", - "extensions": [ - "yang" - ] - }, - "application/yang-data+json": { - "source": "iana", - "compressible": true - }, - "application/yang-data+xml": { - "source": "iana" - }, - "application/yang-patch+json": { - "source": "iana", - "compressible": true - }, - "application/yang-patch+xml": { - "source": "iana" - }, - "application/yin+xml": { - "source": "iana", - "extensions": [ - "yin" - ] - }, - "application/zip": { - "source": "iana", - "compressible": false, - "extensions": [ - "zip" - ] - }, - "application/zlib": { - "source": "iana" - }, - "audio/1d-interleaved-parityfec": { - "source": "iana" - }, - "audio/32kadpcm": { - "source": "iana" - }, - "audio/3gpp": { - "source": "iana", - "compressible": false, - "extensions": [ - "3gpp" - ] - }, - "audio/3gpp2": { - "source": "iana" - }, - "audio/ac3": { - "source": "iana" - }, - "audio/adpcm": { - "source": "apache", - "extensions": [ - "adp" - ] - }, - "audio/amr": { - "source": "iana" - }, - "audio/amr-wb": { - "source": "iana" - }, - "audio/amr-wb+": { - "source": "iana" - }, - "audio/aptx": { - "source": "iana" - }, - "audio/asc": { - "source": "iana" - }, - "audio/atrac-advanced-lossless": { - "source": "iana" - }, - "audio/atrac-x": { - "source": "iana" - }, - "audio/atrac3": { - "source": "iana" - }, - "audio/basic": { - "source": "iana", - "compressible": false, - "extensions": [ - "au", - "snd" - ] - }, - "audio/bv16": { - "source": "iana" - }, - "audio/bv32": { - "source": "iana" - }, - "audio/clearmode": { - "source": "iana" - }, - "audio/cn": { - "source": "iana" - }, - "audio/dat12": { - "source": "iana" - }, - "audio/dls": { - "source": "iana" - }, - "audio/dsr-es201108": { - "source": "iana" - }, - "audio/dsr-es202050": { - "source": "iana" - }, - "audio/dsr-es202211": { - "source": "iana" - }, - "audio/dsr-es202212": { - "source": "iana" - }, - "audio/dv": { - "source": "iana" - }, - "audio/dvi4": { - "source": "iana" - }, - "audio/eac3": { - "source": "iana" - }, - "audio/encaprtp": { - "source": "iana" - }, - "audio/evrc": { - "source": "iana" - }, - "audio/evrc-qcp": { - "source": "iana" - }, - "audio/evrc0": { - "source": "iana" - }, - "audio/evrc1": { - "source": "iana" - }, - "audio/evrcb": { - "source": "iana" - }, - "audio/evrcb0": { - "source": "iana" - }, - "audio/evrcb1": { - "source": "iana" - }, - "audio/evrcnw": { - "source": "iana" - }, - "audio/evrcnw0": { - "source": "iana" - }, - "audio/evrcnw1": { - "source": "iana" - }, - "audio/evrcwb": { - "source": "iana" - }, - "audio/evrcwb0": { - "source": "iana" - }, - "audio/evrcwb1": { - "source": "iana" - }, - "audio/evs": { - "source": "iana" - }, - "audio/fwdred": { - "source": "iana" - }, - "audio/g711-0": { - "source": "iana" - }, - "audio/g719": { - "source": "iana" - }, - "audio/g722": { - "source": "iana" - }, - "audio/g7221": { - "source": "iana" - }, - "audio/g723": { - "source": "iana" - }, - "audio/g726-16": { - "source": "iana" - }, - "audio/g726-24": { - "source": "iana" - }, - "audio/g726-32": { - "source": "iana" - }, - "audio/g726-40": { - "source": "iana" - }, - "audio/g728": { - "source": "iana" - }, - "audio/g729": { - "source": "iana" - }, - "audio/g7291": { - "source": "iana" - }, - "audio/g729d": { - "source": "iana" - }, - "audio/g729e": { - "source": "iana" - }, - "audio/gsm": { - "source": "iana" - }, - "audio/gsm-efr": { - "source": "iana" - }, - "audio/gsm-hr-08": { - "source": "iana" - }, - "audio/ilbc": { - "source": "iana" - }, - "audio/ip-mr_v2.5": { - "source": "iana" - }, - "audio/isac": { - "source": "apache" - }, - "audio/l16": { - "source": "iana" - }, - "audio/l20": { - "source": "iana" - }, - "audio/l24": { - "source": "iana", - "compressible": false - }, - "audio/l8": { - "source": "iana" - }, - "audio/lpc": { - "source": "iana" - }, - "audio/melp": { - "source": "iana" - }, - "audio/melp1200": { - "source": "iana" - }, - "audio/melp2400": { - "source": "iana" - }, - "audio/melp600": { - "source": "iana" - }, - "audio/midi": { - "source": "apache", - "extensions": [ - "mid", - "midi", - "kar", - "rmi" - ] - }, - "audio/mobile-xmf": { - "source": "iana" - }, - "audio/mp3": { - "compressible": false, - "extensions": [ - "mp3" - ] - }, - "audio/mp4": { - "source": "iana", - "compressible": false, - "extensions": [ - "m4a", - "mp4a" - ] - }, - "audio/mp4a-latm": { - "source": "iana" - }, - "audio/mpa": { - "source": "iana" - }, - "audio/mpa-robust": { - "source": "iana" - }, - "audio/mpeg": { - "source": "iana", - "compressible": false, - "extensions": [ - "mpga", - "mp2", - "mp2a", - "mp3", - "m2a", - "m3a" - ] - }, - "audio/mpeg4-generic": { - "source": "iana" - }, - "audio/musepack": { - "source": "apache" - }, - "audio/ogg": { - "source": "iana", - "compressible": false, - "extensions": [ - "oga", - "ogg", - "spx" - ] - }, - "audio/opus": { - "source": "iana" - }, - "audio/parityfec": { - "source": "iana" - }, - "audio/pcma": { - "source": "iana" - }, - "audio/pcma-wb": { - "source": "iana" - }, - "audio/pcmu": { - "source": "iana" - }, - "audio/pcmu-wb": { - "source": "iana" - }, - "audio/prs.sid": { - "source": "iana" - }, - "audio/qcelp": { - "source": "iana" - }, - "audio/raptorfec": { - "source": "iana" - }, - "audio/red": { - "source": "iana" - }, - "audio/rtp-enc-aescm128": { - "source": "iana" - }, - "audio/rtp-midi": { - "source": "iana" - }, - "audio/rtploopback": { - "source": "iana" - }, - "audio/rtx": { - "source": "iana" - }, - "audio/s3m": { - "source": "apache", - "extensions": [ - "s3m" - ] - }, - "audio/silk": { - "source": "apache", - "extensions": [ - "sil" - ] - }, - "audio/smv": { - "source": "iana" - }, - "audio/smv-qcp": { - "source": "iana" - }, - "audio/smv0": { - "source": "iana" - }, - "audio/sp-midi": { - "source": "iana" - }, - "audio/speex": { - "source": "iana" - }, - "audio/t140c": { - "source": "iana" - }, - "audio/t38": { - "source": "iana" - }, - "audio/telephone-event": { - "source": "iana" - }, - "audio/tone": { - "source": "iana" - }, - "audio/uemclip": { - "source": "iana" - }, - "audio/ulpfec": { - "source": "iana" - }, - "audio/vdvi": { - "source": "iana" - }, - "audio/vmr-wb": { - "source": "iana" - }, - "audio/vnd.3gpp.iufp": { - "source": "iana" - }, - "audio/vnd.4sb": { - "source": "iana" - }, - "audio/vnd.audiokoz": { - "source": "iana" - }, - "audio/vnd.celp": { - "source": "iana" - }, - "audio/vnd.cisco.nse": { - "source": "iana" - }, - "audio/vnd.cmles.radio-events": { - "source": "iana" - }, - "audio/vnd.cns.anp1": { - "source": "iana" - }, - "audio/vnd.cns.inf1": { - "source": "iana" - }, - "audio/vnd.dece.audio": { - "source": "iana", - "extensions": [ - "uva", - "uvva" - ] - }, - "audio/vnd.digital-winds": { - "source": "iana", - "extensions": [ - "eol" - ] - }, - "audio/vnd.dlna.adts": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.1": { - "source": "iana" - }, - "audio/vnd.dolby.heaac.2": { - "source": "iana" - }, - "audio/vnd.dolby.mlp": { - "source": "iana" - }, - "audio/vnd.dolby.mps": { - "source": "iana" - }, - "audio/vnd.dolby.pl2": { - "source": "iana" - }, - "audio/vnd.dolby.pl2x": { - "source": "iana" - }, - "audio/vnd.dolby.pl2z": { - "source": "iana" - }, - "audio/vnd.dolby.pulse.1": { - "source": "iana" - }, - "audio/vnd.dra": { - "source": "iana", - "extensions": [ - "dra" - ] - }, - "audio/vnd.dts": { - "source": "iana", - "extensions": [ - "dts" - ] - }, - "audio/vnd.dts.hd": { - "source": "iana", - "extensions": [ - "dtshd" - ] - }, - "audio/vnd.dvb.file": { - "source": "iana" - }, - "audio/vnd.everad.plj": { - "source": "iana" - }, - "audio/vnd.hns.audio": { - "source": "iana" - }, - "audio/vnd.lucent.voice": { - "source": "iana", - "extensions": [ - "lvp" - ] - }, - "audio/vnd.ms-playready.media.pya": { - "source": "iana", - "extensions": [ - "pya" - ] - }, - "audio/vnd.nokia.mobile-xmf": { - "source": "iana" - }, - "audio/vnd.nortel.vbk": { - "source": "iana" - }, - "audio/vnd.nuera.ecelp4800": { - "source": "iana", - "extensions": [ - "ecelp4800" - ] - }, - "audio/vnd.nuera.ecelp7470": { - "source": "iana", - "extensions": [ - "ecelp7470" - ] - }, - "audio/vnd.nuera.ecelp9600": { - "source": "iana", - "extensions": [ - "ecelp9600" - ] - }, - "audio/vnd.octel.sbc": { - "source": "iana" - }, - "audio/vnd.qcelp": { - "source": "iana" - }, - "audio/vnd.rhetorex.32kadpcm": { - "source": "iana" - }, - "audio/vnd.rip": { - "source": "iana", - "extensions": [ - "rip" - ] - }, - "audio/vnd.rn-realaudio": { - "compressible": false - }, - "audio/vnd.sealedmedia.softseal.mpeg": { - "source": "iana" - }, - "audio/vnd.vmx.cvsd": { - "source": "iana" - }, - "audio/vnd.wave": { - "compressible": false - }, - "audio/vorbis": { - "source": "iana", - "compressible": false - }, - "audio/vorbis-config": { - "source": "iana" - }, - "audio/wav": { - "compressible": false, - "extensions": [ - "wav" - ] - }, - "audio/wave": { - "compressible": false, - "extensions": [ - "wav" - ] - }, - "audio/webm": { - "source": "apache", - "compressible": false, - "extensions": [ - "weba" - ] - }, - "audio/x-aac": { - "source": "apache", - "compressible": false, - "extensions": [ - "aac" - ] - }, - "audio/x-aiff": { - "source": "apache", - "extensions": [ - "aif", - "aiff", - "aifc" - ] - }, - "audio/x-caf": { - "source": "apache", - "compressible": false, - "extensions": [ - "caf" - ] - }, - "audio/x-flac": { - "source": "apache", - "extensions": [ - "flac" - ] - }, - "audio/x-m4a": { - "source": "nginx", - "extensions": [ - "m4a" - ] - }, - "audio/x-matroska": { - "source": "apache", - "extensions": [ - "mka" - ] - }, - "audio/x-mpegurl": { - "source": "apache", - "extensions": [ - "m3u" - ] - }, - "audio/x-ms-wax": { - "source": "apache", - "extensions": [ - "wax" - ] - }, - "audio/x-ms-wma": { - "source": "apache", - "extensions": [ - "wma" - ] - }, - "audio/x-pn-realaudio": { - "source": "apache", - "extensions": [ - "ram", - "ra" - ] - }, - "audio/x-pn-realaudio-plugin": { - "source": "apache", - "extensions": [ - "rmp" - ] - }, - "audio/x-realaudio": { - "source": "nginx", - "extensions": [ - "ra" - ] - }, - "audio/x-tta": { - "source": "apache" - }, - "audio/x-wav": { - "source": "apache", - "extensions": [ - "wav" - ] - }, - "audio/xm": { - "source": "apache", - "extensions": [ - "xm" - ] - }, - "chemical/x-cdx": { - "source": "apache", - "extensions": [ - "cdx" - ] - }, - "chemical/x-cif": { - "source": "apache", - "extensions": [ - "cif" - ] - }, - "chemical/x-cmdf": { - "source": "apache", - "extensions": [ - "cmdf" - ] - }, - "chemical/x-cml": { - "source": "apache", - "extensions": [ - "cml" - ] - }, - "chemical/x-csml": { - "source": "apache", - "extensions": [ - "csml" - ] - }, - "chemical/x-pdb": { - "source": "apache" - }, - "chemical/x-xyz": { - "source": "apache", - "extensions": [ - "xyz" - ] - }, - "font/opentype": { - "compressible": true, - "extensions": [ - "otf" - ] - }, - "image/apng": { - "compressible": false, - "extensions": [ - "apng" - ] - }, - "image/bmp": { - "source": "iana", - "compressible": true, - "extensions": [ - "bmp" - ] - }, - "image/cgm": { - "source": "iana", - "extensions": [ - "cgm" - ] - }, - "image/dicom-rle": { - "source": "iana" - }, - "image/emf": { - "source": "iana" - }, - "image/fits": { - "source": "iana" - }, - "image/g3fax": { - "source": "iana", - "extensions": [ - "g3" - ] - }, - "image/gif": { - "source": "iana", - "compressible": false, - "extensions": [ - "gif" - ] - }, - "image/ief": { - "source": "iana", - "extensions": [ - "ief" - ] - }, - "image/jls": { - "source": "iana" - }, - "image/jp2": { - "source": "iana" - }, - "image/jpeg": { - "source": "iana", - "compressible": false, - "extensions": [ - "jpeg", - "jpg", - "jpe" - ] - }, - "image/jpm": { - "source": "iana" - }, - "image/jpx": { - "source": "iana" - }, - "image/ktx": { - "source": "iana", - "extensions": [ - "ktx" - ] - }, - "image/naplps": { - "source": "iana" - }, - "image/pjpeg": { - "compressible": false - }, - "image/png": { - "source": "iana", - "compressible": false, - "extensions": [ - "png" - ] - }, - "image/prs.btif": { - "source": "iana", - "extensions": [ - "btif" - ] - }, - "image/prs.pti": { - "source": "iana" - }, - "image/pwg-raster": { - "source": "iana" - }, - "image/sgi": { - "source": "apache", - "extensions": [ - "sgi" - ] - }, - "image/svg+xml": { - "source": "iana", - "compressible": true, - "extensions": [ - "svg", - "svgz" - ] - }, - "image/t38": { - "source": "iana" - }, - "image/tiff": { - "source": "iana", - "compressible": false, - "extensions": [ - "tiff", - "tif" - ] - }, - "image/tiff-fx": { - "source": "iana" - }, - "image/vnd.adobe.photoshop": { - "source": "iana", - "compressible": true, - "extensions": [ - "psd" - ] - }, - "image/vnd.airzip.accelerator.azv": { - "source": "iana" - }, - "image/vnd.cns.inf2": { - "source": "iana" - }, - "image/vnd.dece.graphic": { - "source": "iana", - "extensions": [ - "uvi", - "uvvi", - "uvg", - "uvvg" - ] - }, - "image/vnd.djvu": { - "source": "iana", - "extensions": [ - "djvu", - "djv" - ] - }, - "image/vnd.dvb.subtitle": { - "source": "iana", - "extensions": [ - "sub" - ] - }, - "image/vnd.dwg": { - "source": "iana", - "extensions": [ - "dwg" - ] - }, - "image/vnd.dxf": { - "source": "iana", - "extensions": [ - "dxf" - ] - }, - "image/vnd.fastbidsheet": { - "source": "iana", - "extensions": [ - "fbs" - ] - }, - "image/vnd.fpx": { - "source": "iana", - "extensions": [ - "fpx" - ] - }, - "image/vnd.fst": { - "source": "iana", - "extensions": [ - "fst" - ] - }, - "image/vnd.fujixerox.edmics-mmr": { - "source": "iana", - "extensions": [ - "mmr" - ] - }, - "image/vnd.fujixerox.edmics-rlc": { - "source": "iana", - "extensions": [ - "rlc" - ] - }, - "image/vnd.globalgraphics.pgb": { - "source": "iana" - }, - "image/vnd.microsoft.icon": { - "source": "iana" - }, - "image/vnd.mix": { - "source": "iana" - }, - "image/vnd.mozilla.apng": { - "source": "iana" - }, - "image/vnd.ms-modi": { - "source": "iana", - "extensions": [ - "mdi" - ] - }, - "image/vnd.ms-photo": { - "source": "apache", - "extensions": [ - "wdp" - ] - }, - "image/vnd.net-fpx": { - "source": "iana", - "extensions": [ - "npx" - ] - }, - "image/vnd.radiance": { - "source": "iana" - }, - "image/vnd.sealed.png": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.gif": { - "source": "iana" - }, - "image/vnd.sealedmedia.softseal.jpg": { - "source": "iana" - }, - "image/vnd.svf": { - "source": "iana" - }, - "image/vnd.tencent.tap": { - "source": "iana" - }, - "image/vnd.valve.source.texture": { - "source": "iana" - }, - "image/vnd.wap.wbmp": { - "source": "iana", - "extensions": [ - "wbmp" - ] - }, - "image/vnd.xiff": { - "source": "iana", - "extensions": [ - "xif" - ] - }, - "image/vnd.zbrush.pcx": { - "source": "iana" - }, - "image/webp": { - "source": "apache", - "extensions": [ - "webp" - ] - }, - "image/wmf": { - "source": "iana" - }, - "image/x-3ds": { - "source": "apache", - "extensions": [ - "3ds" - ] - }, - "image/x-cmu-raster": { - "source": "apache", - "extensions": [ - "ras" - ] - }, - "image/x-cmx": { - "source": "apache", - "extensions": [ - "cmx" - ] - }, - "image/x-freehand": { - "source": "apache", - "extensions": [ - "fh", - "fhc", - "fh4", - "fh5", - "fh7" - ] - }, - "image/x-icon": { - "source": "apache", - "compressible": true, - "extensions": [ - "ico" - ] - }, - "image/x-jng": { - "source": "nginx", - "extensions": [ - "jng" - ] - }, - "image/x-mrsid-image": { - "source": "apache", - "extensions": [ - "sid" - ] - }, - "image/x-ms-bmp": { - "source": "nginx", - "compressible": true, - "extensions": [ - "bmp" - ] - }, - "image/x-pcx": { - "source": "apache", - "extensions": [ - "pcx" - ] - }, - "image/x-pict": { - "source": "apache", - "extensions": [ - "pic", - "pct" - ] - }, - "image/x-portable-anymap": { - "source": "apache", - "extensions": [ - "pnm" - ] - }, - "image/x-portable-bitmap": { - "source": "apache", - "extensions": [ - "pbm" - ] - }, - "image/x-portable-graymap": { - "source": "apache", - "extensions": [ - "pgm" - ] - }, - "image/x-portable-pixmap": { - "source": "apache", - "extensions": [ - "ppm" - ] - }, - "image/x-rgb": { - "source": "apache", - "extensions": [ - "rgb" - ] - }, - "image/x-tga": { - "source": "apache", - "extensions": [ - "tga" - ] - }, - "image/x-xbitmap": { - "source": "apache", - "extensions": [ - "xbm" - ] - }, - "image/x-xcf": { - "compressible": false - }, - "image/x-xpixmap": { - "source": "apache", - "extensions": [ - "xpm" - ] - }, - "image/x-xwindowdump": { - "source": "apache", - "extensions": [ - "xwd" - ] - }, - "message/cpim": { - "source": "iana" - }, - "message/delivery-status": { - "source": "iana" - }, - "message/disposition-notification": { - "source": "iana" - }, - "message/external-body": { - "source": "iana" - }, - "message/feedback-report": { - "source": "iana" - }, - "message/global": { - "source": "iana" - }, - "message/global-delivery-status": { - "source": "iana" - }, - "message/global-disposition-notification": { - "source": "iana" - }, - "message/global-headers": { - "source": "iana" - }, - "message/http": { - "source": "iana", - "compressible": false - }, - "message/imdn+xml": { - "source": "iana", - "compressible": true - }, - "message/news": { - "source": "iana" - }, - "message/partial": { - "source": "iana", - "compressible": false - }, - "message/rfc822": { - "source": "iana", - "compressible": true, - "extensions": [ - "eml", - "mime" - ] - }, - "message/s-http": { - "source": "iana" - }, - "message/sip": { - "source": "iana" - }, - "message/sipfrag": { - "source": "iana" - }, - "message/tracking-status": { - "source": "iana" - }, - "message/vnd.si.simp": { - "source": "iana" - }, - "message/vnd.wfa.wsc": { - "source": "iana" - }, - "model/gltf+json": { - "source": "iana", - "compressible": true - }, - "model/iges": { - "source": "iana", - "compressible": false, - "extensions": [ - "igs", - "iges" - ] - }, - "model/mesh": { - "source": "iana", - "compressible": false, - "extensions": [ - "msh", - "mesh", - "silo" - ] - }, - "model/vnd.collada+xml": { - "source": "iana", - "extensions": [ - "dae" - ] - }, - "model/vnd.dwf": { - "source": "iana", - "extensions": [ - "dwf" - ] - }, - "model/vnd.flatland.3dml": { - "source": "iana" - }, - "model/vnd.gdl": { - "source": "iana", - "extensions": [ - "gdl" - ] - }, - "model/vnd.gs-gdl": { - "source": "apache" - }, - "model/vnd.gs.gdl": { - "source": "iana" - }, - "model/vnd.gtw": { - "source": "iana", - "extensions": [ - "gtw" - ] - }, - "model/vnd.moml+xml": { - "source": "iana" - }, - "model/vnd.mts": { - "source": "iana", - "extensions": [ - "mts" - ] - }, - "model/vnd.opengex": { - "source": "iana" - }, - "model/vnd.parasolid.transmit.binary": { - "source": "iana" - }, - "model/vnd.parasolid.transmit.text": { - "source": "iana" - }, - "model/vnd.rosette.annotated-data-model": { - "source": "iana" - }, - "model/vnd.valve.source.compiled-map": { - "source": "iana" - }, - "model/vnd.vtu": { - "source": "iana", - "extensions": [ - "vtu" - ] - }, - "model/vrml": { - "source": "iana", - "compressible": false, - "extensions": [ - "wrl", - "vrml" - ] - }, - "model/x3d+binary": { - "source": "apache", - "compressible": false, - "extensions": [ - "x3db", - "x3dbz" - ] - }, - "model/x3d+fastinfoset": { - "source": "iana" - }, - "model/x3d+vrml": { - "source": "apache", - "compressible": false, - "extensions": [ - "x3dv", - "x3dvz" - ] - }, - "model/x3d+xml": { - "source": "iana", - "compressible": true, - "extensions": [ - "x3d", - "x3dz" - ] - }, - "model/x3d-vrml": { - "source": "iana" - }, - "multipart/alternative": { - "source": "iana", - "compressible": false - }, - "multipart/appledouble": { - "source": "iana" - }, - "multipart/byteranges": { - "source": "iana" - }, - "multipart/digest": { - "source": "iana" - }, - "multipart/encrypted": { - "source": "iana", - "compressible": false - }, - "multipart/form-data": { - "source": "iana", - "compressible": false - }, - "multipart/header-set": { - "source": "iana" - }, - "multipart/mixed": { - "source": "iana", - "compressible": false - }, - "multipart/parallel": { - "source": "iana" - }, - "multipart/related": { - "source": "iana", - "compressible": false - }, - "multipart/report": { - "source": "iana" - }, - "multipart/signed": { - "source": "iana", - "compressible": false - }, - "multipart/voice-message": { - "source": "iana" - }, - "multipart/x-mixed-replace": { - "source": "iana" - }, - "text/1d-interleaved-parityfec": { - "source": "iana" - }, - "text/cache-manifest": { - "source": "iana", - "compressible": true, - "extensions": [ - "appcache", - "manifest" - ] - }, - "text/calendar": { - "source": "iana", - "extensions": [ - "ics", - "ifb" - ] - }, - "text/calender": { - "compressible": true - }, - "text/cmd": { - "compressible": true - }, - "text/coffeescript": { - "extensions": [ - "coffee", - "litcoffee" - ] - }, - "text/css": { - "source": "iana", - "compressible": true, - "extensions": [ - "css" - ] - }, - "text/csv": { - "source": "iana", - "compressible": true, - "extensions": [ - "csv" - ] - }, - "text/csv-schema": { - "source": "iana" - }, - "text/directory": { - "source": "iana" - }, - "text/dns": { - "source": "iana" - }, - "text/ecmascript": { - "source": "iana" - }, - "text/encaprtp": { - "source": "iana" - }, - "text/enriched": { - "source": "iana" - }, - "text/fwdred": { - "source": "iana" - }, - "text/grammar-ref-list": { - "source": "iana" - }, - "text/hjson": { - "extensions": [ - "hjson" - ] - }, - "text/html": { - "source": "iana", - "compressible": true, - "extensions": [ - "html", - "htm", - "shtml" - ] - }, - "text/jade": { - "extensions": [ - "jade" - ] - }, - "text/javascript": { - "source": "iana", - "compressible": true - }, - "text/jcr-cnd": { - "source": "iana" - }, - "text/jsx": { - "compressible": true, - "extensions": [ - "jsx" - ] - }, - "text/less": { - "extensions": [ - "less" - ] - }, - "text/markdown": { - "source": "iana" - }, - "text/mathml": { - "source": "nginx", - "extensions": [ - "mml" - ] - }, - "text/mizar": { - "source": "iana" - }, - "text/n3": { - "source": "iana", - "compressible": true, - "extensions": [ - "n3" - ] - }, - "text/parameters": { - "source": "iana" - }, - "text/parityfec": { - "source": "iana" - }, - "text/plain": { - "source": "iana", - "compressible": true, - "extensions": [ - "txt", - "text", - "conf", - "def", - "list", - "log", - "in", - "ini" - ] - }, - "text/provenance-notation": { - "source": "iana" - }, - "text/prs.fallenstein.rst": { - "source": "iana" - }, - "text/prs.lines.tag": { - "source": "iana", - "extensions": [ - "dsc" - ] - }, - "text/prs.prop.logic": { - "source": "iana" - }, - "text/raptorfec": { - "source": "iana" - }, - "text/red": { - "source": "iana" - }, - "text/rfc822-headers": { - "source": "iana" - }, - "text/richtext": { - "source": "iana", - "compressible": true, - "extensions": [ - "rtx" - ] - }, - "text/rtf": { - "source": "iana", - "compressible": true, - "extensions": [ - "rtf" - ] - }, - "text/rtp-enc-aescm128": { - "source": "iana" - }, - "text/rtploopback": { - "source": "iana" - }, - "text/rtx": { - "source": "iana" - }, - "text/sgml": { - "source": "iana", - "extensions": [ - "sgml", - "sgm" - ] - }, - "text/slim": { - "extensions": [ - "slim", - "slm" - ] - }, - "text/stylus": { - "extensions": [ - "stylus", - "styl" - ] - }, - "text/t140": { - "source": "iana" - }, - "text/tab-separated-values": { - "source": "iana", - "compressible": true, - "extensions": [ - "tsv" - ] - }, - "text/troff": { - "source": "iana", - "extensions": [ - "t", - "tr", - "roff", - "man", - "me", - "ms" - ] - }, - "text/turtle": { - "source": "iana", - "extensions": [ - "ttl" - ] - }, - "text/ulpfec": { - "source": "iana" - }, - "text/uri-list": { - "source": "iana", - "compressible": true, - "extensions": [ - "uri", - "uris", - "urls" - ] - }, - "text/vcard": { - "source": "iana", - "compressible": true, - "extensions": [ - "vcard" - ] - }, - "text/vnd.a": { - "source": "iana" - }, - "text/vnd.abc": { - "source": "iana" - }, - "text/vnd.ascii-art": { - "source": "iana" - }, - "text/vnd.curl": { - "source": "iana", - "extensions": [ - "curl" - ] - }, - "text/vnd.curl.dcurl": { - "source": "apache", - "extensions": [ - "dcurl" - ] - }, - "text/vnd.curl.mcurl": { - "source": "apache", - "extensions": [ - "mcurl" - ] - }, - "text/vnd.curl.scurl": { - "source": "apache", - "extensions": [ - "scurl" - ] - }, - "text/vnd.debian.copyright": { - "source": "iana" - }, - "text/vnd.dmclientscript": { - "source": "iana" - }, - "text/vnd.dvb.subtitle": { - "source": "iana", - "extensions": [ - "sub" - ] - }, - "text/vnd.esmertec.theme-descriptor": { - "source": "iana" - }, - "text/vnd.fly": { - "source": "iana", - "extensions": [ - "fly" - ] - }, - "text/vnd.fmi.flexstor": { - "source": "iana", - "extensions": [ - "flx" - ] - }, - "text/vnd.graphviz": { - "source": "iana", - "extensions": [ - "gv" - ] - }, - "text/vnd.in3d.3dml": { - "source": "iana", - "extensions": [ - "3dml" - ] - }, - "text/vnd.in3d.spot": { - "source": "iana", - "extensions": [ - "spot" - ] - }, - "text/vnd.iptc.newsml": { - "source": "iana" - }, - "text/vnd.iptc.nitf": { - "source": "iana" - }, - "text/vnd.latex-z": { - "source": "iana" - }, - "text/vnd.motorola.reflex": { - "source": "iana" - }, - "text/vnd.ms-mediapackage": { - "source": "iana" - }, - "text/vnd.net2phone.commcenter.command": { - "source": "iana" - }, - "text/vnd.radisys.msml-basic-layout": { - "source": "iana" - }, - "text/vnd.si.uricatalogue": { - "source": "iana" - }, - "text/vnd.sun.j2me.app-descriptor": { - "source": "iana", - "extensions": [ - "jad" - ] - }, - "text/vnd.trolltech.linguist": { - "source": "iana" - }, - "text/vnd.wap.si": { - "source": "iana" - }, - "text/vnd.wap.sl": { - "source": "iana" - }, - "text/vnd.wap.wml": { - "source": "iana", - "extensions": [ - "wml" - ] - }, - "text/vnd.wap.wmlscript": { - "source": "iana", - "extensions": [ - "wmls" - ] - }, - "text/vtt": { - "charset": "UTF-8", - "compressible": true, - "extensions": [ - "vtt" - ] - }, - "text/x-asm": { - "source": "apache", - "extensions": [ - "s", - "asm" - ] - }, - "text/x-c": { - "source": "apache", - "extensions": [ - "c", - "cc", - "cxx", - "cpp", - "h", - "hh", - "dic" - ] - }, - "text/x-component": { - "source": "nginx", - "extensions": [ - "htc" - ] - }, - "text/x-fortran": { - "source": "apache", - "extensions": [ - "f", - "for", - "f77", - "f90" - ] - }, - "text/x-gwt-rpc": { - "compressible": true - }, - "text/x-handlebars-template": { - "extensions": [ - "hbs" - ] - }, - "text/x-java-source": { - "source": "apache", - "extensions": [ - "java" - ] - }, - "text/x-jquery-tmpl": { - "compressible": true - }, - "text/x-lua": { - "extensions": [ - "lua" - ] - }, - "text/x-markdown": { - "compressible": true, - "extensions": [ - "markdown", - "md", - "mkd" - ] - }, - "text/x-nfo": { - "source": "apache", - "extensions": [ - "nfo" - ] - }, - "text/x-opml": { - "source": "apache", - "extensions": [ - "opml" - ] - }, - "text/x-pascal": { - "source": "apache", - "extensions": [ - "p", - "pas" - ] - }, - "text/x-processing": { - "compressible": true, - "extensions": [ - "pde" - ] - }, - "text/x-sass": { - "extensions": [ - "sass" - ] - }, - "text/x-scss": { - "extensions": [ - "scss" - ] - }, - "text/x-setext": { - "source": "apache", - "extensions": [ - "etx" - ] - }, - "text/x-sfv": { - "source": "apache", - "extensions": [ - "sfv" - ] - }, - "text/x-suse-ymp": { - "compressible": true, - "extensions": [ - "ymp" - ] - }, - "text/x-uuencode": { - "source": "apache", - "extensions": [ - "uu" - ] - }, - "text/x-vcalendar": { - "source": "apache", - "extensions": [ - "vcs" - ] - }, - "text/x-vcard": { - "source": "apache", - "extensions": [ - "vcf" - ] - }, - "text/xml": { - "source": "iana", - "compressible": true, - "extensions": [ - "xml" - ] - }, - "text/xml-external-parsed-entity": { - "source": "iana" - }, - "text/yaml": { - "extensions": [ - "yaml", - "yml" - ] - }, - "video/1d-interleaved-parityfec": { - "source": "apache" - }, - "video/3gpp": { - "source": "apache", - "extensions": [ - "3gp", - "3gpp" - ] - }, - "video/3gpp-tt": { - "source": "apache" - }, - "video/3gpp2": { - "source": "apache", - "extensions": [ - "3g2" - ] - }, - "video/bmpeg": { - "source": "apache" - }, - "video/bt656": { - "source": "apache" - }, - "video/celb": { - "source": "apache" - }, - "video/dv": { - "source": "apache" - }, - "video/encaprtp": { - "source": "apache" - }, - "video/h261": { - "source": "apache", - "extensions": [ - "h261" - ] - }, - "video/h263": { - "source": "apache", - "extensions": [ - "h263" - ] - }, - "video/h263-1998": { - "source": "apache" - }, - "video/h263-2000": { - "source": "apache" - }, - "video/h264": { - "source": "apache", - "extensions": [ - "h264" - ] - }, - "video/h264-rcdo": { - "source": "apache" - }, - "video/h264-svc": { - "source": "apache" - }, - "video/h265": { - "source": "apache" - }, - "video/iso.segment": { - "source": "apache" - }, - "video/jpeg": { - "source": "apache", - "extensions": [ - "jpgv" - ] - }, - "video/jpeg2000": { - "source": "apache" - }, - "video/jpm": { - "source": "apache", - "extensions": [ - "jpm", - "jpgm" - ] - }, - "video/mj2": { - "source": "apache", - "extensions": [ - "mj2", - "mjp2" - ] - }, - "video/mp1s": { - "source": "apache" - }, - "video/mp2p": { - "source": "apache" - }, - "video/mp2t": { - "source": "apache", - "extensions": [ - "ts" - ] - }, - "video/mp4": { - "source": "apache", - "compressible": false, - "extensions": [ - "mp4", - "mp4v", - "mpg4" - ] - }, - "video/mp4v-es": { - "source": "apache" - }, - "video/mpeg": { - "source": "apache", - "compressible": false, - "extensions": [ - "mpeg", - "mpg", - "mpe", - "m1v", - "m2v" - ] - }, - "video/mpeg4-generic": { - "source": "apache" - }, - "video/mpv": { - "source": "apache" - }, - "video/nv": { - "source": "apache" - }, - "video/ogg": { - "source": "apache", - "compressible": false, - "extensions": [ - "ogv" - ] - }, - "video/parityfec": { - "source": "apache" - }, - "video/pointer": { - "source": "apache" - }, - "video/quicktime": { - "source": "apache", - "compressible": false, - "extensions": [ - "qt", - "mov" - ] - }, - "video/raptorfec": { - "source": "apache" - }, - "video/raw": { - "source": "apache" - }, - "video/rtp-enc-aescm128": { - "source": "apache" - }, - "video/rtploopback": { - "source": "apache" - }, - "video/rtx": { - "source": "apache" - }, - "video/smpte292m": { - "source": "apache" - }, - "video/ulpfec": { - "source": "apache" - }, - "video/vc1": { - "source": "apache" - }, - "video/vnd.cctv": { - "source": "apache" - }, - "video/vnd.dece.hd": { - "source": "apache", - "extensions": [ - "uvh", - "uvvh" - ] - }, - "video/vnd.dece.mobile": { - "source": "apache", - "extensions": [ - "uvm", - "uvvm" - ] - }, - "video/vnd.dece.mp4": { - "source": "apache" - }, - "video/vnd.dece.pd": { - "source": "apache", - "extensions": [ - "uvp", - "uvvp" - ] - }, - "video/vnd.dece.sd": { - "source": "apache", - "extensions": [ - "uvs", - "uvvs" - ] - }, - "video/vnd.dece.video": { - "source": "apache", - "extensions": [ - "uvv", - "uvvv" - ] - }, - "video/vnd.directv.mpeg": { - "source": "apache" - }, - "video/vnd.directv.mpeg-tts": { - "source": "apache" - }, - "video/vnd.dlna.mpeg-tts": { - "source": "apache" - }, - "video/vnd.dvb.file": { - "source": "apache", - "extensions": [ - "dvb" - ] - }, - "video/vnd.fvt": { - "source": "apache", - "extensions": [ - "fvt" - ] - }, - "video/vnd.hns.video": { - "source": "apache" - }, - "video/vnd.iptvforum.1dparityfec-1010": { - "source": "apache" - }, - "video/vnd.iptvforum.1dparityfec-2005": { - "source": "apache" - }, - "video/vnd.iptvforum.2dparityfec-1010": { - "source": "apache" - }, - "video/vnd.iptvforum.2dparityfec-2005": { - "source": "apache" - }, - "video/vnd.iptvforum.ttsavc": { - "source": "apache" - }, - "video/vnd.iptvforum.ttsmpeg2": { - "source": "apache" - }, - "video/vnd.motorola.video": { - "source": "apache" - }, - "video/vnd.motorola.videop": { - "source": "apache" - }, - "video/vnd.mpegurl": { - "source": "apache", - "extensions": [ - "mxu", - "m4u" - ] - }, - "video/vnd.ms-playready.media.pyv": { - "source": "apache", - "extensions": [ - "pyv" - ] - }, - "video/vnd.nokia.interleaved-multimedia": { - "source": "apache" - }, - "video/vnd.nokia.videovoip": { - "source": "apache" - }, - "video/vnd.objectvideo": { - "source": "apache" - }, - "video/vnd.radgamettools.bink": { - "source": "apache" - }, - "video/vnd.radgamettools.smacker": { - "source": "apache" - }, - "video/vnd.sealed.mpeg1": { - "source": "apache" - }, - "video/vnd.sealed.mpeg4": { - "source": "apache" - }, - "video/vnd.sealed.swf": { - "source": "apache" - }, - "video/vnd.sealedmedia.softseal.mov": { - "source": "apache" - }, - "video/vnd.uvvu.mp4": { - "source": "apache", - "extensions": [ - "uvu", - "uvvu" - ] - }, - "video/vnd.vivo": { - "source": "apache", - "extensions": [ - "viv" - ] - }, - "video/vp8": { - "source": "apache" - }, - "video/webm": { - "source": "apache", - "compressible": false, - "extensions": [ - "webm" - ] - }, - "video/x-f4v": { - "source": "apache", - "extensions": [ - "f4v" - ] - }, - "video/x-fli": { - "source": "apache", - "extensions": [ - "fli" - ] - }, - "video/x-flv": { - "source": "apache", - "compressible": false, - "extensions": [ - "flv" - ] - }, - "video/x-m4v": { - "source": "apache", - "extensions": [ - "m4v" - ] - }, - "video/x-matroska": { - "source": "apache", - "compressible": false, - "extensions": [ - "mkv", - "mk3d", - "mks" - ] - }, - "video/x-mng": { - "source": "apache", - "extensions": [ - "mng" - ] - }, - "video/x-ms-asf": { - "source": "apache", - "extensions": [ - "asf", - "asx" - ] - }, - "video/x-ms-vob": { - "source": "apache", - "extensions": [ - "vob" - ] - }, - "video/x-ms-wm": { - "source": "apache", - "extensions": [ - "wm" - ] - }, - "video/x-ms-wmv": { - "source": "apache", - "compressible": false, - "extensions": [ - "wmv" - ] - }, - "video/x-ms-wmx": { - "source": "apache", - "extensions": [ - "wmx" - ] - }, - "video/x-ms-wvx": { - "source": "apache", - "extensions": [ - "wvx" - ] - }, - "video/x-msvideo": { - "source": "apache", - "extensions": [ - "avi" - ] - }, - "video/x-sgi-movie": { - "source": "apache", - "extensions": [ - "movie" - ] - }, - "video/x-smv": { - "source": "apache", - "extensions": [ - "smv" - ] - }, - "x-conference/x-cooltalk": { - "source": "apache", - "extensions": [ - "ice" - ] - }, - "x-shader/x-fragment": { - "compressible": true - }, - "x-shader/x-vertex": { - "compressible": true - } -}; /***/ }), -/* 588 */ +/* 756 */ +/***/ (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; +}; + + +/***/ }), +/* 757 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * braces + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT license. + */ + + + +/** + * Module dependencies + */ + +var expand = __webpack_require__(640); +var repeat = __webpack_require__(411); +var tokens = __webpack_require__(778); + +/** + * Expose `braces` + */ + +module.exports = function(str, options) { + if (typeof str !== 'string') { + throw new Error('braces expects a string'); + } + return braces(str, options); +}; + +/** + * Expand `{foo,bar}` or `{1..5}` braces in the + * given `string`. + * + * @param {String} `str` + * @param {Array} `arr` + * @param {Object} `options` + * @return {Array} + */ + +function braces(str, arr, options) { + if (str === '') { + return []; + } + + if (!Array.isArray(arr)) { + options = arr; + arr = []; + } + + var opts = options || {}; + arr = arr || []; + + if (typeof opts.nodupes === 'undefined') { + opts.nodupes = true; + } + + var fn = opts.fn; + var es6; + + if (typeof opts === 'function') { + fn = opts; + opts = {}; + } + + if (!(patternRe instanceof RegExp)) { + patternRe = patternRegex(); + } + + var matches = str.match(patternRe) || []; + var m = matches[0]; + + switch(m) { + case '\\,': + return escapeCommas(str, arr, opts); + case '\\.': + return escapeDots(str, arr, opts); + case '\/.': + return escapePaths(str, arr, opts); + case ' ': + return splitWhitespace(str); + case '{,}': + return exponential(str, opts, braces); + case '{}': + return emptyBraces(str, arr, opts); + case '\\{': + case '\\}': + return escapeBraces(str, arr, opts); + case '${': + if (!/\{[^{]+\{/.test(str)) { + return arr.concat(str); + } else { + es6 = true; + str = tokens.before(str, es6Regex()); + } + } + + if (!(braceRe instanceof RegExp)) { + braceRe = braceRegex(); + } + + var match = braceRe.exec(str); + if (match == null) { + return [str]; + } + + var outter = match[1]; + var inner = match[2]; + if (inner === '') { return [str]; } + + var segs, segsLength; + + if (inner.indexOf('..') !== -1) { + segs = expand(inner, opts, fn) || inner.split(','); + segsLength = segs.length; + + } else if (inner[0] === '"' || inner[0] === '\'') { + return arr.concat(str.split(/['"]/).join('')); + + } else { + segs = inner.split(','); + if (opts.makeRe) { + return braces(str.replace(outter, wrap(segs, '|')), opts); + } + + segsLength = segs.length; + if (segsLength === 1 && opts.bash) { + segs[0] = wrap(segs[0], '\\'); + } + } + + var len = segs.length; + var i = 0, val; + + while (len--) { + var path = segs[i++]; + + if (/(\.[^.\/])/.test(path)) { + if (segsLength > 1) { + return segs; + } else { + return [str]; + } + } + + val = splice(str, outter, path); + + if (/\{[^{}]+?\}/.test(val)) { + arr = braces(val, arr, opts); + } else if (val !== '') { + if (opts.nodupes && arr.indexOf(val) !== -1) { continue; } + arr.push(es6 ? tokens.after(val) : val); + } + } + + if (opts.strict) { return filter(arr, filterEmpty); } + return arr; +} + +/** + * Expand exponential ranges + * + * `a{,}{,}` => ['a', 'a', 'a', 'a'] + */ + +function exponential(str, options, fn) { + if (typeof options === 'function') { + fn = options; + options = null; + } + + var opts = options || {}; + var esc = '__ESC_EXP__'; + var exp = 0; + var res; + + var parts = str.split('{,}'); + if (opts.nodupes) { + return fn(parts.join(''), opts); + } + + exp = parts.length - 1; + res = fn(parts.join(esc), opts); + var len = res.length; + var arr = []; + var i = 0; + + while (len--) { + var ele = res[i++]; + var idx = ele.indexOf(esc); + + if (idx === -1) { + arr.push(ele); + + } else { + ele = ele.split('__ESC_EXP__').join(''); + if (!!ele && opts.nodupes !== false) { + arr.push(ele); + + } else { + var num = Math.pow(2, exp); + arr.push.apply(arr, repeat(ele, num)); + } + } + } + return arr; +} + +/** + * Wrap a value with parens, brackets or braces, + * based on the given character/separator. + * + * @param {String|Array} `val` + * @param {String} `ch` + * @return {String} + */ + +function wrap(val, ch) { + if (ch === '|') { + return '(' + val.join(ch) + ')'; + } + if (ch === ',') { + return '{' + val.join(ch) + '}'; + } + if (ch === '-') { + return '[' + val.join(ch) + ']'; + } + if (ch === '\\') { + return '\\{' + val + '\\}'; + } +} + +/** + * Handle empty braces: `{}` + */ + +function emptyBraces(str, arr, opts) { + return braces(str.split('{}').join('\\{\\}'), arr, opts); +} + +/** + * Filter out empty-ish values + */ + +function filterEmpty(ele) { + return !!ele && ele !== '\\'; +} + +/** + * Handle patterns with whitespace + */ + +function splitWhitespace(str) { + var segs = str.split(' '); + var len = segs.length; + var res = []; + var i = 0; + + while (len--) { + res.push.apply(res, braces(segs[i++])); + } + return res; +} + +/** + * Handle escaped braces: `\\{foo,bar}` + */ + +function escapeBraces(str, arr, opts) { + if (!/\{[^{]+\{/.test(str)) { + return arr.concat(str.split('\\').join('')); + } else { + str = str.split('\\{').join('__LT_BRACE__'); + str = str.split('\\}').join('__RT_BRACE__'); + return map(braces(str, arr, opts), function(ele) { + ele = ele.split('__LT_BRACE__').join('{'); + return ele.split('__RT_BRACE__').join('}'); + }); + } +} + +/** + * Handle escaped dots: `{1\\.2}` + */ + +function escapeDots(str, arr, opts) { + if (!/[^\\]\..+\\\./.test(str)) { + return arr.concat(str.split('\\').join('')); + } else { + str = str.split('\\.').join('__ESC_DOT__'); + return map(braces(str, arr, opts), function(ele) { + return ele.split('__ESC_DOT__').join('.'); + }); + } +} + +/** + * Handle escaped dots: `{1\\.2}` + */ + +function escapePaths(str, arr, opts) { + str = str.split('\/.').join('__ESC_PATH__'); + return map(braces(str, arr, opts), function(ele) { + return ele.split('__ESC_PATH__').join('\/.'); + }); +} + +/** + * Handle escaped commas: `{a\\,b}` + */ + +function escapeCommas(str, arr, opts) { + if (!/\w,/.test(str)) { + return arr.concat(str.split('\\').join('')); + } else { + str = str.split('\\,').join('__ESC_COMMA__'); + return map(braces(str, arr, opts), function(ele) { + return ele.split('__ESC_COMMA__').join(','); + }); + } +} + +/** + * Regex for common patterns + */ + +function patternRegex() { + return /\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\,(?=.*[{}])|\/\.(?=.*[{}])|\\\.(?={)|\\{|\\}/; +} + +/** + * Braces regex. + */ + +function braceRegex() { + return /.*(\\?\{([^}]+)\})/; +} + +/** + * es6 delimiter regex. + */ + +function es6Regex() { + return /\$\{([^}]+)\}/; +} + +var braceRe; +var patternRe; + +/** + * Faster alternative to `String.replace()` when the + * index of the token to be replaces can't be supplied + */ + +function splice(str, token, replacement) { + var i = str.indexOf(token); + return str.substr(0, i) + replacement + + str.substr(i + token.length); +} + +/** + * Fast array map + */ + +function map(arr, fn) { + if (arr == null) { + return []; + } + + var len = arr.length; + var res = new Array(len); + var i = -1; + + while (++i < len) { + res[i] = fn(arr[i], i, arr); + } + + return res; +} + +/** + * Fast array filter + */ + +function filter(arr, cb) { + if (arr == null) return []; + if (typeof cb !== 'function') { + throw new TypeError('braces: filter expects a callback function.'); + } + + var len = arr.length; + var res = arr.slice(); + var i = 0; + + while (len--) { + if (!cb(arr[len], i++)) { + res.splice(len, 1); + } + } + return res; +} + + +/***/ }), +/* 758 */ +/***/ (function(module, exports) { + +module.exports = {"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/cbor":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["ecma","es"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true},"application/fhir+json":{"source":"iana","compressible":true},"application/fhir+xml":{"source":"iana","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mmt-usd+xml":{"source":"iana","compressible":true},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","compressible":true},"application/msc-mixer+xml":{"source":"iana","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana"},"application/n-triples":{"source":"iana"},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana"},"application/news-groupinfo":{"source":"iana"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana"},"application/nss":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p2p-overlay+xml":{"source":"iana","compressible":true},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana"},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","compressible":true},"application/pidf-diff+xml":{"source":"iana","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true},"application/route-s-tsid+xml":{"source":"iana","compressible":true},"application/route-usd+xml":{"source":"iana","compressible":true},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana"},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana"},"application/ttml+xml":{"source":"iana","compressible":true},"application/tve-trigger":{"source":"iana"},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true},"application/urc-targetdesc+xml":{"source":"iana","compressible":true},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume-movie":{"source":"iana"},"application/vnd.desmume.movie":{"source":"apache"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana"},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos+xml":{"source":"iana","compressible":true},"application/vnd.paos.xml":{"source":"apache"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana"},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","compressible":true},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"apache","extensions":["der","crt","pem"]},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true},"application/xcap-caps+xml":{"source":"iana","compressible":true},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana"},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana"},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana"},"image/apng":{"compressible":false,"extensions":["apng"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana"},"image/emf":{"source":"iana"},"image/fits":{"source":"iana"},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana"},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana"},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana"},"image/tiff":{"source":"iana","compressible":false,"extensions":["tiff","tif"]},"image/tiff-fx":{"source":"iana"},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana"},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana"},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana"},"image/vnd.valve.source.texture":{"source":"iana"},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana"},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana"},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/stl":{"source":"iana"},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana"},"model/vnd.parasolid.transmit.binary":{"source":"iana"},"model/vnd.parasolid.transmit.text":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.usdz+zip":{"source":"iana","compressible":false},"model/vnd.valve.source.compiled-map":{"source":"iana"},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana"},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana"},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana","compressible":false},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shex":{"extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana"},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vp8":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}} + +/***/ }), +/* 759 */ /***/ (function(module, exports, __webpack_require__) { /*! @@ -115776,11 +127940,11 @@ module.exports = { * Module exports. */ -module.exports = __webpack_require__(587) +module.exports = __webpack_require__(758) /***/ }), -/* 589 */ +/* 760 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -115790,22 +127954,115 @@ module.exports = (to, from) => { for (const prop of Object.getOwnPropertyNames(from).concat(Object.getOwnPropertySymbols(from))) { Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); } + + return to; }; /***/ }), -/* 590 */ +/* 761 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +const mkdirp = __webpack_require__(145) + +module.exports = function (dir, opts) { + return new Promise((resolve, reject) => { + mkdirp(dir, opts, (err, made) => err === null ? resolve(made) : reject(err)) + }) +} + + +/***/ }), +/* 762 */ +/***/ (function(module, exports, __webpack_require__) { + + +var Promise = __webpack_require__(345) +var fs +try { + fs = __webpack_require__(391) +} catch(err) { + fs = __webpack_require__(5) +} + +var api = [ + 'appendFile', + 'chmod', + 'chown', + 'close', + 'fchmod', + 'fchown', + 'fdatasync', + 'fstat', + 'fsync', + 'ftruncate', + 'futimes', + 'lchown', + 'link', + 'lstat', + 'mkdir', + 'open', + 'read', + 'readFile', + 'readdir', + 'readlink', + 'realpath', + 'rename', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'write', + 'writeFile' +] + +typeof fs.access === 'function' && api.push('access') +typeof fs.copyFile === 'function' && api.push('copyFile') +typeof fs.mkdtemp === 'function' && api.push('mkdtemp') + +__webpack_require__(951).withCallback(fs, exports, api) + +exports.exists = function (filename, callback) { + // callback + if (typeof callback === 'function') { + return fs.stat(filename, function (err) { + callback(null, !err); + }) + } + // or promise + return new Promise(function (resolve) { + fs.stat(filename, function (err) { + resolve(!err) + }) + }) +} + + +/***/ }), +/* 763 */ /***/ (function(module, exports, __webpack_require__) { /*jslint node: true*/ -__webpack_require__(654); +var toArray = __webpack_require__(750); +var emojiByName = __webpack_require__(764); "use strict"; /** * regex to parse emoji in a string - finds emoji, e.g. :coffee: */ -var parser = /:([a-zA-Z0-9_\-\+]+):/g; +var emojiNameRegex = /:([a-zA-Z0-9_\-\+]+):/g; + +/** + * regex to trim whitespace + * use instead of String.prototype.trim() for IE8 supprt + */ +var trimSpaceRegex = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; /** * Removes colons on either side @@ -115813,25 +128070,68 @@ var parser = /:([a-zA-Z0-9_\-\+]+):/g; * @param {string} str * @return {string} */ -var trim = function(str) { +function stripColons (str) { var colonIndex = str.indexOf(':'); if (colonIndex > -1) { // :emoji: (http://www.emoji-cheat-sheet.com/) if (colonIndex === str.length - 1) { str = str.substring(0, colonIndex); - return trim(str); + return stripColons(str); } else { str = str.substr(colonIndex + 1); - return trim(str); + return stripColons(str); } } + return str; } + +/** + * Adds colons to either side + * of the string + * @param {string} str + * @return {string} + */ +function wrapColons (str) { + return (typeof str === 'string' && str.length > 0) ? ':' + str + ':' : str; +} + +/** + * Ensure that the word is wrapped in colons + * by only adding them, if they are not there. + * @param {string} str + * @return {string} + */ +function ensureColons (str) { + return (typeof str === 'string' && str[0] !== ':') ? wrapColons(str) : str; +} + +// Non spacing mark, some emoticons have them. It's the 'Variant Form', +// which provides more information so that emoticons can be rendered as +// more colorful graphics. FE0E is a unicode text version, where as FE0F +// should be rendered as a graphical version. The code gracefully degrades. +var NON_SPACING_MARK = String.fromCharCode(65039); // 65039 - 'ī¸' - 0xFE0F; +var nonSpacingRegex = new RegExp(NON_SPACING_MARK, 'g') + +// Remove the non-spacing-mark from the code, never send a stripped version +// to the client, as it kills graphical emoticons. +function stripNSB (code) { + return code.replace(nonSpacingRegex, ''); +}; + +// Reversed hash table, where as emojiByName contains a { heart: '❤' } +// dictionary emojiByCode contains { ❤: 'heart' }. The codes are normalized +// to the text version. +var emojiByCode = Object.keys(emojiByName).reduce(function(h,k) { + h[stripNSB(emojiByName[k])] = k; + return h; +}, {}); + /** * Emoji namespace */ -var Emoji = module.exports = { - emoji: __webpack_require__(591) +var Emoji = { + emoji: emojiByName, }; /** @@ -115839,11 +128139,12 @@ var Emoji = module.exports = { * @param {string} emoji * @return {string} */ -Emoji._get = function _get(emoji) { - if (Emoji.emoji.hasOwnProperty(emoji)) { - return Emoji.emoji[emoji]; +Emoji._get = function _get (emoji) { + if (emojiByName.hasOwnProperty(emoji)) { + return emojiByName[emoji]; } - return ':' + emoji + ':'; + + return ensureColons(emoji); }; /** @@ -115851,44 +128152,114 @@ Emoji._get = function _get(emoji) { * @param {string} emoji * @return {string} */ -Emoji.get = function get(emoji) { - emoji = trim(emoji); +Emoji.get = function get (emoji) { + emoji = stripColons(emoji); return Emoji._get(emoji); }; +/** + * find the emoji by either code or name + * @param {string} nameOrCode The emoji to find, either `coffee`, `:coffee:` or `☕`; + * @return {object} + */ +Emoji.find = function find (nameOrCode) { + return Emoji.findByName(nameOrCode) || Emoji.findByCode(nameOrCode); +}; + +/** + * find the emoji by name + * @param {string} name The emoji to find either `coffee` or `:coffee:`; + * @return {object} + */ +Emoji.findByName = function findByName (name) { + var stripped = stripColons(name); + var emoji = emojiByName[stripped]; + + return emoji ? ({ emoji: emoji, key: stripped }) : undefined; +}; + +/** + * find the emoji by code (emoji) + * @param {string} code The emoji to find; for example `☕` or `☔` + * @return {object} + */ +Emoji.findByCode = function findByCode (code) { + var stripped = stripNSB(code); + var name = emojiByCode[stripped]; + + // lookup emoji to ensure the Variant Form is returned + return name ? ({ emoji: emojiByName[name], key: name }) : undefined; +}; + + +/** + * Check if an emoji is known by this library + * @param {string} nameOrCode The emoji to validate, either `coffee`, `:coffee:` or `☕`; + * @return {object} + */ +Emoji.hasEmoji = function hasEmoji (nameOrCode) { + return Emoji.hasEmojiByName(nameOrCode) || Emoji.hasEmojiByCode(nameOrCode); +}; + +/** + * Check if an emoji with given name is known by this library + * @param {string} name The emoji to validate either `coffee` or `:coffee:`; + * @return {object} + */ +Emoji.hasEmojiByName = function hasEmojiByName (name) { + var result = Emoji.findByName(name); + return !!result && result.key === stripColons(name); +}; + +/** + * Check if a given emoji is known by this library + * @param {string} code The emoji to validate; for example `☕` or `☔` + * @return {object} + */ +Emoji.hasEmojiByCode = function hasEmojiByCode (code) { + var result = Emoji.findByCode(code); + return !!result && stripNSB(result.emoji) === stripNSB(code); +}; + /** * get emoji name from code - * @param {string} emoji_code + * @param {string} emoji + * @param {boolean} includeColons should the result include the :: * @return {string} */ -Emoji.which = function which(emoji_code) { - for (var prop in Emoji.emoji) { - if (Emoji.emoji.hasOwnProperty(prop)) { - if (Emoji.emoji[prop].codePointAt() === emoji_code.codePointAt()) { - return prop; - } - } - } +Emoji.which = function which (emoji_code, includeColons) { + var code = stripNSB(emoji_code); + var word = emojiByCode[code]; + + return includeColons ? wrapColons(word) : word; }; /** * emojify a string (replace :emoji: with an emoji) * @param {string} str * @param {function} on_missing (gets emoji name without :: and returns a proper emoji if no emoji was found) + * @param {function} format (wrap the returned emoji in a custom element) * @return {string} */ -Emoji.emojify = function emojify(str, on_missing) { +Emoji.emojify = function emojify (str, on_missing, format) { if (!str) return ''; - return str.split(parser) // parse emoji via regex + return str.split(emojiNameRegex) // parse emoji via regex .map(function parseEmoji(s, i) { // every second element is an emoji, e.g. "test :fast_forward:" -> [ "test ", "fast_forward" ] if (i % 2 === 0) return s; var emoji = Emoji._get(s); - if (emoji.indexOf(':') > -1 && typeof on_missing === 'function') { - return on_missing(emoji.substr(1, emoji.length-2)); + var isMissing = emoji.indexOf(':') > -1; + + if (isMissing && typeof on_missing === 'function') { + return on_missing(s); } + + if (!isMissing && typeof format === 'function') { + return format(emoji, s); + } + return emoji; }) .join('') // convert back to string @@ -115899,12 +128270,12 @@ Emoji.emojify = function emojify(str, on_missing) { * return a random emoji * @return {string} */ -Emoji.random = function random() { - var emojiKeys = Object.keys(Emoji.emoji); +Emoji.random = function random () { + var emojiKeys = Object.keys(emojiByName); var randomIndex = Math.floor(Math.random() * emojiKeys.length); var key = emojiKeys[randomIndex]; var emoji = Emoji._get(key); - return {key: key, emoji: emoji}; + return { key: key, emoji: emoji }; } /** @@ -115912,9 +128283,9 @@ Emoji.random = function random() { * @param {string} str * @return {Array.} */ -Emoji.search = function search(str) { - var emojiKeys = Object.keys(Emoji.emoji); - var matcher = trim(str) +Emoji.search = function search (str) { + var emojiKeys = Object.keys(emojiByName); + var matcher = stripColons(str) var matchingKeys = emojiKeys.filter(function(key) { return key.toString().indexOf(matcher) === 0; }); @@ -115926,1357 +128297,67 @@ Emoji.search = function search(str) { }); } +/** + * unemojify a string (replace emoji with :emoji:) + * @param {string} str + * @return {string} + */ +Emoji.unemojify = function unemojify (str) { + if (!str) return ''; + var words = toArray(str); -/***/ }), -/* 591 */ -/***/ (function(module, exports) { - -module.exports = { - "100": "đŸ’¯", - "1234": "đŸ”ĸ", - "interrobang": "â‰ī¸", - "tm": "â„ĸī¸", - "information_source": "â„šī¸", - "left_right_arrow": "â†”ī¸", - "arrow_up_down": "â†•ī¸", - "arrow_upper_left": "â†–ī¸", - "arrow_upper_right": "â†—ī¸", - "arrow_lower_right": "â†˜ī¸", - "arrow_lower_left": "â†™ī¸", - "keyboard": "⌨", - "sunny": "â˜€ī¸", - "cloud": "â˜ī¸", - "umbrella": "â˜”ī¸", - "showman": "☃", - "comet": "☄", - "ballot_box_with_check": "â˜‘ī¸", - "coffee": "â˜•ī¸", - "shamrock": "☘", - "skull_and_crossbones": "☠", - "radioactive_sign": "â˜ĸ", - "biohazard_sign": "â˜Ŗ", - "orthodox_cross": "â˜Ļ", - "wheel_of_dharma": "☸", - "white_frowning_face": "☚", - "aries": "â™ˆī¸", - "taurus": "â™‰ī¸", - "sagittarius": "â™ī¸", - "capricorn": "â™‘ī¸", - "aquarius": "â™’ī¸", - "pisces": "â™“ī¸", - "spades": "â™ ī¸", - "clubs": "â™Ŗī¸", - "hearts": "â™Ĩī¸", - "diamonds": "â™Ļī¸", - "hotsprings": "â™¨ī¸", - "hammer_and_pick": "⚒", - "anchor": "âš“ī¸", - "crossed_swords": "⚔", - "scales": "⚖", - "alembic": "⚗", - "gear": "⚙", - "scissors": "âœ‚ī¸", - "white_check_mark": "✅", - "airplane": "âœˆī¸", - "email": "âœ‰ī¸", - "envelope": "âœ‰ī¸", - "black_nib": "âœ’ī¸", - "heavy_check_mark": "âœ”ī¸", - "heavy_multiplication_x": "âœ–ī¸", - "star_of_david": "✡", - "sparkles": "✨", - "eight_spoked_asterisk": "âœŗī¸", - "eight_pointed_black_star": "âœ´ī¸", - "snowflake": "â„ī¸", - "sparkle": "â‡ī¸", - "question": "❓", - "grey_question": "❔", - "grey_exclamation": "❕", - "exclamation": "â—ī¸", - "heavy_exclamation_mark": "â—ī¸", - "heavy_heart_exclamation_mark_ornament": "âŖ", - "heart": "â¤ī¸", - "heavy_plus_sign": "➕", - "heavy_minus_sign": "➖", - "heavy_division_sign": "➗", - "arrow_heading_up": "â¤´ī¸", - "arrow_heading_down": "â¤ĩī¸", - "wavy_dash": "ã€°ī¸", - "congratulations": "ãŠ—ī¸", - "secret": "ãŠ™ī¸", - "copyright": "ÂŠī¸", - "registered": "ÂŽī¸", - "bangbang": "â€ŧī¸", - "leftwards_arrow_with_hook": "â†Šī¸", - "arrow_right_hook": "â†Ēī¸", - "watch": "âŒšī¸", - "hourglass": "âŒ›ī¸", - "fast_forward": "⏊", - "rewind": "âĒ", - "arrow_double_up": "âĢ", - "arrow_double_down": "âŦ", - "black_right_pointing_double_triangle_with_vertical_bar": "⏭", - "black_left_pointing_double_triangle_with_vertical_bar": "⏎", - "black_right_pointing_triangle_with_double_vertical_bar": "⏯", - "alarm_clock": "⏰", - "stopwatch": "⏱", - "timer_clock": "⏲", - "hourglass_flowing_sand": "âŗ", - "double_vertical_bar": "⏸", - "black_square_for_stop": "⏚", - "black_circle_for_record": "âē", - "m": "â“‚ī¸", - "black_small_square": "â–Ēī¸", - "white_small_square": "â–Ģī¸", - "arrow_forward": "â–ļī¸", - "arrow_backward": "â—€ī¸", - "white_medium_square": "â—ģī¸", - "black_medium_square": "â—ŧī¸", - "white_medium_small_square": "â—Ŋī¸", - "black_medium_small_square": "â—žī¸", - "phone": "â˜Žī¸", - "telephone": "â˜Žī¸", - "point_up": "â˜ī¸", - "star_and_crescent": "â˜Ē", - "peace_symbol": "☎", - "yin_yang": "☯", - "relaxed": "â˜ēī¸", - "gemini": "â™Šī¸", - "cancer": "â™‹ī¸", - "leo": "â™Œī¸", - "virgo": "â™ī¸", - "libra": "â™Žī¸", - "scorpius": "â™ī¸", - "recycle": "â™ģī¸", - "wheelchair": "â™ŋī¸", - "atom_symbol": "⚛", - "fleur_de_lis": "⚜", - "warning": "âš ī¸", - "zap": "âšĄī¸", - "white_circle": "âšĒī¸", - "black_circle": "âšĢī¸", - "coffin": "⚰", - "funeral_urn": "⚱", - "soccer": "âšŊī¸", - "baseball": "âšžī¸", - "snowman": "â›„ī¸", - "partly_sunny": "â›…ī¸", - "thunder_cloud_and_rain": "⛈", - "ophiuchus": "⛎", - "pick": "⛏", - "helmet_with_white_cross": "⛑", - "chains": "⛓", - "no_entry": "â›”ī¸", - "shinto_shrine": "⛩", - "church": "â›Ēī¸", - "mountain": "⛰", - "umbrella_on_ground": "⛱", - "fountain": "â›˛ī¸", - "golf": "â›ŗī¸", - "ferry": "⛴", - "boat": "â›ĩī¸", - "sailboat": "â›ĩī¸", - "skier": "⛷", - "ice_skate": "⛸", - "person_with_ball": "⛹", - "tent": "â›ēī¸", - "fuelpump": "â›Ŋī¸", - "fist": "✊", - "hand": "✋", - "raised_hand": "✋", - "v": "âœŒī¸", - "writing_hand": "✍", - "pencil2": "âœī¸", - "latin_cross": "✝", - "x": "❌", - "negative_squared_cross_mark": "❎", - "arrow_right": "âžĄī¸", - "curly_loop": "➰", - "loop": "âžŋ", - "arrow_left": "âŦ…ī¸", - "arrow_up": "âŦ†ī¸", - "arrow_down": "âŦ‡ī¸", - "black_large_square": "âŦ›ī¸", - "white_large_square": "âŦœī¸", - "star": "â­ī¸", - "o": "â­•ī¸", - "part_alternation_mark": "ã€Ŋī¸", - "mahjong": "đŸ€„ī¸", - "black_joker": "🃏", - "a": "đŸ…°ī¸", - "b": "đŸ…ąī¸", - "o2": "đŸ…žī¸", - "parking": "đŸ…ŋī¸", - "ab": "🆎", - "cl": "🆑", - "cool": "🆒", - "free": "🆓", - "id": "🆔", - "new": "🆕", - "ng": "🆖", - "ok": "🆗", - "sos": "🆘", - "up": "🆙", - "vs": "🆚", - "koko": "🈁", - "sa": "đŸˆ‚ī¸", - "u7121": "đŸˆšī¸", - "u6307": "đŸˆ¯ī¸", - "u7981": "🈲", - "u7a7a": "đŸˆŗ", - "u5408": "🈴", - "u6e80": "đŸˆĩ", - "u6709": "đŸˆļ", - "u6708": "đŸˆˇī¸", - "u7533": "🈸", - "u5272": "🈹", - "u55b6": "đŸˆē", - "ideograph_advantage": "🉐", - "accept": "🉑", - "cyclone": "🌀", - "foggy": "🌁", - "closed_umbrella": "🌂", - "night_with_stars": "🌃", - "sunrise_over_mountains": "🌄", - "sunrise": "🌅", - "city_sunset": "🌆", - "city_sunrise": "🌇", - "rainbow": "🌈", - "bridge_at_night": "🌉", - "ocean": "🌊", - "volcano": "🌋", - "milky_way": "🌌", - "earth_africa": "🌍", - "earth_americas": "🌎", - "earth_asia": "🌏", - "globe_with_meridians": "🌐", - "new_moon": "🌑", - "waxing_crescent_moon": "🌒", - "first_quarter_moon": "🌓", - "moon": "🌔", - "waxing_gibbous_moon": "🌔", - "full_moon": "🌕", - "waning_gibbous_moon": "🌖", - "last_quarter_moon": "🌗", - "waning_crescent_moon": "🌘", - "crescent_moon": "🌙", - "new_moon_with_face": "🌚", - "first_quarter_moon_with_face": "🌛", - "last_quarter_moon_with_face": "🌜", - "full_moon_with_face": "🌝", - "sun_with_face": "🌞", - "star2": "🌟", - "stars": "🌠", - "thermometer": "🌡", - "mostly_sunny": "🌤", - "sun_small_cloud": "🌤", - "barely_sunny": "đŸŒĨ", - "sun_behind_cloud": "đŸŒĨ", - "partly_sunny_rain": "đŸŒĻ", - "sun_behind_rain_cloud": "đŸŒĻ", - "rain_cloud": "🌧", - "snow_cloud": "🌨", - "lightning": "🌩", - "lightning_cloud": "🌩", - "tornado": "đŸŒĒ", - "tornado_cloud": "đŸŒĒ", - "fog": "đŸŒĢ", - "wind_blowing_face": "đŸŒŦ", - "hotdog": "🌭", - "taco": "🌮", - "burrito": "đŸŒ¯", - "chestnut": "🌰", - "seedling": "🌱", - "evergreen_tree": "🌲", - "deciduous_tree": "đŸŒŗ", - "palm_tree": "🌴", - "cactus": "đŸŒĩ", - "hot_pepper": "đŸŒļ", - "tulip": "🌷", - "cherry_blossom": "🌸", - "rose": "🌹", - "hibiscus": "đŸŒē", - "sunflower": "đŸŒģ", - "blossom": "đŸŒŧ", - "corn": "đŸŒŊ", - "ear_of_rice": "🌾", - "herb": "đŸŒŋ", - "four_leaf_clover": "🍀", - "maple_leaf": "🍁", - "fallen_leaf": "🍂", - "leaves": "🍃", - "mushroom": "🍄", - "tomato": "🍅", - "eggplant": "🍆", - "grapes": "🍇", - "melon": "🍈", - "watermelon": "🍉", - "tangerine": "🍊", - "lemon": "🍋", - "banana": "🍌", - "pineapple": "🍍", - "apple": "🍎", - "green_apple": "🍏", - "pear": "🍐", - "peach": "🍑", - "cherries": "🍒", - "strawberry": "🍓", - "hamburger": "🍔", - "pizza": "🍕", - "meat_on_bone": "🍖", - "poultry_leg": "🍗", - "rice_cracker": "🍘", - "rice_ball": "🍙", - "rice": "🍚", - "curry": "🍛", - "ramen": "🍜", - "spaghetti": "🍝", - "bread": "🍞", - "fries": "🍟", - "sweet_potato": "🍠", - "dango": "🍡", - "oden": "đŸĸ", - "sushi": "đŸŖ", - "fried_shrimp": "🍤", - "fish_cake": "đŸĨ", - "icecream": "đŸĻ", - "shaved_ice": "🍧", - "ice_cream": "🍨", - "doughnut": "🍩", - "cookie": "đŸĒ", - "chocolate_bar": "đŸĢ", - "candy": "đŸŦ", - "lollipop": "🍭", - "custard": "🍮", - "honey_pot": "đŸ¯", - "cake": "🍰", - "bento": "🍱", - "stew": "🍲", - "egg": "đŸŗ", - "fork_and_knife": "🍴", - "tea": "đŸĩ", - "sake": "đŸļ", - "wine_glass": "🍷", - "cocktail": "🍸", - "tropical_drink": "🍹", - "beer": "đŸē", - "beers": "đŸģ", - "baby_bottle": "đŸŧ", - "knife_fork_plate": "đŸŊ", - "champagne": "🍾", - "popcorn": "đŸŋ", - "ribbon": "🎀", - "gift": "🎁", - "birthday": "🎂", - "jack_o_lantern": "🎃", - "christmas_tree": "🎄", - "santa": "🎅", - "fireworks": "🎆", - "sparkler": "🎇", - "balloon": "🎈", - "tada": "🎉", - "confetti_ball": "🎊", - "tanabata_tree": "🎋", - "crossed_flags": "🎌", - "bamboo": "🎍", - "dolls": "🎎", - "flags": "🎏", - "wind_chime": "🎐", - "rice_scene": "🎑", - "school_satchel": "🎒", - "mortar_board": "🎓", - "medal": "🎖", - "reminder_ribbon": "🎗", - "studio_microphone": "🎙", - "level_slider": "🎚", - "control_knobs": "🎛", - "film_frames": "🎞", - "admission_tickets": "🎟", - "carousel_horse": "🎠", - "ferris_wheel": "🎡", - "roller_coaster": "đŸŽĸ", - "fishing_pole_and_fish": "đŸŽŖ", - "microphone": "🎤", - "movie_camera": "đŸŽĨ", - "cinema": "đŸŽĻ", - "headphones": "🎧", - "art": "🎨", - "tophat": "🎩", - "circus_tent": "đŸŽĒ", - "ticket": "đŸŽĢ", - "clapper": "đŸŽŦ", - "performing_arts": "🎭", - "video_game": "🎮", - "dart": "đŸŽ¯", - "slot_machine": "🎰", - "8ball": "🎱", - "game_die": "🎲", - "bowling": "đŸŽŗ", - "flower_playing_cards": "🎴", - "musical_note": "đŸŽĩ", - "notes": "đŸŽļ", - "saxophone": "🎷", - "guitar": "🎸", - "musical_keyboard": "🎹", - "trumpet": "đŸŽē", - "violin": "đŸŽģ", - "musical_score": "đŸŽŧ", - "running_shirt_with_sash": "đŸŽŊ", - "tennis": "🎾", - "ski": "đŸŽŋ", - "basketball": "🏀", - "checkered_flag": "🏁", - "snowboarder": "🏂", - "runner": "🏃", - "running": "🏃", - "surfer": "🏄", - "sports_medal": "🏅", - "trophy": "🏆", - "horse_racing": "🏇", - "football": "🏈", - "rugby_football": "🏉", - "swimmer": "🏊", - "weight_lifter": "🏋", - "golfer": "🏌", - "racing_motorcycle": "🏍", - "racing_car": "🏎", - "cricket_bat_and_ball": "🏏", - "volleyball": "🏐", - "field_hockey_stick_and_ball": "🏑", - "ice_hockey_stick_and_puck": "🏒", - "table_tennis_paddle_and_ball": "🏓", - "snow_capped_mountain": "🏔", - "camping": "🏕", - "beach_with_umbrella": "🏖", - "building_construction": "🏗", - "house_buildings": "🏘", - "cityscape": "🏙", - "derelict_house_building": "🏚", - "classical_building": "🏛", - "desert": "🏜", - "desert_island": "🏝", - "national_park": "🏞", - "stadium": "🏟", - "house": "🏠", - "house_with_garden": "🏡", - "office": "đŸĸ", - "post_office": "đŸŖ", - "european_post_office": "🏤", - "hospital": "đŸĨ", - "bank": "đŸĻ", - "atm": "🏧", - "hotel": "🏨", - "love_hotel": "🏩", - "convenience_store": "đŸĒ", - "school": "đŸĢ", - "department_store": "đŸŦ", - "factory": "🏭", - "izakaya_lantern": "🏮", - "lantern": "🏮", - "japanese_castle": "đŸ¯", - "european_castle": "🏰", - "waving_white_flag": "đŸŗ", - "waving_black_flag": "🏴", - "rosette": "đŸĩ", - "label": "🏷", - "badminton_racquet_and_shuttlecock": "🏸", - "bow_and_arrow": "🏹", - "amphora": "đŸē", - "skin-tone-2": "đŸģ", - "skin-tone-3": "đŸŧ", - "skin-tone-4": "đŸŊ", - "skin-tone-5": "🏾", - "skin-tone-6": "đŸŋ", - "rat": "🐀", - "mouse2": "🐁", - "ox": "🐂", - "water_buffalo": "🐃", - "cow2": "🐄", - "tiger2": "🐅", - "leopard": "🐆", - "rabbit2": "🐇", - "cat2": "🐈", - "dragon": "🐉", - "crocodile": "🐊", - "whale2": "🐋", - "snail": "🐌", - "snake": "🐍", - "racehorse": "🐎", - "ram": "🐏", - "goat": "🐐", - "sheep": "🐑", - "monkey": "🐒", - "rooster": "🐓", - "chicken": "🐔", - "dog2": "🐕", - "pig2": "🐖", - "boar": "🐗", - "elephant": "🐘", - "octopus": "🐙", - "shell": "🐚", - "bug": "🐛", - "ant": "🐜", - "bee": "🐝", - "honeybee": "🐝", - "beetle": "🐞", - "fish": "🐟", - "tropical_fish": "🐠", - "blowfish": "🐡", - "turtle": "đŸĸ", - "hatching_chick": "đŸŖ", - "baby_chick": "🐤", - "hatched_chick": "đŸĨ", - "bird": "đŸĻ", - "penguin": "🐧", - "koala": "🐨", - "poodle": "🐩", - "dromedary_camel": "đŸĒ", - "camel": "đŸĢ", - "dolphin": "đŸŦ", - "flipper": "đŸŦ", - "mouse": "🐭", - "cow": "🐮", - "tiger": "đŸ¯", - "rabbit": "🐰", - "cat": "🐱", - "dragon_face": "🐲", - "whale": "đŸŗ", - "horse": "🐴", - "monkey_face": "đŸĩ", - "dog": "đŸļ", - "pig": "🐷", - "frog": "🐸", - "hamster": "🐹", - "wolf": "đŸē", - "bear": "đŸģ", - "panda_face": "đŸŧ", - "pig_nose": "đŸŊ", - "feet": "🐾", - "paw_prints": "🐾", - "chipmunk": "đŸŋ", - "eyes": "👀", - "eye": "👁", - "ear": "👂", - "nose": "👃", - "lips": "👄", - "tongue": "👅", - "point_up_2": "👆", - "point_down": "👇", - "point_left": "👈", - "point_right": "👉", - "facepunch": "👊", - "punch": "👊", - "wave": "👋", - "ok_hand": "👌", - "+1": "👍", - "thumbsup": "👍", - "-1": "👎", - "thumbsdown": "👎", - "clap": "👏", - "open_hands": "👐", - "crown": "👑", - "womans_hat": "👒", - "eyeglasses": "👓", - "necktie": "👔", - "shirt": "👕", - "tshirt": "👕", - "jeans": "👖", - "dress": "👗", - "kimono": "👘", - "bikini": "👙", - "womans_clothes": "👚", - "purse": "👛", - "handbag": "👜", - "pouch": "👝", - "mans_shoe": "👞", - "shoe": "👞", - "athletic_shoe": "👟", - "high_heel": "👠", - "sandal": "👡", - "boot": "đŸ‘ĸ", - "footprints": "đŸ‘Ŗ", - "bust_in_silhouette": "👤", - "busts_in_silhouette": "đŸ‘Ĩ", - "boy": "đŸ‘Ļ", - "girl": "👧", - "man": "👨", - "woman": "👩", - "family": "👨‍👩‍đŸ‘Ļ", - "man-woman-boy": "👨‍👩‍đŸ‘Ļ", - "couple": "đŸ‘Ģ", - "man_and_woman_holding_hands": "đŸ‘Ģ", - "two_men_holding_hands": "đŸ‘Ŧ", - "two_women_holding_hands": "👭", - "cop": "👮", - "dancers": "đŸ‘¯", - "bride_with_veil": "👰", - "person_with_blond_hair": "👱", - "man_with_gua_pi_mao": "👲", - "man_with_turban": "đŸ‘ŗ", - "older_man": "👴", - "older_woman": "đŸ‘ĩ", - "baby": "đŸ‘ļ", - "construction_worker": "👷", - "princess": "👸", - "japanese_ogre": "👹", - "japanese_goblin": "đŸ‘ē", - "ghost": "đŸ‘ģ", - "angel": "đŸ‘ŧ", - "alien": "đŸ‘Ŋ", - "space_invader": "👾", - "imp": "đŸ‘ŋ", - "skull": "💀", - "information_desk_person": "💁", - "guardsman": "💂", - "dancer": "💃", - "lipstick": "💄", - "nail_care": "💅", - "massage": "💆", - "haircut": "💇", - "barber": "💈", - "syringe": "💉", - "pill": "💊", - "kiss": "💋", - "love_letter": "💌", - "ring": "💍", - "gem": "💎", - "couplekiss": "💏", - "bouquet": "💐", - "couple_with_heart": "💑", - "wedding": "💒", - "heartbeat": "💓", - "broken_heart": "💔", - "two_hearts": "💕", - "sparkling_heart": "💖", - "heartpulse": "💗", - "cupid": "💘", - "blue_heart": "💙", - "green_heart": "💚", - "yellow_heart": "💛", - "purple_heart": "💜", - "gift_heart": "💝", - "revolving_hearts": "💞", - "heart_decoration": "💟", - "diamond_shape_with_a_dot_inside": "💠", - "bulb": "💡", - "anger": "đŸ’ĸ", - "bomb": "đŸ’Ŗ", - "zzz": "💤", - "boom": "đŸ’Ĩ", - "collision": "đŸ’Ĩ", - "sweat_drops": "đŸ’Ļ", - "droplet": "💧", - "dash": "💨", - "hankey": "💩", - "poop": "💩", - "shit": "💩", - "muscle": "đŸ’Ē", - "dizzy": "đŸ’Ģ", - "speech_balloon": "đŸ’Ŧ", - "thought_balloon": "💭", - "white_flower": "💮", - "moneybag": "💰", - "currency_exchange": "💱", - "heavy_dollar_sign": "💲", - "credit_card": "đŸ’ŗ", - "yen": "💴", - "dollar": "đŸ’ĩ", - "euro": "đŸ’ļ", - "pound": "💷", - "money_with_wings": "💸", - "chart": "💹", - "seat": "đŸ’ē", - "computer": "đŸ’ģ", - "briefcase": "đŸ’ŧ", - "minidisc": "đŸ’Ŋ", - "floppy_disk": "💾", - "cd": "đŸ’ŋ", - "dvd": "📀", - "file_folder": "📁", - "open_file_folder": "📂", - "page_with_curl": "📃", - "page_facing_up": "📄", - "date": "📅", - "calendar": "📆", - "card_index": "📇", - "chart_with_upwards_trend": "📈", - "chart_with_downwards_trend": "📉", - "bar_chart": "📊", - "clipboard": "📋", - "pushpin": "📌", - "round_pushpin": "📍", - "paperclip": "📎", - "straight_ruler": "📏", - "triangular_ruler": "📐", - "bookmark_tabs": "📑", - "ledger": "📒", - "notebook": "📓", - "notebook_with_decorative_cover": "📔", - "closed_book": "📕", - "book": "📖", - "open_book": "📖", - "green_book": "📗", - "blue_book": "📘", - "orange_book": "📙", - "books": "📚", - "name_badge": "📛", - "scroll": "📜", - "memo": "📝", - "pencil": "📝", - "telephone_receiver": "📞", - "pager": "📟", - "fax": "📠", - "satellite": "🛰", - "loudspeaker": "đŸ“ĸ", - "mega": "đŸ“Ŗ", - "outbox_tray": "📤", - "inbox_tray": "đŸ“Ĩ", - "package": "đŸ“Ļ", - "e-mail": "📧", - "incoming_envelope": "📨", - "envelope_with_arrow": "📩", - "mailbox_closed": "đŸ“Ē", - "mailbox": "đŸ“Ģ", - "mailbox_with_mail": "đŸ“Ŧ", - "mailbox_with_no_mail": "📭", - "postbox": "📮", - "postal_horn": "đŸ“¯", - "newspaper": "📰", - "iphone": "📱", - "calling": "📲", - "vibration_mode": "đŸ“ŗ", - "mobile_phone_off": "📴", - "no_mobile_phones": "đŸ“ĩ", - "signal_strength": "đŸ“ļ", - "camera": "📷", - "camera_with_flash": "📸", - "video_camera": "📹", - "tv": "đŸ“ē", - "radio": "đŸ“ģ", - "vhs": "đŸ“ŧ", - "film_projector": "đŸ“Ŋ", - "prayer_beads": "đŸ“ŋ", - "twisted_rightwards_arrows": "🔀", - "repeat": "🔁", - "repeat_one": "🔂", - "arrows_clockwise": "🔃", - "arrows_counterclockwise": "🔄", - "low_brightness": "🔅", - "high_brightness": "🔆", - "mute": "🔇", - "speaker": "🔈", - "sound": "🔉", - "loud_sound": "🔊", - "battery": "🔋", - "electric_plug": "🔌", - "mag": "🔍", - "mag_right": "🔎", - "lock_with_ink_pen": "🔏", - "closed_lock_with_key": "🔐", - "key": "🔑", - "lock": "🔒", - "unlock": "🔓", - "bell": "🔔", - "no_bell": "🔕", - "bookmark": "🔖", - "link": "🔗", - "radio_button": "🔘", - "back": "🔙", - "end": "🔚", - "on": "🔛", - "soon": "🔜", - "top": "🔝", - "underage": "🔞", - "keycap_ten": "🔟", - "capital_abcd": "🔠", - "abcd": "🔡", - "symbols": "đŸ”Ŗ", - "abc": "🔤", - "fire": "đŸ”Ĩ", - "flashlight": "đŸ”Ļ", - "wrench": "🔧", - "hammer": "🔨", - "nut_and_bolt": "🔩", - "hocho": "đŸ”Ē", - "knife": "đŸ”Ē", - "gun": "đŸ”Ģ", - "microscope": "đŸ”Ŧ", - "telescope": "🔭", - "crystal_ball": "🔮", - "six_pointed_star": "đŸ”¯", - "beginner": "🔰", - "trident": "🔱", - "black_square_button": "🔲", - "white_square_button": "đŸ”ŗ", - "red_circle": "🔴", - "large_blue_circle": "đŸ”ĩ", - "large_orange_diamond": "đŸ”ļ", - "large_blue_diamond": "🔷", - "small_orange_diamond": "🔸", - "small_blue_diamond": "🔹", - "small_red_triangle": "đŸ”ē", - "small_red_triangle_down": "đŸ”ģ", - "arrow_up_small": "đŸ”ŧ", - "arrow_down_small": "đŸ”Ŋ", - "om_symbol": "🕉", - "dove_of_peace": "🕊", - "kaaba": "🕋", - "mosque": "🕌", - "synagogue": "🕍", - "menorah_with_nine_branches": "🕎", - "clock1": "🕐", - "clock2": "🕑", - "clock3": "🕒", - "clock4": "🕓", - "clock5": "🕔", - "clock6": "🕕", - "clock7": "🕖", - "clock8": "🕗", - "clock9": "🕘", - "clock10": "🕙", - "clock11": "🕚", - "clock12": "🕛", - "clock130": "🕜", - "clock230": "🕝", - "clock330": "🕞", - "clock430": "🕟", - "clock530": "🕠", - "clock630": "🕡", - "clock730": "đŸ•ĸ", - "clock830": "đŸ•Ŗ", - "clock930": "🕤", - "clock1030": "đŸ•Ĩ", - "clock1130": "đŸ•Ļ", - "clock1230": "🕧", - "candle": "đŸ•¯", - "mantelpiece_clock": "🕰", - "hole": "đŸ•ŗ", - "man_in_business_suit_levitating": "🕴", - "sleuth_or_spy": "đŸ•ĩ", - "dark_sunglasses": "đŸ•ļ", - "spider": "🕷", - "spider_web": "🕸", - "joystick": "🕹", - "linked_paperclips": "🖇", - "lower_left_ballpoint_pen": "🖊", - "lower_left_fountain_pen": "🖋", - "lower_left_paintbrush": "🖌", - "lower_left_crayon": "🖍", - "raised_hand_with_fingers_splayed": "🖐", - "middle_finger": "🖕", - "reversed_hand_with_middle_finger_extended": "🖕", - "spock-hand": "🖖", - "desktop_computer": "đŸ–Ĩ", - "printer": "🖨", - "three_button_mouse": "🖱", - "trackball": "🖲", - "frame_with_picture": "đŸ–ŧ", - "card_index_dividers": "🗂", - "card_file_box": "🗃", - "file_cabinet": "🗄", - "wastebasket": "🗑", - "spiral_note_pad": "🗒", - "spiral_calendar_pad": "🗓", - "compression": "🗜", - "old_key": "🗝", - "rolled_up_newspaper": "🗞", - "dagger_knife": "🗡", - "speaking_head_in_silhouette": "đŸ—Ŗ", - "left_speech_bubble": "🗨", - "right_anger_bubble": "đŸ—¯", - "ballot_box_with_ballot": "đŸ—ŗ", - "world_map": "đŸ—ē", - "mount_fuji": "đŸ—ģ", - "tokyo_tower": "đŸ—ŧ", - "statue_of_liberty": "đŸ—Ŋ", - "japan": "🗾", - "moyai": "đŸ—ŋ", - "grinning": "😀", - "grin": "😁", - "joy": "😂", - "smiley": "😃", - "smile": "😄", - "sweat_smile": "😅", - "laughing": "😆", - "satisfied": "😆", - "innocent": "😇", - "smiling_imp": "😈", - "wink": "😉", - "blush": "😊", - "yum": "😋", - "relieved": "😌", - "heart_eyes": "😍", - "sunglasses": "😎", - "smirk": "😏", - "neutral_face": "😐", - "expressionless": "😑", - "unamused": "😒", - "sweat": "😓", - "pensive": "😔", - "confused": "😕", - "confounded": "😖", - "kissing": "😗", - "kissing_heart": "😘", - "kissing_smiling_eyes": "😙", - "kissing_closed_eyes": "😚", - "stuck_out_tongue": "😛", - "stuck_out_tongue_winking_eye": "😜", - "stuck_out_tongue_closed_eyes": "😝", - "disappointed": "😞", - "worried": "😟", - "angry": "😠", - "rage": "😡", - "cry": "đŸ˜ĸ", - "persevere": "đŸ˜Ŗ", - "triumph": "😤", - "disappointed_relieved": "đŸ˜Ĩ", - "frowning": "đŸ˜Ļ", - "anguished": "😧", - "fearful": "😨", - "weary": "😩", - "sleepy": "đŸ˜Ē", - "tired_face": "đŸ˜Ģ", - "grimacing": "đŸ˜Ŧ", - "sob": "😭", - "open_mouth": "😮", - "hushed": "đŸ˜¯", - "cold_sweat": "😰", - "scream": "😱", - "astonished": "😲", - "flushed": "đŸ˜ŗ", - "sleeping": "😴", - "dizzy_face": "đŸ˜ĩ", - "no_mouth": "đŸ˜ļ", - "mask": "😷", - "smile_cat": "😸", - "joy_cat": "😹", - "smiley_cat": "đŸ˜ē", - "heart_eyes_cat": "đŸ˜ģ", - "smirk_cat": "đŸ˜ŧ", - "kissing_cat": "đŸ˜Ŋ", - "pouting_cat": "😾", - "crying_cat_face": "đŸ˜ŋ", - "scream_cat": "🙀", - "slightly_frowning_face": "🙁", - "slightly_smiling_face": "🙂", - "upside_down_face": "🙃", - "face_with_rolling_eyes": "🙄", - "no_good": "🙅", - "ok_woman": "🙆", - "bow": "🙇", - "see_no_evil": "🙈", - "hear_no_evil": "🙉", - "speak_no_evil": "🙊", - "raising_hand": "🙋", - "raised_hands": "🙌", - "person_frowning": "🙍", - "person_with_pouting_face": "🙎", - "pray": "🙏", - "rocket": "🚀", - "helicopter": "🚁", - "steam_locomotive": "🚂", - "railway_car": "🚃", - "bullettrain_side": "🚄", - "bullettrain_front": "🚅", - "train2": "🚆", - "metro": "🚇", - "light_rail": "🚈", - "station": "🚉", - "tram": "🚊", - "train": "🚋", - "bus": "🚌", - "oncoming_bus": "🚍", - "trolleybus": "🚎", - "busstop": "🚏", - "minibus": "🚐", - "ambulance": "🚑", - "fire_engine": "🚒", - "police_car": "🚓", - "oncoming_police_car": "🚔", - "taxi": "🚕", - "oncoming_taxi": "🚖", - "car": "🚗", - "red_car": "🚗", - "oncoming_automobile": "🚘", - "blue_car": "🚙", - "truck": "🚚", - "articulated_lorry": "🚛", - "tractor": "🚜", - "monorail": "🚝", - "mountain_railway": "🚞", - "suspension_railway": "🚟", - "mountain_cableway": "🚠", - "aerial_tramway": "🚡", - "ship": "đŸšĸ", - "rowboat": "đŸšŖ", - "speedboat": "🚤", - "traffic_light": "đŸšĨ", - "vertical_traffic_light": "đŸšĻ", - "construction": "🚧", - "rotating_light": "🚨", - "triangular_flag_on_post": "🚩", - "door": "đŸšĒ", - "no_entry_sign": "đŸšĢ", - "smoking": "đŸšŦ", - "no_smoking": "🚭", - "put_litter_in_its_place": "🚮", - "do_not_litter": "đŸš¯", - "potable_water": "🚰", - "non-potable_water": "🚱", - "bike": "🚲", - "no_bicycles": "đŸšŗ", - "bicyclist": "🚴", - "mountain_bicyclist": "đŸšĩ", - "walking": "đŸšļ", - "no_pedestrians": "🚷", - "children_crossing": "🚸", - "mens": "🚹", - "womens": "đŸšē", - "restroom": "đŸšģ", - "baby_symbol": "đŸšŧ", - "toilet": "đŸšŊ", - "wc": "🚾", - "shower": "đŸšŋ", - "bath": "🛀", - "bathtub": "🛁", - "passport_control": "🛂", - "customs": "🛃", - "baggage_claim": "🛄", - "left_luggage": "🛅", - "couch_and_lamp": "🛋", - "sleeping_accommodation": "🛌", - "shopping_bags": "🛍", - "bellhop_bell": "🛎", - "bed": "🛏", - "place_of_worship": "🛐", - "hammer_and_wrench": "🛠", - "shield": "🛡", - "oil_drum": "đŸ›ĸ", - "motorway": "đŸ›Ŗ", - "railway_track": "🛤", - "motor_boat": "đŸ›Ĩ", - "small_airplane": "🛩", - "airplane_departure": "đŸ›Ģ", - "airplane_arriving": "đŸ›Ŧ", - "passenger_ship": "đŸ›ŗ", - "zipper_mouth_face": "🤐", - "money_mouth_face": "🤑", - "face_with_thermometer": "🤒", - "nerd_face": "🤓", - "thinking_face": "🤔", - "face_with_head_bandage": "🤕", - "robot_face": "🤖", - "hugging_face": "🤗", - "the_horns": "🤘", - "sign_of_the_horns": "🤘", - "crab": "đŸĻ€", - "lion_face": "đŸĻ", - "scorpion": "đŸĻ‚", - "turkey": "đŸĻƒ", - "unicorn_face": "đŸĻ„", - "cheese_wedge": "🧀", - "hash": "#ī¸âƒŖ", - "keycap_star": "*âƒŖ", - "zero": "0ī¸âƒŖ", - "one": "1ī¸âƒŖ", - "two": "2ī¸âƒŖ", - "three": "3ī¸âƒŖ", - "four": "4ī¸âƒŖ", - "five": "5ī¸âƒŖ", - "six": "6ī¸âƒŖ", - "seven": "7ī¸âƒŖ", - "eight": "8ī¸âƒŖ", - "nine": "9ī¸âƒŖ", - "flag-ac": "đŸ‡Ļ🇨", - "flag-ad": "đŸ‡Ļ🇩", - "flag-ae": "đŸ‡ĻđŸ‡Ē", - "flag-af": "đŸ‡ĻđŸ‡Ģ", - "flag-ag": "đŸ‡ĻđŸ‡Ŧ", - "flag-ai": "đŸ‡Ļ🇮", - "flag-al": "đŸ‡Ļ🇱", - "flag-am": "đŸ‡Ļ🇲", - "flag-ao": "đŸ‡Ļ🇴", - "flag-aq": "đŸ‡ĻđŸ‡ļ", - "flag-ar": "đŸ‡Ļ🇷", - "flag-as": "đŸ‡Ļ🇸", - "flag-at": "đŸ‡Ļ🇹", - "flag-au": "đŸ‡ĻđŸ‡ē", - "flag-aw": "đŸ‡ĻđŸ‡ŧ", - "flag-ax": "đŸ‡ĻđŸ‡Ŋ", - "flag-az": "đŸ‡ĻđŸ‡ŋ", - "flag-ba": "🇧đŸ‡Ļ", - "flag-bb": "🇧🇧", - "flag-bd": "🇧🇩", - "flag-be": "🇧đŸ‡Ē", - "flag-bf": "🇧đŸ‡Ģ", - "flag-bg": "🇧đŸ‡Ŧ", - "flag-bh": "🇧🇭", - "flag-bi": "🇧🇮", - "flag-bj": "đŸ‡§đŸ‡¯", - "flag-bl": "🇧🇱", - "flag-bm": "🇧🇲", - "flag-bn": "đŸ‡§đŸ‡ŗ", - "flag-bo": "🇧🇴", - "flag-bq": "🇧đŸ‡ļ", - "flag-br": "🇧🇷", - "flag-bs": "🇧🇸", - "flag-bt": "🇧🇹", - "flag-bv": "🇧đŸ‡ģ", - "flag-bw": "🇧đŸ‡ŧ", - "flag-by": "🇧🇾", - "flag-bz": "🇧đŸ‡ŋ", - "flag-ca": "🇨đŸ‡Ļ", - "flag-cc": "🇨🇨", - "flag-cd": "🇨🇩", - "flag-cf": "🇨đŸ‡Ģ", - "flag-cg": "🇨đŸ‡Ŧ", - "flag-ch": "🇨🇭", - "flag-ci": "🇨🇮", - "flag-ck": "🇨🇰", - "flag-cl": "🇨🇱", - "flag-cm": "🇨🇲", - "flag-cn": "đŸ‡¨đŸ‡ŗ", - "cn": "đŸ‡¨đŸ‡ŗ", - "flag-co": "🇨🇴", - "flag-cp": "🇨đŸ‡ĩ", - "flag-cr": "🇨🇷", - "flag-cu": "🇨đŸ‡ē", - "flag-cv": "🇨đŸ‡ģ", - "flag-cw": "🇨đŸ‡ŧ", - "flag-cx": "🇨đŸ‡Ŋ", - "flag-cy": "🇨🇾", - "flag-cz": "🇨đŸ‡ŋ", - "flag-de": "🇩đŸ‡Ē", - "de": "🇩đŸ‡Ē", - "flag-dg": "🇩đŸ‡Ŧ", - "flag-dj": "đŸ‡ŠđŸ‡¯", - "flag-dk": "🇩🇰", - "flag-dm": "🇩🇲", - "flag-do": "🇩🇴", - "flag-dz": "🇩đŸ‡ŋ", - "flag-ea": "đŸ‡ĒđŸ‡Ļ", - "flag-ec": "đŸ‡Ē🇨", - "flag-ee": "đŸ‡ĒđŸ‡Ē", - "flag-eg": "đŸ‡ĒđŸ‡Ŧ", - "flag-eh": "đŸ‡Ē🇭", - "flag-er": "đŸ‡Ē🇷", - "flag-es": "đŸ‡Ē🇸", - "es": "đŸ‡Ē🇸", - "flag-et": "đŸ‡Ē🇹", - "flag-eu": "đŸ‡ĒđŸ‡ē", - "flag-fi": "đŸ‡Ģ🇮", - "flag-fj": "đŸ‡ĢđŸ‡¯", - "flag-fk": "đŸ‡Ģ🇰", - "flag-fm": "đŸ‡Ģ🇲", - "flag-fo": "đŸ‡Ģ🇴", - "flag-fr": "đŸ‡Ģ🇷", - "fr": "đŸ‡Ģ🇷", - "flag-ga": "đŸ‡ŦđŸ‡Ļ", - "flag-gb": "đŸ‡Ŧ🇧", - "gb": "đŸ‡Ŧ🇧", - "uk": "đŸ‡Ŧ🇧", - "flag-gd": "đŸ‡Ŧ🇩", - "flag-ge": "đŸ‡ŦđŸ‡Ē", - "flag-gf": "đŸ‡ŦđŸ‡Ģ", - "flag-gg": "đŸ‡ŦđŸ‡Ŧ", - "flag-gh": "đŸ‡Ŧ🇭", - "flag-gi": "đŸ‡Ŧ🇮", - "flag-gl": "đŸ‡Ŧ🇱", - "flag-gm": "đŸ‡Ŧ🇲", - "flag-gn": "đŸ‡ŦđŸ‡ŗ", - "flag-gp": "đŸ‡ŦđŸ‡ĩ", - "flag-gq": "đŸ‡ŦđŸ‡ļ", - "flag-gr": "đŸ‡Ŧ🇷", - "flag-gs": "đŸ‡Ŧ🇸", - "flag-gt": "đŸ‡Ŧ🇹", - "flag-gu": "đŸ‡ŦđŸ‡ē", - "flag-gw": "đŸ‡ŦđŸ‡ŧ", - "flag-gy": "đŸ‡Ŧ🇾", - "flag-hk": "🇭🇰", - "flag-hm": "🇭🇲", - "flag-hn": "đŸ‡­đŸ‡ŗ", - "flag-hr": "🇭🇷", - "flag-ht": "🇭🇹", - "flag-hu": "🇭đŸ‡ē", - "flag-ic": "🇮🇨", - "flag-id": "🇮🇩", - "flag-ie": "🇮đŸ‡Ē", - "flag-il": "🇮🇱", - "flag-im": "🇮🇲", - "flag-in": "đŸ‡ŽđŸ‡ŗ", - "flag-io": "🇮🇴", - "flag-iq": "🇮đŸ‡ļ", - "flag-ir": "🇮🇷", - "flag-is": "🇮🇸", - "flag-it": "🇮🇹", - "it": "🇮🇹", - "flag-je": "đŸ‡¯đŸ‡Ē", - "flag-jm": "đŸ‡¯đŸ‡˛", - "flag-jo": "đŸ‡¯đŸ‡´", - "flag-jp": "đŸ‡¯đŸ‡ĩ", - "jp": "đŸ‡¯đŸ‡ĩ", - "flag-ke": "🇰đŸ‡Ē", - "flag-kg": "🇰đŸ‡Ŧ", - "flag-kh": "🇰🇭", - "flag-ki": "🇰🇮", - "flag-km": "🇰🇲", - "flag-kn": "đŸ‡°đŸ‡ŗ", - "flag-kp": "🇰đŸ‡ĩ", - "flag-kr": "🇰🇷", - "kr": "🇰🇷", - "flag-kw": "🇰đŸ‡ŧ", - "flag-ky": "🇰🇾", - "flag-kz": "🇰đŸ‡ŋ", - "flag-la": "🇱đŸ‡Ļ", - "flag-lb": "🇱🇧", - "flag-lc": "🇱🇨", - "flag-li": "🇱🇮", - "flag-lk": "🇱🇰", - "flag-lr": "🇱🇷", - "flag-ls": "🇱🇸", - "flag-lt": "🇱🇹", - "flag-lu": "🇱đŸ‡ē", - "flag-lv": "🇱đŸ‡ģ", - "flag-ly": "🇱🇾", - "flag-ma": "🇲đŸ‡Ļ", - "flag-mc": "🇲🇨", - "flag-md": "🇲🇩", - "flag-me": "🇲đŸ‡Ē", - "flag-mf": "🇲đŸ‡Ģ", - "flag-mg": "🇲đŸ‡Ŧ", - "flag-mh": "🇲🇭", - "flag-mk": "🇲🇰", - "flag-ml": "🇲🇱", - "flag-mm": "🇲🇲", - "flag-mn": "đŸ‡˛đŸ‡ŗ", - "flag-mo": "🇲🇴", - "flag-mp": "🇲đŸ‡ĩ", - "flag-mq": "🇲đŸ‡ļ", - "flag-mr": "🇲🇷", - "flag-ms": "🇲🇸", - "flag-mt": "🇲🇹", - "flag-mu": "🇲đŸ‡ē", - "flag-mv": "🇲đŸ‡ģ", - "flag-mw": "🇲đŸ‡ŧ", - "flag-mx": "🇲đŸ‡Ŋ", - "flag-my": "🇲🇾", - "flag-mz": "🇲đŸ‡ŋ", - "flag-na": "đŸ‡ŗđŸ‡Ļ", - "flag-nc": "đŸ‡ŗđŸ‡¨", - "flag-ne": "đŸ‡ŗđŸ‡Ē", - "flag-nf": "đŸ‡ŗđŸ‡Ģ", - "flag-ng": "đŸ‡ŗđŸ‡Ŧ", - "flag-ni": "đŸ‡ŗđŸ‡Ž", - "flag-nl": "đŸ‡ŗđŸ‡ą", - "flag-no": "đŸ‡ŗđŸ‡´", - "flag-np": "đŸ‡ŗđŸ‡ĩ", - "flag-nr": "đŸ‡ŗđŸ‡ˇ", - "flag-nu": "đŸ‡ŗđŸ‡ē", - "flag-nz": "đŸ‡ŗđŸ‡ŋ", - "flag-om": "🇴🇲", - "flag-pa": "đŸ‡ĩđŸ‡Ļ", - "flag-pe": "đŸ‡ĩđŸ‡Ē", - "flag-pf": "đŸ‡ĩđŸ‡Ģ", - "flag-pg": "đŸ‡ĩđŸ‡Ŧ", - "flag-ph": "đŸ‡ĩ🇭", - "flag-pk": "đŸ‡ĩ🇰", - "flag-pl": "đŸ‡ĩ🇱", - "flag-pm": "đŸ‡ĩ🇲", - "flag-pn": "đŸ‡ĩđŸ‡ŗ", - "flag-pr": "đŸ‡ĩ🇷", - "flag-ps": "đŸ‡ĩ🇸", - "flag-pt": "đŸ‡ĩ🇹", - "flag-pw": "đŸ‡ĩđŸ‡ŧ", - "flag-py": "đŸ‡ĩ🇾", - "flag-qa": "đŸ‡ļđŸ‡Ļ", - "flag-re": "🇷đŸ‡Ē", - "flag-ro": "🇷🇴", - "flag-rs": "🇷🇸", - "flag-ru": "🇷đŸ‡ē", - "ru": "🇷đŸ‡ē", - "flag-rw": "🇷đŸ‡ŧ", - "flag-sa": "🇸đŸ‡Ļ", - "flag-sb": "🇸🇧", - "flag-sc": "🇸🇨", - "flag-sd": "🇸🇩", - "flag-se": "🇸đŸ‡Ē", - "flag-sg": "🇸đŸ‡Ŧ", - "flag-sh": "🇸🇭", - "flag-si": "🇸🇮", - "flag-sj": "đŸ‡¸đŸ‡¯", - "flag-sk": "🇸🇰", - "flag-sl": "🇸🇱", - "flag-sm": "🇸🇲", - "flag-sn": "đŸ‡¸đŸ‡ŗ", - "flag-so": "🇸🇴", - "flag-sr": "🇸🇷", - "flag-ss": "🇸🇸", - "flag-st": "🇸🇹", - "flag-sv": "🇸đŸ‡ģ", - "flag-sx": "🇸đŸ‡Ŋ", - "flag-sy": "🇸🇾", - "flag-sz": "🇸đŸ‡ŋ", - "flag-ta": "🇹đŸ‡Ļ", - "flag-tc": "🇹🇨", - "flag-td": "🇹🇩", - "flag-tf": "🇹đŸ‡Ģ", - "flag-tg": "🇹đŸ‡Ŧ", - "flag-th": "🇹🇭", - "flag-tj": "đŸ‡šđŸ‡¯", - "flag-tk": "🇹🇰", - "flag-tl": "🇹🇱", - "flag-tm": "🇹🇲", - "flag-tn": "đŸ‡šđŸ‡ŗ", - "flag-to": "🇹🇴", - "flag-tr": "🇹🇷", - "flag-tt": "🇹🇹", - "flag-tv": "🇹đŸ‡ģ", - "flag-tw": "🇹đŸ‡ŧ", - "flag-tz": "🇹đŸ‡ŋ", - "flag-ua": "đŸ‡ēđŸ‡Ļ", - "flag-ug": "đŸ‡ēđŸ‡Ŧ", - "flag-um": "đŸ‡ē🇲", - "flag-us": "đŸ‡ē🇸", - "us": "đŸ‡ē🇸", - "flag-uy": "đŸ‡ē🇾", - "flag-uz": "đŸ‡ēđŸ‡ŋ", - "flag-va": "đŸ‡ģđŸ‡Ļ", - "flag-vc": "đŸ‡ģ🇨", - "flag-ve": "đŸ‡ģđŸ‡Ē", - "flag-vg": "đŸ‡ģđŸ‡Ŧ", - "flag-vi": "đŸ‡ģ🇮", - "flag-vn": "đŸ‡ģđŸ‡ŗ", - "flag-vu": "đŸ‡ģđŸ‡ē", - "flag-wf": "đŸ‡ŧđŸ‡Ģ", - "flag-ws": "đŸ‡ŧ🇸", - "flag-xk": "đŸ‡Ŋ🇰", - "flag-ye": "🇾đŸ‡Ē", - "flag-yt": "🇾🇹", - "flag-za": "đŸ‡ŋđŸ‡Ļ", - "flag-zm": "đŸ‡ŋ🇲", - "flag-zw": "đŸ‡ŋđŸ‡ŧ", - "man-man-boy": "👨‍👨‍đŸ‘Ļ", - "man-man-boy-boy": "👨‍👨‍đŸ‘Ļ‍đŸ‘Ļ", - "man-man-girl": "👨‍👨‍👧", - "man-man-girl-boy": "👨‍👨‍👧‍đŸ‘Ļ", - "man-man-girl-girl": "👨‍👨‍👧‍👧", - "man-woman-boy-boy": "👨‍👩‍đŸ‘Ļ‍đŸ‘Ļ", - "man-woman-girl": "👨‍👩‍👧", - "man-woman-girl-boy": "👨‍👩‍👧‍đŸ‘Ļ", - "man-woman-girl-girl": "👨‍👩‍👧‍👧", - "man-heart-man": "đŸ‘¨â€â¤ī¸â€đŸ‘¨", - "man-kiss-man": "đŸ‘¨â€â¤ī¸â€đŸ’‹â€đŸ‘¨", - "woman-woman-boy": "👩‍👩‍đŸ‘Ļ", - "woman-woman-boy-boy": "👩‍👩‍đŸ‘Ļ‍đŸ‘Ļ", - "woman-woman-girl": "👩‍👩‍👧", - "woman-woman-girl-boy": "👩‍👩‍👧‍đŸ‘Ļ", - "woman-woman-girl-girl": "👩‍👩‍👧‍👧", - "woman-heart-woman": "đŸ‘Šâ€â¤ī¸â€đŸ‘Š", - "woman-kiss-woman": "đŸ‘Šâ€â¤ī¸â€đŸ’‹â€đŸ‘Š" + return words.map(function(word) { + return Emoji.which(word, true) || word; + }).join(''); }; +/** + * replace emojis with replacement value + * @param {string} str + * @param {function|string} the string or callback function to replace the emoji with + * @param {boolean} should trailing whitespaces be cleaned? Defaults false + * @return {string} + */ +Emoji.replace = function replace (str, replacement, cleanSpaces) { + if (!str) return ''; + + var replace = typeof replacement === 'function' ? replacement : function() { return replacement; }; + var words = toArray(str); + + var replaced = words.map(function(word, idx) { + var emoji = Emoji.findByCode(word); + + if (emoji && cleanSpaces && words[idx + 1] === ' ') { + words[idx + 1] = ''; + } + + return emoji ? replace(emoji) : word; + }).join(''); + + return cleanSpaces ? replaced.replace(trimSpaceRegex, '') : replaced; +}; + + +/** + * remove all emojis from a string + * @param {string} str + * @return {string} + */ +Emoji.strip = function strip (str) { + return Emoji.replace(str, '', true); +}; + +module.exports = Emoji; + + /***/ }), -/* 592 */ +/* 764 */ +/***/ (function(module, exports) { + +module.exports = {"100":"đŸ’¯","1234":"đŸ”ĸ","interrobang":"â‰ī¸","tm":"â„ĸī¸","information_source":"â„šī¸","left_right_arrow":"â†”ī¸","arrow_up_down":"â†•ī¸","arrow_upper_left":"â†–ī¸","arrow_upper_right":"â†—ī¸","arrow_lower_right":"â†˜ī¸","arrow_lower_left":"â†™ī¸","keyboard":"⌨","sunny":"â˜€ī¸","cloud":"â˜ī¸","umbrella":"â˜”ī¸","showman":"☃","comet":"☄","ballot_box_with_check":"â˜‘ī¸","coffee":"â˜•ī¸","shamrock":"☘","skull_and_crossbones":"☠","radioactive_sign":"â˜ĸ","biohazard_sign":"â˜Ŗ","orthodox_cross":"â˜Ļ","wheel_of_dharma":"☸","white_frowning_face":"☚","aries":"â™ˆī¸","taurus":"â™‰ī¸","sagittarius":"â™ī¸","capricorn":"â™‘ī¸","aquarius":"â™’ī¸","pisces":"â™“ī¸","spades":"â™ ī¸","clubs":"â™Ŗī¸","hearts":"â™Ĩī¸","diamonds":"â™Ļī¸","hotsprings":"â™¨ī¸","hammer_and_pick":"⚒","anchor":"âš“ī¸","crossed_swords":"⚔","scales":"⚖","alembic":"⚗","gear":"⚙","scissors":"âœ‚ī¸","white_check_mark":"✅","airplane":"âœˆī¸","email":"âœ‰ī¸","envelope":"âœ‰ī¸","black_nib":"âœ’ī¸","heavy_check_mark":"âœ”ī¸","heavy_multiplication_x":"âœ–ī¸","star_of_david":"✡","sparkles":"✨","eight_spoked_asterisk":"âœŗī¸","eight_pointed_black_star":"âœ´ī¸","snowflake":"â„ī¸","sparkle":"â‡ī¸","question":"❓","grey_question":"❔","grey_exclamation":"❕","exclamation":"â—ī¸","heavy_exclamation_mark":"â—ī¸","heavy_heart_exclamation_mark_ornament":"âŖ","heart":"â¤ī¸","heavy_plus_sign":"➕","heavy_minus_sign":"➖","heavy_division_sign":"➗","arrow_heading_up":"â¤´ī¸","arrow_heading_down":"â¤ĩī¸","wavy_dash":"ã€°ī¸","congratulations":"ãŠ—ī¸","secret":"ãŠ™ī¸","copyright":"ÂŠī¸","registered":"ÂŽī¸","bangbang":"â€ŧī¸","leftwards_arrow_with_hook":"â†Šī¸","arrow_right_hook":"â†Ēī¸","watch":"âŒšī¸","hourglass":"âŒ›ī¸","fast_forward":"⏊","rewind":"âĒ","arrow_double_up":"âĢ","arrow_double_down":"âŦ","black_right_pointing_double_triangle_with_vertical_bar":"⏭","black_left_pointing_double_triangle_with_vertical_bar":"⏎","black_right_pointing_triangle_with_double_vertical_bar":"⏯","alarm_clock":"⏰","stopwatch":"⏱","timer_clock":"⏲","hourglass_flowing_sand":"âŗ","double_vertical_bar":"⏸","black_square_for_stop":"⏚","black_circle_for_record":"âē","m":"â“‚ī¸","black_small_square":"â–Ēī¸","white_small_square":"â–Ģī¸","arrow_forward":"â–ļī¸","arrow_backward":"â—€ī¸","white_medium_square":"â—ģī¸","black_medium_square":"â—ŧī¸","white_medium_small_square":"â—Ŋī¸","black_medium_small_square":"â—žī¸","phone":"â˜Žī¸","telephone":"â˜Žī¸","point_up":"â˜ī¸","star_and_crescent":"â˜Ē","peace_symbol":"☎","yin_yang":"☯","relaxed":"â˜ēī¸","gemini":"â™Šī¸","cancer":"â™‹ī¸","leo":"â™Œī¸","virgo":"â™ī¸","libra":"â™Žī¸","scorpius":"â™ī¸","recycle":"â™ģī¸","wheelchair":"â™ŋī¸","atom_symbol":"⚛","fleur_de_lis":"⚜","warning":"âš ī¸","zap":"âšĄī¸","white_circle":"âšĒī¸","black_circle":"âšĢī¸","coffin":"⚰","funeral_urn":"⚱","soccer":"âšŊī¸","baseball":"âšžī¸","snowman":"â›„ī¸","partly_sunny":"â›…ī¸","thunder_cloud_and_rain":"⛈","ophiuchus":"⛎","pick":"⛏","helmet_with_white_cross":"⛑","chains":"⛓","no_entry":"â›”ī¸","shinto_shrine":"⛩","church":"â›Ēī¸","mountain":"⛰","umbrella_on_ground":"⛱","fountain":"â›˛ī¸","golf":"â›ŗī¸","ferry":"⛴","boat":"â›ĩī¸","sailboat":"â›ĩī¸","skier":"⛷","ice_skate":"⛸","person_with_ball":"⛹","tent":"â›ēī¸","fuelpump":"â›Ŋī¸","fist":"✊","hand":"✋","raised_hand":"✋","v":"âœŒī¸","writing_hand":"✍","pencil2":"âœī¸","latin_cross":"✝","x":"❌","negative_squared_cross_mark":"❎","arrow_right":"âžĄī¸","curly_loop":"➰","loop":"âžŋ","arrow_left":"âŦ…ī¸","arrow_up":"âŦ†ī¸","arrow_down":"âŦ‡ī¸","black_large_square":"âŦ›ī¸","white_large_square":"âŦœī¸","star":"â­ī¸","o":"â­•ī¸","part_alternation_mark":"ã€Ŋī¸","mahjong":"đŸ€„ī¸","black_joker":"🃏","a":"đŸ…°ī¸","b":"đŸ…ąī¸","o2":"đŸ…žī¸","parking":"đŸ…ŋī¸","ab":"🆎","cl":"🆑","cool":"🆒","free":"🆓","id":"🆔","new":"🆕","ng":"🆖","ok":"🆗","sos":"🆘","up":"🆙","vs":"🆚","koko":"🈁","sa":"đŸˆ‚ī¸","u7121":"đŸˆšī¸","u6307":"đŸˆ¯ī¸","u7981":"🈲","u7a7a":"đŸˆŗ","u5408":"🈴","u6e80":"đŸˆĩ","u6709":"đŸˆļ","u6708":"đŸˆˇī¸","u7533":"🈸","u5272":"🈹","u55b6":"đŸˆē","ideograph_advantage":"🉐","accept":"🉑","cyclone":"🌀","foggy":"🌁","closed_umbrella":"🌂","night_with_stars":"🌃","sunrise_over_mountains":"🌄","sunrise":"🌅","city_sunset":"🌆","city_sunrise":"🌇","rainbow":"🌈","bridge_at_night":"🌉","ocean":"🌊","volcano":"🌋","milky_way":"🌌","earth_africa":"🌍","earth_americas":"🌎","earth_asia":"🌏","globe_with_meridians":"🌐","new_moon":"🌑","waxing_crescent_moon":"🌒","first_quarter_moon":"🌓","moon":"🌔","waxing_gibbous_moon":"🌔","full_moon":"🌕","waning_gibbous_moon":"🌖","last_quarter_moon":"🌗","waning_crescent_moon":"🌘","crescent_moon":"🌙","new_moon_with_face":"🌚","first_quarter_moon_with_face":"🌛","last_quarter_moon_with_face":"🌜","full_moon_with_face":"🌝","sun_with_face":"🌞","star2":"🌟","stars":"🌠","thermometer":"🌡","mostly_sunny":"🌤","sun_small_cloud":"🌤","barely_sunny":"đŸŒĨ","sun_behind_cloud":"đŸŒĨ","partly_sunny_rain":"đŸŒĻ","sun_behind_rain_cloud":"đŸŒĻ","rain_cloud":"🌧","snow_cloud":"🌨","lightning":"🌩","lightning_cloud":"🌩","tornado":"đŸŒĒ","tornado_cloud":"đŸŒĒ","fog":"đŸŒĢ","wind_blowing_face":"đŸŒŦ","hotdog":"🌭","taco":"🌮","burrito":"đŸŒ¯","chestnut":"🌰","seedling":"🌱","evergreen_tree":"🌲","deciduous_tree":"đŸŒŗ","palm_tree":"🌴","cactus":"đŸŒĩ","hot_pepper":"đŸŒļ","tulip":"🌷","cherry_blossom":"🌸","rose":"🌹","hibiscus":"đŸŒē","sunflower":"đŸŒģ","blossom":"đŸŒŧ","corn":"đŸŒŊ","ear_of_rice":"🌾","herb":"đŸŒŋ","four_leaf_clover":"🍀","maple_leaf":"🍁","fallen_leaf":"🍂","leaves":"🍃","mushroom":"🍄","tomato":"🍅","eggplant":"🍆","grapes":"🍇","melon":"🍈","watermelon":"🍉","tangerine":"🍊","lemon":"🍋","banana":"🍌","pineapple":"🍍","apple":"🍎","green_apple":"🍏","pear":"🍐","peach":"🍑","cherries":"🍒","strawberry":"🍓","hamburger":"🍔","pizza":"🍕","meat_on_bone":"🍖","poultry_leg":"🍗","rice_cracker":"🍘","rice_ball":"🍙","rice":"🍚","curry":"🍛","ramen":"🍜","spaghetti":"🍝","bread":"🍞","fries":"🍟","sweet_potato":"🍠","dango":"🍡","oden":"đŸĸ","sushi":"đŸŖ","fried_shrimp":"🍤","fish_cake":"đŸĨ","icecream":"đŸĻ","shaved_ice":"🍧","ice_cream":"🍨","doughnut":"🍩","cookie":"đŸĒ","chocolate_bar":"đŸĢ","candy":"đŸŦ","lollipop":"🍭","custard":"🍮","honey_pot":"đŸ¯","cake":"🍰","bento":"🍱","stew":"🍲","egg":"đŸŗ","fork_and_knife":"🍴","tea":"đŸĩ","sake":"đŸļ","wine_glass":"🍷","cocktail":"🍸","tropical_drink":"🍹","beer":"đŸē","beers":"đŸģ","baby_bottle":"đŸŧ","knife_fork_plate":"đŸŊ","champagne":"🍾","popcorn":"đŸŋ","ribbon":"🎀","gift":"🎁","birthday":"🎂","jack_o_lantern":"🎃","christmas_tree":"🎄","santa":"🎅","fireworks":"🎆","sparkler":"🎇","balloon":"🎈","tada":"🎉","confetti_ball":"🎊","tanabata_tree":"🎋","crossed_flags":"🎌","bamboo":"🎍","dolls":"🎎","flags":"🎏","wind_chime":"🎐","rice_scene":"🎑","school_satchel":"🎒","mortar_board":"🎓","medal":"🎖","reminder_ribbon":"🎗","studio_microphone":"🎙","level_slider":"🎚","control_knobs":"🎛","film_frames":"🎞","admission_tickets":"🎟","carousel_horse":"🎠","ferris_wheel":"🎡","roller_coaster":"đŸŽĸ","fishing_pole_and_fish":"đŸŽŖ","microphone":"🎤","movie_camera":"đŸŽĨ","cinema":"đŸŽĻ","headphones":"🎧","art":"🎨","tophat":"🎩","circus_tent":"đŸŽĒ","ticket":"đŸŽĢ","clapper":"đŸŽŦ","performing_arts":"🎭","video_game":"🎮","dart":"đŸŽ¯","slot_machine":"🎰","8ball":"🎱","game_die":"🎲","bowling":"đŸŽŗ","flower_playing_cards":"🎴","musical_note":"đŸŽĩ","notes":"đŸŽļ","saxophone":"🎷","guitar":"🎸","musical_keyboard":"🎹","trumpet":"đŸŽē","violin":"đŸŽģ","musical_score":"đŸŽŧ","running_shirt_with_sash":"đŸŽŊ","tennis":"🎾","ski":"đŸŽŋ","basketball":"🏀","checkered_flag":"🏁","snowboarder":"🏂","runner":"🏃","running":"🏃","surfer":"🏄","sports_medal":"🏅","trophy":"🏆","horse_racing":"🏇","football":"🏈","rugby_football":"🏉","swimmer":"🏊","weight_lifter":"🏋","golfer":"🏌","racing_motorcycle":"🏍","racing_car":"🏎","cricket_bat_and_ball":"🏏","volleyball":"🏐","field_hockey_stick_and_ball":"🏑","ice_hockey_stick_and_puck":"🏒","table_tennis_paddle_and_ball":"🏓","snow_capped_mountain":"🏔","camping":"🏕","beach_with_umbrella":"🏖","building_construction":"🏗","house_buildings":"🏘","cityscape":"🏙","derelict_house_building":"🏚","classical_building":"🏛","desert":"🏜","desert_island":"🏝","national_park":"🏞","stadium":"🏟","house":"🏠","house_with_garden":"🏡","office":"đŸĸ","post_office":"đŸŖ","european_post_office":"🏤","hospital":"đŸĨ","bank":"đŸĻ","atm":"🏧","hotel":"🏨","love_hotel":"🏩","convenience_store":"đŸĒ","school":"đŸĢ","department_store":"đŸŦ","factory":"🏭","izakaya_lantern":"🏮","lantern":"🏮","japanese_castle":"đŸ¯","european_castle":"🏰","waving_white_flag":"đŸŗ","waving_black_flag":"🏴","rosette":"đŸĩ","label":"🏷","badminton_racquet_and_shuttlecock":"🏸","bow_and_arrow":"🏹","amphora":"đŸē","skin-tone-2":"đŸģ","skin-tone-3":"đŸŧ","skin-tone-4":"đŸŊ","skin-tone-5":"🏾","skin-tone-6":"đŸŋ","rat":"🐀","mouse2":"🐁","ox":"🐂","water_buffalo":"🐃","cow2":"🐄","tiger2":"🐅","leopard":"🐆","rabbit2":"🐇","cat2":"🐈","dragon":"🐉","crocodile":"🐊","whale2":"🐋","snail":"🐌","snake":"🐍","racehorse":"🐎","ram":"🐏","goat":"🐐","sheep":"🐑","monkey":"🐒","rooster":"🐓","chicken":"🐔","dog2":"🐕","pig2":"🐖","boar":"🐗","elephant":"🐘","octopus":"🐙","shell":"🐚","bug":"🐛","ant":"🐜","bee":"🐝","honeybee":"🐝","beetle":"🐞","fish":"🐟","tropical_fish":"🐠","blowfish":"🐡","turtle":"đŸĸ","hatching_chick":"đŸŖ","baby_chick":"🐤","hatched_chick":"đŸĨ","bird":"đŸĻ","penguin":"🐧","koala":"🐨","poodle":"🐩","dromedary_camel":"đŸĒ","camel":"đŸĢ","dolphin":"đŸŦ","flipper":"đŸŦ","mouse":"🐭","cow":"🐮","tiger":"đŸ¯","rabbit":"🐰","cat":"🐱","dragon_face":"🐲","whale":"đŸŗ","horse":"🐴","monkey_face":"đŸĩ","dog":"đŸļ","pig":"🐷","frog":"🐸","hamster":"🐹","wolf":"đŸē","bear":"đŸģ","panda_face":"đŸŧ","pig_nose":"đŸŊ","feet":"🐾","paw_prints":"🐾","chipmunk":"đŸŋ","eyes":"👀","eye":"👁","ear":"👂","nose":"👃","lips":"👄","tongue":"👅","point_up_2":"👆","point_down":"👇","point_left":"👈","point_right":"👉","facepunch":"👊","punch":"👊","wave":"👋","ok_hand":"👌","+1":"👍","thumbsup":"👍","-1":"👎","thumbsdown":"👎","clap":"👏","open_hands":"👐","crown":"👑","womans_hat":"👒","eyeglasses":"👓","necktie":"👔","shirt":"👕","tshirt":"👕","jeans":"👖","dress":"👗","kimono":"👘","bikini":"👙","womans_clothes":"👚","purse":"👛","handbag":"👜","pouch":"👝","mans_shoe":"👞","shoe":"👞","athletic_shoe":"👟","high_heel":"👠","sandal":"👡","boot":"đŸ‘ĸ","footprints":"đŸ‘Ŗ","bust_in_silhouette":"👤","busts_in_silhouette":"đŸ‘Ĩ","boy":"đŸ‘Ļ","girl":"👧","man":"👨","woman":"👩","family":"👨‍👩‍đŸ‘Ļ","man-woman-boy":"👨‍👩‍đŸ‘Ļ","couple":"đŸ‘Ģ","man_and_woman_holding_hands":"đŸ‘Ģ","two_men_holding_hands":"đŸ‘Ŧ","two_women_holding_hands":"👭","cop":"👮","dancers":"đŸ‘¯","bride_with_veil":"👰","person_with_blond_hair":"👱","man_with_gua_pi_mao":"👲","man_with_turban":"đŸ‘ŗ","older_man":"👴","older_woman":"đŸ‘ĩ","baby":"đŸ‘ļ","construction_worker":"👷","princess":"👸","japanese_ogre":"👹","japanese_goblin":"đŸ‘ē","ghost":"đŸ‘ģ","angel":"đŸ‘ŧ","alien":"đŸ‘Ŋ","space_invader":"👾","imp":"đŸ‘ŋ","skull":"💀","information_desk_person":"💁","guardsman":"💂","dancer":"💃","lipstick":"💄","nail_care":"💅","massage":"💆","haircut":"💇","barber":"💈","syringe":"💉","pill":"💊","kiss":"💋","love_letter":"💌","ring":"💍","gem":"💎","couplekiss":"💏","bouquet":"💐","couple_with_heart":"💑","wedding":"💒","heartbeat":"💓","broken_heart":"💔","two_hearts":"💕","sparkling_heart":"💖","heartpulse":"💗","cupid":"💘","blue_heart":"💙","green_heart":"💚","yellow_heart":"💛","purple_heart":"💜","gift_heart":"💝","revolving_hearts":"💞","heart_decoration":"💟","diamond_shape_with_a_dot_inside":"💠","bulb":"💡","anger":"đŸ’ĸ","bomb":"đŸ’Ŗ","zzz":"💤","boom":"đŸ’Ĩ","collision":"đŸ’Ĩ","sweat_drops":"đŸ’Ļ","droplet":"💧","dash":"💨","hankey":"💩","poop":"💩","shit":"💩","muscle":"đŸ’Ē","dizzy":"đŸ’Ģ","speech_balloon":"đŸ’Ŧ","thought_balloon":"💭","white_flower":"💮","moneybag":"💰","currency_exchange":"💱","heavy_dollar_sign":"💲","credit_card":"đŸ’ŗ","yen":"💴","dollar":"đŸ’ĩ","euro":"đŸ’ļ","pound":"💷","money_with_wings":"💸","chart":"💹","seat":"đŸ’ē","computer":"đŸ’ģ","briefcase":"đŸ’ŧ","minidisc":"đŸ’Ŋ","floppy_disk":"💾","cd":"đŸ’ŋ","dvd":"📀","file_folder":"📁","open_file_folder":"📂","page_with_curl":"📃","page_facing_up":"📄","date":"📅","calendar":"📆","card_index":"📇","chart_with_upwards_trend":"📈","chart_with_downwards_trend":"📉","bar_chart":"📊","clipboard":"📋","pushpin":"📌","round_pushpin":"📍","paperclip":"📎","straight_ruler":"📏","triangular_ruler":"📐","bookmark_tabs":"📑","ledger":"📒","notebook":"📓","notebook_with_decorative_cover":"📔","closed_book":"📕","book":"📖","open_book":"📖","green_book":"📗","blue_book":"📘","orange_book":"📙","books":"📚","name_badge":"📛","scroll":"📜","memo":"📝","pencil":"📝","telephone_receiver":"📞","pager":"📟","fax":"📠","satellite":"🛰","loudspeaker":"đŸ“ĸ","mega":"đŸ“Ŗ","outbox_tray":"📤","inbox_tray":"đŸ“Ĩ","package":"đŸ“Ļ","e-mail":"📧","incoming_envelope":"📨","envelope_with_arrow":"📩","mailbox_closed":"đŸ“Ē","mailbox":"đŸ“Ģ","mailbox_with_mail":"đŸ“Ŧ","mailbox_with_no_mail":"📭","postbox":"📮","postal_horn":"đŸ“¯","newspaper":"📰","iphone":"📱","calling":"📲","vibration_mode":"đŸ“ŗ","mobile_phone_off":"📴","no_mobile_phones":"đŸ“ĩ","signal_strength":"đŸ“ļ","camera":"📷","camera_with_flash":"📸","video_camera":"📹","tv":"đŸ“ē","radio":"đŸ“ģ","vhs":"đŸ“ŧ","film_projector":"đŸ“Ŋ","prayer_beads":"đŸ“ŋ","twisted_rightwards_arrows":"🔀","repeat":"🔁","repeat_one":"🔂","arrows_clockwise":"🔃","arrows_counterclockwise":"🔄","low_brightness":"🔅","high_brightness":"🔆","mute":"🔇","speaker":"🔈","sound":"🔉","loud_sound":"🔊","battery":"🔋","electric_plug":"🔌","mag":"🔍","mag_right":"🔎","lock_with_ink_pen":"🔏","closed_lock_with_key":"🔐","key":"🔑","lock":"🔒","unlock":"🔓","bell":"🔔","no_bell":"🔕","bookmark":"🔖","link":"🔗","radio_button":"🔘","back":"🔙","end":"🔚","on":"🔛","soon":"🔜","top":"🔝","underage":"🔞","keycap_ten":"🔟","capital_abcd":"🔠","abcd":"🔡","symbols":"đŸ”Ŗ","abc":"🔤","fire":"đŸ”Ĩ","flashlight":"đŸ”Ļ","wrench":"🔧","hammer":"🔨","nut_and_bolt":"🔩","hocho":"đŸ”Ē","knife":"đŸ”Ē","gun":"đŸ”Ģ","microscope":"đŸ”Ŧ","telescope":"🔭","crystal_ball":"🔮","six_pointed_star":"đŸ”¯","beginner":"🔰","trident":"🔱","black_square_button":"🔲","white_square_button":"đŸ”ŗ","red_circle":"🔴","large_blue_circle":"đŸ”ĩ","large_orange_diamond":"đŸ”ļ","large_blue_diamond":"🔷","small_orange_diamond":"🔸","small_blue_diamond":"🔹","small_red_triangle":"đŸ”ē","small_red_triangle_down":"đŸ”ģ","arrow_up_small":"đŸ”ŧ","arrow_down_small":"đŸ”Ŋ","om_symbol":"🕉","dove_of_peace":"🕊","kaaba":"🕋","mosque":"🕌","synagogue":"🕍","menorah_with_nine_branches":"🕎","clock1":"🕐","clock2":"🕑","clock3":"🕒","clock4":"🕓","clock5":"🕔","clock6":"🕕","clock7":"🕖","clock8":"🕗","clock9":"🕘","clock10":"🕙","clock11":"🕚","clock12":"🕛","clock130":"🕜","clock230":"🕝","clock330":"🕞","clock430":"🕟","clock530":"🕠","clock630":"🕡","clock730":"đŸ•ĸ","clock830":"đŸ•Ŗ","clock930":"🕤","clock1030":"đŸ•Ĩ","clock1130":"đŸ•Ļ","clock1230":"🕧","candle":"đŸ•¯","mantelpiece_clock":"🕰","hole":"đŸ•ŗ","man_in_business_suit_levitating":"🕴","sleuth_or_spy":"đŸ•ĩ","dark_sunglasses":"đŸ•ļ","spider":"🕷","spider_web":"🕸","joystick":"🕹","linked_paperclips":"🖇","lower_left_ballpoint_pen":"🖊","lower_left_fountain_pen":"🖋","lower_left_paintbrush":"🖌","lower_left_crayon":"🖍","raised_hand_with_fingers_splayed":"🖐","middle_finger":"🖕","reversed_hand_with_middle_finger_extended":"🖕","spock-hand":"🖖","desktop_computer":"đŸ–Ĩ","printer":"🖨","three_button_mouse":"🖱","trackball":"🖲","frame_with_picture":"đŸ–ŧ","card_index_dividers":"🗂","card_file_box":"🗃","file_cabinet":"🗄","wastebasket":"🗑","spiral_note_pad":"🗒","spiral_calendar_pad":"🗓","compression":"🗜","old_key":"🗝","rolled_up_newspaper":"🗞","dagger_knife":"🗡","speaking_head_in_silhouette":"đŸ—Ŗ","left_speech_bubble":"🗨","right_anger_bubble":"đŸ—¯","ballot_box_with_ballot":"đŸ—ŗ","world_map":"đŸ—ē","mount_fuji":"đŸ—ģ","tokyo_tower":"đŸ—ŧ","statue_of_liberty":"đŸ—Ŋ","japan":"🗾","moyai":"đŸ—ŋ","grinning":"😀","grin":"😁","joy":"😂","smiley":"😃","smile":"😄","sweat_smile":"😅","laughing":"😆","satisfied":"😆","innocent":"😇","smiling_imp":"😈","wink":"😉","blush":"😊","yum":"😋","relieved":"😌","heart_eyes":"😍","sunglasses":"😎","smirk":"😏","neutral_face":"😐","expressionless":"😑","unamused":"😒","sweat":"😓","pensive":"😔","confused":"😕","confounded":"😖","kissing":"😗","kissing_heart":"😘","kissing_smiling_eyes":"😙","kissing_closed_eyes":"😚","stuck_out_tongue":"😛","stuck_out_tongue_winking_eye":"😜","stuck_out_tongue_closed_eyes":"😝","disappointed":"😞","worried":"😟","angry":"😠","rage":"😡","cry":"đŸ˜ĸ","persevere":"đŸ˜Ŗ","triumph":"😤","disappointed_relieved":"đŸ˜Ĩ","frowning":"đŸ˜Ļ","anguished":"😧","fearful":"😨","weary":"😩","sleepy":"đŸ˜Ē","tired_face":"đŸ˜Ģ","grimacing":"đŸ˜Ŧ","sob":"😭","open_mouth":"😮","hushed":"đŸ˜¯","cold_sweat":"😰","scream":"😱","astonished":"😲","flushed":"đŸ˜ŗ","sleeping":"😴","dizzy_face":"đŸ˜ĩ","no_mouth":"đŸ˜ļ","mask":"😷","smile_cat":"😸","joy_cat":"😹","smiley_cat":"đŸ˜ē","heart_eyes_cat":"đŸ˜ģ","smirk_cat":"đŸ˜ŧ","kissing_cat":"đŸ˜Ŋ","pouting_cat":"😾","crying_cat_face":"đŸ˜ŋ","scream_cat":"🙀","slightly_frowning_face":"🙁","slightly_smiling_face":"🙂","upside_down_face":"🙃","face_with_rolling_eyes":"🙄","no_good":"🙅","ok_woman":"🙆","bow":"🙇","see_no_evil":"🙈","hear_no_evil":"🙉","speak_no_evil":"🙊","raising_hand":"🙋","raised_hands":"🙌","person_frowning":"🙍","person_with_pouting_face":"🙎","pray":"🙏","rocket":"🚀","helicopter":"🚁","steam_locomotive":"🚂","railway_car":"🚃","bullettrain_side":"🚄","bullettrain_front":"🚅","train2":"🚆","metro":"🚇","light_rail":"🚈","station":"🚉","tram":"🚊","train":"🚋","bus":"🚌","oncoming_bus":"🚍","trolleybus":"🚎","busstop":"🚏","minibus":"🚐","ambulance":"🚑","fire_engine":"🚒","police_car":"🚓","oncoming_police_car":"🚔","taxi":"🚕","oncoming_taxi":"🚖","car":"🚗","red_car":"🚗","oncoming_automobile":"🚘","blue_car":"🚙","truck":"🚚","articulated_lorry":"🚛","tractor":"🚜","monorail":"🚝","mountain_railway":"🚞","suspension_railway":"🚟","mountain_cableway":"🚠","aerial_tramway":"🚡","ship":"đŸšĸ","rowboat":"đŸšŖ","speedboat":"🚤","traffic_light":"đŸšĨ","vertical_traffic_light":"đŸšĻ","construction":"🚧","rotating_light":"🚨","triangular_flag_on_post":"🚩","door":"đŸšĒ","no_entry_sign":"đŸšĢ","smoking":"đŸšŦ","no_smoking":"🚭","put_litter_in_its_place":"🚮","do_not_litter":"đŸš¯","potable_water":"🚰","non-potable_water":"🚱","bike":"🚲","no_bicycles":"đŸšŗ","bicyclist":"🚴","mountain_bicyclist":"đŸšĩ","walking":"đŸšļ","no_pedestrians":"🚷","children_crossing":"🚸","mens":"🚹","womens":"đŸšē","restroom":"đŸšģ","baby_symbol":"đŸšŧ","toilet":"đŸšŊ","wc":"🚾","shower":"đŸšŋ","bath":"🛀","bathtub":"🛁","passport_control":"🛂","customs":"🛃","baggage_claim":"🛄","left_luggage":"🛅","couch_and_lamp":"🛋","sleeping_accommodation":"🛌","shopping_bags":"🛍","bellhop_bell":"🛎","bed":"🛏","place_of_worship":"🛐","hammer_and_wrench":"🛠","shield":"🛡","oil_drum":"đŸ›ĸ","motorway":"đŸ›Ŗ","railway_track":"🛤","motor_boat":"đŸ›Ĩ","small_airplane":"🛩","airplane_departure":"đŸ›Ģ","airplane_arriving":"đŸ›Ŧ","passenger_ship":"đŸ›ŗ","zipper_mouth_face":"🤐","money_mouth_face":"🤑","face_with_thermometer":"🤒","nerd_face":"🤓","thinking_face":"🤔","face_with_head_bandage":"🤕","robot_face":"🤖","hugging_face":"🤗","the_horns":"🤘","sign_of_the_horns":"🤘","crab":"đŸĻ€","lion_face":"đŸĻ","scorpion":"đŸĻ‚","turkey":"đŸĻƒ","unicorn_face":"đŸĻ„","cheese_wedge":"🧀","hash":"#ī¸âƒŖ","keycap_star":"*âƒŖ","zero":"0ī¸âƒŖ","one":"1ī¸âƒŖ","two":"2ī¸âƒŖ","three":"3ī¸âƒŖ","four":"4ī¸âƒŖ","five":"5ī¸âƒŖ","six":"6ī¸âƒŖ","seven":"7ī¸âƒŖ","eight":"8ī¸âƒŖ","nine":"9ī¸âƒŖ","flag-ac":"đŸ‡Ļ🇨","flag-ad":"đŸ‡Ļ🇩","flag-ae":"đŸ‡ĻđŸ‡Ē","flag-af":"đŸ‡ĻđŸ‡Ģ","flag-ag":"đŸ‡ĻđŸ‡Ŧ","flag-ai":"đŸ‡Ļ🇮","flag-al":"đŸ‡Ļ🇱","flag-am":"đŸ‡Ļ🇲","flag-ao":"đŸ‡Ļ🇴","flag-aq":"đŸ‡ĻđŸ‡ļ","flag-ar":"đŸ‡Ļ🇷","flag-as":"đŸ‡Ļ🇸","flag-at":"đŸ‡Ļ🇹","flag-au":"đŸ‡ĻđŸ‡ē","flag-aw":"đŸ‡ĻđŸ‡ŧ","flag-ax":"đŸ‡ĻđŸ‡Ŋ","flag-az":"đŸ‡ĻđŸ‡ŋ","flag-ba":"🇧đŸ‡Ļ","flag-bb":"🇧🇧","flag-bd":"🇧🇩","flag-be":"🇧đŸ‡Ē","flag-bf":"🇧đŸ‡Ģ","flag-bg":"🇧đŸ‡Ŧ","flag-bh":"🇧🇭","flag-bi":"🇧🇮","flag-bj":"đŸ‡§đŸ‡¯","flag-bl":"🇧🇱","flag-bm":"🇧🇲","flag-bn":"đŸ‡§đŸ‡ŗ","flag-bo":"🇧🇴","flag-bq":"🇧đŸ‡ļ","flag-br":"🇧🇷","flag-bs":"🇧🇸","flag-bt":"🇧🇹","flag-bv":"🇧đŸ‡ģ","flag-bw":"🇧đŸ‡ŧ","flag-by":"🇧🇾","flag-bz":"🇧đŸ‡ŋ","flag-ca":"🇨đŸ‡Ļ","flag-cc":"🇨🇨","flag-cd":"🇨🇩","flag-cf":"🇨đŸ‡Ģ","flag-cg":"🇨đŸ‡Ŧ","flag-ch":"🇨🇭","flag-ci":"🇨🇮","flag-ck":"🇨🇰","flag-cl":"🇨🇱","flag-cm":"🇨🇲","flag-cn":"đŸ‡¨đŸ‡ŗ","cn":"đŸ‡¨đŸ‡ŗ","flag-co":"🇨🇴","flag-cp":"🇨đŸ‡ĩ","flag-cr":"🇨🇷","flag-cu":"🇨đŸ‡ē","flag-cv":"🇨đŸ‡ģ","flag-cw":"🇨đŸ‡ŧ","flag-cx":"🇨đŸ‡Ŋ","flag-cy":"🇨🇾","flag-cz":"🇨đŸ‡ŋ","flag-de":"🇩đŸ‡Ē","de":"🇩đŸ‡Ē","flag-dg":"🇩đŸ‡Ŧ","flag-dj":"đŸ‡ŠđŸ‡¯","flag-dk":"🇩🇰","flag-dm":"🇩🇲","flag-do":"🇩🇴","flag-dz":"🇩đŸ‡ŋ","flag-ea":"đŸ‡ĒđŸ‡Ļ","flag-ec":"đŸ‡Ē🇨","flag-ee":"đŸ‡ĒđŸ‡Ē","flag-eg":"đŸ‡ĒđŸ‡Ŧ","flag-eh":"đŸ‡Ē🇭","flag-er":"đŸ‡Ē🇷","flag-es":"đŸ‡Ē🇸","es":"đŸ‡Ē🇸","flag-et":"đŸ‡Ē🇹","flag-eu":"đŸ‡ĒđŸ‡ē","flag-fi":"đŸ‡Ģ🇮","flag-fj":"đŸ‡ĢđŸ‡¯","flag-fk":"đŸ‡Ģ🇰","flag-fm":"đŸ‡Ģ🇲","flag-fo":"đŸ‡Ģ🇴","flag-fr":"đŸ‡Ģ🇷","fr":"đŸ‡Ģ🇷","flag-ga":"đŸ‡ŦđŸ‡Ļ","flag-gb":"đŸ‡Ŧ🇧","gb":"đŸ‡Ŧ🇧","uk":"đŸ‡Ŧ🇧","flag-gd":"đŸ‡Ŧ🇩","flag-ge":"đŸ‡ŦđŸ‡Ē","flag-gf":"đŸ‡ŦđŸ‡Ģ","flag-gg":"đŸ‡ŦđŸ‡Ŧ","flag-gh":"đŸ‡Ŧ🇭","flag-gi":"đŸ‡Ŧ🇮","flag-gl":"đŸ‡Ŧ🇱","flag-gm":"đŸ‡Ŧ🇲","flag-gn":"đŸ‡ŦđŸ‡ŗ","flag-gp":"đŸ‡ŦđŸ‡ĩ","flag-gq":"đŸ‡ŦđŸ‡ļ","flag-gr":"đŸ‡Ŧ🇷","flag-gs":"đŸ‡Ŧ🇸","flag-gt":"đŸ‡Ŧ🇹","flag-gu":"đŸ‡ŦđŸ‡ē","flag-gw":"đŸ‡ŦđŸ‡ŧ","flag-gy":"đŸ‡Ŧ🇾","flag-hk":"🇭🇰","flag-hm":"🇭🇲","flag-hn":"đŸ‡­đŸ‡ŗ","flag-hr":"🇭🇷","flag-ht":"🇭🇹","flag-hu":"🇭đŸ‡ē","flag-ic":"🇮🇨","flag-id":"🇮🇩","flag-ie":"🇮đŸ‡Ē","flag-il":"🇮🇱","flag-im":"🇮🇲","flag-in":"đŸ‡ŽđŸ‡ŗ","flag-io":"🇮🇴","flag-iq":"🇮đŸ‡ļ","flag-ir":"🇮🇷","flag-is":"🇮🇸","flag-it":"🇮🇹","it":"🇮🇹","flag-je":"đŸ‡¯đŸ‡Ē","flag-jm":"đŸ‡¯đŸ‡˛","flag-jo":"đŸ‡¯đŸ‡´","flag-jp":"đŸ‡¯đŸ‡ĩ","jp":"đŸ‡¯đŸ‡ĩ","flag-ke":"🇰đŸ‡Ē","flag-kg":"🇰đŸ‡Ŧ","flag-kh":"🇰🇭","flag-ki":"🇰🇮","flag-km":"🇰🇲","flag-kn":"đŸ‡°đŸ‡ŗ","flag-kp":"🇰đŸ‡ĩ","flag-kr":"🇰🇷","kr":"🇰🇷","flag-kw":"🇰đŸ‡ŧ","flag-ky":"🇰🇾","flag-kz":"🇰đŸ‡ŋ","flag-la":"🇱đŸ‡Ļ","flag-lb":"🇱🇧","flag-lc":"🇱🇨","flag-li":"🇱🇮","flag-lk":"🇱🇰","flag-lr":"🇱🇷","flag-ls":"🇱🇸","flag-lt":"🇱🇹","flag-lu":"🇱đŸ‡ē","flag-lv":"🇱đŸ‡ģ","flag-ly":"🇱🇾","flag-ma":"🇲đŸ‡Ļ","flag-mc":"🇲🇨","flag-md":"🇲🇩","flag-me":"🇲đŸ‡Ē","flag-mf":"🇲đŸ‡Ģ","flag-mg":"🇲đŸ‡Ŧ","flag-mh":"🇲🇭","flag-mk":"🇲🇰","flag-ml":"🇲🇱","flag-mm":"🇲🇲","flag-mn":"đŸ‡˛đŸ‡ŗ","flag-mo":"🇲🇴","flag-mp":"🇲đŸ‡ĩ","flag-mq":"🇲đŸ‡ļ","flag-mr":"🇲🇷","flag-ms":"🇲🇸","flag-mt":"🇲🇹","flag-mu":"🇲đŸ‡ē","flag-mv":"🇲đŸ‡ģ","flag-mw":"🇲đŸ‡ŧ","flag-mx":"🇲đŸ‡Ŋ","flag-my":"🇲🇾","flag-mz":"🇲đŸ‡ŋ","flag-na":"đŸ‡ŗđŸ‡Ļ","flag-nc":"đŸ‡ŗđŸ‡¨","flag-ne":"đŸ‡ŗđŸ‡Ē","flag-nf":"đŸ‡ŗđŸ‡Ģ","flag-ng":"đŸ‡ŗđŸ‡Ŧ","flag-ni":"đŸ‡ŗđŸ‡Ž","flag-nl":"đŸ‡ŗđŸ‡ą","flag-no":"đŸ‡ŗđŸ‡´","flag-np":"đŸ‡ŗđŸ‡ĩ","flag-nr":"đŸ‡ŗđŸ‡ˇ","flag-nu":"đŸ‡ŗđŸ‡ē","flag-nz":"đŸ‡ŗđŸ‡ŋ","flag-om":"🇴🇲","flag-pa":"đŸ‡ĩđŸ‡Ļ","flag-pe":"đŸ‡ĩđŸ‡Ē","flag-pf":"đŸ‡ĩđŸ‡Ģ","flag-pg":"đŸ‡ĩđŸ‡Ŧ","flag-ph":"đŸ‡ĩ🇭","flag-pk":"đŸ‡ĩ🇰","flag-pl":"đŸ‡ĩ🇱","flag-pm":"đŸ‡ĩ🇲","flag-pn":"đŸ‡ĩđŸ‡ŗ","flag-pr":"đŸ‡ĩ🇷","flag-ps":"đŸ‡ĩ🇸","flag-pt":"đŸ‡ĩ🇹","flag-pw":"đŸ‡ĩđŸ‡ŧ","flag-py":"đŸ‡ĩ🇾","flag-qa":"đŸ‡ļđŸ‡Ļ","flag-re":"🇷đŸ‡Ē","flag-ro":"🇷🇴","flag-rs":"🇷🇸","flag-ru":"🇷đŸ‡ē","ru":"🇷đŸ‡ē","flag-rw":"🇷đŸ‡ŧ","flag-sa":"🇸đŸ‡Ļ","flag-sb":"🇸🇧","flag-sc":"🇸🇨","flag-sd":"🇸🇩","flag-se":"🇸đŸ‡Ē","flag-sg":"🇸đŸ‡Ŧ","flag-sh":"🇸🇭","flag-si":"🇸🇮","flag-sj":"đŸ‡¸đŸ‡¯","flag-sk":"🇸🇰","flag-sl":"🇸🇱","flag-sm":"🇸🇲","flag-sn":"đŸ‡¸đŸ‡ŗ","flag-so":"🇸🇴","flag-sr":"🇸🇷","flag-ss":"🇸🇸","flag-st":"🇸🇹","flag-sv":"🇸đŸ‡ģ","flag-sx":"🇸đŸ‡Ŋ","flag-sy":"🇸🇾","flag-sz":"🇸đŸ‡ŋ","flag-ta":"🇹đŸ‡Ļ","flag-tc":"🇹🇨","flag-td":"🇹🇩","flag-tf":"🇹đŸ‡Ģ","flag-tg":"🇹đŸ‡Ŧ","flag-th":"🇹🇭","flag-tj":"đŸ‡šđŸ‡¯","flag-tk":"🇹🇰","flag-tl":"🇹🇱","flag-tm":"🇹🇲","flag-tn":"đŸ‡šđŸ‡ŗ","flag-to":"🇹🇴","flag-tr":"🇹🇷","flag-tt":"🇹🇹","flag-tv":"🇹đŸ‡ģ","flag-tw":"🇹đŸ‡ŧ","flag-tz":"🇹đŸ‡ŋ","flag-ua":"đŸ‡ēđŸ‡Ļ","flag-ug":"đŸ‡ēđŸ‡Ŧ","flag-um":"đŸ‡ē🇲","flag-us":"đŸ‡ē🇸","us":"đŸ‡ē🇸","flag-uy":"đŸ‡ē🇾","flag-uz":"đŸ‡ēđŸ‡ŋ","flag-va":"đŸ‡ģđŸ‡Ļ","flag-vc":"đŸ‡ģ🇨","flag-ve":"đŸ‡ģđŸ‡Ē","flag-vg":"đŸ‡ģđŸ‡Ŧ","flag-vi":"đŸ‡ģ🇮","flag-vn":"đŸ‡ģđŸ‡ŗ","flag-vu":"đŸ‡ģđŸ‡ē","flag-wf":"đŸ‡ŧđŸ‡Ģ","flag-ws":"đŸ‡ŧ🇸","flag-xk":"đŸ‡Ŋ🇰","flag-ye":"🇾đŸ‡Ē","flag-yt":"🇾🇹","flag-za":"đŸ‡ŋđŸ‡Ļ","flag-zm":"đŸ‡ŋ🇲","flag-zw":"đŸ‡ŋđŸ‡ŧ","man-man-boy":"👨‍👨‍đŸ‘Ļ","man-man-boy-boy":"👨‍👨‍đŸ‘Ļ‍đŸ‘Ļ","man-man-girl":"👨‍👨‍👧","man-man-girl-boy":"👨‍👨‍👧‍đŸ‘Ļ","man-man-girl-girl":"👨‍👨‍👧‍👧","man-woman-boy-boy":"👨‍👩‍đŸ‘Ļ‍đŸ‘Ļ","man-woman-girl":"👨‍👩‍👧","man-woman-girl-boy":"👨‍👩‍👧‍đŸ‘Ļ","man-woman-girl-girl":"👨‍👩‍👧‍👧","man-heart-man":"đŸ‘¨â€â¤ī¸â€đŸ‘¨","man-kiss-man":"đŸ‘¨â€â¤ī¸â€đŸ’‹â€đŸ‘¨","woman-woman-boy":"👩‍👩‍đŸ‘Ļ","woman-woman-boy-boy":"👩‍👩‍đŸ‘Ļ‍đŸ‘Ļ","woman-woman-girl":"👩‍👩‍👧","woman-woman-girl-boy":"👩‍👩‍👧‍đŸ‘Ļ","woman-woman-girl-girl":"👩‍👩‍👧‍👧","woman-heart-woman":"đŸ‘Šâ€â¤ī¸â€đŸ‘Š","woman-kiss-woman":"đŸ‘Šâ€â¤ī¸â€đŸ’‹â€đŸ‘Š"} + +/***/ }), +/* 765 */ /***/ (function(module, exports, __webpack_require__) { /*! @@ -117286,7 +128367,7 @@ module.exports = { * Released under the MIT License. */ -var removeTrailingSeparator = __webpack_require__(616); +var removeTrailingSeparator = __webpack_require__(796); module.exports = function normalizePath(str, stripTrailing) { if (typeof str !== 'string') { @@ -117301,179 +128382,221 @@ module.exports = function normalizePath(str, stripTrailing) { /***/ }), -/* 593 */ +/* 766 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var url = __webpack_require__(14); -var punycode = __webpack_require__(230); -var queryString = __webpack_require__(608); -var prependHttp = __webpack_require__(601); -var sortKeys = __webpack_require__(645); -var objectAssign = __webpack_require__(302); -var DEFAULT_PORTS = { - 'http:': 80, - 'https:': 443, - 'ftp:': 21 -}; +let path -// protocols that always contain a `//`` bit -var slashedProtocol = { - 'http': true, - 'https': true, - 'ftp': true, - 'gopher': true, - 'file': true, - 'http:': true, - 'https:': true, - 'ftp:': true, - 'gopher:': true, - 'file:': true -}; +class LogicalTree { + constructor (name, address, opts) { + this.name = name + this.version = opts.version + this.address = address || '' + this.optional = !!opts.optional + this.dev = !!opts.dev + this.bundled = !!opts.bundled + this.resolved = opts.resolved + this.integrity = opts.integrity + this.dependencies = new Map() + this.requiredBy = new Set() + } -function testParameter(name, filters) { - return filters.some(function (filter) { - return filter instanceof RegExp ? filter.test(name) : filter === name; - }); + get isRoot () { return !this.requiredBy.size } + + addDep (dep) { + this.dependencies.set(dep.name, dep) + dep.requiredBy.add(this) + return this + } + + delDep (dep) { + this.dependencies.delete(dep.name) + dep.requiredBy.delete(this) + return this + } + + getDep (name) { + return this.dependencies.get(name) + } + + path (prefix) { + if (this.isRoot) { + // The address of the root is the prefix itself. + return prefix || '' + } else { + if (!path) { path = __webpack_require__(0) } + return path.join( + prefix || '', + 'node_modules', + this.address.replace(/:/g, '/node_modules/') + ) + } + } + + // This finds cycles _from_ a given node: if some deeper dep has + // its own cycle, but that cycle does not refer to this node, + // it will return false. + hasCycle (_seen, _from) { + if (!_seen) { _seen = new Set() } + if (!_from) { _from = this } + for (let dep of this.dependencies.values()) { + if (_seen.has(dep)) { continue } + _seen.add(dep) + if (dep === _from || dep.hasCycle(_seen, _from)) { + return true + } + } + return false + } + + forEachAsync (fn, opts, _pending) { + if (!opts) { opts = _pending || {} } + if (!_pending) { _pending = new Map() } + const P = opts.Promise || Promise + if (_pending.has(this)) { + return P.resolve(this.hasCycle() || _pending.get(this)) + } + const pending = P.resolve().then(() => { + return fn(this, () => { + return promiseMap( + this.dependencies.values(), + dep => dep.forEachAsync(fn, opts, _pending), + opts + ) + }) + }) + _pending.set(this, pending) + return pending + } + + forEach (fn, _seen) { + if (!_seen) { _seen = new Set() } + if (_seen.has(this)) { return } + _seen.add(this) + fn(this, () => { + for (let dep of this.dependencies.values()) { + dep.forEach(fn, _seen) + } + }) + } } -module.exports = function (str, opts) { - opts = objectAssign({ - normalizeProtocol: true, - normalizeHttps: false, - stripFragment: true, - stripWWW: true, - removeQueryParameters: [/^utm_\w+/i], - removeTrailingSlash: true, - removeDirectoryIndex: false - }, opts); +module.exports = lockTree +function lockTree (pkg, pkgLock, opts) { + const tree = makeNode(pkg.name, null, pkg) + const allDeps = new Map() + Array.from( + new Set(Object.keys(pkg.devDependencies || {}) + .concat(Object.keys(pkg.optionalDependencies || {})) + .concat(Object.keys(pkg.dependencies || {}))) + ).forEach(name => { + let dep = allDeps.get(name) + if (!dep) { + const depNode = (pkgLock.dependencies || {})[name] + dep = makeNode(name, name, depNode) + } + addChild(dep, tree, allDeps, pkgLock) + }) + return tree +} - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } +module.exports.node = makeNode +function makeNode (name, address, opts) { + return new LogicalTree(name, address, opts || {}) +} - var hasRelativeProtocol = str.indexOf('//') === 0; +function addChild (dep, tree, allDeps, pkgLock) { + tree.addDep(dep) + allDeps.set(dep.address, dep) + const addr = dep.address + const lockNode = atAddr(pkgLock, addr) + Object.keys(lockNode.requires || {}).forEach(name => { + const tdepAddr = reqAddr(pkgLock, name, addr) + let tdep = allDeps.get(tdepAddr) + if (!tdep) { + tdep = makeNode(name, tdepAddr, atAddr(pkgLock, tdepAddr)) + addChild(tdep, dep, allDeps, pkgLock) + } else { + dep.addDep(tdep) + } + }) +} - // prepend protocol - str = prependHttp(str.trim()).replace(/^\/\//, 'http://'); +module.exports._reqAddr = reqAddr +function reqAddr (pkgLock, name, fromAddr) { + const lockNode = atAddr(pkgLock, fromAddr) + const child = (lockNode.dependencies || {})[name] + if (child) { + return `${fromAddr}:${name}` + } else { + const parts = fromAddr.split(':') + while (parts.length) { + parts.pop() + const joined = parts.join(':') + const parent = atAddr(pkgLock, joined) + if (parent) { + const child = (parent.dependencies || {})[name] + if (child) { + return `${joined}${parts.length ? ':' : ''}${name}` + } + } + } + const err = new Error(`${name} not accessible from ${fromAddr}`) + err.pkgLock = pkgLock + err.target = name + err.from = fromAddr + throw err + } +} - var urlObj = url.parse(str); +module.exports._atAddr = atAddr +function atAddr (pkgLock, addr) { + if (!addr.length) { return pkgLock } + const parts = addr.split(':') + return parts.reduce((acc, next) => { + return acc && (acc.dependencies || {})[next] + }, pkgLock) +} - if (opts.normalizeHttps && urlObj.protocol === 'https:') { - urlObj.protocol = 'http:'; - } +function promiseMap (arr, fn, opts, _index) { + _index = _index || 0 + const P = (opts && opts.Promise) || Promise + if (P.map) { + return P.map(arr, fn, opts) + } else { + if (!(arr instanceof Array)) { + arr = Array.from(arr) + } + if (_index >= arr.length) { + return P.resolve() + } else { + return P.resolve(fn(arr[_index], _index, arr)) + .then(() => promiseMap(arr, fn, opts, _index + 1)) + } + } +} - if (!urlObj.hostname && !urlObj.pathname) { - throw new Error('Invalid URL'); - } - // prevent these from being used by `url.format` - delete urlObj.host; - delete urlObj.query; +/***/ }), +/* 767 */ +/***/ (function(module, exports, __webpack_require__) { - // remove fragment - if (opts.stripFragment) { - delete urlObj.hash; - } +"use strict"; - // remove default port - var port = DEFAULT_PORTS[urlObj.protocol]; - if (Number(urlObj.port) === port) { - delete urlObj.port; - } - - // remove duplicate slashes - if (urlObj.pathname) { - urlObj.pathname = urlObj.pathname.replace(/\/{2,}/g, '/'); - } - - // decode URI octets - if (urlObj.pathname) { - urlObj.pathname = decodeURI(urlObj.pathname); - } - - // remove directory index - if (opts.removeDirectoryIndex === true) { - opts.removeDirectoryIndex = [/^index\.[a-z]+$/]; - } - - if (Array.isArray(opts.removeDirectoryIndex) && opts.removeDirectoryIndex.length) { - var pathComponents = urlObj.pathname.split('/'); - var lastComponent = pathComponents[pathComponents.length - 1]; - - if (testParameter(lastComponent, opts.removeDirectoryIndex)) { - pathComponents = pathComponents.slice(0, pathComponents.length - 1); - urlObj.pathname = pathComponents.slice(1).join('/') + '/'; - } - } - - // resolve relative paths, but only for slashed protocols - if (slashedProtocol[urlObj.protocol]) { - var domain = urlObj.protocol + '//' + urlObj.hostname; - var relative = url.resolve(domain, urlObj.pathname); - urlObj.pathname = relative.replace(domain, ''); - } - - if (urlObj.hostname) { - // IDN to Unicode - urlObj.hostname = punycode.toUnicode(urlObj.hostname).toLowerCase(); - - // remove trailing dot - urlObj.hostname = urlObj.hostname.replace(/\.$/, ''); - - // remove `www.` - if (opts.stripWWW) { - urlObj.hostname = urlObj.hostname.replace(/^www\./, ''); - } - } - - // remove URL with empty query string - if (urlObj.search === '?') { - delete urlObj.search; - } - - var queryParameters = queryString.parse(urlObj.search); - - // remove query unwanted parameters - if (Array.isArray(opts.removeQueryParameters)) { - for (var key in queryParameters) { - if (testParameter(key, opts.removeQueryParameters)) { - delete queryParameters[key]; - } - } - } - - // sort query parameters - urlObj.search = queryString.stringify(sortKeys(queryParameters)); - - // decode query parameters - urlObj.search = decodeURIComponent(urlObj.search); - - // take advantage of many of the Node `url` normalizations - str = url.format(urlObj); - - // remove ending `/` - if (opts.removeTrailingSlash || urlObj.pathname === '/') { - str = str.replace(/\/$/, ''); - } - - // restore relative protocol, if applicable - if (hasRelativeProtocol && !opts.normalizeProtocol) { - str = str.replace(/^http:\/\//, '//'); - } - - return str; +module.exports = Number.isNaN || function (x) { + return x !== x; }; /***/ }), -/* 594 */ +/* 768 */ /***/ (function(module, exports, __webpack_require__) { -var crypto = __webpack_require__(8) - , qs = __webpack_require__(152) +var crypto = __webpack_require__(11) + , qs = __webpack_require__(196) ; function sha1 (key, body) { @@ -117611,7 +128734,7 @@ exports.generateBase = generateBase /***/ }), -/* 595 */ +/* 769 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -117624,8 +128747,8 @@ exports.generateBase = generateBase -var isObject = __webpack_require__(566); -var forOwn = __webpack_require__(501); +var isObject = __webpack_require__(735); +var forOwn = __webpack_require__(770); module.exports = function omit(obj, keys) { if (!isObject(obj)) return {}; @@ -117658,12 +128781,38 @@ module.exports = function omit(obj, keys) { /***/ }), -/* 596 */ +/* 770 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * for-own + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + + + +var forIn = __webpack_require__(647); +var hasOwn = Object.prototype.hasOwnProperty; + +module.exports = function forOwn(obj, fn, thisArg) { + forIn(obj, function(val, key) { + if (hasOwn.call(obj, key)) { + return fn.call(thisArg, obj[key], key, obj); + } + }); +}; + + +/***/ }), +/* 771 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const mimicFn = __webpack_require__(589); +const mimicFn = __webpack_require__(760); module.exports = (fn, opts) => { // TODO: Remove this in v3 @@ -117704,7 +128853,7 @@ module.exports = (fn, opts) => { /***/ }), -/* 597 */ +/* 772 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -117736,7 +128885,7 @@ module.exports = function () { /***/ }), -/* 598 */ +/* 773 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -117749,10 +128898,10 @@ module.exports = function () { -var isGlob = __webpack_require__(140); -var findBase = __webpack_require__(505); -var extglob = __webpack_require__(139); -var dotfile = __webpack_require__(564); +var isGlob = __webpack_require__(178); +var findBase = __webpack_require__(652); +var extglob = __webpack_require__(177); +var dotfile = __webpack_require__(733); /** * Expose `cache` @@ -117899,11 +129048,112 @@ function unescape(str) { /***/ }), -/* 599 */ +/* 774 */ /***/ (function(module, exports, __webpack_require__) { -var duplexify = __webpack_require__(287) -var through = __webpack_require__(326) +"use strict"; + + +var isWindows = process.platform === 'win32'; + +// Regex to split a windows path into three parts: [*, device, slash, +// tail] windows-only +var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + +// Regex to split the tail part of the above into [*, dir, basename, ext] +var splitTailRe = + /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; + +var win32 = {}; + +// Function to split a filename into [root, dir, basename, ext] +function win32SplitPath(filename) { + // Separate device+slash from tail + var result = splitDeviceRe.exec(filename), + device = (result[1] || '') + (result[2] || ''), + tail = result[3] || ''; + // Split the tail into dir, basename and extension + var result2 = splitTailRe.exec(tail), + dir = result2[1], + basename = result2[2], + ext = result2[3]; + return [device, dir, basename, ext]; +} + +win32.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = win32SplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + + +// Split a filename into [root, dir, basename, ext], unix version +// 'root' is just a slash, or nothing. +var splitPathRe = + /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; +var posix = {}; + + +function posixSplitPath(filename) { + return splitPathRe.exec(filename).slice(1); +} + + +posix.parse = function(pathString) { + if (typeof pathString !== 'string') { + throw new TypeError( + "Parameter 'pathString' must be a string, not " + typeof pathString + ); + } + var allParts = posixSplitPath(pathString); + if (!allParts || allParts.length !== 4) { + throw new TypeError("Invalid path '" + pathString + "'"); + } + allParts[1] = allParts[1] || ''; + allParts[2] = allParts[2] || ''; + allParts[3] = allParts[3] || ''; + + return { + root: allParts[0], + dir: allParts[0] + allParts[1].slice(0, -1), + base: allParts[2], + ext: allParts[3], + name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + }; +}; + + +if (isWindows) + module.exports = win32.parse; +else /* posix */ + module.exports = posix.parse; + +module.exports.posix = posix.parse; +module.exports.win32 = win32.parse; + + +/***/ }), +/* 775 */ +/***/ (function(module, exports, __webpack_require__) { + +var duplexify = __webpack_require__(386) +var through = __webpack_require__(461) +var bufferFrom = __webpack_require__(595) var noop = function() {} @@ -117926,7 +129176,7 @@ var peek = function(opts, onpeek) { var peeker = through.obj({highWaterMark:1}, function(data, enc, cb) { if (isObject(data)) return ready(data, null, cb) - if (!Buffer.isBuffer(data)) data = new Buffer(data) + if (!Buffer.isBuffer(data)) data = bufferFrom(data) if (newline) { var nl = Array.prototype.indexOf.call(data, 10) @@ -117979,13 +129229,14 @@ var peek = function(opts, onpeek) { module.exports = peek + /***/ }), -/* 600 */ +/* 776 */ /***/ (function(module, exports) { -// Generated by CoffeeScript 1.7.1 +// Generated by CoffeeScript 1.12.2 (function() { - var getNanoSeconds, hrtime, loadTime; + var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime; if ((typeof performance !== "undefined" && performance !== null) && performance.now) { module.exports = function() { @@ -117993,7 +129244,7 @@ module.exports = peek }; } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) { module.exports = function() { - return (getNanoSeconds() - loadTime) / 1e6; + return (getNanoSeconds() - nodeLoadTime) / 1e6; }; hrtime = process.hrtime; getNanoSeconds = function() { @@ -118001,7 +129252,9 @@ module.exports = peek hr = hrtime(); return hr[0] * 1e9 + hr[1]; }; - loadTime = getNanoSeconds(); + moduleLoadTime = getNanoSeconds(); + upTime = process.uptime() * 1e9; + nodeLoadTime = moduleLoadTime - upTime; } else if (Date.now) { module.exports = function() { return Date.now() - loadTime; @@ -118016,30 +129269,33 @@ module.exports = peek }).call(this); +//# sourceMappingURL=performance-now.js.map + /***/ }), -/* 601 */ +/* 777 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = function (url) { +module.exports = (url, opts) => { if (typeof url !== 'string') { - throw new TypeError('Expected a string, got ' + typeof url); + throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof url}\``); } url = url.trim(); + opts = Object.assign({https: false}, opts); if (/^\.*\/|^(?!localhost)\w+:/.test(url)) { return url; } - return url.replace(/^(?!(?:\w+:)?\/\/)/, 'http://'); + return url.replace(/^(?!(?:\w+:)?\/\/)/, opts.https ? 'https://' : 'http://'); }; /***/ }), -/* 602 */ +/* 778 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -118099,7 +129355,7 @@ function randomize() { var cache = {}; /***/ }), -/* 603 */ +/* 779 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -118146,7 +129402,7 @@ module.exports = syncFs; /***/ }), -/* 604 */ +/* 780 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -118891,12 +130147,98 @@ exports.unquoted = unquoted; /***/ }), -/* 605 */ +/* 781 */ /***/ (function(module, exports, __webpack_require__) { -var pump = __webpack_require__(304) -var inherits = __webpack_require__(39) -var Duplexify = __webpack_require__(287) +var once = __webpack_require__(83) +var eos = __webpack_require__(173) +var fs = __webpack_require__(5) // we only need fs to get the ReadStream and WriteStream prototypes + +var noop = function () {} + +var isFn = function (fn) { + return typeof fn === 'function' +} + +var isFS = function (stream) { + 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 + + +/***/ }), +/* 782 */ +/***/ (function(module, exports, __webpack_require__) { + +var pump = __webpack_require__(783) +var inherits = __webpack_require__(61) +var Duplexify = __webpack_require__(386) var toArray = function(args) { if (!args.length) return [] @@ -118934,8 +130276,12 @@ var define = function(opts) { pump(streams, function(err) { self.removeListener('close', onclose) - if (err) return self.destroy(err) + if (err) return self.destroy(err.message === 'premature close' ? null : err) ended = true + // pump ends after the last stream is not writable *but* + // pumpify still forwards the readable part so we need to catch errors + // still, so reenable autoDestroy in this case + if (self._autoDestroy === false) self._autoDestroy = true self.uncork() }) @@ -118947,18 +130293,107 @@ var define = function(opts) { return Pumpify } -module.exports = define({destroy:false}) -module.exports.obj = define({destroy:false, objectMode:true, highWaterMark:16}) +module.exports = define({autoDestroy:false, destroy:false}) +module.exports.obj = define({autoDestroy: false, destroy:false, objectMode:true, highWaterMark:16}) +module.exports.ctor = define /***/ }), -/* 606 */ +/* 783 */ +/***/ (function(module, exports, __webpack_require__) { + +var once = __webpack_require__(83) +var eos = __webpack_require__(173) +var fs = __webpack_require__(5) // 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) + }) + }) + + streams.reduce(pipe) +} + +module.exports = pump + + +/***/ }), +/* 784 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(307); +var utils = __webpack_require__(405); var has = Object.prototype.hasOwnProperty; @@ -118976,19 +130411,23 @@ var defaults = { var parseValues = function parseQueryStringValues(str, options) { var obj = {}; - var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); + var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; + var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; + var parts = cleanStr.split(options.delimiter, limit); for (var i = 0; i < parts.length; ++i) { var part = parts[i]; - var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; + + var bracketEqualsPos = part.indexOf(']='); + var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; var key, val; if (pos === -1) { - key = options.decoder(part); + key = options.decoder(part, defaults.decoder); val = options.strictNullHandling ? null : ''; } else { - key = options.decoder(part.slice(0, pos)); - val = options.decoder(part.slice(pos + 1)); + key = options.decoder(part.slice(0, pos), defaults.decoder); + val = options.decoder(part.slice(pos + 1), defaults.decoder); } if (has.call(obj, key)) { obj[key] = [].concat(obj[key]).concat(val); @@ -119000,36 +130439,38 @@ var parseValues = function parseQueryStringValues(str, options) { return obj; }; -var parseObject = function parseObjectRecursive(chain, val, options) { - if (!chain.length) { - return val; - } +var parseObject = function (chain, val, options) { + var leaf = val; - var root = chain.shift(); + for (var i = chain.length - 1; i >= 0; --i) { + var obj; + var root = chain[i]; - var obj; - if (root === '[]') { - obj = []; - obj = obj.concat(parseObject(chain, val, options)); - } else { - obj = options.plainObjects ? Object.create(null) : {}; - var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; - var index = parseInt(cleanRoot, 10); - if ( - !isNaN(index) && - root !== cleanRoot && - String(index) === cleanRoot && - index >= 0 && - (options.parseArrays && index <= options.arrayLimit) - ) { + if (root === '[]') { obj = []; - obj[index] = parseObject(chain, val, options); + obj = obj.concat(leaf); } else { - obj[cleanRoot] = parseObject(chain, val, options); + obj = options.plainObjects ? Object.create(null) : {}; + var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; + var index = parseInt(cleanRoot, 10); + if ( + !isNaN(index) + && root !== cleanRoot + && String(index) === cleanRoot + && index >= 0 + && (options.parseArrays && index <= options.arrayLimit) + ) { + obj = []; + obj[index] = leaf; + } else { + obj[cleanRoot] = leaf; + } } + + leaf = obj; } - return obj; + return leaf; }; var parseKeys = function parseQueryStringKeys(givenKey, val, options) { @@ -119088,12 +130529,13 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options) { }; module.exports = function (str, opts) { - var options = opts || {}; + var options = opts ? utils.assign({}, opts) : {}; if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { throw new TypeError('Decoder has to be a function.'); } + options.ignoreQueryPrefix = options.ignoreQueryPrefix === true; options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; @@ -119126,14 +130568,14 @@ module.exports = function (str, opts) { /***/ }), -/* 607 */ +/* 785 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(307); -var formats = __webpack_require__(305); +var utils = __webpack_require__(405); +var formats = __webpack_require__(403); var arrayPrefixGenerators = { brackets: function brackets(prefix) { // eslint-disable-line func-name-matching @@ -119182,7 +130624,7 @@ var stringify = function stringify( // eslint-disable-line func-name-matching obj = serializeDate(obj); } else if (obj === null) { if (strictNullHandling) { - return encoder && !encodeValuesOnly ? encoder(prefix) : prefix; + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; } obj = ''; @@ -119190,8 +130632,8 @@ var stringify = function stringify( // eslint-disable-line func-name-matching if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { if (encoder) { - var keyValue = encodeValuesOnly ? prefix : encoder(prefix); - return [formatter(keyValue) + '=' + formatter(encoder(obj))]; + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder); + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))]; } return [formatter(prefix) + '=' + formatter(String(obj))]; } @@ -119255,7 +130697,7 @@ var stringify = function stringify( // eslint-disable-line func-name-matching module.exports = function (object, opts) { var obj = object; - var options = opts || {}; + var options = opts ? utils.assign({}, opts) : {}; if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { throw new TypeError('Encoder has to be a function.'); @@ -119271,7 +130713,7 @@ module.exports = function (object, opts) { var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate; var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly; if (typeof options.format === 'undefined') { - options.format = formats.default; + options.format = formats['default']; } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { throw new TypeError('Unknown format option provided.'); } @@ -119335,18 +130777,22 @@ module.exports = function (object, opts) { )); } - return keys.join(delimiter); + var joined = keys.join(delimiter); + var prefix = options.addQueryPrefix === true ? '?' : ''; + + return joined.length > 0 ? prefix + joined : ''; }; /***/ }), -/* 608 */ +/* 786 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var strictUriEncode = __webpack_require__(653); -var objectAssign = __webpack_require__(302); +var strictUriEncode = __webpack_require__(943); +var objectAssign = __webpack_require__(303); +var decodeComponent = __webpack_require__(630); function encoderForArrayFormat(opts) { switch (opts.arrayFormat) { @@ -119458,11 +130904,15 @@ function keysSorter(input) { return input; } -exports.extract = function (str) { - return str.split('?')[1] || ''; -}; +function extract(str) { + var queryStart = str.indexOf('?'); + if (queryStart === -1) { + return ''; + } + return str.slice(queryStart + 1); +} -exports.parse = function (str, opts) { +function parse(str, opts) { opts = objectAssign({arrayFormat: 'none'}, opts); var formatter = parserForArrayFormat(opts); @@ -119475,7 +130925,7 @@ exports.parse = function (str, opts) { return ret; } - str = str.trim().replace(/^(\?|#|&)/, ''); + str = str.trim().replace(/^[?#&]/, ''); if (!str) { return ret; @@ -119490,9 +130940,9 @@ exports.parse = function (str, opts) { // missing `=` should be `null`: // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters - val = val === undefined ? null : decodeURIComponent(val); + val = val === undefined ? null : decodeComponent(val); - formatter(decodeURIComponent(key), val, ret); + formatter(decodeComponent(key), val, ret); }); return Object.keys(ret).sort().reduce(function (result, key) { @@ -119506,7 +130956,10 @@ exports.parse = function (str, opts) { return result; }, Object.create(null)); -}; +} + +exports.extract = extract; +exports.parse = parse; exports.stringify = function (obj, opts) { var defaults = { @@ -119517,9 +130970,13 @@ exports.stringify = function (obj, opts) { opts = objectAssign(defaults, opts); + if (opts.sort === false) { + opts.sort = function () {}; + } + var formatter = encoderForArrayFormat(opts); - return obj ? Object.keys(obj).sort().map(function (key) { + return obj ? Object.keys(obj).sort(opts.sort).map(function (key) { var val = obj[key]; if (val === undefined) { @@ -119550,30 +131007,38 @@ exports.stringify = function (obj, opts) { }).join('&') : ''; }; +exports.parseUrl = function (str, opts) { + return { + url: str.split('?')[0] || '', + query: parse(extract(str), opts) + }; +}; + /***/ }), -/* 609 */ +/* 787 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * randomatic * - * This was originally inspired by - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT License (MIT) + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. */ -var isNumber = __webpack_require__(295); -var typeOf = __webpack_require__(222); +var isNumber = __webpack_require__(788); +var typeOf = __webpack_require__(789); +var mathRandom = __webpack_require__(751); /** * Expose `randomatic` */ module.exports = randomatic; +module.exports.isCrypto = !!mathRandom.cryptographic; /** * Available mask characters @@ -119586,7 +131051,7 @@ var type = { special: '~!@#$%^&()_+-={}[];\',.' }; -type.all = type.lower + type.upper + type.number; +type.all = type.lower + type.upper + type.number + type.special; /** * Generate random character sequences of a specified `length`, @@ -119610,7 +131075,9 @@ function randomatic(pattern, length, options) { length = pattern.length; } else if (isNumber(pattern)) { - options = {}; length = pattern; pattern = '*'; + options = {}; + length = pattern; + pattern = '*'; } } @@ -119635,21 +131102,184 @@ function randomatic(pattern, length, options) { if (custom) mask += pattern; while (length--) { - res += mask.charAt(parseInt(Math.random() * mask.length, 10)); + res += mask.charAt(parseInt(mathRandom() * mask.length, 10)); } return res; }; /***/ }), -/* 610 */ +/* 788 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/*! + * is-number + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + + + +module.exports = function isNumber(num) { + var type = typeof num; + + if (type === 'string' || num instanceof String) { + // an empty string would be coerced to true with the below logic + if (!num.trim()) return false; + } else if (type !== 'number' && !(num instanceof Number)) { + return false; + } + + return (num - num + 1) >= 0; +}; + + +/***/ }), +/* 789 */ +/***/ (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; +} + + +/***/ }), +/* 790 */ /***/ (function(module, exports, __webpack_require__) { module.exports = read -var readline = __webpack_require__(153) -var Mute = __webpack_require__(300) +var readline = __webpack_require__(197) +var Mute = __webpack_require__(401) function read (opts, cb) { if (opts.num) { @@ -119761,17 +131391,38 @@ function read (opts, cb) { /***/ }), -/* 611 */ +/* 791 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = __webpack_require__(74).Duplex +module.exports = __webpack_require__(102).Duplex /***/ }), -/* 612 */ +/* 792 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; +// 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. + // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. @@ -119780,11 +131431,11 @@ module.exports = __webpack_require__(74).Duplex module.exports = PassThrough; -var Transform = __webpack_require__(309); +var Transform = __webpack_require__(407); /**/ -var util = __webpack_require__(110); -util.inherits = __webpack_require__(39); +var util = __webpack_require__(113); +util.inherits = __webpack_require__(61); /**/ util.inherits(PassThrough, Transform); @@ -119800,98 +131451,112 @@ PassThrough.prototype._transform = function (chunk, encoding, cb) { }; /***/ }), -/* 613 */ +/* 793 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Buffer = __webpack_require__(121).Buffer; -/**/ -var bufferShim = __webpack_require__(176); -/**/ +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -module.exports = BufferList; +var Buffer = __webpack_require__(45).Buffer; +var util = __webpack_require__(3); -function BufferList() { - this.head = null; - this.tail = null; - this.length = 0; +function copyBuffer(src, target, offset) { + src.copy(target, offset); } -BufferList.prototype.push = function (v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; -}; +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); -BufferList.prototype.unshift = function (v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; -}; - -BufferList.prototype.shift = function () { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; -}; - -BufferList.prototype.clear = function () { - this.head = this.tail = null; - this.length = 0; -}; - -BufferList.prototype.join = function (s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) { - ret += s + p.data; - }return ret; -}; - -BufferList.prototype.concat = function (n) { - if (this.length === 0) return bufferShim.alloc(0); - if (this.length === 1) return this.head.data; - var ret = bufferShim.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - p.data.copy(ret, i); - i += p.data.length; - p = p.next; + this.head = null; + this.tail = null; + this.length = 0; } - return ret; -}; + + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; + + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; + + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; + + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; + + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; + + return BufferList; +}(); + +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} /***/ }), -/* 614 */ +/* 794 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = __webpack_require__(74).Transform +module.exports = __webpack_require__(102).Transform /***/ }), -/* 615 */ +/* 795 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /*! * regex-cache * - * Copyright (c) 2015 Jon Schlinkert. - * Licensed under the MIT license. + * Copyright (c) 2015-2017, Jon Schlinkert. + * Released under the MIT License. */ -var isPrimitive = __webpack_require__(296); -var equal = __webpack_require__(565); +var equal = __webpack_require__(734); var basic = {}; var cache = {}; @@ -119953,26 +131618,30 @@ module.exports.basic = basic; /***/ }), -/* 616 */ +/* 796 */ /***/ (function(module, exports) { -const isWin = process.platform === 'win32'; +var isWin = process.platform === 'win32'; module.exports = function (str) { - while (endsInSeparator(str)) { - str = str.slice(0, -1); + var i = str.length - 1; + if (i < 2) { + return str; } - return str; + while (isSeparator(str, i)) { + i--; + } + return str.substr(0, i + 1); }; -function endsInSeparator(str) { - var last = str[str.length - 1]; - return str.length > 1 && (last === '/' || (isWin && last === '\\')); +function isSeparator(str, i) { + var char = str[i]; + return i > 0 && (char === '/' || (isWin && char === '\\')); } /***/ }), -/* 617 */ +/* 797 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -120049,47 +131718,17 @@ function repeat(str, num) { /***/ }), -/* 618 */ +/* 798 */ /***/ (function(module, exports) { -module.exports = { - "name": "request-capture-har", - "version": "1.2.2", - "description": "Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client", - "main": "request-capture-har.js", - "scripts": { - "test": "semistandard", - "travis": "npm test && node request-capture-har.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/paulirish/node-request-capture-har.git" - }, - "keywords": [ - "http", - "request", - "har" - ], - "author": "Lars Thorup (http://github.com/larsthorup)", - "license": "MIT", - "bugs": { - "url": "https://github.com/paulirish/node-request-capture-har/issues" - }, - "homepage": "https://github.com/paulirish/node-request-capture-har#readme", - "files": [ - "request-capture-har.js" - ], - "devDependencies": { - "semistandard": "^8.0.0" - } -}; +module.exports = {"name":"request-capture-har","version":"1.2.2","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","main":"request-capture-har.js","scripts":{"test":"semistandard","travis":"npm test && node request-capture-har.js"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"keywords":["http","request","har"],"author":"Lars Thorup (http://github.com/larsthorup)","license":"MIT","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","files":["request-capture-har.js"],"devDependencies":{"semistandard":"^8.0.0"}} /***/ }), -/* 619 */ +/* 799 */ /***/ (function(module, exports, __webpack_require__) { var fs = __webpack_require__(5); -var pkg = __webpack_require__(618); +var pkg = __webpack_require__(798); function buildHarHeaders (headers) { return headers ? Object.keys(headers).map(function (key) { @@ -120233,7 +131872,7 @@ module.exports = HarWrapper; /***/ }), -/* 620 */ +/* 800 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -120253,15 +131892,14 @@ module.exports = HarWrapper; -var extend = __webpack_require__(208) - , cookies = __webpack_require__(314) - , helpers = __webpack_require__(226) +var extend = __webpack_require__(269) +var cookies = __webpack_require__(412) +var helpers = __webpack_require__(305) var paramsHaveRequestBody = helpers.paramsHaveRequestBody - // organize params for patch, post, put, head, del -function initParams(uri, options, callback) { +function initParams (uri, options, callback) { if (typeof options === 'function') { callback = options } @@ -120305,6 +131943,7 @@ function verbFunc (verb) { // define like this to please codeintel/intellisense IDEs request.get = verbFunc('get') request.head = verbFunc('head') +request.options = verbFunc('options') request.post = verbFunc('post') request.put = verbFunc('put') request.patch = verbFunc('patch') @@ -120320,7 +131959,6 @@ request.cookie = function (str) { } function wrapRequestMethod (method, options, requester, verb) { - return function (uri, opts, callback) { var params = initParams(uri, opts, callback) @@ -120351,15 +131989,15 @@ request.defaults = function (options, requester) { options = {} } - var defaults = wrapRequestMethod(self, options, requester) + var defaults = wrapRequestMethod(self, options, requester) var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete'] - verbs.forEach(function(verb) { - defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb) + verbs.forEach(function (verb) { + defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb) }) - defaults.cookie = wrapRequestMethod(self.cookie, options, requester) - defaults.jar = self.jar + defaults.cookie = wrapRequestMethod(self.cookie, options, requester) + defaults.jar = self.jar defaults.defaults = self.defaults return defaults } @@ -120380,35 +132018,34 @@ request.forever = function (agentOptions, optionsArg) { // Exports module.exports = request -request.Request = __webpack_require__(629) +request.Request = __webpack_require__(813) request.initParams = initParams // Backwards compatibility for request.debug Object.defineProperty(request, 'debug', { - enumerable : true, - get : function() { + enumerable: true, + get: function () { return request.Request.debug }, - set : function(debug) { + set: function (debug) { request.Request.debug = debug } }) /***/ }), -/* 621 */ +/* 801 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var caseless = __webpack_require__(178) - , uuid = __webpack_require__(89) - , helpers = __webpack_require__(226) +var caseless = __webpack_require__(231) +var uuid = __webpack_require__(119) +var helpers = __webpack_require__(305) var md5 = helpers.md5 - , toBase64 = helpers.toBase64 - +var toBase64 = helpers.toBase64 function Auth (request) { // define all public properties here @@ -120528,7 +132165,7 @@ Auth.prototype.digest = function (method, path, authHeader) { Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) { var self = this - , request = self.request + var request = self.request var authHeader if (bearer === undefined && user === undefined) { @@ -120545,7 +132182,7 @@ Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) { Auth.prototype.onResponse = function (response) { var self = this - , request = self.request + var request = self.request if (!self.hasAuth || self.sentAuth) { return null } @@ -120571,40 +132208,40 @@ exports.Auth = Auth /***/ }), -/* 622 */ +/* 802 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -function formatHostname(hostname) { +function formatHostname (hostname) { // canonicalize the hostname, so that 'oogle.com' won't match 'google.com' return hostname.replace(/^\.*/, '.').toLowerCase() } -function parseNoProxyZone(zone) { +function parseNoProxyZone (zone) { zone = zone.trim().toLowerCase() var zoneParts = zone.split(':', 2) - , zoneHost = formatHostname(zoneParts[0]) - , zonePort = zoneParts[1] - , hasPort = zone.indexOf(':') > -1 + var zoneHost = formatHostname(zoneParts[0]) + var zonePort = zoneParts[1] + var hasPort = zone.indexOf(':') > -1 return {hostname: zoneHost, port: zonePort, hasPort: hasPort} } -function uriInNoProxy(uri, noProxy) { +function uriInNoProxy (uri, noProxy) { var port = uri.port || (uri.protocol === 'https:' ? '443' : '80') - , hostname = formatHostname(uri.hostname) - , noProxyList = noProxy.split(',') + var hostname = formatHostname(uri.hostname) + var noProxyList = noProxy.split(',') // iterate through the noProxyList until it finds a match. - return noProxyList.map(parseNoProxyZone).some(function(noProxyZone) { + return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) { var isMatchedAt = hostname.indexOf(noProxyZone.hostname) - , hostnameMatched = ( - isMatchedAt > -1 && - (isMatchedAt === hostname.length - noProxyZone.hostname.length) - ) + var hostnameMatched = ( + isMatchedAt > -1 && + (isMatchedAt === hostname.length - noProxyZone.hostname.length) + ) if (noProxyZone.hasPort) { return (port === noProxyZone.port) && hostnameMatched @@ -120614,7 +132251,7 @@ function uriInNoProxy(uri, noProxy) { }) } -function getProxyFromURI(uri) { +function getProxyFromURI (uri) { // Decide the proper request proxy to use based on the request URI object and the // environmental variables (NO_PROXY, HTTP_PROXY, etc.) // respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html) @@ -120637,14 +132274,14 @@ function getProxyFromURI(uri) { if (uri.protocol === 'http:') { return process.env.HTTP_PROXY || - process.env.http_proxy || null + process.env.http_proxy || null } if (uri.protocol === 'https:') { return process.env.HTTPS_PROXY || - process.env.https_proxy || - process.env.HTTP_PROXY || - process.env.http_proxy || null + process.env.https_proxy || + process.env.HTTP_PROXY || + process.env.http_proxy || null } // if none of that works, return null @@ -120657,16 +132294,16 @@ module.exports = getProxyFromURI /***/ }), -/* 623 */ +/* 803 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fs = __webpack_require__(5) -var qs = __webpack_require__(152) -var validate = __webpack_require__(531) -var extend = __webpack_require__(208) +var qs = __webpack_require__(196) +var validate = __webpack_require__(677) +var extend = __webpack_require__(269) function Har (request) { this.request = request @@ -120734,14 +132371,10 @@ Har.prototype.prep = function (data) { 'multipart/related', 'multipart/form-data', 'multipart/alternative'])) { - // reset values data.postData.mimeType = 'multipart/form-data' - } - - else if (some([ + } else if (some([ 'application/x-www-form-urlencoded'])) { - if (!data.postData.params) { data.postData.text = '' } else { @@ -120750,14 +132383,11 @@ Har.prototype.prep = function (data) { // always overwrite data.postData.text = qs.stringify(data.postData.paramsObj) } - } - - else if (some([ + } else if (some([ 'text/json', 'text/x-json', 'application/json', 'application/x-json'])) { - data.postData.mimeType = 'application/json' if (data.postData.text) { @@ -120831,14 +132461,12 @@ Har.prototype.options = function (options) { } if (test('application/x-www-form-urlencoded')) { options.form = req.postData.paramsObj - } - else if (test('application/json')) { + } else if (test('application/json')) { if (req.postData.jsonObj) { options.body = req.postData.jsonObj options.json = true } - } - else if (test('multipart/form-data')) { + } else if (test('multipart/form-data')) { options.formData = {} req.postData.params.forEach(function (param) { @@ -120865,8 +132493,7 @@ Har.prototype.options = function (options) { options.formData[param.name] = attachment }) - } - else { + } else { if (req.postData.text) { options.body = req.postData.text } @@ -120879,17 +132506,112 @@ exports.Har = Har /***/ }), -/* 624 */ +/* 804 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var uuid = __webpack_require__(89) - , CombinedStream = __webpack_require__(285) - , isstream = __webpack_require__(298) - , Buffer = __webpack_require__(88).Buffer +var crypto = __webpack_require__(11) +function randomString (size) { + var bits = (size + 1) * 6 + var buffer = crypto.randomBytes(Math.ceil(bits / 8)) + var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '') + return string.slice(0, size) +} + +function calculatePayloadHash (payload, algorithm, contentType) { + var hash = crypto.createHash(algorithm) + hash.update('hawk.1.payload\n') + hash.update((contentType ? contentType.split(';')[0].trim().toLowerCase() : '') + '\n') + hash.update(payload || '') + hash.update('\n') + return hash.digest('base64') +} + +exports.calculateMac = function (credentials, opts) { + var normalized = 'hawk.1.header\n' + + opts.ts + '\n' + + opts.nonce + '\n' + + (opts.method || '').toUpperCase() + '\n' + + opts.resource + '\n' + + opts.host.toLowerCase() + '\n' + + opts.port + '\n' + + (opts.hash || '') + '\n' + + if (opts.ext) { + normalized = normalized + opts.ext.replace('\\', '\\\\').replace('\n', '\\n') + } + + normalized = normalized + '\n' + + if (opts.app) { + normalized = normalized + opts.app + '\n' + (opts.dlg || '') + '\n' + } + + var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized) + var digest = hmac.digest('base64') + return digest +} + +exports.header = function (uri, method, opts) { + var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1000) + var credentials = opts.credentials + if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) { + return '' + } + + if (['sha1', 'sha256'].indexOf(credentials.algorithm) === -1) { + return '' + } + + var artifacts = { + ts: timestamp, + nonce: opts.nonce || randomString(6), + method: method, + resource: uri.pathname + (uri.search || ''), + host: uri.hostname, + port: uri.port || (uri.protocol === 'http:' ? 80 : 443), + hash: opts.hash, + ext: opts.ext, + app: opts.app, + dlg: opts.dlg + } + + if (!artifacts.hash && (opts.payload || opts.payload === '')) { + artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType) + } + + var mac = exports.calculateMac(credentials, artifacts) + + var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== '' + var header = 'Hawk id="' + credentials.id + + '", ts="' + artifacts.ts + + '", nonce="' + artifacts.nonce + + (artifacts.hash ? '", hash="' + artifacts.hash : '') + + (hasExt ? '", ext="' + artifacts.ext.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : '') + + '", mac="' + mac + '"' + + if (artifacts.app) { + header = header + ', app="' + artifacts.app + (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"' + } + + return header +} + + +/***/ }), +/* 805 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var uuid = __webpack_require__(119) +var CombinedStream = __webpack_require__(385) +var isstream = __webpack_require__(399) +var Buffer = __webpack_require__(45).Buffer function Multipart (request) { this.request = request @@ -120900,8 +132622,8 @@ function Multipart (request) { Multipart.prototype.isChunked = function (options) { var self = this - , chunked = false - , parts = options.data || options + var chunked = false + var parts = options.data || options if (!parts.forEach) { self.request.emit('error', new Error('Argument error, options.multipart.')) @@ -120988,7 +132710,7 @@ Multipart.prototype.onRequest = function (options) { var self = this var chunked = self.isChunked(options) - , parts = options.data || options + var parts = options.data || options self.setHeaders(chunked) self.chunked = chunked @@ -120999,20 +132721,19 @@ exports.Multipart = Multipart /***/ }), -/* 625 */ +/* 806 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var url = __webpack_require__(14) - , qs = __webpack_require__(306) - , caseless = __webpack_require__(178) - , uuid = __webpack_require__(89) - , oauth = __webpack_require__(594) - , crypto = __webpack_require__(8) - , Buffer = __webpack_require__(88).Buffer - +var url = __webpack_require__(24) +var qs = __webpack_require__(404) +var caseless = __webpack_require__(231) +var uuid = __webpack_require__(119) +var oauth = __webpack_require__(768) +var crypto = __webpack_require__(11) +var Buffer = __webpack_require__(45).Buffer function OAuth (request) { this.request = request @@ -121028,7 +132749,7 @@ OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) oa.oauth_version = '1.0' } if (!oa.oauth_timestamp) { - oa.oauth_timestamp = Math.floor( Date.now() / 1000 ).toString() + oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString() } if (!oa.oauth_nonce) { oa.oauth_nonce = uuid().replace(/-/g, '') @@ -121037,11 +132758,11 @@ OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) oa.oauth_signature_method = 'HMAC-SHA1' } - var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key + var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase delete oa.oauth_consumer_secret delete oa.oauth_private_key - var token_secret = oa.oauth_token_secret + var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase delete oa.oauth_token_secret var realm = oa.oauth_realm @@ -121056,8 +132777,9 @@ OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) method, baseurl, params, - consumer_secret_or_private_key, - token_secret) + consumer_secret_or_private_key, // eslint-disable-line camelcase + token_secret // eslint-disable-line camelcase + ) if (realm) { oa.realm = realm @@ -121066,7 +132788,7 @@ OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) return oa } -OAuth.prototype.buildBodyHash = function(_oauth, body) { +OAuth.prototype.buildBodyHash = function (_oauth, body) { if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) { this.request.emit('error', new Error('oauth: ' + _oauth.signature_method + ' signature_method not supported with body_hash signing.')) @@ -121076,7 +132798,7 @@ OAuth.prototype.buildBodyHash = function(_oauth, body) { shasum.update(body || '') var sha1 = shasum.digest('hex') - return Buffer.from(sha1).toString('base64') + return Buffer.from(sha1, 'hex').toString('base64') } OAuth.prototype.concatParams = function (oa, sep, wrap) { @@ -121101,16 +132823,16 @@ OAuth.prototype.onRequest = function (_oauth) { self.params = _oauth var uri = self.request.uri || {} - , method = self.request.method || '' - , headers = caseless(self.request.headers) - , body = self.request.body || '' - , qsLib = self.request.qsLib || qs + var method = self.request.method || '' + var headers = caseless(self.request.headers) + var body = self.request.body || '' + var qsLib = self.request.qsLib || qs var form - , query - , contentType = headers.get('content-type') || '' - , formContentType = 'application/x-www-form-urlencoded' - , transport = _oauth.transport_method || 'header' + var query + var contentType = headers.get('content-type') || '' + var formContentType = 'application/x-www-form-urlencoded' + var transport = _oauth.transport_method || 'header' if (contentType.slice(0, formContentType.length) === formContentType) { contentType = formContentType @@ -121154,15 +132876,14 @@ exports.OAuth = OAuth /***/ }), -/* 626 */ +/* 807 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var qs = __webpack_require__(306) - , querystring = __webpack_require__(152) - +var qs = __webpack_require__(404) +var querystring = __webpack_require__(196) function Querystring (request) { this.request = request @@ -121173,7 +132894,7 @@ function Querystring (request) { } Querystring.prototype.init = function (options) { - if (this.lib) {return} + if (this.lib) { return } this.useQuerystring = options.useQuerystring this.lib = (this.useQuerystring ? querystring : qs) @@ -121212,13 +132933,13 @@ exports.Querystring = Querystring /***/ }), -/* 627 */ +/* 808 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var url = __webpack_require__(14) +var url = __webpack_require__(24) var isUrl = /^https?:/ function Redirect (request) { @@ -121227,7 +132948,7 @@ function Redirect (request) { this.followRedirects = true this.followAllRedirects = false this.followOriginalHttpMethod = false - this.allowRedirect = function () {return true} + this.allowRedirect = function () { return true } this.maxRedirects = 10 this.redirects = [] this.redirectsFollowed = 0 @@ -121262,7 +132983,7 @@ Redirect.prototype.onRequest = function (options) { Redirect.prototype.redirectTo = function (response) { var self = this - , request = self.request + var request = self.request var redirectTo = null if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) { @@ -121296,7 +133017,7 @@ Redirect.prototype.redirectTo = function (response) { Redirect.prototype.onResponse = function (response) { var self = this - , request = self.request + var request = self.request var redirectTo = self.redirectTo(response) if (!redirectTo || !self.allowRedirect.call(request, response)) { @@ -121330,13 +133051,10 @@ Redirect.prototype.onResponse = function (response) { delete request.agent } - self.redirects.push( - { statusCode : response.statusCode - , redirectUri: redirectTo - } - ) - if (self.followAllRedirects && request.method !== 'HEAD' - && response.statusCode !== 401 && response.statusCode !== 307) { + self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo }) + + if (self.followAllRedirects && request.method !== 'HEAD' && + response.statusCode !== 401 && response.statusCode !== 307) { request.method = self.followOriginalHttpMethod ? request.method : 'GET' } // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215 @@ -121376,14 +133094,14 @@ exports.Redirect = Redirect /***/ }), -/* 628 */ +/* 809 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var url = __webpack_require__(14) - , tunnel = __webpack_require__(665) +var url = __webpack_require__(24) +var tunnel = __webpack_require__(955) var defaultProxyHeaderWhiteList = [ 'accept', @@ -121413,10 +133131,10 @@ var defaultProxyHeaderExclusiveList = [ 'proxy-authorization' ] -function constructProxyHost(uriObject) { +function constructProxyHost (uriObject) { var port = uriObject.port - , protocol = uriObject.protocol - , proxyHost = uriObject.hostname + ':' + var protocol = uriObject.protocol + var proxyHost = uriObject.hostname + ':' if (port) { proxyHost += port @@ -121429,7 +133147,7 @@ function constructProxyHost(uriObject) { return proxyHost } -function constructProxyHeaderWhiteList(headers, proxyHeaderWhiteList) { +function constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) { var whiteList = proxyHeaderWhiteList .reduce(function (set, header) { set[header.toLowerCase()] = true @@ -121450,41 +133168,40 @@ function constructTunnelOptions (request, proxyHeaders) { var proxy = request.proxy var tunnelOptions = { - proxy : { - host : proxy.hostname, - port : +proxy.port, - proxyAuth : proxy.auth, - headers : proxyHeaders + proxy: { + host: proxy.hostname, + port: +proxy.port, + proxyAuth: proxy.auth, + headers: proxyHeaders }, - headers : request.headers, - ca : request.ca, - cert : request.cert, - key : request.key, - passphrase : request.passphrase, - pfx : request.pfx, - ciphers : request.ciphers, - rejectUnauthorized : request.rejectUnauthorized, - secureOptions : request.secureOptions, - secureProtocol : request.secureProtocol + headers: request.headers, + ca: request.ca, + cert: request.cert, + key: request.key, + passphrase: request.passphrase, + pfx: request.pfx, + ciphers: request.ciphers, + rejectUnauthorized: request.rejectUnauthorized, + secureOptions: request.secureOptions, + secureProtocol: request.secureProtocol } return tunnelOptions } -function constructTunnelFnName(uri, proxy) { +function constructTunnelFnName (uri, proxy) { var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http') var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http') return [uriProtocol, proxyProtocol].join('Over') } -function getTunnelFn(request) { +function getTunnelFn (request) { var uri = request.uri var proxy = request.proxy var tunnelFnName = constructTunnelFnName(uri, proxy) return tunnel[tunnelFnName] } - function Tunnel (request) { this.request = request this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList @@ -121496,8 +133213,8 @@ function Tunnel (request) { Tunnel.prototype.isEnabled = function () { var self = this - , request = self.request - // Tunnel HTTPS by default. Allow the user to override this setting. + var request = self.request + // Tunnel HTTPS by default. Allow the user to override this setting. // If self.tunnelOverride is set (the user specified a value), use it. if (typeof self.tunnelOverride !== 'undefined') { @@ -121515,7 +133232,7 @@ Tunnel.prototype.isEnabled = function () { Tunnel.prototype.setup = function (options) { var self = this - , request = self.request + var request = self.request options = options || {} @@ -121559,12300 +133276,7 @@ exports.Tunnel = Tunnel /***/ }), -/* 629 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var http = __webpack_require__(49) - , https = __webpack_require__(151) - , url = __webpack_require__(14) - , util = __webpack_require__(2) - , stream = __webpack_require__(25) - , zlib = __webpack_require__(232) - , hawk = __webpack_require__(534) - , aws2 = __webpack_require__(388) - , aws4 = __webpack_require__(389) - , httpSignature = __webpack_require__(538) - , mime = __webpack_require__(299) - , stringstream = __webpack_require__(655) - , caseless = __webpack_require__(178) - , ForeverAgent = __webpack_require__(502) - , FormData = __webpack_require__(503) - , extend = __webpack_require__(208) - , isstream = __webpack_require__(298) - , isTypedArray = __webpack_require__(571).strict - , helpers = __webpack_require__(226) - , cookies = __webpack_require__(314) - , getProxyFromURI = __webpack_require__(622) - , Querystring = __webpack_require__(626).Querystring - , Har = __webpack_require__(623).Har - , Auth = __webpack_require__(621).Auth - , OAuth = __webpack_require__(625).OAuth - , Multipart = __webpack_require__(624).Multipart - , Redirect = __webpack_require__(627).Redirect - , Tunnel = __webpack_require__(628).Tunnel - , now = __webpack_require__(600) - , Buffer = __webpack_require__(88).Buffer - -var safeStringify = helpers.safeStringify - , isReadStream = helpers.isReadStream - , toBase64 = helpers.toBase64 - , defer = helpers.defer - , copy = helpers.copy - , version = helpers.version - , globalCookieJar = cookies.jar() - - -var globalPool = {} - -function filterForNonReserved(reserved, options) { - // Filter out properties that are not reserved. - // Reserved values are passed in at call site. - - var object = {} - for (var i in options) { - var notReserved = (reserved.indexOf(i) === -1) - if (notReserved) { - object[i] = options[i] - } - } - return object -} - -function filterOutReservedFunctions(reserved, options) { - // Filter out properties that are functions and are reserved. - // Reserved values are passed in at call site. - - var object = {} - for (var i in options) { - var isReserved = !(reserved.indexOf(i) === -1) - var isFunction = (typeof options[i] === 'function') - if (!(isReserved && isFunction)) { - object[i] = options[i] - } - } - return object - -} - -// Return a simpler request object to allow serialization -function requestToJSON() { - var self = this - return { - uri: self.uri, - method: self.method, - headers: self.headers - } -} - -// Return a simpler response object to allow serialization -function responseToJSON() { - var self = this - return { - statusCode: self.statusCode, - body: self.body, - headers: self.headers, - request: requestToJSON.call(self.request) - } -} - -function Request (options) { - // if given the method property in options, set property explicitMethod to true - - // extend the Request instance with any non-reserved properties - // remove any reserved functions from the options object - // set Request instance to be readable and writable - // call init - - var self = this - - // start with HAR, then override with additional options - if (options.har) { - self._har = new Har(self) - options = self._har.options(options) - } - - stream.Stream.call(self) - var reserved = Object.keys(Request.prototype) - var nonReserved = filterForNonReserved(reserved, options) - - extend(self, nonReserved) - options = filterOutReservedFunctions(reserved, options) - - self.readable = true - self.writable = true - if (options.method) { - self.explicitMethod = true - } - self._qs = new Querystring(self) - self._auth = new Auth(self) - self._oauth = new OAuth(self) - self._multipart = new Multipart(self) - self._redirect = new Redirect(self) - self._tunnel = new Tunnel(self) - self.init(options) -} - -util.inherits(Request, stream.Stream) - -// Debugging -Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG) -function debug() { - if (Request.debug) { - console.error('REQUEST %s', util.format.apply(util, arguments)) - } -} -Request.prototype.debug = debug - -Request.prototype.init = function (options) { - // init() contains all the code to setup the request object. - // the actual outgoing request is not started until start() is called - // this function is called from both the constructor and on redirect. - var self = this - if (!options) { - options = {} - } - self.headers = self.headers ? copy(self.headers) : {} - - // Delete headers with value undefined since they break - // ClientRequest.OutgoingMessage.setHeader in node 0.12 - for (var headerName in self.headers) { - if (typeof self.headers[headerName] === 'undefined') { - delete self.headers[headerName] - } - } - - caseless.httpify(self, self.headers) - - if (!self.method) { - self.method = options.method || 'GET' - } - if (!self.localAddress) { - self.localAddress = options.localAddress - } - - self._qs.init(options) - - debug(options) - if (!self.pool && self.pool !== false) { - self.pool = globalPool - } - self.dests = self.dests || [] - self.__isRequestRequest = true - - // Protect against double callback - if (!self._callback && self.callback) { - self._callback = self.callback - self.callback = function () { - if (self._callbackCalled) { - return // Print a warning maybe? - } - self._callbackCalled = true - self._callback.apply(self, arguments) - } - self.on('error', self.callback.bind()) - self.on('complete', self.callback.bind(self, null)) - } - - // People use this property instead all the time, so support it - if (!self.uri && self.url) { - self.uri = self.url - delete self.url - } - - // If there's a baseUrl, then use it as the base URL (i.e. uri must be - // specified as a relative path and is appended to baseUrl). - if (self.baseUrl) { - if (typeof self.baseUrl !== 'string') { - return self.emit('error', new Error('options.baseUrl must be a string')) - } - - if (typeof self.uri !== 'string') { - return self.emit('error', new Error('options.uri must be a string when using options.baseUrl')) - } - - if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) { - return self.emit('error', new Error('options.uri must be a path when using options.baseUrl')) - } - - // Handle all cases to make sure that there's only one slash between - // baseUrl and uri. - var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1 - var uriStartsWithSlash = self.uri.indexOf('/') === 0 - - if (baseUrlEndsWithSlash && uriStartsWithSlash) { - self.uri = self.baseUrl + self.uri.slice(1) - } else if (baseUrlEndsWithSlash || uriStartsWithSlash) { - self.uri = self.baseUrl + self.uri - } else if (self.uri === '') { - self.uri = self.baseUrl - } else { - self.uri = self.baseUrl + '/' + self.uri - } - delete self.baseUrl - } - - // A URI is needed by this point, emit error if we haven't been able to get one - if (!self.uri) { - return self.emit('error', new Error('options.uri is a required argument')) - } - - // If a string URI/URL was given, parse it into a URL object - if (typeof self.uri === 'string') { - self.uri = url.parse(self.uri) - } - - // Some URL objects are not from a URL parsed string and need href added - if (!self.uri.href) { - self.uri.href = url.format(self.uri) - } - - // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme - if (self.uri.protocol === 'unix:') { - return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`')) - } - - // Support Unix Sockets - if (self.uri.host === 'unix') { - self.enableUnixSocket() - } - - if (self.strictSSL === false) { - self.rejectUnauthorized = false - } - - if (!self.uri.pathname) {self.uri.pathname = '/'} - - if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) { - // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar - // Detect and reject it as soon as possible - var faultyUri = url.format(self.uri) - var message = 'Invalid URI "' + faultyUri + '"' - if (Object.keys(options).length === 0) { - // No option ? This can be the sign of a redirect - // As this is a case where the user cannot do anything (they didn't call request directly with this URL) - // they should be warned that it can be caused by a redirection (can save some hair) - message += '. This can be caused by a crappy redirection.' - } - // This error was fatal - self.abort() - return self.emit('error', new Error(message)) - } - - if (!self.hasOwnProperty('proxy')) { - self.proxy = getProxyFromURI(self.uri) - } - - self.tunnel = self._tunnel.isEnabled() - if (self.proxy) { - self._tunnel.setup(options) - } - - self._redirect.onRequest(options) - - self.setHost = false - if (!self.hasHeader('host')) { - var hostHeaderName = self.originalHostHeaderName || 'host' - // When used with an IPv6 address, `host` will provide - // the correct bracketed format, unlike using `hostname` and - // optionally adding the `port` when necessary. - self.setHeader(hostHeaderName, self.uri.host) - self.setHost = true - } - - self.jar(self._jar || options.jar) - - if (!self.uri.port) { - if (self.uri.protocol === 'http:') {self.uri.port = 80} - else if (self.uri.protocol === 'https:') {self.uri.port = 443} - } - - if (self.proxy && !self.tunnel) { - self.port = self.proxy.port - self.host = self.proxy.hostname - } else { - self.port = self.uri.port - self.host = self.uri.hostname - } - - if (options.form) { - self.form(options.form) - } - - if (options.formData) { - var formData = options.formData - var requestForm = self.form() - var appendFormValue = function (key, value) { - if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) { - requestForm.append(key, value.value, value.options) - } else { - requestForm.append(key, value) - } - } - for (var formKey in formData) { - if (formData.hasOwnProperty(formKey)) { - var formValue = formData[formKey] - if (formValue instanceof Array) { - for (var j = 0; j < formValue.length; j++) { - appendFormValue(formKey, formValue[j]) - } - } else { - appendFormValue(formKey, formValue) - } - } - } - } - - if (options.qs) { - self.qs(options.qs) - } - - if (self.uri.path) { - self.path = self.uri.path - } else { - self.path = self.uri.pathname + (self.uri.search || '') - } - - if (self.path.length === 0) { - self.path = '/' - } - - // Auth must happen last in case signing is dependent on other headers - if (options.aws) { - self.aws(options.aws) - } - - if (options.hawk) { - self.hawk(options.hawk) - } - - if (options.httpSignature) { - self.httpSignature(options.httpSignature) - } - - if (options.auth) { - if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) { - options.auth.user = options.auth.username - } - if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) { - options.auth.pass = options.auth.password - } - - self.auth( - options.auth.user, - options.auth.pass, - options.auth.sendImmediately, - options.auth.bearer - ) - } - - if (self.gzip && !self.hasHeader('accept-encoding')) { - self.setHeader('accept-encoding', 'gzip, deflate') - } - - if (self.uri.auth && !self.hasHeader('authorization')) { - var uriAuthPieces = self.uri.auth.split(':').map(function(item) {return self._qs.unescape(item)}) - self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true) - } - - if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) { - var proxyAuthPieces = self.proxy.auth.split(':').map(function(item) {return self._qs.unescape(item)}) - var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':')) - self.setHeader('proxy-authorization', authHeader) - } - - if (self.proxy && !self.tunnel) { - self.path = (self.uri.protocol + '//' + self.uri.host + self.path) - } - - if (options.json) { - self.json(options.json) - } - if (options.multipart) { - self.multipart(options.multipart) - } - - if (options.time) { - self.timing = true - - // NOTE: elapsedTime is deprecated in favor of .timings - self.elapsedTime = self.elapsedTime || 0 - } - - function setContentLength () { - if (isTypedArray(self.body)) { - self.body = Buffer.from(self.body) - } - - if (!self.hasHeader('content-length')) { - var length - if (typeof self.body === 'string') { - length = Buffer.byteLength(self.body) - } - else if (Array.isArray(self.body)) { - length = self.body.reduce(function (a, b) {return a + b.length}, 0) - } - else { - length = self.body.length - } - - if (length) { - self.setHeader('content-length', length) - } else { - self.emit('error', new Error('Argument error, options.body.')) - } - } - } - if (self.body && !isstream(self.body)) { - setContentLength() - } - - if (options.oauth) { - self.oauth(options.oauth) - } else if (self._oauth.params && self.hasHeader('authorization')) { - self.oauth(self._oauth.params) - } - - var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol - , defaultModules = {'http:':http, 'https:':https} - , httpModules = self.httpModules || {} - - self.httpModule = httpModules[protocol] || defaultModules[protocol] - - if (!self.httpModule) { - return self.emit('error', new Error('Invalid protocol: ' + protocol)) - } - - if (options.ca) { - self.ca = options.ca - } - - if (!self.agent) { - if (options.agentOptions) { - self.agentOptions = options.agentOptions - } - - if (options.agentClass) { - self.agentClass = options.agentClass - } else if (options.forever) { - var v = version() - // use ForeverAgent in node 0.10- only - if (v.major === 0 && v.minor <= 10) { - self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL - } else { - self.agentClass = self.httpModule.Agent - self.agentOptions = self.agentOptions || {} - self.agentOptions.keepAlive = true - } - } else { - self.agentClass = self.httpModule.Agent - } - } - - if (self.pool === false) { - self.agent = false - } else { - self.agent = self.agent || self.getNewAgent() - } - - self.on('pipe', function (src) { - if (self.ntick && self._started) { - self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.')) - } - self.src = src - if (isReadStream(src)) { - if (!self.hasHeader('content-type')) { - self.setHeader('content-type', mime.lookup(src.path)) - } - } else { - if (src.headers) { - for (var i in src.headers) { - if (!self.hasHeader(i)) { - self.setHeader(i, src.headers[i]) - } - } - } - if (self._json && !self.hasHeader('content-type')) { - self.setHeader('content-type', 'application/json') - } - if (src.method && !self.explicitMethod) { - self.method = src.method - } - } - - // self.on('pipe', function () { - // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.') - // }) - }) - - defer(function () { - if (self._aborted) { - return - } - - var end = function () { - if (self._form) { - if (!self._auth.hasAuth) { - self._form.pipe(self) - } - else if (self._auth.hasAuth && self._auth.sentAuth) { - self._form.pipe(self) - } - } - if (self._multipart && self._multipart.chunked) { - self._multipart.body.pipe(self) - } - if (self.body) { - if (isstream(self.body)) { - self.body.pipe(self) - } else { - setContentLength() - if (Array.isArray(self.body)) { - self.body.forEach(function (part) { - self.write(part) - }) - } else { - self.write(self.body) - } - self.end() - } - } else if (self.requestBodyStream) { - console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.') - self.requestBodyStream.pipe(self) - } else if (!self.src) { - if (self._auth.hasAuth && !self._auth.sentAuth) { - self.end() - return - } - if (self.method !== 'GET' && typeof self.method !== 'undefined') { - self.setHeader('content-length', 0) - } - self.end() - } - } - - if (self._form && !self.hasHeader('content-length')) { - // Before ending the request, we had to compute the length of the whole form, asyncly - self.setHeader(self._form.getHeaders(), true) - self._form.getLength(function (err, length) { - if (!err && !isNaN(length)) { - self.setHeader('content-length', length) - } - end() - }) - } else { - end() - } - - self.ntick = true - }) - -} - -Request.prototype.getNewAgent = function () { - var self = this - var Agent = self.agentClass - var options = {} - if (self.agentOptions) { - for (var i in self.agentOptions) { - options[i] = self.agentOptions[i] - } - } - if (self.ca) { - options.ca = self.ca - } - if (self.ciphers) { - options.ciphers = self.ciphers - } - if (self.secureProtocol) { - options.secureProtocol = self.secureProtocol - } - if (self.secureOptions) { - options.secureOptions = self.secureOptions - } - if (typeof self.rejectUnauthorized !== 'undefined') { - options.rejectUnauthorized = self.rejectUnauthorized - } - - if (self.cert && self.key) { - options.key = self.key - options.cert = self.cert - } - - if (self.pfx) { - options.pfx = self.pfx - } - - if (self.passphrase) { - options.passphrase = self.passphrase - } - - var poolKey = '' - - // different types of agents are in different pools - if (Agent !== self.httpModule.Agent) { - poolKey += Agent.name - } - - // ca option is only relevant if proxy or destination are https - var proxy = self.proxy - if (typeof proxy === 'string') { - proxy = url.parse(proxy) - } - var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:' - - if (isHttps) { - if (options.ca) { - if (poolKey) { - poolKey += ':' - } - poolKey += options.ca - } - - if (typeof options.rejectUnauthorized !== 'undefined') { - if (poolKey) { - poolKey += ':' - } - poolKey += options.rejectUnauthorized - } - - if (options.cert) { - if (poolKey) { - poolKey += ':' - } - poolKey += options.cert.toString('ascii') + options.key.toString('ascii') - } - - if (options.pfx) { - if (poolKey) { - poolKey += ':' - } - poolKey += options.pfx.toString('ascii') - } - - if (options.ciphers) { - if (poolKey) { - poolKey += ':' - } - poolKey += options.ciphers - } - - if (options.secureProtocol) { - if (poolKey) { - poolKey += ':' - } - poolKey += options.secureProtocol - } - - if (options.secureOptions) { - if (poolKey) { - poolKey += ':' - } - poolKey += options.secureOptions - } - } - - if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) { - // not doing anything special. Use the globalAgent - return self.httpModule.globalAgent - } - - // we're using a stored agent. Make sure it's protocol-specific - poolKey = self.uri.protocol + poolKey - - // generate a new agent for this setting if none yet exists - if (!self.pool[poolKey]) { - self.pool[poolKey] = new Agent(options) - // properly set maxSockets on new agents - if (self.pool.maxSockets) { - self.pool[poolKey].maxSockets = self.pool.maxSockets - } - } - - return self.pool[poolKey] -} - -Request.prototype.start = function () { - // start() is called once we are ready to send the outgoing HTTP request. - // this is usually called on the first write(), end() or on nextTick() - var self = this - - if (self.timing) { - // All timings will be relative to this request's startTime. In order to do this, - // we need to capture the wall-clock start time (via Date), immediately followed - // by the high-resolution timer (via now()). While these two won't be set - // at the _exact_ same time, they should be close enough to be able to calculate - // high-resolution, monotonically non-decreasing timestamps relative to startTime. - var startTime = new Date().getTime() - var startTimeNow = now() - } - - if (self._aborted) { - return - } - - self._started = true - self.method = self.method || 'GET' - self.href = self.uri.href - - if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) { - self.setHeader('content-length', self.src.stat.size) - } - if (self._aws) { - self.aws(self._aws, true) - } - - // We have a method named auth, which is completely different from the http.request - // auth option. If we don't remove it, we're gonna have a bad time. - var reqOptions = copy(self) - delete reqOptions.auth - - debug('make request', self.uri.href) - - // node v6.8.0 now supports a `timeout` value in `http.request()`, but we - // should delete it for now since we handle timeouts manually for better - // consistency with node versions before v6.8.0 - delete reqOptions.timeout - - try { - self.req = self.httpModule.request(reqOptions) - } catch (err) { - self.emit('error', err) - return - } - - if (self.timing) { - self.startTime = startTime - self.startTimeNow = startTimeNow - - // Timing values will all be relative to startTime (by comparing to startTimeNow - // so we have an accurate clock) - self.timings = {} - } - - var timeout - if (self.timeout && !self.timeoutTimer) { - if (self.timeout < 0) { - timeout = 0 - } else if (typeof self.timeout === 'number' && isFinite(self.timeout)) { - timeout = self.timeout - } - } - - self.req.on('response', self.onRequestResponse.bind(self)) - self.req.on('error', self.onRequestError.bind(self)) - self.req.on('drain', function() { - self.emit('drain') - }) - self.req.on('socket', function(socket) { - // `._connecting` was the old property which was made public in node v6.1.0 - var isConnecting = socket._connecting || socket.connecting - if (self.timing) { - self.timings.socket = now() - self.startTimeNow - - if (isConnecting) { - var onLookupTiming = function() { - self.timings.lookup = now() - self.startTimeNow - } - - var onConnectTiming = function() { - self.timings.connect = now() - self.startTimeNow - } - - socket.once('lookup', onLookupTiming) - socket.once('connect', onConnectTiming) - - // clean up timing event listeners if needed on error - self.req.once('error', function() { - socket.removeListener('lookup', onLookupTiming) - socket.removeListener('connect', onConnectTiming) - }) - } - } - - var setReqTimeout = function() { - // This timeout sets the amount of time to wait *between* bytes sent - // from the server once connected. - // - // In particular, it's useful for erroring if the server fails to send - // data halfway through streaming a response. - self.req.setTimeout(timeout, function () { - if (self.req) { - self.abort() - var e = new Error('ESOCKETTIMEDOUT') - e.code = 'ESOCKETTIMEDOUT' - e.connect = false - self.emit('error', e) - } - }) - } - if (timeout !== undefined) { - // Only start the connection timer if we're actually connecting a new - // socket, otherwise if we're already connected (because this is a - // keep-alive connection) do not bother. This is important since we won't - // get a 'connect' event for an already connected socket. - if (isConnecting) { - var onReqSockConnect = function() { - socket.removeListener('connect', onReqSockConnect) - clearTimeout(self.timeoutTimer) - self.timeoutTimer = null - setReqTimeout() - } - - socket.on('connect', onReqSockConnect) - - self.req.on('error', function(err) { - socket.removeListener('connect', onReqSockConnect) - }) - - // Set a timeout in memory - this block will throw if the server takes more - // than `timeout` to write the HTTP status and headers (corresponding to - // the on('response') event on the client). NB: this measures wall-clock - // time, not the time between bytes sent by the server. - self.timeoutTimer = setTimeout(function () { - socket.removeListener('connect', onReqSockConnect) - self.abort() - var e = new Error('ETIMEDOUT') - e.code = 'ETIMEDOUT' - e.connect = true - self.emit('error', e) - }, timeout) - } else { - // We're already connected - setReqTimeout() - } - } - self.emit('socket', socket) - }) - - self.emit('request', self.req) -} - -Request.prototype.onRequestError = function (error) { - var self = this - if (self._aborted) { - return - } - if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' - && self.agent.addRequestNoreuse) { - self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } - self.start() - self.req.end() - return - } - if (self.timeout && self.timeoutTimer) { - clearTimeout(self.timeoutTimer) - self.timeoutTimer = null - } - self.emit('error', error) -} - -Request.prototype.onRequestResponse = function (response) { - var self = this - - if (self.timing) { - self.timings.response = now() - self.startTimeNow - } - - debug('onRequestResponse', self.uri.href, response.statusCode, response.headers) - response.on('end', function() { - if (self.timing) { - self.timings.end = now() - self.startTimeNow - response.timingStart = self.startTime - - // fill in the blanks for any periods that didn't trigger, such as - // no lookup or connect due to keep alive - if (!self.timings.socket) { - self.timings.socket = 0 - } - if (!self.timings.lookup) { - self.timings.lookup = self.timings.socket - } - if (!self.timings.connect) { - self.timings.connect = self.timings.lookup - } - if (!self.timings.response) { - self.timings.response = self.timings.connect - } - - debug('elapsed time', self.timings.end) - - // elapsedTime includes all redirects - self.elapsedTime += Math.round(self.timings.end) - - // NOTE: elapsedTime is deprecated in favor of .timings - response.elapsedTime = self.elapsedTime - - // timings is just for the final fetch - response.timings = self.timings - - // pre-calculate phase timings as well - response.timingPhases = { - wait: self.timings.socket, - dns: self.timings.lookup - self.timings.socket, - tcp: self.timings.connect - self.timings.lookup, - firstByte: self.timings.response - self.timings.connect, - download: self.timings.end - self.timings.response, - total: self.timings.end - } - } - debug('response end', self.uri.href, response.statusCode, response.headers) - }) - - if (self._aborted) { - debug('aborted', self.uri.href) - response.resume() - return - } - - self.response = response - response.request = self - response.toJSON = responseToJSON - - // XXX This is different on 0.10, because SSL is strict by default - if (self.httpModule === https && - self.strictSSL && (!response.hasOwnProperty('socket') || - !response.socket.authorized)) { - debug('strict ssl error', self.uri.href) - var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL' - self.emit('error', new Error('SSL Error: ' + sslErr)) - return - } - - // Save the original host before any redirect (if it changes, we need to - // remove any authorization headers). Also remember the case of the header - // name because lots of broken servers expect Host instead of host and we - // want the caller to be able to specify this. - self.originalHost = self.getHeader('host') - if (!self.originalHostHeaderName) { - self.originalHostHeaderName = self.hasHeader('host') - } - if (self.setHost) { - self.removeHeader('host') - } - if (self.timeout && self.timeoutTimer) { - clearTimeout(self.timeoutTimer) - self.timeoutTimer = null - } - - var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar - var addCookie = function (cookie) { - //set the cookie if it's domain in the href's domain. - try { - targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true}) - } catch (e) { - self.emit('error', e) - } - } - - response.caseless = caseless(response.headers) - - if (response.caseless.has('set-cookie') && (!self._disableCookies)) { - var headerName = response.caseless.has('set-cookie') - if (Array.isArray(response.headers[headerName])) { - response.headers[headerName].forEach(addCookie) - } else { - addCookie(response.headers[headerName]) - } - } - - if (self._redirect.onResponse(response)) { - return // Ignore the rest of the response - } else { - // Be a good stream and emit end when the response is finished. - // Hack to emit end on close because of a core bug that never fires end - response.on('close', function () { - if (!self._ended) { - self.response.emit('end') - } - }) - - response.once('end', function () { - self._ended = true - }) - - var noBody = function (code) { - return ( - self.method === 'HEAD' - // Informational - || (code >= 100 && code < 200) - // No Content - || code === 204 - // Not Modified - || code === 304 - ) - } - - var responseContent - if (self.gzip && !noBody(response.statusCode)) { - var contentEncoding = response.headers['content-encoding'] || 'identity' - contentEncoding = contentEncoding.trim().toLowerCase() - - // Be more lenient with decoding compressed responses, since (very rarely) - // servers send slightly invalid gzip responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - var zlibOptions = { - flush: zlib.Z_SYNC_FLUSH - , finishFlush: zlib.Z_SYNC_FLUSH - } - - if (contentEncoding === 'gzip') { - responseContent = zlib.createGunzip(zlibOptions) - response.pipe(responseContent) - } else if (contentEncoding === 'deflate') { - responseContent = zlib.createInflate(zlibOptions) - response.pipe(responseContent) - } else { - // Since previous versions didn't check for Content-Encoding header, - // ignore any invalid values to preserve backwards-compatibility - if (contentEncoding !== 'identity') { - debug('ignoring unrecognized Content-Encoding ' + contentEncoding) - } - responseContent = response - } - } else { - responseContent = response - } - - if (self.encoding) { - if (self.dests.length !== 0) { - console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.') - } else if (responseContent.setEncoding) { - responseContent.setEncoding(self.encoding) - } else { - // Should only occur on node pre-v0.9.4 (joyent/node@9b5abe5) with - // zlib streams. - // If/When support for 0.9.4 is dropped, this should be unnecessary. - responseContent = responseContent.pipe(stringstream(self.encoding)) - } - } - - if (self._paused) { - responseContent.pause() - } - - self.responseContent = responseContent - - self.emit('response', response) - - self.dests.forEach(function (dest) { - self.pipeDest(dest) - }) - - responseContent.on('data', function (chunk) { - if (self.timing && !self.responseStarted) { - self.responseStartTime = (new Date()).getTime() - - // NOTE: responseStartTime is deprecated in favor of .timings - response.responseStartTime = self.responseStartTime - } - self._destdata = true - self.emit('data', chunk) - }) - responseContent.once('end', function (chunk) { - self.emit('end', chunk) - }) - responseContent.on('error', function (error) { - self.emit('error', error) - }) - responseContent.on('close', function () {self.emit('close')}) - - if (self.callback) { - self.readResponseBody(response) - } - //if no callback - else { - self.on('end', function () { - if (self._aborted) { - debug('aborted', self.uri.href) - return - } - self.emit('complete', response) - }) - } - } - debug('finish init function', self.uri.href) -} - -Request.prototype.readResponseBody = function (response) { - var self = this - debug('reading response\'s body') - var buffers = [] - , bufferLength = 0 - , strings = [] - - self.on('data', function (chunk) { - if (!Buffer.isBuffer(chunk)) { - strings.push(chunk) - } else if (chunk.length) { - bufferLength += chunk.length - buffers.push(chunk) - } - }) - self.on('end', function () { - debug('end event', self.uri.href) - if (self._aborted) { - debug('aborted', self.uri.href) - // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request. - // This can lead to leaky behavior if the user retains a reference to the request object. - buffers = [] - bufferLength = 0 - return - } - - if (bufferLength) { - debug('has body', self.uri.href, bufferLength) - response.body = Buffer.concat(buffers, bufferLength) - if (self.encoding !== null) { - response.body = response.body.toString(self.encoding) - } - // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request. - // This can lead to leaky behavior if the user retains a reference to the request object. - buffers = [] - bufferLength = 0 - } else if (strings.length) { - // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. - // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). - if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') { - strings[0] = strings[0].substring(1) - } - response.body = strings.join('') - } - - if (self._json) { - try { - response.body = JSON.parse(response.body, self._jsonReviver) - } catch (e) { - debug('invalid JSON received', self.uri.href) - } - } - debug('emitting complete', self.uri.href) - if (typeof response.body === 'undefined' && !self._json) { - response.body = self.encoding === null ? Buffer.alloc(0) : '' - } - self.emit('complete', response, response.body) - }) -} - -Request.prototype.abort = function () { - var self = this - self._aborted = true - - if (self.req) { - self.req.abort() - } - else if (self.response) { - self.response.destroy() - } - - self.emit('abort') -} - -Request.prototype.pipeDest = function (dest) { - var self = this - var response = self.response - // Called after the response is received - if (dest.headers && !dest.headersSent) { - if (response.caseless.has('content-type')) { - var ctname = response.caseless.has('content-type') - if (dest.setHeader) { - dest.setHeader(ctname, response.headers[ctname]) - } - else { - dest.headers[ctname] = response.headers[ctname] - } - } - - if (response.caseless.has('content-length')) { - var clname = response.caseless.has('content-length') - if (dest.setHeader) { - dest.setHeader(clname, response.headers[clname]) - } else { - dest.headers[clname] = response.headers[clname] - } - } - } - if (dest.setHeader && !dest.headersSent) { - for (var i in response.headers) { - // If the response content is being decoded, the Content-Encoding header - // of the response doesn't represent the piped content, so don't pass it. - if (!self.gzip || i !== 'content-encoding') { - dest.setHeader(i, response.headers[i]) - } - } - dest.statusCode = response.statusCode - } - if (self.pipefilter) { - self.pipefilter(response, dest) - } -} - -Request.prototype.qs = function (q, clobber) { - var self = this - var base - if (!clobber && self.uri.query) { - base = self._qs.parse(self.uri.query) - } else { - base = {} - } - - for (var i in q) { - base[i] = q[i] - } - - var qs = self._qs.stringify(base) - - if (qs === '') { - return self - } - - self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs) - self.url = self.uri - self.path = self.uri.path - - if (self.uri.host === 'unix') { - self.enableUnixSocket() - } - - return self -} -Request.prototype.form = function (form) { - var self = this - if (form) { - if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { - self.setHeader('content-type', 'application/x-www-form-urlencoded') - } - self.body = (typeof form === 'string') - ? self._qs.rfc3986(form.toString('utf8')) - : self._qs.stringify(form).toString('utf8') - return self - } - // create form-data object - self._form = new FormData() - self._form.on('error', function(err) { - err.message = 'form-data: ' + err.message - self.emit('error', err) - self.abort() - }) - return self._form -} -Request.prototype.multipart = function (multipart) { - var self = this - - self._multipart.onRequest(multipart) - - if (!self._multipart.chunked) { - self.body = self._multipart.body - } - - return self -} -Request.prototype.json = function (val) { - var self = this - - if (!self.hasHeader('accept')) { - self.setHeader('accept', 'application/json') - } - - if (typeof self.jsonReplacer === 'function') { - self._jsonReplacer = self.jsonReplacer - } - - self._json = true - if (typeof val === 'boolean') { - if (self.body !== undefined) { - if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { - self.body = safeStringify(self.body, self._jsonReplacer) - } else { - self.body = self._qs.rfc3986(self.body) - } - if (!self.hasHeader('content-type')) { - self.setHeader('content-type', 'application/json') - } - } - } else { - self.body = safeStringify(val, self._jsonReplacer) - if (!self.hasHeader('content-type')) { - self.setHeader('content-type', 'application/json') - } - } - - if (typeof self.jsonReviver === 'function') { - self._jsonReviver = self.jsonReviver - } - - return self -} -Request.prototype.getHeader = function (name, headers) { - var self = this - var result, re, match - if (!headers) { - headers = self.headers - } - Object.keys(headers).forEach(function (key) { - if (key.length !== name.length) { - return - } - re = new RegExp(name, 'i') - match = key.match(re) - if (match) { - result = headers[key] - } - }) - return result -} -Request.prototype.enableUnixSocket = function () { - // Get the socket & request paths from the URL - var unixParts = this.uri.path.split(':') - , host = unixParts[0] - , path = unixParts[1] - // Apply unix properties to request - this.socketPath = host - this.uri.pathname = path - this.uri.path = path - this.uri.host = host - this.uri.hostname = host - this.uri.isUnix = true -} - - -Request.prototype.auth = function (user, pass, sendImmediately, bearer) { - var self = this - - self._auth.onRequest(user, pass, sendImmediately, bearer) - - return self -} -Request.prototype.aws = function (opts, now) { - var self = this - - if (!now) { - self._aws = opts - return self - } - - if (opts.sign_version == 4 || opts.sign_version == '4') { - // use aws4 - var options = { - host: self.uri.host, - path: self.uri.path, - method: self.method, - headers: { - 'content-type': self.getHeader('content-type') || '' - }, - body: self.body - } - var signRes = aws4.sign(options, { - accessKeyId: opts.key, - secretAccessKey: opts.secret, - sessionToken: opts.session - }) - self.setHeader('authorization', signRes.headers.Authorization) - self.setHeader('x-amz-date', signRes.headers['X-Amz-Date']) - if (signRes.headers['X-Amz-Security-Token']) { - self.setHeader('x-amz-security-token', signRes.headers['X-Amz-Security-Token']) - } - } - else { - // default: use aws-sign2 - var date = new Date() - self.setHeader('date', date.toUTCString()) - var auth = - { key: opts.key - , secret: opts.secret - , verb: self.method.toUpperCase() - , date: date - , contentType: self.getHeader('content-type') || '' - , md5: self.getHeader('content-md5') || '' - , amazonHeaders: aws2.canonicalizeHeaders(self.headers) - } - var path = self.uri.path - if (opts.bucket && path) { - auth.resource = '/' + opts.bucket + path - } else if (opts.bucket && !path) { - auth.resource = '/' + opts.bucket - } else if (!opts.bucket && path) { - auth.resource = path - } else if (!opts.bucket && !path) { - auth.resource = '/' - } - auth.resource = aws2.canonicalizeResource(auth.resource) - self.setHeader('authorization', aws2.authorization(auth)) - } - - return self -} -Request.prototype.httpSignature = function (opts) { - var self = this - httpSignature.signRequest({ - getHeader: function(header) { - return self.getHeader(header, self.headers) - }, - setHeader: function(header, value) { - self.setHeader(header, value) - }, - method: self.method, - path: self.path - }, opts) - debug('httpSignature authorization', self.getHeader('authorization')) - - return self -} -Request.prototype.hawk = function (opts) { - var self = this - self.setHeader('Authorization', hawk.client.header(self.uri, self.method, opts).field) -} -Request.prototype.oauth = function (_oauth) { - var self = this - - self._oauth.onRequest(_oauth) - - return self -} - -Request.prototype.jar = function (jar) { - var self = this - var cookies - - if (self._redirect.redirectsFollowed === 0) { - self.originalCookieHeader = self.getHeader('cookie') - } - - if (!jar) { - // disable cookies - cookies = false - self._disableCookies = true - } else { - var targetCookieJar = (jar && jar.getCookieString) ? jar : globalCookieJar - var urihref = self.uri.href - //fetch cookie in the Specified host - if (targetCookieJar) { - cookies = targetCookieJar.getCookieString(urihref) - } - } - - //if need cookie and cookie is not empty - if (cookies && cookies.length) { - if (self.originalCookieHeader) { - // Don't overwrite existing Cookie header - self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies) - } else { - self.setHeader('cookie', cookies) - } - } - self._jar = jar - return self -} - - -// Stream API -Request.prototype.pipe = function (dest, opts) { - var self = this - - if (self.response) { - if (self._destdata) { - self.emit('error', new Error('You cannot pipe after data has been emitted from the response.')) - } else if (self._ended) { - self.emit('error', new Error('You cannot pipe after the response has been ended.')) - } else { - stream.Stream.prototype.pipe.call(self, dest, opts) - self.pipeDest(dest) - return dest - } - } else { - self.dests.push(dest) - stream.Stream.prototype.pipe.call(self, dest, opts) - return dest - } -} -Request.prototype.write = function () { - var self = this - if (self._aborted) {return} - - if (!self._started) { - self.start() - } - if (self.req) { - return self.req.write.apply(self.req, arguments) - } -} -Request.prototype.end = function (chunk) { - var self = this - if (self._aborted) {return} - - if (chunk) { - self.write(chunk) - } - if (!self._started) { - self.start() - } - if (self.req) { - self.req.end() - } -} -Request.prototype.pause = function () { - var self = this - if (!self.responseContent) { - self._paused = true - } else { - self.responseContent.pause.apply(self.responseContent, arguments) - } -} -Request.prototype.resume = function () { - var self = this - if (!self.responseContent) { - self._paused = false - } else { - self.responseContent.resume.apply(self.responseContent, arguments) - } -} -Request.prototype.destroy = function () { - var self = this - if (!self._ended) { - self.end() - } else if (self.response) { - self.response.destroy() - } -} - -Request.defaultProxyHeaderWhiteList = - Tunnel.defaultProxyHeaderWhiteList.slice() - -Request.defaultProxyHeaderExclusiveList = - Tunnel.defaultProxyHeaderExclusiveList.slice() - -// Exports - -Request.prototype.toJSON = requestToJSON -module.exports = Request - - -/***/ }), -/* 630 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const onetime = __webpack_require__(596); -const signalExit = __webpack_require__(317); - -module.exports = onetime(() => { - signalExit(() => { - process.stderr.write('\u001b[?25h'); - }, {alwaysLast: true}); -}); - - -/***/ }), -/* 631 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(632); - -/***/ }), -/* 632 */ -/***/ (function(module, exports, __webpack_require__) { - -var RetryOperation = __webpack_require__(633); - -exports.operation = function(options) { - var timeouts = exports.timeouts(options); - return new RetryOperation(timeouts, { - forever: options && options.forever, - unref: options && options.unref - }); -}; - -exports.timeouts = function(options) { - if (options instanceof Array) { - return [].concat(options); - } - - var opts = { - retries: 10, - factor: 2, - minTimeout: 1 * 1000, - maxTimeout: Infinity, - randomize: false - }; - for (var key in options) { - opts[key] = options[key]; - } - - if (opts.minTimeout > opts.maxTimeout) { - throw new Error('minTimeout is greater than maxTimeout'); - } - - var timeouts = []; - for (var i = 0; i < opts.retries; i++) { - timeouts.push(this.createTimeout(i, opts)); - } - - if (options && options.forever && !timeouts.length) { - timeouts.push(this.createTimeout(i, opts)); - } - - // sort the array numerically ascending - timeouts.sort(function(a,b) { - return a - b; - }); - - return timeouts; -}; - -exports.createTimeout = function(attempt, opts) { - var random = (opts.randomize) - ? (Math.random() + 1) - : 1; - - var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); - timeout = Math.min(timeout, opts.maxTimeout); - - return timeout; -}; - -exports.wrap = function(obj, options, methods) { - if (options instanceof Array) { - methods = options; - options = null; - } - - if (!methods) { - methods = []; - for (var key in obj) { - if (typeof obj[key] === 'function') { - methods.push(key); - } - } - } - - for (var i = 0; i < methods.length; i++) { - var method = methods[i]; - var original = obj[method]; - - obj[method] = function retryWrapper() { - var op = exports.operation(options); - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - - args.push(function(err) { - if (op.retry(err)) { - return; - } - if (err) { - arguments[0] = op.mainError(); - } - callback.apply(this, arguments); - }); - - op.attempt(function() { - original.apply(obj, args); - }); - }; - obj[method].options = options; - } -}; - - -/***/ }), -/* 633 */ -/***/ (function(module, exports) { - -function RetryOperation(timeouts, options) { - // Compatibility for the old (timeouts, retryForever) signature - if (typeof options === 'boolean') { - options = { forever: options }; - } - - this._timeouts = timeouts; - this._options = options || {}; - this._fn = null; - this._errors = []; - this._attempts = 1; - this._operationTimeout = null; - this._operationTimeoutCb = null; - this._timeout = null; - - if (this._options.forever) { - this._cachedTimeouts = this._timeouts.slice(0); - } -} -module.exports = RetryOperation; - -RetryOperation.prototype.stop = function() { - if (this._timeout) { - clearTimeout(this._timeout); - } - - this._timeouts = []; - this._cachedTimeouts = null; -}; - -RetryOperation.prototype.retry = function(err) { - if (this._timeout) { - clearTimeout(this._timeout); - } - - if (!err) { - return false; - } - - this._errors.push(err); - - var timeout = this._timeouts.shift(); - if (timeout === undefined) { - if (this._cachedTimeouts) { - // retry forever, only keep last error - this._errors.splice(this._errors.length - 1, this._errors.length); - this._timeouts = this._cachedTimeouts.slice(0); - timeout = this._timeouts.shift(); - } else { - return false; - } - } - - var self = this; - var timer = setTimeout(function() { - self._attempts++; - - if (self._operationTimeoutCb) { - self._timeout = setTimeout(function() { - self._operationTimeoutCb(self._attempts); - }, self._operationTimeout); - - if (this._options.unref) { - self._timeout.unref(); - } - } - - self._fn(self._attempts); - }, timeout); - - if (this._options.unref) { - timer.unref(); - } - - return true; -}; - -RetryOperation.prototype.attempt = function(fn, timeoutOps) { - this._fn = fn; - - if (timeoutOps) { - if (timeoutOps.timeout) { - this._operationTimeout = timeoutOps.timeout; - } - if (timeoutOps.cb) { - this._operationTimeoutCb = timeoutOps.cb; - } - } - - var self = this; - if (this._operationTimeoutCb) { - this._timeout = setTimeout(function() { - self._operationTimeoutCb(); - }, self._operationTimeout); - } - - this._fn(this._attempts); -}; - -RetryOperation.prototype.try = function(fn) { - console.log('Using RetryOperation.try() is deprecated'); - this.attempt(fn); -}; - -RetryOperation.prototype.start = function(fn) { - console.log('Using RetryOperation.start() is deprecated'); - this.attempt(fn); -}; - -RetryOperation.prototype.start = RetryOperation.prototype.try; - -RetryOperation.prototype.errors = function() { - return this._errors; -}; - -RetryOperation.prototype.attempts = function() { - return this._attempts; -}; - -RetryOperation.prototype.mainError = function() { - if (this._errors.length === 0) { - return null; - } - - var counts = {}; - var mainError = null; - var mainErrorCount = 0; - - for (var i = 0; i < this._errors.length; i++) { - var error = this._errors[i]; - var message = error.message; - var count = (counts[message] || 0) + 1; - - counts[message] = count; - - if (count >= mainErrorCount) { - mainError = error; - mainErrorCount = count; - } - } - - return mainError; -}; - - -/***/ }), -/* 634 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. - -;(function (factory) { - var objectTypes = { - 'function': true, - 'object': true - }; - - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - - // Because of build optimizers - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(40)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Rx, exports) { - return factory(root, exports, Rx); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof module === 'object' && module && module.exports === freeExports) { - module.exports = factory(root, module.exports, require('./rx')); - } else { - root.Rx = factory(root, {}, root.Rx); - } -}.call(this, function (root, exp, Rx, undefined) { - - // References - var Observable = Rx.Observable, - observableProto = Observable.prototype, - BinaryDisposable = Rx.BinaryDisposable, - AnonymousObservable = Rx.AnonymousObservable, - AbstractObserver = Rx.internals.AbstractObserver, - disposableEmpty = Rx.Disposable.empty, - helpers = Rx.helpers, - defaultComparer = helpers.defaultComparer, - identity = helpers.identity, - defaultSubComparer = helpers.defaultSubComparer, - isFunction = helpers.isFunction, - isPromise = helpers.isPromise, - isArrayLike = helpers.isArrayLike, - isIterable = helpers.isIterable, - inherits = Rx.internals.inherits, - observableFromPromise = Observable.fromPromise, - observableFrom = Observable.from, - bindCallback = Rx.internals.bindCallback, - EmptyError = Rx.EmptyError, - ObservableBase = Rx.ObservableBase, - ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError; - - var errorObj = {e: {}}; - - function tryCatcherGen(tryCatchTarget) { - return function tryCatcher() { - try { - return tryCatchTarget.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } - }; - } - - var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { - if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } - return tryCatcherGen(fn); - }; - - function thrower(e) { - throw e; - } - - var ExtremaByObservable = (function (__super__) { - inherits(ExtremaByObservable, __super__); - function ExtremaByObservable(source, k, c) { - this.source = source; - this._k = k; - this._c = c; - __super__.call(this); - } - - ExtremaByObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new ExtremaByObserver(o, this._k, this._c)); - }; - - return ExtremaByObservable; - }(ObservableBase)); - - var ExtremaByObserver = (function (__super__) { - inherits(ExtremaByObserver, __super__); - function ExtremaByObserver(o, k, c) { - this._o = o; - this._k = k; - this._c = c; - this._v = null; - this._hv = false; - this._l = []; - __super__.call(this); - } - - ExtremaByObserver.prototype.next = function (x) { - var key = tryCatch(this._k)(x); - if (key === errorObj) { return this._o.onError(key.e); } - var comparison = 0; - if (!this._hv) { - this._hv = true; - this._v = key; - } else { - comparison = tryCatch(this._c)(key, this._v); - if (comparison === errorObj) { return this._o.onError(comparison.e); } - } - if (comparison > 0) { - this._v = key; - this._l = []; - } - if (comparison >= 0) { this._l.push(x); } - }; - - ExtremaByObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - ExtremaByObserver.prototype.completed = function () { - this._o.onNext(this._l); - this._o.onCompleted(); - }; - - return ExtremaByObserver; - }(AbstractObserver)); - - function firstOnly(x) { - if (x.length === 0) { throw new EmptyError(); } - return x[0]; - } - - var ReduceObservable = (function(__super__) { - inherits(ReduceObservable, __super__); - function ReduceObservable(source, accumulator, hasSeed, seed) { - this.source = source; - this.accumulator = accumulator; - this.hasSeed = hasSeed; - this.seed = seed; - __super__.call(this); - } - - ReduceObservable.prototype.subscribeCore = function(observer) { - return this.source.subscribe(new ReduceObserver(observer,this)); - }; - - return ReduceObservable; - }(ObservableBase)); - - var ReduceObserver = (function (__super__) { - inherits(ReduceObserver, __super__); - function ReduceObserver(o, parent) { - this._o = o; - this._p = parent; - this._fn = parent.accumulator; - this._hs = parent.hasSeed; - this._s = parent.seed; - this._ha = false; - this._a = null; - this._hv = false; - this._i = 0; - __super__.call(this); - } - - ReduceObserver.prototype.next = function (x) { - !this._hv && (this._hv = true); - if (this._ha) { - this._a = tryCatch(this._fn)(this._a, x, this._i, this._p); - } else { - this._a = this._hs ? tryCatch(this._fn)(this._s, x, this._i, this._p) : x; - this._ha = true; - } - if (this._a === errorObj) { return this._o.onError(this._a.e); } - this._i++; - }; - - ReduceObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - ReduceObserver.prototype.completed = function () { - this._hv && this._o.onNext(this._a); - !this._hv && this._hs && this._o.onNext(this._s); - !this._hv && !this._hs && this._o.onError(new EmptyError()); - this._o.onCompleted(); - }; - - return ReduceObserver; - }(AbstractObserver)); - - /** - * Applies an accumulator function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified seed value is used as the initial accumulator value. - * For aggregation behavior with incremental intermediate results, see Observable.scan. - * @param {Function} accumulator An accumulator function to be invoked on each element. - * @param {Any} [seed] The initial accumulator value. - * @returns {Observable} An observable sequence containing a single element with the final accumulator value. - */ - observableProto.reduce = function () { - var hasSeed = false, seed, accumulator = arguments[0]; - if (arguments.length === 2) { - hasSeed = true; - seed = arguments[1]; - } - return new ReduceObservable(this, accumulator, hasSeed, seed); - }; - - var SomeObservable = (function (__super__) { - inherits(SomeObservable, __super__); - function SomeObservable(source, fn) { - this.source = source; - this._fn = fn; - __super__.call(this); - } - - SomeObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new SomeObserver(o, this._fn, this.source)); - }; - - return SomeObservable; - }(ObservableBase)); - - var SomeObserver = (function (__super__) { - inherits(SomeObserver, __super__); - - function SomeObserver(o, fn, s) { - this._o = o; - this._fn = fn; - this._s = s; - this._i = 0; - __super__.call(this); - } - - SomeObserver.prototype.next = function (x) { - var result = tryCatch(this._fn)(x, this._i++, this._s); - if (result === errorObj) { return this._o.onError(result.e); } - if (Boolean(result)) { - this._o.onNext(true); - this._o.onCompleted(); - } - }; - SomeObserver.prototype.error = function (e) { this._o.onError(e); }; - SomeObserver.prototype.completed = function () { - this._o.onNext(false); - this._o.onCompleted(); - }; - - return SomeObserver; - }(AbstractObserver)); - - /** - * Determines whether any element of an observable sequence satisfies a condition if present, else if any items are in the sequence. - * @param {Function} [predicate] A function to test each element for a condition. - * @returns {Observable} An observable sequence containing a single element determining whether any elements in the source sequence pass the test in the specified predicate if given, else if any items are in the sequence. - */ - observableProto.some = function (predicate, thisArg) { - var fn = bindCallback(predicate, thisArg, 3); - return new SomeObservable(this, fn); - }; - - var IsEmptyObservable = (function (__super__) { - inherits(IsEmptyObservable, __super__); - function IsEmptyObservable(source) { - this.source = source; - __super__.call(this); - } - - IsEmptyObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new IsEmptyObserver(o)); - }; - - return IsEmptyObservable; - }(ObservableBase)); - - var IsEmptyObserver = (function(__super__) { - inherits(IsEmptyObserver, __super__); - function IsEmptyObserver(o) { - this._o = o; - __super__.call(this); - } - - IsEmptyObserver.prototype.next = function () { - this._o.onNext(false); - this._o.onCompleted(); - }; - IsEmptyObserver.prototype.error = function (e) { this._o.onError(e); }; - IsEmptyObserver.prototype.completed = function () { - this._o.onNext(true); - this._o.onCompleted(); - }; - - return IsEmptyObserver; - }(AbstractObserver)); - - /** - * Determines whether an observable sequence is empty. - * @returns {Observable} An observable sequence containing a single element determining whether the source sequence is empty. - */ - observableProto.isEmpty = function () { - return new IsEmptyObservable(this); - }; - - var EveryObservable = (function (__super__) { - inherits(EveryObservable, __super__); - function EveryObservable(source, fn) { - this.source = source; - this._fn = fn; - __super__.call(this); - } - - EveryObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new EveryObserver(o, this._fn, this.source)); - }; - - return EveryObservable; - }(ObservableBase)); - - var EveryObserver = (function (__super__) { - inherits(EveryObserver, __super__); - - function EveryObserver(o, fn, s) { - this._o = o; - this._fn = fn; - this._s = s; - this._i = 0; - __super__.call(this); - } - - EveryObserver.prototype.next = function (x) { - var result = tryCatch(this._fn)(x, this._i++, this._s); - if (result === errorObj) { return this._o.onError(result.e); } - if (!Boolean(result)) { - this._o.onNext(false); - this._o.onCompleted(); - } - }; - EveryObserver.prototype.error = function (e) { this._o.onError(e); }; - EveryObserver.prototype.completed = function () { - this._o.onNext(true); - this._o.onCompleted(); - }; - - return EveryObserver; - }(AbstractObserver)); - - /** - * Determines whether all elements of an observable sequence satisfy a condition. - * @param {Function} [predicate] A function to test each element for a condition. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} An observable sequence containing a single element determining whether all elements in the source sequence pass the test in the specified predicate. - */ - observableProto.every = function (predicate, thisArg) { - var fn = bindCallback(predicate, thisArg, 3); - return new EveryObservable(this, fn); - }; - - var IncludesObservable = (function (__super__) { - inherits(IncludesObservable, __super__); - function IncludesObservable(source, elem, idx) { - var n = +idx || 0; - Math.abs(n) === Infinity && (n = 0); - - this.source = source; - this._elem = elem; - this._n = n; - __super__.call(this); - } - - IncludesObservable.prototype.subscribeCore = function (o) { - if (this._n < 0) { - o.onNext(false); - o.onCompleted(); - return disposableEmpty; - } - - return this.source.subscribe(new IncludesObserver(o, this._elem, this._n)); - }; - - return IncludesObservable; - }(ObservableBase)); - - var IncludesObserver = (function (__super__) { - inherits(IncludesObserver, __super__); - function IncludesObserver(o, elem, n) { - this._o = o; - this._elem = elem; - this._n = n; - this._i = 0; - __super__.call(this); - } - - function comparer(a, b) { - return (a === 0 && b === 0) || (a === b || (isNaN(a) && isNaN(b))); - } - - IncludesObserver.prototype.next = function (x) { - if (this._i++ >= this._n && comparer(x, this._elem)) { - this._o.onNext(true); - this._o.onCompleted(); - } - }; - IncludesObserver.prototype.error = function (e) { this._o.onError(e); }; - IncludesObserver.prototype.completed = function () { this._o.onNext(false); this._o.onCompleted(); }; - - return IncludesObserver; - }(AbstractObserver)); - - /** - * Determines whether an observable sequence includes a specified element with an optional equality comparer. - * @param searchElement The value to locate in the source sequence. - * @param {Number} [fromIndex] An equality comparer to compare elements. - * @returns {Observable} An observable sequence containing a single element determining whether the source sequence includes an element that has the specified value from the given index. - */ - observableProto.includes = function (searchElement, fromIndex) { - return new IncludesObservable(this, searchElement, fromIndex); - }; - - var CountObservable = (function (__super__) { - inherits(CountObservable, __super__); - function CountObservable(source, fn) { - this.source = source; - this._fn = fn; - __super__.call(this); - } - - CountObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new CountObserver(o, this._fn, this.source)); - }; - - return CountObservable; - }(ObservableBase)); - - var CountObserver = (function (__super__) { - inherits(CountObserver, __super__); - - function CountObserver(o, fn, s) { - this._o = o; - this._fn = fn; - this._s = s; - this._i = 0; - this._c = 0; - __super__.call(this); - } - - CountObserver.prototype.next = function (x) { - if (this._fn) { - var result = tryCatch(this._fn)(x, this._i++, this._s); - if (result === errorObj) { return this._o.onError(result.e); } - Boolean(result) && (this._c++); - } else { - this._c++; - } - }; - CountObserver.prototype.error = function (e) { this._o.onError(e); }; - CountObserver.prototype.completed = function () { - this._o.onNext(this._c); - this._o.onCompleted(); - }; - - return CountObserver; - }(AbstractObserver)); - - /** - * Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items. - * @example - * res = source.count(); - * res = source.count(function (x) { return x > 3; }); - * @param {Function} [predicate]A function to test each element for a condition. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} An observable sequence containing a single element with a number that represents how many elements in the input sequence satisfy the condition in the predicate function if provided, else the count of items in the sequence. - */ - observableProto.count = function (predicate, thisArg) { - var fn = bindCallback(predicate, thisArg, 3); - return new CountObservable(this, fn); - }; - - var IndexOfObservable = (function (__super__) { - inherits(IndexOfObservable, __super__); - function IndexOfObservable(source, e, n) { - this.source = source; - this._e = e; - this._n = n; - __super__.call(this); - } - - IndexOfObservable.prototype.subscribeCore = function (o) { - if (this._n < 0) { - o.onNext(-1); - o.onCompleted(); - return disposableEmpty; - } - - return this.source.subscribe(new IndexOfObserver(o, this._e, this._n)); - }; - - return IndexOfObservable; - }(ObservableBase)); - - var IndexOfObserver = (function (__super__) { - inherits(IndexOfObserver, __super__); - function IndexOfObserver(o, e, n) { - this._o = o; - this._e = e; - this._n = n; - this._i = 0; - __super__.call(this); - } - - IndexOfObserver.prototype.next = function (x) { - if (this._i >= this._n && x === this._e) { - this._o.onNext(this._i); - this._o.onCompleted(); - } - this._i++; - }; - IndexOfObserver.prototype.error = function (e) { this._o.onError(e); }; - IndexOfObserver.prototype.completed = function () { this._o.onNext(-1); this._o.onCompleted(); }; - - return IndexOfObserver; - }(AbstractObserver)); - - /** - * Returns the first index at which a given element can be found in the observable sequence, or -1 if it is not present. - * @param {Any} searchElement Element to locate in the array. - * @param {Number} [fromIndex] The index to start the search. If not specified, defaults to 0. - * @returns {Observable} And observable sequence containing the first index at which a given element can be found in the observable sequence, or -1 if it is not present. - */ - observableProto.indexOf = function(searchElement, fromIndex) { - var n = +fromIndex || 0; - Math.abs(n) === Infinity && (n = 0); - return new IndexOfObservable(this, searchElement, n); - }; - - var SumObservable = (function (__super__) { - inherits(SumObservable, __super__); - function SumObservable(source, fn) { - this.source = source; - this._fn = fn; - __super__.call(this); - } - - SumObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new SumObserver(o, this._fn, this.source)); - }; - - return SumObservable; - }(ObservableBase)); - - var SumObserver = (function (__super__) { - inherits(SumObserver, __super__); - - function SumObserver(o, fn, s) { - this._o = o; - this._fn = fn; - this._s = s; - this._i = 0; - this._c = 0; - __super__.call(this); - } - - SumObserver.prototype.next = function (x) { - if (this._fn) { - var result = tryCatch(this._fn)(x, this._i++, this._s); - if (result === errorObj) { return this._o.onError(result.e); } - this._c += result; - } else { - this._c += x; - } - }; - SumObserver.prototype.error = function (e) { this._o.onError(e); }; - SumObserver.prototype.completed = function () { - this._o.onNext(this._c); - this._o.onCompleted(); - }; - - return SumObserver; - }(AbstractObserver)); - - /** - * Computes the sum of a sequence of values that are obtained by invoking an optional transform function on each element of the input sequence, else if not specified computes the sum on each item in the sequence. - * @param {Function} [selector] A transform function to apply to each element. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} An observable sequence containing a single element with the sum of the values in the source sequence. - */ - observableProto.sum = function (keySelector, thisArg) { - var fn = bindCallback(keySelector, thisArg, 3); - return new SumObservable(this, fn); - }; - - /** - * Returns the elements in an observable sequence with the minimum key value according to the specified comparer. - * @example - * var res = source.minBy(function (x) { return x.value; }); - * var res = source.minBy(function (x) { return x.value; }, function (x, y) { return x - y; }); - * @param {Function} keySelector Key selector function. - * @param {Function} [comparer] Comparer used to compare key values. - * @returns {Observable} An observable sequence containing a list of zero or more elements that have a minimum key value. - */ - observableProto.minBy = function (keySelector, comparer) { - comparer || (comparer = defaultSubComparer); - return new ExtremaByObservable(this, keySelector, function (x, y) { return comparer(x, y) * -1; }); - }; - - /** - * Returns the minimum element in an observable sequence according to the optional comparer else a default greater than less than check. - * @example - * var res = source.min(); - * var res = source.min(function (x, y) { return x.value - y.value; }); - * @param {Function} [comparer] Comparer used to compare elements. - * @returns {Observable} An observable sequence containing a single element with the minimum element in the source sequence. - */ - observableProto.min = function (comparer) { - return this.minBy(identity, comparer).map(firstOnly); - }; - - /** - * Returns the elements in an observable sequence with the maximum key value according to the specified comparer. - * @example - * var res = source.maxBy(function (x) { return x.value; }); - * var res = source.maxBy(function (x) { return x.value; }, function (x, y) { return x - y;; }); - * @param {Function} keySelector Key selector function. - * @param {Function} [comparer] Comparer used to compare key values. - * @returns {Observable} An observable sequence containing a list of zero or more elements that have a maximum key value. - */ - observableProto.maxBy = function (keySelector, comparer) { - comparer || (comparer = defaultSubComparer); - return new ExtremaByObservable(this, keySelector, comparer); - }; - - /** - * Returns the maximum value in an observable sequence according to the specified comparer. - * @example - * var res = source.max(); - * var res = source.max(function (x, y) { return x.value - y.value; }); - * @param {Function} [comparer] Comparer used to compare elements. - * @returns {Observable} An observable sequence containing a single element with the maximum element in the source sequence. - */ - observableProto.max = function (comparer) { - return this.maxBy(identity, comparer).map(firstOnly); - }; - - var AverageObservable = (function (__super__) { - inherits(AverageObservable, __super__); - function AverageObservable(source, fn) { - this.source = source; - this._fn = fn; - __super__.call(this); - } - - AverageObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new AverageObserver(o, this._fn, this.source)); - }; - - return AverageObservable; - }(ObservableBase)); - - var AverageObserver = (function(__super__) { - inherits(AverageObserver, __super__); - function AverageObserver(o, fn, s) { - this._o = o; - this._fn = fn; - this._s = s; - this._c = 0; - this._t = 0; - __super__.call(this); - } - - AverageObserver.prototype.next = function (x) { - if(this._fn) { - var r = tryCatch(this._fn)(x, this._c++, this._s); - if (r === errorObj) { return this._o.onError(r.e); } - this._t += r; - } else { - this._c++; - this._t += x; - } - }; - AverageObserver.prototype.error = function (e) { this._o.onError(e); }; - AverageObserver.prototype.completed = function () { - if (this._c === 0) { return this._o.onError(new EmptyError()); } - this._o.onNext(this._t / this._c); - this._o.onCompleted(); - }; - - return AverageObserver; - }(AbstractObserver)); - - /** - * Computes the average of an observable sequence of values that are in the sequence or obtained by invoking a transform function on each element of the input sequence if present. - * @param {Function} [selector] A transform function to apply to each element. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} An observable sequence containing a single element with the average of the sequence of values. - */ - observableProto.average = function (keySelector, thisArg) { - var source = this, fn; - if (isFunction(keySelector)) { - fn = bindCallback(keySelector, thisArg, 3); - } - return new AverageObservable(source, fn); - }; - - /** - * Determines whether two sequences are equal by comparing the elements pairwise using a specified equality comparer. - * - * @example - * var res = res = source.sequenceEqual([1,2,3]); - * var res = res = source.sequenceEqual([{ value: 42 }], function (x, y) { return x.value === y.value; }); - * 3 - res = source.sequenceEqual(Rx.Observable.returnValue(42)); - * 4 - res = source.sequenceEqual(Rx.Observable.returnValue({ value: 42 }), function (x, y) { return x.value === y.value; }); - * @param {Observable} second Second observable sequence or array to compare. - * @param {Function} [comparer] Comparer used to compare elements of both sequences. - * @returns {Observable} An observable sequence that contains a single element which indicates whether both sequences are of equal length and their corresponding elements are equal according to the specified equality comparer. - */ - observableProto.sequenceEqual = function (second, comparer) { - var first = this; - comparer || (comparer = defaultComparer); - return new AnonymousObservable(function (o) { - var donel = false, doner = false, ql = [], qr = []; - var subscription1 = first.subscribe(function (x) { - if (qr.length > 0) { - var v = qr.shift(); - var equal = tryCatch(comparer)(v, x); - if (equal === errorObj) { return o.onError(equal.e); } - if (!equal) { - o.onNext(false); - o.onCompleted(); - } - } else if (doner) { - o.onNext(false); - o.onCompleted(); - } else { - ql.push(x); - } - }, function(e) { o.onError(e); }, function () { - donel = true; - if (ql.length === 0) { - if (qr.length > 0) { - o.onNext(false); - o.onCompleted(); - } else if (doner) { - o.onNext(true); - o.onCompleted(); - } - } - }); - - (isArrayLike(second) || isIterable(second)) && (second = observableFrom(second)); - isPromise(second) && (second = observableFromPromise(second)); - var subscription2 = second.subscribe(function (x) { - if (ql.length > 0) { - var v = ql.shift(); - var equal = tryCatch(comparer)(v, x); - if (equal === errorObj) { return o.onError(equal.e); } - if (!equal) { - o.onNext(false); - o.onCompleted(); - } - } else if (donel) { - o.onNext(false); - o.onCompleted(); - } else { - qr.push(x); - } - }, function(e) { o.onError(e); }, function () { - doner = true; - if (qr.length === 0) { - if (ql.length > 0) { - o.onNext(false); - o.onCompleted(); - } else if (donel) { - o.onNext(true); - o.onCompleted(); - } - } - }); - return new BinaryDisposable(subscription1, subscription2); - }, first); - }; - - var ElementAtObservable = (function (__super__) { - inherits(ElementAtObservable, __super__); - function ElementAtObservable(source, i, d) { - this.source = source; - this._i = i; - this._d = d; - __super__.call(this); - } - - ElementAtObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new ElementAtObserver(o, this._i, this._d)); - }; - - return ElementAtObservable; - }(ObservableBase)); - - var ElementAtObserver = (function (__super__) { - inherits(ElementAtObserver, __super__); - - function ElementAtObserver(o, i, d) { - this._o = o; - this._i = i; - this._d = d; - __super__.call(this); - } - - ElementAtObserver.prototype.next = function (x) { - if (this._i-- === 0) { - this._o.onNext(x); - this._o.onCompleted(); - } - }; - ElementAtObserver.prototype.error = function (e) { this._o.onError(e); }; - ElementAtObserver.prototype.completed = function () { - if (this._d === undefined) { - this._o.onError(new ArgumentOutOfRangeError()); - } else { - this._o.onNext(this._d); - this._o.onCompleted(); - } - }; - - return ElementAtObserver; - }(AbstractObserver)); - - /** - * Returns the element at a specified index in a sequence or default value if not found. - * @param {Number} index The zero-based index of the element to retrieve. - * @param {Any} [defaultValue] The default value to use if elementAt does not find a value. - * @returns {Observable} An observable sequence that produces the element at the specified position in the source sequence. - */ - observableProto.elementAt = function (index, defaultValue) { - if (index < 0) { throw new ArgumentOutOfRangeError(); } - return new ElementAtObservable(this, index, defaultValue); - }; - - var SingleObserver = (function(__super__) { - inherits(SingleObserver, __super__); - function SingleObserver(o, obj, s) { - this._o = o; - this._obj = obj; - this._s = s; - this._i = 0; - this._hv = false; - this._v = null; - __super__.call(this); - } - - SingleObserver.prototype.next = function (x) { - var shouldYield = false; - if (this._obj.predicate) { - var res = tryCatch(this._obj.predicate)(x, this._i++, this._s); - if (res === errorObj) { return this._o.onError(res.e); } - Boolean(res) && (shouldYield = true); - } else if (!this._obj.predicate) { - shouldYield = true; - } - if (shouldYield) { - if (this._hv) { - return this._o.onError(new Error('Sequence contains more than one matching element')); - } - this._hv = true; - this._v = x; - } - }; - SingleObserver.prototype.error = function (e) { this._o.onError(e); }; - SingleObserver.prototype.completed = function () { - if (this._hv) { - this._o.onNext(this._v); - this._o.onCompleted(); - } - else if (this._obj.defaultValue === undefined) { - this._o.onError(new EmptyError()); - } else { - this._o.onNext(this._obj.defaultValue); - this._o.onCompleted(); - } - }; - - return SingleObserver; - }(AbstractObserver)); - - - /** - * Returns the only element of an observable sequence that satisfies the condition in the optional predicate, and reports an exception if there is not exactly one element in the observable sequence. - * @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate. - */ - observableProto.single = function (predicate, thisArg) { - var obj = {}, source = this; - if (typeof arguments[0] === 'object') { - obj = arguments[0]; - } else { - obj = { - predicate: arguments[0], - thisArg: arguments[1], - defaultValue: arguments[2] - }; - } - if (isFunction (obj.predicate)) { - var fn = obj.predicate; - obj.predicate = bindCallback(fn, obj.thisArg, 3); - } - return new AnonymousObservable(function (o) { - return source.subscribe(new SingleObserver(o, obj, source)); - }, source); - }; - - var FirstObservable = (function (__super__) { - inherits(FirstObservable, __super__); - function FirstObservable(source, obj) { - this.source = source; - this._obj = obj; - __super__.call(this); - } - - FirstObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new FirstObserver(o, this._obj, this.source)); - }; - - return FirstObservable; - }(ObservableBase)); - - var FirstObserver = (function(__super__) { - inherits(FirstObserver, __super__); - function FirstObserver(o, obj, s) { - this._o = o; - this._obj = obj; - this._s = s; - this._i = 0; - __super__.call(this); - } - - FirstObserver.prototype.next = function (x) { - if (this._obj.predicate) { - var res = tryCatch(this._obj.predicate)(x, this._i++, this._s); - if (res === errorObj) { return this._o.onError(res.e); } - if (Boolean(res)) { - this._o.onNext(x); - this._o.onCompleted(); - } - } else if (!this._obj.predicate) { - this._o.onNext(x); - this._o.onCompleted(); - } - }; - FirstObserver.prototype.error = function (e) { this._o.onError(e); }; - FirstObserver.prototype.completed = function () { - if (this._obj.defaultValue === undefined) { - this._o.onError(new EmptyError()); - } else { - this._o.onNext(this._obj.defaultValue); - this._o.onCompleted(); - } - }; - - return FirstObserver; - }(AbstractObserver)); - - /** - * Returns the first element of an observable sequence that satisfies the condition in the predicate if present else the first item in the sequence. - * @returns {Observable} Sequence containing the first element in the observable sequence that satisfies the condition in the predicate if provided, else the first item in the sequence. - */ - observableProto.first = function () { - var obj = {}, source = this; - if (typeof arguments[0] === 'object') { - obj = arguments[0]; - } else { - obj = { - predicate: arguments[0], - thisArg: arguments[1], - defaultValue: arguments[2] - }; - } - if (isFunction (obj.predicate)) { - var fn = obj.predicate; - obj.predicate = bindCallback(fn, obj.thisArg, 3); - } - return new FirstObservable(this, obj); - }; - - var LastObservable = (function (__super__) { - inherits(LastObservable, __super__); - function LastObservable(source, obj) { - this.source = source; - this._obj = obj; - __super__.call(this); - } - - LastObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new LastObserver(o, this._obj, this.source)); - }; - - return LastObservable; - }(ObservableBase)); - - var LastObserver = (function(__super__) { - inherits(LastObserver, __super__); - function LastObserver(o, obj, s) { - this._o = o; - this._obj = obj; - this._s = s; - this._i = 0; - this._hv = false; - this._v = null; - __super__.call(this); - } - - LastObserver.prototype.next = function (x) { - var shouldYield = false; - if (this._obj.predicate) { - var res = tryCatch(this._obj.predicate)(x, this._i++, this._s); - if (res === errorObj) { return this._o.onError(res.e); } - Boolean(res) && (shouldYield = true); - } else if (!this._obj.predicate) { - shouldYield = true; - } - if (shouldYield) { - this._hv = true; - this._v = x; - } - }; - LastObserver.prototype.error = function (e) { this._o.onError(e); }; - LastObserver.prototype.completed = function () { - if (this._hv) { - this._o.onNext(this._v); - this._o.onCompleted(); - } - else if (this._obj.defaultValue === undefined) { - this._o.onError(new EmptyError()); - } else { - this._o.onNext(this._obj.defaultValue); - this._o.onCompleted(); - } - }; - - return LastObserver; - }(AbstractObserver)); - - /** - * Returns the last element of an observable sequence that satisfies the condition in the predicate if specified, else the last element. - * @returns {Observable} Sequence containing the last element in the observable sequence that satisfies the condition in the predicate. - */ - observableProto.last = function () { - var obj = {}, source = this; - if (typeof arguments[0] === 'object') { - obj = arguments[0]; - } else { - obj = { - predicate: arguments[0], - thisArg: arguments[1], - defaultValue: arguments[2] - }; - } - if (isFunction (obj.predicate)) { - var fn = obj.predicate; - obj.predicate = bindCallback(fn, obj.thisArg, 3); - } - return new LastObservable(this, obj); - }; - - var FindValueObserver = (function(__super__) { - inherits(FindValueObserver, __super__); - function FindValueObserver(observer, source, callback, yieldIndex) { - this._o = observer; - this._s = source; - this._cb = callback; - this._y = yieldIndex; - this._i = 0; - __super__.call(this); - } - - FindValueObserver.prototype.next = function (x) { - var shouldRun = tryCatch(this._cb)(x, this._i, this._s); - if (shouldRun === errorObj) { return this._o.onError(shouldRun.e); } - if (shouldRun) { - this._o.onNext(this._y ? this._i : x); - this._o.onCompleted(); - } else { - this._i++; - } - }; - - FindValueObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - FindValueObserver.prototype.completed = function () { - this._y && this._o.onNext(-1); - this._o.onCompleted(); - }; - - return FindValueObserver; - }(AbstractObserver)); - - function findValue (source, predicate, thisArg, yieldIndex) { - var callback = bindCallback(predicate, thisArg, 3); - return new AnonymousObservable(function (o) { - return source.subscribe(new FindValueObserver(o, source, callback, yieldIndex)); - }, source); - } - - /** - * Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire Observable sequence. - * @param {Function} predicate The predicate that defines the conditions of the element to search for. - * @param {Any} [thisArg] Object to use as `this` when executing the predicate. - * @returns {Observable} An Observable sequence with the first element that matches the conditions defined by the specified predicate, if found; otherwise, undefined. - */ - observableProto.find = function (predicate, thisArg) { - return findValue(this, predicate, thisArg, false); - }; - - /** - * Searches for an element that matches the conditions defined by the specified predicate, and returns - * an Observable sequence with the zero-based index of the first occurrence within the entire Observable sequence. - * @param {Function} predicate The predicate that defines the conditions of the element to search for. - * @param {Any} [thisArg] Object to use as `this` when executing the predicate. - * @returns {Observable} An Observable sequence with the zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. - */ - observableProto.findIndex = function (predicate, thisArg) { - return findValue(this, predicate, thisArg, true); - }; - - var ToSetObservable = (function (__super__) { - inherits(ToSetObservable, __super__); - function ToSetObservable(source) { - this.source = source; - __super__.call(this); - } - - ToSetObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new ToSetObserver(o)); - }; - - return ToSetObservable; - }(ObservableBase)); - - var ToSetObserver = (function (__super__) { - inherits(ToSetObserver, __super__); - function ToSetObserver(o) { - this._o = o; - this._s = new root.Set(); - __super__.call(this); - } - - ToSetObserver.prototype.next = function (x) { - this._s.add(x); - }; - - ToSetObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - ToSetObserver.prototype.completed = function () { - this._o.onNext(this._s); - this._o.onCompleted(); - }; - - return ToSetObserver; - }(AbstractObserver)); - - /** - * Converts the observable sequence to a Set if it exists. - * @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence. - */ - observableProto.toSet = function () { - if (typeof root.Set === 'undefined') { throw new TypeError(); } - return new ToSetObservable(this); - }; - - var ToMapObservable = (function (__super__) { - inherits(ToMapObservable, __super__); - function ToMapObservable(source, k, e) { - this.source = source; - this._k = k; - this._e = e; - __super__.call(this); - } - - ToMapObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new ToMapObserver(o, this._k, this._e)); - }; - - return ToMapObservable; - }(ObservableBase)); - - var ToMapObserver = (function (__super__) { - inherits(ToMapObserver, __super__); - function ToMapObserver(o, k, e) { - this._o = o; - this._k = k; - this._e = e; - this._m = new root.Map(); - __super__.call(this); - } - - ToMapObserver.prototype.next = function (x) { - var key = tryCatch(this._k)(x); - if (key === errorObj) { return this._o.onError(key.e); } - var elem = x; - if (this._e) { - elem = tryCatch(this._e)(x); - if (elem === errorObj) { return this._o.onError(elem.e); } - } - - this._m.set(key, elem); - }; - - ToMapObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - ToMapObserver.prototype.completed = function () { - this._o.onNext(this._m); - this._o.onCompleted(); - }; - - return ToMapObserver; - }(AbstractObserver)); - - /** - * Converts the observable sequence to a Map if it exists. - * @param {Function} keySelector A function which produces the key for the Map. - * @param {Function} [elementSelector] An optional function which produces the element for the Map. If not present, defaults to the value from the observable sequence. - * @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence. - */ - observableProto.toMap = function (keySelector, elementSelector) { - if (typeof root.Map === 'undefined') { throw new TypeError(); } - return new ToMapObservable(this, keySelector, elementSelector); - }; - - var SliceObservable = (function (__super__) { - inherits(SliceObservable, __super__); - function SliceObservable(source, b, e) { - this.source = source; - this._b = b; - this._e = e; - __super__.call(this); - } - - SliceObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new SliceObserver(o, this._b, this._e)); - }; - - return SliceObservable; - }(ObservableBase)); - - var SliceObserver = (function (__super__) { - inherits(SliceObserver, __super__); - - function SliceObserver(o, b, e) { - this._o = o; - this._b = b; - this._e = e; - this._i = 0; - __super__.call(this); - } - - SliceObserver.prototype.next = function (x) { - if (this._i >= this._b) { - if (this._e === this._i) { - this._o.onCompleted(); - } else { - this._o.onNext(x); - } - } - this._i++; - }; - SliceObserver.prototype.error = function (e) { this._o.onError(e); }; - SliceObserver.prototype.completed = function () { this._o.onCompleted(); }; - - return SliceObserver; - }(AbstractObserver)); - - /* - * The slice() method returns a shallow copy of a portion of an Observable into a new Observable object. - * Unlike the array version, this does not support negative numbers for being or end. - * @param {Number} [begin] Zero-based index at which to begin extraction. If omitted, this will default to zero. - * @param {Number} [end] Zero-based index at which to end extraction. slice extracts up to but not including end. - * If omitted, this will emit the rest of the Observable object. - * @returns {Observable} A shallow copy of a portion of an Observable into a new Observable object. - */ - observableProto.slice = function (begin, end) { - var start = begin || 0; - if (start < 0) { throw new Rx.ArgumentOutOfRangeError(); } - if (typeof end === 'number' && end < start) { - throw new Rx.ArgumentOutOfRangeError(); - } - return new SliceObservable(this, start, end); - }; - - var LastIndexOfObservable = (function (__super__) { - inherits(LastIndexOfObservable, __super__); - function LastIndexOfObservable(source, e, n) { - this.source = source; - this._e = e; - this._n = n; - __super__.call(this); - } - - LastIndexOfObservable.prototype.subscribeCore = function (o) { - if (this._n < 0) { - o.onNext(-1); - o.onCompleted(); - return disposableEmpty; - } - - return this.source.subscribe(new LastIndexOfObserver(o, this._e, this._n)); - }; - - return LastIndexOfObservable; - }(ObservableBase)); - - var LastIndexOfObserver = (function (__super__) { - inherits(LastIndexOfObserver, __super__); - function LastIndexOfObserver(o, e, n) { - this._o = o; - this._e = e; - this._n = n; - this._v = 0; - this._hv = false; - this._i = 0; - __super__.call(this); - } - - LastIndexOfObserver.prototype.next = function (x) { - if (this._i >= this._n && x === this._e) { - this._hv = true; - this._v = this._i; - } - this._i++; - }; - LastIndexOfObserver.prototype.error = function (e) { this._o.onError(e); }; - LastIndexOfObserver.prototype.completed = function () { - if (this._hv) { - this._o.onNext(this._v); - } else { - this._o.onNext(-1); - } - this._o.onCompleted(); - }; - - return LastIndexOfObserver; - }(AbstractObserver)); - - /** - * Returns the last index at which a given element can be found in the observable sequence, or -1 if it is not present. - * @param {Any} searchElement Element to locate in the array. - * @param {Number} [fromIndex] The index to start the search. If not specified, defaults to 0. - * @returns {Observable} And observable sequence containing the last index at which a given element can be found in the observable sequence, or -1 if it is not present. - */ - observableProto.lastIndexOf = function(searchElement, fromIndex) { - var n = +fromIndex || 0; - Math.abs(n) === Infinity && (n = 0); - return new LastIndexOfObservable(this, searchElement, n); - }; - - return Rx; -})); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module))) - -/***/ }), -/* 635 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. - -;(function (factory) { - var objectTypes = { - 'function': true, - 'object': true - }; - - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - - // Because of build optimizers - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(315), exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (Rx, exports) { - root.Rx = factory(root, exports, Rx); - return root.Rx; - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof module === 'object' && module && module.exports === freeExports) { - module.exports = factory(root, module.exports, require('./rx')); - } else { - root.Rx = factory(root, {}, root.Rx); - } -}.call(this, function (root, exp, Rx, undefined) { - - // Aliases - var Observable = Rx.Observable, - observableFromPromise = Observable.fromPromise, - observableThrow = Observable.throwError, - AnonymousObservable = Rx.AnonymousObservable, - ObservableBase = Rx.ObservableBase, - AsyncSubject = Rx.AsyncSubject, - disposableCreate = Rx.Disposable.create, - CompositeDisposable = Rx.CompositeDisposable, - immediateScheduler = Rx.Scheduler.immediate, - defaultScheduler = Rx.Scheduler['default'], - inherits = Rx.internals.inherits, - isScheduler = Rx.Scheduler.isScheduler, - isPromise = Rx.helpers.isPromise, - isFunction = Rx.helpers.isFunction, - isIterable = Rx.helpers.isIterable, - isArrayLike = Rx.helpers.isArrayLike; - - var errorObj = {e: {}}; - - function tryCatcherGen(tryCatchTarget) { - return function tryCatcher() { - try { - return tryCatchTarget.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } - }; - } - - var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { - if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } - return tryCatcherGen(fn); - }; - - function thrower(e) { - throw e; - } - - Observable.wrap = function (fn) { - function createObservable() { - return Observable.spawn.call(this, fn.apply(this, arguments)); - } - - createObservable.__generatorFunction__ = fn; - return createObservable; - }; - - var spawn = Observable.spawn = function () { - var gen = arguments[0], self = this, args = []; - for (var i = 1, len = arguments.length; i < len; i++) { args.push(arguments[i]); } - - return new AnonymousObservable(function (o) { - var g = new CompositeDisposable(); - - if (isFunction(gen)) { gen = gen.apply(self, args); } - if (!gen || !isFunction(gen.next)) { - o.onNext(gen); - return o.onCompleted(); - } - - function processGenerator(res) { - var ret = tryCatch(gen.next).call(gen, res); - if (ret === errorObj) { return o.onError(ret.e); } - next(ret); - } - - processGenerator(); - - function onError(err) { - var ret = tryCatch(gen.next).call(gen, err); - if (ret === errorObj) { return o.onError(ret.e); } - next(ret); - } - - function next(ret) { - if (ret.done) { - o.onNext(ret.value); - o.onCompleted(); - return; - } - var obs = toObservable.call(self, ret.value); - var value = null; - var hasValue = false; - if (Observable.isObservable(obs)) { - g.add(obs.subscribe(function(val) { - hasValue = true; - value = val; - }, onError, function() { - hasValue && processGenerator(value); - })); - } else { - onError(new TypeError('type not supported')); - } - } - - return g; - }); - }; - - function toObservable(obj) { - if (!obj) { return obj; } - if (Observable.isObservable(obj)) { return obj; } - if (isPromise(obj)) { return Observable.fromPromise(obj); } - if (isGeneratorFunction(obj) || isGenerator(obj)) { return spawn.call(this, obj); } - if (isFunction(obj)) { return thunkToObservable.call(this, obj); } - if (isArrayLike(obj) || isIterable(obj)) { return arrayToObservable.call(this, obj); } - if (isObject(obj)) {return objectToObservable.call(this, obj);} - return obj; - } - - function arrayToObservable (obj) { - return Observable.from(obj).concatMap(function(o) { - if(Observable.isObservable(o) || isObject(o)) { - return toObservable.call(null, o); - } else { - return Rx.Observable.just(o); - } - }).toArray(); - } - - function objectToObservable (obj) { - var results = new obj.constructor(), keys = Object.keys(obj), observables = []; - for (var i = 0, len = keys.length; i < len; i++) { - var key = keys[i]; - var observable = toObservable.call(this, obj[key]); - - if(observable && Observable.isObservable(observable)) { - defer(observable, key); - } else { - results[key] = obj[key]; - } - } - - return Observable.forkJoin.apply(Observable, observables).map(function() { - return results; - }); - - - function defer (observable, key) { - results[key] = undefined; - observables.push(observable.map(function (next) { - results[key] = next; - })); - } - } - - function thunkToObservable(fn) { - var self = this; - return new AnonymousObservable(function (o) { - fn.call(self, function () { - var err = arguments[0], res = arguments[1]; - if (err) { return o.onError(err); } - if (arguments.length > 2) { - var args = []; - for (var i = 1, len = arguments.length; i < len; i++) { args.push(arguments[i]); } - res = args; - } - o.onNext(res); - o.onCompleted(); - }); - }); - } - - function isGenerator(obj) { - return isFunction (obj.next) && isFunction (obj['throw']); - } - - function isGeneratorFunction(obj) { - var ctor = obj.constructor; - if (!ctor) { return false; } - if (ctor.name === 'GeneratorFunction' || ctor.displayName === 'GeneratorFunction') { return true; } - return isGenerator(ctor.prototype); - } - - function isObject(val) { - return Object == val.constructor; - } - - /** - * Invokes the specified function asynchronously on the specified scheduler, surfacing the result through an observable sequence. - * - * @example - * var res = Rx.Observable.start(function () { console.log('hello'); }); - * var res = Rx.Observable.start(function () { console.log('hello'); }, Rx.Scheduler.timeout); - * var res = Rx.Observable.start(function () { this.log('hello'); }, Rx.Scheduler.timeout, console); - * - * @param {Function} func Function to run asynchronously. - * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout. - * @param [context] The context for the func parameter to be executed. If not specified, defaults to undefined. - * @returns {Observable} An observable sequence exposing the function's result value, or an exception. - * - * Remarks - * * The function is called immediately, not during the subscription of the resulting sequence. - * * Multiple subscriptions to the resulting sequence can observe the function's result. - */ - Observable.start = function (func, context, scheduler) { - return observableToAsync(func, context, scheduler)(); - }; - - /** - * Converts the function into an asynchronous function. Each invocation of the resulting asynchronous function causes an invocation of the original synchronous function on the specified scheduler. - * @param {Function} function Function to convert to an asynchronous function. - * @param {Scheduler} [scheduler] Scheduler to run the function on. If not specified, defaults to Scheduler.timeout. - * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. - * @returns {Function} Asynchronous function. - */ - var observableToAsync = Observable.toAsync = function (func, context, scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - return function () { - var args = arguments, - subject = new AsyncSubject(); - - scheduler.schedule(null, function () { - var result; - try { - result = func.apply(context, args); - } catch (e) { - subject.onError(e); - return; - } - subject.onNext(result); - subject.onCompleted(); - }); - return subject.asObservable(); - }; - }; - -function createCbObservable(fn, ctx, selector, args) { - var o = new AsyncSubject(); - - args.push(createCbHandler(o, ctx, selector)); - fn.apply(ctx, args); - - return o.asObservable(); -} - -function createCbHandler(o, ctx, selector) { - return function handler () { - var len = arguments.length, results = new Array(len); - for(var i = 0; i < len; i++) { results[i] = arguments[i]; } - - if (isFunction(selector)) { - results = tryCatch(selector).apply(ctx, results); - if (results === errorObj) { return o.onError(results.e); } - o.onNext(results); - } else { - if (results.length <= 1) { - o.onNext(results[0]); - } else { - o.onNext(results); - } - } - - o.onCompleted(); - }; -} - -/** - * Converts a callback function to an observable sequence. - * - * @param {Function} fn Function with a callback as the last parameter to convert to an Observable sequence. - * @param {Mixed} [ctx] The context for the func parameter to be executed. If not specified, defaults to undefined. - * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next. - * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array. - */ -Observable.fromCallback = function (fn, ctx, selector) { - return function () { - typeof ctx === 'undefined' && (ctx = this); - - var len = arguments.length, args = new Array(len) - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - return createCbObservable(fn, ctx, selector, args); - }; -}; - -function createNodeObservable(fn, ctx, selector, args) { - var o = new AsyncSubject(); - - args.push(createNodeHandler(o, ctx, selector)); - fn.apply(ctx, args); - - return o.asObservable(); -} - -function createNodeHandler(o, ctx, selector) { - return function handler () { - var err = arguments[0]; - if (err) { return o.onError(err); } - - var len = arguments.length, results = []; - for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; } - - if (isFunction(selector)) { - var results = tryCatch(selector).apply(ctx, results); - if (results === errorObj) { return o.onError(results.e); } - o.onNext(results); - } else { - if (results.length <= 1) { - o.onNext(results[0]); - } else { - o.onNext(results); - } - } - - o.onCompleted(); - }; -} - -/** - * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format. - * @param {Function} fn The function to call - * @param {Mixed} [ctx] The context for the func parameter to be executed. If not specified, defaults to undefined. - * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next. - * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array. - */ -Observable.fromNodeCallback = function (fn, ctx, selector) { - return function () { - typeof ctx === 'undefined' && (ctx = this); - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - return createNodeObservable(fn, ctx, selector, args); - }; -}; - - function isNodeList(el) { - if (root.StaticNodeList) { - // IE8 Specific - // instanceof is slower than Object#toString, but Object#toString will not work as intended in IE8 - return el instanceof root.StaticNodeList || el instanceof root.NodeList; - } else { - return Object.prototype.toString.call(el) === '[object NodeList]'; - } - } - - function ListenDisposable(e, n, fn) { - this._e = e; - this._n = n; - this._fn = fn; - this._e.addEventListener(this._n, this._fn, false); - this.isDisposed = false; - } - ListenDisposable.prototype.dispose = function () { - if (!this.isDisposed) { - this._e.removeEventListener(this._n, this._fn, false); - this.isDisposed = true; - } - }; - - function createEventListener (el, eventName, handler) { - var disposables = new CompositeDisposable(); - - // Asume NodeList or HTMLCollection - var elemToString = Object.prototype.toString.call(el); - if (isNodeList(el) || elemToString === '[object HTMLCollection]') { - for (var i = 0, len = el.length; i < len; i++) { - disposables.add(createEventListener(el.item(i), eventName, handler)); - } - } else if (el) { - disposables.add(new ListenDisposable(el, eventName, handler)); - } - - return disposables; - } - - /** - * Configuration option to determine whether to use native events only - */ - Rx.config.useNativeEvents = false; - - var EventObservable = (function(__super__) { - inherits(EventObservable, __super__); - function EventObservable(el, name, fn) { - this._el = el; - this._n = name; - this._fn = fn; - __super__.call(this); - } - - function createHandler(o, fn) { - return function handler () { - var results = arguments[0]; - if (isFunction(fn)) { - results = tryCatch(fn).apply(null, arguments); - if (results === errorObj) { return o.onError(results.e); } - } - o.onNext(results); - }; - } - - EventObservable.prototype.subscribeCore = function (o) { - return createEventListener( - this._el, - this._n, - createHandler(o, this._fn)); - }; - - return EventObservable; - }(ObservableBase)); - - /** - * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList. - * @param {Object} element The DOMElement or NodeList to attach a listener. - * @param {String} eventName The event name to attach the observable sequence. - * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. - * @returns {Observable} An observable sequence of events from the specified element and the specified event. - */ - Observable.fromEvent = function (element, eventName, selector) { - // Node.js specific - if (element.addListener) { - return fromEventPattern( - function (h) { element.addListener(eventName, h); }, - function (h) { element.removeListener(eventName, h); }, - selector); - } - - // Use only if non-native events are allowed - if (!Rx.config.useNativeEvents) { - // Handles jq, Angular.js, Zepto, Marionette, Ember.js - if (typeof element.on === 'function' && typeof element.off === 'function') { - return fromEventPattern( - function (h) { element.on(eventName, h); }, - function (h) { element.off(eventName, h); }, - selector); - } - } - - return new EventObservable(element, eventName, selector).publish().refCount(); - }; - - var EventPatternObservable = (function(__super__) { - inherits(EventPatternObservable, __super__); - function EventPatternObservable(add, del, fn) { - this._add = add; - this._del = del; - this._fn = fn; - __super__.call(this); - } - - function createHandler(o, fn) { - return function handler () { - var results = arguments[0]; - if (isFunction(fn)) { - results = tryCatch(fn).apply(null, arguments); - if (results === errorObj) { return o.onError(results.e); } - } - o.onNext(results); - }; - } - - EventPatternObservable.prototype.subscribeCore = function (o) { - var fn = createHandler(o, this._fn); - var returnValue = this._add(fn); - return new EventPatternDisposable(this._del, fn, returnValue); - }; - - function EventPatternDisposable(del, fn, ret) { - this._del = del; - this._fn = fn; - this._ret = ret; - this.isDisposed = false; - } - - EventPatternDisposable.prototype.dispose = function () { - if(!this.isDisposed) { - isFunction(this._del) && this._del(this._fn, this._ret); - this.isDisposed = true; - } - }; - - return EventPatternObservable; - }(ObservableBase)); - - /** - * Creates an observable sequence from an event emitter via an addHandler/removeHandler pair. - * @param {Function} addHandler The function to add a handler to the emitter. - * @param {Function} [removeHandler] The optional function to remove a handler from an emitter. - * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. - * @returns {Observable} An observable sequence which wraps an event from an event emitter - */ - var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) { - return new EventPatternObservable(addHandler, removeHandler, selector).publish().refCount(); - }; - - /** - * Invokes the asynchronous function, surfacing the result through an observable sequence. - * @param {Function} functionAsync Asynchronous function which returns a Promise to run. - * @returns {Observable} An observable sequence exposing the function's result value, or an exception. - */ - Observable.startAsync = function (functionAsync) { - var promise = tryCatch(functionAsync)(); - if (promise === errorObj) { return observableThrow(promise.e); } - return observableFromPromise(promise); - }; - - return Rx; -})); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module))) - -/***/ }), -/* 636 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. - -;(function (factory) { - var objectTypes = { - 'function': true, - 'object': true - }; - - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - - // Because of build optimizers - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(40)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Rx, exports) { - return factory(root, exports, Rx); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof module === 'object' && module && module.exports === freeExports) { - module.exports = factory(root, module.exports, require('./rx')); - } else { - root.Rx = factory(root, {}, root.Rx); - } -}.call(this, function (root, exp, Rx, undefined) { - - // References - var Observable = Rx.Observable, - observableProto = Observable.prototype, - AnonymousObservable = Rx.AnonymousObservable, - AbstractObserver = Rx.internals.AbstractObserver, - CompositeDisposable = Rx.CompositeDisposable, - BinaryDisposable = Rx.BinaryDisposable, - NAryDisposable = Rx.NAryDisposable, - Notification = Rx.Notification, - Subject = Rx.Subject, - Observer = Rx.Observer, - disposableEmpty = Rx.Disposable.empty, - disposableCreate = Rx.Disposable.create, - inherits = Rx.internals.inherits, - addProperties = Rx.internals.addProperties, - defaultScheduler = Rx.Scheduler['default'], - currentThreadScheduler = Rx.Scheduler.currentThread, - identity = Rx.helpers.identity, - isScheduler = Rx.Scheduler.isScheduler, - isFunction = Rx.helpers.isFunction, - checkDisposed = Rx.Disposable.checkDisposed; - - var errorObj = {e: {}}; - - function tryCatcherGen(tryCatchTarget) { - return function tryCatcher() { - try { - return tryCatchTarget.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } - }; - } - - var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { - if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } - return tryCatcherGen(fn); - }; - - function thrower(e) { - throw e; - } - - /** - * Used to pause and resume streams. - */ - Rx.Pauser = (function (__super__) { - inherits(Pauser, __super__); - function Pauser() { - __super__.call(this); - } - - /** - * Pauses the underlying sequence. - */ - Pauser.prototype.pause = function () { this.onNext(false); }; - - /** - * Resumes the underlying sequence. - */ - Pauser.prototype.resume = function () { this.onNext(true); }; - - return Pauser; - }(Subject)); - - var PausableObservable = (function (__super__) { - inherits(PausableObservable, __super__); - function PausableObservable(source, pauser) { - this.source = source; - this.controller = new Subject(); - this.paused = true; - - if (pauser && pauser.subscribe) { - this.pauser = this.controller.merge(pauser); - } else { - this.pauser = this.controller; - } - - __super__.call(this); - } - - PausableObservable.prototype._subscribe = function (o) { - var conn = this.source.publish(), - subscription = conn.subscribe(o), - connection = disposableEmpty; - - var pausable = this.pauser.startWith(!this.paused).distinctUntilChanged().subscribe(function (b) { - if (b) { - connection = conn.connect(); - } else { - connection.dispose(); - connection = disposableEmpty; - } - }); - - return new NAryDisposable([subscription, connection, pausable]); - }; - - PausableObservable.prototype.pause = function () { - this.paused = true; - this.controller.onNext(false); - }; - - PausableObservable.prototype.resume = function () { - this.paused = false; - this.controller.onNext(true); - }; - - return PausableObservable; - - }(Observable)); - - /** - * Pauses the underlying observable sequence based upon the observable sequence which yields true/false. - * @example - * var pauser = new Rx.Subject(); - * var source = Rx.Observable.interval(100).pausable(pauser); - * @param {Observable} pauser The observable sequence used to pause the underlying sequence. - * @returns {Observable} The observable sequence which is paused based upon the pauser. - */ - observableProto.pausable = function (pauser) { - return new PausableObservable(this, pauser); - }; - - function combineLatestSource(source, subject, resultSelector) { - return new AnonymousObservable(function (o) { - var hasValue = [false, false], - hasValueAll = false, - isDone = false, - values = new Array(2), - err; - - function next(x, i) { - values[i] = x; - hasValue[i] = true; - if (hasValueAll || (hasValueAll = hasValue.every(identity))) { - if (err) { return o.onError(err); } - var res = tryCatch(resultSelector).apply(null, values); - if (res === errorObj) { return o.onError(res.e); } - o.onNext(res); - } - isDone && values[1] && o.onCompleted(); - } - - return new BinaryDisposable( - source.subscribe( - function (x) { - next(x, 0); - }, - function (e) { - if (values[1]) { - o.onError(e); - } else { - err = e; - } - }, - function () { - isDone = true; - values[1] && o.onCompleted(); - }), - subject.subscribe( - function (x) { - next(x, 1); - }, - function (e) { o.onError(e); }, - function () { - isDone = true; - next(true, 1); - }) - ); - }, source); - } - - var PausableBufferedObservable = (function (__super__) { - inherits(PausableBufferedObservable, __super__); - function PausableBufferedObservable(source, pauser) { - this.source = source; - this.controller = new Subject(); - this.paused = true; - - if (pauser && pauser.subscribe) { - this.pauser = this.controller.merge(pauser); - } else { - this.pauser = this.controller; - } - - __super__.call(this); - } - - PausableBufferedObservable.prototype._subscribe = function (o) { - var q = [], previousShouldFire; - - function drainQueue() { while (q.length > 0) { o.onNext(q.shift()); } } - - var subscription = - combineLatestSource( - this.source, - this.pauser.startWith(!this.paused).distinctUntilChanged(), - function (data, shouldFire) { - return { data: data, shouldFire: shouldFire }; - }) - .subscribe( - function (results) { - if (previousShouldFire !== undefined && results.shouldFire !== previousShouldFire) { - previousShouldFire = results.shouldFire; - // change in shouldFire - if (results.shouldFire) { drainQueue(); } - } else { - previousShouldFire = results.shouldFire; - // new data - if (results.shouldFire) { - o.onNext(results.data); - } else { - q.push(results.data); - } - } - }, - function (err) { - drainQueue(); - o.onError(err); - }, - function () { - drainQueue(); - o.onCompleted(); - } - ); - return subscription; - }; - - PausableBufferedObservable.prototype.pause = function () { - this.paused = true; - this.controller.onNext(false); - }; - - PausableBufferedObservable.prototype.resume = function () { - this.paused = false; - this.controller.onNext(true); - }; - - return PausableBufferedObservable; - - }(Observable)); - - /** - * Pauses the underlying observable sequence based upon the observable sequence which yields true/false, - * and yields the values that were buffered while paused. - * @example - * var pauser = new Rx.Subject(); - * var source = Rx.Observable.interval(100).pausableBuffered(pauser); - * @param {Observable} pauser The observable sequence used to pause the underlying sequence. - * @returns {Observable} The observable sequence which is paused based upon the pauser. - */ - observableProto.pausableBuffered = function (pauser) { - return new PausableBufferedObservable(this, pauser); - }; - - var ControlledObservable = (function (__super__) { - inherits(ControlledObservable, __super__); - function ControlledObservable (source, enableQueue, scheduler) { - __super__.call(this); - this.subject = new ControlledSubject(enableQueue, scheduler); - this.source = source.multicast(this.subject).refCount(); - } - - ControlledObservable.prototype._subscribe = function (o) { - return this.source.subscribe(o); - }; - - ControlledObservable.prototype.request = function (numberOfItems) { - return this.subject.request(numberOfItems == null ? -1 : numberOfItems); - }; - - return ControlledObservable; - - }(Observable)); - - var ControlledSubject = (function (__super__) { - inherits(ControlledSubject, __super__); - function ControlledSubject(enableQueue, scheduler) { - enableQueue == null && (enableQueue = true); - - __super__.call(this); - this.subject = new Subject(); - this.enableQueue = enableQueue; - this.queue = enableQueue ? [] : null; - this.requestedCount = 0; - this.requestedDisposable = null; - this.error = null; - this.hasFailed = false; - this.hasCompleted = false; - this.scheduler = scheduler || currentThreadScheduler; - } - - addProperties(ControlledSubject.prototype, Observer, { - _subscribe: function (o) { - return this.subject.subscribe(o); - }, - onCompleted: function () { - this.hasCompleted = true; - if (!this.enableQueue || this.queue.length === 0) { - this.subject.onCompleted(); - this.disposeCurrentRequest(); - } else { - this.queue.push(Notification.createOnCompleted()); - } - }, - onError: function (error) { - this.hasFailed = true; - this.error = error; - if (!this.enableQueue || this.queue.length === 0) { - this.subject.onError(error); - this.disposeCurrentRequest(); - } else { - this.queue.push(Notification.createOnError(error)); - } - }, - onNext: function (value) { - if (this.requestedCount <= 0) { - this.enableQueue && this.queue.push(Notification.createOnNext(value)); - } else { - (this.requestedCount-- === 0) && this.disposeCurrentRequest(); - this.subject.onNext(value); - } - }, - _processRequest: function (numberOfItems) { - if (this.enableQueue) { - while (this.queue.length > 0 && (numberOfItems > 0 || this.queue[0].kind !== 'N')) { - var first = this.queue.shift(); - first.accept(this.subject); - if (first.kind === 'N') { - numberOfItems--; - } else { - this.disposeCurrentRequest(); - this.queue = []; - } - } - } - - return numberOfItems; - }, - request: function (number) { - this.disposeCurrentRequest(); - var self = this; - - this.requestedDisposable = this.scheduler.schedule(number, - function(s, i) { - var remaining = self._processRequest(i); - var stopped = self.hasCompleted || self.hasFailed; - if (!stopped && remaining > 0) { - self.requestedCount = remaining; - - return disposableCreate(function () { - self.requestedCount = 0; - }); - // Scheduled item is still in progress. Return a new - // disposable to allow the request to be interrupted - // via dispose. - } - }); - - return this.requestedDisposable; - }, - disposeCurrentRequest: function () { - if (this.requestedDisposable) { - this.requestedDisposable.dispose(); - this.requestedDisposable = null; - } - } - }); - - return ControlledSubject; - }(Observable)); - - /** - * Attaches a controller to the observable sequence with the ability to queue. - * @example - * var source = Rx.Observable.interval(100).controlled(); - * source.request(3); // Reads 3 values - * @param {bool} enableQueue truthy value to determine if values should be queued pending the next request - * @param {Scheduler} scheduler determines how the requests will be scheduled - * @returns {Observable} The observable sequence which only propagates values on request. - */ - observableProto.controlled = function (enableQueue, scheduler) { - - if (enableQueue && isScheduler(enableQueue)) { - scheduler = enableQueue; - enableQueue = true; - } - - if (enableQueue == null) { enableQueue = true; } - return new ControlledObservable(this, enableQueue, scheduler); - }; - - var StopAndWaitObservable = (function (__super__) { - inherits(StopAndWaitObservable, __super__); - function StopAndWaitObservable (source) { - __super__.call(this); - this.source = source; - } - - function scheduleMethod(s, self) { - return self.source.request(1); - } - - StopAndWaitObservable.prototype._subscribe = function (o) { - this.subscription = this.source.subscribe(new StopAndWaitObserver(o, this, this.subscription)); - return new BinaryDisposable( - this.subscription, - defaultScheduler.schedule(this, scheduleMethod) - ); - }; - - var StopAndWaitObserver = (function (__sub__) { - inherits(StopAndWaitObserver, __sub__); - function StopAndWaitObserver (observer, observable, cancel) { - __sub__.call(this); - this.observer = observer; - this.observable = observable; - this.cancel = cancel; - this.scheduleDisposable = null; - } - - StopAndWaitObserver.prototype.completed = function () { - this.observer.onCompleted(); - this.dispose(); - }; - - StopAndWaitObserver.prototype.error = function (error) { - this.observer.onError(error); - this.dispose(); - }; - - function innerScheduleMethod(s, self) { - return self.observable.source.request(1); - } - - StopAndWaitObserver.prototype.next = function (value) { - this.observer.onNext(value); - this.scheduleDisposable = defaultScheduler.schedule(this, innerScheduleMethod); - }; - - StopAndWaitObserver.dispose = function () { - this.observer = null; - if (this.cancel) { - this.cancel.dispose(); - this.cancel = null; - } - if (this.scheduleDisposable) { - this.scheduleDisposable.dispose(); - this.scheduleDisposable = null; - } - __sub__.prototype.dispose.call(this); - }; - - return StopAndWaitObserver; - }(AbstractObserver)); - - return StopAndWaitObservable; - }(Observable)); - - - /** - * Attaches a stop and wait observable to the current observable. - * @returns {Observable} A stop and wait observable. - */ - ControlledObservable.prototype.stopAndWait = function () { - return new StopAndWaitObservable(this); - }; - - var WindowedObservable = (function (__super__) { - inherits(WindowedObservable, __super__); - function WindowedObservable(source, windowSize) { - __super__.call(this); - this.source = source; - this.windowSize = windowSize; - } - - function scheduleMethod(s, self) { - return self.source.request(self.windowSize); - } - - WindowedObservable.prototype._subscribe = function (o) { - this.subscription = this.source.subscribe(new WindowedObserver(o, this, this.subscription)); - return new BinaryDisposable( - this.subscription, - defaultScheduler.schedule(this, scheduleMethod) - ); - }; - - var WindowedObserver = (function (__sub__) { - inherits(WindowedObserver, __sub__); - function WindowedObserver(observer, observable, cancel) { - this.observer = observer; - this.observable = observable; - this.cancel = cancel; - this.received = 0; - this.scheduleDisposable = null; - __sub__.call(this); - } - - WindowedObserver.prototype.completed = function () { - this.observer.onCompleted(); - this.dispose(); - }; - - WindowedObserver.prototype.error = function (error) { - this.observer.onError(error); - this.dispose(); - }; - - function innerScheduleMethod(s, self) { - return self.observable.source.request(self.observable.windowSize); - } - - WindowedObserver.prototype.next = function (value) { - this.observer.onNext(value); - this.received = ++this.received % this.observable.windowSize; - this.received === 0 && (this.scheduleDisposable = defaultScheduler.schedule(this, innerScheduleMethod)); - }; - - WindowedObserver.prototype.dispose = function () { - this.observer = null; - if (this.cancel) { - this.cancel.dispose(); - this.cancel = null; - } - if (this.scheduleDisposable) { - this.scheduleDisposable.dispose(); - this.scheduleDisposable = null; - } - __sub__.prototype.dispose.call(this); - }; - - return WindowedObserver; - }(AbstractObserver)); - - return WindowedObservable; - }(Observable)); - - /** - * Creates a sliding windowed observable based upon the window size. - * @param {Number} windowSize The number of items in the window - * @returns {Observable} A windowed observable based upon the window size. - */ - ControlledObservable.prototype.windowed = function (windowSize) { - return new WindowedObservable(this, windowSize); - }; - - /** - * Pipes the existing Observable sequence into a Node.js Stream. - * @param {Stream} dest The destination Node.js stream. - * @returns {Stream} The destination stream. - */ - observableProto.pipe = function (dest) { - var source = this.pausableBuffered(); - - function onDrain() { - source.resume(); - } - - dest.addListener('drain', onDrain); - - source.subscribe( - function (x) { - !dest.write(x) && source.pause(); - }, - function (err) { - dest.emit('error', err); - }, - function () { - // Hack check because STDIO is not closable - !dest._isStdio && dest.end(); - dest.removeListener('drain', onDrain); - }); - - source.resume(); - - return dest; - }; - - return Rx; -})); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module))) - -/***/ }), -/* 637 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. - -;(function (factory) { - var objectTypes = { - 'function': true, - 'object': true - }; - - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - - // Because of build optimizers - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(40)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Rx, exports) { - return factory(root, exports, Rx); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof module === 'object' && module && module.exports === freeExports) { - module.exports = factory(root, module.exports, require('./rx')); - } else { - root.Rx = factory(root, {}, root.Rx); - } -}.call(this, function (root, exp, Rx, undefined) { - - var Observable = Rx.Observable, - ObservableBase = Rx.ObservableBase, - AbstractObserver = Rx.internals.AbstractObserver, - CompositeDisposable = Rx.CompositeDisposable, - BinaryDisposable = Rx.BinaryDisposable, - RefCountDisposable = Rx.RefCountDisposable, - SingleAssignmentDisposable = Rx.SingleAssignmentDisposable, - SerialDisposable = Rx.SerialDisposable, - Subject = Rx.Subject, - observableProto = Observable.prototype, - observableEmpty = Observable.empty, - observableNever = Observable.never, - AnonymousObservable = Rx.AnonymousObservable, - addRef = Rx.internals.addRef, - inherits = Rx.internals.inherits, - bindCallback = Rx.internals.bindCallback, - noop = Rx.helpers.noop, - isPromise = Rx.helpers.isPromise, - isFunction = Rx.helpers.isFunction, - observableFromPromise = Observable.fromPromise; - - var errorObj = {e: {}}; - - function tryCatcherGen(tryCatchTarget) { - return function tryCatcher() { - try { - return tryCatchTarget.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } - }; - } - - var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { - if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } - return tryCatcherGen(fn); - }; - - function thrower(e) { - throw e; - } - - var Map = root.Map || (function () { - function Map() { - this.size = 0; - this._values = []; - this._keys = []; - } - - Map.prototype['delete'] = function (key) { - var i = this._keys.indexOf(key); - if (i === -1) { return false; } - this._values.splice(i, 1); - this._keys.splice(i, 1); - this.size--; - return true; - }; - - Map.prototype.get = function (key) { - var i = this._keys.indexOf(key); - return i === -1 ? undefined : this._values[i]; - }; - - Map.prototype.set = function (key, value) { - var i = this._keys.indexOf(key); - if (i === -1) { - this._keys.push(key); - this._values.push(value); - this.size++; - } else { - this._values[i] = value; - } - return this; - }; - - Map.prototype.forEach = function (cb, thisArg) { - for (var i = 0; i < this.size; i++) { - cb.call(thisArg, this._values[i], this._keys[i]); - } - }; - - return Map; - }()); - - /** - * Correlates the elements of two sequences based on overlapping durations. - * - * @param {Observable} right The right observable sequence to join elements for. - * @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap. - * @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap. - * @param {Function} resultSelector A function invoked to compute a result element for any two overlapping elements of the left and right observable sequences. The parameters passed to the function correspond with the elements from the left and right source sequences for which overlap occurs. - * @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration. - */ - observableProto.join = function (right, leftDurationSelector, rightDurationSelector, resultSelector) { - var left = this; - return new AnonymousObservable(function (o) { - var group = new CompositeDisposable(); - var leftDone = false, rightDone = false; - var leftId = 0, rightId = 0; - var leftMap = new Map(), rightMap = new Map(); - var handleError = function (e) { o.onError(e); }; - - group.add(left.subscribe( - function (value) { - var id = leftId++, md = new SingleAssignmentDisposable(); - - leftMap.set(id, value); - group.add(md); - - var duration = tryCatch(leftDurationSelector)(value); - if (duration === errorObj) { return o.onError(duration.e); } - - md.setDisposable(duration.take(1).subscribe( - noop, - handleError, - function () { - leftMap['delete'](id) && leftMap.size === 0 && leftDone && o.onCompleted(); - group.remove(md); - })); - - rightMap.forEach(function (v) { - var result = tryCatch(resultSelector)(value, v); - if (result === errorObj) { return o.onError(result.e); } - o.onNext(result); - }); - }, - handleError, - function () { - leftDone = true; - (rightDone || leftMap.size === 0) && o.onCompleted(); - }) - ); - - group.add(right.subscribe( - function (value) { - var id = rightId++, md = new SingleAssignmentDisposable(); - - rightMap.set(id, value); - group.add(md); - - var duration = tryCatch(rightDurationSelector)(value); - if (duration === errorObj) { return o.onError(duration.e); } - - md.setDisposable(duration.take(1).subscribe( - noop, - handleError, - function () { - rightMap['delete'](id) && rightMap.size === 0 && rightDone && o.onCompleted(); - group.remove(md); - })); - - leftMap.forEach(function (v) { - var result = tryCatch(resultSelector)(v, value); - if (result === errorObj) { return o.onError(result.e); } - o.onNext(result); - }); - }, - handleError, - function () { - rightDone = true; - (leftDone || rightMap.size === 0) && o.onCompleted(); - }) - ); - return group; - }, left); - }; - - /** - * Correlates the elements of two sequences based on overlapping durations, and groups the results. - * - * @param {Observable} right The right observable sequence to join elements for. - * @param {Function} leftDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the left observable sequence, used to determine overlap. - * @param {Function} rightDurationSelector A function to select the duration (expressed as an observable sequence) of each element of the right observable sequence, used to determine overlap. - * @param {Function} resultSelector A function invoked to compute a result element for any element of the left sequence with overlapping elements from the right observable sequence. The first parameter passed to the function is an element of the left sequence. The second parameter passed to the function is an observable sequence with elements from the right sequence that overlap with the left sequence's element. - * @returns {Observable} An observable sequence that contains result elements computed from source elements that have an overlapping duration. - */ - observableProto.groupJoin = function (right, leftDurationSelector, rightDurationSelector, resultSelector) { - var left = this; - return new AnonymousObservable(function (o) { - var group = new CompositeDisposable(); - var r = new RefCountDisposable(group); - var leftMap = new Map(), rightMap = new Map(); - var leftId = 0, rightId = 0; - var handleError = function (e) { return function (v) { v.onError(e); }; }; - - function handleError(e) { }; - - group.add(left.subscribe( - function (value) { - var s = new Subject(); - var id = leftId++; - leftMap.set(id, s); - - var result = tryCatch(resultSelector)(value, addRef(s, r)); - if (result === errorObj) { - leftMap.forEach(handleError(result.e)); - return o.onError(result.e); - } - o.onNext(result); - - rightMap.forEach(function (v) { s.onNext(v); }); - - var md = new SingleAssignmentDisposable(); - group.add(md); - - var duration = tryCatch(leftDurationSelector)(value); - if (duration === errorObj) { - leftMap.forEach(handleError(duration.e)); - return o.onError(duration.e); - } - - md.setDisposable(duration.take(1).subscribe( - noop, - function (e) { - leftMap.forEach(handleError(e)); - o.onError(e); - }, - function () { - leftMap['delete'](id) && s.onCompleted(); - group.remove(md); - })); - }, - function (e) { - leftMap.forEach(handleError(e)); - o.onError(e); - }, - function () { o.onCompleted(); }) - ); - - group.add(right.subscribe( - function (value) { - var id = rightId++; - rightMap.set(id, value); - - var md = new SingleAssignmentDisposable(); - group.add(md); - - var duration = tryCatch(rightDurationSelector)(value); - if (duration === errorObj) { - leftMap.forEach(handleError(duration.e)); - return o.onError(duration.e); - } - - md.setDisposable(duration.take(1).subscribe( - noop, - function (e) { - leftMap.forEach(handleError(e)); - o.onError(e); - }, - function () { - rightMap['delete'](id); - group.remove(md); - })); - - leftMap.forEach(function (v) { v.onNext(value); }); - }, - function (e) { - leftMap.forEach(handleError(e)); - o.onError(e); - }) - ); - - return r; - }, left); - }; - - function toArray(x) { return x.toArray(); } - - /** - * Projects each element of an observable sequence into zero or more buffers. - * @param {Mixed} bufferOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows). - * @param {Function} [bufferClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored. - * @returns {Observable} An observable sequence of windows. - */ - observableProto.buffer = function () { - return this.window.apply(this, arguments) - .flatMap(toArray); - }; - - /** - * Projects each element of an observable sequence into zero or more windows. - * - * @param {Mixed} windowOpeningsOrClosingSelector Observable sequence whose elements denote the creation of new windows, or, a function invoked to define the boundaries of the produced windows (a new window is started when the previous one is closed, resulting in non-overlapping windows). - * @param {Function} [windowClosingSelector] A function invoked to define the closing of each produced window. If a closing selector function is specified for the first parameter, this parameter is ignored. - * @returns {Observable} An observable sequence of windows. - */ - observableProto.window = function (windowOpeningsOrClosingSelector, windowClosingSelector) { - if (arguments.length === 1 && typeof arguments[0] !== 'function') { - return observableWindowWithBoundaries.call(this, windowOpeningsOrClosingSelector); - } - return typeof windowOpeningsOrClosingSelector === 'function' ? - observableWindowWithClosingSelector.call(this, windowOpeningsOrClosingSelector) : - observableWindowWithOpenings.call(this, windowOpeningsOrClosingSelector, windowClosingSelector); - }; - - function observableWindowWithOpenings(windowOpenings, windowClosingSelector) { - return windowOpenings.groupJoin(this, windowClosingSelector, observableEmpty, function (_, win) { - return win; - }); - } - - function observableWindowWithBoundaries(windowBoundaries) { - var source = this; - return new AnonymousObservable(function (observer) { - var win = new Subject(), - d = new CompositeDisposable(), - r = new RefCountDisposable(d); - - observer.onNext(addRef(win, r)); - - d.add(source.subscribe(function (x) { - win.onNext(x); - }, function (err) { - win.onError(err); - observer.onError(err); - }, function () { - win.onCompleted(); - observer.onCompleted(); - })); - - isPromise(windowBoundaries) && (windowBoundaries = observableFromPromise(windowBoundaries)); - - d.add(windowBoundaries.subscribe(function (w) { - win.onCompleted(); - win = new Subject(); - observer.onNext(addRef(win, r)); - }, function (err) { - win.onError(err); - observer.onError(err); - }, function () { - win.onCompleted(); - observer.onCompleted(); - })); - - return r; - }, source); - } - - function observableWindowWithClosingSelector(windowClosingSelector) { - var source = this; - return new AnonymousObservable(function (observer) { - var m = new SerialDisposable(), - d = new CompositeDisposable(m), - r = new RefCountDisposable(d), - win = new Subject(); - observer.onNext(addRef(win, r)); - d.add(source.subscribe(function (x) { - win.onNext(x); - }, function (err) { - win.onError(err); - observer.onError(err); - }, function () { - win.onCompleted(); - observer.onCompleted(); - })); - - function createWindowClose () { - var windowClose; - try { - windowClose = windowClosingSelector(); - } catch (e) { - observer.onError(e); - return; - } - - isPromise(windowClose) && (windowClose = observableFromPromise(windowClose)); - - var m1 = new SingleAssignmentDisposable(); - m.setDisposable(m1); - m1.setDisposable(windowClose.take(1).subscribe(noop, function (err) { - win.onError(err); - observer.onError(err); - }, function () { - win.onCompleted(); - win = new Subject(); - observer.onNext(addRef(win, r)); - createWindowClose(); - })); - } - - createWindowClose(); - return r; - }, source); - } - - var PairwiseObservable = (function (__super__) { - inherits(PairwiseObservable, __super__); - function PairwiseObservable(source) { - this.source = source; - __super__.call(this); - } - - PairwiseObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new PairwiseObserver(o)); - }; - - return PairwiseObservable; - }(ObservableBase)); - - var PairwiseObserver = (function(__super__) { - inherits(PairwiseObserver, __super__); - function PairwiseObserver(o) { - this._o = o; - this._p = null; - this._hp = false; - __super__.call(this); - } - - PairwiseObserver.prototype.next = function (x) { - if (this._hp) { - this._o.onNext([this._p, x]); - } else { - this._hp = true; - } - this._p = x; - }; - PairwiseObserver.prototype.error = function (err) { this._o.onError(err); }; - PairwiseObserver.prototype.completed = function () { this._o.onCompleted(); }; - - return PairwiseObserver; - }(AbstractObserver)); - - /** - * Returns a new observable that triggers on the second and subsequent triggerings of the input observable. - * The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair. - * The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs. - * @returns {Observable} An observable that triggers on successive pairs of observations from the input observable as an array. - */ - observableProto.pairwise = function () { - return new PairwiseObservable(this); - }; - - /** - * Returns two observables which partition the observations of the source by the given function. - * The first will trigger observations for those values for which the predicate returns true. - * The second will trigger observations for those values where the predicate returns false. - * The predicate is executed once for each subscribed observer. - * Both also propagate all error observations arising from the source and each completes - * when the source completes. - * @param {Function} predicate - * The function to determine which output Observable will trigger a particular observation. - * @returns {Array} - * An array of observables. The first triggers when the predicate returns true, - * and the second triggers when the predicate returns false. - */ - observableProto.partition = function(predicate, thisArg) { - var fn = bindCallback(predicate, thisArg, 3); - return [ - this.filter(predicate, thisArg), - this.filter(function (x, i, o) { return !fn(x, i, o); }) - ]; - }; - - /** - * Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function. - * - * @example - * var res = observable.groupBy(function (x) { return x.id; }); - * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }); - * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); }); - * @param {Function} keySelector A function to extract the key for each element. - * @param {Function} [elementSelector] A function to map each source element to an element in an observable group. - * @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. - */ - observableProto.groupBy = function (keySelector, elementSelector) { - return this.groupByUntil(keySelector, elementSelector, observableNever); - }; - - /** - * Groups the elements of an observable sequence according to a specified key selector function. - * A duration selector function is used to control the lifetime of groups. When a group expires, it receives an OnCompleted notification. When a new element with the same - * key value as a reclaimed group occurs, the group will be reborn with a new lifetime request. - * - * @example - * var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); }); - * 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }); - * 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); }); - * @param {Function} keySelector A function to extract the key for each element. - * @param {Function} durationSelector A function to signal the expiration of a group. - * @returns {Observable} - * A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. - * If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered. - * - */ - observableProto.groupByUntil = function (keySelector, elementSelector, durationSelector) { - var source = this; - return new AnonymousObservable(function (o) { - var map = new Map(), - groupDisposable = new CompositeDisposable(), - refCountDisposable = new RefCountDisposable(groupDisposable), - handleError = function (e) { return function (item) { item.onError(e); }; }; - - groupDisposable.add( - source.subscribe(function (x) { - var key = tryCatch(keySelector)(x); - if (key === errorObj) { - map.forEach(handleError(key.e)); - return o.onError(key.e); - } - - var fireNewMapEntry = false, writer = map.get(key); - if (writer === undefined) { - writer = new Subject(); - map.set(key, writer); - fireNewMapEntry = true; - } - - if (fireNewMapEntry) { - var group = new GroupedObservable(key, writer, refCountDisposable), - durationGroup = new GroupedObservable(key, writer); - var duration = tryCatch(durationSelector)(durationGroup); - if (duration === errorObj) { - map.forEach(handleError(duration.e)); - return o.onError(duration.e); - } - - o.onNext(group); - - var md = new SingleAssignmentDisposable(); - groupDisposable.add(md); - - md.setDisposable(duration.take(1).subscribe( - noop, - function (e) { - map.forEach(handleError(e)); - o.onError(e); - }, - function () { - if (map['delete'](key)) { writer.onCompleted(); } - groupDisposable.remove(md); - })); - } - - var element = x; - if (isFunction(elementSelector)) { - element = tryCatch(elementSelector)(x); - if (element === errorObj) { - map.forEach(handleError(element.e)); - return o.onError(element.e); - } - } - - writer.onNext(element); - }, function (e) { - map.forEach(handleError(e)); - o.onError(e); - }, function () { - map.forEach(function (item) { item.onCompleted(); }); - o.onCompleted(); - })); - - return refCountDisposable; - }, source); - }; - - var UnderlyingObservable = (function (__super__) { - inherits(UnderlyingObservable, __super__); - function UnderlyingObservable(m, u) { - this._m = m; - this._u = u; - __super__.call(this); - } - - UnderlyingObservable.prototype.subscribeCore = function (o) { - return new BinaryDisposable(this._m.getDisposable(), this._u.subscribe(o)); - }; - - return UnderlyingObservable; - }(ObservableBase)); - - var GroupedObservable = (function (__super__) { - inherits(GroupedObservable, __super__); - function GroupedObservable(key, underlyingObservable, mergedDisposable) { - __super__.call(this); - this.key = key; - this.underlyingObservable = !mergedDisposable ? - underlyingObservable : - new UnderlyingObservable(mergedDisposable, underlyingObservable); - } - - GroupedObservable.prototype._subscribe = function (o) { - return this.underlyingObservable.subscribe(o); - }; - - return GroupedObservable; - }(Observable)); - - return Rx; -})); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module))) - -/***/ }), -/* 638 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. - -;(function (factory) { - var objectTypes = { - 'function': true, - 'object': true - }; - - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - - // Because of build optimizers - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(40)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Rx, exports) { - return factory(root, exports, Rx); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof module === 'object' && module && module.exports === freeExports) { - module.exports = factory(root, module.exports, require('./rx')); - } else { - root.Rx = factory(root, {}, root.Rx); - } -}.call(this, function (root, exp, Rx, undefined) { - - // Aliases - var Observable = Rx.Observable, - observableProto = Observable.prototype, - ObservableBase = Rx.ObservableBase, - AbstractObserver = Rx.internals.AbstractObserver, - FlatMapObservable = Rx.FlatMapObservable, - observableConcat = Observable.concat, - observableDefer = Observable.defer, - observableEmpty = Observable.empty, - disposableEmpty = Rx.Disposable.empty, - CompositeDisposable = Rx.CompositeDisposable, - SerialDisposable = Rx.SerialDisposable, - SingleAssignmentDisposable = Rx.SingleAssignmentDisposable, - Enumerable = Rx.internals.Enumerable, - enumerableOf = Enumerable.of, - currentThreadScheduler = Rx.Scheduler.currentThread, - AsyncSubject = Rx.AsyncSubject, - Observer = Rx.Observer, - inherits = Rx.internals.inherits, - addProperties = Rx.internals.addProperties, - helpers = Rx.helpers, - noop = helpers.noop, - isPromise = helpers.isPromise, - isFunction = helpers.isFunction, - isIterable = Rx.helpers.isIterable, - isArrayLike = Rx.helpers.isArrayLike, - isScheduler = Rx.Scheduler.isScheduler, - observableFromPromise = Observable.fromPromise; - - var errorObj = {e: {}}; - - function tryCatcherGen(tryCatchTarget) { - return function tryCatcher() { - try { - return tryCatchTarget.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } - }; - } - - var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { - if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } - return tryCatcherGen(fn); - }; - - function thrower(e) { - throw e; - } - - // Shim in iterator support - var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) || - '_es6shim_iterator_'; - // Bug for mozilla version - if (root.Set && typeof new root.Set()['@@iterator'] === 'function') { - $iterator$ = '@@iterator'; - } - - var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined }; - - var isIterable = Rx.helpers.isIterable = function (o) { - return o && o[$iterator$] !== undefined; - }; - - var isArrayLike = Rx.helpers.isArrayLike = function (o) { - return o && o.length !== undefined; - }; - - Rx.helpers.iterator = $iterator$; - - var WhileEnumerable = (function(__super__) { - inherits(WhileEnumerable, __super__); - function WhileEnumerable(c, s) { - this.c = c; - this.s = s; - } - WhileEnumerable.prototype[$iterator$] = function () { - var self = this; - return { - next: function () { - return self.c() ? - { done: false, value: self.s } : - { done: true, value: void 0 }; - } - }; - }; - return WhileEnumerable; - }(Enumerable)); - - function enumerableWhile(condition, source) { - return new WhileEnumerable(condition, source); - } - - /** - * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions. - * This operator allows for a fluent style of writing queries that use the same sequence multiple times. - * - * @param {Function} selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence. - * @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. - */ - observableProto.letBind = observableProto['let'] = function (func) { - return func(this); - }; - - /** - * Determines whether an observable collection contains values. - * - * @example - * 1 - res = Rx.Observable.if(condition, obs1); - * 2 - res = Rx.Observable.if(condition, obs1, obs2); - * 3 - res = Rx.Observable.if(condition, obs1, scheduler); - * @param {Function} condition The condition which determines if the thenSource or elseSource will be run. - * @param {Observable} thenSource The observable sequence or Promise that will be run if the condition function returns true. - * @param {Observable} [elseSource] The observable sequence or Promise that will be run if the condition function returns false. If this is not provided, it defaults to Rx.Observabe.Empty with the specified scheduler. - * @returns {Observable} An observable sequence which is either the thenSource or elseSource. - */ - Observable['if'] = function (condition, thenSource, elseSourceOrScheduler) { - return observableDefer(function () { - elseSourceOrScheduler || (elseSourceOrScheduler = observableEmpty()); - - isPromise(thenSource) && (thenSource = observableFromPromise(thenSource)); - isPromise(elseSourceOrScheduler) && (elseSourceOrScheduler = observableFromPromise(elseSourceOrScheduler)); - - // Assume a scheduler for empty only - typeof elseSourceOrScheduler.now === 'function' && (elseSourceOrScheduler = observableEmpty(elseSourceOrScheduler)); - return condition() ? thenSource : elseSourceOrScheduler; - }); - }; - - /** - * Concatenates the observable sequences obtained by running the specified result selector for each element in source. - * There is an alias for this method called 'forIn' for browsers 0) { - work = state.q.shift(); - } else { - state.isAcquired = false; - return; - } - var m1 = new SingleAssignmentDisposable(); - state.d.add(m1); - m1.setDisposable(work.subscribe(new ExpandObserver(state, self, m1))); - recurse([state, self]); - } - - ExpandObservable.prototype._ensureActive = function (state) { - var isOwner = false; - if (state.q.length > 0) { - isOwner = !state.isAcquired; - state.isAcquired = true; - } - isOwner && state.m.setDisposable(this._scheduler.scheduleRecursive([state, this], scheduleRecursive)); - }; - - ExpandObservable.prototype.subscribeCore = function (o) { - var m = new SerialDisposable(), - d = new CompositeDisposable(m), - state = { - q: [], - m: m, - d: d, - activeCount: 0, - isAcquired: false, - o: o - }; - - state.q.push(this.source); - state.activeCount++; - this._ensureActive(state); - return d; - }; - - return ExpandObservable; - }(ObservableBase)); - - var ExpandObserver = (function(__super__) { - inherits(ExpandObserver, __super__); - function ExpandObserver(state, parent, m1) { - this._s = state; - this._p = parent; - this._m1 = m1; - __super__.call(this); - } - - ExpandObserver.prototype.next = function (x) { - this._s.o.onNext(x); - var result = tryCatch(this._p._fn)(x); - if (result === errorObj) { return this._s.o.onError(result.e); } - this._s.q.push(result); - this._s.activeCount++; - this._p._ensureActive(this._s); - }; - - ExpandObserver.prototype.error = function (e) { - this._s.o.onError(e); - }; - - ExpandObserver.prototype.completed = function () { - this._s.d.remove(this._m1); - this._s.activeCount--; - this._s.activeCount === 0 && this._s.o.onCompleted(); - }; - - return ExpandObserver; - }(AbstractObserver)); - - /** - * Expands an observable sequence by recursively invoking selector. - * - * @param {Function} selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again. - * @param {Scheduler} [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler. - * @returns {Observable} An observable sequence containing all the elements produced by the recursive expansion. - */ - observableProto.expand = function (selector, scheduler) { - isScheduler(scheduler) || (scheduler = currentThreadScheduler); - return new ExpandObservable(this, selector, scheduler); - }; - - function argumentsToArray() { - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - return args; - } - - var ForkJoinObservable = (function (__super__) { - inherits(ForkJoinObservable, __super__); - function ForkJoinObservable(sources, cb) { - this._sources = sources; - this._cb = cb; - __super__.call(this); - } - - ForkJoinObservable.prototype.subscribeCore = function (o) { - if (this._sources.length === 0) { - o.onCompleted(); - return disposableEmpty; - } - - var count = this._sources.length; - var state = { - finished: false, - hasResults: new Array(count), - hasCompleted: new Array(count), - results: new Array(count) - }; - - var subscriptions = new CompositeDisposable(); - for (var i = 0, len = this._sources.length; i < len; i++) { - var source = this._sources[i]; - isPromise(source) && (source = observableFromPromise(source)); - subscriptions.add(source.subscribe(new ForkJoinObserver(o, state, i, this._cb, subscriptions))); - } - - return subscriptions; - }; - - return ForkJoinObservable; - }(ObservableBase)); - - var ForkJoinObserver = (function(__super__) { - inherits(ForkJoinObserver, __super__); - function ForkJoinObserver(o, s, i, cb, subs) { - this._o = o; - this._s = s; - this._i = i; - this._cb = cb; - this._subs = subs; - __super__.call(this); - } - - ForkJoinObserver.prototype.next = function (x) { - if (!this._s.finished) { - this._s.hasResults[this._i] = true; - this._s.results[this._i] = x; - } - }; - - ForkJoinObserver.prototype.error = function (e) { - this._s.finished = true; - this._o.onError(e); - this._subs.dispose(); - }; - - ForkJoinObserver.prototype.completed = function () { - if (!this._s.finished) { - if (!this._s.hasResults[this._i]) { - return this._o.onCompleted(); - } - this._s.hasCompleted[this._i] = true; - for (var i = 0; i < this._s.results.length; i++) { - if (!this._s.hasCompleted[i]) { return; } - } - this._s.finished = true; - - var res = tryCatch(this._cb).apply(null, this._s.results); - if (res === errorObj) { return this._o.onError(res.e); } - - this._o.onNext(res); - this._o.onCompleted(); - } - }; - - return ForkJoinObserver; - }(AbstractObserver)); - - /** - * Runs all observable sequences in parallel and collect their last elements. - * - * @example - * 1 - res = Rx.Observable.forkJoin([obs1, obs2]); - * 1 - res = Rx.Observable.forkJoin(obs1, obs2, ...); - * @returns {Observable} An observable sequence with an array collecting the last elements of all the input sequences. - */ - Observable.forkJoin = function () { - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; - Array.isArray(args[0]) && (args = args[0]); - return new ForkJoinObservable(args, resultSelector); - }; - - /** - * Runs two observable sequences in parallel and combines their last elemenets. - * @param {Observable} second Second observable sequence. - * @param {Function} resultSelector Result selector function to invoke with the last elements of both sequences. - * @returns {Observable} An observable sequence with the result of calling the selector function with the last elements of both input sequences. - */ - observableProto.forkJoin = function () { - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - if (Array.isArray(args[0])) { - args[0].unshift(this); - } else { - args.unshift(this); - } - return Observable.forkJoin.apply(null, args); - }; - - /** - * Comonadic bind operator. - * @param {Function} selector A transform function to apply to each element. - * @param {Object} scheduler Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler. - * @returns {Observable} An observable sequence which results from the comonadic bind operation. - */ - observableProto.manySelect = observableProto.extend = function (selector, scheduler) { - isScheduler(scheduler) || (scheduler = Rx.Scheduler.immediate); - var source = this; - return observableDefer(function () { - var chain; - - return source - .map(function (x) { - var curr = new ChainObservable(x); - - chain && chain.onNext(x); - chain = curr; - - return curr; - }) - .tap( - noop, - function (e) { chain && chain.onError(e); }, - function () { chain && chain.onCompleted(); } - ) - .observeOn(scheduler) - .map(selector); - }, source); - }; - - var ChainObservable = (function (__super__) { - inherits(ChainObservable, __super__); - function ChainObservable(head) { - __super__.call(this); - this.head = head; - this.tail = new AsyncSubject(); - } - - addProperties(ChainObservable.prototype, Observer, { - _subscribe: function (o) { - var g = new CompositeDisposable(); - g.add(currentThreadScheduler.schedule(this, function (_, self) { - o.onNext(self.head); - g.add(self.tail.mergeAll().subscribe(o)); - })); - - return g; - }, - onCompleted: function () { - this.onNext(Observable.empty()); - }, - onError: function (e) { - this.onNext(Observable['throw'](e)); - }, - onNext: function (v) { - this.tail.onNext(v); - this.tail.onCompleted(); - } - }); - - return ChainObservable; - - }(Observable)); - - var SwitchFirstObservable = (function (__super__) { - inherits(SwitchFirstObservable, __super__); - function SwitchFirstObservable(source) { - this.source = source; - __super__.call(this); - } - - SwitchFirstObservable.prototype.subscribeCore = function (o) { - var m = new SingleAssignmentDisposable(), - g = new CompositeDisposable(), - state = { - hasCurrent: false, - isStopped: false, - o: o, - g: g - }; - - g.add(m); - m.setDisposable(this.source.subscribe(new SwitchFirstObserver(state))); - return g; - }; - - return SwitchFirstObservable; - }(ObservableBase)); - - var SwitchFirstObserver = (function(__super__) { - inherits(SwitchFirstObserver, __super__); - function SwitchFirstObserver(state) { - this._s = state; - __super__.call(this); - } - - SwitchFirstObserver.prototype.next = function (x) { - if (!this._s.hasCurrent) { - this._s.hasCurrent = true; - isPromise(x) && (x = observableFromPromise(x)); - var inner = new SingleAssignmentDisposable(); - this._s.g.add(inner); - inner.setDisposable(x.subscribe(new InnerObserver(this._s, inner))); - } - }; - - SwitchFirstObserver.prototype.error = function (e) { - this._s.o.onError(e); - }; - - SwitchFirstObserver.prototype.completed = function () { - this._s.isStopped = true; - !this._s.hasCurrent && this._s.g.length === 1 && this._s.o.onCompleted(); - }; - - inherits(InnerObserver, __super__); - function InnerObserver(state, inner) { - this._s = state; - this._i = inner; - __super__.call(this); - } - - InnerObserver.prototype.next = function (x) { this._s.o.onNext(x); }; - InnerObserver.prototype.error = function (e) { this._s.o.onError(e); }; - InnerObserver.prototype.completed = function () { - this._s.g.remove(this._i); - this._s.hasCurrent = false; - this._s.isStopped && this._s.g.length === 1 && this._s.o.onCompleted(); - }; - - return SwitchFirstObserver; - }(AbstractObserver)); - - /** - * Performs a exclusive waiting for the first to finish before subscribing to another observable. - * Observables that come in between subscriptions will be dropped on the floor. - * @returns {Observable} A exclusive observable with only the results that happen when subscribed. - */ - observableProto.switchFirst = function () { - return new SwitchFirstObservable(this); - }; - -observableProto.flatMapFirst = observableProto.exhaustMap = function(selector, resultSelector, thisArg) { - return new FlatMapObservable(this, selector, resultSelector, thisArg).switchFirst(); -}; - -observableProto.flatMapWithMaxConcurrent = observableProto.flatMapMaxConcurrent = function(limit, selector, resultSelector, thisArg) { - return new FlatMapObservable(this, selector, resultSelector, thisArg).merge(limit); -}; - - return Rx; -})); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module))) - -/***/ }), -/* 639 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. - -;(function (factory) { - var objectTypes = { - 'function': true, - 'object': true - }; - - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - - // Because of build optimizers - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(40)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Rx, exports) { - return factory(root, exports, Rx); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof module === 'object' && module && module.exports === freeExports) { - module.exports = factory(root, module.exports, require('./rx')); - } else { - root.Rx = factory(root, {}, root.Rx); - } -}.call(this, function (root, exp, Rx, undefined) { - - // Aliases - var Observable = Rx.Observable, - observableProto = Observable.prototype, - AnonymousObservable = Rx.AnonymousObservable, - observableThrow = Observable.throwError, - observerCreate = Rx.Observer.create, - SingleAssignmentDisposable = Rx.SingleAssignmentDisposable, - CompositeDisposable = Rx.CompositeDisposable, - AbstractObserver = Rx.internals.AbstractObserver, - noop = Rx.helpers.noop, - inherits = Rx.internals.inherits, - isFunction = Rx.helpers.isFunction; - - var errorObj = {e: {}}; - - function tryCatcherGen(tryCatchTarget) { - return function tryCatcher() { - try { - return tryCatchTarget.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } - }; - } - - var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { - if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } - return tryCatcherGen(fn); - }; - - function thrower(e) { - throw e; - } - - var Map = root.Map || (function () { - function Map() { - this.size = 0; - this._values = []; - this._keys = []; - } - - Map.prototype['delete'] = function (key) { - var i = this._keys.indexOf(key); - if (i === -1) { return false; } - this._values.splice(i, 1); - this._keys.splice(i, 1); - this.size--; - return true; - }; - - Map.prototype.get = function (key) { - var i = this._keys.indexOf(key); - return i === -1 ? undefined : this._values[i]; - }; - - Map.prototype.set = function (key, value) { - var i = this._keys.indexOf(key); - if (i === -1) { - this._keys.push(key); - this._values.push(value); - this.size++; - } else { - this._values[i] = value; - } - return this; - }; - - Map.prototype.forEach = function (cb, thisArg) { - for (var i = 0; i < this.size; i++) { - cb.call(thisArg, this._values[i], this._keys[i]); - } - }; - - return Map; - }()); - - /** - * @constructor - * Represents a join pattern over observable sequences. - */ - function Pattern(patterns) { - this.patterns = patterns; - } - - /** - * Creates a pattern that matches the current plan matches and when the specified observable sequences has an available value. - * @param other Observable sequence to match in addition to the current pattern. - * @return {Pattern} Pattern object that matches when all observable sequences in the pattern have an available value. - */ - Pattern.prototype.and = function (other) { - return new Pattern(this.patterns.concat(other)); - }; - - /** - * Matches when all observable sequences in the pattern (specified using a chain of and operators) have an available value and projects the values. - * @param {Function} selector Selector that will be invoked with available values from the source sequences, in the same order of the sequences in the pattern. - * @return {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator. - */ - Pattern.prototype.thenDo = function (selector) { - return new Plan(this, selector); - }; - - function Plan(expression, selector) { - this.expression = expression; - this.selector = selector; - } - - function handleOnError(o) { return function (e) { o.onError(e); }; } - function handleOnNext(self, observer) { - return function onNext () { - var result = tryCatch(self.selector).apply(self, arguments); - if (result === errorObj) { return observer.onError(result.e); } - observer.onNext(result); - }; - } - - Plan.prototype.activate = function (externalSubscriptions, observer, deactivate) { - var joinObservers = [], errHandler = handleOnError(observer); - for (var i = 0, len = this.expression.patterns.length; i < len; i++) { - joinObservers.push(planCreateObserver(externalSubscriptions, this.expression.patterns[i], errHandler)); - } - var activePlan = new ActivePlan(joinObservers, handleOnNext(this, observer), function () { - for (var j = 0, jlen = joinObservers.length; j < jlen; j++) { - joinObservers[j].removeActivePlan(activePlan); - } - deactivate(activePlan); - }); - for (i = 0, len = joinObservers.length; i < len; i++) { - joinObservers[i].addActivePlan(activePlan); - } - return activePlan; - }; - - function planCreateObserver(externalSubscriptions, observable, onError) { - var entry = externalSubscriptions.get(observable); - if (!entry) { - var observer = new JoinObserver(observable, onError); - externalSubscriptions.set(observable, observer); - return observer; - } - return entry; - } - - function ActivePlan(joinObserverArray, onNext, onCompleted) { - this.joinObserverArray = joinObserverArray; - this.onNext = onNext; - this.onCompleted = onCompleted; - this.joinObservers = new Map(); - for (var i = 0, len = this.joinObserverArray.length; i < len; i++) { - var joinObserver = this.joinObserverArray[i]; - this.joinObservers.set(joinObserver, joinObserver); - } - } - - ActivePlan.prototype.dequeue = function () { - this.joinObservers.forEach(function (v) { v.queue.shift(); }); - }; - - ActivePlan.prototype.match = function () { - var i, len, hasValues = true; - for (i = 0, len = this.joinObserverArray.length; i < len; i++) { - if (this.joinObserverArray[i].queue.length === 0) { - hasValues = false; - break; - } - } - if (hasValues) { - var firstValues = [], - isCompleted = false; - for (i = 0, len = this.joinObserverArray.length; i < len; i++) { - firstValues.push(this.joinObserverArray[i].queue[0]); - this.joinObserverArray[i].queue[0].kind === 'C' && (isCompleted = true); - } - if (isCompleted) { - this.onCompleted(); - } else { - this.dequeue(); - var values = []; - for (i = 0, len = firstValues.length; i < firstValues.length; i++) { - values.push(firstValues[i].value); - } - this.onNext.apply(this, values); - } - } - }; - - var JoinObserver = (function (__super__) { - inherits(JoinObserver, __super__); - - function JoinObserver(source, onError) { - __super__.call(this); - this.source = source; - this.onError = onError; - this.queue = []; - this.activePlans = []; - this.subscription = new SingleAssignmentDisposable(); - this.isDisposed = false; - } - - var JoinObserverPrototype = JoinObserver.prototype; - - JoinObserverPrototype.next = function (notification) { - if (!this.isDisposed) { - if (notification.kind === 'E') { - return this.onError(notification.error); - } - this.queue.push(notification); - var activePlans = this.activePlans.slice(0); - for (var i = 0, len = activePlans.length; i < len; i++) { - activePlans[i].match(); - } - } - }; - - JoinObserverPrototype.error = noop; - JoinObserverPrototype.completed = noop; - - JoinObserverPrototype.addActivePlan = function (activePlan) { - this.activePlans.push(activePlan); - }; - - JoinObserverPrototype.subscribe = function () { - this.subscription.setDisposable(this.source.materialize().subscribe(this)); - }; - - JoinObserverPrototype.removeActivePlan = function (activePlan) { - this.activePlans.splice(this.activePlans.indexOf(activePlan), 1); - this.activePlans.length === 0 && this.dispose(); - }; - - JoinObserverPrototype.dispose = function () { - __super__.prototype.dispose.call(this); - if (!this.isDisposed) { - this.isDisposed = true; - this.subscription.dispose(); - } - }; - - return JoinObserver; - } (AbstractObserver)); - - /** - * Creates a pattern that matches when both observable sequences have an available value. - * - * @param right Observable sequence to match with the current sequence. - * @return {Pattern} Pattern object that matches when both observable sequences have an available value. - */ - observableProto.and = function (right) { - return new Pattern([this, right]); - }; - - /** - * Matches when the observable sequence has an available value and projects the value. - * - * @param {Function} selector Selector that will be invoked for values in the source sequence. - * @returns {Plan} Plan that produces the projected values, to be fed (with other plans) to the when operator. - */ - observableProto.thenDo = function (selector) { - return new Pattern([this]).thenDo(selector); - }; - - /** - * Joins together the results from several patterns. - * - * @param plans A series of plans (specified as an Array of as a series of arguments) created by use of the Then operator on patterns. - * @returns {Observable} Observable sequence with the results form matching several patterns. - */ - Observable.when = function () { - var len = arguments.length, plans; - if (Array.isArray(arguments[0])) { - plans = arguments[0]; - } else { - plans = new Array(len); - for(var i = 0; i < len; i++) { plans[i] = arguments[i]; } - } - return new AnonymousObservable(function (o) { - var activePlans = [], - externalSubscriptions = new Map(); - var outObserver = observerCreate( - function (x) { o.onNext(x); }, - function (err) { - externalSubscriptions.forEach(function (v) { v.onError(err); }); - o.onError(err); - }, - function (x) { o.onCompleted(); } - ); - try { - for (var i = 0, len = plans.length; i < len; i++) { - activePlans.push(plans[i].activate(externalSubscriptions, outObserver, function (activePlan) { - var idx = activePlans.indexOf(activePlan); - activePlans.splice(idx, 1); - activePlans.length === 0 && o.onCompleted(); - })); - } - } catch (e) { - return observableThrow(e).subscribe(o); - } - var group = new CompositeDisposable(); - externalSubscriptions.forEach(function (joinObserver) { - joinObserver.subscribe(); - group.add(joinObserver); - }); - - return group; - }); - }; - - return Rx; -})); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module))) - -/***/ }), -/* 640 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. - -;(function (factory) { - var objectTypes = { - 'function': true, - 'object': true - }; - - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - - // Because of build optimizers - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(40)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Rx, exports) { - return factory(root, exports, Rx); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof module === 'object' && module && module.exports === freeExports) { - module.exports = factory(root, module.exports, require('./rx')); - } else { - root.Rx = factory(root, {}, root.Rx); - } -}.call(this, function (root, exp, Rx, undefined) { - - var Observable = Rx.Observable, - observableProto = Observable.prototype, - AnonymousObservable = Rx.AnonymousObservable, - observableNever = Observable.never, - isEqual = Rx.internals.isEqual, - defaultSubComparer = Rx.helpers.defaultSubComparer; - - /** - * jortSort checks if your inputs are sorted. Note that this is only for a sequence with an end. - * See http://jort.technology/ for full details. - * @returns {Observable} An observable which has a single value of true if sorted, else false. - */ - observableProto.jortSort = function () { - return this.jortSortUntil(observableNever()); - }; - - /** - * jortSort checks if your inputs are sorted until another Observable sequence fires. - * See http://jort.technology/ for full details. - * @returns {Observable} An observable which has a single value of true if sorted, else false. - */ - observableProto.jortSortUntil = function (other) { - var source = this; - return new AnonymousObservable(function (observer) { - var arr = []; - return source.takeUntil(other).subscribe( - arr.push.bind(arr), - observer.onError.bind(observer), - function () { - var sorted = arr.slice(0).sort(defaultSubComparer); - observer.onNext(isEqual(arr, sorted)); - observer.onCompleted(); - }); - }, source); - }; - - return Rx; -})); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module))) - -/***/ }), -/* 641 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. - -;(function (factory) { - var objectTypes = { - 'function': true, - 'object': true - }; - - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - - // Because of build optimizers - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(316), exports], __WEBPACK_AMD_DEFINE_RESULT__ = function (Rx, exports) { - root.Rx = factory(root, exports, Rx); - return root.Rx; - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof module === 'object' && module && module.exports === freeExports) { - module.exports = factory(root, module.exports, require('./rx')); - } else { - root.Rx = factory(root, {}, root.Rx); - } -}.call(this, function (root, exp, Rx, undefined) { - - // Defaults - var Observer = Rx.Observer, - Observable = Rx.Observable, - Notification = Rx.Notification, - VirtualTimeScheduler = Rx.VirtualTimeScheduler, - Disposable = Rx.Disposable, - disposableEmpty = Disposable.empty, - disposableCreate = Disposable.create, - CompositeDisposable = Rx.CompositeDisposable, - inherits = Rx.internals.inherits, - defaultComparer = Rx.internals.isEqual; - -function OnNextPredicate(predicate) { - this.predicate = predicate; -} - -OnNextPredicate.prototype.equals = function (other) { - if (other === this) { return true; } - if (other == null) { return false; } - if (other.kind !== 'N') { return false; } - return this.predicate(other.value); -}; - -function OnErrorPredicate(predicate) { - this.predicate = predicate; -} - -OnErrorPredicate.prototype.equals = function (other) { - if (other === this) { return true; } - if (other == null) { return false; } - if (other.kind !== 'E') { return false; } - return this.predicate(other.error); -}; - -var ReactiveTest = Rx.ReactiveTest = { - /** Default virtual time used for creation of observable sequences in unit tests. */ - created: 100, - /** Default virtual time used to subscribe to observable sequences in unit tests. */ - subscribed: 200, - /** Default virtual time used to dispose subscriptions in unit tests. */ - disposed: 1000, - - /** - * Factory method for an OnNext notification record at a given time with a given value or a predicate function. - * - * 1 - ReactiveTest.onNext(200, 42); - * 2 - ReactiveTest.onNext(200, function (x) { return x.length == 2; }); - * - * @param ticks Recorded virtual time the OnNext notification occurs. - * @param value Recorded value stored in the OnNext notification or a predicate. - * @return Recorded OnNext notification. - */ - onNext: function (ticks, value) { - return typeof value === 'function' ? - new Recorded(ticks, new OnNextPredicate(value)) : - new Recorded(ticks, Notification.createOnNext(value)); - }, - /** - * Factory method for an OnError notification record at a given time with a given error. - * - * 1 - ReactiveTest.onNext(200, new Error('error')); - * 2 - ReactiveTest.onNext(200, function (e) { return e.message === 'error'; }); - * - * @param ticks Recorded virtual time the OnError notification occurs. - * @param exception Recorded exception stored in the OnError notification. - * @return Recorded OnError notification. - */ - onError: function (ticks, error) { - return typeof error === 'function' ? - new Recorded(ticks, new OnErrorPredicate(error)) : - new Recorded(ticks, Notification.createOnError(error)); - }, - /** - * Factory method for an OnCompleted notification record at a given time. - * - * @param ticks Recorded virtual time the OnCompleted notification occurs. - * @return Recorded OnCompleted notification. - */ - onCompleted: function (ticks) { - return new Recorded(ticks, Notification.createOnCompleted()); - }, - /** - * Factory method for a subscription record based on a given subscription and disposal time. - * - * @param start Virtual time indicating when the subscription was created. - * @param end Virtual time indicating when the subscription was disposed. - * @return Subscription object. - */ - subscribe: function (start, end) { - return new Subscription(start, end); - } -}; - - /** - * Creates a new object recording the production of the specified value at the given virtual time. - * - * @constructor - * @param {Number} time Virtual time the value was produced on. - * @param {Mixed} value Value that was produced. - * @param {Function} comparer An optional comparer. - */ - var Recorded = Rx.Recorded = function (time, value, comparer) { - this.time = time; - this.value = value; - this.comparer = comparer || defaultComparer; - }; - - /** - * Checks whether the given recorded object is equal to the current instance. - * - * @param {Recorded} other Recorded object to check for equality. - * @returns {Boolean} true if both objects are equal; false otherwise. - */ - Recorded.prototype.equals = function (other) { - return this.time === other.time && this.comparer(this.value, other.value); - }; - - /** - * Returns a string representation of the current Recorded value. - * - * @returns {String} String representation of the current Recorded value. - */ - Recorded.prototype.toString = function () { - return this.value.toString() + '@' + this.time; - }; - - /** - * Creates a new subscription object with the given virtual subscription and unsubscription time. - * - * @constructor - * @param {Number} subscribe Virtual time at which the subscription occurred. - * @param {Number} unsubscribe Virtual time at which the unsubscription occurred. - */ - var Subscription = Rx.Subscription = function (start, end) { - this.subscribe = start; - this.unsubscribe = end || Number.MAX_VALUE; - }; - - /** - * Checks whether the given subscription is equal to the current instance. - * @param other Subscription object to check for equality. - * @returns {Boolean} true if both objects are equal; false otherwise. - */ - Subscription.prototype.equals = function (other) { - return this.subscribe === other.subscribe && this.unsubscribe === other.unsubscribe; - }; - - /** - * Returns a string representation of the current Subscription value. - * @returns {String} String representation of the current Subscription value. - */ - Subscription.prototype.toString = function () { - return '(' + this.subscribe + ', ' + (this.unsubscribe === Number.MAX_VALUE ? 'Infinite' : this.unsubscribe) + ')'; - }; - - var MockDisposable = Rx.MockDisposable = function (scheduler) { - this.scheduler = scheduler; - this.disposes = []; - this.disposes.push(this.scheduler.clock); - }; - - MockDisposable.prototype.dispose = function () { - this.disposes.push(this.scheduler.clock); - }; - - var MockObserver = (function (__super__) { - inherits(MockObserver, __super__); - - function MockObserver(scheduler) { - __super__.call(this); - this.scheduler = scheduler; - this.messages = []; - } - - var MockObserverPrototype = MockObserver.prototype; - - MockObserverPrototype.onNext = function (value) { - this.messages.push(new Recorded(this.scheduler.clock, Notification.createOnNext(value))); - }; - - MockObserverPrototype.onError = function (e) { - this.messages.push(new Recorded(this.scheduler.clock, Notification.createOnError(e))); - }; - - MockObserverPrototype.onCompleted = function () { - this.messages.push(new Recorded(this.scheduler.clock, Notification.createOnCompleted())); - }; - - return MockObserver; - })(Observer); - - function MockPromise(scheduler, messages) { - var self = this; - this.scheduler = scheduler; - this.messages = messages; - this.subscriptions = []; - this.observers = []; - for (var i = 0, len = this.messages.length; i < len; i++) { - var message = this.messages[i], - notification = message.value; - (function (innerNotification) { - scheduler.scheduleAbsolute(null, message.time, function () { - var obs = self.observers.slice(0); - - for (var j = 0, jLen = obs.length; j < jLen; j++) { - innerNotification.accept(obs[j]); - } - return disposableEmpty; - }); - })(notification); - } - } - - MockPromise.prototype.then = function (onResolved, onRejected) { - var self = this; - - this.subscriptions.push(new Subscription(this.scheduler.clock)); - var index = this.subscriptions.length - 1; - - var newPromise; - - var observer = Rx.Observer.create( - function (x) { - var retValue = onResolved(x); - if (retValue && typeof retValue.then === 'function') { - newPromise = retValue; - } else { - var ticks = self.scheduler.clock; - newPromise = new MockPromise(self.scheduler, [Rx.ReactiveTest.onNext(ticks, undefined), Rx.ReactiveTest.onCompleted(ticks)]); - } - var idx = self.observers.indexOf(observer); - self.observers.splice(idx, 1); - self.subscriptions[index] = new Subscription(self.subscriptions[index].subscribe, self.scheduler.clock); - }, - function (err) { - onRejected(err); - var idx = self.observers.indexOf(observer); - self.observers.splice(idx, 1); - self.subscriptions[index] = new Subscription(self.subscriptions[index].subscribe, self.scheduler.clock); - } - ); - this.observers.push(observer); - - return newPromise || new MockPromise(this.scheduler, this.messages); - }; - - var HotObservable = (function (__super__) { - inherits(HotObservable, __super__); - - function HotObservable(scheduler, messages) { - __super__.call(this); - var message, notification, observable = this; - this.scheduler = scheduler; - this.messages = messages; - this.subscriptions = []; - this.observers = []; - for (var i = 0, len = this.messages.length; i < len; i++) { - message = this.messages[i]; - notification = message.value; - (function (innerNotification) { - scheduler.scheduleAbsolute(null, message.time, function () { - var obs = observable.observers.slice(0); - - for (var j = 0, jLen = obs.length; j < jLen; j++) { - innerNotification.accept(obs[j]); - } - return disposableEmpty; - }); - })(notification); - } - } - - HotObservable.prototype._subscribe = function (o) { - var observable = this; - this.observers.push(o); - this.subscriptions.push(new Subscription(this.scheduler.clock)); - var index = this.subscriptions.length - 1; - return disposableCreate(function () { - var idx = observable.observers.indexOf(o); - observable.observers.splice(idx, 1); - observable.subscriptions[index] = new Subscription(observable.subscriptions[index].subscribe, observable.scheduler.clock); - }); - }; - - return HotObservable; - })(Observable); - - var ColdObservable = (function (__super__) { - inherits(ColdObservable, __super__); - - function ColdObservable(scheduler, messages) { - __super__.call(this); - this.scheduler = scheduler; - this.messages = messages; - this.subscriptions = []; - } - - ColdObservable.prototype._subscribe = function (o) { - var message, notification, observable = this; - this.subscriptions.push(new Subscription(this.scheduler.clock)); - var index = this.subscriptions.length - 1; - var d = new CompositeDisposable(); - for (var i = 0, len = this.messages.length; i < len; i++) { - message = this.messages[i]; - notification = message.value; - (function (innerNotification) { - d.add(observable.scheduler.scheduleRelative(null, message.time, function () { - innerNotification.accept(o); - return disposableEmpty; - })); - })(notification); - } - return disposableCreate(function () { - observable.subscriptions[index] = new Subscription(observable.subscriptions[index].subscribe, observable.scheduler.clock); - d.dispose(); - }); - }; - - return ColdObservable; - })(Observable); - - /** Virtual time scheduler used for testing applications and libraries built using Reactive Extensions. */ - Rx.TestScheduler = (function (__super__) { - inherits(TestScheduler, __super__); - - function baseComparer(x, y) { - return x > y ? 1 : (x < y ? -1 : 0); - } - - function TestScheduler() { - __super__.call(this, 0, baseComparer); - } - - /** - * Schedules an action to be executed at the specified virtual time. - * - * @param state State passed to the action to be executed. - * @param dueTime Absolute virtual time at which to execute the action. - * @param action Action to be executed. - * @return Disposable object used to cancel the scheduled action (best effort). - */ - TestScheduler.prototype.scheduleAbsolute = function (state, dueTime, action) { - dueTime <= this.clock && (dueTime = this.clock + 1); - return __super__.prototype.scheduleAbsolute.call(this, state, dueTime, action); - }; - /** - * Adds a relative virtual time to an absolute virtual time value. - * - * @param absolute Absolute virtual time value. - * @param relative Relative virtual time value to add. - * @return Resulting absolute virtual time sum value. - */ - TestScheduler.prototype.add = function (absolute, relative) { - return absolute + relative; - }; - /** - * Converts the absolute virtual time value to a DateTimeOffset value. - * - * @param absolute Absolute virtual time value to convert. - * @return Corresponding DateTimeOffset value. - */ - TestScheduler.prototype.toAbsoluteTime = function (absolute) { - return new Date(absolute).getTime(); - }; - /** - * Converts the TimeSpan value to a relative virtual time value. - * - * @param timeSpan TimeSpan value to convert. - * @return Corresponding relative virtual time value. - */ - TestScheduler.prototype.toRelativeTime = function (timeSpan) { - return timeSpan; - }; - /** - * Starts the test scheduler and uses the specified virtual times to invoke the factory function, subscribe to the resulting sequence, and dispose the subscription. - * - * @param create Factory method to create an observable sequence. - * @param created Virtual time at which to invoke the factory to create an observable sequence. - * @param subscribed Virtual time at which to subscribe to the created observable sequence. - * @param disposed Virtual time at which to dispose the subscription. - * @return Observer with timestamped recordings of notification messages that were received during the virtual time window when the subscription to the source sequence was active. - */ - TestScheduler.prototype.startScheduler = function (createFn, settings) { - settings || (settings = {}); - settings.created == null && (settings.created = ReactiveTest.created); - settings.subscribed == null && (settings.subscribed = ReactiveTest.subscribed); - settings.disposed == null && (settings.disposed = ReactiveTest.disposed); - - var observer = this.createObserver(), source, subscription; - - this.scheduleAbsolute(null, settings.created, function () { - source = createFn(); - return disposableEmpty; - }); - - this.scheduleAbsolute(null, settings.subscribed, function () { - subscription = source.subscribe(observer); - return disposableEmpty; - }); - - this.scheduleAbsolute(null, settings.disposed, function () { - subscription.dispose(); - return disposableEmpty; - }); - - this.start(); - - return observer; - }; - - /** - * Creates a hot observable using the specified timestamped notification messages either as an array or arguments. - * @param messages Notifications to surface through the created sequence at their specified absolute virtual times. - * @return Hot observable sequence that can be used to assert the timing of subscriptions and notifications. - */ - TestScheduler.prototype.createHotObservable = function () { - var len = arguments.length, args; - if (Array.isArray(arguments[0])) { - args = arguments[0]; - } else { - args = new Array(len); - for (var i = 0; i < len; i++) { args[i] = arguments[i]; } - } - return new HotObservable(this, args); - }; - - /** - * Creates a cold observable using the specified timestamped notification messages either as an array or arguments. - * @param messages Notifications to surface through the created sequence at their specified virtual time offsets from the sequence subscription time. - * @return Cold observable sequence that can be used to assert the timing of subscriptions and notifications. - */ - TestScheduler.prototype.createColdObservable = function () { - var len = arguments.length, args; - if (Array.isArray(arguments[0])) { - args = arguments[0]; - } else { - args = new Array(len); - for (var i = 0; i < len; i++) { args[i] = arguments[i]; } - } - return new ColdObservable(this, args); - }; - - /** - * Creates a resolved promise with the given value and ticks - * @param {Number} ticks The absolute time of the resolution. - * @param {Any} value The value to yield at the given tick. - * @returns {MockPromise} A mock Promise which fulfills with the given value. - */ - TestScheduler.prototype.createResolvedPromise = function (ticks, value) { - return new MockPromise(this, [Rx.ReactiveTest.onNext(ticks, value), Rx.ReactiveTest.onCompleted(ticks)]); - }; - - /** - * Creates a rejected promise with the given reason and ticks - * @param {Number} ticks The absolute time of the resolution. - * @param {Any} reason The reason for rejection to yield at the given tick. - * @returns {MockPromise} A mock Promise which rejects with the given reason. - */ - TestScheduler.prototype.createRejectedPromise = function (ticks, reason) { - return new MockPromise(this, [Rx.ReactiveTest.onError(ticks, reason)]); - }; - - /** - * Creates an observer that records received notification messages and timestamps those. - * @return Observer that can be used to assert the timing of received notifications. - */ - TestScheduler.prototype.createObserver = function () { - return new MockObserver(this); - }; - - return TestScheduler; - })(VirtualTimeScheduler); - - return Rx; -})); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module))) - -/***/ }), -/* 642 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright (c) Microsoft, All rights reserved. See License.txt in the project root for license information. - -;(function (factory) { - var objectTypes = { - 'function': true, - 'object': true - }; - - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global === 'object' && global); - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - - // Because of build optimizers - if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(40)], __WEBPACK_AMD_DEFINE_RESULT__ = function (Rx, exports) { - return factory(root, exports, Rx); - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof module === 'object' && module && module.exports === freeExports) { - module.exports = factory(root, module.exports, require('./rx')); - } else { - root.Rx = factory(root, {}, root.Rx); - } -}.call(this, function (root, exp, Rx, undefined) { - - // Refernces - var inherits = Rx.internals.inherits, - AbstractObserver = Rx.internals.AbstractObserver, - Observable = Rx.Observable, - observableProto = Observable.prototype, - AnonymousObservable = Rx.AnonymousObservable, - ObservableBase = Rx.ObservableBase, - observableDefer = Observable.defer, - observableEmpty = Observable.empty, - observableNever = Observable.never, - observableThrow = Observable['throw'], - observableFromArray = Observable.fromArray, - defaultScheduler = Rx.Scheduler['default'], - SingleAssignmentDisposable = Rx.SingleAssignmentDisposable, - SerialDisposable = Rx.SerialDisposable, - CompositeDisposable = Rx.CompositeDisposable, - BinaryDisposable = Rx.BinaryDisposable, - RefCountDisposable = Rx.RefCountDisposable, - Subject = Rx.Subject, - addRef = Rx.internals.addRef, - normalizeTime = Rx.Scheduler.normalize, - helpers = Rx.helpers, - isPromise = helpers.isPromise, - isFunction = helpers.isFunction, - isScheduler = Rx.Scheduler.isScheduler, - observableFromPromise = Observable.fromPromise; - - var errorObj = {e: {}}; - - function tryCatcherGen(tryCatchTarget) { - return function tryCatcher() { - try { - return tryCatchTarget.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } - }; - } - - var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { - if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } - return tryCatcherGen(fn); - }; - - function thrower(e) { - throw e; - } - - var TimerObservable = (function(__super__) { - inherits(TimerObservable, __super__); - function TimerObservable(dt, s) { - this._dt = dt; - this._s = s; - __super__.call(this); - } - - TimerObservable.prototype.subscribeCore = function (o) { - return this._s.scheduleFuture(o, this._dt, scheduleMethod); - }; - - function scheduleMethod(s, o) { - o.onNext(0); - o.onCompleted(); - } - - return TimerObservable; - }(ObservableBase)); - - function _observableTimer(dueTime, scheduler) { - return new TimerObservable(dueTime, scheduler); - } - - function observableTimerDateAndPeriod(dueTime, period, scheduler) { - return new AnonymousObservable(function (observer) { - var d = dueTime, p = normalizeTime(period); - return scheduler.scheduleRecursiveFuture(0, d, function (count, self) { - if (p > 0) { - var now = scheduler.now(); - d = new Date(d.getTime() + p); - d.getTime() <= now && (d = new Date(now + p)); - } - observer.onNext(count); - self(count + 1, new Date(d)); - }); - }); - } - - function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) { - return dueTime === period ? - new AnonymousObservable(function (observer) { - return scheduler.schedulePeriodic(0, period, function (count) { - observer.onNext(count); - return count + 1; - }); - }) : - observableDefer(function () { - return observableTimerDateAndPeriod(new Date(scheduler.now() + dueTime), period, scheduler); - }); - } - - /** - * Returns an observable sequence that produces a value after each period. - * - * @example - * 1 - res = Rx.Observable.interval(1000); - * 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout); - * - * @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds). - * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used. - * @returns {Observable} An observable sequence that produces a value after each period. - */ - var observableinterval = Observable.interval = function (period, scheduler) { - return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : defaultScheduler); - }; - - /** - * Returns an observable sequence that produces a value after dueTime has elapsed and then after each period. - * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value. - * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring. - * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used. - * @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period. - */ - var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) { - var period; - isScheduler(scheduler) || (scheduler = defaultScheduler); - if (periodOrScheduler != null && typeof periodOrScheduler === 'number') { - period = periodOrScheduler; - } else if (isScheduler(periodOrScheduler)) { - scheduler = periodOrScheduler; - } - if ((dueTime instanceof Date || typeof dueTime === 'number') && period === undefined) { - return _observableTimer(dueTime, scheduler); - } - if (dueTime instanceof Date && period !== undefined) { - return observableTimerDateAndPeriod(dueTime, periodOrScheduler, scheduler); - } - return observableTimerTimeSpanAndPeriod(dueTime, period, scheduler); - }; - - function observableDelayRelative(source, dueTime, scheduler) { - return new AnonymousObservable(function (o) { - var active = false, - cancelable = new SerialDisposable(), - exception = null, - q = [], - running = false, - subscription; - subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) { - var d, shouldRun; - if (notification.value.kind === 'E') { - q = []; - q.push(notification); - exception = notification.value.error; - shouldRun = !running; - } else { - q.push({ value: notification.value, timestamp: notification.timestamp + dueTime }); - shouldRun = !active; - active = true; - } - if (shouldRun) { - if (exception !== null) { - o.onError(exception); - } else { - d = new SingleAssignmentDisposable(); - cancelable.setDisposable(d); - d.setDisposable(scheduler.scheduleRecursiveFuture(null, dueTime, function (_, self) { - var e, recurseDueTime, result, shouldRecurse; - if (exception !== null) { - return; - } - running = true; - do { - result = null; - if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) { - result = q.shift().value; - } - if (result !== null) { - result.accept(o); - } - } while (result !== null); - shouldRecurse = false; - recurseDueTime = 0; - if (q.length > 0) { - shouldRecurse = true; - recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now()); - } else { - active = false; - } - e = exception; - running = false; - if (e !== null) { - o.onError(e); - } else if (shouldRecurse) { - self(null, recurseDueTime); - } - })); - } - } - }); - return new BinaryDisposable(subscription, cancelable); - }, source); - } - - function observableDelayAbsolute(source, dueTime, scheduler) { - return observableDefer(function () { - return observableDelayRelative(source, dueTime - scheduler.now(), scheduler); - }); - } - - function delayWithSelector(source, subscriptionDelay, delayDurationSelector) { - var subDelay, selector; - if (isFunction(subscriptionDelay)) { - selector = subscriptionDelay; - } else { - subDelay = subscriptionDelay; - selector = delayDurationSelector; - } - return new AnonymousObservable(function (o) { - var delays = new CompositeDisposable(), atEnd = false, subscription = new SerialDisposable(); - - function start() { - subscription.setDisposable(source.subscribe( - function (x) { - var delay = tryCatch(selector)(x); - if (delay === errorObj) { return o.onError(delay.e); } - var d = new SingleAssignmentDisposable(); - delays.add(d); - d.setDisposable(delay.subscribe( - function () { - o.onNext(x); - delays.remove(d); - done(); - }, - function (e) { o.onError(e); }, - function () { - o.onNext(x); - delays.remove(d); - done(); - } - )); - }, - function (e) { o.onError(e); }, - function () { - atEnd = true; - subscription.dispose(); - done(); - } - )); - } - - function done () { - atEnd && delays.length === 0 && o.onCompleted(); - } - - if (!subDelay) { - start(); - } else { - subscription.setDisposable(subDelay.subscribe(start, function (e) { o.onError(e); }, start)); - } - - return new BinaryDisposable(subscription, delays); - }, source); - } - - /** - * Time shifts the observable sequence by dueTime. - * The relative time intervals between the values are preserved. - * - * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence. - * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used. - * @returns {Observable} Time-shifted sequence. - */ - observableProto.delay = function () { - var firstArg = arguments[0]; - if (typeof firstArg === 'number' || firstArg instanceof Date) { - var dueTime = firstArg, scheduler = arguments[1]; - isScheduler(scheduler) || (scheduler = defaultScheduler); - return dueTime instanceof Date ? - observableDelayAbsolute(this, dueTime, scheduler) : - observableDelayRelative(this, dueTime, scheduler); - } else if (Observable.isObservable(firstArg) || isFunction(firstArg)) { - return delayWithSelector(this, firstArg, arguments[1]); - } else { - throw new Error('Invalid arguments'); - } - }; - - var DebounceObservable = (function (__super__) { - inherits(DebounceObservable, __super__); - function DebounceObservable(source, dt, s) { - isScheduler(s) || (s = defaultScheduler); - this.source = source; - this._dt = dt; - this._s = s; - __super__.call(this); - } - - DebounceObservable.prototype.subscribeCore = function (o) { - var cancelable = new SerialDisposable(); - return new BinaryDisposable( - this.source.subscribe(new DebounceObserver(o, this._dt, this._s, cancelable)), - cancelable); - }; - - return DebounceObservable; - }(ObservableBase)); - - var DebounceObserver = (function (__super__) { - inherits(DebounceObserver, __super__); - function DebounceObserver(observer, dueTime, scheduler, cancelable) { - this._o = observer; - this._d = dueTime; - this._scheduler = scheduler; - this._c = cancelable; - this._v = null; - this._hv = false; - this._id = 0; - __super__.call(this); - } - - function scheduleFuture(s, state) { - state.self._hv && state.self._id === state.currentId && state.self._o.onNext(state.x); - state.self._hv = false; - } - - DebounceObserver.prototype.next = function (x) { - this._hv = true; - this._v = x; - var currentId = ++this._id, d = new SingleAssignmentDisposable(); - this._c.setDisposable(d); - d.setDisposable(this._scheduler.scheduleFuture(this, this._d, function (_, self) { - self._hv && self._id === currentId && self._o.onNext(x); - self._hv = false; - })); - }; - - DebounceObserver.prototype.error = function (e) { - this._c.dispose(); - this._o.onError(e); - this._hv = false; - this._id++; - }; - - DebounceObserver.prototype.completed = function () { - this._c.dispose(); - this._hv && this._o.onNext(this._v); - this._o.onCompleted(); - this._hv = false; - this._id++; - }; - - return DebounceObserver; - }(AbstractObserver)); - - function debounceWithSelector(source, durationSelector) { - return new AnonymousObservable(function (o) { - var value, hasValue = false, cancelable = new SerialDisposable(), id = 0; - var subscription = source.subscribe( - function (x) { - var throttle = tryCatch(durationSelector)(x); - if (throttle === errorObj) { return o.onError(throttle.e); } - - isPromise(throttle) && (throttle = observableFromPromise(throttle)); - - hasValue = true; - value = x; - id++; - var currentid = id, d = new SingleAssignmentDisposable(); - cancelable.setDisposable(d); - d.setDisposable(throttle.subscribe( - function () { - hasValue && id === currentid && o.onNext(value); - hasValue = false; - d.dispose(); - }, - function (e) { o.onError(e); }, - function () { - hasValue && id === currentid && o.onNext(value); - hasValue = false; - d.dispose(); - } - )); - }, - function (e) { - cancelable.dispose(); - o.onError(e); - hasValue = false; - id++; - }, - function () { - cancelable.dispose(); - hasValue && o.onNext(value); - o.onCompleted(); - hasValue = false; - id++; - } - ); - return new BinaryDisposable(subscription, cancelable); - }, source); - } - - observableProto.debounce = function () { - if (isFunction (arguments[0])) { - return debounceWithSelector(this, arguments[0]); - } else if (typeof arguments[0] === 'number') { - return new DebounceObservable(this, arguments[0], arguments[1]); - } else { - throw new Error('Invalid arguments'); - } - }; - - /** - * Projects each element of an observable sequence into zero or more windows which are produced based on timing information. - * @param {Number} timeSpan Length of each window (specified as an integer denoting milliseconds). - * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive windows (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent windows. - * @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used. - * @returns {Observable} An observable sequence of windows. - */ - observableProto.windowWithTime = observableProto.windowTime = function (timeSpan, timeShiftOrScheduler, scheduler) { - var source = this, timeShift; - timeShiftOrScheduler == null && (timeShift = timeSpan); - isScheduler(scheduler) || (scheduler = defaultScheduler); - if (typeof timeShiftOrScheduler === 'number') { - timeShift = timeShiftOrScheduler; - } else if (isScheduler(timeShiftOrScheduler)) { - timeShift = timeSpan; - scheduler = timeShiftOrScheduler; - } - return new AnonymousObservable(function (observer) { - var groupDisposable, - nextShift = timeShift, - nextSpan = timeSpan, - q = [], - refCountDisposable, - timerD = new SerialDisposable(), - totalTime = 0; - groupDisposable = new CompositeDisposable(timerD), - refCountDisposable = new RefCountDisposable(groupDisposable); - - function createTimer () { - var m = new SingleAssignmentDisposable(), - isSpan = false, - isShift = false; - timerD.setDisposable(m); - if (nextSpan === nextShift) { - isSpan = true; - isShift = true; - } else if (nextSpan < nextShift) { - isSpan = true; - } else { - isShift = true; - } - var newTotalTime = isSpan ? nextSpan : nextShift, - ts = newTotalTime - totalTime; - totalTime = newTotalTime; - if (isSpan) { - nextSpan += timeShift; - } - if (isShift) { - nextShift += timeShift; - } - m.setDisposable(scheduler.scheduleFuture(null, ts, function () { - if (isShift) { - var s = new Subject(); - q.push(s); - observer.onNext(addRef(s, refCountDisposable)); - } - isSpan && q.shift().onCompleted(); - createTimer(); - })); - }; - q.push(new Subject()); - observer.onNext(addRef(q[0], refCountDisposable)); - createTimer(); - groupDisposable.add(source.subscribe( - function (x) { - for (var i = 0, len = q.length; i < len; i++) { q[i].onNext(x); } - }, - function (e) { - for (var i = 0, len = q.length; i < len; i++) { q[i].onError(e); } - observer.onError(e); - }, - function () { - for (var i = 0, len = q.length; i < len; i++) { q[i].onCompleted(); } - observer.onCompleted(); - } - )); - return refCountDisposable; - }, source); - }; - - /** - * Projects each element of an observable sequence into a window that is completed when either it's full or a given amount of time has elapsed. - * @param {Number} timeSpan Maximum time length of a window. - * @param {Number} count Maximum element count of a window. - * @param {Scheduler} [scheduler] Scheduler to run windowing timers on. If not specified, the timeout scheduler is used. - * @returns {Observable} An observable sequence of windows. - */ - observableProto.windowWithTimeOrCount = observableProto.windowTimeOrCount = function (timeSpan, count, scheduler) { - var source = this; - isScheduler(scheduler) || (scheduler = defaultScheduler); - return new AnonymousObservable(function (observer) { - var timerD = new SerialDisposable(), - groupDisposable = new CompositeDisposable(timerD), - refCountDisposable = new RefCountDisposable(groupDisposable), - n = 0, - windowId = 0, - s = new Subject(); - - function createTimer(id) { - var m = new SingleAssignmentDisposable(); - timerD.setDisposable(m); - m.setDisposable(scheduler.scheduleFuture(null, timeSpan, function () { - if (id !== windowId) { return; } - n = 0; - var newId = ++windowId; - s.onCompleted(); - s = new Subject(); - observer.onNext(addRef(s, refCountDisposable)); - createTimer(newId); - })); - } - - observer.onNext(addRef(s, refCountDisposable)); - createTimer(0); - - groupDisposable.add(source.subscribe( - function (x) { - var newId = 0, newWindow = false; - s.onNext(x); - if (++n === count) { - newWindow = true; - n = 0; - newId = ++windowId; - s.onCompleted(); - s = new Subject(); - observer.onNext(addRef(s, refCountDisposable)); - } - newWindow && createTimer(newId); - }, - function (e) { - s.onError(e); - observer.onError(e); - }, function () { - s.onCompleted(); - observer.onCompleted(); - } - )); - return refCountDisposable; - }, source); - }; - - function toArray(x) { return x.toArray(); } - - /** - * Projects each element of an observable sequence into zero or more buffers which are produced based on timing information. - * @param {Number} timeSpan Length of each buffer (specified as an integer denoting milliseconds). - * @param {Mixed} [timeShiftOrScheduler] Interval between creation of consecutive buffers (specified as an integer denoting milliseconds), or an optional scheduler parameter. If not specified, the time shift corresponds to the timeSpan parameter, resulting in non-overlapping adjacent buffers. - * @param {Scheduler} [scheduler] Scheduler to run buffer timers on. If not specified, the timeout scheduler is used. - * @returns {Observable} An observable sequence of buffers. - */ - observableProto.bufferWithTime = observableProto.bufferTime = function (timeSpan, timeShiftOrScheduler, scheduler) { - return this.windowWithTime(timeSpan, timeShiftOrScheduler, scheduler).flatMap(toArray); - }; - - function toArray(x) { return x.toArray(); } - - /** - * Projects each element of an observable sequence into a buffer that is completed when either it's full or a given amount of time has elapsed. - * @param {Number} timeSpan Maximum time length of a buffer. - * @param {Number} count Maximum element count of a buffer. - * @param {Scheduler} [scheduler] Scheduler to run bufferin timers on. If not specified, the timeout scheduler is used. - * @returns {Observable} An observable sequence of buffers. - */ - observableProto.bufferWithTimeOrCount = observableProto.bufferTimeOrCount = function (timeSpan, count, scheduler) { - return this.windowWithTimeOrCount(timeSpan, count, scheduler).flatMap(toArray); - }; - - var TimeIntervalObservable = (function (__super__) { - inherits(TimeIntervalObservable, __super__); - function TimeIntervalObservable(source, s) { - this.source = source; - this._s = s; - __super__.call(this); - } - - TimeIntervalObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new TimeIntervalObserver(o, this._s)); - }; - - return TimeIntervalObservable; - }(ObservableBase)); - - var TimeIntervalObserver = (function (__super__) { - inherits(TimeIntervalObserver, __super__); - - function TimeIntervalObserver(o, s) { - this._o = o; - this._s = s; - this._l = s.now(); - __super__.call(this); - } - - TimeIntervalObserver.prototype.next = function (x) { - var now = this._s.now(), span = now - this._l; - this._l = now; - this._o.onNext({ value: x, interval: span }); - }; - TimeIntervalObserver.prototype.error = function (e) { this._o.onError(e); }; - TimeIntervalObserver.prototype.completed = function () { this._o.onCompleted(); }; - - return TimeIntervalObserver; - }(AbstractObserver)); - - /** - * Records the time interval between consecutive values in an observable sequence. - * - * @example - * 1 - res = source.timeInterval(); - * 2 - res = source.timeInterval(Rx.Scheduler.timeout); - * - * @param [scheduler] Scheduler used to compute time intervals. If not specified, the timeout scheduler is used. - * @returns {Observable} An observable sequence with time interval information on values. - */ - observableProto.timeInterval = function (scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - return new TimeIntervalObservable(this, scheduler); - }; - - var TimestampObservable = (function (__super__) { - inherits(TimestampObservable, __super__); - function TimestampObservable(source, s) { - this.source = source; - this._s = s; - __super__.call(this); - } - - TimestampObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new TimestampObserver(o, this._s)); - }; - - return TimestampObservable; - }(ObservableBase)); - - var TimestampObserver = (function (__super__) { - inherits(TimestampObserver, __super__); - function TimestampObserver(o, s) { - this._o = o; - this._s = s; - __super__.call(this); - } - - TimestampObserver.prototype.next = function (x) { - this._o.onNext({ value: x, timestamp: this._s.now() }); - }; - - TimestampObserver.prototype.error = function (e) { - this._o.onError(e); - }; - - TimestampObserver.prototype.completed = function () { - this._o.onCompleted(); - }; - - return TimestampObserver; - }(AbstractObserver)); - - /** - * Records the timestamp for each value in an observable sequence. - * - * @example - * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts } - * 2 - res = source.timestamp(Rx.Scheduler.default); - * - * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the default scheduler is used. - * @returns {Observable} An observable sequence with timestamp information on values. - */ - observableProto.timestamp = function (scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - return new TimestampObservable(this, scheduler); - }; - - var SampleObservable = (function(__super__) { - inherits(SampleObservable, __super__); - function SampleObservable(source, sampler) { - this.source = source; - this._sampler = sampler; - __super__.call(this); - } - - SampleObservable.prototype.subscribeCore = function (o) { - var state = { - o: o, - atEnd: false, - value: null, - hasValue: false, - sourceSubscription: new SingleAssignmentDisposable() - }; - - state.sourceSubscription.setDisposable(this.source.subscribe(new SampleSourceObserver(state))); - return new BinaryDisposable( - state.sourceSubscription, - this._sampler.subscribe(new SamplerObserver(state)) - ); - }; - - return SampleObservable; - }(ObservableBase)); - - var SamplerObserver = (function(__super__) { - inherits(SamplerObserver, __super__); - function SamplerObserver(s) { - this._s = s; - __super__.call(this); - } - - SamplerObserver.prototype._handleMessage = function () { - if (this._s.hasValue) { - this._s.hasValue = false; - this._s.o.onNext(this._s.value); - } - this._s.atEnd && this._s.o.onCompleted(); - }; - - SamplerObserver.prototype.next = function () { this._handleMessage(); }; - SamplerObserver.prototype.error = function (e) { this._s.onError(e); }; - SamplerObserver.prototype.completed = function () { this._handleMessage(); }; - - return SamplerObserver; - }(AbstractObserver)); - - var SampleSourceObserver = (function(__super__) { - inherits(SampleSourceObserver, __super__); - function SampleSourceObserver(s) { - this._s = s; - __super__.call(this); - } - - SampleSourceObserver.prototype.next = function (x) { - this._s.hasValue = true; - this._s.value = x; - }; - SampleSourceObserver.prototype.error = function (e) { this._s.o.onError(e); }; - SampleSourceObserver.prototype.completed = function () { - this._s.atEnd = true; - this._s.sourceSubscription.dispose(); - }; - - return SampleSourceObserver; - }(AbstractObserver)); - - /** - * Samples the observable sequence at each interval. - * - * @example - * 1 - res = source.sample(sampleObservable); // Sampler tick sequence - * 2 - res = source.sample(5000); // 5 seconds - * 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds - * - * @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable. - * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used. - * @returns {Observable} Sampled observable sequence. - */ - observableProto.sample = function (intervalOrSampler, scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - return typeof intervalOrSampler === 'number' ? - new SampleObservable(this, observableinterval(intervalOrSampler, scheduler)) : - new SampleObservable(this, intervalOrSampler); - }; - - var TimeoutError = Rx.TimeoutError = function(message) { - this.message = message || 'Timeout has occurred'; - this.name = 'TimeoutError'; - Error.call(this); - }; - TimeoutError.prototype = Object.create(Error.prototype); - - function timeoutWithSelector(source, firstTimeout, timeoutDurationSelector, other) { - if (isFunction(firstTimeout)) { - other = timeoutDurationSelector; - timeoutDurationSelector = firstTimeout; - firstTimeout = observableNever(); - } - Observable.isObservable(other) || (other = observableThrow(new TimeoutError())); - return new AnonymousObservable(function (o) { - var subscription = new SerialDisposable(), - timer = new SerialDisposable(), - original = new SingleAssignmentDisposable(); - - subscription.setDisposable(original); - - var id = 0, switched = false; - - function setTimer(timeout) { - var myId = id, d = new SingleAssignmentDisposable(); - - function timerWins() { - switched = (myId === id); - return switched; - } - - timer.setDisposable(d); - d.setDisposable(timeout.subscribe(function () { - timerWins() && subscription.setDisposable(other.subscribe(o)); - d.dispose(); - }, function (e) { - timerWins() && o.onError(e); - }, function () { - timerWins() && subscription.setDisposable(other.subscribe(o)); - })); - }; - - setTimer(firstTimeout); - - function oWins() { - var res = !switched; - if (res) { id++; } - return res; - } - - original.setDisposable(source.subscribe(function (x) { - if (oWins()) { - o.onNext(x); - var timeout = tryCatch(timeoutDurationSelector)(x); - if (timeout === errorObj) { return o.onError(timeout.e); } - setTimer(isPromise(timeout) ? observableFromPromise(timeout) : timeout); - } - }, function (e) { - oWins() && o.onError(e); - }, function () { - oWins() && o.onCompleted(); - })); - return new BinaryDisposable(subscription, timer); - }, source); - } - - function timeout(source, dueTime, other, scheduler) { - if (isScheduler(other)) { - scheduler = other; - other = observableThrow(new TimeoutError()); - } - if (other instanceof Error) { other = observableThrow(other); } - isScheduler(scheduler) || (scheduler = defaultScheduler); - Observable.isObservable(other) || (other = observableThrow(new TimeoutError())); - return new AnonymousObservable(function (o) { - var id = 0, - original = new SingleAssignmentDisposable(), - subscription = new SerialDisposable(), - switched = false, - timer = new SerialDisposable(); - - subscription.setDisposable(original); - - function createTimer() { - var myId = id; - timer.setDisposable(scheduler.scheduleFuture(null, dueTime, function () { - switched = id === myId; - if (switched) { - isPromise(other) && (other = observableFromPromise(other)); - subscription.setDisposable(other.subscribe(o)); - } - })); - } - - createTimer(); - - original.setDisposable(source.subscribe(function (x) { - if (!switched) { - id++; - o.onNext(x); - createTimer(); - } - }, function (e) { - if (!switched) { - id++; - o.onError(e); - } - }, function () { - if (!switched) { - id++; - o.onCompleted(); - } - })); - return new BinaryDisposable(subscription, timer); - }, source); - } - - observableProto.timeout = function () { - var firstArg = arguments[0]; - if (firstArg instanceof Date || typeof firstArg === 'number') { - return timeout(this, firstArg, arguments[1], arguments[2]); - } else if (Observable.isObservable(firstArg) || isFunction(firstArg)) { - return timeoutWithSelector(this, firstArg, arguments[1], arguments[2]); - } else { - throw new Error('Invalid arguments'); - } - }; - - var GenerateAbsoluteObservable = (function (__super__) { - inherits(GenerateAbsoluteObservable, __super__); - function GenerateAbsoluteObservable(state, cndFn, itrFn, resFn, timeFn, s) { - this._state = state; - this._cndFn = cndFn; - this._itrFn = itrFn; - this._resFn = resFn; - this._timeFn = timeFn; - this._s = s; - __super__.call(this); - } - - function scheduleRecursive(state, recurse) { - state.hasResult && state.o.onNext(state.result); - - if (state.first) { - state.first = false; - } else { - state.newState = tryCatch(state.self._itrFn)(state.newState); - if (state.newState === errorObj) { return state.o.onError(state.newState.e); } - } - state.hasResult = tryCatch(state.self._cndFn)(state.newState); - if (state.hasResult === errorObj) { return state.o.onError(state.hasResult.e); } - if (state.hasResult) { - state.result = tryCatch(state.self._resFn)(state.newState); - if (state.result === errorObj) { return state.o.onError(state.result.e); } - var time = tryCatch(state.self._timeFn)(state.newState); - if (time === errorObj) { return state.o.onError(time.e); } - recurse(state, time); - } else { - state.o.onCompleted(); - } - } - - GenerateAbsoluteObservable.prototype.subscribeCore = function (o) { - var state = { - o: o, - self: this, - newState: this._state, - first: true, - hasResult: false - }; - return this._s.scheduleRecursiveFuture(state, new Date(this._s.now()), scheduleRecursive); - }; - - return GenerateAbsoluteObservable; - }(ObservableBase)); - - /** - * GenerateAbsolutes an observable sequence by iterating a state from an initial state until the condition fails. - * - * @example - * res = source.generateWithAbsoluteTime(0, - * function (x) { return return true; }, - * function (x) { return x + 1; }, - * function (x) { return x; }, - * function (x) { return new Date(); } - * }); - * - * @param {Mixed} initialState Initial state. - * @param {Function} condition Condition to terminate generation (upon returning false). - * @param {Function} iterate Iteration step function. - * @param {Function} resultSelector Selector function for results produced in the sequence. - * @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning Date values. - * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used. - * @returns {Observable} The generated sequence. - */ - Observable.generateWithAbsoluteTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - return new GenerateAbsoluteObservable(initialState, condition, iterate, resultSelector, timeSelector, scheduler); - }; - - var GenerateRelativeObservable = (function (__super__) { - inherits(GenerateRelativeObservable, __super__); - function GenerateRelativeObservable(state, cndFn, itrFn, resFn, timeFn, s) { - this._state = state; - this._cndFn = cndFn; - this._itrFn = itrFn; - this._resFn = resFn; - this._timeFn = timeFn; - this._s = s; - __super__.call(this); - } - - function scheduleRecursive(state, recurse) { - state.hasResult && state.o.onNext(state.result); - - if (state.first) { - state.first = false; - } else { - state.newState = tryCatch(state.self._itrFn)(state.newState); - if (state.newState === errorObj) { return state.o.onError(state.newState.e); } - } - - state.hasResult = tryCatch(state.self._cndFn)(state.newState); - if (state.hasResult === errorObj) { return state.o.onError(state.hasResult.e); } - if (state.hasResult) { - state.result = tryCatch(state.self._resFn)(state.newState); - if (state.result === errorObj) { return state.o.onError(state.result.e); } - var time = tryCatch(state.self._timeFn)(state.newState); - if (time === errorObj) { return state.o.onError(time.e); } - recurse(state, time); - } else { - state.o.onCompleted(); - } - } - - GenerateRelativeObservable.prototype.subscribeCore = function (o) { - var state = { - o: o, - self: this, - newState: this._state, - first: true, - hasResult: false - }; - return this._s.scheduleRecursiveFuture(state, 0, scheduleRecursive); - }; - - return GenerateRelativeObservable; - }(ObservableBase)); - - /** - * Generates an observable sequence by iterating a state from an initial state until the condition fails. - * - * @example - * res = source.generateWithRelativeTime(0, - * function (x) { return return true; }, - * function (x) { return x + 1; }, - * function (x) { return x; }, - * function (x) { return 500; } - * ); - * - * @param {Mixed} initialState Initial state. - * @param {Function} condition Condition to terminate generation (upon returning false). - * @param {Function} iterate Iteration step function. - * @param {Function} resultSelector Selector function for results produced in the sequence. - * @param {Function} timeSelector Time selector function to control the speed of values being produced each iteration, returning integer values denoting milliseconds. - * @param {Scheduler} [scheduler] Scheduler on which to run the generator loop. If not specified, the timeout scheduler is used. - * @returns {Observable} The generated sequence. - */ - Observable.generateWithRelativeTime = function (initialState, condition, iterate, resultSelector, timeSelector, scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - return new GenerateRelativeObservable(initialState, condition, iterate, resultSelector, timeSelector, scheduler); - }; - - var DelaySubscription = (function(__super__) { - inherits(DelaySubscription, __super__); - function DelaySubscription(source, dt, s) { - this.source = source; - this._dt = dt; - this._s = s; - __super__.call(this); - } - - DelaySubscription.prototype.subscribeCore = function (o) { - var d = new SerialDisposable(); - - d.setDisposable(this._s.scheduleFuture([this.source, o, d], this._dt, scheduleMethod)); - - return d; - }; - - function scheduleMethod(s, state) { - var source = state[0], o = state[1], d = state[2]; - d.setDisposable(source.subscribe(o)); - } - - return DelaySubscription; - }(ObservableBase)); - - /** - * Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers. - * - * @example - * 1 - res = source.delaySubscription(5000); // 5s - * 2 - res = source.delaySubscription(5000, Rx.Scheduler.default); // 5 seconds - * - * @param {Number} dueTime Relative or absolute time shift of the subscription. - * @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used. - * @returns {Observable} Time-shifted sequence. - */ - observableProto.delaySubscription = function (dueTime, scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - return new DelaySubscription(this, dueTime, scheduler); - }; - - var SkipLastWithTimeObservable = (function (__super__) { - inherits(SkipLastWithTimeObservable, __super__); - function SkipLastWithTimeObservable(source, d, s) { - this.source = source; - this._d = d; - this._s = s; - __super__.call(this); - } - - SkipLastWithTimeObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new SkipLastWithTimeObserver(o, this)); - }; - - return SkipLastWithTimeObservable; - }(ObservableBase)); - - var SkipLastWithTimeObserver = (function (__super__) { - inherits(SkipLastWithTimeObserver, __super__); - - function SkipLastWithTimeObserver(o, p) { - this._o = o; - this._s = p._s; - this._d = p._d; - this._q = []; - __super__.call(this); - } - - SkipLastWithTimeObserver.prototype.next = function (x) { - var now = this._s.now(); - this._q.push({ interval: now, value: x }); - while (this._q.length > 0 && now - this._q[0].interval >= this._d) { - this._o.onNext(this._q.shift().value); - } - }; - SkipLastWithTimeObserver.prototype.error = function (e) { this._o.onError(e); }; - SkipLastWithTimeObserver.prototype.completed = function () { - var now = this._s.now(); - while (this._q.length > 0 && now - this._q[0].interval >= this._d) { - this._o.onNext(this._q.shift().value); - } - this._o.onCompleted(); - }; - - return SkipLastWithTimeObserver; - }(AbstractObserver)); - - /** - * Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers. - * @description - * This operator accumulates a queue with a length enough to store elements received during the initial duration window. - * As more elements are received, elements older than the specified duration are taken from the queue and produced on the - * result sequence. This causes elements to be delayed with duration. - * @param {Number} duration Duration for skipping elements from the end of the sequence. - * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout - * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the end of the source sequence. - */ - observableProto.skipLastWithTime = function (duration, scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - return new SkipLastWithTimeObservable(this, duration, scheduler); - }; - - var TakeLastWithTimeObservable = (function (__super__) { - inherits(TakeLastWithTimeObservable, __super__); - function TakeLastWithTimeObservable(source, d, s) { - this.source = source; - this._d = d; - this._s = s; - __super__.call(this); - } - - TakeLastWithTimeObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new TakeLastWithTimeObserver(o, this._d, this._s)); - }; - - return TakeLastWithTimeObservable; - }(ObservableBase)); - - var TakeLastWithTimeObserver = (function (__super__) { - inherits(TakeLastWithTimeObserver, __super__); - - function TakeLastWithTimeObserver(o, d, s) { - this._o = o; - this._d = d; - this._s = s; - this._q = []; - __super__.call(this); - } - - TakeLastWithTimeObserver.prototype.next = function (x) { - var now = this._s.now(); - this._q.push({ interval: now, value: x }); - while (this._q.length > 0 && now - this._q[0].interval >= this._d) { - this._q.shift(); - } - }; - TakeLastWithTimeObserver.prototype.error = function (e) { this._o.onError(e); }; - TakeLastWithTimeObserver.prototype.completed = function () { - var now = this._s.now(); - while (this._q.length > 0) { - var next = this._q.shift(); - if (now - next.interval <= this._d) { this._o.onNext(next.value); } - } - this._o.onCompleted(); - }; - - return TakeLastWithTimeObserver; - }(AbstractObserver)); - - /** - * Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements. - * @description - * This operator accumulates a queue with a length enough to store elements received during the initial duration window. - * As more elements are received, elements older than the specified duration are taken from the queue and produced on the - * result sequence. This causes elements to be delayed with duration. - * @param {Number} duration Duration for taking elements from the end of the sequence. - * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. - * @returns {Observable} An observable sequence with the elements taken during the specified duration from the end of the source sequence. - */ - observableProto.takeLastWithTime = function (duration, scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - return new TakeLastWithTimeObservable(this, duration, scheduler); - }; - - /** - * Returns an array with the elements within the specified duration from the end of the observable source sequence, using the specified scheduler to run timers. - * @description - * This operator accumulates a queue with a length enough to store elements received during the initial duration window. - * As more elements are received, elements older than the specified duration are taken from the queue and produced on the - * result sequence. This causes elements to be delayed with duration. - * @param {Number} duration Duration for taking elements from the end of the sequence. - * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. - * @returns {Observable} An observable sequence containing a single array with the elements taken during the specified duration from the end of the source sequence. - */ - observableProto.takeLastBufferWithTime = function (duration, scheduler) { - var source = this; - isScheduler(scheduler) || (scheduler = defaultScheduler); - return new AnonymousObservable(function (o) { - var q = []; - return source.subscribe(function (x) { - var now = scheduler.now(); - q.push({ interval: now, value: x }); - while (q.length > 0 && now - q[0].interval >= duration) { - q.shift(); - } - }, function (e) { o.onError(e); }, function () { - var now = scheduler.now(), res = []; - while (q.length > 0) { - var next = q.shift(); - now - next.interval <= duration && res.push(next.value); - } - o.onNext(res); - o.onCompleted(); - }); - }, source); - }; - - var TakeWithTimeObservable = (function (__super__) { - inherits(TakeWithTimeObservable, __super__); - function TakeWithTimeObservable(source, d, s) { - this.source = source; - this._d = d; - this._s = s; - __super__.call(this); - } - - function scheduleMethod(s, o) { - o.onCompleted(); - } - - TakeWithTimeObservable.prototype.subscribeCore = function (o) { - return new BinaryDisposable( - this._s.scheduleFuture(o, this._d, scheduleMethod), - this.source.subscribe(o) - ); - }; - - return TakeWithTimeObservable; - }(ObservableBase)); - - /** - * Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. - * - * @example - * 1 - res = source.takeWithTime(5000, [optional scheduler]); - * @description - * This operator accumulates a queue with a length enough to store elements received during the initial duration window. - * As more elements are received, elements older than the specified duration are taken from the queue and produced on the - * result sequence. This causes elements to be delayed with duration. - * @param {Number} duration Duration for taking elements from the start of the sequence. - * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. - * @returns {Observable} An observable sequence with the elements taken during the specified duration from the start of the source sequence. - */ - observableProto.takeWithTime = function (duration, scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - return new TakeWithTimeObservable(this, duration, scheduler); - }; - - var SkipWithTimeObservable = (function (__super__) { - inherits(SkipWithTimeObservable, __super__); - function SkipWithTimeObservable(source, d, s) { - this.source = source; - this._d = d; - this._s = s; - this._open = false; - __super__.call(this); - } - - function scheduleMethod(s, self) { - self._open = true; - } - - SkipWithTimeObservable.prototype.subscribeCore = function (o) { - return new BinaryDisposable( - this._s.scheduleFuture(this, this._d, scheduleMethod), - this.source.subscribe(new SkipWithTimeObserver(o, this)) - ); - }; - - return SkipWithTimeObservable; - }(ObservableBase)); - - var SkipWithTimeObserver = (function (__super__) { - inherits(SkipWithTimeObserver, __super__); - - function SkipWithTimeObserver(o, p) { - this._o = o; - this._p = p; - __super__.call(this); - } - - SkipWithTimeObserver.prototype.next = function (x) { this._p._open && this._o.onNext(x); }; - SkipWithTimeObserver.prototype.error = function (e) { this._o.onError(e); }; - SkipWithTimeObserver.prototype.completed = function () { this._o.onCompleted(); }; - - return SkipWithTimeObserver; - }(AbstractObserver)); - - /** - * Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. - * @description - * Specifying a zero value for duration doesn't guarantee no elements will be dropped from the start of the source sequence. - * This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded - * may not execute immediately, despite the zero due time. - * - * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration. - * @param {Number} duration Duration for skipping elements from the start of the sequence. - * @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. - * @returns {Observable} An observable sequence with the elements skipped during the specified duration from the start of the source sequence. - */ - observableProto.skipWithTime = function (duration, scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - return new SkipWithTimeObservable(this, duration, scheduler); - }; - - var SkipUntilWithTimeObservable = (function (__super__) { - inherits(SkipUntilWithTimeObservable, __super__); - function SkipUntilWithTimeObservable(source, startTime, scheduler) { - this.source = source; - this._st = startTime; - this._s = scheduler; - __super__.call(this); - } - - function scheduleMethod(s, state) { - state._open = true; - } - - SkipUntilWithTimeObservable.prototype.subscribeCore = function (o) { - this._open = false; - return new BinaryDisposable( - this._s.scheduleFuture(this, this._st, scheduleMethod), - this.source.subscribe(new SkipUntilWithTimeObserver(o, this)) - ); - }; - - return SkipUntilWithTimeObservable; - }(ObservableBase)); - - var SkipUntilWithTimeObserver = (function (__super__) { - inherits(SkipUntilWithTimeObserver, __super__); - - function SkipUntilWithTimeObserver(o, p) { - this._o = o; - this._p = p; - __super__.call(this); - } - - SkipUntilWithTimeObserver.prototype.next = function (x) { this._p._open && this._o.onNext(x); }; - SkipUntilWithTimeObserver.prototype.error = function (e) { this._o.onError(e); }; - SkipUntilWithTimeObserver.prototype.completed = function () { this._o.onCompleted(); }; - - return SkipUntilWithTimeObserver; - }(AbstractObserver)); - - - /** - * Skips elements from the observable source sequence until the specified start time, using the specified scheduler to run timers. - * Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the start time. - * - * @examples - * 1 - res = source.skipUntilWithTime(new Date(), [scheduler]); - * 2 - res = source.skipUntilWithTime(5000, [scheduler]); - * @param {Date|Number} startTime Time to start taking elements from the source sequence. If this value is less than or equal to Date(), no elements will be skipped. - * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout. - * @returns {Observable} An observable sequence with the elements skipped until the specified start time. - */ - observableProto.skipUntilWithTime = function (startTime, scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - return new SkipUntilWithTimeObservable(this, startTime, scheduler); - }; - - /** - * Takes elements for the specified duration until the specified end time, using the specified scheduler to run timers. - * @param {Number | Date} endTime Time to stop taking elements from the source sequence. If this value is less than or equal to new Date(), the result stream will complete immediately. - * @param {Scheduler} [scheduler] Scheduler to run the timer on. - * @returns {Observable} An observable sequence with the elements taken until the specified end time. - */ - observableProto.takeUntilWithTime = function (endTime, scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - var source = this; - return new AnonymousObservable(function (o) { - return new BinaryDisposable( - scheduler.scheduleFuture(o, endTime, function (_, o) { o.onCompleted(); }), - source.subscribe(o)); - }, source); - }; - - /** - * Returns an Observable that emits only the first item emitted by the source Observable during sequential time windows of a specified duration. - * @param {Number} windowDuration time to wait before emitting another item after emitting the last item - * @param {Scheduler} [scheduler] the Scheduler to use internally to manage the timers that handle timeout for each item. If not provided, defaults to Scheduler.timeout. - * @returns {Observable} An Observable that performs the throttle operation. - */ - observableProto.throttle = function (windowDuration, scheduler) { - isScheduler(scheduler) || (scheduler = defaultScheduler); - var duration = +windowDuration || 0; - if (duration <= 0) { throw new RangeError('windowDuration cannot be less or equal zero.'); } - var source = this; - return new AnonymousObservable(function (o) { - var lastOnNext = 0; - return source.subscribe( - function (x) { - var now = scheduler.now(); - if (lastOnNext === 0 || now - lastOnNext >= duration) { - lastOnNext = now; - o.onNext(x); - } - },function (e) { o.onError(e); }, function () { o.onCompleted(); } - ); - }, source); - }; - - return Rx; -})); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module))) - -/***/ }), -/* 643 */ -/***/ (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' - ) -} - - -/***/ }), -/* 644 */ -/***/ (function(module, exports, __webpack_require__) { - -// Load modules - -var Dgram = __webpack_require__(673); -var Dns = __webpack_require__(335); -var Hoek = __webpack_require__(134); - - -// Declare internals - -var internals = {}; - - -exports.time = function (options, callback) { - - if (arguments.length !== 2) { - callback = arguments[0]; - options = {}; - } - - var settings = Hoek.clone(options); - settings.host = settings.host || 'pool.ntp.org'; - settings.port = settings.port || 123; - settings.resolveReference = settings.resolveReference || false; - - // Declare variables used by callback - - var timeoutId = 0; - var sent = 0; - - // Ensure callback is only called once - - var finish = function (err, result) { - - if (timeoutId) { - clearTimeout(timeoutId); - timeoutId = 0; - } - - socket.removeAllListeners(); - socket.once('error', internals.ignore); - socket.close(); - return callback(err, result); - }; - - finish = Hoek.once(finish); - - // Create UDP socket - - var socket = Dgram.createSocket('udp4'); - - socket.once('error', function (err) { - - return finish(err); - }); - - // Listen to incoming messages - - socket.on('message', function (buffer, rinfo) { - - var received = Date.now(); - - var message = new internals.NtpMessage(buffer); - if (!message.isValid) { - return finish(new Error('Invalid server response'), message); - } - - if (message.originateTimestamp !== sent) { - return finish(new Error('Wrong originate timestamp'), message); - } - - // Timestamp Name ID When Generated - // ------------------------------------------------------------ - // Originate Timestamp T1 time request sent by client - // Receive Timestamp T2 time request received by server - // Transmit Timestamp T3 time reply sent by server - // Destination Timestamp T4 time reply received by client - // - // The roundtrip delay d and system clock offset t are defined as: - // - // d = (T4 - T1) - (T3 - T2) t = ((T2 - T1) + (T3 - T4)) / 2 - - var T1 = message.originateTimestamp; - var T2 = message.receiveTimestamp; - var T3 = message.transmitTimestamp; - var T4 = received; - - message.d = (T4 - T1) - (T3 - T2); - message.t = ((T2 - T1) + (T3 - T4)) / 2; - message.receivedLocally = received; - - if (!settings.resolveReference || - message.stratum !== 'secondary') { - - return finish(null, message); - } - - // Resolve reference IP address - - Dns.reverse(message.referenceId, function (err, domains) { - - if (/* $lab:coverage:off$ */ !err /* $lab:coverage:on$ */) { - message.referenceHost = domains[0]; - } - - return finish(null, message); - }); - }); - - // Set timeout - - if (settings.timeout) { - timeoutId = setTimeout(function () { - - timeoutId = 0; - return finish(new Error('Timeout')); - }, settings.timeout); - } - - // Construct NTP message - - var message = new Buffer(48); - for (var i = 0; i < 48; i++) { // Zero message - message[i] = 0; - } - - message[0] = (0 << 6) + (4 << 3) + (3 << 0) // Set version number to 4 and Mode to 3 (client) - sent = Date.now(); - internals.fromMsecs(sent, message, 40); // Set transmit timestamp (returns as originate) - - // Send NTP request - - socket.send(message, 0, message.length, settings.port, settings.host, function (err, bytes) { - - if (err || - bytes !== 48) { - - return finish(err || new Error('Could not send entire message')); - } - }); -}; - - -internals.NtpMessage = function (buffer) { - - this.isValid = false; - - // Validate - - if (buffer.length !== 48) { - return; - } - - // Leap indicator - - var li = (buffer[0] >> 6); - switch (li) { - case 0: this.leapIndicator = 'no-warning'; break; - case 1: this.leapIndicator = 'last-minute-61'; break; - case 2: this.leapIndicator = 'last-minute-59'; break; - case 3: this.leapIndicator = 'alarm'; break; - } - - // Version - - var vn = ((buffer[0] & 0x38) >> 3); - this.version = vn; - - // Mode - - var mode = (buffer[0] & 0x7); - switch (mode) { - case 1: this.mode = 'symmetric-active'; break; - case 2: this.mode = 'symmetric-passive'; break; - case 3: this.mode = 'client'; break; - case 4: this.mode = 'server'; break; - case 5: this.mode = 'broadcast'; break; - case 0: - case 6: - case 7: this.mode = 'reserved'; break; - } - - // Stratum - - var stratum = buffer[1]; - if (stratum === 0) { - this.stratum = 'death'; - } - else if (stratum === 1) { - this.stratum = 'primary'; - } - else if (stratum <= 15) { - this.stratum = 'secondary'; - } - else { - this.stratum = 'reserved'; - } - - // Poll interval (msec) - - this.pollInterval = Math.round(Math.pow(2, buffer[2])) * 1000; - - // Precision (msecs) - - this.precision = Math.pow(2, buffer[3]) * 1000; - - // Root delay (msecs) - - var rootDelay = 256 * (256 * (256 * buffer[4] + buffer[5]) + buffer[6]) + buffer[7]; - this.rootDelay = 1000 * (rootDelay / 0x10000); - - // Root dispersion (msecs) - - this.rootDispersion = ((buffer[8] << 8) + buffer[9] + ((buffer[10] << 8) + buffer[11]) / Math.pow(2, 16)) * 1000; - - // Reference identifier - - this.referenceId = ''; - switch (this.stratum) { - case 'death': - case 'primary': - this.referenceId = String.fromCharCode(buffer[12]) + String.fromCharCode(buffer[13]) + String.fromCharCode(buffer[14]) + String.fromCharCode(buffer[15]); - break; - case 'secondary': - this.referenceId = '' + buffer[12] + '.' + buffer[13] + '.' + buffer[14] + '.' + buffer[15]; - break; - } - - // Reference timestamp - - this.referenceTimestamp = internals.toMsecs(buffer, 16); - - // Originate timestamp - - this.originateTimestamp = internals.toMsecs(buffer, 24); - - // Receive timestamp - - this.receiveTimestamp = internals.toMsecs(buffer, 32); - - // Transmit timestamp - - this.transmitTimestamp = internals.toMsecs(buffer, 40); - - // Validate - - if (this.version === 4 && - this.stratum !== 'reserved' && - this.mode === 'server' && - this.originateTimestamp && - this.receiveTimestamp && - this.transmitTimestamp) { - - this.isValid = true; - } - - return this; -}; - - -internals.toMsecs = function (buffer, offset) { - - var seconds = 0; - var fraction = 0; - - for (var i = 0; i < 4; ++i) { - seconds = (seconds * 256) + buffer[offset + i]; - } - - for (i = 4; i < 8; ++i) { - fraction = (fraction * 256) + buffer[offset + i]; - } - - return ((seconds - 2208988800 + (fraction / Math.pow(2, 32))) * 1000); -}; - - -internals.fromMsecs = function (ts, buffer, offset) { - - var seconds = Math.floor(ts / 1000) + 2208988800; - var fraction = Math.round((ts % 1000) / 1000 * Math.pow(2, 32)); - - buffer[offset + 0] = (seconds & 0xFF000000) >> 24; - buffer[offset + 1] = (seconds & 0x00FF0000) >> 16; - buffer[offset + 2] = (seconds & 0x0000FF00) >> 8; - buffer[offset + 3] = (seconds & 0x000000FF); - - buffer[offset + 4] = (fraction & 0xFF000000) >> 24; - buffer[offset + 5] = (fraction & 0x00FF0000) >> 16; - buffer[offset + 6] = (fraction & 0x0000FF00) >> 8; - buffer[offset + 7] = (fraction & 0x000000FF); -}; - - -// Offset singleton - -internals.last = { - offset: 0, - expires: 0, - host: '', - port: 0 -}; - - -exports.offset = function (options, callback) { - - if (arguments.length !== 2) { - callback = arguments[0]; - options = {}; - } - - var now = Date.now(); - var clockSyncRefresh = options.clockSyncRefresh || 24 * 60 * 60 * 1000; // Daily - - if (internals.last.offset && - internals.last.host === options.host && - internals.last.port === options.port && - now < internals.last.expires) { - - process.nextTick(function () { - - callback(null, internals.last.offset); - }); - - return; - } - - exports.time(options, function (err, time) { - - if (err) { - return callback(err, 0); - } - - internals.last = { - offset: Math.round(time.t), - expires: now + clockSyncRefresh, - host: options.host, - port: options.port - }; - - return callback(null, internals.last.offset); - }); -}; - - -// Now singleton - -internals.now = { - intervalId: 0 -}; - - -exports.start = function (options, callback) { - - if (arguments.length !== 2) { - callback = arguments[0]; - options = {}; - } - - if (internals.now.intervalId) { - process.nextTick(function () { - - callback(); - }); - - return; - } - - exports.offset(options, function (err, offset) { - - internals.now.intervalId = setInterval(function () { - - exports.offset(options, function () { }); - }, options.clockSyncRefresh || 24 * 60 * 60 * 1000); // Daily - - return callback(); - }); -}; - - -exports.stop = function () { - - if (!internals.now.intervalId) { - return; - } - - clearInterval(internals.now.intervalId); - internals.now.intervalId = 0; -}; - - -exports.isLive = function () { - - return !!internals.now.intervalId; -}; - - -exports.now = function () { - - var now = Date.now(); - if (!exports.isLive() || - now >= internals.last.expires) { - - return now; - } - - return now + internals.last.offset; -}; - - -internals.ignore = function () { - -}; - - -/***/ }), -/* 645 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var isPlainObj = __webpack_require__(568); - -module.exports = function (obj, opts) { - if (!isPlainObj(obj)) { - throw new TypeError('Expected a plain object'); - } - - opts = opts || {}; - - // DEPRECATED - if (typeof opts === 'function') { - opts = {compare: opts}; - } - - var deep = opts.deep; - var seenInput = []; - var seenOutput = []; - - var sortKeys = function (x) { - var seenIndex = seenInput.indexOf(x); - - if (seenIndex !== -1) { - return seenOutput[seenIndex]; - } - - var ret = {}; - var keys = Object.keys(x).sort(opts.compare); - - seenInput.push(x); - seenOutput.push(ret); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var val = x[key]; - - ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val; - } - - return ret; - }; - - return sortKeys(obj); -}; - - -/***/ }), -/* 646 */ -/***/ (function(module, exports, __webpack_require__) { - -var licenseIDs = __webpack_require__(649); - -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; -}; - - -/***/ }), -/* 647 */ -/***/ (function(module, exports, __webpack_require__) { - -var parser = __webpack_require__(648).parser - -module.exports = function (argument) { - return parser.parse(argument) -} - - -/***/ }), -/* 648 */ -/***/ (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__(5).readFileSync(__webpack_require__(0).normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if (typeof module !== 'undefined' && __webpack_require__.c[__webpack_require__.s] === module) { - exports.main(process.argv.slice(1)); -} -} - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module))) - -/***/ }), -/* 649 */ -/***/ (function(module, exports) { - -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" -]; - -/***/ }), -/* 650 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2017 Joyent, Inc. - -module.exports = { - read: read, - verify: verify, - sign: sign, - signAsync: signAsync, - write: write, - - /* Internal private API */ - fromBuffer: fromBuffer, - toBuffer: toBuffer -}; - -var assert = __webpack_require__(11); -var SSHBuffer = __webpack_require__(146); -var crypto = __webpack_require__(8); -var algs = __webpack_require__(22); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); -var Identity = __webpack_require__(119); -var rfc4253 = __webpack_require__(75); -var Signature = __webpack_require__(46); -var utils = __webpack_require__(19); -var Certificate = __webpack_require__(116); - -function verify(cert, key) { - /* - * We always give an issuerKey, so if our verify() is being called then - * there was no signature. Return false. - */ - return (false); -} - -var TYPES = { - 'user': 1, - 'host': 2 -}; -Object.keys(TYPES).forEach(function (k) { TYPES[TYPES[k]] = k; }); - -var ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/; - -function read(buf, options) { - if (Buffer.isBuffer(buf)) - buf = buf.toString('ascii'); - var parts = buf.trim().split(/[ \t\n]+/g); - if (parts.length < 2 || parts.length > 3) - throw (new Error('Not a valid SSH certificate line')); - - var algo = parts[0]; - var data = parts[1]; - - data = new Buffer(data, 'base64'); - return (fromBuffer(data, algo)); -} - -function fromBuffer(data, algo, partial) { - var sshbuf = new SSHBuffer({ buffer: data }); - var innerAlgo = sshbuf.readString(); - if (algo !== undefined && innerAlgo !== algo) - throw (new Error('SSH certificate algorithm mismatch')); - if (algo === undefined) - algo = innerAlgo; - - var cert = {}; - cert.signatures = {}; - cert.signatures.openssh = {}; - - cert.signatures.openssh.nonce = sshbuf.readBuffer(); - - var key = {}; - var parts = (key.parts = []); - key.type = getAlg(algo); - - var partCount = algs.info[key.type].parts.length; - while (parts.length < partCount) - parts.push(sshbuf.readPart()); - assert.ok(parts.length >= 1, 'key must have at least one part'); - - var algInfo = algs.info[key.type]; - if (key.type === 'ecdsa') { - var res = ECDSA_ALGO.exec(algo); - assert.ok(res !== null); - assert.strictEqual(res[1], parts[0].data.toString()); - } - - for (var i = 0; i < algInfo.parts.length; ++i) { - parts[i].name = algInfo.parts[i]; - if (parts[i].name !== 'curve' && - algInfo.normalize !== false) { - var p = parts[i]; - p.data = utils.mpNormalize(p.data); - } - } - - cert.subjectKey = new Key(key); - - cert.serial = sshbuf.readInt64(); - - var type = TYPES[sshbuf.readInt()]; - assert.string(type, 'valid cert type'); - - cert.signatures.openssh.keyId = sshbuf.readString(); - - var principals = []; - var pbuf = sshbuf.readBuffer(); - var psshbuf = new SSHBuffer({ buffer: pbuf }); - while (!psshbuf.atEnd()) - principals.push(psshbuf.readString()); - if (principals.length === 0) - principals = ['*']; - - cert.subjects = principals.map(function (pr) { - if (type === 'user') - return (Identity.forUser(pr)); - else if (type === 'host') - return (Identity.forHost(pr)); - throw (new Error('Unknown identity type ' + type)); - }); - - cert.validFrom = int64ToDate(sshbuf.readInt64()); - cert.validUntil = int64ToDate(sshbuf.readInt64()); - - cert.signatures.openssh.critical = sshbuf.readBuffer(); - cert.signatures.openssh.exts = sshbuf.readBuffer(); - - /* reserved */ - sshbuf.readBuffer(); - - var signingKeyBuf = sshbuf.readBuffer(); - cert.issuerKey = rfc4253.read(signingKeyBuf); - - /* - * OpenSSH certs don't give the identity of the issuer, just their - * public key. So, we use an Identity that matches anything. The - * isSignedBy() function will later tell you if the key matches. - */ - cert.issuer = Identity.forHost('**'); - - var sigBuf = sshbuf.readBuffer(); - cert.signatures.openssh.signature = - Signature.parse(sigBuf, cert.issuerKey.type, 'ssh'); - - if (partial !== undefined) { - partial.remainder = sshbuf.remainder(); - partial.consumed = sshbuf._offset; - } - - return (new Certificate(cert)); -} - -function int64ToDate(buf) { - var i = buf.readUInt32BE(0) * 4294967296; - i += buf.readUInt32BE(4); - var d = new Date(); - d.setTime(i * 1000); - d.sourceInt64 = buf; - return (d); -} - -function dateToInt64(date) { - if (date.sourceInt64 !== undefined) - return (date.sourceInt64); - var i = Math.round(date.getTime() / 1000); - var upper = Math.floor(i / 4294967296); - var lower = Math.floor(i % 4294967296); - var buf = new Buffer(8); - buf.writeUInt32BE(upper, 0); - buf.writeUInt32BE(lower, 4); - return (buf); -} - -function sign(cert, key) { - if (cert.signatures.openssh === undefined) - cert.signatures.openssh = {}; - try { - var blob = toBuffer(cert, true); - } catch (e) { - delete (cert.signatures.openssh); - return (false); - } - var sig = cert.signatures.openssh; - var hashAlgo = undefined; - if (key.type === 'rsa' || key.type === 'dsa') - hashAlgo = 'sha1'; - var signer = key.createSign(hashAlgo); - signer.write(blob); - sig.signature = signer.sign(); - return (true); -} - -function signAsync(cert, signer, done) { - if (cert.signatures.openssh === undefined) - cert.signatures.openssh = {}; - try { - var blob = toBuffer(cert, true); - } catch (e) { - delete (cert.signatures.openssh); - done(e); - return; - } - var sig = cert.signatures.openssh; - - signer(blob, function (err, signature) { - if (err) { - done(err); - return; - } - try { - /* - * This will throw if the signature isn't of a - * type/algo that can be used for SSH. - */ - signature.toBuffer('ssh'); - } catch (e) { - done(e); - return; - } - sig.signature = signature; - done(); - }); -} - -function write(cert, options) { - if (options === undefined) - options = {}; - - var blob = toBuffer(cert); - var out = getCertType(cert.subjectKey) + ' ' + blob.toString('base64'); - if (options.comment) - out = out + ' ' + options.comment; - return (out); -} - - -function toBuffer(cert, noSig) { - assert.object(cert.signatures.openssh, 'signature for openssh format'); - var sig = cert.signatures.openssh; - - if (sig.nonce === undefined) - sig.nonce = crypto.randomBytes(16); - var buf = new SSHBuffer({}); - buf.writeString(getCertType(cert.subjectKey)); - buf.writeBuffer(sig.nonce); - - var key = cert.subjectKey; - var algInfo = algs.info[key.type]; - algInfo.parts.forEach(function (part) { - buf.writePart(key.part[part]); - }); - - buf.writeInt64(cert.serial); - - var type = cert.subjects[0].type; - assert.notStrictEqual(type, 'unknown'); - cert.subjects.forEach(function (id) { - assert.strictEqual(id.type, type); - }); - type = TYPES[type]; - buf.writeInt(type); - - if (sig.keyId === undefined) { - sig.keyId = cert.subjects[0].type + '_' + - (cert.subjects[0].uid || cert.subjects[0].hostname); - } - buf.writeString(sig.keyId); - - var sub = new SSHBuffer({}); - cert.subjects.forEach(function (id) { - if (type === TYPES.host) - sub.writeString(id.hostname); - else if (type === TYPES.user) - sub.writeString(id.uid); - }); - buf.writeBuffer(sub.toBuffer()); - - buf.writeInt64(dateToInt64(cert.validFrom)); - buf.writeInt64(dateToInt64(cert.validUntil)); - - if (sig.critical === undefined) - sig.critical = new Buffer(0); - buf.writeBuffer(sig.critical); - - if (sig.exts === undefined) - sig.exts = new Buffer(0); - buf.writeBuffer(sig.exts); - - /* reserved */ - buf.writeBuffer(new Buffer(0)); - - sub = rfc4253.write(cert.issuerKey); - buf.writeBuffer(sub); - - if (!noSig) - buf.writeBuffer(sig.signature.toBuffer('ssh')); - - return (buf.toBuffer()); -} - -function getAlg(certType) { - if (certType === 'ssh-rsa-cert-v01@openssh.com') - return ('rsa'); - if (certType === 'ssh-dss-cert-v01@openssh.com') - return ('dsa'); - if (certType.match(ECDSA_ALGO)) - return ('ecdsa'); - if (certType === 'ssh-ed25519-cert-v01@openssh.com') - return ('ed25519'); - throw (new Error('Unsupported cert type ' + certType)); -} - -function getCertType(key) { - if (key.type === 'rsa') - return ('ssh-rsa-cert-v01@openssh.com'); - if (key.type === 'dsa') - return ('ssh-dss-cert-v01@openssh.com'); - if (key.type === 'ecdsa') - return ('ecdsa-sha2-' + key.curve + '-cert-v01@openssh.com'); - if (key.type === 'ed25519') - return ('ssh-ed25519-cert-v01@openssh.com'); - throw (new Error('Unsupported key type ' + key.type)); -} - - -/***/ }), -/* 651 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2016 Joyent, Inc. - -var x509 = __webpack_require__(323); - -module.exports = { - read: read, - verify: x509.verify, - sign: x509.sign, - write: write -}; - -var assert = __webpack_require__(11); -var asn1 = __webpack_require__(50); -var algs = __webpack_require__(22); -var utils = __webpack_require__(19); -var Key = __webpack_require__(23); -var PrivateKey = __webpack_require__(24); -var pem = __webpack_require__(58); -var Identity = __webpack_require__(119); -var Signature = __webpack_require__(46); -var Certificate = __webpack_require__(116); - -function read(buf, options) { - if (typeof (buf) !== 'string') { - assert.buffer(buf, 'buf'); - buf = buf.toString('ascii'); - } - - var lines = buf.trim().split(/[\r\n]+/g); - - var m = lines[0].match(/*JSSTYLED*/ - /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/); - assert.ok(m, 'invalid PEM header'); - - var m2 = lines[lines.length - 1].match(/*JSSTYLED*/ - /[-]+[ ]*END CERTIFICATE[ ]*[-]+/); - assert.ok(m2, 'invalid PEM footer'); - - var headers = {}; - while (true) { - lines = lines.slice(1); - m = lines[0].match(/*JSSTYLED*/ - /^([A-Za-z0-9-]+): (.+)$/); - if (!m) - break; - headers[m[1].toLowerCase()] = m[2]; - } - - /* Chop off the first and last lines */ - lines = lines.slice(0, -1).join(''); - buf = new Buffer(lines, 'base64'); - - return (x509.read(buf, options)); -} - -function write(cert, options) { - var dbuf = x509.write(cert, options); - - var header = 'CERTIFICATE'; - var tmp = dbuf.toString('base64'); - var len = tmp.length + (tmp.length / 64) + - 18 + 16 + header.length*2 + 10; - var buf = new Buffer(len); - var o = 0; - o += buf.write('-----BEGIN ' + header + '-----\n', o); - for (var i = 0; i < tmp.length; ) { - var limit = i + 64; - if (limit > tmp.length) - limit = tmp.length; - o += buf.write(tmp.slice(i, limit), o); - buf[o++] = 10; - i = limit; - } - o += buf.write('-----END ' + header + '-----\n', o); - - return (buf.slice(0, o)); -} - - -/***/ }), -/* 652 */ -/***/ (function(module, exports) { - -module.exports = shift - -function shift (stream) { - var rs = stream._readableState - if (!rs) return null - return rs.objectMode ? stream.read() : stream.read(getStateLength(rs)) -} - -function getStateLength (state) { - if (state.buffer.length) { - // Since node 6.3.0 state.buffer is a BufferList not an array - if (state.buffer.head) { - return state.buffer.head.data.length - } - - return state.buffer[0].length - } - - return state.length -} - - -/***/ }), -/* 653 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function (str) { - return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase(); - }); -}; - - -/***/ }), -/* 654 */ -/***/ (function(module, exports) { - -/*! http://mths.be/codepointat v0.2.0 by @mathias */ -if (!String.prototype.codePointAt) { - (function() { - 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` - var defineProperty = (function() { - // IE 8 only supports `Object.defineProperty` on DOM elements - try { - var object = {}; - var $defineProperty = Object.defineProperty; - var result = $defineProperty(object, object, object) && $defineProperty; - } catch(error) {} - return result; - }()); - var codePointAt = function(position) { - if (this == null) { - throw TypeError(); - } - var string = String(this); - var size = string.length; - // `ToInteger` - var index = position ? Number(position) : 0; - if (index != index) { // better `isNaN` - index = 0; - } - // Account for out-of-bounds indices: - if (index < 0 || index >= size) { - return undefined; - } - // Get the first code unit - var first = string.charCodeAt(index); - var second; - if ( // check if it’s the start of a surrogate pair - first >= 0xD800 && first <= 0xDBFF && // high surrogate - size > index + 1 // there is a next code unit - ) { - second = string.charCodeAt(index + 1); - if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate - // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; - } - } - return first; - }; - if (defineProperty) { - defineProperty(String.prototype, 'codePointAt', { - 'value': codePointAt, - 'configurable': true, - 'writable': true - }); - } else { - String.prototype.codePointAt = codePointAt; - } - }()); -} - - -/***/ }), -/* 655 */ -/***/ (function(module, exports, __webpack_require__) { - -var util = __webpack_require__(2) -var Stream = __webpack_require__(25) -var StringDecoder = __webpack_require__(231).StringDecoder - -module.exports = StringStream -module.exports.AlignedStringDecoder = AlignedStringDecoder - -function StringStream(from, to) { - if (!(this instanceof StringStream)) return new StringStream(from, to) - - Stream.call(this) - - if (from == null) from = 'utf8' - - this.readable = this.writable = true - this.paused = false - this.toEncoding = (to == null ? from : to) - this.fromEncoding = (to == null ? '' : from) - this.decoder = new AlignedStringDecoder(this.toEncoding) -} -util.inherits(StringStream, Stream) - -StringStream.prototype.write = function(data) { - if (!this.writable) { - var err = new Error('stream not writable') - err.code = 'EPIPE' - this.emit('error', err) - return false - } - if (this.fromEncoding) { - if (Buffer.isBuffer(data)) data = data.toString() - data = new Buffer(data, this.fromEncoding) - } - var string = this.decoder.write(data) - if (string.length) this.emit('data', string) - return !this.paused -} - -StringStream.prototype.flush = function() { - if (this.decoder.flush) { - var string = this.decoder.flush() - if (string.length) this.emit('data', string) - } -} - -StringStream.prototype.end = function() { - if (!this.writable && !this.readable) return - this.flush() - this.emit('end') - this.writable = this.readable = false - this.destroy() -} - -StringStream.prototype.destroy = function() { - this.decoder = null - this.writable = this.readable = false - this.emit('close') -} - -StringStream.prototype.pause = function() { - this.paused = true -} - -StringStream.prototype.resume = function () { - if (this.paused) this.emit('drain') - this.paused = false -} - -function AlignedStringDecoder(encoding) { - StringDecoder.call(this, encoding) - - switch (this.encoding) { - case 'base64': - this.write = alignedWrite - this.alignedBuffer = new Buffer(3) - this.alignedBytes = 0 - break - } -} -util.inherits(AlignedStringDecoder, StringDecoder) - -AlignedStringDecoder.prototype.flush = function() { - if (!this.alignedBuffer || !this.alignedBytes) return '' - var leftover = this.alignedBuffer.toString(this.encoding, 0, this.alignedBytes) - this.alignedBytes = 0 - return leftover -} - -function alignedWrite(buffer) { - var rem = (this.alignedBytes + buffer.length) % this.alignedBuffer.length - if (!rem && !this.alignedBytes) return buffer.toString(this.encoding) - - var returnBuffer = new Buffer(this.alignedBytes + buffer.length - rem) - - this.alignedBuffer.copy(returnBuffer, 0, 0, this.alignedBytes) - buffer.copy(returnBuffer, this.alignedBytes, 0, buffer.length - rem) - - buffer.copy(this.alignedBuffer, 0, buffer.length - rem, buffer.length) - this.alignedBytes = rem - - return returnBuffer.toString(this.encoding) -} - - -/***/ }), -/* 656 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -const ansiRegex = __webpack_require__(657); - -module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; - - -/***/ }), -/* 657 */ -/***/ (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'); -}; - - -/***/ }), -/* 658 */ -/***/ (function(module, exports, __webpack_require__) { - -var util = __webpack_require__(2) -var bl = __webpack_require__(455) -var xtend = __webpack_require__(333) -var headers = __webpack_require__(324) - -var Writable = __webpack_require__(74).Writable -var PassThrough = __webpack_require__(74).PassThrough - -var noop = function () {} - -var overflow = function (size) { - size &= 511 - return size && 512 - size -} - -var emptyStream = function (self, offset) { - var s = new Source(self, offset) - s.end() - return s -} - -var mixinPax = function (header, pax) { - if (pax.path) header.name = pax.path - if (pax.linkpath) header.linkname = pax.linkpath - header.pax = pax - return header -} - -var Source = function (self, offset) { - this._parent = self - this.offset = offset - PassThrough.call(this) -} - -util.inherits(Source, PassThrough) - -Source.prototype.destroy = function (err) { - this._parent.destroy(err) -} - -var Extract = function (opts) { - if (!(this instanceof Extract)) return new Extract(opts) - Writable.call(this, opts) - - this._offset = 0 - this._buffer = bl() - this._missing = 0 - this._onparse = noop - this._header = null - this._stream = null - this._overflow = null - this._cb = null - this._locked = false - this._destroyed = false - this._pax = null - this._paxGlobal = null - this._gnuLongPath = null - this._gnuLongLinkPath = null - - var self = this - var b = self._buffer - - var oncontinue = function () { - self._continue() - } - - var onunlock = function (err) { - self._locked = false - if (err) return self.destroy(err) - if (!self._stream) oncontinue() - } - - var onstreamend = function () { - self._stream = null - var drain = overflow(self._header.size) - if (drain) self._parse(drain, ondrain) - else self._parse(512, onheader) - if (!self._locked) oncontinue() - } - - var ondrain = function () { - self._buffer.consume(overflow(self._header.size)) - self._parse(512, onheader) - oncontinue() - } - - var onpaxglobalheader = function () { - var size = self._header.size - self._paxGlobal = headers.decodePax(b.slice(0, size)) - b.consume(size) - onstreamend() - } - - var onpaxheader = function () { - var size = self._header.size - self._pax = headers.decodePax(b.slice(0, size)) - if (self._paxGlobal) self._pax = xtend(self._paxGlobal, self._pax) - b.consume(size) - onstreamend() - } - - var ongnulongpath = function () { - var size = self._header.size - this._gnuLongPath = headers.decodeLongPath(b.slice(0, size)) - b.consume(size) - onstreamend() - } - - var ongnulonglinkpath = function () { - var size = self._header.size - this._gnuLongLinkPath = headers.decodeLongPath(b.slice(0, size)) - b.consume(size) - onstreamend() - } - - var onheader = function () { - var offset = self._offset - var header - try { - header = self._header = headers.decode(b.slice(0, 512)) - } catch (err) { - self.emit('error', err) - } - b.consume(512) - - if (!header) { - self._parse(512, onheader) - oncontinue() - return - } - if (header.type === 'gnu-long-path') { - self._parse(header.size, ongnulongpath) - oncontinue() - return - } - if (header.type === 'gnu-long-link-path') { - self._parse(header.size, ongnulonglinkpath) - oncontinue() - return - } - if (header.type === 'pax-global-header') { - self._parse(header.size, onpaxglobalheader) - oncontinue() - return - } - if (header.type === 'pax-header') { - self._parse(header.size, onpaxheader) - oncontinue() - return - } - - if (self._gnuLongPath) { - header.name = self._gnuLongPath - self._gnuLongPath = null - } - - if (self._gnuLongLinkPath) { - header.linkname = self._gnuLongLinkPath - self._gnuLongLinkPath = null - } - - if (self._pax) { - self._header = header = mixinPax(header, self._pax) - self._pax = null - } - - self._locked = true - - if (!header.size || header.type === 'directory') { - self._parse(512, onheader) - self.emit('entry', header, emptyStream(self, offset), onunlock) - return - } - - self._stream = new Source(self, offset) - - self.emit('entry', header, self._stream, onunlock) - self._parse(header.size, onstreamend) - oncontinue() - } - - this._parse(512, onheader) -} - -util.inherits(Extract, Writable) - -Extract.prototype.destroy = function (err) { - if (this._destroyed) return - this._destroyed = true - - if (err) this.emit('error', err) - this.emit('close') - if (this._stream) this._stream.emit('close') -} - -Extract.prototype._parse = function (size, onparse) { - if (this._destroyed) return - this._offset += size - this._missing = size - this._onparse = onparse -} - -Extract.prototype._continue = function () { - if (this._destroyed) return - var cb = this._cb - this._cb = noop - if (this._overflow) this._write(this._overflow, undefined, cb) - else cb() -} - -Extract.prototype._write = function (data, enc, cb) { - if (this._destroyed) return - - var s = this._stream - var b = this._buffer - var missing = this._missing - - // we do not reach end-of-chunk now. just forward it - - if (data.length < missing) { - this._missing -= data.length - this._overflow = null - if (s) return s.write(data, cb) - b.append(data) - return cb() - } - - // end-of-chunk. the parser should call cb. - - this._cb = cb - this._missing = 0 - - var overflow = null - if (data.length > missing) { - overflow = data.slice(missing) - data = data.slice(0, missing) - } - - if (s) s.end(data) - else b.append(data) - - this._overflow = overflow - this._onparse() -} - -module.exports = Extract - - -/***/ }), -/* 659 */ -/***/ (function(module, exports, __webpack_require__) { - -var constants = __webpack_require__(334) -var eos = __webpack_require__(289) -var util = __webpack_require__(2) - -var Readable = __webpack_require__(74).Readable -var Writable = __webpack_require__(74).Writable -var StringDecoder = __webpack_require__(231).StringDecoder - -var headers = __webpack_require__(324) - -var DMODE = parseInt('755', 8) -var FMODE = parseInt('644', 8) - -var END_OF_TAR = new Buffer(1024) -END_OF_TAR.fill(0) - -var noop = function () {} - -var overflow = function (self, size) { - size &= 511 - if (size) self.push(END_OF_TAR.slice(0, 512 - size)) -} - -function modeToType (mode) { - switch (mode & constants.S_IFMT) { - case constants.S_IFBLK: return 'block-device' - case constants.S_IFCHR: return 'character-device' - case constants.S_IFDIR: return 'directory' - case constants.S_IFIFO: return 'fifo' - case constants.S_IFLNK: return 'symlink' - } - - return 'file' -} - -var Sink = function (to) { - Writable.call(this) - this.written = 0 - this._to = to - this._destroyed = false -} - -util.inherits(Sink, Writable) - -Sink.prototype._write = function (data, enc, cb) { - this.written += data.length - if (this._to.push(data)) return cb() - this._to._drain = cb -} - -Sink.prototype.destroy = function () { - if (this._destroyed) return - this._destroyed = true - this.emit('close') -} - -var LinkSink = function () { - Writable.call(this) - this.linkname = '' - this._decoder = new StringDecoder('utf-8') - this._destroyed = false -} - -util.inherits(LinkSink, Writable) - -LinkSink.prototype._write = function (data, enc, cb) { - this.linkname += this._decoder.write(data) - cb() -} - -LinkSink.prototype.destroy = function () { - if (this._destroyed) return - this._destroyed = true - this.emit('close') -} - -var Void = function () { - Writable.call(this) - this._destroyed = false -} - -util.inherits(Void, Writable) - -Void.prototype._write = function (data, enc, cb) { - cb(new Error('No body allowed for this entry')) -} - -Void.prototype.destroy = function () { - if (this._destroyed) return - this._destroyed = true - this.emit('close') -} - -var Pack = function (opts) { - if (!(this instanceof Pack)) return new Pack(opts) - Readable.call(this, opts) - - this._drain = noop - this._finalized = false - this._finalizing = false - this._destroyed = false - this._stream = null -} - -util.inherits(Pack, Readable) - -Pack.prototype.entry = function (header, buffer, callback) { - if (this._stream) throw new Error('already piping an entry') - if (this._finalized || this._destroyed) return - - if (typeof buffer === 'function') { - callback = buffer - buffer = null - } - - if (!callback) callback = noop - - var self = this - - if (!header.size || header.type === 'symlink') header.size = 0 - if (!header.type) header.type = modeToType(header.mode) - if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE - if (!header.uid) header.uid = 0 - if (!header.gid) header.gid = 0 - if (!header.mtime) header.mtime = new Date() - - if (typeof buffer === 'string') buffer = new Buffer(buffer) - if (Buffer.isBuffer(buffer)) { - header.size = buffer.length - this._encode(header) - this.push(buffer) - overflow(self, header.size) - process.nextTick(callback) - return new Void() - } - - if (header.type === 'symlink' && !header.linkname) { - var linkSink = new LinkSink() - eos(linkSink, function (err) { - if (err) { // stream was closed - self.destroy() - return callback(err) - } - - header.linkname = linkSink.linkname - self._encode(header) - callback() - }) - - return linkSink - } - - this._encode(header) - - if (header.type !== 'file' && header.type !== 'contiguous-file') { - process.nextTick(callback) - return new Void() - } - - var sink = new Sink(this) - - this._stream = sink - - eos(sink, function (err) { - self._stream = null - - if (err) { // stream was closed - self.destroy() - return callback(err) - } - - if (sink.written !== header.size) { // corrupting tar - self.destroy() - return callback(new Error('size mismatch')) - } - - overflow(self, header.size) - if (self._finalizing) self.finalize() - callback() - }) - - return sink -} - -Pack.prototype.finalize = function () { - if (this._stream) { - this._finalizing = true - return - } - - if (this._finalized) return - this._finalized = true - this.push(END_OF_TAR) - this.push(null) -} - -Pack.prototype.destroy = function (err) { - if (this._destroyed) return - this._destroyed = true - - if (err) this.emit('error', err) - this.emit('close') - if (this._stream && this._stream.destroy) this._stream.destroy() -} - -Pack.prototype._encode = function (header) { - if (!header.pax) { - var buf = headers.encode(header) - if (buf) { - this.push(buf) - return - } - } - this._encodePax(header) -} - -Pack.prototype._encodePax = function (header) { - var paxHeader = headers.encodePax({ - name: header.name, - linkname: header.linkname, - pax: header.pax - }) - - var newHeader = { - name: 'PaxHeader', - mode: header.mode, - uid: header.uid, - gid: header.gid, - size: paxHeader.length, - mtime: header.mtime, - type: 'pax-header', - linkname: header.linkname && 'PaxHeader', - uname: header.uname, - gname: header.gname, - devmajor: header.devmajor, - devminor: header.devminor - } - - this.push(headers.encode(newHeader)) - this.push(paxHeader) - overflow(this, paxHeader.length) - - newHeader.size = header.size - newHeader.type = header.type - this.push(headers.encode(newHeader)) -} - -Pack.prototype._read = function (n) { - var drain = this._drain - this._drain = noop - drain() -} - -module.exports = Pack - - -/***/ }), -/* 660 */ -/***/ (function(module, exports, __webpack_require__) { - -var Stream = __webpack_require__(25) - -// 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 -} - - - -/***/ }), -/* 661 */ -/***/ (function(module, exports, __webpack_require__) { - -/*! - * Tmp - * - * Copyright (c) 2011-2015 KARASZI Istvan - * - * MIT Licensed - */ - -/** - * Module dependencies. - */ -var - fs = __webpack_require__(5), - path = __webpack_require__(0), - crypto = __webpack_require__(8), - tmpDir = __webpack_require__(597), - _c = process.binding('constants'); - - -/** - * The working inner variables. - */ -var - // store the actual TMP directory - _TMP = tmpDir(), - - // the random characters to choose from - RANDOM_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', - - TEMPLATE_PATTERN = /XXXXXX/, - - DEFAULT_TRIES = 3, - - CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR), - - EBADF = _c.EBADF || _c.os.errno.EBADF, - ENOENT = _c.ENOENT || _c.os.errno.ENOENT, - - DIR_MODE = 448 /* 0700 */, - FILE_MODE = 384 /* 0600 */, - - // this will hold the objects need to be removed on exit - _removeObjects = [], - - _gracefulCleanup = false, - _uncaughtException = false; - -/** - * Random name generator based on crypto. - * Adapted from http://blog.tompawlak.org/how-to-generate-random-values-nodejs-javascript - * - * @param {Number} howMany - * @return {String} - * @api private - */ -function _randomChars(howMany) { - var - value = [], - rnd = null; - - // make sure that we do not fail because we ran out of entropy - try { - rnd = crypto.randomBytes(howMany); - } catch (e) { - rnd = crypto.pseudoRandomBytes(howMany); - } - - for (var i = 0; i < howMany; i++) { - value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); - } - - return value.join(''); -} - -/** - * Checks whether the `obj` parameter is defined or not. - * - * @param {Object} obj - * @return {Boolean} - * @api private - */ -function _isUndefined(obj) { - return typeof obj === 'undefined'; -} - -/** - * Parses the function arguments. - * - * This function helps to have optional arguments. - * - * @param {Object} options - * @param {Function} callback - * @api private - */ -function _parseArguments(options, callback) { - if (typeof options == 'function') { - var - tmp = options, - options = callback || {}, - callback = tmp; - } else if (typeof options == 'undefined') { - options = {}; - } - - return [options, callback]; -} - -/** - * Generates a new temporary name. - * - * @param {Object} opts - * @returns {String} - * @api private - */ -function _generateTmpName(opts) { - if (opts.name) { - return path.join(opts.dir || _TMP, opts.name); - } - - // mkstemps like template - if (opts.template) { - return opts.template.replace(TEMPLATE_PATTERN, _randomChars(6)); - } - - // prefix and postfix - var name = [ - opts.prefix || 'tmp-', - process.pid, - _randomChars(12), - opts.postfix || '' - ].join(''); - - return path.join(opts.dir || _TMP, name); -} - -/** - * Gets a temporary file name. - * - * @param {Object} options - * @param {Function} callback - * @api private - */ -function _getTmpName(options, callback) { - var - args = _parseArguments(options, callback), - opts = args[0], - cb = args[1], - tries = opts.tries || DEFAULT_TRIES; - - if (isNaN(tries) || tries < 0) - return cb(new Error('Invalid tries')); - - if (opts.template && !opts.template.match(TEMPLATE_PATTERN)) - return cb(new Error('Invalid template provided')); - - (function _getUniqueName() { - var name = _generateTmpName(opts); - - // check whether the path exists then retry if needed - fs.stat(name, function (err) { - if (!err) { - if (tries-- > 0) return _getUniqueName(); - - return cb(new Error('Could not get a unique tmp filename, max tries reached ' + name)); - } - - cb(null, name); - }); - }()); -} - -/** - * Synchronous version of _getTmpName. - * - * @param {Object} options - * @returns {String} - * @api private - */ -function _getTmpNameSync(options) { - var - args = _parseArguments(options), - opts = args[0], - tries = opts.tries || DEFAULT_TRIES; - - if (isNaN(tries) || tries < 0) - throw new Error('Invalid tries'); - - if (opts.template && !opts.template.match(TEMPLATE_PATTERN)) - throw new Error('Invalid template provided'); - - do { - var name = _generateTmpName(opts); - try { - fs.statSync(name); - } catch (e) { - return name; - } - } while (tries-- > 0); - - throw new Error('Could not get a unique tmp filename, max tries reached'); -} - -/** - * Creates and opens a temporary file. - * - * @param {Object} options - * @param {Function} callback - * @api public - */ -function _createTmpFile(options, callback) { - var - args = _parseArguments(options, callback), - opts = args[0], - cb = args[1]; - - opts.postfix = (_isUndefined(opts.postfix)) ? '.tmp' : opts.postfix; - - // gets a temporary filename - _getTmpName(opts, function _tmpNameCreated(err, name) { - if (err) return cb(err); - - // create and open the file - fs.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err, fd) { - if (err) return cb(err); - - if (opts.discardDescriptor) { - return fs.close(fd, function _discardCallback(err) { - if (err) { - // Low probability, and the file exists, so this could be - // ignored. If it isn't we certainly need to unlink the - // file, and if that fails too its error is more - // important. - try { - fs.unlinkSync(name); - } catch (e) { - err = e; - } - return cb(err); - } - cb(null, name, undefined, _prepareTmpFileRemoveCallback(name, -1, opts)); - }); - } - if (opts.detachDescriptor) { - return cb(null, name, fd, _prepareTmpFileRemoveCallback(name, -1, opts)); - } - cb(null, name, fd, _prepareTmpFileRemoveCallback(name, fd, opts)); - }); - }); -} - -/** - * Synchronous version of _createTmpFile. - * - * @param {Object} options - * @returns {Object} object consists of name, fd and removeCallback - * @api private - */ -function _createTmpFileSync(options) { - var - args = _parseArguments(options), - opts = args[0]; - - opts.postfix = opts.postfix || '.tmp'; - - var name = _getTmpNameSync(opts); - var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); - - return { - name : name, - fd : fd, - removeCallback : _prepareTmpFileRemoveCallback(name, fd, opts) - }; -} - -/** - * Removes files and folders in a directory recursively. - * - * @param {String} root - * @api private - */ -function _rmdirRecursiveSync(root) { - var dirs = [root]; - - do { - var - dir = dirs.pop(), - deferred = false, - files = fs.readdirSync(dir); - - for (var i = 0, length = files.length; i < length; i++) { - var - file = path.join(dir, files[i]), - stat = fs.lstatSync(file); // lstat so we don't recurse into symlinked directories - - if (stat.isDirectory()) { - if (!deferred) { - deferred = true; - dirs.push(dir); - } - dirs.push(file); - } else { - fs.unlinkSync(file); - } - } - - if (!deferred) { - fs.rmdirSync(dir); - } - } while (dirs.length !== 0); -} - -/** - * Creates a temporary directory. - * - * @param {Object} options - * @param {Function} callback - * @api public - */ -function _createTmpDir(options, callback) { - var - args = _parseArguments(options, callback), - opts = args[0], - cb = args[1]; - - // gets a temporary filename - _getTmpName(opts, function _tmpNameCreated(err, name) { - if (err) return cb(err); - - // create the directory - fs.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err) { - if (err) return cb(err); - - cb(null, name, _prepareTmpDirRemoveCallback(name, opts)); - }); - }); -} - -/** - * Synchronous version of _createTmpDir. - * - * @param {Object} options - * @returns {Object} object consists of name and removeCallback - * @api private - */ -function _createTmpDirSync(options) { - var - args = _parseArguments(options), - opts = args[0]; - - var name = _getTmpNameSync(opts); - fs.mkdirSync(name, opts.mode || DIR_MODE); - - return { - name : name, - removeCallback : _prepareTmpDirRemoveCallback(name, opts) - }; -} - -/** - * Prepares the callback for removal of the temporary file. - * - * @param {String} name - * @param {int} fd - * @param {Object} opts - * @api private - * @returns {Function} the callback - */ -function _prepareTmpFileRemoveCallback(name, fd, opts) { - var removeCallback = _prepareRemoveCallback(function _removeCallback(fdPath) { - try { - if (0 <= fdPath[0]) { - fs.closeSync(fdPath[0]); - } - } - catch (e) { - // under some node/windows related circumstances, a temporary file - // may have not be created as expected or the file was already closed - // by the user, in which case we will simply ignore the error - if (e.errno != -EBADF && e.errno != -ENOENT) { - // reraise any unanticipated error - throw e; - } - } - fs.unlinkSync(fdPath[1]); - }, [fd, name]); - - if (!opts.keep) { - _removeObjects.unshift(removeCallback); - } - - return removeCallback; -} - -/** - * Prepares the callback for removal of the temporary directory. - * - * @param {String} name - * @param {Object} opts - * @returns {Function} the callback - * @api private - */ -function _prepareTmpDirRemoveCallback(name, opts) { - var removeFunction = opts.unsafeCleanup ? _rmdirRecursiveSync : fs.rmdirSync.bind(fs); - var removeCallback = _prepareRemoveCallback(removeFunction, name); - - if (!opts.keep) { - _removeObjects.unshift(removeCallback); - } - - return removeCallback; -} - -/** - * Creates a guarded function wrapping the removeFunction call. - * - * @param {Function} removeFunction - * @param {Object} arg - * @returns {Function} - * @api private - */ -function _prepareRemoveCallback(removeFunction, arg) { - var called = false; - - return function _cleanupCallback(next) { - if (!called) { - var index = _removeObjects.indexOf(_cleanupCallback); - if (index >= 0) { - _removeObjects.splice(index, 1); - } - - called = true; - removeFunction(arg); - } - if (next) next(null); - }; -} - -/** - * The garbage collector. - * - * @api private - */ -function _garbageCollector() { - if (_uncaughtException && !_gracefulCleanup) { - return; - } - - // the function being called removes itself from _removeObjects, - // loop until _removeObjects is empty - while (_removeObjects.length) { - try { - _removeObjects[0].call(null); - } catch (e) { - // already removed? - } - } -} - -function _setGracefulCleanup() { - _gracefulCleanup = true; -} - -var version = process.versions.node.split('.').map(function (value) { - return parseInt(value, 10); -}); - -if (version[0] === 0 && (version[1] < 9 || version[1] === 9 && version[2] < 5)) { - process.addListener('uncaughtException', function _uncaughtExceptionThrown(err) { - _uncaughtException = true; - _garbageCollector(); - - throw err; - }); -} - -process.addListener('exit', function _exit(code) { - if (code) _uncaughtException = true; - _garbageCollector(); -}); - -// exporting all the needed methods -module.exports.tmpdir = _TMP; -module.exports.dir = _createTmpDir; -module.exports.dirSync = _createTmpDirSync; -module.exports.file = _createTmpFile; -module.exports.fileSync = _createTmpFileSync; -module.exports.tmpName = _getTmpName; -module.exports.tmpNameSync = _getTmpNameSync; -module.exports.setGracefulCleanup = _setGracefulCleanup; - - -/***/ }), -/* 662 */ +/* 810 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -133887,48 +133311,39 @@ module.exports.setGracefulCleanup = _setGracefulCleanup; * POSSIBILITY OF SUCH DAMAGE. */ -var net = __webpack_require__(59); -var urlParse = __webpack_require__(14).parse; -var pubsuffix = __webpack_require__(329); -var Store = __webpack_require__(330).Store; -var MemoryCookieStore = __webpack_require__(663).MemoryCookieStore; -var pathMatch = __webpack_require__(327).pathMatch; -var VERSION = __webpack_require__(664).version; +var net = __webpack_require__(164); +var urlParse = __webpack_require__(24).parse; +var pubsuffix = __webpack_require__(415); +var Store = __webpack_require__(416).Store; +var MemoryCookieStore = __webpack_require__(811).MemoryCookieStore; +var pathMatch = __webpack_require__(413).pathMatch; +var VERSION = __webpack_require__(812).version; var punycode; try { - punycode = __webpack_require__(230); + punycode = __webpack_require__(332); } catch(e) { console.warn("cookie: can't load punycode; won't use punycode for domain normalization"); } -var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/; - // From RFC6265 S4.1.1 // note that it excludes \x3B ";" -var COOKIE_OCTET = /[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/; -var COOKIE_OCTETS = new RegExp('^'+COOKIE_OCTET.source+'+$'); +var COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/; var CONTROL_CHARS = /[\x00-\x1F]/; -// Double quotes are part of the value (see: S4.1.1). -// '\r', '\n' and '\0' should be treated as a terminator in the "relaxed" mode -// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60) -// '=' and ';' are attribute/values separators -// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L64) -var COOKIE_PAIR = /^(([^=;]+))\s*=\s*([^\n\r\0]*)/; - -// Used to parse non-RFC-compliant cookies like '=abc' when given the `loose` -// option in Cookie.parse: -var LOOSE_COOKIE_PAIR = /^((?:=)?([^=;]*)\s*=\s*)?([^\n\r\0]*)/; +// From Chromium // '\r', '\n' and '\0' should be treated as a terminator in +// the "relaxed" mode, see: +// https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60 +var TERMINATORS = ['\n', '\r', '\0']; // RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"' // Note ';' is \x3B var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/; -var DAY_OF_MONTH = /^(\d{1,2})[^\d]*$/; -var TIME = /^(\d{1,2})[^\d]*:(\d{1,2})[^\d]*:(\d{1,2})[^\d]*$/; -var MONTH = /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/i; +// date-time parsing constants (RFC6265 S5.1.1) + +var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/; var MONTH_TO_NUM = { jan:0, feb:1, mar:2, apr:3, may:4, jun:5, @@ -133941,13 +133356,80 @@ var NUM_TO_DAY = [ 'Sun','Mon','Tue','Wed','Thu','Fri','Sat' ]; -var YEAR = /^(\d{2}|\d{4})$/; // 2 to 4 digits - var MAX_TIME = 2147483647000; // 31-bit max var MIN_TIME = 0; // 31-bit min +/* + * Parses a Natural number (i.e., non-negative integer) with either the + * *DIGIT ( non-digit *OCTET ) + * or + * *DIGIT + * grammar (RFC6265 S5.1.1). + * + * The "trailingOK" boolean controls if the grammar accepts a + * "( non-digit *OCTET )" trailer. + */ +function parseDigits(token, minDigits, maxDigits, trailingOK) { + var count = 0; + while (count < token.length) { + var c = token.charCodeAt(count); + // "non-digit = %x00-2F / %x3A-FF" + if (c <= 0x2F || c >= 0x3A) { + break; + } + count++; + } -// RFC6265 S5.1.1 date parser: + // constrain to a minimum and maximum number of digits. + if (count < minDigits || count > maxDigits) { + return null; + } + + if (!trailingOK && count != token.length) { + return null; + } + + return parseInt(token.substr(0,count), 10); +} + +function parseTime(token) { + var parts = token.split(':'); + var result = [0,0,0]; + + /* RF6256 S5.1.1: + * time = hms-time ( non-digit *OCTET ) + * hms-time = time-field ":" time-field ":" time-field + * time-field = 1*2DIGIT + */ + + if (parts.length !== 3) { + return null; + } + + for (var i = 0; i < 3; i++) { + // "time-field" must be strictly "1*2DIGIT", HOWEVER, "hms-time" can be + // followed by "( non-digit *OCTET )" so therefore the last time-field can + // have a trailer + var trailingOK = (i == 2); + var num = parseDigits(parts[i], 1, 2, trailingOK); + if (num === null) { + return null; + } + result[i] = num; + } + + return result; +} + +function parseMonth(token) { + token = String(token).substr(0,3).toLowerCase(); + var num = MONTH_TO_NUM[token]; + return num >= 0 ? num : null; +} + +/* + * RFC6265 S5.1.1 date parser (see RFC for full grammar) + */ function parseDate(str) { if (!str) { return; @@ -133963,9 +133445,9 @@ function parseDate(str) { } var hour = null; - var minutes = null; - var seconds = null; - var day = null; + var minute = null; + var second = null; + var dayOfMonth = null; var month = null; var year = null; @@ -133983,22 +133465,12 @@ function parseDate(str) { * the date-token, respectively. Skip the remaining sub-steps and continue * to the next date-token. */ - if (seconds === null) { - result = TIME.exec(token); + if (second === null) { + result = parseTime(token); if (result) { - hour = parseInt(result[1], 10); - minutes = parseInt(result[2], 10); - seconds = parseInt(result[3], 10); - /* RFC6265 S5.1.1.5: - * [fail if] - * * the hour-value is greater than 23, - * * the minute-value is greater than 59, or - * * the second-value is greater than 59. - */ - if(hour > 23 || minutes > 59 || seconds > 59) { - return; - } - + hour = result[0]; + minute = result[1]; + second = result[2]; continue; } } @@ -134008,16 +133480,11 @@ function parseDate(str) { * the day-of-month-value to the number denoted by the date-token. Skip * the remaining sub-steps and continue to the next date-token. */ - if (day === null) { - result = DAY_OF_MONTH.exec(token); - if (result) { - day = parseInt(result, 10); - /* RFC6265 S5.1.1.5: - * [fail if] the day-of-month-value is less than 1 or greater than 31 - */ - if(day < 1 || day > 31) { - return; - } + if (dayOfMonth === null) { + // "day-of-month = 1*2DIGIT ( non-digit *OCTET )" + result = parseDigits(token, 1, 2, true); + if (result !== null) { + dayOfMonth = result; continue; } } @@ -134028,47 +133495,63 @@ function parseDate(str) { * continue to the next date-token. */ if (month === null) { - result = MONTH.exec(token); - if (result) { - month = MONTH_TO_NUM[result[1].toLowerCase()]; + result = parseMonth(token); + if (result !== null) { + month = result; continue; } } - /* 2.4. If the found-year flag is not set and the date-token matches the year - * production, set the found-year flag and set the year-value to the number - * denoted by the date-token. Skip the remaining sub-steps and continue to - * the next date-token. + /* 2.4. If the found-year flag is not set and the date-token matches the + * year production, set the found-year flag and set the year-value to the + * number denoted by the date-token. Skip the remaining sub-steps and + * continue to the next date-token. */ if (year === null) { - result = YEAR.exec(token); - if (result) { - year = parseInt(result[0], 10); + // "year = 2*4DIGIT ( non-digit *OCTET )" + result = parseDigits(token, 2, 4, true); + if (result !== null) { + year = result; /* From S5.1.1: * 3. If the year-value is greater than or equal to 70 and less * than or equal to 99, increment the year-value by 1900. * 4. If the year-value is greater than or equal to 0 and less * than or equal to 69, increment the year-value by 2000. */ - if (70 <= year && year <= 99) { + if (year >= 70 && year <= 99) { year += 1900; - } else if (0 <= year && year <= 69) { + } else if (year >= 0 && year <= 69) { year += 2000; } - - if (year < 1601) { - return; // 5. ... the year-value is less than 1601 - } } } } - if (seconds === null || day === null || month === null || year === null) { - return; // 5. ... at least one of the found-day-of-month, found-month, found- - // year, or found-time flags is not set, + /* RFC 6265 S5.1.1 + * "5. Abort these steps and fail to parse the cookie-date if: + * * at least one of the found-day-of-month, found-month, found- + * year, or found-time flags is not set, + * * the day-of-month-value is less than 1 or greater than 31, + * * the year-value is less than 1601, + * * the hour-value is greater than 23, + * * the minute-value is greater than 59, or + * * the second-value is greater than 59. + * (Note that leap seconds cannot be represented in this syntax.)" + * + * So, in order as above: + */ + if ( + dayOfMonth === null || month === null || year === null || second === null || + dayOfMonth < 1 || dayOfMonth > 31 || + year < 1601 || + hour > 23 || + minute > 59 || + second > 59 + ) { + return; } - return new Date(Date.UTC(year, month, day, hour, minutes, seconds)); + return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second)); } function formatDate(date) { @@ -134175,6 +133658,50 @@ function defaultPath(path) { return path.slice(0, rightSlash); } +function trimTerminator(str) { + for (var t = 0; t < TERMINATORS.length; t++) { + var terminatorIdx = str.indexOf(TERMINATORS[t]); + if (terminatorIdx !== -1) { + str = str.substr(0,terminatorIdx); + } + } + + return str; +} + +function parseCookiePair(cookiePair, looseMode) { + cookiePair = trimTerminator(cookiePair); + + var firstEq = cookiePair.indexOf('='); + if (looseMode) { + if (firstEq === 0) { // '=' is immediately at start + cookiePair = cookiePair.substr(1); + firstEq = cookiePair.indexOf('='); // might still need to split on '=' + } + } else { // non-loose mode + if (firstEq <= 0) { // no '=' or is at start + return; // needs to have non-empty "cookie-name" + } + } + + var cookieName, cookieValue; + if (firstEq <= 0) { + cookieName = ""; + cookieValue = cookiePair.trim(); + } else { + cookieName = cookiePair.substr(0, firstEq).trim(); + cookieValue = cookiePair.substr(firstEq+1).trim(); + } + + if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) { + return; + } + + var c = new Cookie(); + c.key = cookieName; + c.value = cookieValue; + return c; +} function parse(str, options) { if (!options || typeof options !== 'object') { @@ -134184,23 +133711,9 @@ function parse(str, options) { // We use a regex to parse the "name-value-pair" part of S5.2 var firstSemi = str.indexOf(';'); // S5.2 step 1 - var pairRe = options.loose ? LOOSE_COOKIE_PAIR : COOKIE_PAIR; - var result = pairRe.exec(firstSemi === -1 ? str : str.substr(0,firstSemi)); - - // Rx satisfies the "the name string is empty" and "lacks a %x3D ("=")" - // constraints as well as trimming any whitespace. - if (!result) { - return; - } - - var c = new Cookie(); - if (result[1]) { - c.key = result[2].trim(); - } else { - c.key = ''; - } - c.value = result[3].trim(); - if (CONTROL_CHARS.test(c.key) || CONTROL_CHARS.test(c.value)) { + var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi); + var c = parseCookiePair(cookiePair, !!options.loose); + if (!c) { return; } @@ -135064,6 +134577,7 @@ CookieJar.prototype._importCookies = function(serialized, cb) { if (!cookies || !Array.isArray(cookies)) { return cb(new Error('serialized jar has no cookies array')); } + cookies = cookies.slice(); // do not modify the original function putNext(err) { if (err) { @@ -135188,14 +134702,14 @@ module.exports = { pathMatch: pathMatch, getPublicSuffix: pubsuffix.getPublicSuffix, cookieCompare: cookieCompare, - permuteDomain: __webpack_require__(328).permuteDomain, + permuteDomain: __webpack_require__(414).permuteDomain, permutePath: permutePath, canonicalDomain: canonicalDomain }; /***/ }), -/* 663 */ +/* 811 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -135230,10 +134744,10 @@ module.exports = { * POSSIBILITY OF SUCH DAMAGE. */ -var Store = __webpack_require__(330).Store; -var permuteDomain = __webpack_require__(328).permuteDomain; -var pathMatch = __webpack_require__(327).pathMatch; -var util = __webpack_require__(2); +var Store = __webpack_require__(416).Store; +var permuteDomain = __webpack_require__(414).permuteDomain; +var pathMatch = __webpack_require__(413).pathMatch; +var util = __webpack_require__(3); function MemoryCookieStore() { Store.call(this); @@ -135372,99 +134886,11091 @@ MemoryCookieStore.prototype.getAllCookies = function(cb) { /***/ }), -/* 664 */ +/* 812 */ /***/ (function(module, exports) { -module.exports = { - "author": { - "name": "Jeremy Stashewsky", - "email": "jstashewsky@salesforce.com", - "website": "https://github.com/stash" - }, - "contributors": [ - { - "name": "Alexander Savin", - "website": "https://github.com/apsavin" - }, - { - "name": "Ian Livingstone", - "website": "https://github.com/ianlivingstone" - }, - { - "name": "Ivan Nikulin", - "website": "https://github.com/inikulin" - }, - { - "name": "Lalit Kapoor", - "website": "https://github.com/lalitkapoor" - }, - { - "name": "Sam Thompson", - "website": "https://github.com/sambthompson" - }, - { - "name": "Sebastian Mayr", - "website": "https://github.com/Sebmaster" - } - ], - "license": "BSD-3-Clause", - "name": "tough-cookie", - "description": "RFC6265 Cookies and Cookie Jar for node.js", - "keywords": [ - "HTTP", - "cookie", - "cookies", - "set-cookie", - "cookiejar", - "jar", - "RFC6265", - "RFC2965" - ], - "version": "2.3.2", - "homepage": "https://github.com/salesforce/tough-cookie", - "repository": { - "type": "git", - "url": "git://github.com/salesforce/tough-cookie.git" - }, - "bugs": { - "url": "https://github.com/salesforce/tough-cookie/issues" - }, - "main": "./lib/cookie", - "files": [ - "lib" - ], - "scripts": { - "suffixup": "curl -o public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat && ./generate-pubsuffix.js", - "test": "vows test/*_test.js" - }, - "engines": { - "node": ">=0.8" - }, - "devDependencies": { - "async": "^1.4.2", - "string.prototype.repeat": "^0.2.0", - "vows": "^0.8.1" - }, - "dependencies": { - "punycode": "^1.4.1" - } -}; +module.exports = {"author":{"name":"Jeremy Stashewsky","email":"jstashewsky@salesforce.com","website":"https://github.com/stash"},"contributors":[{"name":"Alexander Savin","website":"https://github.com/apsavin"},{"name":"Ian Livingstone","website":"https://github.com/ianlivingstone"},{"name":"Ivan Nikulin","website":"https://github.com/inikulin"},{"name":"Lalit Kapoor","website":"https://github.com/lalitkapoor"},{"name":"Sam Thompson","website":"https://github.com/sambthompson"},{"name":"Sebastian Mayr","website":"https://github.com/Sebmaster"}],"license":"BSD-3-Clause","name":"tough-cookie","description":"RFC6265 Cookies and Cookie Jar for node.js","keywords":["HTTP","cookie","cookies","set-cookie","cookiejar","jar","RFC6265","RFC2965"],"version":"2.3.4","homepage":"https://github.com/salesforce/tough-cookie","repository":{"type":"git","url":"git://github.com/salesforce/tough-cookie.git"},"bugs":{"url":"https://github.com/salesforce/tough-cookie/issues"},"main":"./lib/cookie","files":["lib"],"scripts":{"suffixup":"curl -o public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat && ./generate-pubsuffix.js","test":"vows test/*_test.js"},"engines":{"node":">=0.8"},"devDependencies":{"async":"^1.4.2","string.prototype.repeat":"^0.2.0","vows":"^0.8.1"},"dependencies":{"punycode":"^1.4.1"}} /***/ }), -/* 665 */ +/* 813 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var net = __webpack_require__(59) - , tls = __webpack_require__(336) - , http = __webpack_require__(49) - , https = __webpack_require__(151) - , events = __webpack_require__(47) - , assert = __webpack_require__(20) - , util = __webpack_require__(2) - , Buffer = __webpack_require__(88).Buffer +var http = __webpack_require__(87) +var https = __webpack_require__(195) +var url = __webpack_require__(24) +var util = __webpack_require__(3) +var stream = __webpack_require__(23) +var zlib = __webpack_require__(198) +var aws2 = __webpack_require__(521) +var aws4 = __webpack_require__(522) +var httpSignature = __webpack_require__(680) +var mime = __webpack_require__(400) +var caseless = __webpack_require__(231) +var ForeverAgent = __webpack_require__(648) +var FormData = __webpack_require__(649) +var extend = __webpack_require__(269) +var isstream = __webpack_require__(399) +var isTypedArray = __webpack_require__(742).strict +var helpers = __webpack_require__(305) +var cookies = __webpack_require__(412) +var getProxyFromURI = __webpack_require__(802) +var Querystring = __webpack_require__(807).Querystring +var Har = __webpack_require__(803).Har +var Auth = __webpack_require__(801).Auth +var OAuth = __webpack_require__(806).OAuth +var hawk = __webpack_require__(804) +var Multipart = __webpack_require__(805).Multipart +var Redirect = __webpack_require__(808).Redirect +var Tunnel = __webpack_require__(809).Tunnel +var now = __webpack_require__(776) +var Buffer = __webpack_require__(45).Buffer + +var safeStringify = helpers.safeStringify +var isReadStream = helpers.isReadStream +var toBase64 = helpers.toBase64 +var defer = helpers.defer +var copy = helpers.copy +var version = helpers.version +var globalCookieJar = cookies.jar() + +var globalPool = {} + +function filterForNonReserved (reserved, options) { + // Filter out properties that are not reserved. + // Reserved values are passed in at call site. + + var object = {} + for (var i in options) { + var notReserved = (reserved.indexOf(i) === -1) + if (notReserved) { + object[i] = options[i] + } + } + return object +} + +function filterOutReservedFunctions (reserved, options) { + // Filter out properties that are functions and are reserved. + // Reserved values are passed in at call site. + + var object = {} + for (var i in options) { + var isReserved = !(reserved.indexOf(i) === -1) + var isFunction = (typeof options[i] === 'function') + if (!(isReserved && isFunction)) { + object[i] = options[i] + } + } + return object +} + +// Return a simpler request object to allow serialization +function requestToJSON () { + var self = this + return { + uri: self.uri, + method: self.method, + headers: self.headers + } +} + +// Return a simpler response object to allow serialization +function responseToJSON () { + var self = this + return { + statusCode: self.statusCode, + body: self.body, + headers: self.headers, + request: requestToJSON.call(self.request) + } +} + +function Request (options) { + // if given the method property in options, set property explicitMethod to true + + // extend the Request instance with any non-reserved properties + // remove any reserved functions from the options object + // set Request instance to be readable and writable + // call init + + var self = this + + // start with HAR, then override with additional options + if (options.har) { + self._har = new Har(self) + options = self._har.options(options) + } + + stream.Stream.call(self) + var reserved = Object.keys(Request.prototype) + var nonReserved = filterForNonReserved(reserved, options) + + extend(self, nonReserved) + options = filterOutReservedFunctions(reserved, options) + + self.readable = true + self.writable = true + if (options.method) { + self.explicitMethod = true + } + self._qs = new Querystring(self) + self._auth = new Auth(self) + self._oauth = new OAuth(self) + self._multipart = new Multipart(self) + self._redirect = new Redirect(self) + self._tunnel = new Tunnel(self) + self.init(options) +} + +util.inherits(Request, stream.Stream) + +// Debugging +Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG) +function debug () { + if (Request.debug) { + console.error('REQUEST %s', util.format.apply(util, arguments)) + } +} +Request.prototype.debug = debug + +Request.prototype.init = function (options) { + // init() contains all the code to setup the request object. + // the actual outgoing request is not started until start() is called + // this function is called from both the constructor and on redirect. + var self = this + if (!options) { + options = {} + } + self.headers = self.headers ? copy(self.headers) : {} + + // Delete headers with value undefined since they break + // ClientRequest.OutgoingMessage.setHeader in node 0.12 + for (var headerName in self.headers) { + if (typeof self.headers[headerName] === 'undefined') { + delete self.headers[headerName] + } + } + + caseless.httpify(self, self.headers) + + if (!self.method) { + self.method = options.method || 'GET' + } + if (!self.localAddress) { + self.localAddress = options.localAddress + } + + self._qs.init(options) + + debug(options) + if (!self.pool && self.pool !== false) { + self.pool = globalPool + } + self.dests = self.dests || [] + self.__isRequestRequest = true + + // Protect against double callback + if (!self._callback && self.callback) { + self._callback = self.callback + self.callback = function () { + if (self._callbackCalled) { + return // Print a warning maybe? + } + self._callbackCalled = true + self._callback.apply(self, arguments) + } + self.on('error', self.callback.bind()) + self.on('complete', self.callback.bind(self, null)) + } + + // People use this property instead all the time, so support it + if (!self.uri && self.url) { + self.uri = self.url + delete self.url + } + + // If there's a baseUrl, then use it as the base URL (i.e. uri must be + // specified as a relative path and is appended to baseUrl). + if (self.baseUrl) { + if (typeof self.baseUrl !== 'string') { + return self.emit('error', new Error('options.baseUrl must be a string')) + } + + if (typeof self.uri !== 'string') { + return self.emit('error', new Error('options.uri must be a string when using options.baseUrl')) + } + + if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) { + return self.emit('error', new Error('options.uri must be a path when using options.baseUrl')) + } + + // Handle all cases to make sure that there's only one slash between + // baseUrl and uri. + var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1 + var uriStartsWithSlash = self.uri.indexOf('/') === 0 + + if (baseUrlEndsWithSlash && uriStartsWithSlash) { + self.uri = self.baseUrl + self.uri.slice(1) + } else if (baseUrlEndsWithSlash || uriStartsWithSlash) { + self.uri = self.baseUrl + self.uri + } else if (self.uri === '') { + self.uri = self.baseUrl + } else { + self.uri = self.baseUrl + '/' + self.uri + } + delete self.baseUrl + } + + // A URI is needed by this point, emit error if we haven't been able to get one + if (!self.uri) { + return self.emit('error', new Error('options.uri is a required argument')) + } + + // If a string URI/URL was given, parse it into a URL object + if (typeof self.uri === 'string') { + self.uri = url.parse(self.uri) + } + + // Some URL objects are not from a URL parsed string and need href added + if (!self.uri.href) { + self.uri.href = url.format(self.uri) + } + + // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme + if (self.uri.protocol === 'unix:') { + return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`')) + } + + // Support Unix Sockets + if (self.uri.host === 'unix') { + self.enableUnixSocket() + } + + if (self.strictSSL === false) { + self.rejectUnauthorized = false + } + + if (!self.uri.pathname) { self.uri.pathname = '/' } + + if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) { + // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar + // Detect and reject it as soon as possible + var faultyUri = url.format(self.uri) + var message = 'Invalid URI "' + faultyUri + '"' + if (Object.keys(options).length === 0) { + // No option ? This can be the sign of a redirect + // As this is a case where the user cannot do anything (they didn't call request directly with this URL) + // they should be warned that it can be caused by a redirection (can save some hair) + message += '. This can be caused by a crappy redirection.' + } + // This error was fatal + self.abort() + return self.emit('error', new Error(message)) + } + + if (!self.hasOwnProperty('proxy')) { + self.proxy = getProxyFromURI(self.uri) + } + + self.tunnel = self._tunnel.isEnabled() + if (self.proxy) { + self._tunnel.setup(options) + } + + self._redirect.onRequest(options) + + self.setHost = false + if (!self.hasHeader('host')) { + var hostHeaderName = self.originalHostHeaderName || 'host' + // When used with an IPv6 address, `host` will provide + // the correct bracketed format, unlike using `hostname` and + // optionally adding the `port` when necessary. + self.setHeader(hostHeaderName, self.uri.host) + self.setHost = true + } + + self.jar(self._jar || options.jar) + + if (!self.uri.port) { + if (self.uri.protocol === 'http:') { self.uri.port = 80 } else if (self.uri.protocol === 'https:') { self.uri.port = 443 } + } + + if (self.proxy && !self.tunnel) { + self.port = self.proxy.port + self.host = self.proxy.hostname + } else { + self.port = self.uri.port + self.host = self.uri.hostname + } + + if (options.form) { + self.form(options.form) + } + + if (options.formData) { + var formData = options.formData + var requestForm = self.form() + var appendFormValue = function (key, value) { + if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) { + requestForm.append(key, value.value, value.options) + } else { + requestForm.append(key, value) + } + } + for (var formKey in formData) { + if (formData.hasOwnProperty(formKey)) { + var formValue = formData[formKey] + if (formValue instanceof Array) { + for (var j = 0; j < formValue.length; j++) { + appendFormValue(formKey, formValue[j]) + } + } else { + appendFormValue(formKey, formValue) + } + } + } + } + + if (options.qs) { + self.qs(options.qs) + } + + if (self.uri.path) { + self.path = self.uri.path + } else { + self.path = self.uri.pathname + (self.uri.search || '') + } + + if (self.path.length === 0) { + self.path = '/' + } + + // Auth must happen last in case signing is dependent on other headers + if (options.aws) { + self.aws(options.aws) + } + + if (options.hawk) { + self.hawk(options.hawk) + } + + if (options.httpSignature) { + self.httpSignature(options.httpSignature) + } + + if (options.auth) { + if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) { + options.auth.user = options.auth.username + } + if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) { + options.auth.pass = options.auth.password + } + + self.auth( + options.auth.user, + options.auth.pass, + options.auth.sendImmediately, + options.auth.bearer + ) + } + + if (self.gzip && !self.hasHeader('accept-encoding')) { + self.setHeader('accept-encoding', 'gzip, deflate') + } + + if (self.uri.auth && !self.hasHeader('authorization')) { + var uriAuthPieces = self.uri.auth.split(':').map(function (item) { return self._qs.unescape(item) }) + self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true) + } + + if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) { + var proxyAuthPieces = self.proxy.auth.split(':').map(function (item) { return self._qs.unescape(item) }) + var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':')) + self.setHeader('proxy-authorization', authHeader) + } + + if (self.proxy && !self.tunnel) { + self.path = (self.uri.protocol + '//' + self.uri.host + self.path) + } + + if (options.json) { + self.json(options.json) + } + if (options.multipart) { + self.multipart(options.multipart) + } + + if (options.time) { + self.timing = true + + // NOTE: elapsedTime is deprecated in favor of .timings + self.elapsedTime = self.elapsedTime || 0 + } + + function setContentLength () { + if (isTypedArray(self.body)) { + self.body = Buffer.from(self.body) + } + + if (!self.hasHeader('content-length')) { + var length + if (typeof self.body === 'string') { + length = Buffer.byteLength(self.body) + } else if (Array.isArray(self.body)) { + length = self.body.reduce(function (a, b) { return a + b.length }, 0) + } else { + length = self.body.length + } + + if (length) { + self.setHeader('content-length', length) + } else { + self.emit('error', new Error('Argument error, options.body.')) + } + } + } + if (self.body && !isstream(self.body)) { + setContentLength() + } + + if (options.oauth) { + self.oauth(options.oauth) + } else if (self._oauth.params && self.hasHeader('authorization')) { + self.oauth(self._oauth.params) + } + + var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol + var defaultModules = {'http:': http, 'https:': https} + var httpModules = self.httpModules || {} + + self.httpModule = httpModules[protocol] || defaultModules[protocol] + + if (!self.httpModule) { + return self.emit('error', new Error('Invalid protocol: ' + protocol)) + } + + if (options.ca) { + self.ca = options.ca + } + + if (!self.agent) { + if (options.agentOptions) { + self.agentOptions = options.agentOptions + } + + if (options.agentClass) { + self.agentClass = options.agentClass + } else if (options.forever) { + var v = version() + // use ForeverAgent in node 0.10- only + if (v.major === 0 && v.minor <= 10) { + self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL + } else { + self.agentClass = self.httpModule.Agent + self.agentOptions = self.agentOptions || {} + self.agentOptions.keepAlive = true + } + } else { + self.agentClass = self.httpModule.Agent + } + } + + if (self.pool === false) { + self.agent = false + } else { + self.agent = self.agent || self.getNewAgent() + } + + self.on('pipe', function (src) { + if (self.ntick && self._started) { + self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.')) + } + self.src = src + if (isReadStream(src)) { + if (!self.hasHeader('content-type')) { + self.setHeader('content-type', mime.lookup(src.path)) + } + } else { + if (src.headers) { + for (var i in src.headers) { + if (!self.hasHeader(i)) { + self.setHeader(i, src.headers[i]) + } + } + } + if (self._json && !self.hasHeader('content-type')) { + self.setHeader('content-type', 'application/json') + } + if (src.method && !self.explicitMethod) { + self.method = src.method + } + } + + // self.on('pipe', function () { + // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.') + // }) + }) + + defer(function () { + if (self._aborted) { + return + } + + var end = function () { + if (self._form) { + if (!self._auth.hasAuth) { + self._form.pipe(self) + } else if (self._auth.hasAuth && self._auth.sentAuth) { + self._form.pipe(self) + } + } + if (self._multipart && self._multipart.chunked) { + self._multipart.body.pipe(self) + } + if (self.body) { + if (isstream(self.body)) { + self.body.pipe(self) + } else { + setContentLength() + if (Array.isArray(self.body)) { + self.body.forEach(function (part) { + self.write(part) + }) + } else { + self.write(self.body) + } + self.end() + } + } else if (self.requestBodyStream) { + console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.') + self.requestBodyStream.pipe(self) + } else if (!self.src) { + if (self._auth.hasAuth && !self._auth.sentAuth) { + self.end() + return + } + if (self.method !== 'GET' && typeof self.method !== 'undefined') { + self.setHeader('content-length', 0) + } + self.end() + } + } + + if (self._form && !self.hasHeader('content-length')) { + // Before ending the request, we had to compute the length of the whole form, asyncly + self.setHeader(self._form.getHeaders(), true) + self._form.getLength(function (err, length) { + if (!err && !isNaN(length)) { + self.setHeader('content-length', length) + } + end() + }) + } else { + end() + } + + self.ntick = true + }) +} + +Request.prototype.getNewAgent = function () { + var self = this + var Agent = self.agentClass + var options = {} + if (self.agentOptions) { + for (var i in self.agentOptions) { + options[i] = self.agentOptions[i] + } + } + if (self.ca) { + options.ca = self.ca + } + if (self.ciphers) { + options.ciphers = self.ciphers + } + if (self.secureProtocol) { + options.secureProtocol = self.secureProtocol + } + if (self.secureOptions) { + options.secureOptions = self.secureOptions + } + if (typeof self.rejectUnauthorized !== 'undefined') { + options.rejectUnauthorized = self.rejectUnauthorized + } + + if (self.cert && self.key) { + options.key = self.key + options.cert = self.cert + } + + if (self.pfx) { + options.pfx = self.pfx + } + + if (self.passphrase) { + options.passphrase = self.passphrase + } + + var poolKey = '' + + // different types of agents are in different pools + if (Agent !== self.httpModule.Agent) { + poolKey += Agent.name + } + + // ca option is only relevant if proxy or destination are https + var proxy = self.proxy + if (typeof proxy === 'string') { + proxy = url.parse(proxy) + } + var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:' + + if (isHttps) { + if (options.ca) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.ca + } + + if (typeof options.rejectUnauthorized !== 'undefined') { + if (poolKey) { + poolKey += ':' + } + poolKey += options.rejectUnauthorized + } + + if (options.cert) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.cert.toString('ascii') + options.key.toString('ascii') + } + + if (options.pfx) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.pfx.toString('ascii') + } + + if (options.ciphers) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.ciphers + } + + if (options.secureProtocol) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.secureProtocol + } + + if (options.secureOptions) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.secureOptions + } + } + + if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) { + // not doing anything special. Use the globalAgent + return self.httpModule.globalAgent + } + + // we're using a stored agent. Make sure it's protocol-specific + poolKey = self.uri.protocol + poolKey + + // generate a new agent for this setting if none yet exists + if (!self.pool[poolKey]) { + self.pool[poolKey] = new Agent(options) + // properly set maxSockets on new agents + if (self.pool.maxSockets) { + self.pool[poolKey].maxSockets = self.pool.maxSockets + } + } + + return self.pool[poolKey] +} + +Request.prototype.start = function () { + // start() is called once we are ready to send the outgoing HTTP request. + // this is usually called on the first write(), end() or on nextTick() + var self = this + + if (self.timing) { + // All timings will be relative to this request's startTime. In order to do this, + // we need to capture the wall-clock start time (via Date), immediately followed + // by the high-resolution timer (via now()). While these two won't be set + // at the _exact_ same time, they should be close enough to be able to calculate + // high-resolution, monotonically non-decreasing timestamps relative to startTime. + var startTime = new Date().getTime() + var startTimeNow = now() + } + + if (self._aborted) { + return + } + + self._started = true + self.method = self.method || 'GET' + self.href = self.uri.href + + if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) { + self.setHeader('content-length', self.src.stat.size) + } + if (self._aws) { + self.aws(self._aws, true) + } + + // We have a method named auth, which is completely different from the http.request + // auth option. If we don't remove it, we're gonna have a bad time. + var reqOptions = copy(self) + delete reqOptions.auth + + debug('make request', self.uri.href) + + // node v6.8.0 now supports a `timeout` value in `http.request()`, but we + // should delete it for now since we handle timeouts manually for better + // consistency with node versions before v6.8.0 + delete reqOptions.timeout + + try { + self.req = self.httpModule.request(reqOptions) + } catch (err) { + self.emit('error', err) + return + } + + if (self.timing) { + self.startTime = startTime + self.startTimeNow = startTimeNow + + // Timing values will all be relative to startTime (by comparing to startTimeNow + // so we have an accurate clock) + self.timings = {} + } + + var timeout + if (self.timeout && !self.timeoutTimer) { + if (self.timeout < 0) { + timeout = 0 + } else if (typeof self.timeout === 'number' && isFinite(self.timeout)) { + timeout = self.timeout + } + } + + self.req.on('response', self.onRequestResponse.bind(self)) + self.req.on('error', self.onRequestError.bind(self)) + self.req.on('drain', function () { + self.emit('drain') + }) + + self.req.on('socket', function (socket) { + // `._connecting` was the old property which was made public in node v6.1.0 + var isConnecting = socket._connecting || socket.connecting + if (self.timing) { + self.timings.socket = now() - self.startTimeNow + + if (isConnecting) { + var onLookupTiming = function () { + self.timings.lookup = now() - self.startTimeNow + } + + var onConnectTiming = function () { + self.timings.connect = now() - self.startTimeNow + } + + socket.once('lookup', onLookupTiming) + socket.once('connect', onConnectTiming) + + // clean up timing event listeners if needed on error + self.req.once('error', function () { + socket.removeListener('lookup', onLookupTiming) + socket.removeListener('connect', onConnectTiming) + }) + } + } + + var setReqTimeout = function () { + // This timeout sets the amount of time to wait *between* bytes sent + // from the server once connected. + // + // In particular, it's useful for erroring if the server fails to send + // data halfway through streaming a response. + self.req.setTimeout(timeout, function () { + if (self.req) { + self.abort() + var e = new Error('ESOCKETTIMEDOUT') + e.code = 'ESOCKETTIMEDOUT' + e.connect = false + self.emit('error', e) + } + }) + } + if (timeout !== undefined) { + // Only start the connection timer if we're actually connecting a new + // socket, otherwise if we're already connected (because this is a + // keep-alive connection) do not bother. This is important since we won't + // get a 'connect' event for an already connected socket. + if (isConnecting) { + var onReqSockConnect = function () { + socket.removeListener('connect', onReqSockConnect) + clearTimeout(self.timeoutTimer) + self.timeoutTimer = null + setReqTimeout() + } + + socket.on('connect', onReqSockConnect) + + self.req.on('error', function (err) { // eslint-disable-line handle-callback-err + socket.removeListener('connect', onReqSockConnect) + }) + + // Set a timeout in memory - this block will throw if the server takes more + // than `timeout` to write the HTTP status and headers (corresponding to + // the on('response') event on the client). NB: this measures wall-clock + // time, not the time between bytes sent by the server. + self.timeoutTimer = setTimeout(function () { + socket.removeListener('connect', onReqSockConnect) + self.abort() + var e = new Error('ETIMEDOUT') + e.code = 'ETIMEDOUT' + e.connect = true + self.emit('error', e) + }, timeout) + } else { + // We're already connected + setReqTimeout() + } + } + self.emit('socket', socket) + }) + + self.emit('request', self.req) +} + +Request.prototype.onRequestError = function (error) { + var self = this + if (self._aborted) { + return + } + if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' && + self.agent.addRequestNoreuse) { + self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } + self.start() + self.req.end() + return + } + if (self.timeout && self.timeoutTimer) { + clearTimeout(self.timeoutTimer) + self.timeoutTimer = null + } + self.emit('error', error) +} + +Request.prototype.onRequestResponse = function (response) { + var self = this + + if (self.timing) { + self.timings.response = now() - self.startTimeNow + } + + debug('onRequestResponse', self.uri.href, response.statusCode, response.headers) + response.on('end', function () { + if (self.timing) { + self.timings.end = now() - self.startTimeNow + response.timingStart = self.startTime + + // fill in the blanks for any periods that didn't trigger, such as + // no lookup or connect due to keep alive + if (!self.timings.socket) { + self.timings.socket = 0 + } + if (!self.timings.lookup) { + self.timings.lookup = self.timings.socket + } + if (!self.timings.connect) { + self.timings.connect = self.timings.lookup + } + if (!self.timings.response) { + self.timings.response = self.timings.connect + } + + debug('elapsed time', self.timings.end) + + // elapsedTime includes all redirects + self.elapsedTime += Math.round(self.timings.end) + + // NOTE: elapsedTime is deprecated in favor of .timings + response.elapsedTime = self.elapsedTime + + // timings is just for the final fetch + response.timings = self.timings + + // pre-calculate phase timings as well + response.timingPhases = { + wait: self.timings.socket, + dns: self.timings.lookup - self.timings.socket, + tcp: self.timings.connect - self.timings.lookup, + firstByte: self.timings.response - self.timings.connect, + download: self.timings.end - self.timings.response, + total: self.timings.end + } + } + debug('response end', self.uri.href, response.statusCode, response.headers) + }) + + if (self._aborted) { + debug('aborted', self.uri.href) + response.resume() + return + } + + self.response = response + response.request = self + response.toJSON = responseToJSON + + // XXX This is different on 0.10, because SSL is strict by default + if (self.httpModule === https && + self.strictSSL && (!response.hasOwnProperty('socket') || + !response.socket.authorized)) { + debug('strict ssl error', self.uri.href) + var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL' + self.emit('error', new Error('SSL Error: ' + sslErr)) + return + } + + // Save the original host before any redirect (if it changes, we need to + // remove any authorization headers). Also remember the case of the header + // name because lots of broken servers expect Host instead of host and we + // want the caller to be able to specify this. + self.originalHost = self.getHeader('host') + if (!self.originalHostHeaderName) { + self.originalHostHeaderName = self.hasHeader('host') + } + if (self.setHost) { + self.removeHeader('host') + } + if (self.timeout && self.timeoutTimer) { + clearTimeout(self.timeoutTimer) + self.timeoutTimer = null + } + + var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar + var addCookie = function (cookie) { + // set the cookie if it's domain in the href's domain. + try { + targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true}) + } catch (e) { + self.emit('error', e) + } + } + + response.caseless = caseless(response.headers) + + if (response.caseless.has('set-cookie') && (!self._disableCookies)) { + var headerName = response.caseless.has('set-cookie') + if (Array.isArray(response.headers[headerName])) { + response.headers[headerName].forEach(addCookie) + } else { + addCookie(response.headers[headerName]) + } + } + + if (self._redirect.onResponse(response)) { + return // Ignore the rest of the response + } else { + // Be a good stream and emit end when the response is finished. + // Hack to emit end on close because of a core bug that never fires end + response.on('close', function () { + if (!self._ended) { + self.response.emit('end') + } + }) + + response.once('end', function () { + self._ended = true + }) + + var noBody = function (code) { + return ( + self.method === 'HEAD' || + // Informational + (code >= 100 && code < 200) || + // No Content + code === 204 || + // Not Modified + code === 304 + ) + } + + var responseContent + if (self.gzip && !noBody(response.statusCode)) { + var contentEncoding = response.headers['content-encoding'] || 'identity' + contentEncoding = contentEncoding.trim().toLowerCase() + + // Be more lenient with decoding compressed responses, since (very rarely) + // servers send slightly invalid gzip responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + var zlibOptions = { + flush: zlib.Z_SYNC_FLUSH, + finishFlush: zlib.Z_SYNC_FLUSH + } + + if (contentEncoding === 'gzip') { + responseContent = zlib.createGunzip(zlibOptions) + response.pipe(responseContent) + } else if (contentEncoding === 'deflate') { + responseContent = zlib.createInflate(zlibOptions) + response.pipe(responseContent) + } else { + // Since previous versions didn't check for Content-Encoding header, + // ignore any invalid values to preserve backwards-compatibility + if (contentEncoding !== 'identity') { + debug('ignoring unrecognized Content-Encoding ' + contentEncoding) + } + responseContent = response + } + } else { + responseContent = response + } + + if (self.encoding) { + if (self.dests.length !== 0) { + console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.') + } else { + responseContent.setEncoding(self.encoding) + } + } + + if (self._paused) { + responseContent.pause() + } + + self.responseContent = responseContent + + self.emit('response', response) + + self.dests.forEach(function (dest) { + self.pipeDest(dest) + }) + + responseContent.on('data', function (chunk) { + if (self.timing && !self.responseStarted) { + self.responseStartTime = (new Date()).getTime() + + // NOTE: responseStartTime is deprecated in favor of .timings + response.responseStartTime = self.responseStartTime + } + self._destdata = true + self.emit('data', chunk) + }) + responseContent.once('end', function (chunk) { + self.emit('end', chunk) + }) + responseContent.on('error', function (error) { + self.emit('error', error) + }) + responseContent.on('close', function () { self.emit('close') }) + + if (self.callback) { + self.readResponseBody(response) + } else { // if no callback + self.on('end', function () { + if (self._aborted) { + debug('aborted', self.uri.href) + return + } + self.emit('complete', response) + }) + } + } + debug('finish init function', self.uri.href) +} + +Request.prototype.readResponseBody = function (response) { + var self = this + debug("reading response's body") + var buffers = [] + var bufferLength = 0 + var strings = [] + + self.on('data', function (chunk) { + if (!Buffer.isBuffer(chunk)) { + strings.push(chunk) + } else if (chunk.length) { + bufferLength += chunk.length + buffers.push(chunk) + } + }) + self.on('end', function () { + debug('end event', self.uri.href) + if (self._aborted) { + debug('aborted', self.uri.href) + // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request. + // This can lead to leaky behavior if the user retains a reference to the request object. + buffers = [] + bufferLength = 0 + return + } + + if (bufferLength) { + debug('has body', self.uri.href, bufferLength) + response.body = Buffer.concat(buffers, bufferLength) + if (self.encoding !== null) { + response.body = response.body.toString(self.encoding) + } + // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request. + // This can lead to leaky behavior if the user retains a reference to the request object. + buffers = [] + bufferLength = 0 + } else if (strings.length) { + // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. + // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). + if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') { + strings[0] = strings[0].substring(1) + } + response.body = strings.join('') + } + + if (self._json) { + try { + response.body = JSON.parse(response.body, self._jsonReviver) + } catch (e) { + debug('invalid JSON received', self.uri.href) + } + } + debug('emitting complete', self.uri.href) + if (typeof response.body === 'undefined' && !self._json) { + response.body = self.encoding === null ? Buffer.alloc(0) : '' + } + self.emit('complete', response, response.body) + }) +} + +Request.prototype.abort = function () { + var self = this + self._aborted = true + + if (self.req) { + self.req.abort() + } else if (self.response) { + self.response.destroy() + } + + self.emit('abort') +} + +Request.prototype.pipeDest = function (dest) { + var self = this + var response = self.response + // Called after the response is received + if (dest.headers && !dest.headersSent) { + if (response.caseless.has('content-type')) { + var ctname = response.caseless.has('content-type') + if (dest.setHeader) { + dest.setHeader(ctname, response.headers[ctname]) + } else { + dest.headers[ctname] = response.headers[ctname] + } + } + + if (response.caseless.has('content-length')) { + var clname = response.caseless.has('content-length') + if (dest.setHeader) { + dest.setHeader(clname, response.headers[clname]) + } else { + dest.headers[clname] = response.headers[clname] + } + } + } + if (dest.setHeader && !dest.headersSent) { + for (var i in response.headers) { + // If the response content is being decoded, the Content-Encoding header + // of the response doesn't represent the piped content, so don't pass it. + if (!self.gzip || i !== 'content-encoding') { + dest.setHeader(i, response.headers[i]) + } + } + dest.statusCode = response.statusCode + } + if (self.pipefilter) { + self.pipefilter(response, dest) + } +} + +Request.prototype.qs = function (q, clobber) { + var self = this + var base + if (!clobber && self.uri.query) { + base = self._qs.parse(self.uri.query) + } else { + base = {} + } + + for (var i in q) { + base[i] = q[i] + } + + var qs = self._qs.stringify(base) + + if (qs === '') { + return self + } + + self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs) + self.url = self.uri + self.path = self.uri.path + + if (self.uri.host === 'unix') { + self.enableUnixSocket() + } + + return self +} +Request.prototype.form = function (form) { + var self = this + if (form) { + if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { + self.setHeader('content-type', 'application/x-www-form-urlencoded') + } + self.body = (typeof form === 'string') + ? self._qs.rfc3986(form.toString('utf8')) + : self._qs.stringify(form).toString('utf8') + return self + } + // create form-data object + self._form = new FormData() + self._form.on('error', function (err) { + err.message = 'form-data: ' + err.message + self.emit('error', err) + self.abort() + }) + return self._form +} +Request.prototype.multipart = function (multipart) { + var self = this + + self._multipart.onRequest(multipart) + + if (!self._multipart.chunked) { + self.body = self._multipart.body + } + + return self +} +Request.prototype.json = function (val) { + var self = this + + if (!self.hasHeader('accept')) { + self.setHeader('accept', 'application/json') + } + + if (typeof self.jsonReplacer === 'function') { + self._jsonReplacer = self.jsonReplacer + } + + self._json = true + if (typeof val === 'boolean') { + if (self.body !== undefined) { + if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { + self.body = safeStringify(self.body, self._jsonReplacer) + } else { + self.body = self._qs.rfc3986(self.body) + } + if (!self.hasHeader('content-type')) { + self.setHeader('content-type', 'application/json') + } + } + } else { + self.body = safeStringify(val, self._jsonReplacer) + if (!self.hasHeader('content-type')) { + self.setHeader('content-type', 'application/json') + } + } + + if (typeof self.jsonReviver === 'function') { + self._jsonReviver = self.jsonReviver + } + + return self +} +Request.prototype.getHeader = function (name, headers) { + var self = this + var result, re, match + if (!headers) { + headers = self.headers + } + Object.keys(headers).forEach(function (key) { + if (key.length !== name.length) { + return + } + re = new RegExp(name, 'i') + match = key.match(re) + if (match) { + result = headers[key] + } + }) + return result +} +Request.prototype.enableUnixSocket = function () { + // Get the socket & request paths from the URL + var unixParts = this.uri.path.split(':') + var host = unixParts[0] + var path = unixParts[1] + // Apply unix properties to request + this.socketPath = host + this.uri.pathname = path + this.uri.path = path + this.uri.host = host + this.uri.hostname = host + this.uri.isUnix = true +} + +Request.prototype.auth = function (user, pass, sendImmediately, bearer) { + var self = this + + self._auth.onRequest(user, pass, sendImmediately, bearer) + + return self +} +Request.prototype.aws = function (opts, now) { + var self = this + + if (!now) { + self._aws = opts + return self + } + + if (opts.sign_version === 4 || opts.sign_version === '4') { + // use aws4 + var options = { + host: self.uri.host, + path: self.uri.path, + method: self.method, + headers: { + 'content-type': self.getHeader('content-type') || '' + }, + body: self.body + } + var signRes = aws4.sign(options, { + accessKeyId: opts.key, + secretAccessKey: opts.secret, + sessionToken: opts.session + }) + self.setHeader('authorization', signRes.headers.Authorization) + self.setHeader('x-amz-date', signRes.headers['X-Amz-Date']) + if (signRes.headers['X-Amz-Security-Token']) { + self.setHeader('x-amz-security-token', signRes.headers['X-Amz-Security-Token']) + } + } else { + // default: use aws-sign2 + var date = new Date() + self.setHeader('date', date.toUTCString()) + var auth = { + key: opts.key, + secret: opts.secret, + verb: self.method.toUpperCase(), + date: date, + contentType: self.getHeader('content-type') || '', + md5: self.getHeader('content-md5') || '', + amazonHeaders: aws2.canonicalizeHeaders(self.headers) + } + var path = self.uri.path + if (opts.bucket && path) { + auth.resource = '/' + opts.bucket + path + } else if (opts.bucket && !path) { + auth.resource = '/' + opts.bucket + } else if (!opts.bucket && path) { + auth.resource = path + } else if (!opts.bucket && !path) { + auth.resource = '/' + } + auth.resource = aws2.canonicalizeResource(auth.resource) + self.setHeader('authorization', aws2.authorization(auth)) + } + + return self +} +Request.prototype.httpSignature = function (opts) { + var self = this + httpSignature.signRequest({ + getHeader: function (header) { + return self.getHeader(header, self.headers) + }, + setHeader: function (header, value) { + self.setHeader(header, value) + }, + method: self.method, + path: self.path + }, opts) + debug('httpSignature authorization', self.getHeader('authorization')) + + return self +} +Request.prototype.hawk = function (opts) { + var self = this + self.setHeader('Authorization', hawk.header(self.uri, self.method, opts)) +} +Request.prototype.oauth = function (_oauth) { + var self = this + + self._oauth.onRequest(_oauth) + + return self +} + +Request.prototype.jar = function (jar) { + var self = this + var cookies + + if (self._redirect.redirectsFollowed === 0) { + self.originalCookieHeader = self.getHeader('cookie') + } + + if (!jar) { + // disable cookies + cookies = false + self._disableCookies = true + } else { + var targetCookieJar = (jar && jar.getCookieString) ? jar : globalCookieJar + var urihref = self.uri.href + // fetch cookie in the Specified host + if (targetCookieJar) { + cookies = targetCookieJar.getCookieString(urihref) + } + } + + // if need cookie and cookie is not empty + if (cookies && cookies.length) { + if (self.originalCookieHeader) { + // Don't overwrite existing Cookie header + self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies) + } else { + self.setHeader('cookie', cookies) + } + } + self._jar = jar + return self +} + +// Stream API +Request.prototype.pipe = function (dest, opts) { + var self = this + + if (self.response) { + if (self._destdata) { + self.emit('error', new Error('You cannot pipe after data has been emitted from the response.')) + } else if (self._ended) { + self.emit('error', new Error('You cannot pipe after the response has been ended.')) + } else { + stream.Stream.prototype.pipe.call(self, dest, opts) + self.pipeDest(dest) + return dest + } + } else { + self.dests.push(dest) + stream.Stream.prototype.pipe.call(self, dest, opts) + return dest + } +} +Request.prototype.write = function () { + var self = this + if (self._aborted) { return } + + if (!self._started) { + self.start() + } + if (self.req) { + return self.req.write.apply(self.req, arguments) + } +} +Request.prototype.end = function (chunk) { + var self = this + if (self._aborted) { return } + + if (chunk) { + self.write(chunk) + } + if (!self._started) { + self.start() + } + if (self.req) { + self.req.end() + } +} +Request.prototype.pause = function () { + var self = this + if (!self.responseContent) { + self._paused = true + } else { + self.responseContent.pause.apply(self.responseContent, arguments) + } +} +Request.prototype.resume = function () { + var self = this + if (!self.responseContent) { + self._paused = false + } else { + self.responseContent.resume.apply(self.responseContent, arguments) + } +} +Request.prototype.destroy = function () { + var self = this + if (!self._ended) { + self.end() + } else if (self.response) { + self.response.destroy() + } +} + +Request.defaultProxyHeaderWhiteList = + Tunnel.defaultProxyHeaderWhiteList.slice() + +Request.defaultProxyHeaderExclusiveList = + Tunnel.defaultProxyHeaderExclusiveList.slice() + +// Exports + +Request.prototype.toJSON = requestToJSON +module.exports = Request + + +/***/ }), +/* 814 */ +/***/ (function(module, exports, __webpack_require__) { + +var core = __webpack_require__(306); +var async = __webpack_require__(815); +async.core = core; +async.isCore = function isCore(x) { return core[x]; }; +async.sync = __webpack_require__(817); + +exports = async; +module.exports = async; + + +/***/ }), +/* 815 */ +/***/ (function(module, exports, __webpack_require__) { + +var core = __webpack_require__(306); +var fs = __webpack_require__(5); +var path = __webpack_require__(0); +var caller = __webpack_require__(417); +var nodeModulesPaths = __webpack_require__(418); + +var defaultIsFile = function isFile(file, cb) { + fs.stat(file, function (err, stat) { + if (!err) { + return cb(null, stat.isFile() || stat.isFIFO()); + } + if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false); + return cb(err); + }); +}; + +module.exports = function resolve(x, options, callback) { + var cb = callback; + var opts = options || {}; + if (typeof opts === 'function') { + cb = opts; + opts = {}; + } + if (typeof x !== 'string') { + var err = new TypeError('Path must be a string.'); + return process.nextTick(function () { + cb(err); + }); + } + + var isFile = opts.isFile || defaultIsFile; + var readFile = opts.readFile || fs.readFile; + + var extensions = opts.extensions || ['.js']; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || []; + + if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) { + var res = path.resolve(basedir, x); + if (x === '..' || x.slice(-1) === '/') res += '/'; + if (/\/$/.test(x) && res === basedir) { + loadAsDirectory(res, opts.package, onfile); + } else loadAsFile(res, opts.package, onfile); + } else loadNodeModules(x, basedir, function (err, n, pkg) { + if (err) cb(err); + else if (n) cb(null, n, pkg); + else if (core[x]) return cb(null, x); + else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + + function onfile(err, m, pkg) { + if (err) cb(err); + else if (m) cb(null, m, pkg); + else loadAsDirectory(res, function (err, d, pkg) { + if (err) cb(err); + else if (d) cb(null, d, pkg); + else { + var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + moduleError.code = 'MODULE_NOT_FOUND'; + cb(moduleError); + } + }); + } + + function loadAsFile(x, thePackage, callback) { + var loadAsFilePackage = thePackage; + var cb = callback; + if (typeof loadAsFilePackage === 'function') { + cb = loadAsFilePackage; + loadAsFilePackage = undefined; + } + + var exts = [''].concat(extensions); + load(exts, x, loadAsFilePackage); + + function load(exts, x, loadPackage) { + if (exts.length === 0) return cb(null, undefined, loadPackage); + var file = x + exts[0]; + + var pkg = loadPackage; + if (pkg) onpkg(null, pkg); + else loadpkg(path.dirname(file), onpkg); + + function onpkg(err, pkg_, dir) { + pkg = pkg_; + if (err) return cb(err); + if (dir && pkg && opts.pathFilter) { + var rfile = path.relative(dir, file); + var rel = rfile.slice(0, rfile.length - exts[0].length); + var r = opts.pathFilter(pkg, x, rel); + if (r) return load( + [''].concat(extensions.slice()), + path.resolve(dir, r), + pkg + ); + } + isFile(file, onex); + } + function onex(err, ex) { + if (err) return cb(err); + if (ex) return cb(null, file, pkg); + load(exts.slice(1), x, pkg); + } + } + } + + function loadpkg(dir, cb) { + if (dir === '' || dir === '/') return cb(null); + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return cb(null); + } + if (/[/\\]node_modules[/\\]*$/.test(dir)) return cb(null); + + var pkgfile = path.join(dir, 'package.json'); + isFile(pkgfile, function (err, ex) { + // on err, ex is false + if (!ex) return loadpkg(path.dirname(dir), cb); + + readFile(pkgfile, function (err, body) { + if (err) cb(err); + try { var pkg = JSON.parse(body); } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + cb(null, pkg, dir); + }); + }); + } + + function loadAsDirectory(x, loadAsDirectoryPackage, callback) { + var cb = callback; + var fpkg = loadAsDirectoryPackage; + if (typeof fpkg === 'function') { + cb = fpkg; + fpkg = opts.package; + } + + var pkgfile = path.join(x, 'package.json'); + isFile(pkgfile, function (err, ex) { + if (err) return cb(err); + if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb); + + readFile(pkgfile, function (err, body) { + if (err) return cb(err); + try { + var pkg = JSON.parse(body); + } catch (jsonErr) {} + + if (opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + + if (pkg.main) { + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb); + + var dir = path.resolve(x, pkg.main); + loadAsDirectory(dir, pkg, function (err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + loadAsFile(path.join(x, 'index'), pkg, cb); + }); + }); + return; + } + + loadAsFile(path.join(x, '/index'), pkg, cb); + }); + }); + } + + function processDirs(cb, dirs) { + if (dirs.length === 0) return cb(null, undefined); + var dir = dirs[0]; + + var file = path.join(dir, x); + loadAsFile(file, opts.package, onfile); + + function onfile(err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + loadAsDirectory(path.join(dir, x), opts.package, ondir); + } + + function ondir(err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + processDirs(cb, dirs.slice(1)); + } + } + function loadNodeModules(x, start, cb) { + processDirs(cb, nodeModulesPaths(start, opts)); + } +}; + + +/***/ }), +/* 816 */ +/***/ (function(module, exports) { + +module.exports = {"assert":true,"async_hooks":">= 8","buffer_ieee754":"< 0.9.7","buffer":true,"child_process":true,"cluster":true,"console":true,"constants":true,"crypto":true,"_debugger":"< 8","dgram":true,"dns":true,"domain":true,"events":true,"freelist":"< 6","fs":true,"fs/promises":">= 10 && < 10.1","_http_agent":">= 0.11.1","_http_client":">= 0.11.1","_http_common":">= 0.11.1","_http_incoming":">= 0.11.1","_http_outgoing":">= 0.11.1","_http_server":">= 0.11.1","http":true,"http2":">= 8.8","https":true,"inspector":">= 8.0.0","_linklist":"< 8","module":true,"net":true,"node-inspect/lib/_inspect":">= 7.6.0","node-inspect/lib/internal/inspect_client":">= 7.6.0","node-inspect/lib/internal/inspect_repl":">= 7.6.0","os":true,"path":true,"perf_hooks":">= 8.5","process":">= 1","punycode":true,"querystring":true,"readline":true,"repl":true,"smalloc":">= 0.11.5 && < 3","_stream_duplex":">= 0.9.4","_stream_transform":">= 0.9.4","_stream_wrap":">= 1.4.1","_stream_passthrough":">= 0.9.4","_stream_readable":">= 0.9.4","_stream_writable":">= 0.9.4","stream":true,"string_decoder":true,"sys":true,"timers":true,"_tls_common":">= 0.11.13","_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","tls":true,"trace_events":">= 10","tty":true,"url":true,"util":true,"v8/tools/arguments":">= 10","v8/tools/codemap":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/consarray":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/csvparser":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/logreader":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/profile_view":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/splaytree":[">= 4.4.0 && < 5",">= 5.2.0"],"v8":">= 1","vm":true,"zlib":true} + +/***/ }), +/* 817 */ +/***/ (function(module, exports, __webpack_require__) { + +var core = __webpack_require__(306); +var fs = __webpack_require__(5); +var path = __webpack_require__(0); +var caller = __webpack_require__(417); +var nodeModulesPaths = __webpack_require__(418); + +var defaultIsFile = function isFile(file) { + try { + var stat = fs.statSync(file); + } catch (e) { + if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false; + throw e; + } + return stat.isFile() || stat.isFIFO(); +}; + +module.exports = function (x, options) { + if (typeof x !== 'string') { + throw new TypeError('Path must be a string.'); + } + var opts = options || {}; + var isFile = opts.isFile || defaultIsFile; + var readFileSync = opts.readFileSync || fs.readFileSync; + + var extensions = opts.extensions || ['.js']; + var basedir = opts.basedir || path.dirname(caller()); + var parent = opts.filename || basedir; + + opts.paths = opts.paths || []; + + if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) { + var res = path.resolve(basedir, x); + if (x === '..' || x.slice(-1) === '/') res += '/'; + var m = loadAsFileSync(res) || loadAsDirectorySync(res); + if (m) return m; + } else { + var n = loadNodeModulesSync(x, basedir); + if (n) return n; + } + + if (core[x]) return x; + + var err = new Error("Cannot find module '" + x + "' from '" + parent + "'"); + err.code = 'MODULE_NOT_FOUND'; + throw err; + + function loadAsFileSync(x) { + var pkg = loadpkg(path.dirname(x)); + + if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) { + var rfile = path.relative(pkg.dir, x); + var r = opts.pathFilter(pkg.pkg, x, rfile); + if (r) { + x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign + } + } + + if (isFile(x)) { + return x; + } + + for (var i = 0; i < extensions.length; i++) { + var file = x + extensions[i]; + if (isFile(file)) { + return file; + } + } + } + + function loadpkg(dir) { + if (dir === '' || dir === '/') return; + if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) { + return; + } + if (/[/\\]node_modules[/\\]*$/.test(dir)) return; + + var pkgfile = path.join(dir, 'package.json'); + + if (!isFile(pkgfile)) { + return loadpkg(path.dirname(dir)); + } + + var body = readFileSync(pkgfile); + + try { + var pkg = JSON.parse(body); + } catch (jsonErr) {} + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, dir); + } + + return { pkg: pkg, dir: dir }; + } + + function loadAsDirectorySync(x) { + var pkgfile = path.join(x, '/package.json'); + if (isFile(pkgfile)) { + try { + var body = readFileSync(pkgfile, 'UTF8'); + var pkg = JSON.parse(body); + + if (opts.packageFilter) { + pkg = opts.packageFilter(pkg, x); + } + + if (pkg.main) { + if (pkg.main === '.' || pkg.main === './') { + pkg.main = 'index'; + } + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + var n = loadAsDirectorySync(path.resolve(x, pkg.main)); + if (n) return n; + } + } catch (e) {} + } + + return loadAsFileSync(path.join(x, '/index')); + } + + function loadNodeModulesSync(x, start) { + var dirs = nodeModulesPaths(start, opts); + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + var m = loadAsFileSync(path.join(dir, '/', x)); + if (m) return m; + var n = loadAsDirectorySync(path.join(dir, '/', x)); + if (n) return n; + } + } +}; + + +/***/ }), +/* 818 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +const onetime = __webpack_require__(771); +const signalExit = __webpack_require__(451); + +module.exports = onetime(() => { + signalExit(() => { + process.stderr.write('\u001b[?25h'); + }, {alwaysLast: true}); +}); + + +/***/ }), +/* 819 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(820); + +/***/ }), +/* 820 */ +/***/ (function(module, exports, __webpack_require__) { + +var RetryOperation = __webpack_require__(821); + +exports.operation = function(options) { + var timeouts = exports.timeouts(options); + return new RetryOperation(timeouts, { + forever: options && options.forever, + unref: options && options.unref + }); +}; + +exports.timeouts = function(options) { + if (options instanceof Array) { + return [].concat(options); + } + + var opts = { + retries: 10, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: Infinity, + randomize: false + }; + for (var key in options) { + opts[key] = options[key]; + } + + if (opts.minTimeout > opts.maxTimeout) { + throw new Error('minTimeout is greater than maxTimeout'); + } + + var timeouts = []; + for (var i = 0; i < opts.retries; i++) { + timeouts.push(this.createTimeout(i, opts)); + } + + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + + // sort the array numerically ascending + timeouts.sort(function(a,b) { + return a - b; + }); + + return timeouts; +}; + +exports.createTimeout = function(attempt, opts) { + var random = (opts.randomize) + ? (Math.random() + 1) + : 1; + + var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); + timeout = Math.min(timeout, opts.maxTimeout); + + return timeout; +}; + +exports.wrap = function(obj, options, methods) { + if (options instanceof Array) { + methods = options; + options = null; + } + + if (!methods) { + methods = []; + for (var key in obj) { + if (typeof obj[key] === 'function') { + methods.push(key); + } + } + } + + for (var i = 0; i < methods.length; i++) { + var method = methods[i]; + var original = obj[method]; + + obj[method] = function retryWrapper() { + var op = exports.operation(options); + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + + args.push(function(err) { + if (op.retry(err)) { + return; + } + if (err) { + arguments[0] = op.mainError(); + } + callback.apply(this, arguments); + }); + + op.attempt(function() { + original.apply(obj, args); + }); + }; + obj[method].options = options; + } +}; + + +/***/ }), +/* 821 */ +/***/ (function(module, exports) { + +function RetryOperation(timeouts, options) { + // Compatibility for the old (timeouts, retryForever) signature + if (typeof options === 'boolean') { + options = { forever: options }; + } + + this._timeouts = timeouts; + this._options = options || {}; + this._fn = null; + this._errors = []; + this._attempts = 1; + this._operationTimeout = null; + this._operationTimeoutCb = null; + this._timeout = null; + + if (this._options.forever) { + this._cachedTimeouts = this._timeouts.slice(0); + } +} +module.exports = RetryOperation; + +RetryOperation.prototype.stop = function() { + if (this._timeout) { + clearTimeout(this._timeout); + } + + this._timeouts = []; + this._cachedTimeouts = null; +}; + +RetryOperation.prototype.retry = function(err) { + if (this._timeout) { + clearTimeout(this._timeout); + } + + if (!err) { + return false; + } + + this._errors.push(err); + + var timeout = this._timeouts.shift(); + if (timeout === undefined) { + if (this._cachedTimeouts) { + // retry forever, only keep last error + this._errors.splice(this._errors.length - 1, this._errors.length); + this._timeouts = this._cachedTimeouts.slice(0); + timeout = this._timeouts.shift(); + } else { + return false; + } + } + + var self = this; + var timer = setTimeout(function() { + self._attempts++; + + if (self._operationTimeoutCb) { + self._timeout = setTimeout(function() { + self._operationTimeoutCb(self._attempts); + }, self._operationTimeout); + + if (this._options.unref) { + self._timeout.unref(); + } + } + + self._fn(self._attempts); + }, timeout); + + if (this._options.unref) { + timer.unref(); + } + + return true; +}; + +RetryOperation.prototype.attempt = function(fn, timeoutOps) { + this._fn = fn; + + if (timeoutOps) { + if (timeoutOps.timeout) { + this._operationTimeout = timeoutOps.timeout; + } + if (timeoutOps.cb) { + this._operationTimeoutCb = timeoutOps.cb; + } + } + + var self = this; + if (this._operationTimeoutCb) { + this._timeout = setTimeout(function() { + self._operationTimeoutCb(); + }, self._operationTimeout); + } + + this._fn(this._attempts); +}; + +RetryOperation.prototype.try = function(fn) { + console.log('Using RetryOperation.try() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = function(fn) { + console.log('Using RetryOperation.start() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = RetryOperation.prototype.try; + +RetryOperation.prototype.errors = function() { + return this._errors; +}; + +RetryOperation.prototype.attempts = function() { + return this._attempts; +}; + +RetryOperation.prototype.mainError = function() { + if (this._errors.length === 0) { + return null; + } + + var counts = {}; + var mainError = null; + var mainErrorCount = 0; + + for (var i = 0; i < this._errors.length; i++) { + var error = this._errors[i]; + var message = error.message; + var count = (counts[message] || 0) + 1; + + counts[message] = count; + + if (count >= mainErrorCount) { + mainError = error; + mainErrorCount = count; + } + } + + return mainError; +}; + + +/***/ }), +/* 822 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SubscribeOnObservable; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_asap__ = __webpack_require__(438); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isNumeric__ = __webpack_require__(190); +/** PURE_IMPORTS_START tslib,_Observable,_scheduler_asap,_util_isNumeric PURE_IMPORTS_END */ + + + + +var SubscribeOnObservable = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubscribeOnObservable, _super); + function SubscribeOnObservable(source, delayTime, scheduler) { + if (delayTime === void 0) { + delayTime = 0; + } + if (scheduler === void 0) { + scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_asap__["a" /* asap */]; + } + var _this = _super.call(this) || this; + _this.source = source; + _this.delayTime = delayTime; + _this.scheduler = scheduler; + if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isNumeric__["a" /* isNumeric */])(delayTime) || delayTime < 0) { + _this.delayTime = 0; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + _this.scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_asap__["a" /* asap */]; + } + return _this; + } + SubscribeOnObservable.create = function (source, delay, scheduler) { + if (delay === void 0) { + delay = 0; + } + if (scheduler === void 0) { + scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_asap__["a" /* 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; +}(__WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */])); + +//# sourceMappingURL=SubscribeOnObservable.js.map + + +/***/ }), +/* 823 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = bindCallback; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__ = __webpack_require__(183); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__operators_map__ = __webpack_require__(47); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_canReportError__ = __webpack_require__(322); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isArray__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_isScheduler__ = __webpack_require__(49); +/** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_canReportError,_util_isArray,_util_isScheduler PURE_IMPORTS_END */ + + + + + + +function bindCallback(callbackFunc, resultSelector, scheduler) { + if (resultSelector) { + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isScheduler__["a" /* 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(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__operators_map__["a" /* map */])(function (args) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isArray__["a" /* 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 __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { + if (!scheduler) { + if (!subject) { + subject = new __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__["a" /* 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) { + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_canReportError__["a" /* canReportError */])(subject)) { + subject.error(err); + } + else { + console.warn(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 __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__["a" /* 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 + + +/***/ }), +/* 824 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = bindNodeCallback; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__ = __webpack_require__(183); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__operators_map__ = __webpack_require__(47); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_canReportError__ = __webpack_require__(322); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isScheduler__ = __webpack_require__(49); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_isArray__ = __webpack_require__(41); +/** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_canReportError,_util_isScheduler,_util_isArray PURE_IMPORTS_END */ + + + + + + +function bindNodeCallback(callbackFunc, resultSelector, scheduler) { + if (resultSelector) { + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isScheduler__["a" /* 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(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__operators_map__["a" /* map */])(function (args) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isArray__["a" /* 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 __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { + var context = params.context; + var subject = params.subject; + if (!scheduler) { + if (!subject) { + subject = params.subject = new __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__["a" /* 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) { + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_canReportError__["a" /* canReportError */])(subject)) { + subject.error(err); + } + else { + console.warn(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 __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__["a" /* 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 + + +/***/ }), +/* 825 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = forkJoin; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__empty__ = __webpack_require__(39); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(14); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__operators_map__ = __webpack_require__(47); +/** 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 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(sources[0])) { + sources = sources[0]; + } + if (sources.length === 0) { + return __WEBPACK_IMPORTED_MODULE_3__empty__["b" /* EMPTY */]; + } + if (resultSelector) { + return forkJoin(sources).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__operators_map__["a" /* map */])(function (args) { return resultSelector.apply(void 0, args); })); + } + return new __WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */](function (subscriber) { + return new ForkJoinSubscriber(subscriber, sources); + }); +} +var ForkJoinSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* 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; +}(__WEBPACK_IMPORTED_MODULE_5__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=forkJoin.js.map + + +/***/ }), +/* 826 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = fromEvent; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isArray__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(154); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__operators_map__ = __webpack_require__(47); +/** 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 (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isFunction__["a" /* isFunction */])(options)) { + resultSelector = options; + options = undefined; + } + if (resultSelector) { + return fromEvent(target, eventName, options).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__operators_map__["a" /* map */])(function (args) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isArray__["a" /* isArray */])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); })); + } + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* 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 + + +/***/ }), +/* 827 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = fromEventPattern; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isArray__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(154); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__operators_map__ = __webpack_require__(47); +/** 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(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__operators_map__["a" /* map */])(function (args) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isArray__["a" /* isArray */])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); })); + } + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* 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 (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isFunction__["a" /* isFunction */])(removeHandler)) { + return undefined; + } + return function () { return removeHandler(handler, retValue); }; + }); +} +//# sourceMappingURL=fromEventPattern.js.map + + +/***/ }), +/* 828 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = fromIterable; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__symbol_iterator__ = __webpack_require__(151); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToIterable__ = __webpack_require__(448); +/** 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 __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToIterable__["a" /* subscribeToIterable */])(input)); + } + else { + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { + var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */](); + var iterator; + sub.add(function () { + if (iterator && typeof iterator.return === 'function') { + iterator.return(); + } + }); + sub.add(scheduler.schedule(function () { + iterator = input[__WEBPACK_IMPORTED_MODULE_2__symbol_iterator__["a" /* 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 + + +/***/ }), +/* 829 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = fromObservable; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__symbol_observable__ = __webpack_require__(117); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToObservable__ = __webpack_require__(449); +/** PURE_IMPORTS_START _Observable,_Subscription,_symbol_observable,_util_subscribeToObservable PURE_IMPORTS_END */ + + + + +function fromObservable(input, scheduler) { + if (!scheduler) { + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToObservable__["a" /* subscribeToObservable */])(input)); + } + else { + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { + var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */](); + sub.add(scheduler.schedule(function () { + var observable = input[__WEBPACK_IMPORTED_MODULE_2__symbol_observable__["a" /* 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 + + +/***/ }), +/* 830 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = fromPromise; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToPromise__ = __webpack_require__(450); +/** PURE_IMPORTS_START _Observable,_Subscription,_util_subscribeToPromise PURE_IMPORTS_END */ + + + +function fromPromise(input, scheduler) { + if (!scheduler) { + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToPromise__["a" /* subscribeToPromise */])(input)); + } + else { + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { + var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* 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 + + +/***/ }), +/* 831 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = generate; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_identity__ = __webpack_require__(118); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isScheduler__ = __webpack_require__(49); +/** 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 || __WEBPACK_IMPORTED_MODULE_1__util_identity__["a" /* identity */]; + scheduler = options.scheduler; + } + else if (resultSelectorOrObservable === undefined || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isScheduler__["a" /* isScheduler */])(resultSelectorOrObservable)) { + initialState = initialStateOrOptions; + resultSelector = __WEBPACK_IMPORTED_MODULE_1__util_identity__["a" /* identity */]; + scheduler = resultSelectorOrObservable; + } + else { + initialState = initialStateOrOptions; + resultSelector = resultSelectorOrObservable; + } + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* 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 + + +/***/ }), +/* 832 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = iif; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defer__ = __webpack_require__(310); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__empty__ = __webpack_require__(39); +/** PURE_IMPORTS_START _defer,_empty PURE_IMPORTS_END */ + + +function iif(condition, trueResult, falseResult) { + if (trueResult === void 0) { + trueResult = __WEBPACK_IMPORTED_MODULE_1__empty__["b" /* EMPTY */]; + } + if (falseResult === void 0) { + falseResult = __WEBPACK_IMPORTED_MODULE_1__empty__["b" /* EMPTY */]; + } + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__defer__["a" /* defer */])(function () { return condition() ? trueResult : falseResult; }); +} +//# sourceMappingURL=iif.js.map + + +/***/ }), +/* 833 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = interval; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(40); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isNumeric__ = __webpack_require__(190); +/** 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 = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */]; + } + if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isNumeric__["a" /* isNumeric */])(period) || period < 0) { + period = 0; + } + if (!scheduler || typeof scheduler.schedule !== 'function') { + scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */]; + } + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* 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 + + +/***/ }), +/* 834 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = onErrorResumeNext; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__from__ = __webpack_require__(62); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__empty__ = __webpack_require__(39); +/** 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 __WEBPACK_IMPORTED_MODULE_3__empty__["b" /* EMPTY */]; + } + var first = sources[0], remainder = sources.slice(1); + if (sources.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(first)) { + return onErrorResumeNext.apply(void 0, first); + } + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { + var subNext = function () { return subscriber.add(onErrorResumeNext.apply(void 0, remainder).subscribe(subscriber)); }; + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__from__["a" /* from */])(first).subscribe({ + next: function (value) { subscriber.next(value); }, + error: subNext, + complete: subNext, + }); + }); +} +//# sourceMappingURL=onErrorResumeNext.js.map + + +/***/ }), +/* 835 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = pairs; +/* unused harmony export dispatch */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(25); +/** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */ + + +function pairs(obj, scheduler) { + if (!scheduler) { + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* 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 __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { + var keys = Object.keys(obj); + var subscription = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* 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 + + +/***/ }), +/* 836 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = range; +/* unused harmony export dispatch */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/** 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 __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* 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 + + +/***/ }), +/* 837 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = using; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__from__ = __webpack_require__(62); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__empty__ = __webpack_require__(39); +/** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */ + + + +function using(resourceFactory, observableFactory) { + return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* 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 ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__from__["a" /* from */])(result) : __WEBPACK_IMPORTED_MODULE_2__empty__["b" /* EMPTY */]; + var subscription = source.subscribe(subscriber); + return function () { + subscription.unsubscribe(); + if (resource) { + resource.unsubscribe(); + } + }; + }); +} +//# sourceMappingURL=using.js.map + + +/***/ }), +/* 838 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = auditTime; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scheduler_async__ = __webpack_require__(40); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__audit__ = __webpack_require__(428); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_timer__ = __webpack_require__(427); +/** PURE_IMPORTS_START _scheduler_async,_audit,_observable_timer PURE_IMPORTS_END */ + + + +function auditTime(duration, scheduler) { + if (scheduler === void 0) { + scheduler = __WEBPACK_IMPORTED_MODULE_0__scheduler_async__["a" /* async */]; + } + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__audit__["a" /* audit */])(function () { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_timer__["a" /* timer */])(duration, scheduler); }); +} +//# sourceMappingURL=auditTime.js.map + + +/***/ }), +/* 839 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = buffer; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(14); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BufferSubscriber, _super); + function BufferSubscriber(destination, closingNotifier) { + var _this = _super.call(this, destination) || this; + _this.buffer = []; + _this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* 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; +}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=buffer.js.map + + +/***/ }), +/* 840 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = bufferCount; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +var BufferSkipCountSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=bufferCount.js.map + + +/***/ }), +/* 841 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = bufferTime; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(40); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isScheduler__ = __webpack_require__(49); +/** PURE_IMPORTS_START tslib,_scheduler_async,_Subscriber,_util_isScheduler PURE_IMPORTS_END */ + + + + +function bufferTime(bufferTimeSpan) { + var length = arguments.length; + var scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */]; + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isScheduler__["a" /* 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_2__Subscriber__["a" /* 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 + + +/***/ }), +/* 842 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = bufferToggle; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(14); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(13); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* 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 __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */](); + var context = { buffer: buffer, subscription: subscription }; + contexts.push(context); + var innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(this, closingNotifier, context); + if (!innerSubscription || innerSubscription.closed) { + this.closeBuffer(context); + } + else { + innerSubscription.context = context; + this.add(innerSubscription); + subscription.add(innerSubscription); + } + }; + return BufferToggleSubscriber; +}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=bufferToggle.js.map + + +/***/ }), +/* 843 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = bufferWhen; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(56); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(48); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(14); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.closingSelector)(); + if (closingNotifier === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) { + this.error(__WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e); + } + else { + closingSubscription = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */](); + this.closingSubscription = closingSubscription; + this.add(closingSubscription); + this.subscribing = true; + closingSubscription.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, closingNotifier)); + this.subscribing = false; + } + }; + return BufferWhenSubscriber; +}(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=bufferWhen.js.map + + +/***/ }), +/* 844 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = catchError; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__ = __webpack_require__(84); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(14); +/** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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(); + var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined); + this.add(innerSubscriber); + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(this, result, undefined, undefined, innerSubscriber); + } + }; + return CatchSubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=catchError.js.map + + +/***/ }), +/* 845 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = combineAll; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_combineLatest__ = __webpack_require__(309); +/** PURE_IMPORTS_START _observable_combineLatest PURE_IMPORTS_END */ + +function combineAll(project) { + return function (source) { return source.lift(new __WEBPACK_IMPORTED_MODULE_0__observable_combineLatest__["b" /* CombineLatestOperator */](project)); }; +} +//# sourceMappingURL=combineAll.js.map + + +/***/ }), +/* 846 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = combineLatest; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_combineLatest__ = __webpack_require__(309); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_from__ = __webpack_require__(62); +/** 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 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isArray__["a" /* isArray */])(observables[0])) { + observables = observables[0].slice(); + } + return function (source) { return source.lift.call(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_from__["a" /* from */])([source].concat(observables)), new __WEBPACK_IMPORTED_MODULE_1__observable_combineLatest__["b" /* CombineLatestOperator */](project)); }; +} +//# sourceMappingURL=combineLatest.js.map + + +/***/ }), +/* 847 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = concat; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_concat__ = __webpack_require__(186); +/** 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(__WEBPACK_IMPORTED_MODULE_0__observable_concat__["a" /* concat */].apply(void 0, [source].concat(observables))); }; +} +//# sourceMappingURL=concat.js.map + + +/***/ }), +/* 848 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = concatMapTo; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__concatMap__ = __webpack_require__(430); +/** PURE_IMPORTS_START _concatMap PURE_IMPORTS_END */ + +function concatMapTo(innerObservable, resultSelector) { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__concatMap__["a" /* concatMap */])(function () { return innerObservable; }, resultSelector); +} +//# sourceMappingURL=concatMapTo.js.map + + +/***/ }), +/* 849 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = count; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=count.js.map + + +/***/ }), +/* 850 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = debounce; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(14); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* 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; +}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=debounce.js.map + + +/***/ }), +/* 851 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = debounceTime; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_async__ = __webpack_require__(40); +/** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */ + + + +function debounceTime(dueTime, scheduler) { + if (scheduler === void 0) { + scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_async__["a" /* 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +function dispatchNext(subscriber) { + subscriber.debouncedNext(); +} +//# sourceMappingURL=debounceTime.js.map + + +/***/ }), +/* 852 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = delay; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(40); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isDate__ = __webpack_require__(443); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Notification__ = __webpack_require__(184); +/** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_Subscriber,_Notification PURE_IMPORTS_END */ + + + + + +function delay(delay, scheduler) { + if (scheduler === void 0) { + scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */]; + } + var absoluteDelay = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isDate__["a" /* 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; + var destination = this.destination; + destination.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(__WEBPACK_IMPORTED_MODULE_4__Notification__["a" /* Notification */].createNext(value)); + }; + DelaySubscriber.prototype._error = function (err) { + this.errored = true; + this.queue = []; + this.destination.error(err); + this.unsubscribe(); + }; + DelaySubscriber.prototype._complete = function () { + this.scheduleNotification(__WEBPACK_IMPORTED_MODULE_4__Notification__["a" /* Notification */].createComplete()); + this.unsubscribe(); + }; + return DelaySubscriber; +}(__WEBPACK_IMPORTED_MODULE_3__Subscriber__["a" /* Subscriber */])); +var DelayMessage = /*@__PURE__*/ (function () { + function DelayMessage(time, notification) { + this.time = time; + this.notification = notification; + } + return DelayMessage; +}()); +//# sourceMappingURL=delay.js.map + + +/***/ }), +/* 853 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = delayWhen; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(14); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DelayWhenSubscriber, _super); + function DelayWhenSubscriber(destination, delayDurationSelector) { + var _this = _super.call(this, destination) || this; + _this.delayDurationSelector = delayDurationSelector; + _this.completed = false; + _this.delayNotifierSubscriptions = []; + _this.index = 0; + 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) { + var index = this.index++; + try { + var delayNotifier = this.delayDurationSelector(value, index); + if (delayNotifier) { + this.tryDelay(delayNotifier, value); + } + } + catch (err) { + this.destination.error(err); + } + }; + DelayWhenSubscriber.prototype._complete = function () { + this.completed = true; + this.tryComplete(); + this.unsubscribe(); + }; + 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, delayNotifier, value); + if (notifierSubscription && !notifierSubscription.closed) { + var destination = this.destination; + destination.add(notifierSubscription); + this.delayNotifierSubscriptions.push(notifierSubscription); + } + }; + DelayWhenSubscriber.prototype.tryComplete = function () { + if (this.completed && this.delayNotifierSubscriptions.length === 0) { + this.destination.complete(); + } + }; + return DelayWhenSubscriber; +}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */])); +var SubscriptionDelayObservable = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_2__Observable__["a" /* Observable */])); +var SubscriptionDelaySubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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.unsubscribe(); + this.subscribeToSource(); + }; + SubscriptionDelaySubscriber.prototype.subscribeToSource = function () { + if (!this.sourceSubscribed) { + this.sourceSubscribed = true; + this.unsubscribe(); + this.source.subscribe(this.parent); + } + }; + return SubscriptionDelaySubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=delayWhen.js.map + + +/***/ }), +/* 854 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = dematerialize; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DeMaterializeSubscriber, _super); + function DeMaterializeSubscriber(destination) { + return _super.call(this, destination) || this; + } + DeMaterializeSubscriber.prototype._next = function (value) { + value.observe(this.destination); + }; + return DeMaterializeSubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=dematerialize.js.map + + +/***/ }), +/* 855 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = distinct; +/* unused harmony export DistinctSubscriber */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(14); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* 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; +}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */])); + +//# sourceMappingURL=distinct.js.map + + +/***/ }), +/* 856 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = distinctUntilKeyChanged; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__distinctUntilChanged__ = __webpack_require__(431); +/** PURE_IMPORTS_START _distinctUntilChanged PURE_IMPORTS_END */ + +function distinctUntilKeyChanged(key, compare) { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__distinctUntilChanged__["a" /* distinctUntilChanged */])(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; }); +} +//# sourceMappingURL=distinctUntilKeyChanged.js.map + + +/***/ }), +/* 857 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = elementAt; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_ArgumentOutOfRangeError__ = __webpack_require__(152); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(147); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__throwIfEmpty__ = __webpack_require__(188); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__defaultIfEmpty__ = __webpack_require__(146); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__take__ = __webpack_require__(319); +/** PURE_IMPORTS_START _util_ArgumentOutOfRangeError,_filter,_throwIfEmpty,_defaultIfEmpty,_take PURE_IMPORTS_END */ + + + + + +function elementAt(index, defaultValue) { + if (index < 0) { + throw new __WEBPACK_IMPORTED_MODULE_0__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */](); + } + var hasDefaultValue = arguments.length >= 2; + return function (source) { + return source.pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(function (v, i) { return i === index; }), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__take__["a" /* take */])(1), hasDefaultValue + ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__defaultIfEmpty__["a" /* defaultIfEmpty */])(defaultValue) + : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__throwIfEmpty__["a" /* throwIfEmpty */])(function () { return new __WEBPACK_IMPORTED_MODULE_0__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */](); })); + }; +} +//# sourceMappingURL=elementAt.js.map + + +/***/ }), +/* 858 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = endWith; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_fromArray__ = __webpack_require__(85); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_scalar__ = __webpack_require__(312); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_empty__ = __webpack_require__(39); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_concat__ = __webpack_require__(186); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isScheduler__ = __webpack_require__(49); +/** 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 (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isScheduler__["a" /* isScheduler */])(scheduler)) { + array.pop(); + } + else { + scheduler = null; + } + var len = array.length; + if (len === 1 && !scheduler) { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(source, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__observable_scalar__["a" /* scalar */])(array[0])); + } + else if (len > 0) { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(source, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__observable_fromArray__["a" /* fromArray */])(array, scheduler)); + } + else { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(source, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_empty__["a" /* empty */])(scheduler)); + } + }; +} +//# sourceMappingURL=endWith.js.map + + +/***/ }), +/* 859 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = every; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=every.js.map + + +/***/ }), +/* 860 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = exhaust; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(14); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* 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; +}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=exhaust.js.map + + +/***/ }), +/* 861 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = exhaustMap; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__ = __webpack_require__(84); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(14); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map__ = __webpack_require__(47); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__observable_from__ = __webpack_require__(62); +/** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__observable_from__["a" /* from */])(project(a, i)).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__map__["a" /* 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 result; + var index = this.index++; + try { + result = this.project(value, index); + } + catch (err) { + this.destination.error(err); + return; + } + this.hasSubscription = true; + this._innerSub(result, value, index); + }; + ExhaustMapSubscriber.prototype._innerSub = function (result, value, index) { + var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined); + var destination = this.destination; + destination.add(innerSubscriber); + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(this, result, value, index, innerSubscriber); + }; + ExhaustMapSubscriber.prototype._complete = function () { + this.hasCompleted = true; + if (!this.hasSubscription) { + this.destination.complete(); + } + this.unsubscribe(); + }; + 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) { + var destination = this.destination; + destination.remove(innerSub); + this.hasSubscription = false; + if (this.hasCompleted) { + this.destination.complete(); + } + }; + return ExhaustMapSubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=exhaustMap.js.map + + +/***/ }), +/* 862 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = expand; +/* unused harmony export ExpandOperator */ +/* unused harmony export ExpandSubscriber */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_tryCatch__ = __webpack_require__(56); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_errorObject__ = __webpack_require__(48); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(14); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_tryCatch__["a" /* tryCatch */])(this.project)(value, index); + if (result === __WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */]) { + destination.error(__WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */].e); + } + else if (!this.scheduler) { + this.subscribeToProjection(result, value, index); + } + else { + var state = { subscriber: this, result: result, value: value, index: index }; + var destination_1 = this.destination; + destination_1.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state)); + } + } + else { + this.buffer.push(value); + } + }; + ExpandSubscriber.prototype.subscribeToProjection = function (result, value, index) { + this.active++; + var destination = this.destination; + destination.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, result, value, index)); + }; + ExpandSubscriber.prototype._complete = function () { + this.hasCompleted = true; + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + this.unsubscribe(); + }; + ExpandSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { + this._next(innerValue); + }; + ExpandSubscriber.prototype.notifyComplete = function (innerSub) { + var buffer = this.buffer; + var destination = this.destination; + destination.remove(innerSub); + this.active--; + if (buffer && buffer.length > 0) { + this._next(buffer.shift()); + } + if (this.hasCompleted && this.active === 0) { + this.destination.complete(); + } + }; + return ExpandSubscriber; +}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */])); + +//# sourceMappingURL=expand.js.map + + +/***/ }), +/* 863 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = finalize; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(25); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](FinallySubscriber, _super); + function FinallySubscriber(destination, callback) { + var _this = _super.call(this, destination) || this; + _this.add(new __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */](callback)); + return _this; + } + return FinallySubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=finalize.js.map + + +/***/ }), +/* 864 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = findIndex; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__operators_find__ = __webpack_require__(432); +/** PURE_IMPORTS_START _operators_find PURE_IMPORTS_END */ + +function findIndex(predicate, thisArg) { + return function (source) { return source.lift(new __WEBPACK_IMPORTED_MODULE_0__operators_find__["b" /* FindValueOperator */](predicate, source, true, thisArg)); }; +} +//# sourceMappingURL=findIndex.js.map + + +/***/ }), +/* 865 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = first; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_EmptyError__ = __webpack_require__(153); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(147); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__take__ = __webpack_require__(319); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__defaultIfEmpty__ = __webpack_require__(146); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__throwIfEmpty__ = __webpack_require__(188); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_identity__ = __webpack_require__(118); +/** 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 ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(function (v, i) { return predicate(v, i, source); }) : __WEBPACK_IMPORTED_MODULE_5__util_identity__["a" /* identity */], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__take__["a" /* take */])(1), hasDefaultValue ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__defaultIfEmpty__["a" /* defaultIfEmpty */])(defaultValue) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__throwIfEmpty__["a" /* throwIfEmpty */])(function () { return new __WEBPACK_IMPORTED_MODULE_0__util_EmptyError__["a" /* EmptyError */](); })); }; +} +//# sourceMappingURL=first.js.map + + +/***/ }), +/* 866 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = ignoreElements; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](IgnoreElementsSubscriber, _super); + function IgnoreElementsSubscriber() { + return _super !== null && _super.apply(this, arguments) || this; + } + IgnoreElementsSubscriber.prototype._next = function (unused) { + }; + return IgnoreElementsSubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=ignoreElements.js.map + + +/***/ }), +/* 867 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = isEmpty; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=isEmpty.js.map + + +/***/ }), +/* 868 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = last; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_EmptyError__ = __webpack_require__(153); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(147); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__takeLast__ = __webpack_require__(320); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__throwIfEmpty__ = __webpack_require__(188); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__defaultIfEmpty__ = __webpack_require__(146); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_identity__ = __webpack_require__(118); +/** 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 ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(function (v, i) { return predicate(v, i, source); }) : __WEBPACK_IMPORTED_MODULE_5__util_identity__["a" /* identity */], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__takeLast__["a" /* takeLast */])(1), hasDefaultValue ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__defaultIfEmpty__["a" /* defaultIfEmpty */])(defaultValue) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__throwIfEmpty__["a" /* throwIfEmpty */])(function () { return new __WEBPACK_IMPORTED_MODULE_0__util_EmptyError__["a" /* EmptyError */](); })); }; +} +//# sourceMappingURL=last.js.map + + +/***/ }), +/* 869 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = mapTo; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=mapTo.js.map + + +/***/ }), +/* 870 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = materialize; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Notification__ = __webpack_require__(184); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MaterializeSubscriber, _super); + function MaterializeSubscriber(destination) { + return _super.call(this, destination) || this; + } + MaterializeSubscriber.prototype._next = function (value) { + this.destination.next(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createNext(value)); + }; + MaterializeSubscriber.prototype._error = function (err) { + var destination = this.destination; + destination.next(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createError(err)); + destination.complete(); + }; + MaterializeSubscriber.prototype._complete = function () { + var destination = this.destination; + destination.next(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createComplete()); + destination.complete(); + }; + return MaterializeSubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=materialize.js.map + + +/***/ }), +/* 871 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = max; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__reduce__ = __webpack_require__(187); +/** 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__reduce__["a" /* reduce */])(max); +} +//# sourceMappingURL=max.js.map + + +/***/ }), +/* 872 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = merge; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_merge__ = __webpack_require__(424); +/** 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(__WEBPACK_IMPORTED_MODULE_0__observable_merge__["a" /* merge */].apply(void 0, [source].concat(observables))); }; +} +//# sourceMappingURL=merge.js.map + + +/***/ }), +/* 873 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = mergeMapTo; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mergeMap__ = __webpack_require__(148); +/** 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeMap__["a" /* mergeMap */])(function () { return innerObservable; }, resultSelector, concurrent); + } + if (typeof resultSelector === 'number') { + concurrent = resultSelector; + } + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeMap__["a" /* mergeMap */])(function () { return innerObservable; }, concurrent); +} +//# sourceMappingURL=mergeMapTo.js.map + + +/***/ }), +/* 874 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = mergeScan; +/* unused harmony export MergeScanOperator */ +/* unused harmony export MergeScanSubscriber */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_tryCatch__ = __webpack_require__(56); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_errorObject__ = __webpack_require__(48); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(14); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__InnerSubscriber__ = __webpack_require__(84); +/** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_util_subscribeToResult,_OuterSubscriber,_InnerSubscriber 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_tryCatch__["a" /* tryCatch */])(this.accumulator)(this.acc, value); + var destination = this.destination; + if (ish === __WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */]) { + destination.error(__WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */].e); + } + else { + this.active++; + this._innerSub(ish, value, index); + } + } + else { + this.buffer.push(value); + } + }; + MergeScanSubscriber.prototype._innerSub = function (ish, value, index) { + var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_5__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined); + var destination = this.destination; + destination.add(innerSubscriber); + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(this, ish, value, index, innerSubscriber); + }; + 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(); + } + this.unsubscribe(); + }; + 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; + var destination = this.destination; + destination.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; +}(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */])); + +//# sourceMappingURL=mergeScan.js.map + + +/***/ }), +/* 875 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = min; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__reduce__ = __webpack_require__(187); +/** 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__reduce__["a" /* reduce */])(min); +} +//# sourceMappingURL=min.js.map + + +/***/ }), +/* 876 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = onErrorResumeNext; +/* unused harmony export onErrorResumeNextStatic */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_from__ = __webpack_require__(62); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__InnerSubscriber__ = __webpack_require__(84); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(14); +/** PURE_IMPORTS_START tslib,_observable_from,_util_isArray,_OuterSubscriber,_InnerSubscriber,_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 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* 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 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(nextSources[0])) { + nextSources = nextSources[0]; + } + source = nextSources.shift(); + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__observable_from__["a" /* 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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(); + this.unsubscribe(); + }; + OnErrorResumeNextSubscriber.prototype._complete = function () { + this.subscribeToNextSource(); + this.unsubscribe(); + }; + OnErrorResumeNextSubscriber.prototype.subscribeToNextSource = function () { + var next = this.nextSources.shift(); + if (next) { + var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_4__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined); + var destination = this.destination; + destination.add(innerSubscriber); + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, next, undefined, undefined, innerSubscriber); + } + else { + this.destination.complete(); + } + }; + return OnErrorResumeNextSubscriber; +}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=onErrorResumeNext.js.map + + +/***/ }), +/* 877 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = pairwise; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=pairwise.js.map + + +/***/ }), +/* 878 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = partition; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_not__ = __webpack_require__(931); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(147); +/** PURE_IMPORTS_START _util_not,_filter PURE_IMPORTS_END */ + + +function partition(predicate, thisArg) { + return function (source) { + return [ + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(predicate, thisArg)(source), + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_not__["a" /* not */])(predicate, thisArg))(source) + ]; + }; +} +//# sourceMappingURL=partition.js.map + + +/***/ }), +/* 879 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = pluck; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__map__ = __webpack_require__(47); +/** 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__map__["a" /* 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 + + +/***/ }), +/* 880 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = publish; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Subject__ = __webpack_require__(36); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multicast__ = __webpack_require__(116); +/** PURE_IMPORTS_START _Subject,_multicast PURE_IMPORTS_END */ + + +function publish(selector) { + return selector ? + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(function () { return new __WEBPACK_IMPORTED_MODULE_0__Subject__["a" /* Subject */](); }, selector) : + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(new __WEBPACK_IMPORTED_MODULE_0__Subject__["a" /* Subject */]()); +} +//# sourceMappingURL=publish.js.map + + +/***/ }), +/* 881 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = publishBehavior; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__BehaviorSubject__ = __webpack_require__(419); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multicast__ = __webpack_require__(116); +/** PURE_IMPORTS_START _BehaviorSubject,_multicast PURE_IMPORTS_END */ + + +function publishBehavior(value) { + return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(new __WEBPACK_IMPORTED_MODULE_0__BehaviorSubject__["a" /* BehaviorSubject */](value))(source); }; +} +//# sourceMappingURL=publishBehavior.js.map + + +/***/ }), +/* 882 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = publishLast; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AsyncSubject__ = __webpack_require__(183); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multicast__ = __webpack_require__(116); +/** PURE_IMPORTS_START _AsyncSubject,_multicast PURE_IMPORTS_END */ + + +function publishLast() { + return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(new __WEBPACK_IMPORTED_MODULE_0__AsyncSubject__["a" /* AsyncSubject */]())(source); }; +} +//# sourceMappingURL=publishLast.js.map + + +/***/ }), +/* 883 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = publishReplay; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ReplaySubject__ = __webpack_require__(308); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multicast__ = __webpack_require__(116); +/** 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 __WEBPACK_IMPORTED_MODULE_0__ReplaySubject__["a" /* ReplaySubject */](bufferSize, windowTime, scheduler); + return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(function () { return subject; }, selector)(source); }; +} +//# sourceMappingURL=publishReplay.js.map + + +/***/ }), +/* 884 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = race; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(41); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_race__ = __webpack_require__(426); +/** 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 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isArray__["a" /* isArray */])(observables[0])) { + observables = observables[0]; + } + return source.lift.call(__WEBPACK_IMPORTED_MODULE_1__observable_race__["a" /* race */].apply(void 0, [source].concat(observables))); + }; +} +//# sourceMappingURL=race.js.map + + +/***/ }), +/* 885 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = repeat; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_empty__ = __webpack_require__(39); +/** 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_empty__["a" /* 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=repeat.js.map + + +/***/ }), +/* 886 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = repeatWhen; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(36); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(56); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(48); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(14); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */](); + var retries = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.notifier)(this.notifications); + if (retries === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) { + return _super.prototype.complete.call(this); + } + this.retries = retries; + this.retriesSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, retries); + }; + return RepeatWhenSubscriber; +}(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=repeatWhen.js.map + + +/***/ }), +/* 887 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = retry; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=retry.js.map + + +/***/ }), +/* 888 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = retryWhen; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(36); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(56); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(48); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(14); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */](); + retries = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.notifier)(errors); + if (retries === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) { + return _super.prototype.error.call(this, __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e); + } + retriesSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* 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; +}(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=retryWhen.js.map + + +/***/ }), +/* 889 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = sample; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(14); +/** 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(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(sampleSubscriber, this.notifier)); + return subscription; + }; + return SampleOperator; +}()); +var SampleSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=sample.js.map + + +/***/ }), +/* 890 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = sampleTime; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_async__ = __webpack_require__(40); +/** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */ + + + +function sampleTime(period, scheduler) { + if (scheduler === void 0) { + scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_async__["a" /* 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +function dispatchNotification(state) { + var subscriber = state.subscriber, period = state.period; + subscriber.notifyNext(); + this.schedule(state, period); +} +//# sourceMappingURL=sampleTime.js.map + + +/***/ }), +/* 891 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = sequenceEqual; +/* unused harmony export SequenceEqualOperator */ +/* unused harmony export SequenceEqualSubscriber */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(56); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(48); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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.destination.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; + } + this.unsubscribe(); + }; + 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(comparor)(a, b); + if (areEqual === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) { + this.destination.error(__WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* 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(); + } + }; + SequenceEqualSubscriber.prototype.completeB = function () { + if (this._oneComplete) { + this.emit(this._a.length === 0 && this._b.length === 0); + } + else { + this._oneComplete = true; + } + }; + return SequenceEqualSubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); + +var SequenceEqualCompareToSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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); + this.unsubscribe(); + }; + SequenceEqualCompareToSubscriber.prototype._complete = function () { + this.parent.completeB(); + this.unsubscribe(); + }; + return SequenceEqualCompareToSubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=sequenceEqual.js.map + + +/***/ }), +/* 892 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = share; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__multicast__ = __webpack_require__(116); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__refCount__ = __webpack_require__(316); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subject__ = __webpack_require__(36); +/** PURE_IMPORTS_START _multicast,_refCount,_Subject PURE_IMPORTS_END */ + + + +function shareSubjectFactory() { + return new __WEBPACK_IMPORTED_MODULE_2__Subject__["a" /* Subject */](); +} +function share() { + return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__refCount__["a" /* refCount */])()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__multicast__["a" /* multicast */])(shareSubjectFactory)(source)); }; +} +//# sourceMappingURL=share.js.map + + +/***/ }), +/* 893 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = shareReplay; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ReplaySubject__ = __webpack_require__(308); +/** PURE_IMPORTS_START _ReplaySubject PURE_IMPORTS_END */ + +function shareReplay(bufferSize, windowTime, scheduler) { + if (bufferSize === void 0) { + bufferSize = Number.POSITIVE_INFINITY; + } + if (windowTime === void 0) { + windowTime = Number.POSITIVE_INFINITY; + } + 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 __WEBPACK_IMPORTED_MODULE_0__ReplaySubject__["a" /* 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 + + +/***/ }), +/* 894 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = single; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_EmptyError__ = __webpack_require__(153); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 __WEBPACK_IMPORTED_MODULE_2__util_EmptyError__["a" /* EmptyError */]); + } + }; + return SingleSubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=single.js.map + + +/***/ }), +/* 895 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = skip; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=skip.js.map + + +/***/ }), +/* 896 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = skipLast; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__ = __webpack_require__(152); +/** 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 __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */]; + } + } + SkipLastOperator.prototype.call = function (subscriber, source) { + if (this._skipCount === 0) { + return source.subscribe(new __WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */](subscriber)); + } + else { + return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount)); + } + }; + return SkipLastOperator; +}()); +var SkipLastSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=skipLast.js.map + + +/***/ }), +/* 897 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = skipUntil; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__ = __webpack_require__(84); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(14); +/** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SkipUntilSubscriber, _super); + function SkipUntilSubscriber(destination, notifier) { + var _this = _super.call(this, destination) || this; + _this.hasValue = false; + var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__["a" /* InnerSubscriber */](_this, undefined, undefined); + _this.add(innerSubscriber); + _this.innerSubscription = innerSubscriber; + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(_this, notifier, undefined, undefined, innerSubscriber); + 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; +}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=skipUntil.js.map + + +/***/ }), +/* 898 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = skipWhile; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=skipWhile.js.map + + +/***/ }), +/* 899 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = startWith; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_fromArray__ = __webpack_require__(85); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_scalar__ = __webpack_require__(312); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_empty__ = __webpack_require__(39); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_concat__ = __webpack_require__(186); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isScheduler__ = __webpack_require__(49); +/** 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 (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isScheduler__["a" /* isScheduler */])(scheduler)) { + array.pop(); + } + else { + scheduler = null; + } + var len = array.length; + if (len === 1 && !scheduler) { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__observable_scalar__["a" /* scalar */])(array[0]), source); + } + else if (len > 0) { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__observable_fromArray__["a" /* fromArray */])(array, scheduler), source); + } + else { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_empty__["a" /* empty */])(scheduler), source); + } + }; +} +//# sourceMappingURL=startWith.js.map + + +/***/ }), +/* 900 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = subscribeOn; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_SubscribeOnObservable__ = __webpack_require__(822); +/** 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 __WEBPACK_IMPORTED_MODULE_0__observable_SubscribeOnObservable__["a" /* SubscribeOnObservable */](source, this.delay, this.scheduler).subscribe(subscriber); + }; + return SubscribeOnOperator; +}()); +//# sourceMappingURL=subscribeOn.js.map + + +/***/ }), +/* 901 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = switchAll; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__switchMap__ = __webpack_require__(318); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_identity__ = __webpack_require__(118); +/** PURE_IMPORTS_START _switchMap,_util_identity PURE_IMPORTS_END */ + + +function switchAll() { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__switchMap__["a" /* switchMap */])(__WEBPACK_IMPORTED_MODULE_1__util_identity__["a" /* identity */]); +} +//# sourceMappingURL=switchAll.js.map + + +/***/ }), +/* 902 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = switchMapTo; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__switchMap__ = __webpack_require__(318); +/** PURE_IMPORTS_START _switchMap PURE_IMPORTS_END */ + +function switchMapTo(innerObservable, resultSelector) { + return resultSelector ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__switchMap__["a" /* switchMap */])(function () { return innerObservable; }, resultSelector) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__switchMap__["a" /* switchMap */])(function () { return innerObservable; }); +} +//# sourceMappingURL=switchMapTo.js.map + + +/***/ }), +/* 903 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = takeUntil; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(14); +/** 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(takeUntilSubscriber, this.notifier); + if (notifierSubscription && !takeUntilSubscriber.seenValue) { + takeUntilSubscriber.add(notifierSubscription); + return source.subscribe(takeUntilSubscriber); + } + return takeUntilSubscriber; + }; + return TakeUntilOperator; +}()); +var TakeUntilSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TakeUntilSubscriber, _super); + function TakeUntilSubscriber(destination) { + var _this = _super.call(this, destination) || this; + _this.seenValue = false; + return _this; + } + TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { + this.seenValue = true; + this.complete(); + }; + TakeUntilSubscriber.prototype.notifyComplete = function () { + }; + return TakeUntilSubscriber; +}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=takeUntil.js.map + + +/***/ }), +/* 904 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = takeWhile; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=takeWhile.js.map + + +/***/ }), +/* 905 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = throttleTime; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_async__ = __webpack_require__(40); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__throttle__ = __webpack_require__(436); +/** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async,_throttle PURE_IMPORTS_END */ + + + + +function throttleTime(duration, scheduler, config) { + if (scheduler === void 0) { + scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_async__["a" /* async */]; + } + if (config === void 0) { + config = __WEBPACK_IMPORTED_MODULE_3__throttle__["b" /* 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +function dispatchNext(arg) { + var subscriber = arg.subscriber; + subscriber.clearThrottle(); +} +//# sourceMappingURL=throttleTime.js.map + + +/***/ }), +/* 906 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = timeInterval; +/* unused harmony export TimeInterval */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scheduler_async__ = __webpack_require__(40); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scan__ = __webpack_require__(317); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_defer__ = __webpack_require__(310); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__map__ = __webpack_require__(47); +/** PURE_IMPORTS_START _scheduler_async,_scan,_observable_defer,_map PURE_IMPORTS_END */ + + + + +function timeInterval(scheduler) { + if (scheduler === void 0) { + scheduler = __WEBPACK_IMPORTED_MODULE_0__scheduler_async__["a" /* async */]; + } + return function (source) { + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_defer__["a" /* defer */])(function () { + return source.pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__scan__["a" /* scan */])(function (_a, value) { + var current = _a.current; + return ({ value: value, current: scheduler.now(), last: current }); + }, { current: scheduler.now(), value: undefined, last: undefined }), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__map__["a" /* 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 + + +/***/ }), +/* 907 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = timeout; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scheduler_async__ = __webpack_require__(40); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_TimeoutError__ = __webpack_require__(440); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__timeoutWith__ = __webpack_require__(437); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_throwError__ = __webpack_require__(313); +/** PURE_IMPORTS_START _scheduler_async,_util_TimeoutError,_timeoutWith,_observable_throwError PURE_IMPORTS_END */ + + + + +function timeout(due, scheduler) { + if (scheduler === void 0) { + scheduler = __WEBPACK_IMPORTED_MODULE_0__scheduler_async__["a" /* async */]; + } + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__timeoutWith__["a" /* timeoutWith */])(due, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_throwError__["a" /* throwError */])(new __WEBPACK_IMPORTED_MODULE_1__util_TimeoutError__["a" /* TimeoutError */]()), scheduler); +} +//# sourceMappingURL=timeout.js.map + + +/***/ }), +/* 908 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = timestamp; +/* unused harmony export Timestamp */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scheduler_async__ = __webpack_require__(40); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__map__ = __webpack_require__(47); +/** PURE_IMPORTS_START _scheduler_async,_map PURE_IMPORTS_END */ + + +function timestamp(scheduler) { + if (scheduler === void 0) { + scheduler = __WEBPACK_IMPORTED_MODULE_0__scheduler_async__["a" /* async */]; + } + return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__map__["a" /* 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 + + +/***/ }), +/* 909 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = toArray; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__reduce__ = __webpack_require__(187); +/** 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 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__reduce__["a" /* reduce */])(toArrayReducer, []); +} +//# sourceMappingURL=toArray.js.map + + +/***/ }), +/* 910 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = window; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(36); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(14); +/** 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(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(windowSubscriber, this.windowBoundaries)); + } + return sourceSubscription; + }; + return WindowOperator; +}()); +var WindowSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](WindowSubscriber, _super); + function WindowSubscriber(destination) { + var _this = _super.call(this, destination) || this; + _this.window = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* 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 __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */](); + destination.next(newWindow); + }; + return WindowSubscriber; +}(__WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=window.js.map + + +/***/ }), +/* 911 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = windowCount; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subject__ = __webpack_require__(36); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 __WEBPACK_IMPORTED_MODULE_2__Subject__["a" /* 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 __WEBPACK_IMPORTED_MODULE_2__Subject__["a" /* 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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); +//# sourceMappingURL=windowCount.js.map + + +/***/ }), +/* 912 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = windowTime; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(36); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_async__ = __webpack_require__(40); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isNumeric__ = __webpack_require__(190); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_isScheduler__ = __webpack_require__(49); +/** PURE_IMPORTS_START tslib,_Subject,_scheduler_async,_Subscriber,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */ + + + + + + +function windowTime(windowTimeSpan) { + var scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_async__["a" /* async */]; + var windowCreationInterval = null; + var maxWindowSize = Number.POSITIVE_INFINITY; + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isScheduler__["a" /* isScheduler */])(arguments[3])) { + scheduler = arguments[3]; + } + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isScheduler__["a" /* isScheduler */])(arguments[2])) { + scheduler = arguments[2]; + } + else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isNumeric__["a" /* isNumeric */])(arguments[2])) { + maxWindowSize = arguments[2]; + } + if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isScheduler__["a" /* isScheduler */])(arguments[1])) { + scheduler = arguments[1]; + } + else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isNumeric__["a" /* 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */])); +var WindowTimeSubscriber = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_3__Subscriber__["a" /* 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 + + +/***/ }), +/* 913 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = windowToggle; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(36); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(25); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_tryCatch__ = __webpack_require__(56); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_errorObject__ = __webpack_require__(48); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_subscribeToResult__ = __webpack_require__(14); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_subscribeToResult__["a" /* 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 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(closingSelector)(innerValue); + if (closingNotifier === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) { + return this.error(__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e); + } + else { + var window_1 = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */](); + var subscription = new __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */](); + var context_4 = { window: window_1, subscription: subscription }; + this.contexts.push(context_4); + var innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_subscribeToResult__["a" /* 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; +}(__WEBPACK_IMPORTED_MODULE_5__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=windowToggle.js.map + + +/***/ }), +/* 914 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = windowWhen; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(36); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(56); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(48); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(14); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */](); + this.destination.next(window); + var closingNotifier = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.closingSelector)(); + if (closingNotifier === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) { + var err = __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e; + this.destination.error(err); + this.window.error(err); + } + else { + this.add(this.closingNotification = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, closingNotifier)); + } + }; + return WindowSubscriber; +}(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=windowWhen.js.map + + +/***/ }), +/* 915 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = withLatestFrom; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(14); +/** 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) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* 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; +}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */])); +//# sourceMappingURL=withLatestFrom.js.map + + +/***/ }), +/* 916 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = zip; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_zip__ = __webpack_require__(314); +/** 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(__WEBPACK_IMPORTED_MODULE_0__observable_zip__["a" /* zip */].apply(void 0, [source].concat(observables))); + }; +} +//# sourceMappingURL=zip.js.map + + +/***/ }), +/* 917 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = zipAll; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_zip__ = __webpack_require__(314); +/** PURE_IMPORTS_START _observable_zip PURE_IMPORTS_END */ + +function zipAll(project) { + return function (source) { return source.lift(new __WEBPACK_IMPORTED_MODULE_0__observable_zip__["b" /* ZipOperator */](project)); }; +} +//# sourceMappingURL=zipAll.js.map + + +/***/ }), +/* 918 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Action; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(25); +/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */ + + +var Action = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */])); + +//# sourceMappingURL=Action.js.map + + +/***/ }), +/* 919 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnimationFrameAction; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncAction__ = __webpack_require__(149); +/** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */ + + +var AnimationFrameAction = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__AsyncAction__["a" /* AsyncAction */])); + +//# sourceMappingURL=AnimationFrameAction.js.map + + +/***/ }), +/* 920 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnimationFrameScheduler; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(150); +/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */ + + +var AnimationFrameScheduler = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__["a" /* AsyncScheduler */])); + +//# sourceMappingURL=AnimationFrameScheduler.js.map + + +/***/ }), +/* 921 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsapAction; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_Immediate__ = __webpack_require__(927); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__AsyncAction__ = __webpack_require__(149); +/** PURE_IMPORTS_START tslib,_util_Immediate,_AsyncAction PURE_IMPORTS_END */ + + + +var AsapAction = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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 = __WEBPACK_IMPORTED_MODULE_1__util_Immediate__["a" /* 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) { + __WEBPACK_IMPORTED_MODULE_1__util_Immediate__["a" /* Immediate */].clearImmediate(id); + scheduler.scheduled = undefined; + } + return undefined; + }; + return AsapAction; +}(__WEBPACK_IMPORTED_MODULE_2__AsyncAction__["a" /* AsyncAction */])); + +//# sourceMappingURL=AsapAction.js.map + + +/***/ }), +/* 922 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsapScheduler; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(150); +/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */ + + +var AsapScheduler = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__["a" /* AsyncScheduler */])); + +//# sourceMappingURL=AsapScheduler.js.map + + +/***/ }), +/* 923 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return QueueAction; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncAction__ = __webpack_require__(149); +/** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */ + + +var QueueAction = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__AsyncAction__["a" /* AsyncAction */])); + +//# sourceMappingURL=QueueAction.js.map + + +/***/ }), +/* 924 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return QueueScheduler; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(150); +/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */ + + +var QueueScheduler = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](QueueScheduler, _super); + function QueueScheduler() { + return _super !== null && _super.apply(this, arguments) || this; + } + return QueueScheduler; +}(__WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__["a" /* AsyncScheduler */])); + +//# sourceMappingURL=QueueScheduler.js.map + + +/***/ }), +/* 925 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VirtualTimeScheduler; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return VirtualAction; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncAction__ = __webpack_require__(149); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__AsyncScheduler__ = __webpack_require__(150); +/** PURE_IMPORTS_START tslib,_AsyncAction,_AsyncScheduler PURE_IMPORTS_END */ + + + +var VirtualTimeScheduler = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_2__AsyncScheduler__["a" /* AsyncScheduler */])); + +var VirtualAction = /*@__PURE__*/ (function (_super) { + __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __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; +}(__WEBPACK_IMPORTED_MODULE_1__AsyncAction__["a" /* AsyncAction */])); + +//# sourceMappingURL=VirtualTimeScheduler.js.map + + +/***/ }), +/* 926 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return animationFrame; }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AnimationFrameAction__ = __webpack_require__(919); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AnimationFrameScheduler__ = __webpack_require__(920); +/** PURE_IMPORTS_START _AnimationFrameAction,_AnimationFrameScheduler PURE_IMPORTS_END */ + + +var animationFrame = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_1__AnimationFrameScheduler__["a" /* AnimationFrameScheduler */](__WEBPACK_IMPORTED_MODULE_0__AnimationFrameAction__["a" /* AnimationFrameAction */]); +//# sourceMappingURL=animationFrame.js.map + + +/***/ }), +/* 927 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", 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 + + +/***/ }), +/* 928 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = isInteropObservable; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_observable__ = __webpack_require__(117); +/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */ + +function isInteropObservable(input) { + return input && typeof input[__WEBPACK_IMPORTED_MODULE_0__symbol_observable__["a" /* observable */]] === 'function'; +} +//# sourceMappingURL=isInteropObservable.js.map + + +/***/ }), +/* 929 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = isIterable; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_iterator__ = __webpack_require__(151); +/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */ + +function isIterable(input) { + return input && typeof input[__WEBPACK_IMPORTED_MODULE_0__symbol_iterator__["a" /* iterator */]] === 'function'; +} +//# sourceMappingURL=isIterable.js.map + + +/***/ }), +/* 930 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = isObservable; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */ + +function isObservable(obj) { + return !!obj && (obj instanceof __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */] || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function')); +} +//# sourceMappingURL=isObservable.js.map + + +/***/ }), +/* 931 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = 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 + + +/***/ }), +/* 932 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (immutable) */ __webpack_exports__["a"] = toSubscriber; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Subscriber__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__symbol_rxSubscriber__ = __webpack_require__(321); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observer__ = __webpack_require__(420); +/** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */ + + + +function toSubscriber(nextOrObserver, error, complete) { + if (nextOrObserver) { + if (nextOrObserver instanceof __WEBPACK_IMPORTED_MODULE_0__Subscriber__["a" /* Subscriber */]) { + return nextOrObserver; + } + if (nextOrObserver[__WEBPACK_IMPORTED_MODULE_1__symbol_rxSubscriber__["a" /* rxSubscriber */]]) { + return nextOrObserver[__WEBPACK_IMPORTED_MODULE_1__symbol_rxSubscriber__["a" /* rxSubscriber */]](); + } + } + if (!nextOrObserver && !error && !complete) { + return new __WEBPACK_IMPORTED_MODULE_0__Subscriber__["a" /* Subscriber */](__WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]); + } + return new __WEBPACK_IMPORTED_MODULE_0__Subscriber__["a" /* Subscriber */](nextOrObserver, error, complete); +} +//# sourceMappingURL=toSubscriber.js.map + + +/***/ }), +/* 933 */ +/***/ (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' + ) +} + + +/***/ }), +/* 934 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +const isPlainObj = __webpack_require__(738); + +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); +}; + + +/***/ }), +/* 935 */ +/***/ (function(module, exports, __webpack_require__) { + +/* +Copyright 2015 Kyle E. Mitchell + +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 + +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. +*/ +var parse = __webpack_require__(452) +var spdxLicenseIds = __webpack_require__(453) + +function valid (string) { + try { + parse(string) + return true + } catch (error) { + return false + } +} + +// 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', 'GPL-3.0' + function (argument) { + if (argument.indexOf('3.0') !== -1) { + return argument + '-or-later' + } else { + return argument + '-only' + } + }, + // e.g. 'GPL-2.0-' + function (argument) { + return argument + 'only' + }, + // 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' + } +] + +var licensesWithVersions = spdxLicenseIds + .map(function (id) { + var match = /^(.*)-\d+\.\d+$/.exec(id) + return match + ? [match[0], match[1]] + : [id, null] + }) + .reduce(function (objectMap, item) { + var key = item[1] + objectMap[key] = objectMap[key] || [] + objectMap[key].push(item[0]) + return objectMap + }, {}) + +var licensesWithOneVersion = Object.keys(licensesWithVersions) + .map(function makeEntries (key) { + return [key, licensesWithVersions[key]] + }) + .filter(function identifySoleVersions (item) { + return ( + // Licenses has just one valid version suffix. + item[1].length === 1 && + item[0] !== null && + // APL will be considered Apache, rather than APL-1.0 + item[0] !== 'APL' + ) + }) + .map(function createLastResorts (item) { + return [item[0], item[1][0]] + }) + +licensesWithVersions = undefined + +// 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-or-later'], + ['AGPL', 'AGPL-3.0-or-later'], + ['APACHE', 'Apache-2.0'], + ['ARTISTIC', 'Artistic-2.0'], + ['Affero', 'AGPL-3.0-or-later'], + ['BEER', 'Beerware'], + ['BOOST', 'BSL-1.0'], + ['BSD', 'BSD-2-Clause'], + ['CDDL', 'CDDL-1.1'], + ['ECLIPSE', 'EPL-1.0'], + ['FUCK', 'WTFPL'], + ['GNU', 'GPL-3.0-or-later'], + ['LGPL', 'LGPL-3.0-or-later'], + ['GPLV1', 'GPL-1.0-only'], + ['GPLV2', 'GPL-2.0-only'], + ['GPL', 'GPL-3.0-or-later'], + ['MIT +NO-FALSE-ATTRIBS', 'MITNFA'], + ['MIT', 'MIT'], + ['MPL', 'MPL-2.0'], + ['X11', 'X11'], + ['ZLIB', 'Zlib'] +].concat(licensesWithOneVersion) + +var SUBSTRING = 0 +var IDENTIFIER = 1 + +var validTransformation = function (identifier) { + for (var i = 0; i < transforms.length; i++) { + var transformed = transforms[i](identifier).trim() + 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) { + var validArugment = ( + typeof identifier === 'string' && + identifier.trim().length !== 0 + ) + if (!validArugment) { + throw Error('Invalid argument. Expected non-empty string.') + } + identifier = identifier.replace(/\+$/, '').trim() + if (valid(identifier)) { + return upgradeGPLs(identifier) + } + var transformed = validTransformation(identifier) + if (transformed !== null) { + return upgradeGPLs(transformed) + } + transformed = anyCorrection(identifier, function (argument) { + if (valid(argument)) { + return argument + } + return validTransformation(argument) + }) + if (transformed !== null) { + return upgradeGPLs(transformed) + } + transformed = validLastResort(identifier) + if (transformed !== null) { + return upgradeGPLs(transformed) + } + transformed = anyCorrection(identifier, validLastResort) + if (transformed !== null) { + return upgradeGPLs(transformed) + } + return null +} + +function upgradeGPLs (value) { + if ([ + 'GPL-1.0', 'LGPL-1.0', 'AGPL-1.0', + 'GPL-2.0', 'LGPL-2.0', 'AGPL-2.0', + 'LGPL-2.1' + ].indexOf(value) !== -1) { + return value + '-only' + } else if (['GPL-3.0', 'LGPL-3.0', 'AGPL-3.0'].indexOf(value) !== -1) { + return value + '-or-later' + } else { + return value + } +} + + +/***/ }), +/* 936 */ +/***/ (function(module, exports) { + +module.exports = ["389-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Bison-exception-2.2","Bootloader-exception","CLISP-exception-2.0","Classpath-exception-2.0","DigiRule-FOSS-exception","FLTK-exception","Fawkes-Runtime-exception","Font-exception-2.0","GCC-exception-2.0","GCC-exception-3.1","LZMA-exception","Libtool-exception","Linux-syscall-note","Nokia-Qt-exception-1.1","OCCT-exception-1.0","Qwt-exception-1.0","WxWindows-exception-3.1","eCos-exception-2.0","freertos-exception-2.0","gnu-javamail-exception","i2p-gpl-java-exception","mif-exception","openvpn-openssl-exception","u-boot-exception-2.0"] + +/***/ }), +/* 937 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// The ABNF grammar in the spec is totally ambiguous. +// +// This parser follows the operator precedence defined in the +// `Order of Precedence and Parentheses` section. + +module.exports = function (tokens) { + var index = 0 + + function hasMore () { + return index < tokens.length + } + + function token () { + return hasMore() ? tokens[index] : null + } + + function next () { + if (!hasMore()) { + throw new Error() + } + index++ + } + + function parseOperator (operator) { + var t = token() + if (t && t.type === 'OPERATOR' && operator === t.string) { + next() + return t.string + } + } + + function parseWith () { + if (parseOperator('WITH')) { + var t = token() + if (t && t.type === 'EXCEPTION') { + next() + return t.string + } + throw new Error('Expected exception after `WITH`') + } + } + + function parseLicenseRef () { + // TODO: Actually, everything is concatenated into one string + // for backward-compatibility but it could be better to return + // a nice structure. + var begin = index + var string = '' + var t = token() + if (t.type === 'DOCUMENTREF') { + next() + string += 'DocumentRef-' + t.string + ':' + if (!parseOperator(':')) { + throw new Error('Expected `:` after `DocumentRef-...`') + } + } + t = token() + if (t.type === 'LICENSEREF') { + next() + string += 'LicenseRef-' + t.string + return {license: string} + } + index = begin + } + + function parseLicense () { + var t = token() + if (t && t.type === 'LICENSE') { + next() + var node = {license: t.string} + if (parseOperator('+')) { + node.plus = true + } + var exception = parseWith() + if (exception) { + node.exception = exception + } + return node + } + } + + function parseParenthesizedExpression () { + var left = parseOperator('(') + if (!left) { + return + } + + var expr = parseExpression() + + if (!parseOperator(')')) { + throw new Error('Expected `)`') + } + + return expr + } + + function parseAtom () { + return ( + parseParenthesizedExpression() || + parseLicenseRef() || + parseLicense() + ) + } + + function makeBinaryOpParser (operator, nextParser) { + return function parseBinaryOp () { + var left = nextParser() + if (!left) { + return + } + + if (!parseOperator(operator)) { + return left + } + + var right = parseBinaryOp() + if (!right) { + throw new Error('Expected expression') + } + return { + left: left, + conjunction: operator.toLowerCase(), + right: right + } + } + } + + var parseAnd = makeBinaryOpParser('AND', parseAtom) + var parseExpression = makeBinaryOpParser('OR', parseAnd) + + var node = parseExpression() + if (!node || hasMore()) { + throw new Error('Syntax error') + } + return node +} + + +/***/ }), +/* 938 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var licenses = [] + .concat(__webpack_require__(453)) + .concat(__webpack_require__(939)) +var exceptions = __webpack_require__(936) + +module.exports = function (source) { + var index = 0 + + function hasMore () { + return index < source.length + } + + // `value` can be a regexp or a string. + // If it is recognized, the matching source string is returned and + // the index is incremented. Otherwise `undefined` is returned. + function read (value) { + if (value instanceof RegExp) { + var chars = source.slice(index) + var match = chars.match(value) + if (match) { + index += match[0].length + return match[0] + } + } else { + if (source.indexOf(value, index) === index) { + index += value.length + return value + } + } + } + + function skipWhitespace () { + read(/[ ]*/) + } + + function operator () { + var string + var possibilities = ['WITH', 'AND', 'OR', '(', ')', ':', '+'] + for (var i = 0; i < possibilities.length; i++) { + string = read(possibilities[i]) + if (string) { + break + } + } + + if (string === '+' && index > 1 && source[index - 2] === ' ') { + throw new Error('Space before `+`') + } + + return string && { + type: 'OPERATOR', + string: string + } + } + + function idstring () { + return read(/[A-Za-z0-9-.]+/) + } + + function expectIdstring () { + var string = idstring() + if (!string) { + throw new Error('Expected idstring at offset ' + index) + } + return string + } + + function documentRef () { + if (read('DocumentRef-')) { + var string = expectIdstring() + return {type: 'DOCUMENTREF', string: string} + } + } + + function licenseRef () { + if (read('LicenseRef-')) { + var string = expectIdstring() + return {type: 'LICENSEREF', string: string} + } + } + + function identifier () { + var begin = index + var string = idstring() + + if (licenses.indexOf(string) !== -1) { + return { + type: 'LICENSE', + string: string + } + } else if (exceptions.indexOf(string) !== -1) { + return { + type: 'EXCEPTION', + string: string + } + } + + index = begin + } + + // Tries to read the next token. Returns `undefined` if no token is + // recognized. + function parseToken () { + // Ordering matters + return ( + operator() || + documentRef() || + licenseRef() || + identifier() + ) + } + + var tokens = [] + while (hasMore()) { + skipWhitespace() + if (!hasMore()) { + break + } + + var token = parseToken() + if (!token) { + throw new Error('Unexpected `' + source[index] + + '` at offset ' + index) + } + + tokens.push(token) + } + return tokens +} + + +/***/ }), +/* 939 */ +/***/ (function(module, exports) { + +module.exports = ["AGPL-3.0","eCos-2.0","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.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-2.0","GPL-3.0-with-autoconf-exception","GPL-3.0-with-GCC-exception","GPL-3.0","LGPL-2.0","LGPL-2.1","LGPL-3.0","Nunit","StandardML-NJ","wxWindows"] + +/***/ }), +/* 940 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2017 Joyent, Inc. + +module.exports = { + read: read, + verify: verify, + sign: sign, + signAsync: signAsync, + write: write, + + /* Internal private API */ + fromBuffer: fromBuffer, + toBuffer: toBuffer +}; + +var assert = __webpack_require__(16); +var SSHBuffer = __webpack_require__(159); +var crypto = __webpack_require__(11); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(33); +var Identity = __webpack_require__(158); +var rfc4253 = __webpack_require__(103); +var Signature = __webpack_require__(75); +var utils = __webpack_require__(26); +var Certificate = __webpack_require__(155); + +function verify(cert, key) { + /* + * We always give an issuerKey, so if our verify() is being called then + * there was no signature. Return false. + */ + return (false); +} + +var TYPES = { + 'user': 1, + 'host': 2 +}; +Object.keys(TYPES).forEach(function (k) { TYPES[TYPES[k]] = k; }); + +var ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/; + +function read(buf, options) { + if (Buffer.isBuffer(buf)) + buf = buf.toString('ascii'); + var parts = buf.trim().split(/[ \t\n]+/g); + if (parts.length < 2 || parts.length > 3) + throw (new Error('Not a valid SSH certificate line')); + + var algo = parts[0]; + var data = parts[1]; + + data = Buffer.from(data, 'base64'); + return (fromBuffer(data, algo)); +} + +function fromBuffer(data, algo, partial) { + var sshbuf = new SSHBuffer({ buffer: data }); + var innerAlgo = sshbuf.readString(); + if (algo !== undefined && innerAlgo !== algo) + throw (new Error('SSH certificate algorithm mismatch')); + if (algo === undefined) + algo = innerAlgo; + + var cert = {}; + cert.signatures = {}; + cert.signatures.openssh = {}; + + cert.signatures.openssh.nonce = sshbuf.readBuffer(); + + var key = {}; + var parts = (key.parts = []); + key.type = getAlg(algo); + + var partCount = algs.info[key.type].parts.length; + while (parts.length < partCount) + parts.push(sshbuf.readPart()); + assert.ok(parts.length >= 1, 'key must have at least one part'); + + var algInfo = algs.info[key.type]; + if (key.type === 'ecdsa') { + var res = ECDSA_ALGO.exec(algo); + assert.ok(res !== null); + assert.strictEqual(res[1], parts[0].data.toString()); + } + + for (var i = 0; i < algInfo.parts.length; ++i) { + parts[i].name = algInfo.parts[i]; + if (parts[i].name !== 'curve' && + algInfo.normalize !== false) { + var p = parts[i]; + p.data = utils.mpNormalize(p.data); + } + } + + cert.subjectKey = new Key(key); + + cert.serial = sshbuf.readInt64(); + + var type = TYPES[sshbuf.readInt()]; + assert.string(type, 'valid cert type'); + + cert.signatures.openssh.keyId = sshbuf.readString(); + + var principals = []; + var pbuf = sshbuf.readBuffer(); + var psshbuf = new SSHBuffer({ buffer: pbuf }); + while (!psshbuf.atEnd()) + principals.push(psshbuf.readString()); + if (principals.length === 0) + principals = ['*']; + + cert.subjects = principals.map(function (pr) { + if (type === 'user') + return (Identity.forUser(pr)); + else if (type === 'host') + return (Identity.forHost(pr)); + throw (new Error('Unknown identity type ' + type)); + }); + + cert.validFrom = int64ToDate(sshbuf.readInt64()); + cert.validUntil = int64ToDate(sshbuf.readInt64()); + + cert.signatures.openssh.critical = sshbuf.readBuffer(); + cert.signatures.openssh.exts = sshbuf.readBuffer(); + + /* reserved */ + sshbuf.readBuffer(); + + var signingKeyBuf = sshbuf.readBuffer(); + cert.issuerKey = rfc4253.read(signingKeyBuf); + + /* + * OpenSSH certs don't give the identity of the issuer, just their + * public key. So, we use an Identity that matches anything. The + * isSignedBy() function will later tell you if the key matches. + */ + cert.issuer = Identity.forHost('**'); + + var sigBuf = sshbuf.readBuffer(); + cert.signatures.openssh.signature = + Signature.parse(sigBuf, cert.issuerKey.type, 'ssh'); + + if (partial !== undefined) { + partial.remainder = sshbuf.remainder(); + partial.consumed = sshbuf._offset; + } + + return (new Certificate(cert)); +} + +function int64ToDate(buf) { + var i = buf.readUInt32BE(0) * 4294967296; + i += buf.readUInt32BE(4); + var d = new Date(); + d.setTime(i * 1000); + d.sourceInt64 = buf; + return (d); +} + +function dateToInt64(date) { + if (date.sourceInt64 !== undefined) + return (date.sourceInt64); + var i = Math.round(date.getTime() / 1000); + var upper = Math.floor(i / 4294967296); + var lower = Math.floor(i % 4294967296); + var buf = Buffer.alloc(8); + buf.writeUInt32BE(upper, 0); + buf.writeUInt32BE(lower, 4); + return (buf); +} + +function sign(cert, key) { + if (cert.signatures.openssh === undefined) + cert.signatures.openssh = {}; + try { + var blob = toBuffer(cert, true); + } catch (e) { + delete (cert.signatures.openssh); + return (false); + } + var sig = cert.signatures.openssh; + var hashAlgo = undefined; + if (key.type === 'rsa' || key.type === 'dsa') + hashAlgo = 'sha1'; + var signer = key.createSign(hashAlgo); + signer.write(blob); + sig.signature = signer.sign(); + return (true); +} + +function signAsync(cert, signer, done) { + if (cert.signatures.openssh === undefined) + cert.signatures.openssh = {}; + try { + var blob = toBuffer(cert, true); + } catch (e) { + delete (cert.signatures.openssh); + done(e); + return; + } + var sig = cert.signatures.openssh; + + signer(blob, function (err, signature) { + if (err) { + done(err); + return; + } + try { + /* + * This will throw if the signature isn't of a + * type/algo that can be used for SSH. + */ + signature.toBuffer('ssh'); + } catch (e) { + done(e); + return; + } + sig.signature = signature; + done(); + }); +} + +function write(cert, options) { + if (options === undefined) + options = {}; + + var blob = toBuffer(cert); + var out = getCertType(cert.subjectKey) + ' ' + blob.toString('base64'); + if (options.comment) + out = out + ' ' + options.comment; + return (out); +} + + +function toBuffer(cert, noSig) { + assert.object(cert.signatures.openssh, 'signature for openssh format'); + var sig = cert.signatures.openssh; + + if (sig.nonce === undefined) + sig.nonce = crypto.randomBytes(16); + var buf = new SSHBuffer({}); + buf.writeString(getCertType(cert.subjectKey)); + buf.writeBuffer(sig.nonce); + + var key = cert.subjectKey; + var algInfo = algs.info[key.type]; + algInfo.parts.forEach(function (part) { + buf.writePart(key.part[part]); + }); + + buf.writeInt64(cert.serial); + + var type = cert.subjects[0].type; + assert.notStrictEqual(type, 'unknown'); + cert.subjects.forEach(function (id) { + assert.strictEqual(id.type, type); + }); + type = TYPES[type]; + buf.writeInt(type); + + if (sig.keyId === undefined) { + sig.keyId = cert.subjects[0].type + '_' + + (cert.subjects[0].uid || cert.subjects[0].hostname); + } + buf.writeString(sig.keyId); + + var sub = new SSHBuffer({}); + cert.subjects.forEach(function (id) { + if (type === TYPES.host) + sub.writeString(id.hostname); + else if (type === TYPES.user) + sub.writeString(id.uid); + }); + buf.writeBuffer(sub.toBuffer()); + + buf.writeInt64(dateToInt64(cert.validFrom)); + buf.writeInt64(dateToInt64(cert.validUntil)); + + if (sig.critical === undefined) + sig.critical = Buffer.alloc(0); + buf.writeBuffer(sig.critical); + + if (sig.exts === undefined) + sig.exts = Buffer.alloc(0); + buf.writeBuffer(sig.exts); + + /* reserved */ + buf.writeBuffer(Buffer.alloc(0)); + + sub = rfc4253.write(cert.issuerKey); + buf.writeBuffer(sub); + + if (!noSig) + buf.writeBuffer(sig.signature.toBuffer('ssh')); + + return (buf.toBuffer()); +} + +function getAlg(certType) { + if (certType === 'ssh-rsa-cert-v01@openssh.com') + return ('rsa'); + if (certType === 'ssh-dss-cert-v01@openssh.com') + return ('dsa'); + if (certType.match(ECDSA_ALGO)) + return ('ecdsa'); + if (certType === 'ssh-ed25519-cert-v01@openssh.com') + return ('ed25519'); + throw (new Error('Unsupported cert type ' + certType)); +} + +function getCertType(key) { + if (key.type === 'rsa') + return ('ssh-rsa-cert-v01@openssh.com'); + if (key.type === 'dsa') + return ('ssh-dss-cert-v01@openssh.com'); + if (key.type === 'ecdsa') + return ('ecdsa-sha2-' + key.curve + '-cert-v01@openssh.com'); + if (key.type === 'ed25519') + return ('ssh-ed25519-cert-v01@openssh.com'); + throw (new Error('Unsupported key type ' + key.type)); +} + + +/***/ }), +/* 941 */ +/***/ (function(module, exports, __webpack_require__) { + +// Copyright 2016 Joyent, Inc. + +var x509 = __webpack_require__(457); + +module.exports = { + read: read, + verify: x509.verify, + sign: x509.sign, + write: write +}; + +var assert = __webpack_require__(16); +var asn1 = __webpack_require__(66); +var Buffer = __webpack_require__(15).Buffer; +var algs = __webpack_require__(32); +var utils = __webpack_require__(26); +var Key = __webpack_require__(27); +var PrivateKey = __webpack_require__(33); +var pem = __webpack_require__(86); +var Identity = __webpack_require__(158); +var Signature = __webpack_require__(75); +var Certificate = __webpack_require__(155); + +function read(buf, options) { + if (typeof (buf) !== 'string') { + assert.buffer(buf, 'buf'); + buf = buf.toString('ascii'); + } + + var lines = buf.trim().split(/[\r\n]+/g); + + var m = lines[0].match(/*JSSTYLED*/ + /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/); + assert.ok(m, 'invalid PEM header'); + + var m2 = lines[lines.length - 1].match(/*JSSTYLED*/ + /[-]+[ ]*END CERTIFICATE[ ]*[-]+/); + assert.ok(m2, 'invalid PEM footer'); + + var headers = {}; + while (true) { + lines = lines.slice(1); + m = lines[0].match(/*JSSTYLED*/ + /^([A-Za-z0-9-]+): (.+)$/); + if (!m) + break; + headers[m[1].toLowerCase()] = m[2]; + } + + /* Chop off the first and last lines */ + lines = lines.slice(0, -1).join(''); + buf = Buffer.from(lines, 'base64'); + + return (x509.read(buf, options)); +} + +function write(cert, options) { + var dbuf = x509.write(cert, options); + + var header = 'CERTIFICATE'; + var tmp = dbuf.toString('base64'); + var len = tmp.length + (tmp.length / 64) + + 18 + 16 + header.length*2 + 10; + var buf = Buffer.alloc(len); + var o = 0; + o += buf.write('-----BEGIN ' + header + '-----\n', o); + for (var i = 0; i < tmp.length; ) { + var limit = i + 64; + if (limit > tmp.length) + limit = tmp.length; + o += buf.write(tmp.slice(i, limit), o); + buf[o++] = 10; + i = limit; + } + o += buf.write('-----END ' + header + '-----\n', o); + + return (buf.slice(0, o)); +} + + +/***/ }), +/* 942 */ +/***/ (function(module, exports) { + +module.exports = shift + +function shift (stream) { + var rs = stream._readableState + if (!rs) return null + return rs.objectMode ? stream.read() : stream.read(getStateLength(rs)) +} + +function getStateLength (state) { + if (state.buffer.length) { + // Since node 6.3.0 state.buffer is a BufferList not an array + if (state.buffer.head) { + return state.buffer.head.data.length + } + + return state.buffer[0].length + } + + return state.length +} + + +/***/ }), +/* 943 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function (str) { + return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase(); + }); +}; + + +/***/ }), +/* 944 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var resolvePkg = __webpack_require__(679); + +/* @private + * + * given the name of a descendent module this module locates and returns its + * package.json. In addition, it provides the baseDir. + * + * @method pkg + * @param {String} name + * @param {String} dir (optional) root directory to begin resolution + */ +module.exports = function pkg(name, dir) { + if (name !== './') { name += '/'; } + + var packagePath = resolvePkg(name, dir); + if (packagePath === null) { return null; } + + var thePackage = require(packagePath); + + thePackage.baseDir = packagePath.slice(0, packagePath.length - 12 /* index of `/package.json` */); + + return thePackage; +}; + + +/***/ }), +/* 945 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var stripAnsi = __webpack_require__(947); +var codePointAt = __webpack_require__(607); +var isFullwidthCodePoint = __webpack_require__(946); + +// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345 +module.exports = function (str) { + if (typeof str !== 'string' || str.length === 0) { + return 0; + } + + var width = 0; + + str = stripAnsi(str); + + for (var i = 0; i < str.length; i++) { + var code = codePointAt(str, i); + + // ignore control characters + if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) { + continue; + } + + // surrogates + if (code >= 0x10000) { + i++; + } + + if (isFullwidthCodePoint(code)) { + width += 2; + } else { + width++; + } + } + + return width; +}; + + +/***/ }), +/* 946 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var numberIsNan = __webpack_require__(767); + +module.exports = function (x) { + if (numberIsNan(x)) { + return false; + } + + // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369 + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if (x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + 0x2329 === x || // LEFT-POINTING ANGLE BRACKET + 0x232a === x || // 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; +} + + +/***/ }), +/* 947 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var ansiRegex = __webpack_require__(505)(); + +module.exports = function (str) { + return typeof str === 'string' ? str.replace(ansiRegex, '') : str; +}; + + +/***/ }), +/* 948 */ +/***/ (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'); +}; + + +/***/ }), +/* 949 */ +/***/ (function(module, exports, __webpack_require__) { + +var util = __webpack_require__(3) +var bl = __webpack_require__(592) +var xtend = __webpack_require__(465) +var headers = __webpack_require__(459) + +var Writable = __webpack_require__(102).Writable +var PassThrough = __webpack_require__(102).PassThrough + +var noop = function () {} + +var overflow = function (size) { + size &= 511 + return size && 512 - size +} + +var emptyStream = function (self, offset) { + var s = new Source(self, offset) + s.end() + return s +} + +var mixinPax = function (header, pax) { + if (pax.path) header.name = pax.path + if (pax.linkpath) header.linkname = pax.linkpath + if (pax.size) header.size = parseInt(pax.size, 10) + header.pax = pax + return header +} + +var Source = function (self, offset) { + this._parent = self + this.offset = offset + PassThrough.call(this) +} + +util.inherits(Source, PassThrough) + +Source.prototype.destroy = function (err) { + this._parent.destroy(err) +} + +var Extract = function (opts) { + if (!(this instanceof Extract)) return new Extract(opts) + Writable.call(this, opts) + + opts = opts || {} + + this._offset = 0 + this._buffer = bl() + this._missing = 0 + this._partial = false + this._onparse = noop + this._header = null + this._stream = null + this._overflow = null + this._cb = null + this._locked = false + this._destroyed = false + this._pax = null + this._paxGlobal = null + this._gnuLongPath = null + this._gnuLongLinkPath = null + + var self = this + var b = self._buffer + + var oncontinue = function () { + self._continue() + } + + var onunlock = function (err) { + self._locked = false + if (err) return self.destroy(err) + if (!self._stream) oncontinue() + } + + var onstreamend = function () { + self._stream = null + var drain = overflow(self._header.size) + if (drain) self._parse(drain, ondrain) + else self._parse(512, onheader) + if (!self._locked) oncontinue() + } + + var ondrain = function () { + self._buffer.consume(overflow(self._header.size)) + self._parse(512, onheader) + oncontinue() + } + + var onpaxglobalheader = function () { + var size = self._header.size + self._paxGlobal = headers.decodePax(b.slice(0, size)) + b.consume(size) + onstreamend() + } + + var onpaxheader = function () { + var size = self._header.size + self._pax = headers.decodePax(b.slice(0, size)) + if (self._paxGlobal) self._pax = xtend(self._paxGlobal, self._pax) + b.consume(size) + onstreamend() + } + + var ongnulongpath = function () { + var size = self._header.size + this._gnuLongPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding) + b.consume(size) + onstreamend() + } + + var ongnulonglinkpath = function () { + var size = self._header.size + this._gnuLongLinkPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding) + b.consume(size) + onstreamend() + } + + var onheader = function () { + var offset = self._offset + var header + try { + header = self._header = headers.decode(b.slice(0, 512), opts.filenameEncoding) + } catch (err) { + self.emit('error', err) + } + b.consume(512) + + if (!header) { + self._parse(512, onheader) + oncontinue() + return + } + if (header.type === 'gnu-long-path') { + self._parse(header.size, ongnulongpath) + oncontinue() + return + } + if (header.type === 'gnu-long-link-path') { + self._parse(header.size, ongnulonglinkpath) + oncontinue() + return + } + if (header.type === 'pax-global-header') { + self._parse(header.size, onpaxglobalheader) + oncontinue() + return + } + if (header.type === 'pax-header') { + self._parse(header.size, onpaxheader) + oncontinue() + return + } + + if (self._gnuLongPath) { + header.name = self._gnuLongPath + self._gnuLongPath = null + } + + if (self._gnuLongLinkPath) { + header.linkname = self._gnuLongLinkPath + self._gnuLongLinkPath = null + } + + if (self._pax) { + self._header = header = mixinPax(header, self._pax) + self._pax = null + } + + self._locked = true + + if (!header.size || header.type === 'directory') { + self._parse(512, onheader) + self.emit('entry', header, emptyStream(self, offset), onunlock) + return + } + + self._stream = new Source(self, offset) + + self.emit('entry', header, self._stream, onunlock) + self._parse(header.size, onstreamend) + oncontinue() + } + + this._onheader = onheader + this._parse(512, onheader) +} + +util.inherits(Extract, Writable) + +Extract.prototype.destroy = function (err) { + if (this._destroyed) return + this._destroyed = true + + if (err) this.emit('error', err) + this.emit('close') + if (this._stream) this._stream.emit('close') +} + +Extract.prototype._parse = function (size, onparse) { + if (this._destroyed) return + this._offset += size + this._missing = size + if (onparse === this._onheader) this._partial = false + this._onparse = onparse +} + +Extract.prototype._continue = function () { + if (this._destroyed) return + var cb = this._cb + this._cb = noop + if (this._overflow) this._write(this._overflow, undefined, cb) + else cb() +} + +Extract.prototype._write = function (data, enc, cb) { + if (this._destroyed) return + + var s = this._stream + var b = this._buffer + var missing = this._missing + if (data.length) this._partial = true + + // we do not reach end-of-chunk now. just forward it + + if (data.length < missing) { + this._missing -= data.length + this._overflow = null + if (s) return s.write(data, cb) + b.append(data) + return cb() + } + + // end-of-chunk. the parser should call cb. + + this._cb = cb + this._missing = 0 + + var overflow = null + if (data.length > missing) { + overflow = data.slice(missing) + data = data.slice(0, missing) + } + + if (s) s.end(data) + else b.append(data) + + this._overflow = overflow + this._onparse() +} + +Extract.prototype._final = function (cb) { + if (this._partial) return this.destroy(new Error('Unexpected end of data')) + cb() +} + +module.exports = Extract + + +/***/ }), +/* 950 */ +/***/ (function(module, exports, __webpack_require__) { + +var constants = __webpack_require__(651) +var eos = __webpack_require__(173) +var util = __webpack_require__(3) +var alloc = __webpack_require__(380) +var toBuffer = __webpack_require__(462) + +var Readable = __webpack_require__(102).Readable +var Writable = __webpack_require__(102).Writable +var StringDecoder = __webpack_require__(333).StringDecoder + +var headers = __webpack_require__(459) + +var DMODE = parseInt('755', 8) +var FMODE = parseInt('644', 8) + +var END_OF_TAR = alloc(1024) + +var noop = function () {} + +var overflow = function (self, size) { + size &= 511 + if (size) self.push(END_OF_TAR.slice(0, 512 - size)) +} + +function modeToType (mode) { + switch (mode & constants.S_IFMT) { + case constants.S_IFBLK: return 'block-device' + case constants.S_IFCHR: return 'character-device' + case constants.S_IFDIR: return 'directory' + case constants.S_IFIFO: return 'fifo' + case constants.S_IFLNK: return 'symlink' + } + + return 'file' +} + +var Sink = function (to) { + Writable.call(this) + this.written = 0 + this._to = to + this._destroyed = false +} + +util.inherits(Sink, Writable) + +Sink.prototype._write = function (data, enc, cb) { + this.written += data.length + if (this._to.push(data)) return cb() + this._to._drain = cb +} + +Sink.prototype.destroy = function () { + if (this._destroyed) return + this._destroyed = true + this.emit('close') +} + +var LinkSink = function () { + Writable.call(this) + this.linkname = '' + this._decoder = new StringDecoder('utf-8') + this._destroyed = false +} + +util.inherits(LinkSink, Writable) + +LinkSink.prototype._write = function (data, enc, cb) { + this.linkname += this._decoder.write(data) + cb() +} + +LinkSink.prototype.destroy = function () { + if (this._destroyed) return + this._destroyed = true + this.emit('close') +} + +var Void = function () { + Writable.call(this) + this._destroyed = false +} + +util.inherits(Void, Writable) + +Void.prototype._write = function (data, enc, cb) { + cb(new Error('No body allowed for this entry')) +} + +Void.prototype.destroy = function () { + if (this._destroyed) return + this._destroyed = true + this.emit('close') +} + +var Pack = function (opts) { + if (!(this instanceof Pack)) return new Pack(opts) + Readable.call(this, opts) + + this._drain = noop + this._finalized = false + this._finalizing = false + this._destroyed = false + this._stream = null +} + +util.inherits(Pack, Readable) + +Pack.prototype.entry = function (header, buffer, callback) { + if (this._stream) throw new Error('already piping an entry') + if (this._finalized || this._destroyed) return + + if (typeof buffer === 'function') { + callback = buffer + buffer = null + } + + if (!callback) callback = noop + + var self = this + + if (!header.size || header.type === 'symlink') header.size = 0 + if (!header.type) header.type = modeToType(header.mode) + if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE + if (!header.uid) header.uid = 0 + if (!header.gid) header.gid = 0 + if (!header.mtime) header.mtime = new Date() + + if (typeof buffer === 'string') buffer = toBuffer(buffer) + if (Buffer.isBuffer(buffer)) { + header.size = buffer.length + this._encode(header) + this.push(buffer) + overflow(self, header.size) + process.nextTick(callback) + return new Void() + } + + if (header.type === 'symlink' && !header.linkname) { + var linkSink = new LinkSink() + eos(linkSink, function (err) { + if (err) { // stream was closed + self.destroy() + return callback(err) + } + + header.linkname = linkSink.linkname + self._encode(header) + callback() + }) + + return linkSink + } + + this._encode(header) + + if (header.type !== 'file' && header.type !== 'contiguous-file') { + process.nextTick(callback) + return new Void() + } + + var sink = new Sink(this) + + this._stream = sink + + eos(sink, function (err) { + self._stream = null + + if (err) { // stream was closed + self.destroy() + return callback(err) + } + + if (sink.written !== header.size) { // corrupting tar + self.destroy() + return callback(new Error('size mismatch')) + } + + overflow(self, header.size) + if (self._finalizing) self.finalize() + callback() + }) + + return sink +} + +Pack.prototype.finalize = function () { + if (this._stream) { + this._finalizing = true + return + } + + if (this._finalized) return + this._finalized = true + this.push(END_OF_TAR) + this.push(null) +} + +Pack.prototype.destroy = function (err) { + if (this._destroyed) return + this._destroyed = true + + if (err) this.emit('error', err) + this.emit('close') + if (this._stream && this._stream.destroy) this._stream.destroy() +} + +Pack.prototype._encode = function (header) { + if (!header.pax) { + var buf = headers.encode(header) + if (buf) { + this.push(buf) + return + } + } + this._encodePax(header) +} + +Pack.prototype._encodePax = function (header) { + var paxHeader = headers.encodePax({ + name: header.name, + linkname: header.linkname, + pax: header.pax + }) + + var newHeader = { + name: 'PaxHeader', + mode: header.mode, + uid: header.uid, + gid: header.gid, + size: paxHeader.length, + mtime: header.mtime, + type: 'pax-header', + linkname: header.linkname && 'PaxHeader', + uname: header.uname, + gname: header.gname, + devmajor: header.devmajor, + devminor: header.devminor + } + + this.push(headers.encode(newHeader)) + this.push(paxHeader) + overflow(this, paxHeader.length) + + newHeader.size = header.size + newHeader.type = header.type + this.push(headers.encode(newHeader)) +} + +Pack.prototype._read = function (n) { + var drain = this._drain + this._drain = noop + drain() +} + +module.exports = Pack + + +/***/ }), +/* 951 */ +/***/ (function(module, exports, __webpack_require__) { + + +var thenify = __webpack_require__(952) + +module.exports = thenifyAll +thenifyAll.withCallback = withCallback +thenifyAll.thenify = thenify + +/** + * Promisifies all the selected functions in an object. + * + * @param {Object} source the source object for the async functions + * @param {Object} [destination] the destination to set all the promisified methods + * @param {Array} [methods] an array of method names of `source` + * @return {Object} + * @api public + */ + +function thenifyAll(source, destination, methods) { + return promisifyAll(source, destination, methods, thenify) +} + +/** + * Promisifies all the selected functions in an object and backward compatible with callback. + * + * @param {Object} source the source object for the async functions + * @param {Object} [destination] the destination to set all the promisified methods + * @param {Array} [methods] an array of method names of `source` + * @return {Object} + * @api public + */ + +function withCallback(source, destination, methods) { + return promisifyAll(source, destination, methods, thenify.withCallback) +} + +function promisifyAll(source, destination, methods, promisify) { + if (!destination) { + destination = {}; + methods = Object.keys(source) + } + + if (Array.isArray(destination)) { + methods = destination + destination = {} + } + + if (!methods) { + methods = Object.keys(source) + } + + if (typeof source === 'function') destination = promisify(source) + + methods.forEach(function (name) { + // promisify only if it's a function + if (typeof source[name] === 'function') destination[name] = promisify(source[name]) + }) + + // proxy the rest + Object.keys(source).forEach(function (name) { + if (deprecated(source, name)) return + if (destination[name]) return + destination[name] = source[name] + }) + + return destination +} + +function deprecated(source, name) { + var desc = Object.getOwnPropertyDescriptor(source, name) + if (!desc || !desc.get) return false + if (desc.get.name === 'deprecated') return true + return false +} + + +/***/ }), +/* 952 */ +/***/ (function(module, exports, __webpack_require__) { + + +var Promise = __webpack_require__(345) +var assert = __webpack_require__(28) + +module.exports = thenify + +/** + * Turn async functions into promises + * + * @param {Function} $$__fn__$$ + * @return {Function} + * @api public + */ + +function thenify($$__fn__$$, options) { + assert(typeof $$__fn__$$ === 'function') + return eval(createWrapper($$__fn__$$.name, options)) +} + +/** + * Turn async functions into promises and backward compatible with callback + * + * @param {Function} $$__fn__$$ + * @return {Function} + * @api public + */ + +thenify.withCallback = function ($$__fn__$$, options) { + assert(typeof $$__fn__$$ === 'function') + options = options || {} + options.withCallback = true + if (options.multiArgs === undefined) options.multiArgs = true + return eval(createWrapper($$__fn__$$.name, options)) +} + +function createCallback(resolve, reject, multiArgs) { + return function(err, value) { + if (err) return reject(err) + var length = arguments.length + + if (length <= 2 || !multiArgs) return resolve(value) + + if (Array.isArray(multiArgs)) { + var values = {} + for (var i = 1; i < length; i++) values[multiArgs[i - 1]] = arguments[i] + return resolve(values) + } + + var values = new Array(length - 1) + for (var i = 1; i < length; ++i) values[i - 1] = arguments[i] + resolve(values) + } +} + +function createWrapper(name, options) { + name = (name || '').replace(/\s|bound(?!$)/g, '') + options = options || {} + // default to true + var multiArgs = options.multiArgs !== undefined ? options.multiArgs : true + multiArgs = 'var multiArgs = ' + JSON.stringify(multiArgs) + '\n' + + var withCallback = options.withCallback ? + 'var lastType = typeof arguments[len - 1]\n' + + 'if (lastType === "function") return $$__fn__$$.apply(self, arguments)\n' + : '' + + return '(function ' + name + '() {\n' + + 'var self = this\n' + + 'var len = arguments.length\n' + + multiArgs + + withCallback + + 'var args = new Array(len + 1)\n' + + 'for (var i = 0; i < len; ++i) args[i] = arguments[i]\n' + + 'var lastIndex = i\n' + + 'return new Promise(function (resolve, reject) {\n' + + 'args[lastIndex] = createCallback(resolve, reject, multiArgs)\n' + + '$$__fn__$$.apply(self, args)\n' + + '})\n' + + '})' +} + + +/***/ }), +/* 953 */ +/***/ (function(module, exports, __webpack_require__) { + +var Stream = __webpack_require__(23) + +// 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 +} + + + +/***/ }), +/* 954 */ +/***/ (function(module, exports, __webpack_require__) { + +/*! + * Tmp + * + * Copyright (c) 2011-2017 KARASZI Istvan + * + * MIT Licensed + */ + +/* + * Module dependencies. + */ +const fs = __webpack_require__(5); +const path = __webpack_require__(0); +const crypto = __webpack_require__(11); +const osTmpDir = __webpack_require__(772); +const _c = process.binding('constants'); + +/* + * The working inner variables. + */ +const + /** + * The temporary directory. + * @type {string} + */ + tmpDir = osTmpDir(), + + // the random characters to choose from + RANDOM_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', + + TEMPLATE_PATTERN = /XXXXXX/, + + DEFAULT_TRIES = 3, + + CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR), + + EBADF = _c.EBADF || _c.os.errno.EBADF, + ENOENT = _c.ENOENT || _c.os.errno.ENOENT, + + DIR_MODE = 448 /* 0o700 */, + FILE_MODE = 384 /* 0o600 */, + + // this will hold the objects need to be removed on exit + _removeObjects = []; + +var + _gracefulCleanup = false, + _uncaughtException = false; + +/** + * Random name generator based on crypto. + * Adapted from http://blog.tompawlak.org/how-to-generate-random-values-nodejs-javascript + * + * @param {number} howMany + * @returns {string} the generated random name + * @private + */ +function _randomChars(howMany) { + var + value = [], + rnd = null; + + // make sure that we do not fail because we ran out of entropy + try { + rnd = crypto.randomBytes(howMany); + } catch (e) { + rnd = crypto.pseudoRandomBytes(howMany); + } + + for (var i = 0; i < howMany; i++) { + value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); + } + + return value.join(''); +} + +/** + * Checks whether the `obj` parameter is defined or not. + * + * @param {Object} obj + * @returns {boolean} true if the object is undefined + * @private + */ +function _isUndefined(obj) { + return typeof obj === 'undefined'; +} + +/** + * Parses the function arguments. + * + * This function helps to have optional arguments. + * + * @param {(Options|Function)} options + * @param {Function} callback + * @returns {Array} parsed arguments + * @private + */ +function _parseArguments(options, callback) { + if (typeof options == 'function') { + return [callback || {}, options]; + } + + if (_isUndefined(options)) { + return [{}, callback]; + } + + return [options, callback]; +} + +/** + * Generates a new temporary name. + * + * @param {Object} opts + * @returns {string} the new random name according to opts + * @private + */ +function _generateTmpName(opts) { + if (opts.name) { + return path.join(opts.dir || tmpDir, opts.name); + } + + // mkstemps like template + if (opts.template) { + return opts.template.replace(TEMPLATE_PATTERN, _randomChars(6)); + } + + // prefix and postfix + const name = [ + opts.prefix || 'tmp-', + process.pid, + _randomChars(12), + opts.postfix || '' + ].join(''); + + return path.join(opts.dir || tmpDir, name); +} + +/** + * Gets a temporary file name. + * + * @param {(Options|tmpNameCallback)} options options or callback + * @param {?tmpNameCallback} callback the callback function + */ +function tmpName(options, callback) { + var + args = _parseArguments(options, callback), + opts = args[0], + cb = args[1], + tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES; + + if (isNaN(tries) || tries < 0) + return cb(new Error('Invalid tries')); + + if (opts.template && !opts.template.match(TEMPLATE_PATTERN)) + return cb(new Error('Invalid template provided')); + + (function _getUniqueName() { + const name = _generateTmpName(opts); + + // check whether the path exists then retry if needed + fs.stat(name, function (err) { + if (!err) { + if (tries-- > 0) return _getUniqueName(); + + return cb(new Error('Could not get a unique tmp filename, max tries reached ' + name)); + } + + cb(null, name); + }); + }()); +} + +/** + * Synchronous version of tmpName. + * + * @param {Object} options + * @returns {string} the generated random name + * @throws {Error} if the options are invalid or could not generate a filename + */ +function tmpNameSync(options) { + var + args = _parseArguments(options), + opts = args[0], + tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES; + + if (isNaN(tries) || tries < 0) + throw new Error('Invalid tries'); + + if (opts.template && !opts.template.match(TEMPLATE_PATTERN)) + throw new Error('Invalid template provided'); + + do { + const name = _generateTmpName(opts); + try { + fs.statSync(name); + } catch (e) { + return name; + } + } while (tries-- > 0); + + throw new Error('Could not get a unique tmp filename, max tries reached'); +} + +/** + * Creates and opens a temporary file. + * + * @param {(Options|fileCallback)} options the config options or the callback function + * @param {?fileCallback} callback + */ +function file(options, callback) { + var + args = _parseArguments(options, callback), + opts = args[0], + cb = args[1]; + + opts.postfix = (_isUndefined(opts.postfix)) ? '.tmp' : opts.postfix; + + // gets a temporary filename + tmpName(opts, function _tmpNameCreated(err, name) { + if (err) return cb(err); + + // create and open the file + fs.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err, fd) { + if (err) return cb(err); + + if (opts.discardDescriptor) { + return fs.close(fd, function _discardCallback(err) { + if (err) { + // Low probability, and the file exists, so this could be + // ignored. If it isn't we certainly need to unlink the + // file, and if that fails too its error is more + // important. + try { + fs.unlinkSync(name); + } catch (e) { + if (!isENOENT(e)) { + err = e; + } + } + return cb(err); + } + cb(null, name, undefined, _prepareTmpFileRemoveCallback(name, -1, opts)); + }); + } + if (opts.detachDescriptor) { + return cb(null, name, fd, _prepareTmpFileRemoveCallback(name, -1, opts)); + } + cb(null, name, fd, _prepareTmpFileRemoveCallback(name, fd, opts)); + }); + }); +} + +/** + * Synchronous version of file. + * + * @param {Options} options + * @returns {FileSyncObject} object consists of name, fd and removeCallback + * @throws {Error} if cannot create a file + */ +function fileSync(options) { + var + args = _parseArguments(options), + opts = args[0]; + + opts.postfix = opts.postfix || '.tmp'; + + const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; + const name = tmpNameSync(opts); + var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); + if (opts.discardDescriptor) { + fs.closeSync(fd); + fd = undefined; + } + + return { + name: name, + fd: fd, + removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts) + }; +} + +/** + * Removes files and folders in a directory recursively. + * + * @param {string} root + * @private + */ +function _rmdirRecursiveSync(root) { + const dirs = [root]; + + do { + var + dir = dirs.pop(), + deferred = false, + files = fs.readdirSync(dir); + + for (var i = 0, length = files.length; i < length; i++) { + var + file = path.join(dir, files[i]), + stat = fs.lstatSync(file); // lstat so we don't recurse into symlinked directories + + if (stat.isDirectory()) { + if (!deferred) { + deferred = true; + dirs.push(dir); + } + dirs.push(file); + } else { + fs.unlinkSync(file); + } + } + + if (!deferred) { + fs.rmdirSync(dir); + } + } while (dirs.length !== 0); +} + +/** + * Creates a temporary directory. + * + * @param {(Options|dirCallback)} options the options or the callback function + * @param {?dirCallback} callback + */ +function dir(options, callback) { + var + args = _parseArguments(options, callback), + opts = args[0], + cb = args[1]; + + // gets a temporary filename + tmpName(opts, function _tmpNameCreated(err, name) { + if (err) return cb(err); + + // create the directory + fs.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err) { + if (err) return cb(err); + + cb(null, name, _prepareTmpDirRemoveCallback(name, opts)); + }); + }); +} + +/** + * Synchronous version of dir. + * + * @param {Options} options + * @returns {DirSyncObject} object consists of name and removeCallback + * @throws {Error} if it cannot create a directory + */ +function dirSync(options) { + var + args = _parseArguments(options), + opts = args[0]; + + const name = tmpNameSync(opts); + fs.mkdirSync(name, opts.mode || DIR_MODE); + + return { + name: name, + removeCallback: _prepareTmpDirRemoveCallback(name, opts) + }; +} + +/** + * Prepares the callback for removal of the temporary file. + * + * @param {string} name the path of the file + * @param {number} fd file descriptor + * @param {Object} opts + * @returns {fileCallback} + * @private + */ +function _prepareTmpFileRemoveCallback(name, fd, opts) { + const removeCallback = _prepareRemoveCallback(function _removeCallback(fdPath) { + try { + if (0 <= fdPath[0]) { + fs.closeSync(fdPath[0]); + } + } + catch (e) { + // under some node/windows related circumstances, a temporary file + // may have not be created as expected or the file was already closed + // by the user, in which case we will simply ignore the error + if (!isEBADF(e) && !isENOENT(e)) { + // reraise any unanticipated error + throw e; + } + } + try { + fs.unlinkSync(fdPath[1]); + } + catch (e) { + if (!isENOENT(e)) { + // reraise any unanticipated error + throw e; + } + } + }, [fd, name]); + + if (!opts.keep) { + _removeObjects.unshift(removeCallback); + } + + return removeCallback; +} + +/** + * Prepares the callback for removal of the temporary directory. + * + * @param {string} name + * @param {Object} opts + * @returns {Function} the callback + * @private + */ +function _prepareTmpDirRemoveCallback(name, opts) { + const removeFunction = opts.unsafeCleanup ? _rmdirRecursiveSync : fs.rmdirSync.bind(fs); + const removeCallback = _prepareRemoveCallback(removeFunction, name); + + if (!opts.keep) { + _removeObjects.unshift(removeCallback); + } + + return removeCallback; +} + +/** + * Creates a guarded function wrapping the removeFunction call. + * + * @param {Function} removeFunction + * @param {Object} arg + * @returns {Function} + * @private + */ +function _prepareRemoveCallback(removeFunction, arg) { + var called = false; + + return function _cleanupCallback(next) { + if (!called) { + const index = _removeObjects.indexOf(_cleanupCallback); + if (index >= 0) { + _removeObjects.splice(index, 1); + } + + called = true; + removeFunction(arg); + } + + if (next) next(null); + }; +} + +/** + * The garbage collector. + * + * @private + */ +function _garbageCollector() { + if (_uncaughtException && !_gracefulCleanup) { + return; + } + + // the function being called removes itself from _removeObjects, + // loop until _removeObjects is empty + while (_removeObjects.length) { + try { + _removeObjects[0].call(null); + } catch (e) { + // already removed? + } + } +} + +/** + * Helper for testing against EBADF to compensate changes made to Node 7.x under Windows. + */ +function isEBADF(error) { + return isExpectedError(error, -EBADF, 'EBADF'); +} + +/** + * Helper for testing against ENOENT to compensate changes made to Node 7.x under Windows. + */ +function isENOENT(error) { + return isExpectedError(error, -ENOENT, 'ENOENT'); +} + +/** + * Helper to determine whether the expected error code matches the actual code and errno, + * which will differ between the supported node versions. + * + * - Node >= 7.0: + * error.code {String} + * error.errno {String|Number} any numerical value will be negated + * + * - Node >= 6.0 < 7.0: + * error.code {String} + * error.errno {Number} negated + * + * - Node >= 4.0 < 6.0: introduces SystemError + * error.code {String} + * error.errno {Number} negated + * + * - Node >= 0.10 < 4.0: + * error.code {Number} negated + * error.errno n/a + */ +function isExpectedError(error, code, errno) { + return error.code == code || error.code == errno; +} + +/** + * Sets the graceful cleanup. + * + * Also removes the created files and directories when an uncaught exception occurs. + */ +function setGracefulCleanup() { + _gracefulCleanup = true; +} + +const version = process.versions.node.split('.').map(function (value) { + return parseInt(value, 10); +}); + +if (version[0] === 0 && (version[1] < 9 || version[1] === 9 && version[2] < 5)) { + process.addListener('uncaughtException', function _uncaughtExceptionThrown(err) { + _uncaughtException = true; + _garbageCollector(); + + throw err; + }); +} + +process.addListener('exit', function _exit(code) { + if (code) _uncaughtException = true; + _garbageCollector(); +}); + +/** + * Configuration options. + * + * @typedef {Object} Options + * @property {?number} tries the number of tries before give up the name generation + * @property {?string} template the "mkstemp" like filename template + * @property {?string} name fix name + * @property {?string} dir the tmp directory to use + * @property {?string} prefix prefix for the generated name + * @property {?string} postfix postfix for the generated name + */ + +/** + * @typedef {Object} FileSyncObject + * @property {string} name the name of the file + * @property {string} fd the file descriptor + * @property {fileCallback} removeCallback the callback function to remove the file + */ + +/** + * @typedef {Object} DirSyncObject + * @property {string} name the name of the directory + * @property {fileCallback} removeCallback the callback function to remove the directory + */ + +/** + * @callback tmpNameCallback + * @param {?Error} err the error object if anything goes wrong + * @param {string} name the temporary file name + */ + +/** + * @callback fileCallback + * @param {?Error} err the error object if anything goes wrong + * @param {string} name the temporary file name + * @param {number} fd the file descriptor + * @param {cleanupCallback} fn the cleanup callback function + */ + +/** + * @callback dirCallback + * @param {?Error} err the error object if anything goes wrong + * @param {string} name the temporary file name + * @param {cleanupCallback} fn the cleanup callback function + */ + +/** + * Removes the temporary created file or directory. + * + * @callback cleanupCallback + * @param {simpleCallback} [next] function to call after entry was removed + */ + +/** + * Callback function for function composition. + * @see {@link https://github.com/raszi/node-tmp/issues/57|raszi/node-tmp#57} + * + * @callback simpleCallback + */ + +// exporting all the needed methods +module.exports.tmpdir = tmpDir; + +module.exports.dir = dir; +module.exports.dirSync = dirSync; + +module.exports.file = file; +module.exports.fileSync = fileSync; + +module.exports.tmpName = tmpName; +module.exports.tmpNameSync = tmpNameSync; + +module.exports.setGracefulCleanup = setGracefulCleanup; + + +/***/ }), +/* 955 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var net = __webpack_require__(164) + , tls = __webpack_require__(467) + , http = __webpack_require__(87) + , https = __webpack_require__(195) + , events = __webpack_require__(77) + , assert = __webpack_require__(28) + , util = __webpack_require__(3) + , Buffer = __webpack_require__(45).Buffer ; exports.httpOverHttp = httpOverHttp @@ -135702,7 +146208,7 @@ exports.debug = debug // for test /***/ }), -/* 666 */ +/* 956 */ /***/ (function(module, exports, __webpack_require__) { @@ -135710,38 +146216,27 @@ exports.debug = debug // for test * For Node.js, simply re-export the core `util.deprecate` function. */ -module.exports = __webpack_require__(2).deprecate; +module.exports = __webpack_require__(3).deprecate; /***/ }), -/* 667 */ +/* 957 */ /***/ (function(module, exports, __webpack_require__) { -// Unique ID creation requires a high quality random # generator. We feature -// detect to determine the best RNG source, normalizing to a function that -// returns 128-bits of randomness, since that's what's usually required -var rng = __webpack_require__(332); -var bytesToUuid = __webpack_require__(331); +var rng = __webpack_require__(464); +var bytesToUuid = __webpack_require__(463); // **`v1()` - Generate time-based UUID** // // Inspired by https://github.com/LiosK/UUID.js // and http://docs.python.org/library/uuid.html -// random #'s we need to init node and clockseq -var _seedBytes = rng(); - -// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) -var _nodeId = [ - _seedBytes[0] | 0x01, - _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] -]; - -// Per 4.2.2, randomize (14 bit) clockseq -var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; +var _nodeId; +var _clockseq; // Previous uuid creation time -var _lastMSecs = 0, _lastNSecs = 0; +var _lastMSecs = 0; +var _lastNSecs = 0; // See https://github.com/broofa/node-uuid for API details function v1(options, buf, offset) { @@ -135749,9 +146244,27 @@ function v1(options, buf, offset) { var b = buf || []; options = options || {}; - + var node = options.node || _nodeId; var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; + // node and clockseq need to be initialized to random values if they're not + // specified. We do this lazily to minimize issues related to insufficient + // system entropy. See #189 + if (node == null || clockseq == null) { + var seedBytes = rng(); + if (node == null) { + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + node = _nodeId = [ + seedBytes[0] | 0x01, + seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5] + ]; + } + if (clockseq == null) { + // Per 4.2.2, randomize (14 bit) clockseq + clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff; + } + } + // UUID timestamps are 100 nano-second units since the Gregorian epoch, // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' @@ -135811,7 +146324,6 @@ function v1(options, buf, offset) { b[i++] = clockseq & 0xff; // `node` - var node = options.node || _nodeId; for (var n = 0; n < 6; ++n) { b[i + n] = node[n]; } @@ -135823,17 +146335,17 @@ module.exports = v1; /***/ }), -/* 668 */ +/* 958 */ /***/ (function(module, exports, __webpack_require__) { -var rng = __webpack_require__(332); -var bytesToUuid = __webpack_require__(331); +var rng = __webpack_require__(464); +var bytesToUuid = __webpack_require__(463); function v4(options, buf, offset) { var i = buf && offset || 0; if (typeof(options) == 'string') { - buf = options == 'binary' ? new Array(16) : null; + buf = options === 'binary' ? new Array(16) : null; options = null; } options = options || {}; @@ -135858,11 +146370,11 @@ module.exports = v4; /***/ }), -/* 669 */ +/* 959 */ /***/ (function(module, exports, __webpack_require__) { -var parse = __webpack_require__(647); -var correct = __webpack_require__(646); +var parse = __webpack_require__(452); +var correct = __webpack_require__(935); var genericWarning = ( 'license should be ' + @@ -135920,11 +146432,13 @@ module.exports = function(argument) { validForNewPackages: false, warnings: [genericWarning] }; - var corrected = correct(argument); - if (corrected) { - result.warnings.push( - 'license is similar to the valid expression "' + corrected + '"' - ); + if (argument.trim().length !== 0) { + var corrected = correct(argument); + if (corrected) { + result.warnings.push( + 'license is similar to the valid expression "' + corrected + '"' + ); + } } return result; } @@ -135948,65 +146462,219 @@ module.exports = function(argument) { /***/ }), -/* 670 */ +/* 960 */ /***/ (function(module, exports, __webpack_require__) { /* * verror.js: richer JavaScript errors */ -var mod_assert = __webpack_require__(20); -var mod_util = __webpack_require__(2); +var mod_assertplus = __webpack_require__(16); +var mod_util = __webpack_require__(3); -var mod_extsprintf = __webpack_require__(290); +var mod_extsprintf = __webpack_require__(961); +var mod_isError = __webpack_require__(113).isError; +var sprintf = mod_extsprintf.sprintf; /* * Public interface */ -exports.VError = VError; -exports.WError = WError; -exports.MultiError = MultiError; + +/* So you can 'var VError = require('verror')' */ +module.exports = VError; +/* For compatibility */ +VError.VError = VError; +/* Other exported classes */ +VError.SError = SError; +VError.WError = WError; +VError.MultiError = MultiError; /* - * Like JavaScript's built-in Error class, but supports a "cause" argument and a - * printf-style message. The cause argument can be null. + * Common function used to parse constructor arguments for VError, WError, and + * SError. Named arguments to this function: + * + * strict force strict interpretation of sprintf arguments, even + * if the options in "argv" don't say so + * + * argv error's constructor arguments, which are to be + * interpreted as described in README.md. For quick + * reference, "argv" has one of the following forms: + * + * [ sprintf_args... ] (argv[0] is a string) + * [ cause, sprintf_args... ] (argv[0] is an Error) + * [ options, sprintf_args... ] (argv[0] is an object) + * + * This function normalizes these forms, producing an object with the following + * properties: + * + * options equivalent to "options" in third form. This will never + * be a direct reference to what the caller passed in + * (i.e., it may be a shallow copy), so it can be freely + * modified. + * + * shortmessage result of sprintf(sprintf_args), taking options.strict + * into account as described in README.md. */ -function VError(options) +function parseConstructorArguments(args) { - var args, causedBy, ctor, tailmsg; + var argv, options, sprintf_args, shortmessage, k; - if (options instanceof Error || typeof (options) === 'object') { - args = Array.prototype.slice.call(arguments, 1); + mod_assertplus.object(args, 'args'); + mod_assertplus.bool(args.strict, 'args.strict'); + mod_assertplus.array(args.argv, 'args.argv'); + argv = args.argv; + + /* + * First, figure out which form of invocation we've been given. + */ + if (argv.length === 0) { + options = {}; + sprintf_args = []; + } else if (mod_isError(argv[0])) { + options = { 'cause': argv[0] }; + sprintf_args = argv.slice(1); + } else if (typeof (argv[0]) === 'object') { + options = {}; + for (k in argv[0]) { + options[k] = argv[0][k]; + } + sprintf_args = argv.slice(1); } else { - args = Array.prototype.slice.call(arguments, 0); - options = undefined; + mod_assertplus.string(argv[0], + 'first argument to VError, SError, or WError ' + + 'constructor must be a string, object, or Error'); + options = {}; + sprintf_args = argv; } - tailmsg = args.length > 0 ? - mod_extsprintf.sprintf.apply(null, args) : ''; - this.jse_shortmsg = tailmsg; - this.jse_summary = tailmsg; + /* + * Now construct the error's message. + * + * extsprintf (which we invoke here with our caller's arguments in order + * to construct this Error's message) is strict in its interpretation of + * values to be processed by the "%s" specifier. The value passed to + * extsprintf must actually be a string or something convertible to a + * String using .toString(). Passing other values (notably "null" and + * "undefined") is considered a programmer error. The assumption is + * that if you actually want to print the string "null" or "undefined", + * then that's easy to do that when you're calling extsprintf; on the + * other hand, if you did NOT want that (i.e., there's actually a bug + * where the program assumes some variable is non-null and tries to + * print it, which might happen when constructing a packet or file in + * some specific format), then it's better to stop immediately than + * produce bogus output. + * + * However, sometimes the bug is only in the code calling VError, and a + * programmer might prefer to have the error message contain "null" or + * "undefined" rather than have the bug in the error path crash the + * program (making the first bug harder to identify). For that reason, + * by default VError converts "null" or "undefined" arguments to their + * string representations and passes those to extsprintf. Programmers + * desiring the strict behavior can use the SError class or pass the + * "strict" option to the VError constructor. + */ + mod_assertplus.object(options); + if (!options.strict && !args.strict) { + sprintf_args = sprintf_args.map(function (a) { + return (a === null ? 'null' : + a === undefined ? 'undefined' : a); + }); + } - if (options) { - causedBy = options.cause; + if (sprintf_args.length === 0) { + shortmessage = ''; + } else { + shortmessage = sprintf.apply(null, sprintf_args); + } - if (!causedBy || !(options.cause instanceof Error)) - causedBy = options; + return ({ + 'options': options, + 'shortmessage': shortmessage + }); +} - if (causedBy && (causedBy instanceof Error)) { - this.jse_cause = causedBy; - this.jse_summary += ': ' + causedBy.message; +/* + * See README.md for reference documentation. + */ +function VError() +{ + var args, obj, parsed, cause, ctor, message, k; + + args = Array.prototype.slice.call(arguments, 0); + + /* + * This is a regrettable pattern, but JavaScript's built-in Error class + * is defined to work this way, so we allow the constructor to be called + * without "new". + */ + if (!(this instanceof VError)) { + obj = Object.create(VError.prototype); + VError.apply(obj, arguments); + return (obj); + } + + /* + * For convenience and backwards compatibility, we support several + * different calling forms. Normalize them here. + */ + parsed = parseConstructorArguments({ + 'argv': args, + 'strict': false + }); + + /* + * If we've been given a name, apply it now. + */ + if (parsed.options.name) { + mod_assertplus.string(parsed.options.name, + 'error\'s "name" must be a string'); + this.name = parsed.options.name; + } + + /* + * For debugging, we keep track of the original short message (attached + * this Error particularly) separately from the complete message (which + * includes the messages of our cause chain). + */ + this.jse_shortmsg = parsed.shortmessage; + message = parsed.shortmessage; + + /* + * If we've been given a cause, record a reference to it and update our + * message appropriately. + */ + cause = parsed.options.cause; + if (cause) { + mod_assertplus.ok(mod_isError(cause), 'cause is not an Error'); + this.jse_cause = cause; + + if (!parsed.options.skipCauseMessage) { + message += ': ' + cause.message; } } - this.message = this.jse_summary; - Error.call(this, this.jse_summary); + /* + * If we've been given an object with properties, shallow-copy that + * here. We don't want to use a deep copy in case there are non-plain + * objects here, but we don't want to use the original object in case + * the caller modifies it later. + */ + this.jse_info = {}; + if (parsed.options.info) { + for (k in parsed.options.info) { + this.jse_info[k] = parsed.options.info[k]; + } + } + + this.message = message; + Error.call(this, message); if (Error.captureStackTrace) { - ctor = options ? options.constructorOpt : undefined; - ctor = ctor || arguments.callee; + ctor = parsed.options.constructorOpt || this.constructor; Error.captureStackTrace(this, ctor); } + + return (this); } mod_util.inherits(VError, Error); @@ -136022,11 +146690,153 @@ VError.prototype.toString = function ve_toString() return (str); }; +/* + * This method is provided for compatibility. New callers should use + * VError.cause() instead. That method also uses the saner `null` return value + * when there is no cause. + */ VError.prototype.cause = function ve_cause() { - return (this.jse_cause); + var cause = VError.cause(this); + return (cause === null ? undefined : cause); }; +/* + * Static methods + * + * These class-level methods are provided so that callers can use them on + * instances of Errors that are not VErrors. New interfaces should be provided + * only using static methods to eliminate the class of programming mistake where + * people fail to check whether the Error object has the corresponding methods. + */ + +VError.cause = function (err) +{ + mod_assertplus.ok(mod_isError(err), 'err must be an Error'); + return (mod_isError(err.jse_cause) ? err.jse_cause : null); +}; + +VError.info = function (err) +{ + var rv, cause, k; + + mod_assertplus.ok(mod_isError(err), 'err must be an Error'); + cause = VError.cause(err); + if (cause !== null) { + rv = VError.info(cause); + } else { + rv = {}; + } + + if (typeof (err.jse_info) == 'object' && err.jse_info !== null) { + for (k in err.jse_info) { + rv[k] = err.jse_info[k]; + } + } + + return (rv); +}; + +VError.findCauseByName = function (err, name) +{ + var cause; + + mod_assertplus.ok(mod_isError(err), 'err must be an Error'); + mod_assertplus.string(name, 'name'); + mod_assertplus.ok(name.length > 0, 'name cannot be empty'); + + for (cause = err; cause !== null; cause = VError.cause(cause)) { + mod_assertplus.ok(mod_isError(cause)); + if (cause.name == name) { + return (cause); + } + } + + return (null); +}; + +VError.hasCauseWithName = function (err, name) +{ + return (VError.findCauseByName(err, name) !== null); +}; + +VError.fullStack = function (err) +{ + mod_assertplus.ok(mod_isError(err), 'err must be an Error'); + + var cause = VError.cause(err); + + if (cause) { + return (err.stack + '\ncaused by: ' + VError.fullStack(cause)); + } + + return (err.stack); +}; + +VError.errorFromList = function (errors) +{ + mod_assertplus.arrayOfObject(errors, 'errors'); + + if (errors.length === 0) { + return (null); + } + + errors.forEach(function (e) { + mod_assertplus.ok(mod_isError(e)); + }); + + if (errors.length == 1) { + return (errors[0]); + } + + return (new MultiError(errors)); +}; + +VError.errorForEach = function (err, func) +{ + mod_assertplus.ok(mod_isError(err), 'err must be an Error'); + mod_assertplus.func(func, 'func'); + + if (err instanceof MultiError) { + err.errors().forEach(function iterError(e) { func(e); }); + } else { + func(err); + } +}; + + +/* + * SError is like VError, but stricter about types. You cannot pass "null" or + * "undefined" as string arguments to the formatter. + */ +function SError() +{ + var args, obj, parsed, options; + + args = Array.prototype.slice.call(arguments, 0); + if (!(this instanceof SError)) { + obj = Object.create(SError.prototype); + SError.apply(obj, arguments); + return (obj); + } + + parsed = parseConstructorArguments({ + 'argv': args, + 'strict': true + }); + + options = parsed.options; + VError.call(this, options, '%s', parsed.shortmessage); + + return (this); +} + +/* + * We don't bother setting SError.prototype.name because once constructed, + * SErrors are just like VErrors. + */ +mod_util.inherits(SError, VError); + /* * Represents a collection of errors for the purpose of consumers that generally @@ -136036,87 +146846,316 @@ VError.prototype.cause = function ve_cause() */ function MultiError(errors) { - mod_assert.ok(errors.length > 0); + mod_assertplus.array(errors, 'list of errors'); + mod_assertplus.ok(errors.length > 0, 'must be at least one error'); this.ase_errors = errors; - VError.call(this, errors[0], 'first of %d error%s', - errors.length, errors.length == 1 ? '' : 's'); + VError.call(this, { + 'cause': errors[0] + }, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's'); } mod_util.inherits(MultiError, VError); +MultiError.prototype.name = 'MultiError'; +MultiError.prototype.errors = function me_errors() +{ + return (this.ase_errors.slice(0)); +}; /* - * Like JavaScript's built-in Error class, but supports a "cause" argument which - * is wrapped, not "folded in" as with VError. Accepts a printf-style message. - * The cause argument can be null. + * See README.md for reference details. */ -function WError(options) +function WError() { - Error.call(this); + var args, obj, parsed, options; - var args, cause, ctor; - if (typeof (options) === 'object') { - args = Array.prototype.slice.call(arguments, 1); - } else { - args = Array.prototype.slice.call(arguments, 0); - options = undefined; + args = Array.prototype.slice.call(arguments, 0); + if (!(this instanceof WError)) { + obj = Object.create(WError.prototype); + WError.apply(obj, args); + return (obj); } - if (args.length > 0) { - this.message = mod_extsprintf.sprintf.apply(null, args); - } else { - this.message = ''; - } + parsed = parseConstructorArguments({ + 'argv': args, + 'strict': false + }); - if (options) { - if (options instanceof Error) { - cause = options; - } else { - cause = options.cause; - ctor = options.constructorOpt; - } - } - - Error.captureStackTrace(this, ctor || this.constructor); - if (cause) - this.cause(cause); + options = parsed.options; + options['skipCauseMessage'] = true; + VError.call(this, options, '%s', parsed.shortmessage); + return (this); } -mod_util.inherits(WError, Error); +mod_util.inherits(WError, VError); WError.prototype.name = 'WError'; - WError.prototype.toString = function we_toString() { var str = (this.hasOwnProperty('name') && this.name || this.constructor.name || this.constructor.prototype.name); if (this.message) str += ': ' + this.message; - if (this.we_cause && this.we_cause.message) - str += '; caused by ' + this.we_cause.toString(); + if (this.jse_cause && this.jse_cause.message) + str += '; caused by ' + this.jse_cause.toString(); return (str); }; +/* + * For purely historical reasons, WError's cause() function allows you to set + * the cause. + */ WError.prototype.cause = function we_cause(c) { - if (c instanceof Error) - this.we_cause = c; + if (mod_isError(c)) + this.jse_cause = c; - return (this.we_cause); + return (this.jse_cause); }; /***/ }), -/* 671 */ +/* 961 */ +/***/ (function(module, exports, __webpack_require__) { + +/* + * extsprintf.js: extended POSIX-style sprintf + */ + +var mod_assert = __webpack_require__(28); +var mod_util = __webpack_require__(3); + +/* + * Public interface + */ +exports.sprintf = jsSprintf; +exports.printf = jsPrintf; +exports.fprintf = jsFprintf; + +/* + * Stripped down version of s[n]printf(3c). We make a best effort to throw an + * exception when given a format string we don't understand, rather than + * ignoring it, so that we won't break existing programs if/when we go implement + * the rest of this. + * + * This implementation currently supports specifying + * - field alignment ('-' flag), + * - zero-pad ('0' flag) + * - always show numeric sign ('+' flag), + * - field width + * - conversions for strings, decimal integers, and floats (numbers). + * - argument size specifiers. These are all accepted but ignored, since + * Javascript has no notion of the physical size of an argument. + * + * Everything else is currently unsupported, most notably precision, unsigned + * numbers, non-decimal numbers, and characters. + */ +function jsSprintf(ofmt) +{ + var regex = [ + '([^%]*)', /* normal text */ + '%', /* start of format */ + '([\'\\-+ #0]*?)', /* flags (optional) */ + '([1-9]\\d*)?', /* width (optional) */ + '(\\.([1-9]\\d*))?', /* precision (optional) */ + '[lhjztL]*?', /* length mods (ignored) */ + '([diouxXfFeEgGaAcCsSp%jr])' /* conversion */ + ].join(''); + + var re = new RegExp(regex); + + /* variadic arguments used to fill in conversion specifiers */ + var args = Array.prototype.slice.call(arguments, 1); + /* remaining format string */ + var fmt = ofmt; + + /* components of the current conversion specifier */ + var flags, width, precision, conversion; + var left, pad, sign, arg, match; + + /* return value */ + var ret = ''; + + /* current variadic argument (1-based) */ + var argn = 1; + /* 0-based position in the format string that we've read */ + var posn = 0; + /* 1-based position in the format string of the current conversion */ + var convposn; + /* current conversion specifier */ + var curconv; + + mod_assert.equal('string', typeof (fmt), + 'first argument must be a format string'); + + while ((match = re.exec(fmt)) !== null) { + ret += match[1]; + fmt = fmt.substring(match[0].length); + + /* + * Update flags related to the current conversion specifier's + * position so that we can report clear error messages. + */ + curconv = match[0].substring(match[1].length); + convposn = posn + match[1].length + 1; + posn += match[0].length; + + flags = match[2] || ''; + width = match[3] || 0; + precision = match[4] || ''; + conversion = match[6]; + left = false; + sign = false; + pad = ' '; + + if (conversion == '%') { + ret += '%'; + continue; + } + + if (args.length === 0) { + throw (jsError(ofmt, convposn, curconv, + 'has no matching argument ' + + '(too few arguments passed)')); + } + + arg = args.shift(); + argn++; + + if (flags.match(/[\' #]/)) { + throw (jsError(ofmt, convposn, curconv, + 'uses unsupported flags')); + } + + if (precision.length > 0) { + throw (jsError(ofmt, convposn, curconv, + 'uses non-zero precision (not supported)')); + } + + if (flags.match(/-/)) + left = true; + + if (flags.match(/0/)) + pad = '0'; + + if (flags.match(/\+/)) + sign = true; + + switch (conversion) { + case 's': + if (arg === undefined || arg === null) { + throw (jsError(ofmt, convposn, curconv, + 'attempted to print undefined or null ' + + 'as a string (argument ' + argn + ' to ' + + 'sprintf)')); + } + ret += doPad(pad, width, left, arg.toString()); + break; + + case 'd': + arg = Math.floor(arg); + /*jsl:fallthru*/ + case 'f': + sign = sign && arg > 0 ? '+' : ''; + ret += sign + doPad(pad, width, left, + arg.toString()); + break; + + case 'x': + ret += doPad(pad, width, left, arg.toString(16)); + break; + + case 'j': /* non-standard */ + if (width === 0) + width = 10; + ret += mod_util.inspect(arg, false, width); + break; + + case 'r': /* non-standard */ + ret += dumpException(arg); + break; + + default: + throw (jsError(ofmt, convposn, curconv, + 'is not supported')); + } + } + + ret += fmt; + return (ret); +} + +function jsError(fmtstr, convposn, curconv, reason) { + mod_assert.equal(typeof (fmtstr), 'string'); + mod_assert.equal(typeof (curconv), 'string'); + mod_assert.equal(typeof (convposn), 'number'); + mod_assert.equal(typeof (reason), 'string'); + return (new Error('format string "' + fmtstr + + '": conversion specifier "' + curconv + '" at character ' + + convposn + ' ' + reason)); +} + +function jsPrintf() { + var args = Array.prototype.slice.call(arguments); + args.unshift(process.stdout); + jsFprintf.apply(null, args); +} + +function jsFprintf(stream) { + var args = Array.prototype.slice.call(arguments, 1); + return (stream.write(jsSprintf.apply(this, args))); +} + +function doPad(chr, width, left, str) +{ + var ret = str; + + while (ret.length < width) { + if (left) + ret += chr; + else + ret = chr + ret; + } + + return (ret); +} + +/* + * This function dumps long stack traces for exceptions having a cause() method. + * See node-verror for an example. + */ +function dumpException(ex) +{ + var ret; + + if (!(ex instanceof Error)) + throw (new Error(jsSprintf('invalid type for %%r: %j', ex))); + + /* Note that V8 prepends "ex.stack" with ex.toString(). */ + ret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack; + + if (ex.cause && typeof (ex.cause) === 'function') { + var cex = ex.cause(); + if (cex) { + ret += '\nCaused by: ' + dumpException(cex); + } + } + + return (ret); +} + + +/***/ }), +/* 962 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const lenient = __webpack_require__(672); +const lenient = __webpack_require__(963); module.exports = (val, opts) => { val = String(val).trim(); @@ -136146,7 +147185,7 @@ module.exports = (val, opts) => { /***/ }), -/* 672 */ +/* 963 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -136261,13 +147300,13 @@ module.exports = (val, opts) => { /***/ }), -/* 673 */ +/* 964 */ /***/ (function(module, exports) { -module.exports = require("dgram"); +module.exports = require("dns"); /***/ }), -/* 674 */ +/* 965 */ /***/ (function(module, exports) { module.exports = require("domain"); diff --git a/build/Info.plist b/build/Info.plist deleted file mode 100644 index 4d91015b..00000000 --- a/build/Info.plist +++ /dev/null @@ -1,34 +0,0 @@ - - - CFBundleDocumentTypes - - - CFBundleTypeName - Folders - CFBundleTypeRole - Viewer - LSItemContentTypes - - public.folder - com.apple.bundle - com.apple.package - com.apple.resolvable - - LSHandlerRank - Alternate - - - CFBundleTypeName - UnixExecutables - CFBundleTypeRole - Shell - LSItemContentTypes - - public.unix-executable - - LSHandlerRank - Alternate - - - - diff --git a/build/canary.icns b/build/canary.icns index fa1a666f..d3a565a0 100644 Binary files a/build/canary.icns and b/build/canary.icns differ diff --git a/build/icon.fig b/build/icon.fig new file mode 100644 index 00000000..31370e7b Binary files /dev/null and b/build/icon.fig differ diff --git a/build/icon.icns b/build/icon.icns index bcdd6201..99692b86 100644 Binary files a/build/icon.icns and b/build/icon.icns differ diff --git a/build/win/installer.nsh b/build/win/installer.nsh new file mode 100644 index 00000000..48d68816 --- /dev/null +++ b/build/win/installer.nsh @@ -0,0 +1,28 @@ +!macro customInstall + WriteRegStr HKCU "Software\Classes\Directory\Background\shell\Hyper" "" "Open Hyper here" + WriteRegStr HKCU "Software\Classes\Directory\Background\shell\Hyper" "Icon" "$appExe" + WriteRegStr HKCU "Software\Classes\Directory\Background\shell\Hyper\command" "" `$appExe "%V"` + + WriteRegStr HKCU "Software\Classes\Directory\shell\Hyper" "" "Open Hyper here" + WriteRegStr HKCU "Software\Classes\Directory\shell\Hyper" "Icon" "$appExe" + WriteRegStr HKCU "Software\Classes\Directory\shell\Hyper\command" "" `$appExe "%V"` + + WriteRegStr HKCU "Software\Classes\Drive\shell\Hyper" "" "Open Hyper here" + WriteRegStr HKCU "Software\Classes\Drive\shell\Hyper" "Icon" "$appExe" + WriteRegStr HKCU "Software\Classes\Drive\shell\Hyper\command" "" `$appExe "%V"` +!macroend + +!macro customUnInstall + DeleteRegKey HKCU "Software\Classes\Directory\Background\shell\Hyper" + DeleteRegKey HKCU "Software\Classes\Directory\shell\Hyper" + DeleteRegKey HKCU "Software\Classes\Drive\shell\Hyper" +!macroend + +!macro customInstallMode + StrCpy $isForceCurrentInstall "1" +!macroend + +!macro customInit + IfFileExists $LOCALAPPDATA\Hyper\Update.exe 0 +2 + nsExec::Exec '"$LOCALAPPDATA\Hyper\Update.exe" --uninstall -s' +!macroend \ No newline at end of file diff --git a/cli/api.js b/cli/api.ts similarity index 54% rename from cli/api.js rename to cli/api.ts index ad76ba96..d99174f5 100644 --- a/cli/api.js +++ b/cli/api.ts @@ -1,39 +1,45 @@ -const fs = require('fs'); -const os = require('os'); -const got = require('got'); -const registryUrl = require('registry-url')(); -const pify = require('pify'); -const recast = require('recast'); -const path = require('path'); +// eslint-disable-next-line eslint-comments/disable-enable-pair +/* eslint-disable @typescript-eslint/no-unsafe-return */ +import fs from 'fs'; +import os from 'os'; +import got from 'got'; +import registryUrlModule from 'registry-url'; +const registryUrl = registryUrlModule(); +import pify from 'pify'; +import * as recast from 'recast'; +import path from 'path'; // If the user defines XDG_CONFIG_HOME they definitely want their config there, // otherwise use the home directory in linux/mac and userdata in windows const applicationDirectory = process.env.XDG_CONFIG_HOME !== undefined ? path.join(process.env.XDG_CONFIG_HOME, 'hyper') - : process.platform == 'win32' ? path.join(process.env.APPDATA, 'Hyper') : os.homedir(); + : process.platform == 'win32' + ? path.join(process.env.APPDATA!, 'Hyper') + : os.homedir(); const devConfigFileName = path.join(__dirname, `../.hyper.js`); -let fileName = +const fileName = process.env.NODE_ENV !== 'production' && fs.existsSync(devConfigFileName) ? devConfigFileName : path.join(applicationDirectory, '.hyper.js'); + /** * We need to make sure the file reading and parsing is lazy so that failure to * statically analyze the hyper configuration isn't fatal for all kinds of * subcommands. We can use memoization to make reading and parsing lazy. */ -function memoize(fn) { +function memoize any>(fn: T): T { let hasResult = false; - let result; - return (...args) => { + let result: any; + return ((...args: any[]) => { if (!hasResult) { result = fn(...args); hasResult = true; } return result; - }; + }) as T; } const getFileContents = memoize(() => { @@ -48,24 +54,39 @@ const getFileContents = memoize(() => { return null; }); -const getParsedFile = memoize(() => recast.parse(getFileContents())); +const getParsedFile = memoize(() => recast.parse(getFileContents()!)); -const getProperties = memoize(() => getParsedFile().program.body[0].expression.right.properties); - -const getPlugins = memoize(() => getProperties().find(property => property.key.name === 'plugins').value.elements); - -const getLocalPlugins = memoize( - () => getProperties().find(property => property.key.name === 'localPlugins').value.elements +const getProperties = memoize( + (): any[] => + ((getParsedFile()?.program?.body as any[]) || []).find( + (bodyItem) => + bodyItem.type === 'ExpressionStatement' && + bodyItem.expression.type === 'AssignmentExpression' && + bodyItem.expression.left.object.name === 'module' && + bodyItem.expression.left.property.name === 'exports' && + bodyItem.expression.right.type === 'ObjectExpression' + )?.expression?.right?.properties || [] ); +const getPluginsByKey = (key: string): any[] => + getProperties().find((property) => property?.key?.name === key)?.value?.elements || []; + +const getPlugins = memoize(() => { + return getPluginsByKey('plugins'); +}); + +const getLocalPlugins = memoize(() => { + return getPluginsByKey('localPlugins'); +}); + function exists() { return getFileContents() !== undefined; } -function isInstalled(plugin, locally) { +function isInstalled(plugin: string, locally?: boolean) { const array = locally ? getLocalPlugins() : getPlugins(); if (array && Array.isArray(array)) { - return array.find(entry => entry.value === plugin) !== undefined; + return array.some((entry) => entry.value === plugin); } return false; } @@ -74,30 +95,32 @@ function save() { return pify(fs.writeFile)(fileName, recast.print(getParsedFile()).code, 'utf8'); } -function existsOnNpm(plugin) { - const name = getPackageName(plugin); - return got.get(registryUrl + name.toLowerCase(), {timeout: 10000, json: true}).then(res => { - if (!res.body.versions) { - return Promise.reject(res); - } - }); -} - -function getPackageName(plugin) { +function getPackageName(plugin: string) { const isScoped = plugin[0] === '@'; const nameWithoutVersion = plugin.split('#')[0]; if (isScoped) { - return '@' + nameWithoutVersion.split('@')[1].replace('/', '%2f'); + return `@${nameWithoutVersion.split('@')[1].replace('/', '%2f')}`; } return nameWithoutVersion.split('@')[0]; } -function install(plugin, locally) { +function existsOnNpm(plugin: string) { + const name = getPackageName(plugin); + return got.get(registryUrl + name.toLowerCase(), {timeout: 10000, responseType: 'json'}).then((res) => { + if (!res.body.versions) { + return Promise.reject(res); + } else { + return res; + } + }); +} + +function install(plugin: string, locally?: boolean) { const array = locally ? getLocalPlugins() : getPlugins(); return existsOnNpm(plugin) - .catch(err => { + .catch((err: any) => { const {statusCode} = err; if (statusCode && (statusCode === 404 || statusCode === 200)) { return Promise.reject(`${plugin} not found on npm`); @@ -114,29 +137,24 @@ function install(plugin, locally) { }); } -function uninstall(plugin) { +function uninstall(plugin: string) { if (!isInstalled(plugin)) { return Promise.reject(`${plugin} is not installed`); } - const index = getPlugins().findIndex(entry => entry.value === plugin); + const index = getPlugins().findIndex((entry) => entry.value === plugin); getPlugins().splice(index, 1); return save(); } function list() { - if (Array.isArray(getPlugins())) { + if (getPlugins().length > 0) { return getPlugins() - .map(plugin => plugin.value) + .map((plugin) => plugin.value) .join('\n'); } return false; } -module.exports.configPath = fileName; -module.exports.exists = exists; -module.exports.existsOnNpm = existsOnNpm; -module.exports.isInstalled = isInstalled; -module.exports.install = install; -module.exports.uninstall = uninstall; -module.exports.list = list; +export const configPath = fileName; +export {exists, existsOnNpm, isInstalled, install, uninstall, list}; diff --git a/cli/index.js b/cli/index.js deleted file mode 100644 index 5363abf5..00000000 --- a/cli/index.js +++ /dev/null @@ -1,219 +0,0 @@ -// This is a CLI tool, using console is OK -/* eslint no-console: 0 */ -const {spawn, exec} = require('child_process'); -const {isAbsolute, resolve} = require('path'); -const {existsSync} = require('fs'); -const {version} = require('../app/package'); -const pify = require('pify'); -const args = require('args'); -const chalk = require('chalk'); -const opn = require('opn'); -const columnify = require('columnify'); -const got = require('got'); -const ora = require('ora'); -const api = require('./api'); - -const PLUGIN_PREFIX = 'hyper-'; - -let commandPromise; - -const assertPluginName = pluginName => { - if (!pluginName) { - console.error(chalk.red('Plugin name is required')); - process.exit(1); - } -}; - -const checkConfig = () => { - if (api.exists()) { - return true; - } - let msg = chalk.red(`Error! Config file not found: ${api.configPath}\n`); - msg += 'Please launch Hyper and retry.'; - console.error(msg); - process.exit(1); -}; - -args.command(['i', 'install'], 'Install a plugin', (name, args_) => { - checkConfig(); - const pluginName = args_[0]; - assertPluginName(pluginName); - commandPromise = api - .install(pluginName) - .then(() => console.log(chalk.green(`${pluginName} installed successfully!`))) - .catch(err => console.error(chalk.red(err))); -}); - -args.command(['u', 'uninstall', 'rm', 'remove'], 'Uninstall a plugin', (name, args_) => { - checkConfig(); - const pluginName = args_[0]; - assertPluginName(pluginName); - commandPromise = api - .uninstall(pluginName) - .then(() => console.log(chalk.green(`${pluginName} uninstalled successfully!`))) - .catch(err => console.log(chalk.red(err))); -}); - -args.command(['ls', 'list'], 'List installed plugins', () => { - checkConfig(); - let plugins = api.list(); - - if (plugins) { - console.log(plugins); - } else { - console.log(chalk.red(`No plugins installed yet.`)); - } - process.exit(0); -}); - -const lsRemote = pattern => { - // note that no errors are catched by this function - const URL = `https://api.npms.io/v2/search?q=${(pattern && `${pattern}+`) || ''}keywords:hyper-plugin,hyper-theme`; - return got(URL) - .then(response => JSON.parse(response.body).results) - .then(entries => entries.map(entry => entry.package)) - .then(entries => entries.filter(entry => entry.name.indexOf(PLUGIN_PREFIX) === 0)) - .then(entries => - entries.map(({name, description}) => { - return {name, description}; - }) - ) - .then(entries => - entries.map(entry => { - entry.name = chalk.green(entry.name); - return entry; - }) - ); -}; - -args.command(['s', 'search'], 'Search for plugins on npm', (name, args_) => { - const spinner = ora('Searching').start(); - const query = args_[0] ? args_[0].toLowerCase() : ''; - - commandPromise = lsRemote(query) - .then(entries => { - if (entries.length === 0) { - spinner.fail(); - console.error(chalk.red(`Your search '${query}' did not match any plugins`)); - console.error(`${chalk.red('Try')} ${chalk.green('hyper ls-remote')}`); - process.exit(1); - } else { - let msg = columnify(entries); - spinner.succeed(); - msg = msg.substring(msg.indexOf('\n') + 1); // remove header - console.log(msg); - } - }) - .catch(err => { - spinner.fail(); - console.error(chalk.red(err)); // TODO - }); -}); - -args.command(['lsr', 'list-remote', 'ls-remote'], 'List plugins available on npm', () => { - const spinner = ora('Searching').start(); - - commandPromise = lsRemote() - .then(entries => { - let msg = columnify(entries); - - spinner.succeed(); - msg = msg.substring(msg.indexOf('\n') + 1); // remove header - console.log(msg); - }) - .catch(err => { - spinner.fail(); - console.error(chalk.red(err)); // TODO - }); -}); - -args.command(['d', 'docs', 'h', 'home'], 'Open the npm page of a plugin', (name, args_) => { - const pluginName = args_[0]; - assertPluginName(pluginName); - opn(`http://ghub.io/${pluginName}`, {wait: false}); - process.exit(0); -}); - -args.command(['version'], 'Show the version of hyper', () => { - console.log(version); - process.exit(0); -}); - -args.command([''], 'Launch Hyper'); - -args.option(['v', 'verbose'], 'Verbose mode', false); - -const main = argv => { - const flags = args.parse(argv, { - name: 'hyper', - version: false, - mri: { - boolean: ['v', 'verbose'] - } - }); - - if (commandPromise) { - return commandPromise; - } - - const env = Object.assign({}, process.env, { - // this will signal Hyper that it was spawned from this module - HYPER_CLI: '1', - ELECTRON_NO_ATTACH_CONSOLE: '1' - }); - - delete env['ELECTRON_RUN_AS_NODE']; - - if (flags.verbose) { - env['ELECTRON_ENABLE_LOGGING'] = '1'; - } - - const options = { - detached: true, - env - }; - - const args_ = args.sub.map(arg => { - const cwd = isAbsolute(arg) ? arg : resolve(process.cwd(), arg); - if (!existsSync(cwd)) { - console.error(chalk.red(`Error! Directory or file does not exist: ${cwd}`)); - process.exit(1); - } - return cwd; - }); - - if (!flags.verbose) { - options['stdio'] = 'ignore'; - if (process.platform === 'darwin') { - //Use `open` to prevent multiple Hyper process - const cmd = `open -b co.zeit.hyper ${args_}`; - const opts = { - env - }; - return pify(exec)(cmd, opts); - } - } - - const child = spawn(process.execPath, args_, options); - - if (flags.verbose) { - child.stdout.on('data', data => console.log(data.toString('utf8'))); - child.stderr.on('data', data => console.error(data.toString('utf8'))); - } - if (flags.verbose) { - return new Promise(c => child.once('exit', () => c(null))); - } - child.unref(); - return Promise.resolve(); -}; - -function eventuallyExit(code) { - setTimeout(() => process.exit(code), 100); -} - -main(process.argv) - .then(() => eventuallyExit(0)) - .catch(err => { - console.error(err.stack ? err.stack : err); - eventuallyExit(1); - }); diff --git a/cli/index.ts b/cli/index.ts new file mode 100644 index 00000000..99bbaa86 --- /dev/null +++ b/cli/index.ts @@ -0,0 +1,256 @@ +// This is a CLI tool, using console is OK +/* eslint no-console: 0 */ +import {spawn, exec, SpawnOptions} from 'child_process'; +import {isAbsolute, resolve} from 'path'; +import {existsSync} from 'fs'; +import {version} from '../app/package.json'; +import pify from 'pify'; +import args from 'args'; +import chalk from 'chalk'; +import open from 'open'; +import columnify from 'columnify'; +import got from 'got'; +import ora from 'ora'; +import * as api from './api'; + +let commandPromise: Promise | undefined; + +const assertPluginName = (pluginName: string) => { + if (!pluginName) { + console.error(chalk.red('Plugin name is required')); + process.exit(1); + } +}; + +const checkConfig = () => { + if (api.exists()) { + return true; + } + let msg = chalk.red(`Error! Config file not found: ${api.configPath}\n`); + msg += 'Please launch Hyper and retry.'; + console.error(msg); + process.exit(1); +}; + +args.command( + 'install', + 'Install a plugin', + (name, args_) => { + checkConfig(); + const pluginName = args_[0]; + assertPluginName(pluginName); + commandPromise = api + .install(pluginName) + .then(() => console.log(chalk.green(`${pluginName} installed successfully!`))) + .catch((err) => console.error(chalk.red(err))); + }, + ['i'] +); + +args.command( + 'uninstall', + 'Uninstall a plugin', + (name, args_) => { + checkConfig(); + const pluginName = args_[0]; + assertPluginName(pluginName); + commandPromise = api + .uninstall(pluginName) + .then(() => console.log(chalk.green(`${pluginName} uninstalled successfully!`))) + .catch((err) => console.log(chalk.red(err))); + }, + ['u', 'rm', 'remove'] +); + +args.command( + 'list', + 'List installed plugins', + () => { + checkConfig(); + const plugins = api.list(); + + if (plugins) { + console.log(plugins); + } else { + console.log(chalk.red(`No plugins installed yet.`)); + } + process.exit(0); + }, + ['ls'] +); + +const lsRemote = (pattern?: string) => { + // note that no errors are catched by this function + const URL = `https://api.npms.io/v2/search?q=${ + (pattern && `${pattern}+`) || '' + }keywords:hyper-plugin,hyper-theme&size=250`; + type npmResult = {package: {name: string; description: string}}; + return got(URL) + .then((response) => JSON.parse(response.body).results as npmResult[]) + .then((entries) => entries.map((entry) => entry.package)) + .then((entries) => + entries.map(({name, description}) => { + return {name, description}; + }) + ) + .then((entries) => + entries.map((entry) => { + entry.name = chalk.green(entry.name); + return entry; + }) + ); +}; + +args.command( + 'search', + 'Search for plugins on npm', + (name, args_) => { + const spinner = ora('Searching').start(); + const query = args_[0] ? args_[0].toLowerCase() : ''; + + commandPromise = lsRemote(query) + .then((entries) => { + if (entries.length === 0) { + spinner.fail(); + console.error(chalk.red(`Your search '${query}' did not match any plugins`)); + console.error(`${chalk.red('Try')} ${chalk.green('hyper ls-remote')}`); + process.exit(1); + } else { + let msg = columnify(entries); + spinner.succeed(); + msg = msg.substring(msg.indexOf('\n') + 1); // remove header + console.log(msg); + } + }) + .catch((err) => { + spinner.fail(); + console.error(chalk.red(err)); // TODO + }); + }, + ['s'] +); + +args.command( + 'list-remote', + 'List plugins available on npm', + () => { + const spinner = ora('Searching').start(); + + commandPromise = lsRemote() + .then((entries) => { + let msg = columnify(entries); + + spinner.succeed(); + msg = msg.substring(msg.indexOf('\n') + 1); // remove header + console.log(msg); + }) + .catch((err) => { + spinner.fail(); + console.error(chalk.red(err)); // TODO + }); + }, + ['lsr', 'ls-remote'] +); + +args.command( + 'docs', + 'Open the npm page of a plugin', + (name, args_) => { + const pluginName = args_[0]; + assertPluginName(pluginName); + void open(`http://ghub.io/${pluginName}`, {wait: false}); + process.exit(0); + }, + ['d', 'h', 'home'] +); + +args.command( + 'version', + 'Show the version of hyper', + () => { + console.log(version); + process.exit(0); + }, + [] +); + +args.command('', 'Launch Hyper'); + +args.option(['v', 'verbose'], 'Verbose mode', false); + +const main = (argv: string[]) => { + const flags = args.parse(argv, { + name: 'hyper', + version: false, + mri: { + boolean: ['v', 'verbose'] + } + } as any); + + if (commandPromise) { + return commandPromise; + } + + const env = Object.assign({}, process.env, { + // this will signal Hyper that it was spawned from this module + HYPER_CLI: '1', + ELECTRON_NO_ATTACH_CONSOLE: '1' + }); + + delete env['ELECTRON_RUN_AS_NODE']; + + if (flags.verbose) { + env['ELECTRON_ENABLE_LOGGING'] = '1'; + } + + const options: SpawnOptions = { + detached: true, + env + }; + + const args_ = args.sub.map((arg) => { + const cwd = isAbsolute(arg) ? arg : resolve(process.cwd(), arg); + if (!existsSync(cwd)) { + console.error(chalk.red(`Error! Directory or file does not exist: ${cwd}`)); + process.exit(1); + } + return cwd; + }); + + if (!flags.verbose) { + options['stdio'] = 'ignore'; + if (process.platform === 'darwin') { + //Use `open` to prevent multiple Hyper process + const cmd = `open -b co.zeit.hyper ${args_}`; + const opts = { + env + }; + return pify(exec)(cmd, opts); + } + } + + const child = spawn(process.execPath, args_, options); + + if (flags.verbose) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-call + child.stdout?.on('data', (data) => console.log(data.toString('utf8'))); + // eslint-disable-next-line @typescript-eslint/no-unsafe-call + child.stderr?.on('data', (data) => console.error(data.toString('utf8'))); + } + if (flags.verbose) { + return new Promise((c) => child.once('exit', () => c(null))); + } + child.unref(); + return Promise.resolve(); +}; + +function eventuallyExit(code: number) { + setTimeout(() => process.exit(code), 100); +} + +main(process.argv) + .then(() => eventuallyExit(0)) + .catch((err) => { + console.error(err.stack ? err.stack : err); + eventuallyExit(1); + }); diff --git a/electron-builder.json b/electron-builder.json new file mode 100644 index 00000000..57923dd7 --- /dev/null +++ b/electron-builder.json @@ -0,0 +1,132 @@ +{ + "$schema": "http://json.schemastore.org/electron-builder", + "appId": "co.zeit.hyper", + "directories": { + "app": "target" + }, + "extraResources": [ + "./bin/yarn-standalone.js", + "./bin/cli.js", + { + "from": "./build/${os}/", + "to": "./bin/", + "filter": [ + "hyper*" + ] + } + ], + "linux": { + "category": "TerminalEmulator", + "target": [ + { + "target": "deb", + "arch": [ + "x64", + "arm64" + ] + }, + { + "target": "AppImage", + "arch": [ + "x64", + "arm64" + ] + }, + { + "target": "rpm", + "arch": [ + "x64", + "arm64" + ] + }, + { + "target": "snap", + "arch": [ + "x64" + ] + } + ] + }, + "win": { + "target": [ + "nsis" + ], + "rfc3161TimeStampServer": "http://timestamp.comodoca.com" + }, + "nsis": { + "include": "build/win/installer.nsh", + "oneClick": false, + "perMachine": false, + "allowToChangeInstallationDirectory": true + }, + "mac": { + "target": { + "target": "default", + "arch": [ + "x64", + "arm64" + ] + }, + "artifactName": "${productName}-${version}-${os}-${arch}.${ext}", + "category": "public.app-category.developer-tools", + "extendInfo": { + "CFBundleDocumentTypes": [ + { + "CFBundleTypeName": "Folders", + "CFBundleTypeRole": "Viewer", + "LSHandlerRank": "Alternate", + "LSItemContentTypes": [ + "public.folder", + "com.apple.bundle", + "com.apple.package", + "com.apple.resolvable" + ] + }, + { + "CFBundleTypeName": "UnixExecutables", + "CFBundleTypeRole": "Shell", + "LSHandlerRank": "Alternate", + "LSItemContentTypes": [ + "public.unix-executable" + ] + } + ], + "NSAppleEventsUsageDescription": "An application in Hyper wants to use AppleScript.", + "NSCalendarsUsageDescription": "An application in Hyper wants to access Calendar data.", + "NSCameraUsageDescription": "An application in Hyper wants to use the Camera.", + "NSContactsUsageDescription": "An application in Hyper wants to access your Contacts.", + "NSDesktopFolderUsageDescription": "An application in Hyper wants to access the Desktop folder.", + "NSDocumentsFolderUsageDescription": "An application in Hyper wants to access the Documents folder.", + "NSDownloadsFolderUsageDescription": "An application in Hyper wants to access the Downloads folder.", + "NSFileProviderDomainUsageDescription": "An application in Hyper wants to access files managed by a file provider.", + "NSFileProviderPresenceUsageDescription": "An application in Hyper wants to be informed when other apps access files that it manages.", + "NSLocationUsageDescription": "An application in Hyper wants to access your location information.", + "NSMicrophoneUsageDescription": "An application in Hyper wants to use your microphone.", + "NSMotionUsageDescription": "An application in Hyper wants to use the device’s accelerometer.", + "NSNetworkVolumesUsageDescription": "An application in Hyper wants to access files on a network volume.", + "NSPhotoLibraryUsageDescription": "An application in Hyper wants to access the photo library.", + "NSRemindersUsageDescription": "An application in Hyper wants to access your reminders.", + "NSRemovableVolumesUsageDescription": "An application in Hyper wants to access files on a removable volume.", + "NSSpeechRecognitionUsageDescription": "An application in Hyper wants to send user data to Apple’s speech recognition servers.", + "NSSystemAdministrationUsageDescription": "The operation being performed by an application in Hyper requires elevated permission." + }, + "darkModeSupport": true + }, + "deb": { + "compression": "bzip2", + "afterInstall": "./build/linux/after-install.tpl" + }, + "rpm": { + "afterInstall": "./build/linux/after-install.tpl" + }, + "snap": { + "confinement": "classic", + "publish": "github" + }, + "protocols": { + "name": "ssh URL", + "schemes": [ + "ssh" + ] + } +} diff --git a/jsconfig.json b/jsconfig.json deleted file mode 100644 index d8db036d..00000000 --- a/jsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react", - "target": "es6" - }, - "exclude": ["node_modules", "**/node_modules/*", "bin/*", "renderer/*"] -} diff --git a/lib/actions/config.js b/lib/actions/config.js deleted file mode 100644 index 260b3e4b..00000000 --- a/lib/actions/config.js +++ /dev/null @@ -1,17 +0,0 @@ -import {CONFIG_LOAD, CONFIG_RELOAD} from '../constants/config'; - -export function loadConfig(config) { - return { - type: CONFIG_LOAD, - config - }; -} - -export function reloadConfig(config) { - const now = Date.now(); - return { - type: CONFIG_RELOAD, - config, - now - }; -} diff --git a/lib/actions/config.ts b/lib/actions/config.ts new file mode 100644 index 00000000..4c68302e --- /dev/null +++ b/lib/actions/config.ts @@ -0,0 +1,19 @@ +import {CONFIG_LOAD, CONFIG_RELOAD} from '../constants/config'; +import {HyperActions} from '../hyper'; +import {configOptions} from '../config'; + +export function loadConfig(config: configOptions): HyperActions { + return { + type: CONFIG_LOAD, + config + }; +} + +export function reloadConfig(config: configOptions): HyperActions { + const now = Date.now(); + return { + type: CONFIG_RELOAD, + config, + now + }; +} diff --git a/lib/actions/header.js b/lib/actions/header.ts similarity index 65% rename from lib/actions/header.js rename to lib/actions/header.ts index f72a1360..9cc52cef 100644 --- a/lib/actions/header.js +++ b/lib/actions/header.ts @@ -8,9 +8,10 @@ import { } from '../constants/ui'; import rpc from '../rpc'; import {userExitTermGroup, setActiveGroup} from './term-groups'; +import {HyperDispatch} from '../hyper'; -export function closeTab(uid) { - return dispatch => { +export function closeTab(uid: string) { + return (dispatch: HyperDispatch) => { dispatch({ type: CLOSE_TAB, uid, @@ -21,8 +22,8 @@ export function closeTab(uid) { }; } -export function changeTab(uid) { - return dispatch => { +export function changeTab(uid: string) { + return (dispatch: HyperDispatch) => { dispatch({ type: CHANGE_TAB, uid, @@ -34,29 +35,29 @@ export function changeTab(uid) { } export function maximize() { - return dispatch => { + return (dispatch: HyperDispatch) => { dispatch({ type: UI_WINDOW_MAXIMIZE, effect() { - rpc.emit('maximize'); + rpc.emit('maximize', null); } }); }; } export function unmaximize() { - return dispatch => { + return (dispatch: HyperDispatch) => { dispatch({ type: UI_WINDOW_UNMAXIMIZE, effect() { - rpc.emit('unmaximize'); + rpc.emit('unmaximize', null); } }); }; } -export function openHamburgerMenu(coordinates) { - return dispatch => { +export function openHamburgerMenu(coordinates: {x: number; y: number}) { + return (dispatch: HyperDispatch) => { dispatch({ type: UI_OPEN_HAMBURGER_MENU, effect() { @@ -67,22 +68,22 @@ export function openHamburgerMenu(coordinates) { } export function minimize() { - return dispatch => { + return (dispatch: HyperDispatch) => { dispatch({ type: UI_WINDOW_MINIMIZE, effect() { - rpc.emit('minimize'); + rpc.emit('minimize', null); } }); }; } export function close() { - return dispatch => { + return (dispatch: HyperDispatch) => { dispatch({ type: UI_WINDOW_CLOSE, effect() { - rpc.emit('close'); + rpc.emit('close', null); } }); }; diff --git a/lib/actions/index.js b/lib/actions/index.js deleted file mode 100644 index ea8e9e65..00000000 --- a/lib/actions/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import rpc from '../rpc'; -import INIT from '../constants'; - -export default function init() { - return dispatch => { - dispatch({ - type: INIT, - effect: () => { - rpc.emit('init'); - } - }); - }; -} diff --git a/lib/actions/index.ts b/lib/actions/index.ts new file mode 100644 index 00000000..68b89fbf --- /dev/null +++ b/lib/actions/index.ts @@ -0,0 +1,14 @@ +import rpc from '../rpc'; +import {INIT} from '../constants'; +import {HyperDispatch} from '../hyper'; + +export default function init() { + return (dispatch: HyperDispatch) => { + dispatch({ + type: INIT, + effect: () => { + rpc.emit('init', null); + } + }); + }; +} diff --git a/lib/actions/notifications.js b/lib/actions/notifications.ts similarity index 51% rename from lib/actions/notifications.js rename to lib/actions/notifications.ts index df928375..71a1b9cc 100644 --- a/lib/actions/notifications.js +++ b/lib/actions/notifications.ts @@ -1,13 +1,14 @@ import {NOTIFICATION_MESSAGE, NOTIFICATION_DISMISS} from '../constants/notifications'; +import {HyperActions} from '../hyper'; -export function dismissNotification(id) { +export function dismissNotification(id: string): HyperActions { return { type: NOTIFICATION_DISMISS, id }; } -export function addNotificationMessage(text, url = null, dismissable = true) { +export function addNotificationMessage(text: string, url: string | null = null, dismissable = true): HyperActions { return { type: NOTIFICATION_MESSAGE, text, diff --git a/lib/actions/sessions.js b/lib/actions/sessions.ts similarity index 53% rename from lib/actions/sessions.js rename to lib/actions/sessions.ts index 42f96732..af77f765 100644 --- a/lib/actions/sessions.js +++ b/lib/actions/sessions.ts @@ -12,11 +12,14 @@ import { SESSION_SET_ACTIVE, SESSION_CLEAR_ACTIVE, SESSION_USER_DATA, - SESSION_SET_XTERM_TITLE + SESSION_SET_XTERM_TITLE, + SESSION_SEARCH, + SESSION_SEARCH_CLOSE } from '../constants/sessions'; +import {HyperState, session, HyperDispatch, HyperActions} from '../hyper'; -export function addSession({uid, shell, pid, cols, rows, splitDirection}) { - return (dispatch, getState) => { +export function addSession({uid, shell, pid, cols, rows, splitDirection, activeUid}: session) { + return (dispatch: HyperDispatch, getState: () => HyperState) => { const {sessions} = getState(); const now = Date.now(); dispatch({ @@ -27,27 +30,28 @@ export function addSession({uid, shell, pid, cols, rows, splitDirection}) { cols, rows, splitDirection, - activeUid: sessions.activeUid, + activeUid: activeUid ? activeUid : sessions.activeUid, now }); }; } export function requestSession() { - return (dispatch, getState) => { + return (dispatch: HyperDispatch, getState: () => HyperState) => { dispatch({ type: SESSION_REQUEST, effect: () => { const {ui} = getState(); - const {cols, rows, cwd} = ui; - rpc.emit('new', {cols, rows, cwd}); + // the cols and rows from preview session maybe not accurate. so remove. + const {/*cols, rows,*/ cwd} = ui; + rpc.emit('new', {cwd}); } }); }; } -export function addSessionData(uid, data) { - return dispatch => { +export function addSessionData(uid: string, data: string) { + return (dispatch: HyperDispatch) => { dispatch({ type: SESSION_ADD_DATA, data, @@ -64,8 +68,8 @@ export function addSessionData(uid, data) { }; } -function createExitAction(type) { - return uid => (dispatch, getState) => { +function createExitAction(type: typeof SESSION_USER_EXIT | typeof SESSION_PTY_EXIT) { + return (uid: string) => (dispatch: HyperDispatch, getState: () => HyperState) => { return dispatch({ type, uid, @@ -79,7 +83,7 @@ function createExitAction(type) { window.close(); } } - }); + } as HyperActions); }; } @@ -88,8 +92,8 @@ function createExitAction(type) { export const userExitSession = createExitAction(SESSION_USER_EXIT); export const ptyExitSession = createExitAction(SESSION_PTY_EXIT); -export function setActiveSession(uid) { - return dispatch => { +export function setActiveSession(uid: string) { + return (dispatch: HyperDispatch) => { dispatch({ type: SESSION_SET_ACTIVE, uid @@ -97,13 +101,13 @@ export function setActiveSession(uid) { }; } -export function clearActiveSession() { +export function clearActiveSession(): HyperActions { return { type: SESSION_CLEAR_ACTIVE }; } -export function setSessionXtermTitle(uid, title) { +export function setSessionXtermTitle(uid: string, title: string): HyperActions { return { type: SESSION_SET_XTERM_TITLE, uid, @@ -111,10 +115,10 @@ export function setSessionXtermTitle(uid, title) { }; } -export function resizeSession(uid, cols, rows) { - return (dispatch, getState) => { +export function resizeSession(uid: string, cols: number, rows: number) { + return (dispatch: HyperDispatch, getState: () => HyperState) => { const {termGroups} = getState(); - const group = findBySession(termGroups, uid); + const group = findBySession(termGroups, uid)!; const isStandaloneTerm = !group.parentUid && !group.children.length; const now = Date.now(); dispatch({ @@ -131,8 +135,34 @@ export function resizeSession(uid, cols, rows) { }; } -export function sendSessionData(uid, data, escaped) { - return (dispatch, getState) => { +export function onSearch(uid?: string) { + return (dispatch: HyperDispatch, getState: () => HyperState) => { + const targetUid = uid || getState().sessions.activeUid!; + dispatch({ + type: SESSION_SEARCH, + uid: targetUid + }); + }; +} + +export function closeSearch(uid?: string, keyEvent?: any) { + return (dispatch: HyperDispatch, getState: () => HyperState) => { + const targetUid = uid || getState().sessions.activeUid!; + if (getState().sessions.sessions[targetUid]?.search) { + dispatch({ + type: SESSION_SEARCH_CLOSE, + uid: targetUid + }); + } else { + if (keyEvent) { + keyEvent.catched = false; + } + } + }; +} + +export function sendSessionData(uid: string | null, data: any, escaped?: boolean | null) { + return (dispatch: HyperDispatch, getState: () => HyperState) => { dispatch({ type: SESSION_USER_DATA, data, diff --git a/lib/actions/term-groups.js b/lib/actions/term-groups.ts similarity index 64% rename from lib/actions/term-groups.js rename to lib/actions/term-groups.ts index 3c2940ac..4696bb6d 100644 --- a/lib/actions/term-groups.js +++ b/lib/actions/term-groups.ts @@ -8,28 +8,31 @@ import { } from '../constants/term-groups'; import {SESSION_REQUEST} from '../constants/sessions'; import findBySession from '../utils/term-groups'; -import getRootGroups from '../selectors'; +import {getRootGroups} from '../selectors'; import {setActiveSession, ptyExitSession, userExitSession} from './sessions'; +import {ITermState, ITermGroup, HyperState, HyperDispatch, HyperActions} from '../hyper'; -function requestSplit(direction) { - return () => (dispatch, getState) => { - dispatch({ - type: SESSION_REQUEST, - effect: () => { - const {ui} = getState(); - rpc.emit('new', { - splitDirection: direction, - cwd: ui.cwd - }); - } - }); - }; +function requestSplit(direction: 'VERTICAL' | 'HORIZONTAL') { + return (activeUid: string) => + (dispatch: HyperDispatch, getState: () => HyperState): void => { + dispatch({ + type: SESSION_REQUEST, + effect: () => { + const {ui, sessions} = getState(); + rpc.emit('new', { + splitDirection: direction, + cwd: ui.cwd, + activeUid: activeUid ? activeUid : sessions.activeUid + }); + } + }); + }; } export const requestVerticalSplit = requestSplit(DIRECTION.VERTICAL); export const requestHorizontalSplit = requestSplit(DIRECTION.HORIZONTAL); -export function resizeTermGroup(uid, sizes) { +export function resizeTermGroup(uid: string, sizes: number[]): HyperActions { return { uid, type: TERM_GROUP_RESIZE, @@ -37,26 +40,25 @@ export function resizeTermGroup(uid, sizes) { }; } -export function requestTermGroup() { - return (dispatch, getState) => { +export function requestTermGroup(activeUid: string) { + return (dispatch: HyperDispatch, getState: () => HyperState) => { dispatch({ type: TERM_GROUP_REQUEST, effect: () => { const {ui} = getState(); - const {cols, rows, cwd} = ui; + const {cwd} = ui; rpc.emit('new', { isNewGroup: true, - cols, - rows, - cwd + cwd, + activeUid }); } }); }; } -export function setActiveGroup(uid) { - return (dispatch, getState) => { +export function setActiveGroup(uid: string) { + return (dispatch: HyperDispatch, getState: () => HyperState) => { const {termGroups} = getState(); dispatch(setActiveSession(termGroups.activeSessions[uid])); }; @@ -65,12 +67,12 @@ export function setActiveGroup(uid) { // When we've found the next group which we want to // set as active (after closing something), we also need // to find the first child group which has a sessionUid. -const findFirstSession = (state, group) => { +const findFirstSession = (state: ITermState, group: ITermGroup): string | undefined => { if (group.sessionUid) { return group.sessionUid; } - for (const childUid of group.children) { + for (const childUid of group.children.asMutable()) { const child = state.termGroups[childUid]; // We want to find the *leftmost* session, // even if it's nested deep down: @@ -81,14 +83,14 @@ const findFirstSession = (state, group) => { } }; -const findPrevious = (list, old) => { +const findPrevious = (list: T[], old: T) => { const index = list.indexOf(old); // If `old` was the first item in the list, // choose the other item available: return index ? list[index - 1] : list[1]; }; -const findNextSessionUid = (state, group) => { +const findNextSessionUid = (state: ITermState, group: ITermGroup) => { // If we're closing a root group (i.e. a whole tab), // the next group needs to be a root group as well: if (state.activeRootGroup === group.uid) { @@ -97,13 +99,13 @@ const findNextSessionUid = (state, group) => { return findFirstSession(state, nextGroup); } - const {children} = state.termGroups[group.parentUid]; - const nextUid = findPrevious(children, group.uid); + const {children} = state.termGroups[group.parentUid!]; + const nextUid = findPrevious(children.asMutable(), group.uid); return findFirstSession(state, state.termGroups[nextUid]); }; -export function ptyExitTermGroup(sessionUid) { - return (dispatch, getState) => { +export function ptyExitTermGroup(sessionUid: string) { + return (dispatch: HyperDispatch, getState: () => HyperState) => { const {termGroups} = getState(); const group = findBySession(termGroups, sessionUid); // This might have already been closed: @@ -115,10 +117,10 @@ export function ptyExitTermGroup(sessionUid) { type: TERM_GROUP_EXIT, uid: group.uid, effect: () => { - const activeSessionUid = termGroups.activeSessions[termGroups.activeRootGroup]; + const activeSessionUid = termGroups.activeSessions[termGroups.activeRootGroup!]; if (Object.keys(termGroups.termGroups).length > 1 && activeSessionUid === sessionUid) { const nextSessionUid = findNextSessionUid(termGroups, group); - dispatch(setActiveSession(nextSessionUid)); + dispatch(setActiveSession(nextSessionUid!)); } dispatch(ptyExitSession(sessionUid)); @@ -127,8 +129,8 @@ export function ptyExitTermGroup(sessionUid) { }; } -export function userExitTermGroup(uid) { - return (dispatch, getState) => { +export function userExitTermGroup(uid: string) { + return (dispatch: HyperDispatch, getState: () => HyperState) => { const {termGroups} = getState(); dispatch({ type: TERM_GROUP_EXIT, @@ -138,19 +140,19 @@ export function userExitTermGroup(uid) { if (Object.keys(termGroups.termGroups).length <= 1) { // No need to attempt finding a new active session // if this is the last one we've got: - return dispatch(userExitSession(group.sessionUid)); + return dispatch(userExitSession(group.sessionUid!)); } - const activeSessionUid = termGroups.activeSessions[termGroups.activeRootGroup]; + const activeSessionUid = termGroups.activeSessions[termGroups.activeRootGroup!]; if (termGroups.activeRootGroup === uid || activeSessionUid === group.sessionUid) { const nextSessionUid = findNextSessionUid(termGroups, group); - dispatch(setActiveSession(nextSessionUid)); + dispatch(setActiveSession(nextSessionUid!)); } if (group.sessionUid) { dispatch(userExitSession(group.sessionUid)); } else { - group.children.forEach(childUid => { + group.children.forEach((childUid) => { dispatch(userExitTermGroup(childUid)); }); } @@ -160,12 +162,12 @@ export function userExitTermGroup(uid) { } export function exitActiveTermGroup() { - return (dispatch, getState) => { + return (dispatch: HyperDispatch, getState: () => HyperState) => { dispatch({ type: TERM_GROUP_EXIT_ACTIVE, effect() { const {sessions, termGroups} = getState(); - const {uid} = findBySession(termGroups, sessions.activeUid); + const {uid} = findBySession(termGroups, sessions.activeUid!)!; dispatch(userExitTermGroup(uid)); } }); diff --git a/lib/actions/ui.js b/lib/actions/ui.ts similarity index 67% rename from lib/actions/ui.js rename to lib/actions/ui.ts index 259192ab..af947222 100644 --- a/lib/actions/ui.js +++ b/lib/actions/ui.ts @@ -1,11 +1,10 @@ import {php_escapeshellcmd as escapeShellCmd} from 'php-escape-shell'; -import last from '../utils/array'; -import isExecutable from '../utils/file'; -import getRootGroups from '../selectors'; +import {isExecutable} from '../utils/file'; +import {getRootGroups} from '../selectors'; import findBySession from '../utils/term-groups'; import notify from '../utils/notify'; import rpc from '../rpc'; -import {requestSession, sendSessionData, setActiveSession} from '../actions/sessions'; +import {requestSession, sendSessionData, setActiveSession} from './sessions'; import { UI_FONT_SIZE_SET, UI_FONT_SIZE_INCR, @@ -20,6 +19,8 @@ import { UI_WINDOW_GEOMETRY_CHANGED, UI_WINDOW_MOVE, UI_OPEN_FILE, + UI_ENTER_FULLSCREEN, + UI_LEAVE_FULLSCREEN, UI_OPEN_SSH_URL, UI_CONTEXTMENU_OPEN, UI_COMMAND_EXEC @@ -27,11 +28,11 @@ import { import {setActiveGroup} from './term-groups'; import parseUrl from 'parse-url'; +import {HyperState, HyperDispatch, HyperActions, ITermGroups} from '../hyper'; +import {stat, Stats} from 'fs'; -const {stat} = window.require('fs'); - -export function openContextMenu(uid, selection) { - return (dispatch, getState) => { +export function openContextMenu(uid: string, selection: any) { + return (dispatch: HyperDispatch, getState: () => HyperState) => { dispatch({ type: UI_CONTEXTMENU_OPEN, uid, @@ -47,7 +48,7 @@ export function openContextMenu(uid, selection) { } export function increaseFontSize() { - return (dispatch, getState) => { + return (dispatch: HyperDispatch, getState: () => HyperState) => { dispatch({ type: UI_FONT_SIZE_INCR, effect() { @@ -64,7 +65,7 @@ export function increaseFontSize() { } export function decreaseFontSize() { - return (dispatch, getState) => { + return (dispatch: HyperDispatch, getState: () => HyperState) => { dispatch({ type: UI_FONT_SIZE_DECR, effect() { @@ -81,14 +82,14 @@ export function decreaseFontSize() { }; } -export function resetFontSize() { +export function resetFontSize(): HyperActions { return { type: UI_FONT_SIZE_RESET }; } export function setFontSmoothing() { - return dispatch => { + return (dispatch: HyperDispatch) => { setTimeout(() => { const devicePixelRatio = window.devicePixelRatio; const fontSmoothing = devicePixelRatio < 2 ? 'subpixel-antialiased' : 'antialiased'; @@ -101,7 +102,7 @@ export function setFontSmoothing() { }; } -export function windowGeometryUpdated() { +export function windowGeometryUpdated(): HyperActions { return { type: UI_WINDOW_GEOMETRY_CHANGED }; @@ -109,18 +110,20 @@ export function windowGeometryUpdated() { // Find all sessions that are below the given // termGroup uid in the hierarchy: -const findChildSessions = (termGroups, uid) => { +const findChildSessions = (termGroups: ITermGroups, uid: string): string[] => { const group = termGroups[uid]; if (group.sessionUid) { return [uid]; } - return group.children.reduce((total, childUid) => total.concat(findChildSessions(termGroups, childUid)), []); + return group.children + .asMutable() + .reduce((total: string[], childUid: string) => total.concat(findChildSessions(termGroups, childUid)), []); }; // Get the index of the next or previous group, // depending on the movement direction: -const getNeighborIndex = (groups, uid, type) => { +const getNeighborIndex = (groups: string[], uid: string, type: string) => { if (type === UI_MOVE_NEXT_PANE) { return (groups.indexOf(uid) + 1) % groups.length; } @@ -128,47 +131,45 @@ const getNeighborIndex = (groups, uid, type) => { return (groups.indexOf(uid) + groups.length - 1) % groups.length; }; -function moveToNeighborPane(type) { - return () => (dispatch, getState) => { +function moveToNeighborPane(type: typeof UI_MOVE_NEXT_PANE | typeof UI_MOVE_PREV_PANE) { + return () => (dispatch: HyperDispatch, getState: () => HyperState) => { dispatch({ type, effect() { const {sessions, termGroups} = getState(); - const {uid} = findBySession(termGroups, sessions.activeUid); - const childGroups = findChildSessions(termGroups.termGroups, termGroups.activeRootGroup); + const {uid} = findBySession(termGroups, sessions.activeUid!)!; + const childGroups = findChildSessions(termGroups.termGroups, termGroups.activeRootGroup!); if (childGroups.length === 1) { - //eslint-disable-next-line no-console console.log('ignoring move for single group'); } else { const index = getNeighborIndex(childGroups, uid, type); const {sessionUid} = termGroups.termGroups[childGroups[index]]; - dispatch(setActiveSession(sessionUid)); + dispatch(setActiveSession(sessionUid!)); } } - }); + } as HyperActions); }; } export const moveToNextPane = moveToNeighborPane(UI_MOVE_NEXT_PANE); export const moveToPreviousPane = moveToNeighborPane(UI_MOVE_PREV_PANE); -const getGroupUids = state => { +const getGroupUids = (state: HyperState) => { const rootGroups = getRootGroups(state); return rootGroups.map(({uid}) => uid); }; export function moveLeft() { - return (dispatch, getState) => { + return (dispatch: HyperDispatch, getState: () => HyperState) => { dispatch({ type: UI_MOVE_LEFT, effect() { const state = getState(); - const uid = state.termGroups.activeRootGroup; + const uid = state.termGroups.activeRootGroup!; const groupUids = getGroupUids(state); const index = groupUids.indexOf(uid); - const next = groupUids[index - 1] || last(groupUids); + const next = groupUids[index - 1] || groupUids[groupUids.length - 1]; if (!next || uid === next) { - //eslint-disable-next-line no-console console.log('ignoring left move action'); } else { dispatch(setActiveGroup(next)); @@ -179,17 +180,16 @@ export function moveLeft() { } export function moveRight() { - return (dispatch, getState) => { + return (dispatch: HyperDispatch, getState: () => HyperState) => { dispatch({ type: UI_MOVE_RIGHT, effect() { const state = getState(); const groupUids = getGroupUids(state); - const uid = state.termGroups.activeRootGroup; + const uid = state.termGroups.activeRootGroup!; const index = groupUids.indexOf(uid); const next = groupUids[index + 1] || groupUids[0]; if (!next || uid === next) { - //eslint-disable-next-line no-console console.log('ignoring right move action'); } else { dispatch(setActiveGroup(next)); @@ -199,14 +199,14 @@ export function moveRight() { }; } -export function moveTo(i) { - return (dispatch, getState) => { +export function moveTo(i: number | 'last') { + return (dispatch: HyperDispatch, getState: () => HyperState) => { if (i === 'last') { // Finding last tab index const {termGroups} = getState().termGroups; i = Object.keys(termGroups) - .map(uid => termGroups[uid]) + .map((uid) => termGroups[uid]) .filter(({parentUid}) => !parentUid).length - 1; } dispatch({ @@ -216,13 +216,11 @@ export function moveTo(i) { const state = getState(); const groupUids = getGroupUids(state); const uid = state.termGroups.activeRootGroup; - if (uid === groupUids[i]) { - //eslint-disable-next-line no-console + if (uid === groupUids[i as number]) { console.log('ignoring same uid'); - } else if (groupUids[i]) { - dispatch(setActiveGroup(groupUids[i])); + } else if (groupUids[i as number]) { + dispatch(setActiveGroup(groupUids[i as number])); } else { - //eslint-disable-next-line no-console console.log('ignoring inexistent index', i); } } @@ -230,8 +228,8 @@ export function moveTo(i) { }; } -export function windowMove(window) { - return dispatch => { +export function windowMove(window: any) { + return (dispatch: HyperDispatch) => { dispatch({ type: UI_WINDOW_MOVE, window, @@ -243,7 +241,7 @@ export function windowMove(window) { } export function windowGeometryChange() { - return dispatch => { + return (dispatch: HyperDispatch) => { dispatch({ type: UI_WINDOW_MOVE, effect() { @@ -253,12 +251,12 @@ export function windowGeometryChange() { }; } -export function openFile(path) { - return dispatch => { +export function openFile(path: string) { + return (dispatch: HyperDispatch) => { dispatch({ type: UI_OPEN_FILE, effect() { - stat(path, (err, stats) => { + stat(path, (err: any, stats: Stats) => { if (err) { notify('Unable to open path', `"${path}" doesn't exist.`, {error: err}); } else { @@ -270,7 +268,7 @@ export function openFile(path) { } rpc.once('session add', ({uid}) => { rpc.once('session data', () => { - dispatch(sendSessionData(uid, command)); + dispatch(sendSessionData(uid, command, null)); }); }); } @@ -281,21 +279,33 @@ export function openFile(path) { }; } -export function openSSH(url) { - return dispatch => { +export function enterFullScreen(): HyperActions { + return { + type: UI_ENTER_FULLSCREEN + }; +} + +export function leaveFullScreen(): HyperActions { + return { + type: UI_LEAVE_FULLSCREEN + }; +} + +export function openSSH(url: string) { + return (dispatch: HyperDispatch) => { dispatch({ type: UI_OPEN_SSH_URL, effect() { - let parsedUrl = parseUrl(url, true); - let command = parsedUrl.protocol + ' ' + (parsedUrl.user ? `${parsedUrl.user}@` : '') + parsedUrl.resource; + const parsedUrl = parseUrl(url, true); + let command = `${parsedUrl.protocol} ${parsedUrl.user ? `${parsedUrl.user}@` : ''}${parsedUrl.resource}`; - if (parsedUrl.port) command += ' -p ' + parsedUrl.port; + if (parsedUrl.port) command += ` -p ${parsedUrl.port}`; command += '\n'; rpc.once('session add', ({uid}) => { rpc.once('session data', () => { - dispatch(sendSessionData(uid, command)); + dispatch(sendSessionData(uid, command, null)); }); }); @@ -305,14 +315,14 @@ export function openSSH(url) { }; } -export function execCommand(command, fn, e) { - return dispatch => +export function execCommand(command: string, fn: (e: any, dispatch: HyperDispatch) => void, e: any) { + return (dispatch: HyperDispatch) => dispatch({ type: UI_COMMAND_EXEC, command, effect() { if (fn) { - fn(e); + fn(e, dispatch); } else { rpc.emit('command', command); } diff --git a/lib/actions/updater.js b/lib/actions/updater.ts similarity index 51% rename from lib/actions/updater.js rename to lib/actions/updater.ts index f4d26389..17eef45b 100644 --- a/lib/actions/updater.js +++ b/lib/actions/updater.ts @@ -1,16 +1,17 @@ import {UPDATE_INSTALL, UPDATE_AVAILABLE} from '../constants/updater'; import rpc from '../rpc'; +import {HyperActions} from '../hyper'; -export function installUpdate() { +export function installUpdate(): HyperActions { return { type: UPDATE_INSTALL, effect: () => { - rpc.emit('quit and install'); + rpc.emit('quit and install', null); } }; } -export function updateAvailable(version, notes, releaseUrl, canInstall) { +export function updateAvailable(version: string, notes: string, releaseUrl: string, canInstall: boolean): HyperActions { return { type: UPDATE_AVAILABLE, version, diff --git a/lib/command-registry.js b/lib/command-registry.js deleted file mode 100644 index 41e9fabe..00000000 --- a/lib/command-registry.js +++ /dev/null @@ -1,46 +0,0 @@ -import {remote} from 'electron'; - -const {getDecoratedKeymaps} = remote.require('./plugins'); - -let commands = {}; - -export const getRegisteredKeys = () => { - const keymaps = getDecoratedKeymaps(); - - return Object.keys(keymaps).reduce((result, actionName) => { - const commandKeys = keymaps[actionName]; - commandKeys.forEach(shortcut => { - result[shortcut] = actionName; - }); - return result; - }, {}); -}; - -export const registerCommandHandlers = cmds => { - if (!cmds) { - return; - } - - commands = Object.assign(commands, cmds); -}; - -export const getCommandHandler = command => { - return commands[command]; -}; - -// Some commands are directly excuted by Electron menuItem role. -// They should not be prevented to reach Electron. -const roleCommands = [ - 'window:close', - 'editor:undo', - 'editor:redo', - 'editor:cut', - 'editor:copy', - 'editor:paste', - 'editor:selectAll', - 'window:minimize', - 'window:zoom', - 'window:toggleFullScreen' -]; - -export const shouldPreventDefault = command => !roleCommands.includes(command); diff --git a/lib/command-registry.ts b/lib/command-registry.ts new file mode 100644 index 00000000..27b6e513 --- /dev/null +++ b/lib/command-registry.ts @@ -0,0 +1,53 @@ +import {remote} from 'electron'; +import {HyperDispatch} from './hyper'; +import {closeSearch} from './actions/sessions'; +// TODO: Should be updates to new async API https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31 + +const {getDecoratedKeymaps} = remote.require('./plugins') as typeof import('../app/plugins'); + +let commands: Record void> = { + 'editor:search-close': (e, dispatch) => { + dispatch(closeSearch(undefined, e)); + } +}; + +export const getRegisteredKeys = () => { + const keymaps = getDecoratedKeymaps(); + + return Object.keys(keymaps).reduce((result: Record, actionName) => { + const commandKeys = keymaps[actionName]; + commandKeys.forEach((shortcut) => { + result[shortcut] = actionName; + }); + return result; + }, {}); +}; + +export const registerCommandHandlers = (cmds: typeof commands) => { + if (!cmds) { + return; + } + + commands = Object.assign(commands, cmds); +}; + +export const getCommandHandler = (command: string) => { + return commands[command]; +}; + +// Some commands are directly excuted by Electron menuItem role. +// They should not be prevented to reach Electron. +const roleCommands = [ + 'window:close', + 'editor:undo', + 'editor:redo', + 'editor:cut', + 'editor:copy', + 'editor:paste', + 'editor:selectAll', + 'window:minimize', + 'window:zoom', + 'window:toggleFullScreen' +]; + +export const shouldPreventDefault = (command: string) => !roleCommands.includes(command); diff --git a/lib/components/header.js b/lib/components/header.tsx similarity index 88% rename from lib/components/header.js rename to lib/components/header.tsx index ffeedb5f..faa131fb 100644 --- a/lib/components/header.js +++ b/lib/components/header.tsx @@ -3,21 +3,15 @@ import React from 'react'; import {decorate, getTabsProps} from '../utils/plugins'; import Tabs_ from './tabs'; +import {HeaderProps} from '../hyper'; const Tabs = decorate(Tabs_, 'Tabs'); -export default class Header extends React.PureComponent { - constructor() { - super(); - this.onChangeIntent = this.onChangeIntent.bind(this); - this.handleHeaderMouseDown = this.handleHeaderMouseDown.bind(this); - this.handleHamburgerMenuClick = this.handleHamburgerMenuClick.bind(this); - this.handleMaximizeClick = this.handleMaximizeClick.bind(this); - this.handleMinimizeClick = this.handleMinimizeClick.bind(this); - this.handleCloseClick = this.handleCloseClick.bind(this); - } +export default class Header extends React.PureComponent { + headerMouseDownWindowX!: number; + headerMouseDownWindowY!: number; - onChangeIntent(active) { + onChangeIntent = (active: string) => { // we ignore clicks if they're a byproduct of a drag // motion to move the window if (window.screenX !== this.headerMouseDownWindowX || window.screenY !== this.headerMouseDownWindowY) { @@ -25,47 +19,43 @@ export default class Header extends React.PureComponent { } this.props.onChangeTab(active); - } + }; - handleHeaderMouseDown(ev) { + handleHeaderMouseDown = () => { // the hack of all hacks, this prevents the term // iframe from losing focus, for example, when // the user drags the nav around - ev.preventDefault(); + // Fixed by calling window.focusActiveTerm(), thus we can support drag tab + // ev.preventDefault(); // persist start positions of a potential drag motion // to differentiate dragging from clicking this.headerMouseDownWindowX = window.screenX; this.headerMouseDownWindowY = window.screenY; - } + }; - handleHamburgerMenuClick(event) { + handleHamburgerMenuClick = (event: React.MouseEvent) => { let {right: x, bottom: y} = event.currentTarget.getBoundingClientRect(); x -= 15; // to compensate padding y -= 12; // ^ same this.props.openHamburgerMenu({x, y}); - } + }; - handleMaximizeClick() { + handleMaximizeClick = () => { if (this.props.maximized) { this.props.unmaximize(); } else { this.props.maximize(); } - } + }; - handleMinimizeClick() { + handleMinimizeClick = () => { this.props.minimize(); - } + }; - handleCloseClick() { + handleCloseClick = () => { this.props.close(); - } - - componentWillUnmount() { - delete this.clicks; - clearTimeout(this.clickTimer); - } + }; getWindowHeaderConfig() { const {showHamburgerMenu, showWindowControls} = this.props; @@ -92,7 +82,8 @@ export default class Header extends React.PureComponent { tabs: this.props.tabs, borderColor: this.props.borderColor, onClose: this.props.onCloseTab, - onChange: this.onChangeIntent + onChange: this.onChangeIntent, + fullScreen: this.props.fullScreen }); const {borderColor} = props; let title = 'Hyper'; @@ -110,6 +101,7 @@ export default class Header extends React.PureComponent {
window.focusActiveTerm()} onDoubleClick={this.handleMaximizeClick} > {!isMac && ( diff --git a/lib/components/notification.js b/lib/components/notification.tsx similarity index 83% rename from lib/components/notification.js rename to lib/components/notification.tsx index 0d5b6ffb..12e33eb1 100644 --- a/lib/components/notification.js +++ b/lib/components/notification.tsx @@ -1,13 +1,13 @@ import React from 'react'; +import {NotificationProps, NotificationState} from '../hyper'; -export default class Notification extends React.PureComponent { - constructor() { - super(); +export default class Notification extends React.PureComponent { + dismissTimer!: NodeJS.Timeout; + constructor(props: NotificationProps) { + super(props); this.state = { dismissing: false }; - this.handleDismiss = this.handleDismiss.bind(this); - this.onElement = this.onElement.bind(this); } componentDidMount() { @@ -16,24 +16,24 @@ export default class Notification extends React.PureComponent { } } - componentWillReceiveProps(next) { + componentDidUpdate(prevProps: NotificationProps, prevState: NotificationState) { // if we have a timer going and the notification text // changed we reset the timer - if (next.text !== this.props.text) { - if (this.props.dismissAfter) { + if (this.props.text !== prevProps.text) { + if (prevProps.dismissAfter) { this.resetDismissTimer(); } - if (this.state.dismissing) { + if (prevState.dismissing) { this.setState({dismissing: false}); } } } - handleDismiss() { + handleDismiss = () => { this.setState({dismissing: true}); - } + }; - onElement(el) { + onElement = (el: HTMLDivElement | null) => { if (el) { el.addEventListener('webkitTransitionEnd', () => { if (this.state.dismissing) { @@ -45,7 +45,7 @@ export default class Notification extends React.PureComponent { el.style.setProperty('background-color', backgroundColor, 'important'); } } - } + }; setDismissTimer() { this.dismissTimer = setTimeout(() => { diff --git a/lib/components/notifications.js b/lib/components/notifications.tsx similarity index 80% rename from lib/components/notifications.js rename to lib/components/notifications.tsx index 80ddf735..4a7b00bd 100644 --- a/lib/components/notifications.js +++ b/lib/components/notifications.tsx @@ -3,10 +3,11 @@ import React from 'react'; import {decorate} from '../utils/plugins'; import Notification_ from './notification'; +import {NotificationsProps} from '../hyper'; const Notification = decorate(Notification_, 'Notification'); -export default class Notifications extends React.PureComponent { +export default class Notifications extends React.PureComponent { render() { return (
@@ -49,8 +50,8 @@ export default class Notifications extends React.PureComponent { { - window.require('electron').shell.openExternal(ev.target.href); + onClick={(ev) => { + void window.require('electron').shell.openExternal(ev.currentTarget.href); ev.preventDefault(); }} href={this.props.messageURL} @@ -73,16 +74,18 @@ export default class Notifications extends React.PureComponent { userDismissable > Version {this.props.updateVersion} ready. - {this.props.updateNote && ` ${this.props.updateNote.trim().replace(/\.$/, '')}`} ( { - window.require('electron').shell.openExternal(ev.target.href); + onClick={(ev) => { + void window.require('electron').shell.openExternal(ev.currentTarget.href); ev.preventDefault(); }} - href={`https://github.com/zeit/hyper/releases/tag/${this.props.updateVersion}`} + href={`https://github.com/vercel/hyper/releases/tag/${this.props.updateVersion}`} > notes - ).{' '} + + ).{' '} {this.props.updateCanInstall ? ( { - window.require('electron').shell.openExternal(ev.target.href); + onClick={(ev) => { + void window.require('electron').shell.openExternal(ev.currentTarget.href); ev.preventDefault(); }} - href={this.props.updateReleaseUrl} + href={this.props.updateReleaseUrl!} > Download - )}.{' '} + )} + .{' '} )} {this.props.customChildren} diff --git a/lib/components/searchBox.tsx b/lib/components/searchBox.tsx new file mode 100644 index 00000000..1cc2fda7 --- /dev/null +++ b/lib/components/searchBox.tsx @@ -0,0 +1,80 @@ +import React from 'react'; +import {SearchBoxProps} from '../hyper'; + +const searchBoxStyling: React.CSSProperties = { + float: 'right', + height: '28px', + backgroundColor: 'white', + position: 'absolute', + right: '10px', + top: '0px', + width: '224px', + zIndex: 9999 +}; + +const enterKey = 13; + +export default class SearchBox extends React.PureComponent { + searchTerm: string; + constructor(props: SearchBoxProps) { + super(props); + this.searchTerm = ''; + } + + handleChange = (event: React.KeyboardEvent) => { + this.searchTerm = event.currentTarget.value; + if (event.keyCode === enterKey) { + this.props.search(event.currentTarget.value); + } + }; + + render() { + return ( +
+ input?.focus()} /> + this.props.prev(this.searchTerm)}> + + + this.props.next(this.searchTerm)}> + + + this.props.close()}> + + + +
+ ); + } +} diff --git a/lib/components/split-pane.js b/lib/components/split-pane.tsx similarity index 78% rename from lib/components/split-pane.js rename to lib/components/split-pane.tsx index 6f41fdc8..8ca6cd8c 100644 --- a/lib/components/split-pane.js +++ b/lib/components/split-pane.tsx @@ -1,31 +1,36 @@ -/* eslint-disable quote-props */ import React from 'react'; import _ from 'lodash'; +import {SplitPaneProps} from '../hyper'; -export default class SplitPane extends React.PureComponent { - constructor(props) { +export default class SplitPane extends React.PureComponent { + dragPanePosition!: number; + dragTarget!: Element; + panes!: Element[]; + paneIndex!: number; + d1!: 'height' | 'width'; + d2!: 'top' | 'left'; + d3!: 'clientX' | 'clientY'; + panesSize!: number; + dragging!: boolean; + constructor(props: SplitPaneProps) { super(props); - this.handleDragStart = this.handleDragStart.bind(this); - this.handleAutoResize = this.handleAutoResize.bind(this); - this.onDrag = this.onDrag.bind(this); - this.onDragEnd = this.onDragEnd.bind(this); this.state = {dragging: false}; } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps: SplitPaneProps) { if (this.state.dragging && prevProps.sizes !== this.props.sizes) { // recompute positions for ongoing dragging this.dragPanePosition = this.dragTarget.getBoundingClientRect()[this.d2]; } } - setupPanes(ev) { + setupPanes(ev: any) { this.panes = Array.from(ev.target.parentNode.childNodes); this.paneIndex = this.panes.indexOf(ev.target); this.paneIndex -= Math.ceil(this.paneIndex / 2); } - handleAutoResize(ev) { + handleAutoResize = (ev: React.MouseEvent) => { ev.preventDefault(); this.setupPanes(ev); @@ -39,9 +44,10 @@ export default class SplitPane extends React.PureComponent { sizes_[this.paneIndex + 1] = availableWidth / 2; this.props.onResize(sizes_); - } + }; - handleDragStart(ev) { + handleDragStart = (ev: any) => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-call ev.preventDefault(); this.setState({dragging: true}); window.addEventListener('mousemove', this.onDrag); @@ -60,26 +66,27 @@ export default class SplitPane extends React.PureComponent { this.dragTarget = ev.target; this.dragPanePosition = this.dragTarget.getBoundingClientRect()[this.d2]; + // eslint-disable-next-line @typescript-eslint/no-unsafe-call this.panesSize = ev.target.parentNode.getBoundingClientRect()[this.d1]; this.setupPanes(ev); - } + }; getSizes() { const {sizes} = this.props; - let sizes_; + let sizes_: number[]; if (sizes) { - sizes_ = [].concat(sizes); + sizes_ = [...sizes.asMutable()]; } else { - const total = this.props.children.length; - const count = new Array(total).fill(1 / total); + const total = (this.props.children as React.ReactNodeArray).length; + const count = new Array(total).fill(1 / total); sizes_ = count; } return sizes_; } - onDrag(ev) { + onDrag = (ev: MouseEvent) => { const sizes_ = this.getSizes(); const i = this.paneIndex; @@ -93,34 +100,31 @@ export default class SplitPane extends React.PureComponent { sizes_[i + 1] += d; } this.props.onResize(sizes_); - } + }; - onDragEnd() { + onDragEnd = () => { if (this.state.dragging) { window.removeEventListener('mousemove', this.onDrag); window.removeEventListener('mouseup', this.onDragEnd); this.setState({dragging: false}); } - } + }; render() { - const children = this.props.children; + const children = this.props.children as React.ReactNodeArray; const {direction, borderColor} = this.props; const sizeProperty = direction === 'horizontal' ? 'height' : 'width'; - let {sizes} = this.props; - if (!sizes) { - // workaround for the fact that if we don't specify - // sizes, sometimes flex fails to calculate the - // right height for the horizontal panes - sizes = new Array(children.length).fill(1 / children.length); - } + // workaround for the fact that if we don't specify + // sizes, sometimes flex fails to calculate the + // right height for the horizontal panes + const sizes = this.props.sizes || new Array(children.length).fill(1 / children.length); return (
{React.Children.map(children, (child, i) => { const style = { // flexBasis doesn't work for the first horizontal pane, height need to be specified - [sizeProperty]: sizes[i] * 100 + '%', - flexBasis: sizes[i] * 100 + '%', + [sizeProperty]: `${sizes[i] * 100}%`, + flexBasis: `${sizes[i] * 100}%`, flexGrow: 0 }; return [ diff --git a/lib/components/style-sheet.js b/lib/components/style-sheet.tsx similarity index 96% rename from lib/components/style-sheet.js rename to lib/components/style-sheet.tsx index 1dc02b72..a20af4c4 100644 --- a/lib/components/style-sheet.js +++ b/lib/components/style-sheet.tsx @@ -1,6 +1,7 @@ import React from 'react'; +import {StyleSheetProps} from '../hyper'; -export default class StyleSheet extends React.PureComponent { +export default class StyleSheet extends React.PureComponent { render() { const {backgroundColor, fontFamily, foregroundColor, borderColor} = this.props; diff --git a/lib/components/tab.js b/lib/components/tab.tsx similarity index 83% rename from lib/components/tab.js rename to lib/components/tab.tsx index 33c31539..87421309 100644 --- a/lib/components/tab.js +++ b/lib/components/tab.tsx @@ -1,50 +1,33 @@ import React from 'react'; +import {TabProps} from '../hyper'; -export default class Tab extends React.PureComponent { - constructor() { - super(); - - this.handleHover = this.handleHover.bind(this); - this.handleBlur = this.handleBlur.bind(this); - this.handleClick = this.handleClick.bind(this); - - this.state = { - hovered: false - }; +export default class Tab extends React.PureComponent { + constructor(props: TabProps) { + super(props); } - handleHover() { - this.setState({ - hovered: true - }); - } - - handleBlur() { - this.setState({ - hovered: false - }); - } - - handleClick(event) { + handleClick = (event: React.MouseEvent) => { const isLeftClick = event.nativeEvent.which === 1; - const isMiddleClick = event.nativeEvent.which === 2; if (isLeftClick && !this.props.isActive) { this.props.onSelect(); - } else if (isMiddleClick) { + } + }; + + handleMouseUp = (event: React.MouseEvent) => { + const isMiddleClick = event.nativeEvent.which === 2; + + if (isMiddleClick) { this.props.onClose(); } - } + }; render() { const {isActive, isFirst, isLast, borderColor, hasActivity} = this.props; - const {hovered} = this.state; return (
  • {this.props.text} - + @@ -157,7 +141,7 @@ export default class Tab extends React.PureComponent { color: #909090; } - .tab_iconHovered { + .tab_tab:hover .tab_icon { opacity: 1; transform: none; pointer-events: all; diff --git a/lib/components/tabs.js b/lib/components/tabs.tsx similarity index 77% rename from lib/components/tabs.js rename to lib/components/tabs.tsx index 1d411fac..6055469e 100644 --- a/lib/components/tabs.js +++ b/lib/components/tabs.tsx @@ -3,13 +3,14 @@ import React from 'react'; import {decorate, getTabProps} from '../utils/plugins'; import Tab_ from './tab'; +import {TabsProps} from '../hyper'; const Tab = decorate(Tab_, 'Tab'); const isMac = /Mac/.test(navigator.userAgent); -export default class Tabs extends React.PureComponent { +export default class Tabs extends React.PureComponent { render() { - const {tabs = [], borderColor, onChange, onClose} = this.props; + const {tabs = [], borderColor, onChange, onClose, fullScreen} = this.props; const hide = !isMac && tabs.length === 1; @@ -19,7 +20,7 @@ export default class Tabs extends React.PureComponent { {tabs.length === 1 && isMac ?
    {tabs[0].title}
    : null} {tabs.length > 1 ? [ -
      +
        {tabs.map((tab, i) => { const {uid, title, isActive, hasActivity} = tab; const props = getTabProps(tab, this.props, { @@ -35,7 +36,13 @@ export default class Tabs extends React.PureComponent { return ; })}
      , - isMac &&
      + isMac && ( +
      + ) ] : null} {this.props.customChildren} @@ -75,6 +82,10 @@ export default class Tabs extends React.PureComponent { margin-left: ${isMac ? '76px' : '0'}; } + .tabs_fullScreen { + margin-left: -1px; + } + .tabs_borderShim { position: absolute; width: 76px; @@ -83,6 +94,10 @@ export default class Tabs extends React.PureComponent { border-bottom-style: solid; border-bottom-width: 1px; } + + .tabs_borderShimUndo { + border-bottom-width: 0px; + } `} ); diff --git a/lib/components/term-group.js b/lib/components/term-group.tsx similarity index 66% rename from lib/components/term-group.js rename to lib/components/term-group.tsx index f78c74df..2b6a152b 100644 --- a/lib/components/term-group.js +++ b/lib/components/term-group.tsx @@ -4,36 +4,41 @@ import {decorate, getTermProps, getTermGroupProps} from '../utils/plugins'; import {resizeTermGroup} from '../actions/term-groups'; import Term_ from './term'; import SplitPane_ from './split-pane'; +import {HyperState, HyperDispatch, TermGroupProps, TermGroupOwnProps} from '../hyper'; const Term = decorate(Term_, 'Term'); const SplitPane = decorate(SplitPane_, 'SplitPane'); -class TermGroup_ extends React.PureComponent { - constructor(props, context) { +class TermGroup_ extends React.PureComponent { + bound: WeakMap<(uid: string, ...args: any[]) => any, Record any>>; + term?: Term_ | null; + constructor(props: TermGroupProps, context: any) { super(props, context); this.bound = new WeakMap(); - this.termRefs = {}; - this.onTermRef = this.onTermRef.bind(this); } - bind(fn, thisObj, uid) { + bind any>( + fn: T, + thisObj: any, + uid: string + ): (...args: T extends (uid: string, ..._args: infer I) => any ? I : never) => ReturnType { if (!this.bound.has(fn)) { this.bound.set(fn, {}); } - const map = this.bound.get(fn); + const map = this.bound.get(fn)!; if (!map[uid]) { map[uid] = fn.bind(thisObj, uid); } return map[uid]; } - renderSplit(groups) { + renderSplit(groups: JSX.Element[]) { const [first, ...rest] = groups; if (rest.length === 0) { return first; } - const direction = this.props.termGroup.direction.toLowerCase(); + const direction = this.props.termGroup.direction!.toLowerCase() as 'horizontal' | 'vertical'; return ( { this.term = term; this.props.ref_(uid, term); - } + }; - renderTerm(uid) { + renderTerm(uid: string) { const session = this.props.sessions[uid]; const termRef = this.props.terms[uid]; const props = getTermProps(uid, this.props, { isTermActive: uid === this.props.activeSession, term: termRef ? termRef.term : null, + fitAddon: termRef ? termRef.fitAddon : null, + searchAddon: termRef ? termRef.searchAddon : null, scrollback: this.props.scrollback, backgroundColor: this.props.backgroundColor, foregroundColor: this.props.foregroundColor, @@ -77,21 +84,26 @@ class TermGroup_ extends React.PureComponent { padding: this.props.padding, url: session.url, cleared: session.cleared, + search: session.search, cols: session.cols, rows: session.rows, copyOnSelect: this.props.copyOnSelect, bell: this.props.bell, bellSoundURL: this.props.bellSoundURL, + bellSound: this.props.bellSound, onActive: this.bind(this.props.onActive, null, uid), onResize: this.bind(this.props.onResize, null, uid), onTitle: this.bind(this.props.onTitle, null, uid), onData: this.bind(this.props.onData, null, uid), + toggleSearch: this.bind(this.props.toggleSearch, null, uid), onContextMenu: this.bind(this.props.onContextMenu, null, uid), borderColor: this.props.borderColor, selectionColor: this.props.selectionColor, quickEdit: this.props.quickEdit, webGLRenderer: this.props.webGLRenderer, + webLinksActivationKey: this.props.webLinksActivationKey, macOptionSelectionMode: this.props.macOptionSelectionMode, + disableLigatures: this.props.disableLigatures, uid }); @@ -107,7 +119,7 @@ class TermGroup_ extends React.PureComponent { return this.renderTerm(termGroup.sessionUid); } - const groups = childGroups.map(child => { + const groups = childGroups.asMutable().map((child) => { const props = getTermGroupProps( child.uid, this.props.parentProps, @@ -121,17 +133,20 @@ class TermGroup_ extends React.PureComponent { } } -const TermGroup = connect( - (state, ownProps) => ({ - childGroups: ownProps.termGroup.children.map(uid => state.termGroups.termGroups[uid]) - }), - (dispatch, ownProps) => ({ - onTermGroupResize(splitSizes) { - dispatch(resizeTermGroup(ownProps.termGroup.uid, splitSizes)); - } - }) -)(TermGroup_); +const mapStateToProps = (state: HyperState, ownProps: TermGroupOwnProps) => ({ + childGroups: ownProps.termGroup.children.map((uid) => state.termGroups.termGroups[uid]) +}); + +const mapDispatchToProps = (dispatch: HyperDispatch, ownProps: TermGroupOwnProps) => ({ + onTermGroupResize(splitSizes: number[]) { + dispatch(resizeTermGroup(ownProps.termGroup.uid, splitSizes)); + } +}); + +const TermGroup = connect(mapStateToProps, mapDispatchToProps, null, {forwardRef: true})(TermGroup_); const DecoratedTermGroup = decorate(TermGroup, 'TermGroup'); export default TermGroup; + +export type TermGroupConnectedProps = ReturnType & ReturnType; diff --git a/lib/components/term.js b/lib/components/term.tsx similarity index 50% rename from lib/components/term.js rename to lib/components/term.tsx index 74694c5f..b80f9d0f 100644 --- a/lib/components/term.js +++ b/lib/components/term.tsx @@ -1,24 +1,27 @@ -/* global Blob,URL,requestAnimationFrame,ResizeObserver */ import React from 'react'; -import {Terminal} from 'xterm'; -import * as fit from 'xterm/lib/addons/fit/fit'; -import * as webLinks from 'xterm/lib/addons/webLinks/webLinks'; -import * as winptyCompat from 'xterm/lib/addons/winptyCompat/winptyCompat'; -import {clipboard} from 'electron'; -import * as Color from 'color'; +import {Terminal, ITerminalOptions, IDisposable} from 'xterm'; +import {FitAddon} from 'xterm-addon-fit'; +import {WebLinksAddon} from 'xterm-addon-web-links'; +import {SearchAddon} from 'xterm-addon-search'; +import {WebglAddon} from 'xterm-addon-webgl'; +import {LigaturesAddon} from 'xterm-addon-ligatures'; +import {Unicode11Addon} from 'xterm-addon-unicode11'; +import {clipboard, shell} from 'electron'; +import Color from 'color'; import terms from '../terms'; import processClipboard from '../utils/paste'; +import SearchBox from './searchBox'; +import {TermProps} from '../hyper'; +import {ObjectTypedKeys} from '../utils/object'; -Terminal.applyAddon(fit); -Terminal.applyAddon(webLinks); -Terminal.applyAddon(winptyCompat); +const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].includes(navigator.platform); // map old hterm constants to xterm.js const CURSOR_STYLES = { BEAM: 'bar', UNDERLINE: 'underline', BLOCK: 'block' -}; +} as const; const isWebgl2Supported = (() => { let isSupported = window.WebGL2RenderingContext ? undefined : false; @@ -32,28 +35,11 @@ const isWebgl2Supported = (() => { }; })(); -const getTermOptions = props => { +const getTermOptions = (props: TermProps): ITerminalOptions => { // Set a background color only if it is opaque const needTransparency = Color(props.backgroundColor).alpha() < 1; const backgroundColor = needTransparency ? 'transparent' : props.backgroundColor; - let useWebGL = false; - if (props.webGLRenderer) { - if (needTransparency) { - // eslint-disable-next-line no-console - console.warn( - 'WebGL Renderer has been disabled since it does not support transparent backgrounds yet. ' + - 'Falling back to canvas-based rendering.' - ); - } else if (!isWebgl2Supported()) { - // eslint-disable-next-line no-console - console.warn('WebGL2 is not supported on your machine. Falling back to canvas-based rendering.'); - } else { - useWebGL = true; - } - } - Term.reportRenderer(props.uid, useWebGL ? 'WebGL' : 'Canvas'); - return { macOptionIsMeta: props.modifierKeys.altIsMeta, scrollback: props.scrollback, @@ -67,11 +53,8 @@ const getTermOptions = props => { letterSpacing: props.letterSpacing, allowTransparency: needTransparency, macOptionClickForcesSelection: props.macOptionSelectionMode === 'force', - // HACK: Terminal.setOption breaks if we don't apply these in this order - // TODO: The above notice can be removed once this is addressed: - // https://github.com/xtermjs/xterm.js/pull/1790#issuecomment-450000121 - rendererType: useWebGL ? 'webgl' : 'canvas', - experimentalCharAtlas: useWebGL ? 'webgl' : 'dynamic', + bellStyle: props.bell === 'SOUND' ? 'sound' : 'none', + windowsMode: isWindows, theme: { foreground: props.foregroundColor, background: backgroundColor, @@ -98,22 +81,32 @@ const getTermOptions = props => { }; }; -export default class Term extends React.PureComponent { - constructor(props) { +export default class Term extends React.PureComponent { + termRef: HTMLElement | null; + termWrapperRef: HTMLElement | null; + termOptions: ITerminalOptions; + disposableListeners: IDisposable[]; + termDefaultBellSound: string | null; + fitAddon: FitAddon; + searchAddon: SearchAddon; + static rendererTypes: Record; + term!: Terminal; + resizeObserver!: ResizeObserver; + resizeTimeout!: NodeJS.Timeout; + constructor(props: TermProps) { super(props); props.ref_(props.uid, this); this.termRef = null; this.termWrapperRef = null; - this.termRect = null; - this.onWindowPaste = this.onWindowPaste.bind(this); - this.onTermWrapperRef = this.onTermWrapperRef.bind(this); - this.onMouseUp = this.onMouseUp.bind(this); this.termOptions = {}; this.disposableListeners = []; + this.termDefaultBellSound = null; + this.fitAddon = new FitAddon(); + this.searchAddon = new SearchAddon(); } // The main process shows this in the About dialog - static reportRenderer(uid, type) { + static reportRenderer(uid: string, type: string) { const rendererTypes = Term.rendererTypes || {}; if (rendererTypes[uid] !== type) { rendererTypes[uid] = type; @@ -127,57 +120,117 @@ export default class Term extends React.PureComponent { this.termOptions = getTermOptions(props); this.term = props.term || new Terminal(this.termOptions); + this.termDefaultBellSound = this.term.getOption('bellSound'); // The parent element for the terminal is attached and removed manually so // that we can preserve it across mounts and unmounts of the component - this.termRef = props.term ? props.term._core._parent : document.createElement('div'); + this.termRef = props.term ? props.term.element!.parentElement! : document.createElement('div'); this.termRef.className = 'term_fit term_term'; - this.termWrapperRef.appendChild(this.termRef); + this.termWrapperRef?.appendChild(this.termRef); if (!props.term) { + const needTransparency = Color(props.backgroundColor).alpha() < 1; + let useWebGL = false; + if (props.webGLRenderer) { + if (needTransparency) { + console.warn( + 'WebGL Renderer has been disabled since it does not support transparent backgrounds yet. ' + + 'Falling back to canvas-based rendering.' + ); + } else if (!isWebgl2Supported()) { + console.warn('WebGL2 is not supported on your machine. Falling back to canvas-based rendering.'); + } else { + // Experimental WebGL renderer needs some more glue-code to make it work on Hyper. + // If you're working on enabling back WebGL, you will also need to look into `xterm-addon-ligatures` support for that renderer. + useWebGL = true; + } + } + Term.reportRenderer(props.uid, useWebGL ? 'WebGL' : 'Canvas'); + + const shallActivateWebLink = (event: Record | undefined): boolean => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + return event && (!props.webLinksActivationKey || event[`${props.webLinksActivationKey}Key`]); + }; + + // eslint-disable-next-line @typescript-eslint/unbound-method this.term.attachCustomKeyEventHandler(this.keyboardHandler); + this.term.loadAddon(this.fitAddon); + this.term.loadAddon(this.searchAddon); + this.term.loadAddon( + new WebLinksAddon( + (event: MouseEvent | undefined, uri: string) => { + if (shallActivateWebLink(event)) void shell.openExternal(uri); + }, + { + // prevent default electron link handling to allow selection, e.g. via double-click + willLinkActivate: (event: MouseEvent | undefined) => { + event?.preventDefault(); + return shallActivateWebLink(event); + }, + priority: Date.now() + } + ) + ); this.term.open(this.termRef); - this.term.webLinksInit(); - this.term.winptyCompatInit(); + if (useWebGL) { + this.term.loadAddon(new WebglAddon()); + } + if (props.disableLigatures !== true) { + this.term.loadAddon(new LigaturesAddon()); + } + this.term.loadAddon(new Unicode11Addon()); + this.term.unicode.activeVersion = '11'; + } else { + // get the cached plugins + this.fitAddon = props.fitAddon!; + this.searchAddon = props.searchAddon!; } + this.fitAddon.fit(); + if (this.props.isTermActive) { this.term.focus(); } if (props.onTitle) { - this.disposableListeners.push(this.term.addDisposableListener('title', props.onTitle)); + this.disposableListeners.push(this.term.onTitleChange(props.onTitle)); } if (props.onActive) { - this.disposableListeners.push(this.term.addDisposableListener('focus', props.onActive)); + this.term.textarea?.addEventListener('focus', props.onActive); + this.disposableListeners.push({ + dispose: () => this.term.textarea?.removeEventListener('focus', this.props.onActive) + }); } if (props.onData) { - this.disposableListeners.push(this.term.addDisposableListener('data', props.onData)); + this.disposableListeners.push(this.term.onData(props.onData)); } if (props.onResize) { this.disposableListeners.push( - this.term.addDisposableListener('resize', ({cols, rows}) => { + this.term.onResize(({cols, rows}) => { props.onResize(cols, rows); }) ); + + // the row and col of init session is null, so reize the node-pty + props.onResize(this.term.cols, this.term.rows); } if (props.onCursorMove) { this.disposableListeners.push( - this.term.addDisposableListener('cursormove', () => { + this.term.onCursorMove(() => { const cursorFrame = { - x: this.term._core.buffer.x * this.term._core.renderer.dimensions.actualCellWidth, - y: this.term._core.buffer.y * this.term._core.renderer.dimensions.actualCellHeight, - width: this.term._core.renderer.dimensions.actualCellWidth, - height: this.term._core.renderer.dimensions.actualCellHeight, - col: this.term._core.buffer.x, - row: this.term._core.buffer.y + x: this.term.buffer.active.cursorX * (this.term as any)._core._renderService.dimensions.actualCellWidth, + y: this.term.buffer.active.cursorY * (this.term as any)._core._renderService.dimensions.actualCellHeight, + width: (this.term as any)._core._renderService.dimensions.actualCellWidth, + height: (this.term as any)._core._renderService.dimensions.actualCellHeight, + col: this.term.buffer.active.cursorX, + row: this.term.buffer.active.cursorY }; - props.onCursorMove(cursorFrame); + props.onCursorMove?.(cursorFrame); }) ); } @@ -190,7 +243,6 @@ export default class Term extends React.PureComponent { } getTermDocument() { - // eslint-disable-next-line no-console console.warn( 'The underlying terminal engine of Hyper no longer ' + 'uses iframes with individual `document` objects for each ' + @@ -203,18 +255,19 @@ export default class Term extends React.PureComponent { // intercepting paste event for any necessary processing of // clipboard data, if result is falsy, paste event continues - onWindowPaste(e) { + onWindowPaste = (e: Event) => { if (!this.props.isTermActive) return; const processed = processClipboard(); if (processed) { e.preventDefault(); e.stopPropagation(); - this.term._core.handler(processed); + // eslint-disable-next-line @typescript-eslint/no-unsafe-call + (this.term as any)._core.handler(processed); } - } + }; - onMouseUp(e) { + onMouseUp = (e: React.MouseEvent) => { if (this.props.quickEdit && e.button === 2) { if (this.term.hasSelection()) { clipboard.writeText(this.term.getSelection()); @@ -225,9 +278,9 @@ export default class Term extends React.PureComponent { } else if (this.props.copyOnSelect && this.term.hasSelection()) { clipboard.writeText(this.term.getSelection()); } - } + }; - write(data) { + write(data: string | Uint8Array) { this.term.write(data); } @@ -243,7 +296,23 @@ export default class Term extends React.PureComponent { this.term.reset(); } - resize(cols, rows) { + search = (searchTerm = '') => { + this.searchAddon.findNext(searchTerm); + }; + + searchNext = (searchTerm: string) => { + this.searchAddon.findNext(searchTerm); + }; + + searchPrevious = (searchTerm: string) => { + this.searchAddon.findPrevious(searchTerm); + }; + + closeSearchBox = () => { + this.props.toggleSearch(); + }; + + resize(cols: number, rows: number) { this.term.resize(cols, rows); } @@ -255,24 +324,33 @@ export default class Term extends React.PureComponent { if (!this.termWrapperRef) { return; } - this.term.fit(); + this.fitAddon.fit(); } - keyboardHandler(e) { + keyboardHandler(e: any) { // Has Mousetrap flagged this event as a command? return !e.catched; } - componentWillReceiveProps(nextProps) { - if (!this.props.cleared && nextProps.cleared) { + componentDidUpdate(prevProps: TermProps) { + if (!prevProps.cleared && this.props.cleared) { this.clear(); } - const nextTermOptions = getTermOptions(nextProps); + + const nextTermOptions = getTermOptions(this.props); + + // Use bellSound in nextProps if it exists + // otherwise use the default sound found in xterm. + nextTermOptions.bellSound = this.props.bellSound || this.termDefaultBellSound!; + + if (!prevProps.search && this.props.search) { + this.search(); + } // Update only options that have changed. - Object.keys(nextTermOptions) - .filter(option => option !== 'theme' && nextTermOptions[option] !== this.termOptions[option]) - .forEach(option => { + ObjectTypedKeys(nextTermOptions) + .filter((option) => option !== 'theme' && nextTermOptions[option] !== this.termOptions[option]) + .forEach((option) => { try { this.term.setOption(option, nextTermOptions[option]); } catch (e) { @@ -288,8 +366,8 @@ export default class Term extends React.PureComponent { const shouldUpdateTheme = !this.termOptions.theme || nextTermOptions.rendererType !== this.termOptions.rendererType || - Object.keys(nextTermOptions.theme).some( - option => nextTermOptions.theme[option] !== this.termOptions.theme[option] + ObjectTypedKeys(nextTermOptions.theme!).some( + (option) => nextTermOptions.theme![option] !== this.termOptions.theme![option] ); if (shouldUpdateTheme) { this.term.setOption('theme', nextTermOptions.theme); @@ -298,49 +376,46 @@ export default class Term extends React.PureComponent { this.termOptions = nextTermOptions; if ( - this.props.fontSize !== nextProps.fontSize || - this.props.fontFamily !== nextProps.fontFamily || - this.props.lineHeight !== nextProps.lineHeight || - this.props.letterSpacing !== nextProps.letterSpacing + this.props.fontSize !== prevProps.fontSize || + this.props.fontFamily !== prevProps.fontFamily || + this.props.lineHeight !== prevProps.lineHeight || + this.props.letterSpacing !== prevProps.letterSpacing ) { // resize to fit the container this.fitResize(); } - if (nextProps.rows !== this.props.rows || nextProps.cols !== this.props.cols) { - this.resize(nextProps.cols, nextProps.rows); + if (prevProps.rows !== this.props.rows || prevProps.cols !== this.props.cols) { + this.resize(this.props.cols!, this.props.rows!); } } - onTermWrapperRef(component) { + onTermWrapperRef = (component: HTMLElement | null) => { this.termWrapperRef = component; if (component) { this.resizeObserver = new ResizeObserver(() => { - if (this.resizeTimeout) { - return; - } + clearTimeout(this.resizeTimeout); this.resizeTimeout = setTimeout(() => { - delete this.resizeTimeout; this.fitResize(); - }, 0); + }, 500); }); this.resizeObserver.observe(component); } else { this.resizeObserver.disconnect(); } - } + }; componentWillUnmount() { terms[this.props.uid] = null; - this.termWrapperRef.removeChild(this.termRef); + this.termWrapperRef?.removeChild(this.termRef!); this.props.ref_(this.props.uid, null); // to clean up the terminal, we remove the listeners // instead of invoking `destroy`, since it will make the // term insta un-attachable in the future (which we need // to do in case of splitting, see `componentDidMount` - this.disposableListeners.forEach(handler => handler.dispose()); + this.disposableListeners.forEach((handler) => handler.dispose()); this.disposableListeners = []; window.removeEventListener('paste', this.onWindowPaste, { @@ -358,6 +433,16 @@ export default class Term extends React.PureComponent { {this.props.customChildrenBefore}
      {this.props.customChildren} + {this.props.search ? ( + + ) : ( + '' + )}