You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/97705.async.js

14193 lines
544 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(self["webpackChunk"] = self["webpackChunk"] || []).push([[97705],{
/***/ 86061:
/*!******************************************************************!*\
!*** ./node_modules/_js-beautify@1.15.1@js-beautify/js/index.js ***!
\******************************************************************/
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*jshint node:true */
/* globals define */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**
The following batches are equivalent:
var beautify_js = require('js-beautify');
var beautify_js = require('js-beautify').js;
var beautify_js = require('js-beautify').js_beautify;
var beautify_css = require('js-beautify').css;
var beautify_css = require('js-beautify').css_beautify;
var beautify_html = require('js-beautify').html;
var beautify_html = require('js-beautify').html_beautify;
All methods returned accept two arguments, the source string and an options object.
**/
function get_beautify(js_beautify, css_beautify, html_beautify) {
// the default is js
var beautify = function(src, config) {
return js_beautify.js_beautify(src, config);
};
// short aliases
beautify.js = js_beautify.js_beautify;
beautify.css = css_beautify.css_beautify;
beautify.html = html_beautify.html_beautify;
// legacy aliases
beautify.js_beautify = js_beautify.js_beautify;
beautify.css_beautify = css_beautify.css_beautify;
beautify.html_beautify = html_beautify.html_beautify;
return beautify;
}
if (true) {
// Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [
__webpack_require__(/*! ./lib/beautify */ 32328),
__webpack_require__(/*! ./lib/beautify-css */ 34655),
__webpack_require__(/*! ./lib/beautify-html */ 32708)
], __WEBPACK_AMD_DEFINE_RESULT__ = (function(js_beautify, css_beautify, html_beautify) {
return get_beautify(js_beautify, css_beautify, html_beautify);
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
/***/ }),
/***/ 34655:
/*!*****************************************************************************!*\
!*** ./node_modules/_js-beautify@1.15.1@js-beautify/js/lib/beautify-css.js ***!
\*****************************************************************************/
/***/ (function(module, exports) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* AUTO-GENERATED. DO NOT MODIFY. */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
CSS Beautifier
---------------
Written by Harutyun Amirjanyan, (amirjanyan@gmail.com)
Based on code initially developed by: Einar Lielmanis, <einar@beautifier.io>
https://beautifier.io/
Usage:
css_beautify(source_text);
css_beautify(source_text, options);
The options are (default in brackets):
indent_size (4) — indentation size,
indent_char (space) — character to indent with,
selector_separator_newline (true) - separate selectors with newline or
not (e.g. "a,\nbr" or "a, br")
end_with_newline (false) - end with a newline
newline_between_rules (true) - add a new line after every css rule
space_around_selector_separator (false) - ensure space around selector separators:
'>', '+', '~' (e.g. "a>b" -> "a > b")
e.g
css_beautify(css_source_text, {
'indent_size': 1,
'indent_char': '\t',
'selector_separator': ' ',
'end_with_newline': false,
'newline_between_rules': true,
'space_around_selector_separator': true
});
*/
// http://www.w3.org/TR/CSS21/syndata.html#tokenization
// http://www.w3.org/TR/css3-syntax/
(function() {
/* GENERATED_BUILD_OUTPUT */
var legacy_beautify_css;
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */,
/* 1 */,
/* 2 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function OutputLine(parent) {
this.__parent = parent;
this.__character_count = 0;
// use indent_count as a marker for this.__lines that have preserved indentation
this.__indent_count = -1;
this.__alignment_count = 0;
this.__wrap_point_index = 0;
this.__wrap_point_character_count = 0;
this.__wrap_point_indent_count = -1;
this.__wrap_point_alignment_count = 0;
this.__items = [];
}
OutputLine.prototype.clone_empty = function() {
var line = new OutputLine(this.__parent);
line.set_indent(this.__indent_count, this.__alignment_count);
return line;
};
OutputLine.prototype.item = function(index) {
if (index < 0) {
return this.__items[this.__items.length + index];
} else {
return this.__items[index];
}
};
OutputLine.prototype.has_match = function(pattern) {
for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) {
if (this.__items[lastCheckedOutput].match(pattern)) {
return true;
}
}
return false;
};
OutputLine.prototype.set_indent = function(indent, alignment) {
if (this.is_empty()) {
this.__indent_count = indent || 0;
this.__alignment_count = alignment || 0;
this.__character_count = this.__parent.get_indent_size(this.__indent_count, this.__alignment_count);
}
};
OutputLine.prototype._set_wrap_point = function() {
if (this.__parent.wrap_line_length) {
this.__wrap_point_index = this.__items.length;
this.__wrap_point_character_count = this.__character_count;
this.__wrap_point_indent_count = this.__parent.next_line.__indent_count;
this.__wrap_point_alignment_count = this.__parent.next_line.__alignment_count;
}
};
OutputLine.prototype._should_wrap = function() {
return this.__wrap_point_index &&
this.__character_count > this.__parent.wrap_line_length &&
this.__wrap_point_character_count > this.__parent.next_line.__character_count;
};
OutputLine.prototype._allow_wrap = function() {
if (this._should_wrap()) {
this.__parent.add_new_line();
var next = this.__parent.current_line;
next.set_indent(this.__wrap_point_indent_count, this.__wrap_point_alignment_count);
next.__items = this.__items.slice(this.__wrap_point_index);
this.__items = this.__items.slice(0, this.__wrap_point_index);
next.__character_count += this.__character_count - this.__wrap_point_character_count;
this.__character_count = this.__wrap_point_character_count;
if (next.__items[0] === " ") {
next.__items.splice(0, 1);
next.__character_count -= 1;
}
return true;
}
return false;
};
OutputLine.prototype.is_empty = function() {
return this.__items.length === 0;
};
OutputLine.prototype.last = function() {
if (!this.is_empty()) {
return this.__items[this.__items.length - 1];
} else {
return null;
}
};
OutputLine.prototype.push = function(item) {
this.__items.push(item);
var last_newline_index = item.lastIndexOf('\n');
if (last_newline_index !== -1) {
this.__character_count = item.length - last_newline_index;
} else {
this.__character_count += item.length;
}
};
OutputLine.prototype.pop = function() {
var item = null;
if (!this.is_empty()) {
item = this.__items.pop();
this.__character_count -= item.length;
}
return item;
};
OutputLine.prototype._remove_indent = function() {
if (this.__indent_count > 0) {
this.__indent_count -= 1;
this.__character_count -= this.__parent.indent_size;
}
};
OutputLine.prototype._remove_wrap_indent = function() {
if (this.__wrap_point_indent_count > 0) {
this.__wrap_point_indent_count -= 1;
}
};
OutputLine.prototype.trim = function() {
while (this.last() === ' ') {
this.__items.pop();
this.__character_count -= 1;
}
};
OutputLine.prototype.toString = function() {
var result = '';
if (this.is_empty()) {
if (this.__parent.indent_empty_lines) {
result = this.__parent.get_indent_string(this.__indent_count);
}
} else {
result = this.__parent.get_indent_string(this.__indent_count, this.__alignment_count);
result += this.__items.join('');
}
return result;
};
function IndentStringCache(options, baseIndentString) {
this.__cache = [''];
this.__indent_size = options.indent_size;
this.__indent_string = options.indent_char;
if (!options.indent_with_tabs) {
this.__indent_string = new Array(options.indent_size + 1).join(options.indent_char);
}
// Set to null to continue support for auto detection of base indent
baseIndentString = baseIndentString || '';
if (options.indent_level > 0) {
baseIndentString = new Array(options.indent_level + 1).join(this.__indent_string);
}
this.__base_string = baseIndentString;
this.__base_string_length = baseIndentString.length;
}
IndentStringCache.prototype.get_indent_size = function(indent, column) {
var result = this.__base_string_length;
column = column || 0;
if (indent < 0) {
result = 0;
}
result += indent * this.__indent_size;
result += column;
return result;
};
IndentStringCache.prototype.get_indent_string = function(indent_level, column) {
var result = this.__base_string;
column = column || 0;
if (indent_level < 0) {
indent_level = 0;
result = '';
}
column += indent_level * this.__indent_size;
this.__ensure_cache(column);
result += this.__cache[column];
return result;
};
IndentStringCache.prototype.__ensure_cache = function(column) {
while (column >= this.__cache.length) {
this.__add_column();
}
};
IndentStringCache.prototype.__add_column = function() {
var column = this.__cache.length;
var indent = 0;
var result = '';
if (this.__indent_size && column >= this.__indent_size) {
indent = Math.floor(column / this.__indent_size);
column -= indent * this.__indent_size;
result = new Array(indent + 1).join(this.__indent_string);
}
if (column) {
result += new Array(column + 1).join(' ');
}
this.__cache.push(result);
};
function Output(options, baseIndentString) {
this.__indent_cache = new IndentStringCache(options, baseIndentString);
this.raw = false;
this._end_with_newline = options.end_with_newline;
this.indent_size = options.indent_size;
this.wrap_line_length = options.wrap_line_length;
this.indent_empty_lines = options.indent_empty_lines;
this.__lines = [];
this.previous_line = null;
this.current_line = null;
this.next_line = new OutputLine(this);
this.space_before_token = false;
this.non_breaking_space = false;
this.previous_token_wrapped = false;
// initialize
this.__add_outputline();
}
Output.prototype.__add_outputline = function() {
this.previous_line = this.current_line;
this.current_line = this.next_line.clone_empty();
this.__lines.push(this.current_line);
};
Output.prototype.get_line_number = function() {
return this.__lines.length;
};
Output.prototype.get_indent_string = function(indent, column) {
return this.__indent_cache.get_indent_string(indent, column);
};
Output.prototype.get_indent_size = function(indent, column) {
return this.__indent_cache.get_indent_size(indent, column);
};
Output.prototype.is_empty = function() {
return !this.previous_line && this.current_line.is_empty();
};
Output.prototype.add_new_line = function(force_newline) {
// never newline at the start of file
// otherwise, newline only if we didn't just add one or we're forced
if (this.is_empty() ||
(!force_newline && this.just_added_newline())) {
return false;
}
// if raw output is enabled, don't print additional newlines,
// but still return True as though you had
if (!this.raw) {
this.__add_outputline();
}
return true;
};
Output.prototype.get_code = function(eol) {
this.trim(true);
// handle some edge cases where the last tokens
// has text that ends with newline(s)
var last_item = this.current_line.pop();
if (last_item) {
if (last_item[last_item.length - 1] === '\n') {
last_item = last_item.replace(/\n+$/g, '');
}
this.current_line.push(last_item);
}
if (this._end_with_newline) {
this.__add_outputline();
}
var sweet_code = this.__lines.join('\n');
if (eol !== '\n') {
sweet_code = sweet_code.replace(/[\n]/g, eol);
}
return sweet_code;
};
Output.prototype.set_wrap_point = function() {
this.current_line._set_wrap_point();
};
Output.prototype.set_indent = function(indent, alignment) {
indent = indent || 0;
alignment = alignment || 0;
// Next line stores alignment values
this.next_line.set_indent(indent, alignment);
// Never indent your first output indent at the start of the file
if (this.__lines.length > 1) {
this.current_line.set_indent(indent, alignment);
return true;
}
this.current_line.set_indent();
return false;
};
Output.prototype.add_raw_token = function(token) {
for (var x = 0; x < token.newlines; x++) {
this.__add_outputline();
}
this.current_line.set_indent(-1);
this.current_line.push(token.whitespace_before);
this.current_line.push(token.text);
this.space_before_token = false;
this.non_breaking_space = false;
this.previous_token_wrapped = false;
};
Output.prototype.add_token = function(printable_token) {
this.__add_space_before_token();
this.current_line.push(printable_token);
this.space_before_token = false;
this.non_breaking_space = false;
this.previous_token_wrapped = this.current_line._allow_wrap();
};
Output.prototype.__add_space_before_token = function() {
if (this.space_before_token && !this.just_added_newline()) {
if (!this.non_breaking_space) {
this.set_wrap_point();
}
this.current_line.push(' ');
}
};
Output.prototype.remove_indent = function(index) {
var output_length = this.__lines.length;
while (index < output_length) {
this.__lines[index]._remove_indent();
index++;
}
this.current_line._remove_wrap_indent();
};
Output.prototype.trim = function(eat_newlines) {
eat_newlines = (eat_newlines === undefined) ? false : eat_newlines;
this.current_line.trim();
while (eat_newlines && this.__lines.length > 1 &&
this.current_line.is_empty()) {
this.__lines.pop();
this.current_line = this.__lines[this.__lines.length - 1];
this.current_line.trim();
}
this.previous_line = this.__lines.length > 1 ?
this.__lines[this.__lines.length - 2] : null;
};
Output.prototype.just_added_newline = function() {
return this.current_line.is_empty();
};
Output.prototype.just_added_blankline = function() {
return this.is_empty() ||
(this.current_line.is_empty() && this.previous_line.is_empty());
};
Output.prototype.ensure_empty_line_above = function(starts_with, ends_with) {
var index = this.__lines.length - 2;
while (index >= 0) {
var potentialEmptyLine = this.__lines[index];
if (potentialEmptyLine.is_empty()) {
break;
} else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 &&
potentialEmptyLine.item(-1) !== ends_with) {
this.__lines.splice(index + 1, 0, new OutputLine(this));
this.previous_line = this.__lines[this.__lines.length - 2];
break;
}
index--;
}
};
module.exports.Output = Output;
/***/ }),
/* 3 */,
/* 4 */,
/* 5 */,
/* 6 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function Options(options, merge_child_field) {
this.raw_options = _mergeOpts(options, merge_child_field);
// Support passing the source text back with no change
this.disabled = this._get_boolean('disabled');
this.eol = this._get_characters('eol', 'auto');
this.end_with_newline = this._get_boolean('end_with_newline');
this.indent_size = this._get_number('indent_size', 4);
this.indent_char = this._get_characters('indent_char', ' ');
this.indent_level = this._get_number('indent_level');
this.preserve_newlines = this._get_boolean('preserve_newlines', true);
this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786);
if (!this.preserve_newlines) {
this.max_preserve_newlines = 0;
}
this.indent_with_tabs = this._get_boolean('indent_with_tabs', this.indent_char === '\t');
if (this.indent_with_tabs) {
this.indent_char = '\t';
// indent_size behavior changed after 1.8.6
// It used to be that indent_size would be
// set to 1 for indent_with_tabs. That is no longer needed and
// actually doesn't make sense - why not use spaces? Further,
// that might produce unexpected behavior - tabs being used
// for single-column alignment. So, when indent_with_tabs is true
// and indent_size is 1, reset indent_size to 4.
if (this.indent_size === 1) {
this.indent_size = 4;
}
}
// Backwards compat with 1.3.x
this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char'));
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular']
// For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css).
// other values ignored
this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
}
Options.prototype._get_array = function(name, default_value) {
var option_value = this.raw_options[name];
var result = default_value || [];
if (typeof option_value === 'object') {
if (option_value !== null && typeof option_value.concat === 'function') {
result = option_value.concat();
}
} else if (typeof option_value === 'string') {
result = option_value.split(/[^a-zA-Z0-9_\/\-]+/);
}
return result;
};
Options.prototype._get_boolean = function(name, default_value) {
var option_value = this.raw_options[name];
var result = option_value === undefined ? !!default_value : !!option_value;
return result;
};
Options.prototype._get_characters = function(name, default_value) {
var option_value = this.raw_options[name];
var result = default_value || '';
if (typeof option_value === 'string') {
result = option_value.replace(/\\r/, '\r').replace(/\\n/, '\n').replace(/\\t/, '\t');
}
return result;
};
Options.prototype._get_number = function(name, default_value) {
var option_value = this.raw_options[name];
default_value = parseInt(default_value, 10);
if (isNaN(default_value)) {
default_value = 0;
}
var result = parseInt(option_value, 10);
if (isNaN(result)) {
result = default_value;
}
return result;
};
Options.prototype._get_selection = function(name, selection_list, default_value) {
var result = this._get_selection_list(name, selection_list, default_value);
if (result.length !== 1) {
throw new Error(
"Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" +
selection_list + "\nYou passed in: '" + this.raw_options[name] + "'");
}
return result[0];
};
Options.prototype._get_selection_list = function(name, selection_list, default_value) {
if (!selection_list || selection_list.length === 0) {
throw new Error("Selection list cannot be empty.");
}
default_value = default_value || [selection_list[0]];
if (!this._is_valid_selection(default_value, selection_list)) {
throw new Error("Invalid Default Value!");
}
var result = this._get_array(name, default_value);
if (!this._is_valid_selection(result, selection_list)) {
throw new Error(
"Invalid Option Value: The option '" + name + "' can contain only the following values:\n" +
selection_list + "\nYou passed in: '" + this.raw_options[name] + "'");
}
return result;
};
Options.prototype._is_valid_selection = function(result, selection_list) {
return result.length && selection_list.length &&
!result.some(function(item) { return selection_list.indexOf(item) === -1; });
};
// merges child options up with the parent options object
// Example: obj = {a: 1, b: {a: 2}}
// mergeOpts(obj, 'b')
//
// Returns: {a: 2}
function _mergeOpts(allOptions, childFieldName) {
var finalOpts = {};
allOptions = _normalizeOpts(allOptions);
var name;
for (name in allOptions) {
if (name !== childFieldName) {
finalOpts[name] = allOptions[name];
}
}
//merge in the per type settings for the childFieldName
if (childFieldName && allOptions[childFieldName]) {
for (name in allOptions[childFieldName]) {
finalOpts[name] = allOptions[childFieldName][name];
}
}
return finalOpts;
}
function _normalizeOpts(options) {
var convertedOpts = {};
var key;
for (key in options) {
var newKey = key.replace(/-/g, "_");
convertedOpts[newKey] = options[key];
}
return convertedOpts;
}
module.exports.Options = Options;
module.exports.normalizeOpts = _normalizeOpts;
module.exports.mergeOpts = _mergeOpts;
/***/ }),
/* 7 */,
/* 8 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var regexp_has_sticky = RegExp.prototype.hasOwnProperty('sticky');
function InputScanner(input_string) {
this.__input = input_string || '';
this.__input_length = this.__input.length;
this.__position = 0;
}
InputScanner.prototype.restart = function() {
this.__position = 0;
};
InputScanner.prototype.back = function() {
if (this.__position > 0) {
this.__position -= 1;
}
};
InputScanner.prototype.hasNext = function() {
return this.__position < this.__input_length;
};
InputScanner.prototype.next = function() {
var val = null;
if (this.hasNext()) {
val = this.__input.charAt(this.__position);
this.__position += 1;
}
return val;
};
InputScanner.prototype.peek = function(index) {
var val = null;
index = index || 0;
index += this.__position;
if (index >= 0 && index < this.__input_length) {
val = this.__input.charAt(index);
}
return val;
};
// This is a JavaScript only helper function (not in python)
// Javascript doesn't have a match method
// and not all implementation support "sticky" flag.
// If they do not support sticky then both this.match() and this.test() method
// must get the match and check the index of the match.
// If sticky is supported and set, this method will use it.
// Otherwise it will check that global is set, and fall back to the slower method.
InputScanner.prototype.__match = function(pattern, index) {
pattern.lastIndex = index;
var pattern_match = pattern.exec(this.__input);
if (pattern_match && !(regexp_has_sticky && pattern.sticky)) {
if (pattern_match.index !== index) {
pattern_match = null;
}
}
return pattern_match;
};
InputScanner.prototype.test = function(pattern, index) {
index = index || 0;
index += this.__position;
if (index >= 0 && index < this.__input_length) {
return !!this.__match(pattern, index);
} else {
return false;
}
};
InputScanner.prototype.testChar = function(pattern, index) {
// test one character regex match
var val = this.peek(index);
pattern.lastIndex = 0;
return val !== null && pattern.test(val);
};
InputScanner.prototype.match = function(pattern) {
var pattern_match = this.__match(pattern, this.__position);
if (pattern_match) {
this.__position += pattern_match[0].length;
} else {
pattern_match = null;
}
return pattern_match;
};
InputScanner.prototype.read = function(starting_pattern, until_pattern, until_after) {
var val = '';
var match;
if (starting_pattern) {
match = this.match(starting_pattern);
if (match) {
val += match[0];
}
}
if (until_pattern && (match || !starting_pattern)) {
val += this.readUntil(until_pattern, until_after);
}
return val;
};
InputScanner.prototype.readUntil = function(pattern, until_after) {
var val = '';
var match_index = this.__position;
pattern.lastIndex = this.__position;
var pattern_match = pattern.exec(this.__input);
if (pattern_match) {
match_index = pattern_match.index;
if (until_after) {
match_index += pattern_match[0].length;
}
} else {
match_index = this.__input_length;
}
val = this.__input.substring(this.__position, match_index);
this.__position = match_index;
return val;
};
InputScanner.prototype.readUntilAfter = function(pattern) {
return this.readUntil(pattern, true);
};
InputScanner.prototype.get_regexp = function(pattern, match_from) {
var result = null;
var flags = 'g';
if (match_from && regexp_has_sticky) {
flags = 'y';
}
// strings are converted to regexp
if (typeof pattern === "string" && pattern !== '') {
// result = new RegExp(pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), flags);
result = new RegExp(pattern, flags);
} else if (pattern) {
result = new RegExp(pattern.source, flags);
}
return result;
};
InputScanner.prototype.get_literal_regexp = function(literal_string) {
return RegExp(literal_string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'));
};
/* css beautifier legacy helpers */
InputScanner.prototype.peekUntilAfter = function(pattern) {
var start = this.__position;
var val = this.readUntilAfter(pattern);
this.__position = start;
return val;
};
InputScanner.prototype.lookBack = function(testVal) {
var start = this.__position - 1;
return start >= testVal.length && this.__input.substring(start - testVal.length, start)
.toLowerCase() === testVal;
};
module.exports.InputScanner = InputScanner;
/***/ }),
/* 9 */,
/* 10 */,
/* 11 */,
/* 12 */,
/* 13 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function Directives(start_block_pattern, end_block_pattern) {
start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source;
end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source;
this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \w+[:]\w+)+ /.source + end_block_pattern, 'g');
this.__directive_pattern = / (\w+)[:](\w+)/g;
this.__directives_end_ignore_pattern = new RegExp(start_block_pattern + /\sbeautify\signore:end\s/.source + end_block_pattern, 'g');
}
Directives.prototype.get_directives = function(text) {
if (!text.match(this.__directives_block_pattern)) {
return null;
}
var directives = {};
this.__directive_pattern.lastIndex = 0;
var directive_match = this.__directive_pattern.exec(text);
while (directive_match) {
directives[directive_match[1]] = directive_match[2];
directive_match = this.__directive_pattern.exec(text);
}
return directives;
};
Directives.prototype.readIgnored = function(input) {
return input.readUntilAfter(this.__directives_end_ignore_pattern);
};
module.exports.Directives = Directives;
/***/ }),
/* 14 */,
/* 15 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_30167__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var Beautifier = (__nested_webpack_require_30167__(16).Beautifier),
Options = (__nested_webpack_require_30167__(17).Options);
function css_beautify(source_text, options) {
var beautifier = new Beautifier(source_text, options);
return beautifier.beautify();
}
module.exports = css_beautify;
module.exports.defaultOptions = function() {
return new Options();
};
/***/ }),
/* 16 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_31795__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var Options = (__nested_webpack_require_31795__(17).Options);
var Output = (__nested_webpack_require_31795__(2).Output);
var InputScanner = (__nested_webpack_require_31795__(8).InputScanner);
var Directives = (__nested_webpack_require_31795__(13).Directives);
var directives_core = new Directives(/\/\*/, /\*\//);
var lineBreak = /\r\n|[\r\n]/;
var allLineBreaks = /\r\n|[\r\n]/g;
// tokenizer
var whitespaceChar = /\s/;
var whitespacePattern = /(?:\s|\n)+/g;
var block_comment_pattern = /\/\*(?:[\s\S]*?)((?:\*\/)|$)/g;
var comment_pattern = /\/\/(?:[^\n\r\u2028\u2029]*)/g;
function Beautifier(source_text, options) {
this._source_text = source_text || '';
// Allow the setting of language/file-type specific options
// with inheritance of overall settings
this._options = new Options(options);
this._ch = null;
this._input = null;
// https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule
this.NESTED_AT_RULE = {
"page": true,
"font-face": true,
"keyframes": true,
// also in CONDITIONAL_GROUP_RULE below
"media": true,
"supports": true,
"document": true
};
this.CONDITIONAL_GROUP_RULE = {
"media": true,
"supports": true,
"document": true
};
this.NON_SEMICOLON_NEWLINE_PROPERTY = [
"grid-template-areas",
"grid-template"
];
}
Beautifier.prototype.eatString = function(endChars) {
var result = '';
this._ch = this._input.next();
while (this._ch) {
result += this._ch;
if (this._ch === "\\") {
result += this._input.next();
} else if (endChars.indexOf(this._ch) !== -1 || this._ch === "\n") {
break;
}
this._ch = this._input.next();
}
return result;
};
// Skips any white space in the source text from the current position.
// When allowAtLeastOneNewLine is true, will output new lines for each
// newline character found; if the user has preserve_newlines off, only
// the first newline will be output
Beautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) {
var result = whitespaceChar.test(this._input.peek());
var newline_count = 0;
while (whitespaceChar.test(this._input.peek())) {
this._ch = this._input.next();
if (allowAtLeastOneNewLine && this._ch === '\n') {
if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) {
newline_count++;
this._output.add_new_line(true);
}
}
}
return result;
};
// Nested pseudo-class if we are insideRule
// and the next special character found opens
// a new block
Beautifier.prototype.foundNestedPseudoClass = function() {
var openParen = 0;
var i = 1;
var ch = this._input.peek(i);
while (ch) {
if (ch === "{") {
return true;
} else if (ch === '(') {
// pseudoclasses can contain ()
openParen += 1;
} else if (ch === ')') {
if (openParen === 0) {
return false;
}
openParen -= 1;
} else if (ch === ";" || ch === "}") {
return false;
}
i++;
ch = this._input.peek(i);
}
return false;
};
Beautifier.prototype.print_string = function(output_string) {
this._output.set_indent(this._indentLevel);
this._output.non_breaking_space = true;
this._output.add_token(output_string);
};
Beautifier.prototype.preserveSingleSpace = function(isAfterSpace) {
if (isAfterSpace) {
this._output.space_before_token = true;
}
};
Beautifier.prototype.indent = function() {
this._indentLevel++;
};
Beautifier.prototype.outdent = function() {
if (this._indentLevel > 0) {
this._indentLevel--;
}
};
/*_____________________--------------------_____________________*/
Beautifier.prototype.beautify = function() {
if (this._options.disabled) {
return this._source_text;
}
var source_text = this._source_text;
var eol = this._options.eol;
if (eol === 'auto') {
eol = '\n';
if (source_text && lineBreak.test(source_text || '')) {
eol = source_text.match(lineBreak)[0];
}
}
// HACK: newline parsing inconsistent. This brute force normalizes the this._input.
source_text = source_text.replace(allLineBreaks, '\n');
// reset
var baseIndentString = source_text.match(/^[\t ]*/)[0];
this._output = new Output(this._options, baseIndentString);
this._input = new InputScanner(source_text);
this._indentLevel = 0;
this._nestedLevel = 0;
this._ch = null;
var parenLevel = 0;
var insideRule = false;
// This is the value side of a property value pair (blue in the following ex)
// label { content: blue }
var insidePropertyValue = false;
var enteringConditionalGroup = false;
var insideNonNestedAtRule = false;
var insideScssMap = false;
var topCharacter = this._ch;
var insideNonSemiColonValues = false;
var whitespace;
var isAfterSpace;
var previous_ch;
while (true) {
whitespace = this._input.read(whitespacePattern);
isAfterSpace = whitespace !== '';
previous_ch = topCharacter;
this._ch = this._input.next();
if (this._ch === '\\' && this._input.hasNext()) {
this._ch += this._input.next();
}
topCharacter = this._ch;
if (!this._ch) {
break;
} else if (this._ch === '/' && this._input.peek() === '*') {
// /* css comment */
// Always start block comments on a new line.
// This handles scenarios where a block comment immediately
// follows a property definition on the same line or where
// minified code is being beautified.
this._output.add_new_line();
this._input.back();
var comment = this._input.read(block_comment_pattern);
// Handle ignore directive
var directives = directives_core.get_directives(comment);
if (directives && directives.ignore === 'start') {
comment += directives_core.readIgnored(this._input);
}
this.print_string(comment);
// Ensures any new lines following the comment are preserved
this.eatWhitespace(true);
// Block comments are followed by a new line so they don't
// share a line with other properties
this._output.add_new_line();
} else if (this._ch === '/' && this._input.peek() === '/') {
// // single line comment
// Preserves the space before a comment
// on the same line as a rule
this._output.space_before_token = true;
this._input.back();
this.print_string(this._input.read(comment_pattern));
// Ensures any new lines following the comment are preserved
this.eatWhitespace(true);
} else if (this._ch === '$') {
this.preserveSingleSpace(isAfterSpace);
this.print_string(this._ch);
// strip trailing space, if present, for hash property checks
var variable = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);
if (variable.match(/[ :]$/)) {
// we have a variable or pseudo-class, add it and insert one space before continuing
variable = this.eatString(": ").replace(/\s+$/, '');
this.print_string(variable);
this._output.space_before_token = true;
}
// might be sass variable
if (parenLevel === 0 && variable.indexOf(':') !== -1) {
insidePropertyValue = true;
this.indent();
}
} else if (this._ch === '@') {
this.preserveSingleSpace(isAfterSpace);
// deal with less property mixins @{...}
if (this._input.peek() === '{') {
this.print_string(this._ch + this.eatString('}'));
} else {
this.print_string(this._ch);
// strip trailing space, if present, for hash property checks
var variableOrRule = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);
if (variableOrRule.match(/[ :]$/)) {
// we have a variable or pseudo-class, add it and insert one space before continuing
variableOrRule = this.eatString(": ").replace(/\s+$/, '');
this.print_string(variableOrRule);
this._output.space_before_token = true;
}
// might be less variable
if (parenLevel === 0 && variableOrRule.indexOf(':') !== -1) {
insidePropertyValue = true;
this.indent();
// might be a nesting at-rule
} else if (variableOrRule in this.NESTED_AT_RULE) {
this._nestedLevel += 1;
if (variableOrRule in this.CONDITIONAL_GROUP_RULE) {
enteringConditionalGroup = true;
}
// might be a non-nested at-rule
} else if (parenLevel === 0 && !insidePropertyValue) {
insideNonNestedAtRule = true;
}
}
} else if (this._ch === '#' && this._input.peek() === '{') {
this.preserveSingleSpace(isAfterSpace);
this.print_string(this._ch + this.eatString('}'));
} else if (this._ch === '{') {
if (insidePropertyValue) {
insidePropertyValue = false;
this.outdent();
}
// non nested at rule becomes nested
insideNonNestedAtRule = false;
// when entering conditional groups, only rulesets are allowed
if (enteringConditionalGroup) {
enteringConditionalGroup = false;
insideRule = (this._indentLevel >= this._nestedLevel);
} else {
// otherwise, declarations are also allowed
insideRule = (this._indentLevel >= this._nestedLevel - 1);
}
if (this._options.newline_between_rules && insideRule) {
if (this._output.previous_line && this._output.previous_line.item(-1) !== '{') {
this._output.ensure_empty_line_above('/', ',');
}
}
this._output.space_before_token = true;
// The difference in print_string and indent order is necessary to indent the '{' correctly
if (this._options.brace_style === 'expand') {
this._output.add_new_line();
this.print_string(this._ch);
this.indent();
this._output.set_indent(this._indentLevel);
} else {
// inside mixin and first param is object
if (previous_ch === '(') {
this._output.space_before_token = false;
} else if (previous_ch !== ',') {
this.indent();
}
this.print_string(this._ch);
}
this.eatWhitespace(true);
this._output.add_new_line();
} else if (this._ch === '}') {
this.outdent();
this._output.add_new_line();
if (previous_ch === '{') {
this._output.trim(true);
}
if (insidePropertyValue) {
this.outdent();
insidePropertyValue = false;
}
this.print_string(this._ch);
insideRule = false;
if (this._nestedLevel) {
this._nestedLevel--;
}
this.eatWhitespace(true);
this._output.add_new_line();
if (this._options.newline_between_rules && !this._output.just_added_blankline()) {
if (this._input.peek() !== '}') {
this._output.add_new_line(true);
}
}
if (this._input.peek() === ')') {
this._output.trim(true);
if (this._options.brace_style === "expand") {
this._output.add_new_line(true);
}
}
} else if (this._ch === ":") {
for (var i = 0; i < this.NON_SEMICOLON_NEWLINE_PROPERTY.length; i++) {
if (this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[i])) {
insideNonSemiColonValues = true;
break;
}
}
if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideNonNestedAtRule && parenLevel === 0) {
// 'property: value' delimiter
// which could be in a conditional group query
this.print_string(':');
if (!insidePropertyValue) {
insidePropertyValue = true;
this._output.space_before_token = true;
this.eatWhitespace(true);
this.indent();
}
} else {
// sass/less parent reference don't use a space
// sass nested pseudo-class don't use a space
// preserve space before pseudoclasses/pseudoelements, as it means "in any child"
if (this._input.lookBack(" ")) {
this._output.space_before_token = true;
}
if (this._input.peek() === ":") {
// pseudo-element
this._ch = this._input.next();
this.print_string("::");
} else {
// pseudo-class
this.print_string(':');
}
}
} else if (this._ch === '"' || this._ch === '\'') {
var preserveQuoteSpace = previous_ch === '"' || previous_ch === '\'';
this.preserveSingleSpace(preserveQuoteSpace || isAfterSpace);
this.print_string(this._ch + this.eatString(this._ch));
this.eatWhitespace(true);
} else if (this._ch === ';') {
insideNonSemiColonValues = false;
if (parenLevel === 0) {
if (insidePropertyValue) {
this.outdent();
insidePropertyValue = false;
}
insideNonNestedAtRule = false;
this.print_string(this._ch);
this.eatWhitespace(true);
// This maintains single line comments on the same
// line. Block comments are also affected, but
// a new line is always output before one inside
// that section
if (this._input.peek() !== '/') {
this._output.add_new_line();
}
} else {
this.print_string(this._ch);
this.eatWhitespace(true);
this._output.space_before_token = true;
}
} else if (this._ch === '(') { // may be a url
if (this._input.lookBack("url")) {
this.print_string(this._ch);
this.eatWhitespace();
parenLevel++;
this.indent();
this._ch = this._input.next();
if (this._ch === ')' || this._ch === '"' || this._ch === '\'') {
this._input.back();
} else if (this._ch) {
this.print_string(this._ch + this.eatString(')'));
if (parenLevel) {
parenLevel--;
this.outdent();
}
}
} else {
var space_needed = false;
if (this._input.lookBack("with")) {
// look back is not an accurate solution, we need tokens to confirm without whitespaces
space_needed = true;
}
this.preserveSingleSpace(isAfterSpace || space_needed);
this.print_string(this._ch);
// handle scss/sass map
if (insidePropertyValue && previous_ch === "$" && this._options.selector_separator_newline) {
this._output.add_new_line();
insideScssMap = true;
} else {
this.eatWhitespace();
parenLevel++;
this.indent();
}
}
} else if (this._ch === ')') {
if (parenLevel) {
parenLevel--;
this.outdent();
}
if (insideScssMap && this._input.peek() === ";" && this._options.selector_separator_newline) {
insideScssMap = false;
this.outdent();
this._output.add_new_line();
}
this.print_string(this._ch);
} else if (this._ch === ',') {
this.print_string(this._ch);
this.eatWhitespace(true);
if (this._options.selector_separator_newline && (!insidePropertyValue || insideScssMap) && parenLevel === 0 && !insideNonNestedAtRule) {
this._output.add_new_line();
} else {
this._output.space_before_token = true;
}
} else if ((this._ch === '>' || this._ch === '+' || this._ch === '~') && !insidePropertyValue && parenLevel === 0) {
//handle combinator spacing
if (this._options.space_around_combinator) {
this._output.space_before_token = true;
this.print_string(this._ch);
this._output.space_before_token = true;
} else {
this.print_string(this._ch);
this.eatWhitespace();
// squash extra whitespace
if (this._ch && whitespaceChar.test(this._ch)) {
this._ch = '';
}
}
} else if (this._ch === ']') {
this.print_string(this._ch);
} else if (this._ch === '[') {
this.preserveSingleSpace(isAfterSpace);
this.print_string(this._ch);
} else if (this._ch === '=') { // no whitespace before or after
this.eatWhitespace();
this.print_string('=');
if (whitespaceChar.test(this._ch)) {
this._ch = '';
}
} else if (this._ch === '!' && !this._input.lookBack("\\")) { // !important
this._output.space_before_token = true;
this.print_string(this._ch);
} else {
var preserveAfterSpace = previous_ch === '"' || previous_ch === '\'';
this.preserveSingleSpace(preserveAfterSpace || isAfterSpace);
this.print_string(this._ch);
if (!this._output.just_added_newline() && this._input.peek() === '\n' && insideNonSemiColonValues) {
this._output.add_new_line();
}
}
}
var sweetCode = this._output.get_code(eol);
return sweetCode;
};
module.exports.Beautifier = Beautifier;
/***/ }),
/* 17 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_49905__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var BaseOptions = (__nested_webpack_require_49905__(6).Options);
function Options(options) {
BaseOptions.call(this, options, 'css');
this.selector_separator_newline = this._get_boolean('selector_separator_newline', true);
this.newline_between_rules = this._get_boolean('newline_between_rules', true);
var space_around_selector_separator = this._get_boolean('space_around_selector_separator');
this.space_around_combinator = this._get_boolean('space_around_combinator') || space_around_selector_separator;
var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']);
this.brace_style = 'collapse';
for (var bs = 0; bs < brace_style_split.length; bs++) {
if (brace_style_split[bs] !== 'expand') {
// default to collapse, as only collapse|expand is implemented for now
this.brace_style = 'collapse';
} else {
this.brace_style = brace_style_split[bs];
}
}
}
Options.prototype = new BaseOptions();
module.exports.Options = Options;
/***/ })
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __nested_webpack_require_52385__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_52385__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __nested_webpack_exports__ = __nested_webpack_require_52385__(15);
/******/ legacy_beautify_css = __nested_webpack_exports__;
/******/
/******/ })()
;
var css_beautify = legacy_beautify_css;
/* Footer */
if (true) {
// Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
return {
css_beautify: css_beautify
};
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}());
/***/ }),
/***/ 32708:
/*!******************************************************************************!*\
!*** ./node_modules/_js-beautify@1.15.1@js-beautify/js/lib/beautify-html.js ***!
\******************************************************************************/
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* AUTO-GENERATED. DO NOT MODIFY. */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Style HTML
---------------
Written by Nochum Sossonko, (nsossonko@hotmail.com)
Based on code initially developed by: Einar Lielmanis, <einar@beautifier.io>
https://beautifier.io/
Usage:
style_html(html_source);
style_html(html_source, options);
The options are:
indent_inner_html (default false) — indent <head> and <body> sections,
indent_size (default 4) — indentation size,
indent_char (default space) — character to indent with,
wrap_line_length (default 250) - maximum amount of characters per line (0 = disable)
brace_style (default "collapse") - "collapse" | "expand" | "end-expand" | "none"
put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are.
inline (defaults to inline tags) - list of tags to be considered inline tags
unformatted (defaults to inline tags) - list of tags, that shouldn't be reformatted
content_unformatted (defaults to ["pre", "textarea"] tags) - list of tags, whose content shouldn't be reformatted
indent_scripts (default normal) - "keep"|"separate"|"normal"
preserve_newlines (default true) - whether existing line breaks before elements should be preserved
Only works before elements, not inside tags or for text.
max_preserve_newlines (default unlimited) - maximum number of line breaks to be preserved in one chunk
indent_handlebars (default false) - format and indent {{#foo}} and {{/foo}}
end_with_newline (false) - end with a newline
extra_liners (default [head,body,/html]) -List of tags that should have an extra newline before them.
e.g.
style_html(html_source, {
'indent_inner_html': false,
'indent_size': 2,
'indent_char': ' ',
'wrap_line_length': 78,
'brace_style': 'expand',
'preserve_newlines': true,
'max_preserve_newlines': 5,
'indent_handlebars': false,
'extra_liners': ['/html']
});
*/
(function() {
/* GENERATED_BUILD_OUTPUT */
var legacy_beautify_html;
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */,
/* 1 */,
/* 2 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function OutputLine(parent) {
this.__parent = parent;
this.__character_count = 0;
// use indent_count as a marker for this.__lines that have preserved indentation
this.__indent_count = -1;
this.__alignment_count = 0;
this.__wrap_point_index = 0;
this.__wrap_point_character_count = 0;
this.__wrap_point_indent_count = -1;
this.__wrap_point_alignment_count = 0;
this.__items = [];
}
OutputLine.prototype.clone_empty = function() {
var line = new OutputLine(this.__parent);
line.set_indent(this.__indent_count, this.__alignment_count);
return line;
};
OutputLine.prototype.item = function(index) {
if (index < 0) {
return this.__items[this.__items.length + index];
} else {
return this.__items[index];
}
};
OutputLine.prototype.has_match = function(pattern) {
for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) {
if (this.__items[lastCheckedOutput].match(pattern)) {
return true;
}
}
return false;
};
OutputLine.prototype.set_indent = function(indent, alignment) {
if (this.is_empty()) {
this.__indent_count = indent || 0;
this.__alignment_count = alignment || 0;
this.__character_count = this.__parent.get_indent_size(this.__indent_count, this.__alignment_count);
}
};
OutputLine.prototype._set_wrap_point = function() {
if (this.__parent.wrap_line_length) {
this.__wrap_point_index = this.__items.length;
this.__wrap_point_character_count = this.__character_count;
this.__wrap_point_indent_count = this.__parent.next_line.__indent_count;
this.__wrap_point_alignment_count = this.__parent.next_line.__alignment_count;
}
};
OutputLine.prototype._should_wrap = function() {
return this.__wrap_point_index &&
this.__character_count > this.__parent.wrap_line_length &&
this.__wrap_point_character_count > this.__parent.next_line.__character_count;
};
OutputLine.prototype._allow_wrap = function() {
if (this._should_wrap()) {
this.__parent.add_new_line();
var next = this.__parent.current_line;
next.set_indent(this.__wrap_point_indent_count, this.__wrap_point_alignment_count);
next.__items = this.__items.slice(this.__wrap_point_index);
this.__items = this.__items.slice(0, this.__wrap_point_index);
next.__character_count += this.__character_count - this.__wrap_point_character_count;
this.__character_count = this.__wrap_point_character_count;
if (next.__items[0] === " ") {
next.__items.splice(0, 1);
next.__character_count -= 1;
}
return true;
}
return false;
};
OutputLine.prototype.is_empty = function() {
return this.__items.length === 0;
};
OutputLine.prototype.last = function() {
if (!this.is_empty()) {
return this.__items[this.__items.length - 1];
} else {
return null;
}
};
OutputLine.prototype.push = function(item) {
this.__items.push(item);
var last_newline_index = item.lastIndexOf('\n');
if (last_newline_index !== -1) {
this.__character_count = item.length - last_newline_index;
} else {
this.__character_count += item.length;
}
};
OutputLine.prototype.pop = function() {
var item = null;
if (!this.is_empty()) {
item = this.__items.pop();
this.__character_count -= item.length;
}
return item;
};
OutputLine.prototype._remove_indent = function() {
if (this.__indent_count > 0) {
this.__indent_count -= 1;
this.__character_count -= this.__parent.indent_size;
}
};
OutputLine.prototype._remove_wrap_indent = function() {
if (this.__wrap_point_indent_count > 0) {
this.__wrap_point_indent_count -= 1;
}
};
OutputLine.prototype.trim = function() {
while (this.last() === ' ') {
this.__items.pop();
this.__character_count -= 1;
}
};
OutputLine.prototype.toString = function() {
var result = '';
if (this.is_empty()) {
if (this.__parent.indent_empty_lines) {
result = this.__parent.get_indent_string(this.__indent_count);
}
} else {
result = this.__parent.get_indent_string(this.__indent_count, this.__alignment_count);
result += this.__items.join('');
}
return result;
};
function IndentStringCache(options, baseIndentString) {
this.__cache = [''];
this.__indent_size = options.indent_size;
this.__indent_string = options.indent_char;
if (!options.indent_with_tabs) {
this.__indent_string = new Array(options.indent_size + 1).join(options.indent_char);
}
// Set to null to continue support for auto detection of base indent
baseIndentString = baseIndentString || '';
if (options.indent_level > 0) {
baseIndentString = new Array(options.indent_level + 1).join(this.__indent_string);
}
this.__base_string = baseIndentString;
this.__base_string_length = baseIndentString.length;
}
IndentStringCache.prototype.get_indent_size = function(indent, column) {
var result = this.__base_string_length;
column = column || 0;
if (indent < 0) {
result = 0;
}
result += indent * this.__indent_size;
result += column;
return result;
};
IndentStringCache.prototype.get_indent_string = function(indent_level, column) {
var result = this.__base_string;
column = column || 0;
if (indent_level < 0) {
indent_level = 0;
result = '';
}
column += indent_level * this.__indent_size;
this.__ensure_cache(column);
result += this.__cache[column];
return result;
};
IndentStringCache.prototype.__ensure_cache = function(column) {
while (column >= this.__cache.length) {
this.__add_column();
}
};
IndentStringCache.prototype.__add_column = function() {
var column = this.__cache.length;
var indent = 0;
var result = '';
if (this.__indent_size && column >= this.__indent_size) {
indent = Math.floor(column / this.__indent_size);
column -= indent * this.__indent_size;
result = new Array(indent + 1).join(this.__indent_string);
}
if (column) {
result += new Array(column + 1).join(' ');
}
this.__cache.push(result);
};
function Output(options, baseIndentString) {
this.__indent_cache = new IndentStringCache(options, baseIndentString);
this.raw = false;
this._end_with_newline = options.end_with_newline;
this.indent_size = options.indent_size;
this.wrap_line_length = options.wrap_line_length;
this.indent_empty_lines = options.indent_empty_lines;
this.__lines = [];
this.previous_line = null;
this.current_line = null;
this.next_line = new OutputLine(this);
this.space_before_token = false;
this.non_breaking_space = false;
this.previous_token_wrapped = false;
// initialize
this.__add_outputline();
}
Output.prototype.__add_outputline = function() {
this.previous_line = this.current_line;
this.current_line = this.next_line.clone_empty();
this.__lines.push(this.current_line);
};
Output.prototype.get_line_number = function() {
return this.__lines.length;
};
Output.prototype.get_indent_string = function(indent, column) {
return this.__indent_cache.get_indent_string(indent, column);
};
Output.prototype.get_indent_size = function(indent, column) {
return this.__indent_cache.get_indent_size(indent, column);
};
Output.prototype.is_empty = function() {
return !this.previous_line && this.current_line.is_empty();
};
Output.prototype.add_new_line = function(force_newline) {
// never newline at the start of file
// otherwise, newline only if we didn't just add one or we're forced
if (this.is_empty() ||
(!force_newline && this.just_added_newline())) {
return false;
}
// if raw output is enabled, don't print additional newlines,
// but still return True as though you had
if (!this.raw) {
this.__add_outputline();
}
return true;
};
Output.prototype.get_code = function(eol) {
this.trim(true);
// handle some edge cases where the last tokens
// has text that ends with newline(s)
var last_item = this.current_line.pop();
if (last_item) {
if (last_item[last_item.length - 1] === '\n') {
last_item = last_item.replace(/\n+$/g, '');
}
this.current_line.push(last_item);
}
if (this._end_with_newline) {
this.__add_outputline();
}
var sweet_code = this.__lines.join('\n');
if (eol !== '\n') {
sweet_code = sweet_code.replace(/[\n]/g, eol);
}
return sweet_code;
};
Output.prototype.set_wrap_point = function() {
this.current_line._set_wrap_point();
};
Output.prototype.set_indent = function(indent, alignment) {
indent = indent || 0;
alignment = alignment || 0;
// Next line stores alignment values
this.next_line.set_indent(indent, alignment);
// Never indent your first output indent at the start of the file
if (this.__lines.length > 1) {
this.current_line.set_indent(indent, alignment);
return true;
}
this.current_line.set_indent();
return false;
};
Output.prototype.add_raw_token = function(token) {
for (var x = 0; x < token.newlines; x++) {
this.__add_outputline();
}
this.current_line.set_indent(-1);
this.current_line.push(token.whitespace_before);
this.current_line.push(token.text);
this.space_before_token = false;
this.non_breaking_space = false;
this.previous_token_wrapped = false;
};
Output.prototype.add_token = function(printable_token) {
this.__add_space_before_token();
this.current_line.push(printable_token);
this.space_before_token = false;
this.non_breaking_space = false;
this.previous_token_wrapped = this.current_line._allow_wrap();
};
Output.prototype.__add_space_before_token = function() {
if (this.space_before_token && !this.just_added_newline()) {
if (!this.non_breaking_space) {
this.set_wrap_point();
}
this.current_line.push(' ');
}
};
Output.prototype.remove_indent = function(index) {
var output_length = this.__lines.length;
while (index < output_length) {
this.__lines[index]._remove_indent();
index++;
}
this.current_line._remove_wrap_indent();
};
Output.prototype.trim = function(eat_newlines) {
eat_newlines = (eat_newlines === undefined) ? false : eat_newlines;
this.current_line.trim();
while (eat_newlines && this.__lines.length > 1 &&
this.current_line.is_empty()) {
this.__lines.pop();
this.current_line = this.__lines[this.__lines.length - 1];
this.current_line.trim();
}
this.previous_line = this.__lines.length > 1 ?
this.__lines[this.__lines.length - 2] : null;
};
Output.prototype.just_added_newline = function() {
return this.current_line.is_empty();
};
Output.prototype.just_added_blankline = function() {
return this.is_empty() ||
(this.current_line.is_empty() && this.previous_line.is_empty());
};
Output.prototype.ensure_empty_line_above = function(starts_with, ends_with) {
var index = this.__lines.length - 2;
while (index >= 0) {
var potentialEmptyLine = this.__lines[index];
if (potentialEmptyLine.is_empty()) {
break;
} else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 &&
potentialEmptyLine.item(-1) !== ends_with) {
this.__lines.splice(index + 1, 0, new OutputLine(this));
this.previous_line = this.__lines[this.__lines.length - 2];
break;
}
index--;
}
};
module.exports.Output = Output;
/***/ }),
/* 3 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function Token(type, text, newlines, whitespace_before) {
this.type = type;
this.text = text;
// comments_before are
// comments that have a new line before them
// and may or may not have a newline after
// this is a set of comments before
this.comments_before = null; /* inline comment*/
// this.comments_after = new TokenStream(); // no new line before and newline after
this.newlines = newlines || 0;
this.whitespace_before = whitespace_before || '';
this.parent = null;
this.next = null;
this.previous = null;
this.opened = null;
this.closed = null;
this.directives = null;
}
module.exports.Token = Token;
/***/ }),
/* 4 */,
/* 5 */,
/* 6 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function Options(options, merge_child_field) {
this.raw_options = _mergeOpts(options, merge_child_field);
// Support passing the source text back with no change
this.disabled = this._get_boolean('disabled');
this.eol = this._get_characters('eol', 'auto');
this.end_with_newline = this._get_boolean('end_with_newline');
this.indent_size = this._get_number('indent_size', 4);
this.indent_char = this._get_characters('indent_char', ' ');
this.indent_level = this._get_number('indent_level');
this.preserve_newlines = this._get_boolean('preserve_newlines', true);
this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786);
if (!this.preserve_newlines) {
this.max_preserve_newlines = 0;
}
this.indent_with_tabs = this._get_boolean('indent_with_tabs', this.indent_char === '\t');
if (this.indent_with_tabs) {
this.indent_char = '\t';
// indent_size behavior changed after 1.8.6
// It used to be that indent_size would be
// set to 1 for indent_with_tabs. That is no longer needed and
// actually doesn't make sense - why not use spaces? Further,
// that might produce unexpected behavior - tabs being used
// for single-column alignment. So, when indent_with_tabs is true
// and indent_size is 1, reset indent_size to 4.
if (this.indent_size === 1) {
this.indent_size = 4;
}
}
// Backwards compat with 1.3.x
this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char'));
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular']
// For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css).
// other values ignored
this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
}
Options.prototype._get_array = function(name, default_value) {
var option_value = this.raw_options[name];
var result = default_value || [];
if (typeof option_value === 'object') {
if (option_value !== null && typeof option_value.concat === 'function') {
result = option_value.concat();
}
} else if (typeof option_value === 'string') {
result = option_value.split(/[^a-zA-Z0-9_\/\-]+/);
}
return result;
};
Options.prototype._get_boolean = function(name, default_value) {
var option_value = this.raw_options[name];
var result = option_value === undefined ? !!default_value : !!option_value;
return result;
};
Options.prototype._get_characters = function(name, default_value) {
var option_value = this.raw_options[name];
var result = default_value || '';
if (typeof option_value === 'string') {
result = option_value.replace(/\\r/, '\r').replace(/\\n/, '\n').replace(/\\t/, '\t');
}
return result;
};
Options.prototype._get_number = function(name, default_value) {
var option_value = this.raw_options[name];
default_value = parseInt(default_value, 10);
if (isNaN(default_value)) {
default_value = 0;
}
var result = parseInt(option_value, 10);
if (isNaN(result)) {
result = default_value;
}
return result;
};
Options.prototype._get_selection = function(name, selection_list, default_value) {
var result = this._get_selection_list(name, selection_list, default_value);
if (result.length !== 1) {
throw new Error(
"Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" +
selection_list + "\nYou passed in: '" + this.raw_options[name] + "'");
}
return result[0];
};
Options.prototype._get_selection_list = function(name, selection_list, default_value) {
if (!selection_list || selection_list.length === 0) {
throw new Error("Selection list cannot be empty.");
}
default_value = default_value || [selection_list[0]];
if (!this._is_valid_selection(default_value, selection_list)) {
throw new Error("Invalid Default Value!");
}
var result = this._get_array(name, default_value);
if (!this._is_valid_selection(result, selection_list)) {
throw new Error(
"Invalid Option Value: The option '" + name + "' can contain only the following values:\n" +
selection_list + "\nYou passed in: '" + this.raw_options[name] + "'");
}
return result;
};
Options.prototype._is_valid_selection = function(result, selection_list) {
return result.length && selection_list.length &&
!result.some(function(item) { return selection_list.indexOf(item) === -1; });
};
// merges child options up with the parent options object
// Example: obj = {a: 1, b: {a: 2}}
// mergeOpts(obj, 'b')
//
// Returns: {a: 2}
function _mergeOpts(allOptions, childFieldName) {
var finalOpts = {};
allOptions = _normalizeOpts(allOptions);
var name;
for (name in allOptions) {
if (name !== childFieldName) {
finalOpts[name] = allOptions[name];
}
}
//merge in the per type settings for the childFieldName
if (childFieldName && allOptions[childFieldName]) {
for (name in allOptions[childFieldName]) {
finalOpts[name] = allOptions[childFieldName][name];
}
}
return finalOpts;
}
function _normalizeOpts(options) {
var convertedOpts = {};
var key;
for (key in options) {
var newKey = key.replace(/-/g, "_");
convertedOpts[newKey] = options[key];
}
return convertedOpts;
}
module.exports.Options = Options;
module.exports.normalizeOpts = _normalizeOpts;
module.exports.mergeOpts = _mergeOpts;
/***/ }),
/* 7 */,
/* 8 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var regexp_has_sticky = RegExp.prototype.hasOwnProperty('sticky');
function InputScanner(input_string) {
this.__input = input_string || '';
this.__input_length = this.__input.length;
this.__position = 0;
}
InputScanner.prototype.restart = function() {
this.__position = 0;
};
InputScanner.prototype.back = function() {
if (this.__position > 0) {
this.__position -= 1;
}
};
InputScanner.prototype.hasNext = function() {
return this.__position < this.__input_length;
};
InputScanner.prototype.next = function() {
var val = null;
if (this.hasNext()) {
val = this.__input.charAt(this.__position);
this.__position += 1;
}
return val;
};
InputScanner.prototype.peek = function(index) {
var val = null;
index = index || 0;
index += this.__position;
if (index >= 0 && index < this.__input_length) {
val = this.__input.charAt(index);
}
return val;
};
// This is a JavaScript only helper function (not in python)
// Javascript doesn't have a match method
// and not all implementation support "sticky" flag.
// If they do not support sticky then both this.match() and this.test() method
// must get the match and check the index of the match.
// If sticky is supported and set, this method will use it.
// Otherwise it will check that global is set, and fall back to the slower method.
InputScanner.prototype.__match = function(pattern, index) {
pattern.lastIndex = index;
var pattern_match = pattern.exec(this.__input);
if (pattern_match && !(regexp_has_sticky && pattern.sticky)) {
if (pattern_match.index !== index) {
pattern_match = null;
}
}
return pattern_match;
};
InputScanner.prototype.test = function(pattern, index) {
index = index || 0;
index += this.__position;
if (index >= 0 && index < this.__input_length) {
return !!this.__match(pattern, index);
} else {
return false;
}
};
InputScanner.prototype.testChar = function(pattern, index) {
// test one character regex match
var val = this.peek(index);
pattern.lastIndex = 0;
return val !== null && pattern.test(val);
};
InputScanner.prototype.match = function(pattern) {
var pattern_match = this.__match(pattern, this.__position);
if (pattern_match) {
this.__position += pattern_match[0].length;
} else {
pattern_match = null;
}
return pattern_match;
};
InputScanner.prototype.read = function(starting_pattern, until_pattern, until_after) {
var val = '';
var match;
if (starting_pattern) {
match = this.match(starting_pattern);
if (match) {
val += match[0];
}
}
if (until_pattern && (match || !starting_pattern)) {
val += this.readUntil(until_pattern, until_after);
}
return val;
};
InputScanner.prototype.readUntil = function(pattern, until_after) {
var val = '';
var match_index = this.__position;
pattern.lastIndex = this.__position;
var pattern_match = pattern.exec(this.__input);
if (pattern_match) {
match_index = pattern_match.index;
if (until_after) {
match_index += pattern_match[0].length;
}
} else {
match_index = this.__input_length;
}
val = this.__input.substring(this.__position, match_index);
this.__position = match_index;
return val;
};
InputScanner.prototype.readUntilAfter = function(pattern) {
return this.readUntil(pattern, true);
};
InputScanner.prototype.get_regexp = function(pattern, match_from) {
var result = null;
var flags = 'g';
if (match_from && regexp_has_sticky) {
flags = 'y';
}
// strings are converted to regexp
if (typeof pattern === "string" && pattern !== '') {
// result = new RegExp(pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), flags);
result = new RegExp(pattern, flags);
} else if (pattern) {
result = new RegExp(pattern.source, flags);
}
return result;
};
InputScanner.prototype.get_literal_regexp = function(literal_string) {
return RegExp(literal_string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'));
};
/* css beautifier legacy helpers */
InputScanner.prototype.peekUntilAfter = function(pattern) {
var start = this.__position;
var val = this.readUntilAfter(pattern);
this.__position = start;
return val;
};
InputScanner.prototype.lookBack = function(testVal) {
var start = this.__position - 1;
return start >= testVal.length && this.__input.substring(start - testVal.length, start)
.toLowerCase() === testVal;
};
module.exports.InputScanner = InputScanner;
/***/ }),
/* 9 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_30328__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var InputScanner = (__nested_webpack_require_30328__(8).InputScanner);
var Token = (__nested_webpack_require_30328__(3).Token);
var TokenStream = (__nested_webpack_require_30328__(10).TokenStream);
var WhitespacePattern = (__nested_webpack_require_30328__(11).WhitespacePattern);
var TOKEN = {
START: 'TK_START',
RAW: 'TK_RAW',
EOF: 'TK_EOF'
};
var Tokenizer = function(input_string, options) {
this._input = new InputScanner(input_string);
this._options = options || {};
this.__tokens = null;
this._patterns = {};
this._patterns.whitespace = new WhitespacePattern(this._input);
};
Tokenizer.prototype.tokenize = function() {
this._input.restart();
this.__tokens = new TokenStream();
this._reset();
var current;
var previous = new Token(TOKEN.START, '');
var open_token = null;
var open_stack = [];
var comments = new TokenStream();
while (previous.type !== TOKEN.EOF) {
current = this._get_next_token(previous, open_token);
while (this._is_comment(current)) {
comments.add(current);
current = this._get_next_token(previous, open_token);
}
if (!comments.isEmpty()) {
current.comments_before = comments;
comments = new TokenStream();
}
current.parent = open_token;
if (this._is_opening(current)) {
open_stack.push(open_token);
open_token = current;
} else if (open_token && this._is_closing(current, open_token)) {
current.opened = open_token;
open_token.closed = current;
open_token = open_stack.pop();
current.parent = open_token;
}
current.previous = previous;
previous.next = current;
this.__tokens.add(current);
previous = current;
}
return this.__tokens;
};
Tokenizer.prototype._is_first_token = function() {
return this.__tokens.isEmpty();
};
Tokenizer.prototype._reset = function() {};
Tokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false
this._readWhitespace();
var resulting_string = this._input.read(/.+/g);
if (resulting_string) {
return this._create_token(TOKEN.RAW, resulting_string);
} else {
return this._create_token(TOKEN.EOF, '');
}
};
Tokenizer.prototype._is_comment = function(current_token) { // jshint unused:false
return false;
};
Tokenizer.prototype._is_opening = function(current_token) { // jshint unused:false
return false;
};
Tokenizer.prototype._is_closing = function(current_token, open_token) { // jshint unused:false
return false;
};
Tokenizer.prototype._create_token = function(type, text) {
var token = new Token(type, text,
this._patterns.whitespace.newline_count,
this._patterns.whitespace.whitespace_before_token);
return token;
};
Tokenizer.prototype._readWhitespace = function() {
return this._patterns.whitespace.read();
};
module.exports.Tokenizer = Tokenizer;
module.exports.TOKEN = TOKEN;
/***/ }),
/* 10 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function TokenStream(parent_token) {
// private
this.__tokens = [];
this.__tokens_length = this.__tokens.length;
this.__position = 0;
this.__parent_token = parent_token;
}
TokenStream.prototype.restart = function() {
this.__position = 0;
};
TokenStream.prototype.isEmpty = function() {
return this.__tokens_length === 0;
};
TokenStream.prototype.hasNext = function() {
return this.__position < this.__tokens_length;
};
TokenStream.prototype.next = function() {
var val = null;
if (this.hasNext()) {
val = this.__tokens[this.__position];
this.__position += 1;
}
return val;
};
TokenStream.prototype.peek = function(index) {
var val = null;
index = index || 0;
index += this.__position;
if (index >= 0 && index < this.__tokens_length) {
val = this.__tokens[index];
}
return val;
};
TokenStream.prototype.add = function(token) {
if (this.__parent_token) {
token.parent = this.__parent_token;
}
this.__tokens.push(token);
this.__tokens_length += 1;
};
module.exports.TokenStream = TokenStream;
/***/ }),
/* 11 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_36748__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var Pattern = (__nested_webpack_require_36748__(12).Pattern);
function WhitespacePattern(input_scanner, parent) {
Pattern.call(this, input_scanner, parent);
if (parent) {
this._line_regexp = this._input.get_regexp(parent._line_regexp);
} else {
this.__set_whitespace_patterns('', '');
}
this.newline_count = 0;
this.whitespace_before_token = '';
}
WhitespacePattern.prototype = new Pattern();
WhitespacePattern.prototype.__set_whitespace_patterns = function(whitespace_chars, newline_chars) {
whitespace_chars += '\\t ';
newline_chars += '\\n\\r';
this._match_pattern = this._input.get_regexp(
'[' + whitespace_chars + newline_chars + ']+', true);
this._newline_regexp = this._input.get_regexp(
'\\r\\n|[' + newline_chars + ']');
};
WhitespacePattern.prototype.read = function() {
this.newline_count = 0;
this.whitespace_before_token = '';
var resulting_string = this._input.read(this._match_pattern);
if (resulting_string === ' ') {
this.whitespace_before_token = ' ';
} else if (resulting_string) {
var matches = this.__split(this._newline_regexp, resulting_string);
this.newline_count = matches.length - 1;
this.whitespace_before_token = matches[this.newline_count];
}
return resulting_string;
};
WhitespacePattern.prototype.matching = function(whitespace_chars, newline_chars) {
var result = this._create();
result.__set_whitespace_patterns(whitespace_chars, newline_chars);
result._update();
return result;
};
WhitespacePattern.prototype._create = function() {
return new WhitespacePattern(this._input, this);
};
WhitespacePattern.prototype.__split = function(regexp, input_string) {
regexp.lastIndex = 0;
var start_index = 0;
var result = [];
var next_match = regexp.exec(input_string);
while (next_match) {
result.push(input_string.substring(start_index, next_match.index));
start_index = next_match.index + next_match[0].length;
next_match = regexp.exec(input_string);
}
if (start_index < input_string.length) {
result.push(input_string.substring(start_index, input_string.length));
} else {
result.push('');
}
return result;
};
module.exports.WhitespacePattern = WhitespacePattern;
/***/ }),
/* 12 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function Pattern(input_scanner, parent) {
this._input = input_scanner;
this._starting_pattern = null;
this._match_pattern = null;
this._until_pattern = null;
this._until_after = false;
if (parent) {
this._starting_pattern = this._input.get_regexp(parent._starting_pattern, true);
this._match_pattern = this._input.get_regexp(parent._match_pattern, true);
this._until_pattern = this._input.get_regexp(parent._until_pattern);
this._until_after = parent._until_after;
}
}
Pattern.prototype.read = function() {
var result = this._input.read(this._starting_pattern);
if (!this._starting_pattern || result) {
result += this._input.read(this._match_pattern, this._until_pattern, this._until_after);
}
return result;
};
Pattern.prototype.read_match = function() {
return this._input.match(this._match_pattern);
};
Pattern.prototype.until_after = function(pattern) {
var result = this._create();
result._until_after = true;
result._until_pattern = this._input.get_regexp(pattern);
result._update();
return result;
};
Pattern.prototype.until = function(pattern) {
var result = this._create();
result._until_after = false;
result._until_pattern = this._input.get_regexp(pattern);
result._update();
return result;
};
Pattern.prototype.starting_with = function(pattern) {
var result = this._create();
result._starting_pattern = this._input.get_regexp(pattern, true);
result._update();
return result;
};
Pattern.prototype.matching = function(pattern) {
var result = this._create();
result._match_pattern = this._input.get_regexp(pattern, true);
result._update();
return result;
};
Pattern.prototype._create = function() {
return new Pattern(this._input, this);
};
Pattern.prototype._update = function() {};
module.exports.Pattern = Pattern;
/***/ }),
/* 13 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function Directives(start_block_pattern, end_block_pattern) {
start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source;
end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source;
this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \w+[:]\w+)+ /.source + end_block_pattern, 'g');
this.__directive_pattern = / (\w+)[:](\w+)/g;
this.__directives_end_ignore_pattern = new RegExp(start_block_pattern + /\sbeautify\signore:end\s/.source + end_block_pattern, 'g');
}
Directives.prototype.get_directives = function(text) {
if (!text.match(this.__directives_block_pattern)) {
return null;
}
var directives = {};
this.__directive_pattern.lastIndex = 0;
var directive_match = this.__directive_pattern.exec(text);
while (directive_match) {
directives[directive_match[1]] = directive_match[2];
directive_match = this.__directive_pattern.exec(text);
}
return directives;
};
Directives.prototype.readIgnored = function(input) {
return input.readUntilAfter(this.__directives_end_ignore_pattern);
};
module.exports.Directives = Directives;
/***/ }),
/* 14 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_45735__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var Pattern = (__nested_webpack_require_45735__(12).Pattern);
var template_names = {
django: false,
erb: false,
handlebars: false,
php: false,
smarty: false,
angular: false
};
// This lets templates appear anywhere we would do a readUntil
// The cost is higher but it is pay to play.
function TemplatablePattern(input_scanner, parent) {
Pattern.call(this, input_scanner, parent);
this.__template_pattern = null;
this._disabled = Object.assign({}, template_names);
this._excluded = Object.assign({}, template_names);
if (parent) {
this.__template_pattern = this._input.get_regexp(parent.__template_pattern);
this._excluded = Object.assign(this._excluded, parent._excluded);
this._disabled = Object.assign(this._disabled, parent._disabled);
}
var pattern = new Pattern(input_scanner);
this.__patterns = {
handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/),
handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/),
handlebars: pattern.starting_with(/{{/).until_after(/}}/),
php: pattern.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),
erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/),
// django coflicts with handlebars a bit.
django: pattern.starting_with(/{%/).until_after(/%}/),
django_value: pattern.starting_with(/{{/).until_after(/}}/),
django_comment: pattern.starting_with(/{#/).until_after(/#}/),
smarty: pattern.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),
smarty_comment: pattern.starting_with(/{\*/).until_after(/\*}/),
smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\/literal}/)
};
}
TemplatablePattern.prototype = new Pattern();
TemplatablePattern.prototype._create = function() {
return new TemplatablePattern(this._input, this);
};
TemplatablePattern.prototype._update = function() {
this.__set_templated_pattern();
};
TemplatablePattern.prototype.disable = function(language) {
var result = this._create();
result._disabled[language] = true;
result._update();
return result;
};
TemplatablePattern.prototype.read_options = function(options) {
var result = this._create();
for (var language in template_names) {
result._disabled[language] = options.templating.indexOf(language) === -1;
}
result._update();
return result;
};
TemplatablePattern.prototype.exclude = function(language) {
var result = this._create();
result._excluded[language] = true;
result._update();
return result;
};
TemplatablePattern.prototype.read = function() {
var result = '';
if (this._match_pattern) {
result = this._input.read(this._starting_pattern);
} else {
result = this._input.read(this._starting_pattern, this.__template_pattern);
}
var next = this._read_template();
while (next) {
if (this._match_pattern) {
next += this._input.read(this._match_pattern);
} else {
next += this._input.readUntil(this.__template_pattern);
}
result += next;
next = this._read_template();
}
if (this._until_after) {
result += this._input.readUntilAfter(this._until_pattern);
}
return result;
};
TemplatablePattern.prototype.__set_templated_pattern = function() {
var items = [];
if (!this._disabled.php) {
items.push(this.__patterns.php._starting_pattern.source);
}
if (!this._disabled.handlebars) {
items.push(this.__patterns.handlebars._starting_pattern.source);
}
if (!this._disabled.erb) {
items.push(this.__patterns.erb._starting_pattern.source);
}
if (!this._disabled.django) {
items.push(this.__patterns.django._starting_pattern.source);
// The starting pattern for django is more complex because it has different
// patterns for value, comment, and other sections
items.push(this.__patterns.django_value._starting_pattern.source);
items.push(this.__patterns.django_comment._starting_pattern.source);
}
if (!this._disabled.smarty) {
items.push(this.__patterns.smarty._starting_pattern.source);
}
if (this._until_pattern) {
items.push(this._until_pattern.source);
}
this.__template_pattern = this._input.get_regexp('(?:' + items.join('|') + ')');
};
TemplatablePattern.prototype._read_template = function() {
var resulting_string = '';
var c = this._input.peek();
if (c === '<') {
var peek1 = this._input.peek(1);
//if we're in a comment, do something special
// We treat all comments as literals, even more than preformatted tags
// we just look for the appropriate close tag
if (!this._disabled.php && !this._excluded.php && peek1 === '?') {
resulting_string = resulting_string ||
this.__patterns.php.read();
}
if (!this._disabled.erb && !this._excluded.erb && peek1 === '%') {
resulting_string = resulting_string ||
this.__patterns.erb.read();
}
} else if (c === '{') {
if (!this._disabled.handlebars && !this._excluded.handlebars) {
resulting_string = resulting_string ||
this.__patterns.handlebars_comment.read();
resulting_string = resulting_string ||
this.__patterns.handlebars_unescaped.read();
resulting_string = resulting_string ||
this.__patterns.handlebars.read();
}
if (!this._disabled.django) {
// django coflicts with handlebars a bit.
if (!this._excluded.django && !this._excluded.handlebars) {
resulting_string = resulting_string ||
this.__patterns.django_value.read();
}
if (!this._excluded.django) {
resulting_string = resulting_string ||
this.__patterns.django_comment.read();
resulting_string = resulting_string ||
this.__patterns.django.read();
}
}
if (!this._disabled.smarty) {
// smarty cannot be enabled with django or handlebars enabled
if (this._disabled.django && this._disabled.handlebars) {
resulting_string = resulting_string ||
this.__patterns.smarty_comment.read();
resulting_string = resulting_string ||
this.__patterns.smarty_literal.read();
resulting_string = resulting_string ||
this.__patterns.smarty.read();
}
}
}
return resulting_string;
};
module.exports.TemplatablePattern = TemplatablePattern;
/***/ }),
/* 15 */,
/* 16 */,
/* 17 */,
/* 18 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_53299__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var Beautifier = (__nested_webpack_require_53299__(19).Beautifier),
Options = (__nested_webpack_require_53299__(20).Options);
function style_html(html_source, options, js_beautify, css_beautify) {
var beautifier = new Beautifier(html_source, options, js_beautify, css_beautify);
return beautifier.beautify();
}
module.exports = style_html;
module.exports.defaultOptions = function() {
return new Options();
};
/***/ }),
/* 19 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_54977__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var Options = (__nested_webpack_require_54977__(20).Options);
var Output = (__nested_webpack_require_54977__(2).Output);
var Tokenizer = (__nested_webpack_require_54977__(21).Tokenizer);
var TOKEN = (__nested_webpack_require_54977__(21).TOKEN);
var lineBreak = /\r\n|[\r\n]/;
var allLineBreaks = /\r\n|[\r\n]/g;
var Printer = function(options, base_indent_string) { //handles input/output and some other printing functions
this.indent_level = 0;
this.alignment_size = 0;
this.max_preserve_newlines = options.max_preserve_newlines;
this.preserve_newlines = options.preserve_newlines;
this._output = new Output(options, base_indent_string);
};
Printer.prototype.current_line_has_match = function(pattern) {
return this._output.current_line.has_match(pattern);
};
Printer.prototype.set_space_before_token = function(value, non_breaking) {
this._output.space_before_token = value;
this._output.non_breaking_space = non_breaking;
};
Printer.prototype.set_wrap_point = function() {
this._output.set_indent(this.indent_level, this.alignment_size);
this._output.set_wrap_point();
};
Printer.prototype.add_raw_token = function(token) {
this._output.add_raw_token(token);
};
Printer.prototype.print_preserved_newlines = function(raw_token) {
var newlines = 0;
if (raw_token.type !== TOKEN.TEXT && raw_token.previous.type !== TOKEN.TEXT) {
newlines = raw_token.newlines ? 1 : 0;
}
if (this.preserve_newlines) {
newlines = raw_token.newlines < this.max_preserve_newlines + 1 ? raw_token.newlines : this.max_preserve_newlines + 1;
}
for (var n = 0; n < newlines; n++) {
this.print_newline(n > 0);
}
return newlines !== 0;
};
Printer.prototype.traverse_whitespace = function(raw_token) {
if (raw_token.whitespace_before || raw_token.newlines) {
if (!this.print_preserved_newlines(raw_token)) {
this._output.space_before_token = true;
}
return true;
}
return false;
};
Printer.prototype.previous_token_wrapped = function() {
return this._output.previous_token_wrapped;
};
Printer.prototype.print_newline = function(force) {
this._output.add_new_line(force);
};
Printer.prototype.print_token = function(token) {
if (token.text) {
this._output.set_indent(this.indent_level, this.alignment_size);
this._output.add_token(token.text);
}
};
Printer.prototype.indent = function() {
this.indent_level++;
};
Printer.prototype.deindent = function() {
if (this.indent_level > 0) {
this.indent_level--;
this._output.set_indent(this.indent_level, this.alignment_size);
}
};
Printer.prototype.get_full_indent = function(level) {
level = this.indent_level + (level || 0);
if (level < 1) {
return '';
}
return this._output.get_indent_string(level);
};
var get_type_attribute = function(start_token) {
var result = null;
var raw_token = start_token.next;
// Search attributes for a type attribute
while (raw_token.type !== TOKEN.EOF && start_token.closed !== raw_token) {
if (raw_token.type === TOKEN.ATTRIBUTE && raw_token.text === 'type') {
if (raw_token.next && raw_token.next.type === TOKEN.EQUALS &&
raw_token.next.next && raw_token.next.next.type === TOKEN.VALUE) {
result = raw_token.next.next.text;
}
break;
}
raw_token = raw_token.next;
}
return result;
};
var get_custom_beautifier_name = function(tag_check, raw_token) {
var typeAttribute = null;
var result = null;
if (!raw_token.closed) {
return null;
}
if (tag_check === 'script') {
typeAttribute = 'text/javascript';
} else if (tag_check === 'style') {
typeAttribute = 'text/css';
}
typeAttribute = get_type_attribute(raw_token) || typeAttribute;
// For script and style tags that have a type attribute, only enable custom beautifiers for matching values
// For those without a type attribute use default;
if (typeAttribute.search('text/css') > -1) {
result = 'css';
} else if (typeAttribute.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/) > -1) {
result = 'javascript';
} else if (typeAttribute.search(/(text|application|dojo)\/(x-)?(html)/) > -1) {
result = 'html';
} else if (typeAttribute.search(/test\/null/) > -1) {
// Test only mime-type for testing the beautifier when null is passed as beautifing function
result = 'null';
}
return result;
};
function in_array(what, arr) {
return arr.indexOf(what) !== -1;
}
function TagFrame(parent, parser_token, indent_level) {
this.parent = parent || null;
this.tag = parser_token ? parser_token.tag_name : '';
this.indent_level = indent_level || 0;
this.parser_token = parser_token || null;
}
function TagStack(printer) {
this._printer = printer;
this._current_frame = null;
}
TagStack.prototype.get_parser_token = function() {
return this._current_frame ? this._current_frame.parser_token : null;
};
TagStack.prototype.record_tag = function(parser_token) { //function to record a tag and its parent in this.tags Object
var new_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level);
this._current_frame = new_frame;
};
TagStack.prototype._try_pop_frame = function(frame) { //function to retrieve the opening tag to the corresponding closer
var parser_token = null;
if (frame) {
parser_token = frame.parser_token;
this._printer.indent_level = frame.indent_level;
this._current_frame = frame.parent;
}
return parser_token;
};
TagStack.prototype._get_frame = function(tag_list, stop_list) { //function to retrieve the opening tag to the corresponding closer
var frame = this._current_frame;
while (frame) { //till we reach '' (the initial value);
if (tag_list.indexOf(frame.tag) !== -1) { //if this is it use it
break;
} else if (stop_list && stop_list.indexOf(frame.tag) !== -1) {
frame = null;
break;
}
frame = frame.parent;
}
return frame;
};
TagStack.prototype.try_pop = function(tag, stop_list) { //function to retrieve the opening tag to the corresponding closer
var frame = this._get_frame([tag], stop_list);
return this._try_pop_frame(frame);
};
TagStack.prototype.indent_to_tag = function(tag_list) {
var frame = this._get_frame(tag_list);
if (frame) {
this._printer.indent_level = frame.indent_level;
}
};
function Beautifier(source_text, options, js_beautify, css_beautify) {
//Wrapper function to invoke all the necessary constructors and deal with the output.
this._source_text = source_text || '';
options = options || {};
this._js_beautify = js_beautify;
this._css_beautify = css_beautify;
this._tag_stack = null;
// Allow the setting of language/file-type specific options
// with inheritance of overall settings
var optionHtml = new Options(options, 'html');
this._options = optionHtml;
this._is_wrap_attributes_force = this._options.wrap_attributes.substr(0, 'force'.length) === 'force';
this._is_wrap_attributes_force_expand_multiline = (this._options.wrap_attributes === 'force-expand-multiline');
this._is_wrap_attributes_force_aligned = (this._options.wrap_attributes === 'force-aligned');
this._is_wrap_attributes_aligned_multiple = (this._options.wrap_attributes === 'aligned-multiple');
this._is_wrap_attributes_preserve = this._options.wrap_attributes.substr(0, 'preserve'.length) === 'preserve';
this._is_wrap_attributes_preserve_aligned = (this._options.wrap_attributes === 'preserve-aligned');
}
Beautifier.prototype.beautify = function() {
// if disabled, return the input unchanged.
if (this._options.disabled) {
return this._source_text;
}
var source_text = this._source_text;
var eol = this._options.eol;
if (this._options.eol === 'auto') {
eol = '\n';
if (source_text && lineBreak.test(source_text)) {
eol = source_text.match(lineBreak)[0];
}
}
// HACK: newline parsing inconsistent. This brute force normalizes the input.
source_text = source_text.replace(allLineBreaks, '\n');
var baseIndentString = source_text.match(/^[\t ]*/)[0];
var last_token = {
text: '',
type: ''
};
var last_tag_token = new TagOpenParserToken();
var printer = new Printer(this._options, baseIndentString);
var tokens = new Tokenizer(source_text, this._options).tokenize();
this._tag_stack = new TagStack(printer);
var parser_token = null;
var raw_token = tokens.next();
while (raw_token.type !== TOKEN.EOF) {
if (raw_token.type === TOKEN.TAG_OPEN || raw_token.type === TOKEN.COMMENT) {
parser_token = this._handle_tag_open(printer, raw_token, last_tag_token, last_token, tokens);
last_tag_token = parser_token;
} else if ((raw_token.type === TOKEN.ATTRIBUTE || raw_token.type === TOKEN.EQUALS || raw_token.type === TOKEN.VALUE) ||
(raw_token.type === TOKEN.TEXT && !last_tag_token.tag_complete)) {
parser_token = this._handle_inside_tag(printer, raw_token, last_tag_token, last_token);
} else if (raw_token.type === TOKEN.TAG_CLOSE) {
parser_token = this._handle_tag_close(printer, raw_token, last_tag_token);
} else if (raw_token.type === TOKEN.TEXT) {
parser_token = this._handle_text(printer, raw_token, last_tag_token);
} else if (raw_token.type === TOKEN.CONTROL_FLOW_OPEN) {
parser_token = this._handle_control_flow_open(printer, raw_token);
} else if (raw_token.type === TOKEN.CONTROL_FLOW_CLOSE) {
parser_token = this._handle_control_flow_close(printer, raw_token);
} else {
// This should never happen, but if it does. Print the raw token
printer.add_raw_token(raw_token);
}
last_token = parser_token;
raw_token = tokens.next();
}
var sweet_code = printer._output.get_code(eol);
return sweet_code;
};
Beautifier.prototype._handle_control_flow_open = function(printer, raw_token) {
var parser_token = {
text: raw_token.text,
type: raw_token.type
};
printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '', true);
if (raw_token.newlines) {
printer.print_preserved_newlines(raw_token);
} else {
printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '', true);
}
printer.print_token(raw_token);
printer.indent();
return parser_token;
};
Beautifier.prototype._handle_control_flow_close = function(printer, raw_token) {
var parser_token = {
text: raw_token.text,
type: raw_token.type
};
printer.deindent();
if (raw_token.newlines) {
printer.print_preserved_newlines(raw_token);
} else {
printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '', true);
}
printer.print_token(raw_token);
return parser_token;
};
Beautifier.prototype._handle_tag_close = function(printer, raw_token, last_tag_token) {
var parser_token = {
text: raw_token.text,
type: raw_token.type
};
printer.alignment_size = 0;
last_tag_token.tag_complete = true;
printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '', true);
if (last_tag_token.is_unformatted) {
printer.add_raw_token(raw_token);
} else {
if (last_tag_token.tag_start_char === '<') {
printer.set_space_before_token(raw_token.text[0] === '/', true); // space before />, no space before >
if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.has_wrapped_attrs) {
printer.print_newline(false);
}
}
printer.print_token(raw_token);
}
if (last_tag_token.indent_content &&
!(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) {
printer.indent();
// only indent once per opened tag
last_tag_token.indent_content = false;
}
if (!last_tag_token.is_inline_element &&
!(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) {
printer.set_wrap_point();
}
return parser_token;
};
Beautifier.prototype._handle_inside_tag = function(printer, raw_token, last_tag_token, last_token) {
var wrapped = last_tag_token.has_wrapped_attrs;
var parser_token = {
text: raw_token.text,
type: raw_token.type
};
printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '', true);
if (last_tag_token.is_unformatted) {
printer.add_raw_token(raw_token);
} else if (last_tag_token.tag_start_char === '{' && raw_token.type === TOKEN.TEXT) {
// For the insides of handlebars allow newlines or a single space between open and contents
if (printer.print_preserved_newlines(raw_token)) {
raw_token.newlines = 0;
printer.add_raw_token(raw_token);
} else {
printer.print_token(raw_token);
}
} else {
if (raw_token.type === TOKEN.ATTRIBUTE) {
printer.set_space_before_token(true);
} else if (raw_token.type === TOKEN.EQUALS) { //no space before =
printer.set_space_before_token(false);
} else if (raw_token.type === TOKEN.VALUE && raw_token.previous.type === TOKEN.EQUALS) { //no space before value
printer.set_space_before_token(false);
}
if (raw_token.type === TOKEN.ATTRIBUTE && last_tag_token.tag_start_char === '<') {
if (this._is_wrap_attributes_preserve || this._is_wrap_attributes_preserve_aligned) {
printer.traverse_whitespace(raw_token);
wrapped = wrapped || raw_token.newlines !== 0;
}
// Wrap for 'force' options, and if the number of attributes is at least that specified in 'wrap_attributes_min_attrs':
// 1. always wrap the second and beyond attributes
// 2. wrap the first attribute only if 'force-expand-multiline' is specified
if (this._is_wrap_attributes_force &&
last_tag_token.attr_count >= this._options.wrap_attributes_min_attrs &&
(last_token.type !== TOKEN.TAG_OPEN || // ie. second attribute and beyond
this._is_wrap_attributes_force_expand_multiline)) {
printer.print_newline(false);
wrapped = true;
}
}
printer.print_token(raw_token);
wrapped = wrapped || printer.previous_token_wrapped();
last_tag_token.has_wrapped_attrs = wrapped;
}
return parser_token;
};
Beautifier.prototype._handle_text = function(printer, raw_token, last_tag_token) {
var parser_token = {
text: raw_token.text,
type: 'TK_CONTENT'
};
if (last_tag_token.custom_beautifier_name) { //check if we need to format javascript
this._print_custom_beatifier_text(printer, raw_token, last_tag_token);
} else if (last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) {
printer.add_raw_token(raw_token);
} else {
printer.traverse_whitespace(raw_token);
printer.print_token(raw_token);
}
return parser_token;
};
Beautifier.prototype._print_custom_beatifier_text = function(printer, raw_token, last_tag_token) {
var local = this;
if (raw_token.text !== '') {
var text = raw_token.text,
_beautifier,
script_indent_level = 1,
pre = '',
post = '';
if (last_tag_token.custom_beautifier_name === 'javascript' && typeof this._js_beautify === 'function') {
_beautifier = this._js_beautify;
} else if (last_tag_token.custom_beautifier_name === 'css' && typeof this._css_beautify === 'function') {
_beautifier = this._css_beautify;
} else if (last_tag_token.custom_beautifier_name === 'html') {
_beautifier = function(html_source, options) {
var beautifier = new Beautifier(html_source, options, local._js_beautify, local._css_beautify);
return beautifier.beautify();
};
}
if (this._options.indent_scripts === "keep") {
script_indent_level = 0;
} else if (this._options.indent_scripts === "separate") {
script_indent_level = -printer.indent_level;
}
var indentation = printer.get_full_indent(script_indent_level);
// if there is at least one empty line at the end of this text, strip it
// we'll be adding one back after the text but before the containing tag.
text = text.replace(/\n[ \t]*$/, '');
// Handle the case where content is wrapped in a comment or cdata.
if (last_tag_token.custom_beautifier_name !== 'html' &&
text[0] === '<' && text.match(/^(<!--|<!\[CDATA\[)/)) {
var matched = /^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(text);
// if we start to wrap but don't finish, print raw
if (!matched) {
printer.add_raw_token(raw_token);
return;
}
pre = indentation + matched[1] + '\n';
text = matched[4];
if (matched[5]) {
post = indentation + matched[5];
}
// if there is at least one empty line at the end of this text, strip it
// we'll be adding one back after the text but before the containing tag.
text = text.replace(/\n[ \t]*$/, '');
if (matched[2] || matched[3].indexOf('\n') !== -1) {
// if the first line of the non-comment text has spaces
// use that as the basis for indenting in null case.
matched = matched[3].match(/[ \t]+$/);
if (matched) {
raw_token.whitespace_before = matched[0];
}
}
}
if (text) {
if (_beautifier) {
// call the Beautifier if avaliable
var Child_options = function() {
this.eol = '\n';
};
Child_options.prototype = this._options.raw_options;
var child_options = new Child_options();
text = _beautifier(indentation + text, child_options);
} else {
// simply indent the string otherwise
var white = raw_token.whitespace_before;
if (white) {
text = text.replace(new RegExp('\n(' + white + ')?', 'g'), '\n');
}
text = indentation + text.replace(/\n/g, '\n' + indentation);
}
}
if (pre) {
if (!text) {
text = pre + post;
} else {
text = pre + text + '\n' + post;
}
}
printer.print_newline(false);
if (text) {
raw_token.text = text;
raw_token.whitespace_before = '';
raw_token.newlines = 0;
printer.add_raw_token(raw_token);
printer.print_newline(true);
}
}
};
Beautifier.prototype._handle_tag_open = function(printer, raw_token, last_tag_token, last_token, tokens) {
var parser_token = this._get_tag_open_token(raw_token);
if ((last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) &&
!last_tag_token.is_empty_element &&
raw_token.type === TOKEN.TAG_OPEN && !parser_token.is_start_tag) {
// End element tags for unformatted or content_unformatted elements
// are printed raw to keep any newlines inside them exactly the same.
printer.add_raw_token(raw_token);
parser_token.start_tag_token = this._tag_stack.try_pop(parser_token.tag_name);
} else {
printer.traverse_whitespace(raw_token);
this._set_tag_position(printer, raw_token, parser_token, last_tag_token, last_token);
if (!parser_token.is_inline_element) {
printer.set_wrap_point();
}
printer.print_token(raw_token);
}
// count the number of attributes
if (parser_token.is_start_tag && this._is_wrap_attributes_force) {
var peek_index = 0;
var peek_token;
do {
peek_token = tokens.peek(peek_index);
if (peek_token.type === TOKEN.ATTRIBUTE) {
parser_token.attr_count += 1;
}
peek_index += 1;
} while (peek_token.type !== TOKEN.EOF && peek_token.type !== TOKEN.TAG_CLOSE);
}
//indent attributes an auto, forced, aligned or forced-align line-wrap
if (this._is_wrap_attributes_force_aligned || this._is_wrap_attributes_aligned_multiple || this._is_wrap_attributes_preserve_aligned) {
parser_token.alignment_size = raw_token.text.length + 1;
}
if (!parser_token.tag_complete && !parser_token.is_unformatted) {
printer.alignment_size = parser_token.alignment_size;
}
return parser_token;
};
var TagOpenParserToken = function(parent, raw_token) {
this.parent = parent || null;
this.text = '';
this.type = 'TK_TAG_OPEN';
this.tag_name = '';
this.is_inline_element = false;
this.is_unformatted = false;
this.is_content_unformatted = false;
this.is_empty_element = false;
this.is_start_tag = false;
this.is_end_tag = false;
this.indent_content = false;
this.multiline_content = false;
this.custom_beautifier_name = null;
this.start_tag_token = null;
this.attr_count = 0;
this.has_wrapped_attrs = false;
this.alignment_size = 0;
this.tag_complete = false;
this.tag_start_char = '';
this.tag_check = '';
if (!raw_token) {
this.tag_complete = true;
} else {
var tag_check_match;
this.tag_start_char = raw_token.text[0];
this.text = raw_token.text;
if (this.tag_start_char === '<') {
tag_check_match = raw_token.text.match(/^<([^\s>]*)/);
this.tag_check = tag_check_match ? tag_check_match[1] : '';
} else {
tag_check_match = raw_token.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/);
this.tag_check = tag_check_match ? tag_check_match[1] : '';
// handle "{{#> myPartial}}" or "{{~#> myPartial}}"
if ((raw_token.text.startsWith('{{#>') || raw_token.text.startsWith('{{~#>')) && this.tag_check[0] === '>') {
if (this.tag_check === '>' && raw_token.next !== null) {
this.tag_check = raw_token.next.text.split(' ')[0];
} else {
this.tag_check = raw_token.text.split('>')[1];
}
}
}
this.tag_check = this.tag_check.toLowerCase();
if (raw_token.type === TOKEN.COMMENT) {
this.tag_complete = true;
}
this.is_start_tag = this.tag_check.charAt(0) !== '/';
this.tag_name = !this.is_start_tag ? this.tag_check.substr(1) : this.tag_check;
this.is_end_tag = !this.is_start_tag ||
(raw_token.closed && raw_token.closed.text === '/>');
// if whitespace handler ~ included (i.e. {{~#if true}}), handlebars tags start at pos 3 not pos 2
var handlebar_starts = 2;
if (this.tag_start_char === '{' && this.text.length >= 3) {
if (this.text.charAt(2) === '~') {
handlebar_starts = 3;
}
}
// handlebars tags that don't start with # or ^ are single_tags, and so also start and end.
this.is_end_tag = this.is_end_tag ||
(this.tag_start_char === '{' && (this.text.length < 3 || (/[^#\^]/.test(this.text.charAt(handlebar_starts)))));
}
};
Beautifier.prototype._get_tag_open_token = function(raw_token) { //function to get a full tag and parse its type
var parser_token = new TagOpenParserToken(this._tag_stack.get_parser_token(), raw_token);
parser_token.alignment_size = this._options.wrap_attributes_indent_size;
parser_token.is_end_tag = parser_token.is_end_tag ||
in_array(parser_token.tag_check, this._options.void_elements);
parser_token.is_empty_element = parser_token.tag_complete ||
(parser_token.is_start_tag && parser_token.is_end_tag);
parser_token.is_unformatted = !parser_token.tag_complete && in_array(parser_token.tag_check, this._options.unformatted);
parser_token.is_content_unformatted = !parser_token.is_empty_element && in_array(parser_token.tag_check, this._options.content_unformatted);
parser_token.is_inline_element = in_array(parser_token.tag_name, this._options.inline) || (this._options.inline_custom_elements && parser_token.tag_name.includes("-")) || parser_token.tag_start_char === '{';
return parser_token;
};
Beautifier.prototype._set_tag_position = function(printer, raw_token, parser_token, last_tag_token, last_token) {
if (!parser_token.is_empty_element) {
if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending
parser_token.start_tag_token = this._tag_stack.try_pop(parser_token.tag_name); //remove it and all ancestors
} else { // it's a start-tag
// check if this tag is starting an element that has optional end element
// and do an ending needed
if (this._do_optional_end_element(parser_token)) {
if (!parser_token.is_inline_element) {
printer.print_newline(false);
}
}
this._tag_stack.record_tag(parser_token); //push it on the tag stack
if ((parser_token.tag_name === 'script' || parser_token.tag_name === 'style') &&
!(parser_token.is_unformatted || parser_token.is_content_unformatted)) {
parser_token.custom_beautifier_name = get_custom_beautifier_name(parser_token.tag_check, raw_token);
}
}
}
if (in_array(parser_token.tag_check, this._options.extra_liners)) { //check if this double needs an extra line
printer.print_newline(false);
if (!printer._output.just_added_blankline()) {
printer.print_newline(true);
}
}
if (parser_token.is_empty_element) { //if this tag name is a single tag type (either in the list or has a closing /)
// if you hit an else case, reset the indent level if you are inside an:
// 'if', 'unless', or 'each' block.
if (parser_token.tag_start_char === '{' && parser_token.tag_check === 'else') {
this._tag_stack.indent_to_tag(['if', 'unless', 'each']);
parser_token.indent_content = true;
// Don't add a newline if opening {{#if}} tag is on the current line
var foundIfOnCurrentLine = printer.current_line_has_match(/{{#if/);
if (!foundIfOnCurrentLine) {
printer.print_newline(false);
}
}
// Don't add a newline before elements that should remain where they are.
if (parser_token.tag_name === '!--' && last_token.type === TOKEN.TAG_CLOSE &&
last_tag_token.is_end_tag && parser_token.text.indexOf('\n') === -1) {
//Do nothing. Leave comments on same line.
} else {
if (!(parser_token.is_inline_element || parser_token.is_unformatted)) {
printer.print_newline(false);
}
this._calcluate_parent_multiline(printer, parser_token);
}
} else if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending
var do_end_expand = false;
// deciding whether a block is multiline should not be this hard
do_end_expand = parser_token.start_tag_token && parser_token.start_tag_token.multiline_content;
do_end_expand = do_end_expand || (!parser_token.is_inline_element &&
!(last_tag_token.is_inline_element || last_tag_token.is_unformatted) &&
!(last_token.type === TOKEN.TAG_CLOSE && parser_token.start_tag_token === last_tag_token) &&
last_token.type !== 'TK_CONTENT'
);
if (parser_token.is_content_unformatted || parser_token.is_unformatted) {
do_end_expand = false;
}
if (do_end_expand) {
printer.print_newline(false);
}
} else { // it's a start-tag
parser_token.indent_content = !parser_token.custom_beautifier_name;
if (parser_token.tag_start_char === '<') {
if (parser_token.tag_name === 'html') {
parser_token.indent_content = this._options.indent_inner_html;
} else if (parser_token.tag_name === 'head') {
parser_token.indent_content = this._options.indent_head_inner_html;
} else if (parser_token.tag_name === 'body') {
parser_token.indent_content = this._options.indent_body_inner_html;
}
}
if (!(parser_token.is_inline_element || parser_token.is_unformatted) &&
(last_token.type !== 'TK_CONTENT' || parser_token.is_content_unformatted)) {
printer.print_newline(false);
}
this._calcluate_parent_multiline(printer, parser_token);
}
};
Beautifier.prototype._calcluate_parent_multiline = function(printer, parser_token) {
if (parser_token.parent && printer._output.just_added_newline() &&
!((parser_token.is_inline_element || parser_token.is_unformatted) && parser_token.parent.is_inline_element)) {
parser_token.parent.multiline_content = true;
}
};
//To be used for <p> tag special case:
var p_closers = ['address', 'article', 'aside', 'blockquote', 'details', 'div', 'dl', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'main', 'menu', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'];
var p_parent_excludes = ['a', 'audio', 'del', 'ins', 'map', 'noscript', 'video'];
Beautifier.prototype._do_optional_end_element = function(parser_token) {
var result = null;
// NOTE: cases of "if there is no more content in the parent element"
// are handled automatically by the beautifier.
// It assumes parent or ancestor close tag closes all children.
// https://www.w3.org/TR/html5/syntax.html#optional-tags
if (parser_token.is_empty_element || !parser_token.is_start_tag || !parser_token.parent) {
return;
}
if (parser_token.tag_name === 'body') {
// A head elements end tag may be omitted if the head element is not immediately followed by a space character or a comment.
result = result || this._tag_stack.try_pop('head');
//} else if (parser_token.tag_name === 'body') {
// DONE: A body elements end tag may be omitted if the body element is not immediately followed by a comment.
} else if (parser_token.tag_name === 'li') {
// An li elements end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element.
result = result || this._tag_stack.try_pop('li', ['ol', 'ul', 'menu']);
} else if (parser_token.tag_name === 'dd' || parser_token.tag_name === 'dt') {
// A dd elements end tag may be omitted if the dd element is immediately followed by another dd element or a dt element, or if there is no more content in the parent element.
// A dt elements end tag may be omitted if the dt element is immediately followed by another dt element or a dd element.
result = result || this._tag_stack.try_pop('dt', ['dl']);
result = result || this._tag_stack.try_pop('dd', ['dl']);
} else if (parser_token.parent.tag_name === 'p' && p_closers.indexOf(parser_token.tag_name) !== -1) {
// IMPORTANT: this else-if works because p_closers has no overlap with any other element we look for in this method
// check for the parent element is an HTML element that is not an <a>, <audio>, <del>, <ins>, <map>, <noscript>, or <video> element, or an autonomous custom element.
// To do this right, this needs to be coded as an inclusion of the inverse of the exclusion above.
// But to start with (if we ignore "autonomous custom elements") the exclusion would be fine.
var p_parent = parser_token.parent.parent;
if (!p_parent || p_parent_excludes.indexOf(p_parent.tag_name) === -1) {
result = result || this._tag_stack.try_pop('p');
}
} else if (parser_token.tag_name === 'rp' || parser_token.tag_name === 'rt') {
// An rt elements end tag may be omitted if the rt element is immediately followed by an rt or rp element, or if there is no more content in the parent element.
// An rp elements end tag may be omitted if the rp element is immediately followed by an rt or rp element, or if there is no more content in the parent element.
result = result || this._tag_stack.try_pop('rt', ['ruby', 'rtc']);
result = result || this._tag_stack.try_pop('rp', ['ruby', 'rtc']);
} else if (parser_token.tag_name === 'optgroup') {
// An optgroup elements end tag may be omitted if the optgroup element is immediately followed by another optgroup element, or if there is no more content in the parent element.
// An option elements end tag may be omitted if the option element is immediately followed by another option element, or if it is immediately followed by an optgroup element, or if there is no more content in the parent element.
result = result || this._tag_stack.try_pop('optgroup', ['select']);
//result = result || this._tag_stack.try_pop('option', ['select']);
} else if (parser_token.tag_name === 'option') {
// An option elements end tag may be omitted if the option element is immediately followed by another option element, or if it is immediately followed by an optgroup element, or if there is no more content in the parent element.
result = result || this._tag_stack.try_pop('option', ['select', 'datalist', 'optgroup']);
} else if (parser_token.tag_name === 'colgroup') {
// DONE: A colgroup elements end tag may be omitted if the colgroup element is not immediately followed by a space character or a comment.
// A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.
result = result || this._tag_stack.try_pop('caption', ['table']);
} else if (parser_token.tag_name === 'thead') {
// A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.
// A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.
result = result || this._tag_stack.try_pop('caption', ['table']);
result = result || this._tag_stack.try_pop('colgroup', ['table']);
//} else if (parser_token.tag_name === 'caption') {
// DONE: A caption elements end tag may be omitted if the caption element is not immediately followed by a space character or a comment.
} else if (parser_token.tag_name === 'tbody' || parser_token.tag_name === 'tfoot') {
// A thead elements end tag may be omitted if the thead element is immediately followed by a tbody or tfoot element.
// A tbody elements end tag may be omitted if the tbody element is immediately followed by a tbody or tfoot element, or if there is no more content in the parent element.
// A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.
// A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.
result = result || this._tag_stack.try_pop('caption', ['table']);
result = result || this._tag_stack.try_pop('colgroup', ['table']);
result = result || this._tag_stack.try_pop('thead', ['table']);
result = result || this._tag_stack.try_pop('tbody', ['table']);
//} else if (parser_token.tag_name === 'tfoot') {
// DONE: A tfoot elements end tag may be omitted if there is no more content in the parent element.
} else if (parser_token.tag_name === 'tr') {
// A tr elements end tag may be omitted if the tr element is immediately followed by another tr element, or if there is no more content in the parent element.
// A colgroup element's end tag may be ommitted if a thead, tfoot, tbody, or tr element is started.
// A caption element's end tag may be ommitted if a colgroup, thead, tfoot, tbody, or tr element is started.
result = result || this._tag_stack.try_pop('caption', ['table']);
result = result || this._tag_stack.try_pop('colgroup', ['table']);
result = result || this._tag_stack.try_pop('tr', ['table', 'thead', 'tbody', 'tfoot']);
} else if (parser_token.tag_name === 'th' || parser_token.tag_name === 'td') {
// A td elements end tag may be omitted if the td element is immediately followed by a td or th element, or if there is no more content in the parent element.
// A th elements end tag may be omitted if the th element is immediately followed by a td or th element, or if there is no more content in the parent element.
result = result || this._tag_stack.try_pop('td', ['table', 'thead', 'tbody', 'tfoot', 'tr']);
result = result || this._tag_stack.try_pop('th', ['table', 'thead', 'tbody', 'tfoot', 'tr']);
}
// Start element omission not handled currently
// A head elements start tag may be omitted if the element is empty, or if the first thing inside the head element is an element.
// A tbody elements start tag may be omitted if the first thing inside the tbody element is a tr element, and if the element is not immediately preceded by a tbody, thead, or tfoot element whose end tag has been omitted. (It cant be omitted if the element is empty.)
// A colgroup elements start tag may be omitted if the first thing inside the colgroup element is a col element, and if the element is not immediately preceded by another colgroup element whose end tag has been omitted. (It cant be omitted if the element is empty.)
// Fix up the parent of the parser token
parser_token.parent = this._tag_stack.get_parser_token();
return result;
};
module.exports.Beautifier = Beautifier;
/***/ }),
/* 20 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_92532__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var BaseOptions = (__nested_webpack_require_92532__(6).Options);
function Options(options) {
BaseOptions.call(this, options, 'html');
if (this.templating.length === 1 && this.templating[0] === 'auto') {
this.templating = ['django', 'erb', 'handlebars', 'php'];
}
this.indent_inner_html = this._get_boolean('indent_inner_html');
this.indent_body_inner_html = this._get_boolean('indent_body_inner_html', true);
this.indent_head_inner_html = this._get_boolean('indent_head_inner_html', true);
this.indent_handlebars = this._get_boolean('indent_handlebars', true);
this.wrap_attributes = this._get_selection('wrap_attributes',
['auto', 'force', 'force-aligned', 'force-expand-multiline', 'aligned-multiple', 'preserve', 'preserve-aligned']);
this.wrap_attributes_min_attrs = this._get_number('wrap_attributes_min_attrs', 2);
this.wrap_attributes_indent_size = this._get_number('wrap_attributes_indent_size', this.indent_size);
this.extra_liners = this._get_array('extra_liners', ['head', 'body', '/html']);
// Block vs inline elements
// https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
// https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements
// https://www.w3.org/TR/html5/dom.html#phrasing-content
this.inline = this._get_array('inline', [
'a', 'abbr', 'area', 'audio', 'b', 'bdi', 'bdo', 'br', 'button', 'canvas', 'cite',
'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', 'iframe', 'img',
'input', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'math', 'meter', 'noscript',
'object', 'output', 'progress', 'q', 'ruby', 's', 'samp', /* 'script', */ 'select', 'small',
'span', 'strong', 'sub', 'sup', 'svg', 'template', 'textarea', 'time', 'u', 'var',
'video', 'wbr', 'text',
// obsolete inline tags
'acronym', 'big', 'strike', 'tt'
]);
this.inline_custom_elements = this._get_boolean('inline_custom_elements', true);
this.void_elements = this._get_array('void_elements', [
// HTLM void elements - aka self-closing tags - aka singletons
// https://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements
'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen',
'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr',
// NOTE: Optional tags are too complex for a simple list
// they are hard coded in _do_optional_end_element
// Doctype and xml elements
'!doctype', '?xml',
// obsolete tags
// basefont: https://www.computerhope.com/jargon/h/html-basefont-tag.htm
// isndex: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/isindex
'basefont', 'isindex'
]);
this.unformatted = this._get_array('unformatted', []);
this.content_unformatted = this._get_array('content_unformatted', [
'pre', 'textarea'
]);
this.unformatted_content_delimiter = this._get_characters('unformatted_content_delimiter');
this.indent_scripts = this._get_selection('indent_scripts', ['normal', 'keep', 'separate']);
}
Options.prototype = new BaseOptions();
module.exports.Options = Options;
/***/ }),
/* 21 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_96899__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var BaseTokenizer = (__nested_webpack_require_96899__(9).Tokenizer);
var BASETOKEN = (__nested_webpack_require_96899__(9).TOKEN);
var Directives = (__nested_webpack_require_96899__(13).Directives);
var TemplatablePattern = (__nested_webpack_require_96899__(14).TemplatablePattern);
var Pattern = (__nested_webpack_require_96899__(12).Pattern);
var TOKEN = {
TAG_OPEN: 'TK_TAG_OPEN',
TAG_CLOSE: 'TK_TAG_CLOSE',
CONTROL_FLOW_OPEN: 'TK_CONTROL_FLOW_OPEN',
CONTROL_FLOW_CLOSE: 'TK_CONTROL_FLOW_CLOSE',
ATTRIBUTE: 'TK_ATTRIBUTE',
EQUALS: 'TK_EQUALS',
VALUE: 'TK_VALUE',
COMMENT: 'TK_COMMENT',
TEXT: 'TK_TEXT',
UNKNOWN: 'TK_UNKNOWN',
START: BASETOKEN.START,
RAW: BASETOKEN.RAW,
EOF: BASETOKEN.EOF
};
var directives_core = new Directives(/<\!--/, /-->/);
var Tokenizer = function(input_string, options) {
BaseTokenizer.call(this, input_string, options);
this._current_tag_name = '';
// Words end at whitespace or when a tag starts
// if we are indenting handlebars, they are considered tags
var templatable_reader = new TemplatablePattern(this._input).read_options(this._options);
var pattern_reader = new Pattern(this._input);
this.__patterns = {
word: templatable_reader.until(/[\n\r\t <]/),
word_control_flow_close_excluded: templatable_reader.until(/[\n\r\t <}]/),
single_quote: templatable_reader.until_after(/'/),
double_quote: templatable_reader.until_after(/"/),
attribute: templatable_reader.until(/[\n\r\t =>]|\/>/),
element_name: templatable_reader.until(/[\n\r\t >\/]/),
angular_control_flow_start: pattern_reader.matching(/\@[a-zA-Z]+[^({]*[({]/),
handlebars_comment: pattern_reader.starting_with(/{{!--/).until_after(/--}}/),
handlebars: pattern_reader.starting_with(/{{/).until_after(/}}/),
handlebars_open: pattern_reader.until(/[\n\r\t }]/),
handlebars_raw_close: pattern_reader.until(/}}/),
comment: pattern_reader.starting_with(/<!--/).until_after(/-->/),
cdata: pattern_reader.starting_with(/<!\[CDATA\[/).until_after(/]]>/),
// https://en.wikipedia.org/wiki/Conditional_comment
conditional_comment: pattern_reader.starting_with(/<!\[/).until_after(/]>/),
processing: pattern_reader.starting_with(/<\?/).until_after(/\?>/)
};
if (this._options.indent_handlebars) {
this.__patterns.word = this.__patterns.word.exclude('handlebars');
this.__patterns.word_control_flow_close_excluded = this.__patterns.word_control_flow_close_excluded.exclude('handlebars');
}
this._unformatted_content_delimiter = null;
if (this._options.unformatted_content_delimiter) {
var literal_regexp = this._input.get_literal_regexp(this._options.unformatted_content_delimiter);
this.__patterns.unformatted_content_delimiter =
pattern_reader.matching(literal_regexp)
.until_after(literal_regexp);
}
};
Tokenizer.prototype = new BaseTokenizer();
Tokenizer.prototype._is_comment = function(current_token) { // jshint unused:false
return false; //current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.UNKNOWN;
};
Tokenizer.prototype._is_opening = function(current_token) {
return current_token.type === TOKEN.TAG_OPEN || current_token.type === TOKEN.CONTROL_FLOW_OPEN;
};
Tokenizer.prototype._is_closing = function(current_token, open_token) {
return (current_token.type === TOKEN.TAG_CLOSE &&
(open_token && (
((current_token.text === '>' || current_token.text === '/>') && open_token.text[0] === '<') ||
(current_token.text === '}}' && open_token.text[0] === '{' && open_token.text[1] === '{')))
) || (current_token.type === TOKEN.CONTROL_FLOW_CLOSE &&
(current_token.text === '}' && open_token.text.endsWith('{')));
};
Tokenizer.prototype._reset = function() {
this._current_tag_name = '';
};
Tokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false
var token = null;
this._readWhitespace();
var c = this._input.peek();
if (c === null) {
return this._create_token(TOKEN.EOF, '');
}
token = token || this._read_open_handlebars(c, open_token);
token = token || this._read_attribute(c, previous_token, open_token);
token = token || this._read_close(c, open_token);
token = token || this._read_control_flows(c, open_token);
token = token || this._read_raw_content(c, previous_token, open_token);
token = token || this._read_content_word(c, open_token);
token = token || this._read_comment_or_cdata(c);
token = token || this._read_processing(c);
token = token || this._read_open(c, open_token);
token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());
return token;
};
Tokenizer.prototype._read_comment_or_cdata = function(c) { // jshint unused:false
var token = null;
var resulting_string = null;
var directives = null;
if (c === '<') {
var peek1 = this._input.peek(1);
// We treat all comments as literals, even more than preformatted tags
// we only look for the appropriate closing marker
if (peek1 === '!') {
resulting_string = this.__patterns.comment.read();
// only process directive on html comments
if (resulting_string) {
directives = directives_core.get_directives(resulting_string);
if (directives && directives.ignore === 'start') {
resulting_string += directives_core.readIgnored(this._input);
}
} else {
resulting_string = this.__patterns.cdata.read();
}
}
if (resulting_string) {
token = this._create_token(TOKEN.COMMENT, resulting_string);
token.directives = directives;
}
}
return token;
};
Tokenizer.prototype._read_processing = function(c) { // jshint unused:false
var token = null;
var resulting_string = null;
var directives = null;
if (c === '<') {
var peek1 = this._input.peek(1);
if (peek1 === '!' || peek1 === '?') {
resulting_string = this.__patterns.conditional_comment.read();
resulting_string = resulting_string || this.__patterns.processing.read();
}
if (resulting_string) {
token = this._create_token(TOKEN.COMMENT, resulting_string);
token.directives = directives;
}
}
return token;
};
Tokenizer.prototype._read_open = function(c, open_token) {
var resulting_string = null;
var token = null;
if (!open_token || open_token.type === TOKEN.CONTROL_FLOW_OPEN) {
if (c === '<') {
resulting_string = this._input.next();
if (this._input.peek() === '/') {
resulting_string += this._input.next();
}
resulting_string += this.__patterns.element_name.read();
token = this._create_token(TOKEN.TAG_OPEN, resulting_string);
}
}
return token;
};
Tokenizer.prototype._read_open_handlebars = function(c, open_token) {
var resulting_string = null;
var token = null;
if (!open_token || open_token.type === TOKEN.CONTROL_FLOW_OPEN) {
if (this._options.indent_handlebars && c === '{' && this._input.peek(1) === '{') {
if (this._input.peek(2) === '!') {
resulting_string = this.__patterns.handlebars_comment.read();
resulting_string = resulting_string || this.__patterns.handlebars.read();
token = this._create_token(TOKEN.COMMENT, resulting_string);
} else {
resulting_string = this.__patterns.handlebars_open.read();
token = this._create_token(TOKEN.TAG_OPEN, resulting_string);
}
}
}
return token;
};
Tokenizer.prototype._read_control_flows = function(c, open_token) {
var resulting_string = '';
var token = null;
// Only check for control flows if angular templating is set AND indenting is set
if (!this._options.templating.includes('angular') || !this._options.indent_handlebars) {
return token;
}
if (c === '@') {
resulting_string = this.__patterns.angular_control_flow_start.read();
if (resulting_string === '') {
return token;
}
var opening_parentheses_count = resulting_string.endsWith('(') ? 1 : 0;
var closing_parentheses_count = 0;
// The opening brace of the control flow is where the number of opening and closing parentheses equal
// e.g. @if({value: true} !== null) {
while (!(resulting_string.endsWith('{') && opening_parentheses_count === closing_parentheses_count)) {
var next_char = this._input.next();
if (next_char === null) {
break;
} else if (next_char === '(') {
opening_parentheses_count++;
} else if (next_char === ')') {
closing_parentheses_count++;
}
resulting_string += next_char;
}
token = this._create_token(TOKEN.CONTROL_FLOW_OPEN, resulting_string);
} else if (c === '}' && open_token && open_token.type === TOKEN.CONTROL_FLOW_OPEN) {
resulting_string = this._input.next();
token = this._create_token(TOKEN.CONTROL_FLOW_CLOSE, resulting_string);
}
return token;
};
Tokenizer.prototype._read_close = function(c, open_token) {
var resulting_string = null;
var token = null;
if (open_token && open_token.type === TOKEN.TAG_OPEN) {
if (open_token.text[0] === '<' && (c === '>' || (c === '/' && this._input.peek(1) === '>'))) {
resulting_string = this._input.next();
if (c === '/') { // for close tag "/>"
resulting_string += this._input.next();
}
token = this._create_token(TOKEN.TAG_CLOSE, resulting_string);
} else if (open_token.text[0] === '{' && c === '}' && this._input.peek(1) === '}') {
this._input.next();
this._input.next();
token = this._create_token(TOKEN.TAG_CLOSE, '}}');
}
}
return token;
};
Tokenizer.prototype._read_attribute = function(c, previous_token, open_token) {
var token = null;
var resulting_string = '';
if (open_token && open_token.text[0] === '<') {
if (c === '=') {
token = this._create_token(TOKEN.EQUALS, this._input.next());
} else if (c === '"' || c === "'") {
var content = this._input.next();
if (c === '"') {
content += this.__patterns.double_quote.read();
} else {
content += this.__patterns.single_quote.read();
}
token = this._create_token(TOKEN.VALUE, content);
} else {
resulting_string = this.__patterns.attribute.read();
if (resulting_string) {
if (previous_token.type === TOKEN.EQUALS) {
token = this._create_token(TOKEN.VALUE, resulting_string);
} else {
token = this._create_token(TOKEN.ATTRIBUTE, resulting_string);
}
}
}
}
return token;
};
Tokenizer.prototype._is_content_unformatted = function(tag_name) {
// void_elements have no content and so cannot have unformatted content
// script and style tags should always be read as unformatted content
// finally content_unformatted and unformatted element contents are unformatted
return this._options.void_elements.indexOf(tag_name) === -1 &&
(this._options.content_unformatted.indexOf(tag_name) !== -1 ||
this._options.unformatted.indexOf(tag_name) !== -1);
};
Tokenizer.prototype._read_raw_content = function(c, previous_token, open_token) { // jshint unused:false
var resulting_string = '';
if (open_token && open_token.text[0] === '{') {
resulting_string = this.__patterns.handlebars_raw_close.read();
} else if (previous_token.type === TOKEN.TAG_CLOSE &&
previous_token.opened.text[0] === '<' && previous_token.text[0] !== '/') {
// ^^ empty tag has no content
var tag_name = previous_token.opened.text.substr(1).toLowerCase();
if (tag_name === 'script' || tag_name === 'style') {
// Script and style tags are allowed to have comments wrapping their content
// or just have regular content.
var token = this._read_comment_or_cdata(c);
if (token) {
token.type = TOKEN.TEXT;
return token;
}
resulting_string = this._input.readUntil(new RegExp('</' + tag_name + '[\\n\\r\\t ]*?>', 'ig'));
} else if (this._is_content_unformatted(tag_name)) {
resulting_string = this._input.readUntil(new RegExp('</' + tag_name + '[\\n\\r\\t ]*?>', 'ig'));
}
}
if (resulting_string) {
return this._create_token(TOKEN.TEXT, resulting_string);
}
return null;
};
Tokenizer.prototype._read_content_word = function(c, open_token) {
var resulting_string = '';
if (this._options.unformatted_content_delimiter) {
if (c === this._options.unformatted_content_delimiter[0]) {
resulting_string = this.__patterns.unformatted_content_delimiter.read();
}
}
if (!resulting_string) {
resulting_string = (open_token && open_token.type === TOKEN.CONTROL_FLOW_OPEN) ? this.__patterns.word_control_flow_close_excluded.read() : this.__patterns.word.read();
}
if (resulting_string) {
return this._create_token(TOKEN.TEXT, resulting_string);
}
};
module.exports.Tokenizer = Tokenizer;
module.exports.TOKEN = TOKEN;
/***/ })
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __nested_webpack_require_111122__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_111122__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __nested_webpack_exports__ = __nested_webpack_require_111122__(18);
/******/ legacy_beautify_html = __nested_webpack_exports__;
/******/
/******/ })()
;
var style_html = legacy_beautify_html;
/* Footer */
if (true) {
// Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__, __webpack_require__(/*! ./beautify */ 32328), __webpack_require__(/*! ./beautify-css */ 34655)], __WEBPACK_AMD_DEFINE_RESULT__ = (function(requireamd) {
var js_beautify = __webpack_require__(/*! ./beautify */ 32328);
var css_beautify = __webpack_require__(/*! ./beautify-css */ 34655);
return {
html_beautify: function(html_source, options) {
return style_html(html_source, options, js_beautify.js_beautify, css_beautify.css_beautify);
}
};
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else { var css_beautify, js_beautify; }
}());
/***/ }),
/***/ 32328:
/*!*************************************************************************!*\
!*** ./node_modules/_js-beautify@1.15.1@js-beautify/js/lib/beautify.js ***!
\*************************************************************************/
/***/ (function(module, exports) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* AUTO-GENERATED. DO NOT MODIFY. */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
JS Beautifier
---------------
Written by Einar Lielmanis, <einar@beautifier.io>
https://beautifier.io/
Originally converted to javascript by Vital, <vital76@gmail.com>
"End braces on own line" added by Chris J. Shull, <chrisjshull@gmail.com>
Parsing improvements for brace-less statements by Liam Newman <bitwiseman@beautifier.io>
Usage:
js_beautify(js_source_text);
js_beautify(js_source_text, options);
The options are:
indent_size (default 4) - indentation size,
indent_char (default space) - character to indent with,
preserve_newlines (default true) - whether existing line breaks should be preserved,
max_preserve_newlines (default unlimited) - maximum number of line breaks to be preserved in one chunk,
jslint_happy (default false) - if true, then jslint-stricter mode is enforced.
jslint_happy !jslint_happy
---------------------------------
function () function()
switch () { switch() {
case 1: case 1:
break; break;
} }
space_after_anon_function (default false) - should the space before an anonymous function's parens be added, "function()" vs "function ()",
NOTE: This option is overridden by jslint_happy (i.e. if jslint_happy is true, space_after_anon_function is true by design)
brace_style (default "collapse") - "collapse" | "expand" | "end-expand" | "none" | any of the former + ",preserve-inline"
put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line, or attempt to keep them where they are.
preserve-inline will try to preserve inline blocks of curly braces
space_before_conditional (default true) - should the space before conditional statement be added, "if(true)" vs "if (true)",
unescape_strings (default false) - should printable characters in strings encoded in \xNN notation be unescaped, "example" vs "\x65\x78\x61\x6d\x70\x6c\x65"
wrap_line_length (default unlimited) - lines should wrap at next opportunity after this number of characters.
NOTE: This is not a hard limit. Lines will continue until a point where a newline would
be preserved if it were present.
end_with_newline (default false) - end output with a newline
e.g
js_beautify(js_source_text, {
'indent_size': 1,
'indent_char': '\t'
});
*/
(function() {
/* GENERATED_BUILD_OUTPUT */
var legacy_beautify_js;
/******/ (function() { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ([
/* 0 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_4000__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var Beautifier = (__nested_webpack_require_4000__(1).Beautifier),
Options = (__nested_webpack_require_4000__(5).Options);
function js_beautify(js_source_text, options) {
var beautifier = new Beautifier(js_source_text, options);
return beautifier.beautify();
}
module.exports = js_beautify;
module.exports.defaultOptions = function() {
return new Options();
};
/***/ }),
/* 1 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_5629__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var Output = (__nested_webpack_require_5629__(2).Output);
var Token = (__nested_webpack_require_5629__(3).Token);
var acorn = __nested_webpack_require_5629__(4);
var Options = (__nested_webpack_require_5629__(5).Options);
var Tokenizer = (__nested_webpack_require_5629__(7).Tokenizer);
var line_starters = (__nested_webpack_require_5629__(7).line_starters);
var positionable_operators = (__nested_webpack_require_5629__(7).positionable_operators);
var TOKEN = (__nested_webpack_require_5629__(7).TOKEN);
function in_array(what, arr) {
return arr.indexOf(what) !== -1;
}
function ltrim(s) {
return s.replace(/^\s+/g, '');
}
function generateMapFromStrings(list) {
var result = {};
for (var x = 0; x < list.length; x++) {
// make the mapped names underscored instead of dash
result[list[x].replace(/-/g, '_')] = list[x];
}
return result;
}
function reserved_word(token, word) {
return token && token.type === TOKEN.RESERVED && token.text === word;
}
function reserved_array(token, words) {
return token && token.type === TOKEN.RESERVED && in_array(token.text, words);
}
// Unsure of what they mean, but they work. Worth cleaning up in future.
var special_words = ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async'];
var validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];
// Generate map from array
var OPERATOR_POSITION = generateMapFromStrings(validPositionValues);
var OPERATOR_POSITION_BEFORE_OR_PRESERVE = [OPERATOR_POSITION.before_newline, OPERATOR_POSITION.preserve_newline];
var MODE = {
BlockStatement: 'BlockStatement', // 'BLOCK'
Statement: 'Statement', // 'STATEMENT'
ObjectLiteral: 'ObjectLiteral', // 'OBJECT',
ArrayLiteral: 'ArrayLiteral', //'[EXPRESSION]',
ForInitializer: 'ForInitializer', //'(FOR-EXPRESSION)',
Conditional: 'Conditional', //'(COND-EXPRESSION)',
Expression: 'Expression' //'(EXPRESSION)'
};
function remove_redundant_indentation(output, frame) {
// This implementation is effective but has some issues:
// - can cause line wrap to happen too soon due to indent removal
// after wrap points are calculated
// These issues are minor compared to ugly indentation.
if (frame.multiline_frame ||
frame.mode === MODE.ForInitializer ||
frame.mode === MODE.Conditional) {
return;
}
// remove one indent from each line inside this section
output.remove_indent(frame.start_line_index);
}
// we could use just string.split, but
// IE doesn't like returning empty strings
function split_linebreaks(s) {
//return s.split(/\x0d\x0a|\x0a/);
s = s.replace(acorn.allLineBreaks, '\n');
var out = [],
idx = s.indexOf("\n");
while (idx !== -1) {
out.push(s.substring(0, idx));
s = s.substring(idx + 1);
idx = s.indexOf("\n");
}
if (s.length) {
out.push(s);
}
return out;
}
function is_array(mode) {
return mode === MODE.ArrayLiteral;
}
function is_expression(mode) {
return in_array(mode, [MODE.Expression, MODE.ForInitializer, MODE.Conditional]);
}
function all_lines_start_with(lines, c) {
for (var i = 0; i < lines.length; i++) {
var line = lines[i].trim();
if (line.charAt(0) !== c) {
return false;
}
}
return true;
}
function each_line_matches_indent(lines, indent) {
var i = 0,
len = lines.length,
line;
for (; i < len; i++) {
line = lines[i];
// allow empty lines to pass through
if (line && line.indexOf(indent) !== 0) {
return false;
}
}
return true;
}
function Beautifier(source_text, options) {
options = options || {};
this._source_text = source_text || '';
this._output = null;
this._tokens = null;
this._last_last_text = null;
this._flags = null;
this._previous_flags = null;
this._flag_store = null;
this._options = new Options(options);
}
Beautifier.prototype.create_flags = function(flags_base, mode) {
var next_indent_level = 0;
if (flags_base) {
next_indent_level = flags_base.indentation_level;
if (!this._output.just_added_newline() &&
flags_base.line_indent_level > next_indent_level) {
next_indent_level = flags_base.line_indent_level;
}
}
var next_flags = {
mode: mode,
parent: flags_base,
last_token: flags_base ? flags_base.last_token : new Token(TOKEN.START_BLOCK, ''), // last token text
last_word: flags_base ? flags_base.last_word : '', // last TOKEN.WORD passed
declaration_statement: false,
declaration_assignment: false,
multiline_frame: false,
inline_frame: false,
if_block: false,
else_block: false,
class_start_block: false, // class A { INSIDE HERE } or class B extends C { INSIDE HERE }
do_block: false,
do_while: false,
import_block: false,
in_case_statement: false, // switch(..){ INSIDE HERE }
in_case: false, // we're on the exact line with "case 0:"
case_body: false, // the indented case-action block
case_block: false, // the indented case-action block is wrapped with {}
indentation_level: next_indent_level,
alignment: 0,
line_indent_level: flags_base ? flags_base.line_indent_level : next_indent_level,
start_line_index: this._output.get_line_number(),
ternary_depth: 0
};
return next_flags;
};
Beautifier.prototype._reset = function(source_text) {
var baseIndentString = source_text.match(/^[\t ]*/)[0];
this._last_last_text = ''; // pre-last token text
this._output = new Output(this._options, baseIndentString);
// If testing the ignore directive, start with output disable set to true
this._output.raw = this._options.test_output_raw;
// Stack of parsing/formatting states, including MODE.
// We tokenize, parse, and output in an almost purely a forward-only stream of token input
// and formatted output. This makes the beautifier less accurate than full parsers
// but also far more tolerant of syntax errors.
//
// For example, the default mode is MODE.BlockStatement. If we see a '{' we push a new frame of type
// MODE.BlockStatement on the the stack, even though it could be object literal. If we later
// encounter a ":", we'll switch to to MODE.ObjectLiteral. If we then see a ";",
// most full parsers would die, but the beautifier gracefully falls back to
// MODE.BlockStatement and continues on.
this._flag_store = [];
this.set_mode(MODE.BlockStatement);
var tokenizer = new Tokenizer(source_text, this._options);
this._tokens = tokenizer.tokenize();
return source_text;
};
Beautifier.prototype.beautify = function() {
// if disabled, return the input unchanged.
if (this._options.disabled) {
return this._source_text;
}
var sweet_code;
var source_text = this._reset(this._source_text);
var eol = this._options.eol;
if (this._options.eol === 'auto') {
eol = '\n';
if (source_text && acorn.lineBreak.test(source_text || '')) {
eol = source_text.match(acorn.lineBreak)[0];
}
}
var current_token = this._tokens.next();
while (current_token) {
this.handle_token(current_token);
this._last_last_text = this._flags.last_token.text;
this._flags.last_token = current_token;
current_token = this._tokens.next();
}
sweet_code = this._output.get_code(eol);
return sweet_code;
};
Beautifier.prototype.handle_token = function(current_token, preserve_statement_flags) {
if (current_token.type === TOKEN.START_EXPR) {
this.handle_start_expr(current_token);
} else if (current_token.type === TOKEN.END_EXPR) {
this.handle_end_expr(current_token);
} else if (current_token.type === TOKEN.START_BLOCK) {
this.handle_start_block(current_token);
} else if (current_token.type === TOKEN.END_BLOCK) {
this.handle_end_block(current_token);
} else if (current_token.type === TOKEN.WORD) {
this.handle_word(current_token);
} else if (current_token.type === TOKEN.RESERVED) {
this.handle_word(current_token);
} else if (current_token.type === TOKEN.SEMICOLON) {
this.handle_semicolon(current_token);
} else if (current_token.type === TOKEN.STRING) {
this.handle_string(current_token);
} else if (current_token.type === TOKEN.EQUALS) {
this.handle_equals(current_token);
} else if (current_token.type === TOKEN.OPERATOR) {
this.handle_operator(current_token);
} else if (current_token.type === TOKEN.COMMA) {
this.handle_comma(current_token);
} else if (current_token.type === TOKEN.BLOCK_COMMENT) {
this.handle_block_comment(current_token, preserve_statement_flags);
} else if (current_token.type === TOKEN.COMMENT) {
this.handle_comment(current_token, preserve_statement_flags);
} else if (current_token.type === TOKEN.DOT) {
this.handle_dot(current_token);
} else if (current_token.type === TOKEN.EOF) {
this.handle_eof(current_token);
} else if (current_token.type === TOKEN.UNKNOWN) {
this.handle_unknown(current_token, preserve_statement_flags);
} else {
this.handle_unknown(current_token, preserve_statement_flags);
}
};
Beautifier.prototype.handle_whitespace_and_comments = function(current_token, preserve_statement_flags) {
var newlines = current_token.newlines;
var keep_whitespace = this._options.keep_array_indentation && is_array(this._flags.mode);
if (current_token.comments_before) {
var comment_token = current_token.comments_before.next();
while (comment_token) {
// The cleanest handling of inline comments is to treat them as though they aren't there.
// Just continue formatting and the behavior should be logical.
// Also ignore unknown tokens. Again, this should result in better behavior.
this.handle_whitespace_and_comments(comment_token, preserve_statement_flags);
this.handle_token(comment_token, preserve_statement_flags);
comment_token = current_token.comments_before.next();
}
}
if (keep_whitespace) {
for (var i = 0; i < newlines; i += 1) {
this.print_newline(i > 0, preserve_statement_flags);
}
} else {
if (this._options.max_preserve_newlines && newlines > this._options.max_preserve_newlines) {
newlines = this._options.max_preserve_newlines;
}
if (this._options.preserve_newlines) {
if (newlines > 1) {
this.print_newline(false, preserve_statement_flags);
for (var j = 1; j < newlines; j += 1) {
this.print_newline(true, preserve_statement_flags);
}
}
}
}
};
var newline_restricted_tokens = ['async', 'break', 'continue', 'return', 'throw', 'yield'];
Beautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, force_linewrap) {
force_linewrap = (force_linewrap === undefined) ? false : force_linewrap;
// Never wrap the first token on a line
if (this._output.just_added_newline()) {
return;
}
var shouldPreserveOrForce = (this._options.preserve_newlines && current_token.newlines) || force_linewrap;
var operatorLogicApplies = in_array(this._flags.last_token.text, positionable_operators) ||
in_array(current_token.text, positionable_operators);
if (operatorLogicApplies) {
var shouldPrintOperatorNewline = (
in_array(this._flags.last_token.text, positionable_operators) &&
in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)
) ||
in_array(current_token.text, positionable_operators);
shouldPreserveOrForce = shouldPreserveOrForce && shouldPrintOperatorNewline;
}
if (shouldPreserveOrForce) {
this.print_newline(false, true);
} else if (this._options.wrap_line_length) {
if (reserved_array(this._flags.last_token, newline_restricted_tokens)) {
// These tokens should never have a newline inserted
// between them and the following expression.
return;
}
this._output.set_wrap_point();
}
};
Beautifier.prototype.print_newline = function(force_newline, preserve_statement_flags) {
if (!preserve_statement_flags) {
if (this._flags.last_token.text !== ';' && this._flags.last_token.text !== ',' && this._flags.last_token.text !== '=' && (this._flags.last_token.type !== TOKEN.OPERATOR || this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) {
var next_token = this._tokens.peek();
while (this._flags.mode === MODE.Statement &&
!(this._flags.if_block && reserved_word(next_token, 'else')) &&
!this._flags.do_block) {
this.restore_mode();
}
}
}
if (this._output.add_new_line(force_newline)) {
this._flags.multiline_frame = true;
}
};
Beautifier.prototype.print_token_line_indentation = function(current_token) {
if (this._output.just_added_newline()) {
if (this._options.keep_array_indentation &&
current_token.newlines &&
(current_token.text === '[' || is_array(this._flags.mode))) {
this._output.current_line.set_indent(-1);
this._output.current_line.push(current_token.whitespace_before);
this._output.space_before_token = false;
} else if (this._output.set_indent(this._flags.indentation_level, this._flags.alignment)) {
this._flags.line_indent_level = this._flags.indentation_level;
}
}
};
Beautifier.prototype.print_token = function(current_token) {
if (this._output.raw) {
this._output.add_raw_token(current_token);
return;
}
if (this._options.comma_first && current_token.previous && current_token.previous.type === TOKEN.COMMA &&
this._output.just_added_newline()) {
if (this._output.previous_line.last() === ',') {
var popped = this._output.previous_line.pop();
// if the comma was already at the start of the line,
// pull back onto that line and reprint the indentation
if (this._output.previous_line.is_empty()) {
this._output.previous_line.push(popped);
this._output.trim(true);
this._output.current_line.pop();
this._output.trim();
}
// add the comma in front of the next token
this.print_token_line_indentation(current_token);
this._output.add_token(',');
this._output.space_before_token = true;
}
}
this.print_token_line_indentation(current_token);
this._output.non_breaking_space = true;
this._output.add_token(current_token.text);
if (this._output.previous_token_wrapped) {
this._flags.multiline_frame = true;
}
};
Beautifier.prototype.indent = function() {
this._flags.indentation_level += 1;
this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
};
Beautifier.prototype.deindent = function() {
if (this._flags.indentation_level > 0 &&
((!this._flags.parent) || this._flags.indentation_level > this._flags.parent.indentation_level)) {
this._flags.indentation_level -= 1;
this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
}
};
Beautifier.prototype.set_mode = function(mode) {
if (this._flags) {
this._flag_store.push(this._flags);
this._previous_flags = this._flags;
} else {
this._previous_flags = this.create_flags(null, mode);
}
this._flags = this.create_flags(this._previous_flags, mode);
this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
};
Beautifier.prototype.restore_mode = function() {
if (this._flag_store.length > 0) {
this._previous_flags = this._flags;
this._flags = this._flag_store.pop();
if (this._previous_flags.mode === MODE.Statement) {
remove_redundant_indentation(this._output, this._previous_flags);
}
this._output.set_indent(this._flags.indentation_level, this._flags.alignment);
}
};
Beautifier.prototype.start_of_object_property = function() {
return this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement && (
(this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || (reserved_array(this._flags.last_token, ['get', 'set'])));
};
Beautifier.prototype.start_of_statement = function(current_token) {
var start = false;
start = start || reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD;
start = start || reserved_word(this._flags.last_token, 'do');
start = start || (!(this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement)) && reserved_array(this._flags.last_token, newline_restricted_tokens) && !current_token.newlines;
start = start || reserved_word(this._flags.last_token, 'else') &&
!(reserved_word(current_token, 'if') && !current_token.comments_before);
start = start || (this._flags.last_token.type === TOKEN.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional));
start = start || (this._flags.last_token.type === TOKEN.WORD && this._flags.mode === MODE.BlockStatement &&
!this._flags.in_case &&
!(current_token.text === '--' || current_token.text === '++') &&
this._last_last_text !== 'function' &&
current_token.type !== TOKEN.WORD && current_token.type !== TOKEN.RESERVED);
start = start || (this._flags.mode === MODE.ObjectLiteral && (
(this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || reserved_array(this._flags.last_token, ['get', 'set'])));
if (start) {
this.set_mode(MODE.Statement);
this.indent();
this.handle_whitespace_and_comments(current_token, true);
// Issue #276:
// If starting a new statement with [if, for, while, do], push to a new line.
// if (a) if (b) if(c) d(); else e(); else f();
if (!this.start_of_object_property()) {
this.allow_wrap_or_preserved_newline(current_token,
reserved_array(current_token, ['do', 'for', 'if', 'while']));
}
return true;
}
return false;
};
Beautifier.prototype.handle_start_expr = function(current_token) {
// The conditional starts the statement if appropriate.
if (!this.start_of_statement(current_token)) {
this.handle_whitespace_and_comments(current_token);
}
var next_mode = MODE.Expression;
if (current_token.text === '[') {
if (this._flags.last_token.type === TOKEN.WORD || this._flags.last_token.text === ')') {
// this is array index specifier, break immediately
// a[x], fn()[x]
if (reserved_array(this._flags.last_token, line_starters)) {
this._output.space_before_token = true;
}
this.print_token(current_token);
this.set_mode(next_mode);
this.indent();
if (this._options.space_in_paren) {
this._output.space_before_token = true;
}
return;
}
next_mode = MODE.ArrayLiteral;
if (is_array(this._flags.mode)) {
if (this._flags.last_token.text === '[' ||
(this._flags.last_token.text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) {
// ], [ goes to new line
// }, [ goes to new line
if (!this._options.keep_array_indentation) {
this.print_newline();
}
}
}
if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR, TOKEN.DOT])) {
this._output.space_before_token = true;
}
} else {
if (this._flags.last_token.type === TOKEN.RESERVED) {
if (this._flags.last_token.text === 'for') {
this._output.space_before_token = this._options.space_before_conditional;
next_mode = MODE.ForInitializer;
} else if (in_array(this._flags.last_token.text, ['if', 'while', 'switch'])) {
this._output.space_before_token = this._options.space_before_conditional;
next_mode = MODE.Conditional;
} else if (in_array(this._flags.last_word, ['await', 'async'])) {
// Should be a space between await and an IIFE, or async and an arrow function
this._output.space_before_token = true;
} else if (this._flags.last_token.text === 'import' && current_token.whitespace_before === '') {
this._output.space_before_token = false;
} else if (in_array(this._flags.last_token.text, line_starters) || this._flags.last_token.text === 'catch') {
this._output.space_before_token = true;
}
} else if (this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {
// Support of this kind of newline preservation.
// a = (b &&
// (c || d));
if (!this.start_of_object_property()) {
this.allow_wrap_or_preserved_newline(current_token);
}
} else if (this._flags.last_token.type === TOKEN.WORD) {
this._output.space_before_token = false;
// function name() vs function name ()
// function* name() vs function* name ()
// async name() vs async name ()
// In ES6, you can also define the method properties of an object
// var obj = {a: function() {}}
// It can be abbreviated
// var obj = {a() {}}
// var obj = { a() {}} vs var obj = { a () {}}
// var obj = { * a() {}} vs var obj = { * a () {}}
var peek_back_two = this._tokens.peek(-3);
if (this._options.space_after_named_function && peek_back_two) {
// peek starts at next character so -1 is current token
var peek_back_three = this._tokens.peek(-4);
if (reserved_array(peek_back_two, ['async', 'function']) ||
(peek_back_two.text === '*' && reserved_array(peek_back_three, ['async', 'function']))) {
this._output.space_before_token = true;
} else if (this._flags.mode === MODE.ObjectLiteral) {
if ((peek_back_two.text === '{' || peek_back_two.text === ',') ||
(peek_back_two.text === '*' && (peek_back_three.text === '{' || peek_back_three.text === ','))) {
this._output.space_before_token = true;
}
} else if (this._flags.parent && this._flags.parent.class_start_block) {
this._output.space_before_token = true;
}
}
} else {
// Support preserving wrapped arrow function expressions
// a.b('c',
// () => d.e
// )
this.allow_wrap_or_preserved_newline(current_token);
}
// function() vs function ()
// yield*() vs yield* ()
// function*() vs function* ()
if ((this._flags.last_token.type === TOKEN.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) ||
(this._flags.last_token.text === '*' &&
(in_array(this._last_last_text, ['function', 'yield']) ||
(this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {
this._output.space_before_token = this._options.space_after_anon_function;
}
}
if (this._flags.last_token.text === ';' || this._flags.last_token.type === TOKEN.START_BLOCK) {
this.print_newline();
} else if (this._flags.last_token.type === TOKEN.END_EXPR || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.END_BLOCK || this._flags.last_token.text === '.' || this._flags.last_token.type === TOKEN.COMMA) {
// do nothing on (( and )( and ][ and ]( and .(
// TODO: Consider whether forcing this is required. Review failing tests when removed.
this.allow_wrap_or_preserved_newline(current_token, current_token.newlines);
}
this.print_token(current_token);
this.set_mode(next_mode);
if (this._options.space_in_paren) {
this._output.space_before_token = true;
}
// In all cases, if we newline while inside an expression it should be indented.
this.indent();
};
Beautifier.prototype.handle_end_expr = function(current_token) {
// statements inside expressions are not valid syntax, but...
// statements must all be closed when their container closes
while (this._flags.mode === MODE.Statement) {
this.restore_mode();
}
this.handle_whitespace_and_comments(current_token);
if (this._flags.multiline_frame) {
this.allow_wrap_or_preserved_newline(current_token,
current_token.text === ']' && is_array(this._flags.mode) && !this._options.keep_array_indentation);
}
if (this._options.space_in_paren) {
if (this._flags.last_token.type === TOKEN.START_EXPR && !this._options.space_in_empty_paren) {
// () [] no inner space in empty parens like these, ever, ref #320
this._output.trim();
this._output.space_before_token = false;
} else {
this._output.space_before_token = true;
}
}
this.deindent();
this.print_token(current_token);
this.restore_mode();
remove_redundant_indentation(this._output, this._previous_flags);
// do {} while () // no statement required after
if (this._flags.do_while && this._previous_flags.mode === MODE.Conditional) {
this._previous_flags.mode = MODE.Expression;
this._flags.do_block = false;
this._flags.do_while = false;
}
};
Beautifier.prototype.handle_start_block = function(current_token) {
this.handle_whitespace_and_comments(current_token);
// Check if this is should be treated as a ObjectLiteral
var next_token = this._tokens.peek();
var second_token = this._tokens.peek(1);
if (this._flags.last_word === 'switch' && this._flags.last_token.type === TOKEN.END_EXPR) {
this.set_mode(MODE.BlockStatement);
this._flags.in_case_statement = true;
} else if (this._flags.case_body) {
this.set_mode(MODE.BlockStatement);
} else if (second_token && (
(in_array(second_token.text, [':', ',']) && in_array(next_token.type, [TOKEN.STRING, TOKEN.WORD, TOKEN.RESERVED])) ||
(in_array(next_token.text, ['get', 'set', '...']) && in_array(second_token.type, [TOKEN.WORD, TOKEN.RESERVED]))
)) {
// We don't support TypeScript,but we didn't break it for a very long time.
// We'll try to keep not breaking it.
if (in_array(this._last_last_text, ['class', 'interface']) && !in_array(second_token.text, [':', ','])) {
this.set_mode(MODE.BlockStatement);
} else {
this.set_mode(MODE.ObjectLiteral);
}
} else if (this._flags.last_token.type === TOKEN.OPERATOR && this._flags.last_token.text === '=>') {
// arrow function: (param1, paramN) => { statements }
this.set_mode(MODE.BlockStatement);
} else if (in_array(this._flags.last_token.type, [TOKEN.EQUALS, TOKEN.START_EXPR, TOKEN.COMMA, TOKEN.OPERATOR]) ||
reserved_array(this._flags.last_token, ['return', 'throw', 'import', 'default'])
) {
// Detecting shorthand function syntax is difficult by scanning forward,
// so check the surrounding context.
// If the block is being returned, imported, export default, passed as arg,
// assigned with = or assigned in a nested object, treat as an ObjectLiteral.
this.set_mode(MODE.ObjectLiteral);
} else {
this.set_mode(MODE.BlockStatement);
}
if (this._flags.last_token) {
if (reserved_array(this._flags.last_token.previous, ['class', 'extends'])) {
this._flags.class_start_block = true;
}
}
var empty_braces = !next_token.comments_before && next_token.text === '}';
var empty_anonymous_function = empty_braces && this._flags.last_word === 'function' &&
this._flags.last_token.type === TOKEN.END_EXPR;
if (this._options.brace_preserve_inline) // check for inline, set inline_frame if so
{
// search forward for a newline wanted inside this block
var index = 0;
var check_token = null;
this._flags.inline_frame = true;
do {
index += 1;
check_token = this._tokens.peek(index - 1);
if (check_token.newlines) {
this._flags.inline_frame = false;
break;
}
} while (check_token.type !== TOKEN.EOF &&
!(check_token.type === TOKEN.END_BLOCK && check_token.opened === current_token));
}
if ((this._options.brace_style === "expand" ||
(this._options.brace_style === "none" && current_token.newlines)) &&
!this._flags.inline_frame) {
if (this._flags.last_token.type !== TOKEN.OPERATOR &&
(empty_anonymous_function ||
this._flags.last_token.type === TOKEN.EQUALS ||
(reserved_array(this._flags.last_token, special_words) && this._flags.last_token.text !== 'else'))) {
this._output.space_before_token = true;
} else {
this.print_newline(false, true);
}
} else { // collapse || inline_frame
if (is_array(this._previous_flags.mode) && (this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.COMMA)) {
if (this._flags.last_token.type === TOKEN.COMMA || this._options.space_in_paren) {
this._output.space_before_token = true;
}
if (this._flags.last_token.type === TOKEN.COMMA || (this._flags.last_token.type === TOKEN.START_EXPR && this._flags.inline_frame)) {
this.allow_wrap_or_preserved_newline(current_token);
this._previous_flags.multiline_frame = this._previous_flags.multiline_frame || this._flags.multiline_frame;
this._flags.multiline_frame = false;
}
}
if (this._flags.last_token.type !== TOKEN.OPERATOR && this._flags.last_token.type !== TOKEN.START_EXPR) {
if (in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.SEMICOLON]) && !this._flags.inline_frame) {
this.print_newline();
} else {
this._output.space_before_token = true;
}
}
}
this.print_token(current_token);
this.indent();
// Except for specific cases, open braces are followed by a new line.
if (!empty_braces && !(this._options.brace_preserve_inline && this._flags.inline_frame)) {
this.print_newline();
}
};
Beautifier.prototype.handle_end_block = function(current_token) {
// statements must all be closed when their container closes
this.handle_whitespace_and_comments(current_token);
while (this._flags.mode === MODE.Statement) {
this.restore_mode();
}
var empty_braces = this._flags.last_token.type === TOKEN.START_BLOCK;
if (this._flags.inline_frame && !empty_braces) { // try inline_frame (only set if this._options.braces-preserve-inline) first
this._output.space_before_token = true;
} else if (this._options.brace_style === "expand") {
if (!empty_braces) {
this.print_newline();
}
} else {
// skip {}
if (!empty_braces) {
if (is_array(this._flags.mode) && this._options.keep_array_indentation) {
// we REALLY need a newline here, but newliner would skip that
this._options.keep_array_indentation = false;
this.print_newline();
this._options.keep_array_indentation = true;
} else {
this.print_newline();
}
}
}
this.restore_mode();
this.print_token(current_token);
};
Beautifier.prototype.handle_word = function(current_token) {
if (current_token.type === TOKEN.RESERVED) {
if (in_array(current_token.text, ['set', 'get']) && this._flags.mode !== MODE.ObjectLiteral) {
current_token.type = TOKEN.WORD;
} else if (current_token.text === 'import' && in_array(this._tokens.peek().text, ['(', '.'])) {
current_token.type = TOKEN.WORD;
} else if (in_array(current_token.text, ['as', 'from']) && !this._flags.import_block) {
current_token.type = TOKEN.WORD;
} else if (this._flags.mode === MODE.ObjectLiteral) {
var next_token = this._tokens.peek();
if (next_token.text === ':') {
current_token.type = TOKEN.WORD;
}
}
}
if (this.start_of_statement(current_token)) {
// The conditional starts the statement if appropriate.
if (reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD) {
this._flags.declaration_statement = true;
}
} else if (current_token.newlines && !is_expression(this._flags.mode) &&
(this._flags.last_token.type !== TOKEN.OPERATOR || (this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) &&
this._flags.last_token.type !== TOKEN.EQUALS &&
(this._options.preserve_newlines || !reserved_array(this._flags.last_token, ['var', 'let', 'const', 'set', 'get']))) {
this.handle_whitespace_and_comments(current_token);
this.print_newline();
} else {
this.handle_whitespace_and_comments(current_token);
}
if (this._flags.do_block && !this._flags.do_while) {
if (reserved_word(current_token, 'while')) {
// do {} ## while ()
this._output.space_before_token = true;
this.print_token(current_token);
this._output.space_before_token = true;
this._flags.do_while = true;
return;
} else {
// do {} should always have while as the next word.
// if we don't see the expected while, recover
this.print_newline();
this._flags.do_block = false;
}
}
// if may be followed by else, or not
// Bare/inline ifs are tricky
// Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e();
if (this._flags.if_block) {
if (!this._flags.else_block && reserved_word(current_token, 'else')) {
this._flags.else_block = true;
} else {
while (this._flags.mode === MODE.Statement) {
this.restore_mode();
}
this._flags.if_block = false;
this._flags.else_block = false;
}
}
if (this._flags.in_case_statement && reserved_array(current_token, ['case', 'default'])) {
this.print_newline();
if (!this._flags.case_block && (this._flags.case_body || this._options.jslint_happy)) {
// switch cases following one another
this.deindent();
}
this._flags.case_body = false;
this.print_token(current_token);
this._flags.in_case = true;
return;
}
if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {
if (!this.start_of_object_property() && !(
// start of object property is different for numeric values with +/- prefix operators
in_array(this._flags.last_token.text, ['+', '-']) && this._last_last_text === ':' && this._flags.parent.mode === MODE.ObjectLiteral)) {
this.allow_wrap_or_preserved_newline(current_token);
}
}
if (reserved_word(current_token, 'function')) {
if (in_array(this._flags.last_token.text, ['}', ';']) ||
(this._output.just_added_newline() && !(in_array(this._flags.last_token.text, ['(', '[', '{', ':', '=', ',']) || this._flags.last_token.type === TOKEN.OPERATOR))) {
// make sure there is a nice clean space of at least one blank line
// before a new function definition
if (!this._output.just_added_blankline() && !current_token.comments_before) {
this.print_newline();
this.print_newline(true);
}
}
if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD) {
if (reserved_array(this._flags.last_token, ['get', 'set', 'new', 'export']) ||
reserved_array(this._flags.last_token, newline_restricted_tokens)) {
this._output.space_before_token = true;
} else if (reserved_word(this._flags.last_token, 'default') && this._last_last_text === 'export') {
this._output.space_before_token = true;
} else if (this._flags.last_token.text === 'declare') {
// accomodates Typescript declare function formatting
this._output.space_before_token = true;
} else {
this.print_newline();
}
} else if (this._flags.last_token.type === TOKEN.OPERATOR || this._flags.last_token.text === '=') {
// foo = function
this._output.space_before_token = true;
} else if (!this._flags.multiline_frame && (is_expression(this._flags.mode) || is_array(this._flags.mode))) {
// (function
} else {
this.print_newline();
}
this.print_token(current_token);
this._flags.last_word = current_token.text;
return;
}
var prefix = 'NONE';
if (this._flags.last_token.type === TOKEN.END_BLOCK) {
if (this._previous_flags.inline_frame) {
prefix = 'SPACE';
} else if (!reserved_array(current_token, ['else', 'catch', 'finally', 'from'])) {
prefix = 'NEWLINE';
} else {
if (this._options.brace_style === "expand" ||
this._options.brace_style === "end-expand" ||
(this._options.brace_style === "none" && current_token.newlines)) {
prefix = 'NEWLINE';
} else {
prefix = 'SPACE';
this._output.space_before_token = true;
}
}
} else if (this._flags.last_token.type === TOKEN.SEMICOLON && this._flags.mode === MODE.BlockStatement) {
// TODO: Should this be for STATEMENT as well?
prefix = 'NEWLINE';
} else if (this._flags.last_token.type === TOKEN.SEMICOLON && is_expression(this._flags.mode)) {
prefix = 'SPACE';
} else if (this._flags.last_token.type === TOKEN.STRING) {
prefix = 'NEWLINE';
} else if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD ||
(this._flags.last_token.text === '*' &&
(in_array(this._last_last_text, ['function', 'yield']) ||
(this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {
prefix = 'SPACE';
} else if (this._flags.last_token.type === TOKEN.START_BLOCK) {
if (this._flags.inline_frame) {
prefix = 'SPACE';
} else {
prefix = 'NEWLINE';
}
} else if (this._flags.last_token.type === TOKEN.END_EXPR) {
this._output.space_before_token = true;
prefix = 'NEWLINE';
}
if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') {
if (this._flags.inline_frame || this._flags.last_token.text === 'else' || this._flags.last_token.text === 'export') {
prefix = 'SPACE';
} else {
prefix = 'NEWLINE';
}
}
if (reserved_array(current_token, ['else', 'catch', 'finally'])) {
if ((!(this._flags.last_token.type === TOKEN.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) ||
this._options.brace_style === "expand" ||
this._options.brace_style === "end-expand" ||
(this._options.brace_style === "none" && current_token.newlines)) &&
!this._flags.inline_frame) {
this.print_newline();
} else {
this._output.trim(true);
var line = this._output.current_line;
// If we trimmed and there's something other than a close block before us
// put a newline back in. Handles '} // comment' scenario.
if (line.last() !== '}') {
this.print_newline();
}
this._output.space_before_token = true;
}
} else if (prefix === 'NEWLINE') {
if (reserved_array(this._flags.last_token, special_words)) {
// no newline between 'return nnn'
this._output.space_before_token = true;
} else if (this._flags.last_token.text === 'declare' && reserved_array(current_token, ['var', 'let', 'const'])) {
// accomodates Typescript declare formatting
this._output.space_before_token = true;
} else if (this._flags.last_token.type !== TOKEN.END_EXPR) {
if ((this._flags.last_token.type !== TOKEN.START_EXPR || !reserved_array(current_token, ['var', 'let', 'const'])) && this._flags.last_token.text !== ':') {
// no need to force newline on 'var': for (var x = 0...)
if (reserved_word(current_token, 'if') && reserved_word(current_token.previous, 'else')) {
// no newline for } else if {
this._output.space_before_token = true;
} else {
this.print_newline();
}
}
} else if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') {
this.print_newline();
}
} else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_token.text === ',' && this._last_last_text === '}') {
this.print_newline(); // }, in lists get a newline treatment
} else if (prefix === 'SPACE') {
this._output.space_before_token = true;
}
if (current_token.previous && (current_token.previous.type === TOKEN.WORD || current_token.previous.type === TOKEN.RESERVED)) {
this._output.space_before_token = true;
}
this.print_token(current_token);
this._flags.last_word = current_token.text;
if (current_token.type === TOKEN.RESERVED) {
if (current_token.text === 'do') {
this._flags.do_block = true;
} else if (current_token.text === 'if') {
this._flags.if_block = true;
} else if (current_token.text === 'import') {
this._flags.import_block = true;
} else if (this._flags.import_block && reserved_word(current_token, 'from')) {
this._flags.import_block = false;
}
}
};
Beautifier.prototype.handle_semicolon = function(current_token) {
if (this.start_of_statement(current_token)) {
// The conditional starts the statement if appropriate.
// Semicolon can be the start (and end) of a statement
this._output.space_before_token = false;
} else {
this.handle_whitespace_and_comments(current_token);
}
var next_token = this._tokens.peek();
while (this._flags.mode === MODE.Statement &&
!(this._flags.if_block && reserved_word(next_token, 'else')) &&
!this._flags.do_block) {
this.restore_mode();
}
// hacky but effective for the moment
if (this._flags.import_block) {
this._flags.import_block = false;
}
this.print_token(current_token);
};
Beautifier.prototype.handle_string = function(current_token) {
if (current_token.text.startsWith("`") && current_token.newlines === 0 && current_token.whitespace_before === '' && (current_token.previous.text === ')' || this._flags.last_token.type === TOKEN.WORD)) {
//Conditional for detectign backtick strings
} else if (this.start_of_statement(current_token)) {
// The conditional starts the statement if appropriate.
// One difference - strings want at least a space before
this._output.space_before_token = true;
} else {
this.handle_whitespace_and_comments(current_token);
if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD || this._flags.inline_frame) {
this._output.space_before_token = true;
} else if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {
if (!this.start_of_object_property()) {
this.allow_wrap_or_preserved_newline(current_token);
}
} else if ((current_token.text.startsWith("`") && this._flags.last_token.type === TOKEN.END_EXPR && (current_token.previous.text === ']' || current_token.previous.text === ')') && current_token.newlines === 0)) {
this._output.space_before_token = true;
} else {
this.print_newline();
}
}
this.print_token(current_token);
};
Beautifier.prototype.handle_equals = function(current_token) {
if (this.start_of_statement(current_token)) {
// The conditional starts the statement if appropriate.
} else {
this.handle_whitespace_and_comments(current_token);
}
if (this._flags.declaration_statement) {
// just got an '=' in a var-line, different formatting/line-breaking, etc will now be done
this._flags.declaration_assignment = true;
}
this._output.space_before_token = true;
this.print_token(current_token);
this._output.space_before_token = true;
};
Beautifier.prototype.handle_comma = function(current_token) {
this.handle_whitespace_and_comments(current_token, true);
this.print_token(current_token);
this._output.space_before_token = true;
if (this._flags.declaration_statement) {
if (is_expression(this._flags.parent.mode)) {
// do not break on comma, for(var a = 1, b = 2)
this._flags.declaration_assignment = false;
}
if (this._flags.declaration_assignment) {
this._flags.declaration_assignment = false;
this.print_newline(false, true);
} else if (this._options.comma_first) {
// for comma-first, we want to allow a newline before the comma
// to turn into a newline after the comma, which we will fixup later
this.allow_wrap_or_preserved_newline(current_token);
}
} else if (this._flags.mode === MODE.ObjectLiteral ||
(this._flags.mode === MODE.Statement && this._flags.parent.mode === MODE.ObjectLiteral)) {
if (this._flags.mode === MODE.Statement) {
this.restore_mode();
}
if (!this._flags.inline_frame) {
this.print_newline();
}
} else if (this._options.comma_first) {
// EXPR or DO_BLOCK
// for comma-first, we want to allow a newline before the comma
// to turn into a newline after the comma, which we will fixup later
this.allow_wrap_or_preserved_newline(current_token);
}
};
Beautifier.prototype.handle_operator = function(current_token) {
var isGeneratorAsterisk = current_token.text === '*' &&
(reserved_array(this._flags.last_token, ['function', 'yield']) ||
(in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.COMMA, TOKEN.END_BLOCK, TOKEN.SEMICOLON]))
);
var isUnary = in_array(current_token.text, ['-', '+']) && (
in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.START_EXPR, TOKEN.EQUALS, TOKEN.OPERATOR]) ||
in_array(this._flags.last_token.text, line_starters) ||
this._flags.last_token.text === ','
);
if (this.start_of_statement(current_token)) {
// The conditional starts the statement if appropriate.
} else {
var preserve_statement_flags = !isGeneratorAsterisk;
this.handle_whitespace_and_comments(current_token, preserve_statement_flags);
}
// hack for actionscript's import .*;
if (current_token.text === '*' && this._flags.last_token.type === TOKEN.DOT) {
this.print_token(current_token);
return;
}
if (current_token.text === '::') {
// no spaces around exotic namespacing syntax operator
this.print_token(current_token);
return;
}
if (in_array(current_token.text, ['-', '+']) && this.start_of_object_property()) {
// numeric value with +/- symbol in front as a property
this.print_token(current_token);
return;
}
// Allow line wrapping between operators when operator_position is
// set to before or preserve
if (this._flags.last_token.type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) {
this.allow_wrap_or_preserved_newline(current_token);
}
if (current_token.text === ':' && this._flags.in_case) {
this.print_token(current_token);
this._flags.in_case = false;
this._flags.case_body = true;
if (this._tokens.peek().type !== TOKEN.START_BLOCK) {
this.indent();
this.print_newline();
this._flags.case_block = false;
} else {
this._flags.case_block = true;
this._output.space_before_token = true;
}
return;
}
var space_before = true;
var space_after = true;
var in_ternary = false;
if (current_token.text === ':') {
if (this._flags.ternary_depth === 0) {
// Colon is invalid javascript outside of ternary and object, but do our best to guess what was meant.
space_before = false;
} else {
this._flags.ternary_depth -= 1;
in_ternary = true;
}
} else if (current_token.text === '?') {
this._flags.ternary_depth += 1;
}
// let's handle the operator_position option prior to any conflicting logic
if (!isUnary && !isGeneratorAsterisk && this._options.preserve_newlines && in_array(current_token.text, positionable_operators)) {
var isColon = current_token.text === ':';
var isTernaryColon = (isColon && in_ternary);
var isOtherColon = (isColon && !in_ternary);
switch (this._options.operator_position) {
case OPERATOR_POSITION.before_newline:
// if the current token is : and it's not a ternary statement then we set space_before to false
this._output.space_before_token = !isOtherColon;
this.print_token(current_token);
if (!isColon || isTernaryColon) {
this.allow_wrap_or_preserved_newline(current_token);
}
this._output.space_before_token = true;
return;
case OPERATOR_POSITION.after_newline:
// if the current token is anything but colon, or (via deduction) it's a colon and in a ternary statement,
// then print a newline.
this._output.space_before_token = true;
if (!isColon || isTernaryColon) {
if (this._tokens.peek().newlines) {
this.print_newline(false, true);
} else {
this.allow_wrap_or_preserved_newline(current_token);
}
} else {
this._output.space_before_token = false;
}
this.print_token(current_token);
this._output.space_before_token = true;
return;
case OPERATOR_POSITION.preserve_newline:
if (!isOtherColon) {
this.allow_wrap_or_preserved_newline(current_token);
}
// if we just added a newline, or the current token is : and it's not a ternary statement,
// then we set space_before to false
space_before = !(this._output.just_added_newline() || isOtherColon);
this._output.space_before_token = space_before;
this.print_token(current_token);
this._output.space_before_token = true;
return;
}
}
if (isGeneratorAsterisk) {
this.allow_wrap_or_preserved_newline(current_token);
space_before = false;
var next_token = this._tokens.peek();
space_after = next_token && in_array(next_token.type, [TOKEN.WORD, TOKEN.RESERVED]);
} else if (current_token.text === '...') {
this.allow_wrap_or_preserved_newline(current_token);
space_before = this._flags.last_token.type === TOKEN.START_BLOCK;
space_after = false;
} else if (in_array(current_token.text, ['--', '++', '!', '~']) || isUnary) {
// unary operators (and binary +/- pretending to be unary) special cases
if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR) {
this.allow_wrap_or_preserved_newline(current_token);
}
space_before = false;
space_after = false;
// http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1
// if there is a newline between -- or ++ and anything else we should preserve it.
if (current_token.newlines && (current_token.text === '--' || current_token.text === '++' || current_token.text === '~')) {
var new_line_needed = reserved_array(this._flags.last_token, special_words) && current_token.newlines;
if (new_line_needed && (this._previous_flags.if_block || this._previous_flags.else_block)) {
this.restore_mode();
}
this.print_newline(new_line_needed, true);
}
if (this._flags.last_token.text === ';' && is_expression(this._flags.mode)) {
// for (;; ++i)
// ^^^
space_before = true;
}
if (this._flags.last_token.type === TOKEN.RESERVED) {
space_before = true;
} else if (this._flags.last_token.type === TOKEN.END_EXPR) {
space_before = !(this._flags.last_token.text === ']' && (current_token.text === '--' || current_token.text === '++'));
} else if (this._flags.last_token.type === TOKEN.OPERATOR) {
// a++ + ++b;
// a - -b
space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(this._flags.last_token.text, ['--', '-', '++', '+']);
// + and - are not unary when preceeded by -- or ++ operator
// a-- + b
// a * +b
// a - -b
if (in_array(current_token.text, ['+', '-']) && in_array(this._flags.last_token.text, ['--', '++'])) {
space_after = true;
}
}
if (((this._flags.mode === MODE.BlockStatement && !this._flags.inline_frame) || this._flags.mode === MODE.Statement) &&
(this._flags.last_token.text === '{' || this._flags.last_token.text === ';')) {
// { foo; --i }
// foo(); --bar;
this.print_newline();
}
}
this._output.space_before_token = this._output.space_before_token || space_before;
this.print_token(current_token);
this._output.space_before_token = space_after;
};
Beautifier.prototype.handle_block_comment = function(current_token, preserve_statement_flags) {
if (this._output.raw) {
this._output.add_raw_token(current_token);
if (current_token.directives && current_token.directives.preserve === 'end') {
// If we're testing the raw output behavior, do not allow a directive to turn it off.
this._output.raw = this._options.test_output_raw;
}
return;
}
if (current_token.directives) {
this.print_newline(false, preserve_statement_flags);
this.print_token(current_token);
if (current_token.directives.preserve === 'start') {
this._output.raw = true;
}
this.print_newline(false, true);
return;
}
// inline block
if (!acorn.newline.test(current_token.text) && !current_token.newlines) {
this._output.space_before_token = true;
this.print_token(current_token);
this._output.space_before_token = true;
return;
} else {
this.print_block_commment(current_token, preserve_statement_flags);
}
};
Beautifier.prototype.print_block_commment = function(current_token, preserve_statement_flags) {
var lines = split_linebreaks(current_token.text);
var j; // iterator for this case
var javadoc = false;
var starless = false;
var lastIndent = current_token.whitespace_before;
var lastIndentLength = lastIndent.length;
// block comment starts with a new line
this.print_newline(false, preserve_statement_flags);
// first line always indented
this.print_token_line_indentation(current_token);
this._output.add_token(lines[0]);
this.print_newline(false, preserve_statement_flags);
if (lines.length > 1) {
lines = lines.slice(1);
javadoc = all_lines_start_with(lines, '*');
starless = each_line_matches_indent(lines, lastIndent);
if (javadoc) {
this._flags.alignment = 1;
}
for (j = 0; j < lines.length; j++) {
if (javadoc) {
// javadoc: reformat and re-indent
this.print_token_line_indentation(current_token);
this._output.add_token(ltrim(lines[j]));
} else if (starless && lines[j]) {
// starless: re-indent non-empty content, avoiding trim
this.print_token_line_indentation(current_token);
this._output.add_token(lines[j].substring(lastIndentLength));
} else {
// normal comments output raw
this._output.current_line.set_indent(-1);
this._output.add_token(lines[j]);
}
// for comments on their own line or more than one line, make sure there's a new line after
this.print_newline(false, preserve_statement_flags);
}
this._flags.alignment = 0;
}
};
Beautifier.prototype.handle_comment = function(current_token, preserve_statement_flags) {
if (current_token.newlines) {
this.print_newline(false, preserve_statement_flags);
} else {
this._output.trim(true);
}
this._output.space_before_token = true;
this.print_token(current_token);
this.print_newline(false, preserve_statement_flags);
};
Beautifier.prototype.handle_dot = function(current_token) {
if (this.start_of_statement(current_token)) {
// The conditional starts the statement if appropriate.
} else {
this.handle_whitespace_and_comments(current_token, true);
}
if (this._flags.last_token.text.match('^[0-9]+$')) {
this._output.space_before_token = true;
}
if (reserved_array(this._flags.last_token, special_words)) {
this._output.space_before_token = false;
} else {
// allow preserved newlines before dots in general
// force newlines on dots after close paren when break_chained - for bar().baz()
this.allow_wrap_or_preserved_newline(current_token,
this._flags.last_token.text === ')' && this._options.break_chained_methods);
}
// Only unindent chained method dot if this dot starts a new line.
// Otherwise the automatic extra indentation removal will handle the over indent
if (this._options.unindent_chained_methods && this._output.just_added_newline()) {
this.deindent();
}
this.print_token(current_token);
};
Beautifier.prototype.handle_unknown = function(current_token, preserve_statement_flags) {
this.print_token(current_token);
if (current_token.text[current_token.text.length - 1] === '\n') {
this.print_newline(false, preserve_statement_flags);
}
};
Beautifier.prototype.handle_eof = function(current_token) {
// Unwind any open statements
while (this._flags.mode === MODE.Statement) {
this.restore_mode();
}
this.handle_whitespace_and_comments(current_token);
};
module.exports.Beautifier = Beautifier;
/***/ }),
/* 2 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function OutputLine(parent) {
this.__parent = parent;
this.__character_count = 0;
// use indent_count as a marker for this.__lines that have preserved indentation
this.__indent_count = -1;
this.__alignment_count = 0;
this.__wrap_point_index = 0;
this.__wrap_point_character_count = 0;
this.__wrap_point_indent_count = -1;
this.__wrap_point_alignment_count = 0;
this.__items = [];
}
OutputLine.prototype.clone_empty = function() {
var line = new OutputLine(this.__parent);
line.set_indent(this.__indent_count, this.__alignment_count);
return line;
};
OutputLine.prototype.item = function(index) {
if (index < 0) {
return this.__items[this.__items.length + index];
} else {
return this.__items[index];
}
};
OutputLine.prototype.has_match = function(pattern) {
for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) {
if (this.__items[lastCheckedOutput].match(pattern)) {
return true;
}
}
return false;
};
OutputLine.prototype.set_indent = function(indent, alignment) {
if (this.is_empty()) {
this.__indent_count = indent || 0;
this.__alignment_count = alignment || 0;
this.__character_count = this.__parent.get_indent_size(this.__indent_count, this.__alignment_count);
}
};
OutputLine.prototype._set_wrap_point = function() {
if (this.__parent.wrap_line_length) {
this.__wrap_point_index = this.__items.length;
this.__wrap_point_character_count = this.__character_count;
this.__wrap_point_indent_count = this.__parent.next_line.__indent_count;
this.__wrap_point_alignment_count = this.__parent.next_line.__alignment_count;
}
};
OutputLine.prototype._should_wrap = function() {
return this.__wrap_point_index &&
this.__character_count > this.__parent.wrap_line_length &&
this.__wrap_point_character_count > this.__parent.next_line.__character_count;
};
OutputLine.prototype._allow_wrap = function() {
if (this._should_wrap()) {
this.__parent.add_new_line();
var next = this.__parent.current_line;
next.set_indent(this.__wrap_point_indent_count, this.__wrap_point_alignment_count);
next.__items = this.__items.slice(this.__wrap_point_index);
this.__items = this.__items.slice(0, this.__wrap_point_index);
next.__character_count += this.__character_count - this.__wrap_point_character_count;
this.__character_count = this.__wrap_point_character_count;
if (next.__items[0] === " ") {
next.__items.splice(0, 1);
next.__character_count -= 1;
}
return true;
}
return false;
};
OutputLine.prototype.is_empty = function() {
return this.__items.length === 0;
};
OutputLine.prototype.last = function() {
if (!this.is_empty()) {
return this.__items[this.__items.length - 1];
} else {
return null;
}
};
OutputLine.prototype.push = function(item) {
this.__items.push(item);
var last_newline_index = item.lastIndexOf('\n');
if (last_newline_index !== -1) {
this.__character_count = item.length - last_newline_index;
} else {
this.__character_count += item.length;
}
};
OutputLine.prototype.pop = function() {
var item = null;
if (!this.is_empty()) {
item = this.__items.pop();
this.__character_count -= item.length;
}
return item;
};
OutputLine.prototype._remove_indent = function() {
if (this.__indent_count > 0) {
this.__indent_count -= 1;
this.__character_count -= this.__parent.indent_size;
}
};
OutputLine.prototype._remove_wrap_indent = function() {
if (this.__wrap_point_indent_count > 0) {
this.__wrap_point_indent_count -= 1;
}
};
OutputLine.prototype.trim = function() {
while (this.last() === ' ') {
this.__items.pop();
this.__character_count -= 1;
}
};
OutputLine.prototype.toString = function() {
var result = '';
if (this.is_empty()) {
if (this.__parent.indent_empty_lines) {
result = this.__parent.get_indent_string(this.__indent_count);
}
} else {
result = this.__parent.get_indent_string(this.__indent_count, this.__alignment_count);
result += this.__items.join('');
}
return result;
};
function IndentStringCache(options, baseIndentString) {
this.__cache = [''];
this.__indent_size = options.indent_size;
this.__indent_string = options.indent_char;
if (!options.indent_with_tabs) {
this.__indent_string = new Array(options.indent_size + 1).join(options.indent_char);
}
// Set to null to continue support for auto detection of base indent
baseIndentString = baseIndentString || '';
if (options.indent_level > 0) {
baseIndentString = new Array(options.indent_level + 1).join(this.__indent_string);
}
this.__base_string = baseIndentString;
this.__base_string_length = baseIndentString.length;
}
IndentStringCache.prototype.get_indent_size = function(indent, column) {
var result = this.__base_string_length;
column = column || 0;
if (indent < 0) {
result = 0;
}
result += indent * this.__indent_size;
result += column;
return result;
};
IndentStringCache.prototype.get_indent_string = function(indent_level, column) {
var result = this.__base_string;
column = column || 0;
if (indent_level < 0) {
indent_level = 0;
result = '';
}
column += indent_level * this.__indent_size;
this.__ensure_cache(column);
result += this.__cache[column];
return result;
};
IndentStringCache.prototype.__ensure_cache = function(column) {
while (column >= this.__cache.length) {
this.__add_column();
}
};
IndentStringCache.prototype.__add_column = function() {
var column = this.__cache.length;
var indent = 0;
var result = '';
if (this.__indent_size && column >= this.__indent_size) {
indent = Math.floor(column / this.__indent_size);
column -= indent * this.__indent_size;
result = new Array(indent + 1).join(this.__indent_string);
}
if (column) {
result += new Array(column + 1).join(' ');
}
this.__cache.push(result);
};
function Output(options, baseIndentString) {
this.__indent_cache = new IndentStringCache(options, baseIndentString);
this.raw = false;
this._end_with_newline = options.end_with_newline;
this.indent_size = options.indent_size;
this.wrap_line_length = options.wrap_line_length;
this.indent_empty_lines = options.indent_empty_lines;
this.__lines = [];
this.previous_line = null;
this.current_line = null;
this.next_line = new OutputLine(this);
this.space_before_token = false;
this.non_breaking_space = false;
this.previous_token_wrapped = false;
// initialize
this.__add_outputline();
}
Output.prototype.__add_outputline = function() {
this.previous_line = this.current_line;
this.current_line = this.next_line.clone_empty();
this.__lines.push(this.current_line);
};
Output.prototype.get_line_number = function() {
return this.__lines.length;
};
Output.prototype.get_indent_string = function(indent, column) {
return this.__indent_cache.get_indent_string(indent, column);
};
Output.prototype.get_indent_size = function(indent, column) {
return this.__indent_cache.get_indent_size(indent, column);
};
Output.prototype.is_empty = function() {
return !this.previous_line && this.current_line.is_empty();
};
Output.prototype.add_new_line = function(force_newline) {
// never newline at the start of file
// otherwise, newline only if we didn't just add one or we're forced
if (this.is_empty() ||
(!force_newline && this.just_added_newline())) {
return false;
}
// if raw output is enabled, don't print additional newlines,
// but still return True as though you had
if (!this.raw) {
this.__add_outputline();
}
return true;
};
Output.prototype.get_code = function(eol) {
this.trim(true);
// handle some edge cases where the last tokens
// has text that ends with newline(s)
var last_item = this.current_line.pop();
if (last_item) {
if (last_item[last_item.length - 1] === '\n') {
last_item = last_item.replace(/\n+$/g, '');
}
this.current_line.push(last_item);
}
if (this._end_with_newline) {
this.__add_outputline();
}
var sweet_code = this.__lines.join('\n');
if (eol !== '\n') {
sweet_code = sweet_code.replace(/[\n]/g, eol);
}
return sweet_code;
};
Output.prototype.set_wrap_point = function() {
this.current_line._set_wrap_point();
};
Output.prototype.set_indent = function(indent, alignment) {
indent = indent || 0;
alignment = alignment || 0;
// Next line stores alignment values
this.next_line.set_indent(indent, alignment);
// Never indent your first output indent at the start of the file
if (this.__lines.length > 1) {
this.current_line.set_indent(indent, alignment);
return true;
}
this.current_line.set_indent();
return false;
};
Output.prototype.add_raw_token = function(token) {
for (var x = 0; x < token.newlines; x++) {
this.__add_outputline();
}
this.current_line.set_indent(-1);
this.current_line.push(token.whitespace_before);
this.current_line.push(token.text);
this.space_before_token = false;
this.non_breaking_space = false;
this.previous_token_wrapped = false;
};
Output.prototype.add_token = function(printable_token) {
this.__add_space_before_token();
this.current_line.push(printable_token);
this.space_before_token = false;
this.non_breaking_space = false;
this.previous_token_wrapped = this.current_line._allow_wrap();
};
Output.prototype.__add_space_before_token = function() {
if (this.space_before_token && !this.just_added_newline()) {
if (!this.non_breaking_space) {
this.set_wrap_point();
}
this.current_line.push(' ');
}
};
Output.prototype.remove_indent = function(index) {
var output_length = this.__lines.length;
while (index < output_length) {
this.__lines[index]._remove_indent();
index++;
}
this.current_line._remove_wrap_indent();
};
Output.prototype.trim = function(eat_newlines) {
eat_newlines = (eat_newlines === undefined) ? false : eat_newlines;
this.current_line.trim();
while (eat_newlines && this.__lines.length > 1 &&
this.current_line.is_empty()) {
this.__lines.pop();
this.current_line = this.__lines[this.__lines.length - 1];
this.current_line.trim();
}
this.previous_line = this.__lines.length > 1 ?
this.__lines[this.__lines.length - 2] : null;
};
Output.prototype.just_added_newline = function() {
return this.current_line.is_empty();
};
Output.prototype.just_added_blankline = function() {
return this.is_empty() ||
(this.current_line.is_empty() && this.previous_line.is_empty());
};
Output.prototype.ensure_empty_line_above = function(starts_with, ends_with) {
var index = this.__lines.length - 2;
while (index >= 0) {
var potentialEmptyLine = this.__lines[index];
if (potentialEmptyLine.is_empty()) {
break;
} else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 &&
potentialEmptyLine.item(-1) !== ends_with) {
this.__lines.splice(index + 1, 0, new OutputLine(this));
this.previous_line = this.__lines[this.__lines.length - 2];
break;
}
index--;
}
};
module.exports.Output = Output;
/***/ }),
/* 3 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function Token(type, text, newlines, whitespace_before) {
this.type = type;
this.text = text;
// comments_before are
// comments that have a new line before them
// and may or may not have a newline after
// this is a set of comments before
this.comments_before = null; /* inline comment*/
// this.comments_after = new TokenStream(); // no new line before and newline after
this.newlines = newlines || 0;
this.whitespace_before = whitespace_before || '';
this.parent = null;
this.next = null;
this.previous = null;
this.opened = null;
this.closed = null;
this.directives = null;
}
module.exports.Token = Token;
/***/ }),
/* 4 */
/***/ (function(__unused_webpack_module, exports) {
/* jshint node: true, curly: false */
// Parts of this section of code is taken from acorn.
//
// Acorn was written by Marijn Haverbeke and released under an MIT
// license. The Unicode regexps (for identifiers and whitespace) were
// taken from [Esprima](http://esprima.org) by Ariya Hidayat.
//
// Git repositories for Acorn are available at
//
// http://marijnhaverbeke.nl/git/acorn
// https://github.com/marijnh/acorn.git
// ## Character categories
// acorn used char codes to squeeze the last bit of performance out
// Beautifier is okay without that, so we're using regex
// permit # (23), $ (36), and @ (64). @ is used in ES7 decorators.
// 65 through 91 are uppercase letters.
// permit _ (95).
// 97 through 123 are lowercase letters.
var baseASCIIidentifierStartChars = "\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a";
// inside an identifier @ is not allowed but 0-9 are.
var baseASCIIidentifierChars = "\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a";
// Big ugly regular expressions that match characters in the
// whitespace, identifier, and identifier-start categories. These
// are only applied when a character is found to actually have a
// code point above 128.
var nonASCIIidentifierStartChars = "\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\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\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\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\\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-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\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\\u0d60\\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-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\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\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\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\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\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";
var nonASCIIidentifierChars = "\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f";
//var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
//var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
var unicodeEscapeOrCodePoint = "\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]+\\}";
var identifierStart = "(?:" + unicodeEscapeOrCodePoint + "|[" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + "])";
var identifierChars = "(?:" + unicodeEscapeOrCodePoint + "|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])*";
exports.identifier = new RegExp(identifierStart + identifierChars, 'g');
exports.identifierStart = new RegExp(identifierStart);
exports.identifierMatch = new RegExp("(?:" + unicodeEscapeOrCodePoint + "|[" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "])+");
var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; // jshint ignore:line
// Whether a single character denotes a newline.
exports.newline = /[\n\r\u2028\u2029]/;
// Matches a whole line break (where CRLF is considered a single
// line break). Used to count lines.
// in javascript, these two differ
// in python they are the same, different methods are called on them
exports.lineBreak = new RegExp('\r\n|' + exports.newline.source);
exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g');
/***/ }),
/* 5 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_87818__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var BaseOptions = (__nested_webpack_require_87818__(6).Options);
var validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];
function Options(options) {
BaseOptions.call(this, options, 'js');
// compatibility, re
var raw_brace_style = this.raw_options.brace_style || null;
if (raw_brace_style === "expand-strict") { //graceful handling of deprecated option
this.raw_options.brace_style = "expand";
} else if (raw_brace_style === "collapse-preserve-inline") { //graceful handling of deprecated option
this.raw_options.brace_style = "collapse,preserve-inline";
} else if (this.raw_options.braces_on_own_line !== undefined) { //graceful handling of deprecated option
this.raw_options.brace_style = this.raw_options.braces_on_own_line ? "expand" : "collapse";
// } else if (!raw_brace_style) { //Nothing exists to set it
// raw_brace_style = "collapse";
}
//preserve-inline in delimited string will trigger brace_preserve_inline, everything
//else is considered a brace_style and the last one only will have an effect
var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']);
this.brace_preserve_inline = false; //Defaults in case one or other was not specified in meta-option
this.brace_style = "collapse";
for (var bs = 0; bs < brace_style_split.length; bs++) {
if (brace_style_split[bs] === "preserve-inline") {
this.brace_preserve_inline = true;
} else {
this.brace_style = brace_style_split[bs];
}
}
this.unindent_chained_methods = this._get_boolean('unindent_chained_methods');
this.break_chained_methods = this._get_boolean('break_chained_methods');
this.space_in_paren = this._get_boolean('space_in_paren');
this.space_in_empty_paren = this._get_boolean('space_in_empty_paren');
this.jslint_happy = this._get_boolean('jslint_happy');
this.space_after_anon_function = this._get_boolean('space_after_anon_function');
this.space_after_named_function = this._get_boolean('space_after_named_function');
this.keep_array_indentation = this._get_boolean('keep_array_indentation');
this.space_before_conditional = this._get_boolean('space_before_conditional', true);
this.unescape_strings = this._get_boolean('unescape_strings');
this.e4x = this._get_boolean('e4x');
this.comma_first = this._get_boolean('comma_first');
this.operator_position = this._get_selection('operator_position', validPositionValues);
// For testing of beautify preserve:start directive
this.test_output_raw = this._get_boolean('test_output_raw');
// force this._options.space_after_anon_function to true if this._options.jslint_happy
if (this.jslint_happy) {
this.space_after_anon_function = true;
}
}
Options.prototype = new BaseOptions();
module.exports.Options = Options;
/***/ }),
/* 6 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function Options(options, merge_child_field) {
this.raw_options = _mergeOpts(options, merge_child_field);
// Support passing the source text back with no change
this.disabled = this._get_boolean('disabled');
this.eol = this._get_characters('eol', 'auto');
this.end_with_newline = this._get_boolean('end_with_newline');
this.indent_size = this._get_number('indent_size', 4);
this.indent_char = this._get_characters('indent_char', ' ');
this.indent_level = this._get_number('indent_level');
this.preserve_newlines = this._get_boolean('preserve_newlines', true);
this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786);
if (!this.preserve_newlines) {
this.max_preserve_newlines = 0;
}
this.indent_with_tabs = this._get_boolean('indent_with_tabs', this.indent_char === '\t');
if (this.indent_with_tabs) {
this.indent_char = '\t';
// indent_size behavior changed after 1.8.6
// It used to be that indent_size would be
// set to 1 for indent_with_tabs. That is no longer needed and
// actually doesn't make sense - why not use spaces? Further,
// that might produce unexpected behavior - tabs being used
// for single-column alignment. So, when indent_with_tabs is true
// and indent_size is 1, reset indent_size to 4.
if (this.indent_size === 1) {
this.indent_size = 4;
}
}
// Backwards compat with 1.3.x
this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char'));
this.indent_empty_lines = this._get_boolean('indent_empty_lines');
// valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty', 'angular']
// For now, 'auto' = all off for javascript, all except angular on for html (and inline javascript/css).
// other values ignored
this.templating = this._get_selection_list('templating', ['auto', 'none', 'angular', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);
}
Options.prototype._get_array = function(name, default_value) {
var option_value = this.raw_options[name];
var result = default_value || [];
if (typeof option_value === 'object') {
if (option_value !== null && typeof option_value.concat === 'function') {
result = option_value.concat();
}
} else if (typeof option_value === 'string') {
result = option_value.split(/[^a-zA-Z0-9_\/\-]+/);
}
return result;
};
Options.prototype._get_boolean = function(name, default_value) {
var option_value = this.raw_options[name];
var result = option_value === undefined ? !!default_value : !!option_value;
return result;
};
Options.prototype._get_characters = function(name, default_value) {
var option_value = this.raw_options[name];
var result = default_value || '';
if (typeof option_value === 'string') {
result = option_value.replace(/\\r/, '\r').replace(/\\n/, '\n').replace(/\\t/, '\t');
}
return result;
};
Options.prototype._get_number = function(name, default_value) {
var option_value = this.raw_options[name];
default_value = parseInt(default_value, 10);
if (isNaN(default_value)) {
default_value = 0;
}
var result = parseInt(option_value, 10);
if (isNaN(result)) {
result = default_value;
}
return result;
};
Options.prototype._get_selection = function(name, selection_list, default_value) {
var result = this._get_selection_list(name, selection_list, default_value);
if (result.length !== 1) {
throw new Error(
"Invalid Option Value: The option '" + name + "' can only be one of the following values:\n" +
selection_list + "\nYou passed in: '" + this.raw_options[name] + "'");
}
return result[0];
};
Options.prototype._get_selection_list = function(name, selection_list, default_value) {
if (!selection_list || selection_list.length === 0) {
throw new Error("Selection list cannot be empty.");
}
default_value = default_value || [selection_list[0]];
if (!this._is_valid_selection(default_value, selection_list)) {
throw new Error("Invalid Default Value!");
}
var result = this._get_array(name, default_value);
if (!this._is_valid_selection(result, selection_list)) {
throw new Error(
"Invalid Option Value: The option '" + name + "' can contain only the following values:\n" +
selection_list + "\nYou passed in: '" + this.raw_options[name] + "'");
}
return result;
};
Options.prototype._is_valid_selection = function(result, selection_list) {
return result.length && selection_list.length &&
!result.some(function(item) { return selection_list.indexOf(item) === -1; });
};
// merges child options up with the parent options object
// Example: obj = {a: 1, b: {a: 2}}
// mergeOpts(obj, 'b')
//
// Returns: {a: 2}
function _mergeOpts(allOptions, childFieldName) {
var finalOpts = {};
allOptions = _normalizeOpts(allOptions);
var name;
for (name in allOptions) {
if (name !== childFieldName) {
finalOpts[name] = allOptions[name];
}
}
//merge in the per type settings for the childFieldName
if (childFieldName && allOptions[childFieldName]) {
for (name in allOptions[childFieldName]) {
finalOpts[name] = allOptions[childFieldName][name];
}
}
return finalOpts;
}
function _normalizeOpts(options) {
var convertedOpts = {};
var key;
for (key in options) {
var newKey = key.replace(/-/g, "_");
convertedOpts[newKey] = options[key];
}
return convertedOpts;
}
module.exports.Options = Options;
module.exports.normalizeOpts = _normalizeOpts;
module.exports.mergeOpts = _mergeOpts;
/***/ }),
/* 7 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_98755__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var InputScanner = (__nested_webpack_require_98755__(8).InputScanner);
var BaseTokenizer = (__nested_webpack_require_98755__(9).Tokenizer);
var BASETOKEN = (__nested_webpack_require_98755__(9).TOKEN);
var Directives = (__nested_webpack_require_98755__(13).Directives);
var acorn = __nested_webpack_require_98755__(4);
var Pattern = (__nested_webpack_require_98755__(12).Pattern);
var TemplatablePattern = (__nested_webpack_require_98755__(14).TemplatablePattern);
function in_array(what, arr) {
return arr.indexOf(what) !== -1;
}
var TOKEN = {
START_EXPR: 'TK_START_EXPR',
END_EXPR: 'TK_END_EXPR',
START_BLOCK: 'TK_START_BLOCK',
END_BLOCK: 'TK_END_BLOCK',
WORD: 'TK_WORD',
RESERVED: 'TK_RESERVED',
SEMICOLON: 'TK_SEMICOLON',
STRING: 'TK_STRING',
EQUALS: 'TK_EQUALS',
OPERATOR: 'TK_OPERATOR',
COMMA: 'TK_COMMA',
BLOCK_COMMENT: 'TK_BLOCK_COMMENT',
COMMENT: 'TK_COMMENT',
DOT: 'TK_DOT',
UNKNOWN: 'TK_UNKNOWN',
START: BASETOKEN.START,
RAW: BASETOKEN.RAW,
EOF: BASETOKEN.EOF
};
var directives_core = new Directives(/\/\*/, /\*\//);
var number_pattern = /0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/;
var digit = /[0-9]/;
// Dot "." must be distinguished from "..." and decimal
var dot_pattern = /[^\d\.]/;
var positionable_operators = (
">>> === !== &&= ??= ||= " +
"<< && >= ** != == <= >> || ?? |> " +
"< / - + > : & % ? ^ | *").split(' ');
// IMPORTANT: this must be sorted longest to shortest or tokenizing many not work.
// Also, you must update possitionable operators separately from punct
var punct =
">>>= " +
"... >>= <<= === >>> !== **= &&= ??= ||= " +
"=> ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> " +
"= ! ? > < : / ^ - + * & % ~ |";
punct = punct.replace(/[-[\]{}()*+?.,\\^$|#]/g, "\\$&");
// ?. but not if followed by a number
punct = '\\?\\.(?!\\d) ' + punct;
punct = punct.replace(/ /g, '|');
var punct_pattern = new RegExp(punct);
// words which should always start on new line.
var line_starters = 'continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export'.split(',');
var reserved_words = line_starters.concat(['do', 'in', 'of', 'else', 'get', 'set', 'new', 'catch', 'finally', 'typeof', 'yield', 'async', 'await', 'from', 'as', 'class', 'extends']);
var reserved_word_pattern = new RegExp('^(?:' + reserved_words.join('|') + ')$');
// var template_pattern = /(?:(?:<\?php|<\?=)[\s\S]*?\?>)|(?:<%[\s\S]*?%>)/g;
var in_html_comment;
var Tokenizer = function(input_string, options) {
BaseTokenizer.call(this, input_string, options);
this._patterns.whitespace = this._patterns.whitespace.matching(
/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,
/\u2028\u2029/.source);
var pattern_reader = new Pattern(this._input);
var templatable = new TemplatablePattern(this._input)
.read_options(this._options);
this.__patterns = {
template: templatable,
identifier: templatable.starting_with(acorn.identifier).matching(acorn.identifierMatch),
number: pattern_reader.matching(number_pattern),
punct: pattern_reader.matching(punct_pattern),
// comment ends just before nearest linefeed or end of file
comment: pattern_reader.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),
// /* ... */ comment ends with nearest */ or end of file
block_comment: pattern_reader.starting_with(/\/\*/).until_after(/\*\//),
html_comment_start: pattern_reader.matching(/<!--/),
html_comment_end: pattern_reader.matching(/-->/),
include: pattern_reader.starting_with(/#include/).until_after(acorn.lineBreak),
shebang: pattern_reader.starting_with(/#!/).until_after(acorn.lineBreak),
xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),
single_quote: templatable.until(/['\\\n\r\u2028\u2029]/),
double_quote: templatable.until(/["\\\n\r\u2028\u2029]/),
template_text: templatable.until(/[`\\$]/),
template_expression: templatable.until(/[`}\\]/)
};
};
Tokenizer.prototype = new BaseTokenizer();
Tokenizer.prototype._is_comment = function(current_token) {
return current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.BLOCK_COMMENT || current_token.type === TOKEN.UNKNOWN;
};
Tokenizer.prototype._is_opening = function(current_token) {
return current_token.type === TOKEN.START_BLOCK || current_token.type === TOKEN.START_EXPR;
};
Tokenizer.prototype._is_closing = function(current_token, open_token) {
return (current_token.type === TOKEN.END_BLOCK || current_token.type === TOKEN.END_EXPR) &&
(open_token && (
(current_token.text === ']' && open_token.text === '[') ||
(current_token.text === ')' && open_token.text === '(') ||
(current_token.text === '}' && open_token.text === '{')));
};
Tokenizer.prototype._reset = function() {
in_html_comment = false;
};
Tokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false
var token = null;
this._readWhitespace();
var c = this._input.peek();
if (c === null) {
return this._create_token(TOKEN.EOF, '');
}
token = token || this._read_non_javascript(c);
token = token || this._read_string(c);
token = token || this._read_pair(c, this._input.peek(1)); // Issue #2062 hack for record type '#{'
token = token || this._read_word(previous_token);
token = token || this._read_singles(c);
token = token || this._read_comment(c);
token = token || this._read_regexp(c, previous_token);
token = token || this._read_xml(c, previous_token);
token = token || this._read_punctuation();
token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());
return token;
};
Tokenizer.prototype._read_word = function(previous_token) {
var resulting_string;
resulting_string = this.__patterns.identifier.read();
if (resulting_string !== '') {
resulting_string = resulting_string.replace(acorn.allLineBreaks, '\n');
if (!(previous_token.type === TOKEN.DOT ||
(previous_token.type === TOKEN.RESERVED && (previous_token.text === 'set' || previous_token.text === 'get'))) &&
reserved_word_pattern.test(resulting_string)) {
if ((resulting_string === 'in' || resulting_string === 'of') &&
(previous_token.type === TOKEN.WORD || previous_token.type === TOKEN.STRING)) { // hack for 'in' and 'of' operators
return this._create_token(TOKEN.OPERATOR, resulting_string);
}
return this._create_token(TOKEN.RESERVED, resulting_string);
}
return this._create_token(TOKEN.WORD, resulting_string);
}
resulting_string = this.__patterns.number.read();
if (resulting_string !== '') {
return this._create_token(TOKEN.WORD, resulting_string);
}
};
Tokenizer.prototype._read_singles = function(c) {
var token = null;
if (c === '(' || c === '[') {
token = this._create_token(TOKEN.START_EXPR, c);
} else if (c === ')' || c === ']') {
token = this._create_token(TOKEN.END_EXPR, c);
} else if (c === '{') {
token = this._create_token(TOKEN.START_BLOCK, c);
} else if (c === '}') {
token = this._create_token(TOKEN.END_BLOCK, c);
} else if (c === ';') {
token = this._create_token(TOKEN.SEMICOLON, c);
} else if (c === '.' && dot_pattern.test(this._input.peek(1))) {
token = this._create_token(TOKEN.DOT, c);
} else if (c === ',') {
token = this._create_token(TOKEN.COMMA, c);
}
if (token) {
this._input.next();
}
return token;
};
Tokenizer.prototype._read_pair = function(c, d) {
var token = null;
if (c === '#' && d === '{') {
token = this._create_token(TOKEN.START_BLOCK, c + d);
}
if (token) {
this._input.next();
this._input.next();
}
return token;
};
Tokenizer.prototype._read_punctuation = function() {
var resulting_string = this.__patterns.punct.read();
if (resulting_string !== '') {
if (resulting_string === '=') {
return this._create_token(TOKEN.EQUALS, resulting_string);
} else if (resulting_string === '?.') {
return this._create_token(TOKEN.DOT, resulting_string);
} else {
return this._create_token(TOKEN.OPERATOR, resulting_string);
}
}
};
Tokenizer.prototype._read_non_javascript = function(c) {
var resulting_string = '';
if (c === '#') {
if (this._is_first_token()) {
resulting_string = this.__patterns.shebang.read();
if (resulting_string) {
return this._create_token(TOKEN.UNKNOWN, resulting_string.trim() + '\n');
}
}
// handles extendscript #includes
resulting_string = this.__patterns.include.read();
if (resulting_string) {
return this._create_token(TOKEN.UNKNOWN, resulting_string.trim() + '\n');
}
c = this._input.next();
// Spidermonkey-specific sharp variables for circular references. Considered obsolete.
var sharp = '#';
if (this._input.hasNext() && this._input.testChar(digit)) {
do {
c = this._input.next();
sharp += c;
} while (this._input.hasNext() && c !== '#' && c !== '=');
if (c === '#') {
//
} else if (this._input.peek() === '[' && this._input.peek(1) === ']') {
sharp += '[]';
this._input.next();
this._input.next();
} else if (this._input.peek() === '{' && this._input.peek(1) === '}') {
sharp += '{}';
this._input.next();
this._input.next();
}
return this._create_token(TOKEN.WORD, sharp);
}
this._input.back();
} else if (c === '<' && this._is_first_token()) {
resulting_string = this.__patterns.html_comment_start.read();
if (resulting_string) {
while (this._input.hasNext() && !this._input.testChar(acorn.newline)) {
resulting_string += this._input.next();
}
in_html_comment = true;
return this._create_token(TOKEN.COMMENT, resulting_string);
}
} else if (in_html_comment && c === '-') {
resulting_string = this.__patterns.html_comment_end.read();
if (resulting_string) {
in_html_comment = false;
return this._create_token(TOKEN.COMMENT, resulting_string);
}
}
return null;
};
Tokenizer.prototype._read_comment = function(c) {
var token = null;
if (c === '/') {
var comment = '';
if (this._input.peek(1) === '*') {
// peek for comment /* ... */
comment = this.__patterns.block_comment.read();
var directives = directives_core.get_directives(comment);
if (directives && directives.ignore === 'start') {
comment += directives_core.readIgnored(this._input);
}
comment = comment.replace(acorn.allLineBreaks, '\n');
token = this._create_token(TOKEN.BLOCK_COMMENT, comment);
token.directives = directives;
} else if (this._input.peek(1) === '/') {
// peek for comment // ...
comment = this.__patterns.comment.read();
token = this._create_token(TOKEN.COMMENT, comment);
}
}
return token;
};
Tokenizer.prototype._read_string = function(c) {
if (c === '`' || c === "'" || c === '"') {
var resulting_string = this._input.next();
this.has_char_escapes = false;
if (c === '`') {
resulting_string += this._read_string_recursive('`', true, '${');
} else {
resulting_string += this._read_string_recursive(c);
}
if (this.has_char_escapes && this._options.unescape_strings) {
resulting_string = unescape_string(resulting_string);
}
if (this._input.peek() === c) {
resulting_string += this._input.next();
}
resulting_string = resulting_string.replace(acorn.allLineBreaks, '\n');
return this._create_token(TOKEN.STRING, resulting_string);
}
return null;
};
Tokenizer.prototype._allow_regexp_or_xml = function(previous_token) {
// regex and xml can only appear in specific locations during parsing
return (previous_token.type === TOKEN.RESERVED && in_array(previous_token.text, ['return', 'case', 'throw', 'else', 'do', 'typeof', 'yield'])) ||
(previous_token.type === TOKEN.END_EXPR && previous_token.text === ')' &&
previous_token.opened.previous.type === TOKEN.RESERVED && in_array(previous_token.opened.previous.text, ['if', 'while', 'for'])) ||
(in_array(previous_token.type, [TOKEN.COMMENT, TOKEN.START_EXPR, TOKEN.START_BLOCK, TOKEN.START,
TOKEN.END_BLOCK, TOKEN.OPERATOR, TOKEN.EQUALS, TOKEN.EOF, TOKEN.SEMICOLON, TOKEN.COMMA
]));
};
Tokenizer.prototype._read_regexp = function(c, previous_token) {
if (c === '/' && this._allow_regexp_or_xml(previous_token)) {
// handle regexp
//
var resulting_string = this._input.next();
var esc = false;
var in_char_class = false;
while (this._input.hasNext() &&
((esc || in_char_class || this._input.peek() !== c) &&
!this._input.testChar(acorn.newline))) {
resulting_string += this._input.peek();
if (!esc) {
esc = this._input.peek() === '\\';
if (this._input.peek() === '[') {
in_char_class = true;
} else if (this._input.peek() === ']') {
in_char_class = false;
}
} else {
esc = false;
}
this._input.next();
}
if (this._input.peek() === c) {
resulting_string += this._input.next();
// regexps may have modifiers /regexp/MOD , so fetch those, too
// Only [gim] are valid, but if the user puts in garbage, do what we can to take it.
resulting_string += this._input.read(acorn.identifier);
}
return this._create_token(TOKEN.STRING, resulting_string);
}
return null;
};
Tokenizer.prototype._read_xml = function(c, previous_token) {
if (this._options.e4x && c === "<" && this._allow_regexp_or_xml(previous_token)) {
var xmlStr = '';
var match = this.__patterns.xml.read_match();
// handle e4x xml literals
//
if (match) {
// Trim root tag to attempt to
var rootTag = match[2].replace(/^{\s+/, '{').replace(/\s+}$/, '}');
var isCurlyRoot = rootTag.indexOf('{') === 0;
var depth = 0;
while (match) {
var isEndTag = !!match[1];
var tagName = match[2];
var isSingletonTag = (!!match[match.length - 1]) || (tagName.slice(0, 8) === "![CDATA[");
if (!isSingletonTag &&
(tagName === rootTag || (isCurlyRoot && tagName.replace(/^{\s+/, '{').replace(/\s+}$/, '}')))) {
if (isEndTag) {
--depth;
} else {
++depth;
}
}
xmlStr += match[0];
if (depth <= 0) {
break;
}
match = this.__patterns.xml.read_match();
}
// if we didn't close correctly, keep unformatted.
if (!match) {
xmlStr += this._input.match(/[\s\S]*/g)[0];
}
xmlStr = xmlStr.replace(acorn.allLineBreaks, '\n');
return this._create_token(TOKEN.STRING, xmlStr);
}
}
return null;
};
function unescape_string(s) {
// You think that a regex would work for this
// return s.replace(/\\x([0-9a-f]{2})/gi, function(match, val) {
// return String.fromCharCode(parseInt(val, 16));
// })
// However, dealing with '\xff', '\\xff', '\\\xff' makes this more fun.
var out = '',
escaped = 0;
var input_scan = new InputScanner(s);
var matched = null;
while (input_scan.hasNext()) {
// Keep any whitespace, non-slash characters
// also keep slash pairs.
matched = input_scan.match(/([\s]|[^\\]|\\\\)+/g);
if (matched) {
out += matched[0];
}
if (input_scan.peek() === '\\') {
input_scan.next();
if (input_scan.peek() === 'x') {
matched = input_scan.match(/x([0-9A-Fa-f]{2})/g);
} else if (input_scan.peek() === 'u') {
matched = input_scan.match(/u([0-9A-Fa-f]{4})/g);
if (!matched) {
matched = input_scan.match(/u\{([0-9A-Fa-f]+)\}/g);
}
} else {
out += '\\';
if (input_scan.hasNext()) {
out += input_scan.next();
}
continue;
}
// If there's some error decoding, return the original string
if (!matched) {
return s;
}
escaped = parseInt(matched[1], 16);
if (escaped > 0x7e && escaped <= 0xff && matched[0].indexOf('x') === 0) {
// we bail out on \x7f..\xff,
// leaving whole string escaped,
// as it's probably completely binary
return s;
} else if (escaped >= 0x00 && escaped < 0x20) {
// leave 0x00...0x1f escaped
out += '\\' + matched[0];
} else if (escaped > 0x10FFFF) {
// If the escape sequence is out of bounds, keep the original sequence and continue conversion
out += '\\' + matched[0];
} else if (escaped === 0x22 || escaped === 0x27 || escaped === 0x5c) {
// single-quote, apostrophe, backslash - escape these
out += '\\' + String.fromCharCode(escaped);
} else {
out += String.fromCharCode(escaped);
}
}
}
return out;
}
// handle string
//
Tokenizer.prototype._read_string_recursive = function(delimiter, allow_unescaped_newlines, start_sub) {
var current_char;
var pattern;
if (delimiter === '\'') {
pattern = this.__patterns.single_quote;
} else if (delimiter === '"') {
pattern = this.__patterns.double_quote;
} else if (delimiter === '`') {
pattern = this.__patterns.template_text;
} else if (delimiter === '}') {
pattern = this.__patterns.template_expression;
}
var resulting_string = pattern.read();
var next = '';
while (this._input.hasNext()) {
next = this._input.next();
if (next === delimiter ||
(!allow_unescaped_newlines && acorn.newline.test(next))) {
this._input.back();
break;
} else if (next === '\\' && this._input.hasNext()) {
current_char = this._input.peek();
if (current_char === 'x' || current_char === 'u') {
this.has_char_escapes = true;
} else if (current_char === '\r' && this._input.peek(1) === '\n') {
this._input.next();
}
next += this._input.next();
} else if (start_sub) {
if (start_sub === '${' && next === '$' && this._input.peek() === '{') {
next += this._input.next();
}
if (start_sub === next) {
if (delimiter === '`') {
next += this._read_string_recursive('}', allow_unescaped_newlines, '`');
} else {
next += this._read_string_recursive('`', allow_unescaped_newlines, '${');
}
if (this._input.hasNext()) {
next += this._input.next();
}
}
}
next += pattern.read();
resulting_string += next;
}
return resulting_string;
};
module.exports.Tokenizer = Tokenizer;
module.exports.TOKEN = TOKEN;
module.exports.positionable_operators = positionable_operators.slice();
module.exports.line_starters = line_starters.slice();
/***/ }),
/* 8 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var regexp_has_sticky = RegExp.prototype.hasOwnProperty('sticky');
function InputScanner(input_string) {
this.__input = input_string || '';
this.__input_length = this.__input.length;
this.__position = 0;
}
InputScanner.prototype.restart = function() {
this.__position = 0;
};
InputScanner.prototype.back = function() {
if (this.__position > 0) {
this.__position -= 1;
}
};
InputScanner.prototype.hasNext = function() {
return this.__position < this.__input_length;
};
InputScanner.prototype.next = function() {
var val = null;
if (this.hasNext()) {
val = this.__input.charAt(this.__position);
this.__position += 1;
}
return val;
};
InputScanner.prototype.peek = function(index) {
var val = null;
index = index || 0;
index += this.__position;
if (index >= 0 && index < this.__input_length) {
val = this.__input.charAt(index);
}
return val;
};
// This is a JavaScript only helper function (not in python)
// Javascript doesn't have a match method
// and not all implementation support "sticky" flag.
// If they do not support sticky then both this.match() and this.test() method
// must get the match and check the index of the match.
// If sticky is supported and set, this method will use it.
// Otherwise it will check that global is set, and fall back to the slower method.
InputScanner.prototype.__match = function(pattern, index) {
pattern.lastIndex = index;
var pattern_match = pattern.exec(this.__input);
if (pattern_match && !(regexp_has_sticky && pattern.sticky)) {
if (pattern_match.index !== index) {
pattern_match = null;
}
}
return pattern_match;
};
InputScanner.prototype.test = function(pattern, index) {
index = index || 0;
index += this.__position;
if (index >= 0 && index < this.__input_length) {
return !!this.__match(pattern, index);
} else {
return false;
}
};
InputScanner.prototype.testChar = function(pattern, index) {
// test one character regex match
var val = this.peek(index);
pattern.lastIndex = 0;
return val !== null && pattern.test(val);
};
InputScanner.prototype.match = function(pattern) {
var pattern_match = this.__match(pattern, this.__position);
if (pattern_match) {
this.__position += pattern_match[0].length;
} else {
pattern_match = null;
}
return pattern_match;
};
InputScanner.prototype.read = function(starting_pattern, until_pattern, until_after) {
var val = '';
var match;
if (starting_pattern) {
match = this.match(starting_pattern);
if (match) {
val += match[0];
}
}
if (until_pattern && (match || !starting_pattern)) {
val += this.readUntil(until_pattern, until_after);
}
return val;
};
InputScanner.prototype.readUntil = function(pattern, until_after) {
var val = '';
var match_index = this.__position;
pattern.lastIndex = this.__position;
var pattern_match = pattern.exec(this.__input);
if (pattern_match) {
match_index = pattern_match.index;
if (until_after) {
match_index += pattern_match[0].length;
}
} else {
match_index = this.__input_length;
}
val = this.__input.substring(this.__position, match_index);
this.__position = match_index;
return val;
};
InputScanner.prototype.readUntilAfter = function(pattern) {
return this.readUntil(pattern, true);
};
InputScanner.prototype.get_regexp = function(pattern, match_from) {
var result = null;
var flags = 'g';
if (match_from && regexp_has_sticky) {
flags = 'y';
}
// strings are converted to regexp
if (typeof pattern === "string" && pattern !== '') {
// result = new RegExp(pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), flags);
result = new RegExp(pattern, flags);
} else if (pattern) {
result = new RegExp(pattern.source, flags);
}
return result;
};
InputScanner.prototype.get_literal_regexp = function(literal_string) {
return RegExp(literal_string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'));
};
/* css beautifier legacy helpers */
InputScanner.prototype.peekUntilAfter = function(pattern) {
var start = this.__position;
var val = this.readUntilAfter(pattern);
this.__position = start;
return val;
};
InputScanner.prototype.lookBack = function(testVal) {
var start = this.__position - 1;
return start >= testVal.length && this.__input.substring(start - testVal.length, start)
.toLowerCase() === testVal;
};
module.exports.InputScanner = InputScanner;
/***/ }),
/* 9 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_124617__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var InputScanner = (__nested_webpack_require_124617__(8).InputScanner);
var Token = (__nested_webpack_require_124617__(3).Token);
var TokenStream = (__nested_webpack_require_124617__(10).TokenStream);
var WhitespacePattern = (__nested_webpack_require_124617__(11).WhitespacePattern);
var TOKEN = {
START: 'TK_START',
RAW: 'TK_RAW',
EOF: 'TK_EOF'
};
var Tokenizer = function(input_string, options) {
this._input = new InputScanner(input_string);
this._options = options || {};
this.__tokens = null;
this._patterns = {};
this._patterns.whitespace = new WhitespacePattern(this._input);
};
Tokenizer.prototype.tokenize = function() {
this._input.restart();
this.__tokens = new TokenStream();
this._reset();
var current;
var previous = new Token(TOKEN.START, '');
var open_token = null;
var open_stack = [];
var comments = new TokenStream();
while (previous.type !== TOKEN.EOF) {
current = this._get_next_token(previous, open_token);
while (this._is_comment(current)) {
comments.add(current);
current = this._get_next_token(previous, open_token);
}
if (!comments.isEmpty()) {
current.comments_before = comments;
comments = new TokenStream();
}
current.parent = open_token;
if (this._is_opening(current)) {
open_stack.push(open_token);
open_token = current;
} else if (open_token && this._is_closing(current, open_token)) {
current.opened = open_token;
open_token.closed = current;
open_token = open_stack.pop();
current.parent = open_token;
}
current.previous = previous;
previous.next = current;
this.__tokens.add(current);
previous = current;
}
return this.__tokens;
};
Tokenizer.prototype._is_first_token = function() {
return this.__tokens.isEmpty();
};
Tokenizer.prototype._reset = function() {};
Tokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false
this._readWhitespace();
var resulting_string = this._input.read(/.+/g);
if (resulting_string) {
return this._create_token(TOKEN.RAW, resulting_string);
} else {
return this._create_token(TOKEN.EOF, '');
}
};
Tokenizer.prototype._is_comment = function(current_token) { // jshint unused:false
return false;
};
Tokenizer.prototype._is_opening = function(current_token) { // jshint unused:false
return false;
};
Tokenizer.prototype._is_closing = function(current_token, open_token) { // jshint unused:false
return false;
};
Tokenizer.prototype._create_token = function(type, text) {
var token = new Token(type, text,
this._patterns.whitespace.newline_count,
this._patterns.whitespace.whitespace_before_token);
return token;
};
Tokenizer.prototype._readWhitespace = function() {
return this._patterns.whitespace.read();
};
module.exports.Tokenizer = Tokenizer;
module.exports.TOKEN = TOKEN;
/***/ }),
/* 10 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function TokenStream(parent_token) {
// private
this.__tokens = [];
this.__tokens_length = this.__tokens.length;
this.__position = 0;
this.__parent_token = parent_token;
}
TokenStream.prototype.restart = function() {
this.__position = 0;
};
TokenStream.prototype.isEmpty = function() {
return this.__tokens_length === 0;
};
TokenStream.prototype.hasNext = function() {
return this.__position < this.__tokens_length;
};
TokenStream.prototype.next = function() {
var val = null;
if (this.hasNext()) {
val = this.__tokens[this.__position];
this.__position += 1;
}
return val;
};
TokenStream.prototype.peek = function(index) {
var val = null;
index = index || 0;
index += this.__position;
if (index >= 0 && index < this.__tokens_length) {
val = this.__tokens[index];
}
return val;
};
TokenStream.prototype.add = function(token) {
if (this.__parent_token) {
token.parent = this.__parent_token;
}
this.__tokens.push(token);
this.__tokens_length += 1;
};
module.exports.TokenStream = TokenStream;
/***/ }),
/* 11 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_131037__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var Pattern = (__nested_webpack_require_131037__(12).Pattern);
function WhitespacePattern(input_scanner, parent) {
Pattern.call(this, input_scanner, parent);
if (parent) {
this._line_regexp = this._input.get_regexp(parent._line_regexp);
} else {
this.__set_whitespace_patterns('', '');
}
this.newline_count = 0;
this.whitespace_before_token = '';
}
WhitespacePattern.prototype = new Pattern();
WhitespacePattern.prototype.__set_whitespace_patterns = function(whitespace_chars, newline_chars) {
whitespace_chars += '\\t ';
newline_chars += '\\n\\r';
this._match_pattern = this._input.get_regexp(
'[' + whitespace_chars + newline_chars + ']+', true);
this._newline_regexp = this._input.get_regexp(
'\\r\\n|[' + newline_chars + ']');
};
WhitespacePattern.prototype.read = function() {
this.newline_count = 0;
this.whitespace_before_token = '';
var resulting_string = this._input.read(this._match_pattern);
if (resulting_string === ' ') {
this.whitespace_before_token = ' ';
} else if (resulting_string) {
var matches = this.__split(this._newline_regexp, resulting_string);
this.newline_count = matches.length - 1;
this.whitespace_before_token = matches[this.newline_count];
}
return resulting_string;
};
WhitespacePattern.prototype.matching = function(whitespace_chars, newline_chars) {
var result = this._create();
result.__set_whitespace_patterns(whitespace_chars, newline_chars);
result._update();
return result;
};
WhitespacePattern.prototype._create = function() {
return new WhitespacePattern(this._input, this);
};
WhitespacePattern.prototype.__split = function(regexp, input_string) {
regexp.lastIndex = 0;
var start_index = 0;
var result = [];
var next_match = regexp.exec(input_string);
while (next_match) {
result.push(input_string.substring(start_index, next_match.index));
start_index = next_match.index + next_match[0].length;
next_match = regexp.exec(input_string);
}
if (start_index < input_string.length) {
result.push(input_string.substring(start_index, input_string.length));
} else {
result.push('');
}
return result;
};
module.exports.WhitespacePattern = WhitespacePattern;
/***/ }),
/* 12 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function Pattern(input_scanner, parent) {
this._input = input_scanner;
this._starting_pattern = null;
this._match_pattern = null;
this._until_pattern = null;
this._until_after = false;
if (parent) {
this._starting_pattern = this._input.get_regexp(parent._starting_pattern, true);
this._match_pattern = this._input.get_regexp(parent._match_pattern, true);
this._until_pattern = this._input.get_regexp(parent._until_pattern);
this._until_after = parent._until_after;
}
}
Pattern.prototype.read = function() {
var result = this._input.read(this._starting_pattern);
if (!this._starting_pattern || result) {
result += this._input.read(this._match_pattern, this._until_pattern, this._until_after);
}
return result;
};
Pattern.prototype.read_match = function() {
return this._input.match(this._match_pattern);
};
Pattern.prototype.until_after = function(pattern) {
var result = this._create();
result._until_after = true;
result._until_pattern = this._input.get_regexp(pattern);
result._update();
return result;
};
Pattern.prototype.until = function(pattern) {
var result = this._create();
result._until_after = false;
result._until_pattern = this._input.get_regexp(pattern);
result._update();
return result;
};
Pattern.prototype.starting_with = function(pattern) {
var result = this._create();
result._starting_pattern = this._input.get_regexp(pattern, true);
result._update();
return result;
};
Pattern.prototype.matching = function(pattern) {
var result = this._create();
result._match_pattern = this._input.get_regexp(pattern, true);
result._update();
return result;
};
Pattern.prototype._create = function() {
return new Pattern(this._input, this);
};
Pattern.prototype._update = function() {};
module.exports.Pattern = Pattern;
/***/ }),
/* 13 */
/***/ (function(module) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
function Directives(start_block_pattern, end_block_pattern) {
start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source;
end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source;
this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \w+[:]\w+)+ /.source + end_block_pattern, 'g');
this.__directive_pattern = / (\w+)[:](\w+)/g;
this.__directives_end_ignore_pattern = new RegExp(start_block_pattern + /\sbeautify\signore:end\s/.source + end_block_pattern, 'g');
}
Directives.prototype.get_directives = function(text) {
if (!text.match(this.__directives_block_pattern)) {
return null;
}
var directives = {};
this.__directive_pattern.lastIndex = 0;
var directive_match = this.__directive_pattern.exec(text);
while (directive_match) {
directives[directive_match[1]] = directive_match[2];
directive_match = this.__directive_pattern.exec(text);
}
return directives;
};
Directives.prototype.readIgnored = function(input) {
return input.readUntilAfter(this.__directives_end_ignore_pattern);
};
module.exports.Directives = Directives;
/***/ }),
/* 14 */
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_140024__) {
/*jshint node:true */
/*
The MIT License (MIT)
Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
var Pattern = (__nested_webpack_require_140024__(12).Pattern);
var template_names = {
django: false,
erb: false,
handlebars: false,
php: false,
smarty: false,
angular: false
};
// This lets templates appear anywhere we would do a readUntil
// The cost is higher but it is pay to play.
function TemplatablePattern(input_scanner, parent) {
Pattern.call(this, input_scanner, parent);
this.__template_pattern = null;
this._disabled = Object.assign({}, template_names);
this._excluded = Object.assign({}, template_names);
if (parent) {
this.__template_pattern = this._input.get_regexp(parent.__template_pattern);
this._excluded = Object.assign(this._excluded, parent._excluded);
this._disabled = Object.assign(this._disabled, parent._disabled);
}
var pattern = new Pattern(input_scanner);
this.__patterns = {
handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/),
handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/),
handlebars: pattern.starting_with(/{{/).until_after(/}}/),
php: pattern.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),
erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/),
// django coflicts with handlebars a bit.
django: pattern.starting_with(/{%/).until_after(/%}/),
django_value: pattern.starting_with(/{{/).until_after(/}}/),
django_comment: pattern.starting_with(/{#/).until_after(/#}/),
smarty: pattern.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),
smarty_comment: pattern.starting_with(/{\*/).until_after(/\*}/),
smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\/literal}/)
};
}
TemplatablePattern.prototype = new Pattern();
TemplatablePattern.prototype._create = function() {
return new TemplatablePattern(this._input, this);
};
TemplatablePattern.prototype._update = function() {
this.__set_templated_pattern();
};
TemplatablePattern.prototype.disable = function(language) {
var result = this._create();
result._disabled[language] = true;
result._update();
return result;
};
TemplatablePattern.prototype.read_options = function(options) {
var result = this._create();
for (var language in template_names) {
result._disabled[language] = options.templating.indexOf(language) === -1;
}
result._update();
return result;
};
TemplatablePattern.prototype.exclude = function(language) {
var result = this._create();
result._excluded[language] = true;
result._update();
return result;
};
TemplatablePattern.prototype.read = function() {
var result = '';
if (this._match_pattern) {
result = this._input.read(this._starting_pattern);
} else {
result = this._input.read(this._starting_pattern, this.__template_pattern);
}
var next = this._read_template();
while (next) {
if (this._match_pattern) {
next += this._input.read(this._match_pattern);
} else {
next += this._input.readUntil(this.__template_pattern);
}
result += next;
next = this._read_template();
}
if (this._until_after) {
result += this._input.readUntilAfter(this._until_pattern);
}
return result;
};
TemplatablePattern.prototype.__set_templated_pattern = function() {
var items = [];
if (!this._disabled.php) {
items.push(this.__patterns.php._starting_pattern.source);
}
if (!this._disabled.handlebars) {
items.push(this.__patterns.handlebars._starting_pattern.source);
}
if (!this._disabled.erb) {
items.push(this.__patterns.erb._starting_pattern.source);
}
if (!this._disabled.django) {
items.push(this.__patterns.django._starting_pattern.source);
// The starting pattern for django is more complex because it has different
// patterns for value, comment, and other sections
items.push(this.__patterns.django_value._starting_pattern.source);
items.push(this.__patterns.django_comment._starting_pattern.source);
}
if (!this._disabled.smarty) {
items.push(this.__patterns.smarty._starting_pattern.source);
}
if (this._until_pattern) {
items.push(this._until_pattern.source);
}
this.__template_pattern = this._input.get_regexp('(?:' + items.join('|') + ')');
};
TemplatablePattern.prototype._read_template = function() {
var resulting_string = '';
var c = this._input.peek();
if (c === '<') {
var peek1 = this._input.peek(1);
//if we're in a comment, do something special
// We treat all comments as literals, even more than preformatted tags
// we just look for the appropriate close tag
if (!this._disabled.php && !this._excluded.php && peek1 === '?') {
resulting_string = resulting_string ||
this.__patterns.php.read();
}
if (!this._disabled.erb && !this._excluded.erb && peek1 === '%') {
resulting_string = resulting_string ||
this.__patterns.erb.read();
}
} else if (c === '{') {
if (!this._disabled.handlebars && !this._excluded.handlebars) {
resulting_string = resulting_string ||
this.__patterns.handlebars_comment.read();
resulting_string = resulting_string ||
this.__patterns.handlebars_unescaped.read();
resulting_string = resulting_string ||
this.__patterns.handlebars.read();
}
if (!this._disabled.django) {
// django coflicts with handlebars a bit.
if (!this._excluded.django && !this._excluded.handlebars) {
resulting_string = resulting_string ||
this.__patterns.django_value.read();
}
if (!this._excluded.django) {
resulting_string = resulting_string ||
this.__patterns.django_comment.read();
resulting_string = resulting_string ||
this.__patterns.django.read();
}
}
if (!this._disabled.smarty) {
// smarty cannot be enabled with django or handlebars enabled
if (this._disabled.django && this._disabled.handlebars) {
resulting_string = resulting_string ||
this.__patterns.smarty_comment.read();
resulting_string = resulting_string ||
this.__patterns.smarty_literal.read();
resulting_string = resulting_string ||
this.__patterns.smarty.read();
}
}
}
return resulting_string;
};
module.exports.TemplatablePattern = TemplatablePattern;
/***/ })
/******/ ]);
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __nested_webpack_require_147717__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_147717__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module is referenced by other modules so it can't be inlined
/******/ var __nested_webpack_exports__ = __nested_webpack_require_147717__(0);
/******/ legacy_beautify_js = __nested_webpack_exports__;
/******/
/******/ })()
;
var js_beautify = legacy_beautify_js;
/* Footer */
if (true) {
// Add support for AMD ( https://github.com/amdjs/amdjs-api/wiki/AMD#defineamd-property- )
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
return { js_beautify: js_beautify };
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else {}
}());
/***/ }),
/***/ 75918:
/*!****************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/actions.js ***!
\****************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Wi: function() { return /* binding */ ActionRunner; },
/* harmony export */ Z0: function() { return /* binding */ Separator; },
/* harmony export */ aU: function() { return /* binding */ Action; },
/* harmony export */ eZ: function() { return /* binding */ EmptySubmenuAction; },
/* harmony export */ wY: function() { return /* binding */ SubmenuAction; }
/* harmony export */ });
/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ 4348);
/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lifecycle.js */ 69323);
/* harmony import */ var _nls_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../nls.js */ 13268);
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
class Action extends _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__/* .Disposable */ .JT {
constructor(id, label = '', cssClass = '', enabled = true, actionCallback) {
super();
this._onDidChange = this._register(new _event_js__WEBPACK_IMPORTED_MODULE_0__/* .Emitter */ .Q5());
this.onDidChange = this._onDidChange.event;
this._enabled = true;
this._id = id;
this._label = label;
this._cssClass = cssClass;
this._enabled = enabled;
this._actionCallback = actionCallback;
}
get id() {
return this._id;
}
get label() {
return this._label;
}
set label(value) {
this._setLabel(value);
}
_setLabel(value) {
if (this._label !== value) {
this._label = value;
this._onDidChange.fire({ label: value });
}
}
get tooltip() {
return this._tooltip || '';
}
set tooltip(value) {
this._setTooltip(value);
}
_setTooltip(value) {
if (this._tooltip !== value) {
this._tooltip = value;
this._onDidChange.fire({ tooltip: value });
}
}
get class() {
return this._cssClass;
}
set class(value) {
this._setClass(value);
}
_setClass(value) {
if (this._cssClass !== value) {
this._cssClass = value;
this._onDidChange.fire({ class: value });
}
}
get enabled() {
return this._enabled;
}
set enabled(value) {
this._setEnabled(value);
}
_setEnabled(value) {
if (this._enabled !== value) {
this._enabled = value;
this._onDidChange.fire({ enabled: value });
}
}
get checked() {
return this._checked;
}
set checked(value) {
this._setChecked(value);
}
_setChecked(value) {
if (this._checked !== value) {
this._checked = value;
this._onDidChange.fire({ checked: value });
}
}
run(event, data) {
return __awaiter(this, void 0, void 0, function* () {
if (this._actionCallback) {
yield this._actionCallback(event);
}
});
}
}
class ActionRunner extends _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__/* .Disposable */ .JT {
constructor() {
super(...arguments);
this._onBeforeRun = this._register(new _event_js__WEBPACK_IMPORTED_MODULE_0__/* .Emitter */ .Q5());
this.onBeforeRun = this._onBeforeRun.event;
this._onDidRun = this._register(new _event_js__WEBPACK_IMPORTED_MODULE_0__/* .Emitter */ .Q5());
this.onDidRun = this._onDidRun.event;
}
run(action, context) {
return __awaiter(this, void 0, void 0, function* () {
if (!action.enabled) {
return;
}
this._onBeforeRun.fire({ action });
let error = undefined;
try {
yield this.runAction(action, context);
}
catch (e) {
error = e;
}
this._onDidRun.fire({ action, error });
});
}
runAction(action, context) {
return __awaiter(this, void 0, void 0, function* () {
yield action.run(context);
});
}
}
class Separator extends Action {
constructor(label) {
super(Separator.ID, label, label ? 'separator text' : 'separator');
this.checked = false;
this.enabled = false;
}
}
Separator.ID = 'vs.actions.separator';
class SubmenuAction {
constructor(id, label, actions, cssClass) {
this.tooltip = '';
this.enabled = true;
this.checked = false;
this.id = id;
this.label = label;
this.class = cssClass;
this._actions = actions;
}
get actions() { return this._actions; }
dispose() {
// there is NOTHING to dispose and the SubmenuAction should
// never have anything to dispose as it is a convenience type
// to bridge into the rendering world.
}
run() {
return __awaiter(this, void 0, void 0, function* () { });
}
}
class EmptySubmenuAction extends Action {
constructor() {
super(EmptySubmenuAction.ID, _nls_js__WEBPACK_IMPORTED_MODULE_2__/* .localize */ .N('submenu.empty', '(empty)'), undefined, false);
}
}
EmptySubmenuAction.ID = 'vs.actions.empty';
/***/ }),
/***/ 76068:
/*!***************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/assert.js ***!
\***************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ ok: function() { return /* binding */ ok; }
/* harmony export */ });
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/**
* Throws an error with the provided message if the provided value does not evaluate to a true Javascript value.
*/
function ok(value, message) {
if (!value) {
throw new Error(message ? `Assertion failed (${message})` : 'Assertion Failed');
}
}
/***/ }),
/***/ 52615:
/*!*****************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/codicons.js ***!
\*****************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ CM: function() { return /* binding */ registerCodicon; },
/* harmony export */ JL: function() { return /* binding */ getCodiconAriaLabel; },
/* harmony export */ dT: function() { return /* binding */ CSSIcon; },
/* harmony export */ fK: function() { return /* binding */ iconRegistry; },
/* harmony export */ lA: function() { return /* binding */ Codicon; }
/* harmony export */ });
/* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ 4348);
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
class Registry {
constructor() {
this._icons = new Map();
this._onDidRegister = new _event_js__WEBPACK_IMPORTED_MODULE_0__/* .Emitter */ .Q5();
}
add(icon) {
const existing = this._icons.get(icon.id);
if (!existing) {
this._icons.set(icon.id, icon);
this._onDidRegister.fire(icon);
}
else if (icon.description) {
existing.description = icon.description;
}
else {
console.error(`Duplicate registration of codicon ${icon.id}`);
}
}
get(id) {
return this._icons.get(id);
}
get all() {
return this._icons.values();
}
get onDidRegister() {
return this._onDidRegister.event;
}
}
const _registry = new Registry();
const iconRegistry = _registry;
function registerCodicon(id, def) {
return new Codicon(id, def);
}
// Selects all codicon names encapsulated in the `$()` syntax and wraps the
// results with spaces so that screen readers can read the text better.
function getCodiconAriaLabel(text) {
if (!text) {
return '';
}
return text.replace(/\$\((.*?)\)/g, (_match, codiconName) => ` ${codiconName} `).trim();
}
class Codicon {
constructor(id, definition, description) {
this.id = id;
this.definition = definition;
this.description = description;
_registry.add(this);
}
get classNames() { return 'codicon codicon-' + this.id; }
// classNamesArray is useful for migrating to ES6 classlist
get classNamesArray() { return ['codicon', 'codicon-' + this.id]; }
get cssSelector() { return '.codicon.codicon-' + this.id; }
}
var CSSIcon;
(function (CSSIcon) {
CSSIcon.iconNameSegment = '[A-Za-z0-9]+';
CSSIcon.iconNameExpression = '[A-Za-z0-9\\-]+';
CSSIcon.iconModifierExpression = '~[A-Za-z]+';
const cssIconIdRegex = new RegExp(`^(${CSSIcon.iconNameExpression})(${CSSIcon.iconModifierExpression})?$`);
function asClassNameArray(icon) {
if (icon instanceof Codicon) {
return ['codicon', 'codicon-' + icon.id];
}
const match = cssIconIdRegex.exec(icon.id);
if (!match) {
return asClassNameArray(Codicon.error);
}
let [, id, modifier] = match;
const classNames = ['codicon', 'codicon-' + id];
if (modifier) {
classNames.push('codicon-modifier-' + modifier.substr(1));
}
return classNames;
}
CSSIcon.asClassNameArray = asClassNameArray;
function asClassName(icon) {
return asClassNameArray(icon).join(' ');
}
CSSIcon.asClassName = asClassName;
function asCSSSelector(icon) {
return '.' + asClassNameArray(icon).join('.');
}
CSSIcon.asCSSSelector = asCSSSelector;
})(CSSIcon || (CSSIcon = {}));
(function (Codicon) {
// built-in icons, with image name
Codicon.add = new Codicon('add', { fontCharacter: '\\ea60' });
Codicon.plus = new Codicon('plus', Codicon.add.definition);
Codicon.gistNew = new Codicon('gist-new', Codicon.add.definition);
Codicon.repoCreate = new Codicon('repo-create', Codicon.add.definition);
Codicon.lightbulb = new Codicon('lightbulb', { fontCharacter: '\\ea61' });
Codicon.lightBulb = new Codicon('light-bulb', { fontCharacter: '\\ea61' });
Codicon.repo = new Codicon('repo', { fontCharacter: '\\ea62' });
Codicon.repoDelete = new Codicon('repo-delete', { fontCharacter: '\\ea62' });
Codicon.gistFork = new Codicon('gist-fork', { fontCharacter: '\\ea63' });
Codicon.repoForked = new Codicon('repo-forked', { fontCharacter: '\\ea63' });
Codicon.gitPullRequest = new Codicon('git-pull-request', { fontCharacter: '\\ea64' });
Codicon.gitPullRequestAbandoned = new Codicon('git-pull-request-abandoned', { fontCharacter: '\\ea64' });
Codicon.recordKeys = new Codicon('record-keys', { fontCharacter: '\\ea65' });
Codicon.keyboard = new Codicon('keyboard', { fontCharacter: '\\ea65' });
Codicon.tag = new Codicon('tag', { fontCharacter: '\\ea66' });
Codicon.tagAdd = new Codicon('tag-add', { fontCharacter: '\\ea66' });
Codicon.tagRemove = new Codicon('tag-remove', { fontCharacter: '\\ea66' });
Codicon.person = new Codicon('person', { fontCharacter: '\\ea67' });
Codicon.personFollow = new Codicon('person-follow', { fontCharacter: '\\ea67' });
Codicon.personOutline = new Codicon('person-outline', { fontCharacter: '\\ea67' });
Codicon.personFilled = new Codicon('person-filled', { fontCharacter: '\\ea67' });
Codicon.gitBranch = new Codicon('git-branch', { fontCharacter: '\\ea68' });
Codicon.gitBranchCreate = new Codicon('git-branch-create', { fontCharacter: '\\ea68' });
Codicon.gitBranchDelete = new Codicon('git-branch-delete', { fontCharacter: '\\ea68' });
Codicon.sourceControl = new Codicon('source-control', { fontCharacter: '\\ea68' });
Codicon.mirror = new Codicon('mirror', { fontCharacter: '\\ea69' });
Codicon.mirrorPublic = new Codicon('mirror-public', { fontCharacter: '\\ea69' });
Codicon.star = new Codicon('star', { fontCharacter: '\\ea6a' });
Codicon.starAdd = new Codicon('star-add', { fontCharacter: '\\ea6a' });
Codicon.starDelete = new Codicon('star-delete', { fontCharacter: '\\ea6a' });
Codicon.starEmpty = new Codicon('star-empty', { fontCharacter: '\\ea6a' });
Codicon.comment = new Codicon('comment', { fontCharacter: '\\ea6b' });
Codicon.commentAdd = new Codicon('comment-add', { fontCharacter: '\\ea6b' });
Codicon.alert = new Codicon('alert', { fontCharacter: '\\ea6c' });
Codicon.warning = new Codicon('warning', { fontCharacter: '\\ea6c' });
Codicon.search = new Codicon('search', { fontCharacter: '\\ea6d' });
Codicon.searchSave = new Codicon('search-save', { fontCharacter: '\\ea6d' });
Codicon.logOut = new Codicon('log-out', { fontCharacter: '\\ea6e' });
Codicon.signOut = new Codicon('sign-out', { fontCharacter: '\\ea6e' });
Codicon.logIn = new Codicon('log-in', { fontCharacter: '\\ea6f' });
Codicon.signIn = new Codicon('sign-in', { fontCharacter: '\\ea6f' });
Codicon.eye = new Codicon('eye', { fontCharacter: '\\ea70' });
Codicon.eyeUnwatch = new Codicon('eye-unwatch', { fontCharacter: '\\ea70' });
Codicon.eyeWatch = new Codicon('eye-watch', { fontCharacter: '\\ea70' });
Codicon.circleFilled = new Codicon('circle-filled', { fontCharacter: '\\ea71' });
Codicon.primitiveDot = new Codicon('primitive-dot', { fontCharacter: '\\ea71' });
Codicon.closeDirty = new Codicon('close-dirty', { fontCharacter: '\\ea71' });
Codicon.debugBreakpoint = new Codicon('debug-breakpoint', { fontCharacter: '\\ea71' });
Codicon.debugBreakpointDisabled = new Codicon('debug-breakpoint-disabled', { fontCharacter: '\\ea71' });
Codicon.debugHint = new Codicon('debug-hint', { fontCharacter: '\\ea71' });
Codicon.primitiveSquare = new Codicon('primitive-square', { fontCharacter: '\\ea72' });
Codicon.edit = new Codicon('edit', { fontCharacter: '\\ea73' });
Codicon.pencil = new Codicon('pencil', { fontCharacter: '\\ea73' });
Codicon.info = new Codicon('info', { fontCharacter: '\\ea74' });
Codicon.issueOpened = new Codicon('issue-opened', { fontCharacter: '\\ea74' });
Codicon.gistPrivate = new Codicon('gist-private', { fontCharacter: '\\ea75' });
Codicon.gitForkPrivate = new Codicon('git-fork-private', { fontCharacter: '\\ea75' });
Codicon.lock = new Codicon('lock', { fontCharacter: '\\ea75' });
Codicon.mirrorPrivate = new Codicon('mirror-private', { fontCharacter: '\\ea75' });
Codicon.close = new Codicon('close', { fontCharacter: '\\ea76' });
Codicon.removeClose = new Codicon('remove-close', { fontCharacter: '\\ea76' });
Codicon.x = new Codicon('x', { fontCharacter: '\\ea76' });
Codicon.repoSync = new Codicon('repo-sync', { fontCharacter: '\\ea77' });
Codicon.sync = new Codicon('sync', { fontCharacter: '\\ea77' });
Codicon.clone = new Codicon('clone', { fontCharacter: '\\ea78' });
Codicon.desktopDownload = new Codicon('desktop-download', { fontCharacter: '\\ea78' });
Codicon.beaker = new Codicon('beaker', { fontCharacter: '\\ea79' });
Codicon.microscope = new Codicon('microscope', { fontCharacter: '\\ea79' });
Codicon.vm = new Codicon('vm', { fontCharacter: '\\ea7a' });
Codicon.deviceDesktop = new Codicon('device-desktop', { fontCharacter: '\\ea7a' });
Codicon.file = new Codicon('file', { fontCharacter: '\\ea7b' });
Codicon.fileText = new Codicon('file-text', { fontCharacter: '\\ea7b' });
Codicon.more = new Codicon('more', { fontCharacter: '\\ea7c' });
Codicon.ellipsis = new Codicon('ellipsis', { fontCharacter: '\\ea7c' });
Codicon.kebabHorizontal = new Codicon('kebab-horizontal', { fontCharacter: '\\ea7c' });
Codicon.mailReply = new Codicon('mail-reply', { fontCharacter: '\\ea7d' });
Codicon.reply = new Codicon('reply', { fontCharacter: '\\ea7d' });
Codicon.organization = new Codicon('organization', { fontCharacter: '\\ea7e' });
Codicon.organizationFilled = new Codicon('organization-filled', { fontCharacter: '\\ea7e' });
Codicon.organizationOutline = new Codicon('organization-outline', { fontCharacter: '\\ea7e' });
Codicon.newFile = new Codicon('new-file', { fontCharacter: '\\ea7f' });
Codicon.fileAdd = new Codicon('file-add', { fontCharacter: '\\ea7f' });
Codicon.newFolder = new Codicon('new-folder', { fontCharacter: '\\ea80' });
Codicon.fileDirectoryCreate = new Codicon('file-directory-create', { fontCharacter: '\\ea80' });
Codicon.trash = new Codicon('trash', { fontCharacter: '\\ea81' });
Codicon.trashcan = new Codicon('trashcan', { fontCharacter: '\\ea81' });
Codicon.history = new Codicon('history', { fontCharacter: '\\ea82' });
Codicon.clock = new Codicon('clock', { fontCharacter: '\\ea82' });
Codicon.folder = new Codicon('folder', { fontCharacter: '\\ea83' });
Codicon.fileDirectory = new Codicon('file-directory', { fontCharacter: '\\ea83' });
Codicon.symbolFolder = new Codicon('symbol-folder', { fontCharacter: '\\ea83' });
Codicon.logoGithub = new Codicon('logo-github', { fontCharacter: '\\ea84' });
Codicon.markGithub = new Codicon('mark-github', { fontCharacter: '\\ea84' });
Codicon.github = new Codicon('github', { fontCharacter: '\\ea84' });
Codicon.terminal = new Codicon('terminal', { fontCharacter: '\\ea85' });
Codicon.console = new Codicon('console', { fontCharacter: '\\ea85' });
Codicon.repl = new Codicon('repl', { fontCharacter: '\\ea85' });
Codicon.zap = new Codicon('zap', { fontCharacter: '\\ea86' });
Codicon.symbolEvent = new Codicon('symbol-event', { fontCharacter: '\\ea86' });
Codicon.error = new Codicon('error', { fontCharacter: '\\ea87' });
Codicon.stop = new Codicon('stop', { fontCharacter: '\\ea87' });
Codicon.variable = new Codicon('variable', { fontCharacter: '\\ea88' });
Codicon.symbolVariable = new Codicon('symbol-variable', { fontCharacter: '\\ea88' });
Codicon.array = new Codicon('array', { fontCharacter: '\\ea8a' });
Codicon.symbolArray = new Codicon('symbol-array', { fontCharacter: '\\ea8a' });
Codicon.symbolModule = new Codicon('symbol-module', { fontCharacter: '\\ea8b' });
Codicon.symbolPackage = new Codicon('symbol-package', { fontCharacter: '\\ea8b' });
Codicon.symbolNamespace = new Codicon('symbol-namespace', { fontCharacter: '\\ea8b' });
Codicon.symbolObject = new Codicon('symbol-object', { fontCharacter: '\\ea8b' });
Codicon.symbolMethod = new Codicon('symbol-method', { fontCharacter: '\\ea8c' });
Codicon.symbolFunction = new Codicon('symbol-function', { fontCharacter: '\\ea8c' });
Codicon.symbolConstructor = new Codicon('symbol-constructor', { fontCharacter: '\\ea8c' });
Codicon.symbolBoolean = new Codicon('symbol-boolean', { fontCharacter: '\\ea8f' });
Codicon.symbolNull = new Codicon('symbol-null', { fontCharacter: '\\ea8f' });
Codicon.symbolNumeric = new Codicon('symbol-numeric', { fontCharacter: '\\ea90' });
Codicon.symbolNumber = new Codicon('symbol-number', { fontCharacter: '\\ea90' });
Codicon.symbolStructure = new Codicon('symbol-structure', { fontCharacter: '\\ea91' });
Codicon.symbolStruct = new Codicon('symbol-struct', { fontCharacter: '\\ea91' });
Codicon.symbolParameter = new Codicon('symbol-parameter', { fontCharacter: '\\ea92' });
Codicon.symbolTypeParameter = new Codicon('symbol-type-parameter', { fontCharacter: '\\ea92' });
Codicon.symbolKey = new Codicon('symbol-key', { fontCharacter: '\\ea93' });
Codicon.symbolText = new Codicon('symbol-text', { fontCharacter: '\\ea93' });
Codicon.symbolReference = new Codicon('symbol-reference', { fontCharacter: '\\ea94' });
Codicon.goToFile = new Codicon('go-to-file', { fontCharacter: '\\ea94' });
Codicon.symbolEnum = new Codicon('symbol-enum', { fontCharacter: '\\ea95' });
Codicon.symbolValue = new Codicon('symbol-value', { fontCharacter: '\\ea95' });
Codicon.symbolRuler = new Codicon('symbol-ruler', { fontCharacter: '\\ea96' });
Codicon.symbolUnit = new Codicon('symbol-unit', { fontCharacter: '\\ea96' });
Codicon.activateBreakpoints = new Codicon('activate-breakpoints', { fontCharacter: '\\ea97' });
Codicon.archive = new Codicon('archive', { fontCharacter: '\\ea98' });
Codicon.arrowBoth = new Codicon('arrow-both', { fontCharacter: '\\ea99' });
Codicon.arrowDown = new Codicon('arrow-down', { fontCharacter: '\\ea9a' });
Codicon.arrowLeft = new Codicon('arrow-left', { fontCharacter: '\\ea9b' });
Codicon.arrowRight = new Codicon('arrow-right', { fontCharacter: '\\ea9c' });
Codicon.arrowSmallDown = new Codicon('arrow-small-down', { fontCharacter: '\\ea9d' });
Codicon.arrowSmallLeft = new Codicon('arrow-small-left', { fontCharacter: '\\ea9e' });
Codicon.arrowSmallRight = new Codicon('arrow-small-right', { fontCharacter: '\\ea9f' });
Codicon.arrowSmallUp = new Codicon('arrow-small-up', { fontCharacter: '\\eaa0' });
Codicon.arrowUp = new Codicon('arrow-up', { fontCharacter: '\\eaa1' });
Codicon.bell = new Codicon('bell', { fontCharacter: '\\eaa2' });
Codicon.bold = new Codicon('bold', { fontCharacter: '\\eaa3' });
Codicon.book = new Codicon('book', { fontCharacter: '\\eaa4' });
Codicon.bookmark = new Codicon('bookmark', { fontCharacter: '\\eaa5' });
Codicon.debugBreakpointConditionalUnverified = new Codicon('debug-breakpoint-conditional-unverified', { fontCharacter: '\\eaa6' });
Codicon.debugBreakpointConditional = new Codicon('debug-breakpoint-conditional', { fontCharacter: '\\eaa7' });
Codicon.debugBreakpointConditionalDisabled = new Codicon('debug-breakpoint-conditional-disabled', { fontCharacter: '\\eaa7' });
Codicon.debugBreakpointDataUnverified = new Codicon('debug-breakpoint-data-unverified', { fontCharacter: '\\eaa8' });
Codicon.debugBreakpointData = new Codicon('debug-breakpoint-data', { fontCharacter: '\\eaa9' });
Codicon.debugBreakpointDataDisabled = new Codicon('debug-breakpoint-data-disabled', { fontCharacter: '\\eaa9' });
Codicon.debugBreakpointLogUnverified = new Codicon('debug-breakpoint-log-unverified', { fontCharacter: '\\eaaa' });
Codicon.debugBreakpointLog = new Codicon('debug-breakpoint-log', { fontCharacter: '\\eaab' });
Codicon.debugBreakpointLogDisabled = new Codicon('debug-breakpoint-log-disabled', { fontCharacter: '\\eaab' });
Codicon.briefcase = new Codicon('briefcase', { fontCharacter: '\\eaac' });
Codicon.broadcast = new Codicon('broadcast', { fontCharacter: '\\eaad' });
Codicon.browser = new Codicon('browser', { fontCharacter: '\\eaae' });
Codicon.bug = new Codicon('bug', { fontCharacter: '\\eaaf' });
Codicon.calendar = new Codicon('calendar', { fontCharacter: '\\eab0' });
Codicon.caseSensitive = new Codicon('case-sensitive', { fontCharacter: '\\eab1' });
Codicon.check = new Codicon('check', { fontCharacter: '\\eab2' });
Codicon.checklist = new Codicon('checklist', { fontCharacter: '\\eab3' });
Codicon.chevronDown = new Codicon('chevron-down', { fontCharacter: '\\eab4' });
Codicon.dropDownButton = new Codicon('drop-down-button', Codicon.chevronDown.definition);
Codicon.chevronLeft = new Codicon('chevron-left', { fontCharacter: '\\eab5' });
Codicon.chevronRight = new Codicon('chevron-right', { fontCharacter: '\\eab6' });
Codicon.chevronUp = new Codicon('chevron-up', { fontCharacter: '\\eab7' });
Codicon.chromeClose = new Codicon('chrome-close', { fontCharacter: '\\eab8' });
Codicon.chromeMaximize = new Codicon('chrome-maximize', { fontCharacter: '\\eab9' });
Codicon.chromeMinimize = new Codicon('chrome-minimize', { fontCharacter: '\\eaba' });
Codicon.chromeRestore = new Codicon('chrome-restore', { fontCharacter: '\\eabb' });
Codicon.circleOutline = new Codicon('circle-outline', { fontCharacter: '\\eabc' });
Codicon.debugBreakpointUnverified = new Codicon('debug-breakpoint-unverified', { fontCharacter: '\\eabc' });
Codicon.circleSlash = new Codicon('circle-slash', { fontCharacter: '\\eabd' });
Codicon.circuitBoard = new Codicon('circuit-board', { fontCharacter: '\\eabe' });
Codicon.clearAll = new Codicon('clear-all', { fontCharacter: '\\eabf' });
Codicon.clippy = new Codicon('clippy', { fontCharacter: '\\eac0' });
Codicon.closeAll = new Codicon('close-all', { fontCharacter: '\\eac1' });
Codicon.cloudDownload = new Codicon('cloud-download', { fontCharacter: '\\eac2' });
Codicon.cloudUpload = new Codicon('cloud-upload', { fontCharacter: '\\eac3' });
Codicon.code = new Codicon('code', { fontCharacter: '\\eac4' });
Codicon.collapseAll = new Codicon('collapse-all', { fontCharacter: '\\eac5' });
Codicon.colorMode = new Codicon('color-mode', { fontCharacter: '\\eac6' });
Codicon.commentDiscussion = new Codicon('comment-discussion', { fontCharacter: '\\eac7' });
Codicon.compareChanges = new Codicon('compare-changes', { fontCharacter: '\\eafd' });
Codicon.creditCard = new Codicon('credit-card', { fontCharacter: '\\eac9' });
Codicon.dash = new Codicon('dash', { fontCharacter: '\\eacc' });
Codicon.dashboard = new Codicon('dashboard', { fontCharacter: '\\eacd' });
Codicon.database = new Codicon('database', { fontCharacter: '\\eace' });
Codicon.debugContinue = new Codicon('debug-continue', { fontCharacter: '\\eacf' });
Codicon.debugDisconnect = new Codicon('debug-disconnect', { fontCharacter: '\\ead0' });
Codicon.debugPause = new Codicon('debug-pause', { fontCharacter: '\\ead1' });
Codicon.debugRestart = new Codicon('debug-restart', { fontCharacter: '\\ead2' });
Codicon.debugStart = new Codicon('debug-start', { fontCharacter: '\\ead3' });
Codicon.debugStepInto = new Codicon('debug-step-into', { fontCharacter: '\\ead4' });
Codicon.debugStepOut = new Codicon('debug-step-out', { fontCharacter: '\\ead5' });
Codicon.debugStepOver = new Codicon('debug-step-over', { fontCharacter: '\\ead6' });
Codicon.debugStop = new Codicon('debug-stop', { fontCharacter: '\\ead7' });
Codicon.debug = new Codicon('debug', { fontCharacter: '\\ead8' });
Codicon.deviceCameraVideo = new Codicon('device-camera-video', { fontCharacter: '\\ead9' });
Codicon.deviceCamera = new Codicon('device-camera', { fontCharacter: '\\eada' });
Codicon.deviceMobile = new Codicon('device-mobile', { fontCharacter: '\\eadb' });
Codicon.diffAdded = new Codicon('diff-added', { fontCharacter: '\\eadc' });
Codicon.diffIgnored = new Codicon('diff-ignored', { fontCharacter: '\\eadd' });
Codicon.diffModified = new Codicon('diff-modified', { fontCharacter: '\\eade' });
Codicon.diffRemoved = new Codicon('diff-removed', { fontCharacter: '\\eadf' });
Codicon.diffRenamed = new Codicon('diff-renamed', { fontCharacter: '\\eae0' });
Codicon.diff = new Codicon('diff', { fontCharacter: '\\eae1' });
Codicon.discard = new Codicon('discard', { fontCharacter: '\\eae2' });
Codicon.editorLayout = new Codicon('editor-layout', { fontCharacter: '\\eae3' });
Codicon.emptyWindow = new Codicon('empty-window', { fontCharacter: '\\eae4' });
Codicon.exclude = new Codicon('exclude', { fontCharacter: '\\eae5' });
Codicon.extensions = new Codicon('extensions', { fontCharacter: '\\eae6' });
Codicon.eyeClosed = new Codicon('eye-closed', { fontCharacter: '\\eae7' });
Codicon.fileBinary = new Codicon('file-binary', { fontCharacter: '\\eae8' });
Codicon.fileCode = new Codicon('file-code', { fontCharacter: '\\eae9' });
Codicon.fileMedia = new Codicon('file-media', { fontCharacter: '\\eaea' });
Codicon.filePdf = new Codicon('file-pdf', { fontCharacter: '\\eaeb' });
Codicon.fileSubmodule = new Codicon('file-submodule', { fontCharacter: '\\eaec' });
Codicon.fileSymlinkDirectory = new Codicon('file-symlink-directory', { fontCharacter: '\\eaed' });
Codicon.fileSymlinkFile = new Codicon('file-symlink-file', { fontCharacter: '\\eaee' });
Codicon.fileZip = new Codicon('file-zip', { fontCharacter: '\\eaef' });
Codicon.files = new Codicon('files', { fontCharacter: '\\eaf0' });
Codicon.filter = new Codicon('filter', { fontCharacter: '\\eaf1' });
Codicon.flame = new Codicon('flame', { fontCharacter: '\\eaf2' });
Codicon.foldDown = new Codicon('fold-down', { fontCharacter: '\\eaf3' });
Codicon.foldUp = new Codicon('fold-up', { fontCharacter: '\\eaf4' });
Codicon.fold = new Codicon('fold', { fontCharacter: '\\eaf5' });
Codicon.folderActive = new Codicon('folder-active', { fontCharacter: '\\eaf6' });
Codicon.folderOpened = new Codicon('folder-opened', { fontCharacter: '\\eaf7' });
Codicon.gear = new Codicon('gear', { fontCharacter: '\\eaf8' });
Codicon.gift = new Codicon('gift', { fontCharacter: '\\eaf9' });
Codicon.gistSecret = new Codicon('gist-secret', { fontCharacter: '\\eafa' });
Codicon.gist = new Codicon('gist', { fontCharacter: '\\eafb' });
Codicon.gitCommit = new Codicon('git-commit', { fontCharacter: '\\eafc' });
Codicon.gitCompare = new Codicon('git-compare', { fontCharacter: '\\eafd' });
Codicon.gitMerge = new Codicon('git-merge', { fontCharacter: '\\eafe' });
Codicon.githubAction = new Codicon('github-action', { fontCharacter: '\\eaff' });
Codicon.githubAlt = new Codicon('github-alt', { fontCharacter: '\\eb00' });
Codicon.globe = new Codicon('globe', { fontCharacter: '\\eb01' });
Codicon.grabber = new Codicon('grabber', { fontCharacter: '\\eb02' });
Codicon.graph = new Codicon('graph', { fontCharacter: '\\eb03' });
Codicon.gripper = new Codicon('gripper', { fontCharacter: '\\eb04' });
Codicon.heart = new Codicon('heart', { fontCharacter: '\\eb05' });
Codicon.home = new Codicon('home', { fontCharacter: '\\eb06' });
Codicon.horizontalRule = new Codicon('horizontal-rule', { fontCharacter: '\\eb07' });
Codicon.hubot = new Codicon('hubot', { fontCharacter: '\\eb08' });
Codicon.inbox = new Codicon('inbox', { fontCharacter: '\\eb09' });
Codicon.issueClosed = new Codicon('issue-closed', { fontCharacter: '\\eba4' });
Codicon.issueReopened = new Codicon('issue-reopened', { fontCharacter: '\\eb0b' });
Codicon.issues = new Codicon('issues', { fontCharacter: '\\eb0c' });
Codicon.italic = new Codicon('italic', { fontCharacter: '\\eb0d' });
Codicon.jersey = new Codicon('jersey', { fontCharacter: '\\eb0e' });
Codicon.json = new Codicon('json', { fontCharacter: '\\eb0f' });
Codicon.kebabVertical = new Codicon('kebab-vertical', { fontCharacter: '\\eb10' });
Codicon.key = new Codicon('key', { fontCharacter: '\\eb11' });
Codicon.law = new Codicon('law', { fontCharacter: '\\eb12' });
Codicon.lightbulbAutofix = new Codicon('lightbulb-autofix', { fontCharacter: '\\eb13' });
Codicon.linkExternal = new Codicon('link-external', { fontCharacter: '\\eb14' });
Codicon.link = new Codicon('link', { fontCharacter: '\\eb15' });
Codicon.listOrdered = new Codicon('list-ordered', { fontCharacter: '\\eb16' });
Codicon.listUnordered = new Codicon('list-unordered', { fontCharacter: '\\eb17' });
Codicon.liveShare = new Codicon('live-share', { fontCharacter: '\\eb18' });
Codicon.loading = new Codicon('loading', { fontCharacter: '\\eb19' });
Codicon.location = new Codicon('location', { fontCharacter: '\\eb1a' });
Codicon.mailRead = new Codicon('mail-read', { fontCharacter: '\\eb1b' });
Codicon.mail = new Codicon('mail', { fontCharacter: '\\eb1c' });
Codicon.markdown = new Codicon('markdown', { fontCharacter: '\\eb1d' });
Codicon.megaphone = new Codicon('megaphone', { fontCharacter: '\\eb1e' });
Codicon.mention = new Codicon('mention', { fontCharacter: '\\eb1f' });
Codicon.milestone = new Codicon('milestone', { fontCharacter: '\\eb20' });
Codicon.mortarBoard = new Codicon('mortar-board', { fontCharacter: '\\eb21' });
Codicon.move = new Codicon('move', { fontCharacter: '\\eb22' });
Codicon.multipleWindows = new Codicon('multiple-windows', { fontCharacter: '\\eb23' });
Codicon.mute = new Codicon('mute', { fontCharacter: '\\eb24' });
Codicon.noNewline = new Codicon('no-newline', { fontCharacter: '\\eb25' });
Codicon.note = new Codicon('note', { fontCharacter: '\\eb26' });
Codicon.octoface = new Codicon('octoface', { fontCharacter: '\\eb27' });
Codicon.openPreview = new Codicon('open-preview', { fontCharacter: '\\eb28' });
Codicon.package_ = new Codicon('package', { fontCharacter: '\\eb29' });
Codicon.paintcan = new Codicon('paintcan', { fontCharacter: '\\eb2a' });
Codicon.pin = new Codicon('pin', { fontCharacter: '\\eb2b' });
Codicon.play = new Codicon('play', { fontCharacter: '\\eb2c' });
Codicon.run = new Codicon('run', { fontCharacter: '\\eb2c' });
Codicon.plug = new Codicon('plug', { fontCharacter: '\\eb2d' });
Codicon.preserveCase = new Codicon('preserve-case', { fontCharacter: '\\eb2e' });
Codicon.preview = new Codicon('preview', { fontCharacter: '\\eb2f' });
Codicon.project = new Codicon('project', { fontCharacter: '\\eb30' });
Codicon.pulse = new Codicon('pulse', { fontCharacter: '\\eb31' });
Codicon.question = new Codicon('question', { fontCharacter: '\\eb32' });
Codicon.quote = new Codicon('quote', { fontCharacter: '\\eb33' });
Codicon.radioTower = new Codicon('radio-tower', { fontCharacter: '\\eb34' });
Codicon.reactions = new Codicon('reactions', { fontCharacter: '\\eb35' });
Codicon.references = new Codicon('references', { fontCharacter: '\\eb36' });
Codicon.refresh = new Codicon('refresh', { fontCharacter: '\\eb37' });
Codicon.regex = new Codicon('regex', { fontCharacter: '\\eb38' });
Codicon.remoteExplorer = new Codicon('remote-explorer', { fontCharacter: '\\eb39' });
Codicon.remote = new Codicon('remote', { fontCharacter: '\\eb3a' });
Codicon.remove = new Codicon('remove', { fontCharacter: '\\eb3b' });
Codicon.replaceAll = new Codicon('replace-all', { fontCharacter: '\\eb3c' });
Codicon.replace = new Codicon('replace', { fontCharacter: '\\eb3d' });
Codicon.repoClone = new Codicon('repo-clone', { fontCharacter: '\\eb3e' });
Codicon.repoForcePush = new Codicon('repo-force-push', { fontCharacter: '\\eb3f' });
Codicon.repoPull = new Codicon('repo-pull', { fontCharacter: '\\eb40' });
Codicon.repoPush = new Codicon('repo-push', { fontCharacter: '\\eb41' });
Codicon.report = new Codicon('report', { fontCharacter: '\\eb42' });
Codicon.requestChanges = new Codicon('request-changes', { fontCharacter: '\\eb43' });
Codicon.rocket = new Codicon('rocket', { fontCharacter: '\\eb44' });
Codicon.rootFolderOpened = new Codicon('root-folder-opened', { fontCharacter: '\\eb45' });
Codicon.rootFolder = new Codicon('root-folder', { fontCharacter: '\\eb46' });
Codicon.rss = new Codicon('rss', { fontCharacter: '\\eb47' });
Codicon.ruby = new Codicon('ruby', { fontCharacter: '\\eb48' });
Codicon.saveAll = new Codicon('save-all', { fontCharacter: '\\eb49' });
Codicon.saveAs = new Codicon('save-as', { fontCharacter: '\\eb4a' });
Codicon.save = new Codicon('save', { fontCharacter: '\\eb4b' });
Codicon.screenFull = new Codicon('screen-full', { fontCharacter: '\\eb4c' });
Codicon.screenNormal = new Codicon('screen-normal', { fontCharacter: '\\eb4d' });
Codicon.searchStop = new Codicon('search-stop', { fontCharacter: '\\eb4e' });
Codicon.server = new Codicon('server', { fontCharacter: '\\eb50' });
Codicon.settingsGear = new Codicon('settings-gear', { fontCharacter: '\\eb51' });
Codicon.settings = new Codicon('settings', { fontCharacter: '\\eb52' });
Codicon.shield = new Codicon('shield', { fontCharacter: '\\eb53' });
Codicon.smiley = new Codicon('smiley', { fontCharacter: '\\eb54' });
Codicon.sortPrecedence = new Codicon('sort-precedence', { fontCharacter: '\\eb55' });
Codicon.splitHorizontal = new Codicon('split-horizontal', { fontCharacter: '\\eb56' });
Codicon.splitVertical = new Codicon('split-vertical', { fontCharacter: '\\eb57' });
Codicon.squirrel = new Codicon('squirrel', { fontCharacter: '\\eb58' });
Codicon.starFull = new Codicon('star-full', { fontCharacter: '\\eb59' });
Codicon.starHalf = new Codicon('star-half', { fontCharacter: '\\eb5a' });
Codicon.symbolClass = new Codicon('symbol-class', { fontCharacter: '\\eb5b' });
Codicon.symbolColor = new Codicon('symbol-color', { fontCharacter: '\\eb5c' });
Codicon.symbolConstant = new Codicon('symbol-constant', { fontCharacter: '\\eb5d' });
Codicon.symbolEnumMember = new Codicon('symbol-enum-member', { fontCharacter: '\\eb5e' });
Codicon.symbolField = new Codicon('symbol-field', { fontCharacter: '\\eb5f' });
Codicon.symbolFile = new Codicon('symbol-file', { fontCharacter: '\\eb60' });
Codicon.symbolInterface = new Codicon('symbol-interface', { fontCharacter: '\\eb61' });
Codicon.symbolKeyword = new Codicon('symbol-keyword', { fontCharacter: '\\eb62' });
Codicon.symbolMisc = new Codicon('symbol-misc', { fontCharacter: '\\eb63' });
Codicon.symbolOperator = new Codicon('symbol-operator', { fontCharacter: '\\eb64' });
Codicon.symbolProperty = new Codicon('symbol-property', { fontCharacter: '\\eb65' });
Codicon.wrench = new Codicon('wrench', { fontCharacter: '\\eb65' });
Codicon.wrenchSubaction = new Codicon('wrench-subaction', { fontCharacter: '\\eb65' });
Codicon.symbolSnippet = new Codicon('symbol-snippet', { fontCharacter: '\\eb66' });
Codicon.tasklist = new Codicon('tasklist', { fontCharacter: '\\eb67' });
Codicon.telescope = new Codicon('telescope', { fontCharacter: '\\eb68' });
Codicon.textSize = new Codicon('text-size', { fontCharacter: '\\eb69' });
Codicon.threeBars = new Codicon('three-bars', { fontCharacter: '\\eb6a' });
Codicon.thumbsdown = new Codicon('thumbsdown', { fontCharacter: '\\eb6b' });
Codicon.thumbsup = new Codicon('thumbsup', { fontCharacter: '\\eb6c' });
Codicon.tools = new Codicon('tools', { fontCharacter: '\\eb6d' });
Codicon.triangleDown = new Codicon('triangle-down', { fontCharacter: '\\eb6e' });
Codicon.triangleLeft = new Codicon('triangle-left', { fontCharacter: '\\eb6f' });
Codicon.triangleRight = new Codicon('triangle-right', { fontCharacter: '\\eb70' });
Codicon.triangleUp = new Codicon('triangle-up', { fontCharacter: '\\eb71' });
Codicon.twitter = new Codicon('twitter', { fontCharacter: '\\eb72' });
Codicon.unfold = new Codicon('unfold', { fontCharacter: '\\eb73' });
Codicon.unlock = new Codicon('unlock', { fontCharacter: '\\eb74' });
Codicon.unmute = new Codicon('unmute', { fontCharacter: '\\eb75' });
Codicon.unverified = new Codicon('unverified', { fontCharacter: '\\eb76' });
Codicon.verified = new Codicon('verified', { fontCharacter: '\\eb77' });
Codicon.versions = new Codicon('versions', { fontCharacter: '\\eb78' });
Codicon.vmActive = new Codicon('vm-active', { fontCharacter: '\\eb79' });
Codicon.vmOutline = new Codicon('vm-outline', { fontCharacter: '\\eb7a' });
Codicon.vmRunning = new Codicon('vm-running', { fontCharacter: '\\eb7b' });
Codicon.watch = new Codicon('watch', { fontCharacter: '\\eb7c' });
Codicon.whitespace = new Codicon('whitespace', { fontCharacter: '\\eb7d' });
Codicon.wholeWord = new Codicon('whole-word', { fontCharacter: '\\eb7e' });
Codicon.window = new Codicon('window', { fontCharacter: '\\eb7f' });
Codicon.wordWrap = new Codicon('word-wrap', { fontCharacter: '\\eb80' });
Codicon.zoomIn = new Codicon('zoom-in', { fontCharacter: '\\eb81' });
Codicon.zoomOut = new Codicon('zoom-out', { fontCharacter: '\\eb82' });
Codicon.listFilter = new Codicon('list-filter', { fontCharacter: '\\eb83' });
Codicon.listFlat = new Codicon('list-flat', { fontCharacter: '\\eb84' });
Codicon.listSelection = new Codicon('list-selection', { fontCharacter: '\\eb85' });
Codicon.selection = new Codicon('selection', { fontCharacter: '\\eb85' });
Codicon.listTree = new Codicon('list-tree', { fontCharacter: '\\eb86' });
Codicon.debugBreakpointFunctionUnverified = new Codicon('debug-breakpoint-function-unverified', { fontCharacter: '\\eb87' });
Codicon.debugBreakpointFunction = new Codicon('debug-breakpoint-function', { fontCharacter: '\\eb88' });
Codicon.debugBreakpointFunctionDisabled = new Codicon('debug-breakpoint-function-disabled', { fontCharacter: '\\eb88' });
Codicon.debugStackframeActive = new Codicon('debug-stackframe-active', { fontCharacter: '\\eb89' });
Codicon.debugStackframeDot = new Codicon('debug-stackframe-dot', { fontCharacter: '\\eb8a' });
Codicon.debugStackframe = new Codicon('debug-stackframe', { fontCharacter: '\\eb8b' });
Codicon.debugStackframeFocused = new Codicon('debug-stackframe-focused', { fontCharacter: '\\eb8b' });
Codicon.debugBreakpointUnsupported = new Codicon('debug-breakpoint-unsupported', { fontCharacter: '\\eb8c' });
Codicon.symbolString = new Codicon('symbol-string', { fontCharacter: '\\eb8d' });
Codicon.debugReverseContinue = new Codicon('debug-reverse-continue', { fontCharacter: '\\eb8e' });
Codicon.debugStepBack = new Codicon('debug-step-back', { fontCharacter: '\\eb8f' });
Codicon.debugRestartFrame = new Codicon('debug-restart-frame', { fontCharacter: '\\eb90' });
Codicon.callIncoming = new Codicon('call-incoming', { fontCharacter: '\\eb92' });
Codicon.callOutgoing = new Codicon('call-outgoing', { fontCharacter: '\\eb93' });
Codicon.menu = new Codicon('menu', { fontCharacter: '\\eb94' });
Codicon.expandAll = new Codicon('expand-all', { fontCharacter: '\\eb95' });
Codicon.feedback = new Codicon('feedback', { fontCharacter: '\\eb96' });
Codicon.groupByRefType = new Codicon('group-by-ref-type', { fontCharacter: '\\eb97' });
Codicon.ungroupByRefType = new Codicon('ungroup-by-ref-type', { fontCharacter: '\\eb98' });
Codicon.account = new Codicon('account', { fontCharacter: '\\eb99' });
Codicon.bellDot = new Codicon('bell-dot', { fontCharacter: '\\eb9a' });
Codicon.debugConsole = new Codicon('debug-console', { fontCharacter: '\\eb9b' });
Codicon.library = new Codicon('library', { fontCharacter: '\\eb9c' });
Codicon.output = new Codicon('output', { fontCharacter: '\\eb9d' });
Codicon.runAll = new Codicon('run-all', { fontCharacter: '\\eb9e' });
Codicon.syncIgnored = new Codicon('sync-ignored', { fontCharacter: '\\eb9f' });
Codicon.pinned = new Codicon('pinned', { fontCharacter: '\\eba0' });
Codicon.githubInverted = new Codicon('github-inverted', { fontCharacter: '\\eba1' });
Codicon.debugAlt = new Codicon('debug-alt', { fontCharacter: '\\eb91' });
Codicon.serverProcess = new Codicon('server-process', { fontCharacter: '\\eba2' });
Codicon.serverEnvironment = new Codicon('server-environment', { fontCharacter: '\\eba3' });
Codicon.pass = new Codicon('pass', { fontCharacter: '\\eba4' });
Codicon.stopCircle = new Codicon('stop-circle', { fontCharacter: '\\eba5' });
Codicon.playCircle = new Codicon('play-circle', { fontCharacter: '\\eba6' });
Codicon.record = new Codicon('record', { fontCharacter: '\\eba7' });
Codicon.debugAltSmall = new Codicon('debug-alt-small', { fontCharacter: '\\eba8' });
Codicon.vmConnect = new Codicon('vm-connect', { fontCharacter: '\\eba9' });
Codicon.cloud = new Codicon('cloud', { fontCharacter: '\\ebaa' });
Codicon.merge = new Codicon('merge', { fontCharacter: '\\ebab' });
Codicon.exportIcon = new Codicon('export', { fontCharacter: '\\ebac' });
Codicon.graphLeft = new Codicon('graph-left', { fontCharacter: '\\ebad' });
Codicon.magnet = new Codicon('magnet', { fontCharacter: '\\ebae' });
Codicon.notebook = new Codicon('notebook', { fontCharacter: '\\ebaf' });
Codicon.redo = new Codicon('redo', { fontCharacter: '\\ebb0' });
Codicon.checkAll = new Codicon('check-all', { fontCharacter: '\\ebb1' });
Codicon.pinnedDirty = new Codicon('pinned-dirty', { fontCharacter: '\\ebb2' });
Codicon.passFilled = new Codicon('pass-filled', { fontCharacter: '\\ebb3' });
Codicon.circleLargeFilled = new Codicon('circle-large-filled', { fontCharacter: '\\ebb4' });
Codicon.circleLargeOutline = new Codicon('circle-large-outline', { fontCharacter: '\\ebb5' });
Codicon.combine = new Codicon('combine', { fontCharacter: '\\ebb6' });
Codicon.gather = new Codicon('gather', { fontCharacter: '\\ebb6' });
Codicon.table = new Codicon('table', { fontCharacter: '\\ebb7' });
Codicon.variableGroup = new Codicon('variable-group', { fontCharacter: '\\ebb8' });
Codicon.typeHierarchy = new Codicon('type-hierarchy', { fontCharacter: '\\ebb9' });
Codicon.typeHierarchySub = new Codicon('type-hierarchy-sub', { fontCharacter: '\\ebba' });
Codicon.typeHierarchySuper = new Codicon('type-hierarchy-super', { fontCharacter: '\\ebbb' });
Codicon.gitPullRequestCreate = new Codicon('git-pull-request-create', { fontCharacter: '\\ebbc' });
Codicon.runAbove = new Codicon('run-above', { fontCharacter: '\\ebbd' });
Codicon.runBelow = new Codicon('run-below', { fontCharacter: '\\ebbe' });
Codicon.notebookTemplate = new Codicon('notebook-template', { fontCharacter: '\\ebbf' });
Codicon.debugRerun = new Codicon('debug-rerun', { fontCharacter: '\\ebc0' });
Codicon.workspaceTrusted = new Codicon('workspace-trusted', { fontCharacter: '\\ebc1' });
Codicon.workspaceUntrusted = new Codicon('workspace-untrusted', { fontCharacter: '\\ebc2' });
Codicon.workspaceUnspecified = new Codicon('workspace-unspecified', { fontCharacter: '\\ebc3' });
Codicon.terminalCmd = new Codicon('terminal-cmd', { fontCharacter: '\\ebc4' });
Codicon.terminalDebian = new Codicon('terminal-debian', { fontCharacter: '\\ebc5' });
Codicon.terminalLinux = new Codicon('terminal-linux', { fontCharacter: '\\ebc6' });
Codicon.terminalPowershell = new Codicon('terminal-powershell', { fontCharacter: '\\ebc7' });
Codicon.terminalTmux = new Codicon('terminal-tmux', { fontCharacter: '\\ebc8' });
Codicon.terminalUbuntu = new Codicon('terminal-ubuntu', { fontCharacter: '\\ebc9' });
Codicon.terminalBash = new Codicon('terminal-bash', { fontCharacter: '\\ebca' });
Codicon.arrowSwap = new Codicon('arrow-swap', { fontCharacter: '\\ebcb' });
Codicon.copy = new Codicon('copy', { fontCharacter: '\\ebcc' });
Codicon.personAdd = new Codicon('person-add', { fontCharacter: '\\ebcd' });
Codicon.filterFilled = new Codicon('filter-filled', { fontCharacter: '\\ebce' });
Codicon.wand = new Codicon('wand', { fontCharacter: '\\ebcf' });
Codicon.debugLineByLine = new Codicon('debug-line-by-line', { fontCharacter: '\\ebd0' });
Codicon.inspect = new Codicon('inspect', { fontCharacter: '\\ebd1' });
Codicon.layers = new Codicon('layers', { fontCharacter: '\\ebd2' });
Codicon.layersDot = new Codicon('layers-dot', { fontCharacter: '\\ebd3' });
Codicon.layersActive = new Codicon('layers-active', { fontCharacter: '\\ebd4' });
Codicon.compass = new Codicon('compass', { fontCharacter: '\\ebd5' });
Codicon.compassDot = new Codicon('compass-dot', { fontCharacter: '\\ebd6' });
Codicon.compassActive = new Codicon('compass-active', { fontCharacter: '\\ebd7' });
Codicon.azure = new Codicon('azure', { fontCharacter: '\\ebd8' });
Codicon.issueDraft = new Codicon('issue-draft', { fontCharacter: '\\ebd9' });
Codicon.gitPullRequestClosed = new Codicon('git-pull-request-closed', { fontCharacter: '\\ebda' });
Codicon.gitPullRequestDraft = new Codicon('git-pull-request-draft', { fontCharacter: '\\ebdb' });
Codicon.debugAll = new Codicon('debug-all', { fontCharacter: '\\ebdc' });
Codicon.debugCoverage = new Codicon('debug-coverage', { fontCharacter: '\\ebdd' });
Codicon.runErrors = new Codicon('run-errors', { fontCharacter: '\\ebde' });
Codicon.folderLibrary = new Codicon('folder-library', { fontCharacter: '\\ebdf' });
Codicon.debugContinueSmall = new Codicon('debug-continue-small', { fontCharacter: '\\ebe0' });
Codicon.beakerStop = new Codicon('beaker-stop', { fontCharacter: '\\ebe1' });
Codicon.graphLine = new Codicon('graph-line', { fontCharacter: '\\ebe2' });
Codicon.graphScatter = new Codicon('graph-scatter', { fontCharacter: '\\ebe3' });
Codicon.pieChart = new Codicon('pie-chart', { fontCharacter: '\\ebe4' });
Codicon.bracket = new Codicon('bracket', Codicon.json.definition);
Codicon.bracketDot = new Codicon('bracket-dot', { fontCharacter: '\\ebe5' });
Codicon.bracketError = new Codicon('bracket-error', { fontCharacter: '\\ebe6' });
Codicon.lockSmall = new Codicon('lock-small', { fontCharacter: '\\ebe7' });
Codicon.azureDevops = new Codicon('azure-devops', { fontCharacter: '\\ebe8' });
Codicon.verifiedFilled = new Codicon('verified-filled', { fontCharacter: '\\ebe9' });
})(Codicon || (Codicon = {}));
/***/ }),
/***/ 79881:
/*!***************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/errors.js ***!
\***************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ B8: function() { return /* binding */ NotSupportedError; },
/* harmony export */ Cp: function() { return /* binding */ onUnexpectedExternalError; },
/* harmony export */ F0: function() { return /* binding */ canceled; },
/* harmony export */ L6: function() { return /* binding */ illegalState; },
/* harmony export */ VV: function() { return /* binding */ isPromiseCanceledError; },
/* harmony export */ b1: function() { return /* binding */ illegalArgument; },
/* harmony export */ dL: function() { return /* binding */ onUnexpectedError; },
/* harmony export */ ri: function() { return /* binding */ transformErrorForSerialization; }
/* harmony export */ });
/* unused harmony exports ErrorHandler, errorHandler */
// Avoid circular dependency on EventEmitter by implementing a subset of the interface.
class ErrorHandler {
constructor() {
this.listeners = [];
this.unexpectedErrorHandler = function (e) {
setTimeout(() => {
if (e.stack) {
throw new Error(e.message + '\n\n' + e.stack);
}
throw e;
}, 0);
};
}
emit(e) {
this.listeners.forEach((listener) => {
listener(e);
});
}
onUnexpectedError(e) {
this.unexpectedErrorHandler(e);
this.emit(e);
}
// For external errors, we don't want the listeners to be called
onUnexpectedExternalError(e) {
this.unexpectedErrorHandler(e);
}
}
const errorHandler = new ErrorHandler();
function onUnexpectedError(e) {
// ignore errors from cancelled promises
if (!isPromiseCanceledError(e)) {
errorHandler.onUnexpectedError(e);
}
return undefined;
}
function onUnexpectedExternalError(e) {
// ignore errors from cancelled promises
if (!isPromiseCanceledError(e)) {
errorHandler.onUnexpectedExternalError(e);
}
return undefined;
}
function transformErrorForSerialization(error) {
if (error instanceof Error) {
let { name, message } = error;
const stack = error.stacktrace || error.stack;
return {
$isError: true,
name,
message,
stack
};
}
// return as is
return error;
}
const canceledName = 'Canceled';
/**
* Checks if the given error is a promise in canceled state
*/
function isPromiseCanceledError(error) {
return error instanceof Error && error.name === canceledName && error.message === canceledName;
}
/**
* Returns an error that signals cancellation.
*/
function canceled() {
const error = new Error(canceledName);
error.name = error.message;
return error;
}
function illegalArgument(name) {
if (name) {
return new Error(`Illegal argument: ${name}`);
}
else {
return new Error('Illegal argument');
}
}
function illegalState(name) {
if (name) {
return new Error(`Illegal state: ${name}`);
}
else {
return new Error('Illegal state');
}
}
class NotSupportedError extends Error {
constructor(message) {
super('NotSupported');
if (message) {
this.message = message;
}
}
}
/***/ }),
/***/ 4348:
/*!**************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/event.js ***!
\**************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ D0: function() { return /* binding */ DebounceEmitter; },
/* harmony export */ E7: function() { return /* binding */ EventBufferer; },
/* harmony export */ K3: function() { return /* binding */ PauseableEmitter; },
/* harmony export */ Q5: function() { return /* binding */ Emitter; },
/* harmony export */ ZD: function() { return /* binding */ Relay; },
/* harmony export */ ju: function() { return /* binding */ Event; }
/* harmony export */ });
/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ 79881);
/* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lifecycle.js */ 69323);
/* harmony import */ var _linkedList_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linkedList.js */ 34502);
/* harmony import */ var _stopwatch_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stopwatch.js */ 95830);
var Event;
(function (Event) {
Event.None = () => _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__/* .Disposable */ .JT.None;
/**
* Given an event, returns another event which only fires once.
*/
function once(event) {
return (listener, thisArgs = null, disposables) => {
// we need this, in case the event fires during the listener call
let didFire = false;
let result;
result = event(e => {
if (didFire) {
return;
}
else if (result) {
result.dispose();
}
else {
didFire = true;
}
return listener.call(thisArgs, e);
}, null, disposables);
if (didFire) {
result.dispose();
}
return result;
};
}
Event.once = once;
/**
* @deprecated DO NOT use, this leaks memory
*/
function map(event, map) {
return snapshot((listener, thisArgs = null, disposables) => event(i => listener.call(thisArgs, map(i)), null, disposables));
}
Event.map = map;
/**
* @deprecated DO NOT use, this leaks memory
*/
function forEach(event, each) {
return snapshot((listener, thisArgs = null, disposables) => event(i => { each(i); listener.call(thisArgs, i); }, null, disposables));
}
Event.forEach = forEach;
function filter(event, filter) {
return snapshot((listener, thisArgs = null, disposables) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables));
}
Event.filter = filter;
/**
* Given an event, returns the same event but typed as `Event<void>`.
*/
function signal(event) {
return event;
}
Event.signal = signal;
function any(...events) {
return (listener, thisArgs = null, disposables) => (0,_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__/* .combinedDisposable */ .F8)(...events.map(event => event(e => listener.call(thisArgs, e), null, disposables)));
}
Event.any = any;
/**
* @deprecated DO NOT use, this leaks memory
*/
function reduce(event, merge, initial) {
let output = initial;
return map(event, e => {
output = merge(output, e);
return output;
});
}
Event.reduce = reduce;
/**
* @deprecated DO NOT use, this leaks memory
*/
function snapshot(event) {
let listener;
const emitter = new Emitter({
onFirstListenerAdd() {
listener = event(emitter.fire, emitter);
},
onLastListenerRemove() {
listener.dispose();
}
});
return emitter.event;
}
/**
* @deprecated DO NOT use, this leaks memory
*/
function debounce(event, merge, delay = 100, leading = false, leakWarningThreshold) {
let subscription;
let output = undefined;
let handle = undefined;
let numDebouncedCalls = 0;
const emitter = new Emitter({
leakWarningThreshold,
onFirstListenerAdd() {
subscription = event(cur => {
numDebouncedCalls++;
output = merge(output, cur);
if (leading && !handle) {
emitter.fire(output);
output = undefined;
}
clearTimeout(handle);
handle = setTimeout(() => {
const _output = output;
output = undefined;
handle = undefined;
if (!leading || numDebouncedCalls > 1) {
emitter.fire(_output);
}
numDebouncedCalls = 0;
}, delay);
});
},
onLastListenerRemove() {
subscription.dispose();
}
});
return emitter.event;
}
Event.debounce = debounce;
/**
* @deprecated DO NOT use, this leaks memory
*/
function latch(event, equals = (a, b) => a === b) {
let firstCall = true;
let cache;
return filter(event, value => {
const shouldEmit = firstCall || !equals(value, cache);
firstCall = false;
cache = value;
return shouldEmit;
});
}
Event.latch = latch;
/**
* @deprecated DO NOT use, this leaks memory
*/
function split(event, isT) {
return [
Event.filter(event, isT),
Event.filter(event, e => !isT(e)),
];
}
Event.split = split;
/**
* @deprecated DO NOT use, this leaks memory
*/
function buffer(event, nextTick = false, _buffer = []) {
let buffer = _buffer.slice();
let listener = event(e => {
if (buffer) {
buffer.push(e);
}
else {
emitter.fire(e);
}
});
const flush = () => {
if (buffer) {
buffer.forEach(e => emitter.fire(e));
}
buffer = null;
};
const emitter = new Emitter({
onFirstListenerAdd() {
if (!listener) {
listener = event(e => emitter.fire(e));
}
},
onFirstListenerDidAdd() {
if (buffer) {
if (nextTick) {
setTimeout(flush);
}
else {
flush();
}
}
},
onLastListenerRemove() {
if (listener) {
listener.dispose();
}
listener = null;
}
});
return emitter.event;
}
Event.buffer = buffer;
class ChainableEvent {
constructor(event) {
this.event = event;
}
map(fn) {
return new ChainableEvent(map(this.event, fn));
}
forEach(fn) {
return new ChainableEvent(forEach(this.event, fn));
}
filter(fn) {
return new ChainableEvent(filter(this.event, fn));
}
reduce(merge, initial) {
return new ChainableEvent(reduce(this.event, merge, initial));
}
latch() {
return new ChainableEvent(latch(this.event));
}
debounce(merge, delay = 100, leading = false, leakWarningThreshold) {
return new ChainableEvent(debounce(this.event, merge, delay, leading, leakWarningThreshold));
}
on(listener, thisArgs, disposables) {
return this.event(listener, thisArgs, disposables);
}
once(listener, thisArgs, disposables) {
return once(this.event)(listener, thisArgs, disposables);
}
}
/**
* @deprecated DO NOT use, this leaks memory
*/
function chain(event) {
return new ChainableEvent(event);
}
Event.chain = chain;
function fromNodeEventEmitter(emitter, eventName, map = id => id) {
const fn = (...args) => result.fire(map(...args));
const onFirstListenerAdd = () => emitter.on(eventName, fn);
const onLastListenerRemove = () => emitter.removeListener(eventName, fn);
const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove });
return result.event;
}
Event.fromNodeEventEmitter = fromNodeEventEmitter;
function fromDOMEventEmitter(emitter, eventName, map = id => id) {
const fn = (...args) => result.fire(map(...args));
const onFirstListenerAdd = () => emitter.addEventListener(eventName, fn);
const onLastListenerRemove = () => emitter.removeEventListener(eventName, fn);
const result = new Emitter({ onFirstListenerAdd, onLastListenerRemove });
return result.event;
}
Event.fromDOMEventEmitter = fromDOMEventEmitter;
function toPromise(event) {
return new Promise(resolve => once(event)(resolve));
}
Event.toPromise = toPromise;
})(Event || (Event = {}));
class EventProfiling {
constructor(name) {
this._listenerCount = 0;
this._invocationCount = 0;
this._elapsedOverall = 0;
this._name = `${name}_${EventProfiling._idPool++}`;
}
start(listenerCount) {
this._stopWatch = new _stopwatch_js__WEBPACK_IMPORTED_MODULE_3__/* .StopWatch */ .G(true);
this._listenerCount = listenerCount;
}
stop() {
if (this._stopWatch) {
const elapsed = this._stopWatch.elapsed();
this._elapsedOverall += elapsed;
this._invocationCount += 1;
console.info(`did FIRE ${this._name}: elapsed_ms: ${elapsed.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`);
this._stopWatch = undefined;
}
}
}
EventProfiling._idPool = 0;
let _globalLeakWarningThreshold = -1;
class LeakageMonitor {
constructor(customThreshold, name = Math.random().toString(18).slice(2, 5)) {
this.customThreshold = customThreshold;
this.name = name;
this._warnCountdown = 0;
}
dispose() {
if (this._stacks) {
this._stacks.clear();
}
}
check(listenerCount) {
let threshold = _globalLeakWarningThreshold;
if (typeof this.customThreshold === 'number') {
threshold = this.customThreshold;
}
if (threshold <= 0 || listenerCount < threshold) {
return undefined;
}
if (!this._stacks) {
this._stacks = new Map();
}
const stack = new Error().stack.split('\n').slice(3).join('\n');
const count = (this._stacks.get(stack) || 0);
this._stacks.set(stack, count + 1);
this._warnCountdown -= 1;
if (this._warnCountdown <= 0) {
// only warn on first exceed and then every time the limit
// is exceeded by 50% again
this._warnCountdown = threshold * 0.5;
// find most frequent listener and print warning
let topStack;
let topCount = 0;
for (const [stack, count] of this._stacks) {
if (!topStack || topCount < count) {
topStack = stack;
topCount = count;
}
}
console.warn(`[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`);
console.warn(topStack);
}
return () => {
const count = (this._stacks.get(stack) || 0);
this._stacks.set(stack, count - 1);
};
}
}
/**
* The Emitter can be used to expose an Event to the public
* to fire it from the insides.
* Sample:
class Document {
private readonly _onDidChange = new Emitter<(value:string)=>any>();
public onDidChange = this._onDidChange.event;
// getter-style
// get onDidChange(): Event<(value:string)=>any> {
// return this._onDidChange.event;
// }
private _doIt() {
//...
this._onDidChange.fire(value);
}
}
*/
class Emitter {
constructor(options) {
var _a;
this._disposed = false;
this._options = options;
this._leakageMon = _globalLeakWarningThreshold > 0 ? new LeakageMonitor(this._options && this._options.leakWarningThreshold) : undefined;
this._perfMon = ((_a = this._options) === null || _a === void 0 ? void 0 : _a._profName) ? new EventProfiling(this._options._profName) : undefined;
}
/**
* For the public to allow to subscribe
* to events from this Emitter
*/
get event() {
if (!this._event) {
this._event = (listener, thisArgs, disposables) => {
var _a;
if (!this._listeners) {
this._listeners = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__/* .LinkedList */ .S();
}
const firstListener = this._listeners.isEmpty();
if (firstListener && this._options && this._options.onFirstListenerAdd) {
this._options.onFirstListenerAdd(this);
}
const remove = this._listeners.push(!thisArgs ? listener : [listener, thisArgs]);
if (firstListener && this._options && this._options.onFirstListenerDidAdd) {
this._options.onFirstListenerDidAdd(this);
}
if (this._options && this._options.onListenerDidAdd) {
this._options.onListenerDidAdd(this, listener, thisArgs);
}
// check and record this emitter for potential leakage
const removeMonitor = (_a = this._leakageMon) === null || _a === void 0 ? void 0 : _a.check(this._listeners.size);
const result = (0,_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__/* .toDisposable */ .OF)(() => {
if (removeMonitor) {
removeMonitor();
}
if (!this._disposed) {
remove();
if (this._options && this._options.onLastListenerRemove) {
const hasListeners = (this._listeners && !this._listeners.isEmpty());
if (!hasListeners) {
this._options.onLastListenerRemove(this);
}
}
}
});
if (disposables instanceof _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__/* .DisposableStore */ .SL) {
disposables.add(result);
}
else if (Array.isArray(disposables)) {
disposables.push(result);
}
return result;
};
}
return this._event;
}
/**
* To be kept private to fire an event to
* subscribers
*/
fire(event) {
var _a, _b;
if (this._listeners) {
// put all [listener,event]-pairs into delivery queue
// then emit all event. an inner/nested event might be
// the driver of this
if (!this._deliveryQueue) {
this._deliveryQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__/* .LinkedList */ .S();
}
for (let listener of this._listeners) {
this._deliveryQueue.push([listener, event]);
}
// start/stop performance insight collection
(_a = this._perfMon) === null || _a === void 0 ? void 0 : _a.start(this._deliveryQueue.size);
while (this._deliveryQueue.size > 0) {
const [listener, event] = this._deliveryQueue.shift();
try {
if (typeof listener === 'function') {
listener.call(undefined, event);
}
else {
listener[0].call(listener[1], event);
}
}
catch (e) {
(0,_errors_js__WEBPACK_IMPORTED_MODULE_0__/* .onUnexpectedError */ .dL)(e);
}
}
(_b = this._perfMon) === null || _b === void 0 ? void 0 : _b.stop();
}
}
dispose() {
var _a, _b, _c, _d, _e;
if (!this._disposed) {
this._disposed = true;
(_a = this._listeners) === null || _a === void 0 ? void 0 : _a.clear();
(_b = this._deliveryQueue) === null || _b === void 0 ? void 0 : _b.clear();
(_d = (_c = this._options) === null || _c === void 0 ? void 0 : _c.onLastListenerRemove) === null || _d === void 0 ? void 0 : _d.call(_c);
(_e = this._leakageMon) === null || _e === void 0 ? void 0 : _e.dispose();
}
}
}
class PauseableEmitter extends Emitter {
constructor(options) {
super(options);
this._isPaused = 0;
this._eventQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_2__/* .LinkedList */ .S();
this._mergeFn = options === null || options === void 0 ? void 0 : options.merge;
}
pause() {
this._isPaused++;
}
resume() {
if (this._isPaused !== 0 && --this._isPaused === 0) {
if (this._mergeFn) {
// use the merge function to create a single composite
// event. make a copy in case firing pauses this emitter
const events = Array.from(this._eventQueue);
this._eventQueue.clear();
super.fire(this._mergeFn(events));
}
else {
// no merging, fire each event individually and test
// that this emitter isn't paused halfway through
while (!this._isPaused && this._eventQueue.size !== 0) {
super.fire(this._eventQueue.shift());
}
}
}
}
fire(event) {
if (this._listeners) {
if (this._isPaused !== 0) {
this._eventQueue.push(event);
}
else {
super.fire(event);
}
}
}
}
class DebounceEmitter extends PauseableEmitter {
constructor(options) {
var _a;
super(options);
this._delay = (_a = options.delay) !== null && _a !== void 0 ? _a : 100;
}
fire(event) {
if (!this._handle) {
this.pause();
this._handle = setTimeout(() => {
this._handle = undefined;
this.resume();
}, this._delay);
}
super.fire(event);
}
}
/**
* The EventBufferer is useful in situations in which you want
* to delay firing your events during some code.
* You can wrap that code and be sure that the event will not
* be fired during that wrap.
*
* ```
* const emitter: Emitter;
* const delayer = new EventDelayer();
* const delayedEvent = delayer.wrapEvent(emitter.event);
*
* delayedEvent(console.log);
*
* delayer.bufferEvents(() => {
* emitter.fire(); // event will not be fired yet
* });
*
* // event will only be fired at this point
* ```
*/
class EventBufferer {
constructor() {
this.buffers = [];
}
wrapEvent(event) {
return (listener, thisArgs, disposables) => {
return event(i => {
const buffer = this.buffers[this.buffers.length - 1];
if (buffer) {
buffer.push(() => listener.call(thisArgs, i));
}
else {
listener.call(thisArgs, i);
}
}, undefined, disposables);
};
}
bufferEvents(fn) {
const buffer = [];
this.buffers.push(buffer);
const r = fn();
this.buffers.pop();
buffer.forEach(flush => flush());
return r;
}
}
/**
* A Relay is an event forwarder which functions as a replugabble event pipe.
* Once created, you can connect an input event to it and it will simply forward
* events from that input event through its own `event` property. The `input`
* can be changed at any point in time.
*/
class Relay {
constructor() {
this.listening = false;
this.inputEvent = Event.None;
this.inputEventListener = _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__/* .Disposable */ .JT.None;
this.emitter = new Emitter({
onFirstListenerDidAdd: () => {
this.listening = true;
this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter);
},
onLastListenerRemove: () => {
this.listening = false;
this.inputEventListener.dispose();
}
});
this.event = this.emitter.event;
}
set input(event) {
this.inputEvent = event;
if (this.listening) {
this.inputEventListener.dispose();
this.inputEventListener = event(this.emitter.fire, this.emitter);
}
}
dispose() {
this.inputEventListener.dispose();
this.emitter.dispose();
}
}
/***/ }),
/***/ 17845:
/*!*******************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/functional.js ***!
\*******************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ I: function() { return /* binding */ once; }
/* harmony export */ });
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
function once(fn) {
const _this = this;
let didCall = false;
let result;
return function () {
if (didCall) {
return result;
}
didCall = true;
result = fn.apply(_this, arguments);
return result;
};
}
/***/ }),
/***/ 88226:
/*!*****************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/iterator.js ***!
\*****************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ $: function() { return /* binding */ Iterable; }
/* harmony export */ });
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var Iterable;
(function (Iterable) {
function is(thing) {
return thing && typeof thing === 'object' && typeof thing[Symbol.iterator] === 'function';
}
Iterable.is = is;
const _empty = Object.freeze([]);
function empty() {
return _empty;
}
Iterable.empty = empty;
function* single(element) {
yield element;
}
Iterable.single = single;
function from(iterable) {
return iterable || _empty;
}
Iterable.from = from;
function isEmpty(iterable) {
return !iterable || iterable[Symbol.iterator]().next().done === true;
}
Iterable.isEmpty = isEmpty;
function first(iterable) {
return iterable[Symbol.iterator]().next().value;
}
Iterable.first = first;
function some(iterable, predicate) {
for (const element of iterable) {
if (predicate(element)) {
return true;
}
}
return false;
}
Iterable.some = some;
function find(iterable, predicate) {
for (const element of iterable) {
if (predicate(element)) {
return element;
}
}
return undefined;
}
Iterable.find = find;
function* filter(iterable, predicate) {
for (const element of iterable) {
if (predicate(element)) {
yield element;
}
}
}
Iterable.filter = filter;
function* map(iterable, fn) {
let index = 0;
for (const element of iterable) {
yield fn(element, index++);
}
}
Iterable.map = map;
function* concat(...iterables) {
for (const iterable of iterables) {
for (const element of iterable) {
yield element;
}
}
}
Iterable.concat = concat;
function* concatNested(iterables) {
for (const iterable of iterables) {
for (const element of iterable) {
yield element;
}
}
}
Iterable.concatNested = concatNested;
function reduce(iterable, reducer, initialValue) {
let value = initialValue;
for (const element of iterable) {
value = reducer(value, element);
}
return value;
}
Iterable.reduce = reduce;
/**
* Returns an iterable slice of the array, with the same semantics as `array.slice()`.
*/
function* slice(arr, from, to = arr.length) {
if (from < 0) {
from += arr.length;
}
if (to < 0) {
to += arr.length;
}
else if (to > arr.length) {
to = arr.length;
}
for (; from < to; from++) {
yield arr[from];
}
}
Iterable.slice = slice;
/**
* Consumes `atMost` elements from iterable and returns the consumed elements,
* and an iterable for the rest of the elements.
*/
function consume(iterable, atMost = Number.POSITIVE_INFINITY) {
const consumed = [];
if (atMost === 0) {
return [consumed, iterable];
}
const iterator = iterable[Symbol.iterator]();
for (let i = 0; i < atMost; i++) {
const next = iterator.next();
if (next.done) {
return [consumed, Iterable.empty()];
}
consumed.push(next.value);
}
return [consumed, { [Symbol.iterator]() { return iterator; } }];
}
Iterable.consume = consume;
/**
* Returns whether the iterables are the same length and all items are
* equal using the comparator function.
*/
function equals(a, b, comparator = (at, bt) => at === bt) {
const ai = a[Symbol.iterator]();
const bi = b[Symbol.iterator]();
while (true) {
const an = ai.next();
const bn = bi.next();
if (an.done !== bn.done) {
return false;
}
else if (an.done) {
return true;
}
else if (!comparator(an.value, bn.value)) {
return false;
}
}
}
Iterable.equals = equals;
})(Iterable || (Iterable = {}));
/***/ }),
/***/ 69323:
/*!******************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/lifecycle.js ***!
\******************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ B9: function() { return /* binding */ dispose; },
/* harmony export */ F8: function() { return /* binding */ combinedDisposable; },
/* harmony export */ JT: function() { return /* binding */ Disposable; },
/* harmony export */ Jz: function() { return /* binding */ ImmortalReference; },
/* harmony export */ OF: function() { return /* binding */ toDisposable; },
/* harmony export */ SL: function() { return /* binding */ DisposableStore; },
/* harmony export */ Wf: function() { return /* binding */ isDisposable; },
/* harmony export */ XK: function() { return /* binding */ MutableDisposable; },
/* harmony export */ dk: function() { return /* binding */ markAsSingleton; }
/* harmony export */ });
/* unused harmony exports setDisposableTracker, MultiDisposeError */
/* harmony import */ var _functional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functional.js */ 17845);
/* harmony import */ var _iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iterator.js */ 88226);
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/**
* Enables logging of potentially leaked disposables.
*
* A disposable is considered leaked if it is not disposed or not registered as the child of
* another disposable. This tracking is very simple an only works for classes that either
* extend Disposable or use a DisposableStore. This means there are a lot of false positives.
*/
const TRACK_DISPOSABLES = false;
let disposableTracker = null;
function setDisposableTracker(tracker) {
disposableTracker = tracker;
}
if (TRACK_DISPOSABLES) {
const __is_disposable_tracked__ = '__is_disposable_tracked__';
setDisposableTracker(new class {
trackDisposable(x) {
const stack = new Error('Potentially leaked disposable').stack;
setTimeout(() => {
if (!x[__is_disposable_tracked__]) {
console.log(stack);
}
}, 3000);
}
setParent(child, parent) {
if (child && child !== Disposable.None) {
try {
child[__is_disposable_tracked__] = true;
}
catch (_a) {
// noop
}
}
}
markAsDisposed(disposable) {
if (disposable && disposable !== Disposable.None) {
try {
disposable[__is_disposable_tracked__] = true;
}
catch (_a) {
// noop
}
}
}
markAsSingleton(disposable) { }
});
}
function trackDisposable(x) {
disposableTracker === null || disposableTracker === void 0 ? void 0 : disposableTracker.trackDisposable(x);
return x;
}
function markAsDisposed(disposable) {
disposableTracker === null || disposableTracker === void 0 ? void 0 : disposableTracker.markAsDisposed(disposable);
}
function setParentOfDisposable(child, parent) {
disposableTracker === null || disposableTracker === void 0 ? void 0 : disposableTracker.setParent(child, parent);
}
function setParentOfDisposables(children, parent) {
if (!disposableTracker) {
return;
}
for (const child of children) {
disposableTracker.setParent(child, parent);
}
}
/**
* Indicates that the given object is a singleton which does not need to be disposed.
*/
function markAsSingleton(singleton) {
disposableTracker === null || disposableTracker === void 0 ? void 0 : disposableTracker.markAsSingleton(singleton);
return singleton;
}
class MultiDisposeError extends Error {
constructor(errors) {
super(`Encountered errors while disposing of store. Errors: [${errors.join(', ')}]`);
this.errors = errors;
}
}
function isDisposable(thing) {
return typeof thing.dispose === 'function' && thing.dispose.length === 0;
}
function dispose(arg) {
if (_iterator_js__WEBPACK_IMPORTED_MODULE_0__/* .Iterable */ .$.is(arg)) {
let errors = [];
for (const d of arg) {
if (d) {
try {
d.dispose();
}
catch (e) {
errors.push(e);
}
}
}
if (errors.length === 1) {
throw errors[0];
}
else if (errors.length > 1) {
throw new MultiDisposeError(errors);
}
return Array.isArray(arg) ? [] : arg;
}
else if (arg) {
arg.dispose();
return arg;
}
}
function combinedDisposable(...disposables) {
const parent = toDisposable(() => dispose(disposables));
setParentOfDisposables(disposables, parent);
return parent;
}
function toDisposable(fn) {
const self = trackDisposable({
dispose: (0,_functional_js__WEBPACK_IMPORTED_MODULE_1__/* .once */ .I)(() => {
markAsDisposed(self);
fn();
})
});
return self;
}
class DisposableStore {
constructor() {
this._toDispose = new Set();
this._isDisposed = false;
trackDisposable(this);
}
/**
* Dispose of all registered disposables and mark this object as disposed.
*
* Any future disposables added to this object will be disposed of on `add`.
*/
dispose() {
if (this._isDisposed) {
return;
}
markAsDisposed(this);
this._isDisposed = true;
this.clear();
}
/**
* Dispose of all registered disposables but do not mark this object as disposed.
*/
clear() {
try {
dispose(this._toDispose.values());
}
finally {
this._toDispose.clear();
}
}
add(o) {
if (!o) {
return o;
}
if (o === this) {
throw new Error('Cannot register a disposable on itself!');
}
setParentOfDisposable(o, this);
if (this._isDisposed) {
if (!DisposableStore.DISABLE_DISPOSED_WARNING) {
console.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack);
}
}
else {
this._toDispose.add(o);
}
return o;
}
}
DisposableStore.DISABLE_DISPOSED_WARNING = false;
class Disposable {
constructor() {
this._store = new DisposableStore();
trackDisposable(this);
setParentOfDisposable(this._store, this);
}
dispose() {
markAsDisposed(this);
this._store.dispose();
}
_register(o) {
if (o === this) {
throw new Error('Cannot register a disposable on itself!');
}
return this._store.add(o);
}
}
Disposable.None = Object.freeze({ dispose() { } });
/**
* Manages the lifecycle of a disposable value that may be changed.
*
* This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can
* also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.
*/
class MutableDisposable {
constructor() {
this._isDisposed = false;
trackDisposable(this);
}
get value() {
return this._isDisposed ? undefined : this._value;
}
set value(value) {
var _a;
if (this._isDisposed || value === this._value) {
return;
}
(_a = this._value) === null || _a === void 0 ? void 0 : _a.dispose();
if (value) {
setParentOfDisposable(value, this);
}
this._value = value;
}
clear() {
this.value = undefined;
}
dispose() {
var _a;
this._isDisposed = true;
markAsDisposed(this);
(_a = this._value) === null || _a === void 0 ? void 0 : _a.dispose();
this._value = undefined;
}
/**
* Clears the value, but does not dispose it.
* The old value is returned.
*/
clearAndLeak() {
const oldValue = this._value;
this._value = undefined;
if (oldValue) {
setParentOfDisposable(oldValue, null);
}
return oldValue;
}
}
class ImmortalReference {
constructor(object) {
this.object = object;
}
dispose() { }
}
/***/ }),
/***/ 34502:
/*!*******************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/linkedList.js ***!
\*******************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ S: function() { return /* binding */ LinkedList; }
/* harmony export */ });
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
class Node {
constructor(element) {
this.element = element;
this.next = Node.Undefined;
this.prev = Node.Undefined;
}
}
Node.Undefined = new Node(undefined);
class LinkedList {
constructor() {
this._first = Node.Undefined;
this._last = Node.Undefined;
this._size = 0;
}
get size() {
return this._size;
}
isEmpty() {
return this._first === Node.Undefined;
}
clear() {
let node = this._first;
while (node !== Node.Undefined) {
const next = node.next;
node.prev = Node.Undefined;
node.next = Node.Undefined;
node = next;
}
this._first = Node.Undefined;
this._last = Node.Undefined;
this._size = 0;
}
unshift(element) {
return this._insert(element, false);
}
push(element) {
return this._insert(element, true);
}
_insert(element, atTheEnd) {
const newNode = new Node(element);
if (this._first === Node.Undefined) {
this._first = newNode;
this._last = newNode;
}
else if (atTheEnd) {
// push
const oldLast = this._last;
this._last = newNode;
newNode.prev = oldLast;
oldLast.next = newNode;
}
else {
// unshift
const oldFirst = this._first;
this._first = newNode;
newNode.next = oldFirst;
oldFirst.prev = newNode;
}
this._size += 1;
let didRemove = false;
return () => {
if (!didRemove) {
didRemove = true;
this._remove(newNode);
}
};
}
shift() {
if (this._first === Node.Undefined) {
return undefined;
}
else {
const res = this._first.element;
this._remove(this._first);
return res;
}
}
pop() {
if (this._last === Node.Undefined) {
return undefined;
}
else {
const res = this._last.element;
this._remove(this._last);
return res;
}
}
_remove(node) {
if (node.prev !== Node.Undefined && node.next !== Node.Undefined) {
// middle
const anchor = node.prev;
anchor.next = node.next;
node.next.prev = anchor;
}
else if (node.prev === Node.Undefined && node.next === Node.Undefined) {
// only node
this._first = Node.Undefined;
this._last = Node.Undefined;
}
else if (node.next === Node.Undefined) {
// last
this._last = this._last.prev;
this._last.next = Node.Undefined;
}
else if (node.prev === Node.Undefined) {
// first
this._first = this._first.next;
this._first.prev = Node.Undefined;
}
// done
this._size -= 1;
}
*[Symbol.iterator]() {
let node = this._first;
while (node !== Node.Undefined) {
yield node.element;
node = node.next;
}
}
}
/***/ }),
/***/ 23345:
/*!*****************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/platform.js ***!
\*****************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ $L: function() { return /* binding */ isWeb; },
/* harmony export */ ED: function() { return /* binding */ isWindows; },
/* harmony export */ IJ: function() { return /* binding */ isLinux; },
/* harmony export */ OS: function() { return /* binding */ OS; },
/* harmony export */ WE: function() { return /* binding */ userAgent; },
/* harmony export */ dz: function() { return /* binding */ isMacintosh; },
/* harmony export */ gn: function() { return /* binding */ isIOS; },
/* harmony export */ li: function() { return /* binding */ globals; },
/* harmony export */ r: function() { return /* binding */ isLittleEndian; },
/* harmony export */ tY: function() { return /* binding */ isNative; },
/* harmony export */ xS: function() { return /* binding */ setImmediate; }
/* harmony export */ });
/* provided dependency */ var process = __webpack_require__(/*! ./node_modules/_process@0.11.10@process/browser.js */ 97671);
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var _a;
const LANGUAGE_DEFAULT = 'en';
let _isWindows = false;
let _isMacintosh = false;
let _isLinux = false;
let _isLinuxSnap = false;
let _isNative = false;
let _isWeb = false;
let _isIOS = false;
let _locale = undefined;
let _language = (/* unused pure expression or super */ null && (LANGUAGE_DEFAULT));
let _translationsConfigFile = (/* unused pure expression or super */ null && (undefined));
let _userAgent = undefined;
const globals = (typeof self === 'object' ? self : typeof __webpack_require__.g === 'object' ? __webpack_require__.g : {});
let nodeProcess = undefined;
if (typeof globals.vscode !== 'undefined' && typeof globals.vscode.process !== 'undefined') {
// Native environment (sandboxed)
nodeProcess = globals.vscode.process;
}
else if (typeof process !== 'undefined') {
// Native environment (non-sandboxed)
nodeProcess = process;
}
const isElectronRenderer = typeof ((_a = nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.versions) === null || _a === void 0 ? void 0 : _a.electron) === 'string' && nodeProcess.type === 'renderer';
// Web environment
if (typeof navigator === 'object' && !isElectronRenderer) {
_userAgent = navigator.userAgent;
_isWindows = _userAgent.indexOf('Windows') >= 0;
_isMacintosh = _userAgent.indexOf('Macintosh') >= 0;
_isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;
_isLinux = _userAgent.indexOf('Linux') >= 0;
_isWeb = true;
_locale = navigator.language;
_language = _locale;
}
// Native environment
else if (typeof nodeProcess === 'object') {
_isWindows = (nodeProcess.platform === 'win32');
_isMacintosh = (nodeProcess.platform === 'darwin');
_isLinux = (nodeProcess.platform === 'linux');
_isLinuxSnap = _isLinux && !!nodeProcess.env['SNAP'] && !!nodeProcess.env['SNAP_REVISION'];
_locale = LANGUAGE_DEFAULT;
_language = LANGUAGE_DEFAULT;
const rawNlsConfig = nodeProcess.env['VSCODE_NLS_CONFIG'];
if (rawNlsConfig) {
try {
const nlsConfig = JSON.parse(rawNlsConfig);
const resolved = nlsConfig.availableLanguages['*'];
_locale = nlsConfig.locale;
// VSCode's default language is 'en'
_language = resolved ? resolved : LANGUAGE_DEFAULT;
_translationsConfigFile = nlsConfig._translationsConfigFile;
}
catch (e) {
}
}
_isNative = true;
}
// Unknown environment
else {
console.error('Unable to resolve platform.');
}
let _platform = 0 /* Web */;
if (_isMacintosh) {
_platform = 1 /* Mac */;
}
else if (_isWindows) {
_platform = 3 /* Windows */;
}
else if (_isLinux) {
_platform = 2 /* Linux */;
}
const isWindows = _isWindows;
const isMacintosh = _isMacintosh;
const isLinux = _isLinux;
const isNative = _isNative;
const isWeb = _isWeb;
const isIOS = _isIOS;
const userAgent = _userAgent;
const setImmediate = (function defineSetImmediate() {
if (globals.setImmediate) {
return globals.setImmediate.bind(globals);
}
if (typeof globals.postMessage === 'function' && !globals.importScripts) {
let pending = [];
globals.addEventListener('message', (e) => {
if (e.data && e.data.vscodeSetImmediateId) {
for (let i = 0, len = pending.length; i < len; i++) {
const candidate = pending[i];
if (candidate.id === e.data.vscodeSetImmediateId) {
pending.splice(i, 1);
candidate.callback();
return;
}
}
}
});
let lastId = 0;
return (callback) => {
const myId = ++lastId;
pending.push({
id: myId,
callback: callback
});
globals.postMessage({ vscodeSetImmediateId: myId }, '*');
};
}
if (typeof (nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.nextTick) === 'function') {
return nodeProcess.nextTick.bind(nodeProcess);
}
const _promise = Promise.resolve();
return (callback) => _promise.then(callback);
})();
const OS = (_isMacintosh || _isIOS ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */));
let _isLittleEndian = true;
let _isLittleEndianComputed = false;
function isLittleEndian() {
if (!_isLittleEndianComputed) {
_isLittleEndianComputed = true;
const test = new Uint8Array(2);
test[0] = 1;
test[1] = 2;
const view = new Uint16Array(test.buffer);
_isLittleEndian = (view[0] === (2 << 8) + 1);
}
return _isLittleEndian;
}
/***/ }),
/***/ 95830:
/*!******************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/stopwatch.js ***!
\******************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ G: function() { return /* binding */ StopWatch; }
/* harmony export */ });
/* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ 23345);
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const hasPerformanceNow = (_platform_js__WEBPACK_IMPORTED_MODULE_0__/* .globals */ .li.performance && typeof _platform_js__WEBPACK_IMPORTED_MODULE_0__/* .globals */ .li.performance.now === 'function');
class StopWatch {
constructor(highResolution) {
this._highResolution = hasPerformanceNow && highResolution;
this._startTime = this._now();
this._stopTime = -1;
}
static create(highResolution = true) {
return new StopWatch(highResolution);
}
stop() {
this._stopTime = this._now();
}
elapsed() {
if (this._stopTime !== -1) {
return this._stopTime - this._startTime;
}
return this._now() - this._startTime;
}
_now() {
return this._highResolution ? _platform_js__WEBPACK_IMPORTED_MODULE_0__/* .globals */ .li.performance.now() : Date.now();
}
}
/***/ }),
/***/ 82983:
/*!****************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/strings.js ***!
\****************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ $i: function() { return /* binding */ isBasicASCII; },
/* harmony export */ C8: function() { return /* binding */ isEmojiImprecise; },
/* harmony export */ GF: function() { return /* binding */ createRegExp; },
/* harmony export */ HO: function() { return /* binding */ prevCharLength; },
/* harmony export */ IO: function() { return /* binding */ regExpLeadsToEndlessLoop; },
/* harmony export */ K7: function() { return /* binding */ isFullWidthCharacter; },
/* harmony export */ Kw: function() { return /* binding */ containsUppercaseCharacter; },
/* harmony export */ LC: function() { return /* binding */ firstNonWhitespaceIndex; },
/* harmony export */ Mh: function() { return /* binding */ commonPrefixLength; },
/* harmony export */ P1: function() { return /* binding */ commonSuffixLength; },
/* harmony export */ PJ: function() { return /* binding */ singleLetterHash; },
/* harmony export */ Qe: function() { return /* binding */ UNUSUAL_LINE_TERMINATORS; },
/* harmony export */ R1: function() { return /* binding */ stripWildcards; },
/* harmony export */ RP: function() { return /* binding */ containsEmoji; },
/* harmony export */ S6: function() { return /* binding */ getGraphemeBreakType; },
/* harmony export */ TT: function() { return /* binding */ compareSubstring; },
/* harmony export */ Ut: function() { return /* binding */ containsRTL; },
/* harmony export */ V8: function() { return /* binding */ getLeadingWhitespace; },
/* harmony export */ WU: function() { return /* binding */ format; },
/* harmony export */ YK: function() { return /* binding */ isLowSurrogate; },
/* harmony export */ YU: function() { return /* binding */ escape; },
/* harmony export */ ZG: function() { return /* binding */ isHighSurrogate; },
/* harmony export */ ZH: function() { return /* binding */ getNextCodePoint; },
/* harmony export */ ab: function() { return /* binding */ containsUnusualLineTerminators; },
/* harmony export */ c1: function() { return /* binding */ UTF8_BOM_CHARACTER; },
/* harmony export */ df: function() { return /* binding */ isUpperAsciiLetter; },
/* harmony export */ ec: function() { return /* binding */ escapeRegExpCharacters; },
/* harmony export */ fi: function() { return /* binding */ breakBetweenGraphemeBreakType; },
/* harmony export */ fy: function() { return /* binding */ trim; },
/* harmony export */ j3: function() { return /* binding */ ltrim; },
/* harmony export */ j_: function() { return /* binding */ compareSubstringIgnoreCase; },
/* harmony export */ m5: function() { return /* binding */ isFalsyOrWhitespace; },
/* harmony export */ mK: function() { return /* binding */ isLowerAsciiLetter; },
/* harmony export */ mr: function() { return /* binding */ regExpFlags; },
/* harmony export */ oH: function() { return /* binding */ getLeftDeleteOffset; },
/* harmony export */ oL: function() { return /* binding */ rtrim; },
/* harmony export */ ok: function() { return /* binding */ startsWithIgnoreCase; },
/* harmony export */ ow: function() { return /* binding */ lastNonWhitespaceIndex; },
/* harmony export */ qq: function() { return /* binding */ equalsIgnoreCase; },
/* harmony export */ qu: function() { return /* binding */ compare; },
/* harmony export */ rL: function() { return /* binding */ computeCodePoint; },
/* harmony export */ uS: function() { return /* binding */ startsWithUTF8BOM; },
/* harmony export */ un: function() { return /* binding */ convertSimple2RegExpPattern; },
/* harmony export */ uq: function() { return /* binding */ splitLines; },
/* harmony export */ vH: function() { return /* binding */ nextCharLength; },
/* harmony export */ xe: function() { return /* binding */ containsFullWidthCharacter; },
/* harmony export */ zY: function() { return /* binding */ compareIgnoreCase; }
/* harmony export */ });
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
function isFalsyOrWhitespace(str) {
if (!str || typeof str !== 'string') {
return true;
}
return str.trim().length === 0;
}
const _formatRegexp = /{(\d+)}/g;
/**
* Helper to produce a string with a variable number of arguments. Insert variable segments
* into the string using the {n} notation where N is the index of the argument following the string.
* @param value string to which formatting is applied
* @param args replacements for {n}-entries
*/
function format(value, ...args) {
if (args.length === 0) {
return value;
}
return value.replace(_formatRegexp, function (match, group) {
const idx = parseInt(group, 10);
return isNaN(idx) || idx < 0 || idx >= args.length ?
match :
args[idx];
});
}
/**
* Converts HTML characters inside the string to use entities instead. Makes the string safe from
* being used e.g. in HTMLElement.innerHTML.
*/
function escape(html) {
return html.replace(/[<>&]/g, function (match) {
switch (match) {
case '<': return '&lt;';
case '>': return '&gt;';
case '&': return '&amp;';
default: return match;
}
});
}
/**
* Escapes regular expression characters in a given string
*/
function escapeRegExpCharacters(value) {
return value.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, '\\$&');
}
/**
* Removes all occurrences of needle from the beginning and end of haystack.
* @param haystack string to trim
* @param needle the thing to trim (default is a blank)
*/
function trim(haystack, needle = ' ') {
const trimmed = ltrim(haystack, needle);
return rtrim(trimmed, needle);
}
/**
* Removes all occurrences of needle from the beginning of haystack.
* @param haystack string to trim
* @param needle the thing to trim
*/
function ltrim(haystack, needle) {
if (!haystack || !needle) {
return haystack;
}
const needleLen = needle.length;
if (needleLen === 0 || haystack.length === 0) {
return haystack;
}
let offset = 0;
while (haystack.indexOf(needle, offset) === offset) {
offset = offset + needleLen;
}
return haystack.substring(offset);
}
/**
* Removes all occurrences of needle from the end of haystack.
* @param haystack string to trim
* @param needle the thing to trim
*/
function rtrim(haystack, needle) {
if (!haystack || !needle) {
return haystack;
}
const needleLen = needle.length, haystackLen = haystack.length;
if (needleLen === 0 || haystackLen === 0) {
return haystack;
}
let offset = haystackLen, idx = -1;
while (true) {
idx = haystack.lastIndexOf(needle, offset - 1);
if (idx === -1 || idx + needleLen !== offset) {
break;
}
if (idx === 0) {
return '';
}
offset = idx;
}
return haystack.substring(0, offset);
}
function convertSimple2RegExpPattern(pattern) {
return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&').replace(/[\*]/g, '.*');
}
function stripWildcards(pattern) {
return pattern.replace(/\*/g, '');
}
function createRegExp(searchString, isRegex, options = {}) {
if (!searchString) {
throw new Error('Cannot create regex from empty string');
}
if (!isRegex) {
searchString = escapeRegExpCharacters(searchString);
}
if (options.wholeWord) {
if (!/\B/.test(searchString.charAt(0))) {
searchString = '\\b' + searchString;
}
if (!/\B/.test(searchString.charAt(searchString.length - 1))) {
searchString = searchString + '\\b';
}
}
let modifiers = '';
if (options.global) {
modifiers += 'g';
}
if (!options.matchCase) {
modifiers += 'i';
}
if (options.multiline) {
modifiers += 'm';
}
if (options.unicode) {
modifiers += 'u';
}
return new RegExp(searchString, modifiers);
}
function regExpLeadsToEndlessLoop(regexp) {
// Exit early if it's one of these special cases which are meant to match
// against an empty string
if (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$' || regexp.source === '^\\s*$') {
return false;
}
// We check against an empty string. If the regular expression doesn't advance
// (e.g. ends in an endless loop) it will match an empty string.
const match = regexp.exec('');
return !!(match && regexp.lastIndex === 0);
}
function regExpFlags(regexp) {
return (regexp.global ? 'g' : '')
+ (regexp.ignoreCase ? 'i' : '')
+ (regexp.multiline ? 'm' : '')
+ (regexp /* standalone editor compilation */.unicode ? 'u' : '');
}
function splitLines(str) {
return str.split(/\r\n|\r|\n/);
}
/**
* Returns first index of the string that is not whitespace.
* If string is empty or contains only whitespaces, returns -1
*/
function firstNonWhitespaceIndex(str) {
for (let i = 0, len = str.length; i < len; i++) {
const chCode = str.charCodeAt(i);
if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {
return i;
}
}
return -1;
}
/**
* Returns the leading whitespace of the string.
* If the string contains only whitespaces, returns entire string
*/
function getLeadingWhitespace(str, start = 0, end = str.length) {
for (let i = start; i < end; i++) {
const chCode = str.charCodeAt(i);
if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {
return str.substring(start, i);
}
}
return str.substring(start, end);
}
/**
* Returns last index of the string that is not whitespace.
* If string is empty or contains only whitespaces, returns -1
*/
function lastNonWhitespaceIndex(str, startIndex = str.length - 1) {
for (let i = startIndex; i >= 0; i--) {
const chCode = str.charCodeAt(i);
if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {
return i;
}
}
return -1;
}
function compare(a, b) {
if (a < b) {
return -1;
}
else if (a > b) {
return 1;
}
else {
return 0;
}
}
function compareSubstring(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) {
for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) {
let codeA = a.charCodeAt(aStart);
let codeB = b.charCodeAt(bStart);
if (codeA < codeB) {
return -1;
}
else if (codeA > codeB) {
return 1;
}
}
const aLen = aEnd - aStart;
const bLen = bEnd - bStart;
if (aLen < bLen) {
return -1;
}
else if (aLen > bLen) {
return 1;
}
return 0;
}
function compareIgnoreCase(a, b) {
return compareSubstringIgnoreCase(a, b, 0, a.length, 0, b.length);
}
function compareSubstringIgnoreCase(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) {
for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) {
let codeA = a.charCodeAt(aStart);
let codeB = b.charCodeAt(bStart);
if (codeA === codeB) {
// equal
continue;
}
if (codeA >= 128 || codeB >= 128) {
// not ASCII letters -> fallback to lower-casing strings
return compareSubstring(a.toLowerCase(), b.toLowerCase(), aStart, aEnd, bStart, bEnd);
}
// mapper lower-case ascii letter onto upper-case varinats
// [97-122] (lower ascii) --> [65-90] (upper ascii)
if (isLowerAsciiLetter(codeA)) {
codeA -= 32;
}
if (isLowerAsciiLetter(codeB)) {
codeB -= 32;
}
// compare both code points
const diff = codeA - codeB;
if (diff === 0) {
continue;
}
return diff;
}
const aLen = aEnd - aStart;
const bLen = bEnd - bStart;
if (aLen < bLen) {
return -1;
}
else if (aLen > bLen) {
return 1;
}
return 0;
}
function isLowerAsciiLetter(code) {
return code >= 97 /* a */ && code <= 122 /* z */;
}
function isUpperAsciiLetter(code) {
return code >= 65 /* A */ && code <= 90 /* Z */;
}
function equalsIgnoreCase(a, b) {
return a.length === b.length && compareSubstringIgnoreCase(a, b) === 0;
}
function startsWithIgnoreCase(str, candidate) {
const candidateLength = candidate.length;
if (candidate.length > str.length) {
return false;
}
return compareSubstringIgnoreCase(str, candidate, 0, candidateLength) === 0;
}
/**
* @returns the length of the common prefix of the two strings.
*/
function commonPrefixLength(a, b) {
let i, len = Math.min(a.length, b.length);
for (i = 0; i < len; i++) {
if (a.charCodeAt(i) !== b.charCodeAt(i)) {
return i;
}
}
return len;
}
/**
* @returns the length of the common suffix of the two strings.
*/
function commonSuffixLength(a, b) {
let i, len = Math.min(a.length, b.length);
const aLastIndex = a.length - 1;
const bLastIndex = b.length - 1;
for (i = 0; i < len; i++) {
if (a.charCodeAt(aLastIndex - i) !== b.charCodeAt(bLastIndex - i)) {
return i;
}
}
return len;
}
/**
* See http://en.wikipedia.org/wiki/Surrogate_pair
*/
function isHighSurrogate(charCode) {
return (0xD800 <= charCode && charCode <= 0xDBFF);
}
/**
* See http://en.wikipedia.org/wiki/Surrogate_pair
*/
function isLowSurrogate(charCode) {
return (0xDC00 <= charCode && charCode <= 0xDFFF);
}
/**
* See http://en.wikipedia.org/wiki/Surrogate_pair
*/
function computeCodePoint(highSurrogate, lowSurrogate) {
return ((highSurrogate - 0xD800) << 10) + (lowSurrogate - 0xDC00) + 0x10000;
}
/**
* get the code point that begins at offset `offset`
*/
function getNextCodePoint(str, len, offset) {
const charCode = str.charCodeAt(offset);
if (isHighSurrogate(charCode) && offset + 1 < len) {
const nextCharCode = str.charCodeAt(offset + 1);
if (isLowSurrogate(nextCharCode)) {
return computeCodePoint(charCode, nextCharCode);
}
}
return charCode;
}
/**
* get the code point that ends right before offset `offset`
*/
function getPrevCodePoint(str, offset) {
const charCode = str.charCodeAt(offset - 1);
if (isLowSurrogate(charCode) && offset > 1) {
const prevCharCode = str.charCodeAt(offset - 2);
if (isHighSurrogate(prevCharCode)) {
return computeCodePoint(prevCharCode, charCode);
}
}
return charCode;
}
function nextCharLength(str, offset) {
const graphemeBreakTree = GraphemeBreakTree.getInstance();
const initialOffset = offset;
const len = str.length;
const initialCodePoint = getNextCodePoint(str, len, offset);
offset += (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);
let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint);
while (offset < len) {
const nextCodePoint = getNextCodePoint(str, len, offset);
const nextGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(nextCodePoint);
if (breakBetweenGraphemeBreakType(graphemeBreakType, nextGraphemeBreakType)) {
break;
}
offset += (nextCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);
graphemeBreakType = nextGraphemeBreakType;
}
return (offset - initialOffset);
}
function prevCharLength(str, offset) {
const graphemeBreakTree = GraphemeBreakTree.getInstance();
const initialOffset = offset;
const initialCodePoint = getPrevCodePoint(str, offset);
offset -= (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);
let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint);
while (offset > 0) {
const prevCodePoint = getPrevCodePoint(str, offset);
const prevGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(prevCodePoint);
if (breakBetweenGraphemeBreakType(prevGraphemeBreakType, graphemeBreakType)) {
break;
}
offset -= (prevCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);
graphemeBreakType = prevGraphemeBreakType;
}
return (initialOffset - offset);
}
/**
* Generated using https://github.com/alexdima/unicode-utils/blob/master/generate-rtl-test.js
*/
const CONTAINS_RTL = /(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;
/**
* Returns true if `str` contains any Unicode character that is classified as "R" or "AL".
*/
function containsRTL(str) {
return CONTAINS_RTL.test(str);
}
/**
* Generated using https://github.com/alexdima/unicode-utils/blob/master/generate-emoji-test.js
*/
const CONTAINS_EMOJI = /(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;
function containsEmoji(str) {
return CONTAINS_EMOJI.test(str);
}
const IS_BASIC_ASCII = /^[\t\n\r\x20-\x7E]*$/;
/**
* Returns true if `str` contains only basic ASCII characters in the range 32 - 126 (including 32 and 126) or \n, \r, \t
*/
function isBasicASCII(str) {
return IS_BASIC_ASCII.test(str);
}
const UNUSUAL_LINE_TERMINATORS = /[\u2028\u2029]/; // LINE SEPARATOR (LS) or PARAGRAPH SEPARATOR (PS)
/**
* Returns true if `str` contains unusual line terminators, like LS or PS
*/
function containsUnusualLineTerminators(str) {
return UNUSUAL_LINE_TERMINATORS.test(str);
}
function containsFullWidthCharacter(str) {
for (let i = 0, len = str.length; i < len; i++) {
if (isFullWidthCharacter(str.charCodeAt(i))) {
return true;
}
}
return false;
}
function isFullWidthCharacter(charCode) {
// Do a cheap trick to better support wrapping of wide characters, treat them as 2 columns
// http://jrgraphix.net/research/unicode_blocks.php
// 2E80 — 2EFF CJK Radicals Supplement
// 2F00 — 2FDF Kangxi Radicals
// 2FF0 — 2FFF Ideographic Description Characters
// 3000 — 303F CJK Symbols and Punctuation
// 3040 — 309F Hiragana
// 30A0 — 30FF Katakana
// 3100 — 312F Bopomofo
// 3130 — 318F Hangul Compatibility Jamo
// 3190 — 319F Kanbun
// 31A0 — 31BF Bopomofo Extended
// 31F0 — 31FF Katakana Phonetic Extensions
// 3200 — 32FF Enclosed CJK Letters and Months
// 3300 — 33FF CJK Compatibility
// 3400 — 4DBF CJK Unified Ideographs Extension A
// 4DC0 — 4DFF Yijing Hexagram Symbols
// 4E00 — 9FFF CJK Unified Ideographs
// A000 — A48F Yi Syllables
// A490 — A4CF Yi Radicals
// AC00 — D7AF Hangul Syllables
// [IGNORE] D800 — DB7F High Surrogates
// [IGNORE] DB80 — DBFF High Private Use Surrogates
// [IGNORE] DC00 — DFFF Low Surrogates
// [IGNORE] E000 — F8FF Private Use Area
// F900 — FAFF CJK Compatibility Ideographs
// [IGNORE] FB00 — FB4F Alphabetic Presentation Forms
// [IGNORE] FB50 — FDFF Arabic Presentation Forms-A
// [IGNORE] FE00 — FE0F Variation Selectors
// [IGNORE] FE20 — FE2F Combining Half Marks
// [IGNORE] FE30 — FE4F CJK Compatibility Forms
// [IGNORE] FE50 — FE6F Small Form Variants
// [IGNORE] FE70 — FEFF Arabic Presentation Forms-B
// FF00 — FFEF Halfwidth and Fullwidth Forms
// [https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms]
// of which FF01 - FF5E fullwidth ASCII of 21 to 7E
// [IGNORE] and FF65 - FFDC halfwidth of Katakana and Hangul
// [IGNORE] FFF0 — FFFF Specials
charCode = +charCode; // @perf
return ((charCode >= 0x2E80 && charCode <= 0xD7AF)
|| (charCode >= 0xF900 && charCode <= 0xFAFF)
|| (charCode >= 0xFF01 && charCode <= 0xFF5E));
}
/**
* A fast function (therefore imprecise) to check if code points are emojis.
* Generated using https://github.com/alexdima/unicode-utils/blob/master/generate-emoji-test.js
*/
function isEmojiImprecise(x) {
return ((x >= 0x1F1E6 && x <= 0x1F1FF) || (x === 8986) || (x === 8987) || (x === 9200)
|| (x === 9203) || (x >= 9728 && x <= 10175) || (x === 11088) || (x === 11093)
|| (x >= 127744 && x <= 128591) || (x >= 128640 && x <= 128764)
|| (x >= 128992 && x <= 129003) || (x >= 129280 && x <= 129535)
|| (x >= 129648 && x <= 129750));
}
// -- UTF-8 BOM
const UTF8_BOM_CHARACTER = String.fromCharCode(65279 /* UTF8_BOM */);
function startsWithUTF8BOM(str) {
return !!(str && str.length > 0 && str.charCodeAt(0) === 65279 /* UTF8_BOM */);
}
function containsUppercaseCharacter(target, ignoreEscapedChars = false) {
if (!target) {
return false;
}
if (ignoreEscapedChars) {
target = target.replace(/\\./g, '');
}
return target.toLowerCase() !== target;
}
/**
* Produces 'a'-'z', followed by 'A'-'Z'... followed by 'a'-'z', etc.
*/
function singleLetterHash(n) {
const LETTERS_CNT = (90 /* Z */ - 65 /* A */ + 1);
n = n % (2 * LETTERS_CNT);
if (n < LETTERS_CNT) {
return String.fromCharCode(97 /* a */ + n);
}
return String.fromCharCode(65 /* A */ + n - LETTERS_CNT);
}
//#region Unicode Grapheme Break
function getGraphemeBreakType(codePoint) {
const graphemeBreakTree = GraphemeBreakTree.getInstance();
return graphemeBreakTree.getGraphemeBreakType(codePoint);
}
function breakBetweenGraphemeBreakType(breakTypeA, breakTypeB) {
// http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules
// !!! Let's make the common case a bit faster
if (breakTypeA === 0 /* Other */) {
// see https://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakTest-13.0.0d10.html#table
return (breakTypeB !== 5 /* Extend */ && breakTypeB !== 7 /* SpacingMark */);
}
// Do not break between a CR and LF. Otherwise, break before and after controls.
// GB3 CR × LF
// GB4 (Control | CR | LF) ÷
// GB5 ÷ (Control | CR | LF)
if (breakTypeA === 2 /* CR */) {
if (breakTypeB === 3 /* LF */) {
return false; // GB3
}
}
if (breakTypeA === 4 /* Control */ || breakTypeA === 2 /* CR */ || breakTypeA === 3 /* LF */) {
return true; // GB4
}
if (breakTypeB === 4 /* Control */ || breakTypeB === 2 /* CR */ || breakTypeB === 3 /* LF */) {
return true; // GB5
}
// Do not break Hangul syllable sequences.
// GB6 L × (L | V | LV | LVT)
// GB7 (LV | V) × (V | T)
// GB8 (LVT | T) × T
if (breakTypeA === 8 /* L */) {
if (breakTypeB === 8 /* L */ || breakTypeB === 9 /* V */ || breakTypeB === 11 /* LV */ || breakTypeB === 12 /* LVT */) {
return false; // GB6
}
}
if (breakTypeA === 11 /* LV */ || breakTypeA === 9 /* V */) {
if (breakTypeB === 9 /* V */ || breakTypeB === 10 /* T */) {
return false; // GB7
}
}
if (breakTypeA === 12 /* LVT */ || breakTypeA === 10 /* T */) {
if (breakTypeB === 10 /* T */) {
return false; // GB8
}
}
// Do not break before extending characters or ZWJ.
// GB9 × (Extend | ZWJ)
if (breakTypeB === 5 /* Extend */ || breakTypeB === 13 /* ZWJ */) {
return false; // GB9
}
// The GB9a and GB9b rules only apply to extended grapheme clusters:
// Do not break before SpacingMarks, or after Prepend characters.
// GB9a × SpacingMark
// GB9b Prepend ×
if (breakTypeB === 7 /* SpacingMark */) {
return false; // GB9a
}
if (breakTypeA === 1 /* Prepend */) {
return false; // GB9b
}
// Do not break within emoji modifier sequences or emoji zwj sequences.
// GB11 \p{Extended_Pictographic} Extend* ZWJ × \p{Extended_Pictographic}
if (breakTypeA === 13 /* ZWJ */ && breakTypeB === 14 /* Extended_Pictographic */) {
// Note: we are not implementing the rule entirely here to avoid introducing states
return false; // GB11
}
// GB12 sot (RI RI)* RI × RI
// GB13 [^RI] (RI RI)* RI × RI
if (breakTypeA === 6 /* Regional_Indicator */ && breakTypeB === 6 /* Regional_Indicator */) {
// Note: we are not implementing the rule entirely here to avoid introducing states
return false; // GB12 & GB13
}
// GB999 Any ÷ Any
return true;
}
class GraphemeBreakTree {
constructor() {
this._data = getGraphemeBreakRawData();
}
static getInstance() {
if (!GraphemeBreakTree._INSTANCE) {
GraphemeBreakTree._INSTANCE = new GraphemeBreakTree();
}
return GraphemeBreakTree._INSTANCE;
}
getGraphemeBreakType(codePoint) {
// !!! Let's make 7bit ASCII a bit faster: 0..31
if (codePoint < 32) {
if (codePoint === 10 /* LineFeed */) {
return 3 /* LF */;
}
if (codePoint === 13 /* CarriageReturn */) {
return 2 /* CR */;
}
return 4 /* Control */;
}
// !!! Let's make 7bit ASCII a bit faster: 32..126
if (codePoint < 127) {
return 0 /* Other */;
}
const data = this._data;
const nodeCount = data.length / 3;
let nodeIndex = 1;
while (nodeIndex <= nodeCount) {
if (codePoint < data[3 * nodeIndex]) {
// go left
nodeIndex = 2 * nodeIndex;
}
else if (codePoint > data[3 * nodeIndex + 1]) {
// go right
nodeIndex = 2 * nodeIndex + 1;
}
else {
// hit
return data[3 * nodeIndex + 2];
}
}
return 0 /* Other */;
}
}
GraphemeBreakTree._INSTANCE = null;
function getGraphemeBreakRawData() {
// generated using https://github.com/alexdima/unicode-utils/blob/master/generate-grapheme-break.js
return JSON.parse('[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]');
}
//#endregion
/**
* Computes the offset after performing a left delete on the given string,
* while considering unicode grapheme/emoji rules.
*/
function getLeftDeleteOffset(offset, str) {
if (offset === 0) {
return 0;
}
// Try to delete emoji part.
const emojiOffset = getOffsetBeforeLastEmojiComponent(offset, str);
if (emojiOffset !== undefined) {
return emojiOffset;
}
// Otherwise, just skip a single code point.
const codePoint = getPrevCodePoint(str, offset);
offset -= getUTF16Length(codePoint);
return offset;
}
function getOffsetBeforeLastEmojiComponent(offset, str) {
// See https://www.unicode.org/reports/tr51/tr51-14.html#EBNF_and_Regex for the
// structure of emojis.
let codePoint = getPrevCodePoint(str, offset);
offset -= getUTF16Length(codePoint);
// Skip modifiers
while ((isEmojiModifier(codePoint) || codePoint === 65039 /* emojiVariantSelector */ || codePoint === 8419 /* enclosingKeyCap */)) {
if (offset === 0) {
// Cannot skip modifier, no preceding emoji base.
return undefined;
}
codePoint = getPrevCodePoint(str, offset);
offset -= getUTF16Length(codePoint);
}
// Expect base emoji
if (!isEmojiImprecise(codePoint)) {
// Unexpected code point, not a valid emoji.
return undefined;
}
if (offset >= 0) {
// Skip optional ZWJ code points that combine multiple emojis.
// In theory, we should check if that ZWJ actually combines multiple emojis
// to prevent deleting ZWJs in situations we didn't account for.
const optionalZwjCodePoint = getPrevCodePoint(str, offset);
if (optionalZwjCodePoint === 8205 /* zwj */) {
offset -= getUTF16Length(optionalZwjCodePoint);
}
}
return offset;
}
function getUTF16Length(codePoint) {
return codePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1;
}
function isEmojiModifier(codePoint) {
return 0x1F3FB <= codePoint && codePoint <= 0x1F3FF;
}
/***/ }),
/***/ 72999:
/*!**************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/base/common/types.js ***!
\**************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ $E: function() { return /* binding */ getAllMethodNames; },
/* harmony export */ $K: function() { return /* binding */ isDefined; },
/* harmony export */ D8: function() { return /* binding */ validateConstraints; },
/* harmony export */ HD: function() { return /* binding */ isString; },
/* harmony export */ IU: function() { return /* binding */ createProxyObject; },
/* harmony export */ Jp: function() { return /* binding */ isUndefinedOrNull; },
/* harmony export */ Kn: function() { return /* binding */ isObject; },
/* harmony export */ cW: function() { return /* binding */ assertIsDefined; },
/* harmony export */ f6: function() { return /* binding */ withNullAsUndefined; },
/* harmony export */ hj: function() { return /* binding */ isNumber; },
/* harmony export */ jn: function() { return /* binding */ isBoolean; },
/* harmony export */ kJ: function() { return /* binding */ isArray; },
/* harmony export */ mf: function() { return /* binding */ isFunction; },
/* harmony export */ o8: function() { return /* binding */ isUndefined; },
/* harmony export */ p_: function() { return /* binding */ assertType; },
/* harmony export */ vE: function() { return /* binding */ assertNever; }
/* harmony export */ });
/* unused harmony exports validateConstraint, getAllPropertyNames */
/**
* @returns whether the provided parameter is a JavaScript Array or not.
*/
function isArray(array) {
return Array.isArray(array);
}
/**
* @returns whether the provided parameter is a JavaScript String or not.
*/
function isString(str) {
return (typeof str === 'string');
}
/**
*
* @returns whether the provided parameter is of type `object` but **not**
* `null`, an `array`, a `regexp`, nor a `date`.
*/
function isObject(obj) {
// The method can't do a type cast since there are type (like strings) which
// are subclasses of any put not positvely matched by the function. Hence type
// narrowing results in wrong results.
return typeof obj === 'object'
&& obj !== null
&& !Array.isArray(obj)
&& !(obj instanceof RegExp)
&& !(obj instanceof Date);
}
/**
* In **contrast** to just checking `typeof` this will return `false` for `NaN`.
* @returns whether the provided parameter is a JavaScript Number or not.
*/
function isNumber(obj) {
return (typeof obj === 'number' && !isNaN(obj));
}
/**
* @returns whether the provided parameter is a JavaScript Boolean or not.
*/
function isBoolean(obj) {
return (obj === true || obj === false);
}
/**
* @returns whether the provided parameter is undefined.
*/
function isUndefined(obj) {
return (typeof obj === 'undefined');
}
/**
* @returns whether the provided parameter is defined.
*/
function isDefined(arg) {
return !isUndefinedOrNull(arg);
}
/**
* @returns whether the provided parameter is undefined or null.
*/
function isUndefinedOrNull(obj) {
return (isUndefined(obj) || obj === null);
}
function assertType(condition, type) {
if (!condition) {
throw new Error(type ? `Unexpected type, expected '${type}'` : 'Unexpected type');
}
}
/**
* Asserts that the argument passed in is neither undefined nor null.
*/
function assertIsDefined(arg) {
if (isUndefinedOrNull(arg)) {
throw new Error('Assertion Failed: argument is undefined or null');
}
return arg;
}
/**
* @returns whether the provided parameter is a JavaScript Function or not.
*/
function isFunction(obj) {
return (typeof obj === 'function');
}
function validateConstraints(args, constraints) {
const len = Math.min(args.length, constraints.length);
for (let i = 0; i < len; i++) {
validateConstraint(args[i], constraints[i]);
}
}
function validateConstraint(arg, constraint) {
if (isString(constraint)) {
if (typeof arg !== constraint) {
throw new Error(`argument does not match constraint: typeof ${constraint}`);
}
}
else if (isFunction(constraint)) {
try {
if (arg instanceof constraint) {
return;
}
}
catch (_a) {
// ignore
}
if (!isUndefinedOrNull(arg) && arg.constructor === constraint) {
return;
}
if (constraint.length === 1 && constraint.call(undefined, arg) === true) {
return;
}
throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`);
}
}
function getAllPropertyNames(obj) {
let res = [];
let proto = Object.getPrototypeOf(obj);
while (Object.prototype !== proto) {
res = res.concat(Object.getOwnPropertyNames(proto));
proto = Object.getPrototypeOf(proto);
}
return res;
}
function getAllMethodNames(obj) {
const methods = [];
for (const prop of getAllPropertyNames(obj)) {
if (typeof obj[prop] === 'function') {
methods.push(prop);
}
}
return methods;
}
function createProxyObject(methodNames, invoke) {
const createProxyMethod = (method) => {
return function () {
const args = Array.prototype.slice.call(arguments, 0);
return invoke(method, args);
};
};
let result = {};
for (const methodName of methodNames) {
result[methodName] = createProxyMethod(methodName);
}
return result;
}
/**
* Converts null to undefined, passes all other values through.
*/
function withNullAsUndefined(x) {
return x === null ? undefined : x;
}
function assertNever(value, message = 'Unreachable') {
throw new Error(message);
}
/***/ }),
/***/ 13268:
/*!************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/nls.js ***!
\************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ N: function() { return /* binding */ localize; }
/* harmony export */ });
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
function _format(message, args) {
let result;
if (args.length === 0) {
result = message;
}
else {
result = message.replace(/\{(\d+)\}/g, function (match, rest) {
const index = rest[0];
return typeof args[index] !== 'undefined' ? args[index] : match;
});
}
return result;
}
function localize(data, message, ...args) {
return _format(message, args);
}
/***/ }),
/***/ 96236:
/*!****************************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/actions/common/actions.js ***!
\****************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ BH: function() { return /* binding */ MenuRegistry; },
/* harmony export */ NZ: function() { return /* binding */ SubmenuItemAction; },
/* harmony export */ U8: function() { return /* binding */ MenuItemAction; },
/* harmony export */ co: function() { return /* binding */ IMenuService; },
/* harmony export */ eH: function() { return /* binding */ MenuId; },
/* harmony export */ vr: function() { return /* binding */ isIMenuItem; }
/* harmony export */ });
/* harmony import */ var _base_common_actions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/actions.js */ 75918);
/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/codicons.js */ 52615);
/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ 4348);
/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/iterator.js */ 88226);
/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ 69323);
/* harmony import */ var _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/linkedList.js */ 34502);
/* harmony import */ var _commands_common_commands_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../commands/common/commands.js */ 35884);
/* harmony import */ var _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../contextkey/common/contextkey.js */ 90689);
/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ 16925);
/* harmony import */ var _theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../theme/common/themeService.js */ 49055);
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __param = (undefined && undefined.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
function isIMenuItem(item) {
return item.command !== undefined;
}
class MenuId {
constructor(debugName) {
this.id = MenuId._idPool++;
this._debugName = debugName;
}
}
MenuId._idPool = 0;
MenuId.CommandPalette = new MenuId('CommandPalette');
MenuId.EditorContext = new MenuId('EditorContext');
MenuId.SimpleEditorContext = new MenuId('SimpleEditorContext');
MenuId.EditorContextCopy = new MenuId('EditorContextCopy');
MenuId.EditorContextPeek = new MenuId('EditorContextPeek');
MenuId.MenubarEditMenu = new MenuId('MenubarEditMenu');
MenuId.MenubarCopy = new MenuId('MenubarCopy');
MenuId.MenubarGoMenu = new MenuId('MenubarGoMenu');
MenuId.MenubarSelectionMenu = new MenuId('MenubarSelectionMenu');
MenuId.InlineCompletionsActions = new MenuId('InlineCompletionsActions');
const IMenuService = (0,_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_8__/* .createDecorator */ .yh)('menuService');
const MenuRegistry = new class {
constructor() {
this._commands = new Map();
this._menuItems = new Map();
this._onDidChangeMenu = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__/* .Emitter */ .Q5();
this.onDidChangeMenu = this._onDidChangeMenu.event;
this._commandPaletteChangeEvent = {
has: id => id === MenuId.CommandPalette
};
}
addCommand(command) {
return this.addCommands(_base_common_iterator_js__WEBPACK_IMPORTED_MODULE_3__/* .Iterable */ .$.single(command));
}
addCommands(commands) {
for (const command of commands) {
this._commands.set(command.id, command);
}
this._onDidChangeMenu.fire(this._commandPaletteChangeEvent);
return (0,_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__/* .toDisposable */ .OF)(() => {
let didChange = false;
for (const command of commands) {
didChange = this._commands.delete(command.id) || didChange;
}
if (didChange) {
this._onDidChangeMenu.fire(this._commandPaletteChangeEvent);
}
});
}
getCommand(id) {
return this._commands.get(id);
}
getCommands() {
const map = new Map();
this._commands.forEach((value, key) => map.set(key, value));
return map;
}
appendMenuItem(id, item) {
return this.appendMenuItems(_base_common_iterator_js__WEBPACK_IMPORTED_MODULE_3__/* .Iterable */ .$.single({ id, item }));
}
appendMenuItems(items) {
const changedIds = new Set();
const toRemove = new _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_5__/* .LinkedList */ .S();
for (const { id, item } of items) {
let list = this._menuItems.get(id);
if (!list) {
list = new _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_5__/* .LinkedList */ .S();
this._menuItems.set(id, list);
}
toRemove.push(list.push(item));
changedIds.add(id);
}
this._onDidChangeMenu.fire(changedIds);
return (0,_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_4__/* .toDisposable */ .OF)(() => {
if (toRemove.size > 0) {
for (let fn of toRemove) {
fn();
}
this._onDidChangeMenu.fire(changedIds);
toRemove.clear();
}
});
}
getMenuItems(id) {
let result;
if (this._menuItems.has(id)) {
result = [...this._menuItems.get(id)];
}
else {
result = [];
}
if (id === MenuId.CommandPalette) {
// CommandPalette is special because it shows
// all commands by default
this._appendImplicitItems(result);
}
return result;
}
_appendImplicitItems(result) {
const set = new Set();
for (const item of result) {
if (isIMenuItem(item)) {
set.add(item.command.id);
if (item.alt) {
set.add(item.alt.id);
}
}
}
this._commands.forEach((command, id) => {
if (!set.has(id)) {
result.push({ command });
}
});
}
};
class SubmenuItemAction extends _base_common_actions_js__WEBPACK_IMPORTED_MODULE_0__/* .SubmenuAction */ .wY {
constructor(item, _menuService, _contextKeyService, _options) {
super(`submenuitem.${item.submenu.id}`, typeof item.title === 'string' ? item.title : item.title.value, [], 'submenu');
this.item = item;
this._menuService = _menuService;
this._contextKeyService = _contextKeyService;
this._options = _options;
}
get actions() {
const result = [];
const menu = this._menuService.createMenu(this.item.submenu, this._contextKeyService);
const groups = menu.getActions(this._options);
menu.dispose();
for (const [, actions] of groups) {
if (actions.length > 0) {
result.push(...actions);
result.push(new _base_common_actions_js__WEBPACK_IMPORTED_MODULE_0__/* .Separator */ .Z0());
}
}
if (result.length) {
result.pop(); // remove last separator
}
return result;
}
}
// implements IAction, does NOT extend Action, so that no one
// subscribes to events of Action or modified properties
let MenuItemAction = class MenuItemAction {
constructor(item, alt, options, contextKeyService, _commandService) {
var _a, _b;
this._commandService = _commandService;
this.id = item.id;
this.label = (options === null || options === void 0 ? void 0 : options.renderShortTitle) && item.shortTitle
? (typeof item.shortTitle === 'string' ? item.shortTitle : item.shortTitle.value)
: (typeof item.title === 'string' ? item.title : item.title.value);
this.tooltip = (_b = (typeof item.tooltip === 'string' ? item.tooltip : (_a = item.tooltip) === null || _a === void 0 ? void 0 : _a.value)) !== null && _b !== void 0 ? _b : '';
this.enabled = !item.precondition || contextKeyService.contextMatchesRules(item.precondition);
this.checked = undefined;
if (item.toggled) {
const toggled = (item.toggled.condition ? item.toggled : { condition: item.toggled });
this.checked = contextKeyService.contextMatchesRules(toggled.condition);
if (this.checked && toggled.tooltip) {
this.tooltip = typeof toggled.tooltip === 'string' ? toggled.tooltip : toggled.tooltip.value;
}
if (toggled.title) {
this.label = typeof toggled.title === 'string' ? toggled.title : toggled.title.value;
}
}
this.item = item;
this.alt = alt ? new MenuItemAction(alt, undefined, options, contextKeyService, _commandService) : undefined;
this._options = options;
if (_theme_common_themeService_js__WEBPACK_IMPORTED_MODULE_9__/* .ThemeIcon */ .kS.isThemeIcon(item.icon)) {
this.class = _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_1__/* .CSSIcon */ .dT.asClassName(item.icon);
}
}
dispose() {
// there is NOTHING to dispose and the MenuItemAction should
// never have anything to dispose as it is a convenience type
// to bridge into the rendering world.
}
run(...args) {
var _a, _b;
let runArgs = [];
if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.arg) {
runArgs = [...runArgs, this._options.arg];
}
if ((_b = this._options) === null || _b === void 0 ? void 0 : _b.shouldForwardArgs) {
runArgs = [...runArgs, ...args];
}
return this._commandService.executeCommand(this.id, ...runArgs);
}
};
MenuItemAction = __decorate([
__param(3, _contextkey_common_contextkey_js__WEBPACK_IMPORTED_MODULE_7__/* .IContextKeyService */ .i6),
__param(4, _commands_common_commands_js__WEBPACK_IMPORTED_MODULE_6__/* .ICommandService */ .H)
], MenuItemAction);
//#endregion
/***/ }),
/***/ 35884:
/*!******************************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/commands/common/commands.js ***!
\******************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ H: function() { return /* binding */ ICommandService; },
/* harmony export */ P: function() { return /* binding */ CommandsRegistry; }
/* harmony export */ });
/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/event.js */ 4348);
/* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/iterator.js */ 88226);
/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ 69323);
/* harmony import */ var _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/linkedList.js */ 34502);
/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../base/common/types.js */ 72999);
/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ 16925);
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const ICommandService = (0,_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_4__/* .createDecorator */ .yh)('commandService');
const CommandsRegistry = new class {
constructor() {
this._commands = new Map();
this._onDidRegisterCommand = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_0__/* .Emitter */ .Q5();
this.onDidRegisterCommand = this._onDidRegisterCommand.event;
}
registerCommand(idOrCommand, handler) {
if (!idOrCommand) {
throw new Error(`invalid command`);
}
if (typeof idOrCommand === 'string') {
if (!handler) {
throw new Error(`invalid command`);
}
return this.registerCommand({ id: idOrCommand, handler });
}
// add argument validation if rich command metadata is provided
if (idOrCommand.description) {
const constraints = [];
for (let arg of idOrCommand.description.args) {
constraints.push(arg.constraint);
}
const actualHandler = idOrCommand.handler;
idOrCommand.handler = function (accessor, ...args) {
(0,_base_common_types_js__WEBPACK_IMPORTED_MODULE_5__/* .validateConstraints */ .D8)(args, constraints);
return actualHandler(accessor, ...args);
};
}
// find a place to store the command
const { id } = idOrCommand;
let commands = this._commands.get(id);
if (!commands) {
commands = new _base_common_linkedList_js__WEBPACK_IMPORTED_MODULE_3__/* .LinkedList */ .S();
this._commands.set(id, commands);
}
let removeFn = commands.unshift(idOrCommand);
let ret = (0,_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__/* .toDisposable */ .OF)(() => {
removeFn();
const command = this._commands.get(id);
if (command === null || command === void 0 ? void 0 : command.isEmpty()) {
this._commands.delete(id);
}
});
// tell the world about this command
this._onDidRegisterCommand.fire(id);
return ret;
}
registerCommandAlias(oldId, newId) {
return CommandsRegistry.registerCommand(oldId, (accessor, ...args) => accessor.get(ICommandService).executeCommand(newId, ...args));
}
getCommand(id) {
const list = this._commands.get(id);
if (!list || list.isEmpty()) {
return undefined;
}
return _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_1__/* .Iterable */ .$.first(list);
}
getCommands() {
const result = new Map();
for (const key of this._commands.keys()) {
const command = this.getCommand(key);
if (command) {
result.set(key, command);
}
}
return result;
}
};
CommandsRegistry.registerCommand('noop', () => { });
/***/ }),
/***/ 90689:
/*!**********************************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/contextkey/common/contextkey.js ***!
\**********************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ Ao: function() { return /* binding */ ContextKeyExpr; },
/* harmony export */ Eq: function() { return /* binding */ SET_CONTEXT_COMMAND_ID; },
/* harmony export */ Fb: function() { return /* binding */ expressionsAreEqualWithConstantSubstitution; },
/* harmony export */ K8: function() { return /* binding */ implies; },
/* harmony export */ i6: function() { return /* binding */ IContextKeyService; },
/* harmony export */ uy: function() { return /* binding */ RawContextKey; }
/* harmony export */ });
/* unused harmony exports ContextKeyFalseExpr, ContextKeyTrueExpr, ContextKeyDefinedExpr, ContextKeyEqualsExpr, ContextKeyInExpr, ContextKeyNotInExpr, ContextKeyNotEqualsExpr, ContextKeyNotExpr, ContextKeyGreaterExpr, ContextKeyGreaterEqualsExpr, ContextKeySmallerExpr, ContextKeySmallerEqualsExpr, ContextKeyRegexExpr, ContextKeyNotRegexExpr */
/* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/platform.js */ 23345);
/* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ 82983);
/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ 16925);
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
let _userAgent = _base_common_platform_js__WEBPACK_IMPORTED_MODULE_0__/* .userAgent */ .WE || '';
const CONSTANT_VALUES = new Map();
CONSTANT_VALUES.set('false', false);
CONSTANT_VALUES.set('true', true);
CONSTANT_VALUES.set('isMac', _base_common_platform_js__WEBPACK_IMPORTED_MODULE_0__/* .isMacintosh */ .dz);
CONSTANT_VALUES.set('isLinux', _base_common_platform_js__WEBPACK_IMPORTED_MODULE_0__/* .isLinux */ .IJ);
CONSTANT_VALUES.set('isWindows', _base_common_platform_js__WEBPACK_IMPORTED_MODULE_0__/* .isWindows */ .ED);
CONSTANT_VALUES.set('isWeb', _base_common_platform_js__WEBPACK_IMPORTED_MODULE_0__/* .isWeb */ .$L);
CONSTANT_VALUES.set('isMacNative', _base_common_platform_js__WEBPACK_IMPORTED_MODULE_0__/* .isMacintosh */ .dz && !_base_common_platform_js__WEBPACK_IMPORTED_MODULE_0__/* .isWeb */ .$L);
CONSTANT_VALUES.set('isEdge', _userAgent.indexOf('Edg/') >= 0);
CONSTANT_VALUES.set('isFirefox', _userAgent.indexOf('Firefox') >= 0);
CONSTANT_VALUES.set('isChrome', _userAgent.indexOf('Chrome') >= 0);
CONSTANT_VALUES.set('isSafari', _userAgent.indexOf('Safari') >= 0);
const hasOwnProperty = Object.prototype.hasOwnProperty;
class ContextKeyExpr {
static has(key) {
return ContextKeyDefinedExpr.create(key);
}
static equals(key, value) {
return ContextKeyEqualsExpr.create(key, value);
}
static regex(key, value) {
return ContextKeyRegexExpr.create(key, value);
}
static not(key) {
return ContextKeyNotExpr.create(key);
}
static and(...expr) {
return ContextKeyAndExpr.create(expr, null);
}
static or(...expr) {
return ContextKeyOrExpr.create(expr, null, true);
}
static deserialize(serialized, strict = false) {
if (!serialized) {
return undefined;
}
return this._deserializeOrExpression(serialized, strict);
}
static _deserializeOrExpression(serialized, strict) {
let pieces = serialized.split('||');
return ContextKeyOrExpr.create(pieces.map(p => this._deserializeAndExpression(p, strict)), null, true);
}
static _deserializeAndExpression(serialized, strict) {
let pieces = serialized.split('&&');
return ContextKeyAndExpr.create(pieces.map(p => this._deserializeOne(p, strict)), null);
}
static _deserializeOne(serializedOne, strict) {
serializedOne = serializedOne.trim();
if (serializedOne.indexOf('!=') >= 0) {
let pieces = serializedOne.split('!=');
return ContextKeyNotEqualsExpr.create(pieces[0].trim(), this._deserializeValue(pieces[1], strict));
}
if (serializedOne.indexOf('==') >= 0) {
let pieces = serializedOne.split('==');
return ContextKeyEqualsExpr.create(pieces[0].trim(), this._deserializeValue(pieces[1], strict));
}
if (serializedOne.indexOf('=~') >= 0) {
let pieces = serializedOne.split('=~');
return ContextKeyRegexExpr.create(pieces[0].trim(), this._deserializeRegexValue(pieces[1], strict));
}
if (serializedOne.indexOf(' in ') >= 0) {
let pieces = serializedOne.split(' in ');
return ContextKeyInExpr.create(pieces[0].trim(), pieces[1].trim());
}
if (/^[^<=>]+>=[^<=>]+$/.test(serializedOne)) {
const pieces = serializedOne.split('>=');
return ContextKeyGreaterEqualsExpr.create(pieces[0].trim(), pieces[1].trim());
}
if (/^[^<=>]+>[^<=>]+$/.test(serializedOne)) {
const pieces = serializedOne.split('>');
return ContextKeyGreaterExpr.create(pieces[0].trim(), pieces[1].trim());
}
if (/^[^<=>]+<=[^<=>]+$/.test(serializedOne)) {
const pieces = serializedOne.split('<=');
return ContextKeySmallerEqualsExpr.create(pieces[0].trim(), pieces[1].trim());
}
if (/^[^<=>]+<[^<=>]+$/.test(serializedOne)) {
const pieces = serializedOne.split('<');
return ContextKeySmallerExpr.create(pieces[0].trim(), pieces[1].trim());
}
if (/^\!\s*/.test(serializedOne)) {
return ContextKeyNotExpr.create(serializedOne.substr(1).trim());
}
return ContextKeyDefinedExpr.create(serializedOne);
}
static _deserializeValue(serializedValue, strict) {
serializedValue = serializedValue.trim();
if (serializedValue === 'true') {
return true;
}
if (serializedValue === 'false') {
return false;
}
let m = /^'([^']*)'$/.exec(serializedValue);
if (m) {
return m[1].trim();
}
return serializedValue;
}
static _deserializeRegexValue(serializedValue, strict) {
if ((0,_base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__/* .isFalsyOrWhitespace */ .m5)(serializedValue)) {
if (strict) {
throw new Error('missing regexp-value for =~-expression');
}
else {
console.warn('missing regexp-value for =~-expression');
}
return null;
}
let start = serializedValue.indexOf('/');
let end = serializedValue.lastIndexOf('/');
if (start === end || start < 0 /* || to < 0 */) {
if (strict) {
throw new Error(`bad regexp-value '${serializedValue}', missing /-enclosure`);
}
else {
console.warn(`bad regexp-value '${serializedValue}', missing /-enclosure`);
}
return null;
}
let value = serializedValue.slice(start + 1, end);
let caseIgnoreFlag = serializedValue[end + 1] === 'i' ? 'i' : '';
try {
return new RegExp(value, caseIgnoreFlag);
}
catch (e) {
if (strict) {
throw new Error(`bad regexp-value '${serializedValue}', parse error: ${e}`);
}
else {
console.warn(`bad regexp-value '${serializedValue}', parse error: ${e}`);
}
return null;
}
}
}
function expressionsAreEqualWithConstantSubstitution(a, b) {
const aExpr = a ? a.substituteConstants() : undefined;
const bExpr = b ? b.substituteConstants() : undefined;
if (!aExpr && !bExpr) {
return true;
}
if (!aExpr || !bExpr) {
return false;
}
return aExpr.equals(bExpr);
}
function cmp(a, b) {
return a.cmp(b);
}
class ContextKeyFalseExpr {
constructor() {
this.type = 0 /* False */;
}
cmp(other) {
return this.type - other.type;
}
equals(other) {
return (other.type === this.type);
}
substituteConstants() {
return this;
}
evaluate(context) {
return false;
}
serialize() {
return 'false';
}
keys() {
return [];
}
negate() {
return ContextKeyTrueExpr.INSTANCE;
}
}
ContextKeyFalseExpr.INSTANCE = new ContextKeyFalseExpr();
class ContextKeyTrueExpr {
constructor() {
this.type = 1 /* True */;
}
cmp(other) {
return this.type - other.type;
}
equals(other) {
return (other.type === this.type);
}
substituteConstants() {
return this;
}
evaluate(context) {
return true;
}
serialize() {
return 'true';
}
keys() {
return [];
}
negate() {
return ContextKeyFalseExpr.INSTANCE;
}
}
ContextKeyTrueExpr.INSTANCE = new ContextKeyTrueExpr();
class ContextKeyDefinedExpr {
constructor(key, negated) {
this.key = key;
this.negated = negated;
this.type = 2 /* Defined */;
}
static create(key, negated = null) {
const constantValue = CONSTANT_VALUES.get(key);
if (typeof constantValue === 'boolean') {
return constantValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE;
}
return new ContextKeyDefinedExpr(key, negated);
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
return cmp1(this.key, other.key);
}
equals(other) {
if (other.type === this.type) {
return (this.key === other.key);
}
return false;
}
substituteConstants() {
const constantValue = CONSTANT_VALUES.get(this.key);
if (typeof constantValue === 'boolean') {
return constantValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE;
}
return this;
}
evaluate(context) {
return (!!context.getValue(this.key));
}
serialize() {
return this.key;
}
keys() {
return [this.key];
}
negate() {
if (!this.negated) {
this.negated = ContextKeyNotExpr.create(this.key, this);
}
return this.negated;
}
}
class ContextKeyEqualsExpr {
constructor(key, value, negated) {
this.key = key;
this.value = value;
this.negated = negated;
this.type = 4 /* Equals */;
}
static create(key, value, negated = null) {
if (typeof value === 'boolean') {
return (value ? ContextKeyDefinedExpr.create(key, negated) : ContextKeyNotExpr.create(key, negated));
}
const constantValue = CONSTANT_VALUES.get(key);
if (typeof constantValue === 'boolean') {
const trueValue = constantValue ? 'true' : 'false';
return (value === trueValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE);
}
return new ContextKeyEqualsExpr(key, value, negated);
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
return cmp2(this.key, this.value, other.key, other.value);
}
equals(other) {
if (other.type === this.type) {
return (this.key === other.key && this.value === other.value);
}
return false;
}
substituteConstants() {
const constantValue = CONSTANT_VALUES.get(this.key);
if (typeof constantValue === 'boolean') {
const trueValue = constantValue ? 'true' : 'false';
return (this.value === trueValue ? ContextKeyTrueExpr.INSTANCE : ContextKeyFalseExpr.INSTANCE);
}
return this;
}
evaluate(context) {
// Intentional ==
// eslint-disable-next-line eqeqeq
return (context.getValue(this.key) == this.value);
}
serialize() {
return `${this.key} == '${this.value}'`;
}
keys() {
return [this.key];
}
negate() {
if (!this.negated) {
this.negated = ContextKeyNotEqualsExpr.create(this.key, this.value, this);
}
return this.negated;
}
}
class ContextKeyInExpr {
constructor(key, valueKey) {
this.key = key;
this.valueKey = valueKey;
this.type = 10 /* In */;
this.negated = null;
}
static create(key, valueKey) {
return new ContextKeyInExpr(key, valueKey);
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
return cmp2(this.key, this.valueKey, other.key, other.valueKey);
}
equals(other) {
if (other.type === this.type) {
return (this.key === other.key && this.valueKey === other.valueKey);
}
return false;
}
substituteConstants() {
return this;
}
evaluate(context) {
const source = context.getValue(this.valueKey);
const item = context.getValue(this.key);
if (Array.isArray(source)) {
return (source.indexOf(item) >= 0);
}
if (typeof item === 'string' && typeof source === 'object' && source !== null) {
return hasOwnProperty.call(source, item);
}
return false;
}
serialize() {
return `${this.key} in '${this.valueKey}'`;
}
keys() {
return [this.key, this.valueKey];
}
negate() {
if (!this.negated) {
this.negated = ContextKeyNotInExpr.create(this);
}
return this.negated;
}
}
class ContextKeyNotInExpr {
constructor(_actual) {
this._actual = _actual;
this.type = 11 /* NotIn */;
//
}
static create(actual) {
return new ContextKeyNotInExpr(actual);
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
return this._actual.cmp(other._actual);
}
equals(other) {
if (other.type === this.type) {
return this._actual.equals(other._actual);
}
return false;
}
substituteConstants() {
return this;
}
evaluate(context) {
return !this._actual.evaluate(context);
}
serialize() {
throw new Error('Method not implemented.');
}
keys() {
return this._actual.keys();
}
negate() {
return this._actual;
}
}
class ContextKeyNotEqualsExpr {
constructor(key, value, negated) {
this.key = key;
this.value = value;
this.negated = negated;
this.type = 5 /* NotEquals */;
}
static create(key, value, negated = null) {
if (typeof value === 'boolean') {
if (value) {
return ContextKeyNotExpr.create(key, negated);
}
return ContextKeyDefinedExpr.create(key, negated);
}
const constantValue = CONSTANT_VALUES.get(key);
if (typeof constantValue === 'boolean') {
const falseValue = constantValue ? 'true' : 'false';
return (value === falseValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);
}
return new ContextKeyNotEqualsExpr(key, value, negated);
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
return cmp2(this.key, this.value, other.key, other.value);
}
equals(other) {
if (other.type === this.type) {
return (this.key === other.key && this.value === other.value);
}
return false;
}
substituteConstants() {
const constantValue = CONSTANT_VALUES.get(this.key);
if (typeof constantValue === 'boolean') {
const falseValue = constantValue ? 'true' : 'false';
return (this.value === falseValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);
}
return this;
}
evaluate(context) {
// Intentional !=
// eslint-disable-next-line eqeqeq
return (context.getValue(this.key) != this.value);
}
serialize() {
return `${this.key} != '${this.value}'`;
}
keys() {
return [this.key];
}
negate() {
if (!this.negated) {
this.negated = ContextKeyEqualsExpr.create(this.key, this.value, this);
}
return this.negated;
}
}
class ContextKeyNotExpr {
constructor(key, negated) {
this.key = key;
this.negated = negated;
this.type = 3 /* Not */;
}
static create(key, negated = null) {
const constantValue = CONSTANT_VALUES.get(key);
if (typeof constantValue === 'boolean') {
return (constantValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);
}
return new ContextKeyNotExpr(key, negated);
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
return cmp1(this.key, other.key);
}
equals(other) {
if (other.type === this.type) {
return (this.key === other.key);
}
return false;
}
substituteConstants() {
const constantValue = CONSTANT_VALUES.get(this.key);
if (typeof constantValue === 'boolean') {
return (constantValue ? ContextKeyFalseExpr.INSTANCE : ContextKeyTrueExpr.INSTANCE);
}
return this;
}
evaluate(context) {
return (!context.getValue(this.key));
}
serialize() {
return `!${this.key}`;
}
keys() {
return [this.key];
}
negate() {
if (!this.negated) {
this.negated = ContextKeyDefinedExpr.create(this.key, this);
}
return this.negated;
}
}
function withFloatOrStr(value, callback) {
if (typeof value === 'string') {
const n = parseFloat(value);
if (!isNaN(n)) {
value = n;
}
}
if (typeof value === 'string' || typeof value === 'number') {
return callback(value);
}
return ContextKeyFalseExpr.INSTANCE;
}
class ContextKeyGreaterExpr {
constructor(key, value, negated) {
this.key = key;
this.value = value;
this.negated = negated;
this.type = 12 /* Greater */;
}
static create(key, _value, negated = null) {
return withFloatOrStr(_value, (value) => new ContextKeyGreaterExpr(key, value, negated));
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
return cmp2(this.key, this.value, other.key, other.value);
}
equals(other) {
if (other.type === this.type) {
return (this.key === other.key && this.value === other.value);
}
return false;
}
substituteConstants() {
return this;
}
evaluate(context) {
if (typeof this.value === 'string') {
return false;
}
return (parseFloat(context.getValue(this.key)) > this.value);
}
serialize() {
return `${this.key} > ${this.value}`;
}
keys() {
return [this.key];
}
negate() {
if (!this.negated) {
this.negated = ContextKeySmallerEqualsExpr.create(this.key, this.value, this);
}
return this.negated;
}
}
class ContextKeyGreaterEqualsExpr {
constructor(key, value, negated) {
this.key = key;
this.value = value;
this.negated = negated;
this.type = 13 /* GreaterEquals */;
}
static create(key, _value, negated = null) {
return withFloatOrStr(_value, (value) => new ContextKeyGreaterEqualsExpr(key, value, negated));
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
return cmp2(this.key, this.value, other.key, other.value);
}
equals(other) {
if (other.type === this.type) {
return (this.key === other.key && this.value === other.value);
}
return false;
}
substituteConstants() {
return this;
}
evaluate(context) {
if (typeof this.value === 'string') {
return false;
}
return (parseFloat(context.getValue(this.key)) >= this.value);
}
serialize() {
return `${this.key} >= ${this.value}`;
}
keys() {
return [this.key];
}
negate() {
if (!this.negated) {
this.negated = ContextKeySmallerExpr.create(this.key, this.value, this);
}
return this.negated;
}
}
class ContextKeySmallerExpr {
constructor(key, value, negated) {
this.key = key;
this.value = value;
this.negated = negated;
this.type = 14 /* Smaller */;
}
static create(key, _value, negated = null) {
return withFloatOrStr(_value, (value) => new ContextKeySmallerExpr(key, value, negated));
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
return cmp2(this.key, this.value, other.key, other.value);
}
equals(other) {
if (other.type === this.type) {
return (this.key === other.key && this.value === other.value);
}
return false;
}
substituteConstants() {
return this;
}
evaluate(context) {
if (typeof this.value === 'string') {
return false;
}
return (parseFloat(context.getValue(this.key)) < this.value);
}
serialize() {
return `${this.key} < ${this.value}`;
}
keys() {
return [this.key];
}
negate() {
if (!this.negated) {
this.negated = ContextKeyGreaterEqualsExpr.create(this.key, this.value, this);
}
return this.negated;
}
}
class ContextKeySmallerEqualsExpr {
constructor(key, value, negated) {
this.key = key;
this.value = value;
this.negated = negated;
this.type = 15 /* SmallerEquals */;
}
static create(key, _value, negated = null) {
return withFloatOrStr(_value, (value) => new ContextKeySmallerEqualsExpr(key, value, negated));
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
return cmp2(this.key, this.value, other.key, other.value);
}
equals(other) {
if (other.type === this.type) {
return (this.key === other.key && this.value === other.value);
}
return false;
}
substituteConstants() {
return this;
}
evaluate(context) {
if (typeof this.value === 'string') {
return false;
}
return (parseFloat(context.getValue(this.key)) <= this.value);
}
serialize() {
return `${this.key} <= ${this.value}`;
}
keys() {
return [this.key];
}
negate() {
if (!this.negated) {
this.negated = ContextKeyGreaterExpr.create(this.key, this.value, this);
}
return this.negated;
}
}
class ContextKeyRegexExpr {
constructor(key, regexp) {
this.key = key;
this.regexp = regexp;
this.type = 7 /* Regex */;
this.negated = null;
//
}
static create(key, regexp) {
return new ContextKeyRegexExpr(key, regexp);
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
if (this.key < other.key) {
return -1;
}
if (this.key > other.key) {
return 1;
}
const thisSource = this.regexp ? this.regexp.source : '';
const otherSource = other.regexp ? other.regexp.source : '';
if (thisSource < otherSource) {
return -1;
}
if (thisSource > otherSource) {
return 1;
}
return 0;
}
equals(other) {
if (other.type === this.type) {
const thisSource = this.regexp ? this.regexp.source : '';
const otherSource = other.regexp ? other.regexp.source : '';
return (this.key === other.key && thisSource === otherSource);
}
return false;
}
substituteConstants() {
return this;
}
evaluate(context) {
let value = context.getValue(this.key);
return this.regexp ? this.regexp.test(value) : false;
}
serialize() {
const value = this.regexp
? `/${this.regexp.source}/${this.regexp.ignoreCase ? 'i' : ''}`
: '/invalid/';
return `${this.key} =~ ${value}`;
}
keys() {
return [this.key];
}
negate() {
if (!this.negated) {
this.negated = ContextKeyNotRegexExpr.create(this);
}
return this.negated;
}
}
class ContextKeyNotRegexExpr {
constructor(_actual) {
this._actual = _actual;
this.type = 8 /* NotRegex */;
//
}
static create(actual) {
return new ContextKeyNotRegexExpr(actual);
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
return this._actual.cmp(other._actual);
}
equals(other) {
if (other.type === this.type) {
return this._actual.equals(other._actual);
}
return false;
}
substituteConstants() {
return this;
}
evaluate(context) {
return !this._actual.evaluate(context);
}
serialize() {
throw new Error('Method not implemented.');
}
keys() {
return this._actual.keys();
}
negate() {
return this._actual;
}
}
/**
* @returns the same instance if nothing changed.
*/
function eliminateConstantsInArray(arr) {
// Allocate array only if there is a difference
let newArr = null;
for (let i = 0, len = arr.length; i < len; i++) {
const newExpr = arr[i].substituteConstants();
if (arr[i] !== newExpr) {
// something has changed!
// allocate array on first difference
if (newArr === null) {
newArr = [];
for (let j = 0; j < i; j++) {
newArr[j] = arr[j];
}
}
}
if (newArr !== null) {
newArr[i] = newExpr;
}
}
if (newArr === null) {
return arr;
}
return newArr;
}
class ContextKeyAndExpr {
constructor(expr, negated) {
this.expr = expr;
this.negated = negated;
this.type = 6 /* And */;
}
static create(_expr, negated) {
return ContextKeyAndExpr._normalizeArr(_expr, negated);
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
if (this.expr.length < other.expr.length) {
return -1;
}
if (this.expr.length > other.expr.length) {
return 1;
}
for (let i = 0, len = this.expr.length; i < len; i++) {
const r = cmp(this.expr[i], other.expr[i]);
if (r !== 0) {
return r;
}
}
return 0;
}
equals(other) {
if (other.type === this.type) {
if (this.expr.length !== other.expr.length) {
return false;
}
for (let i = 0, len = this.expr.length; i < len; i++) {
if (!this.expr[i].equals(other.expr[i])) {
return false;
}
}
return true;
}
return false;
}
substituteConstants() {
const exprArr = eliminateConstantsInArray(this.expr);
if (exprArr === this.expr) {
// no change
return this;
}
return ContextKeyAndExpr.create(exprArr, this.negated);
}
evaluate(context) {
for (let i = 0, len = this.expr.length; i < len; i++) {
if (!this.expr[i].evaluate(context)) {
return false;
}
}
return true;
}
static _normalizeArr(arr, negated) {
const expr = [];
let hasTrue = false;
for (const e of arr) {
if (!e) {
continue;
}
if (e.type === 1 /* True */) {
// anything && true ==> anything
hasTrue = true;
continue;
}
if (e.type === 0 /* False */) {
// anything && false ==> false
return ContextKeyFalseExpr.INSTANCE;
}
if (e.type === 6 /* And */) {
expr.push(...e.expr);
continue;
}
expr.push(e);
}
if (expr.length === 0 && hasTrue) {
return ContextKeyTrueExpr.INSTANCE;
}
if (expr.length === 0) {
return undefined;
}
if (expr.length === 1) {
return expr[0];
}
expr.sort(cmp);
// eliminate duplicate terms
for (let i = 1; i < expr.length; i++) {
if (expr[i - 1].equals(expr[i])) {
expr.splice(i, 1);
i--;
}
}
if (expr.length === 1) {
return expr[0];
}
// We must distribute any OR expression because we don't support parens
// OR extensions will be at the end (due to sorting rules)
while (expr.length > 1) {
const lastElement = expr[expr.length - 1];
if (lastElement.type !== 9 /* Or */) {
break;
}
// pop the last element
expr.pop();
// pop the second to last element
const secondToLastElement = expr.pop();
const isFinished = (expr.length === 0);
// distribute `lastElement` over `secondToLastElement`
const resultElement = ContextKeyOrExpr.create(lastElement.expr.map(el => ContextKeyAndExpr.create([el, secondToLastElement], null)), null, isFinished);
if (resultElement) {
expr.push(resultElement);
expr.sort(cmp);
}
}
if (expr.length === 1) {
return expr[0];
}
return new ContextKeyAndExpr(expr, negated);
}
serialize() {
return this.expr.map(e => e.serialize()).join(' && ');
}
keys() {
const result = [];
for (let expr of this.expr) {
result.push(...expr.keys());
}
return result;
}
negate() {
if (!this.negated) {
const result = [];
for (let expr of this.expr) {
result.push(expr.negate());
}
this.negated = ContextKeyOrExpr.create(result, this, true);
}
return this.negated;
}
}
class ContextKeyOrExpr {
constructor(expr, negated) {
this.expr = expr;
this.negated = negated;
this.type = 9 /* Or */;
}
static create(_expr, negated, extraRedundantCheck) {
return ContextKeyOrExpr._normalizeArr(_expr, negated, extraRedundantCheck);
}
cmp(other) {
if (other.type !== this.type) {
return this.type - other.type;
}
if (this.expr.length < other.expr.length) {
return -1;
}
if (this.expr.length > other.expr.length) {
return 1;
}
for (let i = 0, len = this.expr.length; i < len; i++) {
const r = cmp(this.expr[i], other.expr[i]);
if (r !== 0) {
return r;
}
}
return 0;
}
equals(other) {
if (other.type === this.type) {
if (this.expr.length !== other.expr.length) {
return false;
}
for (let i = 0, len = this.expr.length; i < len; i++) {
if (!this.expr[i].equals(other.expr[i])) {
return false;
}
}
return true;
}
return false;
}
substituteConstants() {
const exprArr = eliminateConstantsInArray(this.expr);
if (exprArr === this.expr) {
// no change
return this;
}
return ContextKeyOrExpr.create(exprArr, this.negated, false);
}
evaluate(context) {
for (let i = 0, len = this.expr.length; i < len; i++) {
if (this.expr[i].evaluate(context)) {
return true;
}
}
return false;
}
static _normalizeArr(arr, negated, extraRedundantCheck) {
let expr = [];
let hasFalse = false;
if (arr) {
for (let i = 0, len = arr.length; i < len; i++) {
const e = arr[i];
if (!e) {
continue;
}
if (e.type === 0 /* False */) {
// anything || false ==> anything
hasFalse = true;
continue;
}
if (e.type === 1 /* True */) {
// anything || true ==> true
return ContextKeyTrueExpr.INSTANCE;
}
if (e.type === 9 /* Or */) {
expr = expr.concat(e.expr);
continue;
}
expr.push(e);
}
if (expr.length === 0 && hasFalse) {
return ContextKeyFalseExpr.INSTANCE;
}
expr.sort(cmp);
}
if (expr.length === 0) {
return undefined;
}
if (expr.length === 1) {
return expr[0];
}
// eliminate duplicate terms
for (let i = 1; i < expr.length; i++) {
if (expr[i - 1].equals(expr[i])) {
expr.splice(i, 1);
i--;
}
}
if (expr.length === 1) {
return expr[0];
}
// eliminate redundant terms
if (extraRedundantCheck) {
for (let i = 0; i < expr.length; i++) {
for (let j = i + 1; j < expr.length; j++) {
if (implies(expr[i], expr[j])) {
expr.splice(j, 1);
j--;
}
}
}
if (expr.length === 1) {
return expr[0];
}
}
return new ContextKeyOrExpr(expr, negated);
}
serialize() {
return this.expr.map(e => e.serialize()).join(' || ');
}
keys() {
const result = [];
for (let expr of this.expr) {
result.push(...expr.keys());
}
return result;
}
negate() {
if (!this.negated) {
let result = [];
for (let expr of this.expr) {
result.push(expr.negate());
}
// We don't support parens, so here we distribute the AND over the OR terminals
// We always take the first 2 AND pairs and distribute them
while (result.length > 1) {
const LEFT = result.shift();
const RIGHT = result.shift();
const all = [];
for (const left of getTerminals(LEFT)) {
for (const right of getTerminals(RIGHT)) {
all.push(ContextKeyAndExpr.create([left, right], null));
}
}
const isFinished = (result.length === 0);
result.unshift(ContextKeyOrExpr.create(all, null, isFinished));
}
this.negated = result[0];
}
return this.negated;
}
}
class RawContextKey extends ContextKeyDefinedExpr {
constructor(key, defaultValue, metaOrHide) {
super(key, null);
this._defaultValue = defaultValue;
// collect all context keys into a central place
if (typeof metaOrHide === 'object') {
RawContextKey._info.push(Object.assign(Object.assign({}, metaOrHide), { key }));
}
else if (metaOrHide !== true) {
RawContextKey._info.push({ key, description: metaOrHide, type: defaultValue !== null && defaultValue !== undefined ? typeof defaultValue : undefined });
}
}
static all() {
return RawContextKey._info.values();
}
bindTo(target) {
return target.createKey(this.key, this._defaultValue);
}
getValue(target) {
return target.getContextKeyValue(this.key);
}
toNegated() {
return this.negate();
}
isEqualTo(value) {
return ContextKeyEqualsExpr.create(this.key, value);
}
}
RawContextKey._info = [];
const IContextKeyService = (0,_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_2__/* .createDecorator */ .yh)('contextKeyService');
const SET_CONTEXT_COMMAND_ID = 'setContext';
function cmp1(key1, key2) {
if (key1 < key2) {
return -1;
}
if (key1 > key2) {
return 1;
}
return 0;
}
function cmp2(key1, value1, key2, value2) {
if (key1 < key2) {
return -1;
}
if (key1 > key2) {
return 1;
}
if (value1 < value2) {
return -1;
}
if (value1 > value2) {
return 1;
}
return 0;
}
/**
* Returns true if it is provable `p` implies `q`.
*/
function implies(p, q) {
if (q.type === 6 /* And */ && (p.type !== 9 /* Or */ && p.type !== 6 /* And */)) {
// covers the case: A implies A && B
for (const qTerm of q.expr) {
if (p.equals(qTerm)) {
return true;
}
}
}
const notP = p.negate();
const expr = getTerminals(notP).concat(getTerminals(q));
expr.sort(cmp);
for (let i = 0; i < expr.length; i++) {
const a = expr[i];
const notA = a.negate();
for (let j = i + 1; j < expr.length; j++) {
const b = expr[j];
if (notA.equals(b)) {
return true;
}
}
}
return false;
}
function getTerminals(node) {
if (node.type === 9 /* Or */) {
return node.expr;
}
return [node];
}
/***/ }),
/***/ 16925:
/*!****************************************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/instantiation/common/instantiation.js ***!
\****************************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ I8: function() { return /* binding */ _util; },
/* harmony export */ TG: function() { return /* binding */ IInstantiationService; },
/* harmony export */ jt: function() { return /* binding */ optional; },
/* harmony export */ yh: function() { return /* binding */ createDecorator; }
/* harmony export */ });
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// ------ internal util
var _util;
(function (_util) {
_util.serviceIds = new Map();
_util.DI_TARGET = '$di$target';
_util.DI_DEPENDENCIES = '$di$dependencies';
function getServiceDependencies(ctor) {
return ctor[_util.DI_DEPENDENCIES] || [];
}
_util.getServiceDependencies = getServiceDependencies;
})(_util || (_util = {}));
const IInstantiationService = createDecorator('instantiationService');
function storeServiceDependency(id, target, index, optional) {
if (target[_util.DI_TARGET] === target) {
target[_util.DI_DEPENDENCIES].push({ id, index, optional });
}
else {
target[_util.DI_DEPENDENCIES] = [{ id, index, optional }];
target[_util.DI_TARGET] = target;
}
}
/**
* The *only* valid way to create a {{ServiceIdentifier}}.
*/
function createDecorator(serviceId) {
if (_util.serviceIds.has(serviceId)) {
return _util.serviceIds.get(serviceId);
}
const id = function (target, key, index) {
if (arguments.length !== 3) {
throw new Error('@IServiceName-decorator can only be used to decorate a parameter');
}
storeServiceDependency(id, target, index, false);
};
id.toString = () => serviceId;
_util.serviceIds.set(serviceId, id);
return id;
}
/**
* Mark a service dependency as optional.
* @deprecated Avoid, see https://github.com/microsoft/vscode/issues/119440
*/
function optional(serviceIdentifier) {
return function (target, key, index) {
if (arguments.length !== 3) {
throw new Error('@optional-decorator can only be used to decorate a parameter');
}
storeServiceDependency(serviceIdentifier, target, index, true);
};
}
/***/ }),
/***/ 44650:
/*!******************************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/registry/common/platform.js ***!
\******************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ B: function() { return /* binding */ Registry; }
/* harmony export */ });
/* harmony import */ var _base_common_assert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/assert.js */ 76068);
/* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/types.js */ 72999);
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
class RegistryImpl {
constructor() {
this.data = new Map();
}
add(id, data) {
_base_common_assert_js__WEBPACK_IMPORTED_MODULE_0__.ok(_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__/* .isString */ .HD(id));
_base_common_assert_js__WEBPACK_IMPORTED_MODULE_0__.ok(_base_common_types_js__WEBPACK_IMPORTED_MODULE_1__/* .isObject */ .Kn(data));
_base_common_assert_js__WEBPACK_IMPORTED_MODULE_0__.ok(!this.data.has(id), 'There is already an extension with this id');
this.data.set(id, data);
}
as(id) {
return this.data.get(id) || null;
}
}
const Registry = new RegistryImpl();
/***/ }),
/***/ 66213:
/*!************************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/theme/common/theme.js ***!
\************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ e: function() { return /* binding */ ColorScheme; }
/* harmony export */ });
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/**
* Color scheme used by the OS and by color themes.
*/
var ColorScheme;
(function (ColorScheme) {
ColorScheme["DARK"] = "dark";
ColorScheme["LIGHT"] = "light";
ColorScheme["HIGH_CONTRAST"] = "hc";
})(ColorScheme || (ColorScheme = {}));
/***/ }),
/***/ 49055:
/*!*******************************************************************************************************!*\
!*** ./node_modules/_monaco-editor@0.30.0@monaco-editor/esm/vs/platform/theme/common/themeService.js ***!
\*******************************************************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ EN: function() { return /* binding */ themeColorFromId; },
/* harmony export */ IP: function() { return /* binding */ Extensions; },
/* harmony export */ Ic: function() { return /* binding */ registerThemingParticipant; },
/* harmony export */ XE: function() { return /* binding */ IThemeService; },
/* harmony export */ bB: function() { return /* binding */ Themable; },
/* harmony export */ kS: function() { return /* binding */ ThemeIcon; },
/* harmony export */ m6: function() { return /* binding */ getThemeTypeSelector; }
/* harmony export */ });
/* unused harmony export ThemeColor */
/* harmony import */ var _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/codicons.js */ 52615);
/* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/event.js */ 4348);
/* harmony import */ var _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/lifecycle.js */ 69323);
/* harmony import */ var _instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../instantiation/common/instantiation.js */ 16925);
/* harmony import */ var _registry_common_platform_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../registry/common/platform.js */ 44650);
/* harmony import */ var _theme_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./theme.js */ 66213);
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const IThemeService = (0,_instantiation_common_instantiation_js__WEBPACK_IMPORTED_MODULE_3__/* .createDecorator */ .yh)('themeService');
var ThemeColor;
(function (ThemeColor) {
function isThemeColor(obj) {
return obj && typeof obj === 'object' && typeof obj.id === 'string';
}
ThemeColor.isThemeColor = isThemeColor;
})(ThemeColor || (ThemeColor = {}));
function themeColorFromId(id) {
return { id };
}
var ThemeIcon;
(function (ThemeIcon) {
function isThemeIcon(obj) {
return obj && typeof obj === 'object' && typeof obj.id === 'string' && (typeof obj.color === 'undefined' || ThemeColor.isThemeColor(obj.color));
}
ThemeIcon.isThemeIcon = isThemeIcon;
const _regexFromString = new RegExp(`^\\$\\((${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_0__/* .CSSIcon */ .dT.iconNameExpression}(?:${_base_common_codicons_js__WEBPACK_IMPORTED_MODULE_0__/* .CSSIcon */ .dT.iconModifierExpression})?)\\)$`);
function fromString(str) {
const match = _regexFromString.exec(str);
if (!match) {
return undefined;
}
let [, name] = match;
return { id: name };
}
ThemeIcon.fromString = fromString;
function modify(icon, modifier) {
let id = icon.id;
const tildeIndex = id.lastIndexOf('~');
if (tildeIndex !== -1) {
id = id.substring(0, tildeIndex);
}
if (modifier) {
id = `${id}~${modifier}`;
}
return { id };
}
ThemeIcon.modify = modify;
function isEqual(ti1, ti2) {
var _a, _b;
return ti1.id === ti2.id && ((_a = ti1.color) === null || _a === void 0 ? void 0 : _a.id) === ((_b = ti2.color) === null || _b === void 0 ? void 0 : _b.id);
}
ThemeIcon.isEqual = isEqual;
function asThemeIcon(codicon, color) {
return { id: codicon.id, color: color ? themeColorFromId(color) : undefined };
}
ThemeIcon.asThemeIcon = asThemeIcon;
ThemeIcon.asClassNameArray = _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_0__/* .CSSIcon */ .dT.asClassNameArray;
ThemeIcon.asClassName = _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_0__/* .CSSIcon */ .dT.asClassName;
ThemeIcon.asCSSSelector = _base_common_codicons_js__WEBPACK_IMPORTED_MODULE_0__/* .CSSIcon */ .dT.asCSSSelector;
})(ThemeIcon || (ThemeIcon = {}));
function getThemeTypeSelector(type) {
switch (type) {
case _theme_js__WEBPACK_IMPORTED_MODULE_5__/* .ColorScheme */ .e.DARK: return 'vs-dark';
case _theme_js__WEBPACK_IMPORTED_MODULE_5__/* .ColorScheme */ .e.HIGH_CONTRAST: return 'hc-black';
default: return 'vs';
}
}
// static theming participant
const Extensions = {
ThemingContribution: 'base.contributions.theming'
};
class ThemingRegistry {
constructor() {
this.themingParticipants = [];
this.themingParticipants = [];
this.onThemingParticipantAddedEmitter = new _base_common_event_js__WEBPACK_IMPORTED_MODULE_1__/* .Emitter */ .Q5();
}
onColorThemeChange(participant) {
this.themingParticipants.push(participant);
this.onThemingParticipantAddedEmitter.fire(participant);
return (0,_base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__/* .toDisposable */ .OF)(() => {
const idx = this.themingParticipants.indexOf(participant);
this.themingParticipants.splice(idx, 1);
});
}
getThemingParticipants() {
return this.themingParticipants;
}
}
let themingRegistry = new ThemingRegistry();
_registry_common_platform_js__WEBPACK_IMPORTED_MODULE_4__/* .Registry */ .B.add(Extensions.ThemingContribution, themingRegistry);
function registerThemingParticipant(participant) {
return themingRegistry.onColorThemeChange(participant);
}
/**
* Utility base class for all themable components.
*/
class Themable extends _base_common_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__/* .Disposable */ .JT {
constructor(themeService) {
super();
this.themeService = themeService;
this.theme = themeService.getColorTheme();
// Hook up to theme changes
this._register(this.themeService.onDidColorThemeChange(theme => this.onThemeChange(theme)));
}
onThemeChange(theme) {
this.theme = theme;
this.updateStyles();
}
updateStyles() {
// Subclasses to override
}
}
/***/ })
}]);