X-Git-Url: https://git.josue.xyz/?p=dotfiles%2F.git;a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-markdownlint%2Flib%2Findex.js;h=869ca8282dc466899f304c3d7bedca01d47df76b;hp=7ed39ab48d35262fbc7e79646d982b1025657a3a;hb=4d07c77cf4d78cab8639e13ddc3c22495e585b0b;hpb=b3950616b54221c40a7dab9099bda675007e5b6e diff --git a/.config/coc/extensions/node_modules/coc-markdownlint/lib/index.js b/.config/coc/extensions/node_modules/coc-markdownlint/lib/index.js index 7ed39ab4..869ca828 100644 --- a/.config/coc/extensions/node_modules/coc-markdownlint/lib/index.js +++ b/.config/coc/extensions/node_modules/coc-markdownlint/lib/index.js @@ -1,30247 +1,2 @@ -(function(e, a) { for(var i in a) e[i] = a[i]; }(exports, /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.activate = void 0; -const coc_nvim_1 = __webpack_require__(1); -const engine_1 = __webpack_require__(2); -const documentSelector = [ - { - language: 'markdown', - scheme: 'file' - }, - { - language: 'markdown', - scheme: 'untitled' - } -]; -let documentVersion = 0; -const engine = new engine_1.MarkdownlintEngine(); -const config = coc_nvim_1.workspace.getConfiguration('markdownlint'); -function didOpenTextDocument(document) { - if (config.get('onOpen', true)) { - engine.lint(document); - } -} -async function didChangeTextDocument(params) { - if (!config.get('onChange', true)) { - return; - } - if (params.textDocument.version && documentVersion !== params.textDocument.version) { - documentVersion = params.textDocument.version; - const { document } = await coc_nvim_1.workspace.getCurrentState(); - engine.lint(document); - } -} -async function didSaveTextDocument(document) { - if (config.get('onSave', true)) { - engine.lint(document); - } -} -async function activate(context) { - await engine.parseConfig(); - context.subscriptions.push(coc_nvim_1.languages.registerCodeActionProvider(documentSelector, engine, 'markdownlint'), coc_nvim_1.commands.registerCommand(engine.fixAllCommandName, async () => { - const { document } = await coc_nvim_1.workspace.getCurrentState(); - engine.fixAll(document); - }), coc_nvim_1.workspace.onDidOpenTextDocument(didOpenTextDocument), coc_nvim_1.workspace.onDidChangeTextDocument(didChangeTextDocument), coc_nvim_1.workspace.onDidSaveTextDocument(didSaveTextDocument), coc_nvim_1.events.on('BufEnter', bufnr => { - if (!bufnr) { - return; - } - const doc = coc_nvim_1.workspace.getDocument(bufnr); - if (!doc) { - return; - } - didOpenTextDocument(doc.textDocument); - })); - coc_nvim_1.workspace.documents.map((doc) => { - didOpenTextDocument(doc.textDocument); - }); -} -exports.activate = activate; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports) { - -module.exports = require("coc.nvim"); - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MarkdownlintEngine = void 0; -const coc_nvim_1 = __webpack_require__(1); -const deep_extend_1 = __importDefault(__webpack_require__(3)); -const fs_1 = __importDefault(__webpack_require__(4)); -const js_yaml_1 = __importDefault(__webpack_require__(5)); -const markdownlint_1 = __importDefault(__webpack_require__(37)); -const markdownlint_rule_helpers_1 = __webpack_require__(156); -const path_1 = __importDefault(__webpack_require__(38)); -const rc_1 = __importDefault(__webpack_require__(157)); -const vscode_languageserver_protocol_1 = __webpack_require__(162); -const projectConfigFiles = ['.markdownlint.json', '.markdownlint.yaml', '.markdownlint.yml']; -const configFileParsers = [JSON.parse, js_yaml_1.default.safeLoad]; -class MarkdownlintEngine { - constructor() { - this.fixAllCommandName = 'markdownlint.fixAll'; - this.source = 'markdownlint'; - this.outputChannel = coc_nvim_1.workspace.createOutputChannel(this.source); - this.diagnosticCollection = coc_nvim_1.languages.createDiagnosticCollection(this.source); - this.config = {}; - } - outputLine(message) { - if (this.outputChannel) { - this.outputChannel.appendLine(`[${new Date().toLocaleTimeString()}] ${message}`); - } - } - async parseConfig() { - try { - this.config = rc_1.default(this.source, {}); - this.outputLine(`Info: global config: ${JSON.stringify(rc_1.default(this.source, {}))}`); - } - catch (e) { - this.outputLine(`Error: global config parse failed: ${e}`); - } - try { - const preferences = coc_nvim_1.workspace.getConfiguration('coc.preferences'); - const rootFolder = await coc_nvim_1.workspace.resolveRootFolder(coc_nvim_1.Uri.parse(coc_nvim_1.workspace.uri), preferences.get('rootPatterns', [])); - for (const projectConfigFile of projectConfigFiles) { - const fullPath = path_1.default.join(rootFolder, projectConfigFile); - if (fs_1.default.existsSync(fullPath)) { - // @ts-ignore - const projectConfig = markdownlint_1.default.readConfigSync(fullPath, configFileParsers); - this.config = deep_extend_1.default(this.config, projectConfig); - this.outputLine(`Info: local config: ${fullPath}, ${JSON.stringify(projectConfig)}`); - break; - } - } - } - catch (e) { - this.outputLine(`Error: local config parse failed: ${e}`); - } - const cocConfig = coc_nvim_1.workspace.getConfiguration('markdownlint').get('config'); - if (cocConfig) { - this.config = deep_extend_1.default(this.config, cocConfig); - this.outputLine(`Info: config from coc-settings.json: ${JSON.stringify(cocConfig)}`); - } - this.outputLine(`Info: full config: ${JSON.stringify(this.config)}`); - } - markdownlintWrapper(document) { - const options = { - resultVersion: 3, - config: this.config, - // customRules: customRules, - strings: { - [document.uri]: document.getText() - } - }; - let results = []; - try { - results = markdownlint_1.default.sync(options)[document.uri]; - } - catch (e) { - this.outputLine(`Error: lint exception: ${e.stack}`); - } - return results; - } - async provideCodeActions(document, _range, context) { - const codeActions = []; - const fixInfoDiagnostics = []; - for (const diagnostic of context.diagnostics) { - // @ts-ignore - if (diagnostic.fixInfo) { - // @ts-ignore - const lineNumber = diagnostic.fixInfo.lineNumber - 1 || diagnostic.range.start.line; - const line = await coc_nvim_1.workspace.getLine(document.uri, lineNumber); - // @ts-ignore - const newText = markdownlint_rule_helpers_1.applyFix(line, diagnostic.fixInfo, '\n'); - const edit = { changes: {} }; - if (typeof newText === 'string') { - const range = vscode_languageserver_protocol_1.Range.create(lineNumber, 0, lineNumber, line.length); - edit.changes[document.uri] = [vscode_languageserver_protocol_1.TextEdit.replace(range, newText)]; - } - else { - edit.changes[document.uri] = [vscode_languageserver_protocol_1.TextEdit.del(diagnostic.range)]; - } - const title = `Fix: ${diagnostic.message.split(':')[0]}`; - const action = { - title, - edit, - diagnostics: [...context.diagnostics] - }; - fixInfoDiagnostics.push(diagnostic); - codeActions.push(action); - } - } - if (fixInfoDiagnostics.length) { - const title = 'Fix All error found by markdownlint'; - const sourceFixAllAction = { - title, - kind: vscode_languageserver_protocol_1.CodeActionKind.SourceFixAll, - diagnostics: fixInfoDiagnostics, - command: { - title, - command: this.fixAllCommandName - } - }; - codeActions.push(sourceFixAllAction); - } - return codeActions; - } - lint(document) { - this.diagnosticCollection.clear(); - if (document.languageId !== 'markdown') { - return; - } - const results = this.markdownlintWrapper(document); - if (!results.length) { - return; - } - const diagnostics = []; - results.forEach((result) => { - const ruleDescription = result.ruleDescription; - let message = result.ruleNames.join('/') + ': ' + ruleDescription; - if (result.errorDetail) { - message += ' [' + result.errorDetail + ']'; - } - const start = vscode_languageserver_protocol_1.Position.create(result.lineNumber - 1, 0); - const end = vscode_languageserver_protocol_1.Position.create(result.lineNumber - 1, 0); - if (result.errorRange) { - start.character = result.errorRange[0] - 1; - end.character = start.character + result.errorRange[1]; - } - const range = vscode_languageserver_protocol_1.Range.create(start, end); - const diagnostic = vscode_languageserver_protocol_1.Diagnostic.create(range, message); - diagnostic.severity = vscode_languageserver_protocol_1.DiagnosticSeverity.Warning; - diagnostic.source = this.source; - // @ts-ignore - diagnostic.fixInfo = result.fixInfo; - diagnostics.push(diagnostic); - }); - this.diagnosticCollection.set(document.uri, diagnostics); - } - async fixAll(document) { - const results = this.markdownlintWrapper(document); - if (!results.length) { - return; - } - const text = document.getText(); - const fixedText = markdownlint_rule_helpers_1.applyFixes(text, results); - if (text != fixedText) { - const doc = coc_nvim_1.workspace.getDocument(document.uri); - const end = vscode_languageserver_protocol_1.Position.create(doc.lineCount - 1, doc.getline(doc.lineCount - 1).length); - const edit = { - changes: { - [document.uri]: [vscode_languageserver_protocol_1.TextEdit.replace(vscode_languageserver_protocol_1.Range.create(vscode_languageserver_protocol_1.Position.create(0, 0), end), fixedText)] - } - }; - await coc_nvim_1.workspace.applyEdit(edit); - } - } -} -exports.MarkdownlintEngine = MarkdownlintEngine; - - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * @description Recursive object extending - * @author Viacheslav Lotsmanov - * @license MIT - * - * The MIT License (MIT) - * - * Copyright (c) 2013-2018 Viacheslav Lotsmanov - * - * 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. - */ - - - -function isSpecificValue(val) { - return ( - val instanceof Buffer - || val instanceof Date - || val instanceof RegExp - ) ? true : false; -} - -function cloneSpecificValue(val) { - if (val instanceof Buffer) { - var x = Buffer.alloc - ? Buffer.alloc(val.length) - : new Buffer(val.length); - val.copy(x); - return x; - } else if (val instanceof Date) { - return new Date(val.getTime()); - } else if (val instanceof RegExp) { - return new RegExp(val); - } else { - throw new Error('Unexpected situation'); - } -} - -/** - * Recursive cloning array. - */ -function deepCloneArray(arr) { - var clone = []; - arr.forEach(function (item, index) { - if (typeof item === 'object' && item !== null) { - if (Array.isArray(item)) { - clone[index] = deepCloneArray(item); - } else if (isSpecificValue(item)) { - clone[index] = cloneSpecificValue(item); - } else { - clone[index] = deepExtend({}, item); - } - } else { - clone[index] = item; - } - }); - return clone; -} - -function safeGetProperty(object, property) { - return property === '__proto__' ? undefined : object[property]; -} - -/** - * Extening object that entered in first argument. - * - * Returns extended object or false if have no target object or incorrect type. - * - * If you wish to clone source object (without modify it), just use empty new - * object as first argument, like this: - * deepExtend({}, yourObj_1, [yourObj_N]); - */ -var deepExtend = module.exports = function (/*obj_1, [obj_2], [obj_N]*/) { - if (arguments.length < 1 || typeof arguments[0] !== 'object') { - return false; - } - - if (arguments.length < 2) { - return arguments[0]; - } - - var target = arguments[0]; - - // convert arguments to array and cut off target object - var args = Array.prototype.slice.call(arguments, 1); - - var val, src, clone; - - args.forEach(function (obj) { - // skip argument if isn't an object, is null, or is an array - if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) { - return; - } - - Object.keys(obj).forEach(function (key) { - src = safeGetProperty(target, key); // source value - val = safeGetProperty(obj, key); // new value - - // recursion prevention - if (val === target) { - return; - - /** - * if new value isn't object then just overwrite by new value - * instead of extending. - */ - } else if (typeof val !== 'object' || val === null) { - target[key] = val; - return; - - // just clone arrays (and recursive clone objects inside) - } else if (Array.isArray(val)) { - target[key] = deepCloneArray(val); - return; - - // custom cloning and overwrite for specific objects - } else if (isSpecificValue(val)) { - target[key] = cloneSpecificValue(val); - return; - - // overwrite by new value if source isn't object or array - } else if (typeof src !== 'object' || src === null || Array.isArray(src)) { - target[key] = deepExtend({}, val); - return; - - // source value and new value is objects both, extending... - } else { - target[key] = deepExtend(src, val); - return; - } - }); - }); - - return target; -}; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -module.exports = require("fs"); - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - - -var yaml = __webpack_require__(6); - - -module.exports = yaml; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - - -var loader = __webpack_require__(7); -var dumper = __webpack_require__(36); - - -function deprecated(name) { - return function () { - throw new Error('Function ' + name + ' is deprecated and cannot be used.'); - }; -} - - -module.exports.Type = __webpack_require__(13); -module.exports.Schema = __webpack_require__(12); -module.exports.FAILSAFE_SCHEMA = __webpack_require__(16); -module.exports.JSON_SCHEMA = __webpack_require__(15); -module.exports.CORE_SCHEMA = __webpack_require__(14); -module.exports.DEFAULT_SAFE_SCHEMA = __webpack_require__(11); -module.exports.DEFAULT_FULL_SCHEMA = __webpack_require__(31); -module.exports.load = loader.load; -module.exports.loadAll = loader.loadAll; -module.exports.safeLoad = loader.safeLoad; -module.exports.safeLoadAll = loader.safeLoadAll; -module.exports.dump = dumper.dump; -module.exports.safeDump = dumper.safeDump; -module.exports.YAMLException = __webpack_require__(9); - -// Deprecated schema names from JS-YAML 2.0.x -module.exports.MINIMAL_SCHEMA = __webpack_require__(16); -module.exports.SAFE_SCHEMA = __webpack_require__(11); -module.exports.DEFAULT_SCHEMA = __webpack_require__(31); - -// Deprecated functions from JS-YAML 1.x.x -module.exports.scan = deprecated('scan'); -module.exports.parse = deprecated('parse'); -module.exports.compose = deprecated('compose'); -module.exports.addConstructor = deprecated('addConstructor'); - - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/*eslint-disable max-len,no-use-before-define*/ - -var common = __webpack_require__(8); -var YAMLException = __webpack_require__(9); -var Mark = __webpack_require__(10); -var DEFAULT_SAFE_SCHEMA = __webpack_require__(11); -var DEFAULT_FULL_SCHEMA = __webpack_require__(31); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - - -var CONTEXT_FLOW_IN = 1; -var CONTEXT_FLOW_OUT = 2; -var CONTEXT_BLOCK_IN = 3; -var CONTEXT_BLOCK_OUT = 4; - - -var CHOMPING_CLIP = 1; -var CHOMPING_STRIP = 2; -var CHOMPING_KEEP = 3; - - -var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; -var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; -var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; -var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; -var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - - -function _class(obj) { return Object.prototype.toString.call(obj); } - -function is_EOL(c) { - return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); -} - -function is_WHITE_SPACE(c) { - return (c === 0x09/* Tab */) || (c === 0x20/* Space */); -} - -function is_WS_OR_EOL(c) { - return (c === 0x09/* Tab */) || - (c === 0x20/* Space */) || - (c === 0x0A/* LF */) || - (c === 0x0D/* CR */); -} - -function is_FLOW_INDICATOR(c) { - return c === 0x2C/* , */ || - c === 0x5B/* [ */ || - c === 0x5D/* ] */ || - c === 0x7B/* { */ || - c === 0x7D/* } */; -} - -function fromHexCode(c) { - var lc; - - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - /*eslint-disable no-bitwise*/ - lc = c | 0x20; - - if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { - return lc - 0x61 + 10; - } - - return -1; -} - -function escapedHexLen(c) { - if (c === 0x78/* x */) { return 2; } - if (c === 0x75/* u */) { return 4; } - if (c === 0x55/* U */) { return 8; } - return 0; -} - -function fromDecimalCode(c) { - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - return -1; -} - -function simpleEscapeSequence(c) { - /* eslint-disable indent */ - return (c === 0x30/* 0 */) ? '\x00' : - (c === 0x61/* a */) ? '\x07' : - (c === 0x62/* b */) ? '\x08' : - (c === 0x74/* t */) ? '\x09' : - (c === 0x09/* Tab */) ? '\x09' : - (c === 0x6E/* n */) ? '\x0A' : - (c === 0x76/* v */) ? '\x0B' : - (c === 0x66/* f */) ? '\x0C' : - (c === 0x72/* r */) ? '\x0D' : - (c === 0x65/* e */) ? '\x1B' : - (c === 0x20/* Space */) ? ' ' : - (c === 0x22/* " */) ? '\x22' : - (c === 0x2F/* / */) ? '/' : - (c === 0x5C/* \ */) ? '\x5C' : - (c === 0x4E/* N */) ? '\x85' : - (c === 0x5F/* _ */) ? '\xA0' : - (c === 0x4C/* L */) ? '\u2028' : - (c === 0x50/* P */) ? '\u2029' : ''; -} - -function charFromCodepoint(c) { - if (c <= 0xFFFF) { - return String.fromCharCode(c); - } - // Encode UTF-16 surrogate pair - // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF - return String.fromCharCode( - ((c - 0x010000) >> 10) + 0xD800, - ((c - 0x010000) & 0x03FF) + 0xDC00 - ); -} - -var simpleEscapeCheck = new Array(256); // integer, for fast access -var simpleEscapeMap = new Array(256); -for (var i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); -} - - -function State(input, options) { - this.input = input; - - this.filename = options['filename'] || null; - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.onWarning = options['onWarning'] || null; - this.legacy = options['legacy'] || false; - this.json = options['json'] || false; - this.listener = options['listener'] || null; - - this.implicitTypes = this.schema.compiledImplicit; - this.typeMap = this.schema.compiledTypeMap; - - this.length = input.length; - this.position = 0; - this.line = 0; - this.lineStart = 0; - this.lineIndent = 0; - - this.documents = []; - - /* - this.version; - this.checkLineBreaks; - this.tagMap; - this.anchorMap; - this.tag; - this.anchor; - this.kind; - this.result;*/ - -} - - -function generateError(state, message) { - return new YAMLException( - message, - new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); -} - -function throwError(state, message) { - throw generateError(state, message); -} - -function throwWarning(state, message) { - if (state.onWarning) { - state.onWarning.call(null, generateError(state, message)); - } -} - - -var directiveHandlers = { - - YAML: function handleYamlDirective(state, name, args) { - - var match, major, minor; - - if (state.version !== null) { - throwError(state, 'duplication of %YAML directive'); - } - - if (args.length !== 1) { - throwError(state, 'YAML directive accepts exactly one argument'); - } - - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - - if (match === null) { - throwError(state, 'ill-formed argument of the YAML directive'); - } - - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); - - if (major !== 1) { - throwError(state, 'unacceptable YAML version of the document'); - } - - state.version = args[0]; - state.checkLineBreaks = (minor < 2); - - if (minor !== 1 && minor !== 2) { - throwWarning(state, 'unsupported YAML version of the document'); - } - }, - - TAG: function handleTagDirective(state, name, args) { - - var handle, prefix; - - if (args.length !== 2) { - throwError(state, 'TAG directive accepts exactly two arguments'); - } - - handle = args[0]; - prefix = args[1]; - - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); - } - - if (_hasOwnProperty.call(state.tagMap, handle)) { - throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); - } - - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); - } - - state.tagMap[handle] = prefix; - } -}; - - -function captureSegment(state, start, end, checkJson) { - var _position, _length, _character, _result; - - if (start < end) { - _result = state.input.slice(start, end); - - if (checkJson) { - for (_position = 0, _length = _result.length; _position < _length; _position += 1) { - _character = _result.charCodeAt(_position); - if (!(_character === 0x09 || - (0x20 <= _character && _character <= 0x10FFFF))) { - throwError(state, 'expected valid JSON character'); - } - } - } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state, 'the stream contains non-printable characters'); - } - - state.result += _result; - } -} - -function mergeMappings(state, destination, source, overridableKeys) { - var sourceKeys, key, index, quantity; - - if (!common.isObject(source)) { - throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); - } - - sourceKeys = Object.keys(source); - - for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { - key = sourceKeys[index]; - - if (!_hasOwnProperty.call(destination, key)) { - destination[key] = source[key]; - overridableKeys[key] = true; - } - } -} - -function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { - var index, quantity; - - // The output is a plain object here, so keys can only be strings. - // We need to convert keyNode to a string, but doing so can hang the process - // (deeply nested arrays that explode exponentially using aliases). - if (Array.isArray(keyNode)) { - keyNode = Array.prototype.slice.call(keyNode); - - for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { - if (Array.isArray(keyNode[index])) { - throwError(state, 'nested arrays are not supported inside keys'); - } - - if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { - keyNode[index] = '[object Object]'; - } - } - } - - // Avoid code execution in load() via toString property - // (still use its own toString for arrays, timestamps, - // and whatever user schema extensions happen to have @@toStringTag) - if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { - keyNode = '[object Object]'; - } - - - keyNode = String(keyNode); - - if (_result === null) { - _result = {}; - } - - if (keyTag === 'tag:yaml.org,2002:merge') { - if (Array.isArray(valueNode)) { - for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state, _result, valueNode[index], overridableKeys); - } - } else { - mergeMappings(state, _result, valueNode, overridableKeys); - } - } else { - if (!state.json && - !_hasOwnProperty.call(overridableKeys, keyNode) && - _hasOwnProperty.call(_result, keyNode)) { - state.line = startLine || state.line; - state.position = startPos || state.position; - throwError(state, 'duplicated mapping key'); - } - _result[keyNode] = valueNode; - delete overridableKeys[keyNode]; - } - - return _result; -} - -function readLineBreak(state) { - var ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x0A/* LF */) { - state.position++; - } else if (ch === 0x0D/* CR */) { - state.position++; - if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { - state.position++; - } - } else { - throwError(state, 'a line break is expected'); - } - - state.line += 1; - state.lineStart = state.position; -} - -function skipSeparationSpace(state, allowComments, checkIndent) { - var lineBreaks = 0, - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (allowComments && ch === 0x23/* # */) { - do { - ch = state.input.charCodeAt(++state.position); - } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); - } - - if (is_EOL(ch)) { - readLineBreak(state); - - ch = state.input.charCodeAt(state.position); - lineBreaks++; - state.lineIndent = 0; - - while (ch === 0x20/* Space */) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - } else { - break; - } - } - - if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { - throwWarning(state, 'deficient indentation'); - } - - return lineBreaks; -} - -function testDocumentSeparator(state) { - var _position = state.position, - ch; - - ch = state.input.charCodeAt(_position); - - // Condition state.position === state.lineStart is tested - // in parent on each call, for efficiency. No needs to test here again. - if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && - ch === state.input.charCodeAt(_position + 1) && - ch === state.input.charCodeAt(_position + 2)) { - - _position += 3; - - ch = state.input.charCodeAt(_position); - - if (ch === 0 || is_WS_OR_EOL(ch)) { - return true; - } - } - - return false; -} - -function writeFoldedLines(state, count) { - if (count === 1) { - state.result += ' '; - } else if (count > 1) { - state.result += common.repeat('\n', count - 1); - } -} - - -function readPlainScalar(state, nodeIndent, withinFlowCollection) { - var preceding, - following, - captureStart, - captureEnd, - hasPendingContent, - _line, - _lineStart, - _lineIndent, - _kind = state.kind, - _result = state.result, - ch; - - ch = state.input.charCodeAt(state.position); - - if (is_WS_OR_EOL(ch) || - is_FLOW_INDICATOR(ch) || - ch === 0x23/* # */ || - ch === 0x26/* & */ || - ch === 0x2A/* * */ || - ch === 0x21/* ! */ || - ch === 0x7C/* | */ || - ch === 0x3E/* > */ || - ch === 0x27/* ' */ || - ch === 0x22/* " */ || - ch === 0x25/* % */ || - ch === 0x40/* @ */ || - ch === 0x60/* ` */) { - return false; - } - - if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - return false; - } - } - - state.kind = 'scalar'; - state.result = ''; - captureStart = captureEnd = state.position; - hasPendingContent = false; - - while (ch !== 0) { - if (ch === 0x3A/* : */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - break; - } - - } else if (ch === 0x23/* # */) { - preceding = state.input.charCodeAt(state.position - 1); - - if (is_WS_OR_EOL(preceding)) { - break; - } - - } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || - withinFlowCollection && is_FLOW_INDICATOR(ch)) { - break; - - } else if (is_EOL(ch)) { - _line = state.line; - _lineStart = state.lineStart; - _lineIndent = state.lineIndent; - skipSeparationSpace(state, false, -1); - - if (state.lineIndent >= nodeIndent) { - hasPendingContent = true; - ch = state.input.charCodeAt(state.position); - continue; - } else { - state.position = captureEnd; - state.line = _line; - state.lineStart = _lineStart; - state.lineIndent = _lineIndent; - break; - } - } - - if (hasPendingContent) { - captureSegment(state, captureStart, captureEnd, false); - writeFoldedLines(state, state.line - _line); - captureStart = captureEnd = state.position; - hasPendingContent = false; - } - - if (!is_WHITE_SPACE(ch)) { - captureEnd = state.position + 1; - } - - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, captureEnd, false); - - if (state.result) { - return true; - } - - state.kind = _kind; - state.result = _result; - return false; -} - -function readSingleQuotedScalar(state, nodeIndent) { - var ch, - captureStart, captureEnd; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x27/* ' */) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x27/* ' */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x27/* ' */) { - captureStart = state.position; - state.position++; - captureEnd = state.position; - } else { - return true; - } - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a single quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a single quoted scalar'); -} - -function readDoubleQuotedScalar(state, nodeIndent) { - var captureStart, - captureEnd, - hexLength, - hexResult, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x22/* " */) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - if (ch === 0x22/* " */) { - captureSegment(state, captureStart, state.position, true); - state.position++; - return true; - - } else if (ch === 0x5C/* \ */) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (is_EOL(ch)) { - skipSeparationSpace(state, false, nodeIndent); - - // TODO: rework to inline fn with no type cast? - } else if (ch < 256 && simpleEscapeCheck[ch]) { - state.result += simpleEscapeMap[ch]; - state.position++; - - } else if ((tmp = escapedHexLen(ch)) > 0) { - hexLength = tmp; - hexResult = 0; - - for (; hexLength > 0; hexLength--) { - ch = state.input.charCodeAt(++state.position); - - if ((tmp = fromHexCode(ch)) >= 0) { - hexResult = (hexResult << 4) + tmp; - - } else { - throwError(state, 'expected hexadecimal character'); - } - } - - state.result += charFromCodepoint(hexResult); - - state.position++; - - } else { - throwError(state, 'unknown escape sequence'); - } - - captureStart = captureEnd = state.position; - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a double quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a double quoted scalar'); -} - -function readFlowCollection(state, nodeIndent) { - var readNext = true, - _line, - _tag = state.tag, - _result, - _anchor = state.anchor, - following, - terminator, - isPair, - isExplicitPair, - isMapping, - overridableKeys = {}, - keyNode, - keyTag, - valueNode, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x5B/* [ */) { - terminator = 0x5D;/* ] */ - isMapping = false; - _result = []; - } else if (ch === 0x7B/* { */) { - terminator = 0x7D;/* } */ - isMapping = true; - _result = {}; - } else { - return false; - } - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(++state.position); - - while (ch !== 0) { - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === terminator) { - state.position++; - state.tag = _tag; - state.anchor = _anchor; - state.kind = isMapping ? 'mapping' : 'sequence'; - state.result = _result; - return true; - } else if (!readNext) { - throwError(state, 'missed comma between flow collection entries'); - } - - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; - - if (ch === 0x3F/* ? */) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following)) { - isPair = isExplicitPair = true; - state.position++; - skipSeparationSpace(state, true, nodeIndent); - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state.tag; - keyNode = state.result; - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { - isPair = true; - ch = state.input.charCodeAt(++state.position); - skipSeparationSpace(state, true, nodeIndent); - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state.result; - } - - if (isMapping) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); - } else if (isPair) { - _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); - } else { - _result.push(keyNode); - } - - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x2C/* , */) { - readNext = true; - ch = state.input.charCodeAt(++state.position); - } else { - readNext = false; - } - } - - throwError(state, 'unexpected end of the stream within a flow collection'); -} - -function readBlockScalar(state, nodeIndent) { - var captureStart, - folding, - chomping = CHOMPING_CLIP, - didReadContent = false, - detectedIndent = false, - textIndent = nodeIndent, - emptyLines = 0, - atMoreIndented = false, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x7C/* | */) { - folding = false; - } else if (ch === 0x3E/* > */) { - folding = true; - } else { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - - while (ch !== 0) { - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { - if (CHOMPING_CLIP === chomping) { - chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; - } else { - throwError(state, 'repeat of a chomping mode identifier'); - } - - } else if ((tmp = fromDecimalCode(ch)) >= 0) { - if (tmp === 0) { - throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); - } else if (!detectedIndent) { - textIndent = nodeIndent + tmp - 1; - detectedIndent = true; - } else { - throwError(state, 'repeat of an indentation width identifier'); - } - - } else { - break; - } - } - - if (is_WHITE_SPACE(ch)) { - do { ch = state.input.charCodeAt(++state.position); } - while (is_WHITE_SPACE(ch)); - - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (!is_EOL(ch) && (ch !== 0)); - } - } - - while (ch !== 0) { - readLineBreak(state); - state.lineIndent = 0; - - ch = state.input.charCodeAt(state.position); - - while ((!detectedIndent || state.lineIndent < textIndent) && - (ch === 0x20/* Space */)) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - - if (!detectedIndent && state.lineIndent > textIndent) { - textIndent = state.lineIndent; - } - - if (is_EOL(ch)) { - emptyLines++; - continue; - } - - // End of the scalar. - if (state.lineIndent < textIndent) { - - // Perform the chomping. - if (chomping === CHOMPING_KEEP) { - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } else if (chomping === CHOMPING_CLIP) { - if (didReadContent) { // i.e. only if the scalar is not empty. - state.result += '\n'; - } - } - - // Break this `while` cycle and go to the funciton's epilogue. - break; - } - - // Folded style: use fancy rules to handle line breaks. - if (folding) { - - // Lines starting with white space characters (more-indented lines) are not folded. - if (is_WHITE_SPACE(ch)) { - atMoreIndented = true; - // except for the first content line (cf. Example 8.1) - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - - // End of more-indented block. - } else if (atMoreIndented) { - atMoreIndented = false; - state.result += common.repeat('\n', emptyLines + 1); - - // Just one line break - perceive as the same line. - } else if (emptyLines === 0) { - if (didReadContent) { // i.e. only if we have already read some scalar content. - state.result += ' '; - } - - // Several line breaks - perceive as different lines. - } else { - state.result += common.repeat('\n', emptyLines); - } - - // Literal style: just add exact number of line breaks between content lines. - } else { - // Keep all line breaks except the header line break. - state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); - } - - didReadContent = true; - detectedIndent = true; - emptyLines = 0; - captureStart = state.position; - - while (!is_EOL(ch) && (ch !== 0)) { - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, state.position, false); - } - - return true; -} - -function readBlockSequence(state, nodeIndent) { - var _line, - _tag = state.tag, - _anchor = state.anchor, - _result = [], - following, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - - if (ch !== 0x2D/* - */) { - break; - } - - following = state.input.charCodeAt(state.position + 1); - - if (!is_WS_OR_EOL(following)) { - break; - } - - detected = true; - state.position++; - - if (skipSeparationSpace(state, true, -1)) { - if (state.lineIndent <= nodeIndent) { - _result.push(null); - ch = state.input.charCodeAt(state.position); - continue; - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state.result); - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { - throwError(state, 'bad indentation of a sequence entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'sequence'; - state.result = _result; - return true; - } - return false; -} - -function readBlockMapping(state, nodeIndent, flowIndent) { - var following, - allowCompact, - _line, - _pos, - _tag = state.tag, - _anchor = state.anchor, - _result = {}, - overridableKeys = {}, - keyTag = null, - keyNode = null, - valueNode = null, - atExplicitKey = false, - detected = false, - ch; - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (ch !== 0) { - following = state.input.charCodeAt(state.position + 1); - _line = state.line; // Save the current line. - _pos = state.position; - - // - // Explicit notation case. There are two separate blocks: - // first for the key (denoted by "?") and second for the value (denoted by ":") - // - if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { - - if (ch === 0x3F/* ? */) { - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = true; - allowCompact = true; - - } else if (atExplicitKey) { - // i.e. 0x3A/* : */ === character after the explicit key. - atExplicitKey = false; - allowCompact = true; - - } else { - throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); - } - - state.position += 1; - ch = following; - - // - // Implicit notation case. Flow-style node as the key first, then ":", and the value. - // - } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { - - if (state.line === _line) { - ch = state.input.charCodeAt(state.position); - - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (ch === 0x3A/* : */) { - ch = state.input.charCodeAt(++state.position); - - if (!is_WS_OR_EOL(ch)) { - throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); - } - - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = false; - allowCompact = false; - keyTag = state.tag; - keyNode = state.result; - - } else if (detected) { - throwError(state, 'can not read an implicit mapping pair; a colon is missed'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else if (detected) { - throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else { - break; // Reading is done. Go to the epilogue. - } - - // - // Common reading code for both explicit and implicit notations. - // - if (state.line === _line || state.lineIndent > nodeIndent) { - if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { - if (atExplicitKey) { - keyNode = state.result; - } else { - valueNode = state.result; - } - } - - if (!atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); - keyTag = keyNode = valueNode = null; - } - - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - } - - if (state.lineIndent > nodeIndent && (ch !== 0)) { - throwError(state, 'bad indentation of a mapping entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - // - // Epilogue. - // - - // Special case: last mapping's node contains only the key in explicit notation. - if (atExplicitKey) { - storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); - } - - // Expose the resulting mapping. - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'mapping'; - state.result = _result; - } - - return detected; -} - -function readTagProperty(state) { - var _position, - isVerbatim = false, - isNamed = false, - tagHandle, - tagName, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x21/* ! */) return false; - - if (state.tag !== null) { - throwError(state, 'duplication of a tag property'); - } - - ch = state.input.charCodeAt(++state.position); - - if (ch === 0x3C/* < */) { - isVerbatim = true; - ch = state.input.charCodeAt(++state.position); - - } else if (ch === 0x21/* ! */) { - isNamed = true; - tagHandle = '!!'; - ch = state.input.charCodeAt(++state.position); - - } else { - tagHandle = '!'; - } - - _position = state.position; - - if (isVerbatim) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && ch !== 0x3E/* > */); - - if (state.position < state.length) { - tagName = state.input.slice(_position, state.position); - ch = state.input.charCodeAt(++state.position); - } else { - throwError(state, 'unexpected end of the stream within a verbatim tag'); - } - } else { - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - - if (ch === 0x21/* ! */) { - if (!isNamed) { - tagHandle = state.input.slice(_position - 1, state.position + 1); - - if (!PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError(state, 'named tag handle cannot contain such characters'); - } - - isNamed = true; - _position = state.position + 1; - } else { - throwError(state, 'tag suffix cannot contain exclamation marks'); - } - } - - ch = state.input.charCodeAt(++state.position); - } - - tagName = state.input.slice(_position, state.position); - - if (PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError(state, 'tag suffix cannot contain flow indicator characters'); - } - } - - if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state, 'tag name cannot contain such characters: ' + tagName); - } - - if (isVerbatim) { - state.tag = tagName; - - } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { - state.tag = state.tagMap[tagHandle] + tagName; - - } else if (tagHandle === '!') { - state.tag = '!' + tagName; - - } else if (tagHandle === '!!') { - state.tag = 'tag:yaml.org,2002:' + tagName; - - } else { - throwError(state, 'undeclared tag handle "' + tagHandle + '"'); - } - - return true; -} - -function readAnchorProperty(state) { - var _position, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x26/* & */) return false; - - if (state.anchor !== null) { - throwError(state, 'duplication of an anchor property'); - } - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an anchor node must contain at least one character'); - } - - state.anchor = state.input.slice(_position, state.position); - return true; -} - -function readAlias(state) { - var _position, alias, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch !== 0x2A/* * */) return false; - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an alias node must contain at least one character'); - } - - alias = state.input.slice(_position, state.position); - - if (!state.anchorMap.hasOwnProperty(alias)) { - throwError(state, 'unidentified alias "' + alias + '"'); - } - - state.result = state.anchorMap[alias]; - skipSeparationSpace(state, true, -1); - return true; -} - -function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { - var allowBlockStyles, - allowBlockScalars, - allowBlockCollections, - indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } - } - - if (indentStatus === 1) { - while (readTagProperty(state) || readAnchorProperty(state)) { - if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; - allowBlockCollections = allowBlockStyles; - - if (state.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } else { - allowBlockCollections = false; - } - } - } - - if (allowBlockCollections) { - allowBlockCollections = atNewLine || allowCompact; - } - - if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { - if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { - flowIndent = parentIndent; - } else { - flowIndent = parentIndent + 1; - } - - blockIndent = state.position - state.lineStart; - - if (indentStatus === 1) { - if (allowBlockCollections && - (readBlockSequence(state, blockIndent) || - readBlockMapping(state, blockIndent, flowIndent)) || - readFlowCollection(state, flowIndent)) { - hasContent = true; - } else { - if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || - readSingleQuotedScalar(state, flowIndent) || - readDoubleQuotedScalar(state, flowIndent)) { - hasContent = true; - - } else if (readAlias(state)) { - hasContent = true; - - if (state.tag !== null || state.anchor !== null) { - throwError(state, 'alias node should not have any properties'); - } - - } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; - - if (state.tag === null) { - state.tag = '?'; - } - } - - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else if (indentStatus === 0) { - // Special case: block sequences are allowed to have same indentation level as the parent. - // http://www.yaml.org/spec/1.2/spec.html#id2799784 - hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); - } - } - - if (state.tag !== null && state.tag !== '!') { - if (state.tag === '?') { - // Implicit resolving is not allowed for non-scalar types, and '?' - // non-specific tag is only automatically assigned to plain scalars. - // - // We only need to check kind conformity in case user explicitly assigns '?' - // tag, for example like this: "! [0]" - // - if (state.result !== null && state.kind !== 'scalar') { - throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); - } - - for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { - type = state.implicitTypes[typeIndex]; - - if (type.resolve(state.result)) { // `state.result` updated in resolver if matched - state.result = type.construct(state.result); - state.tag = type.tag; - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - break; - } - } - } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { - type = state.typeMap[state.kind || 'fallback'][state.tag]; - - if (state.result !== null && type.kind !== state.kind) { - throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); - } - - if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched - throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); - } else { - state.result = type.construct(state.result); - if (state.anchor !== null) { - state.anchorMap[state.anchor] = state.result; - } - } - } else { - throwError(state, 'unknown tag !<' + state.tag + '>'); - } - } - - if (state.listener !== null) { - state.listener('close', state); - } - return state.tag !== null || state.anchor !== null || hasContent; -} - -function readDocument(state) { - var documentStart = state.position, - _position, - directiveName, - directiveArgs, - hasDirectives = false, - ch; - - state.version = null; - state.checkLineBreaks = state.legacy; - state.tagMap = {}; - state.anchorMap = {}; - - while ((ch = state.input.charCodeAt(state.position)) !== 0) { - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if (state.lineIndent > 0 || ch !== 0x25/* % */) { - break; - } - - hasDirectives = true; - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveName = state.input.slice(_position, state.position); - directiveArgs = []; - - if (directiveName.length < 1) { - throwError(state, 'directive name must not be less than one character in length'); - } - - while (ch !== 0) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (ch === 0x23/* # */) { - do { ch = state.input.charCodeAt(++state.position); } - while (ch !== 0 && !is_EOL(ch)); - break; - } - - if (is_EOL(ch)) break; - - _position = state.position; - - while (ch !== 0 && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveArgs.push(state.input.slice(_position, state.position)); - } - - if (ch !== 0) readLineBreak(state); - - if (_hasOwnProperty.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](state, directiveName, directiveArgs); - } else { - throwWarning(state, 'unknown document directive "' + directiveName + '"'); - } - } - - skipSeparationSpace(state, true, -1); - - if (state.lineIndent === 0 && - state.input.charCodeAt(state.position) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && - state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - - } else if (hasDirectives) { - throwError(state, 'directives end mark is expected'); - } - - composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(state, true, -1); - - if (state.checkLineBreaks && - PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { - throwWarning(state, 'non-ASCII line breaks are interpreted as content'); - } - - state.documents.push(state.result); - - if (state.position === state.lineStart && testDocumentSeparator(state)) { - - if (state.input.charCodeAt(state.position) === 0x2E/* . */) { - state.position += 3; - skipSeparationSpace(state, true, -1); - } - return; - } - - if (state.position < (state.length - 1)) { - throwError(state, 'end of the stream or a document separator is expected'); - } else { - return; - } -} - - -function loadDocuments(input, options) { - input = String(input); - options = options || {}; - - if (input.length !== 0) { - - // Add tailing `\n` if not exists - if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && - input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { - input += '\n'; - } - - // Strip BOM - if (input.charCodeAt(0) === 0xFEFF) { - input = input.slice(1); - } - } - - var state = new State(input, options); - - var nullpos = input.indexOf('\0'); - - if (nullpos !== -1) { - state.position = nullpos; - throwError(state, 'null byte is not allowed in input'); - } - - // Use 0 as string terminator. That significantly simplifies bounds check. - state.input += '\0'; - - while (state.input.charCodeAt(state.position) === 0x20/* Space */) { - state.lineIndent += 1; - state.position += 1; - } - - while (state.position < (state.length - 1)) { - readDocument(state); - } - - return state.documents; -} - - -function loadAll(input, iterator, options) { - if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { - options = iterator; - iterator = null; - } - - var documents = loadDocuments(input, options); - - if (typeof iterator !== 'function') { - return documents; - } - - for (var index = 0, length = documents.length; index < length; index += 1) { - iterator(documents[index]); - } -} - - -function load(input, options) { - var documents = loadDocuments(input, options); - - if (documents.length === 0) { - /*eslint-disable no-undefined*/ - return undefined; - } else if (documents.length === 1) { - return documents[0]; - } - throw new YAMLException('expected a single document in the stream, but found more'); -} - - -function safeLoadAll(input, iterator, options) { - if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { - options = iterator; - iterator = null; - } - - return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -function safeLoad(input, options) { - return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -module.exports.loadAll = loadAll; -module.exports.load = load; -module.exports.safeLoadAll = safeLoadAll; -module.exports.safeLoad = safeLoad; - - -/***/ }), -/* 8 */ -/***/ (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; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// YAML error class. http://stackoverflow.com/questions/8458984 -// - - -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 || ''; - } -} - - -// Inherit from Error -YAMLException.prototype = Object.create(Error.prototype); -YAMLException.prototype.constructor = YAMLException; - - -YAMLException.prototype.toString = function toString(compact) { - var result = this.name + ': '; - - result += this.reason || '(unknown reason)'; - - if (!compact && this.mark) { - result += ' ' + this.mark.toString(); - } - - return result; -}; - - -module.exports = YAMLException; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - - -var common = __webpack_require__(8); - - -function Mark(name, buffer, position, line, column) { - this.name = name; - this.buffer = buffer; - this.position = position; - this.line = line; - this.column = column; -} - - -Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { - var head, start, tail, end, snippet; - - if (!this.buffer) return null; - - indent = indent || 4; - maxLength = maxLength || 75; - - head = ''; - start = this.position; - - while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { - start -= 1; - if (this.position - start > (maxLength / 2 - 1)) { - head = ' ... '; - start += 5; - break; - } - } - - tail = ''; - end = this.position; - - while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { - end += 1; - if (end - this.position > (maxLength / 2 - 1)) { - tail = ' ... '; - end -= 5; - break; - } - } - - snippet = this.buffer.slice(start, end); - - return common.repeat(' ', indent) + head + snippet + tail + '\n' + - common.repeat(' ', indent + this.position - start + head.length) + '^'; -}; - - -Mark.prototype.toString = function toString(compact) { - var snippet, where = ''; - - if (this.name) { - where += 'in "' + this.name + '" '; - } - - where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); - - if (!compact) { - snippet = this.getSnippet(); - - if (snippet) { - where += ':\n' + snippet; - } - } - - return where; -}; - - -module.exports = Mark; - - -/***/ }), -/* 11 */ -/***/ (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__(12); - - -module.exports = new Schema({ - include: [ - __webpack_require__(14) - ], - implicit: [ - __webpack_require__(24), - __webpack_require__(25) - ], - explicit: [ - __webpack_require__(26), - __webpack_require__(28), - __webpack_require__(29), - __webpack_require__(30) - ] -}); - - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/*eslint-disable max-len*/ - -var common = __webpack_require__(8); -var YAMLException = __webpack_require__(9); -var Type = __webpack_require__(13); - - -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; - - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var YAMLException = __webpack_require__(9); - -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.'); - } - }); - - // 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.'); - } -} - -module.exports = Type; - - -/***/ }), -/* 14 */ -/***/ (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__(12); - - -module.exports = new Schema({ - include: [ - __webpack_require__(15) - ] -}); - - -/***/ }), -/* 15 */ -/***/ (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__(12); - - -module.exports = new Schema({ - include: [ - __webpack_require__(16) - ], - implicit: [ - __webpack_require__(20), - __webpack_require__(21), - __webpack_require__(22), - __webpack_require__(23) - ] -}); - - -/***/ }), -/* 16 */ -/***/ (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__(12); - - -module.exports = new Schema({ - explicit: [ - __webpack_require__(17), - __webpack_require__(18), - __webpack_require__(19) - ] -}); - - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Type = __webpack_require__(13); - -module.exports = new Type('tag:yaml.org,2002:str', { - kind: 'scalar', - construct: function (data) { return data !== null ? data : ''; } -}); - - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Type = __webpack_require__(13); - -module.exports = new Type('tag:yaml.org,2002:seq', { - kind: 'sequence', - construct: function (data) { return data !== null ? data : []; } -}); - - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Type = __webpack_require__(13); - -module.exports = new Type('tag:yaml.org,2002:map', { - kind: 'mapping', - construct: function (data) { return data !== null ? data : {}; } -}); - - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Type = __webpack_require__(13); - -function resolveYamlNull(data) { - if (data === null) return true; - - var max = data.length; - - return (max === 1 && data === '~') || - (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); -} - -function constructYamlNull() { - return null; -} - -function isNull(object) { - return object === null; -} - -module.exports = new Type('tag:yaml.org,2002:null', { - kind: 'scalar', - resolve: resolveYamlNull, - construct: constructYamlNull, - predicate: isNull, - represent: { - canonical: function () { return '~'; }, - lowercase: function () { return 'null'; }, - uppercase: function () { return 'NULL'; }, - camelcase: function () { return 'Null'; } - }, - defaultStyle: 'lowercase' -}); - - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Type = __webpack_require__(13); - -function resolveYamlBoolean(data) { - if (data === null) return false; - - var max = data.length; - - return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || - (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); -} - -function constructYamlBoolean(data) { - return data === 'true' || - data === 'True' || - data === 'TRUE'; -} - -function isBoolean(object) { - return Object.prototype.toString.call(object) === '[object Boolean]'; -} - -module.exports = new Type('tag:yaml.org,2002:bool', { - kind: 'scalar', - resolve: resolveYamlBoolean, - construct: constructYamlBoolean, - predicate: isBoolean, - represent: { - lowercase: function (object) { return object ? 'true' : 'false'; }, - uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, - camelcase: function (object) { return object ? 'True' : 'False'; } - }, - defaultStyle: 'lowercase' -}); - - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var common = __webpack_require__(8); -var Type = __webpack_require__(13); - -function isHexCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || - ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || - ((0x61/* a */ <= c) && (c <= 0x66/* f */)); -} - -function isOctCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); -} - -function isDecCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); -} - -function resolveYamlInteger(data) { - if (data === null) return false; - - var max = data.length, - index = 0, - hasDigits = false, - ch; - - if (!max) return false; - - ch = data[index]; - - // sign - if (ch === '-' || ch === '+') { - ch = data[++index]; - } - - if (ch === '0') { - // 0 - if (index + 1 === max) return true; - ch = data[++index]; - - // base 2, base 8, base 16 - - if (ch === 'b') { - // base 2 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch !== '0' && ch !== '1') return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - - if (ch === 'x') { - // base 16 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isHexCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - // base 8 - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (!isOctCode(data.charCodeAt(index))) return false; - hasDigits = true; - } - return hasDigits && ch !== '_'; - } - - // base 10 (except 0) or base 60 - - // value should not start with `_`; - if (ch === '_') return false; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') continue; - if (ch === ':') break; - if (!isDecCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } - - // Should have digits and should not end with `_` - if (!hasDigits || ch === '_') return false; - - // if !base60 - done; - if (ch !== ':') return true; - - // base60 almost not used, no needs to optimize - return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); -} - -function constructYamlInteger(data) { - var value = data, sign = 1, ch, base, digits = []; - - if (value.indexOf('_') !== -1) { - value = value.replace(/_/g, ''); - } - - ch = value[0]; - - if (ch === '-' || ch === '+') { - if (ch === '-') sign = -1; - value = value.slice(1); - ch = value[0]; - } - - if (value === '0') return 0; - - if (ch === '0') { - if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); - if (value[1] === 'x') return sign * parseInt(value, 16); - return sign * parseInt(value, 8); - } - - if (value.indexOf(':') !== -1) { - value.split(':').forEach(function (v) { - digits.unshift(parseInt(v, 10)); - }); - - value = 0; - base = 1; - - digits.forEach(function (d) { - value += (d * base); - base *= 60; - }); - - return sign * value; - - } - - return sign * parseInt(value, 10); -} - -function isInteger(object) { - return (Object.prototype.toString.call(object)) === '[object Number]' && - (object % 1 === 0 && !common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:int', { - kind: 'scalar', - resolve: resolveYamlInteger, - construct: constructYamlInteger, - predicate: isInteger, - represent: { - binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, - octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, - decimal: function (obj) { return obj.toString(10); }, - /* eslint-disable max-len */ - hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } - }, - defaultStyle: 'decimal', - styleAliases: { - binary: [ 2, 'bin' ], - octal: [ 8, 'oct' ], - decimal: [ 10, 'dec' ], - hexadecimal: [ 16, 'hex' ] - } -}); - - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var common = __webpack_require__(8); -var Type = __webpack_require__(13); - -var YAML_FLOAT_PATTERN = new RegExp( - // 2.5e4, 2.5 and integers - '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + - // .2e4, .2 - // special case, seems not from spec - '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + - // 20:59 - '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + - // .inf - '|[-+]?\\.(?:inf|Inf|INF)' + - // .nan - '|\\.(?:nan|NaN|NAN))$'); - -function resolveYamlFloat(data) { - if (data === null) return false; - - if (!YAML_FLOAT_PATTERN.test(data) || - // Quick hack to not allow integers end with `_` - // Probably should update regexp & check speed - data[data.length - 1] === '_') { - return false; - } - - return true; -} - -function constructYamlFloat(data) { - var value, sign, base, digits; - - value = data.replace(/_/g, '').toLowerCase(); - sign = value[0] === '-' ? -1 : 1; - digits = []; - - if ('+-'.indexOf(value[0]) >= 0) { - value = value.slice(1); - } - - if (value === '.inf') { - return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - - } else if (value === '.nan') { - return NaN; - - } else if (value.indexOf(':') >= 0) { - value.split(':').forEach(function (v) { - digits.unshift(parseFloat(v, 10)); - }); - - value = 0.0; - base = 1; - - digits.forEach(function (d) { - value += d * base; - base *= 60; - }); - - return sign * value; - - } - return sign * parseFloat(value, 10); -} - - -var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; - -function representYamlFloat(object, style) { - var res; - - if (isNaN(object)) { - switch (style) { - case 'lowercase': return '.nan'; - case 'uppercase': return '.NAN'; - case 'camelcase': return '.NaN'; - } - } else if (Number.POSITIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '.inf'; - case 'uppercase': return '.INF'; - case 'camelcase': return '.Inf'; - } - } else if (Number.NEGATIVE_INFINITY === object) { - switch (style) { - case 'lowercase': return '-.inf'; - case 'uppercase': return '-.INF'; - case 'camelcase': return '-.Inf'; - } - } else if (common.isNegativeZero(object)) { - return '-0.0'; - } - - res = object.toString(10); - - // JS stringifier can build scientific format without dots: 5e-100, - // while YAML requres dot: 5.e-100. Fix it with simple hack - - return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; -} - -function isFloat(object) { - return (Object.prototype.toString.call(object) === '[object Number]') && - (object % 1 !== 0 || common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:float', { - kind: 'scalar', - resolve: resolveYamlFloat, - construct: constructYamlFloat, - predicate: isFloat, - represent: representYamlFloat, - defaultStyle: 'lowercase' -}); - - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Type = __webpack_require__(13); - -var YAML_DATE_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9])' + // [2] month - '-([0-9][0-9])$'); // [3] day - -var YAML_TIMESTAMP_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9]?)' + // [2] month - '-([0-9][0-9]?)' + // [3] day - '(?:[Tt]|[ \\t]+)' + // ... - '([0-9][0-9]?)' + // [4] hour - ':([0-9][0-9])' + // [5] minute - ':([0-9][0-9])' + // [6] second - '(?:\\.([0-9]*))?' + // [7] fraction - '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?$'); // [11] tz_minute - -function resolveYamlTimestamp(data) { - if (data === null) return false; - if (YAML_DATE_REGEXP.exec(data) !== null) return true; - if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; - return false; -} - -function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; - - match = YAML_DATE_REGEXP.exec(data); - if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); - - if (match === null) throw new Error('Date resolve error'); - - // match: [1] year [2] month [3] day - - year = +(match[1]); - month = +(match[2]) - 1; // JS month starts with 0 - day = +(match[3]); - - if (!match[4]) { // no hour - return new Date(Date.UTC(year, month, day)); - } - - // match: [4] hour [5] minute [6] second [7] fraction - - hour = +(match[4]); - minute = +(match[5]); - second = +(match[6]); - - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { // milli-seconds - fraction += '0'; - } - fraction = +fraction; - } - - // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute - - if (match[9]) { - tz_hour = +(match[10]); - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if (match[9] === '-') delta = -delta; - } - - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - - if (delta) date.setTime(date.getTime() - delta); - - return date; -} - -function representYamlTimestamp(object /*, style*/) { - return object.toISOString(); -} - -module.exports = new Type('tag:yaml.org,2002:timestamp', { - kind: 'scalar', - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp -}); - - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Type = __webpack_require__(13); - -function resolveYamlMerge(data) { - return data === '<<' || data === null; -} - -module.exports = new Type('tag:yaml.org,2002:merge', { - kind: 'scalar', - resolve: resolveYamlMerge -}); - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -var require; - -/*eslint-disable no-bitwise*/ - -var NodeBuffer; - -try { - // A trick for browserified version, to not include `Buffer` shim - var _require = require; - NodeBuffer = __webpack_require__(27).Buffer; -} catch (__) {} - -var Type = __webpack_require__(13); - - -// [ 64, 65, 66 ] -> [ padding, CR, LF ] -var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; - - -function resolveYamlBinary(data) { - if (data === null) return false; - - var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; - - // Convert one by one. - for (idx = 0; idx < max; idx++) { - code = map.indexOf(data.charAt(idx)); - - // Skip CR/LF - if (code > 64) continue; - - // Fail on illegal characters - if (code < 0) return false; - - bitlen += 6; - } - - // If there are any bits left, source was corrupted - return (bitlen % 8) === 0; -} - -function constructYamlBinary(data) { - var idx, tailbits, - input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan - max = input.length, - map = BASE64_MAP, - bits = 0, - result = []; - - // Collect by 6*4 bits (3 bytes) - - for (idx = 0; idx < max; idx++) { - if ((idx % 4 === 0) && idx) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } - - bits = (bits << 6) | map.indexOf(input.charAt(idx)); - } - - // Dump tail - - tailbits = (max % 4) * 6; - - if (tailbits === 0) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } else if (tailbits === 18) { - result.push((bits >> 10) & 0xFF); - result.push((bits >> 2) & 0xFF); - } else if (tailbits === 12) { - result.push((bits >> 4) & 0xFF); - } - - // Wrap into Buffer for NodeJS and leave Array for browser - if (NodeBuffer) { - // Support node 6.+ Buffer API when available - return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); - } - - return result; -} - -function representYamlBinary(object /*, style*/) { - var result = '', bits = 0, idx, tail, - max = object.length, - map = BASE64_MAP; - - // Convert every three bytes to 4 ASCII characters. - - for (idx = 0; idx < max; idx++) { - if ((idx % 3 === 0) && idx) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } - - bits = (bits << 8) + object[idx]; - } - - // Dump tail - - tail = max % 3; - - if (tail === 0) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } else if (tail === 2) { - result += map[(bits >> 10) & 0x3F]; - result += map[(bits >> 4) & 0x3F]; - result += map[(bits << 2) & 0x3F]; - result += map[64]; - } else if (tail === 1) { - result += map[(bits >> 2) & 0x3F]; - result += map[(bits << 4) & 0x3F]; - result += map[64]; - result += map[64]; - } - - return result; -} - -function isBinary(object) { - return NodeBuffer && NodeBuffer.isBuffer(object); -} - -module.exports = new Type('tag:yaml.org,2002:binary', { - kind: 'scalar', - resolve: resolveYamlBinary, - construct: constructYamlBinary, - predicate: isBinary, - represent: representYamlBinary -}); - - -/***/ }), -/* 27 */ -/***/ (function(module, exports) { - -module.exports = require("buffer"); - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Type = __webpack_require__(13); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; -var _toString = Object.prototype.toString; - -function resolveYamlOmap(data) { - if (data === null) return true; - - var objectKeys = [], index, length, pair, pairKey, pairHasKey, - object = data; - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - pairHasKey = false; - - if (_toString.call(pair) !== '[object Object]') return false; - - for (pairKey in pair) { - if (_hasOwnProperty.call(pair, pairKey)) { - if (!pairHasKey) pairHasKey = true; - else return false; - } - } - - if (!pairHasKey) return false; - - if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); - else return false; - } - - return true; -} - -function constructYamlOmap(data) { - return data !== null ? data : []; -} - -module.exports = new Type('tag:yaml.org,2002:omap', { - kind: 'sequence', - resolve: resolveYamlOmap, - construct: constructYamlOmap -}); - - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Type = __webpack_require__(13); - -var _toString = Object.prototype.toString; - -function resolveYamlPairs(data) { - if (data === null) return true; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - if (_toString.call(pair) !== '[object Object]') return false; - - keys = Object.keys(pair); - - if (keys.length !== 1) return false; - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return true; -} - -function constructYamlPairs(data) { - if (data === null) return []; - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - keys = Object.keys(pair); - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return result; -} - -module.exports = new Type('tag:yaml.org,2002:pairs', { - kind: 'sequence', - resolve: resolveYamlPairs, - construct: constructYamlPairs -}); - - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Type = __webpack_require__(13); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - -function resolveYamlSet(data) { - if (data === null) return true; - - var key, object = data; - - for (key in object) { - if (_hasOwnProperty.call(object, key)) { - if (object[key] !== null) return false; - } - } - - return true; -} - -function constructYamlSet(data) { - return data !== null ? data : {}; -} - -module.exports = new Type('tag:yaml.org,2002:set', { - kind: 'mapping', - resolve: resolveYamlSet, - construct: constructYamlSet -}); - - -/***/ }), -/* 31 */ -/***/ (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__(12); - - -module.exports = Schema.DEFAULT = new Schema({ - include: [ - __webpack_require__(11) - ], - explicit: [ - __webpack_require__(32), - __webpack_require__(33), - __webpack_require__(34) - ] -}); - - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Type = __webpack_require__(13); - -function resolveJavascriptUndefined() { - return true; -} - -function constructJavascriptUndefined() { - /*eslint-disable no-undefined*/ - return undefined; -} - -function representJavascriptUndefined() { - return ''; -} - -function isUndefined(object) { - return typeof object === 'undefined'; -} - -module.exports = new Type('tag:yaml.org,2002:js/undefined', { - kind: 'scalar', - resolve: resolveJavascriptUndefined, - construct: constructJavascriptUndefined, - predicate: isUndefined, - represent: representJavascriptUndefined -}); - - -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var Type = __webpack_require__(13); - -function resolveJavascriptRegExp(data) { - if (data === null) return false; - if (data.length === 0) return false; - - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // if regexp starts with '/' it can have modifiers and must be properly closed - // `/foo/gim` - modifiers tail can be maximum 3 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - - if (modifiers.length > 3) return false; - // if expression starts with /, is should be properly terminated - if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; - } - - return true; -} - -function constructJavascriptRegExp(data) { - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // `/foo/gim` - tail can be maximum 4 chars - if (regexp[0] === '/') { - if (tail) modifiers = tail[1]; - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); - } - - return new RegExp(regexp, modifiers); -} - -function representJavascriptRegExp(object /*, style*/) { - var result = '/' + object.source + '/'; - - if (object.global) result += 'g'; - if (object.multiline) result += 'm'; - if (object.ignoreCase) result += 'i'; - - return result; -} - -function isRegExp(object) { - return Object.prototype.toString.call(object) === '[object RegExp]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/regexp', { - kind: 'scalar', - resolve: resolveJavascriptRegExp, - construct: constructJavascriptRegExp, - predicate: isRegExp, - represent: representJavascriptRegExp -}); - - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -var require; - -var esprima; - -// Browserified version does not have esprima -// -// 1. For node.js just require module as deps -// 2. For browser try to require mudule via external AMD system. -// If not found - try to fallback to window.esprima. If not -// found too - then fail to parse. -// -try { - // workaround to exclude package from browserify list. - var _require = require; - esprima = __webpack_require__(35); -} catch (_) { - /* eslint-disable no-redeclare */ - /* global window */ - if (typeof window !== 'undefined') esprima = window.esprima; -} - -var Type = __webpack_require__(13); - -function resolveJavascriptFunction(data) { - if (data === null) return false; - - try { - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }); - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - return false; - } - - return true; - } catch (err) { - return false; - } -} - -function constructJavascriptFunction(data) { - /*jslint evil:true*/ - - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if (ast.type !== 'Program' || - ast.body.length !== 1 || - ast.body[0].type !== 'ExpressionStatement' || - (ast.body[0].expression.type !== 'ArrowFunctionExpression' && - ast.body[0].expression.type !== 'FunctionExpression')) { - throw new Error('Failed to resolve function'); - } - - ast.body[0].expression.params.forEach(function (param) { - params.push(param.name); - }); - - body = ast.body[0].expression.body.range; - - // Esprima's ranges include the first '{' and the last '}' characters on - // function expressions. So cut them out. - if (ast.body[0].expression.body.type === 'BlockStatement') { - /*eslint-disable no-new-func*/ - return new Function(params, source.slice(body[0] + 1, body[1] - 1)); - } - // ES6 arrow functions can omit the BlockStatement. In that case, just return - // the body. - /*eslint-disable no-new-func*/ - return new Function(params, 'return ' + source.slice(body[0], body[1])); -} - -function representJavascriptFunction(object /*, style*/) { - return object.toString(); -} - -function isFunction(object) { - return Object.prototype.toString.call(object) === '[object Function]'; -} - -module.exports = new Type('tag:yaml.org,2002:js/function', { - kind: 'scalar', - resolve: resolveJavascriptFunction, - construct: constructJavascriptFunction, - predicate: isFunction, - represent: representJavascriptFunction -}); - - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -(function webpackUniversalModuleDefinition(root, factory) { -/* istanbul ignore next */ - if(true) - module.exports = factory(); - else {} -})(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; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // 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'; - - -/***/ }, -/* 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; // `/, true ], - [ /^<\?/, /\?>/, true ], - [ /^/, true ], - [ /^/, true ], - [ new RegExp('^|$))', 'i'), /^$/, true ], - [ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false ] -]; - - -module.exports = function html_block(state, startLine, endLine, silent) { - var i, nextLine, token, lineText, - pos = state.bMarks[startLine] + state.tShift[startLine], - max = state.eMarks[startLine]; - - // if it's indented more than 3 spaces, it should be a code block - if (state.sCount[startLine] - state.blkIndent >= 4) { return false; } - - if (!state.md.options.html) { return false; } - - if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; } - - lineText = state.src.slice(pos, max); - - for (i = 0; i < HTML_SEQUENCES.length; i++) { - if (HTML_SEQUENCES[i][0].test(lineText)) { break; } - } - - if (i === HTML_SEQUENCES.length) { return false; } - - if (silent) { - // true if this sequence can be a terminator, false otherwise - return HTML_SEQUENCES[i][2]; - } - - nextLine = startLine + 1; - - // If we are here - we detected HTML block. - // Let's roll down till block end. - if (!HTML_SEQUENCES[i][1].test(lineText)) { - for (; nextLine < endLine; nextLine++) { - if (state.sCount[nextLine] < state.blkIndent) { break; } - - pos = state.bMarks[nextLine] + state.tShift[nextLine]; - max = state.eMarks[nextLine]; - lineText = state.src.slice(pos, max); - - if (HTML_SEQUENCES[i][1].test(lineText)) { - if (lineText.length !== 0) { nextLine++; } - break; - } - } - } - - state.line = nextLine; - - token = state.push('html_block', '', 0); - token.map = [ startLine, nextLine ]; - token.content = state.getLines(startLine, nextLine, state.blkIndent, true); - - return true; -}; - - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// List of valid html blocks names, accorting to commonmark spec -// http://jgm.github.io/CommonMark/spec.html#html-blocks - - - - -module.exports = [ - 'address', - 'article', - 'aside', - 'base', - 'basefont', - 'blockquote', - 'body', - 'caption', - 'center', - 'col', - 'colgroup', - 'dd', - 'details', - 'dialog', - 'dir', - 'div', - 'dl', - 'dt', - 'fieldset', - 'figcaption', - 'figure', - 'footer', - 'form', - 'frame', - 'frameset', - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6', - 'head', - 'header', - 'hr', - 'html', - 'iframe', - 'legend', - 'li', - 'link', - 'main', - 'menu', - 'menuitem', - 'meta', - 'nav', - 'noframes', - 'ol', - 'optgroup', - 'option', - 'p', - 'param', - 'section', - 'source', - 'summary', - 'table', - 'tbody', - 'td', - 'tfoot', - 'th', - 'thead', - 'title', - 'tr', - 'track', - 'ul' -]; - - -/***/ }), -/* 83 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Regexps to match html elements - - - -var attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; - -var unquoted = '[^"\'=<>`\\x00-\\x20]+'; -var single_quoted = "'[^']*'"; -var double_quoted = '"[^"]*"'; - -var attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')'; - -var attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)'; - -var open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>'; - -var close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; -var comment = '|'; -var processing = '<[?].*?[?]>'; -var declaration = ']*>'; -var cdata = ''; - -var HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment + - '|' + processing + '|' + declaration + '|' + cdata + ')'); -var HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')'); - -module.exports.HTML_TAG_RE = HTML_TAG_RE; -module.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE; - - -/***/ }), -/* 84 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Paragraph - - - - -module.exports = function paragraph(state, startLine/*, endLine*/) { - var content, terminate, i, l, token, oldParentType, - nextLine = startLine + 1, - terminatorRules = state.md.block.ruler.getRules('paragraph'), - endLine = state.lineMax; - - oldParentType = state.parentType; - state.parentType = 'paragraph'; - - // jump line-by-line until empty one or EOF - for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { - // this would be a code block normally, but after paragraph - // it's considered a lazy continuation regardless of what's there - if (state.sCount[nextLine] - state.blkIndent > 3) { continue; } - - // quirk for blockquotes, this line should already be checked by that rule - if (state.sCount[nextLine] < 0) { continue; } - - // Some tags can terminate paragraph without empty line. - terminate = false; - for (i = 0, l = terminatorRules.length; i < l; i++) { - if (terminatorRules[i](state, nextLine, endLine, true)) { - terminate = true; - break; - } - } - if (terminate) { break; } - } - - content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); - - state.line = nextLine; - - token = state.push('paragraph_open', 'p', 1); - token.map = [ startLine, state.line ]; - - token = state.push('inline', '', 0); - token.content = content; - token.map = [ startLine, state.line ]; - token.children = []; - - token = state.push('paragraph_close', 'p', -1); - - state.parentType = oldParentType; - - return true; -}; - - -/***/ }), -/* 85 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Parser state class - - - -var Token = __webpack_require__(70); -var isSpace = __webpack_require__(42).isSpace; - - -function StateBlock(src, md, env, tokens) { - var ch, s, start, pos, len, indent, offset, indent_found; - - this.src = src; - - // link to parser instance - this.md = md; - - this.env = env; - - // - // Internal state vartiables - // - - this.tokens = tokens; - - this.bMarks = []; // line begin offsets for fast jumps - this.eMarks = []; // line end offsets for fast jumps - this.tShift = []; // offsets of the first non-space characters (tabs not expanded) - this.sCount = []; // indents for each line (tabs expanded) - - // An amount of virtual spaces (tabs expanded) between beginning - // of each line (bMarks) and real beginning of that line. - // - // It exists only as a hack because blockquotes override bMarks - // losing information in the process. - // - // It's used only when expanding tabs, you can think about it as - // an initial tab length, e.g. bsCount=21 applied to string `\t123` - // means first tab should be expanded to 4-21%4 === 3 spaces. - // - this.bsCount = []; - - // block parser variables - this.blkIndent = 0; // required block content indent (for example, if we are - // inside a list, it would be positioned after list marker) - this.line = 0; // line index in src - this.lineMax = 0; // lines count - this.tight = false; // loose/tight mode for lists - this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any) - this.listIndent = -1; // indent of the current list block (-1 if there isn't any) - - // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference' - // used in lists to determine if they interrupt a paragraph - this.parentType = 'root'; - - this.level = 0; - - // renderer - this.result = ''; - - // Create caches - // Generate markers. - s = this.src; - indent_found = false; - - for (start = pos = indent = offset = 0, len = s.length; pos < len; pos++) { - ch = s.charCodeAt(pos); - - if (!indent_found) { - if (isSpace(ch)) { - indent++; - - if (ch === 0x09) { - offset += 4 - offset % 4; - } else { - offset++; - } - continue; - } else { - indent_found = true; - } - } - - if (ch === 0x0A || pos === len - 1) { - if (ch !== 0x0A) { pos++; } - this.bMarks.push(start); - this.eMarks.push(pos); - this.tShift.push(indent); - this.sCount.push(offset); - this.bsCount.push(0); - - indent_found = false; - indent = 0; - offset = 0; - start = pos + 1; - } - } - - // Push fake entry to simplify cache bounds checks - this.bMarks.push(s.length); - this.eMarks.push(s.length); - this.tShift.push(0); - this.sCount.push(0); - this.bsCount.push(0); - - this.lineMax = this.bMarks.length - 1; // don't count last fake line -} - -// Push new token to "stream". -// -StateBlock.prototype.push = function (type, tag, nesting) { - var token = new Token(type, tag, nesting); - token.block = true; - - if (nesting < 0) this.level--; // closing tag - token.level = this.level; - if (nesting > 0) this.level++; // opening tag - - this.tokens.push(token); - return token; -}; - -StateBlock.prototype.isEmpty = function isEmpty(line) { - return this.bMarks[line] + this.tShift[line] >= this.eMarks[line]; -}; - -StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) { - for (var max = this.lineMax; from < max; from++) { - if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) { - break; - } - } - return from; -}; - -// Skip spaces from given position. -StateBlock.prototype.skipSpaces = function skipSpaces(pos) { - var ch; - - for (var max = this.src.length; pos < max; pos++) { - ch = this.src.charCodeAt(pos); - if (!isSpace(ch)) { break; } - } - return pos; -}; - -// Skip spaces from given position in reverse. -StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) { - if (pos <= min) { return pos; } - - while (pos > min) { - if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1; } - } - return pos; -}; - -// Skip char codes from given position -StateBlock.prototype.skipChars = function skipChars(pos, code) { - for (var max = this.src.length; pos < max; pos++) { - if (this.src.charCodeAt(pos) !== code) { break; } - } - return pos; -}; - -// Skip char codes reverse from given position - 1 -StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) { - if (pos <= min) { return pos; } - - while (pos > min) { - if (code !== this.src.charCodeAt(--pos)) { return pos + 1; } - } - return pos; -}; - -// cut lines range from source. -StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) { - var i, lineIndent, ch, first, last, queue, lineStart, - line = begin; - - if (begin >= end) { - return ''; - } - - queue = new Array(end - begin); - - for (i = 0; line < end; line++, i++) { - lineIndent = 0; - lineStart = first = this.bMarks[line]; - - if (line + 1 < end || keepLastLF) { - // No need for bounds check because we have fake entry on tail. - last = this.eMarks[line] + 1; - } else { - last = this.eMarks[line]; - } - - while (first < last && lineIndent < indent) { - ch = this.src.charCodeAt(first); - - if (isSpace(ch)) { - if (ch === 0x09) { - lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4; - } else { - lineIndent++; - } - } else if (first - lineStart < this.tShift[line]) { - // patched tShift masked characters to look like spaces (blockquotes, list markers) - lineIndent++; - } else { - break; - } - - first++; - } - - if (lineIndent > indent) { - // partially expanding tabs in code blocks, e.g '\t\tfoobar' - // with indent=2 becomes ' \tfoobar' - queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last); - } else { - queue[i] = this.src.slice(first, last); - } - } - - return queue.join(''); -}; - -// re-export Token class to use in block rules -StateBlock.prototype.Token = Token; - - -module.exports = StateBlock; - - -/***/ }), -/* 86 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** internal - * class ParserInline - * - * Tokenizes paragraph content. - **/ - - - -var Ruler = __webpack_require__(62); - - -//////////////////////////////////////////////////////////////////////////////// -// Parser rules - -var _rules = [ - [ 'text', __webpack_require__(87) ], - [ 'newline', __webpack_require__(88) ], - [ 'escape', __webpack_require__(89) ], - [ 'backticks', __webpack_require__(90) ], - [ 'strikethrough', __webpack_require__(91).tokenize ], - [ 'emphasis', __webpack_require__(92).tokenize ], - [ 'link', __webpack_require__(93) ], - [ 'image', __webpack_require__(94) ], - [ 'autolink', __webpack_require__(95) ], - [ 'html_inline', __webpack_require__(96) ], - [ 'entity', __webpack_require__(97) ] -]; - -var _rules2 = [ - [ 'balance_pairs', __webpack_require__(98) ], - [ 'strikethrough', __webpack_require__(91).postProcess ], - [ 'emphasis', __webpack_require__(92).postProcess ], - [ 'text_collapse', __webpack_require__(99) ] -]; - - -/** - * new ParserInline() - **/ -function ParserInline() { - var i; - - /** - * ParserInline#ruler -> Ruler - * - * [[Ruler]] instance. Keep configuration of inline rules. - **/ - this.ruler = new Ruler(); - - for (i = 0; i < _rules.length; i++) { - this.ruler.push(_rules[i][0], _rules[i][1]); - } - - /** - * ParserInline#ruler2 -> Ruler - * - * [[Ruler]] instance. Second ruler used for post-processing - * (e.g. in emphasis-like rules). - **/ - this.ruler2 = new Ruler(); - - for (i = 0; i < _rules2.length; i++) { - this.ruler2.push(_rules2[i][0], _rules2[i][1]); - } -} - - -// Skip single token by running all rules in validation mode; -// returns `true` if any rule reported success -// -ParserInline.prototype.skipToken = function (state) { - var ok, i, pos = state.pos, - rules = this.ruler.getRules(''), - len = rules.length, - maxNesting = state.md.options.maxNesting, - cache = state.cache; - - - if (typeof cache[pos] !== 'undefined') { - state.pos = cache[pos]; - return; - } - - if (state.level < maxNesting) { - for (i = 0; i < len; i++) { - // Increment state.level and decrement it later to limit recursion. - // It's harmless to do here, because no tokens are created. But ideally, - // we'd need a separate private state variable for this purpose. - // - state.level++; - ok = rules[i](state, true); - state.level--; - - if (ok) { break; } - } - } else { - // Too much nesting, just skip until the end of the paragraph. - // - // NOTE: this will cause links to behave incorrectly in the following case, - // when an amount of `[` is exactly equal to `maxNesting + 1`: - // - // [[[[[[[[[[[[[[[[[[[[[foo]() - // - // TODO: remove this workaround when CM standard will allow nested links - // (we can replace it by preventing links from being parsed in - // validation mode) - // - state.pos = state.posMax; - } - - if (!ok) { state.pos++; } - cache[pos] = state.pos; -}; - - -// Generate tokens for input range -// -ParserInline.prototype.tokenize = function (state) { - var ok, i, - rules = this.ruler.getRules(''), - len = rules.length, - end = state.posMax, - maxNesting = state.md.options.maxNesting; - - while (state.pos < end) { - // Try all possible rules. - // On success, rule should: - // - // - update `state.pos` - // - update `state.tokens` - // - return true - - if (state.level < maxNesting) { - for (i = 0; i < len; i++) { - ok = rules[i](state, false); - if (ok) { break; } - } - } - - if (ok) { - if (state.pos >= end) { break; } - continue; - } - - state.pending += state.src[state.pos++]; - } - - if (state.pending) { - state.pushPending(); - } -}; - - -/** - * ParserInline.parse(str, md, env, outTokens) - * - * Process input string and push inline tokens into `outTokens` - **/ -ParserInline.prototype.parse = function (str, md, env, outTokens) { - var i, rules, len; - var state = new this.State(str, md, env, outTokens); - - this.tokenize(state); - - rules = this.ruler2.getRules(''); - len = rules.length; - - for (i = 0; i < len; i++) { - rules[i](state); - } -}; - - -ParserInline.prototype.State = __webpack_require__(100); - - -module.exports = ParserInline; - - -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Skip text characters for text token, place those to pending buffer -// and increment current pos - - - - -// Rule to skip pure text -// '{}$%@~+=:' reserved for extentions - -// !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ - -// !!!! Don't confuse with "Markdown ASCII Punctuation" chars -// http://spec.commonmark.org/0.15/#ascii-punctuation-character -function isTerminatorChar(ch) { - switch (ch) { - case 0x0A/* \n */: - case 0x21/* ! */: - case 0x23/* # */: - case 0x24/* $ */: - case 0x25/* % */: - case 0x26/* & */: - case 0x2A/* * */: - case 0x2B/* + */: - case 0x2D/* - */: - case 0x3A/* : */: - case 0x3C/* < */: - case 0x3D/* = */: - case 0x3E/* > */: - case 0x40/* @ */: - case 0x5B/* [ */: - case 0x5C/* \ */: - case 0x5D/* ] */: - case 0x5E/* ^ */: - case 0x5F/* _ */: - case 0x60/* ` */: - case 0x7B/* { */: - case 0x7D/* } */: - case 0x7E/* ~ */: - return true; - default: - return false; - } -} - -module.exports = function text(state, silent) { - var pos = state.pos; - - while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) { - pos++; - } - - if (pos === state.pos) { return false; } - - if (!silent) { state.pending += state.src.slice(state.pos, pos); } - - state.pos = pos; - - return true; -}; - -// Alternative implementation, for memory. -// -// It costs 10% of performance, but allows extend terminators list, if place it -// to `ParcerInline` property. Probably, will switch to it sometime, such -// flexibility required. - -/* -var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/; - -module.exports = function text(state, silent) { - var pos = state.pos, - idx = state.src.slice(pos).search(TERMINATOR_RE); - - // first char is terminator -> empty text - if (idx === 0) { return false; } - - // no terminator -> text till end of string - if (idx < 0) { - if (!silent) { state.pending += state.src.slice(pos); } - state.pos = state.src.length; - return true; - } - - if (!silent) { state.pending += state.src.slice(pos, pos + idx); } - - state.pos += idx; - - return true; -};*/ - - -/***/ }), -/* 88 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Proceess '\n' - - - -var isSpace = __webpack_require__(42).isSpace; - - -module.exports = function newline(state, silent) { - var pmax, max, pos = state.pos; - - if (state.src.charCodeAt(pos) !== 0x0A/* \n */) { return false; } - - pmax = state.pending.length - 1; - max = state.posMax; - - // ' \n' -> hardbreak - // Lookup in pending chars is bad practice! Don't copy to other rules! - // Pending string is stored in concat mode, indexed lookups will cause - // convertion to flat mode. - if (!silent) { - if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) { - if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) { - state.pending = state.pending.replace(/ +$/, ''); - state.push('hardbreak', 'br', 0); - } else { - state.pending = state.pending.slice(0, -1); - state.push('softbreak', 'br', 0); - } - - } else { - state.push('softbreak', 'br', 0); - } - } - - pos++; - - // skip heading spaces for next line - while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; } - - state.pos = pos; - return true; -}; - - -/***/ }), -/* 89 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Process escaped chars and hardbreaks - - - -var isSpace = __webpack_require__(42).isSpace; - -var ESCAPED = []; - -for (var i = 0; i < 256; i++) { ESCAPED.push(0); } - -'\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-' - .split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1; }); - - -module.exports = function escape(state, silent) { - var ch, pos = state.pos, max = state.posMax; - - if (state.src.charCodeAt(pos) !== 0x5C/* \ */) { return false; } - - pos++; - - if (pos < max) { - ch = state.src.charCodeAt(pos); - - if (ch < 256 && ESCAPED[ch] !== 0) { - if (!silent) { state.pending += state.src[pos]; } - state.pos += 2; - return true; - } - - if (ch === 0x0A) { - if (!silent) { - state.push('hardbreak', 'br', 0); - } - - pos++; - // skip leading whitespaces from next line - while (pos < max) { - ch = state.src.charCodeAt(pos); - if (!isSpace(ch)) { break; } - pos++; - } - - state.pos = pos; - return true; - } - } - - if (!silent) { state.pending += '\\'; } - state.pos++; - return true; -}; - - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Parse backticks - - - -module.exports = function backtick(state, silent) { - var start, max, marker, matchStart, matchEnd, token, - pos = state.pos, - ch = state.src.charCodeAt(pos); - - if (ch !== 0x60/* ` */) { return false; } - - start = pos; - pos++; - max = state.posMax; - - while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++; } - - marker = state.src.slice(start, pos); - - matchStart = matchEnd = pos; - - while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) { - matchEnd = matchStart + 1; - - while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++; } - - if (matchEnd - matchStart === marker.length) { - if (!silent) { - token = state.push('code_inline', 'code', 0); - token.markup = marker; - token.content = state.src.slice(pos, matchStart) - .replace(/\n/g, ' ') - .replace(/^ (.+) $/, '$1'); - } - state.pos = matchEnd; - return true; - } - } - - if (!silent) { state.pending += marker; } - state.pos += marker.length; - return true; -}; - - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// ~~strike through~~ -// - - - -// Insert each marker as a separate text token, and add it to delimiter list -// -module.exports.tokenize = function strikethrough(state, silent) { - var i, scanned, token, len, ch, - start = state.pos, - marker = state.src.charCodeAt(start); - - if (silent) { return false; } - - if (marker !== 0x7E/* ~ */) { return false; } - - scanned = state.scanDelims(state.pos, true); - len = scanned.length; - ch = String.fromCharCode(marker); - - if (len < 2) { return false; } - - if (len % 2) { - token = state.push('text', '', 0); - token.content = ch; - len--; - } - - for (i = 0; i < len; i += 2) { - token = state.push('text', '', 0); - token.content = ch + ch; - - state.delimiters.push({ - marker: marker, - length: 0, // disable "rule of 3" length checks meant for emphasis - jump: i, - token: state.tokens.length - 1, - end: -1, - open: scanned.can_open, - close: scanned.can_close - }); - } - - state.pos += scanned.length; - - return true; -}; - - -function postProcess(state, delimiters) { - var i, j, - startDelim, - endDelim, - token, - loneMarkers = [], - max = delimiters.length; - - for (i = 0; i < max; i++) { - startDelim = delimiters[i]; - - if (startDelim.marker !== 0x7E/* ~ */) { - continue; - } - - if (startDelim.end === -1) { - continue; - } - - endDelim = delimiters[startDelim.end]; - - token = state.tokens[startDelim.token]; - token.type = 's_open'; - token.tag = 's'; - token.nesting = 1; - token.markup = '~~'; - token.content = ''; - - token = state.tokens[endDelim.token]; - token.type = 's_close'; - token.tag = 's'; - token.nesting = -1; - token.markup = '~~'; - token.content = ''; - - if (state.tokens[endDelim.token - 1].type === 'text' && - state.tokens[endDelim.token - 1].content === '~') { - - loneMarkers.push(endDelim.token - 1); - } - } - - // If a marker sequence has an odd number of characters, it's splitted - // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the - // start of the sequence. - // - // So, we have to move all those markers after subsequent s_close tags. - // - while (loneMarkers.length) { - i = loneMarkers.pop(); - j = i + 1; - - while (j < state.tokens.length && state.tokens[j].type === 's_close') { - j++; - } - - j--; - - if (i !== j) { - token = state.tokens[j]; - state.tokens[j] = state.tokens[i]; - state.tokens[i] = token; - } - } -} - - -// Walk through delimiter list and replace text tokens with tags -// -module.exports.postProcess = function strikethrough(state) { - var curr, - tokens_meta = state.tokens_meta, - max = state.tokens_meta.length; - - postProcess(state, state.delimiters); - - for (curr = 0; curr < max; curr++) { - if (tokens_meta[curr] && tokens_meta[curr].delimiters) { - postProcess(state, tokens_meta[curr].delimiters); - } - } -}; - - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Process *this* and _that_ -// - - - -// Insert each marker as a separate text token, and add it to delimiter list -// -module.exports.tokenize = function emphasis(state, silent) { - var i, scanned, token, - start = state.pos, - marker = state.src.charCodeAt(start); - - if (silent) { return false; } - - if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false; } - - scanned = state.scanDelims(state.pos, marker === 0x2A); - - for (i = 0; i < scanned.length; i++) { - token = state.push('text', '', 0); - token.content = String.fromCharCode(marker); - - state.delimiters.push({ - // Char code of the starting marker (number). - // - marker: marker, - - // Total length of these series of delimiters. - // - length: scanned.length, - - // An amount of characters before this one that's equivalent to - // current one. In plain English: if this delimiter does not open - // an emphasis, neither do previous `jump` characters. - // - // Used to skip sequences like "*****" in one step, for 1st asterisk - // value will be 0, for 2nd it's 1 and so on. - // - jump: i, - - // A position of the token this delimiter corresponds to. - // - token: state.tokens.length - 1, - - // If this delimiter is matched as a valid opener, `end` will be - // equal to its position, otherwise it's `-1`. - // - end: -1, - - // Boolean flags that determine if this delimiter could open or close - // an emphasis. - // - open: scanned.can_open, - close: scanned.can_close - }); - } - - state.pos += scanned.length; - - return true; -}; - - -function postProcess(state, delimiters) { - var i, - startDelim, - endDelim, - token, - ch, - isStrong, - max = delimiters.length; - - for (i = max - 1; i >= 0; i--) { - startDelim = delimiters[i]; - - if (startDelim.marker !== 0x5F/* _ */ && startDelim.marker !== 0x2A/* * */) { - continue; - } - - // Process only opening markers - if (startDelim.end === -1) { - continue; - } - - endDelim = delimiters[startDelim.end]; - - // If the previous delimiter has the same marker and is adjacent to this one, - // merge those into one strong delimiter. - // - // `whatever` -> `whatever` - // - isStrong = i > 0 && - delimiters[i - 1].end === startDelim.end + 1 && - delimiters[i - 1].token === startDelim.token - 1 && - delimiters[startDelim.end + 1].token === endDelim.token + 1 && - delimiters[i - 1].marker === startDelim.marker; - - ch = String.fromCharCode(startDelim.marker); - - token = state.tokens[startDelim.token]; - token.type = isStrong ? 'strong_open' : 'em_open'; - token.tag = isStrong ? 'strong' : 'em'; - token.nesting = 1; - token.markup = isStrong ? ch + ch : ch; - token.content = ''; - - token = state.tokens[endDelim.token]; - token.type = isStrong ? 'strong_close' : 'em_close'; - token.tag = isStrong ? 'strong' : 'em'; - token.nesting = -1; - token.markup = isStrong ? ch + ch : ch; - token.content = ''; - - if (isStrong) { - state.tokens[delimiters[i - 1].token].content = ''; - state.tokens[delimiters[startDelim.end + 1].token].content = ''; - i--; - } - } -} - - -// Walk through delimiter list and replace text tokens with tags -// -module.exports.postProcess = function emphasis(state) { - var curr, - tokens_meta = state.tokens_meta, - max = state.tokens_meta.length; - - postProcess(state, state.delimiters); - - for (curr = 0; curr < max; curr++) { - if (tokens_meta[curr] && tokens_meta[curr].delimiters) { - postProcess(state, tokens_meta[curr].delimiters); - } - } -}; - - -/***/ }), -/* 93 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Process [link]( "stuff") - - - -var normalizeReference = __webpack_require__(42).normalizeReference; -var isSpace = __webpack_require__(42).isSpace; - - -module.exports = function link(state, silent) { - var attrs, - code, - label, - labelEnd, - labelStart, - pos, - res, - ref, - title, - token, - href = '', - oldPos = state.pos, - max = state.posMax, - start = state.pos, - parseReference = true; - - if (state.src.charCodeAt(state.pos) !== 0x5B/* [ */) { return false; } - - labelStart = state.pos + 1; - labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true); - - // parser failed to find ']', so it's not a valid link - if (labelEnd < 0) { return false; } - - pos = labelEnd + 1; - if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) { - // - // Inline link - // - - // might have found a valid shortcut link, disable reference parsing - parseReference = false; - - // [link]( "title" ) - // ^^ skipping these spaces - pos++; - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { break; } - } - if (pos >= max) { return false; } - - // [link]( "title" ) - // ^^^^^^ parsing link destination - start = pos; - res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); - if (res.ok) { - href = state.md.normalizeLink(res.str); - if (state.md.validateLink(href)) { - pos = res.pos; - } else { - href = ''; - } - } - - // [link]( "title" ) - // ^^ skipping these spaces - start = pos; - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { break; } - } - - // [link]( "title" ) - // ^^^^^^^ parsing link title - res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); - if (pos < max && start !== pos && res.ok) { - title = res.str; - pos = res.pos; - - // [link]( "title" ) - // ^^ skipping these spaces - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { break; } - } - } else { - title = ''; - } - - if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) { - // parsing a valid shortcut link failed, fallback to reference - parseReference = true; - } - pos++; - } - - if (parseReference) { - // - // Link reference - // - if (typeof state.env.references === 'undefined') { return false; } - - if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) { - start = pos + 1; - pos = state.md.helpers.parseLinkLabel(state, pos); - if (pos >= 0) { - label = state.src.slice(start, pos++); - } else { - pos = labelEnd + 1; - } - } else { - pos = labelEnd + 1; - } - - // covers label === '' and label === undefined - // (collapsed reference link and shortcut reference link respectively) - if (!label) { label = state.src.slice(labelStart, labelEnd); } - - ref = state.env.references[normalizeReference(label)]; - if (!ref) { - state.pos = oldPos; - return false; - } - href = ref.href; - title = ref.title; - } - - // - // We found the end of the link, and know for a fact it's a valid link; - // so all that's left to do is to call tokenizer. - // - if (!silent) { - state.pos = labelStart; - state.posMax = labelEnd; - - token = state.push('link_open', 'a', 1); - token.attrs = attrs = [ [ 'href', href ] ]; - if (title) { - attrs.push([ 'title', title ]); - } - - state.md.inline.tokenize(state); - - token = state.push('link_close', 'a', -1); - } - - state.pos = pos; - state.posMax = max; - return true; -}; - - -/***/ }), -/* 94 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Process ![image]( "title") - - - -var normalizeReference = __webpack_require__(42).normalizeReference; -var isSpace = __webpack_require__(42).isSpace; - - -module.exports = function image(state, silent) { - var attrs, - code, - content, - label, - labelEnd, - labelStart, - pos, - ref, - res, - title, - token, - tokens, - start, - href = '', - oldPos = state.pos, - max = state.posMax; - - if (state.src.charCodeAt(state.pos) !== 0x21/* ! */) { return false; } - if (state.src.charCodeAt(state.pos + 1) !== 0x5B/* [ */) { return false; } - - labelStart = state.pos + 2; - labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false); - - // parser failed to find ']', so it's not a valid link - if (labelEnd < 0) { return false; } - - pos = labelEnd + 1; - if (pos < max && state.src.charCodeAt(pos) === 0x28/* ( */) { - // - // Inline link - // - - // [link]( "title" ) - // ^^ skipping these spaces - pos++; - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { break; } - } - if (pos >= max) { return false; } - - // [link]( "title" ) - // ^^^^^^ parsing link destination - start = pos; - res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); - if (res.ok) { - href = state.md.normalizeLink(res.str); - if (state.md.validateLink(href)) { - pos = res.pos; - } else { - href = ''; - } - } - - // [link]( "title" ) - // ^^ skipping these spaces - start = pos; - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { break; } - } - - // [link]( "title" ) - // ^^^^^^^ parsing link title - res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); - if (pos < max && start !== pos && res.ok) { - title = res.str; - pos = res.pos; - - // [link]( "title" ) - // ^^ skipping these spaces - for (; pos < max; pos++) { - code = state.src.charCodeAt(pos); - if (!isSpace(code) && code !== 0x0A) { break; } - } - } else { - title = ''; - } - - if (pos >= max || state.src.charCodeAt(pos) !== 0x29/* ) */) { - state.pos = oldPos; - return false; - } - pos++; - } else { - // - // Link reference - // - if (typeof state.env.references === 'undefined') { return false; } - - if (pos < max && state.src.charCodeAt(pos) === 0x5B/* [ */) { - start = pos + 1; - pos = state.md.helpers.parseLinkLabel(state, pos); - if (pos >= 0) { - label = state.src.slice(start, pos++); - } else { - pos = labelEnd + 1; - } - } else { - pos = labelEnd + 1; - } - - // covers label === '' and label === undefined - // (collapsed reference link and shortcut reference link respectively) - if (!label) { label = state.src.slice(labelStart, labelEnd); } - - ref = state.env.references[normalizeReference(label)]; - if (!ref) { - state.pos = oldPos; - return false; - } - href = ref.href; - title = ref.title; - } - - // - // We found the end of the link, and know for a fact it's a valid link; - // so all that's left to do is to call tokenizer. - // - if (!silent) { - content = state.src.slice(labelStart, labelEnd); - - state.md.inline.parse( - content, - state.md, - state.env, - tokens = [] - ); - - token = state.push('image', 'img', 0); - token.attrs = attrs = [ [ 'src', href ], [ 'alt', '' ] ]; - token.children = tokens; - token.content = content; - - if (title) { - attrs.push([ 'title', title ]); - } - } - - state.pos = pos; - state.posMax = max; - return true; -}; - - -/***/ }), -/* 95 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Process autolinks '' - - - - -/*eslint max-len:0*/ -var EMAIL_RE = /^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/; -var AUTOLINK_RE = /^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/; - - -module.exports = function autolink(state, silent) { - var tail, linkMatch, emailMatch, url, fullUrl, token, - pos = state.pos; - - if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; } - - tail = state.src.slice(pos); - - if (tail.indexOf('>') < 0) { return false; } - - if (AUTOLINK_RE.test(tail)) { - linkMatch = tail.match(AUTOLINK_RE); - - url = linkMatch[0].slice(1, -1); - fullUrl = state.md.normalizeLink(url); - if (!state.md.validateLink(fullUrl)) { return false; } - - if (!silent) { - token = state.push('link_open', 'a', 1); - token.attrs = [ [ 'href', fullUrl ] ]; - token.markup = 'autolink'; - token.info = 'auto'; - - token = state.push('text', '', 0); - token.content = state.md.normalizeLinkText(url); - - token = state.push('link_close', 'a', -1); - token.markup = 'autolink'; - token.info = 'auto'; - } - - state.pos += linkMatch[0].length; - return true; - } - - if (EMAIL_RE.test(tail)) { - emailMatch = tail.match(EMAIL_RE); - - url = emailMatch[0].slice(1, -1); - fullUrl = state.md.normalizeLink('mailto:' + url); - if (!state.md.validateLink(fullUrl)) { return false; } - - if (!silent) { - token = state.push('link_open', 'a', 1); - token.attrs = [ [ 'href', fullUrl ] ]; - token.markup = 'autolink'; - token.info = 'auto'; - - token = state.push('text', '', 0); - token.content = state.md.normalizeLinkText(url); - - token = state.push('link_close', 'a', -1); - token.markup = 'autolink'; - token.info = 'auto'; - } - - state.pos += emailMatch[0].length; - return true; - } - - return false; -}; - - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Process html tags - - - - -var HTML_TAG_RE = __webpack_require__(83).HTML_TAG_RE; - - -function isLetter(ch) { - /*eslint no-bitwise:0*/ - var lc = ch | 0x20; // to lower case - return (lc >= 0x61/* a */) && (lc <= 0x7a/* z */); -} - - -module.exports = function html_inline(state, silent) { - var ch, match, max, token, - pos = state.pos; - - if (!state.md.options.html) { return false; } - - // Check start - max = state.posMax; - if (state.src.charCodeAt(pos) !== 0x3C/* < */ || - pos + 2 >= max) { - return false; - } - - // Quick fail on second char - ch = state.src.charCodeAt(pos + 1); - if (ch !== 0x21/* ! */ && - ch !== 0x3F/* ? */ && - ch !== 0x2F/* / */ && - !isLetter(ch)) { - return false; - } - - match = state.src.slice(pos).match(HTML_TAG_RE); - if (!match) { return false; } - - if (!silent) { - token = state.push('html_inline', '', 0); - token.content = state.src.slice(pos, pos + match[0].length); - } - state.pos += match[0].length; - return true; -}; - - -/***/ }), -/* 97 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Process html entity - {, ¯, ", ... - - - -var entities = __webpack_require__(43); -var has = __webpack_require__(42).has; -var isValidEntityCode = __webpack_require__(42).isValidEntityCode; -var fromCodePoint = __webpack_require__(42).fromCodePoint; - - -var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i; -var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i; - - -module.exports = function entity(state, silent) { - var ch, code, match, pos = state.pos, max = state.posMax; - - if (state.src.charCodeAt(pos) !== 0x26/* & */) { return false; } - - if (pos + 1 < max) { - ch = state.src.charCodeAt(pos + 1); - - if (ch === 0x23 /* # */) { - match = state.src.slice(pos).match(DIGITAL_RE); - if (match) { - if (!silent) { - code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10); - state.pending += isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD); - } - state.pos += match[0].length; - return true; - } - } else { - match = state.src.slice(pos).match(NAMED_RE); - if (match) { - if (has(entities, match[1])) { - if (!silent) { state.pending += entities[match[1]]; } - state.pos += match[0].length; - return true; - } - } - } - } - - if (!silent) { state.pending += '&'; } - state.pos++; - return true; -}; - - -/***/ }), -/* 98 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// For each opening emphasis-like marker find a matching closing one -// - - - -function processDelimiters(state, delimiters) { - var closerIdx, openerIdx, closer, opener, minOpenerIdx, newMinOpenerIdx, - isOddMatch, lastJump, - openersBottom = {}, - max = delimiters.length; - - for (closerIdx = 0; closerIdx < max; closerIdx++) { - closer = delimiters[closerIdx]; - - // Length is only used for emphasis-specific "rule of 3", - // if it's not defined (in strikethrough or 3rd party plugins), - // we can default it to 0 to disable those checks. - // - closer.length = closer.length || 0; - - if (!closer.close) continue; - - // Previously calculated lower bounds (previous fails) - // for each marker and each delimiter length modulo 3. - if (!openersBottom.hasOwnProperty(closer.marker)) { - openersBottom[closer.marker] = [ -1, -1, -1 ]; - } - - minOpenerIdx = openersBottom[closer.marker][closer.length % 3]; - newMinOpenerIdx = -1; - - openerIdx = closerIdx - closer.jump - 1; - - for (; openerIdx > minOpenerIdx; openerIdx -= opener.jump + 1) { - opener = delimiters[openerIdx]; - - if (opener.marker !== closer.marker) continue; - - if (newMinOpenerIdx === -1) newMinOpenerIdx = openerIdx; - - if (opener.open && - opener.end < 0 && - opener.level === closer.level) { - - isOddMatch = false; - - // from spec: - // - // If one of the delimiters can both open and close emphasis, then the - // sum of the lengths of the delimiter runs containing the opening and - // closing delimiters must not be a multiple of 3 unless both lengths - // are multiples of 3. - // - if (opener.close || closer.open) { - if ((opener.length + closer.length) % 3 === 0) { - if (opener.length % 3 !== 0 || closer.length % 3 !== 0) { - isOddMatch = true; - } - } - } - - if (!isOddMatch) { - // If previous delimiter cannot be an opener, we can safely skip - // the entire sequence in future checks. This is required to make - // sure algorithm has linear complexity (see *_*_*_*_*_... case). - // - lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? - delimiters[openerIdx - 1].jump + 1 : - 0; - - closer.jump = closerIdx - openerIdx + lastJump; - closer.open = false; - opener.end = closerIdx; - opener.jump = lastJump; - opener.close = false; - newMinOpenerIdx = -1; - break; - } - } - } - - if (newMinOpenerIdx !== -1) { - // If match for this delimiter run failed, we want to set lower bound for - // future lookups. This is required to make sure algorithm has linear - // complexity. - // - // See details here: - // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442 - // - openersBottom[closer.marker][(closer.length || 0) % 3] = newMinOpenerIdx; - } - } -} - - -module.exports = function link_pairs(state) { - var curr, - tokens_meta = state.tokens_meta, - max = state.tokens_meta.length; - - processDelimiters(state, state.delimiters); - - for (curr = 0; curr < max; curr++) { - if (tokens_meta[curr] && tokens_meta[curr].delimiters) { - processDelimiters(state, tokens_meta[curr].delimiters); - } - } -}; - - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Clean up tokens after emphasis and strikethrough postprocessing: -// merge adjacent text nodes into one and re-calculate all token levels -// -// This is necessary because initially emphasis delimiter markers (*, _, ~) -// are treated as their own separate text tokens. Then emphasis rule either -// leaves them as text (needed to merge with adjacent text) or turns them -// into opening/closing tags (which messes up levels inside). -// - - - -module.exports = function text_collapse(state) { - var curr, last, - level = 0, - tokens = state.tokens, - max = state.tokens.length; - - for (curr = last = 0; curr < max; curr++) { - // re-calculate levels after emphasis/strikethrough turns some text nodes - // into opening/closing tags - if (tokens[curr].nesting < 0) level--; // closing tag - tokens[curr].level = level; - if (tokens[curr].nesting > 0) level++; // opening tag - - if (tokens[curr].type === 'text' && - curr + 1 < max && - tokens[curr + 1].type === 'text') { - - // collapse two adjacent text nodes - tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; - } else { - if (curr !== last) { tokens[last] = tokens[curr]; } - - last++; - } - } - - if (curr !== last) { - tokens.length = last; - } -}; - - -/***/ }), -/* 100 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Inline parser state - - - - -var Token = __webpack_require__(70); -var isWhiteSpace = __webpack_require__(42).isWhiteSpace; -var isPunctChar = __webpack_require__(42).isPunctChar; -var isMdAsciiPunct = __webpack_require__(42).isMdAsciiPunct; - - -function StateInline(src, md, env, outTokens) { - this.src = src; - this.env = env; - this.md = md; - this.tokens = outTokens; - this.tokens_meta = Array(outTokens.length); - - this.pos = 0; - this.posMax = this.src.length; - this.level = 0; - this.pending = ''; - this.pendingLevel = 0; - - // Stores { start: end } pairs. Useful for backtrack - // optimization of pairs parse (emphasis, strikes). - this.cache = {}; - - // List of emphasis-like delimiters for current tag - this.delimiters = []; - - // Stack of delimiter lists for upper level tags - this._prev_delimiters = []; -} - - -// Flush pending text -// -StateInline.prototype.pushPending = function () { - var token = new Token('text', '', 0); - token.content = this.pending; - token.level = this.pendingLevel; - this.tokens.push(token); - this.pending = ''; - return token; -}; - - -// Push new token to "stream". -// If pending text exists - flush it as text token -// -StateInline.prototype.push = function (type, tag, nesting) { - if (this.pending) { - this.pushPending(); - } - - var token = new Token(type, tag, nesting); - var token_meta = null; - - if (nesting < 0) { - // closing tag - this.level--; - this.delimiters = this._prev_delimiters.pop(); - } - - token.level = this.level; - - if (nesting > 0) { - // opening tag - this.level++; - this._prev_delimiters.push(this.delimiters); - this.delimiters = []; - token_meta = { delimiters: this.delimiters }; - } - - this.pendingLevel = this.level; - this.tokens.push(token); - this.tokens_meta.push(token_meta); - return token; -}; - - -// Scan a sequence of emphasis-like markers, and determine whether -// it can start an emphasis sequence or end an emphasis sequence. -// -// - start - position to scan from (it should point at a valid marker); -// - canSplitWord - determine if these markers can be found inside a word -// -StateInline.prototype.scanDelims = function (start, canSplitWord) { - var pos = start, lastChar, nextChar, count, can_open, can_close, - isLastWhiteSpace, isLastPunctChar, - isNextWhiteSpace, isNextPunctChar, - left_flanking = true, - right_flanking = true, - max = this.posMax, - marker = this.src.charCodeAt(start); - - // treat beginning of the line as a whitespace - lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20; - - while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; } - - count = pos - start; - - // treat end of the line as a whitespace - nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20; - - isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); - isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); - - isLastWhiteSpace = isWhiteSpace(lastChar); - isNextWhiteSpace = isWhiteSpace(nextChar); - - if (isNextWhiteSpace) { - left_flanking = false; - } else if (isNextPunctChar) { - if (!(isLastWhiteSpace || isLastPunctChar)) { - left_flanking = false; - } - } - - if (isLastWhiteSpace) { - right_flanking = false; - } else if (isLastPunctChar) { - if (!(isNextWhiteSpace || isNextPunctChar)) { - right_flanking = false; - } - } - - if (!canSplitWord) { - can_open = left_flanking && (!right_flanking || isLastPunctChar); - can_close = right_flanking && (!left_flanking || isNextPunctChar); - } else { - can_open = left_flanking; - can_close = right_flanking; - } - - return { - can_open: can_open, - can_close: can_close, - length: count - }; -}; - - -// re-export Token class to use in block rules -StateInline.prototype.Token = Token; - - -module.exports = StateInline; - - -/***/ }), -/* 101 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - - -//////////////////////////////////////////////////////////////////////////////// -// Helpers - -// Merge objects -// -function assign(obj /*from1, from2, from3, ...*/) { - var sources = Array.prototype.slice.call(arguments, 1); - - sources.forEach(function (source) { - if (!source) { return; } - - Object.keys(source).forEach(function (key) { - obj[key] = source[key]; - }); - }); - - return obj; -} - -function _class(obj) { return Object.prototype.toString.call(obj); } -function isString(obj) { return _class(obj) === '[object String]'; } -function isObject(obj) { return _class(obj) === '[object Object]'; } -function isRegExp(obj) { return _class(obj) === '[object RegExp]'; } -function isFunction(obj) { return _class(obj) === '[object Function]'; } - - -function escapeRE(str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); } - -//////////////////////////////////////////////////////////////////////////////// - - -var defaultOptions = { - fuzzyLink: true, - fuzzyEmail: true, - fuzzyIP: false -}; - - -function isOptionsObj(obj) { - return Object.keys(obj || {}).reduce(function (acc, k) { - return acc || defaultOptions.hasOwnProperty(k); - }, false); -} - - -var defaultSchemas = { - 'http:': { - validate: function (text, pos, self) { - var tail = text.slice(pos); - - if (!self.re.http) { - // compile lazily, because "host"-containing variables can change on tlds update. - self.re.http = new RegExp( - '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i' - ); - } - if (self.re.http.test(tail)) { - return tail.match(self.re.http)[0].length; - } - return 0; - } - }, - 'https:': 'http:', - 'ftp:': 'http:', - '//': { - validate: function (text, pos, self) { - var tail = text.slice(pos); - - if (!self.re.no_http) { - // compile lazily, because "host"-containing variables can change on tlds update. - self.re.no_http = new RegExp( - '^' + - self.re.src_auth + - // Don't allow single-level domains, because of false positives like '//test' - // with code comments - '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' + - self.re.src_port + - self.re.src_host_terminator + - self.re.src_path, - - 'i' - ); - } - - if (self.re.no_http.test(tail)) { - // should not be `://` & `///`, that protects from errors in protocol name - if (pos >= 3 && text[pos - 3] === ':') { return 0; } - if (pos >= 3 && text[pos - 3] === '/') { return 0; } - return tail.match(self.re.no_http)[0].length; - } - return 0; - } - }, - 'mailto:': { - validate: function (text, pos, self) { - var tail = text.slice(pos); - - if (!self.re.mailto) { - self.re.mailto = new RegExp( - '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i' - ); - } - if (self.re.mailto.test(tail)) { - return tail.match(self.re.mailto)[0].length; - } - return 0; - } - } -}; - -/*eslint-disable max-len*/ - -// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js) -var tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]'; - -// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead -var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|'); - -/*eslint-enable max-len*/ - -//////////////////////////////////////////////////////////////////////////////// - -function resetScanCache(self) { - self.__index__ = -1; - self.__text_cache__ = ''; -} - -function createValidator(re) { - return function (text, pos) { - var tail = text.slice(pos); - - if (re.test(tail)) { - return tail.match(re)[0].length; - } - return 0; - }; -} - -function createNormalizer() { - return function (match, self) { - self.normalize(match); - }; -} - -// Schemas compiler. Build regexps. -// -function compile(self) { - - // Load & clone RE patterns. - var re = self.re = __webpack_require__(102)(self.__opts__); - - // Define dynamic patterns - var tlds = self.__tlds__.slice(); - - self.onCompile(); - - if (!self.__tlds_replaced__) { - tlds.push(tlds_2ch_src_re); - } - tlds.push(re.src_xn); - - re.src_tlds = tlds.join('|'); - - function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); } - - re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i'); - re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i'); - re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i'); - re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i'); - - // - // Compile each schema - // - - var aliases = []; - - self.__compiled__ = {}; // Reset compiled data - - function schemaError(name, val) { - throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val); - } - - Object.keys(self.__schemas__).forEach(function (name) { - var val = self.__schemas__[name]; - - // skip disabled methods - if (val === null) { return; } - - var compiled = { validate: null, link: null }; - - self.__compiled__[name] = compiled; - - if (isObject(val)) { - if (isRegExp(val.validate)) { - compiled.validate = createValidator(val.validate); - } else if (isFunction(val.validate)) { - compiled.validate = val.validate; - } else { - schemaError(name, val); - } - - if (isFunction(val.normalize)) { - compiled.normalize = val.normalize; - } else if (!val.normalize) { - compiled.normalize = createNormalizer(); - } else { - schemaError(name, val); - } - - return; - } - - if (isString(val)) { - aliases.push(name); - return; - } - - schemaError(name, val); - }); - - // - // Compile postponed aliases - // - - aliases.forEach(function (alias) { - if (!self.__compiled__[self.__schemas__[alias]]) { - // Silently fail on missed schemas to avoid errons on disable. - // schemaError(alias, self.__schemas__[alias]); - return; - } - - self.__compiled__[alias].validate = - self.__compiled__[self.__schemas__[alias]].validate; - self.__compiled__[alias].normalize = - self.__compiled__[self.__schemas__[alias]].normalize; - }); - - // - // Fake record for guessed links - // - self.__compiled__[''] = { validate: null, normalize: createNormalizer() }; - - // - // Build schema condition - // - var slist = Object.keys(self.__compiled__) - .filter(function (name) { - // Filter disabled & fake schemas - return name.length > 0 && self.__compiled__[name]; - }) - .map(escapeRE) - .join('|'); - // (?!_) cause 1.5x slowdown - self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i'); - self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig'); - - self.re.pretest = RegExp( - '(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@', - 'i' - ); - - // - // Cleanup - // - - resetScanCache(self); -} - -/** - * class Match - * - * Match result. Single element of array, returned by [[LinkifyIt#match]] - **/ -function Match(self, shift) { - var start = self.__index__, - end = self.__last_index__, - text = self.__text_cache__.slice(start, end); - - /** - * Match#schema -> String - * - * Prefix (protocol) for matched string. - **/ - this.schema = self.__schema__.toLowerCase(); - /** - * Match#index -> Number - * - * First position of matched string. - **/ - this.index = start + shift; - /** - * Match#lastIndex -> Number - * - * Next position after matched string. - **/ - this.lastIndex = end + shift; - /** - * Match#raw -> String - * - * Matched string. - **/ - this.raw = text; - /** - * Match#text -> String - * - * Notmalized text of matched string. - **/ - this.text = text; - /** - * Match#url -> String - * - * Normalized url of matched string. - **/ - this.url = text; -} - -function createMatch(self, shift) { - var match = new Match(self, shift); - - self.__compiled__[match.schema].normalize(match, self); - - return match; -} - - -/** - * class LinkifyIt - **/ - -/** - * new LinkifyIt(schemas, options) - * - schemas (Object): Optional. Additional schemas to validate (prefix/validator) - * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } - * - * Creates new linkifier instance with optional additional schemas. - * Can be called without `new` keyword for convenience. - * - * By default understands: - * - * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links - * - "fuzzy" links and emails (example.com, foo@bar.com). - * - * `schemas` is an object, where each key/value describes protocol/rule: - * - * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:` - * for example). `linkify-it` makes shure that prefix is not preceeded with - * alphanumeric char and symbols. Only whitespaces and punctuation allowed. - * - __value__ - rule to check tail after link prefix - * - _String_ - just alias to existing rule - * - _Object_ - * - _validate_ - validator function (should return matched length on success), - * or `RegExp`. - * - _normalize_ - optional function to normalize text & url of matched result - * (for example, for @twitter mentions). - * - * `options`: - * - * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`. - * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts - * like version numbers. Default `false`. - * - __fuzzyEmail__ - recognize emails without `mailto:` prefix. - * - **/ -function LinkifyIt(schemas, options) { - if (!(this instanceof LinkifyIt)) { - return new LinkifyIt(schemas, options); - } - - if (!options) { - if (isOptionsObj(schemas)) { - options = schemas; - schemas = {}; - } - } - - this.__opts__ = assign({}, defaultOptions, options); - - // Cache last tested result. Used to skip repeating steps on next `match` call. - this.__index__ = -1; - this.__last_index__ = -1; // Next scan position - this.__schema__ = ''; - this.__text_cache__ = ''; - - this.__schemas__ = assign({}, defaultSchemas, schemas); - this.__compiled__ = {}; - - this.__tlds__ = tlds_default; - this.__tlds_replaced__ = false; - - this.re = {}; - - compile(this); -} - - -/** chainable - * LinkifyIt#add(schema, definition) - * - schema (String): rule name (fixed pattern prefix) - * - definition (String|RegExp|Object): schema definition - * - * Add new rule definition. See constructor description for details. - **/ -LinkifyIt.prototype.add = function add(schema, definition) { - this.__schemas__[schema] = definition; - compile(this); - return this; -}; - - -/** chainable - * LinkifyIt#set(options) - * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } - * - * Set recognition options for links without schema. - **/ -LinkifyIt.prototype.set = function set(options) { - this.__opts__ = assign(this.__opts__, options); - return this; -}; - - -/** - * LinkifyIt#test(text) -> Boolean - * - * Searches linkifiable pattern and returns `true` on success or `false` on fail. - **/ -LinkifyIt.prototype.test = function test(text) { - // Reset scan cache - this.__text_cache__ = text; - this.__index__ = -1; - - if (!text.length) { return false; } - - var m, ml, me, len, shift, next, re, tld_pos, at_pos; - - // try to scan for link with schema - that's the most simple rule - if (this.re.schema_test.test(text)) { - re = this.re.schema_search; - re.lastIndex = 0; - while ((m = re.exec(text)) !== null) { - len = this.testSchemaAt(text, m[2], re.lastIndex); - if (len) { - this.__schema__ = m[2]; - this.__index__ = m.index + m[1].length; - this.__last_index__ = m.index + m[0].length + len; - break; - } - } - } - - if (this.__opts__.fuzzyLink && this.__compiled__['http:']) { - // guess schemaless links - tld_pos = text.search(this.re.host_fuzzy_test); - if (tld_pos >= 0) { - // if tld is located after found link - no need to check fuzzy pattern - if (this.__index__ < 0 || tld_pos < this.__index__) { - if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) { - - shift = ml.index + ml[1].length; - - if (this.__index__ < 0 || shift < this.__index__) { - this.__schema__ = ''; - this.__index__ = shift; - this.__last_index__ = ml.index + ml[0].length; - } - } - } - } - } - - if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) { - // guess schemaless emails - at_pos = text.indexOf('@'); - if (at_pos >= 0) { - // We can't skip this check, because this cases are possible: - // 192.168.1.1@gmail.com, my.in@example.com - if ((me = text.match(this.re.email_fuzzy)) !== null) { - - shift = me.index + me[1].length; - next = me.index + me[0].length; - - if (this.__index__ < 0 || shift < this.__index__ || - (shift === this.__index__ && next > this.__last_index__)) { - this.__schema__ = 'mailto:'; - this.__index__ = shift; - this.__last_index__ = next; - } - } - } - } - - return this.__index__ >= 0; -}; - - -/** - * LinkifyIt#pretest(text) -> Boolean - * - * Very quick check, that can give false positives. Returns true if link MAY BE - * can exists. Can be used for speed optimization, when you need to check that - * link NOT exists. - **/ -LinkifyIt.prototype.pretest = function pretest(text) { - return this.re.pretest.test(text); -}; - - -/** - * LinkifyIt#testSchemaAt(text, name, position) -> Number - * - text (String): text to scan - * - name (String): rule (schema) name - * - position (Number): text offset to check from - * - * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly - * at given position. Returns length of found pattern (0 on fail). - **/ -LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) { - // If not supported schema check requested - terminate - if (!this.__compiled__[schema.toLowerCase()]) { - return 0; - } - return this.__compiled__[schema.toLowerCase()].validate(text, pos, this); -}; - - -/** - * LinkifyIt#match(text) -> Array|null - * - * Returns array of found link descriptions or `null` on fail. We strongly - * recommend to use [[LinkifyIt#test]] first, for best speed. - * - * ##### Result match description - * - * - __schema__ - link schema, can be empty for fuzzy links, or `//` for - * protocol-neutral links. - * - __index__ - offset of matched text - * - __lastIndex__ - index of next char after mathch end - * - __raw__ - matched text - * - __text__ - normalized text - * - __url__ - link, generated from matched text - **/ -LinkifyIt.prototype.match = function match(text) { - var shift = 0, result = []; - - // Try to take previous element from cache, if .test() called before - if (this.__index__ >= 0 && this.__text_cache__ === text) { - result.push(createMatch(this, shift)); - shift = this.__last_index__; - } - - // Cut head if cache was used - var tail = shift ? text.slice(shift) : text; - - // Scan string until end reached - while (this.test(tail)) { - result.push(createMatch(this, shift)); - - tail = tail.slice(this.__last_index__); - shift += this.__last_index__; - } - - if (result.length) { - return result; - } - - return null; -}; - - -/** chainable - * LinkifyIt#tlds(list [, keepOld]) -> this - * - list (Array): list of tlds - * - keepOld (Boolean): merge with current list if `true` (`false` by default) - * - * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix) - * to avoid false positives. By default this algorythm used: - * - * - hostname with any 2-letter root zones are ok. - * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф - * are ok. - * - encoded (`xn--...`) root zones are ok. - * - * If list is replaced, then exact match for 2-chars root zones will be checked. - **/ -LinkifyIt.prototype.tlds = function tlds(list, keepOld) { - list = Array.isArray(list) ? list : [ list ]; - - if (!keepOld) { - this.__tlds__ = list.slice(); - this.__tlds_replaced__ = true; - compile(this); - return this; - } - - this.__tlds__ = this.__tlds__.concat(list) - .sort() - .filter(function (el, idx, arr) { - return el !== arr[idx - 1]; - }) - .reverse(); - - compile(this); - return this; -}; - -/** - * LinkifyIt#normalize(match) - * - * Default normalizer (if schema does not define it's own). - **/ -LinkifyIt.prototype.normalize = function normalize(match) { - - // Do minimal possible changes by default. Need to collect feedback prior - // to move forward https://github.com/markdown-it/linkify-it/issues/1 - - if (!match.schema) { match.url = 'http://' + match.url; } - - if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) { - match.url = 'mailto:' + match.url; - } -}; - - -/** - * LinkifyIt#onCompile() - * - * Override to modify basic RegExp-s. - **/ -LinkifyIt.prototype.onCompile = function onCompile() { -}; - - -module.exports = LinkifyIt; - - -/***/ }), -/* 102 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - - -module.exports = function (opts) { - var re = {}; - - // Use direct extract instead of `regenerate` to reduse browserified size - re.src_Any = __webpack_require__(52).source; - re.src_Cc = __webpack_require__(53).source; - re.src_Z = __webpack_require__(55).source; - re.src_P = __webpack_require__(45).source; - - // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation) - re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join('|'); - - // \p{\Z\Cc} (white spaces + control) - re.src_ZCc = [ re.src_Z, re.src_Cc ].join('|'); - - // Experimental. List of chars, completely prohibited in links - // because can separate it from other part of text - var text_separators = '[><\uff5c]'; - - // All possible word characters (everything without punctuation, spaces & controls) - // Defined via punctuation & spaces to save space - // Should be something like \p{\L\N\S\M} (\w but without `_`) - re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')'; - // The same as abothe but without [0-9] - // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')'; - - //////////////////////////////////////////////////////////////////////////////// - - re.src_ip4 = - - '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'; - - // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch. - re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?'; - - re.src_port = - - '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?'; - - re.src_host_terminator = - - '(?=$|' + text_separators + '|' + re.src_ZPCc + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))'; - - re.src_path = - - '(?:' + - '[/?#]' + - '(?:' + - '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-]).|' + - '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' + - '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' + - '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' + - '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' + - "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" + - "\\'(?=" + re.src_pseudo_letter + '|[-]).|' + // allow `I'm_king` if no pair found - '\\.{2,4}[a-zA-Z0-9%/]|' + // github has ... in commit range links, - // google has .... in links (issue #66) - // Restrict to - // - english - // - percent-encoded - // - parts of file path - // until more examples found. - '\\.(?!' + re.src_ZCc + '|[.]).|' + - (opts && opts['---'] ? - '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate - : - '\\-+|' - ) + - '\\,(?!' + re.src_ZCc + ').|' + // allow `,,,` in paths - '\\!(?!' + re.src_ZCc + '|[!]).|' + - '\\?(?!' + re.src_ZCc + '|[?]).' + - ')+' + - '|\\/' + - ')?'; - - // Allow anything in markdown spec, forbid quote (") at the first position - // because emails enclosed in quotes are far more common - re.src_email_name = - - '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*'; - - re.src_xn = - - 'xn--[a-z0-9\\-]{1,59}'; - - // More to read about domain names - // http://serverfault.com/questions/638260/ - - re.src_domain_root = - - // Allow letters & digits (http://test1) - '(?:' + - re.src_xn + - '|' + - re.src_pseudo_letter + '{1,63}' + - ')'; - - re.src_domain = - - '(?:' + - re.src_xn + - '|' + - '(?:' + re.src_pseudo_letter + ')' + - '|' + - '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' + - ')'; - - re.src_host = - - '(?:' + - // Don't need IP check, because digits are already allowed in normal domain names - // src_ip4 + - // '|' + - '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain/*_root*/ + ')' + - ')'; - - re.tpl_host_fuzzy = - - '(?:' + - re.src_ip4 + - '|' + - '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' + - ')'; - - re.tpl_host_no_ip_fuzzy = - - '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))'; - - re.src_host_strict = - - re.src_host + re.src_host_terminator; - - re.tpl_host_fuzzy_strict = - - re.tpl_host_fuzzy + re.src_host_terminator; - - re.src_host_port_strict = - - re.src_host + re.src_port + re.src_host_terminator; - - re.tpl_host_port_fuzzy_strict = - - re.tpl_host_fuzzy + re.src_port + re.src_host_terminator; - - re.tpl_host_port_no_ip_fuzzy_strict = - - re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator; - - - //////////////////////////////////////////////////////////////////////////////// - // Main rules - - // Rude test fuzzy links by host, for quick deny - re.tpl_host_fuzzy_test = - - 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))'; - - re.tpl_email_fuzzy = - - '(^|' + text_separators + '|"|\\(|' + re.src_ZCc + ')' + - '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')'; - - re.tpl_link_fuzzy = - // Fuzzy link can't be prepended with .:/\- and non punctuation. - // but can start with > (markdown blockquote) - '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + - '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')'; - - re.tpl_link_no_ip_fuzzy = - // Fuzzy link can't be prepended with .:/\- and non punctuation. - // but can start with > (markdown blockquote) - '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + - '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')'; - - return re; -}; - - -/***/ }), -/* 103 */ -/***/ (function(module, exports) { - -module.exports = require("punycode"); - -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// markdown-it default options - - - - -module.exports = { - options: { - html: false, // Enable HTML tags in source - xhtmlOut: false, // Use '/' to close single tags (
) - breaks: false, // Convert '\n' in paragraphs into
- langPrefix: 'language-', // CSS language prefix for fenced blocks - linkify: false, // autoconvert URL-like texts to links - - // Enable some language-neutral replacements + quotes beautification - typographer: false, - - // Double + single quotes replacement pairs, when typographer enabled, - // and smartquotes on. Could be either a String or an Array. - // - // For example, you can use '«»„“' for Russian, '„“‚‘' for German, - // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). - quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */ - - // Highlighter function. Should return escaped HTML, - // or '' if the source string is not changed and should be escaped externaly. - // If result starts with ) - breaks: false, // Convert '\n' in paragraphs into
- langPrefix: 'language-', // CSS language prefix for fenced blocks - linkify: false, // autoconvert URL-like texts to links - - // Enable some language-neutral replacements + quotes beautification - typographer: false, - - // Double + single quotes replacement pairs, when typographer enabled, - // and smartquotes on. Could be either a String or an Array. - // - // For example, you can use '«»„“' for Russian, '„“‚‘' for German, - // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). - quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */ - - // Highlighter function. Should return escaped HTML, - // or '' if the source string is not changed and should be escaped externaly. - // If result starts with ) - breaks: false, // Convert '\n' in paragraphs into
- langPrefix: 'language-', // CSS language prefix for fenced blocks - linkify: false, // autoconvert URL-like texts to links - - // Enable some language-neutral replacements + quotes beautification - typographer: false, - - // Double + single quotes replacement pairs, when typographer enabled, - // and smartquotes on. Could be either a String or an Array. - // - // For example, you can use '«»„“' for Russian, '„“‚‘' for German, - // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). - quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */ - - // Highlighter function. Should return escaped HTML, - // or '' if the source string is not changed and should be escaped externaly. - // If result starts with { - const name = rule.names[0].toLowerCase(); - rule.information = - new URL(`${homepage}/blob/v${version}/doc/Rules.md#${name}`); -}); -module.exports = rules; - - -/***/ }), -/* 108 */ -/***/ (function(module) { - -module.exports = JSON.parse("{\"name\":\"markdownlint\",\"version\":\"0.20.4\",\"description\":\"A Node.js style checker and lint tool for Markdown/CommonMark files.\",\"main\":\"lib/markdownlint.js\",\"types\":\"lib/markdownlint.d.ts\",\"author\":\"David Anson (https://dlaa.me/)\",\"license\":\"MIT\",\"homepage\":\"https://github.com/DavidAnson/markdownlint\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/DavidAnson/markdownlint.git\"},\"bugs\":\"https://github.com/DavidAnson/markdownlint/issues\",\"scripts\":{\"test\":\"node test/markdownlint-test.js\",\"test-cover\":\"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 node test/markdownlint-test.js\",\"test-declaration\":\"cd example/typescript && tsc && node type-check.js\",\"test-extra\":\"node test/markdownlint-test-extra.js\",\"debug\":\"node debug node_modules/nodeunit/bin/nodeunit\",\"lint\":\"eslint --max-warnings 0 lib helpers test schema && eslint --env browser --global markdownit --global markdownlint --rule \\\"no-unused-vars: 0, no-extend-native: 0, max-statements: 0, no-console: 0, no-var: 0\\\" demo && eslint --rule \\\"no-console: 0, no-invalid-this: 0, no-shadow: 0, object-property-newline: 0\\\" example\",\"ci\":\"npm run test-cover && npm run lint && npm run test-declaration\",\"build-config-schema\":\"node schema/build-config-schema.js\",\"build-declaration\":\"tsc --allowJs --declaration --outDir declaration --resolveJsonModule lib/markdownlint.js && cpy declaration/lib/markdownlint.d.ts lib && rimraf declaration\",\"build-demo\":\"cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && cpy file-header.js . --rename=markdownlint-browser.js && tsc --allowJs --resolveJsonModule --outDir ../lib-es3 ../lib/markdownlint.js && cpy ../helpers/package.json ../lib-es3/helpers && browserify ../lib-es3/lib/markdownlint.js --standalone markdownlint >> markdownlint-browser.js && uglifyjs markdownlint-browser.js --compress --mangle --comments --output markdownlint-browser.min.js\",\"build-example\":\"npm install --no-save --ignore-scripts grunt grunt-cli gulp through2\",\"example\":\"cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint\",\"clone-test-repos\":\"make-dir test-repos && cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet\",\"clone-test-repos-large\":\"npm run clone-test-repos && cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet\",\"lint-test-repos\":\"node test/markdownlint-test-repos.js\",\"clean-test-repos\":\"rimraf test-repos\"},\"engines\":{\"node\":\">=10\"},\"dependencies\":{\"markdown-it\":\"10.0.0\"},\"devDependencies\":{\"@types/node\":\"~13.11.1\",\"browserify\":\"~16.5.1\",\"c8\":\"~7.1.2\",\"cpy-cli\":\"~3.1.0\",\"eslint\":\"~6.8.0\",\"eslint-plugin-jsdoc\":\"~22.1.0\",\"globby\":\"~11.0.0\",\"js-yaml\":\"~3.13.1\",\"make-dir-cli\":\"~2.0.0\",\"markdown-it-for-inline\":\"~0.1.1\",\"markdown-it-katex\":\"~2.0.3\",\"markdown-it-sub\":\"~1.0.0\",\"markdown-it-sup\":\"~1.0.0\",\"markdownlint-rule-helpers\":\"~0.7.0\",\"rimraf\":\"~3.0.2\",\"strip-json-comments\":\"~3.1.0\",\"tape\":\"~4.13.2\",\"tape-player\":\"~0.1.0\",\"toml\":\"~3.0.0\",\"tv4\":\"~1.3.0\",\"typescript\":\"~3.8.3\",\"uglify-js\":\"~3.8.1\"},\"keywords\":[\"markdown\",\"lint\",\"md\",\"CommonMark\",\"markdownlint\"],\"browser\":{\"markdown-it\":\"../demo/markdown-it-stub.js\"}}"); - -/***/ }), -/* 109 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf, filterTokens } = __webpack_require__(110); - -module.exports = { - "names": [ "MD001", "heading-increment", "header-increment" ], - "description": "Heading levels should only increment by one level at a time", - "tags": [ "headings", "headers" ], - "function": function MD001(params, onError) { - let prevLevel = 0; - filterTokens(params, "heading_open", function forToken(token) { - const level = parseInt(token.tag.slice(1), 10); - if (prevLevel && (level > prevLevel)) { - addErrorDetailIf(onError, token.lineNumber, - "h" + (prevLevel + 1), "h" + level); - } - prevLevel = level; - }); - } -}; - - -/***/ }), -/* 110 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const os = __webpack_require__(111); - -// Regular expression for matching common newline characters -// See NEWLINES_RE in markdown-it/lib/rules_core/normalize.js -const newLineRe = /\r\n?|\n/g; -module.exports.newLineRe = newLineRe; - -// Regular expression for matching common front matter (YAML and TOML) -module.exports.frontMatterRe = - // eslint-disable-next-line max-len - /((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$))(\r\n|\r|\n|$)/m; - -// Regular expression for matching inline disable/enable comments -const inlineCommentRe = - // eslint-disable-next-line max-len - //ig; -module.exports.inlineCommentRe = inlineCommentRe; - -// Regular expressions for range matching -module.exports.bareUrlRe = /(?:http|ftp)s?:\/\/[^\s\]"']*(?:\/|[^\s\]"'\W])/ig; -module.exports.listItemMarkerRe = /^([\s>]*)(?:[*+-]|\d+[.)])\s+/; -module.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/; - -// Regular expression for all instances of emphasis markers -const emphasisMarkersRe = /[_*]/g; - -// Regular expression for inline links and shortcut reference links -const linkRe = /\[(?:[^[\]]|\[[^\]]*\])*\](?:\(\S*\))?/g; - -// readFile options for reading with the UTF-8 encoding -module.exports.utf8Encoding = { "encoding": "utf8" }; - -// All punctuation characters (normal and full-width) -module.exports.allPunctuation = ".,;:!?。,;:!?"; - -// Returns true iff the input is a number -module.exports.isNumber = function isNumber(obj) { - return typeof obj === "number"; -}; - -// Returns true iff the input is a string -module.exports.isString = function isString(obj) { - return typeof obj === "string"; -}; - -// Returns true iff the input string is empty -module.exports.isEmptyString = function isEmptyString(str) { - return str.length === 0; -}; - -// Returns true iff the input is an object -module.exports.isObject = function isObject(obj) { - return (obj !== null) && (typeof obj === "object") && !Array.isArray(obj); -}; - -// Returns true iff the input line is blank (no content) -// Example: Contains nothing, whitespace, or comments -const blankLineRe = />|(?:)/g; -module.exports.isBlankLine = function isBlankLine(line) { - return !line || !line.trim() || !line.replace(blankLineRe, "").trim(); -}; - -/** - * Compare function for Array.prototype.sort for ascending order of numbers. - * - * @param {number} a First number. - * @param {number} b Second number. - * @returns {number} Positive value if a>b, negative value if b> 1; - if (array[mid] < element) { - left = mid + 1; - } else if (array[mid] > element) { - right = mid - 1; - } else { - return true; - } - } - return false; -}; - -// Replaces the text of all properly-formatted HTML comments with whitespace -// This preserves the line/column information for the rest of the document -// Trailing whitespace is avoided with a '\' character in the last column -// See https://www.w3.org/TR/html5/syntax.html#comments for details -const htmlCommentBegin = ""; -module.exports.clearHtmlCommentText = function clearHtmlCommentText(text) { - let i = 0; - while ((i = text.indexOf(htmlCommentBegin, i)) !== -1) { - const j = text.indexOf(htmlCommentEnd, i); - if (j === -1) { - // Un-terminated comments are treated as text - break; - } - const comment = text.slice(i + htmlCommentBegin.length, j); - if ((comment.length > 0) && - (comment[0] !== ">") && - (comment[comment.length - 1] !== "-") && - !comment.includes("--") && - (text.slice(i, j + htmlCommentEnd.length) - .search(inlineCommentRe) === -1)) { - const blanks = comment - .replace(/[^\r\n]/g, " ") - .replace(/ ([\r\n])/g, "\\$1"); - text = text.slice(0, i + htmlCommentBegin.length) + - blanks + text.slice(j); - } - i = j + htmlCommentEnd.length; - } - return text; -}; - -// Escapes a string for use in a RegExp -module.exports.escapeForRegExp = function escapeForRegExp(str) { - return str.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"); -}; - -// Un-escapes Markdown content (simple algorithm; not a parser) -const escapedMarkdownRe = /\\./g; -module.exports.unescapeMarkdown = - function unescapeMarkdown(markdown, replacement) { - return markdown.replace(escapedMarkdownRe, (match) => { - const char = match[1]; - if ("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".includes(char)) { - return replacement || char; - } - return match; - }); - }; - -/** - * Return the string representation of a fence markup character. - * - * @param {string} markup Fence string. - * @returns {string} String representation. - */ -module.exports.fencedCodeBlockStyleFor = - function fencedCodeBlockStyleFor(markup) { - switch (markup[0]) { - case "~": - return "tilde"; - default: - return "backtick"; - } - }; - -/** - * Return the number of characters of indent for a token. - * - * @param {Object} token MarkdownItToken instance. - * @returns {number} Characters of indent. - */ -function indentFor(token) { - const line = token.line.replace(/^[\s>]*(> |>)/, ""); - return line.length - line.trimLeft().length; -} -module.exports.indentFor = indentFor; - -// Returns the heading style for a heading token -module.exports.headingStyleFor = function headingStyleFor(token) { - if ((token.map[1] - token.map[0]) === 1) { - if (/[^\\]#\s*$/.test(token.line)) { - return "atx_closed"; - } - return "atx"; - } - return "setext"; -}; - -/** - * Return the string representation of an unordered list marker. - * - * @param {Object} token MarkdownItToken instance. - * @returns {string} String representation. - */ -module.exports.unorderedListStyleFor = function unorderedListStyleFor(token) { - switch (token.markup) { - case "-": - return "dash"; - case "+": - return "plus"; - // case "*": - default: - return "asterisk"; - } -}; - -/** - * Calls the provided function for each matching token. - * - * @param {Object} params RuleParams instance. - * @param {string} type Token type identifier. - * @param {Function} handler Callback function. - * @returns {void} - */ -function filterTokens(params, type, handler) { - params.tokens.forEach(function forToken(token) { - if (token.type === type) { - handler(token); - } - }); -} -module.exports.filterTokens = filterTokens; - -// Get line metadata array -module.exports.getLineMetadata = function getLineMetadata(params) { - const lineMetadata = params.lines.map(function mapLine(line, index) { - return [ line, index, false, 0, false, false ]; - }); - filterTokens(params, "fence", function forToken(token) { - lineMetadata[token.map[0]][3] = 1; - lineMetadata[token.map[1] - 1][3] = -1; - for (let i = token.map[0] + 1; i < token.map[1] - 1; i++) { - lineMetadata[i][2] = true; - } - }); - filterTokens(params, "code_block", function forToken(token) { - for (let i = token.map[0]; i < token.map[1]; i++) { - lineMetadata[i][2] = true; - } - }); - filterTokens(params, "table_open", function forToken(token) { - for (let i = token.map[0]; i < token.map[1]; i++) { - lineMetadata[i][4] = true; - } - }); - filterTokens(params, "list_item_open", function forToken(token) { - let count = 1; - for (let i = token.map[0]; i < token.map[1]; i++) { - lineMetadata[i][5] = count; - count++; - } - }); - filterTokens(params, "hr", function forToken(token) { - lineMetadata[token.map[0]][6] = true; - }); - return lineMetadata; -}; - -// Calls the provided function for each line (with context) -module.exports.forEachLine = function forEachLine(lineMetadata, handler) { - lineMetadata.forEach(function forMetadata(metadata) { - // Parameters: line, lineIndex, inCode, onFence, inTable, inItem, inBreak - handler(...metadata); - }); -}; - -// Returns (nested) lists as a flat array (in order) -module.exports.flattenLists = function flattenLists(params) { - const flattenedLists = []; - const stack = []; - let current = null; - let nesting = 0; - const nestingStack = []; - let lastWithMap = { "map": [ 0, 1 ] }; - params.tokens.forEach(function forToken(token) { - if ((token.type === "bullet_list_open") || - (token.type === "ordered_list_open")) { - // Save current context and start a new one - stack.push(current); - current = { - "unordered": (token.type === "bullet_list_open"), - "parentsUnordered": !current || - (current.unordered && current.parentsUnordered), - "open": token, - "indent": indentFor(token), - "parentIndent": (current && current.indent) || 0, - "items": [], - "nesting": nesting, - "lastLineIndex": -1, - "insert": flattenedLists.length - }; - nesting++; - } else if ((token.type === "bullet_list_close") || - (token.type === "ordered_list_close")) { - // Finalize current context and restore previous - current.lastLineIndex = lastWithMap.map[1]; - flattenedLists.splice(current.insert, 0, current); - delete current.insert; - current = stack.pop(); - nesting--; - } else if (token.type === "list_item_open") { - // Add list item - current.items.push(token); - } else if (token.type === "blockquote_open") { - nestingStack.push(nesting); - nesting = 0; - } else if (token.type === "blockquote_close") { - nesting = nestingStack.pop(); - } else if (token.map) { - // Track last token with map - lastWithMap = token; - } - }); - return flattenedLists; -}; - -// Calls the provided function for each specified inline child token -module.exports.forEachInlineChild = -function forEachInlineChild(params, type, handler) { - filterTokens(params, "inline", function forToken(token) { - token.children.forEach(function forChild(child) { - if (child.type === type) { - handler(child, token); - } - }); - }); -}; - -// Calls the provided function for each heading's content -module.exports.forEachHeading = function forEachHeading(params, handler) { - let heading = null; - params.tokens.forEach(function forToken(token) { - if (token.type === "heading_open") { - heading = token; - } else if (token.type === "heading_close") { - heading = null; - } else if ((token.type === "inline") && heading) { - handler(heading, token.content); - } - }); -}; - -/** - * Calls the provided function for each inline code span's content. - * - * @param {string} input Markdown content. - * @param {Function} handler Callback function. - * @returns {void} - */ -function forEachInlineCodeSpan(input, handler) { - let currentLine = 0; - let currentColumn = 0; - let index = 0; - while (index < input.length) { - let startIndex = -1; - let startLine = -1; - let startColumn = -1; - let tickCount = 0; - let currentTicks = 0; - let state = "normal"; - // Deliberate <= so trailing 0 completes the last span (ex: "text `code`") - for (; index <= input.length; index++) { - const char = input[index]; - // Ignore backticks in link destination - if ((char === "[") && (state === "normal")) { - state = "linkTextOpen"; - } else if ((char === "]") && (state === "linkTextOpen")) { - state = "linkTextClosed"; - } else if ((char === "(") && (state === "linkTextClosed")) { - state = "linkDestinationOpen"; - } else if ( - ((char === "(") && (state === "linkDestinationOpen")) || - ((char === ")") && (state === "linkDestinationOpen")) || - (state === "linkTextClosed")) { - state = "normal"; - } - // Parse backtick open/close - if ((char === "`") && (state !== "linkDestinationOpen")) { - // Count backticks at start or end of code span - currentTicks++; - if ((startIndex === -1) || (startColumn === -1)) { - startIndex = index + 1; - } - } else { - if ((startIndex >= 0) && - (startColumn >= 0) && - (tickCount === currentTicks)) { - // Found end backticks; invoke callback for code span - handler( - input.substring(startIndex, index - currentTicks), - startLine, startColumn, tickCount); - startIndex = -1; - startColumn = -1; - } else if ((startIndex >= 0) && (startColumn === -1)) { - // Found start backticks - tickCount = currentTicks; - startLine = currentLine; - startColumn = currentColumn; - } - // Not in backticks - currentTicks = 0; - } - if (char === "\n") { - // On next line - currentLine++; - currentColumn = 0; - } else if ((char === "\\") && - ((startIndex === -1) || (startColumn === -1)) && - (input[index + 1] !== "\n")) { - // Escape character outside code, skip next - index++; - currentColumn += 2; - } else { - // On next column - currentColumn++; - } - } - if (startIndex >= 0) { - // Restart loop after unmatched start backticks (ex: "`text``code``") - index = startIndex; - currentLine = startLine; - currentColumn = startColumn; - } - } -} -module.exports.forEachInlineCodeSpan = forEachInlineCodeSpan; - -/** - * Adds a generic error object via the onError callback. - * - * @param {Object} onError RuleOnError instance. - * @param {number} lineNumber Line number. - * @param {string} [detail] Error details. - * @param {string} [context] Error context. - * @param {number[]} [range] Column and length of error. - * @param {Object} [fixInfo] RuleOnErrorFixInfo instance. - * @returns {void} - */ -function addError(onError, lineNumber, detail, context, range, fixInfo) { - onError({ - lineNumber, - detail, - context, - range, - fixInfo - }); -} -module.exports.addError = addError; - -// Adds an error object with details conditionally via the onError callback -module.exports.addErrorDetailIf = function addErrorDetailIf( - onError, lineNumber, expected, actual, detail, context, range, fixInfo) { - if (expected !== actual) { - addError( - onError, - lineNumber, - "Expected: " + expected + "; Actual: " + actual + - (detail ? "; " + detail : ""), - context, - range, - fixInfo); - } -}; - -// Adds an error object with context via the onError callback -module.exports.addErrorContext = function addErrorContext( - onError, lineNumber, context, left, right, range, fixInfo) { - if (context.length <= 30) { - // Nothing to do - } else if (left && right) { - context = context.substr(0, 15) + "..." + context.substr(-15); - } else if (right) { - context = "..." + context.substr(-30); - } else { - context = context.substr(0, 30) + "..."; - } - addError(onError, lineNumber, null, context, range, fixInfo); -}; - -// Returns a range object for a line by applying a RegExp -module.exports.rangeFromRegExp = function rangeFromRegExp(line, regexp) { - let range = null; - const match = line.match(regexp); - if (match) { - const column = match.index + 1; - const length = match[0].length; - range = [ column, length ]; - } - return range; -}; - -// Determines if the front matter includes a title -module.exports.frontMatterHasTitle = - function frontMatterHasTitle(frontMatterLines, frontMatterTitlePattern) { - const ignoreFrontMatter = - (frontMatterTitlePattern !== undefined) && !frontMatterTitlePattern; - const frontMatterTitleRe = - new RegExp(String(frontMatterTitlePattern || "^\\s*title\\s*[:=]"), "i"); - return !ignoreFrontMatter && - frontMatterLines.some((line) => frontMatterTitleRe.test(line)); - }; - -/** - * Returns a list of emphasis markers in code spans and links. - * - * @param {Object} params RuleParams instance. - * @returns {number[][]} List of markers. - */ -function emphasisMarkersInContent(params) { - const { lines } = params; - const byLine = new Array(lines.length); - // Search code spans - filterTokens(params, "inline", (token) => { - const { children, lineNumber, map } = token; - if (children.some((child) => child.type === "code_inline")) { - const tokenLines = lines.slice(map[0], map[1]); - forEachInlineCodeSpan( - tokenLines.join("\n"), - (code, lineIndex, column, tickCount) => { - const codeLines = code.split(newLineRe); - codeLines.forEach((codeLine, codeLineIndex) => { - let match = null; - while ((match = emphasisMarkersRe.exec(codeLine))) { - const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex; - const inLine = byLine[byLineIndex] || []; - const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount; - inLine.push(codeLineOffset + match.index); - byLine[byLineIndex] = inLine; - } - }); - } - ); - } - }); - // Search links - lines.forEach((tokenLine, tokenLineIndex) => { - let linkMatch = null; - while ((linkMatch = linkRe.exec(tokenLine))) { - let markerMatch = null; - while ((markerMatch = emphasisMarkersRe.exec(linkMatch[0]))) { - const inLine = byLine[tokenLineIndex] || []; - inLine.push(linkMatch.index + markerMatch.index); - byLine[tokenLineIndex] = inLine; - } - } - }); - return byLine; -} -module.exports.emphasisMarkersInContent = emphasisMarkersInContent; - -/** - * Gets the most common line ending, falling back to the platform default. - * - * @param {string} input Markdown content to analyze. - * @returns {string} Preferred line ending. - */ -function getPreferredLineEnding(input) { - let cr = 0; - let lf = 0; - let crlf = 0; - const endings = input.match(newLineRe) || []; - endings.forEach((ending) => { - // eslint-disable-next-line default-case - switch (ending) { - case "\r": - cr++; - break; - case "\n": - lf++; - break; - case "\r\n": - crlf++; - break; - } - }); - let preferredLineEnding = null; - if (!cr && !lf && !crlf) { - preferredLineEnding = os.EOL; - } else if ((lf >= crlf) && (lf >= cr)) { - preferredLineEnding = "\n"; - } else if (crlf >= cr) { - preferredLineEnding = "\r\n"; - } else { - preferredLineEnding = "\r"; - } - return preferredLineEnding; -} -module.exports.getPreferredLineEnding = getPreferredLineEnding; - -/** - * Normalizes the fields of a RuleOnErrorFixInfo instance. - * - * @param {Object} fixInfo RuleOnErrorFixInfo instance. - * @param {number} [lineNumber] Line number. - * @returns {Object} Normalized RuleOnErrorFixInfo instance. - */ -function normalizeFixInfo(fixInfo, lineNumber) { - return { - "lineNumber": fixInfo.lineNumber || lineNumber, - "editColumn": fixInfo.editColumn || 1, - "deleteCount": fixInfo.deleteCount || 0, - "insertText": fixInfo.insertText || "" - }; -} - -/** - * Fixes the specified error on a line of Markdown content. - * - * @param {string} line Line of Markdown content. - * @param {Object} fixInfo RuleOnErrorFixInfo instance. - * @param {string} lineEnding Line ending to use. - * @returns {string} Fixed content. - */ -function applyFix(line, fixInfo, lineEnding) { - const { editColumn, deleteCount, insertText } = normalizeFixInfo(fixInfo); - const editIndex = editColumn - 1; - return (deleteCount === -1) ? - null : - line.slice(0, editIndex) + - insertText.replace(/\n/g, lineEnding || "\n") + - line.slice(editIndex + deleteCount); -} -module.exports.applyFix = applyFix; - -// Applies as many fixes as possible to the input lines -module.exports.applyFixes = function applyFixes(input, errors) { - const lineEnding = getPreferredLineEnding(input); - const lines = input.split(newLineRe); - // Normalize fixInfo objects - let fixInfos = errors - .filter((error) => error.fixInfo) - .map((error) => normalizeFixInfo(error.fixInfo, error.lineNumber)); - // Sort bottom-to-top, line-deletes last, right-to-left, long-to-short - fixInfos.sort((a, b) => { - const aDeletingLine = (a.deleteCount === -1); - const bDeletingLine = (b.deleteCount === -1); - return ( - (b.lineNumber - a.lineNumber) || - (aDeletingLine ? 1 : (bDeletingLine ? -1 : 0)) || - (b.editColumn - a.editColumn) || - (b.insertText.length - a.insertText.length) - ); - }); - // Remove duplicate entries (needed for following collapse step) - let lastFixInfo = {}; - fixInfos = fixInfos.filter((fixInfo) => { - const unique = ( - (fixInfo.lineNumber !== lastFixInfo.lineNumber) || - (fixInfo.editColumn !== lastFixInfo.editColumn) || - (fixInfo.deleteCount !== lastFixInfo.deleteCount) || - (fixInfo.insertText !== lastFixInfo.insertText) - ); - lastFixInfo = fixInfo; - return unique; - }); - // Collapse insert/no-delete and no-insert/delete for same line/column - lastFixInfo = {}; - fixInfos.forEach((fixInfo) => { - if ( - (fixInfo.lineNumber === lastFixInfo.lineNumber) && - (fixInfo.editColumn === lastFixInfo.editColumn) && - !fixInfo.insertText && - (fixInfo.deleteCount > 0) && - lastFixInfo.insertText && - !lastFixInfo.deleteCount) { - fixInfo.insertText = lastFixInfo.insertText; - lastFixInfo.lineNumber = 0; - } - lastFixInfo = fixInfo; - }); - fixInfos = fixInfos.filter((fixInfo) => fixInfo.lineNumber); - // Apply all (remaining/updated) fixes - let lastLineIndex = -1; - let lastEditIndex = -1; - fixInfos.forEach((fixInfo) => { - const { lineNumber, editColumn, deleteCount } = fixInfo; - const lineIndex = lineNumber - 1; - const editIndex = editColumn - 1; - if ( - (lineIndex !== lastLineIndex) || - ((editIndex + deleteCount) < lastEditIndex) || - (deleteCount === -1) - ) { - lines[lineIndex] = applyFix(lines[lineIndex], fixInfo, lineEnding); - } - lastLineIndex = lineIndex; - lastEditIndex = editIndex; - }); - // Return corrected input - return lines.filter((line) => line !== null).join(lineEnding); -}; - - -/***/ }), -/* 111 */ -/***/ (function(module, exports) { - -module.exports = require("os"); - -/***/ }), -/* 112 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf } = __webpack_require__(110); - -module.exports = { - "names": [ "MD002", "first-heading-h1", "first-header-h1" ], - "description": "First heading should be a top level heading", - "tags": [ "headings", "headers" ], - "function": function MD002(params, onError) { - const level = Number(params.config.level || 1); - const tag = "h" + level; - params.tokens.every(function forToken(token) { - if (token.type === "heading_open") { - addErrorDetailIf(onError, token.lineNumber, tag, token.tag); - return false; - } - return true; - }); - } -}; - - -/***/ }), -/* 113 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf, filterTokens, headingStyleFor } = - __webpack_require__(110); - -module.exports = { - "names": [ "MD003", "heading-style", "header-style" ], - "description": "Heading style", - "tags": [ "headings", "headers" ], - "function": function MD003(params, onError) { - let style = String(params.config.style || "consistent"); - filterTokens(params, "heading_open", function forToken(token) { - const styleForToken = headingStyleFor(token); - if (style === "consistent") { - style = styleForToken; - } - if (styleForToken !== style) { - const h12 = /h[12]/.test(token.tag); - const setextWithAtx = - (style === "setext_with_atx") && - ((h12 && (styleForToken === "setext")) || - (!h12 && (styleForToken === "atx"))); - const setextWithAtxClosed = - (style === "setext_with_atx_closed") && - ((h12 && (styleForToken === "setext")) || - (!h12 && (styleForToken === "atx_closed"))); - if (!setextWithAtx && !setextWithAtxClosed) { - let expected = style; - if (style === "setext_with_atx") { - expected = h12 ? "setext" : "atx"; - } else if (style === "setext_with_atx_closed") { - expected = h12 ? "setext" : "atx_closed"; - } - addErrorDetailIf(onError, token.lineNumber, - expected, styleForToken); - } - } - }); - } -}; - - -/***/ }), -/* 114 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf, listItemMarkerRe, - rangeFromRegExp, unorderedListStyleFor } = __webpack_require__(110); -const { flattenedLists } = __webpack_require__(115); - -module.exports = { - "names": [ "MD004", "ul-style" ], - "description": "Unordered list style", - "tags": [ "bullet", "ul" ], - "function": function MD004(params, onError) { - const style = String(params.config.style || "consistent"); - let expectedStyle = style; - const nestingStyles = []; - flattenedLists().forEach((list) => { - if (list.unordered) { - if (expectedStyle === "consistent") { - expectedStyle = unorderedListStyleFor(list.items[0]); - } - list.items.forEach((item) => { - const itemStyle = unorderedListStyleFor(item); - if (style === "sublist") { - const nesting = list.nesting; - if (!nestingStyles[nesting] && - (itemStyle !== nestingStyles[nesting - 1])) { - nestingStyles[nesting] = itemStyle; - } else { - addErrorDetailIf(onError, item.lineNumber, - nestingStyles[nesting], itemStyle, null, null, - rangeFromRegExp(item.line, listItemMarkerRe)); - } - } else { - addErrorDetailIf(onError, item.lineNumber, - expectedStyle, itemStyle, null, null, - rangeFromRegExp(item.line, listItemMarkerRe)); - } - }); - } - }); - } -}; - - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -let lineMetadata = null; -module.exports.lineMetadata = (value) => { - if (value) { - lineMetadata = value; - } - return lineMetadata; -}; - -let flattenedLists = null; -module.exports.flattenedLists = (value) => { - if (value) { - flattenedLists = value; - } - return flattenedLists; -}; - -module.exports.clear = () => { - lineMetadata = null; - flattenedLists = null; -}; - - -/***/ }), -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addError, addErrorDetailIf, indentFor, listItemMarkerRe, - orderedListItemMarkerRe, rangeFromRegExp } = __webpack_require__(110); -const { flattenedLists } = __webpack_require__(115); - -module.exports = { - "names": [ "MD005", "list-indent" ], - "description": "Inconsistent indentation for list items at the same level", - "tags": [ "bullet", "ul", "indentation" ], - "function": function MD005(params, onError) { - flattenedLists().forEach((list) => { - const expectedIndent = list.indent; - let expectedEnd = 0; - let actualEnd = -1; - let endMatching = false; - list.items.forEach((item) => { - const { line, lineNumber } = item; - const actualIndent = indentFor(item); - let match = null; - if (list.unordered) { - addErrorDetailIf( - onError, - lineNumber, - expectedIndent, - actualIndent, - null, - null, - rangeFromRegExp(line, listItemMarkerRe) - // No fixInfo; MD007 handles this scenario better - ); - } else if ((match = orderedListItemMarkerRe.exec(line))) { - actualEnd = match[0].length; - expectedEnd = expectedEnd || actualEnd; - const markerLength = match[1].length + 1; - if ((expectedIndent !== actualIndent) || endMatching) { - if (expectedEnd === actualEnd) { - endMatching = true; - } else { - const detail = endMatching ? - `Expected: (${expectedEnd}); Actual: (${actualEnd})` : - `Expected: ${expectedIndent}; Actual: ${actualIndent}`; - const expected = endMatching ? - expectedEnd - markerLength : - expectedIndent; - const actual = endMatching ? - actualEnd - markerLength : - actualIndent; - addError( - onError, - lineNumber, - detail, - null, - rangeFromRegExp(line, listItemMarkerRe), - { - "editColumn": Math.min(actual, expected) + 1, - "deleteCount": Math.max(actual - expected, 0), - "insertText": "".padEnd(Math.max(expected - actual, 0)) - } - ); - } - } - } - }); - }); - } -}; - - -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf, listItemMarkerRe, rangeFromRegExp } = - __webpack_require__(110); -const { flattenedLists } = __webpack_require__(115); - -module.exports = { - "names": [ "MD006", "ul-start-left" ], - "description": - "Consider starting bulleted lists at the beginning of the line", - "tags": [ "bullet", "ul", "indentation" ], - "function": function MD006(params, onError) { - flattenedLists().forEach((list) => { - if (list.unordered && !list.nesting && (list.indent !== 0)) { - list.items.forEach((item) => { - const { lineNumber, line } = item; - addErrorDetailIf( - onError, - lineNumber, - 0, - list.indent, - null, - null, - rangeFromRegExp(line, listItemMarkerRe), - { - "deleteCount": line.length - line.trimLeft().length - }); - }); - } - }); - } -}; - - -/***/ }), -/* 118 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf, indentFor, listItemMarkerRe } = - __webpack_require__(110); -const { flattenedLists } = __webpack_require__(115); - -module.exports = { - "names": [ "MD007", "ul-indent" ], - "description": "Unordered list indentation", - "tags": [ "bullet", "ul", "indentation" ], - "function": function MD007(params, onError) { - const indent = Number(params.config.indent || 2); - const startIndented = !!params.config.start_indented; - flattenedLists().forEach((list) => { - if (list.unordered && list.parentsUnordered) { - list.items.forEach((item) => { - const { lineNumber, line } = item; - const expectedNesting = list.nesting + (startIndented ? 1 : 0); - const expectedIndent = expectedNesting * indent; - const actualIndent = indentFor(item); - let range = null; - let editColumn = 1; - const match = line.match(listItemMarkerRe); - if (match) { - range = [ 1, match[0].length ]; - editColumn += match[1].length - actualIndent; - } - addErrorDetailIf( - onError, - lineNumber, - expectedIndent, - actualIndent, - null, - null, - range, - { - editColumn, - "deleteCount": actualIndent, - "insertText": "".padEnd(expectedIndent) - }); - }); - } - }); - } -}; - - -/***/ }), -/* 119 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addError, filterTokens, forEachInlineCodeSpan, forEachLine, - includesSorted, newLineRe, numericSortAscending } = __webpack_require__(110); -const { lineMetadata } = __webpack_require__(115); - -module.exports = { - "names": [ "MD009", "no-trailing-spaces" ], - "description": "Trailing spaces", - "tags": [ "whitespace" ], - "function": function MD009(params, onError) { - let brSpaces = params.config.br_spaces; - brSpaces = Number((brSpaces === undefined) ? 2 : brSpaces); - const listItemEmptyLines = !!params.config.list_item_empty_lines; - const strict = !!params.config.strict; - const listItemLineNumbers = []; - if (listItemEmptyLines) { - filterTokens(params, "list_item_open", (token) => { - for (let i = token.map[0]; i < token.map[1]; i++) { - listItemLineNumbers.push(i + 1); - } - }); - listItemLineNumbers.sort(numericSortAscending); - } - const paragraphLineNumbers = []; - const codeInlineLineNumbers = []; - if (strict) { - filterTokens(params, "paragraph_open", (token) => { - for (let i = token.map[0]; i < token.map[1] - 1; i++) { - paragraphLineNumbers.push(i + 1); - } - }); - paragraphLineNumbers.sort(numericSortAscending); - filterTokens(params, "inline", (token) => { - if (token.children.some((child) => child.type === "code_inline")) { - const tokenLines = params.lines.slice(token.map[0], token.map[1]); - forEachInlineCodeSpan(tokenLines.join("\n"), (code, lineIndex) => { - const codeLineCount = code.split(newLineRe).length; - for (let i = 0; i < codeLineCount; i++) { - codeInlineLineNumbers.push(token.lineNumber + lineIndex + i); - } - }); - } - }); - codeInlineLineNumbers.sort(numericSortAscending); - } - const expected = (brSpaces < 2) ? 0 : brSpaces; - let inFencedCode = 0; - forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence) => { - inFencedCode += onFence; - const lineNumber = lineIndex + 1; - const trailingSpaces = line.length - line.trimRight().length; - if ((!inCode || inFencedCode) && trailingSpaces && - !includesSorted(listItemLineNumbers, lineNumber)) { - if ((expected !== trailingSpaces) || - (strict && - (!includesSorted(paragraphLineNumbers, lineNumber) || - includesSorted(codeInlineLineNumbers, lineNumber)))) { - const column = line.length - trailingSpaces + 1; - addError( - onError, - lineNumber, - "Expected: " + (expected === 0 ? "" : "0 or ") + - expected + "; Actual: " + trailingSpaces, - null, - [ column, trailingSpaces ], - { - "editColumn": column, - "deleteCount": trailingSpaces - }); - } - } - }); - } -}; - - -/***/ }), -/* 120 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addError, forEachLine } = __webpack_require__(110); -const { lineMetadata } = __webpack_require__(115); - -const tabRe = /\t+/g; - -module.exports = { - "names": [ "MD010", "no-hard-tabs" ], - "description": "Hard tabs", - "tags": [ "whitespace", "hard_tab" ], - "function": function MD010(params, onError) { - const codeBlocks = params.config.code_blocks; - const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks; - forEachLine(lineMetadata(), (line, lineIndex, inCode) => { - if (!inCode || includeCodeBlocks) { - let match = null; - while ((match = tabRe.exec(line)) !== null) { - const column = match.index + 1; - const length = match[0].length; - addError( - onError, - lineIndex + 1, - "Column: " + column, - null, - [ column, length ], - { - "editColumn": column, - "deleteCount": length, - "insertText": "".padEnd(length) - }); - } - } - }); - } -}; - - -/***/ }), -/* 121 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addError, forEachInlineChild, unescapeMarkdown } = - __webpack_require__(110); - -const reversedLinkRe = /\(([^)]+)\)\[([^\]^][^\]]*)]/g; - -module.exports = { - "names": [ "MD011", "no-reversed-links" ], - "description": "Reversed link syntax", - "tags": [ "links" ], - "function": function MD011(params, onError) { - forEachInlineChild(params, "text", (token) => { - const { lineNumber, content } = token; - let match = null; - while ((match = reversedLinkRe.exec(content)) !== null) { - const [ reversedLink, linkText, linkDestination ] = match; - const line = params.lines[lineNumber - 1]; - const column = unescapeMarkdown(line).indexOf(reversedLink) + 1; - const length = reversedLink.length; - addError( - onError, - lineNumber, - reversedLink, - null, - [ column, length ], - { - "editColumn": column, - "deleteCount": length, - "insertText": `[${linkText}](${linkDestination})` - } - ); - } - }); - } -}; - - -/***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf, forEachLine } = __webpack_require__(110); -const { lineMetadata } = __webpack_require__(115); - -module.exports = { - "names": [ "MD012", "no-multiple-blanks" ], - "description": "Multiple consecutive blank lines", - "tags": [ "whitespace", "blank_lines" ], - "function": function MD012(params, onError) { - const maximum = Number(params.config.maximum || 1); - let count = 0; - forEachLine(lineMetadata(), (line, lineIndex, inCode) => { - count = (inCode || line.trim().length) ? 0 : count + 1; - if (maximum < count) { - addErrorDetailIf( - onError, - lineIndex + 1, - maximum, - count, - null, - null, - null, - { - "deleteCount": -1 - }); - } - }); - } -}; - - -/***/ }), -/* 123 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf, filterTokens, forEachHeading, forEachLine, - includesSorted } = __webpack_require__(110); -const { lineMetadata } = __webpack_require__(115); - -const longLineRePrefix = "^.{"; -const longLineRePostfixRelaxed = "}.*\\s.*$"; -const longLineRePostfixStrict = "}.+$"; -const labelRe = /^\s*\[.*[^\\]]:/; -const linkOrImageOnlyLineRe = /^[es]*(lT?L|I)[ES]*$/; -const sternModeRe = /^([#>\s]*\s)?\S*$/; -const tokenTypeMap = { - "em_open": "e", - "em_close": "E", - "image": "I", - "link_open": "l", - "link_close": "L", - "strong_open": "s", - "strong_close": "S", - "text": "T" -}; - -module.exports = { - "names": [ "MD013", "line-length" ], - "description": "Line length", - "tags": [ "line_length" ], - "function": function MD013(params, onError) { - const lineLength = Number(params.config.line_length || 80); - const headingLineLength = - Number(params.config.heading_line_length || lineLength); - const codeLineLength = - Number(params.config.code_block_line_length || lineLength); - const strict = !!params.config.strict; - const stern = !!params.config.stern; - const longLineRePostfix = - (strict || stern) ? longLineRePostfixStrict : longLineRePostfixRelaxed; - const longLineRe = - new RegExp(longLineRePrefix + lineLength + longLineRePostfix); - const longHeadingLineRe = - new RegExp(longLineRePrefix + headingLineLength + longLineRePostfix); - const longCodeLineRe = - new RegExp(longLineRePrefix + codeLineLength + longLineRePostfix); - const codeBlocks = params.config.code_blocks; - const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks; - const tables = params.config.tables; - const includeTables = (tables === undefined) ? true : !!tables; - let headings = params.config.headings; - if (headings === undefined) { - headings = params.config.headers; - } - const includeHeadings = (headings === undefined) ? true : !!headings; - const headingLineNumbers = []; - forEachHeading(params, (heading) => { - headingLineNumbers.push(heading.lineNumber); - }); - const linkOnlyLineNumbers = []; - filterTokens(params, "inline", (token) => { - let childTokenTypes = ""; - token.children.forEach((child) => { - if (child.type !== "text" || child.content !== "") { - childTokenTypes += tokenTypeMap[child.type] || "x"; - } - }); - if (linkOrImageOnlyLineRe.test(childTokenTypes)) { - linkOnlyLineNumbers.push(token.lineNumber); - } - }); - forEachLine(lineMetadata(), (line, lineIndex, inCode, onFence, inTable) => { - const lineNumber = lineIndex + 1; - const isHeading = includesSorted(headingLineNumbers, lineNumber); - const length = inCode ? - codeLineLength : - (isHeading ? headingLineLength : lineLength); - const lengthRe = inCode ? - longCodeLineRe : - (isHeading ? longHeadingLineRe : longLineRe); - if ((includeCodeBlocks || !inCode) && - (includeTables || !inTable) && - (includeHeadings || !isHeading) && - (strict || - (!(stern && sternModeRe.test(line)) && - !includesSorted(linkOnlyLineNumbers, lineNumber) && - !labelRe.test(line))) && - lengthRe.test(line)) { - addErrorDetailIf( - onError, - lineNumber, - length, - line.length, - null, - null, - [ length + 1, line.length - length ]); - } - }); - } -}; - - -/***/ }), -/* 124 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, filterTokens } = __webpack_require__(110); - -const dollarCommandRe = /^(\s*)(\$\s+)/; - -module.exports = { - "names": [ "MD014", "commands-show-output" ], - "description": "Dollar signs used before commands without showing output", - "tags": [ "code" ], - "function": function MD014(params, onError) { - [ "code_block", "fence" ].forEach((type) => { - filterTokens(params, type, (token) => { - const margin = (token.type === "fence") ? 1 : 0; - const dollarInstances = []; - let allDollars = true; - for (let i = token.map[0] + margin; i < token.map[1] - margin; i++) { - const line = params.lines[i]; - const lineTrim = line.trim(); - if (lineTrim) { - const match = dollarCommandRe.exec(line); - if (match) { - const column = match[1].length + 1; - const length = match[2].length; - dollarInstances.push([ i, lineTrim, column, length ]); - } else { - allDollars = false; - } - } - } - if (allDollars) { - dollarInstances.forEach((instance) => { - const [ i, lineTrim, column, length ] = instance; - addErrorContext( - onError, - i + 1, - lineTrim, - null, - null, - [ column, length ], - { - "editColumn": column, - "deleteCount": length - } - ); - }); - } - }); - }); - } -}; - - -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, forEachLine } = __webpack_require__(110); -const { lineMetadata } = __webpack_require__(115); - -module.exports = { - "names": [ "MD018", "no-missing-space-atx" ], - "description": "No space after hash on atx style heading", - "tags": [ "headings", "headers", "atx", "spaces" ], - "function": function MD018(params, onError) { - forEachLine(lineMetadata(), (line, lineIndex, inCode) => { - if (!inCode && - /^#+[^#\s]/.test(line) && - !/#\s*$/.test(line) && - !line.startsWith("#️⃣")) { - const hashCount = /^#+/.exec(line)[0].length; - addErrorContext( - onError, - lineIndex + 1, - line.trim(), - null, - null, - [ 1, hashCount + 1 ], - { - "editColumn": hashCount + 1, - "insertText": " " - } - ); - } - }); - } -}; - - -/***/ }), -/* 126 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, filterTokens, headingStyleFor } = - __webpack_require__(110); - -module.exports = { - "names": [ "MD019", "no-multiple-space-atx" ], - "description": "Multiple spaces after hash on atx style heading", - "tags": [ "headings", "headers", "atx", "spaces" ], - "function": function MD019(params, onError) { - filterTokens(params, "heading_open", (token) => { - if (headingStyleFor(token) === "atx") { - const { line, lineNumber } = token; - const match = /^(#+)(\s{2,})(?:\S)/.exec(line); - if (match) { - const [ - , - { "length": hashLength }, - { "length": spacesLength } - ] = match; - addErrorContext( - onError, - lineNumber, - line.trim(), - null, - null, - [ 1, hashLength + spacesLength + 1 ], - { - "editColumn": hashLength + 1, - "deleteCount": spacesLength - 1 - } - ); - } - } - }); - } -}; - - -/***/ }), -/* 127 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, forEachLine } = __webpack_require__(110); -const { lineMetadata } = __webpack_require__(115); - -module.exports = { - "names": [ "MD020", "no-missing-space-closed-atx" ], - "description": "No space inside hashes on closed atx style heading", - "tags": [ "headings", "headers", "atx_closed", "spaces" ], - "function": function MD020(params, onError) { - forEachLine(lineMetadata(), (line, lineIndex, inCode) => { - if (!inCode) { - const match = - /^(#+)(\s*)([^#]*?[^#\\])(\s*)((?:\\#)?)(#+)(\s*)$/.exec(line); - if (match) { - const [ - , - leftHash, - { "length": leftSpaceLength }, - content, - { "length": rightSpaceLength }, - rightEscape, - rightHash, - { "length": trailSpaceLength } - ] = match; - const leftHashLength = leftHash.length; - const rightHashLength = rightHash.length; - const left = !leftSpaceLength; - const right = !rightSpaceLength || rightEscape; - const rightEscapeReplacement = rightEscape ? `${rightEscape} ` : ""; - if (left || right) { - const range = left ? - [ - 1, - leftHashLength + 1 - ] : - [ - line.length - trailSpaceLength - rightHashLength, - rightHashLength + 1 - ]; - addErrorContext( - onError, - lineIndex + 1, - line.trim(), - left, - right, - range, - { - "editColumn": 1, - "deleteCount": line.length, - "insertText": - `${leftHash} ${content} ${rightEscapeReplacement}${rightHash}` - } - ); - } - } - } - }); - } -}; - - -/***/ }), -/* 128 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, filterTokens, headingStyleFor } = - __webpack_require__(110); - -module.exports = { - "names": [ "MD021", "no-multiple-space-closed-atx" ], - "description": "Multiple spaces inside hashes on closed atx style heading", - "tags": [ "headings", "headers", "atx_closed", "spaces" ], - "function": function MD021(params, onError) { - filterTokens(params, "heading_open", (token) => { - if (headingStyleFor(token) === "atx_closed") { - const { line, lineNumber } = token; - const match = /^(#+)(\s+)([^#]+?)(\s+)(#+)(\s*)$/.exec(line); - if (match) { - const [ - , - leftHash, - { "length": leftSpaceLength }, - content, - { "length": rightSpaceLength }, - rightHash, - { "length": trailSpaceLength } - ] = match; - const left = leftSpaceLength > 1; - const right = rightSpaceLength > 1; - if (left || right) { - const length = line.length; - const leftHashLength = leftHash.length; - const rightHashLength = rightHash.length; - const range = left ? - [ - 1, - leftHashLength + leftSpaceLength + 1 - ] : - [ - length - trailSpaceLength - rightHashLength - rightSpaceLength, - rightSpaceLength + rightHashLength + 1 - ]; - addErrorContext( - onError, - lineNumber, - line.trim(), - left, - right, - range, - { - "editColumn": 1, - "deleteCount": length, - "insertText": `${leftHash} ${content} ${rightHash}` - } - ); - } - } - } - }); - } -}; - - -/***/ }), -/* 129 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf, filterTokens, isBlankLine } = __webpack_require__(110); - -module.exports = { - "names": [ "MD022", "blanks-around-headings", "blanks-around-headers" ], - "description": "Headings should be surrounded by blank lines", - "tags": [ "headings", "headers", "blank_lines" ], - "function": function MD022(params, onError) { - let linesAbove = params.config.lines_above; - linesAbove = Number((linesAbove === undefined) ? 1 : linesAbove); - let linesBelow = params.config.lines_below; - linesBelow = Number((linesBelow === undefined) ? 1 : linesBelow); - const { lines } = params; - filterTokens(params, "heading_open", (token) => { - const [ topIndex, nextIndex ] = token.map; - let actualAbove = 0; - for (let i = 0; i < linesAbove; i++) { - if (isBlankLine(lines[topIndex - i - 1])) { - actualAbove++; - } - } - addErrorDetailIf( - onError, - topIndex + 1, - linesAbove, - actualAbove, - "Above", - lines[topIndex].trim(), - null, - { - "insertText": "".padEnd(linesAbove - actualAbove, "\n") - }); - let actualBelow = 0; - for (let i = 0; i < linesBelow; i++) { - if (isBlankLine(lines[nextIndex + i])) { - actualBelow++; - } - } - addErrorDetailIf( - onError, - topIndex + 1, - linesBelow, - actualBelow, - "Below", - lines[topIndex].trim(), - null, - { - "lineNumber": nextIndex + 1, - "insertText": "".padEnd(linesBelow - actualBelow, "\n") - }); - }); - } -}; - - -/***/ }), -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, filterTokens } = __webpack_require__(110); - -const spaceBeforeHeadingRe = /^((?:\s+)|(?:[>\s]+\s\s))[^>\s]/; - -module.exports = { - "names": [ "MD023", "heading-start-left", "header-start-left" ], - "description": "Headings must start at the beginning of the line", - "tags": [ "headings", "headers", "spaces" ], - "function": function MD023(params, onError) { - filterTokens(params, "heading_open", function forToken(token) { - const { lineNumber, line } = token; - const match = line.match(spaceBeforeHeadingRe); - if (match) { - const [ prefixAndFirstChar, prefix ] = match; - let deleteCount = prefix.length; - const prefixLengthNoSpace = prefix.trimRight().length; - if (prefixLengthNoSpace) { - deleteCount -= prefixLengthNoSpace - 1; - } - addErrorContext( - onError, - lineNumber, - line, - null, - null, - [ 1, prefixAndFirstChar.length ], - { - "editColumn": prefixLengthNoSpace + 1, - "deleteCount": deleteCount - }); - } - }); - } -}; - - -/***/ }), -/* 131 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, forEachHeading } = __webpack_require__(110); - -module.exports = { - "names": [ "MD024", "no-duplicate-heading", "no-duplicate-header" ], - "description": "Multiple headings with the same content", - "tags": [ "headings", "headers" ], - "function": function MD024(params, onError) { - const siblingsOnly = !!params.config.siblings_only || - !!params.config.allow_different_nesting || false; - const knownContents = [ null, [] ]; - let lastLevel = 1; - let knownContent = knownContents[lastLevel]; - forEachHeading(params, (heading, content) => { - if (siblingsOnly) { - const newLevel = heading.tag.slice(1); - while (lastLevel < newLevel) { - lastLevel++; - knownContents[lastLevel] = []; - } - while (lastLevel > newLevel) { - knownContents[lastLevel] = []; - lastLevel--; - } - knownContent = knownContents[newLevel]; - } - if (knownContent.includes(content)) { - addErrorContext(onError, heading.lineNumber, - heading.line.trim()); - } else { - knownContent.push(content); - } - }); - } -}; - - -/***/ }), -/* 132 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, filterTokens, frontMatterHasTitle } = - __webpack_require__(110); - -module.exports = { - "names": [ "MD025", "single-title", "single-h1" ], - "description": "Multiple top level headings in the same document", - "tags": [ "headings", "headers" ], - "function": function MD025(params, onError) { - const level = Number(params.config.level || 1); - const tag = "h" + level; - const foundFrontMatterTitle = - frontMatterHasTitle( - params.frontMatterLines, - params.config.front_matter_title - ); - let hasTopLevelHeading = false; - filterTokens(params, "heading_open", function forToken(token) { - if (token.tag === tag) { - if (hasTopLevelHeading || foundFrontMatterTitle) { - addErrorContext(onError, token.lineNumber, - token.line.trim()); - } else if (token.lineNumber === 1) { - hasTopLevelHeading = true; - } - } - }); - } -}; - - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addError, allPunctuation, escapeForRegExp, forEachHeading } = - __webpack_require__(110); - -module.exports = { - "names": [ "MD026", "no-trailing-punctuation" ], - "description": "Trailing punctuation in heading", - "tags": [ "headings", "headers" ], - "function": function MD026(params, onError) { - let punctuation = params.config.punctuation; - punctuation = - String((punctuation === undefined) ? allPunctuation : punctuation); - const trailingPunctuationRe = - new RegExp("\\s*[" + escapeForRegExp(punctuation) + "]+$"); - forEachHeading(params, (heading) => { - const { line, lineNumber } = heading; - const trimmedLine = line.replace(/[\s#]*$/, ""); - const match = trailingPunctuationRe.exec(trimmedLine); - if (match) { - const fullMatch = match[0]; - const column = match.index + 1; - const length = fullMatch.length; - addError( - onError, - lineNumber, - `Punctuation: '${fullMatch}'`, - null, - [ column, length ], - { - "editColumn": column, - "deleteCount": length - } - ); - } - }); - } -}; - - -/***/ }), -/* 134 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, newLineRe } = __webpack_require__(110); - -const spaceAfterBlockQuoteRe = /^((?:\s*>)+)(\s{2,})\S/; - -module.exports = { - "names": [ "MD027", "no-multiple-space-blockquote" ], - "description": "Multiple spaces after blockquote symbol", - "tags": [ "blockquote", "whitespace", "indentation" ], - "function": function MD027(params, onError) { - let blockquoteNesting = 0; - let listItemNesting = 0; - params.tokens.forEach((token) => { - const { content, lineNumber, type } = token; - if (type === "blockquote_open") { - blockquoteNesting++; - } else if (type === "blockquote_close") { - blockquoteNesting--; - } else if (type === "list_item_open") { - listItemNesting++; - } else if (type === "list_item_close") { - listItemNesting--; - } else if ((type === "inline") && blockquoteNesting) { - const lineCount = content.split(newLineRe).length; - for (let i = 0; i < lineCount; i++) { - const line = params.lines[lineNumber + i - 1]; - const match = line.match(spaceAfterBlockQuoteRe); - if (match) { - const [ - fullMatch, - { "length": blockquoteLength }, - { "length": spaceLength } - ] = match; - if (!listItemNesting || (fullMatch[fullMatch.length - 1] === ">")) { - addErrorContext( - onError, - lineNumber + i, - line, - null, - null, - [ 1, fullMatch.length ], - { - "editColumn": blockquoteLength + 1, - "deleteCount": spaceLength - 1 - } - ); - } - } - } - } - }); - } -}; - - -/***/ }), -/* 135 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addError } = __webpack_require__(110); - -module.exports = { - "names": [ "MD028", "no-blanks-blockquote" ], - "description": "Blank line inside blockquote", - "tags": [ "blockquote", "whitespace" ], - "function": function MD028(params, onError) { - let prevToken = {}; - let prevLineNumber = null; - params.tokens.forEach(function forToken(token) { - if ((token.type === "blockquote_open") && - (prevToken.type === "blockquote_close")) { - for ( - let lineNumber = prevLineNumber; - lineNumber < token.lineNumber; - lineNumber++) { - addError( - onError, - lineNumber, - null, - null, - null, - { - "deleteCount": -1 - }); - } - } - prevToken = token; - if (token.type === "blockquote_open") { - prevLineNumber = token.map[1] + 1; - } - }); - } -}; - - -/***/ }), -/* 136 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf, listItemMarkerRe, orderedListItemMarkerRe, - rangeFromRegExp } = __webpack_require__(110); -const { flattenedLists } = __webpack_require__(115); - -const listStyleExamples = { - "one": "1/1/1", - "ordered": "1/2/3", - "zero": "0/0/0" -}; - -module.exports = { - "names": [ "MD029", "ol-prefix" ], - "description": "Ordered list item prefix", - "tags": [ "ol" ], - "function": function MD029(params, onError) { - const style = String(params.config.style || "one_or_ordered"); - flattenedLists().filter((list) => !list.unordered).forEach((list) => { - const { items } = list; - let current = 1; - let incrementing = false; - // Check for incrementing number pattern 1/2/3 or 0/1/2 - if (items.length >= 2) { - const first = orderedListItemMarkerRe.exec(items[0].line); - const second = orderedListItemMarkerRe.exec(items[1].line); - if (first && second) { - const [ , firstNumber ] = first; - const [ , secondNumber ] = second; - if ((secondNumber !== "1") || (firstNumber === "0")) { - incrementing = true; - if (firstNumber === "0") { - current = 0; - } - } - } - } - // Determine effective style - let listStyle = style; - if (listStyle === "one_or_ordered") { - listStyle = incrementing ? "ordered" : "one"; - } - // Force expected value for 0/0/0 and 1/1/1 patterns - if (listStyle === "zero") { - current = 0; - } else if (listStyle === "one") { - current = 1; - } - // Validate each list item marker - items.forEach((item) => { - const match = orderedListItemMarkerRe.exec(item.line); - if (match) { - addErrorDetailIf(onError, item.lineNumber, - String(current), match[1], - "Style: " + listStyleExamples[listStyle], null, - rangeFromRegExp(item.line, listItemMarkerRe)); - if (listStyle === "ordered") { - current++; - } - } - }); - }); - } -}; - - -/***/ }), -/* 137 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf } = __webpack_require__(110); -const { flattenedLists } = __webpack_require__(115); - -module.exports = { - "names": [ "MD030", "list-marker-space" ], - "description": "Spaces after list markers", - "tags": [ "ol", "ul", "whitespace" ], - "function": function MD030(params, onError) { - const ulSingle = Number(params.config.ul_single || 1); - const olSingle = Number(params.config.ol_single || 1); - const ulMulti = Number(params.config.ul_multi || 1); - const olMulti = Number(params.config.ol_multi || 1); - flattenedLists().forEach((list) => { - const lineCount = list.lastLineIndex - list.open.map[0]; - const allSingle = lineCount === list.items.length; - const expectedSpaces = list.unordered ? - (allSingle ? ulSingle : ulMulti) : - (allSingle ? olSingle : olMulti); - list.items.forEach((item) => { - const { line, lineNumber } = item; - const match = /^[\s>]*\S+(\s*)/.exec(line); - const [ { "length": matchLength }, { "length": actualSpaces } ] = match; - if (matchLength < line.length) { - let fixInfo = null; - if (expectedSpaces !== actualSpaces) { - fixInfo = { - "editColumn": matchLength - actualSpaces + 1, - "deleteCount": actualSpaces, - "insertText": "".padEnd(expectedSpaces) - }; - } - addErrorDetailIf( - onError, - lineNumber, - expectedSpaces, - actualSpaces, - null, - null, - [ 1, matchLength ], - fixInfo - ); - } - }); - }); - } -}; - - -/***/ }), -/* 138 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, forEachLine, isBlankLine } = __webpack_require__(110); -const { lineMetadata } = __webpack_require__(115); - -const codeFencePrefixRe = /^(.*?)\s*[`~]/; - -module.exports = { - "names": [ "MD031", "blanks-around-fences" ], - "description": "Fenced code blocks should be surrounded by blank lines", - "tags": [ "code", "blank_lines" ], - "function": function MD031(params, onError) { - const listItems = params.config.list_items; - const includeListItems = (listItems === undefined) ? true : !!listItems; - const { lines } = params; - forEachLine(lineMetadata(), (line, i, inCode, onFence, inTable, inItem) => { - const onTopFence = (onFence > 0); - const onBottomFence = (onFence < 0); - if ((includeListItems || !inItem) && - ((onTopFence && !isBlankLine(lines[i - 1])) || - (onBottomFence && !isBlankLine(lines[i + 1])))) { - const [ , prefix ] = line.match(codeFencePrefixRe); - addErrorContext( - onError, - i + 1, - lines[i].trim(), - null, - null, - null, - { - "lineNumber": i + (onTopFence ? 1 : 2), - "insertText": `${prefix}\n` - }); - } - }); - } -}; - - -/***/ }), -/* 139 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, isBlankLine } = __webpack_require__(110); -const { flattenedLists } = __webpack_require__(115); - -const quotePrefixRe = /^[>\s]*/; - -module.exports = { - "names": [ "MD032", "blanks-around-lists" ], - "description": "Lists should be surrounded by blank lines", - "tags": [ "bullet", "ul", "ol", "blank_lines" ], - "function": function MD032(params, onError) { - const { lines } = params; - flattenedLists().filter((list) => !list.nesting).forEach((list) => { - const firstIndex = list.open.map[0]; - if (!isBlankLine(lines[firstIndex - 1])) { - const line = lines[firstIndex]; - const quotePrefix = line.match(quotePrefixRe)[0].trimRight(); - addErrorContext( - onError, - firstIndex + 1, - line.trim(), - null, - null, - null, - { - "insertText": `${quotePrefix}\n` - }); - } - const lastIndex = list.lastLineIndex - 1; - if (!isBlankLine(lines[lastIndex + 1])) { - const line = lines[lastIndex]; - const quotePrefix = line.match(quotePrefixRe)[0].trimRight(); - addErrorContext( - onError, - lastIndex + 1, - line.trim(), - null, - null, - null, - { - "lineNumber": lastIndex + 2, - "insertText": `${quotePrefix}\n` - }); - } - }); - } -}; - - -/***/ }), -/* 140 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addError, forEachLine, unescapeMarkdown } = __webpack_require__(110); -const { lineMetadata } = __webpack_require__(115); - -const htmlElementRe = /<(([A-Za-z][A-Za-z0-9-]*)(?:\s[^>]*)?)\/?>/g; -const linkDestinationRe = /]\(\s*$/; -const inlineCodeRe = /^[^`]*(`+[^`]+`+[^`]+)*`+[^`]*$/; -// See https://spec.commonmark.org/0.29/#autolinks -const emailAddressRe = - // eslint-disable-next-line max-len - /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; - -module.exports = { - "names": [ "MD033", "no-inline-html" ], - "description": "Inline HTML", - "tags": [ "html" ], - "function": function MD033(params, onError) { - let allowedElements = params.config.allowed_elements; - allowedElements = Array.isArray(allowedElements) ? allowedElements : []; - allowedElements = allowedElements.map((element) => element.toLowerCase()); - forEachLine(lineMetadata(), (line, lineIndex, inCode) => { - let match = null; - // eslint-disable-next-line no-unmodified-loop-condition - while (!inCode && ((match = htmlElementRe.exec(line)) !== null)) { - const [ tag, content, element ] = match; - if (!allowedElements.includes(element.toLowerCase()) && - !tag.endsWith("\\>") && - !emailAddressRe.test(content)) { - const prefix = line.substring(0, match.index); - if (!linkDestinationRe.test(prefix) && !inlineCodeRe.test(prefix)) { - const unescaped = unescapeMarkdown(prefix + "<", "_"); - if (!unescaped.endsWith("_") && - ((unescaped + "`").match(/`/g).length % 2)) { - addError(onError, lineIndex + 1, "Element: " + element, - null, [ match.index + 1, tag.length ]); - } - } - } - } - }); - } -}; - - -/***/ }), -/* 141 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, bareUrlRe, filterTokens } = __webpack_require__(110); - -module.exports = { - "names": [ "MD034", "no-bare-urls" ], - "description": "Bare URL used", - "tags": [ "links", "url" ], - "function": function MD034(params, onError) { - filterTokens(params, "inline", (token) => { - let inLink = false; - token.children.forEach((child) => { - const { content, line, lineNumber, type } = child; - let match = null; - if (type === "link_open") { - inLink = true; - } else if (type === "link_close") { - inLink = false; - } else if ((type === "text") && !inLink) { - while ((match = bareUrlRe.exec(content)) !== null) { - const [ bareUrl ] = match; - const matchIndex = match.index; - const bareUrlLength = bareUrl.length; - // Allow "[https://example.com]" to avoid conflicts with - // MD011/no-reversed-links; allow quoting as another way - // of deliberately including a bare URL - const leftChar = content[matchIndex - 1]; - const rightChar = content[matchIndex + bareUrlLength]; - if ( - !((leftChar === "[") && (rightChar === "]")) && - !((leftChar === "\"") && (rightChar === "\"")) && - !((leftChar === "'") && (rightChar === "'")) - ) { - const index = line.indexOf(content); - const range = (index === -1) ? null : [ - index + matchIndex + 1, - bareUrlLength - ]; - const fixInfo = range ? { - "editColumn": range[0], - "deleteCount": range[1], - "insertText": `<${bareUrl}>` - } : null; - addErrorContext( - onError, - lineNumber, - bareUrl, - null, - null, - range, - fixInfo - ); - } - } - } - }); - }); - } -}; - - -/***/ }), -/* 142 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf, filterTokens } = __webpack_require__(110); - -module.exports = { - "names": [ "MD035", "hr-style" ], - "description": "Horizontal rule style", - "tags": [ "hr" ], - "function": function MD035(params, onError) { - let style = String(params.config.style || "consistent"); - filterTokens(params, "hr", function forToken(token) { - const lineTrim = token.line.trim(); - if (style === "consistent") { - style = lineTrim; - } - addErrorDetailIf(onError, token.lineNumber, style, lineTrim); - }); - } -}; - - -/***/ }), -/* 143 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, allPunctuation } = __webpack_require__(110); - -module.exports = { - "names": [ "MD036", "no-emphasis-as-heading", "no-emphasis-as-header" ], - "description": "Emphasis used instead of a heading", - "tags": [ "headings", "headers", "emphasis" ], - "function": function MD036(params, onError) { - let punctuation = params.config.punctuation; - punctuation = - String((punctuation === undefined) ? allPunctuation : punctuation); - const re = new RegExp("[" + punctuation + "]$"); - // eslint-disable-next-line jsdoc/require-jsdoc - function base(token) { - if (token.type === "paragraph_open") { - return function inParagraph(t) { - // Always paragraph_open/inline/paragraph_close, - const children = t.children.filter(function notEmptyText(child) { - return (child.type !== "text") || (child.content !== ""); - }); - if ((children.length === 3) && - ((children[0].type === "strong_open") || - (children[0].type === "em_open")) && - (children[1].type === "text") && - !re.test(children[1].content)) { - addErrorContext(onError, t.lineNumber, - children[1].content); - } - return base; - }; - } else if (token.type === "blockquote_open") { - return function inBlockquote(t) { - if (t.type !== "blockquote_close") { - return inBlockquote; - } - return base; - }; - } else if (token.type === "list_item_open") { - return function inListItem(t) { - if (t.type !== "list_item_close") { - return inListItem; - } - return base; - }; - } - return base; - } - let state = base; - params.tokens.forEach(function forToken(token) { - state = state(token); - }); - } -}; - - -/***/ }), -/* 144 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, emphasisMarkersInContent, forEachLine, isBlankLine } = - __webpack_require__(110); -const { lineMetadata } = __webpack_require__(115); - -const emphasisRe = /(^|[^\\]|\\\\)(?:(\*\*?\*?)|(__?_?))/g; -const asteriskListItemMarkerRe = /^([\s>]*)\*(\s+)/; -const leftSpaceRe = /^\s+/; -const rightSpaceRe = /\s+$/; - -module.exports = { - "names": [ "MD037", "no-space-in-emphasis" ], - "description": "Spaces inside emphasis markers", - "tags": [ "whitespace", "emphasis" ], - "function": function MD037(params, onError) { - // eslint-disable-next-line init-declarations - let effectiveEmphasisLength, emphasisIndex, emphasisKind, emphasisLength, - pendingError = null; - // eslint-disable-next-line jsdoc/require-jsdoc - function resetRunTracking() { - emphasisIndex = -1; - emphasisLength = 0; - emphasisKind = ""; - effectiveEmphasisLength = 0; - pendingError = null; - } - // eslint-disable-next-line jsdoc/require-jsdoc - function handleRunEnd(line, lineIndex, contextLength, match, matchIndex) { - // Close current run - let content = line.substring(emphasisIndex, matchIndex); - if (!emphasisLength) { - content = content.trimStart(); - } - if (!match) { - content = content.trimEnd(); - } - const leftSpace = leftSpaceRe.test(content); - const rightSpace = rightSpaceRe.test(content); - if (leftSpace || rightSpace) { - // Report the violation - const contextStart = emphasisIndex - emphasisLength; - const contextEnd = matchIndex + contextLength; - const context = line.substring(contextStart, contextEnd); - const column = contextStart + 1; - const length = contextEnd - contextStart; - const leftMarker = line.substring(contextStart, emphasisIndex); - const rightMarker = match ? (match[2] || match[3]) : ""; - const fixedText = `${leftMarker}${content.trim()}${rightMarker}`; - return [ - onError, - lineIndex + 1, - context, - leftSpace, - rightSpace, - [ column, length ], - { - "editColumn": column, - "deleteCount": length, - "insertText": fixedText - } - ]; - } - return null; - } - // Initialize - const ignoreMarkersByLine = emphasisMarkersInContent(params); - resetRunTracking(); - forEachLine( - lineMetadata(), - (line, lineIndex, inCode, onFence, inTable, inItem, onBreak) => { - const onItemStart = (inItem === 1); - if (inCode || inTable || onBreak || onItemStart || isBlankLine(line)) { - // Emphasis resets when leaving a block - resetRunTracking(); - } - if (inCode || onBreak) { - // Emphasis has no meaning here - return; - } - if (onItemStart) { - // Trim overlapping '*' list item marker - line = line.replace(asteriskListItemMarkerRe, "$1 $2"); - } - let match = null; - // Match all emphasis-looking runs in the line... - while ((match = emphasisRe.exec(line))) { - const ignoreMarkersForLine = ignoreMarkersByLine[lineIndex] || []; - const matchIndex = match.index + match[1].length; - if (ignoreMarkersForLine.includes(matchIndex)) { - // Ignore emphasis markers inside code spans and links - continue; - } - const matchLength = match[0].length - match[1].length; - const matchKind = (match[2] || match[3])[0]; - if (emphasisIndex === -1) { - // New run - emphasisIndex = matchIndex + matchLength; - emphasisLength = matchLength; - emphasisKind = matchKind; - effectiveEmphasisLength = matchLength; - } else if (matchKind === emphasisKind) { - // Matching emphasis markers - if (matchLength === effectiveEmphasisLength) { - // Ending an existing run, report any pending error - if (pendingError) { - addErrorContext(...pendingError); - pendingError = null; - } - const error = handleRunEnd( - line, lineIndex, effectiveEmphasisLength, match, matchIndex); - if (error) { - addErrorContext(...error); - } - // Reset - resetRunTracking(); - } else if (matchLength === 3) { - // Swap internal run length (1->2 or 2->1) - effectiveEmphasisLength = matchLength - effectiveEmphasisLength; - } else if (effectiveEmphasisLength === 3) { - // Downgrade internal run (3->1 or 3->2) - effectiveEmphasisLength -= matchLength; - } else { - // Upgrade to internal run (1->3 or 2->3) - effectiveEmphasisLength += matchLength; - } - // Back up one character so RegExp has a chance to match the - // next marker (ex: "**star**_underscore_") - if (emphasisRe.lastIndex > 1) { - emphasisRe.lastIndex--; - } - } else if (emphasisRe.lastIndex > 1) { - // Back up one character so RegExp has a chance to match the - // mis-matched marker (ex: "*text_*") - emphasisRe.lastIndex--; - } - } - if (emphasisIndex !== -1) { - pendingError = pendingError || - handleRunEnd(line, lineIndex, 0, null, line.length); - // Adjust for pending run on new line - emphasisIndex = 0; - emphasisLength = 0; - } - } - ); - } -}; - - -/***/ }), -/* 145 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, filterTokens, forEachInlineCodeSpan, newLineRe } = - __webpack_require__(110); - -const leftSpaceRe = /^\s([^`]|$)/; -const rightSpaceRe = /[^`]\s$/; -const singleLeftRightSpaceRe = /^\s(?:\S.*\S|\S)\s$/; - -module.exports = { - "names": [ "MD038", "no-space-in-code" ], - "description": "Spaces inside code span elements", - "tags": [ "whitespace", "code" ], - "function": function MD038(params, onError) { - filterTokens(params, "inline", (token) => { - if (token.children.some((child) => child.type === "code_inline")) { - const tokenLines = params.lines.slice(token.map[0], token.map[1]); - forEachInlineCodeSpan( - tokenLines.join("\n"), - (code, lineIndex, columnIndex, tickCount) => { - let rangeIndex = columnIndex - tickCount; - let rangeLength = code.length + (2 * tickCount); - let rangeLineOffset = 0; - let fixIndex = columnIndex; - let fixLength = code.length; - const codeLines = code.split(newLineRe); - const left = leftSpaceRe.test(code); - const right = !left && rightSpaceRe.test(code); - if (right && (codeLines.length > 1)) { - rangeIndex = 0; - rangeLineOffset = codeLines.length - 1; - fixIndex = 0; - } - const allowed = singleLeftRightSpaceRe.test(code); - if ((left || right) && !allowed) { - const codeLinesRange = codeLines[rangeLineOffset]; - if (codeLines.length > 1) { - rangeLength = codeLinesRange.length + tickCount; - fixLength = codeLinesRange.length; - } - const context = tokenLines[lineIndex + rangeLineOffset] - .substring(rangeIndex, rangeIndex + rangeLength); - const codeLinesRangeTrim = codeLinesRange.trim(); - const fixText = - (codeLinesRangeTrim.startsWith("`") ? " " : "") + - codeLinesRangeTrim + - (codeLinesRangeTrim.endsWith("`") ? " " : ""); - addErrorContext( - onError, - token.lineNumber + lineIndex + rangeLineOffset, - context, - left, - right, - [ rangeIndex + 1, rangeLength ], - { - "editColumn": fixIndex + 1, - "deleteCount": fixLength, - "insertText": fixText - } - ); - } - }); - } - }); - } -}; - - -/***/ }), -/* 146 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, filterTokens } = __webpack_require__(110); - -const spaceInLinkRe = /\[(?:\s+(?:[^\]]*?)\s*|(?:[^\]]*?)\s+)](?=\(\S*\))/; - -module.exports = { - "names": [ "MD039", "no-space-in-links" ], - "description": "Spaces inside link text", - "tags": [ "whitespace", "links" ], - "function": function MD039(params, onError) { - filterTokens(params, "inline", (token) => { - const { children } = token; - let { lineNumber } = token; - let inLink = false; - let linkText = ""; - let lineIndex = 0; - children.forEach((child) => { - const { content, type } = child; - if (type === "link_open") { - inLink = true; - linkText = ""; - } else if (type === "link_close") { - inLink = false; - const left = linkText.trimLeft().length !== linkText.length; - const right = linkText.trimRight().length !== linkText.length; - if (left || right) { - const line = params.lines[lineNumber - 1]; - let range = null; - let fixInfo = null; - const match = line.slice(lineIndex).match(spaceInLinkRe); - if (match) { - const column = match.index + lineIndex + 1; - const length = match[0].length; - range = [ column, length ]; - fixInfo = { - "editColumn": column + 1, - "deleteCount": length - 2, - "insertText": linkText.trim() - }; - lineIndex = column + length - 1; - } - addErrorContext( - onError, - lineNumber, - `[${linkText}]`, - left, - right, - range, - fixInfo - ); - } - } else if ((type === "softbreak") || (type === "hardbreak")) { - lineNumber++; - lineIndex = 0; - } else if (inLink) { - linkText += content; - } - }); - }); - } -}; - - -/***/ }), -/* 147 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, filterTokens } = __webpack_require__(110); - -module.exports = { - "names": [ "MD040", "fenced-code-language" ], - "description": "Fenced code blocks should have a language specified", - "tags": [ "code", "language" ], - "function": function MD040(params, onError) { - filterTokens(params, "fence", function forToken(token) { - if (!token.info.trim()) { - addErrorContext(onError, token.lineNumber, token.line); - } - }); - } -}; - - -/***/ }), -/* 148 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, frontMatterHasTitle } = __webpack_require__(110); - -module.exports = { - "names": [ "MD041", "first-line-heading", "first-line-h1" ], - "description": "First line in file should be a top level heading", - "tags": [ "headings", "headers" ], - "function": function MD041(params, onError) { - const level = Number(params.config.level || 1); - const tag = "h" + level; - const foundFrontMatterTitle = - frontMatterHasTitle( - params.frontMatterLines, - params.config.front_matter_title - ); - if (!foundFrontMatterTitle) { - params.tokens.every((token) => { - if (token.type === "html_block") { - return true; - } - if ((token.type !== "heading_open") || (token.tag !== tag)) { - addErrorContext(onError, token.lineNumber, token.line); - } - return false; - }); - } - } -}; - - -/***/ }), -/* 149 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, filterTokens, rangeFromRegExp } = - __webpack_require__(110); - -const emptyLinkRe = /\[[^\]]*](?:\((?:#?|(?:<>))\))/; - -module.exports = { - "names": [ "MD042", "no-empty-links" ], - "description": "No empty links", - "tags": [ "links" ], - "function": function MD042(params, onError) { - filterTokens(params, "inline", function forToken(token) { - let inLink = false; - let linkText = ""; - let emptyLink = false; - token.children.forEach(function forChild(child) { - if (child.type === "link_open") { - inLink = true; - linkText = ""; - child.attrs.forEach(function forAttr(attr) { - if (attr[0] === "href" && (!attr[1] || (attr[1] === "#"))) { - emptyLink = true; - } - }); - } else if (child.type === "link_close") { - inLink = false; - if (emptyLink) { - addErrorContext(onError, child.lineNumber, - "[" + linkText + "]()", null, null, - rangeFromRegExp(child.line, emptyLinkRe)); - } - } else if (inLink) { - linkText += child.content; - } - }); - }); - } -}; - - -/***/ }), -/* 150 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorContext, addErrorDetailIf, forEachHeading } = - __webpack_require__(110); - -module.exports = { - "names": [ "MD043", "required-headings", "required-headers" ], - "description": "Required heading structure", - "tags": [ "headings", "headers" ], - "function": function MD043(params, onError) { - const requiredHeadings = params.config.headings || params.config.headers; - if (Array.isArray(requiredHeadings)) { - const levels = {}; - [ 1, 2, 3, 4, 5, 6 ].forEach(function forLevel(level) { - levels["h" + level] = "######".substr(-level); - }); - let i = 0; - let optional = false; - let errorCount = 0; - forEachHeading(params, function forHeading(heading, content) { - if (!errorCount) { - const actual = levels[heading.tag] + " " + content; - const expected = requiredHeadings[i++] || "[None]"; - if (expected === "*") { - optional = true; - } else if (expected.toLowerCase() === actual.toLowerCase()) { - optional = false; - } else if (optional) { - i--; - } else { - addErrorDetailIf(onError, heading.lineNumber, - expected, actual); - errorCount++; - } - } - }); - if ((i < requiredHeadings.length) && !errorCount) { - addErrorContext(onError, params.lines.length, - requiredHeadings[i]); - } - } - } -}; - - -/***/ }), -/* 151 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf, bareUrlRe, escapeForRegExp, filterTokens, - forEachInlineChild, newLineRe } = __webpack_require__(110); - -const startNonWordRe = /^\W/; -const endNonWordRe = /\W$/; - -module.exports = { - "names": [ "MD044", "proper-names" ], - "description": "Proper names should have the correct capitalization", - "tags": [ "spelling" ], - "function": function MD044(params, onError) { - let names = params.config.names; - names = Array.isArray(names) ? names : []; - const codeBlocks = params.config.code_blocks; - const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks; - names.forEach((name) => { - const escapedName = escapeForRegExp(name); - const startNamePattern = startNonWordRe.test(name) ? "" : "\\S*\\b"; - const endNamePattern = endNonWordRe.test(name) ? "" : "\\b\\S*"; - const namePattern = - `(${startNamePattern})(${escapedName})(${endNamePattern})`; - const anyNameRe = new RegExp(namePattern, "gi"); - // eslint-disable-next-line jsdoc/require-jsdoc - function forToken(token) { - const fenceOffset = (token.type === "fence") ? 1 : 0; - token.content.split(newLineRe) - .forEach((line, index) => { - let match = null; - while ((match = anyNameRe.exec(line)) !== null) { - const [ fullMatch, leftMatch, nameMatch, rightMatch ] = match; - if (fullMatch.search(bareUrlRe) === -1) { - const wordMatch = fullMatch - .replace(new RegExp(`^\\W{0,${leftMatch.length}}`), "") - .replace(new RegExp(`\\W{0,${rightMatch.length}}$`), ""); - if (!names.includes(wordMatch)) { - const lineNumber = token.lineNumber + index + fenceOffset; - const fullLine = params.lines[lineNumber - 1]; - const matchLength = wordMatch.length; - const matchIndex = fullLine.indexOf(wordMatch); - const range = (matchIndex === -1) ? - null : - [ matchIndex + 1, matchLength ]; - const fixInfo = (matchIndex === -1) ? - null : - { - "editColumn": matchIndex + 1, - "deleteCount": matchLength, - "insertText": name - }; - addErrorDetailIf( - onError, - lineNumber, - name, - nameMatch, - null, - null, - range, - fixInfo - ); - } - } - } - }); - } - forEachInlineChild(params, "text", forToken); - if (includeCodeBlocks) { - forEachInlineChild(params, "code_inline", forToken); - filterTokens(params, "code_block", forToken); - filterTokens(params, "fence", forToken); - } - }); - } -}; - - -/***/ }), -/* 152 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addError, forEachInlineChild } = __webpack_require__(110); - -module.exports = { - "names": [ "MD045", "no-alt-text" ], - "description": "Images should have alternate text (alt text)", - "tags": [ "accessibility", "images" ], - "function": function MD045(params, onError) { - forEachInlineChild(params, "image", function forToken(token) { - if (token.content === "") { - addError(onError, token.lineNumber); - } - }); - } -}; - - -/***/ }), -/* 153 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf } = __webpack_require__(110); - -const tokenTypeToStyle = { - "fence": "fenced", - "code_block": "indented" -}; - -module.exports = { - "names": [ "MD046", "code-block-style" ], - "description": "Code block style", - "tags": [ "code" ], - "function": function MD046(params, onError) { - let expectedStyle = String(params.config.style || "consistent"); - params.tokens - .filter((token) => token.type === "code_block" || token.type === "fence") - .forEach((token) => { - const { lineNumber, type } = token; - if (expectedStyle === "consistent") { - expectedStyle = tokenTypeToStyle[type]; - } - addErrorDetailIf( - onError, - lineNumber, - expectedStyle, - tokenTypeToStyle[type]); - }); - } -}; - - -/***/ }), -/* 154 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addError, isBlankLine } = __webpack_require__(110); - -module.exports = { - "names": [ "MD047", "single-trailing-newline" ], - "description": "Files should end with a single newline character", - "tags": [ "blank_lines" ], - "function": function MD047(params, onError) { - const lastLineNumber = params.lines.length; - const lastLine = params.lines[lastLineNumber - 1]; - if (!isBlankLine(lastLine)) { - addError( - onError, - lastLineNumber, - null, - null, - [ lastLine.length, 1 ], - { - "insertText": "\n", - "editColumn": lastLine.length + 1 - } - ); - } - } -}; - - -/***/ }), -/* 155 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const { addErrorDetailIf, fencedCodeBlockStyleFor } = __webpack_require__(110); - -module.exports = { - "names": [ "MD048", "code-fence-style" ], - "description": "Code fence style", - "tags": [ "code" ], - "function": function MD048(params, onError) { - const style = String(params.config.style || "consistent"); - let expectedStyle = style; - params.tokens - .filter((token) => token.type === "fence") - .forEach((fenceToken) => { - const { lineNumber, markup } = fenceToken; - if (expectedStyle === "consistent") { - expectedStyle = fencedCodeBlockStyleFor(markup); - } - addErrorDetailIf( - onError, - lineNumber, - expectedStyle, - fencedCodeBlockStyleFor(markup) - ); - }); - } -}; - - -/***/ }), -/* 156 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// @ts-check - - - -const os = __webpack_require__(111); - -// Regular expression for matching common newline characters -// See NEWLINES_RE in markdown-it/lib/rules_core/normalize.js -const newLineRe = /\r\n?|\n/g; -module.exports.newLineRe = newLineRe; - -// Regular expression for matching common front matter (YAML and TOML) -module.exports.frontMatterRe = - // eslint-disable-next-line max-len - /((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$))(\r\n|\r|\n|$)/m; - -// Regular expression for matching inline disable/enable comments -const inlineCommentRe = - // eslint-disable-next-line max-len - //ig; -module.exports.inlineCommentRe = inlineCommentRe; - -// Regular expressions for range matching -module.exports.bareUrlRe = /(?:http|ftp)s?:\/\/[^\s\]"']*(?:\/|[^\s\]"'\W])/ig; -module.exports.listItemMarkerRe = /^([\s>]*)(?:[*+-]|\d+[.)])\s+/; -module.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/; - -// Regular expression for all instances of emphasis markers -const emphasisMarkersRe = /[_*]/g; - -// Regular expression for inline links and shortcut reference links -const linkRe = /\[(?:[^[\]]|\[[^\]]*\])*\](?:\(\S*\))?/g; - -// readFile options for reading with the UTF-8 encoding -module.exports.utf8Encoding = { "encoding": "utf8" }; - -// All punctuation characters (normal and full-width) -module.exports.allPunctuation = ".,;:!?。,;:!?"; - -// Returns true iff the input is a number -module.exports.isNumber = function isNumber(obj) { - return typeof obj === "number"; -}; - -// Returns true iff the input is a string -module.exports.isString = function isString(obj) { - return typeof obj === "string"; -}; - -// Returns true iff the input string is empty -module.exports.isEmptyString = function isEmptyString(str) { - return str.length === 0; -}; - -// Returns true iff the input is an object -module.exports.isObject = function isObject(obj) { - return (obj !== null) && (typeof obj === "object") && !Array.isArray(obj); -}; - -// Returns true iff the input line is blank (no content) -// Example: Contains nothing, whitespace, or comments -const blankLineRe = />|(?:)/g; -module.exports.isBlankLine = function isBlankLine(line) { - return !line || !line.trim() || !line.replace(blankLineRe, "").trim(); -}; - -/** - * Compare function for Array.prototype.sort for ascending order of numbers. - * - * @param {number} a First number. - * @param {number} b Second number. - * @returns {number} Positive value if a>b, negative value if b> 1; - if (array[mid] < element) { - left = mid + 1; - } else if (array[mid] > element) { - right = mid - 1; - } else { - return true; - } - } - return false; -}; - -// Replaces the text of all properly-formatted HTML comments with whitespace -// This preserves the line/column information for the rest of the document -// Trailing whitespace is avoided with a '\' character in the last column -// See https://www.w3.org/TR/html5/syntax.html#comments for details -const htmlCommentBegin = ""; -module.exports.clearHtmlCommentText = function clearHtmlCommentText(text) { - let i = 0; - while ((i = text.indexOf(htmlCommentBegin, i)) !== -1) { - const j = text.indexOf(htmlCommentEnd, i); - if (j === -1) { - // Un-terminated comments are treated as text - break; - } - const comment = text.slice(i + htmlCommentBegin.length, j); - if ((comment.length > 0) && - (comment[0] !== ">") && - (comment[comment.length - 1] !== "-") && - !comment.includes("--") && - (text.slice(i, j + htmlCommentEnd.length) - .search(inlineCommentRe) === -1)) { - const blanks = comment - .replace(/[^\r\n]/g, " ") - .replace(/ ([\r\n])/g, "\\$1"); - text = text.slice(0, i + htmlCommentBegin.length) + - blanks + text.slice(j); - } - i = j + htmlCommentEnd.length; - } - return text; -}; - -// Escapes a string for use in a RegExp -module.exports.escapeForRegExp = function escapeForRegExp(str) { - return str.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"); -}; - -// Un-escapes Markdown content (simple algorithm; not a parser) -const escapedMarkdownRe = /\\./g; -module.exports.unescapeMarkdown = - function unescapeMarkdown(markdown, replacement) { - return markdown.replace(escapedMarkdownRe, (match) => { - const char = match[1]; - if ("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".includes(char)) { - return replacement || char; - } - return match; - }); - }; - -/** - * Return the string representation of a fence markup character. - * - * @param {string} markup Fence string. - * @returns {string} String representation. - */ -module.exports.fencedCodeBlockStyleFor = - function fencedCodeBlockStyleFor(markup) { - switch (markup[0]) { - case "~": - return "tilde"; - default: - return "backtick"; - } - }; - -/** - * Return the number of characters of indent for a token. - * - * @param {Object} token MarkdownItToken instance. - * @returns {number} Characters of indent. - */ -function indentFor(token) { - const line = token.line.replace(/^[\s>]*(> |>)/, ""); - return line.length - line.trimLeft().length; -} -module.exports.indentFor = indentFor; - -// Returns the heading style for a heading token -module.exports.headingStyleFor = function headingStyleFor(token) { - if ((token.map[1] - token.map[0]) === 1) { - if (/[^\\]#\s*$/.test(token.line)) { - return "atx_closed"; - } - return "atx"; - } - return "setext"; -}; - -/** - * Return the string representation of an unordered list marker. - * - * @param {Object} token MarkdownItToken instance. - * @returns {string} String representation. - */ -module.exports.unorderedListStyleFor = function unorderedListStyleFor(token) { - switch (token.markup) { - case "-": - return "dash"; - case "+": - return "plus"; - // case "*": - default: - return "asterisk"; - } -}; - -/** - * Calls the provided function for each matching token. - * - * @param {Object} params RuleParams instance. - * @param {string} type Token type identifier. - * @param {Function} handler Callback function. - * @returns {void} - */ -function filterTokens(params, type, handler) { - params.tokens.forEach(function forToken(token) { - if (token.type === type) { - handler(token); - } - }); -} -module.exports.filterTokens = filterTokens; - -// Get line metadata array -module.exports.getLineMetadata = function getLineMetadata(params) { - const lineMetadata = params.lines.map(function mapLine(line, index) { - return [ line, index, false, 0, false, false ]; - }); - filterTokens(params, "fence", function forToken(token) { - lineMetadata[token.map[0]][3] = 1; - lineMetadata[token.map[1] - 1][3] = -1; - for (let i = token.map[0] + 1; i < token.map[1] - 1; i++) { - lineMetadata[i][2] = true; - } - }); - filterTokens(params, "code_block", function forToken(token) { - for (let i = token.map[0]; i < token.map[1]; i++) { - lineMetadata[i][2] = true; - } - }); - filterTokens(params, "table_open", function forToken(token) { - for (let i = token.map[0]; i < token.map[1]; i++) { - lineMetadata[i][4] = true; - } - }); - filterTokens(params, "list_item_open", function forToken(token) { - let count = 1; - for (let i = token.map[0]; i < token.map[1]; i++) { - lineMetadata[i][5] = count; - count++; - } - }); - filterTokens(params, "hr", function forToken(token) { - lineMetadata[token.map[0]][6] = true; - }); - return lineMetadata; -}; - -// Calls the provided function for each line (with context) -module.exports.forEachLine = function forEachLine(lineMetadata, handler) { - lineMetadata.forEach(function forMetadata(metadata) { - // Parameters: line, lineIndex, inCode, onFence, inTable, inItem, inBreak - handler(...metadata); - }); -}; - -// Returns (nested) lists as a flat array (in order) -module.exports.flattenLists = function flattenLists(params) { - const flattenedLists = []; - const stack = []; - let current = null; - let nesting = 0; - const nestingStack = []; - let lastWithMap = { "map": [ 0, 1 ] }; - params.tokens.forEach(function forToken(token) { - if ((token.type === "bullet_list_open") || - (token.type === "ordered_list_open")) { - // Save current context and start a new one - stack.push(current); - current = { - "unordered": (token.type === "bullet_list_open"), - "parentsUnordered": !current || - (current.unordered && current.parentsUnordered), - "open": token, - "indent": indentFor(token), - "parentIndent": (current && current.indent) || 0, - "items": [], - "nesting": nesting, - "lastLineIndex": -1, - "insert": flattenedLists.length - }; - nesting++; - } else if ((token.type === "bullet_list_close") || - (token.type === "ordered_list_close")) { - // Finalize current context and restore previous - current.lastLineIndex = lastWithMap.map[1]; - flattenedLists.splice(current.insert, 0, current); - delete current.insert; - current = stack.pop(); - nesting--; - } else if (token.type === "list_item_open") { - // Add list item - current.items.push(token); - } else if (token.type === "blockquote_open") { - nestingStack.push(nesting); - nesting = 0; - } else if (token.type === "blockquote_close") { - nesting = nestingStack.pop(); - } else if (token.map) { - // Track last token with map - lastWithMap = token; - } - }); - return flattenedLists; -}; - -// Calls the provided function for each specified inline child token -module.exports.forEachInlineChild = -function forEachInlineChild(params, type, handler) { - filterTokens(params, "inline", function forToken(token) { - token.children.forEach(function forChild(child) { - if (child.type === type) { - handler(child, token); - } - }); - }); -}; - -// Calls the provided function for each heading's content -module.exports.forEachHeading = function forEachHeading(params, handler) { - let heading = null; - params.tokens.forEach(function forToken(token) { - if (token.type === "heading_open") { - heading = token; - } else if (token.type === "heading_close") { - heading = null; - } else if ((token.type === "inline") && heading) { - handler(heading, token.content); - } - }); -}; - -/** - * Calls the provided function for each inline code span's content. - * - * @param {string} input Markdown content. - * @param {Function} handler Callback function. - * @returns {void} - */ -function forEachInlineCodeSpan(input, handler) { - let currentLine = 0; - let currentColumn = 0; - let index = 0; - while (index < input.length) { - let startIndex = -1; - let startLine = -1; - let startColumn = -1; - let tickCount = 0; - let currentTicks = 0; - let state = "normal"; - // Deliberate <= so trailing 0 completes the last span (ex: "text `code`") - for (; index <= input.length; index++) { - const char = input[index]; - // Ignore backticks in link destination - if ((char === "[") && (state === "normal")) { - state = "linkTextOpen"; - } else if ((char === "]") && (state === "linkTextOpen")) { - state = "linkTextClosed"; - } else if ((char === "(") && (state === "linkTextClosed")) { - state = "linkDestinationOpen"; - } else if ( - ((char === "(") && (state === "linkDestinationOpen")) || - ((char === ")") && (state === "linkDestinationOpen")) || - (state === "linkTextClosed")) { - state = "normal"; - } - // Parse backtick open/close - if ((char === "`") && (state !== "linkDestinationOpen")) { - // Count backticks at start or end of code span - currentTicks++; - if ((startIndex === -1) || (startColumn === -1)) { - startIndex = index + 1; - } - } else { - if ((startIndex >= 0) && - (startColumn >= 0) && - (tickCount === currentTicks)) { - // Found end backticks; invoke callback for code span - handler( - input.substring(startIndex, index - currentTicks), - startLine, startColumn, tickCount); - startIndex = -1; - startColumn = -1; - } else if ((startIndex >= 0) && (startColumn === -1)) { - // Found start backticks - tickCount = currentTicks; - startLine = currentLine; - startColumn = currentColumn; - } - // Not in backticks - currentTicks = 0; - } - if (char === "\n") { - // On next line - currentLine++; - currentColumn = 0; - } else if ((char === "\\") && - ((startIndex === -1) || (startColumn === -1)) && - (input[index + 1] !== "\n")) { - // Escape character outside code, skip next - index++; - currentColumn += 2; - } else { - // On next column - currentColumn++; - } - } - if (startIndex >= 0) { - // Restart loop after unmatched start backticks (ex: "`text``code``") - index = startIndex; - currentLine = startLine; - currentColumn = startColumn; - } - } -} -module.exports.forEachInlineCodeSpan = forEachInlineCodeSpan; - -/** - * Adds a generic error object via the onError callback. - * - * @param {Object} onError RuleOnError instance. - * @param {number} lineNumber Line number. - * @param {string} [detail] Error details. - * @param {string} [context] Error context. - * @param {number[]} [range] Column and length of error. - * @param {Object} [fixInfo] RuleOnErrorFixInfo instance. - * @returns {void} - */ -function addError(onError, lineNumber, detail, context, range, fixInfo) { - onError({ - lineNumber, - detail, - context, - range, - fixInfo - }); -} -module.exports.addError = addError; - -// Adds an error object with details conditionally via the onError callback -module.exports.addErrorDetailIf = function addErrorDetailIf( - onError, lineNumber, expected, actual, detail, context, range, fixInfo) { - if (expected !== actual) { - addError( - onError, - lineNumber, - "Expected: " + expected + "; Actual: " + actual + - (detail ? "; " + detail : ""), - context, - range, - fixInfo); - } -}; - -// Adds an error object with context via the onError callback -module.exports.addErrorContext = function addErrorContext( - onError, lineNumber, context, left, right, range, fixInfo) { - if (context.length <= 30) { - // Nothing to do - } else if (left && right) { - context = context.substr(0, 15) + "..." + context.substr(-15); - } else if (right) { - context = "..." + context.substr(-30); - } else { - context = context.substr(0, 30) + "..."; - } - addError(onError, lineNumber, null, context, range, fixInfo); -}; - -// Returns a range object for a line by applying a RegExp -module.exports.rangeFromRegExp = function rangeFromRegExp(line, regexp) { - let range = null; - const match = line.match(regexp); - if (match) { - const column = match.index + 1; - const length = match[0].length; - range = [ column, length ]; - } - return range; -}; - -// Determines if the front matter includes a title -module.exports.frontMatterHasTitle = - function frontMatterHasTitle(frontMatterLines, frontMatterTitlePattern) { - const ignoreFrontMatter = - (frontMatterTitlePattern !== undefined) && !frontMatterTitlePattern; - const frontMatterTitleRe = - new RegExp(String(frontMatterTitlePattern || "^\\s*title\\s*[:=]"), "i"); - return !ignoreFrontMatter && - frontMatterLines.some((line) => frontMatterTitleRe.test(line)); - }; - -/** - * Returns a list of emphasis markers in code spans and links. - * - * @param {Object} params RuleParams instance. - * @returns {number[][]} List of markers. - */ -function emphasisMarkersInContent(params) { - const { lines } = params; - const byLine = new Array(lines.length); - // Search code spans - filterTokens(params, "inline", (token) => { - const { children, lineNumber, map } = token; - if (children.some((child) => child.type === "code_inline")) { - const tokenLines = lines.slice(map[0], map[1]); - forEachInlineCodeSpan( - tokenLines.join("\n"), - (code, lineIndex, column, tickCount) => { - const codeLines = code.split(newLineRe); - codeLines.forEach((codeLine, codeLineIndex) => { - let match = null; - while ((match = emphasisMarkersRe.exec(codeLine))) { - const byLineIndex = lineNumber - 1 + lineIndex + codeLineIndex; - const inLine = byLine[byLineIndex] || []; - const codeLineOffset = codeLineIndex ? 0 : column - 1 + tickCount; - inLine.push(codeLineOffset + match.index); - byLine[byLineIndex] = inLine; - } - }); - } - ); - } - }); - // Search links - lines.forEach((tokenLine, tokenLineIndex) => { - let linkMatch = null; - while ((linkMatch = linkRe.exec(tokenLine))) { - let markerMatch = null; - while ((markerMatch = emphasisMarkersRe.exec(linkMatch[0]))) { - const inLine = byLine[tokenLineIndex] || []; - inLine.push(linkMatch.index + markerMatch.index); - byLine[tokenLineIndex] = inLine; - } - } - }); - return byLine; -} -module.exports.emphasisMarkersInContent = emphasisMarkersInContent; - -/** - * Gets the most common line ending, falling back to the platform default. - * - * @param {string} input Markdown content to analyze. - * @returns {string} Preferred line ending. - */ -function getPreferredLineEnding(input) { - let cr = 0; - let lf = 0; - let crlf = 0; - const endings = input.match(newLineRe) || []; - endings.forEach((ending) => { - // eslint-disable-next-line default-case - switch (ending) { - case "\r": - cr++; - break; - case "\n": - lf++; - break; - case "\r\n": - crlf++; - break; - } - }); - let preferredLineEnding = null; - if (!cr && !lf && !crlf) { - preferredLineEnding = os.EOL; - } else if ((lf >= crlf) && (lf >= cr)) { - preferredLineEnding = "\n"; - } else if (crlf >= cr) { - preferredLineEnding = "\r\n"; - } else { - preferredLineEnding = "\r"; - } - return preferredLineEnding; -} -module.exports.getPreferredLineEnding = getPreferredLineEnding; - -/** - * Normalizes the fields of a RuleOnErrorFixInfo instance. - * - * @param {Object} fixInfo RuleOnErrorFixInfo instance. - * @param {number} [lineNumber] Line number. - * @returns {Object} Normalized RuleOnErrorFixInfo instance. - */ -function normalizeFixInfo(fixInfo, lineNumber) { - return { - "lineNumber": fixInfo.lineNumber || lineNumber, - "editColumn": fixInfo.editColumn || 1, - "deleteCount": fixInfo.deleteCount || 0, - "insertText": fixInfo.insertText || "" - }; -} - -/** - * Fixes the specified error on a line of Markdown content. - * - * @param {string} line Line of Markdown content. - * @param {Object} fixInfo RuleOnErrorFixInfo instance. - * @param {string} lineEnding Line ending to use. - * @returns {string} Fixed content. - */ -function applyFix(line, fixInfo, lineEnding) { - const { editColumn, deleteCount, insertText } = normalizeFixInfo(fixInfo); - const editIndex = editColumn - 1; - return (deleteCount === -1) ? - null : - line.slice(0, editIndex) + - insertText.replace(/\n/g, lineEnding || "\n") + - line.slice(editIndex + deleteCount); -} -module.exports.applyFix = applyFix; - -// Applies as many fixes as possible to the input lines -module.exports.applyFixes = function applyFixes(input, errors) { - const lineEnding = getPreferredLineEnding(input); - const lines = input.split(newLineRe); - // Normalize fixInfo objects - let fixInfos = errors - .filter((error) => error.fixInfo) - .map((error) => normalizeFixInfo(error.fixInfo, error.lineNumber)); - // Sort bottom-to-top, line-deletes last, right-to-left, long-to-short - fixInfos.sort((a, b) => { - const aDeletingLine = (a.deleteCount === -1); - const bDeletingLine = (b.deleteCount === -1); - return ( - (b.lineNumber - a.lineNumber) || - (aDeletingLine ? 1 : (bDeletingLine ? -1 : 0)) || - (b.editColumn - a.editColumn) || - (b.insertText.length - a.insertText.length) - ); - }); - // Remove duplicate entries (needed for following collapse step) - let lastFixInfo = {}; - fixInfos = fixInfos.filter((fixInfo) => { - const unique = ( - (fixInfo.lineNumber !== lastFixInfo.lineNumber) || - (fixInfo.editColumn !== lastFixInfo.editColumn) || - (fixInfo.deleteCount !== lastFixInfo.deleteCount) || - (fixInfo.insertText !== lastFixInfo.insertText) - ); - lastFixInfo = fixInfo; - return unique; - }); - // Collapse insert/no-delete and no-insert/delete for same line/column - lastFixInfo = {}; - fixInfos.forEach((fixInfo) => { - if ( - (fixInfo.lineNumber === lastFixInfo.lineNumber) && - (fixInfo.editColumn === lastFixInfo.editColumn) && - !fixInfo.insertText && - (fixInfo.deleteCount > 0) && - lastFixInfo.insertText && - !lastFixInfo.deleteCount) { - fixInfo.insertText = lastFixInfo.insertText; - lastFixInfo.lineNumber = 0; - } - lastFixInfo = fixInfo; - }); - fixInfos = fixInfos.filter((fixInfo) => fixInfo.lineNumber); - // Apply all (remaining/updated) fixes - let lastLineIndex = -1; - let lastEditIndex = -1; - fixInfos.forEach((fixInfo) => { - const { lineNumber, editColumn, deleteCount } = fixInfo; - const lineIndex = lineNumber - 1; - const editIndex = editColumn - 1; - if ( - (lineIndex !== lastLineIndex) || - ((editIndex + deleteCount) < lastEditIndex) || - (deleteCount === -1) - ) { - lines[lineIndex] = applyFix(lines[lineIndex], fixInfo, lineEnding); - } - lastLineIndex = lineIndex; - lastEditIndex = editIndex; - }); - // Return corrected input - return lines.filter((line) => line !== null).join(lineEnding); -}; - - -/***/ }), -/* 157 */ -/***/ (function(module, exports, __webpack_require__) { - -var cc = __webpack_require__(158) -var join = __webpack_require__(38).join -var deepExtend = __webpack_require__(3) -var etc = '/etc' -var win = process.platform === "win32" -var home = win - ? process.env.USERPROFILE - : process.env.HOME - -module.exports = function (name, defaults, argv, parse) { - if('string' !== typeof name) - throw new Error('rc(name): name *must* be string') - if(!argv) - argv = __webpack_require__(161)(process.argv.slice(2)) - defaults = ( - 'string' === typeof defaults - ? cc.json(defaults) : defaults - ) || {} - - parse = parse || cc.parse - - var env = cc.env(name + '_') - - var configs = [defaults] - var configFiles = [] - function addConfigFile (file) { - if (configFiles.indexOf(file) >= 0) return - var fileConfig = cc.file(file) - if (fileConfig) { - configs.push(parse(fileConfig)) - configFiles.push(file) - } - } - - // which files do we look at? - if (!win) - [join(etc, name, 'config'), - join(etc, name + 'rc')].forEach(addConfigFile) - if (home) - [join(home, '.config', name, 'config'), - join(home, '.config', name), - join(home, '.' + name, 'config'), - join(home, '.' + name + 'rc')].forEach(addConfigFile) - addConfigFile(cc.find('.'+name+'rc')) - if (env.config) addConfigFile(env.config) - if (argv.config) addConfigFile(argv.config) - - return deepExtend.apply(null, configs.concat([ - env, - argv, - configFiles.length ? {configs: configFiles, config: configFiles[configFiles.length - 1]} : undefined, - ])) -} - - -/***/ }), -/* 158 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var fs = __webpack_require__(4) -var ini = __webpack_require__(159) -var path = __webpack_require__(38) -var stripJsonComments = __webpack_require__(160) - -var parse = exports.parse = function (content) { - - //if it ends in .json or starts with { then it must be json. - //must be done this way, because ini accepts everything. - //can't just try and parse it and let it throw if it's not ini. - //everything is ini. even json with a syntax error. - - if(/^\s*{/.test(content)) - return JSON.parse(stripJsonComments(content)) - return ini.parse(content) - -} - -var file = exports.file = function () { - var args = [].slice.call(arguments).filter(function (arg) { return arg != null }) - - //path.join breaks if it's a not a string, so just skip this. - for(var i in args) - if('string' !== typeof args[i]) - return - - var file = path.join.apply(null, args) - var content - try { - return fs.readFileSync(file,'utf-8') - } catch (err) { - return - } -} - -var json = exports.json = function () { - var content = file.apply(null, arguments) - return content ? parse(content) : null -} - -var env = exports.env = function (prefix, env) { - env = env || process.env - var obj = {} - var l = prefix.length - for(var k in env) { - if(k.toLowerCase().indexOf(prefix.toLowerCase()) === 0) { - - var keypath = k.substring(l).split('__') - - // Trim empty strings from keypath array - var _emptyStringIndex - while ((_emptyStringIndex=keypath.indexOf('')) > -1) { - keypath.splice(_emptyStringIndex, 1) - } - - var cursor = obj - keypath.forEach(function _buildSubObj(_subkey,i){ - - // (check for _subkey first so we ignore empty strings) - // (check for cursor to avoid assignment to primitive objects) - if (!_subkey || typeof cursor !== 'object') - return - - // If this is the last key, just stuff the value in there - // Assigns actual value from env variable to final key - // (unless it's just an empty string- in that case use the last valid key) - if (i === keypath.length-1) - cursor[_subkey] = env[k] - - - // Build sub-object if nothing already exists at the keypath - if (cursor[_subkey] === undefined) - cursor[_subkey] = {} - - // Increment cursor used to track the object at the current depth - cursor = cursor[_subkey] - - }) - - } - - } - - return obj -} - -var find = exports.find = function () { - var rel = path.join.apply(null, [].slice.call(arguments)) - - function find(start, rel) { - var file = path.join(start, rel) - try { - fs.statSync(file) - return file - } catch (err) { - if(path.dirname(start) !== start) // root - return find(path.dirname(start), rel) - } - } - return find(process.cwd(), rel) -} - - - - -/***/ }), -/* 159 */ -/***/ (function(module, exports) { - -exports.parse = exports.decode = decode - -exports.stringify = exports.encode = encode - -exports.safe = safe -exports.unsafe = unsafe - -var eol = typeof process !== 'undefined' && - process.platform === 'win32' ? '\r\n' : '\n' - -function encode (obj, opt) { - var children = [] - var out = '' - - if (typeof opt === 'string') { - opt = { - section: opt, - whitespace: false - } - } else { - opt = opt || {} - opt.whitespace = opt.whitespace === true - } - - var separator = opt.whitespace ? ' = ' : '=' - - Object.keys(obj).forEach(function (k, _, __) { - var val = obj[k] - if (val && Array.isArray(val)) { - val.forEach(function (item) { - out += safe(k + '[]') + separator + safe(item) + '\n' - }) - } else if (val && typeof val === 'object') { - children.push(k) - } else { - out += safe(k) + separator + safe(val) + eol - } - }) - - if (opt.section && out.length) { - out = '[' + safe(opt.section) + ']' + eol + out - } - - children.forEach(function (k, _, __) { - var nk = dotSplit(k).join('\\.') - var section = (opt.section ? opt.section + '.' : '') + nk - var child = encode(obj[k], { - section: section, - whitespace: opt.whitespace - }) - if (out.length && child.length) { - out += eol - } - out += child - }) - - return out -} - -function dotSplit (str) { - return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002') - .replace(/\\\./g, '\u0001') - .split(/\./).map(function (part) { - return part.replace(/\1/g, '\\.') - .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001') - }) -} - -function decode (str) { - var out = {} - var p = out - var section = null - // section |key = value - var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i - var lines = str.split(/[\r\n]+/g) - - lines.forEach(function (line, _, __) { - if (!line || line.match(/^\s*[;#]/)) return - var match = line.match(re) - if (!match) return - if (match[1] !== undefined) { - section = unsafe(match[1]) - p = out[section] = out[section] || {} - return - } - var key = unsafe(match[2]) - var value = match[3] ? unsafe(match[4]) : true - switch (value) { - case 'true': - case 'false': - case 'null': value = JSON.parse(value) - } - - // Convert keys with '[]' suffix to an array - if (key.length > 2 && key.slice(-2) === '[]') { - key = key.substring(0, key.length - 2) - if (!p[key]) { - p[key] = [] - } else if (!Array.isArray(p[key])) { - p[key] = [p[key]] - } - } - - // safeguard against resetting a previously defined - // array by accidentally forgetting the brackets - if (Array.isArray(p[key])) { - p[key].push(value) - } else { - p[key] = value - } - }) - - // {a:{y:1},"a.b":{x:2}} --> {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 - } - // 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) - 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] = {} - p = p[part] - }) - if (p === out && nl === l) { - return false - } - p[nl] = out[k] - return true - }).forEach(function (del, _, __) { - delete out[del] - }) - - return out -} - -function isQuoted (val) { - 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, '\\#') -} - -function unsafe (val, doUnesc) { - 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) - } - try { val = JSON.parse(val) } catch (_) {} - } else { - // walk the val to find the first not-escaped ; character - var esc = false - var unesc = '' - for (var i = 0, l = val.length; i < l; i++) { - var c = val.charAt(i) - if (esc) { - if ('\\;#'.indexOf(c) !== -1) { - unesc += c - } else { - unesc += '\\' + c - } - esc = false - } else if (';#'.indexOf(c) !== -1) { - break - } else if (c === '\\') { - esc = true - } else { - unesc += c - } - } - if (esc) { - unesc += '\\' - } - return unesc.trim() - } - return val -} - - -/***/ }), -/* 160 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var singleComment = 1; -var multiComment = 2; - -function stripWithoutWhitespace() { - return ''; -} - -function stripWithWhitespace(str, start, end) { - return str.slice(start, end).replace(/\S/g, ' '); -} - -module.exports = function (str, opts) { - opts = opts || {}; - - var currentChar; - var nextChar; - var insideString = false; - var insideComment = false; - var offset = 0; - var ret = ''; - var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace; - - for (var i = 0; i < str.length; i++) { - currentChar = str[i]; - nextChar = str[i + 1]; - - if (!insideComment && currentChar === '"') { - var escaped = str[i - 1] === '\\' && str[i - 2] !== '\\'; - if (!escaped) { - insideString = !insideString; - } - } - - if (insideString) { - continue; - } - - if (!insideComment && currentChar + nextChar === '//') { - ret += str.slice(offset, i); - offset = i; - insideComment = singleComment; - i++; - } else if (insideComment === singleComment && currentChar + nextChar === '\r\n') { - i++; - insideComment = false; - ret += strip(str, offset, i); - offset = i; - continue; - } else if (insideComment === singleComment && currentChar === '\n') { - insideComment = false; - ret += strip(str, offset, i); - offset = i; - } else if (!insideComment && currentChar + nextChar === '/*') { - ret += str.slice(offset, i); - offset = i; - insideComment = multiComment; - i++; - continue; - } else if (insideComment === multiComment && currentChar + nextChar === '*/') { - i++; - insideComment = false; - ret += strip(str, offset, i + 1); - offset = i + 1; - continue; - } - } - - return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset)); -}; - - -/***/ }), -/* 161 */ -/***/ (function(module, exports) { - -module.exports = function (args, opts) { - if (!opts) opts = {}; - - var flags = { bools : {}, strings : {}, unknownFn: null }; - - if (typeof opts['unknown'] === 'function') { - flags.unknownFn = opts['unknown']; - } - - if (typeof opts['boolean'] === 'boolean' && opts['boolean']) { - flags.allBools = true; - } else { - [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - }); - } - - var aliases = {}; - Object.keys(opts.alias || {}).forEach(function (key) { - aliases[key] = [].concat(opts.alias[key]); - aliases[key].forEach(function (x) { - aliases[x] = [key].concat(aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); - - [].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - if (aliases[key]) { - flags.strings[aliases[key]] = true; - } - }); - - var defaults = opts['default'] || {}; - - var argv = { _ : [] }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] === undefined ? false : defaults[key]); - }); - - var notFlags = []; - - if (args.indexOf('--') !== -1) { - notFlags = args.slice(args.indexOf('--')+1); - args = args.slice(0, args.indexOf('--')); - } - - function argDefined(key, arg) { - return (flags.allBools && /^--[^=]+$/.test(arg)) || - flags.strings[key] || flags.bools[key] || aliases[key]; - } - - function setArg (key, val, arg) { - if (arg && flags.unknownFn && !argDefined(key, arg)) { - if (flags.unknownFn(arg) === false) return; - } - - var value = !flags.strings[key] && isNumber(val) - ? Number(val) : val - ; - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), value); - }); - } - - function setKey (obj, keys, value) { - var o = obj; - for (var i = 0; i < keys.length-1; i++) { - var key = keys[i]; - if (key === '__proto__') return; - if (o[key] === undefined) o[key] = {}; - if (o[key] === Object.prototype || o[key] === Number.prototype - || o[key] === String.prototype) o[key] = {}; - if (o[key] === Array.prototype) o[key] = []; - o = o[key]; - } - - var key = keys[keys.length - 1]; - if (key === '__proto__') return; - if (o === Object.prototype || o === Number.prototype - || o === String.prototype) o = {}; - if (o === Array.prototype) o = []; - if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } - } - - function aliasIsBoolean(key) { - return aliases[key].some(function (x) { - return flags.bools[x]; - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (/^--.+=/.test(arg)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - var key = m[1]; - var value = m[2]; - if (flags.bools[key]) { - value = value !== 'false'; - } - setArg(key, value, arg); - } - else if (/^--no-.+/.test(arg)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false, arg); - } - else if (/^--.+/.test(arg)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !/^-/.test(next) - && !flags.bools[key] - && !flags.allBools - && (aliases[key] ? !aliasIsBoolean(key) : true)) { - setArg(key, next, arg); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true', arg); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } - else if (/^-[^-]+/.test(arg)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - var next = arg.slice(j+2); - - if (next === '-') { - setArg(letters[j], next, arg) - continue; - } - - if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) { - setArg(letters[j], next.split('=')[1], arg); - broken = true; - break; - } - - if (/[A-Za-z]/.test(letters[j]) - && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next, arg); - broken = true; - break; - } - - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2), arg); - broken = true; - break; - } - else { - setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg); - } - } - - var key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) - && !flags.bools[key] - && (aliases[key] ? !aliasIsBoolean(key) : true)) { - setArg(key, args[i+1], arg); - i++; - } - else if (args[i+1] && /^(true|false)$/.test(args[i+1])) { - setArg(key, args[i+1] === 'true', arg); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true, arg); - } - } - } - else { - if (!flags.unknownFn || flags.unknownFn(arg) !== false) { - argv._.push( - flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) - ); - } - if (opts.stopEarly) { - argv._.push.apply(argv._, args.slice(i + 1)); - break; - } - } - } - - Object.keys(defaults).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) { - setKey(argv, key.split('.'), defaults[key]); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), defaults[key]); - }); - } - }); - - if (opts['--']) { - argv['--'] = new Array(); - notFlags.forEach(function(key) { - argv['--'].push(key); - }); - } - else { - notFlags.forEach(function(key) { - argv._.push(key); - }); - } - - return argv; -}; - -function hasKey (obj, keys) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - o = (o[key] || {}); - }); - - var key = keys[keys.length - 1]; - return key in o; -} - -function isNumber (x) { - if (typeof x === 'number') return true; - if (/^0x[0-9a-f]+$/i.test(x)) return true; - return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} - - - -/***/ }), -/* 162 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(163); -exports.ErrorCodes = vscode_jsonrpc_1.ErrorCodes; -exports.ResponseError = vscode_jsonrpc_1.ResponseError; -exports.CancellationToken = vscode_jsonrpc_1.CancellationToken; -exports.CancellationTokenSource = vscode_jsonrpc_1.CancellationTokenSource; -exports.Disposable = vscode_jsonrpc_1.Disposable; -exports.Event = vscode_jsonrpc_1.Event; -exports.Emitter = vscode_jsonrpc_1.Emitter; -exports.Trace = vscode_jsonrpc_1.Trace; -exports.TraceFormat = vscode_jsonrpc_1.TraceFormat; -exports.SetTraceNotification = vscode_jsonrpc_1.SetTraceNotification; -exports.LogTraceNotification = vscode_jsonrpc_1.LogTraceNotification; -exports.RequestType = vscode_jsonrpc_1.RequestType; -exports.RequestType0 = vscode_jsonrpc_1.RequestType0; -exports.NotificationType = vscode_jsonrpc_1.NotificationType; -exports.NotificationType0 = vscode_jsonrpc_1.NotificationType0; -exports.MessageReader = vscode_jsonrpc_1.MessageReader; -exports.MessageWriter = vscode_jsonrpc_1.MessageWriter; -exports.ConnectionStrategy = vscode_jsonrpc_1.ConnectionStrategy; -exports.StreamMessageReader = vscode_jsonrpc_1.StreamMessageReader; -exports.StreamMessageWriter = vscode_jsonrpc_1.StreamMessageWriter; -exports.IPCMessageReader = vscode_jsonrpc_1.IPCMessageReader; -exports.IPCMessageWriter = vscode_jsonrpc_1.IPCMessageWriter; -exports.createClientPipeTransport = vscode_jsonrpc_1.createClientPipeTransport; -exports.createServerPipeTransport = vscode_jsonrpc_1.createServerPipeTransport; -exports.generateRandomPipeName = vscode_jsonrpc_1.generateRandomPipeName; -exports.createClientSocketTransport = vscode_jsonrpc_1.createClientSocketTransport; -exports.createServerSocketTransport = vscode_jsonrpc_1.createServerSocketTransport; -exports.ProgressType = vscode_jsonrpc_1.ProgressType; -__export(__webpack_require__(175)); -__export(__webpack_require__(176)); -const callHierarchy = __webpack_require__(188); -const st = __webpack_require__(189); -var Proposed; -(function (Proposed) { - let CallHierarchyPrepareRequest; - (function (CallHierarchyPrepareRequest) { - CallHierarchyPrepareRequest.method = callHierarchy.CallHierarchyPrepareRequest.method; - CallHierarchyPrepareRequest.type = callHierarchy.CallHierarchyPrepareRequest.type; - })(CallHierarchyPrepareRequest = Proposed.CallHierarchyPrepareRequest || (Proposed.CallHierarchyPrepareRequest = {})); - let CallHierarchyIncomingCallsRequest; - (function (CallHierarchyIncomingCallsRequest) { - CallHierarchyIncomingCallsRequest.method = callHierarchy.CallHierarchyIncomingCallsRequest.method; - CallHierarchyIncomingCallsRequest.type = callHierarchy.CallHierarchyIncomingCallsRequest.type; - })(CallHierarchyIncomingCallsRequest = Proposed.CallHierarchyIncomingCallsRequest || (Proposed.CallHierarchyIncomingCallsRequest = {})); - let CallHierarchyOutgoingCallsRequest; - (function (CallHierarchyOutgoingCallsRequest) { - CallHierarchyOutgoingCallsRequest.method = callHierarchy.CallHierarchyOutgoingCallsRequest.method; - CallHierarchyOutgoingCallsRequest.type = callHierarchy.CallHierarchyOutgoingCallsRequest.type; - })(CallHierarchyOutgoingCallsRequest = Proposed.CallHierarchyOutgoingCallsRequest || (Proposed.CallHierarchyOutgoingCallsRequest = {})); - Proposed.SemanticTokenTypes = st.SemanticTokenTypes; - Proposed.SemanticTokenModifiers = st.SemanticTokenModifiers; - Proposed.SemanticTokens = st.SemanticTokens; - let SemanticTokensRequest; - (function (SemanticTokensRequest) { - SemanticTokensRequest.method = st.SemanticTokensRequest.method; - SemanticTokensRequest.type = st.SemanticTokensRequest.type; - })(SemanticTokensRequest = Proposed.SemanticTokensRequest || (Proposed.SemanticTokensRequest = {})); - let SemanticTokensEditsRequest; - (function (SemanticTokensEditsRequest) { - SemanticTokensEditsRequest.method = st.SemanticTokensEditsRequest.method; - SemanticTokensEditsRequest.type = st.SemanticTokensEditsRequest.type; - })(SemanticTokensEditsRequest = Proposed.SemanticTokensEditsRequest || (Proposed.SemanticTokensEditsRequest = {})); - let SemanticTokensRangeRequest; - (function (SemanticTokensRangeRequest) { - SemanticTokensRangeRequest.method = st.SemanticTokensRangeRequest.method; - SemanticTokensRangeRequest.type = st.SemanticTokensRangeRequest.type; - })(SemanticTokensRangeRequest = Proposed.SemanticTokensRangeRequest || (Proposed.SemanticTokensRangeRequest = {})); -})(Proposed = exports.Proposed || (exports.Proposed = {})); -function createProtocolConnection(reader, writer, logger, strategy) { - return vscode_jsonrpc_1.createMessageConnection(reader, writer, logger, strategy); -} -exports.createProtocolConnection = createProtocolConnection; - - -/***/ }), -/* 163 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ -/// - -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -const Is = __webpack_require__(164); -const messages_1 = __webpack_require__(165); -exports.RequestType = messages_1.RequestType; -exports.RequestType0 = messages_1.RequestType0; -exports.RequestType1 = messages_1.RequestType1; -exports.RequestType2 = messages_1.RequestType2; -exports.RequestType3 = messages_1.RequestType3; -exports.RequestType4 = messages_1.RequestType4; -exports.RequestType5 = messages_1.RequestType5; -exports.RequestType6 = messages_1.RequestType6; -exports.RequestType7 = messages_1.RequestType7; -exports.RequestType8 = messages_1.RequestType8; -exports.RequestType9 = messages_1.RequestType9; -exports.ResponseError = messages_1.ResponseError; -exports.ErrorCodes = messages_1.ErrorCodes; -exports.NotificationType = messages_1.NotificationType; -exports.NotificationType0 = messages_1.NotificationType0; -exports.NotificationType1 = messages_1.NotificationType1; -exports.NotificationType2 = messages_1.NotificationType2; -exports.NotificationType3 = messages_1.NotificationType3; -exports.NotificationType4 = messages_1.NotificationType4; -exports.NotificationType5 = messages_1.NotificationType5; -exports.NotificationType6 = messages_1.NotificationType6; -exports.NotificationType7 = messages_1.NotificationType7; -exports.NotificationType8 = messages_1.NotificationType8; -exports.NotificationType9 = messages_1.NotificationType9; -const messageReader_1 = __webpack_require__(166); -exports.MessageReader = messageReader_1.MessageReader; -exports.StreamMessageReader = messageReader_1.StreamMessageReader; -exports.IPCMessageReader = messageReader_1.IPCMessageReader; -exports.SocketMessageReader = messageReader_1.SocketMessageReader; -const messageWriter_1 = __webpack_require__(168); -exports.MessageWriter = messageWriter_1.MessageWriter; -exports.StreamMessageWriter = messageWriter_1.StreamMessageWriter; -exports.IPCMessageWriter = messageWriter_1.IPCMessageWriter; -exports.SocketMessageWriter = messageWriter_1.SocketMessageWriter; -const events_1 = __webpack_require__(167); -exports.Disposable = events_1.Disposable; -exports.Event = events_1.Event; -exports.Emitter = events_1.Emitter; -const cancellation_1 = __webpack_require__(169); -exports.CancellationTokenSource = cancellation_1.CancellationTokenSource; -exports.CancellationToken = cancellation_1.CancellationToken; -const linkedMap_1 = __webpack_require__(170); -__export(__webpack_require__(171)); -__export(__webpack_require__(174)); -var CancelNotification; -(function (CancelNotification) { - CancelNotification.type = new messages_1.NotificationType('$/cancelRequest'); -})(CancelNotification || (CancelNotification = {})); -var ProgressNotification; -(function (ProgressNotification) { - ProgressNotification.type = new messages_1.NotificationType('$/progress'); -})(ProgressNotification || (ProgressNotification = {})); -class ProgressType { - constructor() { - } -} -exports.ProgressType = ProgressType; -exports.NullLogger = Object.freeze({ - error: () => { }, - warn: () => { }, - info: () => { }, - log: () => { } -}); -var Trace; -(function (Trace) { - Trace[Trace["Off"] = 0] = "Off"; - Trace[Trace["Messages"] = 1] = "Messages"; - Trace[Trace["Verbose"] = 2] = "Verbose"; -})(Trace = exports.Trace || (exports.Trace = {})); -(function (Trace) { - function fromString(value) { - if (!Is.string(value)) { - return Trace.Off; - } - value = value.toLowerCase(); - switch (value) { - case 'off': - return Trace.Off; - case 'messages': - return Trace.Messages; - case 'verbose': - return Trace.Verbose; - default: - return Trace.Off; - } - } - Trace.fromString = fromString; - function toString(value) { - switch (value) { - case Trace.Off: - return 'off'; - case Trace.Messages: - return 'messages'; - case Trace.Verbose: - return 'verbose'; - default: - return 'off'; - } - } - Trace.toString = toString; -})(Trace = exports.Trace || (exports.Trace = {})); -var TraceFormat; -(function (TraceFormat) { - TraceFormat["Text"] = "text"; - TraceFormat["JSON"] = "json"; -})(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {})); -(function (TraceFormat) { - function fromString(value) { - value = value.toLowerCase(); - if (value === 'json') { - return TraceFormat.JSON; - } - else { - return TraceFormat.Text; - } - } - TraceFormat.fromString = fromString; -})(TraceFormat = exports.TraceFormat || (exports.TraceFormat = {})); -var SetTraceNotification; -(function (SetTraceNotification) { - SetTraceNotification.type = new messages_1.NotificationType('$/setTraceNotification'); -})(SetTraceNotification = exports.SetTraceNotification || (exports.SetTraceNotification = {})); -var LogTraceNotification; -(function (LogTraceNotification) { - LogTraceNotification.type = new messages_1.NotificationType('$/logTraceNotification'); -})(LogTraceNotification = exports.LogTraceNotification || (exports.LogTraceNotification = {})); -var ConnectionErrors; -(function (ConnectionErrors) { - /** - * The connection is closed. - */ - ConnectionErrors[ConnectionErrors["Closed"] = 1] = "Closed"; - /** - * The connection got disposed. - */ - ConnectionErrors[ConnectionErrors["Disposed"] = 2] = "Disposed"; - /** - * The connection is already in listening mode. - */ - ConnectionErrors[ConnectionErrors["AlreadyListening"] = 3] = "AlreadyListening"; -})(ConnectionErrors = exports.ConnectionErrors || (exports.ConnectionErrors = {})); -class ConnectionError extends Error { - constructor(code, message) { - super(message); - this.code = code; - Object.setPrototypeOf(this, ConnectionError.prototype); - } -} -exports.ConnectionError = ConnectionError; -var ConnectionStrategy; -(function (ConnectionStrategy) { - function is(value) { - let candidate = value; - return candidate && Is.func(candidate.cancelUndispatched); - } - ConnectionStrategy.is = is; -})(ConnectionStrategy = exports.ConnectionStrategy || (exports.ConnectionStrategy = {})); -var ConnectionState; -(function (ConnectionState) { - ConnectionState[ConnectionState["New"] = 1] = "New"; - ConnectionState[ConnectionState["Listening"] = 2] = "Listening"; - ConnectionState[ConnectionState["Closed"] = 3] = "Closed"; - ConnectionState[ConnectionState["Disposed"] = 4] = "Disposed"; -})(ConnectionState || (ConnectionState = {})); -function _createMessageConnection(messageReader, messageWriter, logger, strategy) { - let sequenceNumber = 0; - let notificationSquenceNumber = 0; - let unknownResponseSquenceNumber = 0; - const version = '2.0'; - let starRequestHandler = undefined; - let requestHandlers = Object.create(null); - let starNotificationHandler = undefined; - let notificationHandlers = Object.create(null); - let progressHandlers = new Map(); - let timer; - let messageQueue = new linkedMap_1.LinkedMap(); - let responsePromises = Object.create(null); - let requestTokens = Object.create(null); - let trace = Trace.Off; - let traceFormat = TraceFormat.Text; - let tracer; - let state = ConnectionState.New; - let errorEmitter = new events_1.Emitter(); - let closeEmitter = new events_1.Emitter(); - let unhandledNotificationEmitter = new events_1.Emitter(); - let unhandledProgressEmitter = new events_1.Emitter(); - let disposeEmitter = new events_1.Emitter(); - function createRequestQueueKey(id) { - return 'req-' + id.toString(); - } - function createResponseQueueKey(id) { - if (id === null) { - return 'res-unknown-' + (++unknownResponseSquenceNumber).toString(); - } - else { - return 'res-' + id.toString(); - } - } - function createNotificationQueueKey() { - return 'not-' + (++notificationSquenceNumber).toString(); - } - function addMessageToQueue(queue, message) { - if (messages_1.isRequestMessage(message)) { - queue.set(createRequestQueueKey(message.id), message); - } - else if (messages_1.isResponseMessage(message)) { - queue.set(createResponseQueueKey(message.id), message); - } - else { - queue.set(createNotificationQueueKey(), message); - } - } - function cancelUndispatched(_message) { - return undefined; - } - function isListening() { - return state === ConnectionState.Listening; - } - function isClosed() { - return state === ConnectionState.Closed; - } - function isDisposed() { - return state === ConnectionState.Disposed; - } - function closeHandler() { - if (state === ConnectionState.New || state === ConnectionState.Listening) { - state = ConnectionState.Closed; - closeEmitter.fire(undefined); - } - // If the connection is disposed don't sent close events. - } - function readErrorHandler(error) { - errorEmitter.fire([error, undefined, undefined]); - } - function writeErrorHandler(data) { - errorEmitter.fire(data); - } - messageReader.onClose(closeHandler); - messageReader.onError(readErrorHandler); - messageWriter.onClose(closeHandler); - messageWriter.onError(writeErrorHandler); - function triggerMessageQueue() { - if (timer || messageQueue.size === 0) { - return; - } - timer = setImmediate(() => { - timer = undefined; - processMessageQueue(); - }); - } - function processMessageQueue() { - if (messageQueue.size === 0) { - return; - } - let message = messageQueue.shift(); - try { - if (messages_1.isRequestMessage(message)) { - handleRequest(message); - } - else if (messages_1.isNotificationMessage(message)) { - handleNotification(message); - } - else if (messages_1.isResponseMessage(message)) { - handleResponse(message); - } - else { - handleInvalidMessage(message); - } - } - finally { - triggerMessageQueue(); - } - } - let callback = (message) => { - try { - // We have received a cancellation message. Check if the message is still in the queue - // and cancel it if allowed to do so. - if (messages_1.isNotificationMessage(message) && message.method === CancelNotification.type.method) { - let key = createRequestQueueKey(message.params.id); - let toCancel = messageQueue.get(key); - if (messages_1.isRequestMessage(toCancel)) { - let response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel); - if (response && (response.error !== void 0 || response.result !== void 0)) { - messageQueue.delete(key); - response.id = toCancel.id; - traceSendingResponse(response, message.method, Date.now()); - messageWriter.write(response); - return; - } - } - } - addMessageToQueue(messageQueue, message); - } - finally { - triggerMessageQueue(); - } - }; - function handleRequest(requestMessage) { - if (isDisposed()) { - // we return here silently since we fired an event when the - // connection got disposed. - return; - } - function reply(resultOrError, method, startTime) { - let message = { - jsonrpc: version, - id: requestMessage.id - }; - if (resultOrError instanceof messages_1.ResponseError) { - message.error = resultOrError.toJson(); - } - else { - message.result = resultOrError === void 0 ? null : resultOrError; - } - traceSendingResponse(message, method, startTime); - messageWriter.write(message); - } - function replyError(error, method, startTime) { - let message = { - jsonrpc: version, - id: requestMessage.id, - error: error.toJson() - }; - traceSendingResponse(message, method, startTime); - messageWriter.write(message); - } - function replySuccess(result, method, startTime) { - // The JSON RPC defines that a response must either have a result or an error - // So we can't treat undefined as a valid response result. - if (result === void 0) { - result = null; - } - let message = { - jsonrpc: version, - id: requestMessage.id, - result: result - }; - traceSendingResponse(message, method, startTime); - messageWriter.write(message); - } - traceReceivedRequest(requestMessage); - let element = requestHandlers[requestMessage.method]; - let type; - let requestHandler; - if (element) { - type = element.type; - requestHandler = element.handler; - } - let startTime = Date.now(); - if (requestHandler || starRequestHandler) { - let cancellationSource = new cancellation_1.CancellationTokenSource(); - let tokenKey = String(requestMessage.id); - requestTokens[tokenKey] = cancellationSource; - try { - let handlerResult; - if (requestMessage.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) { - handlerResult = requestHandler - ? requestHandler(cancellationSource.token) - : starRequestHandler(requestMessage.method, cancellationSource.token); - } - else if (Is.array(requestMessage.params) && (type === void 0 || type.numberOfParams > 1)) { - handlerResult = requestHandler - ? requestHandler(...requestMessage.params, cancellationSource.token) - : starRequestHandler(requestMessage.method, ...requestMessage.params, cancellationSource.token); - } - else { - handlerResult = requestHandler - ? requestHandler(requestMessage.params, cancellationSource.token) - : starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token); - } - let promise = handlerResult; - if (!handlerResult) { - delete requestTokens[tokenKey]; - replySuccess(handlerResult, requestMessage.method, startTime); - } - else if (promise.then) { - promise.then((resultOrError) => { - delete requestTokens[tokenKey]; - reply(resultOrError, requestMessage.method, startTime); - }, error => { - delete requestTokens[tokenKey]; - if (error instanceof messages_1.ResponseError) { - replyError(error, requestMessage.method, startTime); - } - else if (error && Is.string(error.message)) { - replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime); - } - else { - replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime); - } - }); - } - else { - delete requestTokens[tokenKey]; - reply(handlerResult, requestMessage.method, startTime); - } - } - catch (error) { - delete requestTokens[tokenKey]; - if (error instanceof messages_1.ResponseError) { - reply(error, requestMessage.method, startTime); - } - else if (error && Is.string(error.message)) { - replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime); - } - else { - replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime); - } - } - } - else { - replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime); - } - } - function handleResponse(responseMessage) { - if (isDisposed()) { - // See handle request. - return; - } - if (responseMessage.id === null) { - if (responseMessage.error) { - logger.error(`Received response message without id: Error is: \n${JSON.stringify(responseMessage.error, undefined, 4)}`); - } - else { - logger.error(`Received response message without id. No further error information provided.`); - } - } - else { - let key = String(responseMessage.id); - let responsePromise = responsePromises[key]; - traceReceivedResponse(responseMessage, responsePromise); - if (responsePromise) { - delete responsePromises[key]; - try { - if (responseMessage.error) { - let error = responseMessage.error; - responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data)); - } - else if (responseMessage.result !== void 0) { - responsePromise.resolve(responseMessage.result); - } - else { - throw new Error('Should never happen.'); - } - } - catch (error) { - if (error.message) { - logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`); - } - else { - logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`); - } - } - } - } - } - function handleNotification(message) { - if (isDisposed()) { - // See handle request. - return; - } - let type = undefined; - let notificationHandler; - if (message.method === CancelNotification.type.method) { - notificationHandler = (params) => { - let id = params.id; - let source = requestTokens[String(id)]; - if (source) { - source.cancel(); - } - }; - } - else { - let element = notificationHandlers[message.method]; - if (element) { - notificationHandler = element.handler; - type = element.type; - } - } - if (notificationHandler || starNotificationHandler) { - try { - traceReceivedNotification(message); - if (message.params === void 0 || (type !== void 0 && type.numberOfParams === 0)) { - notificationHandler ? notificationHandler() : starNotificationHandler(message.method); - } - else if (Is.array(message.params) && (type === void 0 || type.numberOfParams > 1)) { - notificationHandler ? notificationHandler(...message.params) : starNotificationHandler(message.method, ...message.params); - } - else { - notificationHandler ? notificationHandler(message.params) : starNotificationHandler(message.method, message.params); - } - } - catch (error) { - if (error.message) { - logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`); - } - else { - logger.error(`Notification handler '${message.method}' failed unexpectedly.`); - } - } - } - else { - unhandledNotificationEmitter.fire(message); - } - } - function handleInvalidMessage(message) { - if (!message) { - logger.error('Received empty message.'); - return; - } - logger.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(message, null, 4)}`); - // Test whether we find an id to reject the promise - let responseMessage = message; - if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) { - let key = String(responseMessage.id); - let responseHandler = responsePromises[key]; - if (responseHandler) { - responseHandler.reject(new Error('The received response has neither a result nor an error property.')); - } - } - } - function traceSendingRequest(message) { - if (trace === Trace.Off || !tracer) { - return; - } - if (traceFormat === TraceFormat.Text) { - let data = undefined; - if (trace === Trace.Verbose && message.params) { - data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`; - } - tracer.log(`Sending request '${message.method} - (${message.id})'.`, data); - } - else { - logLSPMessage('send-request', message); - } - } - function traceSendingNotification(message) { - if (trace === Trace.Off || !tracer) { - return; - } - if (traceFormat === TraceFormat.Text) { - let data = undefined; - if (trace === Trace.Verbose) { - if (message.params) { - data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`; - } - else { - data = 'No parameters provided.\n\n'; - } - } - tracer.log(`Sending notification '${message.method}'.`, data); - } - else { - logLSPMessage('send-notification', message); - } - } - function traceSendingResponse(message, method, startTime) { - if (trace === Trace.Off || !tracer) { - return; - } - if (traceFormat === TraceFormat.Text) { - let data = undefined; - if (trace === Trace.Verbose) { - if (message.error && message.error.data) { - data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`; - } - else { - if (message.result) { - data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`; - } - else if (message.error === void 0) { - data = 'No result returned.\n\n'; - } - } - } - tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data); - } - else { - logLSPMessage('send-response', message); - } - } - function traceReceivedRequest(message) { - if (trace === Trace.Off || !tracer) { - return; - } - if (traceFormat === TraceFormat.Text) { - let data = undefined; - if (trace === Trace.Verbose && message.params) { - data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`; - } - tracer.log(`Received request '${message.method} - (${message.id})'.`, data); - } - else { - logLSPMessage('receive-request', message); - } - } - function traceReceivedNotification(message) { - if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) { - return; - } - if (traceFormat === TraceFormat.Text) { - let data = undefined; - if (trace === Trace.Verbose) { - if (message.params) { - data = `Params: ${JSON.stringify(message.params, null, 4)}\n\n`; - } - else { - data = 'No parameters provided.\n\n'; - } - } - tracer.log(`Received notification '${message.method}'.`, data); - } - else { - logLSPMessage('receive-notification', message); - } - } - function traceReceivedResponse(message, responsePromise) { - if (trace === Trace.Off || !tracer) { - return; - } - if (traceFormat === TraceFormat.Text) { - let data = undefined; - if (trace === Trace.Verbose) { - if (message.error && message.error.data) { - data = `Error data: ${JSON.stringify(message.error.data, null, 4)}\n\n`; - } - else { - if (message.result) { - data = `Result: ${JSON.stringify(message.result, null, 4)}\n\n`; - } - else if (message.error === void 0) { - data = 'No result returned.\n\n'; - } - } - } - if (responsePromise) { - let error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : ''; - tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data); - } - else { - tracer.log(`Received response ${message.id} without active response promise.`, data); - } - } - else { - logLSPMessage('receive-response', message); - } - } - function logLSPMessage(type, message) { - if (!tracer || trace === Trace.Off) { - return; - } - const lspMessage = { - isLSPMessage: true, - type, - message, - timestamp: Date.now() - }; - tracer.log(lspMessage); - } - function throwIfClosedOrDisposed() { - if (isClosed()) { - throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.'); - } - if (isDisposed()) { - throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.'); - } - } - function throwIfListening() { - if (isListening()) { - throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening'); - } - } - function throwIfNotListening() { - if (!isListening()) { - throw new Error('Call listen() first.'); - } - } - function undefinedToNull(param) { - if (param === void 0) { - return null; - } - else { - return param; - } - } - function computeMessageParams(type, params) { - let result; - let numberOfParams = type.numberOfParams; - switch (numberOfParams) { - case 0: - result = null; - break; - case 1: - result = undefinedToNull(params[0]); - break; - default: - result = []; - for (let i = 0; i < params.length && i < numberOfParams; i++) { - result.push(undefinedToNull(params[i])); - } - if (params.length < numberOfParams) { - for (let i = params.length; i < numberOfParams; i++) { - result.push(null); - } - } - break; - } - return result; - } - let connection = { - sendNotification: (type, ...params) => { - throwIfClosedOrDisposed(); - let method; - let messageParams; - if (Is.string(type)) { - method = type; - switch (params.length) { - case 0: - messageParams = null; - break; - case 1: - messageParams = params[0]; - break; - default: - messageParams = params; - break; - } - } - else { - method = type.method; - messageParams = computeMessageParams(type, params); - } - let notificationMessage = { - jsonrpc: version, - method: method, - params: messageParams - }; - traceSendingNotification(notificationMessage); - messageWriter.write(notificationMessage); - }, - onNotification: (type, handler) => { - throwIfClosedOrDisposed(); - if (Is.func(type)) { - starNotificationHandler = type; - } - else if (handler) { - if (Is.string(type)) { - notificationHandlers[type] = { type: undefined, handler }; - } - else { - notificationHandlers[type.method] = { type, handler }; - } - } - }, - onProgress: (_type, token, handler) => { - if (progressHandlers.has(token)) { - throw new Error(`Progress handler for token ${token} already registered`); - } - progressHandlers.set(token, handler); - return { - dispose: () => { - progressHandlers.delete(token); - } - }; - }, - sendProgress: (_type, token, value) => { - connection.sendNotification(ProgressNotification.type, { token, value }); - }, - onUnhandledProgress: unhandledProgressEmitter.event, - sendRequest: (type, ...params) => { - throwIfClosedOrDisposed(); - throwIfNotListening(); - let method; - let messageParams; - let token = undefined; - if (Is.string(type)) { - method = type; - switch (params.length) { - case 0: - messageParams = null; - break; - case 1: - // The cancellation token is optional so it can also be undefined. - if (cancellation_1.CancellationToken.is(params[0])) { - messageParams = null; - token = params[0]; - } - else { - messageParams = undefinedToNull(params[0]); - } - break; - default: - const last = params.length - 1; - if (cancellation_1.CancellationToken.is(params[last])) { - token = params[last]; - if (params.length === 2) { - messageParams = undefinedToNull(params[0]); - } - else { - messageParams = params.slice(0, last).map(value => undefinedToNull(value)); - } - } - else { - messageParams = params.map(value => undefinedToNull(value)); - } - break; - } - } - else { - method = type.method; - messageParams = computeMessageParams(type, params); - let numberOfParams = type.numberOfParams; - token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : undefined; - } - let id = sequenceNumber++; - let result = new Promise((resolve, reject) => { - let requestMessage = { - jsonrpc: version, - id: id, - method: method, - params: messageParams - }; - let responsePromise = { method: method, timerStart: Date.now(), resolve, reject }; - traceSendingRequest(requestMessage); - try { - messageWriter.write(requestMessage); - } - catch (e) { - // Writing the message failed. So we need to reject the promise. - responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, e.message ? e.message : 'Unknown reason')); - responsePromise = null; - } - if (responsePromise) { - responsePromises[String(id)] = responsePromise; - } - }); - if (token) { - token.onCancellationRequested(() => { - connection.sendNotification(CancelNotification.type, { id }); - }); - } - return result; - }, - onRequest: (type, handler) => { - throwIfClosedOrDisposed(); - if (Is.func(type)) { - starRequestHandler = type; - } - else if (handler) { - if (Is.string(type)) { - requestHandlers[type] = { type: undefined, handler }; - } - else { - requestHandlers[type.method] = { type, handler }; - } - } - }, - trace: (_value, _tracer, sendNotificationOrTraceOptions) => { - let _sendNotification = false; - let _traceFormat = TraceFormat.Text; - if (sendNotificationOrTraceOptions !== void 0) { - if (Is.boolean(sendNotificationOrTraceOptions)) { - _sendNotification = sendNotificationOrTraceOptions; - } - else { - _sendNotification = sendNotificationOrTraceOptions.sendNotification || false; - _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text; - } - } - trace = _value; - traceFormat = _traceFormat; - if (trace === Trace.Off) { - tracer = undefined; - } - else { - tracer = _tracer; - } - if (_sendNotification && !isClosed() && !isDisposed()) { - connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) }); - } - }, - onError: errorEmitter.event, - onClose: closeEmitter.event, - onUnhandledNotification: unhandledNotificationEmitter.event, - onDispose: disposeEmitter.event, - dispose: () => { - if (isDisposed()) { - return; - } - state = ConnectionState.Disposed; - disposeEmitter.fire(undefined); - let error = new Error('Connection got disposed.'); - Object.keys(responsePromises).forEach((key) => { - responsePromises[key].reject(error); - }); - responsePromises = Object.create(null); - requestTokens = Object.create(null); - messageQueue = new linkedMap_1.LinkedMap(); - // Test for backwards compatibility - if (Is.func(messageWriter.dispose)) { - messageWriter.dispose(); - } - if (Is.func(messageReader.dispose)) { - messageReader.dispose(); - } - }, - listen: () => { - throwIfClosedOrDisposed(); - throwIfListening(); - state = ConnectionState.Listening; - messageReader.listen(callback); - }, - inspect: () => { - // eslint-disable-next-line no-console - console.log('inspect'); - } - }; - connection.onNotification(LogTraceNotification.type, (params) => { - if (trace === Trace.Off || !tracer) { - return; - } - tracer.log(params.message, trace === Trace.Verbose ? params.verbose : undefined); - }); - connection.onNotification(ProgressNotification.type, (params) => { - const handler = progressHandlers.get(params.token); - if (handler) { - handler(params.value); - } - else { - unhandledProgressEmitter.fire(params); - } - }); - return connection; -} -function isMessageReader(value) { - return value.listen !== void 0 && value.read === void 0; -} -function isMessageWriter(value) { - return value.write !== void 0 && value.end === void 0; -} -function createMessageConnection(input, output, logger, strategy) { - if (!logger) { - logger = exports.NullLogger; - } - let reader = isMessageReader(input) ? input : new messageReader_1.StreamMessageReader(input); - let writer = isMessageWriter(output) ? output : new messageWriter_1.StreamMessageWriter(output); - return _createMessageConnection(reader, writer, logger, strategy); -} -exports.createMessageConnection = createMessageConnection; - - -/***/ }), -/* 164 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -function boolean(value) { - return value === true || value === false; -} -exports.boolean = boolean; -function string(value) { - return typeof value === 'string' || value instanceof String; -} -exports.string = string; -function number(value) { - return typeof value === 'number' || value instanceof Number; -} -exports.number = number; -function error(value) { - return value instanceof Error; -} -exports.error = error; -function func(value) { - return typeof value === 'function'; -} -exports.func = func; -function array(value) { - return Array.isArray(value); -} -exports.array = array; -function stringArray(value) { - return array(value) && value.every(elem => string(elem)); -} -exports.stringArray = stringArray; - - -/***/ }), -/* 165 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const is = __webpack_require__(164); -/** - * Predefined error codes. - */ -var ErrorCodes; -(function (ErrorCodes) { - // Defined by JSON RPC - ErrorCodes.ParseError = -32700; - ErrorCodes.InvalidRequest = -32600; - ErrorCodes.MethodNotFound = -32601; - ErrorCodes.InvalidParams = -32602; - ErrorCodes.InternalError = -32603; - ErrorCodes.serverErrorStart = -32099; - ErrorCodes.serverErrorEnd = -32000; - ErrorCodes.ServerNotInitialized = -32002; - ErrorCodes.UnknownErrorCode = -32001; - // Defined by the protocol. - ErrorCodes.RequestCancelled = -32800; - ErrorCodes.ContentModified = -32801; - // Defined by VSCode library. - ErrorCodes.MessageWriteError = 1; - ErrorCodes.MessageReadError = 2; -})(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {})); -/** - * An error object return in a response in case a request - * has failed. - */ -class ResponseError extends Error { - constructor(code, message, data) { - super(message); - this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode; - this.data = data; - Object.setPrototypeOf(this, ResponseError.prototype); - } - toJson() { - return { - code: this.code, - message: this.message, - data: this.data, - }; - } -} -exports.ResponseError = ResponseError; -/** - * An abstract implementation of a MessageType. - */ -class AbstractMessageType { - constructor(_method, _numberOfParams) { - this._method = _method; - this._numberOfParams = _numberOfParams; - } - get method() { - return this._method; - } - get numberOfParams() { - return this._numberOfParams; - } -} -exports.AbstractMessageType = AbstractMessageType; -/** - * Classes to type request response pairs - * - * The type parameter RO will be removed in the next major version - * of the JSON RPC library since it is a LSP concept and doesn't - * belong here. For now it is tagged as default never. - */ -class RequestType0 extends AbstractMessageType { - constructor(method) { - super(method, 0); - } -} -exports.RequestType0 = RequestType0; -class RequestType extends AbstractMessageType { - constructor(method) { - super(method, 1); - } -} -exports.RequestType = RequestType; -class RequestType1 extends AbstractMessageType { - constructor(method) { - super(method, 1); - } -} -exports.RequestType1 = RequestType1; -class RequestType2 extends AbstractMessageType { - constructor(method) { - super(method, 2); - } -} -exports.RequestType2 = RequestType2; -class RequestType3 extends AbstractMessageType { - constructor(method) { - super(method, 3); - } -} -exports.RequestType3 = RequestType3; -class RequestType4 extends AbstractMessageType { - constructor(method) { - super(method, 4); - } -} -exports.RequestType4 = RequestType4; -class RequestType5 extends AbstractMessageType { - constructor(method) { - super(method, 5); - } -} -exports.RequestType5 = RequestType5; -class RequestType6 extends AbstractMessageType { - constructor(method) { - super(method, 6); - } -} -exports.RequestType6 = RequestType6; -class RequestType7 extends AbstractMessageType { - constructor(method) { - super(method, 7); - } -} -exports.RequestType7 = RequestType7; -class RequestType8 extends AbstractMessageType { - constructor(method) { - super(method, 8); - } -} -exports.RequestType8 = RequestType8; -class RequestType9 extends AbstractMessageType { - constructor(method) { - super(method, 9); - } -} -exports.RequestType9 = RequestType9; -/** - * The type parameter RO will be removed in the next major version - * of the JSON RPC library since it is a LSP concept and doesn't - * belong here. For now it is tagged as default never. - */ -class NotificationType extends AbstractMessageType { - constructor(method) { - super(method, 1); - this._ = undefined; - } -} -exports.NotificationType = NotificationType; -class NotificationType0 extends AbstractMessageType { - constructor(method) { - super(method, 0); - } -} -exports.NotificationType0 = NotificationType0; -class NotificationType1 extends AbstractMessageType { - constructor(method) { - super(method, 1); - } -} -exports.NotificationType1 = NotificationType1; -class NotificationType2 extends AbstractMessageType { - constructor(method) { - super(method, 2); - } -} -exports.NotificationType2 = NotificationType2; -class NotificationType3 extends AbstractMessageType { - constructor(method) { - super(method, 3); - } -} -exports.NotificationType3 = NotificationType3; -class NotificationType4 extends AbstractMessageType { - constructor(method) { - super(method, 4); - } -} -exports.NotificationType4 = NotificationType4; -class NotificationType5 extends AbstractMessageType { - constructor(method) { - super(method, 5); - } -} -exports.NotificationType5 = NotificationType5; -class NotificationType6 extends AbstractMessageType { - constructor(method) { - super(method, 6); - } -} -exports.NotificationType6 = NotificationType6; -class NotificationType7 extends AbstractMessageType { - constructor(method) { - super(method, 7); - } -} -exports.NotificationType7 = NotificationType7; -class NotificationType8 extends AbstractMessageType { - constructor(method) { - super(method, 8); - } -} -exports.NotificationType8 = NotificationType8; -class NotificationType9 extends AbstractMessageType { - constructor(method) { - super(method, 9); - } -} -exports.NotificationType9 = NotificationType9; -/** - * Tests if the given message is a request message - */ -function isRequestMessage(message) { - let candidate = message; - return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id)); -} -exports.isRequestMessage = isRequestMessage; -/** - * Tests if the given message is a notification message - */ -function isNotificationMessage(message) { - let candidate = message; - return candidate && is.string(candidate.method) && message.id === void 0; -} -exports.isNotificationMessage = isNotificationMessage; -/** - * Tests if the given message is a response message - */ -function isResponseMessage(message) { - let candidate = message; - return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null); -} -exports.isResponseMessage = isResponseMessage; - - -/***/ }), -/* 166 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const events_1 = __webpack_require__(167); -const Is = __webpack_require__(164); -let DefaultSize = 8192; -let CR = Buffer.from('\r', 'ascii')[0]; -let LF = Buffer.from('\n', 'ascii')[0]; -let CRLF = '\r\n'; -class MessageBuffer { - constructor(encoding = 'utf8') { - this.encoding = encoding; - this.index = 0; - this.buffer = Buffer.allocUnsafe(DefaultSize); - } - append(chunk) { - var toAppend = chunk; - if (typeof (chunk) === 'string') { - var str = chunk; - var bufferLen = Buffer.byteLength(str, this.encoding); - toAppend = Buffer.allocUnsafe(bufferLen); - toAppend.write(str, 0, bufferLen, this.encoding); - } - if (this.buffer.length - this.index >= toAppend.length) { - toAppend.copy(this.buffer, this.index, 0, toAppend.length); - } - else { - var newSize = (Math.ceil((this.index + toAppend.length) / DefaultSize) + 1) * DefaultSize; - if (this.index === 0) { - this.buffer = Buffer.allocUnsafe(newSize); - toAppend.copy(this.buffer, 0, 0, toAppend.length); - } - else { - this.buffer = Buffer.concat([this.buffer.slice(0, this.index), toAppend], newSize); - } - } - this.index += toAppend.length; - } - tryReadHeaders() { - let result = undefined; - let current = 0; - while (current + 3 < this.index && (this.buffer[current] !== CR || this.buffer[current + 1] !== LF || this.buffer[current + 2] !== CR || this.buffer[current + 3] !== LF)) { - current++; - } - // No header / body separator found (e.g CRLFCRLF) - if (current + 3 >= this.index) { - return result; - } - result = Object.create(null); - let headers = this.buffer.toString('ascii', 0, current).split(CRLF); - headers.forEach((header) => { - let index = header.indexOf(':'); - if (index === -1) { - throw new Error('Message header must separate key and value using :'); - } - let key = header.substr(0, index); - let value = header.substr(index + 1).trim(); - result[key] = value; - }); - let nextStart = current + 4; - this.buffer = this.buffer.slice(nextStart); - this.index = this.index - nextStart; - return result; - } - tryReadContent(length) { - if (this.index < length) { - return null; - } - let result = this.buffer.toString(this.encoding, 0, length); - let nextStart = length; - this.buffer.copy(this.buffer, 0, nextStart); - this.index = this.index - nextStart; - return result; - } - get numberOfBytes() { - return this.index; - } -} -var MessageReader; -(function (MessageReader) { - function is(value) { - let candidate = value; - return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) && - Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage); - } - MessageReader.is = is; -})(MessageReader = exports.MessageReader || (exports.MessageReader = {})); -class AbstractMessageReader { - constructor() { - this.errorEmitter = new events_1.Emitter(); - this.closeEmitter = new events_1.Emitter(); - this.partialMessageEmitter = new events_1.Emitter(); - } - dispose() { - this.errorEmitter.dispose(); - this.closeEmitter.dispose(); - } - get onError() { - return this.errorEmitter.event; - } - fireError(error) { - this.errorEmitter.fire(this.asError(error)); - } - get onClose() { - return this.closeEmitter.event; - } - fireClose() { - this.closeEmitter.fire(undefined); - } - get onPartialMessage() { - return this.partialMessageEmitter.event; - } - firePartialMessage(info) { - this.partialMessageEmitter.fire(info); - } - asError(error) { - if (error instanceof Error) { - return error; - } - else { - return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`); - } - } -} -exports.AbstractMessageReader = AbstractMessageReader; -class StreamMessageReader extends AbstractMessageReader { - constructor(readable, encoding = 'utf8') { - super(); - this.readable = readable; - this.buffer = new MessageBuffer(encoding); - this._partialMessageTimeout = 10000; - } - set partialMessageTimeout(timeout) { - this._partialMessageTimeout = timeout; - } - get partialMessageTimeout() { - return this._partialMessageTimeout; - } - listen(callback) { - this.nextMessageLength = -1; - this.messageToken = 0; - this.partialMessageTimer = undefined; - this.callback = callback; - this.readable.on('data', (data) => { - this.onData(data); - }); - this.readable.on('error', (error) => this.fireError(error)); - this.readable.on('close', () => this.fireClose()); - } - onData(data) { - this.buffer.append(data); - while (true) { - if (this.nextMessageLength === -1) { - let headers = this.buffer.tryReadHeaders(); - if (!headers) { - return; - } - let contentLength = headers['Content-Length']; - if (!contentLength) { - throw new Error('Header must provide a Content-Length property.'); - } - let length = parseInt(contentLength); - if (isNaN(length)) { - throw new Error('Content-Length value must be a number.'); - } - this.nextMessageLength = length; - // Take the encoding form the header. For compatibility - // treat both utf-8 and utf8 as node utf8 - } - var msg = this.buffer.tryReadContent(this.nextMessageLength); - if (msg === null) { - /** We haven't received the full message yet. */ - this.setPartialMessageTimer(); - return; - } - this.clearPartialMessageTimer(); - this.nextMessageLength = -1; - this.messageToken++; - var json = JSON.parse(msg); - this.callback(json); - } - } - clearPartialMessageTimer() { - if (this.partialMessageTimer) { - clearTimeout(this.partialMessageTimer); - this.partialMessageTimer = undefined; - } - } - setPartialMessageTimer() { - this.clearPartialMessageTimer(); - if (this._partialMessageTimeout <= 0) { - return; - } - this.partialMessageTimer = setTimeout((token, timeout) => { - this.partialMessageTimer = undefined; - if (token === this.messageToken) { - this.firePartialMessage({ messageToken: token, waitingTime: timeout }); - this.setPartialMessageTimer(); - } - }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout); - } -} -exports.StreamMessageReader = StreamMessageReader; -class IPCMessageReader extends AbstractMessageReader { - constructor(process) { - super(); - this.process = process; - let eventEmitter = this.process; - eventEmitter.on('error', (error) => this.fireError(error)); - eventEmitter.on('close', () => this.fireClose()); - } - listen(callback) { - this.process.on('message', callback); - } -} -exports.IPCMessageReader = IPCMessageReader; -class SocketMessageReader extends StreamMessageReader { - constructor(socket, encoding = 'utf-8') { - super(socket, encoding); - } -} -exports.SocketMessageReader = SocketMessageReader; - - -/***/ }), -/* 167 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -var Disposable; -(function (Disposable) { - function create(func) { - return { - dispose: func - }; - } - Disposable.create = create; -})(Disposable = exports.Disposable || (exports.Disposable = {})); -var Event; -(function (Event) { - const _disposable = { dispose() { } }; - Event.None = function () { return _disposable; }; -})(Event = exports.Event || (exports.Event = {})); -class CallbackList { - add(callback, context = null, bucket) { - if (!this._callbacks) { - this._callbacks = []; - this._contexts = []; - } - this._callbacks.push(callback); - this._contexts.push(context); - if (Array.isArray(bucket)) { - bucket.push({ dispose: () => this.remove(callback, context) }); - } - } - remove(callback, context = null) { - if (!this._callbacks) { - return; - } - var foundCallbackWithDifferentContext = false; - for (var i = 0, len = this._callbacks.length; i < len; i++) { - if (this._callbacks[i] === callback) { - if (this._contexts[i] === context) { - // callback & context match => remove it - this._callbacks.splice(i, 1); - this._contexts.splice(i, 1); - return; - } - else { - foundCallbackWithDifferentContext = true; - } - } - } - if (foundCallbackWithDifferentContext) { - throw new Error('When adding a listener with a context, you should remove it with the same context'); - } - } - invoke(...args) { - if (!this._callbacks) { - return []; - } - var ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0); - for (var i = 0, len = callbacks.length; i < len; i++) { - try { - ret.push(callbacks[i].apply(contexts[i], args)); - } - catch (e) { - // eslint-disable-next-line no-console - console.error(e); - } - } - return ret; - } - isEmpty() { - return !this._callbacks || this._callbacks.length === 0; - } - dispose() { - this._callbacks = undefined; - this._contexts = undefined; - } -} -class Emitter { - constructor(_options) { - this._options = _options; - } - /** - * For the public to allow to subscribe - * to events from this Emitter - */ - get event() { - if (!this._event) { - this._event = (listener, thisArgs, disposables) => { - if (!this._callbacks) { - this._callbacks = new CallbackList(); - } - if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) { - this._options.onFirstListenerAdd(this); - } - this._callbacks.add(listener, thisArgs); - let result; - result = { - dispose: () => { - this._callbacks.remove(listener, thisArgs); - result.dispose = Emitter._noop; - if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) { - this._options.onLastListenerRemove(this); - } - } - }; - if (Array.isArray(disposables)) { - disposables.push(result); - } - return result; - }; - } - return this._event; - } - /** - * To be kept private to fire an event to - * subscribers - */ - fire(event) { - if (this._callbacks) { - this._callbacks.invoke.call(this._callbacks, event); - } - } - dispose() { - if (this._callbacks) { - this._callbacks.dispose(); - this._callbacks = undefined; - } - } -} -exports.Emitter = Emitter; -Emitter._noop = function () { }; - - -/***/ }), -/* 168 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const events_1 = __webpack_require__(167); -const Is = __webpack_require__(164); -let ContentLength = 'Content-Length: '; -let CRLF = '\r\n'; -var MessageWriter; -(function (MessageWriter) { - function is(value) { - let candidate = value; - return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) && - Is.func(candidate.onError) && Is.func(candidate.write); - } - MessageWriter.is = is; -})(MessageWriter = exports.MessageWriter || (exports.MessageWriter = {})); -class AbstractMessageWriter { - constructor() { - this.errorEmitter = new events_1.Emitter(); - this.closeEmitter = new events_1.Emitter(); - } - dispose() { - this.errorEmitter.dispose(); - this.closeEmitter.dispose(); - } - get onError() { - return this.errorEmitter.event; - } - fireError(error, message, count) { - this.errorEmitter.fire([this.asError(error), message, count]); - } - get onClose() { - return this.closeEmitter.event; - } - fireClose() { - this.closeEmitter.fire(undefined); - } - asError(error) { - if (error instanceof Error) { - return error; - } - else { - return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : 'unknown'}`); - } - } -} -exports.AbstractMessageWriter = AbstractMessageWriter; -class StreamMessageWriter extends AbstractMessageWriter { - constructor(writable, encoding = 'utf8') { - super(); - this.writable = writable; - this.encoding = encoding; - this.errorCount = 0; - this.writable.on('error', (error) => this.fireError(error)); - this.writable.on('close', () => this.fireClose()); - } - write(msg) { - let json = JSON.stringify(msg); - let contentLength = Buffer.byteLength(json, this.encoding); - let headers = [ - ContentLength, contentLength.toString(), CRLF, - CRLF - ]; - try { - // Header must be written in ASCII encoding - this.writable.write(headers.join(''), 'ascii'); - // Now write the content. This can be written in any encoding - this.writable.write(json, this.encoding); - this.errorCount = 0; - } - catch (error) { - this.errorCount++; - this.fireError(error, msg, this.errorCount); - } - } -} -exports.StreamMessageWriter = StreamMessageWriter; -class IPCMessageWriter extends AbstractMessageWriter { - constructor(process) { - super(); - this.process = process; - this.errorCount = 0; - this.queue = []; - this.sending = false; - let eventEmitter = this.process; - eventEmitter.on('error', (error) => this.fireError(error)); - eventEmitter.on('close', () => this.fireClose); - } - write(msg) { - if (!this.sending && this.queue.length === 0) { - // See https://github.com/nodejs/node/issues/7657 - this.doWriteMessage(msg); - } - else { - this.queue.push(msg); - } - } - doWriteMessage(msg) { - try { - if (this.process.send) { - this.sending = true; - this.process.send(msg, undefined, undefined, (error) => { - this.sending = false; - if (error) { - this.errorCount++; - this.fireError(error, msg, this.errorCount); - } - else { - this.errorCount = 0; - } - if (this.queue.length > 0) { - this.doWriteMessage(this.queue.shift()); - } - }); - } - } - catch (error) { - this.errorCount++; - this.fireError(error, msg, this.errorCount); - } - } -} -exports.IPCMessageWriter = IPCMessageWriter; -class SocketMessageWriter extends AbstractMessageWriter { - constructor(socket, encoding = 'utf8') { - super(); - this.socket = socket; - this.queue = []; - this.sending = false; - this.encoding = encoding; - this.errorCount = 0; - this.socket.on('error', (error) => this.fireError(error)); - this.socket.on('close', () => this.fireClose()); - } - dispose() { - super.dispose(); - this.socket.destroy(); - } - write(msg) { - if (!this.sending && this.queue.length === 0) { - // See https://github.com/nodejs/node/issues/7657 - this.doWriteMessage(msg); - } - else { - this.queue.push(msg); - } - } - doWriteMessage(msg) { - let json = JSON.stringify(msg); - let contentLength = Buffer.byteLength(json, this.encoding); - let headers = [ - ContentLength, contentLength.toString(), CRLF, - CRLF - ]; - try { - // Header must be written in ASCII encoding - this.sending = true; - this.socket.write(headers.join(''), 'ascii', (error) => { - if (error) { - this.handleError(error, msg); - } - try { - // Now write the content. This can be written in any encoding - this.socket.write(json, this.encoding, (error) => { - this.sending = false; - if (error) { - this.handleError(error, msg); - } - else { - this.errorCount = 0; - } - if (this.queue.length > 0) { - this.doWriteMessage(this.queue.shift()); - } - }); - } - catch (error) { - this.handleError(error, msg); - } - }); - } - catch (error) { - this.handleError(error, msg); - } - } - handleError(error, msg) { - this.errorCount++; - this.fireError(error, msg, this.errorCount); - } -} -exports.SocketMessageWriter = SocketMessageWriter; - - -/***/ }), -/* 169 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -Object.defineProperty(exports, "__esModule", { value: true }); -const events_1 = __webpack_require__(167); -const Is = __webpack_require__(164); -var CancellationToken; -(function (CancellationToken) { - CancellationToken.None = Object.freeze({ - isCancellationRequested: false, - onCancellationRequested: events_1.Event.None - }); - CancellationToken.Cancelled = Object.freeze({ - isCancellationRequested: true, - onCancellationRequested: events_1.Event.None - }); - function is(value) { - let candidate = value; - return candidate && (candidate === CancellationToken.None - || candidate === CancellationToken.Cancelled - || (Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested)); - } - CancellationToken.is = is; -})(CancellationToken = exports.CancellationToken || (exports.CancellationToken = {})); -const shortcutEvent = Object.freeze(function (callback, context) { - let handle = setTimeout(callback.bind(context), 0); - return { dispose() { clearTimeout(handle); } }; -}); -class MutableToken { - constructor() { - this._isCancelled = false; - } - cancel() { - if (!this._isCancelled) { - this._isCancelled = true; - if (this._emitter) { - this._emitter.fire(undefined); - this.dispose(); - } - } - } - get isCancellationRequested() { - return this._isCancelled; - } - get onCancellationRequested() { - if (this._isCancelled) { - return shortcutEvent; - } - if (!this._emitter) { - this._emitter = new events_1.Emitter(); - } - return this._emitter.event; - } - dispose() { - if (this._emitter) { - this._emitter.dispose(); - this._emitter = undefined; - } - } -} -class CancellationTokenSource { - get token() { - if (!this._token) { - // be lazy and create the token only when - // actually needed - this._token = new MutableToken(); - } - return this._token; - } - cancel() { - if (!this._token) { - // save an object by returning the default - // cancelled token when cancellation happens - // before someone asks for the token - this._token = CancellationToken.Cancelled; - } - else { - this._token.cancel(); - } - } - dispose() { - if (!this._token) { - // ensure to initialize with an empty token if we had none - this._token = CancellationToken.None; - } - else if (this._token instanceof MutableToken) { - // actually dispose - this._token.dispose(); - } - } -} -exports.CancellationTokenSource = CancellationTokenSource; - - -/***/ }), -/* 170 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -var Touch; -(function (Touch) { - Touch.None = 0; - Touch.First = 1; - Touch.Last = 2; -})(Touch = exports.Touch || (exports.Touch = {})); -class LinkedMap { - constructor() { - this._map = new Map(); - this._head = undefined; - this._tail = undefined; - this._size = 0; - } - clear() { - this._map.clear(); - this._head = undefined; - this._tail = undefined; - this._size = 0; - } - isEmpty() { - return !this._head && !this._tail; - } - get size() { - return this._size; - } - has(key) { - return this._map.has(key); - } - get(key) { - const item = this._map.get(key); - if (!item) { - return undefined; - } - return item.value; - } - set(key, value, touch = Touch.None) { - let item = this._map.get(key); - if (item) { - item.value = value; - if (touch !== Touch.None) { - this.touch(item, touch); - } - } - else { - item = { key, value, next: undefined, previous: undefined }; - switch (touch) { - case Touch.None: - this.addItemLast(item); - break; - case Touch.First: - this.addItemFirst(item); - break; - case Touch.Last: - this.addItemLast(item); - break; - default: - this.addItemLast(item); - break; - } - this._map.set(key, item); - this._size++; - } - } - delete(key) { - const item = this._map.get(key); - if (!item) { - return false; - } - this._map.delete(key); - this.removeItem(item); - this._size--; - return true; - } - shift() { - if (!this._head && !this._tail) { - return undefined; - } - if (!this._head || !this._tail) { - throw new Error('Invalid list'); - } - const item = this._head; - this._map.delete(item.key); - this.removeItem(item); - this._size--; - return item.value; - } - forEach(callbackfn, thisArg) { - let current = this._head; - while (current) { - if (thisArg) { - callbackfn.bind(thisArg)(current.value, current.key, this); - } - else { - callbackfn(current.value, current.key, this); - } - current = current.next; - } - } - forEachReverse(callbackfn, thisArg) { - let current = this._tail; - while (current) { - if (thisArg) { - callbackfn.bind(thisArg)(current.value, current.key, this); - } - else { - callbackfn(current.value, current.key, this); - } - current = current.previous; - } - } - values() { - let result = []; - let current = this._head; - while (current) { - result.push(current.value); - current = current.next; - } - return result; - } - keys() { - let result = []; - let current = this._head; - while (current) { - result.push(current.key); - current = current.next; - } - return result; - } - /* JSON RPC run on es5 which has no Symbol.iterator - public keys(): IterableIterator { - let current = this._head; - let iterator: IterableIterator = { - [Symbol.iterator]() { - return iterator; - }, - next():IteratorResult { - if (current) { - let result = { value: current.key, done: false }; - current = current.next; - return result; - } else { - return { value: undefined, done: true }; - } - } - }; - return iterator; - } - - public values(): IterableIterator { - let current = this._head; - let iterator: IterableIterator = { - [Symbol.iterator]() { - return iterator; - }, - next():IteratorResult { - if (current) { - let result = { value: current.value, done: false }; - current = current.next; - return result; - } else { - return { value: undefined, done: true }; - } - } - }; - return iterator; - } - */ - addItemFirst(item) { - // First time Insert - if (!this._head && !this._tail) { - this._tail = item; - } - else if (!this._head) { - throw new Error('Invalid list'); - } - else { - item.next = this._head; - this._head.previous = item; - } - this._head = item; - } - addItemLast(item) { - // First time Insert - if (!this._head && !this._tail) { - this._head = item; - } - else if (!this._tail) { - throw new Error('Invalid list'); - } - else { - item.previous = this._tail; - this._tail.next = item; - } - this._tail = item; - } - removeItem(item) { - if (item === this._head && item === this._tail) { - this._head = undefined; - this._tail = undefined; - } - else if (item === this._head) { - this._head = item.next; - } - else if (item === this._tail) { - this._tail = item.previous; - } - else { - const next = item.next; - const previous = item.previous; - if (!next || !previous) { - throw new Error('Invalid list'); - } - next.previous = previous; - previous.next = next; - } - } - touch(item, touch) { - if (!this._head || !this._tail) { - throw new Error('Invalid list'); - } - if ((touch !== Touch.First && touch !== Touch.Last)) { - return; - } - if (touch === Touch.First) { - if (item === this._head) { - return; - } - const next = item.next; - const previous = item.previous; - // Unlink the item - if (item === this._tail) { - // previous must be defined since item was not head but is tail - // So there are more than on item in the map - previous.next = undefined; - this._tail = previous; - } - else { - // Both next and previous are not undefined since item was neither head nor tail. - next.previous = previous; - previous.next = next; - } - // Insert the node at head - item.previous = undefined; - item.next = this._head; - this._head.previous = item; - this._head = item; - } - else if (touch === Touch.Last) { - if (item === this._tail) { - return; - } - const next = item.next; - const previous = item.previous; - // Unlink the item. - if (item === this._head) { - // next must be defined since item was not tail but is head - // So there are more than on item in the map - next.previous = undefined; - this._head = next; - } - else { - // Both next and previous are not undefined since item was neither head nor tail. - next.previous = previous; - previous.next = next; - } - item.next = undefined; - item.previous = this._tail; - this._tail.next = item; - this._tail = item; - } - } -} -exports.LinkedMap = LinkedMap; - - -/***/ }), -/* 171 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const path_1 = __webpack_require__(38); -const os_1 = __webpack_require__(111); -const crypto_1 = __webpack_require__(172); -const net_1 = __webpack_require__(173); -const messageReader_1 = __webpack_require__(166); -const messageWriter_1 = __webpack_require__(168); -function generateRandomPipeName() { - const randomSuffix = crypto_1.randomBytes(21).toString('hex'); - if (process.platform === 'win32') { - return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`; - } - else { - // Mac/Unix: use socket file - return path_1.join(os_1.tmpdir(), `vscode-${randomSuffix}.sock`); - } -} -exports.generateRandomPipeName = generateRandomPipeName; -function createClientPipeTransport(pipeName, encoding = 'utf-8') { - let connectResolve; - let connected = new Promise((resolve, _reject) => { - connectResolve = resolve; - }); - return new Promise((resolve, reject) => { - let server = net_1.createServer((socket) => { - server.close(); - connectResolve([ - new messageReader_1.SocketMessageReader(socket, encoding), - new messageWriter_1.SocketMessageWriter(socket, encoding) - ]); - }); - server.on('error', reject); - server.listen(pipeName, () => { - server.removeListener('error', reject); - resolve({ - onConnected: () => { return connected; } - }); - }); - }); -} -exports.createClientPipeTransport = createClientPipeTransport; -function createServerPipeTransport(pipeName, encoding = 'utf-8') { - const socket = net_1.createConnection(pipeName); - return [ - new messageReader_1.SocketMessageReader(socket, encoding), - new messageWriter_1.SocketMessageWriter(socket, encoding) - ]; -} -exports.createServerPipeTransport = createServerPipeTransport; - - -/***/ }), -/* 172 */ -/***/ (function(module, exports) { - -module.exports = require("crypto"); - -/***/ }), -/* 173 */ -/***/ (function(module, exports) { - -module.exports = require("net"); - -/***/ }), -/* 174 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const net_1 = __webpack_require__(173); -const messageReader_1 = __webpack_require__(166); -const messageWriter_1 = __webpack_require__(168); -function createClientSocketTransport(port, encoding = 'utf-8') { - let connectResolve; - let connected = new Promise((resolve, _reject) => { - connectResolve = resolve; - }); - return new Promise((resolve, reject) => { - let server = net_1.createServer((socket) => { - server.close(); - connectResolve([ - new messageReader_1.SocketMessageReader(socket, encoding), - new messageWriter_1.SocketMessageWriter(socket, encoding) - ]); - }); - server.on('error', reject); - server.listen(port, '127.0.0.1', () => { - server.removeListener('error', reject); - resolve({ - onConnected: () => { return connected; } - }); - }); - }); -} -exports.createClientSocketTransport = createClientSocketTransport; -function createServerSocketTransport(port, encoding = 'utf-8') { - const socket = net_1.createConnection(port, '127.0.0.1'); - return [ - new messageReader_1.SocketMessageReader(socket, encoding), - new messageWriter_1.SocketMessageWriter(socket, encoding) - ]; -} -exports.createServerSocketTransport = createServerSocketTransport; - - -/***/ }), -/* 175 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Location", function() { return Location; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocationLink", function() { return LocationLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Color", function() { return Color; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorInformation", function() { return ColorInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPresentation", function() { return ColorPresentation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRangeKind", function() { return FoldingRangeKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FoldingRange", function() { return FoldingRange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticRelatedInformation", function() { return DiagnosticRelatedInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticSeverity", function() { return DiagnosticSeverity; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiagnosticTag", function() { return DiagnosticTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Diagnostic", function() { return Diagnostic; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEdit", function() { return TextEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentEdit", function() { return TextDocumentEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CreateFile", function() { return CreateFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenameFile", function() { return RenameFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DeleteFile", function() { return DeleteFile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceEdit", function() { return WorkspaceEdit; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WorkspaceChange", function() { return WorkspaceChange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentIdentifier", function() { return TextDocumentIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VersionedTextDocumentIdentifier", function() { return VersionedTextDocumentIdentifier; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocumentItem", function() { return TextDocumentItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupKind", function() { return MarkupKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkupContent", function() { return MarkupContent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InsertTextFormat", function() { return InsertTextFormat; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemTag", function() { return CompletionItemTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItem", function() { return CompletionItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionList", function() { return CompletionList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkedString", function() { return MarkedString; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hover", function() { return Hover; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ParameterInformation", function() { return ParameterInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureInformation", function() { return SignatureInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlight", function() { return DocumentHighlight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolTag", function() { return SymbolTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolInformation", function() { return SymbolInformation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentSymbol", function() { return DocumentSymbol; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionKind", function() { return CodeActionKind; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeActionContext", function() { return CodeActionContext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeAction", function() { return CodeAction; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CodeLens", function() { return CodeLens; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormattingOptions", function() { return FormattingOptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentLink", function() { return DocumentLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionRange", function() { return SelectionRange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EOL", function() { return EOL; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextDocument", function() { return TextDocument; }); -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -/** - * The Position namespace provides helper functions to work with - * [Position](#Position) literals. - */ -var Position; -(function (Position) { - /** - * Creates a new Position literal from the given line and character. - * @param line The position's line. - * @param character The position's character. - */ - function create(line, character) { - return { line: line, character: character }; - } - Position.create = create; - /** - * Checks whether the given liternal conforms to the [Position](#Position) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Is.number(candidate.line) && Is.number(candidate.character); - } - Position.is = is; -})(Position || (Position = {})); -/** - * The Range namespace provides helper functions to work with - * [Range](#Range) literals. - */ -var Range; -(function (Range) { - function create(one, two, three, four) { - if (Is.number(one) && Is.number(two) && Is.number(three) && Is.number(four)) { - return { start: Position.create(one, two), end: Position.create(three, four) }; - } - else if (Position.is(one) && Position.is(two)) { - return { start: one, end: two }; - } - else { - throw new Error("Range#create called with invalid arguments[" + one + ", " + two + ", " + three + ", " + four + "]"); - } - } - Range.create = create; - /** - * Checks whether the given literal conforms to the [Range](#Range) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end); - } - Range.is = is; -})(Range || (Range = {})); -/** - * The Location namespace provides helper functions to work with - * [Location](#Location) literals. - */ -var Location; -(function (Location) { - /** - * Creates a Location literal. - * @param uri The location's uri. - * @param range The location's range. - */ - function create(uri, range) { - return { uri: uri, range: range }; - } - Location.create = create; - /** - * Checks whether the given literal conforms to the [Location](#Location) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri)); - } - Location.is = is; -})(Location || (Location = {})); -/** - * The LocationLink namespace provides helper functions to work with - * [LocationLink](#LocationLink) literals. - */ -var LocationLink; -(function (LocationLink) { - /** - * Creates a LocationLink literal. - * @param targetUri The definition's uri. - * @param targetRange The full range of the definition. - * @param targetSelectionRange The span of the symbol definition at the target. - * @param originSelectionRange The span of the symbol being defined in the originating source file. - */ - function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) { - return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange }; - } - LocationLink.create = create; - /** - * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) - && (Range.is(candidate.targetSelectionRange) || Is.undefined(candidate.targetSelectionRange)) - && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange)); - } - LocationLink.is = is; -})(LocationLink || (LocationLink = {})); -/** - * The Color namespace provides helper functions to work with - * [Color](#Color) literals. - */ -var Color; -(function (Color) { - /** - * Creates a new Color literal. - */ - function create(red, green, blue, alpha) { - return { - red: red, - green: green, - blue: blue, - alpha: alpha, - }; - } - Color.create = create; - /** - * Checks whether the given literal conforms to the [Color](#Color) interface. - */ - function is(value) { - var candidate = value; - return Is.number(candidate.red) - && Is.number(candidate.green) - && Is.number(candidate.blue) - && Is.number(candidate.alpha); - } - Color.is = is; -})(Color || (Color = {})); -/** - * The ColorInformation namespace provides helper functions to work with - * [ColorInformation](#ColorInformation) literals. - */ -var ColorInformation; -(function (ColorInformation) { - /** - * Creates a new ColorInformation literal. - */ - function create(range, color) { - return { - range: range, - color: color, - }; - } - ColorInformation.create = create; - /** - * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. - */ - function is(value) { - var candidate = value; - return Range.is(candidate.range) && Color.is(candidate.color); - } - ColorInformation.is = is; -})(ColorInformation || (ColorInformation = {})); -/** - * The Color namespace provides helper functions to work with - * [ColorPresentation](#ColorPresentation) literals. - */ -var ColorPresentation; -(function (ColorPresentation) { - /** - * Creates a new ColorInformation literal. - */ - function create(label, textEdit, additionalTextEdits) { - return { - label: label, - textEdit: textEdit, - additionalTextEdits: additionalTextEdits, - }; - } - ColorPresentation.create = create; - /** - * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface. - */ - function is(value) { - var candidate = value; - return Is.string(candidate.label) - && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) - && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is)); - } - ColorPresentation.is = is; -})(ColorPresentation || (ColorPresentation = {})); -/** - * Enum of known range kinds - */ -var FoldingRangeKind; -(function (FoldingRangeKind) { - /** - * Folding range for a comment - */ - FoldingRangeKind["Comment"] = "comment"; - /** - * Folding range for a imports or includes - */ - FoldingRangeKind["Imports"] = "imports"; - /** - * Folding range for a region (e.g. `#region`) - */ - FoldingRangeKind["Region"] = "region"; -})(FoldingRangeKind || (FoldingRangeKind = {})); -/** - * The folding range namespace provides helper functions to work with - * [FoldingRange](#FoldingRange) literals. - */ -var FoldingRange; -(function (FoldingRange) { - /** - * Creates a new FoldingRange literal. - */ - function create(startLine, endLine, startCharacter, endCharacter, kind) { - var result = { - startLine: startLine, - endLine: endLine - }; - if (Is.defined(startCharacter)) { - result.startCharacter = startCharacter; - } - if (Is.defined(endCharacter)) { - result.endCharacter = endCharacter; - } - if (Is.defined(kind)) { - result.kind = kind; - } - return result; - } - FoldingRange.create = create; - /** - * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface. - */ - function is(value) { - var candidate = value; - return Is.number(candidate.startLine) && Is.number(candidate.startLine) - && (Is.undefined(candidate.startCharacter) || Is.number(candidate.startCharacter)) - && (Is.undefined(candidate.endCharacter) || Is.number(candidate.endCharacter)) - && (Is.undefined(candidate.kind) || Is.string(candidate.kind)); - } - FoldingRange.is = is; -})(FoldingRange || (FoldingRange = {})); -/** - * The DiagnosticRelatedInformation namespace provides helper functions to work with - * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals. - */ -var DiagnosticRelatedInformation; -(function (DiagnosticRelatedInformation) { - /** - * Creates a new DiagnosticRelatedInformation literal. - */ - function create(location, message) { - return { - location: location, - message: message - }; - } - DiagnosticRelatedInformation.create = create; - /** - * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message); - } - DiagnosticRelatedInformation.is = is; -})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {})); -/** - * The diagnostic's severity. - */ -var DiagnosticSeverity; -(function (DiagnosticSeverity) { - /** - * Reports an error. - */ - DiagnosticSeverity.Error = 1; - /** - * Reports a warning. - */ - DiagnosticSeverity.Warning = 2; - /** - * Reports an information. - */ - DiagnosticSeverity.Information = 3; - /** - * Reports a hint. - */ - DiagnosticSeverity.Hint = 4; -})(DiagnosticSeverity || (DiagnosticSeverity = {})); -/** - * The diagnostic tags. - * - * @since 3.15.0 - */ -var DiagnosticTag; -(function (DiagnosticTag) { - /** - * Unused or unnecessary code. - * - * Clients are allowed to render diagnostics with this tag faded out instead of having - * an error squiggle. - */ - DiagnosticTag.Unnecessary = 1; - /** - * Deprecated or obsolete code. - * - * Clients are allowed to rendered diagnostics with this tag strike through. - */ - DiagnosticTag.Deprecated = 2; -})(DiagnosticTag || (DiagnosticTag = {})); -/** - * The Diagnostic namespace provides helper functions to work with - * [Diagnostic](#Diagnostic) literals. - */ -var Diagnostic; -(function (Diagnostic) { - /** - * Creates a new Diagnostic literal. - */ - function create(range, message, severity, code, source, relatedInformation) { - var result = { range: range, message: message }; - if (Is.defined(severity)) { - result.severity = severity; - } - if (Is.defined(code)) { - result.code = code; - } - if (Is.defined(source)) { - result.source = source; - } - if (Is.defined(relatedInformation)) { - result.relatedInformation = relatedInformation; - } - return result; - } - Diagnostic.create = create; - /** - * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) - && Range.is(candidate.range) - && Is.string(candidate.message) - && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) - && (Is.number(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) - && (Is.string(candidate.source) || Is.undefined(candidate.source)) - && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is)); - } - Diagnostic.is = is; -})(Diagnostic || (Diagnostic = {})); -/** - * The Command namespace provides helper functions to work with - * [Command](#Command) literals. - */ -var Command; -(function (Command) { - /** - * Creates a new Command literal. - */ - function create(title, command) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - var result = { title: title, command: command }; - if (Is.defined(args) && args.length > 0) { - result.arguments = args; - } - return result; - } - Command.create = create; - /** - * Checks whether the given literal conforms to the [Command](#Command) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command); - } - Command.is = is; -})(Command || (Command = {})); -/** - * The TextEdit namespace provides helper function to create replace, - * insert and delete edits more easily. - */ -var TextEdit; -(function (TextEdit) { - /** - * Creates a replace text edit. - * @param range The range of text to be replaced. - * @param newText The new text. - */ - function replace(range, newText) { - return { range: range, newText: newText }; - } - TextEdit.replace = replace; - /** - * Creates a insert text edit. - * @param position The position to insert the text at. - * @param newText The text to be inserted. - */ - function insert(position, newText) { - return { range: { start: position, end: position }, newText: newText }; - } - TextEdit.insert = insert; - /** - * Creates a delete text edit. - * @param range The range of text to be deleted. - */ - function del(range) { - return { range: range, newText: '' }; - } - TextEdit.del = del; - function is(value) { - var candidate = value; - return Is.objectLiteral(candidate) - && Is.string(candidate.newText) - && Range.is(candidate.range); - } - TextEdit.is = is; -})(TextEdit || (TextEdit = {})); -/** - * The TextDocumentEdit namespace provides helper function to create - * an edit that manipulates a text document. - */ -var TextDocumentEdit; -(function (TextDocumentEdit) { - /** - * Creates a new `TextDocumentEdit` - */ - function create(textDocument, edits) { - return { textDocument: textDocument, edits: edits }; - } - TextDocumentEdit.create = create; - function is(value) { - var candidate = value; - return Is.defined(candidate) - && VersionedTextDocumentIdentifier.is(candidate.textDocument) - && Array.isArray(candidate.edits); - } - TextDocumentEdit.is = is; -})(TextDocumentEdit || (TextDocumentEdit = {})); -var CreateFile; -(function (CreateFile) { - function create(uri, options) { - var result = { - kind: 'create', - uri: uri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - return result; - } - CreateFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && - (candidate.options === void 0 || - ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); - } - CreateFile.is = is; -})(CreateFile || (CreateFile = {})); -var RenameFile; -(function (RenameFile) { - function create(oldUri, newUri, options) { - var result = { - kind: 'rename', - oldUri: oldUri, - newUri: newUri - }; - if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) { - result.options = options; - } - return result; - } - RenameFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && - (candidate.options === void 0 || - ((candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists)))); - } - RenameFile.is = is; -})(RenameFile || (RenameFile = {})); -var DeleteFile; -(function (DeleteFile) { - function create(uri, options) { - var result = { - kind: 'delete', - uri: uri - }; - if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) { - result.options = options; - } - return result; - } - DeleteFile.create = create; - function is(value) { - var candidate = value; - return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && - (candidate.options === void 0 || - ((candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists)))); - } - DeleteFile.is = is; -})(DeleteFile || (DeleteFile = {})); -var WorkspaceEdit; -(function (WorkspaceEdit) { - function is(value) { - var candidate = value; - return candidate && - (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && - (candidate.documentChanges === void 0 || candidate.documentChanges.every(function (change) { - if (Is.string(change.kind)) { - return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change); - } - else { - return TextDocumentEdit.is(change); - } - })); - } - WorkspaceEdit.is = is; -})(WorkspaceEdit || (WorkspaceEdit = {})); -var TextEditChangeImpl = /** @class */ (function () { - function TextEditChangeImpl(edits) { - this.edits = edits; - } - TextEditChangeImpl.prototype.insert = function (position, newText) { - this.edits.push(TextEdit.insert(position, newText)); - }; - TextEditChangeImpl.prototype.replace = function (range, newText) { - this.edits.push(TextEdit.replace(range, newText)); - }; - TextEditChangeImpl.prototype.delete = function (range) { - this.edits.push(TextEdit.del(range)); - }; - TextEditChangeImpl.prototype.add = function (edit) { - this.edits.push(edit); - }; - TextEditChangeImpl.prototype.all = function () { - return this.edits; - }; - TextEditChangeImpl.prototype.clear = function () { - this.edits.splice(0, this.edits.length); - }; - return TextEditChangeImpl; -}()); -/** - * A workspace change helps constructing changes to a workspace. - */ -var WorkspaceChange = /** @class */ (function () { - function WorkspaceChange(workspaceEdit) { - var _this = this; - this._textEditChanges = Object.create(null); - if (workspaceEdit) { - this._workspaceEdit = workspaceEdit; - if (workspaceEdit.documentChanges) { - workspaceEdit.documentChanges.forEach(function (change) { - if (TextDocumentEdit.is(change)) { - var textEditChange = new TextEditChangeImpl(change.edits); - _this._textEditChanges[change.textDocument.uri] = textEditChange; - } - }); - } - else if (workspaceEdit.changes) { - Object.keys(workspaceEdit.changes).forEach(function (key) { - var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]); - _this._textEditChanges[key] = textEditChange; - }); - } - } - } - Object.defineProperty(WorkspaceChange.prototype, "edit", { - /** - * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal - * use to be returned from a workspace edit operation like rename. - */ - get: function () { - return this._workspaceEdit; - }, - enumerable: true, - configurable: true - }); - WorkspaceChange.prototype.getTextEditChange = function (key) { - if (VersionedTextDocumentIdentifier.is(key)) { - if (!this._workspaceEdit) { - this._workspaceEdit = { - documentChanges: [] - }; - } - if (!this._workspaceEdit.documentChanges) { - throw new Error('Workspace edit is not configured for document changes.'); - } - var textDocument = key; - var result = this._textEditChanges[textDocument.uri]; - if (!result) { - var edits = []; - var textDocumentEdit = { - textDocument: textDocument, - edits: edits - }; - this._workspaceEdit.documentChanges.push(textDocumentEdit); - result = new TextEditChangeImpl(edits); - this._textEditChanges[textDocument.uri] = result; - } - return result; - } - else { - if (!this._workspaceEdit) { - this._workspaceEdit = { - changes: Object.create(null) - }; - } - if (!this._workspaceEdit.changes) { - throw new Error('Workspace edit is not configured for normal text edit changes.'); - } - var result = this._textEditChanges[key]; - if (!result) { - var edits = []; - this._workspaceEdit.changes[key] = edits; - result = new TextEditChangeImpl(edits); - this._textEditChanges[key] = result; - } - return result; - } - }; - WorkspaceChange.prototype.createFile = function (uri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(CreateFile.create(uri, options)); - }; - WorkspaceChange.prototype.renameFile = function (oldUri, newUri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(RenameFile.create(oldUri, newUri, options)); - }; - WorkspaceChange.prototype.deleteFile = function (uri, options) { - this.checkDocumentChanges(); - this._workspaceEdit.documentChanges.push(DeleteFile.create(uri, options)); - }; - WorkspaceChange.prototype.checkDocumentChanges = function () { - if (!this._workspaceEdit || !this._workspaceEdit.documentChanges) { - throw new Error('Workspace edit is not configured for document changes.'); - } - }; - return WorkspaceChange; -}()); - -/** - * The TextDocumentIdentifier namespace provides helper functions to work with - * [TextDocumentIdentifier](#TextDocumentIdentifier) literals. - */ -var TextDocumentIdentifier; -(function (TextDocumentIdentifier) { - /** - * Creates a new TextDocumentIdentifier literal. - * @param uri The document's uri. - */ - function create(uri) { - return { uri: uri }; - } - TextDocumentIdentifier.create = create; - /** - * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri); - } - TextDocumentIdentifier.is = is; -})(TextDocumentIdentifier || (TextDocumentIdentifier = {})); -/** - * The VersionedTextDocumentIdentifier namespace provides helper functions to work with - * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals. - */ -var VersionedTextDocumentIdentifier; -(function (VersionedTextDocumentIdentifier) { - /** - * Creates a new VersionedTextDocumentIdentifier literal. - * @param uri The document's uri. - * @param uri The document's text. - */ - function create(uri, version) { - return { uri: uri, version: version }; - } - VersionedTextDocumentIdentifier.create = create; - /** - * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.number(candidate.version)); - } - VersionedTextDocumentIdentifier.is = is; -})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {})); -/** - * The TextDocumentItem namespace provides helper functions to work with - * [TextDocumentItem](#TextDocumentItem) literals. - */ -var TextDocumentItem; -(function (TextDocumentItem) { - /** - * Creates a new TextDocumentItem literal. - * @param uri The document's uri. - * @param languageId The document's language identifier. - * @param version The document's version number. - * @param text The document's text. - */ - function create(uri, languageId, version, text) { - return { uri: uri, languageId: languageId, version: version, text: text }; - } - TextDocumentItem.create = create; - /** - * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.number(candidate.version) && Is.string(candidate.text); - } - TextDocumentItem.is = is; -})(TextDocumentItem || (TextDocumentItem = {})); -/** - * Describes the content type that a client supports in various - * result literals like `Hover`, `ParameterInfo` or `CompletionItem`. - * - * Please note that `MarkupKinds` must not start with a `$`. This kinds - * are reserved for internal usage. - */ -var MarkupKind; -(function (MarkupKind) { - /** - * Plain text is supported as a content format - */ - MarkupKind.PlainText = 'plaintext'; - /** - * Markdown is supported as a content format - */ - MarkupKind.Markdown = 'markdown'; -})(MarkupKind || (MarkupKind = {})); -(function (MarkupKind) { - /** - * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type. - */ - function is(value) { - var candidate = value; - return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown; - } - MarkupKind.is = is; -})(MarkupKind || (MarkupKind = {})); -var MarkupContent; -(function (MarkupContent) { - /** - * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface. - */ - function is(value) { - var candidate = value; - return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value); - } - MarkupContent.is = is; -})(MarkupContent || (MarkupContent = {})); -/** - * The kind of a completion entry. - */ -var CompletionItemKind; -(function (CompletionItemKind) { - CompletionItemKind.Text = 1; - CompletionItemKind.Method = 2; - CompletionItemKind.Function = 3; - CompletionItemKind.Constructor = 4; - CompletionItemKind.Field = 5; - CompletionItemKind.Variable = 6; - CompletionItemKind.Class = 7; - CompletionItemKind.Interface = 8; - CompletionItemKind.Module = 9; - CompletionItemKind.Property = 10; - CompletionItemKind.Unit = 11; - CompletionItemKind.Value = 12; - CompletionItemKind.Enum = 13; - CompletionItemKind.Keyword = 14; - CompletionItemKind.Snippet = 15; - CompletionItemKind.Color = 16; - CompletionItemKind.File = 17; - CompletionItemKind.Reference = 18; - CompletionItemKind.Folder = 19; - CompletionItemKind.EnumMember = 20; - CompletionItemKind.Constant = 21; - CompletionItemKind.Struct = 22; - CompletionItemKind.Event = 23; - CompletionItemKind.Operator = 24; - CompletionItemKind.TypeParameter = 25; -})(CompletionItemKind || (CompletionItemKind = {})); -/** - * Defines whether the insert text in a completion item should be interpreted as - * plain text or a snippet. - */ -var InsertTextFormat; -(function (InsertTextFormat) { - /** - * The primary text to be inserted is treated as a plain string. - */ - InsertTextFormat.PlainText = 1; - /** - * The primary text to be inserted is treated as a snippet. - * - * A snippet can define tab stops and placeholders with `$1`, `$2` - * and `${3:foo}`. `$0` defines the final tab stop, it defaults to - * the end of the snippet. Placeholders with equal identifiers are linked, - * that is typing in one will update others too. - * - * See also: https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md - */ - InsertTextFormat.Snippet = 2; -})(InsertTextFormat || (InsertTextFormat = {})); -/** - * Completion item tags are extra annotations that tweak the rendering of a completion - * item. - * - * @since 3.15.0 - */ -var CompletionItemTag; -(function (CompletionItemTag) { - /** - * Render a completion as obsolete, usually using a strike-out. - */ - CompletionItemTag.Deprecated = 1; -})(CompletionItemTag || (CompletionItemTag = {})); -/** - * The CompletionItem namespace provides functions to deal with - * completion items. - */ -var CompletionItem; -(function (CompletionItem) { - /** - * Create a completion item and seed it with a label. - * @param label The completion item's label - */ - function create(label) { - return { label: label }; - } - CompletionItem.create = create; -})(CompletionItem || (CompletionItem = {})); -/** - * The CompletionList namespace provides functions to deal with - * completion lists. - */ -var CompletionList; -(function (CompletionList) { - /** - * Creates a new completion list. - * - * @param items The completion items. - * @param isIncomplete The list is not complete. - */ - function create(items, isIncomplete) { - return { items: items ? items : [], isIncomplete: !!isIncomplete }; - } - CompletionList.create = create; -})(CompletionList || (CompletionList = {})); -var MarkedString; -(function (MarkedString) { - /** - * Creates a marked string from plain text. - * - * @param plainText The plain text. - */ - function fromPlainText(plainText) { - return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash - } - MarkedString.fromPlainText = fromPlainText; - /** - * Checks whether the given value conforms to the [MarkedString](#MarkedString) type. - */ - function is(value) { - var candidate = value; - return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value)); - } - MarkedString.is = is; -})(MarkedString || (MarkedString = {})); -var Hover; -(function (Hover) { - /** - * Checks whether the given value conforms to the [Hover](#Hover) interface. - */ - function is(value) { - var candidate = value; - return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || - MarkedString.is(candidate.contents) || - Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range)); - } - Hover.is = is; -})(Hover || (Hover = {})); -/** - * The ParameterInformation namespace provides helper functions to work with - * [ParameterInformation](#ParameterInformation) literals. - */ -var ParameterInformation; -(function (ParameterInformation) { - /** - * Creates a new parameter information literal. - * - * @param label A label string. - * @param documentation A doc string. - */ - function create(label, documentation) { - return documentation ? { label: label, documentation: documentation } : { label: label }; - } - ParameterInformation.create = create; -})(ParameterInformation || (ParameterInformation = {})); -/** - * The SignatureInformation namespace provides helper functions to work with - * [SignatureInformation](#SignatureInformation) literals. - */ -var SignatureInformation; -(function (SignatureInformation) { - function create(label, documentation) { - var parameters = []; - for (var _i = 2; _i < arguments.length; _i++) { - parameters[_i - 2] = arguments[_i]; - } - var result = { label: label }; - if (Is.defined(documentation)) { - result.documentation = documentation; - } - if (Is.defined(parameters)) { - result.parameters = parameters; - } - else { - result.parameters = []; - } - return result; - } - SignatureInformation.create = create; -})(SignatureInformation || (SignatureInformation = {})); -/** - * A document highlight kind. - */ -var DocumentHighlightKind; -(function (DocumentHighlightKind) { - /** - * A textual occurrence. - */ - DocumentHighlightKind.Text = 1; - /** - * Read-access of a symbol, like reading a variable. - */ - DocumentHighlightKind.Read = 2; - /** - * Write-access of a symbol, like writing to a variable. - */ - DocumentHighlightKind.Write = 3; -})(DocumentHighlightKind || (DocumentHighlightKind = {})); -/** - * DocumentHighlight namespace to provide helper functions to work with - * [DocumentHighlight](#DocumentHighlight) literals. - */ -var DocumentHighlight; -(function (DocumentHighlight) { - /** - * Create a DocumentHighlight object. - * @param range The range the highlight applies to. - */ - function create(range, kind) { - var result = { range: range }; - if (Is.number(kind)) { - result.kind = kind; - } - return result; - } - DocumentHighlight.create = create; -})(DocumentHighlight || (DocumentHighlight = {})); -/** - * A symbol kind. - */ -var SymbolKind; -(function (SymbolKind) { - SymbolKind.File = 1; - SymbolKind.Module = 2; - SymbolKind.Namespace = 3; - SymbolKind.Package = 4; - SymbolKind.Class = 5; - SymbolKind.Method = 6; - SymbolKind.Property = 7; - SymbolKind.Field = 8; - SymbolKind.Constructor = 9; - SymbolKind.Enum = 10; - SymbolKind.Interface = 11; - SymbolKind.Function = 12; - SymbolKind.Variable = 13; - SymbolKind.Constant = 14; - SymbolKind.String = 15; - SymbolKind.Number = 16; - SymbolKind.Boolean = 17; - SymbolKind.Array = 18; - SymbolKind.Object = 19; - SymbolKind.Key = 20; - SymbolKind.Null = 21; - SymbolKind.EnumMember = 22; - SymbolKind.Struct = 23; - SymbolKind.Event = 24; - SymbolKind.Operator = 25; - SymbolKind.TypeParameter = 26; -})(SymbolKind || (SymbolKind = {})); -/** - * Symbol tags are extra annotations that tweak the rendering of a symbol. - * @since 3.15 - */ -var SymbolTag; -(function (SymbolTag) { - /** - * Render a symbol as obsolete, usually using a strike-out. - */ - SymbolTag.Deprecated = 1; -})(SymbolTag || (SymbolTag = {})); -var SymbolInformation; -(function (SymbolInformation) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the location of the symbol. - * @param uri The resource of the location of symbol, defaults to the current document. - * @param containerName The name of the symbol containing the symbol. - */ - function create(name, kind, range, uri, containerName) { - var result = { - name: name, - kind: kind, - location: { uri: uri, range: range } - }; - if (containerName) { - result.containerName = containerName; - } - return result; - } - SymbolInformation.create = create; -})(SymbolInformation || (SymbolInformation = {})); -var DocumentSymbol; -(function (DocumentSymbol) { - /** - * Creates a new symbol information literal. - * - * @param name The name of the symbol. - * @param detail The detail of the symbol. - * @param kind The kind of the symbol. - * @param range The range of the symbol. - * @param selectionRange The selectionRange of the symbol. - * @param children Children of the symbol. - */ - function create(name, detail, kind, range, selectionRange, children) { - var result = { - name: name, - detail: detail, - kind: kind, - range: range, - selectionRange: selectionRange - }; - if (children !== void 0) { - result.children = children; - } - return result; - } - DocumentSymbol.create = create; - /** - * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface. - */ - function is(value) { - var candidate = value; - return candidate && - Is.string(candidate.name) && Is.number(candidate.kind) && - Range.is(candidate.range) && Range.is(candidate.selectionRange) && - (candidate.detail === void 0 || Is.string(candidate.detail)) && - (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && - (candidate.children === void 0 || Array.isArray(candidate.children)); - } - DocumentSymbol.is = is; -})(DocumentSymbol || (DocumentSymbol = {})); -/** - * A set of predefined code action kinds - */ -var CodeActionKind; -(function (CodeActionKind) { - /** - * Empty kind. - */ - CodeActionKind.Empty = ''; - /** - * Base kind for quickfix actions: 'quickfix' - */ - CodeActionKind.QuickFix = 'quickfix'; - /** - * Base kind for refactoring actions: 'refactor' - */ - CodeActionKind.Refactor = 'refactor'; - /** - * Base kind for refactoring extraction actions: 'refactor.extract' - * - * Example extract actions: - * - * - Extract method - * - Extract function - * - Extract variable - * - Extract interface from class - * - ... - */ - CodeActionKind.RefactorExtract = 'refactor.extract'; - /** - * Base kind for refactoring inline actions: 'refactor.inline' - * - * Example inline actions: - * - * - Inline function - * - Inline variable - * - Inline constant - * - ... - */ - CodeActionKind.RefactorInline = 'refactor.inline'; - /** - * Base kind for refactoring rewrite actions: 'refactor.rewrite' - * - * Example rewrite actions: - * - * - Convert JavaScript function to class - * - Add or remove parameter - * - Encapsulate field - * - Make method static - * - Move method to base class - * - ... - */ - CodeActionKind.RefactorRewrite = 'refactor.rewrite'; - /** - * Base kind for source actions: `source` - * - * Source code actions apply to the entire file. - */ - CodeActionKind.Source = 'source'; - /** - * Base kind for an organize imports source action: `source.organizeImports` - */ - CodeActionKind.SourceOrganizeImports = 'source.organizeImports'; - /** - * Base kind for auto-fix source actions: `source.fixAll`. - * - * Fix all actions automatically fix errors that have a clear fix that do not require user input. - * They should not suppress errors or perform unsafe fixes such as generating new types or classes. - * - * @since 3.15.0 - */ - CodeActionKind.SourceFixAll = 'source.fixAll'; -})(CodeActionKind || (CodeActionKind = {})); -/** - * The CodeActionContext namespace provides helper functions to work with - * [CodeActionContext](#CodeActionContext) literals. - */ -var CodeActionContext; -(function (CodeActionContext) { - /** - * Creates a new CodeActionContext literal. - */ - function create(diagnostics, only) { - var result = { diagnostics: diagnostics }; - if (only !== void 0 && only !== null) { - result.only = only; - } - return result; - } - CodeActionContext.create = create; - /** - * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)); - } - CodeActionContext.is = is; -})(CodeActionContext || (CodeActionContext = {})); -var CodeAction; -(function (CodeAction) { - function create(title, commandOrEdit, kind) { - var result = { title: title }; - if (Command.is(commandOrEdit)) { - result.command = commandOrEdit; - } - else { - result.edit = commandOrEdit; - } - if (kind !== void 0) { - result.kind = kind; - } - return result; - } - CodeAction.create = create; - function is(value) { - var candidate = value; - return candidate && Is.string(candidate.title) && - (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && - (candidate.kind === void 0 || Is.string(candidate.kind)) && - (candidate.edit !== void 0 || candidate.command !== void 0) && - (candidate.command === void 0 || Command.is(candidate.command)) && - (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && - (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit)); - } - CodeAction.is = is; -})(CodeAction || (CodeAction = {})); -/** - * The CodeLens namespace provides helper functions to work with - * [CodeLens](#CodeLens) literals. - */ -var CodeLens; -(function (CodeLens) { - /** - * Creates a new CodeLens literal. - */ - function create(range, data) { - var result = { range: range }; - if (Is.defined(data)) { - result.data = data; - } - return result; - } - CodeLens.create = create; - /** - * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command)); - } - CodeLens.is = is; -})(CodeLens || (CodeLens = {})); -/** - * The FormattingOptions namespace provides helper functions to work with - * [FormattingOptions](#FormattingOptions) literals. - */ -var FormattingOptions; -(function (FormattingOptions) { - /** - * Creates a new FormattingOptions literal. - */ - function create(tabSize, insertSpaces) { - return { tabSize: tabSize, insertSpaces: insertSpaces }; - } - FormattingOptions.create = create; - /** - * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.number(candidate.tabSize) && Is.boolean(candidate.insertSpaces); - } - FormattingOptions.is = is; -})(FormattingOptions || (FormattingOptions = {})); -/** - * The DocumentLink namespace provides helper functions to work with - * [DocumentLink](#DocumentLink) literals. - */ -var DocumentLink; -(function (DocumentLink) { - /** - * Creates a new DocumentLink literal. - */ - function create(range, target, data) { - return { range: range, target: target, data: data }; - } - DocumentLink.create = create; - /** - * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target)); - } - DocumentLink.is = is; -})(DocumentLink || (DocumentLink = {})); -/** - * The SelectionRange namespace provides helper function to work with - * SelectionRange literals. - */ -var SelectionRange; -(function (SelectionRange) { - /** - * Creates a new SelectionRange - * @param range the range. - * @param parent an optional parent. - */ - function create(range, parent) { - return { range: range, parent: parent }; - } - SelectionRange.create = create; - function is(value) { - var candidate = value; - return candidate !== undefined && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent)); - } - SelectionRange.is = is; -})(SelectionRange || (SelectionRange = {})); -var EOL = ['\n', '\r\n', '\r']; -/** - * @deprecated Use the text document from the new vscode-languageserver-textdocument package. - */ -var TextDocument; -(function (TextDocument) { - /** - * Creates a new ITextDocument literal from the given uri and content. - * @param uri The document's uri. - * @param languageId The document's language Id. - * @param content The document's content. - */ - function create(uri, languageId, version, content) { - return new FullTextDocument(uri, languageId, version, content); - } - TextDocument.create = create; - /** - * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface. - */ - function is(value) { - var candidate = value; - return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.number(candidate.lineCount) - && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false; - } - TextDocument.is = is; - function applyEdits(document, edits) { - var text = document.getText(); - var sortedEdits = mergeSort(edits, function (a, b) { - var diff = a.range.start.line - b.range.start.line; - if (diff === 0) { - return a.range.start.character - b.range.start.character; - } - return diff; - }); - var lastModifiedOffset = text.length; - for (var i = sortedEdits.length - 1; i >= 0; i--) { - var e = sortedEdits[i]; - var startOffset = document.offsetAt(e.range.start); - var endOffset = document.offsetAt(e.range.end); - if (endOffset <= lastModifiedOffset) { - text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length); - } - else { - throw new Error('Overlapping edit'); - } - lastModifiedOffset = startOffset; - } - return text; - } - TextDocument.applyEdits = applyEdits; - function mergeSort(data, compare) { - if (data.length <= 1) { - // sorted - return data; - } - var p = (data.length / 2) | 0; - var left = data.slice(0, p); - var right = data.slice(p); - mergeSort(left, compare); - mergeSort(right, compare); - var leftIdx = 0; - var rightIdx = 0; - var i = 0; - while (leftIdx < left.length && rightIdx < right.length) { - var ret = compare(left[leftIdx], right[rightIdx]); - if (ret <= 0) { - // smaller_equal -> take left to preserve order - data[i++] = left[leftIdx++]; - } - else { - // greater -> take right - data[i++] = right[rightIdx++]; - } - } - while (leftIdx < left.length) { - data[i++] = left[leftIdx++]; - } - while (rightIdx < right.length) { - data[i++] = right[rightIdx++]; - } - return data; - } -})(TextDocument || (TextDocument = {})); -var FullTextDocument = /** @class */ (function () { - function FullTextDocument(uri, languageId, version, content) { - this._uri = uri; - this._languageId = languageId; - this._version = version; - this._content = content; - this._lineOffsets = undefined; - } - Object.defineProperty(FullTextDocument.prototype, "uri", { - get: function () { - return this._uri; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "languageId", { - get: function () { - return this._languageId; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(FullTextDocument.prototype, "version", { - get: function () { - return this._version; - }, - enumerable: true, - configurable: true - }); - FullTextDocument.prototype.getText = function (range) { - if (range) { - var start = this.offsetAt(range.start); - var end = this.offsetAt(range.end); - return this._content.substring(start, end); - } - return this._content; - }; - FullTextDocument.prototype.update = function (event, version) { - this._content = event.text; - this._version = version; - this._lineOffsets = undefined; - }; - FullTextDocument.prototype.getLineOffsets = function () { - if (this._lineOffsets === undefined) { - var lineOffsets = []; - var text = this._content; - var isLineStart = true; - for (var i = 0; i < text.length; i++) { - if (isLineStart) { - lineOffsets.push(i); - isLineStart = false; - } - var ch = text.charAt(i); - isLineStart = (ch === '\r' || ch === '\n'); - if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') { - i++; - } - } - if (isLineStart && text.length > 0) { - lineOffsets.push(text.length); - } - this._lineOffsets = lineOffsets; - } - return this._lineOffsets; - }; - FullTextDocument.prototype.positionAt = function (offset) { - offset = Math.max(Math.min(offset, this._content.length), 0); - var lineOffsets = this.getLineOffsets(); - var low = 0, high = lineOffsets.length; - if (high === 0) { - return Position.create(0, offset); - } - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (lineOffsets[mid] > offset) { - high = mid; - } - else { - low = mid + 1; - } - } - // low is the least x for which the line offset is larger than the current offset - // or array.length if no line offset is larger than the current offset - var line = low - 1; - return Position.create(line, offset - lineOffsets[line]); - }; - FullTextDocument.prototype.offsetAt = function (position) { - var lineOffsets = this.getLineOffsets(); - if (position.line >= lineOffsets.length) { - return this._content.length; - } - else if (position.line < 0) { - return 0; - } - var lineOffset = lineOffsets[position.line]; - var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; - return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset); - }; - Object.defineProperty(FullTextDocument.prototype, "lineCount", { - get: function () { - return this.getLineOffsets().length; - }, - enumerable: true, - configurable: true - }); - return FullTextDocument; -}()); -var Is; -(function (Is) { - var toString = Object.prototype.toString; - function defined(value) { - return typeof value !== 'undefined'; - } - Is.defined = defined; - function undefined(value) { - return typeof value === 'undefined'; - } - Is.undefined = undefined; - function boolean(value) { - return value === true || value === false; - } - Is.boolean = boolean; - function string(value) { - return toString.call(value) === '[object String]'; - } - Is.string = string; - function number(value) { - return toString.call(value) === '[object Number]'; - } - Is.number = number; - function func(value) { - return toString.call(value) === '[object Function]'; - } - Is.func = func; - function objectLiteral(value) { - // Strictly speaking class instances pass this check as well. Since the LSP - // doesn't use classes we ignore this for now. If we do we need to add something - // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` - return value !== null && typeof value === 'object'; - } - Is.objectLiteral = objectLiteral; - function typedArray(value, check) { - return Array.isArray(value) && value.every(check); - } - Is.typedArray = typedArray; -})(Is || (Is = {})); - - -/***/ }), -/* 176 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const Is = __webpack_require__(177); -const vscode_jsonrpc_1 = __webpack_require__(163); -const messages_1 = __webpack_require__(178); -const protocol_implementation_1 = __webpack_require__(179); -exports.ImplementationRequest = protocol_implementation_1.ImplementationRequest; -const protocol_typeDefinition_1 = __webpack_require__(180); -exports.TypeDefinitionRequest = protocol_typeDefinition_1.TypeDefinitionRequest; -const protocol_workspaceFolders_1 = __webpack_require__(181); -exports.WorkspaceFoldersRequest = protocol_workspaceFolders_1.WorkspaceFoldersRequest; -exports.DidChangeWorkspaceFoldersNotification = protocol_workspaceFolders_1.DidChangeWorkspaceFoldersNotification; -const protocol_configuration_1 = __webpack_require__(182); -exports.ConfigurationRequest = protocol_configuration_1.ConfigurationRequest; -const protocol_colorProvider_1 = __webpack_require__(183); -exports.DocumentColorRequest = protocol_colorProvider_1.DocumentColorRequest; -exports.ColorPresentationRequest = protocol_colorProvider_1.ColorPresentationRequest; -const protocol_foldingRange_1 = __webpack_require__(184); -exports.FoldingRangeRequest = protocol_foldingRange_1.FoldingRangeRequest; -const protocol_declaration_1 = __webpack_require__(185); -exports.DeclarationRequest = protocol_declaration_1.DeclarationRequest; -const protocol_selectionRange_1 = __webpack_require__(186); -exports.SelectionRangeRequest = protocol_selectionRange_1.SelectionRangeRequest; -const protocol_progress_1 = __webpack_require__(187); -exports.WorkDoneProgress = protocol_progress_1.WorkDoneProgress; -exports.WorkDoneProgressCreateRequest = protocol_progress_1.WorkDoneProgressCreateRequest; -exports.WorkDoneProgressCancelNotification = protocol_progress_1.WorkDoneProgressCancelNotification; -// @ts-ignore: to avoid inlining LocatioLink as dynamic import -let __noDynamicImport; -/** - * The DocumentFilter namespace provides helper functions to work with - * [DocumentFilter](#DocumentFilter) literals. - */ -var DocumentFilter; -(function (DocumentFilter) { - function is(value) { - const candidate = value; - return Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern); - } - DocumentFilter.is = is; -})(DocumentFilter = exports.DocumentFilter || (exports.DocumentFilter = {})); -/** - * The DocumentSelector namespace provides helper functions to work with - * [DocumentSelector](#DocumentSelector)s. - */ -var DocumentSelector; -(function (DocumentSelector) { - function is(value) { - if (!Array.isArray(value)) { - return false; - } - for (let elem of value) { - if (!Is.string(elem) && !DocumentFilter.is(elem)) { - return false; - } - } - return true; - } - DocumentSelector.is = is; -})(DocumentSelector = exports.DocumentSelector || (exports.DocumentSelector = {})); -/** - * The `client/registerCapability` request is sent from the server to the client to register a new capability - * handler on the client side. - */ -var RegistrationRequest; -(function (RegistrationRequest) { - RegistrationRequest.type = new messages_1.ProtocolRequestType('client/registerCapability'); -})(RegistrationRequest = exports.RegistrationRequest || (exports.RegistrationRequest = {})); -/** - * The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability - * handler on the client side. - */ -var UnregistrationRequest; -(function (UnregistrationRequest) { - UnregistrationRequest.type = new messages_1.ProtocolRequestType('client/unregisterCapability'); -})(UnregistrationRequest = exports.UnregistrationRequest || (exports.UnregistrationRequest = {})); -var ResourceOperationKind; -(function (ResourceOperationKind) { - /** - * Supports creating new files and folders. - */ - ResourceOperationKind.Create = 'create'; - /** - * Supports renaming existing files and folders. - */ - ResourceOperationKind.Rename = 'rename'; - /** - * Supports deleting existing files and folders. - */ - ResourceOperationKind.Delete = 'delete'; -})(ResourceOperationKind = exports.ResourceOperationKind || (exports.ResourceOperationKind = {})); -var FailureHandlingKind; -(function (FailureHandlingKind) { - /** - * Applying the workspace change is simply aborted if one of the changes provided - * fails. All operations executed before the failing operation stay executed. - */ - FailureHandlingKind.Abort = 'abort'; - /** - * All operations are executed transactional. That means they either all - * succeed or no changes at all are applied to the workspace. - */ - FailureHandlingKind.Transactional = 'transactional'; - /** - * If the workspace edit contains only textual file changes they are executed transactional. - * If resource changes (create, rename or delete file) are part of the change the failure - * handling startegy is abort. - */ - FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional'; - /** - * The client tries to undo the operations already executed. But there is no - * guarantee that this is succeeding. - */ - FailureHandlingKind.Undo = 'undo'; -})(FailureHandlingKind = exports.FailureHandlingKind || (exports.FailureHandlingKind = {})); -/** - * The StaticRegistrationOptions namespace provides helper functions to work with - * [StaticRegistrationOptions](#StaticRegistrationOptions) literals. - */ -var StaticRegistrationOptions; -(function (StaticRegistrationOptions) { - function hasId(value) { - const candidate = value; - return candidate && Is.string(candidate.id) && candidate.id.length > 0; - } - StaticRegistrationOptions.hasId = hasId; -})(StaticRegistrationOptions = exports.StaticRegistrationOptions || (exports.StaticRegistrationOptions = {})); -/** - * The TextDocumentRegistrationOptions namespace provides helper functions to work with - * [TextDocumentRegistrationOptions](#TextDocumentRegistrationOptions) literals. - */ -var TextDocumentRegistrationOptions; -(function (TextDocumentRegistrationOptions) { - function is(value) { - const candidate = value; - return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector)); - } - TextDocumentRegistrationOptions.is = is; -})(TextDocumentRegistrationOptions = exports.TextDocumentRegistrationOptions || (exports.TextDocumentRegistrationOptions = {})); -/** - * The WorkDoneProgressOptions namespace provides helper functions to work with - * [WorkDoneProgressOptions](#WorkDoneProgressOptions) literals. - */ -var WorkDoneProgressOptions; -(function (WorkDoneProgressOptions) { - function is(value) { - const candidate = value; - return Is.objectLiteral(candidate) && (candidate.workDoneProgress === undefined || Is.boolean(candidate.workDoneProgress)); - } - WorkDoneProgressOptions.is = is; - function hasWorkDoneProgress(value) { - const candidate = value; - return candidate && Is.boolean(candidate.workDoneProgress); - } - WorkDoneProgressOptions.hasWorkDoneProgress = hasWorkDoneProgress; -})(WorkDoneProgressOptions = exports.WorkDoneProgressOptions || (exports.WorkDoneProgressOptions = {})); -/** - * The initialize request is sent from the client to the server. - * It is sent once as the request after starting up the server. - * The requests parameter is of type [InitializeParams](#InitializeParams) - * the response if of type [InitializeResult](#InitializeResult) of a Thenable that - * resolves to such. - */ -var InitializeRequest; -(function (InitializeRequest) { - InitializeRequest.type = new messages_1.ProtocolRequestType('initialize'); -})(InitializeRequest = exports.InitializeRequest || (exports.InitializeRequest = {})); -/** - * Known error codes for an `InitializeError`; - */ -var InitializeError; -(function (InitializeError) { - /** - * If the protocol version provided by the client can't be handled by the server. - * @deprecated This initialize error got replaced by client capabilities. There is - * no version handshake in version 3.0x - */ - InitializeError.unknownProtocolVersion = 1; -})(InitializeError = exports.InitializeError || (exports.InitializeError = {})); -/** - * The intialized notification is sent from the client to the - * server after the client is fully initialized and the server - * is allowed to send requests from the server to the client. - */ -var InitializedNotification; -(function (InitializedNotification) { - InitializedNotification.type = new messages_1.ProtocolNotificationType('initialized'); -})(InitializedNotification = exports.InitializedNotification || (exports.InitializedNotification = {})); -//---- Shutdown Method ---- -/** - * A shutdown request is sent from the client to the server. - * It is sent once when the client decides to shutdown the - * server. The only notification that is sent after a shutdown request - * is the exit event. - */ -var ShutdownRequest; -(function (ShutdownRequest) { - ShutdownRequest.type = new messages_1.ProtocolRequestType0('shutdown'); -})(ShutdownRequest = exports.ShutdownRequest || (exports.ShutdownRequest = {})); -//---- Exit Notification ---- -/** - * The exit event is sent from the client to the server to - * ask the server to exit its process. - */ -var ExitNotification; -(function (ExitNotification) { - ExitNotification.type = new messages_1.ProtocolNotificationType0('exit'); -})(ExitNotification = exports.ExitNotification || (exports.ExitNotification = {})); -/** - * The configuration change notification is sent from the client to the server - * when the client's configuration has changed. The notification contains - * the changed configuration as defined by the language client. - */ -var DidChangeConfigurationNotification; -(function (DidChangeConfigurationNotification) { - DidChangeConfigurationNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeConfiguration'); -})(DidChangeConfigurationNotification = exports.DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = {})); -//---- Message show and log notifications ---- -/** - * The message type - */ -var MessageType; -(function (MessageType) { - /** - * An error message. - */ - MessageType.Error = 1; - /** - * A warning message. - */ - MessageType.Warning = 2; - /** - * An information message. - */ - MessageType.Info = 3; - /** - * A log message. - */ - MessageType.Log = 4; -})(MessageType = exports.MessageType || (exports.MessageType = {})); -/** - * The show message notification is sent from a server to a client to ask - * the client to display a particular message in the user interface. - */ -var ShowMessageNotification; -(function (ShowMessageNotification) { - ShowMessageNotification.type = new messages_1.ProtocolNotificationType('window/showMessage'); -})(ShowMessageNotification = exports.ShowMessageNotification || (exports.ShowMessageNotification = {})); -/** - * The show message request is sent from the server to the client to show a message - * and a set of options actions to the user. - */ -var ShowMessageRequest; -(function (ShowMessageRequest) { - ShowMessageRequest.type = new messages_1.ProtocolRequestType('window/showMessageRequest'); -})(ShowMessageRequest = exports.ShowMessageRequest || (exports.ShowMessageRequest = {})); -/** - * The log message notification is sent from the server to the client to ask - * the client to log a particular message. - */ -var LogMessageNotification; -(function (LogMessageNotification) { - LogMessageNotification.type = new messages_1.ProtocolNotificationType('window/logMessage'); -})(LogMessageNotification = exports.LogMessageNotification || (exports.LogMessageNotification = {})); -//---- Telemetry notification -/** - * The telemetry event notification is sent from the server to the client to ask - * the client to log telemetry data. - */ -var TelemetryEventNotification; -(function (TelemetryEventNotification) { - TelemetryEventNotification.type = new messages_1.ProtocolNotificationType('telemetry/event'); -})(TelemetryEventNotification = exports.TelemetryEventNotification || (exports.TelemetryEventNotification = {})); -/** - * Defines how the host (editor) should sync - * document changes to the language server. - */ -var TextDocumentSyncKind; -(function (TextDocumentSyncKind) { - /** - * Documents should not be synced at all. - */ - TextDocumentSyncKind.None = 0; - /** - * Documents are synced by always sending the full content - * of the document. - */ - TextDocumentSyncKind.Full = 1; - /** - * Documents are synced by sending the full content on open. - * After that only incremental updates to the document are - * send. - */ - TextDocumentSyncKind.Incremental = 2; -})(TextDocumentSyncKind = exports.TextDocumentSyncKind || (exports.TextDocumentSyncKind = {})); -/** - * The document open notification is sent from the client to the server to signal - * newly opened text documents. The document's truth is now managed by the client - * and the server must not try to read the document's truth using the document's - * uri. Open in this sense means it is managed by the client. It doesn't necessarily - * mean that its content is presented in an editor. An open notification must not - * be sent more than once without a corresponding close notification send before. - * This means open and close notification must be balanced and the max open count - * is one. - */ -var DidOpenTextDocumentNotification; -(function (DidOpenTextDocumentNotification) { - DidOpenTextDocumentNotification.method = 'textDocument/didOpen'; - DidOpenTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification.method); -})(DidOpenTextDocumentNotification = exports.DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = {})); -/** - * The document change notification is sent from the client to the server to signal - * changes to a text document. - */ -var DidChangeTextDocumentNotification; -(function (DidChangeTextDocumentNotification) { - DidChangeTextDocumentNotification.method = 'textDocument/didChange'; - DidChangeTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification.method); -})(DidChangeTextDocumentNotification = exports.DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = {})); -/** - * The document close notification is sent from the client to the server when - * the document got closed in the client. The document's truth now exists where - * the document's uri points to (e.g. if the document's uri is a file uri the - * truth now exists on disk). As with the open notification the close notification - * is about managing the document's content. Receiving a close notification - * doesn't mean that the document was open in an editor before. A close - * notification requires a previous open notification to be sent. - */ -var DidCloseTextDocumentNotification; -(function (DidCloseTextDocumentNotification) { - DidCloseTextDocumentNotification.method = 'textDocument/didClose'; - DidCloseTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification.method); -})(DidCloseTextDocumentNotification = exports.DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = {})); -/** - * The document save notification is sent from the client to the server when - * the document got saved in the client. - */ -var DidSaveTextDocumentNotification; -(function (DidSaveTextDocumentNotification) { - DidSaveTextDocumentNotification.method = 'textDocument/didSave'; - DidSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification.method); -})(DidSaveTextDocumentNotification = exports.DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = {})); -/** - * Represents reasons why a text document is saved. - */ -var TextDocumentSaveReason; -(function (TextDocumentSaveReason) { - /** - * Manually triggered, e.g. by the user pressing save, by starting debugging, - * or by an API call. - */ - TextDocumentSaveReason.Manual = 1; - /** - * Automatic after a delay. - */ - TextDocumentSaveReason.AfterDelay = 2; - /** - * When the editor lost focus. - */ - TextDocumentSaveReason.FocusOut = 3; -})(TextDocumentSaveReason = exports.TextDocumentSaveReason || (exports.TextDocumentSaveReason = {})); -/** - * A document will save notification is sent from the client to the server before - * the document is actually saved. - */ -var WillSaveTextDocumentNotification; -(function (WillSaveTextDocumentNotification) { - WillSaveTextDocumentNotification.method = 'textDocument/willSave'; - WillSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification.method); -})(WillSaveTextDocumentNotification = exports.WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = {})); -/** - * A document will save request is sent from the client to the server before - * the document is actually saved. The request can return an array of TextEdits - * which will be applied to the text document before it is saved. Please note that - * clients might drop results if computing the text edits took too long or if a - * server constantly fails on this request. This is done to keep the save fast and - * reliable. - */ -var WillSaveTextDocumentWaitUntilRequest; -(function (WillSaveTextDocumentWaitUntilRequest) { - WillSaveTextDocumentWaitUntilRequest.method = 'textDocument/willSaveWaitUntil'; - WillSaveTextDocumentWaitUntilRequest.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest.method); -})(WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = {})); -/** - * The watched files notification is sent from the client to the server when - * the client detects changes to file watched by the language client. - */ -var DidChangeWatchedFilesNotification; -(function (DidChangeWatchedFilesNotification) { - DidChangeWatchedFilesNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeWatchedFiles'); -})(DidChangeWatchedFilesNotification = exports.DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = {})); -/** - * The file event type - */ -var FileChangeType; -(function (FileChangeType) { - /** - * The file got created. - */ - FileChangeType.Created = 1; - /** - * The file got changed. - */ - FileChangeType.Changed = 2; - /** - * The file got deleted. - */ - FileChangeType.Deleted = 3; -})(FileChangeType = exports.FileChangeType || (exports.FileChangeType = {})); -var WatchKind; -(function (WatchKind) { - /** - * Interested in create events. - */ - WatchKind.Create = 1; - /** - * Interested in change events - */ - WatchKind.Change = 2; - /** - * Interested in delete events - */ - WatchKind.Delete = 4; -})(WatchKind = exports.WatchKind || (exports.WatchKind = {})); -/** - * Diagnostics notification are sent from the server to the client to signal - * results of validation runs. - */ -var PublishDiagnosticsNotification; -(function (PublishDiagnosticsNotification) { - PublishDiagnosticsNotification.type = new messages_1.ProtocolNotificationType('textDocument/publishDiagnostics'); -})(PublishDiagnosticsNotification = exports.PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = {})); -/** - * How a completion was triggered - */ -var CompletionTriggerKind; -(function (CompletionTriggerKind) { - /** - * Completion was triggered by typing an identifier (24x7 code - * complete), manual invocation (e.g Ctrl+Space) or via API. - */ - CompletionTriggerKind.Invoked = 1; - /** - * Completion was triggered by a trigger character specified by - * the `triggerCharacters` properties of the `CompletionRegistrationOptions`. - */ - CompletionTriggerKind.TriggerCharacter = 2; - /** - * Completion was re-triggered as current completion list is incomplete - */ - CompletionTriggerKind.TriggerForIncompleteCompletions = 3; -})(CompletionTriggerKind = exports.CompletionTriggerKind || (exports.CompletionTriggerKind = {})); -/** - * Request to request completion at a given text document position. The request's - * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response - * is of type [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList) - * or a Thenable that resolves to such. - * - * The request can delay the computation of the [`detail`](#CompletionItem.detail) - * and [`documentation`](#CompletionItem.documentation) properties to the `completionItem/resolve` - * request. However, properties that are needed for the initial sorting and filtering, like `sortText`, - * `filterText`, `insertText`, and `textEdit`, must not be changed during resolve. - */ -var CompletionRequest; -(function (CompletionRequest) { - CompletionRequest.method = 'textDocument/completion'; - CompletionRequest.type = new messages_1.ProtocolRequestType(CompletionRequest.method); - /** @deprecated Use CompletionRequest.type */ - CompletionRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(CompletionRequest = exports.CompletionRequest || (exports.CompletionRequest = {})); -/** - * Request to resolve additional information for a given completion item.The request's - * parameter is of type [CompletionItem](#CompletionItem) the response - * is of type [CompletionItem](#CompletionItem) or a Thenable that resolves to such. - */ -var CompletionResolveRequest; -(function (CompletionResolveRequest) { - CompletionResolveRequest.method = 'completionItem/resolve'; - CompletionResolveRequest.type = new messages_1.ProtocolRequestType(CompletionResolveRequest.method); -})(CompletionResolveRequest = exports.CompletionResolveRequest || (exports.CompletionResolveRequest = {})); -/** - * Request to request hover information at a given text document position. The request's - * parameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of - * type [Hover](#Hover) or a Thenable that resolves to such. - */ -var HoverRequest; -(function (HoverRequest) { - HoverRequest.method = 'textDocument/hover'; - HoverRequest.type = new messages_1.ProtocolRequestType(HoverRequest.method); -})(HoverRequest = exports.HoverRequest || (exports.HoverRequest = {})); -/** - * How a signature help was triggered. - * - * @since 3.15.0 - */ -var SignatureHelpTriggerKind; -(function (SignatureHelpTriggerKind) { - /** - * Signature help was invoked manually by the user or by a command. - */ - SignatureHelpTriggerKind.Invoked = 1; - /** - * Signature help was triggered by a trigger character. - */ - SignatureHelpTriggerKind.TriggerCharacter = 2; - /** - * Signature help was triggered by the cursor moving or by the document content changing. - */ - SignatureHelpTriggerKind.ContentChange = 3; -})(SignatureHelpTriggerKind = exports.SignatureHelpTriggerKind || (exports.SignatureHelpTriggerKind = {})); -var SignatureHelpRequest; -(function (SignatureHelpRequest) { - SignatureHelpRequest.method = 'textDocument/signatureHelp'; - SignatureHelpRequest.type = new messages_1.ProtocolRequestType(SignatureHelpRequest.method); -})(SignatureHelpRequest = exports.SignatureHelpRequest || (exports.SignatureHelpRequest = {})); -/** - * A request to resolve the definition location of a symbol at a given text - * document position. The request's parameter is of type [TextDocumentPosition] - * (#TextDocumentPosition) the response is of either type [Definition](#Definition) - * or a typed array of [DefinitionLink](#DefinitionLink) or a Thenable that resolves - * to such. - */ -var DefinitionRequest; -(function (DefinitionRequest) { - DefinitionRequest.method = 'textDocument/definition'; - DefinitionRequest.type = new messages_1.ProtocolRequestType(DefinitionRequest.method); - /** @deprecated Use DefinitionRequest.type */ - DefinitionRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(DefinitionRequest = exports.DefinitionRequest || (exports.DefinitionRequest = {})); -/** - * A request to resolve project-wide references for the symbol denoted - * by the given text document position. The request's parameter is of - * type [ReferenceParams](#ReferenceParams) the response is of type - * [Location[]](#Location) or a Thenable that resolves to such. - */ -var ReferencesRequest; -(function (ReferencesRequest) { - ReferencesRequest.method = 'textDocument/references'; - ReferencesRequest.type = new messages_1.ProtocolRequestType(ReferencesRequest.method); - /** @deprecated Use ReferencesRequest.type */ - ReferencesRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(ReferencesRequest = exports.ReferencesRequest || (exports.ReferencesRequest = {})); -/** - * Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given - * text document position. The request's parameter is of type [TextDocumentPosition] - * (#TextDocumentPosition) the request response is of type [DocumentHighlight[]] - * (#DocumentHighlight) or a Thenable that resolves to such. - */ -var DocumentHighlightRequest; -(function (DocumentHighlightRequest) { - DocumentHighlightRequest.method = 'textDocument/documentHighlight'; - DocumentHighlightRequest.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest.method); - /** @deprecated Use DocumentHighlightRequest.type */ - DocumentHighlightRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(DocumentHighlightRequest = exports.DocumentHighlightRequest || (exports.DocumentHighlightRequest = {})); -/** - * A request to list all symbols found in a given text document. The request's - * parameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the - * response is of type [SymbolInformation[]](#SymbolInformation) or a Thenable - * that resolves to such. - */ -var DocumentSymbolRequest; -(function (DocumentSymbolRequest) { - DocumentSymbolRequest.method = 'textDocument/documentSymbol'; - DocumentSymbolRequest.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest.method); - /** @deprecated Use DocumentSymbolRequest.type */ - DocumentSymbolRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(DocumentSymbolRequest = exports.DocumentSymbolRequest || (exports.DocumentSymbolRequest = {})); -/** - * A request to provide commands for the given text document and range. - */ -var CodeActionRequest; -(function (CodeActionRequest) { - CodeActionRequest.method = 'textDocument/codeAction'; - CodeActionRequest.type = new messages_1.ProtocolRequestType(CodeActionRequest.method); - /** @deprecated Use CodeActionRequest.type */ - CodeActionRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(CodeActionRequest = exports.CodeActionRequest || (exports.CodeActionRequest = {})); -/** - * A request to list project-wide symbols matching the query string given - * by the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is - * of type [SymbolInformation[]](#SymbolInformation) or a Thenable that - * resolves to such. - */ -var WorkspaceSymbolRequest; -(function (WorkspaceSymbolRequest) { - WorkspaceSymbolRequest.method = 'workspace/symbol'; - WorkspaceSymbolRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest.method); - /** @deprecated Use WorkspaceSymbolRequest.type */ - WorkspaceSymbolRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(WorkspaceSymbolRequest = exports.WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = {})); -/** - * A request to provide code lens for the given text document. - */ -var CodeLensRequest; -(function (CodeLensRequest) { - CodeLensRequest.type = new messages_1.ProtocolRequestType('textDocument/codeLens'); - /** @deprecated Use CodeLensRequest.type */ - CodeLensRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(CodeLensRequest = exports.CodeLensRequest || (exports.CodeLensRequest = {})); -/** - * A request to resolve a command for a given code lens. - */ -var CodeLensResolveRequest; -(function (CodeLensResolveRequest) { - CodeLensResolveRequest.type = new messages_1.ProtocolRequestType('codeLens/resolve'); -})(CodeLensResolveRequest = exports.CodeLensResolveRequest || (exports.CodeLensResolveRequest = {})); -/** - * A request to provide document links - */ -var DocumentLinkRequest; -(function (DocumentLinkRequest) { - DocumentLinkRequest.method = 'textDocument/documentLink'; - DocumentLinkRequest.type = new messages_1.ProtocolRequestType(DocumentLinkRequest.method); - /** @deprecated Use DocumentLinkRequest.type */ - DocumentLinkRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(DocumentLinkRequest = exports.DocumentLinkRequest || (exports.DocumentLinkRequest = {})); -/** - * Request to resolve additional information for a given document link. The request's - * parameter is of type [DocumentLink](#DocumentLink) the response - * is of type [DocumentLink](#DocumentLink) or a Thenable that resolves to such. - */ -var DocumentLinkResolveRequest; -(function (DocumentLinkResolveRequest) { - DocumentLinkResolveRequest.type = new messages_1.ProtocolRequestType('documentLink/resolve'); -})(DocumentLinkResolveRequest = exports.DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = {})); -/** - * A request to to format a whole document. - */ -var DocumentFormattingRequest; -(function (DocumentFormattingRequest) { - DocumentFormattingRequest.method = 'textDocument/formatting'; - DocumentFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest.method); -})(DocumentFormattingRequest = exports.DocumentFormattingRequest || (exports.DocumentFormattingRequest = {})); -/** - * A request to to format a range in a document. - */ -var DocumentRangeFormattingRequest; -(function (DocumentRangeFormattingRequest) { - DocumentRangeFormattingRequest.method = 'textDocument/rangeFormatting'; - DocumentRangeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest.method); -})(DocumentRangeFormattingRequest = exports.DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = {})); -/** - * A request to format a document on type. - */ -var DocumentOnTypeFormattingRequest; -(function (DocumentOnTypeFormattingRequest) { - DocumentOnTypeFormattingRequest.method = 'textDocument/onTypeFormatting'; - DocumentOnTypeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest.method); -})(DocumentOnTypeFormattingRequest = exports.DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = {})); -/** - * A request to rename a symbol. - */ -var RenameRequest; -(function (RenameRequest) { - RenameRequest.method = 'textDocument/rename'; - RenameRequest.type = new messages_1.ProtocolRequestType(RenameRequest.method); -})(RenameRequest = exports.RenameRequest || (exports.RenameRequest = {})); -/** - * A request to test and perform the setup necessary for a rename. - */ -var PrepareRenameRequest; -(function (PrepareRenameRequest) { - PrepareRenameRequest.method = 'textDocument/prepareRename'; - PrepareRenameRequest.type = new messages_1.ProtocolRequestType(PrepareRenameRequest.method); -})(PrepareRenameRequest = exports.PrepareRenameRequest || (exports.PrepareRenameRequest = {})); -/** - * A request send from the client to the server to execute a command. The request might return - * a workspace edit which the client will apply to the workspace. - */ -var ExecuteCommandRequest; -(function (ExecuteCommandRequest) { - ExecuteCommandRequest.type = new messages_1.ProtocolRequestType('workspace/executeCommand'); -})(ExecuteCommandRequest = exports.ExecuteCommandRequest || (exports.ExecuteCommandRequest = {})); -/** - * A request sent from the server to the client to modified certain resources. - */ -var ApplyWorkspaceEditRequest; -(function (ApplyWorkspaceEditRequest) { - ApplyWorkspaceEditRequest.type = new messages_1.ProtocolRequestType('workspace/applyEdit'); -})(ApplyWorkspaceEditRequest = exports.ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = {})); - - -/***/ }), -/* 177 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -function boolean(value) { - return value === true || value === false; -} -exports.boolean = boolean; -function string(value) { - return typeof value === 'string' || value instanceof String; -} -exports.string = string; -function number(value) { - return typeof value === 'number' || value instanceof Number; -} -exports.number = number; -function error(value) { - return value instanceof Error; -} -exports.error = error; -function func(value) { - return typeof value === 'function'; -} -exports.func = func; -function array(value) { - return Array.isArray(value); -} -exports.array = array; -function stringArray(value) { - return array(value) && value.every(elem => string(elem)); -} -exports.stringArray = stringArray; -function typedArray(value, check) { - return Array.isArray(value) && value.every(check); -} -exports.typedArray = typedArray; -function objectLiteral(value) { - // Strictly speaking class instances pass this check as well. Since the LSP - // doesn't use classes we ignore this for now. If we do we need to add something - // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null` - return value !== null && typeof value === 'object'; -} -exports.objectLiteral = objectLiteral; - - -/***/ }), -/* 178 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(163); -class ProtocolRequestType0 extends vscode_jsonrpc_1.RequestType0 { - constructor(method) { - super(method); - } -} -exports.ProtocolRequestType0 = ProtocolRequestType0; -class ProtocolRequestType extends vscode_jsonrpc_1.RequestType { - constructor(method) { - super(method); - } -} -exports.ProtocolRequestType = ProtocolRequestType; -class ProtocolNotificationType extends vscode_jsonrpc_1.NotificationType { - constructor(method) { - super(method); - } -} -exports.ProtocolNotificationType = ProtocolNotificationType; -class ProtocolNotificationType0 extends vscode_jsonrpc_1.NotificationType0 { - constructor(method) { - super(method); - } -} -exports.ProtocolNotificationType0 = ProtocolNotificationType0; - - -/***/ }), -/* 179 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(163); -const messages_1 = __webpack_require__(178); -// @ts-ignore: to avoid inlining LocatioLink as dynamic import -let __noDynamicImport; -/** - * A request to resolve the implementation locations of a symbol at a given text - * document position. The request's parameter is of type [TextDocumentPositioParams] - * (#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a - * Thenable that resolves to such. - */ -var ImplementationRequest; -(function (ImplementationRequest) { - ImplementationRequest.method = 'textDocument/implementation'; - ImplementationRequest.type = new messages_1.ProtocolRequestType(ImplementationRequest.method); - /** @deprecated Use ImplementationRequest.type */ - ImplementationRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(ImplementationRequest = exports.ImplementationRequest || (exports.ImplementationRequest = {})); - - -/***/ }), -/* 180 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(163); -const messages_1 = __webpack_require__(178); -// @ts-ignore: to avoid inlining LocatioLink as dynamic import -let __noDynamicImport; -/** - * A request to resolve the type definition locations of a symbol at a given text - * document position. The request's parameter is of type [TextDocumentPositioParams] - * (#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a - * Thenable that resolves to such. - */ -var TypeDefinitionRequest; -(function (TypeDefinitionRequest) { - TypeDefinitionRequest.method = 'textDocument/typeDefinition'; - TypeDefinitionRequest.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest.method); - /** @deprecated Use TypeDefinitionRequest.type */ - TypeDefinitionRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(TypeDefinitionRequest = exports.TypeDefinitionRequest || (exports.TypeDefinitionRequest = {})); - - -/***/ }), -/* 181 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const messages_1 = __webpack_require__(178); -/** - * The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders. - */ -var WorkspaceFoldersRequest; -(function (WorkspaceFoldersRequest) { - WorkspaceFoldersRequest.type = new messages_1.ProtocolRequestType0('workspace/workspaceFolders'); -})(WorkspaceFoldersRequest = exports.WorkspaceFoldersRequest || (exports.WorkspaceFoldersRequest = {})); -/** - * The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace - * folder configuration changes. - */ -var DidChangeWorkspaceFoldersNotification; -(function (DidChangeWorkspaceFoldersNotification) { - DidChangeWorkspaceFoldersNotification.type = new messages_1.ProtocolNotificationType('workspace/didChangeWorkspaceFolders'); -})(DidChangeWorkspaceFoldersNotification = exports.DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = {})); - - -/***/ }), -/* 182 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const messages_1 = __webpack_require__(178); -/** - * The 'workspace/configuration' request is sent from the server to the client to fetch a certain - * configuration setting. - * - * This pull model replaces the old push model were the client signaled configuration change via an - * event. If the server still needs to react to configuration changes (since the server caches the - * result of `workspace/configuration` requests) the server should register for an empty configuration - * change event and empty the cache if such an event is received. - */ -var ConfigurationRequest; -(function (ConfigurationRequest) { - ConfigurationRequest.type = new messages_1.ProtocolRequestType('workspace/configuration'); -})(ConfigurationRequest = exports.ConfigurationRequest || (exports.ConfigurationRequest = {})); - - -/***/ }), -/* 183 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(163); -const messages_1 = __webpack_require__(178); -/** - * A request to list all color symbols found in a given text document. The request's - * parameter is of type [DocumentColorParams](#DocumentColorParams) the - * response is of type [ColorInformation[]](#ColorInformation) or a Thenable - * that resolves to such. - */ -var DocumentColorRequest; -(function (DocumentColorRequest) { - DocumentColorRequest.method = 'textDocument/documentColor'; - DocumentColorRequest.type = new messages_1.ProtocolRequestType(DocumentColorRequest.method); - /** @deprecated Use DocumentColorRequest.type */ - DocumentColorRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(DocumentColorRequest = exports.DocumentColorRequest || (exports.DocumentColorRequest = {})); -/** - * A request to list all presentation for a color. The request's - * parameter is of type [ColorPresentationParams](#ColorPresentationParams) the - * response is of type [ColorInformation[]](#ColorInformation) or a Thenable - * that resolves to such. - */ -var ColorPresentationRequest; -(function (ColorPresentationRequest) { - ColorPresentationRequest.type = new messages_1.ProtocolRequestType('textDocument/colorPresentation'); -})(ColorPresentationRequest = exports.ColorPresentationRequest || (exports.ColorPresentationRequest = {})); - - -/***/ }), -/* 184 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(163); -const messages_1 = __webpack_require__(178); -/** - * Enum of known range kinds - */ -var FoldingRangeKind; -(function (FoldingRangeKind) { - /** - * Folding range for a comment - */ - FoldingRangeKind["Comment"] = "comment"; - /** - * Folding range for a imports or includes - */ - FoldingRangeKind["Imports"] = "imports"; - /** - * Folding range for a region (e.g. `#region`) - */ - FoldingRangeKind["Region"] = "region"; -})(FoldingRangeKind = exports.FoldingRangeKind || (exports.FoldingRangeKind = {})); -/** - * A request to provide folding ranges in a document. The request's - * parameter is of type [FoldingRangeParams](#FoldingRangeParams), the - * response is of type [FoldingRangeList](#FoldingRangeList) or a Thenable - * that resolves to such. - */ -var FoldingRangeRequest; -(function (FoldingRangeRequest) { - FoldingRangeRequest.method = 'textDocument/foldingRange'; - FoldingRangeRequest.type = new messages_1.ProtocolRequestType(FoldingRangeRequest.method); - /** @deprecated Use FoldingRangeRequest.type */ - FoldingRangeRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(FoldingRangeRequest = exports.FoldingRangeRequest || (exports.FoldingRangeRequest = {})); - - -/***/ }), -/* 185 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(163); -const messages_1 = __webpack_require__(178); -// @ts-ignore: to avoid inlining LocatioLink as dynamic import -let __noDynamicImport; -/** - * A request to resolve the type definition locations of a symbol at a given text - * document position. The request's parameter is of type [TextDocumentPositioParams] - * (#TextDocumentPositionParams) the response is of type [Declaration](#Declaration) - * or a typed array of [DeclarationLink](#DeclarationLink) or a Thenable that resolves - * to such. - */ -var DeclarationRequest; -(function (DeclarationRequest) { - DeclarationRequest.method = 'textDocument/declaration'; - DeclarationRequest.type = new messages_1.ProtocolRequestType(DeclarationRequest.method); - /** @deprecated Use DeclarationRequest.type */ - DeclarationRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(DeclarationRequest = exports.DeclarationRequest || (exports.DeclarationRequest = {})); - - -/***/ }), -/* 186 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(163); -const messages_1 = __webpack_require__(178); -/** - * A request to provide selection ranges in a document. The request's - * parameter is of type [SelectionRangeParams](#SelectionRangeParams), the - * response is of type [SelectionRange[]](#SelectionRange[]) or a Thenable - * that resolves to such. - */ -var SelectionRangeRequest; -(function (SelectionRangeRequest) { - SelectionRangeRequest.method = 'textDocument/selectionRange'; - SelectionRangeRequest.type = new messages_1.ProtocolRequestType(SelectionRangeRequest.method); - /** @deprecated Use SelectionRangeRequest.type */ - SelectionRangeRequest.resultType = new vscode_jsonrpc_1.ProgressType(); -})(SelectionRangeRequest = exports.SelectionRangeRequest || (exports.SelectionRangeRequest = {})); - - -/***/ }), -/* 187 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const vscode_jsonrpc_1 = __webpack_require__(163); -const messages_1 = __webpack_require__(178); -var WorkDoneProgress; -(function (WorkDoneProgress) { - WorkDoneProgress.type = new vscode_jsonrpc_1.ProgressType(); -})(WorkDoneProgress = exports.WorkDoneProgress || (exports.WorkDoneProgress = {})); -/** - * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress - * reporting from the server. - */ -var WorkDoneProgressCreateRequest; -(function (WorkDoneProgressCreateRequest) { - WorkDoneProgressCreateRequest.type = new messages_1.ProtocolRequestType('window/workDoneProgress/create'); -})(WorkDoneProgressCreateRequest = exports.WorkDoneProgressCreateRequest || (exports.WorkDoneProgressCreateRequest = {})); -/** - * The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress - * initiated on the server side. - */ -var WorkDoneProgressCancelNotification; -(function (WorkDoneProgressCancelNotification) { - WorkDoneProgressCancelNotification.type = new messages_1.ProtocolNotificationType('window/workDoneProgress/cancel'); -})(WorkDoneProgressCancelNotification = exports.WorkDoneProgressCancelNotification || (exports.WorkDoneProgressCancelNotification = {})); - - -/***/ }), -/* 188 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) TypeFox and others. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const messages_1 = __webpack_require__(178); -/** - * A request to result a `CallHierarchyItem` in a document at a given position. - * Can be used as an input to a incoming or outgoing call hierarchy. - * - * @since 3.16.0 - Proposed state - */ -var CallHierarchyPrepareRequest; -(function (CallHierarchyPrepareRequest) { - CallHierarchyPrepareRequest.method = 'textDocument/prepareCallHierarchy'; - CallHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(CallHierarchyPrepareRequest.method); -})(CallHierarchyPrepareRequest = exports.CallHierarchyPrepareRequest || (exports.CallHierarchyPrepareRequest = {})); -/** - * A request to resolve the incoming calls for a given `CallHierarchyItem`. - * - * @since 3.16.0 - Proposed state - */ -var CallHierarchyIncomingCallsRequest; -(function (CallHierarchyIncomingCallsRequest) { - CallHierarchyIncomingCallsRequest.method = 'callHierarchy/incomingCalls'; - CallHierarchyIncomingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyIncomingCallsRequest.method); -})(CallHierarchyIncomingCallsRequest = exports.CallHierarchyIncomingCallsRequest || (exports.CallHierarchyIncomingCallsRequest = {})); -/** - * A request to resolve the outgoing calls for a given `CallHierarchyItem`. - * - * @since 3.16.0 - Proposed state - */ -var CallHierarchyOutgoingCallsRequest; -(function (CallHierarchyOutgoingCallsRequest) { - CallHierarchyOutgoingCallsRequest.method = 'callHierarchy/outgoingCalls'; - CallHierarchyOutgoingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyOutgoingCallsRequest.method); -})(CallHierarchyOutgoingCallsRequest = exports.CallHierarchyOutgoingCallsRequest || (exports.CallHierarchyOutgoingCallsRequest = {})); - - -/***/ }), -/* 189 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -Object.defineProperty(exports, "__esModule", { value: true }); -const messages_1 = __webpack_require__(178); -/** - * A set of predefined token types. This set is not fixed - * an clients can specify additional token types via the - * corresponding client capabilities. - * - * @since 3.16.0 - Proposed state - */ -var SemanticTokenTypes; -(function (SemanticTokenTypes) { - SemanticTokenTypes["comment"] = "comment"; - SemanticTokenTypes["keyword"] = "keyword"; - SemanticTokenTypes["string"] = "string"; - SemanticTokenTypes["number"] = "number"; - SemanticTokenTypes["regexp"] = "regexp"; - SemanticTokenTypes["operator"] = "operator"; - SemanticTokenTypes["namespace"] = "namespace"; - SemanticTokenTypes["type"] = "type"; - SemanticTokenTypes["struct"] = "struct"; - SemanticTokenTypes["class"] = "class"; - SemanticTokenTypes["interface"] = "interface"; - SemanticTokenTypes["enum"] = "enum"; - SemanticTokenTypes["typeParameter"] = "typeParameter"; - SemanticTokenTypes["function"] = "function"; - SemanticTokenTypes["member"] = "member"; - SemanticTokenTypes["property"] = "property"; - SemanticTokenTypes["macro"] = "macro"; - SemanticTokenTypes["variable"] = "variable"; - SemanticTokenTypes["parameter"] = "parameter"; - SemanticTokenTypes["label"] = "label"; -})(SemanticTokenTypes = exports.SemanticTokenTypes || (exports.SemanticTokenTypes = {})); -/** - * A set of predefined token modifiers. This set is not fixed - * an clients can specify additional token types via the - * corresponding client capabilities. - * - * @since 3.16.0 - Proposed state - */ -var SemanticTokenModifiers; -(function (SemanticTokenModifiers) { - SemanticTokenModifiers["documentation"] = "documentation"; - SemanticTokenModifiers["declaration"] = "declaration"; - SemanticTokenModifiers["definition"] = "definition"; - SemanticTokenModifiers["reference"] = "reference"; - SemanticTokenModifiers["static"] = "static"; - SemanticTokenModifiers["abstract"] = "abstract"; - SemanticTokenModifiers["deprecated"] = "deprecated"; - SemanticTokenModifiers["async"] = "async"; - SemanticTokenModifiers["volatile"] = "volatile"; - SemanticTokenModifiers["readonly"] = "readonly"; -})(SemanticTokenModifiers = exports.SemanticTokenModifiers || (exports.SemanticTokenModifiers = {})); -/** - * @since 3.16.0 - Proposed state - */ -var SemanticTokens; -(function (SemanticTokens) { - function is(value) { - const candidate = value; - return candidate !== undefined && (candidate.resultId === undefined || typeof candidate.resultId === 'string') && - Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number'); - } - SemanticTokens.is = is; -})(SemanticTokens = exports.SemanticTokens || (exports.SemanticTokens = {})); -/** - * @since 3.16.0 - Proposed state - */ -var SemanticTokensRequest; -(function (SemanticTokensRequest) { - SemanticTokensRequest.method = 'textDocument/semanticTokens'; - SemanticTokensRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRequest.method); -})(SemanticTokensRequest = exports.SemanticTokensRequest || (exports.SemanticTokensRequest = {})); -/** - * @since 3.16.0 - Proposed state - */ -var SemanticTokensEditsRequest; -(function (SemanticTokensEditsRequest) { - SemanticTokensEditsRequest.method = 'textDocument/semanticTokens/edits'; - SemanticTokensEditsRequest.type = new messages_1.ProtocolRequestType(SemanticTokensEditsRequest.method); -})(SemanticTokensEditsRequest = exports.SemanticTokensEditsRequest || (exports.SemanticTokensEditsRequest = {})); -/** - * @since 3.16.0 - Proposed state - */ -var SemanticTokensRangeRequest; -(function (SemanticTokensRangeRequest) { - SemanticTokensRangeRequest.method = 'textDocument/semanticTokens/range'; - SemanticTokensRangeRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest.method); -})(SemanticTokensRangeRequest = exports.SemanticTokensRangeRequest || (exports.SemanticTokensRangeRequest = {})); - - -/***/ }) -/******/ ]))); \ No newline at end of file +/*! For license information please see index.js.LICENSE.txt */ +!function(e,t){for(var n in t)e[n]=t[n];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})}(exports,(()=>{var e=[(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.activate=void 0;const r=n(1),i=n(2),s=[{language:"markdown",scheme:"file"},{language:"markdown",scheme:"untitled"}];let o=0;const a=new i.MarkdownlintEngine,u=r.workspace.getConfiguration("markdownlint");function c(e){u.get("onOpen",!0)&&a.lint(e)}async function l(e){if(u.get("onChange",!0)&&e.textDocument.version&&o!==e.textDocument.version){o=e.textDocument.version;const{document:t}=await r.workspace.getCurrentState();a.lint(t)}}async function h(e){u.get("onSave",!0)&&a.lint(e)}t.activate=async function(e){await a.parseConfig(),e.subscriptions.push(r.languages.registerCodeActionProvider(s,a,"markdownlint"),r.commands.registerCommand(a.fixAllCommandName,(async()=>{const{document:e}=await r.workspace.getCurrentState();a.fixAll(e)})),r.workspace.onDidOpenTextDocument(c),r.workspace.onDidChangeTextDocument(l),r.workspace.onDidSaveTextDocument(h)),r.workspace.documents.map((e=>{c(e.textDocument)}))}},e=>{"use strict";e.exports=require("coc.nvim")},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MarkdownlintEngine=void 0;const i=n(1),s=r(n(3)),o=r(n(4)),a=r(n(5)),u=r(n(37)),c=n(158),l=r(n(39)),h=r(n(159)),p=n(164),d=[".markdownlint.json",".markdownlint.yaml",".markdownlint.yml"],f=[JSON.parse,a.default.safeLoad];t.MarkdownlintEngine=class{constructor(){this.fixAllCommandName="markdownlint.fixAll",this.source="markdownlint",this.outputChannel=i.workspace.createOutputChannel(this.source),this.diagnosticCollection=i.languages.createDiagnosticCollection(this.source),this.config={}}outputLine(e){this.outputChannel&&this.outputChannel.appendLine(`[${(new Date).toLocaleTimeString()}] ${e}`)}async parseConfig(){try{this.config=h.default(this.source,{}),this.outputLine("Info: global config: "+JSON.stringify(h.default(this.source,{})))}catch(e){this.outputLine("Error: global config parse failed: "+e)}try{const e=i.workspace.getConfiguration("coc.preferences"),t=await i.workspace.resolveRootFolder(i.Uri.parse(i.workspace.uri),e.get("rootPatterns",[]));for(const e of d){const n=l.default.join(t,e);if(o.default.existsSync(n)){const e=u.default.readConfigSync(n,f);this.config=s.default(this.config,e),this.outputLine(`Info: local config: ${n}, ${JSON.stringify(e)}`);break}}}catch(e){this.outputLine("Error: local config parse failed: "+e)}const e=i.workspace.getConfiguration("markdownlint").get("config");e&&(this.config=s.default(this.config,e),this.outputLine("Info: config from coc-settings.json: "+JSON.stringify(e))),this.outputLine("Info: full config: "+JSON.stringify(this.config))}markdownlintWrapper(e){const t={resultVersion:3,config:this.config,strings:{[e.uri]:e.getText()}};let n=[];try{n=u.default.sync(t)[e.uri]}catch(e){this.outputLine("Error: lint exception: "+e.stack)}return n}async provideCodeActions(e,t,n){const r=[],s=[];for(const t of n.diagnostics)if(t.fixInfo){const o=t.fixInfo.lineNumber-1||t.range.start.line,a=await i.workspace.getLine(e.uri,o),u=c.applyFix(a,t.fixInfo,"\n"),l={changes:{}};if("string"==typeof u){const t=p.Range.create(o,0,o,a.length);l.changes[e.uri]=[p.TextEdit.replace(t,u)]}else l.changes[e.uri]=[p.TextEdit.del(t.range)];const h={title:"Fix: "+t.message.split(":")[0],edit:l,diagnostics:[...n.diagnostics]};s.push(t),r.push(h)}if(s.length){const e="Fix All error found by markdownlint",t={title:e,kind:p.CodeActionKind.SourceFixAll,diagnostics:s,command:{title:e,command:this.fixAllCommandName}};r.push(t)}return r}lint(e){if("markdown"!==e.languageId)return;this.diagnosticCollection.clear();const t=this.markdownlintWrapper(e);if(!t.length)return;const n=[];t.forEach((e=>{const t=e.ruleDescription;let r=e.ruleNames.join("/")+": "+t;e.errorDetail&&(r+=" ["+e.errorDetail+"]");const i=p.Position.create(e.lineNumber-1,0),s=p.Position.create(e.lineNumber-1,0);e.errorRange&&(i.character=e.errorRange[0]-1,s.character=i.character+e.errorRange[1]);const o=p.Range.create(i,s),a=p.Diagnostic.create(o,r);a.severity=p.DiagnosticSeverity.Warning,a.source=this.source,a.fixInfo=e.fixInfo,n.push(a)})),this.diagnosticCollection.set(e.uri,n)}async fixAll(e){const t=this.markdownlintWrapper(e);if(!t.length)return;const n=e.getText(),r=c.applyFixes(n,t);if(n!=r){const t=i.workspace.getDocument(e.uri),n=p.Position.create(t.lineCount-1,t.getline(t.lineCount-1).length),s={changes:{[e.uri]:[p.TextEdit.replace(p.Range.create(p.Position.create(0,0),n),r)]}};await i.workspace.applyEdit(s)}}}},e=>{"use strict";function t(e){return e instanceof Buffer||e instanceof Date||e instanceof RegExp}function n(e){if(e instanceof Buffer){var t=Buffer.alloc?Buffer.alloc(e.length):new Buffer(e.length);return e.copy(t),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function r(e){var i=[];return e.forEach((function(e,o){"object"==typeof e&&null!==e?Array.isArray(e)?i[o]=r(e):t(e)?i[o]=n(e):i[o]=s({},e):i[o]=e})),i}function i(e,t){return"__proto__"===t?void 0:e[t]}var s=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,o,a=arguments[0],u=Array.prototype.slice.call(arguments,1);return u.forEach((function(u){"object"!=typeof u||null===u||Array.isArray(u)||Object.keys(u).forEach((function(c){return o=i(a,c),(e=i(u,c))===a?void 0:"object"!=typeof e||null===e?void(a[c]=e):Array.isArray(e)?void(a[c]=r(e)):t(e)?void(a[c]=n(e)):"object"!=typeof o||null===o||Array.isArray(o)?void(a[c]=s({},e)):void(a[c]=s(o,e))}))})),a}},e=>{"use strict";e.exports=require("fs")},(e,t,n)=>{"use strict";var r=n(6);e.exports=r},(e,t,n)=>{"use strict";var r=n(7),i=n(36);function s(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}e.exports.Type=n(13),e.exports.Schema=n(12),e.exports.FAILSAFE_SCHEMA=n(16),e.exports.JSON_SCHEMA=n(15),e.exports.CORE_SCHEMA=n(14),e.exports.DEFAULT_SAFE_SCHEMA=n(11),e.exports.DEFAULT_FULL_SCHEMA=n(31),e.exports.load=r.load,e.exports.loadAll=r.loadAll,e.exports.safeLoad=r.safeLoad,e.exports.safeLoadAll=r.safeLoadAll,e.exports.dump=i.dump,e.exports.safeDump=i.safeDump,e.exports.YAMLException=n(9),e.exports.MINIMAL_SCHEMA=n(16),e.exports.SAFE_SCHEMA=n(11),e.exports.DEFAULT_SCHEMA=n(31),e.exports.scan=s("scan"),e.exports.parse=s("parse"),e.exports.compose=s("compose"),e.exports.addConstructor=s("addConstructor")},(e,t,n)=>{"use strict";var r=n(8),i=n(9),s=n(10),o=n(11),a=n(31),u=Object.prototype.hasOwnProperty,c=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,l=/[\x85\u2028\u2029]/,h=/[,\[\]\{\}]/,p=/^(?:!|!!|![a-z\-]+!)$/i,d=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function f(e){return Object.prototype.toString.call(e)}function m(e){return 10===e||13===e}function g(e){return 9===e||32===e}function x(e){return 9===e||32===e||10===e||13===e}function y(e){return 44===e||91===e||93===e||123===e||125===e}function D(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function C(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function v(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var E=new Array(256),k=new Array(256),b=0;b<256;b++)E[b]=C(b)?1:0,k[b]=C(b);function A(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||a,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function w(e,t){return new i(t,new s(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function S(e,t){throw w(e,t)}function _(e,t){e.onWarning&&e.onWarning.call(null,w(e,t))}var F={YAML:function(e,t,n){var r,i,s;null!==e.version&&S(e,"duplication of %YAML directive"),1!==n.length&&S(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&S(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),s=parseInt(r[2],10),1!==i&&S(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=s<2,1!==s&&2!==s&&_(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&S(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],p.test(r)||S(e,"ill-formed tag handle (first argument) of the TAG directive"),u.call(e.tagMap,r)&&S(e,'there is a previously declared suffix for "'+r+'" tag handle'),d.test(i)||S(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=i}};function T(e,t,n,r){var i,s,o,a;if(t1&&(e.result+=r.repeat("\n",t-1))}function q(e,t){var n,r,i=e.tag,s=e.anchor,o=[],a=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),r=e.input.charCodeAt(e.position);0!==r&&45===r&&x(e.input.charCodeAt(e.position+1));)if(a=!0,e.position++,I(e,!0,-1)&&e.lineIndent<=t)o.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,z(e,t,3,!1,!0),o.push(e.result),I(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)S(e,"bad indentation of a sequence entry");else if(e.lineIndentt?C=1:e.lineIndent===t?C=0:e.lineIndentt?C=1:e.lineIndent===t?C=0:e.lineIndentt)&&(z(e,t,4,!0,i)&&(m?d=e.result:f=e.result),m||(M(e,l,h,p,d,f,s,o),p=d=f=null),I(e,!0,-1),a=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==a)S(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===s?S(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?S(e,"repeat of an indentation width identifier"):(h=t+s-1,l=!0)}if(g(o)){do{o=e.input.charCodeAt(++e.position)}while(g(o));if(35===o)do{o=e.input.charCodeAt(++e.position)}while(!m(o)&&0!==o)}for(;0!==o;){for(R(e),e.lineIndent=0,o=e.input.charCodeAt(e.position);(!l||e.lineIndenth&&(h=e.lineIndent),m(o))p++;else{if(e.lineIndent0){for(i=o,s=0;i>0;i--)(o=D(a=e.input.charCodeAt(++e.position)))>=0?s=(s<<4)+o:S(e,"expected hexadecimal character");e.result+=v(s),e.position++}else S(e,"unknown escape sequence");n=r=e.position}else m(a)?(T(e,n,r,!0),L(e,I(e,!1,t)),n=r=e.position):e.position===e.lineStart&&B(e)?S(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}S(e,"unexpected end of the stream within a double quoted scalar")}(e,d)?A=!0:function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!x(r)&&!y(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&S(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),e.anchorMap.hasOwnProperty(n)||S(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],I(e,!0,-1),!0}(e)?(A=!0,null===e.tag&&null===e.anchor||S(e,"alias node should not have any properties")):function(e,t,n){var r,i,s,o,a,u,c,l,h=e.kind,p=e.result;if(x(l=e.input.charCodeAt(e.position))||y(l)||35===l||38===l||42===l||33===l||124===l||62===l||39===l||34===l||37===l||64===l||96===l)return!1;if((63===l||45===l)&&(x(r=e.input.charCodeAt(e.position+1))||n&&y(r)))return!1;for(e.kind="scalar",e.result="",i=s=e.position,o=!1;0!==l;){if(58===l){if(x(r=e.input.charCodeAt(e.position+1))||n&&y(r))break}else if(35===l){if(x(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&B(e)||n&&y(l))break;if(m(l)){if(a=e.line,u=e.lineStart,c=e.lineIndent,I(e,!1,-1),e.lineIndent>=t){o=!0,l=e.input.charCodeAt(e.position);continue}e.position=s,e.line=a,e.lineStart=u,e.lineIndent=c;break}}o&&(T(e,i,s,!1),L(e,e.line-a),i=s=e.position,o=!1),g(l)||(s=e.position+1),l=e.input.charCodeAt(++e.position)}return T(e,i,s,!1),!!e.result||(e.kind=h,e.result=p,!1)}(e,d,1===n)&&(A=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===C&&(A=c&&q(e,f))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&S(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),l=0,h=e.implicitTypes.length;l tag; it should be "'+p.kind+'", not "'+e.kind+'"'),p.resolve(e.result)?(e.result=p.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):S(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):S(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||A}function j(e){var t,n,r,i,s=e.position,o=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(i=e.input.charCodeAt(e.position))&&(I(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(o=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!x(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&S(e,"directive name must not be less than one character in length");0!==i;){for(;g(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!m(i));break}if(m(i))break;for(t=e.position;0!==i&&!x(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&R(e),u.call(F,n)?F[n](e,n,r):_(e,'unknown document directive "'+n+'"')}I(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,I(e,!0,-1)):o&&S(e,"directives end mark is expected"),z(e,e.lineIndent-1,4,!1,!0),I(e,!0,-1),e.checkLineBreaks&&l.test(e.input.slice(s,e.position))&&_(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&B(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,I(e,!0,-1)):e.position{"use strict";function t(e){return null==e}e.exports.isNothing=t,e.exports.isObject=function(e){return"object"==typeof e&&null!==e},e.exports.toArray=function(e){return Array.isArray(e)?e:t(e)?[]:[e]},e.exports.repeat=function(e,t){var n,r="";for(n=0;n{"use strict";function t(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=t},(e,t,n)=>{"use strict";var r=n(8);function i(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}i.prototype.getSnippet=function(e,t){var n,i,s,o,a;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",i=this.position;i>0&&-1==="\0\r\n…\u2028\u2029".indexOf(this.buffer.charAt(i-1));)if(i-=1,this.position-i>t/2-1){n=" ... ",i+=5;break}for(s="",o=this.position;ot/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(i,o),r.repeat(" ",e)+n+a+s+"\n"+r.repeat(" ",e+this.position-i+n.length)+"^"},i.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n},e.exports=i},(e,t,n)=>{"use strict";var r=n(12);e.exports=new r({include:[n(14)],implicit:[n(24),n(25)],explicit:[n(26),n(28),n(29),n(30)]})},(e,t,n)=>{"use strict";var r=n(8),i=n(9),s=n(13);function o(e,t,n){var r=[];return e.include.forEach((function(e){n=o(e,t,n)})),e[t].forEach((function(e){n.forEach((function(t,n){t.tag===e.tag&&t.kind===e.kind&&r.push(n)})),n.push(e)})),n.filter((function(e,t){return-1===r.indexOf(t)}))}function a(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach((function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new i("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")})),this.compiledImplicit=o(this,"implicit",[]),this.compiledExplicit=o(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function r(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e{"use strict";var r=n(9),i=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];e.exports=function(e,t){var n,o;if(t=t||{},Object.keys(t).forEach((function(t){if(-1===i.indexOf(t))throw new r('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=(n=t.styleAliases||null,o={},null!==n&&Object.keys(n).forEach((function(e){n[e].forEach((function(t){o[String(t)]=e}))})),o),-1===s.indexOf(this.kind))throw new r('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}},(e,t,n)=>{"use strict";var r=n(12);e.exports=new r({include:[n(15)]})},(e,t,n)=>{"use strict";var r=n(12);e.exports=new r({include:[n(16)],implicit:[n(20),n(21),n(22),n(23)]})},(e,t,n)=>{"use strict";var r=n(12);e.exports=new r({explicit:[n(17),n(18),n(19)]})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},(e,t,n)=>{"use strict";var r=n(8),i=n(13);function s(e){return 48<=e&&e<=55}function o(e){return 48<=e&&e<=57}e.exports=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,i=0,a=!1;if(!r)return!1;if("-"!==(t=e[i])&&"+"!==t||(t=e[++i]),"0"===t){if(i+1===r)return!0;if("b"===(t=e[++i])){for(i++;i=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},(e,t,n)=>{"use strict";var r=n(8),i=n(13),s=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),o=/^[-+]?[0-9]+e/;e.exports=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!s.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,r,i;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,i=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach((function(e){i.unshift(parseFloat(e,10))})),t=0,r=1,i.forEach((function(e){t+=e*r,r*=60})),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||r.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(e))return"-0.0";return n=e.toString(10),o.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})},(e,t,n)=>{"use strict";var r=n(13),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");e.exports=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==i.exec(e)||null!==s.exec(e))},construct:function(e){var t,n,r,o,a,u,c,l,h=0,p=null;if(null===(t=i.exec(e))&&(t=s.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,o=+t[3],!t[4])return new Date(Date.UTC(n,r,o));if(a=+t[4],u=+t[5],c=+t[6],t[7]){for(h=t[7].slice(0,3);h.length<3;)h+="0";h=+h}return t[9]&&(p=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(p=-p)),l=new Date(Date.UTC(n,r,o,a,u,c,h)),p&&l.setTime(l.getTime()-p),l},instanceOf:Date,represent:function(e){return e.toISOString()}})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})},(e,t,n)=>{"use strict";var r;try{r=n(27).Buffer}catch(e){}var i=n(13),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";e.exports=new i("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,i=e.length,o=s;for(n=0;n64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,i=e.replace(/[\r\n=]/g,""),o=i.length,a=s,u=0,c=[];for(t=0;t>16&255),c.push(u>>8&255),c.push(255&u)),u=u<<6|a.indexOf(i.charAt(t));return 0==(n=o%4*6)?(c.push(u>>16&255),c.push(u>>8&255),c.push(255&u)):18===n?(c.push(u>>10&255),c.push(u>>2&255)):12===n&&c.push(u>>4&255),r?r.from?r.from(c):new r(c):c},predicate:function(e){return r&&r.isBuffer(e)},represent:function(e){var t,n,r="",i=0,o=e.length,a=s;for(t=0;t>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]),i=(i<<8)+e[t];return 0==(n=o%3)?(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]):2===n?(r+=a[i>>10&63],r+=a[i>>4&63],r+=a[i<<2&63],r+=a[64]):1===n&&(r+=a[i>>2&63],r+=a[i<<4&63],r+=a[64],r+=a[64]),r}})},e=>{"use strict";e.exports=require("buffer")},(e,t,n)=>{"use strict";var r=n(13),i=Object.prototype.hasOwnProperty,s=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,o,a,u=[],c=e;for(t=0,n=c.length;t{"use strict";var r=n(13),i=Object.prototype.toString;e.exports=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,s,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t{"use strict";var r=n(13),i=Object.prototype.hasOwnProperty;e.exports=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(i.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})},(e,t,n)=>{"use strict";var r=n(12);e.exports=r.DEFAULT=new r({include:[n(11)],explicit:[n(32),n(33),n(34)]})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}})},(e,t,n)=>{"use strict";var r=n(13);e.exports=new r("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1}return!0},construct:function(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}})},(e,t,n)=>{"use strict";var r;try{r=n(35)}catch(e){"undefined"!=typeof window&&(r=window.esprima)}var i=n(13);e.exports=new i("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",n=r.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(e){return!1}},construct:function(e){var t,n="("+e+")",i=r.parse(n,{range:!0}),s=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"ArrowFunctionExpression"!==i.body[0].expression.type&&"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach((function(e){s.push(e.name)})),t=i.body[0].expression.body.range,"BlockStatement"===i.body[0].expression.body.type?new Function(s,n.slice(t[0]+1,t[1]-1)):new Function(s,"return "+n.slice(t[0],t[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}})},function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(3),s=n(8),o=n(15);function a(e,t,n){var o=null,a=function(e,t){n&&n(e,t),o&&o.visit(e,t)},u="function"==typeof n?a:null,c=!1;if(t){c="boolean"==typeof t.comment&&t.comment;var l="boolean"==typeof t.attachComment&&t.attachComment;(c||l)&&((o=new r.CommentHandler).attach=l,t.comment=!0,u=a)}var h,p=!1;t&&"string"==typeof t.sourceType&&(p="module"===t.sourceType),h=t&&"boolean"==typeof t.jsx&&t.jsx?new i.JSXParser(e,t,u):new s.Parser(e,t,u);var d=p?h.parseModule():h.parseScript();return c&&o&&(d.comments=o.comments),h.config.tokens&&(d.tokens=h.tokens),h.config.tolerant&&(d.errors=h.errorHandler.errors),d}t.parse=a,t.parseModule=function(e,t,n){var r=t||{};return r.sourceType="module",a(e,r,n)},t.parseScript=function(e,t,n){var r=t||{};return r.sourceType="script",a(e,r,n)},t.tokenize=function(e,t,n){var r,i=new o.Tokenizer(e,t);r=[];try{for(;;){var s=i.getNextToken();if(!s)break;n&&(s=n(s)),r.push(s)}}catch(e){i.errorHandler.tolerate(e)}return i.errorHandler.tolerant&&(r.errors=i.errors()),r};var u=n(2);t.Syntax=u.Syntax,t.version="4.0.1"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=function(){function e(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return e.prototype.insertInnerComments=function(e,t){if(e.type===r.Syntax.BlockStatement&&0===e.body.length){for(var n=[],i=this.leading.length-1;i>=0;--i){var s=this.leading[i];t.end.offset>=s.start&&(n.unshift(s.comment),this.leading.splice(i,1),this.trailing.splice(i,1))}n.length&&(e.innerComments=n)}},e.prototype.findTrailingComments=function(e){var t=[];if(this.trailing.length>0){for(var n=this.trailing.length-1;n>=0;--n){var r=this.trailing[n];r.start>=e.end.offset&&t.unshift(r.comment)}return this.trailing.length=0,t}var i=this.stack[this.stack.length-1];if(i&&i.node.trailingComments){var s=i.node.trailingComments[0];s&&s.range[0]>=e.end.offset&&(t=i.node.trailingComments,delete i.node.trailingComments)}return t},e.prototype.findLeadingComments=function(e){for(var t,n=[];this.stack.length>0&&(s=this.stack[this.stack.length-1])&&s.start>=e.start.offset;)t=s.node,this.stack.pop();if(t){for(var r=(t.leadingComments?t.leadingComments.length:0)-1;r>=0;--r){var i=t.leadingComments[r];i.range[1]<=e.start.offset&&(n.unshift(i),t.leadingComments.splice(r,1))}return t.leadingComments&&0===t.leadingComments.length&&delete t.leadingComments,n}for(r=this.leading.length-1;r>=0;--r){var s;(s=this.leading[r]).start<=e.start.offset&&(n.unshift(s.comment),this.leading.splice(r,1))}return n},e.prototype.visitNode=function(e,t){if(!(e.type===r.Syntax.Program&&e.body.length>0)){this.insertInnerComments(e,t);var n=this.findTrailingComments(t),i=this.findLeadingComments(t);i.length>0&&(e.leadingComments=i),n.length>0&&(e.trailingComments=n),this.stack.push({node:e,start:t.start.offset})}},e.prototype.visitComment=function(e,t){var n="L"===e.type[0]?"Line":"Block",r={type:n,value:e.value};if(e.range&&(r.range=e.range),e.loc&&(r.loc=e.loc),this.comments.push(r),this.attach){var i={comment:{type:n,value:e.value,range:[t.start.offset,t.end.offset]},start:t.start.offset};e.loc&&(i.comment.loc=e.loc),e.type=n,this.leading.push(i),this.trailing.push(i)}},e.prototype.visit=function(e,t){"LineComment"===e.type||"BlockComment"===e.type?this.visitComment(e,t):this.attach&&this.visitNode(e,t)},e}();t.CommentHandler=i},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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"}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var s=n(4),o=n(5),a=n(6),u=n(7),c=n(8),l=n(13),h=n(14);function p(e){var t;switch(e.type){case a.JSXSyntax.JSXIdentifier:t=e.name;break;case a.JSXSyntax.JSXNamespacedName:var n=e;t=p(n.namespace)+":"+p(n.name);break;case a.JSXSyntax.JSXMemberExpression:var r=e;t=p(r.object)+"."+p(r.property)}return t}l.TokenName[100]="JSXIdentifier",l.TokenName[101]="JSXText";var d=function(e){function t(t,n,r){return e.call(this,t,n,r)||this}return i(t,e),t.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():e.prototype.parsePrimaryExpression.call(this)},t.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},t.prototype.finishJSX=function(){this.nextToken()},t.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},t.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.scanXHTMLEntity=function(e){for(var t="&",n=!0,r=!1,i=!1,o=!1;!this.scanner.eof()&&n&&!r;){var a=this.scanner.source[this.scanner.index];if(a===e)break;if(r=";"===a,t+=a,++this.scanner.index,!r)switch(t.length){case 2:i="#"===a;break;case 3:i&&(n=(o="x"===a)||s.Character.isDecimalDigit(a.charCodeAt(0)),i=i&&!o);break;default:n=(n=n&&!(i&&!s.Character.isDecimalDigit(a.charCodeAt(0))))&&!(o&&!s.Character.isHexDigit(a.charCodeAt(0)))}}if(n&&r&&t.length>2){var u=t.substr(1,t.length-2);i&&u.length>1?t=String.fromCharCode(parseInt(u.substr(1),10)):o&&u.length>2?t=String.fromCharCode(parseInt("0"+u.substr(1),16)):i||o||!h.XHTMLEntities[u]||(t=h.XHTMLEntities[u])}return t},t.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e)return{type:7,value:a=this.scanner.source[this.scanner.index++],lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index};if(34===e||39===e){for(var t=this.scanner.index,n=this.scanner.source[this.scanner.index++],r="";!this.scanner.eof()&&(u=this.scanner.source[this.scanner.index++])!==n;)r+="&"===u?this.scanXHTMLEntity(n):u;return{type:8,value:r,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}if(46===e){var i=this.scanner.source.charCodeAt(this.scanner.index+1),o=this.scanner.source.charCodeAt(this.scanner.index+2),a=46===i&&46===o?"...":".";return t=this.scanner.index,this.scanner.index+=a.length,{type:7,value:a,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}if(96===e)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(s.Character.isIdentifierStart(e)&&92!==e){for(t=this.scanner.index,++this.scanner.index;!this.scanner.eof();){var u=this.scanner.source.charCodeAt(this.scanner.index);if(s.Character.isIdentifierPart(u)&&92!==u)++this.scanner.index;else{if(45!==u)break;++this.scanner.index}}return{type:100,value:this.scanner.source.slice(t,this.scanner.index),lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:t,end:this.scanner.index}}return this.scanner.lex()},t.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 e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},t.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var e=this.scanner.index,t="";!this.scanner.eof();){var n=this.scanner.source[this.scanner.index];if("{"===n||"<"===n)break;++this.scanner.index,t+=n,s.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++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 r={type:101,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return t.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(r)),r},t.prototype.peekJSXToken=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.lexJSX();return this.scanner.restoreState(e),t},t.prototype.expectJSX=function(e){var t=this.nextJSXToken();7===t.type&&t.value===e||this.throwUnexpectedToken(t)},t.prototype.matchJSX=function(e){var t=this.peekJSXToken();return 7===t.type&&t.value===e},t.prototype.parseJSXIdentifier=function(){var e=this.createJSXNode(),t=this.nextJSXToken();return 100!==t.type&&this.throwUnexpectedToken(t),this.finalize(e,new o.JSXIdentifier(t.value))},t.prototype.parseJSXElementName=function(){var e=this.createJSXNode(),t=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=t;this.expectJSX(":");var r=this.parseJSXIdentifier();t=this.finalize(e,new o.JSXNamespacedName(n,r))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var i=t;this.expectJSX(".");var s=this.parseJSXIdentifier();t=this.finalize(e,new o.JSXMemberExpression(i,s))}return t},t.prototype.parseJSXAttributeName=function(){var e,t=this.createJSXNode(),n=this.parseJSXIdentifier();if(this.matchJSX(":")){var r=n;this.expectJSX(":");var i=this.parseJSXIdentifier();e=this.finalize(t,new o.JSXNamespacedName(r,i))}else e=n;return e},t.prototype.parseJSXStringLiteralAttribute=function(){var e=this.createJSXNode(),t=this.nextJSXToken();8!==t.type&&this.throwUnexpectedToken(t);var n=this.getTokenRaw(t);return this.finalize(e,new u.Literal(t.value,n))},t.prototype.parseJSXExpressionAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new o.JSXExpressionContainer(t))},t.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},t.prototype.parseJSXNameValueAttribute=function(){var e=this.createJSXNode(),t=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(e,new o.JSXAttribute(t,n))},t.prototype.parseJSXSpreadAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new o.JSXSpreadAttribute(t))},t.prototype.parseJSXAttributes=function(){for(var e=[];!this.matchJSX("/")&&!this.matchJSX(">");){var t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();e.push(t)}return e},t.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX("<");var t=this.parseJSXElementName(),n=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new o.JSXOpeningElement(t,r,n))},t.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var t=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(e,new o.JSXClosingElement(t))}var n=this.parseJSXElementName(),r=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new o.JSXOpeningElement(n,i,r))},t.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(e,new o.JSXEmptyExpression)},t.prototype.parseJSXExpressionContainer=function(){var e,t=this.createJSXNode();return this.expectJSX("{"),this.matchJSX("}")?(e=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),e=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(t,new o.JSXExpressionContainer(e))},t.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),n=this.nextJSXText();if(n.start0))break;s=this.finalize(e.node,new o.JSXElement(e.opening,e.children,e.closing)),(e=t[t.length-1]).children.push(s),t.pop()}}return e},t.prototype.parseJSXElement=function(){var e=this.createJSXNode(),t=this.parseJSXOpeningElement(),n=[],r=null;if(!t.selfClosing){var i=this.parseComplexJSXElement({node:e,opening:t,closing:r,children:n});n=i.children,r=i.closing}return this.finalize(e,new o.JSXElement(t,n,r))},t.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var e=this.parseJSXElement();return this.finishJSX(),e},t.prototype.isStartOfExpression=function(){return e.prototype.isStartOfExpression.call(this)||this.match("<")},t}(c.Parser);t.JSXParser=d},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={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]/,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]/};t.Character={fromCodePoint:function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&n.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(e))},isIdentifierPart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&n.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(e))},isDecimalDigit:function(e){return e>=48&&e<=57},isHexDigit:function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},isOctalDigit:function(e){return e>=48&&e<=55}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6);t.JSXClosingElement=function(e){this.type=r.JSXSyntax.JSXClosingElement,this.name=e};t.JSXElement=function(e,t,n){this.type=r.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=n};t.JSXEmptyExpression=function(){this.type=r.JSXSyntax.JSXEmptyExpression};t.JSXExpressionContainer=function(e){this.type=r.JSXSyntax.JSXExpressionContainer,this.expression=e};t.JSXIdentifier=function(e){this.type=r.JSXSyntax.JSXIdentifier,this.name=e};t.JSXMemberExpression=function(e,t){this.type=r.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t};t.JSXAttribute=function(e,t){this.type=r.JSXSyntax.JSXAttribute,this.name=e,this.value=t};t.JSXNamespacedName=function(e,t){this.type=r.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t};t.JSXOpeningElement=function(e,t,n){this.type=r.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=n};t.JSXSpreadAttribute=function(e){this.type=r.JSXSyntax.JSXSpreadAttribute,this.argument=e};t.JSXText=function(e,t){this.type=r.JSXSyntax.JSXText,this.value=e,this.raw=t}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.ArrayExpression=function(e){this.type=r.Syntax.ArrayExpression,this.elements=e};t.ArrayPattern=function(e){this.type=r.Syntax.ArrayPattern,this.elements=e};t.ArrowFunctionExpression=function(e,t,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!1};t.AssignmentExpression=function(e,t,n){this.type=r.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=n};t.AssignmentPattern=function(e,t){this.type=r.Syntax.AssignmentPattern,this.left=e,this.right=t};t.AsyncArrowFunctionExpression=function(e,t,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n,this.async=!0};t.AsyncFunctionDeclaration=function(e,t,n){this.type=r.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0};t.AsyncFunctionExpression=function(e,t,n){this.type=r.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=!1,this.expression=!1,this.async=!0};t.AwaitExpression=function(e){this.type=r.Syntax.AwaitExpression,this.argument=e};t.BinaryExpression=function(e,t,n){var i="||"===e||"&&"===e;this.type=i?r.Syntax.LogicalExpression:r.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=n};t.BlockStatement=function(e){this.type=r.Syntax.BlockStatement,this.body=e};t.BreakStatement=function(e){this.type=r.Syntax.BreakStatement,this.label=e};t.CallExpression=function(e,t){this.type=r.Syntax.CallExpression,this.callee=e,this.arguments=t};t.CatchClause=function(e,t){this.type=r.Syntax.CatchClause,this.param=e,this.body=t};t.ClassBody=function(e){this.type=r.Syntax.ClassBody,this.body=e};t.ClassDeclaration=function(e,t,n){this.type=r.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=n};t.ClassExpression=function(e,t,n){this.type=r.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=n};t.ComputedMemberExpression=function(e,t){this.type=r.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t};t.ConditionalExpression=function(e,t,n){this.type=r.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n};t.ContinueStatement=function(e){this.type=r.Syntax.ContinueStatement,this.label=e};t.DebuggerStatement=function(){this.type=r.Syntax.DebuggerStatement};t.Directive=function(e,t){this.type=r.Syntax.ExpressionStatement,this.expression=e,this.directive=t};t.DoWhileStatement=function(e,t){this.type=r.Syntax.DoWhileStatement,this.body=e,this.test=t};t.EmptyStatement=function(){this.type=r.Syntax.EmptyStatement};t.ExportAllDeclaration=function(e){this.type=r.Syntax.ExportAllDeclaration,this.source=e};t.ExportDefaultDeclaration=function(e){this.type=r.Syntax.ExportDefaultDeclaration,this.declaration=e};t.ExportNamedDeclaration=function(e,t,n){this.type=r.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n};t.ExportSpecifier=function(e,t){this.type=r.Syntax.ExportSpecifier,this.exported=t,this.local=e};t.ExpressionStatement=function(e){this.type=r.Syntax.ExpressionStatement,this.expression=e};t.ForInStatement=function(e,t,n){this.type=r.Syntax.ForInStatement,this.left=e,this.right=t,this.body=n,this.each=!1};t.ForOfStatement=function(e,t,n){this.type=r.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=n};t.ForStatement=function(e,t,n,i){this.type=r.Syntax.ForStatement,this.init=e,this.test=t,this.update=n,this.body=i};t.FunctionDeclaration=function(e,t,n,i){this.type=r.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=i,this.expression=!1,this.async=!1};t.FunctionExpression=function(e,t,n,i){this.type=r.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=i,this.expression=!1,this.async=!1};t.Identifier=function(e){this.type=r.Syntax.Identifier,this.name=e};t.IfStatement=function(e,t,n){this.type=r.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=n};t.ImportDeclaration=function(e,t){this.type=r.Syntax.ImportDeclaration,this.specifiers=e,this.source=t};t.ImportDefaultSpecifier=function(e){this.type=r.Syntax.ImportDefaultSpecifier,this.local=e};t.ImportNamespaceSpecifier=function(e){this.type=r.Syntax.ImportNamespaceSpecifier,this.local=e};t.ImportSpecifier=function(e,t){this.type=r.Syntax.ImportSpecifier,this.local=e,this.imported=t};t.LabeledStatement=function(e,t){this.type=r.Syntax.LabeledStatement,this.label=e,this.body=t};t.Literal=function(e,t){this.type=r.Syntax.Literal,this.value=e,this.raw=t};t.MetaProperty=function(e,t){this.type=r.Syntax.MetaProperty,this.meta=e,this.property=t};t.MethodDefinition=function(e,t,n,i,s){this.type=r.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=n,this.kind=i,this.static=s};t.Module=function(e){this.type=r.Syntax.Program,this.body=e,this.sourceType="module"};t.NewExpression=function(e,t){this.type=r.Syntax.NewExpression,this.callee=e,this.arguments=t};t.ObjectExpression=function(e){this.type=r.Syntax.ObjectExpression,this.properties=e};t.ObjectPattern=function(e){this.type=r.Syntax.ObjectPattern,this.properties=e};t.Property=function(e,t,n,i,s,o){this.type=r.Syntax.Property,this.key=t,this.computed=n,this.value=i,this.kind=e,this.method=s,this.shorthand=o};t.RegexLiteral=function(e,t,n,i){this.type=r.Syntax.Literal,this.value=e,this.raw=t,this.regex={pattern:n,flags:i}};t.RestElement=function(e){this.type=r.Syntax.RestElement,this.argument=e};t.ReturnStatement=function(e){this.type=r.Syntax.ReturnStatement,this.argument=e};t.Script=function(e){this.type=r.Syntax.Program,this.body=e,this.sourceType="script"};t.SequenceExpression=function(e){this.type=r.Syntax.SequenceExpression,this.expressions=e};t.SpreadElement=function(e){this.type=r.Syntax.SpreadElement,this.argument=e};t.StaticMemberExpression=function(e,t){this.type=r.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t};t.Super=function(){this.type=r.Syntax.Super};t.SwitchCase=function(e,t){this.type=r.Syntax.SwitchCase,this.test=e,this.consequent=t};t.SwitchStatement=function(e,t){this.type=r.Syntax.SwitchStatement,this.discriminant=e,this.cases=t};t.TaggedTemplateExpression=function(e,t){this.type=r.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t};t.TemplateElement=function(e,t){this.type=r.Syntax.TemplateElement,this.value=e,this.tail=t};t.TemplateLiteral=function(e,t){this.type=r.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t};t.ThisExpression=function(){this.type=r.Syntax.ThisExpression};t.ThrowStatement=function(e){this.type=r.Syntax.ThrowStatement,this.argument=e};t.TryStatement=function(e,t,n){this.type=r.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=n};t.UnaryExpression=function(e,t){this.type=r.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0};t.UpdateExpression=function(e,t,n){this.type=r.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=n};t.VariableDeclaration=function(e,t){this.type=r.Syntax.VariableDeclaration,this.declarations=e,this.kind=t};t.VariableDeclarator=function(e,t){this.type=r.Syntax.VariableDeclarator,this.id=e,this.init=t};t.WhileStatement=function(e,t){this.type=r.Syntax.WhileStatement,this.test=e,this.body=t};t.WithStatement=function(e,t){this.type=r.Syntax.WithStatement,this.object=e,this.body=t};t.YieldExpression=function(e,t){this.type=r.Syntax.YieldExpression,this.argument=e,this.delegate=t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=n(10),s=n(11),o=n(7),a=n(12),u=n(2),c=n(13),l="ArrowParameterPlaceHolder",h=function(){function e(e,t,n){void 0===t&&(t={}),this.config={range:"boolean"==typeof t.range&&t.range,loc:"boolean"==typeof t.loc&&t.loc,source:null,tokens:"boolean"==typeof t.tokens&&t.tokens,comment:"boolean"==typeof t.comment&&t.comment,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.config.loc&&t.source&&null!==t.source&&(this.config.source=String(t.source)),this.delegate=n,this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new a.Scanner(e,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,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},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}}return e.prototype.throwError=function(e){for(var t=[],n=1;n0&&this.delegate)for(var t=0;t>="===e||">>>="===e||"&="===e||"^="===e||"|="===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=r,i},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=r||this.context.firstCoverInitializedNameError,i},e.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(2===this.lookahead.type||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},e.prototype.parsePrimaryExpression=function(){var e,t,n,r=this.createNode();switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),e=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(r,new o.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,s.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new o.Literal(t.value,n));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new o.Literal("true"===t.value,n));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new o.Literal(null,n));break;case 10:e=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,e=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":e=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":e=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,t=this.nextRegexToken(),n=this.getTokenRaw(t),e=this.finalize(r,new o.RegexLiteral(t.regex,n,t.pattern,t.flags));break;default:e=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?e=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?e=this.finalize(r,new o.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?e=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),e=this.finalize(r,new o.ThisExpression)):e=this.matchKeyword("class")?this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:e=this.throwUnexpectedToken(this.nextToken())}return e},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect("...");var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new o.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),t.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),t.push(n)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(e,new o.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,n=this.context.allowStrictDirective;this.context.allowStrictDirective=e.simple;var r=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,this.context.allowStrictDirective=n,r},e.prototype.parsePropertyMethodFunction=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters(),r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,n.params,r,!1))},e.prototype.parsePropertyMethodAsyncFunction=function(){var e=this.createNode(),t=this.context.allowYield,n=this.context.await;this.context.allowYield=!1,this.context.await=!0;var r=this.parseFormalParameters(),i=this.parsePropertyMethod(r);return this.context.allowYield=t,this.context.await=n,this.finalize(e,new o.AsyncFunctionExpression(null,r.params,i))},e.prototype.parseObjectPropertyKey=function(){var e,t=this.createNode(),n=this.nextToken();switch(n.type){case 8:case 6:this.context.strict&&n.octal&&this.tolerateUnexpectedToken(n,s.Messages.StrictOctalLiteral);var r=this.getTokenRaw(n);e=this.finalize(t,new o.Literal(n.value,r));break;case 3:case 1:case 5:case 4:e=this.finalize(t,new o.Identifier(n.value));break;case 7:"["===n.value?(e=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):e=this.throwUnexpectedToken(n);break;default:e=this.throwUnexpectedToken(n)}return e},e.prototype.isPropertyKey=function(e,t){return e.type===u.Syntax.Identifier&&e.name===t||e.type===u.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t,n=this.createNode(),r=this.lookahead,i=null,a=null,u=!1,c=!1,l=!1,h=!1;if(3===r.type){var p=r.value;this.nextToken(),u=this.match("["),i=(h=!(this.hasLineTerminator||"async"!==p||this.match(":")||this.match("(")||this.match("*")||this.match(",")))?this.parseObjectPropertyKey():this.finalize(n,new o.Identifier(p))}else this.match("*")?this.nextToken():(u=this.match("["),i=this.parseObjectPropertyKey());var d=this.qualifiedPropertyName(this.lookahead);if(3===r.type&&!h&&"get"===r.value&&d)t="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod();else if(3===r.type&&!h&&"set"===r.value&&d)t="set",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseSetterMethod();else if(7===r.type&&"*"===r.value&&d)t="init",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0;else if(i||this.throwUnexpectedToken(this.lookahead),t="init",this.match(":")&&!h)!u&&this.isPropertyKey(i,"__proto__")&&(e.value&&this.tolerateError(s.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),a=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))a=h?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0;else if(3===r.type)if(p=this.finalize(n,new o.Identifier(r.value)),this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),l=!0;var f=this.isolateCoverGrammar(this.parseAssignmentExpression);a=this.finalize(n,new o.AssignmentPattern(p,f))}else l=!0,a=p;else this.throwUnexpectedToken(this.nextToken());return this.finalize(n,new o.Property(t,i,u,a,c,l))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect("{");for(var t=[],n={value:!1};!this.match("}");)t.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(e,new o.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){r.assert(this.lookahead.head,"Template literal must start with a template head");var e=this.createNode(),t=this.nextToken(),n=t.value,i=t.cooked;return this.finalize(e,new o.TemplateElement({raw:n,cooked:i},t.tail))},e.prototype.parseTemplateElement=function(){10!==this.lookahead.type&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),n=t.value,r=t.cooked;return this.finalize(e,new o.TemplateElement({raw:n,cooked:r},t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],n=[],r=this.parseTemplateHead();for(n.push(r);!r.tail;)t.push(this.parseExpression()),r=this.parseTemplateElement(),n.push(r);return this.finalize(e,new o.TemplateLiteral(n,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case u.Syntax.Identifier:case u.Syntax.MemberExpression:case u.Syntax.RestElement:case u.Syntax.AssignmentPattern:break;case u.Syntax.SpreadElement:e.type=u.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case u.Syntax.ArrayExpression:e.type=u.Syntax.ArrayPattern;for(var t=0;t")||this.expect("=>"),e={type:l,params:[],async:!1};else{var t=this.lookahead,n=[];if(this.match("..."))e=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:l,params:[e],async:!1};else{var r=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var i=[];for(this.context.isAssignmentTarget=!1,i.push(e);2!==this.lookahead.type&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var s=0;s")||this.expect("=>"),this.context.isBindingElement=!1,s=0;s")&&(e.type===u.Syntax.Identifier&&"yield"===e.name&&(r=!0,e={type:l,params:[e],async:!1}),!r)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===u.Syntax.SequenceExpression)for(s=0;s")){for(var u=0;u0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var i=[e,this.lookahead],s=t,a=this.isolateCoverGrammar(this.parseExponentiationExpression),u=[s,n.value,a],c=[r];!((r=this.binaryPrecedence(this.lookahead))<=0);){for(;u.length>2&&r<=c[c.length-1];){a=u.pop();var l=u.pop();c.pop(),s=u.pop(),i.pop();var h=this.startNode(i[i.length-1]);u.push(this.finalize(h,new o.BinaryExpression(l,s,a)))}u.push(this.nextToken().value),c.push(r),i.push(this.lookahead),u.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var p=u.length-1;t=u[p];for(var d=i.pop();p>1;){var f=i.pop(),m=d&&d.lineStart;h=this.startNode(f,m),l=u[p-1],t=this.finalize(h,new o.BinaryExpression(l,u[p-2],t)),p-=2,d=f}}return t},e.prototype.parseConditionalExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var r=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var i=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new o.ConditionalExpression(t,r,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return t},e.prototype.checkPatternParam=function(e,t){switch(t.type){case u.Syntax.Identifier:this.validateParam(e,t,t.name);break;case u.Syntax.RestElement:this.checkPatternParam(e,t.argument);break;case u.Syntax.AssignmentPattern:this.checkPatternParam(e,t.left);break;case u.Syntax.ArrayPattern:for(var n=0;n")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var i=e.async,a=this.reinterpretAsCoverFormalsList(e);if(a){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var c=this.context.strict,h=this.context.allowStrictDirective;this.context.allowStrictDirective=a.simple;var p=this.context.allowYield,d=this.context.await;this.context.allowYield=!0,this.context.await=i;var f=this.startNode(t);this.expect("=>");var m=void 0;if(this.match("{")){var g=this.context.allowIn;this.context.allowIn=!0,m=this.parseFunctionSourceElements(),this.context.allowIn=g}else m=this.isolateCoverGrammar(this.parseAssignmentExpression);var x=m.type!==u.Syntax.BlockStatement;this.context.strict&&a.firstRestricted&&this.throwUnexpectedToken(a.firstRestricted,a.message),this.context.strict&&a.stricted&&this.tolerateUnexpectedToken(a.stricted,a.message),e=i?this.finalize(f,new o.AsyncArrowFunctionExpression(a.params,m,x)):this.finalize(f,new o.ArrowFunctionExpression(a.params,m,x)),this.context.strict=c,this.context.allowStrictDirective=h,this.context.allowYield=p,this.context.await=d}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(s.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===u.Syntax.Identifier){var y=e;this.scanner.isRestrictedWord(y.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(y.name)&&this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1);var D=(n=this.nextToken()).value,C=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new o.AssignmentExpression(D,e,C)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var n=[];for(n.push(t);2!==this.lookahead.type&&this.match(",");)this.nextToken(),n.push(this.isolateCoverGrammar(this.parseAssignmentExpression));t=this.finalize(this.startNode(e),new o.SequenceExpression(n))}return t},e.prototype.parseStatementListItem=function(){var e;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,4===this.lookahead.type)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalExportDeclaration),e=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,s.Messages.IllegalImportDeclaration),e=this.parseImportDeclaration();break;case"const":e=this.parseLexicalDeclaration({inFor:!1});break;case"function":e=this.parseFunctionDeclaration();break;case"class":e=this.parseClassDeclaration();break;case"let":e=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:e=this.parseStatement()}else e=this.parseStatement();return e},e.prototype.parseBlock=function(){var e=this.createNode();this.expect("{");for(var t=[];!this.match("}");)t.push(this.parseStatementListItem());return this.expect("}"),this.finalize(e,new o.BlockStatement(t))},e.prototype.parseLexicalBinding=function(e,t){var n=this.createNode(),r=this.parsePattern([],e);this.context.strict&&r.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(r.name)&&this.tolerateError(s.Messages.StrictVarName);var i=null;return"const"===e?this.matchKeyword("in")||this.matchContextualKeyword("of")||(this.match("=")?(this.nextToken(),i=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(s.Messages.DeclarationMissingInitializer,"const")):(!t.inFor&&r.type!==u.Syntax.Identifier||this.match("="))&&(this.expect("="),i=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(n,new o.VariableDeclarator(r,i))},e.prototype.parseBindingList=function(e,t){for(var n=[this.parseLexicalBinding(e,t)];this.match(",");)this.nextToken(),n.push(this.parseLexicalBinding(e,t));return n},e.prototype.isLexicalDeclaration=function(){var e=this.scanner.saveState();this.scanner.scanComments();var t=this.scanner.lex();return this.scanner.restoreState(e),3===t.type||7===t.type&&"["===t.value||7===t.type&&"{"===t.value||4===t.type&&"let"===t.value||4===t.type&&"yield"===t.value},e.prototype.parseLexicalDeclaration=function(e){var t=this.createNode(),n=this.nextToken().value;r.assert("let"===n||"const"===n,"Lexical declaration must be either let or const");var i=this.parseBindingList(n,e);return this.consumeSemicolon(),this.finalize(t,new o.VariableDeclaration(i,n))},e.prototype.parseBindingRestElement=function(e,t){var n=this.createNode();this.expect("...");var r=this.parsePattern(e,t);return this.finalize(n,new o.RestElement(r))},e.prototype.parseArrayPattern=function(e,t){var n=this.createNode();this.expect("[");for(var r=[];!this.match("]");)if(this.match(","))this.nextToken(),r.push(null);else{if(this.match("...")){r.push(this.parseBindingRestElement(e,t));break}r.push(this.parsePatternWithDefault(e,t)),this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(n,new o.ArrayPattern(r))},e.prototype.parsePropertyPattern=function(e,t){var n,r,i=this.createNode(),s=!1,a=!1;if(3===this.lookahead.type){var u=this.lookahead;n=this.parseVariableIdentifier();var c=this.finalize(i,new o.Identifier(u.value));if(this.match("=")){e.push(u),a=!0,this.nextToken();var l=this.parseAssignmentExpression();r=this.finalize(this.startNode(u),new o.AssignmentPattern(c,l))}else this.match(":")?(this.expect(":"),r=this.parsePatternWithDefault(e,t)):(e.push(u),a=!0,r=c)}else s=this.match("["),n=this.parseObjectPropertyKey(),this.expect(":"),r=this.parsePatternWithDefault(e,t);return this.finalize(i,new o.Property("init",n,s,r,!1,a))},e.prototype.parseObjectPattern=function(e,t){var n=this.createNode(),r=[];for(this.expect("{");!this.match("}");)r.push(this.parsePropertyPattern(e,t)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(n,new o.ObjectPattern(r))},e.prototype.parsePattern=function(e,t){var n;return this.match("[")?n=this.parseArrayPattern(e,t):this.match("{")?n=this.parseObjectPattern(e,t):(!this.matchKeyword("let")||"const"!==t&&"let"!==t||this.tolerateUnexpectedToken(this.lookahead,s.Messages.LetInLexicalBinding),e.push(this.lookahead),n=this.parseVariableIdentifier(t)),n},e.prototype.parsePatternWithDefault=function(e,t){var n=this.lookahead,r=this.parsePattern(e,t);if(this.match("=")){this.nextToken();var i=this.context.allowYield;this.context.allowYield=!0;var s=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=i,r=this.finalize(this.startNode(n),new o.AssignmentPattern(r,s))}return r},e.prototype.parseVariableIdentifier=function(e){var t=this.createNode(),n=this.nextToken();return 4===n.type&&"yield"===n.value?this.context.strict?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(n):3!==n.type?this.context.strict&&4===n.type&&this.scanner.isStrictModeReservedWord(n.value)?this.tolerateUnexpectedToken(n,s.Messages.StrictReservedWord):(this.context.strict||"let"!==n.value||"var"!==e)&&this.throwUnexpectedToken(n):(this.context.isModule||this.context.await)&&3===n.type&&"await"===n.value&&this.tolerateUnexpectedToken(n),this.finalize(t,new o.Identifier(n.value))},e.prototype.parseVariableDeclaration=function(e){var t=this.createNode(),n=this.parsePattern([],"var");this.context.strict&&n.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(n.name)&&this.tolerateError(s.Messages.StrictVarName);var r=null;return this.match("=")?(this.nextToken(),r=this.isolateCoverGrammar(this.parseAssignmentExpression)):n.type===u.Syntax.Identifier||e.inFor||this.expect("="),this.finalize(t,new o.VariableDeclarator(n,r))},e.prototype.parseVariableDeclarationList=function(e){var t={inFor:e.inFor},n=[];for(n.push(this.parseVariableDeclaration(t));this.match(",");)this.nextToken(),n.push(this.parseVariableDeclaration(t));return n},e.prototype.parseVariableStatement=function(){var e=this.createNode();this.expectKeyword("var");var t=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(e,new o.VariableDeclaration(t,"var"))},e.prototype.parseEmptyStatement=function(){var e=this.createNode();return this.expect(";"),this.finalize(e,new o.EmptyStatement)},e.prototype.parseExpressionStatement=function(){var e=this.createNode(),t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new o.ExpressionStatement(t))},e.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(s.Messages.StrictFunction),this.parseStatement()},e.prototype.parseIfStatement=function(){var e,t=this.createNode(),n=null;this.expectKeyword("if"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),e=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),n=this.parseIfClause())),this.finalize(t,new o.IfStatement(r,e,n))},e.prototype.parseDoWhileStatement=function(){var e=this.createNode();this.expectKeyword("do");var t=this.context.inIteration;this.context.inIteration=!0;var n=this.parseStatement();this.context.inIteration=t,this.expectKeyword("while"),this.expect("(");var r=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(e,new o.DoWhileStatement(n,r))},e.prototype.parseWhileStatement=function(){var e,t=this.createNode();this.expectKeyword("while"),this.expect("(");var n=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var r=this.context.inIteration;this.context.inIteration=!0,e=this.parseStatement(),this.context.inIteration=r}return this.finalize(t,new o.WhileStatement(n,e))},e.prototype.parseForStatement=function(){var e,t,n,r=null,i=null,a=null,c=!0,l=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){r=this.createNode(),this.nextToken();var h=this.context.allowIn;this.context.allowIn=!1;var p=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=h,1===p.length&&this.matchKeyword("in")){var d=p[0];d.init&&(d.id.type===u.Syntax.ArrayPattern||d.id.type===u.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(s.Messages.ForInOfLoopInitializer,"for-in"),r=this.finalize(r,new o.VariableDeclaration(p,"var")),this.nextToken(),e=r,t=this.parseExpression(),r=null}else 1===p.length&&null===p[0].init&&this.matchContextualKeyword("of")?(r=this.finalize(r,new o.VariableDeclaration(p,"var")),this.nextToken(),e=r,t=this.parseAssignmentExpression(),r=null,c=!1):(r=this.finalize(r,new o.VariableDeclaration(p,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){r=this.createNode();var f=this.nextToken().value;this.context.strict||"in"!==this.lookahead.value?(h=this.context.allowIn,this.context.allowIn=!1,p=this.parseBindingList(f,{inFor:!0}),this.context.allowIn=h,1===p.length&&null===p[0].init&&this.matchKeyword("in")?(r=this.finalize(r,new o.VariableDeclaration(p,f)),this.nextToken(),e=r,t=this.parseExpression(),r=null):1===p.length&&null===p[0].init&&this.matchContextualKeyword("of")?(r=this.finalize(r,new o.VariableDeclaration(p,f)),this.nextToken(),e=r,t=this.parseAssignmentExpression(),r=null,c=!1):(this.consumeSemicolon(),r=this.finalize(r,new o.VariableDeclaration(p,f)))):(r=this.finalize(r,new o.Identifier(f)),this.nextToken(),e=r,t=this.parseExpression(),r=null)}else{var m=this.lookahead;if(h=this.context.allowIn,this.context.allowIn=!1,r=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=h,this.matchKeyword("in"))this.context.isAssignmentTarget&&r.type!==u.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(r),e=r,t=this.parseExpression(),r=null;else if(this.matchContextualKeyword("of"))this.context.isAssignmentTarget&&r.type!==u.Syntax.AssignmentExpression||this.tolerateError(s.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(r),e=r,t=this.parseAssignmentExpression(),r=null,c=!1;else{if(this.match(",")){for(var g=[r];this.match(",");)this.nextToken(),g.push(this.isolateCoverGrammar(this.parseAssignmentExpression));r=this.finalize(this.startNode(m),new o.SequenceExpression(g))}this.expect(";")}}if(void 0===e&&(this.match(";")||(i=this.parseExpression()),this.expect(";"),this.match(")")||(a=this.parseExpression())),!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),n=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var x=this.context.inIteration;this.context.inIteration=!0,n=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=x}return void 0===e?this.finalize(l,new o.ForStatement(r,i,a,n)):c?this.finalize(l,new o.ForInStatement(e,t,n)):this.finalize(l,new o.ForOfStatement(e,t,n))},e.prototype.parseContinueStatement=function(){var e=this.createNode();this.expectKeyword("continue");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier();t=n;var r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(s.Messages.UnknownLabel,n.name)}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.throwError(s.Messages.IllegalContinue),this.finalize(e,new o.ContinueStatement(t))},e.prototype.parseBreakStatement=function(){var e=this.createNode();this.expectKeyword("break");var t=null;if(3===this.lookahead.type&&!this.hasLineTerminator){var n=this.parseVariableIdentifier(),r="$"+n.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,r)||this.throwError(s.Messages.UnknownLabel,n.name),t=n}return this.consumeSemicolon(),null!==t||this.context.inIteration||this.context.inSwitch||this.throwError(s.Messages.IllegalBreak),this.finalize(e,new o.BreakStatement(t))},e.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(s.Messages.IllegalReturn);var e=this.createNode();this.expectKeyword("return");var t=(this.match(";")||this.match("}")||this.hasLineTerminator||2===this.lookahead.type)&&8!==this.lookahead.type&&10!==this.lookahead.type?null:this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new o.ReturnStatement(t))},e.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(s.Messages.StrictModeWith);var e,t=this.createNode();this.expectKeyword("with"),this.expect("(");var n=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),e=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),e=this.parseStatement()),this.finalize(t,new o.WithStatement(n,e))},e.prototype.parseSwitchCase=function(){var e,t=this.createNode();this.matchKeyword("default")?(this.nextToken(),e=null):(this.expectKeyword("case"),e=this.parseExpression()),this.expect(":");for(var n=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)n.push(this.parseStatementListItem());return this.finalize(t,new o.SwitchCase(e,n))},e.prototype.parseSwitchStatement=function(){var e=this.createNode();this.expectKeyword("switch"),this.expect("(");var t=this.parseExpression();this.expect(")");var n=this.context.inSwitch;this.context.inSwitch=!0;var r=[],i=!1;for(this.expect("{");!this.match("}");){var a=this.parseSwitchCase();null===a.test&&(i&&this.throwError(s.Messages.MultipleDefaultsInSwitch),i=!0),r.push(a)}return this.expect("}"),this.context.inSwitch=n,this.finalize(e,new o.SwitchStatement(t,r))},e.prototype.parseLabelledStatement=function(){var e,t=this.createNode(),n=this.parseExpression();if(n.type===u.Syntax.Identifier&&this.match(":")){this.nextToken();var r=n,i="$"+r.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,i)&&this.throwError(s.Messages.Redeclaration,"Label",r.name),this.context.labelSet[i]=!0;var a=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),a=this.parseClassDeclaration();else if(this.matchKeyword("function")){var c=this.lookahead,l=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(c,s.Messages.StrictFunction):l.generator&&this.tolerateUnexpectedToken(c,s.Messages.GeneratorInLegacyContext),a=l}else a=this.parseStatement();delete this.context.labelSet[i],e=new o.LabeledStatement(r,a)}else this.consumeSemicolon(),e=new o.ExpressionStatement(n);return this.finalize(t,e)},e.prototype.parseThrowStatement=function(){var e=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(s.Messages.NewlineAfterThrow);var t=this.parseExpression();return this.consumeSemicolon(),this.finalize(e,new o.ThrowStatement(t))},e.prototype.parseCatchClause=function(){var e=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var t=[],n=this.parsePattern(t),r={},i=0;i0&&this.tolerateError(s.Messages.BadGetterArity);var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,n.params,r,!1))},e.prototype.parseSetterMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();1!==n.params.length?this.tolerateError(s.Messages.BadSetterArity):n.params[0]instanceof o.RestElement&&this.tolerateError(s.Messages.BadSetterRestParameter);var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,n.params,r,!1))},e.prototype.parseGeneratorMethod=function(){var e=this.createNode(),t=this.context.allowYield;this.context.allowYield=!0;var n=this.parseFormalParameters();this.context.allowYield=!1;var r=this.parsePropertyMethod(n);return this.context.allowYield=t,this.finalize(e,new o.FunctionExpression(null,n.params,r,!0))},e.prototype.isStartOfExpression=function(){var e=!0,t=this.lookahead.value;switch(this.lookahead.type){case 7:e="["===t||"("===t||"{"===t||"+"===t||"-"===t||"!"===t||"~"===t||"++"===t||"--"===t||"/"===t||"/="===t;break;case 4:e="class"===t||"delete"===t||"function"===t||"let"===t||"new"===t||"super"===t||"this"===t||"typeof"===t||"void"===t||"yield"===t}return e},e.prototype.parseYieldExpression=function(){var e=this.createNode();this.expectKeyword("yield");var t=null,n=!1;if(!this.hasLineTerminator){var r=this.context.allowYield;this.context.allowYield=!1,(n=this.match("*"))?(this.nextToken(),t=this.parseAssignmentExpression()):this.isStartOfExpression()&&(t=this.parseAssignmentExpression()),this.context.allowYield=r}return this.finalize(e,new o.YieldExpression(t,n))},e.prototype.parseClassElement=function(e){var t=this.lookahead,n=this.createNode(),r="",i=null,a=null,u=!1,c=!1,l=!1,h=!1;if(this.match("*"))this.nextToken();else if(u=this.match("["),"static"===(i=this.parseObjectPropertyKey()).name&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(t=this.lookahead,l=!0,u=this.match("["),this.match("*")?this.nextToken():i=this.parseObjectPropertyKey()),3===t.type&&!this.hasLineTerminator&&"async"===t.value){var p=this.lookahead.value;":"!==p&&"("!==p&&"*"!==p&&(h=!0,t=this.lookahead,i=this.parseObjectPropertyKey(),3===t.type&&"constructor"===t.value&&this.tolerateUnexpectedToken(t,s.Messages.ConstructorIsAsync))}var d=this.qualifiedPropertyName(this.lookahead);return 3===t.type?"get"===t.value&&d?(r="get",u=this.match("["),i=this.parseObjectPropertyKey(),this.context.allowYield=!1,a=this.parseGetterMethod()):"set"===t.value&&d&&(r="set",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseSetterMethod()):7===t.type&&"*"===t.value&&d&&(r="init",u=this.match("["),i=this.parseObjectPropertyKey(),a=this.parseGeneratorMethod(),c=!0),!r&&i&&this.match("(")&&(r="init",a=h?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),c=!0),r||this.throwUnexpectedToken(this.lookahead),"init"===r&&(r="method"),u||(l&&this.isPropertyKey(i,"prototype")&&this.throwUnexpectedToken(t,s.Messages.StaticPrototype),!l&&this.isPropertyKey(i,"constructor")&&(("method"!==r||!c||a&&a.generator)&&this.throwUnexpectedToken(t,s.Messages.ConstructorSpecialMethod),e.value?this.throwUnexpectedToken(t,s.Messages.DuplicateConstructor):e.value=!0,r="constructor")),this.finalize(n,new o.MethodDefinition(i,u,a,r,l))},e.prototype.parseClassElementList=function(){var e=[],t={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():e.push(this.parseClassElement(t));return this.expect("}"),e},e.prototype.parseClassBody=function(){var e=this.createNode(),t=this.parseClassElementList();return this.finalize(e,new o.ClassBody(t))},e.prototype.parseClassDeclaration=function(e){var t=this.createNode(),n=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var r=e&&3!==this.lookahead.type?null:this.parseVariableIdentifier(),i=null;this.matchKeyword("extends")&&(this.nextToken(),i=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var s=this.parseClassBody();return this.context.strict=n,this.finalize(t,new o.ClassDeclaration(r,i,s))},e.prototype.parseClassExpression=function(){var e=this.createNode(),t=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var n=3===this.lookahead.type?this.parseVariableIdentifier():null,r=null;this.matchKeyword("extends")&&(this.nextToken(),r=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var i=this.parseClassBody();return this.context.strict=t,this.finalize(e,new o.ClassExpression(n,r,i))},e.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new o.Module(t))},e.prototype.parseScript=function(){for(var e=this.createNode(),t=this.parseDirectivePrologues();2!==this.lookahead.type;)t.push(this.parseStatementListItem());return this.finalize(e,new o.Script(t))},e.prototype.parseModuleSpecifier=function(){var e=this.createNode();8!==this.lookahead.type&&this.throwError(s.Messages.InvalidModuleSpecifier);var t=this.nextToken(),n=this.getTokenRaw(t);return this.finalize(e,new o.Literal(t.value,n))},e.prototype.parseImportSpecifier=function(){var e,t,n=this.createNode();return 3===this.lookahead.type?(t=e=this.parseVariableIdentifier(),this.matchContextualKeyword("as")&&(this.nextToken(),t=this.parseVariableIdentifier())):(t=e=this.parseIdentifierName(),this.matchContextualKeyword("as")?(this.nextToken(),t=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(n,new o.ImportSpecifier(t,e))},e.prototype.parseNamedImports=function(){this.expect("{");for(var e=[];!this.match("}");)e.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),e},e.prototype.parseImportDefaultSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName();return this.finalize(e,new o.ImportDefaultSpecifier(t))},e.prototype.parseImportNamespaceSpecifier=function(){var e=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(s.Messages.NoAsAfterImportNamespace),this.nextToken();var t=this.parseIdentifierName();return this.finalize(e,new o.ImportNamespaceSpecifier(t))},e.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalImportDeclaration);var e,t=this.createNode();this.expectKeyword("import");var n=[];if(8===this.lookahead.type)e=this.parseModuleSpecifier();else{if(this.match("{")?n=n.concat(this.parseNamedImports()):this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(n.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?n.push(this.parseImportNamespaceSpecifier()):this.match("{")?n=n.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var r=this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken(),e=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(t,new o.ImportDeclaration(n,e))},e.prototype.parseExportSpecifier=function(){var e=this.createNode(),t=this.parseIdentifierName(),n=t;return this.matchContextualKeyword("as")&&(this.nextToken(),n=this.parseIdentifierName()),this.finalize(e,new o.ExportSpecifier(t,n))},e.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(s.Messages.IllegalExportDeclaration);var e,t=this.createNode();if(this.expectKeyword("export"),this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var n=this.parseFunctionDeclaration(!0);e=this.finalize(t,new o.ExportDefaultDeclaration(n))}else this.matchKeyword("class")?(n=this.parseClassDeclaration(!0),e=this.finalize(t,new o.ExportDefaultDeclaration(n))):this.matchContextualKeyword("async")?(n=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression(),e=this.finalize(t,new o.ExportDefaultDeclaration(n))):(this.matchContextualKeyword("from")&&this.throwError(s.Messages.UnexpectedToken,this.lookahead.value),n=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression(),this.consumeSemicolon(),e=this.finalize(t,new o.ExportDefaultDeclaration(n)));else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var r=this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause;this.throwError(r,this.lookahead.value)}this.nextToken();var i=this.parseModuleSpecifier();this.consumeSemicolon(),e=this.finalize(t,new o.ExportAllDeclaration(i))}else if(4===this.lookahead.type){switch(n=void 0,this.lookahead.value){case"let":case"const":n=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":n=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}e=this.finalize(t,new o.ExportNamedDeclaration(n,[],null))}else if(this.matchAsyncFunction())n=this.parseFunctionDeclaration(),e=this.finalize(t,new o.ExportNamedDeclaration(n,[],null));else{var a=[],u=null,c=!1;for(this.expect("{");!this.match("}");)c=c||this.matchKeyword("default"),a.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");this.expect("}"),this.matchContextualKeyword("from")?(this.nextToken(),u=this.parseModuleSpecifier(),this.consumeSemicolon()):c?(r=this.lookahead.value?s.Messages.UnexpectedToken:s.Messages.MissingFromClause,this.throwError(r,this.lookahead.value)):this.consumeSemicolon(),e=this.finalize(t,new o.ExportNamedDeclaration(null,a,u))}return e},e}();t.Parser=h},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error("ASSERT: "+t)}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.errors=[],this.tolerant=!1}return e.prototype.recordError=function(e){this.errors.push(e)},e.prototype.tolerate=function(e){if(!this.tolerant)throw e;this.recordError(e)},e.prototype.constructError=function(e,t){var n=new Error(e);try{throw n}catch(e){Object.create&&Object.defineProperty&&(n=Object.create(e),Object.defineProperty(n,"column",{value:t}))}return n},e.prototype.createError=function(e,t,n,r){var i="Line "+t+": "+r,s=this.constructError(i,n);return s.index=e,s.lineNumber=t,s.description=r,s},e.prototype.throwError=function(e,t,n,r){throw this.createError(e,t,n,r)},e.prototype.tolerateError=function(e,t,n,r){var i=this.createError(e,t,n,r);if(!this.tolerant)throw i;this.recordError(i)},e}();t.ErrorHandler=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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 /"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=n(4),s=n(11);function o(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function a(e){return"01234567".indexOf(e)}var u=function(){function e(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.isModule=!1,this.length=e.length,this.index=0,this.lineNumber=e.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return e.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},e.prototype.restoreState=function(e){this.index=e.index,this.lineNumber=e.lineNumber,this.lineStart=e.lineStart},e.prototype.eof=function(){return this.index>=this.length},e.prototype.throwUnexpectedToken=function(e){return void 0===e&&(e=s.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.tolerateUnexpectedToken=function(e){void 0===e&&(e=s.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.skipSingleLineComment=function(e){var t,n,r=[];for(this.trackComment&&(r=[],t=this.index-e,n={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var s=this.source.charCodeAt(this.index);if(++this.index,i.Character.isLineTerminator(s)){if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart-1};var o={multiLine:!1,slice:[t+e,this.index-1],range:[t,this.index-1],loc:n};r.push(o)}return 13===s&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,r}}return this.trackComment&&(n.end={line:this.lineNumber,column:this.index-this.lineStart},o={multiLine:!1,slice:[t+e,this.index],range:[t,this.index],loc:n},r.push(o)),r},e.prototype.skipMultiLineComment=function(){var e,t,n=[];for(this.trackComment&&(n=[],e=this.index-2,t={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var r=this.source.charCodeAt(this.index);if(i.Character.isLineTerminator(r))13===r&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===r){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){t.end={line:this.lineNumber,column:this.index-this.lineStart};var s={multiLine:!0,slice:[e+2,this.index-2],range:[e,this.index],loc:t};n.push(s)}return n}++this.index}else++this.index}return this.trackComment&&(t.end={line:this.lineNumber,column:this.index-this.lineStart},s={multiLine:!0,slice:[e+2,this.index],range:[e,this.index],loc:t},n.push(s)),this.tolerateUnexpectedToken(),n},e.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index;!this.eof();){var n=this.source.charCodeAt(this.index);if(i.Character.isWhiteSpace(n))++this.index;else if(i.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===n)if(47===(n=this.source.charCodeAt(this.index+1))){this.index+=2;var r=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(r)),t=!0}else{if(42!==n)break;this.index+=2,r=this.skipMultiLineComment(),this.trackComment&&(e=e.concat(r))}else if(t&&45===n){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3,r=this.skipSingleLineComment(3),this.trackComment&&(e=e.concat(r))}else{if(60!==n||this.isModule)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4,r=this.skipSingleLineComment(4),this.trackComment&&(e=e.concat(r))}}return e},e.prototype.isFutureReservedWord=function(e){switch(e){case"enum":case"export":case"import":case"super":return!0;default:return!1}},e.prototype.isStrictModeReservedWord=function(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},e.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},e.prototype.isKeyword=function(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}},e.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){var n=this.source.charCodeAt(e+1);n>=56320&&n<=57343&&(t=1024*(t-55296)+n-56320+65536)}return t},e.prototype.scanHexEscape=function(e){for(var t="u"===e?4:2,n=0,r=0;r1114111||"}"!==e)&&this.throwUnexpectedToken(),i.Character.fromCodePoint(t)},e.prototype.getIdentifier=function(){for(var e=this.index++;!this.eof();){var t=this.source.charCodeAt(this.index);if(92===t)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!i.Character.isIdentifierPart(t))break;++this.index}return this.source.slice(e,this.index)},e.prototype.getComplexIdentifier=function(){var e,t=this.codePointAt(this.index),n=i.Character.fromCodePoint(t);for(this.index+=n.length,92===t&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this.scanUnicodeCodePointEscape()):null!==(e=this.scanHexEscape("u"))&&"\\"!==e&&i.Character.isIdentifierStart(e.charCodeAt(0))||this.throwUnexpectedToken(),n=e);!this.eof()&&(t=this.codePointAt(this.index),i.Character.isIdentifierPart(t));)n+=e=i.Character.fromCodePoint(t),this.index+=e.length,92===t&&(n=n.substr(0,n.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,e=this.scanUnicodeCodePointEscape()):null!==(e=this.scanHexEscape("u"))&&"\\"!==e&&i.Character.isIdentifierPart(e.charCodeAt(0))||this.throwUnexpectedToken(),n+=e);return n},e.prototype.octalToDecimal=function(e){var t="0"!==e,n=a(e);return!this.eof()&&i.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+a(this.source[this.index++]),"0123".indexOf(e)>=0&&!this.eof()&&i.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+a(this.source[this.index++]))),{code:n,octal:t}},e.prototype.scanIdentifier=function(){var e,t=this.index,n=92===this.source.charCodeAt(t)?this.getComplexIdentifier():this.getIdentifier();if(3!=(e=1===n.length?3:this.isKeyword(n)?4:"null"===n?5:"true"===n||"false"===n?1:3)&&t+n.length!==this.index){var r=this.index;this.index=t,this.tolerateUnexpectedToken(s.Messages.InvalidEscapedReservedWord),this.index=r}return{type:e,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.scanPunctuator=function(){var e=this.index,t=this.source[this.index];switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,t="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:">>>="===(t=this.source.substr(this.index,4))?this.index+=4:"==="===(t=t.substr(0,3))||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:"&&"===(t=t.substr(0,2))||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],"<>=!+-*%&|^/".indexOf(t)>=0&&++this.index)}return this.index===e&&this.throwUnexpectedToken(),{type:7,value:t,lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&i.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),i.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanBinaryLiteral=function(e){for(var t,n="";!this.eof()&&("0"===(t=this.source[this.index])||"1"===t);)n+=this.source[this.index++];return 0===n.length&&this.throwUnexpectedToken(),this.eof()||(t=this.source.charCodeAt(this.index),(i.Character.isIdentifierStart(t)||i.Character.isDecimalDigit(t))&&this.throwUnexpectedToken()),{type:6,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanOctalLiteral=function(e,t){var n="",r=!1;for(i.Character.isOctalDigit(e.charCodeAt(0))?(r=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&i.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return r||0!==n.length||this.throwUnexpectedToken(),(i.Character.isIdentifierStart(this.source.charCodeAt(this.index))||i.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(n,8),octal:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1;e=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,(function(e,t,n){var i=parseInt(t||n,16);return i>1114111&&r.throwUnexpectedToken(s.Messages.InvalidRegExp),i<=65535?String.fromCharCode(i):"￿"})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"￿"));try{RegExp(n)}catch(e){this.throwUnexpectedToken(s.Messages.InvalidRegExp)}try{return new RegExp(e,t)}catch(e){return null}},e.prototype.scanRegExpBody=function(){var e=this.source[this.index];r.assert("/"===e,"Regular expression literal must start with a slash");for(var t=this.source[this.index++],n=!1,o=!1;!this.eof();)if(t+=e=this.source[this.index++],"\\"===e)e=this.source[this.index++],i.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),t+=e;else if(i.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);else if(n)"]"===e&&(n=!1);else{if("/"===e){o=!0;break}"["===e&&(n=!0)}return o||this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),t.substr(1,t.length-2)},e.prototype.scanRegExpFlags=function(){for(var e="";!this.eof();){var t=this.source[this.index];if(!i.Character.isIdentifierPart(t.charCodeAt(0)))break;if(++this.index,"\\"!==t||this.eof())e+=t;else if("u"===(t=this.source[this.index])){++this.index;var n=this.index,r=this.scanHexEscape("u");if(null!==r)for(e+=r;n=55296&&e<57343&&i.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},e}();t.Scanner=u},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TokenName={},t.TokenName[1]="Boolean",t.TokenName[2]="",t.TokenName[3]="Identifier",t.TokenName[4]="Keyword",t.TokenName[5]="Null",t.TokenName[6]="Numeric",t.TokenName[7]="Punctuator",t.TokenName[8]="String",t.TokenName[9]="RegularExpression",t.TokenName[10]="Template"},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(12),s=n(13),o=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(e)>=0},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case"this":case"]":t=!1;break;case")":var n=this.values[this.paren-1];t="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(t=!1,"function"===this.values[this.curly-3])t=!!(r=this.values[this.curly-4])&&!this.beforeFunctionExpression(r);else if("function"===this.values[this.curly-4]){var r;t=!(r=this.values[this.curly-5])||!this.beforeFunctionExpression(r)}}return t},e.prototype.push=function(e){7===e.type||4===e.type?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e}(),a=function(){function e(e,t){this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=!!t&&"boolean"==typeof t.tolerant&&t.tolerant,this.scanner=new i.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&"boolean"==typeof t.comment&&t.comment,this.trackRange=!!t&&"boolean"==typeof t.range&&t.range,this.trackLoc=!!t&&"boolean"==typeof t.loc&&t.loc,this.buffer=[],this.reader=new o}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var e=this.scanner.scanComments();if(this.scanner.trackComment)for(var t=0;t{"use strict";var r=n(8),i=n(9),s=n(31),o=n(11),a=Object.prototype.toString,u=Object.prototype.hasOwnProperty,c={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},l=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function h(e){var t,n,s;if(t=e.toString(16).toUpperCase(),e<=255)n="x",s=2;else if(e<=65535)n="u",s=4;else{if(!(e<=4294967295))throw new i("code point within a string may not be greater than 0xFFFFFFFF");n="U",s=8}return"\\"+n+r.repeat("0",s-t.length)+t}function p(e){this.schema=e.schema||s,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=r.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=function(e,t){var n,r,i,s,o,a,c;if(null===t)return{};for(n={},i=0,s=(r=Object.keys(t)).length;i-1&&n>=e.flowLevel;switch(function(e,t,n,r,i){var s,o,a,u,c=!1,l=!1,h=-1!==r,p=-1,d=g(u=e.charCodeAt(0))&&65279!==u&&!m(u)&&45!==u&&63!==u&&58!==u&&44!==u&&91!==u&&93!==u&&123!==u&&125!==u&&35!==u&&38!==u&&42!==u&&33!==u&&124!==u&&61!==u&&62!==u&&39!==u&&34!==u&&37!==u&&64!==u&&96!==u&&!m(e.charCodeAt(e.length-1));if(t)for(s=0;s0?e.charCodeAt(s-1):null,d=d&&x(o,a)}else{for(s=0;sr&&" "!==e[p+1],p=s);else if(!g(o))return 5;a=s>0?e.charCodeAt(s-1):null,d=d&&x(o,a)}l=l||h&&s-p-1>r&&" "!==e[p+1]}return c||l?n>9&&y(e)?5:l?4:3:d&&!i(e)?1:2}(t,a,e.indent,o,(function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n"+C(t,e.indent)+v(d(function(e,t){for(var n,r,i,s=/(\n+)([^\n]*)/g,o=(i=-1!==(i=e.indexOf("\n"))?i:e.length,s.lastIndex=i,E(e.slice(0,i),t)),a="\n"===e[0]||" "===e[0];r=s.exec(e);){var u=r[1],c=r[2];n=" "===c[0],o+=u+(a||n||""===c?"":"\n")+E(c,t),a=n}return o}(t,o),s));case 5:return'"'+function(e){for(var t,n,r,i="",s=0;s=55296&&t<=56319&&(n=e.charCodeAt(s+1))>=56320&&n<=57343?(i+=h(1024*(t-55296)+n-56320+65536),s++):i+=!(r=c[t])&&g(t)?e[s]:r||h(t);return i}(t)+'"';default:throw new i("impossible error: invalid scalar style")}}()}function C(e,t){var n=y(e)?String(t):"",r="\n"===e[e.length-1];return n+(!r||"\n"!==e[e.length-2]&&"\n"!==e?r?"":"-":"+")+"\n"}function v(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function E(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,s=0,o=0,a=0,u="";n=i.exec(e);)(a=n.index)-s>t&&(r=o>s?o:a,u+="\n"+e.slice(s,r),s=r+1),o=a;return u+="\n",e.length-s>t&&o>s?u+=e.slice(s,o)+"\n"+e.slice(o+1):u+=e.slice(s),u.slice(1)}function k(e,t,n){var r,s,o,c,l,h;for(o=0,c=(s=n?e.explicitTypes:e.implicitTypes).length;o tag resolver accepts not "'+h+'" style');r=l.represent[h](t,h)}e.dump=r}return!0}return!1}function b(e,t,n,r,s,o){e.tag=null,e.dump=n,k(e,n,!1)||k(e,n,!0);var u=a.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var c,l,h="[object Object]"===u||"[object Array]"===u;if(h&&(l=-1!==(c=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||l||2!==e.indent&&t>0)&&(s=!1),l&&e.usedDuplicates[c])e.dump="*ref_"+c;else{if(h&&l&&!e.usedDuplicates[c]&&(e.usedDuplicates[c]=!0),"[object Object]"===u)r&&0!==Object.keys(e.dump).length?(function(e,t,n,r){var s,o,a,u,c,l,h="",p=e.tag,d=Object.keys(n);if(!0===e.sortKeys)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new i("sortKeys must be a boolean or a function");for(s=0,o=d.length;s1024)&&(e.dump&&10===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=f(e,t)),b(e,t+1,u,!0,c)&&(e.dump&&10===e.dump.charCodeAt(0)?l+=":":l+=": ",h+=l+=e.dump));e.tag=p,e.dump=h||"{}"}(e,t,e.dump,s),l&&(e.dump="&ref_"+c+e.dump)):(function(e,t,n){var r,i,s,o,a,u="",c=e.tag,l=Object.keys(n);for(r=0,i=l.length;r1024&&(a+="? "),a+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),b(e,t,o,!1,!1)&&(u+=a+=e.dump));e.tag=c,e.dump="{"+u+"}"}(e,t,e.dump),l&&(e.dump="&ref_"+c+" "+e.dump));else if("[object Array]"===u){var p=e.noArrayIndent&&t>0?t-1:t;r&&0!==e.dump.length?(function(e,t,n,r){var i,s,o="",a=e.tag;for(i=0,s=n.length;i "+e.dump)}return!0}function A(e,t){var n,r,i=[],s=[];for(w(e,i,s),n=0,r=s.length;n{"use strict";const r=n(38).URL,i=n(4),s=n(39),{promisify:o}=n(40),a=n(41),u=n(108),c=n(111),l=n(116),h=["MD002","MD006"];function p(e,t){return e.lineNumber-t.lineNumber}function d(){return!0}function f(e,t,n){return 0===t||e.lineNumber>n[t-1].lineNumber}function m(e,t,n,r,i,s,o,a,u,m){const g=function(e,t){let n=[];if(t){const r=e.match(t);if(r&&!r.index){const t=r[0];e=e.slice(t.length),n=t.split(c.newLineRe),n.length>0&&""===n[n.length-1]&&n.length--}}return{content:e,frontMatterLines:n}}(n=n.replace(/^\uFEFF/,""),s),x=g.frontMatterLines;n=c.clearHtmlCommentText(g.content);const y=r.parse(n,{}),D=n.split(c.newLineRe);!function(e,t){let n=null;e.forEach((function(e){if("thead_open"===e.type||"tbody_open"===e.type?n=e.map.slice():"tr_close"===e.type&&n?n[0]++:"thead_close"!==e.type&&"tbody_close"!==e.type||(n=null),n&&!e.map&&(e.map=n.slice()),e.map){for(e.line=t[e.map[0]],e.lineNumber=e.map[0]+1;e.map[1]&&!(t[e.map[1]-1]||"").trim();)e.map[1]--;let n=e.lineNumber;const r=[];c.forEachInlineCodeSpan(e.content,(function(e){r.push(e.split(c.newLineRe).length-1)})),(e.children||[]).forEach((function(e){e.lineNumber=n,e.line=t[n-1],"softbreak"===e.type||"hardbreak"===e.type?n++:"code_inline"===e.type&&(n+=r.shift())}))}}))}(y,D);const C=function(e){const t={};return e.forEach((function(e){const n=e.names[0].toUpperCase();e.names.forEach((function(e){const r=e.toUpperCase();t[r]=[n]})),e.tags.forEach((function(e){const r=e.toUpperCase(),i=t[r]||[];i.push(n),t[r]=i}))})),t}(e),{effectiveConfig:v,enabledRulesPerLineNumber:E}=function(e,t,n,r,i,s){let o={},a={};const u=[],l=new Array(1+n.length);function p(e,n,i){(e?t:[t.join("\n")]).forEach(((e,t)=>{if(!r){let r=null;for(;r=c.inlineCommentRe.exec(e);){const e=(r[1]||r[3]).toUpperCase(),i=r[2]||r[4];n(e,i,t+1)}}i&&i()}))}function d(e,t,n){const r=e.startsWith("ENABLE");(t?t.trim().toUpperCase().split(/\s+/):u).forEach((e=>{(s[e]||[]).forEach((e=>{n[e]=r}))}))}p(!1,(function(e,t){if("CONFIGURE-FILE"===e)try{const e=JSON.parse(t);i={...i,...e}}catch{}}));const f=function(e,t,n){const r=Object.keys(t).filter((e=>"DEFAULT"===e.toUpperCase())),i=0===r.length||!!t[r[0]],s={};return e.forEach((e=>{const t=e.names[0].toUpperCase();s[t]=i})),h.forEach((e=>{s[e]=!1})),Object.keys(t).forEach((e=>{let r=t[e];r?r instanceof Object||(r={}):r=!1;const i=e.toUpperCase();(n[i]||[]).forEach((e=>{s[e]=r}))})),s}(e,i,s);return e.forEach((e=>{const t=e.names[0].toUpperCase();u.push(t),o[t]=!!f[t]})),a=o,p(!0,(function(e,t){"ENABLE-FILE"!==e&&"DISABLE-FILE"!==e||d(e,t,o)})),p(!0,(function(e,t){"CAPTURE"===e?a={...o}:"RESTORE"===e?o={...a}:"ENABLE"!==e&&"DISABLE"!==e||(o={...o},d(e,t,o))}),(function(){l.push({...o})})),p(!0,(function(e,t,n){"DISABLE-NEXT-LINE"===e&&d(e,t,l[n+1]||{})})),{effectiveConfig:f,enabledRulesPerLineNumber:l}}(e,D,x,a,i,C),k={name:t,tokens:y,lines:D,frontMatterLines:x};l.lineMetadata(c.getLineMetadata(k)),l.flattenedLists(c.flattenLists(k));const b=0===u?{}:[];try{e.forEach((function(e){const t=e.names[0],n=t.toUpperCase();function r(e){throw new Error("Property '"+e+"' of onError parameter is incorrect.")}k.config=v[n];const i=[];function s(e){(!e||!c.isNumber(e.lineNumber)||e.lineNumber<1||e.lineNumber>D.length)&&r("lineNumber"),e.detail&&!c.isString(e.detail)&&r("detail"),e.context&&!c.isString(e.context)&&r("context"),e.range&&(!Array.isArray(e.range)||2!==e.range.length||!c.isNumber(e.range[0])||e.range[0]<1||!c.isNumber(e.range[1])||e.range[1]<1||e.range[0]+e.range[1]-1>D[e.lineNumber-1].length)&&r("range");const t=e.fixInfo,n={};if(t){c.isObject(t)||r("fixInfo"),void 0!==t.lineNumber&&((!c.isNumber(t.lineNumber)||t.lineNumber<1||t.lineNumber>D.length)&&r("fixInfo.lineNumber"),n.lineNumber=t.lineNumber+x.length);const i=t.lineNumber||e.lineNumber;void 0!==t.editColumn&&((!c.isNumber(t.editColumn)||t.editColumn<1||t.editColumn>D[i-1].length+1)&&r("fixInfo.editColumn"),n.editColumn=t.editColumn),void 0!==t.deleteCount&&((!c.isNumber(t.deleteCount)||t.deleteCount<-1||t.deleteCount>D[i-1].length)&&r("fixInfo.deleteCount"),n.deleteCount=t.deleteCount),void 0!==t.insertText&&(c.isString(t.insertText)||r("fixInfo.insertText"),n.insertText=t.insertText)}i.push({lineNumber:e.lineNumber+x.length,detail:e.detail||null,context:e.context||null,range:e.range?[...e.range]:null,fixInfo:t?n:null})}if(o)try{e.function(k,s)}catch(e){s({lineNumber:1,detail:"This rule threw an exception: "+e.message})}else e.function(k,s);if(i.length>0){i.sort(p);const r=i.filter(3===u?d:f).filter((function(e){return E[e.lineNumber][n]})).map((function(n){if(0===u)return n.lineNumber;const r={};return r.lineNumber=n.lineNumber,1===u?(r.ruleName=t,r.ruleAlias=e.names[1]||e.names[0]):r.ruleNames=e.names,r.ruleDescription=e.description,r.ruleInformation=e.information?e.information.href:null,r.errorDetail=n.detail,r.errorContext=n.context,r.errorRange=n.range,3===u&&(r.fixInfo=n.fixInfo),r}));r.length>0&&(0===u?b[t]=r:Array.prototype.push.apply(b,r))}}))}catch(e){return l.clear(),m(e)}return l.clear(),m(null,b)}function g(e,t,n,r,s,o,a,u,l,h){function p(i,c){return i?h(i):m(e,t,c,n,r,s,o,a,u,h)}l?p(null,i.readFileSync(t,c.utf8Encoding)):i.readFile(t,c.utf8Encoding,p)}function x(e,t,n){e=e||{},n=n||function(){};const i=u.concat(e.customRules||[]),s=function(e){let t=null;if(e.length===u.length)return t;const n={};return e.forEach((function(e,i){const s=i-u.length;function o(e){return new Error("Property '"+e+"' of custom rule at index "+s+" is incorrect.")}["names","tags"].forEach((function(n){const r=e[n];t||r&&Array.isArray(r)&&0!==r.length&&r.every(c.isString)&&!r.some(c.isEmptyString)||(t=o(n))})),[["description","string"],["function","function"]].forEach((function(n){const r=n[0],i=e[r];t||i&&typeof i===n[1]||(t=o(r))})),!t&&e.information&&Object.getPrototypeOf(e.information)!==r.prototype&&(t=o("information")),t||(e.names.forEach((function(e){const r=e.toUpperCase();t||void 0===n[r]||(t=new Error("Name '"+e+"' of custom rule at index "+s+" is already used as a name or tag.")),n[r]=!0})),e.tags.forEach((function(e){const r=e.toUpperCase();!t&&n[r]&&(t=new Error("Tag '"+e+"' of custom rule at index "+s+" is already used as a name.")),n[r]=!1})))})),t}(i);if(s)return n(s);let o=[];Array.isArray(e.files)?o=e.files.slice():e.files&&(o=[String(e.files)]);const l=e.strings||{},h=Object.keys(l),p=e.config||{default:!0},d=void 0===e.frontMatter?c.frontMatterRe:e.frontMatter,f=!!e.handleRuleFailures,x=!!e.noInlineConfig,y=void 0===e.resultVersion?2:e.resultVersion,D=a({html:!0});(e.markdownItPlugins||[]).forEach((function(e){D.use(...e)}));const C=function(e){const t={};return Object.defineProperty(t,"toString",{value:function(n){let r=null;const i=[],s=Object.keys(t);return s.sort(),s.forEach((function(s){const o=t[s];Array.isArray(o)?o.forEach((function(e){const t=e.ruleNames?e.ruleNames.join("/"):e.ruleName+"/"+e.ruleAlias;i.push(s+": "+e.lineNumber+": "+t+" "+e.ruleDescription+(e.errorDetail?" ["+e.errorDetail+"]":"")+(e.errorContext?' [Context: "'+e.errorContext+'"]':""))})):(r||(r={},e.forEach((function(e){const t=e.names[0].toUpperCase();r[t]=e}))),Object.keys(o).forEach((function(e){const t=r[e.toUpperCase()];o[e].forEach((function(e){const r=Math.min(n?1:0,t.names.length-1),o=s+": "+e+": "+t.names[r]+" "+t.description;i.push(o)}))})))})),i.join("\n")}}),t}(i);let v=!1,E=null;function k(e,t){return e?(v=!0,n(e)):(C[E]=t,null)}for(;!v&&(E=h.shift());)m(i,E,l[E]||"",D,p,d,f,x,y,k);if(t){for(;!v&&(E=o.shift());)g(i,E,D,p,d,f,x,y,t,k);return v||n(null,C)}let b=0;function A(){const e=o.shift();if(v);else if(e)b++,g(i,e,D,p,d,f,x,y,t,((t,r)=>(b--,t?(v=!0,n(t)):(C[e]=r,A(),null))));else if(0===b)return v=!0,n(null,C);return null}return A(),A(),A(),A(),A(),A(),A(),A(),null}function y(e,t){return x(e,!1,t)}const D=o(y);function C(e,t,n){let r=null,i="";const s=[];return(n||[JSON.parse]).every((e=>{try{r=e(t)}catch(e){s.push(e.message)}return!r})),r||(s.unshift(`Unable to parse '${e}'`),i=s.join("; ")),{config:r,message:i}}function v(e,t){const r=s.dirname(e),o=s.resolve(r,t);try{if(i.statSync(o).isFile())return o}catch{}try{return n(157).resolve(t,{paths:[r]})}catch{}return o}function E(e,t,n){n||(n=t,t=null),i.readFile(e,c.utf8Encoding,((r,i)=>{if(r)return n(r);const{config:s,message:o}=C(e,i,t);if(!s)return n(new Error(o));const a=s.extends;return a?(delete s.extends,E(v(e,a),t,((e,t)=>e?n(e):n(null,{...t,...s})))):n(null,s)}))}const k=o(E);y.sync=function(e){let t=null;return x(e,!0,(function(e,n){if(e)throw e;t=n})),t},y.readConfig=E,y.readConfigSync=function e(t,n){const r=i.readFileSync(t,c.utf8Encoding),{config:s,message:o}=C(t,r,n);if(!s)throw new Error(o);const a=s.extends;return a?(delete s.extends,{...e(v(t,a),n),...s}):s},y.getVersion=function(){return n(109).version},y.promises={markdownlint:function(e){return D(e)},readConfig:function(e,t){return k(e,t)}},e.exports=y},e=>{"use strict";e.exports=require("url")},e=>{"use strict";e.exports=require("path")},e=>{"use strict";e.exports=require("util")},(e,t,n)=>{"use strict";e.exports=n(42)},(e,t,n)=>{"use strict";var r=n(43),i=n(57),s=n(61),o=n(62),a=n(72),u=n(87),c=n(102),l=n(47),h=n(104),p={default:n(105),zero:n(106),commonmark:n(107)},d=/^(vbscript|javascript|file|data):/,f=/^data:image\/(gif|png|jpeg|webp);/;function m(e){var t=e.trim().toLowerCase();return!d.test(t)||!!f.test(t)}var g=["http:","https:","mailto:"];function x(e){var t=l.parse(e,!0);if(t.hostname&&(!t.protocol||g.indexOf(t.protocol)>=0))try{t.hostname=h.toASCII(t.hostname)}catch(e){}return l.encode(l.format(t))}function y(e){var t=l.parse(e,!0);if(t.hostname&&(!t.protocol||g.indexOf(t.protocol)>=0))try{t.hostname=h.toUnicode(t.hostname)}catch(e){}return l.decode(l.format(t),l.decode.defaultChars+"%")}function D(e,t){if(!(this instanceof D))return new D(e,t);t||r.isString(e)||(t=e||{},e="default"),this.inline=new u,this.block=new a,this.core=new o,this.renderer=new s,this.linkify=new c,this.validateLink=m,this.normalizeLink=x,this.normalizeLinkText=y,this.utils=r,this.helpers=r.assign({},i),this.options={},this.configure(e),t&&this.set(t)}D.prototype.set=function(e){return r.assign(this.options,e),this},D.prototype.configure=function(e){var t,n=this;if(r.isString(e)&&!(e=p[t=e]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach((function(t){e.components[t].rules&&n[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&n[t].ruler2.enableOnly(e.components[t].rules2)})),this},D.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.enable(e,!0))}),this),n=n.concat(this.inline.ruler2.enable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},D.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.disable(e,!0))}),this),n=n.concat(this.inline.ruler2.disable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},D.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},D.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},D.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},D.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},D.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=D},(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty;function i(e,t){return r.call(e,t)}function s(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||65535==(65535&e)||65534==(65535&e)||e>=0&&e<=8||11===e||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function o(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var a=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,u=new RegExp(a.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),c=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,l=n(44),h=/[&<>"]/,p=/[&<>"]/g,d={"&":"&","<":"<",">":">",'"':"""};function f(e){return d[e]}var m=/[.?*+^$[\]\\(){}|-]/g,g=n(46);t.lib={},t.lib.mdurl=n(47),t.lib.ucmicro=n(52),t.assign=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=i,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(a,"$1")},t.unescapeAll=function(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(u,(function(e,t,n){return t||function(e,t){var n=0;return i(l,t)?l[t]:35===t.charCodeAt(0)&&c.test(t)&&s(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?o(n):e}(e,n)}))},t.isValidEntityCode=s,t.fromCodePoint=o,t.escapeHtml=function(e){return h.test(e)?e.replace(p,f):e},t.arrayReplaceAt=function(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))},t.isSpace=function(e){switch(e){case 9:case 32:return!0}return!1},t.isWhiteSpace=function(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},t.isMdAsciiPunct=function(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},t.isPunctChar=function(e){return g.test(e)},t.escapeRE=function(e){return e.replace(m,"\\$&")},t.normalizeReference=function(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}},(e,t,n)=>{"use strict";e.exports=n(45)},e=>{"use strict";e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')},e=>{e.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},(e,t,n)=>{"use strict";e.exports.encode=n(48),e.exports.decode=n(49),e.exports.format=n(50),e.exports.parse=n(51)},e=>{"use strict";var t={};function n(e,r,i){var s,o,a,u,c,l="";for("string"!=typeof r&&(i=r,r=n.defaultChars),void 0===i&&(i=!0),c=function(e){var n,r,i=t[e];if(i)return i;for(i=t[e]=[],n=0;n<128;n++)r=String.fromCharCode(n),/^[0-9a-z]$/i.test(r)?i.push(r):i.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2));for(n=0;n=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1=56320&&u<=57343){l+=encodeURIComponent(e[s]+e[s+1]),s++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(e[s]);return l}n.defaultChars=";/?:@&=+$,-_.!~*'()#",n.componentChars="-_.!~*'()",e.exports=n},e=>{"use strict";var t={};function n(e,r){var i;return"string"!=typeof r&&(r=n.defaultChars),i=function(e){var n,r,i=t[e];if(i)return i;for(i=t[e]=[],n=0;n<128;n++)r=String.fromCharCode(n),i.push(r);for(n=0;n=55296&&u<=57343?"���":String.fromCharCode(u),t+=6):240==(248&r)&&t+91114111?c+="����":(u-=65536,c+=String.fromCharCode(55296+(u>>10),56320+(1023&u))),t+=9):c+="�";return c}))}n.defaultChars=";/?:@&=+$,#",n.componentChars="",e.exports=n},e=>{"use strict";e.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",(t+=e.search||"")+(e.hash||"")}},e=>{"use strict";function t(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var n=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,s=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),o=["'"].concat(s),a=["%","/","?",";","#"].concat(o),u=["/","?","#"],c=/^[+a-z0-9A-Z_-]{0,63}$/,l=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};t.prototype.parse=function(e,t){var r,s,o,d,f,m=e;if(m=m.trim(),!t&&1===e.split("#").length){var g=i.exec(m);if(g)return this.pathname=g[1],g[2]&&(this.search=g[2]),this}var x=n.exec(m);if(x&&(o=(x=x[0]).toLowerCase(),this.protocol=x,m=m.substr(x.length)),(t||x||m.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(f="//"===m.substr(0,2))||x&&h[x]||(m=m.substr(2),this.slashes=!0)),!h[x]&&(f||x&&!p[x])){var y,D,C=-1;for(r=0;r127?A+="x":A+=b[w];if(!A.match(c)){var _=k.slice(0,r),F=k.slice(r+1),T=b.match(l);T&&(_.push(T[1]),F.unshift(T[2])),F.length&&(m=F.join(".")+m),this.hostname=_.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),E&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var N=m.indexOf("#");-1!==N&&(this.hash=m.substr(N),m=m.slice(0,N));var M=m.indexOf("?");return-1!==M&&(this.search=m.substr(M),m=m.slice(0,M)),m&&(this.pathname=m),p[o]&&this.hostname&&!this.pathname&&(this.pathname=""),this},t.prototype.parseHost=function(e){var t=r.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},e.exports=function(e,n){if(e&&e instanceof t)return e;var r=new t;return r.parse(e,n),r}},(e,t,n)=>{"use strict";t.Any=n(53),t.Cc=n(54),t.Cf=n(55),t.P=n(46),t.Z=n(56)},e=>{e.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},e=>{e.exports=/[\0-\x1F\x7F-\x9F]/},e=>{e.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},e=>{e.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},(e,t,n)=>{"use strict";t.parseLinkLabel=n(58),t.parseLinkDestination=n(59),t.parseLinkTitle=n(60)},e=>{"use strict";e.exports=function(e,t,n){var r,i,s,o,a=-1,u=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos{"use strict";var r=n(43).unescapeAll;e.exports=function(e,t,n){var i,s,o=t,a={ok:!1,pos:0,lines:0,str:""};if(60===e.charCodeAt(t)){for(t++;t{"use strict";var r=n(43).unescapeAll;e.exports=function(e,t,n){var i,s,o=0,a=t,u={ok:!1,pos:0,lines:0,str:""};if(t>=n)return u;if(34!==(s=e.charCodeAt(t))&&39!==s&&40!==s)return u;for(t++,40===s&&(s=41);t{"use strict";var r=n(43).assign,i=n(43).unescapeAll,s=n(43).escapeHtml,o={};function a(){this.rules=r({},o)}o.code_inline=function(e,t,n,r,i){var o=e[t];return""+s(e[t].content)+""},o.code_block=function(e,t,n,r,i){var o=e[t];return""+s(e[t].content)+"\n"},o.fence=function(e,t,n,r,o){var a,u,c,l,h,p=e[t],d=p.info?i(p.info).trim():"",f="",m="";return d&&(f=(c=d.split(/(\s+)/g))[0],m=c.slice(2).join("")),0===(a=n.highlight&&n.highlight(p.content,f,m)||s(p.content)).indexOf(""+a+"\n"):"
"+a+"
\n"},o.image=function(e,t,n,r,i){var s=e[t];return s.attrs[s.attrIndex("alt")][1]=i.renderInlineAsText(s.children,n,r),i.renderToken(e,t,n)},o.hardbreak=function(e,t,n){return n.xhtmlOut?"
\n":"
\n"},o.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"
\n":"
\n":"\n"},o.text=function(e,t){return s(e[t].content)},o.html_block=function(e,t){return e[t].content},o.html_inline=function(e,t){return e[t].content},a.prototype.renderAttrs=function(e){var t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t\n":">")},a.prototype.renderInline=function(e,t,n){for(var r,i="",s=this.rules,o=0,a=e.length;o{"use strict";var r=n(63),i=[["normalize",n(64)],["block",n(65)],["inline",n(66)],["linkify",n(67)],["replacements",n(68)],["smartquotes",n(69)]];function s(){this.ruler=new r;for(var e=0;e{"use strict";function t(){this.__rules__=[],this.__cache__=null}t.prototype.__find__=function(e){for(var t=0;t{"use strict";var t=/\r\n?|\n/g,n=/\0/g;e.exports=function(e){var r;r=(r=e.src.replace(t,"\n")).replace(n,"�"),e.src=r}},e=>{"use strict";e.exports=function(e){var t;e.inlineMode?((t=new e.Token("inline","",0)).content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}},e=>{"use strict";e.exports=function(e){var t,n,r,i=e.tokens;for(n=0,r=i.length;n{"use strict";var r=n(43).arrayReplaceAt;function i(e){return/^<\/a\s*>/i.test(e)}e.exports=function(e){var t,n,s,o,a,u,c,l,h,p,d,f,m,g,x,y,D,C,v=e.tokens;if(e.md.options.linkify)for(n=0,s=v.length;n=0;t--)if("link_close"!==(u=o[t]).type){if("html_inline"===u.type&&(C=u.content,/^\s]/i.test(C)&&m>0&&m--,i(u.content)&&m++),!(m>0)&&"text"===u.type&&e.md.linkify.test(u.content)){for(h=u.content,D=e.md.linkify.match(h),c=[],f=u.level,d=0,l=0;ld&&((a=new e.Token("text","",0)).content=h.slice(d,p),a.level=f,c.push(a)),(a=new e.Token("link_open","a",1)).attrs=[["href",x]],a.level=f++,a.markup="linkify",a.info="auto",c.push(a),(a=new e.Token("text","",0)).content=y,a.level=f,c.push(a),(a=new e.Token("link_close","a",-1)).level=--f,a.markup="linkify",a.info="auto",c.push(a),d=D[l].lastIndex);d{"use strict";var t=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,n=/\((c|tm|r|p)\)/i,r=/\((c|tm|r|p)\)/gi,i={c:"©",r:"®",p:"§",tm:"™"};function s(e,t){return i[t.toLowerCase()]}function o(e){var t,n,i=0;for(t=e.length-1;t>=0;t--)"text"!==(n=e[t]).type||i||(n.content=n.content.replace(r,s)),"link_open"===n.type&&"auto"===n.info&&i--,"link_close"===n.type&&"auto"===n.info&&i++}function a(e){var n,r,i=0;for(n=e.length-1;n>=0;n--)"text"!==(r=e[n]).type||i||t.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===r.type&&"auto"===r.info&&i--,"link_close"===r.type&&"auto"===r.info&&i++}e.exports=function(e){var r;if(e.md.options.typographer)for(r=e.tokens.length-1;r>=0;r--)"inline"===e.tokens[r].type&&(n.test(e.tokens[r].content)&&o(e.tokens[r].children),t.test(e.tokens[r].content)&&a(e.tokens[r].children))}},(e,t,n)=>{"use strict";var r=n(43).isWhiteSpace,i=n(43).isPunctChar,s=n(43).isMdAsciiPunct,o=/['"]/,a=/['"]/g;function u(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}function c(e,t){var n,o,c,l,h,p,d,f,m,g,x,y,D,C,v,E,k,b,A,w,S;for(A=[],n=0;n=0&&!(A[k].level<=d);k--);if(A.length=k+1,"text"===o.type){h=0,p=(c=o.content).length;e:for(;h=0)m=c.charCodeAt(l.index-1);else for(k=n-1;k>=0&&"softbreak"!==e[k].type&&"hardbreak"!==e[k].type;k--)if(e[k].content){m=e[k].content.charCodeAt(e[k].content.length-1);break}if(g=32,h=48&&m<=57&&(E=v=!1),v&&E&&(v=x,E=y),v||E){if(E)for(k=A.length-1;k>=0&&(f=A[k],!(A[k].level=0;t--)"inline"===e.tokens[t].type&&o.test(e.tokens[t].content)&&c(e.tokens[t].children,e)}},(e,t,n)=>{"use strict";var r=n(71);function i(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}i.prototype.Token=r,e.exports=i},e=>{"use strict";function t(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}t.prototype.attrIndex=function(e){var t,n,r;if(!this.attrs)return-1;for(n=0,r=(t=this.attrs).length;n=0&&(n=this.attrs[t][1]),n},t.prototype.attrJoin=function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},e.exports=t},(e,t,n)=>{"use strict";var r=n(63),i=[["table",n(73),["paragraph","reference"]],["code",n(74)],["fence",n(75),["paragraph","reference","blockquote","list"]],["blockquote",n(76),["paragraph","reference","blockquote","list"]],["hr",n(77),["paragraph","reference","blockquote","list"]],["list",n(78),["paragraph","reference","blockquote"]],["reference",n(79)],["heading",n(80),["paragraph","reference","blockquote"]],["lheading",n(81)],["html_block",n(82),["paragraph","reference","blockquote"]],["paragraph",n(85)]];function s(){this.ruler=new r;for(var e=0;e=n))&&!(e.sCount[o]=u){e.line=n;break}for(r=0;r{"use strict";var r=n(43).isSpace;function i(e,t){var n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.substr(n,r-n)}function s(e){var t,n=[],r=0,i=e.length,s=!1,o=0,a="";for(t=e.charCodeAt(r);rn)return!1;if(p=t+1,e.sCount[p]=4)return!1;if((c=e.bMarks[p]+e.tShift[p])>=e.eMarks[p])return!1;if(124!==(a=e.src.charCodeAt(c++))&&45!==a&&58!==a)return!1;for(;c=4)return!1;if((d=s(u)).length&&""===d[0]&&d.shift(),d.length&&""===d[d.length-1]&&d.pop(),0===(f=d.length)||f!==g.length)return!1;if(o)return!0;for(C=e.parentType,e.parentType="table",E=e.md.block.ruler.getRules("blockquote"),(m=e.push("table_open","table",1)).map=y=[t,0],(m=e.push("thead_open","thead",1)).map=[t,t+1],(m=e.push("tr_open","tr",1)).map=[t,t+1],l=0;l=4)break;for((d=s(u)).length&&""===d[0]&&d.shift(),d.length&&""===d[d.length-1]&&d.pop(),p===t+2&&((m=e.push("tbody_open","tbody",1)).map=D=[t+2,0]),(m=e.push("tr_open","tr",1)).map=[p,p+1],l=0;l{"use strict";e.exports=function(e,t,n){var r,i,s;if(e.sCount[t]-e.blkIndent<4)return!1;for(i=r=t+1;r=4))break;i=++r}return e.line=i,(s=e.push("code_block","code",0)).content=e.getLines(t,i,4+e.blkIndent,!0),s.map=[t,e.line],!0}},e=>{"use strict";e.exports=function(e,t,n,r){var i,s,o,a,u,c,l,h=!1,p=e.bMarks[t]+e.tShift[t],d=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(p+3>d)return!1;if(126!==(i=e.src.charCodeAt(p))&&96!==i)return!1;if(u=p,(s=(p=e.skipChars(p,i))-u)<3)return!1;if(l=e.src.slice(u,p),o=e.src.slice(p,d),96===i&&o.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;for(a=t;!(++a>=n||(p=u=e.bMarks[a]+e.tShift[a])<(d=e.eMarks[a])&&e.sCount[a]=4||(p=e.skipChars(p,i))-u{"use strict";var r=n(43).isSpace;e.exports=function(e,t,n,i){var s,o,a,u,c,l,h,p,d,f,m,g,x,y,D,C,v,E,k,b,A=e.lineMax,w=e.bMarks[t]+e.tShift[t],S=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(62!==e.src.charCodeAt(w++))return!1;if(i)return!0;for(u=d=e.sCount[t]+1,32===e.src.charCodeAt(w)?(w++,u++,d++,s=!1,C=!0):9===e.src.charCodeAt(w)?(C=!0,(e.bsCount[t]+d)%4==3?(w++,u++,d++,s=!1):s=!0):C=!1,f=[e.bMarks[t]],e.bMarks[t]=w;w=S,y=[e.sCount[t]],e.sCount[t]=d-u,D=[e.tShift[t]],e.tShift[t]=w-e.bMarks[t],E=e.md.block.ruler.getRules("blockquote"),x=e.parentType,e.parentType="blockquote",p=t+1;p=(S=e.eMarks[p])));p++)if(62!==e.src.charCodeAt(w++)||b){if(l)break;for(v=!1,a=0,c=E.length;a=S,m.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(C?1:0),y.push(e.sCount[p]),e.sCount[p]=d-u,D.push(e.tShift[p]),e.tShift[p]=w-e.bMarks[p]}for(g=e.blkIndent,e.blkIndent=0,(k=e.push("blockquote_open","blockquote",1)).markup=">",k.map=h=[t,0],e.md.block.tokenize(e,t,p),(k=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=A,e.parentType=x,h[1]=e.line,a=0;a{"use strict";var r=n(43).isSpace;e.exports=function(e,t,n,i){var s,o,a,u,c=e.bMarks[t]+e.tShift[t],l=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(42!==(s=e.src.charCodeAt(c++))&&45!==s&&95!==s)return!1;for(o=1;c{"use strict";var r=n(43).isSpace;function i(e,t){var n,i,s,o;return i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],42!==(n=e.src.charCodeAt(i++))&&45!==n&&43!==n||i=o)return-1;if((n=e.src.charCodeAt(s++))<48||n>57)return-1;for(;;){if(s>=o)return-1;if(!((n=e.src.charCodeAt(s++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(s-i>=10)return-1}return s=4)return!1;if(e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]=e.blkIndent&&(I=!0),(_=s(e,t))>=0){if(p=!0,T=e.bMarks[t]+e.tShift[t],y=Number(e.src.substr(T,_-T-1)),I&&1!==y)return!1}else{if(!((_=i(e,t))>=0))return!1;p=!1}if(I&&e.skipSpaces(_)>=e.eMarks[t])return!1;if(x=e.src.charCodeAt(_-1),r)return!0;for(g=e.tokens.length,p?(R=e.push("ordered_list_open","ol",1),1!==y&&(R.attrs=[["start",y]])):R=e.push("bullet_list_open","ul",1),R.map=m=[t,0],R.markup=String.fromCharCode(x),C=t,F=!1,M=e.md.block.ruler.getRules("list"),k=e.parentType,e.parentType="list";C=D?1:v-h)>4&&(l=1),c=h+l,(R=e.push("list_item_open","li",1)).markup=String.fromCharCode(x),R.map=d=[t,0],w=e.tight,A=e.tShift[t],b=e.sCount[t],E=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=c,e.tight=!0,e.tShift[t]=a-e.bMarks[t],e.sCount[t]=v,a>=D&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,t,n,!0),e.tight&&!F||(B=!1),F=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=E,e.tShift[t]=A,e.sCount[t]=b,e.tight=w,(R=e.push("list_item_close","li",-1)).markup=String.fromCharCode(x),C=t=e.line,d[1]=C,a=e.bMarks[t],C>=n)break;if(e.sCount[C]=4)break;for(N=!1,u=0,f=M.length;u{"use strict";var r=n(43).normalizeReference,i=n(43).isSpace;e.exports=function(e,t,n,s){var o,a,u,c,l,h,p,d,f,m,g,x,y,D,C,v,E=0,k=e.bMarks[t]+e.tShift[t],b=e.eMarks[t],A=t+1;if(e.sCount[t]-e.blkIndent>=4)return!1;if(91!==e.src.charCodeAt(k))return!1;for(;++k3||e.sCount[A]<0)){for(D=!1,h=0,p=C.length;h{"use strict";var r=n(43).isSpace;e.exports=function(e,t,n,i){var s,o,a,u,c=e.bMarks[t]+e.tShift[t],l=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(35!==(s=e.src.charCodeAt(c))||c>=l)return!1;for(o=1,s=e.src.charCodeAt(++c);35===s&&c6||cc&&r(e.src.charCodeAt(a-1))&&(l=a),e.line=t+1,(u=e.push("heading_open","h"+String(o),1)).markup="########".slice(0,o),u.map=[t,e.line],(u=e.push("inline","",0)).content=e.src.slice(c,l).trim(),u.map=[t,e.line],u.children=[],(u=e.push("heading_close","h"+String(o),-1)).markup="########".slice(0,o)),0))}},e=>{"use strict";e.exports=function(e,t,n){var r,i,s,o,a,u,c,l,h,p,d=t+1,f=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(p=e.parentType,e.parentType="paragraph";d3)){if(e.sCount[d]>=e.blkIndent&&(u=e.bMarks[d]+e.tShift[d])<(c=e.eMarks[d])&&(45===(h=e.src.charCodeAt(u))||61===h)&&(u=e.skipChars(u,h),(u=e.skipSpaces(u))>=c)){l=61===h?1:2;break}if(!(e.sCount[d]<0)){for(i=!1,s=0,o=f.length;s{"use strict";var r=n(83),i=n(84).HTML_OPEN_CLOSE_TAG_RE,s=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(i.source+"\\s*$"),/^$/,!1]];e.exports=function(e,t,n,r){var i,o,a,u,c=e.bMarks[t]+e.tShift[t],l=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(c))return!1;for(u=e.src.slice(c,l),i=0;i{"use strict";e.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","meta","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},e=>{"use strict";var t="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",n="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",r=new RegExp("^(?:"+t+"|"+n+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?].*?[?]>|]*>|)"),i=new RegExp("^(?:"+t+"|"+n+")");e.exports.HTML_TAG_RE=r,e.exports.HTML_OPEN_CLOSE_TAG_RE=i},e=>{"use strict";e.exports=function(e,t){var n,r,i,s,o,a,u=t+1,c=e.md.block.ruler.getRules("paragraph"),l=e.lineMax;for(a=e.parentType,e.parentType="paragraph";u3||e.sCount[u]<0)){for(r=!1,i=0,s=c.length;i{"use strict";var r=n(71),i=n(43).isSpace;function s(e,t,n,r){var s,o,a,u,c,l,h,p;for(this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",p=!1,a=u=l=h=0,c=(o=this.src).length;u0&&this.level++,this.tokens.push(i),i},s.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},s.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;et;)if(!i(this.src.charCodeAt(--e)))return e+1;return e},s.prototype.skipChars=function(e,t){for(var n=this.src.length;en;)if(t!==this.src.charCodeAt(--e))return e+1;return e},s.prototype.getLines=function(e,t,n,r){var s,o,a,u,c,l,h,p=e;if(e>=t)return"";for(l=new Array(t-e),s=0;pn?new Array(o-n+1).join(" ")+this.src.slice(u,c):this.src.slice(u,c)}return l.join("")},s.prototype.Token=r,e.exports=s},(e,t,n)=>{"use strict";var r=n(63),i=[["text",n(88)],["newline",n(89)],["escape",n(90)],["backticks",n(91)],["strikethrough",n(92).tokenize],["emphasis",n(93).tokenize],["link",n(94)],["image",n(95)],["autolink",n(96)],["html_inline",n(97)],["entity",n(98)]],s=[["balance_pairs",n(99)],["strikethrough",n(92).postProcess],["emphasis",n(93).postProcess],["text_collapse",n(100)]];function o(){var e;for(this.ruler=new r,e=0;e=s)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},o.prototype.parse=function(e,t,n,r){var i,s,o,a=new this.State(e,t,n,r);for(this.tokenize(a),o=(s=this.ruler2.getRules("")).length,i=0;i{"use strict";function t(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}e.exports=function(e,n){for(var r=e.pos;r{"use strict";var r=n(43).isSpace;e.exports=function(e,t){var n,i,s=e.pos;if(10!==e.src.charCodeAt(s))return!1;for(n=e.pending.length-1,i=e.posMax,t||(n>=0&&32===e.pending.charCodeAt(n)?n>=1&&32===e.pending.charCodeAt(n-1)?(e.pending=e.pending.replace(/ +$/,""),e.push("hardbreak","br",0)):(e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0)):e.push("softbreak","br",0)),s++;s{"use strict";for(var r=n(43).isSpace,i=[],s=0;s<256;s++)i.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(e){i[e.charCodeAt(0)]=1})),e.exports=function(e,t){var n,s=e.pos,o=e.posMax;if(92!==e.src.charCodeAt(s))return!1;if(++s{"use strict";e.exports=function(e,t){var n,r,i,s,o,a,u=e.pos;if(96!==e.src.charCodeAt(u))return!1;for(n=u,u++,r=e.posMax;u{"use strict";function t(e,t){var n,r,i,s,o,a=[],u=t.length;for(n=0;n{"use strict";function t(e,t){var n,r,i,s,o,a;for(n=t.length-1;n>=0;n--)95!==(r=t[n]).marker&&42!==r.marker||-1!==r.end&&(i=t[r.end],a=n>0&&t[n-1].end===r.end+1&&t[n-1].token===r.token-1&&t[r.end+1].token===i.token+1&&t[n-1].marker===r.marker,o=String.fromCharCode(r.marker),(s=e.tokens[r.token]).type=a?"strong_open":"em_open",s.tag=a?"strong":"em",s.nesting=1,s.markup=a?o+o:o,s.content="",(s=e.tokens[i.token]).type=a?"strong_close":"em_close",s.tag=a?"strong":"em",s.nesting=-1,s.markup=a?o+o:o,s.content="",a&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--))}e.exports.tokenize=function(e,t){var n,r,i=e.pos,s=e.src.charCodeAt(i);if(t)return!1;if(95!==s&&42!==s)return!1;for(r=e.scanDelims(e.pos,42===s),n=0;n{"use strict";var r=n(43).normalizeReference,i=n(43).isSpace;e.exports=function(e,t){var n,s,o,a,u,c,l,h,p,d="",f=e.pos,m=e.posMax,g=e.pos,x=!0;if(91!==e.src.charCodeAt(e.pos))return!1;if(u=e.pos+1,(a=e.md.helpers.parseLinkLabel(e,e.pos,!0))<0)return!1;if((c=a+1)=m)return!1;for(g=c,(l=e.md.helpers.parseLinkDestination(e.src,c,e.posMax)).ok&&(d=e.md.normalizeLink(l.str),e.md.validateLink(d)?c=l.pos:d=""),g=c;c=m||41!==e.src.charCodeAt(c))&&(x=!0),c++}if(x){if(void 0===e.env.references)return!1;if(c=0?o=e.src.slice(g,c++):c=a+1):c=a+1,o||(o=e.src.slice(u,a)),!(h=e.env.references[r(o)]))return e.pos=f,!1;d=h.href,p=h.title}return t||(e.pos=u,e.posMax=a,e.push("link_open","a",1).attrs=n=[["href",d]],p&&n.push(["title",p]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=c,e.posMax=m,!0}},(e,t,n)=>{"use strict";var r=n(43).normalizeReference,i=n(43).isSpace;e.exports=function(e,t){var n,s,o,a,u,c,l,h,p,d,f,m,g,x="",y=e.pos,D=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(c=e.pos+2,(u=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((l=u+1)=D)return!1;for(g=l,(p=e.md.helpers.parseLinkDestination(e.src,l,e.posMax)).ok&&(x=e.md.normalizeLink(p.str),e.md.validateLink(x)?l=p.pos:x=""),g=l;l=D||41!==e.src.charCodeAt(l))return e.pos=y,!1;l++}else{if(void 0===e.env.references)return!1;if(l=0?a=e.src.slice(g,l++):l=u+1):l=u+1,a||(a=e.src.slice(c,u)),!(h=e.env.references[r(a)]))return e.pos=y,!1;x=h.href,d=h.title}return t||(o=e.src.slice(c,u),e.md.inline.parse(o,e.md,e.env,m=[]),(f=e.push("image","img",0)).attrs=n=[["src",x],["alt",""]],f.children=m,f.content=o,d&&n.push(["title",d])),e.pos=l,e.posMax=D,!0}},e=>{"use strict";var t=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,n=/^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;e.exports=function(e,r){var i,s,o,a,u,c,l=e.pos;return!(60!==e.src.charCodeAt(l)||(i=e.src.slice(l)).indexOf(">")<0||(n.test(i)?(a=(s=i.match(n))[0].slice(1,-1),u=e.md.normalizeLink(a),!e.md.validateLink(u)||(r||((c=e.push("link_open","a",1)).attrs=[["href",u]],c.markup="autolink",c.info="auto",(c=e.push("text","",0)).content=e.md.normalizeLinkText(a),(c=e.push("link_close","a",-1)).markup="autolink",c.info="auto"),e.pos+=s[0].length,0)):!t.test(i)||(a=(o=i.match(t))[0].slice(1,-1),u=e.md.normalizeLink("mailto:"+a),!e.md.validateLink(u)||(r||((c=e.push("link_open","a",1)).attrs=[["href",u]],c.markup="autolink",c.info="auto",(c=e.push("text","",0)).content=e.md.normalizeLinkText(a),(c=e.push("link_close","a",-1)).markup="autolink",c.info="auto"),e.pos+=o[0].length,0))))}},(e,t,n)=>{"use strict";var r=n(84).HTML_TAG_RE;e.exports=function(e,t){var n,i,s,o=e.pos;return!(!e.md.options.html||(s=e.posMax,60!==e.src.charCodeAt(o)||o+2>=s||33!==(n=e.src.charCodeAt(o+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n)||!(i=e.src.slice(o).match(r))||(t||(e.push("html_inline","",0).content=e.src.slice(o,o+i[0].length)),e.pos+=i[0].length,0)))}},(e,t,n)=>{"use strict";var r=n(44),i=n(43).has,s=n(43).isValidEntityCode,o=n(43).fromCodePoint,a=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,u=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(e,t){var n,c,l=e.pos,h=e.posMax;if(38!==e.src.charCodeAt(l))return!1;if(l+1{"use strict";function t(e,t){var n,r,i,s,o,a,u,c,l={},h=t.length;for(n=0;no;r-=s.jump+1)if((s=t[r]).marker===i.marker&&(-1===a&&(a=r),s.open&&s.end<0&&(u=!1,(s.close||i.open)&&(s.length+i.length)%3==0&&(s.length%3==0&&i.length%3==0||(u=!0)),!u))){c=r>0&&!t[r-1].open?t[r-1].jump+1:0,i.jump=n-r+c,i.open=!1,s.end=n,s.jump=c,s.close=!1,a=-1;break}-1!==a&&(l[i.marker][(i.length||0)%3]=a)}}e.exports=function(e){var n,r=e.tokens_meta,i=e.tokens_meta.length;for(t(0,e.delimiters),n=0;n{"use strict";e.exports=function(e){var t,n,r=0,i=e.tokens,s=e.tokens.length;for(t=n=0;t0&&r++,"text"===i[t].type&&t+1{"use strict";var r=n(71),i=n(43).isWhiteSpace,s=n(43).isPunctChar,o=n(43).isMdAsciiPunct;function a(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[]}a.prototype.pushPending=function(){var e=new r("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},a.prototype.push=function(e,t,n){this.pending&&this.pushPending();var i=new r(e,t,n),s=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(s),i},a.prototype.scanDelims=function(e,t){var n,r,a,u,c,l,h,p,d,f=e,m=!0,g=!0,x=this.posMax,y=this.src.charCodeAt(e);for(n=e>0?this.src.charCodeAt(e-1):32;f{"use strict";function r(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){t&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e}function i(e){return Object.prototype.toString.call(e)}function s(e){return"[object Function]"===i(e)}function o(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var a={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1},u={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},c="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function l(e){var t=e.re=n(103)(e.__opts__),r=e.__tlds__.slice();function a(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||r.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),r.push(t.src_xn),t.src_tlds=r.join("|"),t.email_fuzzy=RegExp(a(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(a(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(a(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(a(t.tpl_host_fuzzy_test),"i");var u=[];function c(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,"[object Object]"===i(n))return"[object RegExp]"!==i(n.validate)?s(n.validate)?r.validate=n.validate:c(t,n):r.validate=function(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}(n.validate),void(s(n.normalize)?r.normalize=n.normalize:n.normalize?c(t,n):r.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===i(e)}(n)?c(t,n):u.push(t)}})),u.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var l=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(o).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+l+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+l+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function h(e,t){var n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function p(e,t){var n=new h(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function d(e,t){if(!(this instanceof d))return new d(e,t);var n;t||(n=e,Object.keys(n||{}).reduce((function(e,t){return e||a.hasOwnProperty(t)}),!1)&&(t=e,e={})),this.__opts__=r({},a,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},u,e),this.__compiled__={},this.__tlds__=c,this.__tlds_replaced__=!1,this.re={},l(this)}d.prototype.add=function(e,t){return this.__schemas__[e]=t,l(this),this},d.prototype.set=function(e){return this.__opts__=r(this.__opts__,e),this},d.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,r,i,s,o,a,u;if(this.re.schema_test.test(e))for((a=this.re.schema_search).lastIndex=0;null!==(t=a.exec(e));)if(i=this.testSchemaAt(e,t[2],a.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||u=0&&null!==(r=e.match(this.re.email_fuzzy))&&(s=r.index+r[1].length,o=r.index+r[0].length,(this.__index__<0||sthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=o)),this.__index__>=0},d.prototype.pretest=function(e){return this.re.pretest.test(e)},d.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},d.prototype.match=function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(p(this,t)),t=this.__last_index__);for(var r=t?e.slice(t):e;this.test(r);)n.push(p(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},d.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),l(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,l(this),this)},d.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},d.prototype.onCompile=function(){},e.exports=d},(e,t,n)=>{"use strict";e.exports=function(e){var t={};return t.src_Any=n(53).source,t.src_Cc=n(54).source,t.src_Z=n(56).source,t.src_P=n(46).source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|"),t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+t.src_ZCc+").|\\!+(?!"+t.src_ZCc+"|[!]).|\\?(?!"+t.src_ZCc+"|[?]).)+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}},e=>{"use strict";e.exports=require("punycode")},e=>{"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},e=>{"use strict";e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},e=>{"use strict";e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},(e,t,n)=>{"use strict";const r=n(38).URL,i=n(109),s=i.homepage,o=i.version,a=[n(110),n(113),n(114),n(115),n(117),n(118),n(119),n(120),n(121),n(122),n(123),n(124),n(125),n(126),n(127),n(128),n(129),n(130),n(131),n(132),n(133),n(134),n(135),n(136),n(137),n(138),n(139),n(140),n(141),n(142),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(154),n(155),n(156)];a.forEach((e=>{const t=e.names[0].toLowerCase();e.information=new r(`${s}/blob/v${o}/doc/Rules.md#${t}`)})),e.exports=a},e=>{"use strict";e.exports=JSON.parse('{"name":"markdownlint","version":"0.22.0","description":"A Node.js style checker and lint tool for Markdown/CommonMark files.","main":"lib/markdownlint.js","types":"lib/markdownlint.d.ts","author":"David Anson (https://dlaa.me/)","license":"MIT","homepage":"https://github.com/DavidAnson/markdownlint","repository":{"type":"git","url":"https://github.com/DavidAnson/markdownlint.git"},"bugs":"https://github.com/DavidAnson/markdownlint/issues","scripts":{"test":"tape test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js","test-cover":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 tape test/markdownlint-test.js test/markdownlint-test-custom-rules.js test/markdownlint-test-helpers.js test/markdownlint-test-result-object.js test/markdownlint-test-scenarios.js","test-declaration":"cd example/typescript && tsc && node type-check.js","test-extra":"node test/markdownlint-test-extra.js","lint":"eslint --max-warnings 0 lib helpers test schema && eslint --env browser --global markdownit --global markdownlint --rule \\"no-unused-vars: 0, no-extend-native: 0, max-statements: 0, no-console: 0, no-var: 0, unicorn/prefer-add-event-listener: 0, unicorn/prefer-query-selector: 0, unicorn/prefer-replace-all: 0\\" demo && eslint --rule \\"no-console: 0, no-invalid-this: 0, no-shadow: 0, object-property-newline: 0, node/no-missing-require: 0, node/no-extraneous-require: 0\\" example","ci":"npm run test-cover && npm run lint && npm run test-declaration","build-config-schema":"node schema/build-config-schema.js","build-declaration":"tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && rimraf \'lib/{c,md,r}*.d.ts\' \'helpers/*.d.ts\'","build-demo":"cpy node_modules/markdown-it/dist/markdown-it.min.js demo && cd demo && rimraf markdownlint-browser.* && cpy file-header.js . --rename=markdownlint-browser.js && tsc --allowJs --resolveJsonModule --outDir ../lib-es3 ../lib/markdownlint.js && cpy ../helpers/package.json ../lib-es3/helpers && browserify ../lib-es3/lib/markdownlint.js --standalone markdownlint >> markdownlint-browser.js && browserify ../lib-es3/helpers/helpers.js --standalone helpers >> markdownlint-rule-helpers-browser.js && uglifyjs markdownlint-browser.js markdownlint-rule-helpers-browser.js --compress --mangle --comments --output markdownlint-browser.min.js","build-example":"npm install --no-save --ignore-scripts grunt grunt-cli gulp through2","example":"cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint","clone-test-repos":"make-dir test-repos && cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet","clone-test-repos-large":"npm run clone-test-repos && cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet","lint-test-repos":"node test/markdownlint-test-repos.js","clean-test-repos":"rimraf test-repos"},"engines":{"node":">=10"},"dependencies":{"markdown-it":"12.0.2"},"devDependencies":{"@types/node":"~14.14.9","browserify":"~17.0.0","c8":"~7.3.5","cpy-cli":"~3.1.1","eslint":"~7.14.0","eslint-plugin-jsdoc":"~30.7.8","eslint-plugin-node":"~11.1.0","eslint-plugin-unicorn":"~23.0.0","globby":"~11.0.1","js-yaml":"~3.14.0","make-dir-cli":"~2.0.0","markdown-it-for-inline":"~0.1.1","markdown-it-sub":"~1.0.0","markdown-it-sup":"~1.0.0","markdown-it-texmath":"~0.8.0","markdownlint-rule-helpers":"~0.12.0","rimraf":"~3.0.2","strip-json-comments":"~3.1.1","tape":"~5.0.1","tape-player":"~0.1.1","toml":"~3.0.0","tv4":"~1.3.0","typescript":"~4.1.2","uglify-js":"~3.12.0"},"keywords":["markdown","lint","md","CommonMark","markdownlint"],"browser":{"markdown-it":"../demo/markdown-it-stub.js"}}')},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,filterTokens:i}=n(111);e.exports={names:["MD001","heading-increment","header-increment"],description:"Heading levels should only increment by one level at a time",tags:["headings","headers"],function:function(e,t){let n=0;i(e,"heading_open",(function(e){const i=Number.parseInt(e.tag.slice(1),10);n&&i>n&&r(t,e.lineNumber,"h"+(n+1),"h"+i),n=i}))}}},(e,t,n)=>{"use strict";const r=n(112),i=/\r\n?|\n/g;e.exports.newLineRe=i,e.exports.frontMatterRe=/((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[^]*?^\}\s*$))(\r\n|\r|\n|$)/m;const s=//gi;e.exports.inlineCommentRe=s,e.exports.bareUrlRe=/(?:http|ftp)s?:\/\/[^\s\]"']*(?:\/|[^\s\]"'\W])/gi,e.exports.listItemMarkerRe=/^([\s>]*)(?:[*+-]|\d+[.)])\s+/,e.exports.orderedListItemMarkerRe=/^[\s>]*0*(\d+)[.)]/;const o=/[_*]/g,a=/\[(?:[^[\]]|\[[^\]]*\])*\](?:\(\S*\))?/g;e.exports.utf8Encoding="utf8";const u=".,;:!?。,;:!?";e.exports.allPunctuation=u,e.exports.allPunctuationNoQuestion=u.replace(/[??]/gu,""),e.exports.isNumber=function(e){return"number"==typeof e},e.exports.isString=function(e){return"string"==typeof e},e.exports.isEmptyString=function(e){return 0===e.length},e.exports.isObject=function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)};const c=/>|(?:)/g;e.exports.isBlankLine=function(e){return!e||!e.trim()||!e.replace(c,"").trim()},e.exports.numericSortAscending=function(e,t){return e-t},e.exports.includesSorted=function(e,t){let n=0,r=e.length-1;for(;n<=r;){const i=n+r>>1;if(e[i]t))return!0;r=i-1}}return!1};const l="\x3c!--",h="--\x3e";e.exports.clearHtmlCommentText=function(e){let t=0;for(;-1!==(t=e.indexOf(l,t));){const n=e.indexOf(h,t);if(-1===n)break;const r=e.slice(t+l.length,n);if(r.length>0&&">"!==r[0]&&"-"!==r[r.length-1]&&!r.includes("--")&&-1===e.slice(t,n+h.length).search(s)){const i=r.replace(/[^\r\n]/g," ").replace(/ ([\r\n])/g,"\\$1");e=e.slice(0,t+l.length)+i+e.slice(n)}t=n+h.length}return e},e.exports.escapeForRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")};const p=/\\./g;function d(e){const t=e.line.replace(/^[\s>]*(> |>)/,"");return t.length-t.trimLeft().length}function f(e,t,n){e.tokens.forEach((function(e){e.type===t&&n(e)}))}function m(e,t){let n=0,r=0,i=0;for(;i=0&&a>=0&&u===c?(t(e.substring(s,i-c),o,a,u),s=-1,a=-1):s>=0&&-1===a&&(u=c,o=n,a=r),c=0),"\n"===h?(n++,r=0):"\\"!==h||-1!==s&&-1!==a||"\n"===e[i+1]?r++:(i++,r+=2)}s>=0&&(i=s,n=o,r=a)}}function g(e,t,n,r,i,s){e({lineNumber:t,detail:n,context:r,range:i,fixInfo:s})}function x(e){let t=0,n=0,s=0;(e.match(i)||[]).forEach((e=>{switch(e){case"\r":t++;break;case"\n":n++;break;case"\r\n":s++}}));let o=null;return o=t||n||s?n>=s&&n>=t?"\n":s>=t?"\r\n":"\r":r.EOL,o}function y(e,t){return{lineNumber:e.lineNumber||t,editColumn:e.editColumn||1,deleteCount:e.deleteCount||0,insertText:e.insertText||""}}function D(e,t,n){const{editColumn:r,deleteCount:i,insertText:s}=y(t),o=r-1;return-1===i?null:e.slice(0,o)+s.replace(/\n/g,n||"\n")+e.slice(o+i)}e.exports.unescapeMarkdown=function(e,t){return e.replace(p,(e=>{const n=e[1];return"!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".includes(n)?t||n:e}))},e.exports.fencedCodeBlockStyleFor=function(e){switch(e[0]){case"~":return"tilde";default:return"backtick"}},e.exports.indentFor=d,e.exports.headingStyleFor=function(e){return e.map[1]-e.map[0]==1?/[^\\]#\s*$/.test(e.line)?"atx_closed":"atx":"setext"},e.exports.unorderedListStyleFor=function(e){switch(e.markup){case"-":return"dash";case"+":return"plus";default:return"asterisk"}},e.exports.filterTokens=f,e.exports.getLineMetadata=function(e){const t=e.lines.map((function(e,t){return[e,t,!1,0,!1,!1]}));return f(e,"fence",(function(e){t[e.map[0]][3]=1,t[e.map[1]-1][3]=-1;for(let n=e.map[0]+1;nr.test(e)))},e.exports.emphasisMarkersInContent=function(e){const{lines:t}=e,n=new Array(t.length);return f(e,"inline",(e=>{const{children:r,lineNumber:s,map:a}=e;r.some((e=>"code_inline"===e.type))&&m(t.slice(a[0],a[1]).join("\n"),((e,t,r,a)=>{e.split(i).forEach(((e,i)=>{let u=null;for(;u=o.exec(e);){const e=s-1+t+i,o=n[e]||[],c=i?0:r-1+a;o.push(c+u.index),n[e]=o}}))}))})),t.forEach(((e,t)=>{let r=null;for(;r=a.exec(e);){let e=null;for(;e=o.exec(r[0]);){const i=n[t]||[];i.push(r.index+e.index),n[t]=i}}})),n},e.exports.getPreferredLineEnding=x,e.exports.applyFix=D,e.exports.applyFixes=function(e,t){const n=x(e),r=e.split(i);let s=t.filter((e=>e.fixInfo)).map((e=>y(e.fixInfo,e.lineNumber)));s.sort(((e,t)=>{const n=-1===e.deleteCount,r=-1===t.deleteCount;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length}));let o={};s=s.filter((e=>{const t=e.lineNumber!==o.lineNumber||e.editColumn!==o.editColumn||e.deleteCount!==o.deleteCount||e.insertText!==o.insertText;return o=e,t})),o={},s.forEach((e=>{e.lineNumber===o.lineNumber&&e.editColumn===o.editColumn&&!e.insertText&&e.deleteCount>0&&o.insertText&&!o.deleteCount&&(e.insertText=o.insertText,o.lineNumber=0),o=e})),s=s.filter((e=>e.lineNumber));let a=-1,u=-1;return s.forEach((e=>{const{lineNumber:t,editColumn:i,deleteCount:s}=e,o=t-1,c=i-1;(o!==a||c+snull!==e)).join(n)}},e=>{"use strict";e.exports=require("os")},(e,t,n)=>{"use strict";const{addErrorDetailIf:r}=n(111);e.exports={names:["MD002","first-heading-h1","first-header-h1"],description:"First heading should be a top level heading",tags:["headings","headers"],function:function(e,t){const n="h"+Number(e.config.level||1);e.tokens.every((function(e){return"heading_open"!==e.type||(r(t,e.lineNumber,n,e.tag),!1)}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,filterTokens:i,headingStyleFor:s}=n(111);e.exports={names:["MD003","heading-style","header-style"],description:"Heading style",tags:["headings","headers"],function:function(e,t){let n=String(e.config.style||"consistent");i(e,"heading_open",(function(e){const i=s(e);if("consistent"===n&&(n=i),i!==n){const s=/h[12]/.test(e.tag),o="setext_with_atx_closed"===n&&(s&&"setext"===i||!s&&"atx_closed"===i);if(!("setext_with_atx"===n&&(s&&"setext"===i||!s&&"atx"===i)||o)){let o=n;"setext_with_atx"===n?o=s?"setext":"atx":"setext_with_atx_closed"===n&&(o=s?"setext":"atx_closed"),r(t,e.lineNumber,o,i)}}}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,listItemMarkerRe:i,rangeFromRegExp:s,unorderedListStyleFor:o}=n(111),{flattenedLists:a}=n(116);e.exports={names:["MD004","ul-style"],description:"Unordered list style",tags:["bullet","ul"],function:function(e,t){const n=String(e.config.style||"consistent");let u=n;const c=[];a().forEach((e=>{e.unordered&&("consistent"===u&&(u=o(e.items[0])),e.items.forEach((a=>{const l=o(a);if("sublist"===n){const n=e.nesting;c[n]||l===c[n-1]?r(t,a.lineNumber,c[n],l,null,null,s(a.line,i)):c[n]=l}else r(t,a.lineNumber,u,l,null,null,s(a.line,i))})))}))}}},e=>{"use strict";let t=null;e.exports.lineMetadata=e=>(e&&(t=e),t);let n=null;e.exports.flattenedLists=e=>(e&&(n=e),n),e.exports.clear=()=>{t=null,n=null}},(e,t,n)=>{"use strict";const{addError:r,addErrorDetailIf:i,indentFor:s,listItemMarkerRe:o,orderedListItemMarkerRe:a,rangeFromRegExp:u}=n(111),{flattenedLists:c}=n(116);e.exports={names:["MD005","list-indent"],description:"Inconsistent indentation for list items at the same level",tags:["bullet","ul","indentation"],function:function(e,t){c().forEach((e=>{const n=e.indent;let c=0,l=-1,h=!1;e.items.forEach((p=>{const{line:d,lineNumber:f}=p,m=s(p);let g=null;if(e.unordered)i(t,f,n,m,null,null,u(d,o));else if(g=a.exec(d)){l=g[0].length,c=c||l;const e=g[1].length+1;if(n!==m||h)if(c===l)h=!0;else{const i=h?c-e:n,s=h?l-e:m;r(t,f,h?`Expected: (${c}); Actual: (${l})`:`Expected: ${n}; Actual: ${m}`,null,u(d,o),{editColumn:Math.min(s,i)+1,deleteCount:Math.max(s-i,0),insertText:"".padEnd(Math.max(i-s,0))})}}}))}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,listItemMarkerRe:i,rangeFromRegExp:s}=n(111),{flattenedLists:o}=n(116);e.exports={names:["MD006","ul-start-left"],description:"Consider starting bulleted lists at the beginning of the line",tags:["bullet","ul","indentation"],function:function(e,t){o().forEach((e=>{e.unordered&&!e.nesting&&0!==e.indent&&e.items.forEach((n=>{const{lineNumber:o,line:a}=n;r(t,o,0,e.indent,null,null,s(a,i),{deleteCount:a.length-a.trimLeft().length})}))}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,indentFor:i,listItemMarkerRe:s}=n(111),{flattenedLists:o}=n(116);e.exports={names:["MD007","ul-indent"],description:"Unordered list indentation",tags:["bullet","ul","indentation"],function:function(e,t){const n=Number(e.config.indent||2),a=!!e.config.start_indented;o().forEach((e=>{e.unordered&&e.parentsUnordered&&e.items.forEach((o=>{const{lineNumber:u,line:c}=o,l=(e.nesting+(a?1:0))*n,h=i(o);let p=null,d=1;const f=c.match(s);f&&(p=[1,f[0].length],d+=f[1].length-h),r(t,u,l,h,null,null,p,{editColumn:d,deleteCount:h,insertText:"".padEnd(l)})}))}))}}},(e,t,n)=>{"use strict";const{addError:r,filterTokens:i,forEachInlineCodeSpan:s,forEachLine:o,includesSorted:a,newLineRe:u,numericSortAscending:c}=n(111),{lineMetadata:l}=n(116);e.exports={names:["MD009","no-trailing-spaces"],description:"Trailing spaces",tags:["whitespace"],function:function(e,t){let n=e.config.br_spaces;n=Number(void 0===n?2:n);const h=!!e.config.list_item_empty_lines,p=!!e.config.strict,d=[];h&&(i(e,"list_item_open",(e=>{for(let t=e.map[0];t{for(let t=e.map[0];t{if(t.children.some((e=>"code_inline"===e.type))){const n=e.lines.slice(t.map[0],t.map[1]);s(n.join("\n"),((e,n)=>{const r=e.split(u).length;for(let e=0;e{const s=n+1,o=e.length-e.trimRight().length;if(o&&!i&&!a(d,s)&&(g!==o||p&&(!a(f,s)||a(m,s)))){const n=e.length-o+1;r(t,s,"Expected: "+(0===g?"":"0 or ")+g+"; Actual: "+o,null,[n,o],{editColumn:n,deleteCount:o})}}))}}},(e,t,n)=>{"use strict";const{addError:r,forEachLine:i}=n(111),{lineMetadata:s}=n(116),o=/\t+/g;e.exports={names:["MD010","no-hard-tabs"],description:"Hard tabs",tags:["whitespace","hard_tab"],function:function(e,t){const n=e.config.code_blocks,a=void 0===n||!!n;i(s(),((e,n,i)=>{if(!i||a){let i=null;for(;null!==(i=o.exec(e));){const e=i.index+1,s=i[0].length;r(t,n+1,"Column: "+e,null,[e,s],{editColumn:e,deleteCount:s,insertText:"".padEnd(s)})}}}))}}},(e,t,n)=>{"use strict";const{addError:r,forEachInlineChild:i,unescapeMarkdown:s}=n(111),o=/\(([^)]+)\)\[([^\]^][^\]]*)]/g;e.exports={names:["MD011","no-reversed-links"],description:"Reversed link syntax",tags:["links"],function:function(e,t){i(e,"text",(n=>{const{lineNumber:i,content:a}=n;let u=null;for(;null!==(u=o.exec(a));){const[n,o,a]=u,c=e.lines[i-1],l=s(c).indexOf(n)+1,h=n.length;r(t,i,n,null,l?[l,h]:null,l?{editColumn:l,deleteCount:h,insertText:`[${o}](${a})`}:null)}}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,forEachLine:i}=n(111),{lineMetadata:s}=n(116);e.exports={names:["MD012","no-multiple-blanks"],description:"Multiple consecutive blank lines",tags:["whitespace","blank_lines"],function:function(e,t){const n=Number(e.config.maximum||1);let o=0;i(s(),((e,i,s)=>{o=s||e.trim().length>0?0:o+1,n{"use strict";const{addErrorDetailIf:r,filterTokens:i,forEachHeading:s,forEachLine:o,includesSorted:a}=n(111),{lineMetadata:u}=n(116),c="^.{",l=/^\s*\[.*[^\\]]:/,h=/^[es]*(lT?L|I)[ES]*$/,p=/^([#>\s]*\s)?\S*$/,d={em_open:"e",em_close:"E",image:"I",link_open:"l",link_close:"L",strong_open:"s",strong_close:"S",text:"T"};e.exports={names:["MD013","line-length"],description:"Line length",tags:["line_length"],function:function(e,t){const n=Number(e.config.line_length||80),f=Number(e.config.heading_line_length||n),m=Number(e.config.code_block_line_length||n),g=!!e.config.strict,x=!!e.config.stern,y=g||x?"}.+$":"}.*\\s.*$",D=new RegExp(c+n+y),C=new RegExp(c+f+y),v=new RegExp(c+m+y),E=e.config.code_blocks,k=void 0===E||!!E,b=e.config.tables,A=void 0===b||!!b;let w=e.config.headings;void 0===w&&(w=e.config.headers);const S=void 0===w||!!w,_=[];s(e,(e=>{_.push(e.lineNumber)}));const F=[];i(e,"inline",(e=>{let t="";e.children.forEach((e=>{"text"===e.type&&""===e.content||(t+=d[e.type]||"x")})),h.test(t)&&F.push(e.lineNumber)})),o(u(),((e,i,s,o,u)=>{const c=i+1,h=a(_,c),d=s?m:h?f:n,y=s?v:h?C:D;!k&&s||!A&&u||!S&&h||!g&&(x&&p.test(e)||a(F,c)||l.test(e))||!y.test(e)||r(t,c,d,e.length,null,null,[d+1,e.length-d])}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i}=n(111),s=/^(\s*)(\$\s+)/;e.exports={names:["MD014","commands-show-output"],description:"Dollar signs used before commands without showing output",tags:["code"],function:function(e,t){["code_block","fence"].forEach((n=>{i(e,n,(n=>{const i="fence"===n.type?1:0,o=[];let a=!0;for(let t=n.map[0]+i;t{const[n,i,s,o]=e;r(t,n+1,i,null,null,[s,o],{editColumn:s,deleteCount:o})}))}))}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,forEachLine:i}=n(111),{lineMetadata:s}=n(116);e.exports={names:["MD018","no-missing-space-atx"],description:"No space after hash on atx style heading",tags:["headings","headers","atx","spaces"],function:function(e,t){i(s(),((e,n,i)=>{if(!i&&/^#+[^#\s]/.test(e)&&!/#\s*$/.test(e)&&!e.startsWith("#️⃣")){const i=/^#+/.exec(e)[0].length;r(t,n+1,e.trim(),null,null,[1,i+1],{editColumn:i+1,insertText:" "})}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i,headingStyleFor:s}=n(111);e.exports={names:["MD019","no-multiple-space-atx"],description:"Multiple spaces after hash on atx style heading",tags:["headings","headers","atx","spaces"],function:function(e,t){i(e,"heading_open",(e=>{if("atx"===s(e)){const{line:n,lineNumber:i}=e,s=/^(#+)(\s{2,})(?:\S)/.exec(n);if(s){const[,{length:e},{length:o}]=s;r(t,i,n.trim(),null,null,[1,e+o+1],{editColumn:e+1,deleteCount:o-1})}}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,forEachLine:i}=n(111),{lineMetadata:s}=n(116);e.exports={names:["MD020","no-missing-space-closed-atx"],description:"No space inside hashes on closed atx style heading",tags:["headings","headers","atx_closed","spaces"],function:function(e,t){i(s(),((e,n,i)=>{if(!i){const i=/^(#+)(\s*)([^#]*?[^#\\])(\s*)((?:\\#)?)(#+)(\s*)$/.exec(e);if(i){const[,s,{length:o},a,{length:u},c,l,{length:h}]=i,p=s.length,d=l.length,f=!o,m=!u||c,g=c?c+" ":"";if(f||m){const i=f?[1,p+1]:[e.length-h-d,d+1];r(t,n+1,e.trim(),f,m,i,{editColumn:1,deleteCount:e.length,insertText:`${s} ${a} ${g}${l}`})}}}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i,headingStyleFor:s}=n(111);e.exports={names:["MD021","no-multiple-space-closed-atx"],description:"Multiple spaces inside hashes on closed atx style heading",tags:["headings","headers","atx_closed","spaces"],function:function(e,t){i(e,"heading_open",(e=>{if("atx_closed"===s(e)){const{line:n,lineNumber:i}=e,s=/^(#+)(\s+)([^#]+?)(\s+)(#+)(\s*)$/.exec(n);if(s){const[,e,{length:o},a,{length:u},c,{length:l}]=s,h=o>1,p=u>1;if(h||p){const s=n.length,d=e.length,f=c.length,m=h?[1,d+o+1]:[s-l-f-u,u+f+1];r(t,i,n.trim(),h,p,m,{editColumn:1,deleteCount:s,insertText:`${e} ${a} ${c}`})}}}}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,filterTokens:i,isBlankLine:s}=n(111);e.exports={names:["MD022","blanks-around-headings","blanks-around-headers"],description:"Headings should be surrounded by blank lines",tags:["headings","headers","blank_lines"],function:function(e,t){let n=e.config.lines_above;n=Number(void 0===n?1:n);let o=e.config.lines_below;o=Number(void 0===o?1:o);const{lines:a}=e;i(e,"heading_open",(e=>{const[i,u]=e.map;let c=0;for(let e=0;e{"use strict";const{addErrorContext:r,filterTokens:i}=n(111),s=/^((?:\s+)|(?:[>\s]+\s\s))[^>\s]/;e.exports={names:["MD023","heading-start-left","header-start-left"],description:"Headings must start at the beginning of the line",tags:["headings","headers","spaces"],function:function(e,t){i(e,"heading_open",(function(e){const{lineNumber:n,line:i}=e,o=i.match(s);if(o){const[e,s]=o;let a=s.length;const u=s.trimRight().length;u&&(a-=u-1),r(t,n,i,null,null,[1,e.length],{editColumn:u+1,deleteCount:a})}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,forEachHeading:i}=n(111);e.exports={names:["MD024","no-duplicate-heading","no-duplicate-header"],description:"Multiple headings with the same content",tags:["headings","headers"],function:function(e,t){const n=!!e.config.siblings_only||!!e.config.allow_different_nesting||!1,s=[null,[]];let o=1,a=s[o];i(e,((e,i)=>{if(n){const t=e.tag.slice(1);for(;ot;)s[o]=[],o--;a=s[t]}a.includes(i)?r(t,e.lineNumber,e.line.trim()):a.push(i)}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i,frontMatterHasTitle:s}=n(111);e.exports={names:["MD025","single-title","single-h1"],description:"Multiple top level headings in the same document",tags:["headings","headers"],function:function(e,t){const n="h"+Number(e.config.level||1),o=s(e.frontMatterLines,e.config.front_matter_title);let a=!1;i(e,"heading_open",(function(e){e.tag===n&&(a||o?r(t,e.lineNumber,e.line.trim()):1===e.lineNumber&&(a=!0))}))}}},(e,t,n)=>{"use strict";const{addError:r,allPunctuationNoQuestion:i,escapeForRegExp:s,forEachHeading:o}=n(111),a=/&#?[0-9a-zA-Z]+;$/;e.exports={names:["MD026","no-trailing-punctuation"],description:"Trailing punctuation in heading",tags:["headings","headers"],function:function(e,t){let n=e.config.punctuation;n=String(void 0===n?i:n);const u=new RegExp("\\s*["+s(n)+"]+$");o(e,(e=>{const{line:n,lineNumber:i}=e,s=n.replace(/[\s#]*$/,""),o=u.exec(s);if(o&&!a.test(s)){const e=o[0],n=o.index+1,s=e.length;r(t,i,`Punctuation: '${e}'`,null,[n,s],{editColumn:n,deleteCount:s})}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,newLineRe:i}=n(111),s=/^((?:\s*>)+)(\s{2,})\S/;e.exports={names:["MD027","no-multiple-space-blockquote"],description:"Multiple spaces after blockquote symbol",tags:["blockquote","whitespace","indentation"],function:function(e,t){let n=0,o=0;e.tokens.forEach((a=>{const{content:u,lineNumber:c,type:l}=a;if("blockquote_open"===l)n++;else if("blockquote_close"===l)n--;else if("list_item_open"===l)o++;else if("list_item_close"===l)o--;else if("inline"===l&&n){const n=u.split(i).length;for(let i=0;i"!==e[e.length-1]||r(t,c+i,n,null,null,[1,e.length],{editColumn:s+1,deleteCount:u-1})}}}}))}}},(e,t,n)=>{"use strict";const{addError:r}=n(111);e.exports={names:["MD028","no-blanks-blockquote"],description:"Blank line inside blockquote",tags:["blockquote","whitespace"],function:function(e,t){let n={},i=null;e.tokens.forEach((function(e){if("blockquote_open"===e.type&&"blockquote_close"===n.type)for(let n=i;n{"use strict";const{addErrorDetailIf:r,listItemMarkerRe:i,orderedListItemMarkerRe:s,rangeFromRegExp:o}=n(111),{flattenedLists:a}=n(116),u={one:"1/1/1",ordered:"1/2/3",zero:"0/0/0"};e.exports={names:["MD029","ol-prefix"],description:"Ordered list item prefix",tags:["ol"],function:function(e,t){const n=String(e.config.style||"one_or_ordered");a().filter((e=>!e.unordered)).forEach((e=>{const{items:a}=e;let c=1,l=!1;if(a.length>=2){const e=s.exec(a[0].line),t=s.exec(a[1].line);if(e&&t){const[,n]=e,[,r]=t;"1"===r&&"0"!==n||(l=!0,"0"===n&&(c=0))}}let h=n;"one_or_ordered"===h&&(h=l?"ordered":"one"),"zero"===h?c=0:"one"===h&&(c=1),a.forEach((e=>{const n=s.exec(e.line);n&&(r(t,e.lineNumber,String(c),n[1],"Style: "+u[h],null,o(e.line,i)),"ordered"===h&&c++)}))}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r}=n(111),{flattenedLists:i}=n(116);e.exports={names:["MD030","list-marker-space"],description:"Spaces after list markers",tags:["ol","ul","whitespace"],function:function(e,t){const n=Number(e.config.ul_single||1),s=Number(e.config.ol_single||1),o=Number(e.config.ul_multi||1),a=Number(e.config.ol_multi||1);i().forEach((e=>{const i=e.lastLineIndex-e.open.map[0]===e.items.length,u=e.unordered?i?n:o:i?s:a;e.items.forEach((e=>{const{line:n,lineNumber:i}=e,s=/^[\s>]*\S+(\s*)/.exec(n),[{length:o},{length:a}]=s;if(o{"use strict";const{addErrorContext:r,forEachLine:i,isBlankLine:s}=n(111),{lineMetadata:o}=n(116),a=/^(.*?)\s*[`~]/;e.exports={names:["MD031","blanks-around-fences"],description:"Fenced code blocks should be surrounded by blank lines",tags:["code","blank_lines"],function:function(e,t){const n=e.config.list_items,u=void 0===n||!!n,{lines:c}=e;i(o(),((e,n,i,o,l,h)=>{const p=o>0,d=o<0;if((u||!h)&&(p&&!s(c[n-1])||d&&!s(c[n+1]))){const[,i]=e.match(a)||[],s=void 0===i?null:{lineNumber:n+(p?1:2),insertText:i+"\n"};r(t,n+1,c[n].trim(),null,null,null,s)}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,isBlankLine:i}=n(111),{flattenedLists:s}=n(116),o=/^[>\s]*/;e.exports={names:["MD032","blanks-around-lists"],description:"Lists should be surrounded by blank lines",tags:["bullet","ul","ol","blank_lines"],function:function(e,t){const{lines:n}=e;s().filter((e=>!e.nesting)).forEach((e=>{const s=e.open.map[0];if(!i(n[s-1])){const e=n[s],i=e.match(o)[0].trimRight();r(t,s+1,e.trim(),null,null,null,{insertText:i+"\n"})}const a=e.lastLineIndex-1;if(!i(n[a+1])){const e=n[a],i=e.match(o)[0].trimRight();r(t,a+1,e.trim(),null,null,null,{lineNumber:a+2,insertText:i+"\n"})}}))}}},(e,t,n)=>{"use strict";const{addError:r,forEachLine:i,unescapeMarkdown:s}=n(111),{lineMetadata:o}=n(116),a=/<(([A-Za-z][A-Za-z0-9-]*)(?:\s[^>]*)?)\/?>/g,u=/]\(\s*$/,c=/^[^`]*(`+[^`]+`+[^`]+)*`+[^`]*$/,l=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;e.exports={names:["MD033","no-inline-html"],description:"Inline HTML",tags:["html"],function:function(e,t){let n=e.config.allowed_elements;n=Array.isArray(n)?n:[],n=n.map((e=>e.toLowerCase())),i(o(),((e,i,o)=>{let h=null;for(;!o&&null!==(h=a.exec(e));){const[o,a,p]=h;if(!n.includes(p.toLowerCase())&&!o.endsWith("\\>")&&!l.test(a)){const n=e.substring(0,h.index);if(!u.test(n)&&!c.test(n)){const e=s(n+"<","_");!e.endsWith("_")&&(e+"`").match(/`/g).length%2&&r(t,i+1,"Element: "+p,null,[h.index+1,o.length])}}}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,bareUrlRe:i,filterTokens:s}=n(111);e.exports={names:["MD034","no-bare-urls"],description:"Bare URL used",tags:["links","url"],function:function(e,t){s(e,"inline",(e=>{let n=!1;e.children.forEach((e=>{const{content:s,line:o,lineNumber:a,type:u}=e;let c=null;if("link_open"===u)n=!0;else if("link_close"===u)n=!1;else if("text"===u&&!n)for(;null!==(c=i.exec(s));){const[e]=c,n=c.index,i=e.length,u=s[n-1],l=s[n+i];if(!("["===u&&"]"===l||'"'===u&&'"'===l||"'"===u&&"'"===l)){const u=o.indexOf(s),c=-1===u?null:[u+n+1,i],l=c?{editColumn:c[0],deleteCount:c[1],insertText:`<${e}>`}:null;r(t,a,e,null,null,c,l)}}}))}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,filterTokens:i}=n(111);e.exports={names:["MD035","hr-style"],description:"Horizontal rule style",tags:["hr"],function:function(e,t){let n=String(e.config.style||"consistent");i(e,"hr",(function(e){const i=e.line.trim();"consistent"===n&&(n=i),r(t,e.lineNumber,n,i)}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,allPunctuation:i}=n(111);e.exports={names:["MD036","no-emphasis-as-heading","no-emphasis-as-header"],description:"Emphasis used instead of a heading",tags:["headings","headers","emphasis"],function:function(e,t){let n=e.config.punctuation;n=String(void 0===n?i:n);const s=new RegExp("["+n+"]$");let o=function e(n){return"paragraph_open"===n.type?function(n){const i=n.children.filter((function(e){return"text"!==e.type||""!==e.content}));return 3!==i.length||"strong_open"!==i[0].type&&"em_open"!==i[0].type||"text"!==i[1].type||s.test(i[1].content)||r(t,n.lineNumber,i[1].content),e}:"blockquote_open"===n.type?function t(n){return"blockquote_close"!==n.type?t:e}:"list_item_open"===n.type?function t(n){return"list_item_close"!==n.type?t:e}:e};e.tokens.forEach((function(e){o=o(e)}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,emphasisMarkersInContent:i,forEachLine:s,isBlankLine:o}=n(111),{lineMetadata:a}=n(116),u=/(^|[^\\]|\\\\)(?:(\*\*?\*?)|(__?_?))/g,c=/^([\s>]*)\*(\s+)/,l=/^\s+/,h=/\s+$/;e.exports={names:["MD037","no-space-in-emphasis"],description:"Spaces inside emphasis markers",tags:["whitespace","emphasis"],function:function(e,t){let n,p,d,f,m=null;function g(){p=-1,f=0,d="",n=0,m=null}function x(e,n,r,i,s){let o=e.substring(p,s);f||(o=o.trimLeft()),i||(o=o.trimRight());const a=l.test(o),u=h.test(o);if(a||u){const c=p-f,l=s+r,h=e.substring(c,l),d=c+1,m=l-c,g=e.substring(c,p),x=i?i[2]||i[3]:"",y=`${g}${o.trim()}${x}`;return[t,n+1,h,a,u,[d,m],{editColumn:d,deleteCount:m,insertText:y}]}return null}const y=i(e);g(),s(a(),((e,t,i,s,a,l,h)=>{const D=1===l;if((i||a||h||D||o(e))&&g(),i||h)return;D&&(e=e.replace(c,"$1 $2"));let C=null;for(;C=u.exec(e);){const i=y[t]||[],s=C.index+C[1].length;if(i.includes(s))continue;const o=C[0].length-C[1].length,a=(C[2]||C[3])[0];if(-1===p)p=s+o,f=o,d=a,n=o;else if(a===d){if(o===n){m&&(r(...m),m=null);const i=x(e,t,n,C,s);i&&r(...i),g()}else 3===o?n=o-n:3===n?n-=o:n+=o;u.lastIndex>1&&u.lastIndex--}else u.lastIndex>1&&u.lastIndex--}-1!==p&&(m=m||x(e,t,0,null,e.length),p=0,f=0)}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i,forEachInlineCodeSpan:s,newLineRe:o}=n(111),a=/^\s([^`]|$)/,u=/[^`]\s$/,c=/^\s(?:\S.*\S|\S)\s$/;e.exports={names:["MD038","no-space-in-code"],description:"Spaces inside code span elements",tags:["whitespace","code"],function:function(e,t){i(e,"inline",(n=>{if(n.children.some((e=>"code_inline"===e.type))){const i=e.lines.slice(n.map[0],n.map[1]);s(i.join("\n"),((e,s,l,h)=>{let p=l-h,d=e.length+2*h,f=0,m=l,g=e.length;const x=e.split(o),y=a.test(e),D=!y&&u.test(e);D&&x.length>1&&(p=0,f=x.length-1,m=0);const C=c.test(e);if((y||D)&&!C){const e=x[f];x.length>1&&(d=e.length+h,g=e.length);const o=i[s+f].substring(p,p+d),a=e.trim(),u=(a.startsWith("`")?" ":"")+a+(a.endsWith("`")?" ":"");r(t,n.lineNumber+s+f,o,y,D,[p+1,d],{editColumn:m+1,deleteCount:g,insertText:u})}}))}}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i}=n(111),s=/\[(?:\s+(?:[^\]]*?)\s*|(?:[^\]]*?)\s+)](?=\(\S*\))/;e.exports={names:["MD039","no-space-in-links"],description:"Spaces inside link text",tags:["whitespace","links"],function:function(e,t){i(e,"inline",(n=>{const{children:i}=n;let{lineNumber:o}=n,a=!1,u="",c=0;i.forEach((n=>{const{content:i,type:l}=n;if("link_open"===l)a=!0,u="";else if("link_close"===l){a=!1;const n=u.trimLeft().length!==u.length,i=u.trimRight().length!==u.length;if(n||i){let a=null,l=null;const h=e.lines[o-1].slice(c).match(s);if(h){const e=h.index+c+1,t=h[0].length;a=[e,t],l={editColumn:e+1,deleteCount:t-2,insertText:u.trim()},c=e+t-1}r(t,o,`[${u}]`,n,i,a,l)}}else"softbreak"===l||"hardbreak"===l?(o++,c=0):a&&(u+=i)}))}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i}=n(111);e.exports={names:["MD040","fenced-code-language"],description:"Fenced code blocks should have a language specified",tags:["code","language"],function:function(e,t){i(e,"fence",(function(e){e.info.trim()||r(t,e.lineNumber,e.line)}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,frontMatterHasTitle:i}=n(111);e.exports={names:["MD041","first-line-heading","first-line-h1"],description:"First line in file should be a top level heading",tags:["headings","headers"],function:function(e,t){const n="h"+Number(e.config.level||1);i(e.frontMatterLines,e.config.front_matter_title)||e.tokens.every((e=>"html_block"===e.type||("heading_open"===e.type&&e.tag===n||r(t,e.lineNumber,e.line),!1)))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,filterTokens:i,rangeFromRegExp:s}=n(111),o=/\[[^\]]*](?:\((?:#?|(?:<>))\))/;e.exports={names:["MD042","no-empty-links"],description:"No empty links",tags:["links"],function:function(e,t){i(e,"inline",(function(e){let n=!1,i="",a=!1;e.children.forEach((function(e){"link_open"===e.type?(n=!0,i="",e.attrs.forEach((function(e){"href"!==e[0]||e[1]&&"#"!==e[1]||(a=!0)}))):"link_close"===e.type?(n=!1,a&&(r(t,e.lineNumber,"["+i+"]()",null,null,s(e.line,o)),a=!1)):n&&(i+=e.content)}))}))}}},(e,t,n)=>{"use strict";const{addErrorContext:r,addErrorDetailIf:i,forEachHeading:s}=n(111);e.exports={names:["MD043","required-headings","required-headers"],description:"Required heading structure",tags:["headings","headers"],function:function(e,t){const n=e.config.headings||e.config.headers;if(Array.isArray(n)){const o={};[1,2,3,4,5,6].forEach((e=>{o["h"+e]="######".substr(-e)}));let a=0,u=!1,c=!1,l=!1;const h=()=>n[a++]||"[None]";s(e,((e,n)=>{if(!c){l=!0;const r=o[e.tag]+" "+n;let s=h();"*"===s?(u=!0,s=h()):"+"===s?u=!0:s.toLowerCase()===r.toLowerCase()?u=!1:u?a--:(i(t,e.lineNumber,s,r),c=!0)}})),!c&&a"*"===e)))&&r(t,e.lines.length,n[a])}}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,bareUrlRe:i,escapeForRegExp:s,filterTokens:o,forEachInlineChild:a,newLineRe:u}=n(111),c=/^\W/,l=/\W$/;e.exports={names:["MD044","proper-names"],description:"Proper names should have the correct capitalization",tags:["spelling"],function:function(e,t){let n=e.config.names;n=Array.isArray(n)?n:[];const h=e.config.code_blocks,p=void 0===h||!!h,d=new Set;o(e,"inline",(e=>{let t=!1;e.children.forEach((e=>{const{info:n,type:r}=e;"link_open"===r&&"auto"===n?t=!0:"link_close"===r?t=!1:"text"===r&&t&&d.add(e)}))})),n.forEach((h=>{const f=s(h),m=c.test(h)?"":"\\S*\\b",g=l.test(h)?"":"\\b\\S*",x=new RegExp(`(${m})(${f})(${g})`,"gi");function y(s){if(!d.has(s)){const o="fence"===s.type?1:0;s.content.split(u).forEach(((a,u)=>{let c=null;for(;null!==(c=x.exec(a));){const[a,l,p,d]=c;if(-1===a.search(i)){const i=a.replace(new RegExp(`^\\W{0,${l.length}}`),"").replace(new RegExp(`\\W{0,${d.length}}$`),"");if(!n.includes(i)){const n=s.lineNumber+u+o,a=e.lines[n-1],c=i.length,l=a.indexOf(i);r(t,n,h,p,null,null,-1===l?null:[l+1,c],-1===l?null:{editColumn:l+1,deleteCount:c,insertText:h})}}}}))}}a(e,"text",y),p&&(a(e,"code_inline",y),o(e,"code_block",y),o(e,"fence",y))}))}}},(e,t,n)=>{"use strict";const{addError:r,forEachInlineChild:i}=n(111);e.exports={names:["MD045","no-alt-text"],description:"Images should have alternate text (alt text)",tags:["accessibility","images"],function:function(e,t){i(e,"image",(function(e){""===e.content&&r(t,e.lineNumber)}))}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r}=n(111),i={fence:"fenced",code_block:"indented"};e.exports={names:["MD046","code-block-style"],description:"Code block style",tags:["code"],function:function(e,t){let n=String(e.config.style||"consistent");e.tokens.filter((e=>"code_block"===e.type||"fence"===e.type)).forEach((e=>{const{lineNumber:s,type:o}=e;"consistent"===n&&(n=i[o]),r(t,s,n,i[o])}))}}},(e,t,n)=>{"use strict";const{addError:r,isBlankLine:i}=n(111);e.exports={names:["MD047","single-trailing-newline"],description:"Files should end with a single newline character",tags:["blank_lines"],function:function(e,t){const n=e.lines.length,s=e.lines[n-1];i(s)||r(t,n,null,null,[s.length,1],{insertText:"\n",editColumn:s.length+1})}}},(e,t,n)=>{"use strict";const{addErrorDetailIf:r,fencedCodeBlockStyleFor:i}=n(111);e.exports={names:["MD048","code-fence-style"],description:"Code fence style",tags:["code"],function:function(e,t){let n=String(e.config.style||"consistent");e.tokens.filter((e=>"fence"===e.type)).forEach((e=>{const{lineNumber:s,markup:o}=e;"consistent"===n&&(n=i(o)),r(t,s,n,i(o))}))}}},e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=157,e.exports=t},(e,t,n)=>{"use strict";const r=n(112),i=/\r\n?|\n/g;e.exports.newLineRe=i,e.exports.frontMatterRe=/((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[^]*?^\}\s*$))(\r\n|\r|\n|$)/m;const s=//gi;e.exports.inlineCommentRe=s,e.exports.bareUrlRe=/(?:http|ftp)s?:\/\/[^\s\]"']*(?:\/|[^\s\]"'\W])/gi,e.exports.listItemMarkerRe=/^([\s>]*)(?:[*+-]|\d+[.)])\s+/,e.exports.orderedListItemMarkerRe=/^[\s>]*0*(\d+)[.)]/;const o=/[_*]/g,a=/\[(?:[^[\]]|\[[^\]]*\])*\](?:\(\S*\))?/g;e.exports.utf8Encoding="utf8";const u=".,;:!?。,;:!?";e.exports.allPunctuation=u,e.exports.allPunctuationNoQuestion=u.replace(/[??]/gu,""),e.exports.isNumber=function(e){return"number"==typeof e},e.exports.isString=function(e){return"string"==typeof e},e.exports.isEmptyString=function(e){return 0===e.length},e.exports.isObject=function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)};const c=/>|(?:)/g;e.exports.isBlankLine=function(e){return!e||!e.trim()||!e.replace(c,"").trim()},e.exports.numericSortAscending=function(e,t){return e-t},e.exports.includesSorted=function(e,t){let n=0,r=e.length-1;for(;n<=r;){const i=n+r>>1;if(e[i]t))return!0;r=i-1}}return!1};const l="\x3c!--",h="--\x3e";e.exports.clearHtmlCommentText=function(e){let t=0;for(;-1!==(t=e.indexOf(l,t));){const n=e.indexOf(h,t);if(-1===n)break;const r=e.slice(t+l.length,n);if(r.length>0&&">"!==r[0]&&"-"!==r[r.length-1]&&!r.includes("--")&&-1===e.slice(t,n+h.length).search(s)){const i=r.replace(/[^\r\n]/g," ").replace(/ ([\r\n])/g,"\\$1");e=e.slice(0,t+l.length)+i+e.slice(n)}t=n+h.length}return e},e.exports.escapeForRegExp=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")};const p=/\\./g;function d(e){const t=e.line.replace(/^[\s>]*(> |>)/,"");return t.length-t.trimLeft().length}function f(e,t,n){e.tokens.forEach((function(e){e.type===t&&n(e)}))}function m(e,t){let n=0,r=0,i=0;for(;i=0&&a>=0&&u===c?(t(e.substring(s,i-c),o,a,u),s=-1,a=-1):s>=0&&-1===a&&(u=c,o=n,a=r),c=0),"\n"===h?(n++,r=0):"\\"!==h||-1!==s&&-1!==a||"\n"===e[i+1]?r++:(i++,r+=2)}s>=0&&(i=s,n=o,r=a)}}function g(e,t,n,r,i,s){e({lineNumber:t,detail:n,context:r,range:i,fixInfo:s})}function x(e){let t=0,n=0,s=0;(e.match(i)||[]).forEach((e=>{switch(e){case"\r":t++;break;case"\n":n++;break;case"\r\n":s++}}));let o=null;return o=t||n||s?n>=s&&n>=t?"\n":s>=t?"\r\n":"\r":r.EOL,o}function y(e,t){return{lineNumber:e.lineNumber||t,editColumn:e.editColumn||1,deleteCount:e.deleteCount||0,insertText:e.insertText||""}}function D(e,t,n){const{editColumn:r,deleteCount:i,insertText:s}=y(t),o=r-1;return-1===i?null:e.slice(0,o)+s.replace(/\n/g,n||"\n")+e.slice(o+i)}e.exports.unescapeMarkdown=function(e,t){return e.replace(p,(e=>{const n=e[1];return"!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~".includes(n)?t||n:e}))},e.exports.fencedCodeBlockStyleFor=function(e){switch(e[0]){case"~":return"tilde";default:return"backtick"}},e.exports.indentFor=d,e.exports.headingStyleFor=function(e){return e.map[1]-e.map[0]==1?/[^\\]#\s*$/.test(e.line)?"atx_closed":"atx":"setext"},e.exports.unorderedListStyleFor=function(e){switch(e.markup){case"-":return"dash";case"+":return"plus";default:return"asterisk"}},e.exports.filterTokens=f,e.exports.getLineMetadata=function(e){const t=e.lines.map((function(e,t){return[e,t,!1,0,!1,!1]}));return f(e,"fence",(function(e){t[e.map[0]][3]=1,t[e.map[1]-1][3]=-1;for(let n=e.map[0]+1;nr.test(e)))},e.exports.emphasisMarkersInContent=function(e){const{lines:t}=e,n=new Array(t.length);return f(e,"inline",(e=>{const{children:r,lineNumber:s,map:a}=e;r.some((e=>"code_inline"===e.type))&&m(t.slice(a[0],a[1]).join("\n"),((e,t,r,a)=>{e.split(i).forEach(((e,i)=>{let u=null;for(;u=o.exec(e);){const e=s-1+t+i,o=n[e]||[],c=i?0:r-1+a;o.push(c+u.index),n[e]=o}}))}))})),t.forEach(((e,t)=>{let r=null;for(;r=a.exec(e);){let e=null;for(;e=o.exec(r[0]);){const i=n[t]||[];i.push(r.index+e.index),n[t]=i}}})),n},e.exports.getPreferredLineEnding=x,e.exports.applyFix=D,e.exports.applyFixes=function(e,t){const n=x(e),r=e.split(i);let s=t.filter((e=>e.fixInfo)).map((e=>y(e.fixInfo,e.lineNumber)));s.sort(((e,t)=>{const n=-1===e.deleteCount,r=-1===t.deleteCount;return t.lineNumber-e.lineNumber||(n?1:r?-1:0)||t.editColumn-e.editColumn||t.insertText.length-e.insertText.length}));let o={};s=s.filter((e=>{const t=e.lineNumber!==o.lineNumber||e.editColumn!==o.editColumn||e.deleteCount!==o.deleteCount||e.insertText!==o.insertText;return o=e,t})),o={},s.forEach((e=>{e.lineNumber===o.lineNumber&&e.editColumn===o.editColumn&&!e.insertText&&e.deleteCount>0&&o.insertText&&!o.deleteCount&&(e.insertText=o.insertText,o.lineNumber=0),o=e})),s=s.filter((e=>e.lineNumber));let a=-1,u=-1;return s.forEach((e=>{const{lineNumber:t,editColumn:i,deleteCount:s}=e,o=t-1,c=i-1;(o!==a||c+snull!==e)).join(n)}},(e,t,n)=>{var r=n(160),i=n(39).join,s=n(3),o="/etc",a="win32"===process.platform,u=a?process.env.USERPROFILE:process.env.HOME;e.exports=function(e,t,c,l){if("string"!=typeof e)throw new Error("rc(name): name *must* be string");c||(c=n(163)(process.argv.slice(2))),t=("string"==typeof t?r.json(t):t)||{},l=l||r.parse;var h=r.env(e+"_"),p=[t],d=[];function f(e){if(!(d.indexOf(e)>=0)){var t=r.file(e);t&&(p.push(l(t)),d.push(e))}}return a||[i(o,e,"config"),i(o,e+"rc")].forEach(f),u&&[i(u,".config",e,"config"),i(u,".config",e),i(u,"."+e,"config"),i(u,"."+e+"rc")].forEach(f),f(r.find("."+e+"rc")),h.config&&f(h.config),c.config&&f(c.config),s.apply(null,p.concat([h,c,d.length?{configs:d,config:d[d.length-1]}:void 0]))}},(e,t,n)=>{"use strict";var r=n(4),i=n(161),s=n(39),o=n(162),a=t.parse=function(e){return/^\s*{/.test(e)?JSON.parse(o(e)):i.parse(e)},u=t.file=function(){var e=[].slice.call(arguments).filter((function(e){return null!=e}));for(var t in e)if("string"!=typeof e[t])return;var n=s.join.apply(null,e);try{return r.readFileSync(n,"utf-8")}catch(e){return}};t.json=function(){var e=u.apply(null,arguments);return e?a(e):null},t.env=function(e,t){t=t||process.env;var n={},r=e.length;for(var i in t)if(0===i.toLowerCase().indexOf(e.toLowerCase())){for(var s,o=i.substring(r).split("__");(s=o.indexOf(""))>-1;)o.splice(s,1);var a=n;o.forEach((function(e,n){e&&"object"==typeof a&&(n===o.length-1&&(a[e]=t[i]),void 0===a[e]&&(a[e]={}),a=a[e])}))}return n},t.find=function(){var e=s.join.apply(null,[].slice.call(arguments));function t(e,n){var i=s.join(e,n);try{return r.statSync(i),i}catch(r){if(s.dirname(e)!==e)return t(s.dirname(e),n)}}return t(process.cwd(),e)}},(e,t)=>{t.parse=t.decode=function(e){var t={},n=t,i=null,s=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;return e.split(/[\r\n]+/g).forEach((function(e,r,a){if(e&&!e.match(/^\s*[;#]/)){var u=e.match(s);if(u){if(void 0!==u[1])return i=o(u[1]),void(n=t[i]=t[i]||{});var c=o(u[2]),l=!u[3]||o(u[4]);switch(l){case"true":case"false":case"null":l=JSON.parse(l)}c.length>2&&"[]"===c.slice(-2)&&(c=c.substring(0,c.length-2),n[c]?Array.isArray(n[c])||(n[c]=[n[c]]):n[c]=[]),Array.isArray(n[c])?n[c].push(l):n[c]=l}}})),Object.keys(t).filter((function(e,n,i){if(!t[e]||"object"!=typeof t[e]||Array.isArray(t[e]))return!1;var s=r(e),o=t,a=s.pop(),u=a.replace(/\\\./g,".");return s.forEach((function(e,t,n){o[e]&&"object"==typeof o[e]||(o[e]={}),o=o[e]})),(o!==t||u!==a)&&(o[u]=t[e],!0)})).forEach((function(e,n,r){delete t[e]})),t},t.stringify=t.encode=function e(t,i){var o=[],a="";"string"==typeof i?i={section:i,whitespace:!1}:(i=i||{}).whitespace=!0===i.whitespace;var u=i.whitespace?" = ":"=";return Object.keys(t).forEach((function(e,r,i){var c=t[e];c&&Array.isArray(c)?c.forEach((function(t){a+=s(e+"[]")+u+s(t)+"\n"})):c&&"object"==typeof c?o.push(e):a+=s(e)+u+s(c)+n})),i.section&&a.length&&(a="["+s(i.section)+"]"+n+a),o.forEach((function(s,o,u){var c=r(s).join("\\."),l=(i.section?i.section+".":"")+c,h=e(t[s],{section:l,whitespace:i.whitespace});a.length&&h.length&&(a+=n),a+=h})),a},t.safe=s,t.unsafe=o;var n="undefined"!=typeof process&&"win32"===process.platform?"\r\n":"\n";function r(e){return e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map((function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")}))}function i(e){return'"'===e.charAt(0)&&'"'===e.slice(-1)||"'"===e.charAt(0)&&"'"===e.slice(-1)}function s(e){return"string"!=typeof e||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&i(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,"\\;").replace(/#/g,"\\#")}function o(e,t){if(!i(e=(e||"").trim())){for(var n=!1,r="",s=0,o=e.length;s{"use strict";function t(){return""}function n(e,t,n){return e.slice(t,n).replace(/\S/g," ")}e.exports=function(e,r){for(var i,s,o=!1,a=!1,u=0,c="",l=!1===(r=r||{}).whitespace?t:n,h=0;h{function t(e){return"number"==typeof e||!!/^0x[0-9a-f]+$/i.test(e)||/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}e.exports=function(e,n){n||(n={});var r={bools:{},strings:{},unknownFn:null};"function"==typeof n.unknown&&(r.unknownFn=n.unknown),"boolean"==typeof n.boolean&&n.boolean?r.allBools=!0:[].concat(n.boolean).filter(Boolean).forEach((function(e){r.bools[e]=!0}));var i={};Object.keys(n.alias||{}).forEach((function(e){i[e]=[].concat(n.alias[e]),i[e].forEach((function(t){i[t]=[e].concat(i[e].filter((function(e){return t!==e})))}))})),[].concat(n.string).filter(Boolean).forEach((function(e){r.strings[e]=!0,i[e]&&(r.strings[i[e]]=!0)}));var s=n.default||{},o={_:[]};Object.keys(r.bools).forEach((function(e){u(e,void 0!==s[e]&&s[e])}));var a=[];function u(e,n,s){if(!s||!r.unknownFn||function(e,t){return r.allBools&&/^--[^=]+$/.test(t)||r.strings[e]||r.bools[e]||i[e]}(e,s)||!1!==r.unknownFn(s)){var a=!r.strings[e]&&t(n)?Number(n):n;c(o,e.split("."),a),(i[e]||[]).forEach((function(e){c(o,e.split("."),a)}))}}function c(e,t,n){for(var i=e,s=0;s{"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0});const i=n(165);t.ErrorCodes=i.ErrorCodes,t.ResponseError=i.ResponseError,t.CancellationToken=i.CancellationToken,t.CancellationTokenSource=i.CancellationTokenSource,t.Disposable=i.Disposable,t.Event=i.Event,t.Emitter=i.Emitter,t.Trace=i.Trace,t.TraceFormat=i.TraceFormat,t.SetTraceNotification=i.SetTraceNotification,t.LogTraceNotification=i.LogTraceNotification,t.RequestType=i.RequestType,t.RequestType0=i.RequestType0,t.NotificationType=i.NotificationType,t.NotificationType0=i.NotificationType0,t.MessageReader=i.MessageReader,t.MessageWriter=i.MessageWriter,t.ConnectionStrategy=i.ConnectionStrategy,t.StreamMessageReader=i.StreamMessageReader,t.StreamMessageWriter=i.StreamMessageWriter,t.IPCMessageReader=i.IPCMessageReader,t.IPCMessageWriter=i.IPCMessageWriter,t.createClientPipeTransport=i.createClientPipeTransport,t.createServerPipeTransport=i.createServerPipeTransport,t.generateRandomPipeName=i.generateRandomPipeName,t.createClientSocketTransport=i.createClientSocketTransport,t.createServerSocketTransport=i.createServerSocketTransport,t.ProgressType=i.ProgressType,r(n(177)),r(n(178));const s=n(190),o=n(191);!function(e){let t,n,r,i,a,u;!function(e){e.method=s.CallHierarchyPrepareRequest.method,e.type=s.CallHierarchyPrepareRequest.type}(t=e.CallHierarchyPrepareRequest||(e.CallHierarchyPrepareRequest={})),function(e){e.method=s.CallHierarchyIncomingCallsRequest.method,e.type=s.CallHierarchyIncomingCallsRequest.type}(n=e.CallHierarchyIncomingCallsRequest||(e.CallHierarchyIncomingCallsRequest={})),function(e){e.method=s.CallHierarchyOutgoingCallsRequest.method,e.type=s.CallHierarchyOutgoingCallsRequest.type}(r=e.CallHierarchyOutgoingCallsRequest||(e.CallHierarchyOutgoingCallsRequest={})),e.SemanticTokenTypes=o.SemanticTokenTypes,e.SemanticTokenModifiers=o.SemanticTokenModifiers,e.SemanticTokens=o.SemanticTokens,function(e){e.method=o.SemanticTokensRequest.method,e.type=o.SemanticTokensRequest.type}(i=e.SemanticTokensRequest||(e.SemanticTokensRequest={})),function(e){e.method=o.SemanticTokensEditsRequest.method,e.type=o.SemanticTokensEditsRequest.type}(a=e.SemanticTokensEditsRequest||(e.SemanticTokensEditsRequest={})),function(e){e.method=o.SemanticTokensRangeRequest.method,e.type=o.SemanticTokensRangeRequest.type}(u=e.SemanticTokensRangeRequest||(e.SemanticTokensRangeRequest={}))}(t.Proposed||(t.Proposed={})),t.createProtocolConnection=function(e,t,n,r){return i.createMessageConnection(e,t,n,r)}},(e,t,n)=>{"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0});const i=n(166),s=n(167);t.RequestType=s.RequestType,t.RequestType0=s.RequestType0,t.RequestType1=s.RequestType1,t.RequestType2=s.RequestType2,t.RequestType3=s.RequestType3,t.RequestType4=s.RequestType4,t.RequestType5=s.RequestType5,t.RequestType6=s.RequestType6,t.RequestType7=s.RequestType7,t.RequestType8=s.RequestType8,t.RequestType9=s.RequestType9,t.ResponseError=s.ResponseError,t.ErrorCodes=s.ErrorCodes,t.NotificationType=s.NotificationType,t.NotificationType0=s.NotificationType0,t.NotificationType1=s.NotificationType1,t.NotificationType2=s.NotificationType2,t.NotificationType3=s.NotificationType3,t.NotificationType4=s.NotificationType4,t.NotificationType5=s.NotificationType5,t.NotificationType6=s.NotificationType6,t.NotificationType7=s.NotificationType7,t.NotificationType8=s.NotificationType8,t.NotificationType9=s.NotificationType9;const o=n(168);t.MessageReader=o.MessageReader,t.StreamMessageReader=o.StreamMessageReader,t.IPCMessageReader=o.IPCMessageReader,t.SocketMessageReader=o.SocketMessageReader;const a=n(170);t.MessageWriter=a.MessageWriter,t.StreamMessageWriter=a.StreamMessageWriter,t.IPCMessageWriter=a.IPCMessageWriter,t.SocketMessageWriter=a.SocketMessageWriter;const u=n(169);t.Disposable=u.Disposable,t.Event=u.Event,t.Emitter=u.Emitter;const c=n(171);t.CancellationTokenSource=c.CancellationTokenSource,t.CancellationToken=c.CancellationToken;const l=n(172);var h,p,d,f,m,g,x,y;r(n(173)),r(n(176)),function(e){e.type=new s.NotificationType("$/cancelRequest")}(h||(h={})),function(e){e.type=new s.NotificationType("$/progress")}(p||(p={})),t.ProgressType=class{constructor(){}},t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Verbose=2]="Verbose"}(d=t.Trace||(t.Trace={})),function(e){e.fromString=function(t){if(!i.string(t))return e.Off;switch(t=t.toLowerCase()){case"off":return e.Off;case"messages":return e.Messages;case"verbose":return e.Verbose;default:return e.Off}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Verbose:return"verbose";default:return"off"}}}(d=t.Trace||(t.Trace={})),function(e){e.Text="text",e.JSON="json"}(t.TraceFormat||(t.TraceFormat={})),function(e){e.fromString=function(t){return"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(f=t.TraceFormat||(t.TraceFormat={})),function(e){e.type=new s.NotificationType("$/setTraceNotification")}(m=t.SetTraceNotification||(t.SetTraceNotification={})),function(e){e.type=new s.NotificationType("$/logTraceNotification")}(g=t.LogTraceNotification||(t.LogTraceNotification={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(x=t.ConnectionErrors||(t.ConnectionErrors={}));class D extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,D.prototype)}}function C(e,t,n,r){let o=0,a=0,C=0;const v="2.0";let E,k,b=void 0,A=Object.create(null),w=void 0,S=Object.create(null),_=new Map,F=new l.LinkedMap,T=Object.create(null),N=Object.create(null),M=d.Off,R=f.Text,I=y.New,B=new u.Emitter,L=new u.Emitter,q=new u.Emitter,P=new u.Emitter,O=new u.Emitter;function z(e){return"req-"+e.toString()}function j(e){}function U(){return I===y.Listening}function J(){return I===y.Closed}function X(){return I===y.Disposed}function $(){I!==y.New&&I!==y.Listening||(I=y.Closed,L.fire(void 0))}function H(){E||0===F.size||(E=setImmediate((()=>{E=void 0,function(){if(0===F.size)return;let e=F.shift();try{s.isRequestMessage(e)?function(e){if(X())return;function n(n,r,i){let o={jsonrpc:v,id:e.id};n instanceof s.ResponseError?o.error=n.toJson():o.result=void 0===n?null:n,K(o,r,i),t.write(o)}function r(n,r,i){let s={jsonrpc:v,id:e.id,error:n.toJson()};K(s,r,i),t.write(s)}!function(e){if(M!==d.Off&&k)if(R===f.Text){let t=void 0;M===d.Verbose&&e.params&&(t=`Params: ${JSON.stringify(e.params,null,4)}\n\n`),k.log(`Received request '${e.method} - (${e.id})'.`,t)}else V("receive-request",e)}(e);let o,a,u=A[e.method];u&&(o=u.type,a=u.handler);let l=Date.now();if(a||b){let u=new c.CancellationTokenSource,h=String(e.id);N[h]=u;try{let c;c=void 0===e.params||void 0!==o&&0===o.numberOfParams?a?a(u.token):b(e.method,u.token):i.array(e.params)&&(void 0===o||o.numberOfParams>1)?a?a(...e.params,u.token):b(e.method,...e.params,u.token):a?a(e.params,u.token):b(e.method,e.params,u.token);let p=c;c?p.then?p.then((t=>{delete N[h],n(t,e.method,l)}),(t=>{delete N[h],t instanceof s.ResponseError?r(t,e.method,l):t&&i.string(t.message)?r(new s.ResponseError(s.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,l):r(new s.ResponseError(s.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)})):(delete N[h],n(c,e.method,l)):(delete N[h],function(n,r,i){void 0===n&&(n=null);let s={jsonrpc:v,id:e.id,result:n};K(s,r,i),t.write(s)}(c,e.method,l))}catch(t){delete N[h],t instanceof s.ResponseError?n(t,e.method,l):t&&i.string(t.message)?r(new s.ResponseError(s.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,l):r(new s.ResponseError(s.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,l)}}else r(new s.ResponseError(s.ErrorCodes.MethodNotFound,"Unhandled method "+e.method),e.method,l)}(e):s.isNotificationMessage(e)?function(e){if(X())return;let t,r=void 0;if(e.method===h.type.method)t=e=>{let t=e.id,n=N[String(t)];n&&n.cancel()};else{let n=S[e.method];n&&(t=n.handler,r=n.type)}if(t||w)try{!function(e){if(M!==d.Off&&k&&e.method!==g.type.method)if(R===f.Text){let t=void 0;M===d.Verbose&&(t=e.params?`Params: ${JSON.stringify(e.params,null,4)}\n\n`:"No parameters provided.\n\n"),k.log(`Received notification '${e.method}'.`,t)}else V("receive-notification",e)}(e),void 0===e.params||void 0!==r&&0===r.numberOfParams?t?t():w(e.method):i.array(e.params)&&(void 0===r||r.numberOfParams>1)?t?t(...e.params):w(e.method,...e.params):t?t(e.params):w(e.method,e.params)}catch(t){t.message?n.error(`Notification handler '${e.method}' failed with message: ${t.message}`):n.error(`Notification handler '${e.method}' failed unexpectedly.`)}else q.fire(e)}(e):s.isResponseMessage(e)?function(e){if(!X())if(null===e.id)e.error?n.error("Received response message without id: Error is: \n"+JSON.stringify(e.error,void 0,4)):n.error("Received response message without id. No further error information provided.");else{let t=String(e.id),r=T[t];if(function(e,t){if(M!==d.Off&&k)if(R===f.Text){let n=void 0;if(M===d.Verbose&&(e.error&&e.error.data?n=`Error data: ${JSON.stringify(e.error.data,null,4)}\n\n`:e.result?n=`Result: ${JSON.stringify(e.result,null,4)}\n\n`:void 0===e.error&&(n="No result returned.\n\n")),t){let r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:"";k.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else k.log(`Received response ${e.id} without active response promise.`,n)}else V("receive-response",e)}(e,r),r){delete T[t];try{if(e.error){let t=e.error;r.reject(new s.ResponseError(t.code,t.message,t.data))}else{if(void 0===e.result)throw new Error("Should never happen.");r.resolve(e.result)}}catch(e){e.message?n.error(`Response handler '${r.method}' failed with message: ${e.message}`):n.error(`Response handler '${r.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void n.error("Received empty message.");n.error("Received message which is neither a response nor a notification message:\n"+JSON.stringify(e,null,4));let t=e;if(i.string(t.id)||i.number(t.id)){let e=String(t.id),n=T[e];n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}finally{H()}}()})))}e.onClose($),e.onError((function(e){B.fire([e,void 0,void 0])})),t.onClose($),t.onError((function(e){B.fire(e)}));let W=e=>{try{if(s.isNotificationMessage(e)&&e.method===h.type.method){let n=z(e.params.id),i=F.get(n);if(s.isRequestMessage(i)){let s=r&&r.cancelUndispatched?r.cancelUndispatched(i,j):void 0;if(s&&(void 0!==s.error||void 0!==s.result))return F.delete(n),s.id=i.id,K(s,e.method,Date.now()),void t.write(s)}}!function(e,t){var n;s.isRequestMessage(t)?e.set(z(t.id),t):s.isResponseMessage(t)?e.set(null===(n=t.id)?"res-unknown-"+(++C).toString():"res-"+n.toString(),t):e.set("not-"+(++a).toString(),t)}(F,e)}finally{H()}};function K(e,t,n){if(M!==d.Off&&k)if(R===f.Text){let r=void 0;M===d.Verbose&&(e.error&&e.error.data?r=`Error data: ${JSON.stringify(e.error.data,null,4)}\n\n`:e.result?r=`Result: ${JSON.stringify(e.result,null,4)}\n\n`:void 0===e.error&&(r="No result returned.\n\n")),k.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else V("send-response",e)}function V(e,t){if(!k||M===d.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};k.log(n)}function G(){if(J())throw new D(x.Closed,"Connection is closed.");if(X())throw new D(x.Disposed,"Connection is disposed.")}function Y(e){return void 0===e?null:e}function Z(e,t){let n,r=e.numberOfParams;switch(r){case 0:n=null;break;case 1:n=Y(t[0]);break;default:n=[];for(let e=0;e{let r,s;if(G(),i.string(e))switch(r=e,n.length){case 0:s=null;break;case 1:s=n[0];break;default:s=n}else r=e.method,s=Z(e,n);let o={jsonrpc:v,method:r,params:s};!function(e){if(M!==d.Off&&k)if(R===f.Text){let t=void 0;M===d.Verbose&&(t=e.params?`Params: ${JSON.stringify(e.params,null,4)}\n\n`:"No parameters provided.\n\n"),k.log(`Sending notification '${e.method}'.`,t)}else V("send-notification",e)}(o),t.write(o)},onNotification:(e,t)=>{G(),i.func(e)?w=e:t&&(i.string(e)?S[e]={type:void 0,handler:t}:S[e.method]={type:e,handler:t})},onProgress:(e,t,n)=>{if(_.has(t))throw new Error(`Progress handler for token ${t} already registered`);return _.set(t,n),{dispose:()=>{_.delete(t)}}},sendProgress:(e,t,n)=>{Q.sendNotification(p.type,{token:t,value:n})},onUnhandledProgress:P.event,sendRequest:(e,...n)=>{let r,a;G(),function(){if(!U())throw new Error("Call listen() first.")}();let u=void 0;if(i.string(e))switch(r=e,n.length){case 0:a=null;break;case 1:c.CancellationToken.is(n[0])?(a=null,u=n[0]):a=Y(n[0]);break;default:const e=n.length-1;c.CancellationToken.is(n[e])?(u=n[e],a=2===n.length?Y(n[0]):n.slice(0,e).map((e=>Y(e)))):a=n.map((e=>Y(e)))}else{r=e.method,a=Z(e,n);let t=e.numberOfParams;u=c.CancellationToken.is(n[t])?n[t]:void 0}let l=o++,p=new Promise(((e,n)=>{let i={jsonrpc:v,id:l,method:r,params:a},o={method:r,timerStart:Date.now(),resolve:e,reject:n};!function(e){if(M!==d.Off&&k)if(R===f.Text){let t=void 0;M===d.Verbose&&e.params&&(t=`Params: ${JSON.stringify(e.params,null,4)}\n\n`),k.log(`Sending request '${e.method} - (${e.id})'.`,t)}else V("send-request",e)}(i);try{t.write(i)}catch(e){o.reject(new s.ResponseError(s.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),o=null}o&&(T[String(l)]=o)}));return u&&u.onCancellationRequested((()=>{Q.sendNotification(h.type,{id:l})})),p},onRequest:(e,t)=>{G(),i.func(e)?b=e:t&&(i.string(e)?A[e]={type:void 0,handler:t}:A[e.method]={type:e,handler:t})},trace:(e,t,n)=>{let r=!1,s=f.Text;void 0!==n&&(i.boolean(n)?r=n:(r=n.sendNotification||!1,s=n.traceFormat||f.Text)),M=e,R=s,k=M===d.Off?void 0:t,!r||J()||X()||Q.sendNotification(m.type,{value:d.toString(e)})},onError:B.event,onClose:L.event,onUnhandledNotification:q.event,onDispose:O.event,dispose:()=>{if(X())return;I=y.Disposed,O.fire(void 0);let n=new Error("Connection got disposed.");Object.keys(T).forEach((e=>{T[e].reject(n)})),T=Object.create(null),N=Object.create(null),F=new l.LinkedMap,i.func(t.dispose)&&t.dispose(),i.func(e.dispose)&&e.dispose()},listen:()=>{G(),function(){if(U())throw new D(x.AlreadyListening,"Connection is already listening")}(),I=y.Listening,e.listen(W)},inspect:()=>{console.log("inspect")}};return Q.onNotification(g.type,(e=>{M!==d.Off&&k&&k.log(e.message,M===d.Verbose?e.verbose:void 0)})),Q.onNotification(p.type,(e=>{const t=_.get(e.token);t?t(e.value):P.fire(e)})),Q}t.ConnectionError=D,(t.ConnectionStrategy||(t.ConnectionStrategy={})).is=function(e){let t=e;return t&&i.func(t.cancelUndispatched)},function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"}(y||(y={})),t.createMessageConnection=function(e,n,r,i){var s;return r||(r=t.NullLogger),C(void 0!==(s=e).listen&&void 0===s.read?e:new o.StreamMessageReader(e),function(e){return void 0!==e.write&&void 0===e.end}(n)?n:new a.StreamMessageWriter(n),r,i)}},(e,t)=>{"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every((e=>n(e)))}},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(166);var i;!function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.serverErrorStart=-32099,e.serverErrorEnd=-32e3,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.RequestCancelled=-32800,e.ContentModified=-32801,e.MessageWriteError=1,e.MessageReadError=2}(i=t.ErrorCodes||(t.ErrorCodes={}));class s extends Error{constructor(e,t,n){super(t),this.code=r.number(e)?e:i.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,s.prototype)}toJson(){return{code:this.code,message:this.message,data:this.data}}}t.ResponseError=s;class o{constructor(e,t){this._method=e,this._numberOfParams=t}get method(){return this._method}get numberOfParams(){return this._numberOfParams}}t.AbstractMessageType=o,t.RequestType0=class extends o{constructor(e){super(e,0)}},t.RequestType=class extends o{constructor(e){super(e,1)}},t.RequestType1=class extends o{constructor(e){super(e,1)}},t.RequestType2=class extends o{constructor(e){super(e,2)}},t.RequestType3=class extends o{constructor(e){super(e,3)}},t.RequestType4=class extends o{constructor(e){super(e,4)}},t.RequestType5=class extends o{constructor(e){super(e,5)}},t.RequestType6=class extends o{constructor(e){super(e,6)}},t.RequestType7=class extends o{constructor(e){super(e,7)}},t.RequestType8=class extends o{constructor(e){super(e,8)}},t.RequestType9=class extends o{constructor(e){super(e,9)}},t.NotificationType=class extends o{constructor(e){super(e,1),this._=void 0}},t.NotificationType0=class extends o{constructor(e){super(e,0)}},t.NotificationType1=class extends o{constructor(e){super(e,1)}},t.NotificationType2=class extends o{constructor(e){super(e,2)}},t.NotificationType3=class extends o{constructor(e){super(e,3)}},t.NotificationType4=class extends o{constructor(e){super(e,4)}},t.NotificationType5=class extends o{constructor(e){super(e,5)}},t.NotificationType6=class extends o{constructor(e){super(e,6)}},t.NotificationType7=class extends o{constructor(e){super(e,7)}},t.NotificationType8=class extends o{constructor(e){super(e,8)}},t.NotificationType9=class extends o{constructor(e){super(e,9)}},t.isRequestMessage=function(e){let t=e;return t&&r.string(t.method)&&(r.string(t.id)||r.number(t.id))},t.isNotificationMessage=function(e){let t=e;return t&&r.string(t.method)&&void 0===e.id},t.isResponseMessage=function(e){let t=e;return t&&(void 0!==t.result||!!t.error)&&(r.string(t.id)||r.number(t.id)||null===t.id)}},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(169),i=n(166);let s=8192,o=Buffer.from("\r","ascii")[0],a=Buffer.from("\n","ascii")[0];class u{constructor(e="utf8"){this.encoding=e,this.index=0,this.buffer=Buffer.allocUnsafe(s)}append(e){var t=e;if("string"==typeof e){var n=e,r=Buffer.byteLength(n,this.encoding);(t=Buffer.allocUnsafe(r)).write(n,0,r,this.encoding)}if(this.buffer.length-this.index>=t.length)t.copy(this.buffer,this.index,0,t.length);else{var i=(Math.ceil((this.index+t.length)/s)+1)*s;0===this.index?(this.buffer=Buffer.allocUnsafe(i),t.copy(this.buffer,0,0,t.length)):this.buffer=Buffer.concat([this.buffer.slice(0,this.index),t],i)}this.index+=t.length}tryReadHeaders(){let e=void 0,t=0;for(;t+3=this.index)return e;e=Object.create(null),this.buffer.toString("ascii",0,t).split("\r\n").forEach((t=>{let n=t.indexOf(":");if(-1===n)throw new Error("Message header must separate key and value using :");let r=t.substr(0,n),i=t.substr(n+1).trim();e[r]=i}));let n=t+4;return this.buffer=this.buffer.slice(n),this.index=this.index-n,e}tryReadContent(e){if(this.index{this.onData(e)})),this.readable.on("error",(e=>this.fireError(e))),this.readable.on("close",(()=>this.fireClose()))}onData(e){for(this.buffer.append(e);;){if(-1===this.nextMessageLength){let e=this.buffer.tryReadHeaders();if(!e)return;let t=e["Content-Length"];if(!t)throw new Error("Header must provide a Content-Length property.");let n=parseInt(t);if(isNaN(n))throw new Error("Content-Length value must be a number.");this.nextMessageLength=n}var t=this.buffer.tryReadContent(this.nextMessageLength);if(null===t)return void this.setPartialMessageTimer();this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.messageToken++;var n=JSON.parse(t);this.callback(n)}}clearPartialMessageTimer(){this.partialMessageTimer&&(clearTimeout(this.partialMessageTimer),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=setTimeout(((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())}),this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}t.StreamMessageReader=l,t.IPCMessageReader=class extends c{constructor(e){super(),this.process=e;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose()))}listen(e){this.process.on("message",e)}},t.SocketMessageReader=class extends l{constructor(e,t="utf-8"){super(e,t)}}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(t.Disposable||(t.Disposable={})).create=function(e){return{dispose:e}},function(e){const t={dispose(){}};e.None=function(){return t}}(t.Event||(t.Event={}));class n{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(this._callbacks){for(var n=!1,r=0,i=this._callbacks.length;r{let s;return this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t),s={dispose:()=>{this._callbacks.remove(e,t),s.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this)}},Array.isArray(i)&&i.push(s),s}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}t.Emitter=r,r._noop=function(){}},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(169),i=n(166);let s="Content-Length: ",o="\r\n";(t.MessageWriter||(t.MessageWriter={})).is=function(e){let t=e;return t&&i.func(t.dispose)&&i.func(t.onClose)&&i.func(t.onError)&&i.func(t.write)};class a{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error("Writer received error. Reason: "+(i.string(e.message)?e.message:"unknown"))}}t.AbstractMessageWriter=a,t.StreamMessageWriter=class extends a{constructor(e,t="utf8"){super(),this.writable=e,this.encoding=t,this.errorCount=0,this.writable.on("error",(e=>this.fireError(e))),this.writable.on("close",(()=>this.fireClose()))}write(e){let t=JSON.stringify(e),n=Buffer.byteLength(t,this.encoding),r=[s,n.toString(),o,o];try{this.writable.write(r.join(""),"ascii"),this.writable.write(t,this.encoding),this.errorCount=0}catch(t){this.errorCount++,this.fireError(t,e,this.errorCount)}}},t.IPCMessageWriter=class extends a{constructor(e){super(),this.process=e,this.errorCount=0,this.queue=[],this.sending=!1;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose))}write(e){this.sending||0!==this.queue.length?this.queue.push(e):this.doWriteMessage(e)}doWriteMessage(e){try{this.process.send&&(this.sending=!0,this.process.send(e,void 0,void 0,(t=>{this.sending=!1,t?(this.errorCount++,this.fireError(t,e,this.errorCount)):this.errorCount=0,this.queue.length>0&&this.doWriteMessage(this.queue.shift())})))}catch(t){this.errorCount++,this.fireError(t,e,this.errorCount)}}},t.SocketMessageWriter=class extends a{constructor(e,t="utf8"){super(),this.socket=e,this.queue=[],this.sending=!1,this.encoding=t,this.errorCount=0,this.socket.on("error",(e=>this.fireError(e))),this.socket.on("close",(()=>this.fireClose()))}dispose(){super.dispose(),this.socket.destroy()}write(e){this.sending||0!==this.queue.length?this.queue.push(e):this.doWriteMessage(e)}doWriteMessage(e){let t=JSON.stringify(e),n=Buffer.byteLength(t,this.encoding),r=[s,n.toString(),o,o];try{this.sending=!0,this.socket.write(r.join(""),"ascii",(n=>{n&&this.handleError(n,e);try{this.socket.write(t,this.encoding,(t=>{this.sending=!1,t?this.handleError(t,e):this.errorCount=0,this.queue.length>0&&this.doWriteMessage(this.queue.shift())}))}catch(n){this.handleError(n,e)}}))}catch(t){this.handleError(t,e)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}}},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(169),i=n(166);var s;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None}),e.is=function(t){let n=t;return n&&(n===e.None||n===e.Cancelled||i.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}}(s=t.CancellationToken||(t.CancellationToken={}));const o=Object.freeze((function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}));class a{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?o:(this._emitter||(this._emitter=new r.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}t.CancellationTokenSource=class{get token(){return this._token||(this._token=new a),this._token}cancel(){this._token?this._token.cancel():this._token=s.Cancelled}dispose(){this._token?this._token instanceof a&&this._token.dispose():this._token=s.None}}},(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.None=0,e.First=1,e.Last=2}(n=t.Touch||(t.Touch={})),t.LinkedMap=class{constructor(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}has(e){return this._map.has(e)}get(e){const t=this._map.get(e);if(t)return t.value}set(e,t,r=n.None){let i=this._map.get(e);if(i)i.value=t,r!==n.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(i);break;case n.First:this.addItemFirst(i);break;case n.Last:default:this.addItemLast(i)}this._map.set(e,i),this._size++}}delete(e){const t=this._map.get(e);return!!t&&(this._map.delete(e),this.removeItem(t),this._size--,!0)}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._head;for(;n;)t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),n=n.next}forEachReverse(e,t){let n=this._tail;for(;n;)t?e.bind(t)(n.value,n.key,this):e(n.value,n.key,this),n=n.previous}values(){let e=[],t=this._head;for(;t;)e.push(t.value),t=t.next;return e}keys(){let e=[],t=this._head;for(;t;)e.push(t.key),t=t.next;return e}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head)this._head=e.next;else if(e===this._tail)this._tail=e.previous;else{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(t===n.First||t===n.Last)if(t===n.First){if(e===this._head)return;const t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e}else if(t===n.Last){if(e===this._tail)return;const t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e}}}},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(39),i=n(112),s=n(174),o=n(175),a=n(168),u=n(170);t.generateRandomPipeName=function(){const e=s.randomBytes(21).toString("hex");return"win32"===process.platform?`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`:r.join(i.tmpdir(),`vscode-${e}.sock`)},t.createClientPipeTransport=function(e,t="utf-8"){let n,r=new Promise(((e,t)=>{n=e}));return new Promise(((i,s)=>{let c=o.createServer((e=>{c.close(),n([new a.SocketMessageReader(e,t),new u.SocketMessageWriter(e,t)])}));c.on("error",s),c.listen(e,(()=>{c.removeListener("error",s),i({onConnected:()=>r})}))}))},t.createServerPipeTransport=function(e,t="utf-8"){const n=o.createConnection(e);return[new a.SocketMessageReader(n,t),new u.SocketMessageWriter(n,t)]}},e=>{"use strict";e.exports=require("crypto")},e=>{"use strict";e.exports=require("net")},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(175),i=n(168),s=n(170);t.createClientSocketTransport=function(e,t="utf-8"){let n,o=new Promise(((e,t)=>{n=e}));return new Promise(((a,u)=>{let c=r.createServer((e=>{c.close(),n([new i.SocketMessageReader(e,t),new s.SocketMessageWriter(e,t)])}));c.on("error",u),c.listen(e,"127.0.0.1",(()=>{c.removeListener("error",u),a({onConnected:()=>o})}))}))},t.createServerSocketTransport=function(e,t="utf-8"){const n=r.createConnection(e,"127.0.0.1");return[new i.SocketMessageReader(n,t),new s.SocketMessageWriter(n,t)]}},(e,t,n)=>{"use strict";var r,i,s,o,a,u,c,l,h,p,d,f,m,g,x,y,D,C,v,E;n.r(t),n.d(t,{Position:()=>r,Range:()=>i,Location:()=>s,LocationLink:()=>o,Color:()=>a,ColorInformation:()=>u,ColorPresentation:()=>c,FoldingRangeKind:()=>l,FoldingRange:()=>h,DiagnosticRelatedInformation:()=>p,DiagnosticSeverity:()=>d,DiagnosticTag:()=>f,Diagnostic:()=>m,Command:()=>g,TextEdit:()=>x,TextDocumentEdit:()=>y,CreateFile:()=>D,RenameFile:()=>C,DeleteFile:()=>v,WorkspaceEdit:()=>E,WorkspaceChange:()=>Y,TextDocumentIdentifier:()=>k,VersionedTextDocumentIdentifier:()=>b,TextDocumentItem:()=>A,MarkupKind:()=>w,MarkupContent:()=>S,CompletionItemKind:()=>_,InsertTextFormat:()=>F,CompletionItemTag:()=>T,CompletionItem:()=>N,CompletionList:()=>M,MarkedString:()=>R,Hover:()=>I,ParameterInformation:()=>B,SignatureInformation:()=>L,DocumentHighlightKind:()=>q,DocumentHighlight:()=>P,SymbolKind:()=>O,SymbolTag:()=>z,SymbolInformation:()=>j,DocumentSymbol:()=>U,CodeActionKind:()=>J,CodeActionContext:()=>X,CodeAction:()=>$,CodeLens:()=>H,FormattingOptions:()=>W,DocumentLink:()=>K,SelectionRange:()=>V,EOL:()=>Q,TextDocument:()=>Z}),function(e){e.create=function(e,t){return{line:e,character:t}},e.is=function(e){var t=e;return ee.objectLiteral(t)&&ee.number(t.line)&&ee.number(t.character)}}(r||(r={})),function(e){e.create=function(e,t,n,i){if(ee.number(e)&&ee.number(t)&&ee.number(n)&&ee.number(i))return{start:r.create(e,t),end:r.create(n,i)};if(r.is(e)&&r.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments["+e+", "+t+", "+n+", "+i+"]")},e.is=function(e){var t=e;return ee.objectLiteral(t)&&r.is(t.start)&&r.is(t.end)}}(i||(i={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return ee.defined(t)&&i.is(t.range)&&(ee.string(t.uri)||ee.undefined(t.uri))}}(s||(s={})),function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){var t=e;return ee.defined(t)&&i.is(t.targetRange)&&ee.string(t.targetUri)&&(i.is(t.targetSelectionRange)||ee.undefined(t.targetSelectionRange))&&(i.is(t.originSelectionRange)||ee.undefined(t.originSelectionRange))}}(o||(o={})),function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){var t=e;return ee.number(t.red)&&ee.number(t.green)&&ee.number(t.blue)&&ee.number(t.alpha)}}(a||(a={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return i.is(t.range)&&a.is(t.color)}}(u||(u={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return ee.string(t.label)&&(ee.undefined(t.textEdit)||x.is(t))&&(ee.undefined(t.additionalTextEdits)||ee.typedArray(t.additionalTextEdits,x.is))}}(c||(c={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(l||(l={})),function(e){e.create=function(e,t,n,r,i){var s={startLine:e,endLine:t};return ee.defined(n)&&(s.startCharacter=n),ee.defined(r)&&(s.endCharacter=r),ee.defined(i)&&(s.kind=i),s},e.is=function(e){var t=e;return ee.number(t.startLine)&&ee.number(t.startLine)&&(ee.undefined(t.startCharacter)||ee.number(t.startCharacter))&&(ee.undefined(t.endCharacter)||ee.number(t.endCharacter))&&(ee.undefined(t.kind)||ee.string(t.kind))}}(h||(h={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return ee.defined(t)&&s.is(t.location)&&ee.string(t.message)}}(p||(p={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(d||(d={})),function(e){e.Unnecessary=1,e.Deprecated=2}(f||(f={})),function(e){e.create=function(e,t,n,r,i,s){var o={range:e,message:t};return ee.defined(n)&&(o.severity=n),ee.defined(r)&&(o.code=r),ee.defined(i)&&(o.source=i),ee.defined(s)&&(o.relatedInformation=s),o},e.is=function(e){var t=e;return ee.defined(t)&&i.is(t.range)&&ee.string(t.message)&&(ee.number(t.severity)||ee.undefined(t.severity))&&(ee.number(t.code)||ee.string(t.code)||ee.undefined(t.code))&&(ee.string(t.source)||ee.undefined(t.source))&&(ee.undefined(t.relatedInformation)||ee.typedArray(t.relatedInformation,p.is))}}(m||(m={})),function(e){e.create=function(e,t){for(var n=[],r=2;r0&&(i.arguments=n),i},e.is=function(e){var t=e;return ee.defined(t)&&ee.string(t.title)&&ee.string(t.command)}}(g||(g={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return ee.objectLiteral(t)&&ee.string(t.newText)&&i.is(t.range)}}(x||(x={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return ee.defined(t)&&b.is(t.textDocument)&&Array.isArray(t.edits)}}(y||(y={})),function(e){e.create=function(e,t){var n={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(n.options=t),n},e.is=function(e){var t=e;return t&&"create"===t.kind&&ee.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||ee.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||ee.boolean(t.options.ignoreIfExists)))}}(D||(D={})),function(e){e.create=function(e,t,n){var r={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(r.options=n),r},e.is=function(e){var t=e;return t&&"rename"===t.kind&&ee.string(t.oldUri)&&ee.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||ee.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||ee.boolean(t.options.ignoreIfExists)))}}(C||(C={})),function(e){e.create=function(e,t){var n={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(n.options=t),n},e.is=function(e){var t=e;return t&&"delete"===t.kind&&ee.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||ee.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||ee.boolean(t.options.ignoreIfNotExists)))}}(v||(v={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return ee.string(e.kind)?D.is(e)||C.is(e)||v.is(e):y.is(e)})))}}(E||(E={}));var k,b,A,w,S,_,F,T,N,M,R,I,B,L,q,P,O,z,j,U,J,X,$,H,W,K,V,G=function(){function e(e){this.edits=e}return e.prototype.insert=function(e,t){this.edits.push(x.insert(e,t))},e.prototype.replace=function(e,t){this.edits.push(x.replace(e,t))},e.prototype.delete=function(e){this.edits.push(x.del(e))},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e}(),Y=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach((function(e){if(y.is(e)){var n=new G(e.edits);t._textEditChanges[e.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new G(e.changes[n]);t._textEditChanges[n]=r})))}return Object.defineProperty(e.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),e.prototype.getTextEditChange=function(e){if(b.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t=e;if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new G(i),this._textEditChanges[t.uri]=r}return r}if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new G(i),this._textEditChanges[e]=r}return r},e.prototype.createFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(D.create(e,t))},e.prototype.renameFile=function(e,t,n){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(C.create(e,t,n))},e.prototype.deleteFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(v.create(e,t))},e.prototype.checkDocumentChanges=function(){if(!this._workspaceEdit||!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.")},e}();!function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return ee.defined(t)&&ee.string(t.uri)}}(k||(k={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return ee.defined(t)&&ee.string(t.uri)&&(null===t.version||ee.number(t.version))}}(b||(b={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return ee.defined(t)&&ee.string(t.uri)&&ee.string(t.languageId)&&ee.number(t.version)&&ee.string(t.text)}}(A||(A={})),function(e){e.PlainText="plaintext",e.Markdown="markdown"}(w||(w={})),function(e){e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(w||(w={})),function(e){e.is=function(e){var t=e;return ee.objectLiteral(e)&&w.is(t.kind)&&ee.string(t.value)}}(S||(S={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(_||(_={})),function(e){e.PlainText=1,e.Snippet=2}(F||(F={})),function(e){e.Deprecated=1}(T||(T={})),function(e){e.create=function(e){return{label:e}}}(N||(N={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(M||(M={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return ee.string(t)||ee.objectLiteral(t)&&ee.string(t.language)&&ee.string(t.value)}}(R||(R={})),function(e){e.is=function(e){var t=e;return!!t&&ee.objectLiteral(t)&&(S.is(t.contents)||R.is(t.contents)||ee.typedArray(t.contents,R.is))&&(void 0===e.range||i.is(e.range))}}(I||(I={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(B||(B={})),function(e){e.create=function(e,t){for(var n=[],r=2;r=0;o--){var a=i[o],u=e.offsetAt(a.range.start),c=e.offsetAt(a.range.end);if(!(c<=s))throw new Error("Overlapping edit");r=r.substring(0,u)+a.newText+r.substring(c,r.length),s=u}return r}}(Z||(Z={}));var ee,te=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,i=t.length;if(0===i)return r.create(0,e);for(;ne?i=s:n=s+1}var o=n-1;return r.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(179),i=n(165),s=n(180),o=n(181);t.ImplementationRequest=o.ImplementationRequest;const a=n(182);t.TypeDefinitionRequest=a.TypeDefinitionRequest;const u=n(183);t.WorkspaceFoldersRequest=u.WorkspaceFoldersRequest,t.DidChangeWorkspaceFoldersNotification=u.DidChangeWorkspaceFoldersNotification;const c=n(184);t.ConfigurationRequest=c.ConfigurationRequest;const l=n(185);t.DocumentColorRequest=l.DocumentColorRequest,t.ColorPresentationRequest=l.ColorPresentationRequest;const h=n(186);t.FoldingRangeRequest=h.FoldingRangeRequest;const p=n(187);t.DeclarationRequest=p.DeclarationRequest;const d=n(188);t.SelectionRangeRequest=d.SelectionRangeRequest;const f=n(189);var m,g,x,y,D,C,v,E,k,b,A,w,S,_,F,T,N,M,R,I,B,L,q,P,O,z,j,U,J,X,$,H,W,K,V;t.WorkDoneProgress=f.WorkDoneProgress,t.WorkDoneProgressCreateRequest=f.WorkDoneProgressCreateRequest,t.WorkDoneProgressCancelNotification=f.WorkDoneProgressCancelNotification,function(e){e.is=function(e){const t=e;return r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}}(m=t.DocumentFilter||(t.DocumentFilter={})),function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!m.is(t))return!1;return!0}}(g=t.DocumentSelector||(t.DocumentSelector={})),(t.RegistrationRequest||(t.RegistrationRequest={})).type=new s.ProtocolRequestType("client/registerCapability"),(t.UnregistrationRequest||(t.UnregistrationRequest={})).type=new s.ProtocolRequestType("client/unregisterCapability"),(V=t.ResourceOperationKind||(t.ResourceOperationKind={})).Create="create",V.Rename="rename",V.Delete="delete",(K=t.FailureHandlingKind||(t.FailureHandlingKind={})).Abort="abort",K.Transactional="transactional",K.TextOnlyTransactional="textOnlyTransactional",K.Undo="undo",(t.StaticRegistrationOptions||(t.StaticRegistrationOptions={})).hasId=function(e){const t=e;return t&&r.string(t.id)&&t.id.length>0},(t.TextDocumentRegistrationOptions||(t.TextDocumentRegistrationOptions={})).is=function(e){const t=e;return t&&(null===t.documentSelector||g.is(t.documentSelector))},(W=t.WorkDoneProgressOptions||(t.WorkDoneProgressOptions={})).is=function(e){const t=e;return r.objectLiteral(t)&&(void 0===t.workDoneProgress||r.boolean(t.workDoneProgress))},W.hasWorkDoneProgress=function(e){const t=e;return t&&r.boolean(t.workDoneProgress)},(t.InitializeRequest||(t.InitializeRequest={})).type=new s.ProtocolRequestType("initialize"),(t.InitializeError||(t.InitializeError={})).unknownProtocolVersion=1,(t.InitializedNotification||(t.InitializedNotification={})).type=new s.ProtocolNotificationType("initialized"),(t.ShutdownRequest||(t.ShutdownRequest={})).type=new s.ProtocolRequestType0("shutdown"),(t.ExitNotification||(t.ExitNotification={})).type=new s.ProtocolNotificationType0("exit"),(t.DidChangeConfigurationNotification||(t.DidChangeConfigurationNotification={})).type=new s.ProtocolNotificationType("workspace/didChangeConfiguration"),(H=t.MessageType||(t.MessageType={})).Error=1,H.Warning=2,H.Info=3,H.Log=4,(t.ShowMessageNotification||(t.ShowMessageNotification={})).type=new s.ProtocolNotificationType("window/showMessage"),(t.ShowMessageRequest||(t.ShowMessageRequest={})).type=new s.ProtocolRequestType("window/showMessageRequest"),(t.LogMessageNotification||(t.LogMessageNotification={})).type=new s.ProtocolNotificationType("window/logMessage"),(t.TelemetryEventNotification||(t.TelemetryEventNotification={})).type=new s.ProtocolNotificationType("telemetry/event"),($=t.TextDocumentSyncKind||(t.TextDocumentSyncKind={})).None=0,$.Full=1,$.Incremental=2,(X=t.DidOpenTextDocumentNotification||(t.DidOpenTextDocumentNotification={})).method="textDocument/didOpen",X.type=new s.ProtocolNotificationType(X.method),(J=t.DidChangeTextDocumentNotification||(t.DidChangeTextDocumentNotification={})).method="textDocument/didChange",J.type=new s.ProtocolNotificationType(J.method),(U=t.DidCloseTextDocumentNotification||(t.DidCloseTextDocumentNotification={})).method="textDocument/didClose",U.type=new s.ProtocolNotificationType(U.method),(j=t.DidSaveTextDocumentNotification||(t.DidSaveTextDocumentNotification={})).method="textDocument/didSave",j.type=new s.ProtocolNotificationType(j.method),(z=t.TextDocumentSaveReason||(t.TextDocumentSaveReason={})).Manual=1,z.AfterDelay=2,z.FocusOut=3,(O=t.WillSaveTextDocumentNotification||(t.WillSaveTextDocumentNotification={})).method="textDocument/willSave",O.type=new s.ProtocolNotificationType(O.method),(P=t.WillSaveTextDocumentWaitUntilRequest||(t.WillSaveTextDocumentWaitUntilRequest={})).method="textDocument/willSaveWaitUntil",P.type=new s.ProtocolRequestType(P.method),(t.DidChangeWatchedFilesNotification||(t.DidChangeWatchedFilesNotification={})).type=new s.ProtocolNotificationType("workspace/didChangeWatchedFiles"),(q=t.FileChangeType||(t.FileChangeType={})).Created=1,q.Changed=2,q.Deleted=3,(L=t.WatchKind||(t.WatchKind={})).Create=1,L.Change=2,L.Delete=4,(t.PublishDiagnosticsNotification||(t.PublishDiagnosticsNotification={})).type=new s.ProtocolNotificationType("textDocument/publishDiagnostics"),(B=t.CompletionTriggerKind||(t.CompletionTriggerKind={})).Invoked=1,B.TriggerCharacter=2,B.TriggerForIncompleteCompletions=3,(I=t.CompletionRequest||(t.CompletionRequest={})).method="textDocument/completion",I.type=new s.ProtocolRequestType(I.method),I.resultType=new i.ProgressType,(R=t.CompletionResolveRequest||(t.CompletionResolveRequest={})).method="completionItem/resolve",R.type=new s.ProtocolRequestType(R.method),(M=t.HoverRequest||(t.HoverRequest={})).method="textDocument/hover",M.type=new s.ProtocolRequestType(M.method),(N=t.SignatureHelpTriggerKind||(t.SignatureHelpTriggerKind={})).Invoked=1,N.TriggerCharacter=2,N.ContentChange=3,(T=t.SignatureHelpRequest||(t.SignatureHelpRequest={})).method="textDocument/signatureHelp",T.type=new s.ProtocolRequestType(T.method),(F=t.DefinitionRequest||(t.DefinitionRequest={})).method="textDocument/definition",F.type=new s.ProtocolRequestType(F.method),F.resultType=new i.ProgressType,(_=t.ReferencesRequest||(t.ReferencesRequest={})).method="textDocument/references",_.type=new s.ProtocolRequestType(_.method),_.resultType=new i.ProgressType,(S=t.DocumentHighlightRequest||(t.DocumentHighlightRequest={})).method="textDocument/documentHighlight",S.type=new s.ProtocolRequestType(S.method),S.resultType=new i.ProgressType,(w=t.DocumentSymbolRequest||(t.DocumentSymbolRequest={})).method="textDocument/documentSymbol",w.type=new s.ProtocolRequestType(w.method),w.resultType=new i.ProgressType,(A=t.CodeActionRequest||(t.CodeActionRequest={})).method="textDocument/codeAction",A.type=new s.ProtocolRequestType(A.method),A.resultType=new i.ProgressType,(b=t.WorkspaceSymbolRequest||(t.WorkspaceSymbolRequest={})).method="workspace/symbol",b.type=new s.ProtocolRequestType(b.method),b.resultType=new i.ProgressType,(k=t.CodeLensRequest||(t.CodeLensRequest={})).type=new s.ProtocolRequestType("textDocument/codeLens"),k.resultType=new i.ProgressType,(t.CodeLensResolveRequest||(t.CodeLensResolveRequest={})).type=new s.ProtocolRequestType("codeLens/resolve"),(E=t.DocumentLinkRequest||(t.DocumentLinkRequest={})).method="textDocument/documentLink",E.type=new s.ProtocolRequestType(E.method),E.resultType=new i.ProgressType,(t.DocumentLinkResolveRequest||(t.DocumentLinkResolveRequest={})).type=new s.ProtocolRequestType("documentLink/resolve"),(v=t.DocumentFormattingRequest||(t.DocumentFormattingRequest={})).method="textDocument/formatting",v.type=new s.ProtocolRequestType(v.method),(C=t.DocumentRangeFormattingRequest||(t.DocumentRangeFormattingRequest={})).method="textDocument/rangeFormatting",C.type=new s.ProtocolRequestType(C.method),(D=t.DocumentOnTypeFormattingRequest||(t.DocumentOnTypeFormattingRequest={})).method="textDocument/onTypeFormatting",D.type=new s.ProtocolRequestType(D.method),(y=t.RenameRequest||(t.RenameRequest={})).method="textDocument/rename",y.type=new s.ProtocolRequestType(y.method),(x=t.PrepareRenameRequest||(t.PrepareRenameRequest={})).method="textDocument/prepareRename",x.type=new s.ProtocolRequestType(x.method),(t.ExecuteCommandRequest||(t.ExecuteCommandRequest={})).type=new s.ProtocolRequestType("workspace/executeCommand"),(t.ApplyWorkspaceEditRequest||(t.ApplyWorkspaceEditRequest={})).type=new s.ProtocolRequestType("workspace/applyEdit")},(e,t)=>{"use strict";function n(e){return"string"==typeof e||e instanceof String}function r(e){return Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.boolean=function(e){return!0===e||!1===e},t.string=n,t.number=function(e){return"number"==typeof e||e instanceof Number},t.error=function(e){return e instanceof Error},t.func=function(e){return"function"==typeof e},t.array=r,t.stringArray=function(e){return r(e)&&e.every((e=>n(e)))},t.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},t.objectLiteral=function(e){return null!==e&&"object"==typeof e}},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165);class i extends r.RequestType0{constructor(e){super(e)}}t.ProtocolRequestType0=i;class s extends r.RequestType{constructor(e){super(e)}}t.ProtocolRequestType=s;class o extends r.NotificationType{constructor(e){super(e)}}t.ProtocolNotificationType=o;class a extends r.NotificationType0{constructor(e){super(e)}}t.ProtocolNotificationType0=a},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);var s;(s=t.ImplementationRequest||(t.ImplementationRequest={})).method="textDocument/implementation",s.type=new i.ProtocolRequestType(s.method),s.resultType=new r.ProgressType},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);var s;(s=t.TypeDefinitionRequest||(t.TypeDefinitionRequest={})).method="textDocument/typeDefinition",s.type=new i.ProtocolRequestType(s.method),s.resultType=new r.ProgressType},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(180);(t.WorkspaceFoldersRequest||(t.WorkspaceFoldersRequest={})).type=new r.ProtocolRequestType0("workspace/workspaceFolders"),(t.DidChangeWorkspaceFoldersNotification||(t.DidChangeWorkspaceFoldersNotification={})).type=new r.ProtocolNotificationType("workspace/didChangeWorkspaceFolders")},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(180);(t.ConfigurationRequest||(t.ConfigurationRequest={})).type=new r.ProtocolRequestType("workspace/configuration")},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);var s;(s=t.DocumentColorRequest||(t.DocumentColorRequest={})).method="textDocument/documentColor",s.type=new i.ProtocolRequestType(s.method),s.resultType=new r.ProgressType,(t.ColorPresentationRequest||(t.ColorPresentationRequest={})).type=new i.ProtocolRequestType("textDocument/colorPresentation")},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);var s,o;(o=t.FoldingRangeKind||(t.FoldingRangeKind={})).Comment="comment",o.Imports="imports",o.Region="region",(s=t.FoldingRangeRequest||(t.FoldingRangeRequest={})).method="textDocument/foldingRange",s.type=new i.ProtocolRequestType(s.method),s.resultType=new r.ProgressType},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);var s;(s=t.DeclarationRequest||(t.DeclarationRequest={})).method="textDocument/declaration",s.type=new i.ProtocolRequestType(s.method),s.resultType=new r.ProgressType},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);var s;(s=t.SelectionRangeRequest||(t.SelectionRangeRequest={})).method="textDocument/selectionRange",s.type=new i.ProtocolRequestType(s.method),s.resultType=new r.ProgressType},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(165),i=n(180);(t.WorkDoneProgress||(t.WorkDoneProgress={})).type=new r.ProgressType,(t.WorkDoneProgressCreateRequest||(t.WorkDoneProgressCreateRequest={})).type=new i.ProtocolRequestType("window/workDoneProgress/create"),(t.WorkDoneProgressCancelNotification||(t.WorkDoneProgressCancelNotification={})).type=new i.ProtocolNotificationType("window/workDoneProgress/cancel")},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(180);var i,s,o;(o=t.CallHierarchyPrepareRequest||(t.CallHierarchyPrepareRequest={})).method="textDocument/prepareCallHierarchy",o.type=new r.ProtocolRequestType(o.method),(s=t.CallHierarchyIncomingCallsRequest||(t.CallHierarchyIncomingCallsRequest={})).method="callHierarchy/incomingCalls",s.type=new r.ProtocolRequestType(s.method),(i=t.CallHierarchyOutgoingCallsRequest||(t.CallHierarchyOutgoingCallsRequest={})).method="callHierarchy/outgoingCalls",i.type=new r.ProtocolRequestType(i.method)},(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(180);var i,s,o,a,u;(u=t.SemanticTokenTypes||(t.SemanticTokenTypes={})).comment="comment",u.keyword="keyword",u.string="string",u.number="number",u.regexp="regexp",u.operator="operator",u.namespace="namespace",u.type="type",u.struct="struct",u.class="class",u.interface="interface",u.enum="enum",u.typeParameter="typeParameter",u.function="function",u.member="member",u.property="property",u.macro="macro",u.variable="variable",u.parameter="parameter",u.label="label",(a=t.SemanticTokenModifiers||(t.SemanticTokenModifiers={})).documentation="documentation",a.declaration="declaration",a.definition="definition",a.reference="reference",a.static="static",a.abstract="abstract",a.deprecated="deprecated",a.async="async",a.volatile="volatile",a.readonly="readonly",(t.SemanticTokens||(t.SemanticTokens={})).is=function(e){const t=e;return void 0!==t&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])},(o=t.SemanticTokensRequest||(t.SemanticTokensRequest={})).method="textDocument/semanticTokens",o.type=new r.ProtocolRequestType(o.method),(s=t.SemanticTokensEditsRequest||(t.SemanticTokensEditsRequest={})).method="textDocument/semanticTokens/edits",s.type=new r.ProtocolRequestType(s.method),(i=t.SemanticTokensRangeRequest||(t.SemanticTokensRangeRequest={})).method="textDocument/semanticTokens/range",i.type=new r.ProtocolRequestType(i.method)}],t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}return n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(0)})()); \ No newline at end of file