From eebf70d1e8a4fd646ba2e8a5e1dbcea68d490713 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Thu, 30 Dec 2021 10:42:41 +0100 Subject: [PATCH] MDL-71719 lib: Upgrade jsbeautify to 1.14.0 --- .../moodle-atto_html-beautify-debug.js | 582 +++++++----------- .../moodle-atto_html-beautify-min.js | 46 +- .../moodle-atto_html-beautify.js | 582 +++++++----------- .../html/yui/src/beautify/js/beautify-css.js | 163 ++--- .../html/yui/src/beautify/js/beautify-html.js | 201 +++--- .../html/yui/src/beautify/js/beautify.js | 218 +++---- 6 files changed, 686 insertions(+), 1106 deletions(-) diff --git a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify-debug.js b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify-debug.js index ad3648722fa..9db40eb0564 100644 --- a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify-debug.js +++ b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify-debug.js @@ -106,98 +106,13 @@ Y.namespace('M.atto_html').beautify = exports; (function() { /* GENERATED_BUILD_OUTPUT */ -var legacy_beautify_js = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ([ +var legacy_beautify_js; +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ([ /* 0 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -244,9 +159,8 @@ module.exports.defaultOptions = function() { /***/ }), /* 1 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -795,7 +709,7 @@ Beautifier.prototype.handle_start_expr = function(current_token) { } } - if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) { + 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 { @@ -803,7 +717,7 @@ Beautifier.prototype.handle_start_expr = function(current_token) { 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'])) { + } 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'])) { @@ -1306,7 +1220,9 @@ Beautifier.prototype.handle_semicolon = function(current_token) { }; Beautifier.prototype.handle_string = function(current_token) { - if (this.start_of_statement(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; @@ -1318,6 +1234,8 @@ Beautifier.prototype.handle_string = function(current_token) { 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(); } @@ -1706,9 +1624,8 @@ module.exports.Beautifier = Beautifier; /***/ }), /* 2 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* The MIT License (MIT) @@ -2132,9 +2049,8 @@ module.exports.Output = Output; /***/ }), /* 3 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -2193,9 +2109,8 @@ module.exports.Token = Token; /***/ }), /* 4 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports) { -"use strict"; /* jshint node: true, curly: false */ // Parts of this section of code is taken from acorn. // @@ -2257,9 +2172,8 @@ exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g'); /***/ }), /* 5 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -2357,9 +2271,8 @@ module.exports.Options = Options; /***/ }), /* 6 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -2429,10 +2342,10 @@ function Options(options, merge_child_field) { this.indent_empty_lines = this._get_boolean('indent_empty_lines'); - // valid templating languages ['django', 'erb', 'handlebars', 'php'] + // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty'] // For now, 'auto' = all off for javascript, all on for html (and inline javascript). // other values ignored - this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']); + this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); } Options.prototype._get_array = function(name, default_value) { @@ -2557,9 +2470,8 @@ module.exports.mergeOpts = _mergeOpts; /***/ }), /* 7 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -2628,7 +2540,7 @@ var TOKEN = { var directives_core = new Directives(/\/\*/, /\*\//); -var number_pattern = /0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/; +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]/; @@ -2688,7 +2600,7 @@ var Tokenizer = function(input_string, options) { 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_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/), + xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/), single_quote: templatable.until(/['\\\n\r\u2028\u2029]/), double_quote: templatable.until(/["\\\n\r\u2028\u2029]/), template_text: templatable.until(/[`\\$]/), @@ -3130,9 +3042,8 @@ module.exports.line_starters = line_starters.slice(); /***/ }), /* 8 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -3329,9 +3240,8 @@ module.exports.InputScanner = InputScanner; /***/ }), /* 9 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -3476,9 +3386,8 @@ module.exports.TOKEN = TOKEN; /***/ }), /* 10 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -3561,9 +3470,8 @@ module.exports.TokenStream = TokenStream; /***/ }), /* 11 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -3673,9 +3581,8 @@ module.exports.WhitespacePattern = WhitespacePattern; /***/ }), /* 12 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -3774,9 +3681,8 @@ module.exports.Pattern = Pattern; /***/ }), /* 13 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -3843,9 +3749,8 @@ module.exports.Directives = Directives; /***/ }), /* 14 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -3883,7 +3788,8 @@ var template_names = { django: false, erb: false, handlebars: false, - php: false + php: false, + smarty: false }; // This lets templates appear anywhere we would do a readUntil @@ -3904,12 +3810,15 @@ function TemplatablePattern(input_scanner, parent) { 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(/\?>/), + 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(/#}/) + 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(); @@ -3983,9 +3892,14 @@ TemplatablePattern.prototype.__set_templated_pattern = function() { } 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); @@ -4031,6 +3945,17 @@ TemplatablePattern.prototype._read_template = function() { 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; }; @@ -4040,7 +3965,42 @@ module.exports.TemplatablePattern = TemplatablePattern; /***/ }) -/******/ ]); +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(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, __webpack_require__); +/******/ +/******/ // 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 __webpack_exports__ = __webpack_require__(0); +/******/ legacy_beautify_js = __webpack_exports__; +/******/ +/******/ })() +; var js_beautify = legacy_beautify_js; /* Footer */ if (typeof define === "function" && define.amd) { @@ -4129,100 +4089,15 @@ if (typeof define === "function" && define.amd) { (function() { /* GENERATED_BUILD_OUTPUT */ -var legacy_beautify_css = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 15); -/******/ }) -/************************************************************************/ -/******/ ([ +var legacy_beautify_css; +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ([ /* 0 */, /* 1 */, /* 2 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* The MIT License (MIT) @@ -4649,9 +4524,8 @@ module.exports.Output = Output; /* 4 */, /* 5 */, /* 6 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -4721,10 +4595,10 @@ function Options(options, merge_child_field) { this.indent_empty_lines = this._get_boolean('indent_empty_lines'); - // valid templating languages ['django', 'erb', 'handlebars', 'php'] + // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty'] // For now, 'auto' = all off for javascript, all on for html (and inline javascript). // other values ignored - this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']); + this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); } Options.prototype._get_array = function(name, default_value) { @@ -4850,9 +4724,8 @@ module.exports.mergeOpts = _mergeOpts; /***/ }), /* 7 */, /* 8 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -5053,9 +4926,8 @@ module.exports.InputScanner = InputScanner; /* 11 */, /* 12 */, /* 13 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -5123,9 +4995,8 @@ module.exports.Directives = Directives; /***/ }), /* 14 */, /* 15 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -5172,9 +5043,8 @@ module.exports.defaultOptions = function() { /***/ }), /* 16 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -5268,13 +5138,12 @@ Beautifier.prototype.eatString = function(endChars) { // the first newline will be output Beautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) { var result = whitespaceChar.test(this._input.peek()); - var isFirstNewLine = true; - + var newline_count = 0; while (whitespaceChar.test(this._input.peek())) { this._ch = this._input.next(); if (allowAtLeastOneNewLine && this._ch === '\n') { - if (this._options.preserve_newlines || isFirstNewLine) { - isFirstNewLine = false; + if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) { + newline_count++; this._output.add_new_line(true); } } @@ -5611,7 +5480,7 @@ Beautifier.prototype.beautify = function() { } else if (this._ch === ',') { this.print_string(this._ch); this.eatWhitespace(true); - if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport) { + if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport && !insideAtExtend) { this._output.add_new_line(); } else { this._output.space_before_token = true; @@ -5660,9 +5529,8 @@ module.exports.Beautifier = Beautifier; /***/ }), /* 17 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -5722,7 +5590,42 @@ module.exports.Options = Options; /***/ }) -/******/ ]); +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(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, __webpack_require__); +/******/ +/******/ // 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 __webpack_exports__ = __webpack_require__(15); +/******/ legacy_beautify_css = __webpack_exports__; +/******/ +/******/ })() +; var css_beautify = legacy_beautify_css; /* Footer */ if (typeof define === "function" && define.amd) { @@ -5822,100 +5725,15 @@ if (typeof define === "function" && define.amd) { (function() { /* GENERATED_BUILD_OUTPUT */ -var legacy_beautify_html = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 18); -/******/ }) -/************************************************************************/ -/******/ ([ +var legacy_beautify_html; +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ([ /* 0 */, /* 1 */, /* 2 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* The MIT License (MIT) @@ -6339,9 +6157,8 @@ module.exports.Output = Output; /***/ }), /* 3 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -6402,9 +6219,8 @@ module.exports.Token = Token; /* 4 */, /* 5 */, /* 6 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -6474,10 +6290,10 @@ function Options(options, merge_child_field) { this.indent_empty_lines = this._get_boolean('indent_empty_lines'); - // valid templating languages ['django', 'erb', 'handlebars', 'php'] + // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty'] // For now, 'auto' = all off for javascript, all on for html (and inline javascript). // other values ignored - this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']); + this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); } Options.prototype._get_array = function(name, default_value) { @@ -6603,9 +6419,8 @@ module.exports.mergeOpts = _mergeOpts; /***/ }), /* 7 */, /* 8 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -6802,9 +6617,8 @@ module.exports.InputScanner = InputScanner; /***/ }), /* 9 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -6949,9 +6763,8 @@ module.exports.TOKEN = TOKEN; /***/ }), /* 10 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -7034,9 +6847,8 @@ module.exports.TokenStream = TokenStream; /***/ }), /* 11 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -7146,9 +6958,8 @@ module.exports.WhitespacePattern = WhitespacePattern; /***/ }), /* 12 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -7247,9 +7058,8 @@ module.exports.Pattern = Pattern; /***/ }), /* 13 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -7316,9 +7126,8 @@ module.exports.Directives = Directives; /***/ }), /* 14 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -7356,7 +7165,8 @@ var template_names = { django: false, erb: false, handlebars: false, - php: false + php: false, + smarty: false }; // This lets templates appear anywhere we would do a readUntil @@ -7377,12 +7187,15 @@ function TemplatablePattern(input_scanner, parent) { 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(/\?>/), + 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(/#}/) + 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(); @@ -7456,9 +7269,14 @@ TemplatablePattern.prototype.__set_templated_pattern = function() { } 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); @@ -7504,6 +7322,17 @@ TemplatablePattern.prototype._read_template = function() { 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; }; @@ -7517,9 +7346,8 @@ module.exports.TemplatablePattern = TemplatablePattern; /* 16 */, /* 17 */, /* 18 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -7566,9 +7394,8 @@ module.exports.defaultOptions = function() { /***/ }), /* 19 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -8438,9 +8265,8 @@ module.exports.Beautifier = Beautifier; /***/ }), /* 20 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -8536,9 +8362,8 @@ module.exports.Options = Options; /***/ }), /* 21 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -8874,7 +8699,42 @@ module.exports.TOKEN = TOKEN; /***/ }) -/******/ ]); +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(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, __webpack_require__); +/******/ +/******/ // 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 __webpack_exports__ = __webpack_require__(18); +/******/ legacy_beautify_html = __webpack_exports__; +/******/ +/******/ })() +; var style_html = legacy_beautify_html; /* Footer */ if (typeof define === "function" && define.amd) { diff --git a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify-min.js b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify-min.js index 906083c3dec..ec8bf58ee49 100644 --- a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify-min.js +++ b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify-min.js @@ -1,23 +1,23 @@ -YUI.add("moodle-atto_html-beautify",function(t,e){var n,i,_,s,r,a,o,u,h,p,l,c,d,f,g={},m=null,b=function(){return g};function y(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,y),e.l=!0,e.exports}function w(t){if(a[t])return a[t].exports;var e=a[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,w),e.l=!0,e.exports}function k(t){if(c[t])return c[t].exports;var e=c[t]={i:t,l:!1,exports:{}};return l[t].call(e.exports,e,e.exports,k),e.l=!0,e.exports}b(),t.namespace("M.atto_html").beautify=g,i={},y.m=n=[function(t,e,n){"use strict";var i=n(1).Beautifier,_=n(5).Options;t.exports=function s(t,e){return new i(t,e).beautify()},t.exports.defaultOptions=function(){return new _}},function(t,e,n){"use strict";var p,l,c,d,f,a,_,s,r,o,u,i=n(2).Output,h=n(3).Token,g=n(4),m=n(5).Options,b=n(7).Tokenizer,y=n(7).line_starters,w=n(7).positionable_operators,k=n(7).TOKEN;function x(t,e){return-1!==e.indexOf(t)}function v(t,e){return t&&t.type===k.RESERVED&&t.text===e}function E(t,e){return t&&t.type===k.RESERVED&&x(t.text,e)}function O(t,e){e.multiline_frame||e.mode===s||e.mode===r||t.remove_indent(e.start_line_index)}function T(t){return t===_}function R(t){return x(t,[o,s,r])}function A(t,e){e=e||{},this._source_text=t||"",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 m(e)}p=["case","return","do","if","throw","else","await","break","continue","async"],l=function S(t){var e,n={};for(e=0;en&&(n=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new h(k.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,alignment:0,line_indent_level:t?t.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0}},A.prototype._reset=function(t){var e,n=t.match(/^[\t ]*/)[0];return this._last_last_text="",this._output=new i(this._options,n),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d),e=new b(t,this._options),this._tokens=e.tokenize(),t},A.prototype.beautify=function(){var t,e,n;if(this._options.disabled)return this._source_text;for(t=this._reset(this._source_text),e=this._options.eol,"auto"===this._options.eol&&(e="\n",t&&g.lineBreak.test(t||"")&&(e=t.match(g.lineBreak)[0])),n=this._tokens.next();n;)this.handle_token(n),this._last_last_text=this._flags.last_token.text,this._flags.last_token=n,n=this._tokens.next();return this._output.get_code(e)},A.prototype.handle_token=function(t,e){t.type===k.START_EXPR?this.handle_start_expr(t):t.type===k.END_EXPR?this.handle_end_expr(t):t.type===k.START_BLOCK?this.handle_start_block(t):t.type===k.END_BLOCK?this.handle_end_block(t):t.type===k.WORD||t.type===k.RESERVED?this.handle_word(t):t.type===k.SEMICOLON?this.handle_semicolon(t):t.type===k.STRING?this.handle_string(t):t.type===k.EQUALS?this.handle_equals(t):t.type===k.OPERATOR?this.handle_operator(t):t.type===k.COMMA?this.handle_comma(t):t.type===k.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===k.COMMENT?this.handle_comment(t,e):t.type===k.DOT?this.handle_dot(t):t.type===k.EOF?this.handle_eof(t):(t.type,k.UNKNOWN,this.handle_unknown(t,e))},A.prototype.handle_whitespace_and_comments=function(t,e){var n,i,_,s=t.newlines,r=this._options.keep_array_indentation&&T(this._flags.mode);if(t.comments_before)for(n=t.comments_before.next();n;)this.handle_whitespace_and_comments(n,e),this.handle_token(n,e),n=t.comments_before.next();if(r)for(i=0;ithis._options.max_preserve_newlines&&(s=this._options.max_preserve_newlines),this._options.preserve_newlines&&1this._flags.parent.indentation_level)&&(--this._flags.indentation_level,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},A.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},A.prototype.restore_mode=function(){0"!==this._flags.last_token.text)&&(x(this._flags.last_token.type,[k.EQUALS,k.START_EXPR,k.COMMA,k.OPERATOR])||E(this._flags.last_token,["return","throw","import","default"]))?this.set_mode(a):this.set_mode(d),_=(i=!e.comments_before&&"}"===e.text)&&"function"===this._flags.last_word&&this._flags.last_token.type===k.END_EXPR,this._options.brace_preserve_inline){s=0,r=null,this._flags.inline_frame=!0;do{if(s+=1,(r=this._tokens.peek(s-1)).newlines){this._flags.inline_frame=!1;break}}while(r.type!==k.EOF&&(r.type!==k.END_BLOCK||r.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==k.OPERATOR&&(_||this._flags.last_token.type===k.EQUALS||E(this._flags.last_token,p)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!T(this._previous_flags.mode)||this._flags.last_token.type!==k.START_EXPR&&this._flags.last_token.type!==k.COMMA||(this._flags.last_token.type!==k.COMMA&&!this._options.space_in_paren||(this._output.space_before_token=!0),(this._flags.last_token.type===k.COMMA||this._flags.last_token.type===k.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==k.OPERATOR&&this._flags.last_token.type!==k.START_EXPR&&(this._flags.last_token.type!==k.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent(),i||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},A.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===f;)this.restore_mode();var e=this._flags.last_token.type===k.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(T(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},A.prototype.handle_word=function(t){var e;if(t.type===k.RESERVED&&(x(t.text,["set","get"])&&this._flags.mode!==a||"import"===t.text&&"("===this._tokens.peek().text||x(t.text,["as","from"])&&!this._flags.import_block||this._flags.mode===a&&":"===this._tokens.peek().text)&&(t.type=k.WORD),this.start_of_statement(t)?E(this._flags.last_token,["var","let","const"])&&t.type===k.WORD&&(this._flags.declaration_statement=!0):!t.newlines||R(this._flags.mode)||this._flags.last_token.type===k.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===k.EQUALS||!this._options.preserve_newlines&&E(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(v(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&v(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}return this._flags.in_case_statement&&E(t,["case","default"])?(this.print_newline(),this._flags.last_token.type!==k.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0)):(this._flags.last_token.type!==k.COMMA&&this._flags.last_token.type!==k.START_EXPR&&this._flags.last_token.type!==k.EQUALS&&this._flags.last_token.type!==k.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),v(t,"function")?((x(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!x(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==k.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===k.RESERVED||this._flags.last_token.type===k.WORD?E(this._flags.last_token,["get","set","new","export"])||E(this._flags.last_token,u)||v(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===k.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:!this._flags.multiline_frame&&(R(this._flags.mode)||T(this._flags.mode))||this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text)):(e="NONE",this._flags.last_token.type===k.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":!E(t,["else","catch","finally","from"])||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):this._flags.last_token.type===k.SEMICOLON&&this._flags.mode===d?e="NEWLINE":this._flags.last_token.type===k.SEMICOLON&&R(this._flags.mode -)?e="SPACE":this._flags.last_token.type===k.STRING?e="NEWLINE":this._flags.last_token.type===k.RESERVED||this._flags.last_token.type===k.WORD||"*"===this._flags.last_token.text&&(x(this._last_last_text,["function","yield"])||this._flags.mode===a&&x(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===k.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===k.END_EXPR&&(this._output.space_before_token=!0,e="NEWLINE"),E(t,y)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),E(t,["else","catch","finally"])?(this._flags.last_token.type!==k.END_BLOCK||this._previous_flags.mode!==d||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?E(this._flags.last_token,p)||"declare"===this._flags.last_token.text&&E(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==k.END_EXPR?this._flags.last_token.type===k.START_EXPR&&E(t,["var","let","const"])||":"===this._flags.last_token.text||(v(t,"if")&&v(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):E(t,y)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&T(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0),!t.previous||t.previous.type!==k.WORD&&t.previous.type!==k.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,void(t.type===k.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&v(t,"from")&&(this._flags.import_block=!1)))))},A.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==f||this._flags.if_block&&v(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},A.prototype.handle_string=function(t){this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===k.RESERVED||this._flags.last_token.type===k.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===k.COMMA||this._flags.last_token.type===k.START_EXPR||this._flags.last_token.type===k.EQUALS||this._flags.last_token.type===k.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):this.print_newline()),this.print_token(t)},A.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},A.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(R(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===a||this._flags.mode===f&&this._flags.parent.mode===a?(this._flags.mode===f&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},A.prototype.handle_operator=function(t){var e,n,i,_,s,r,a,o,u="*"===t.text&&(E(this._flags.last_token,["function","yield"])||x(this._flags.last_token.type,[k.START_BLOCK,k.COMMA,k.END_BLOCK,k.SEMICOLON])),h=x(t.text,["-","+"])&&(x(this._flags.last_token.type,[k.START_BLOCK,k.START_EXPR,k.EQUALS,k.OPERATOR])||x(this._flags.last_token.text,y)||","===this._flags.last_token.text);if(this.start_of_statement(t)||(e=!u,this.handle_whitespace_and_comments(t,e)),E(this._flags.last_token,p))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==k.DOT)if("::"!==t.text){if(this._flags.last_token.type===k.OPERATOR&&x(this._options.operator_position,c)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==k.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0);if(_=!(i=n=!0),":"===t.text?0===this._flags.ternary_depth?n=!1:(--this._flags.ternary_depth,_=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!h&&!u&&this._options.preserve_newlines&&x(t.text,w))switch(r=(s=":"===t.text)&&_,a=s&&!_,this._options.operator_position){case l.before_newline:return this._output.space_before_token=!a,this.print_token(t),s&&!r||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case l.after_newline:return this._output.space_before_token=!0,!s||r?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case l.preserve_newline:return a||this.allow_wrap_or_preserved_newline(t),n=!(this._output.just_added_newline()||a),this._output.space_before_token=n,this.print_token(t),void(this._output.space_before_token=!0)}u?(this.allow_wrap_or_preserved_newline(t),n=!1,i=(o=this._tokens.peek())&&x(o.type,[k.WORD,k.RESERVED])):"..."===t.text?(this.allow_wrap_or_preserved_newline(t),n=this._flags.last_token.type===k.START_BLOCK,i=!1):(x(t.text,["--","++","!","~"] -)||h)&&(this._flags.last_token.type!==k.COMMA&&this._flags.last_token.type!==k.START_EXPR||this.allow_wrap_or_preserved_newline(t),i=n=!1,!t.newlines||"--"!==t.text&&"++"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&R(this._flags.mode)&&(n=!0),this._flags.last_token.type===k.RESERVED?n=!0:this._flags.last_token.type===k.END_EXPR?n=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===k.OPERATOR&&(n=x(t.text,["--","-","++","+"])&&x(this._flags.last_token.text,["--","-","++","+"]),x(t.text,["+","-"])&&x(this._flags.last_token.text,["--","++"])&&(i=!0)),(this._flags.mode!==d||this._flags.inline_frame)&&this._flags.mode!==f||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()),this._output.space_before_token=this._output.space_before_token||n,this.print_token(t),this._output.space_before_token=i}else this.print_token(t);else this.print_token(t)},A.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):g.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},A.prototype.print_block_commment=function(t,e){var n,i=function o(t){for(var e=[],n=(t=t.replace(g.allLineBreaks,"\n")).indexOf("\n");-1!==n;)e.push(t.substring(0,n)),n=(t=t.substring(n+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),_=!1,s=!1,r=t.whitespace_before,a=r.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(i[0]),this.print_newline(!1,e),1this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},_.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),--t.__character_count),!0}return!1},_.prototype.is_empty=function(){ -return 0===this.__items.length},_.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},_.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},_.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},_.prototype._remove_indent=function(){0=this.__cache.length;)this.__add_column()},i.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},s.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(t){var e,n;return this.trim(!0),(e=this.current_line.pop())&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline(),n=this.__lines.join("\n"),"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),1>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),o=(o="\\?\\.(?!\\d) "+(o=(o=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |").replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|"),h=new RegExp(o),l=(p="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(",")).concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),c=new RegExp("^(?:"+l.join("|")+")$"),(f=function(t,e){var n,i;m.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source),n=new k(this._input),i=new x(this._input).read_options(this._options),this.__patterns={template:i,identifier:i.starting_with(w.identifier).matching(w.identifierMatch),number:n.matching(s),punct:n.matching(h),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(//),include:n.starting_with(/#include/).until_after(w.lineBreak),shebang:n.starting_with(/#!/).until_after(w.lineBreak),xml:n.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:i.until(/['\\\n\r\u2028\u2029]/),double_quote:i.until(/["\\\n\r\u2028\u2029]/),template_text:i.until(/[`\\$]/),template_expression:i.until(/[`}\\]/)}}).prototype=new m,f.prototype._is_comment=function(t){return t.type===u.COMMENT||t.type===u.BLOCK_COMMENT||t.type===u.UNKNOWN},f.prototype._is_opening=function(t){return t.type===u.START_BLOCK||t.type===u.START_EXPR},f.prototype._is_closing=function(t,e){return(t.type===u.END_BLOCK||t.type===u.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},f.prototype._reset=function(){d=!1},f.prototype._get_next_token=function(t,e){var n,i=null;return this._readWhitespace(),null===(n=this._input.peek())?this._create_token(u.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(n))||this._read_string(n))||this._read_word(t))||this._read_singles(n))||this._read_comment(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_punctuation())||this._create_token(u.UNKNOWN,this._input.next())},f.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(w.allLineBreaks,"\n"),t.type!==u.DOT&&(t.type!==u.RESERVED||"set"!==t.text&&"get"!==t.text)&&c.test(e)?"in"===e||"of"===e?this._create_token(u.OPERATOR,e):this._create_token(u.RESERVED,e):this._create_token(u.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(u.WORD,e):void 0},f.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(u.START_EXPR,t):")"===t||"]"===t?e=this._create_token(u.END_EXPR,t):"{"===t?e=this._create_token(u.START_BLOCK,t):"}"===t?e=this._create_token(u.END_BLOCK,t):";"===t?e=this._create_token(u.SEMICOLON,t):"."===t&&r.test(this._input.peek(1))?e=this._create_token(u.DOT,t):","===t&&(e=this._create_token(u.COMMA,t)),e&&this._input.next(),e},f.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(u.EQUALS,t):"?."===t?this._create_token(u.DOT,t):this._create_token(u.OPERATOR,t)},f.prototype._read_non_javascript=function(t){var e,n="";if("#"===t){if(this._is_first_token()&&(n=this.__patterns.shebang.read()))return this._create_token(u.UNKNOWN,n.trim()+"\n");if(n=this.__patterns.include.read())return this._create_token(u.UNKNOWN,n.trim()+"\n");if(t=this._input.next(),e="#",this._input.hasNext()&&this._input.testChar(i)){for(;e+=t=this._input.next(),this._input.hasNext()&&"#"!==t&&"="!==t;);return"#"===t||( -"["===this._input.peek()&&"]"===this._input.peek(1)?(e+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(e+="{}",this._input.next(),this._input.next())),this._create_token(u.WORD,e)}this._input.back()}else if("<"===t&&this._is_first_token()){if(n=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(w.newline);)n+=this._input.next();return d=!0,this._create_token(u.COMMENT,n)}}else if(d&&"-"===t&&(n=this.__patterns.html_comment_end.read()))return d=!1,this._create_token(u.COMMENT,n);return null},f.prototype._read_comment=function(t){var e,n,i=null;return"/"===t&&(e="","*"===this._input.peek(1)?(e=this.__patterns.block_comment.read(),(n=_.get_directives(e))&&"start"===n.ignore&&(e+=_.readIgnored(this._input)),e=e.replace(w.allLineBreaks,"\n"),(i=this._create_token(u.BLOCK_COMMENT,e)).directives=n):"/"===this._input.peek(1)&&(e=this.__patterns.comment.read(),i=this._create_token(u.COMMENT,e))),i},f.prototype._read_string=function(t){if("`"!==t&&"'"!==t&&'"'!==t)return null;var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function s(t){var e="",n=0,i=new g(t),_=null;for(;i.hasNext();)if((_=i.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=_[0]),"\\"===i.peek()){if(i.next(),"x"===i.peek())_=i.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==i.peek()){e+="\\",i.hasNext()&&(e+=i.next());continue}_=i.match(/u([0-9A-Fa-f]{4})/g)}if(!_)return t;if(126<(n=parseInt(_[1],16))&&n<=255&&0===_[0].indexOf("x"))return t;if(0<=n&&n<32){e+="\\"+_[0];continue}e+=34===n||39===n||92===n?"\\"+String.fromCharCode(n):String.fromCharCode(n)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(w.allLineBreaks,"\n"),this._create_token(u.STRING,e)},f.prototype._allow_regexp_or_xml=function(t){return t.type===u.RESERVED&&v(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===u.END_EXPR&&")"===t.text&&t.opened.previous.type===u.RESERVED&&v(t.opened.previous.text,["if","while","for"])||v(t.type,[u.COMMENT,u.START_EXPR,u.START_BLOCK,u.START,u.END_BLOCK,u.OPERATOR,u.EQUALS,u.EOF,u.SEMICOLON,u.COMMA])},f.prototype._read_regexp=function(t,e){var n,i,_;if("/"===t&&this._allow_regexp_or_xml(e)){for(n=this._input.next(),_=i=!1;this._input.hasNext()&&(i||_||this._input.peek()!==t)&&!this._input.testChar(w.newline);)n+=this._input.peek(),i?i=!1:(i="\\"===this._input.peek(),"["===this._input.peek()?_=!0:"]"===this._input.peek()&&(_=!1)),this._input.next();return this._input.peek()===t&&(n+=this._input.next(),n+=this._input.read(w.identifier)),this._create_token(u.STRING,n)}return null},f.prototype._read_xml=function(t,e){var n,i,_,s,r,a,o;if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)&&(n="",i=this.__patterns.xml.read_match())){for(s=0===(_=i[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}")).indexOf("{"),r=0;i&&(a=!!i[1],o=i[2],!(!!i[i.length-1]||"![CDATA["===o.slice(0,8))&&(o===_||s&&o.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(a?--r:++r),n+=i[0],!(r<=0));)i=this.__patterns.xml.read_match();return i||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(w.allLineBreaks,"\n"),this._create_token(u.STRING,n)}return null},f.prototype._read_string_recursive=function(t,e,n){var i,_,s,r;for("'"===t?_=this.__patterns.single_quote:'"'===t?_=this.__patterns.double_quote:"`"===t?_=this.__patterns.template_text:"}"===t&&(_=this.__patterns.template_expression),s=_.read(),r="";this._input.hasNext();){if((r=this._input.next())===t||!e&&w.newline.test(r)){this._input.back();break}"\\"===r&&this._input.hasNext()?("x"===(i=this._input.peek())||"u"===i?this.has_char_escapes=!0:"\r"===i&&"\n"===this._input.peek(1)&&this._input.next(),r+=this._input.next()):n&&("${"===n&&"$"===r&&"{"===this._input.peek()&&(r+=this._input.next()),n===r&&(r+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(r+=this._input.next()))),s+=r+=_.read()}return s},t.exports.Tokenizer=f,t.exports.TOKEN=u,t.exports.positionable_operators=a.slice(),t.exports.line_starters=p.slice()},function(t,e,n){"use strict";var _=RegExp.prototype.hasOwnProperty("sticky");function i(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}i.prototype.restart=function(){this.__position=0},i.prototype.back=function(){0=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=i},function(t,e,n){"use strict";var i=n(8).InputScanner,s=n(3).Token,r=n(10).TokenStream,_=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(t,e){this._input=new i(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new _(this._input)};o.prototype.tokenize=function(){var t,e,n,i,_;for(this._input.restart(),this.__tokens=new r,this._reset(),e=new s(a.START,""),n=null,i=[],_=new r;e.type!==a.EOF;){for(t=this._get_next_token(e,n);this._is_comment(t);)_.add(t),t=this._get_next_token(e,n);_.isEmpty()||(t.comments_before=_,_=new r),t.parent=n,this._is_opening(t)?(i.push(n),n=t):n&&this._is_closing(t,n)&&((t.opened=n).closed=t,n=i.pop(),t.parent=n),(t.previous=e).next=t,this.__tokens.add(t),e=t}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},o.prototype._is_comment=function(t){return!1},o.prototype._is_opening=function(t){return!1},o.prototype._is_closing=function(t,e){return!1},o.prototype._create_token=function(t,e){return new s(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},t.exports.Tokenizer=o,t.exports.TOKEN=a},function(t,e,n){"use strict";function i(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}i.prototype.restart=function(){this.__position=0},i.prototype.isEmpty=function(){return 0===this.__tokens_length},i.prototype.hasNext=function(){return this.__position/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/)}}(s.prototype=new i)._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},s.prototype.read_options=function(t){var e,n=this._create();for(e in _)n._disabled[e]=-1===t.templating.indexOf(e);return n._update(),n},s.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},s.prototype.read=function(){var t,e="";for(e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern),t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},s.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},s.prototype._read_template=function(){var t,e="",n=this._input.peek();return"<"===n?(t=this._input.peek(1),this._disabled.php||this._excluded.php||"?"!==t||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==t||(e=e||this.__patterns.erb.read())):"{"===n&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read()))),e},t.exports.TemplatablePattern=s}],y.c=i,y.d=function(t,e,n){y.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},y.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},y.t=function(e,t){var n,i;if(1&t&&(e=y(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;if(n=Object.create(null),y.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(i in e)y.d(n,i,function(t){return e[t]}.bind(null,i));return n},y.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return y.d(e,"a",e),e},y.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},y.p="",_=y(y.s=0),s=_,"function"==typeof m&&m.amd?m([],function(){return{js_beautify:s}}):void 0!==g?g.js_beautify=s:"undefined"!=typeof window?window.js_beautify=s:"undefined"!=typeof global&&(global.js_beautify=s),a={},w.m=r=[,,function(t,e,n){"use strict";function _(t){this.__parent=t,this.__character_count=0,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=[]}function i(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",0this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},_.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count), -t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),--t.__character_count),!0}return!1},_.prototype.is_empty=function(){return 0===this.__items.length},_.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},_.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},_.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},_.prototype._remove_indent=function(){0=this.__cache.length;)this.__add_column()},i.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},s.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(t){var e,n;return this.trim(!0),(e=this.current_line.pop())&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline(),n=this.__lines.join("\n"),"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),1=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=i},,,,,function(t,e,n){"use strict";function i(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}i.prototype.get_directives=function(t){var e,n;if(!t.match(this.__directives_block_pattern))return null;for(e={},this.__directive_pattern.lastIndex=0,n=this.__directive_pattern.exec(t);n;)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e},i.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},t.exports.Directives=i},,function(t,e,n){"use strict";var i=n(16).Beautifier,_=n(17).Options;t.exports=function s(t,e){return new i(t,e).beautify()},t.exports.defaultOptions=function(){return new _}},function(t,e,n){"use strict";var i=n(17).Options,f=n(2).Output,g=n(8).InputScanner,_=n(13).Directives,m=new _(/\/\*/,/\*\//),b=/\r\n|[\r\n]/,y=/\r\n|[\r\n]/g,w=/\s/,k=/(?:\s|\n)+/g,x=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,v=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function s(t,e){this._source_text=t||"",this._options=new i(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}s.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},s.prototype.eatWhitespace=function(t){for(var e=w.test(this._input.peek()),n=!0;w.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(this._options.preserve_newlines||n)&&(n=!1,this._output.add_new_line(!0));return e},s.prototype.foundNestedPseudoClass=function(){for(var t=0,e=1,n=this._input.peek(e);n;){if("{"===n)return!0;if("("===n)t+=1;else if(")"===n){if(0===t)return!1;--t}else if(";"===n||"}"===n)return!1;e++,n=this._input.peek(e)}return!1},s.prototype.print_string=function(t){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(t)},s.prototype.preserveSingleSpace=function(t){t&&(this._output.space_before_token=!0)},s.prototype.indent=function(){this._indentLevel++},s.prototype.outdent=function(){ -0=this._nestedLevel):this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&_&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===p&&this._output.trim(!0),a=o=!1,s&&(this.outdent(),s=!1),this.print_string(this._ch),_=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!_&&!r||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||a||0!==i?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),s||(s=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(h),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?0===i?(s&&(this.outdent(),s=!1),o=a=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),i++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),i&&(i--,this.outdent()))):(this.preserveSingleSpace(h),this.print_string(this._ch),this.eatWhitespace(),i++,this.indent()):")"===this._ch?(i&&(i--,this.outdent()),this.print_string(this._ch)):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||s||0!==i||o?this._output.space_before_token=!0:this._output.add_new_line()):">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||s||0!==i?"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(h),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),w.test(this._ch)&&(this._ch="")):("!"!==this._ch||this._input.lookBack("\\")?this.preserveSingleSpace(h):this.print_string(" "),this.print_string(this._ch)):this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&w.test(this._ch)&&(this._ch=""));return this._output.get_code(e)},t.exports.Beautifier=s},function(t,e,n){"use strict";var _=n(6).Options;function i(t){var e,n,i;for(_.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0),e=this._get_boolean("space_around_selector_separator"),this.space_around_combinator=this._get_boolean("space_around_combinator")||e,n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]),this.brace_style="collapse",i=0;ithis.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},_.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),--t.__character_count),!0}return!1},_.prototype.is_empty=function(){return 0===this.__items.length},_.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},_.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},_.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},_.prototype._remove_indent=function(){0=this.__cache.length;)this.__add_column()},i.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},s.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(t){var e,n;return this.trim(!0),(e=this.current_line.pop())&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline(),n=this.__lines.join("\n"),"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),1=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=i},function(t,e,n){"use strict";var i=n(8).InputScanner,s=n(3).Token,r=n(10).TokenStream,_=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(t,e){this._input=new i(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new _(this._input)};o.prototype.tokenize=function(){var t,e,n,i,_;for(this._input.restart(),this.__tokens=new r,this._reset(),e=new s(a.START,""),n=null,i=[],_=new r;e.type!==a.EOF;){for(t=this._get_next_token(e,n);this._is_comment(t);)_.add(t),t=this._get_next_token(e,n);_.isEmpty()||(t.comments_before=_,_=new r),t.parent=n,this._is_opening(t)?(i.push(n),n=t):n&&this._is_closing(t,n)&&((t.opened=n).closed=t,n=i.pop(),t.parent=n),(t.previous=e).next=t,this.__tokens.add(t),e=t}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},o.prototype._is_comment=function(t){return!1},o.prototype._is_opening=function(t){return!1},o.prototype._is_closing=function(t,e){return!1},o.prototype._create_token=function(t,e){return new s(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},t.exports.Tokenizer=o,t.exports.TOKEN=a},function(t,e,n){"use strict";function i(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}i.prototype.restart=function(){this.__position=0},i.prototype.isEmpty=function(){return 0===this.__tokens_length},i.prototype.hasNext=function(){return this.__position/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/)}}(s.prototype=new i)._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},s.prototype.read_options=function(t){var e,n=this._create();for(e in _)n._disabled[e]=-1===t.templating.indexOf(e);return n._update(),n},s.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},s.prototype.read=function(){var t,e="";for(e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern),t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},s.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},s.prototype._read_template=function(){var t,e="",n=this._input.peek();return"<"===n?(t=this._input.peek(1),this._disabled.php||this._excluded.php||"?"!==t||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==t||(e=e||this.__patterns.erb.read())):"{"===n&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read()))),e},t.exports.TemplatablePattern=s},,,,function(t,e,n){"use strict";var _=n(19).Beautifier,i=n(20).Options;t.exports=function s(t,e,n,i){return new _(t,e,n,i).beautify()},t.exports.defaultOptions=function(){return new i}},function(t,e,n){"use strict";var _,r,u,i,s,a=n(20).Options,o=n(2).Output,h=n(21).Tokenizer,p=n(21).TOKEN,l=/\r\n|[\r\n]/,c=/\r\n|[\r\n]/g,d=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new o(t,e)};function f(t,e){return-1!==e.indexOf(t)}function g(t,e,n){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=n||0,this.parser_token=e||null}function m(t){this._printer=t,this._current_frame=null}function b(t,e,n,i){this._source_text=t||"",e=e||{},this._js_beautify=n,this._css_beautify=i,this._tag_stack=null;var _=new a(e,"html");this._options=_,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}d.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},d.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},d.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},d.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},d.prototype.print_preserved_newlines=function(t){var e,n=0;for(t.type!==p.TEXT&&t.previous.type!==p.TEXT&&(n=t.newlines?1:0),this.preserve_newlines&&(n=t.newlines|]]>)$/.exec(i)))return void t.add_raw_token(e);r=o+u[1]+"\n",i=u[4],u[5]&&(a=o+u[5]),i=i.replace(/\n[ \t]*$/,""),(u[2]||-1!==u[3].indexOf("\n"))&&(u=u[3].match(/[ \t]+$/))&&(e.whitespace_before=u[0])}i=i&&(_?((h=function(){this.eol="\n"}).prototype=this._options.raw_options,_(o+i,new h)):((p=e.whitespace_before)&&(i=i.replace(new RegExp("\n("+p+")?","g"),"\n")),o+i.replace(/\n/g,"\n"+o))),r&&(i=i?r+i+"\n"+a:r+a),t.print_newline(!1),i&&(e.text=i,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},b.prototype._handle_tag_open=function(t,e,n,i){var _=this._get_tag_open_token(e);return!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||e.type!==p.TAG_OPEN||0!==e.text.indexOf("]*)/),this.tag_check=n?n[1]:""):(n=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=n?n[1]:"","{{#>"===e.text&&">"===this.tag_check&&null!==e.next&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===p.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0),this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0},b.prototype._get_tag_open_token=function(t){var e=new u(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||f(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&f(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&f(e.tag_check,this._options.content_unformatted),e.is_inline_element=f(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},b.prototype._set_tag_position=function(t,e,n,i,_){var s;n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=r(n.tag_check,e)))),f(n.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),n.is_empty_element?("{"===n.tag_start_char&&"else"===n.tag_check&&(this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1)),"!--"===n.tag_name&&_.type===p.TAG_CLOSE&&i.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n))):n.is_end_tag?(s=!1,s=(s=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(i.is_inline_element||i.is_unformatted)&&!(_.type===p.TAG_CLOSE&&n.start_tag_token===i)&&"TK_CONTENT"!==_.type,(n.is_content_unformatted||n.is_unformatted)&&(s=!1),s&&t.print_newline(!1)):(n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===_.type&&!n.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n))},b.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)},i=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],s=["a","audio","del","ins","map","noscript","video"],b.prototype._do_optional_end_element=function(t){var e,n=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent)return"body"===t.tag_name?n=n||this._tag_stack.try_pop("head"):"li"===t.tag_name?n=n||this._tag_stack.try_pop("li",["ol","ul"]):"dd"===t.tag_name||"dt"===t.tag_name?n=(n=n||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]):"p"===t.parent.tag_name&&-1!==i.indexOf(t.tag_name)?(e=t.parent.parent)&&-1!==s.indexOf(e.tag_name)||(n=n||this._tag_stack.try_pop("p")):"rp"===t.tag_name||"rt"===t.tag_name?n=(n=n||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?n=n||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?n=n||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?n=n||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?n=(n=n||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?n=(n=(n=(n=n||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?n=(n=(n=n||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(n=(n=n||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"])),t.parent=this._tag_stack.get_parser_token(),n},t.exports.Beautifier=b},function(t,e,n){"use strict";var i=n(6).Options;function _(t){i.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(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",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),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"]),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","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","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"])}_.prototype=new i,t.exports.Options=_},function(t,e,n){"use strict";var s=n(9).Tokenizer,i=n(9).TOKEN,_=n(13).Directives,r=n(14).TemplatablePattern,a=n(12).Pattern,o={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:i.START,RAW:i.RAW,EOF:i.EOF},u=new _(/<\!--/,/-->/),h=function(t,e){var n,i,_;s.call(this,t,e),this._current_tag_name="",n=new r(this._input).read_options(this._options),i=new a(this._input),this.__patterns={word:n.until(/[\n\r\t <]/),single_quote:n.until_after(/'/),double_quote:n.until_after(/"/),attribute:n.until(/[\n\r\t =>]|\/>/),element_name:n.until(/[\n\r\t >\/]/),handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),handlebars_open:i.until(/[\n\r\t }]/),handlebars_raw_close:i.until(/}}/),comment:i.starting_with(//),cdata:i.starting_with(//),conditional_comment:i.starting_with(//),processing:i.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter&&(_=this._input.get_literal_regexp(this._options.unformatted_content_delimiter),this.__patterns.unformatted_content_delimiter=i.matching(_).until_after(_))};h.prototype=new s,h.prototype._is_comment=function(t){return!1},h.prototype._is_opening=function(t){return t.type===o.TAG_OPEN},h.prototype._is_closing=function(t,e){return t.type===o.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},h.prototype._reset=function(){this._current_tag_name=""},h.prototype._get_next_token=function(t,e){var n,i=null;return this._readWhitespace(),null===(n=this._input.peek())?this._create_token(o.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(n,e))||this._read_attribute(n,t,e))||this._read_close(n,e))||this._read_raw_content(n,t,e))||this._read_content_word(n))||this._read_comment_or_cdata(n))||this._read_processing(n))||this._read_open(n,e))||this._create_token(o.UNKNOWN,this._input.next())},h.prototype._read_comment_or_cdata=function(t){var e=null,n=null,i=null;return"<"===t&&("!"===this._input.peek(1)&&((n=this.__patterns.comment.read())?(i=u.get_directives(n))&&"start"===i.ignore&&(n+=u.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((e=this._create_token(o.COMMENT,n)).directives=i)),e},h.prototype._read_processing=function(t){var e,n=null,i=null,_=null;return"<"===t&&("!"!==(e=this._input.peek(1))&&"?"!==e||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((n=this._create_token(o.COMMENT,i)).directives=_)),n},h.prototype._read_open=function(t,e){var n=null,i=null;return e||"<"===t&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),i=this._create_token(o.TAG_OPEN,n)),i},h.prototype._read_open_handlebars=function(t,e){var n=null,i=null;return e||this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&(i="!"===this._input.peek(2)?(n=(n=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),this._create_token(o.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),this._create_token(o.TAG_OPEN,n))),i},h.prototype._read_close=function(t,e){var n=null,i=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(n=this._input.next(),"/"===t&&(n+=this._input.next()),i=this._create_token(o.TAG_CLOSE,n)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),i=this._create_token(o.TAG_CLOSE,"}}"))),i},h.prototype._read_attribute=function(t,e,n){var i,_=null,s="";return n&&"<"===n.text[0]&&("="===t?_=this._create_token(o.EQUALS,this._input.next()):'"'===t||"'"===t?(i=this._input.next(),i+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),_=this._create_token(o.VALUE,i)):(s=this.__patterns.attribute.read())&&(_=e.type===o.EQUALS?this._create_token(o.VALUE,s):this._create_token(o.ATTRIBUTE,s))),_},h.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},h.prototype._read_raw_content=function(t,e,n){var i,_,s="";if(n&&"{"===n.text[0])s=this.__patterns.handlebars_raw_close.read();else if(e.type===o.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0])if("script"===(i=e.opened.text.substr(1).toLowerCase())||"style"===i){if(_=this._read_comment_or_cdata(t))return _.type=o.TEXT,_;s=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(i)&&(s=this._input.readUntil(new RegExp("","ig")));return s?this._create_token(o.TEXT,s):null},h.prototype._read_content_word=function(t){var e="";if( -this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e=e||this.__patterns.word.read())return this._create_token(o.TEXT,e)},t.exports.Tokenizer=h,t.exports.TOKEN=o}],k.c=c,k.d=function(t,e,n){k.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},k.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},k.t=function(e,t){var n,i;if(1&t&&(e=k(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;if(n=Object.create(null),k.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(i in e)k.d(n,i,function(t){return e[t]}.bind(null,i));return n},k.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return k.d(e,"a",e),e},k.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},k.p="",d=k(k.s=18),f=d,"function"==typeof m&&m.amd?m(["require","./beautify","./beautify-css"],function(t){var n=t("./beautify"),i=t("./beautify-css");return{html_beautify:function(t,e){return f(t,e,n.js_beautify,i.css_beautify)}}}):void 0!==g?(h=b("./beautify.js"),p=b("./beautify-css.js"),g.html_beautify=function(t,e){return f(t,e,h.js_beautify,p.css_beautify)}):"undefined"!=typeof window?window.html_beautify=function(t,e){return f(t,e,window.js_beautify,window.css_beautify)}:"undefined"!=typeof global&&(global.html_beautify=function(t,e){return f(t,e,global.js_beautify,global.css_beautify)})},"@VERSION@"); \ No newline at end of file +YUI.add("moodle-atto_html-beautify",function(t,e){var n,i,r,_,a,s,o,h,u={},p=null,l=function(){return u};l(),t.namespace("M.atto_html").beautify=u,function(){"use strict";var t,i=[function(t,e,n){var i=n(1).Beautifier,_=n(5).Options;t.exports=function s(t,e){return new i(t,e).beautify()},t.exports.defaultOptions=function(){return new _}},function(t,e,n){var p,l,c,d,f,a,_,s,r,o,h,i=n(2).Output,u=n(3).Token,g=n(4),m=n(5).Options,b=n(7).Tokenizer,y=n(7).line_starters,w=n(7).positionable_operators,k=n(7).TOKEN;function x(t,e){return-1!==e.indexOf(t)}function v(t,e){return t&&t.type===k.RESERVED&&t.text===e}function E(t,e){return t&&t.type===k.RESERVED&&x(t.text,e)}function O(t,e){e.multiline_frame||e.mode===s||e.mode===r||t.remove_indent(e.start_line_index)}function T(t){return t===_}function R(t){return x(t,[o,s,r])}function A(t,e){e=e||{},this._source_text=t||"",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 m(e)}p=["case","return","do","if","throw","else","await","break","continue","async"],l=function N(t){var e,n={};for(e=0;en&&(n=t.line_indent_level)),{mode:e,parent:t,last_token:t?t.last_token:new u(k.START_BLOCK,""),last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,alignment:0,line_indent_level:t?t.line_indent_level:n,start_line_index:this._output.get_line_number(),ternary_depth:0}},A.prototype._reset=function(t){var e,n=t.match(/^[\t ]*/)[0];return this._last_last_text="",this._output=new i(this._options,n),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d),e=new b(t,this._options),this._tokens=e.tokenize(),t},A.prototype.beautify=function(){var t,e,n;if(this._options.disabled)return this._source_text;for(t=this._reset(this._source_text),e=this._options.eol,"auto"===this._options.eol&&(e="\n",t&&g.lineBreak.test(t||"")&&(e=t.match(g.lineBreak)[0])),n=this._tokens.next();n;)this.handle_token(n),this._last_last_text=this._flags.last_token.text,this._flags.last_token=n,n=this._tokens.next();return this._output.get_code(e)},A.prototype.handle_token=function(t,e){t.type===k.START_EXPR?this.handle_start_expr(t):t.type===k.END_EXPR?this.handle_end_expr(t):t.type===k.START_BLOCK?this.handle_start_block(t):t.type===k.END_BLOCK?this.handle_end_block(t):t.type===k.WORD||t.type===k.RESERVED?this.handle_word(t):t.type===k.SEMICOLON?this.handle_semicolon(t):t.type===k.STRING?this.handle_string(t):t.type===k.EQUALS?this.handle_equals(t):t.type===k.OPERATOR?this.handle_operator(t):t.type===k.COMMA?this.handle_comma(t):t.type===k.BLOCK_COMMENT?this.handle_block_comment(t,e):t.type===k.COMMENT?this.handle_comment(t,e):t.type===k.DOT?this.handle_dot(t):t.type===k.EOF?this.handle_eof(t):(t.type,k.UNKNOWN,this.handle_unknown(t,e))},A.prototype.handle_whitespace_and_comments=function(t,e){var n,i,_,s=t.newlines,r=this._options.keep_array_indentation&&T(this._flags.mode);if(t.comments_before)for(n=t.comments_before.next();n;)this.handle_whitespace_and_comments(n,e),this.handle_token(n,e),n=t.comments_before.next();if(r)for(i=0;ithis._options.max_preserve_newlines&&(s=this._options.max_preserve_newlines),this._options.preserve_newlines&&1this._flags.parent.indentation_level)&&(--this._flags.indentation_level,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},A.prototype.set_mode=function(t){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,t),this._flags=this.create_flags(this._previous_flags,t),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},A.prototype.restore_mode=function(){0"!==this._flags.last_token.text)&&(x(this._flags.last_token.type,[k.EQUALS,k.START_EXPR,k.COMMA,k.OPERATOR])||E(this._flags.last_token,["return","throw","import","default"]))?this.set_mode(a):this.set_mode(d),_=(i=!e.comments_before&&"}"===e.text)&&"function"===this._flags.last_word&&this._flags.last_token.type===k.END_EXPR,this._options.brace_preserve_inline){s=0,r=null,this._flags.inline_frame=!0;do{if(s+=1,(r=this._tokens.peek(s-1)).newlines){this._flags.inline_frame=!1;break}}while(r.type!==k.EOF&&(r.type!==k.END_BLOCK||r.opened!==t))}("expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==k.OPERATOR&&(_||this._flags.last_token.type===k.EQUALS||E(this._flags.last_token,p)&&"else"!==this._flags.last_token.text)?this._output.space_before_token=!0:this.print_newline(!1,!0):(!T(this._previous_flags.mode)||this._flags.last_token.type!==k.START_EXPR&&this._flags.last_token.type!==k.COMMA||(this._flags.last_token.type!==k.COMMA&&!this._options.space_in_paren||(this._output.space_before_token=!0),(this._flags.last_token.type===k.COMMA||this._flags.last_token.type===k.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(t),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==k.OPERATOR&&this._flags.last_token.type!==k.START_EXPR&&(this._flags.last_token.type!==k.START_BLOCK||this._flags.inline_frame?this._output.space_before_token=!0:this.print_newline())),this.print_token(t),this.indent(),i||this._options.brace_preserve_inline&&this._flags.inline_frame||this.print_newline()},A.prototype.handle_end_block=function(t){for(this.handle_whitespace_and_comments(t);this._flags.mode===f;)this.restore_mode();var e=this._flags.last_token.type===k.START_BLOCK;this._flags.inline_frame&&!e?this._output.space_before_token=!0:"expand"===this._options.brace_style?e||this.print_newline():e||(T(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(t)},A.prototype.handle_word=function(t){var e;if(t.type===k.RESERVED&&(x(t.text,["set","get"])&&this._flags.mode!==a||"import"===t.text&&"("===this._tokens.peek().text||x(t.text,["as","from"])&&!this._flags.import_block||this._flags.mode===a&&":"===this._tokens.peek().text)&&(t.type=k.WORD),this.start_of_statement(t)?E(this._flags.last_token,["var","let","const"])&&t.type===k.WORD&&(this._flags.declaration_statement=!0):!t.newlines||R(this._flags.mode)||this._flags.last_token.type===k.OPERATOR&&"--"!==this._flags.last_token.text&&"++"!==this._flags.last_token.text||this._flags.last_token.type===k.EQUALS||!this._options.preserve_newlines&&E(this._flags.last_token,["var","let","const","set","get"])?this.handle_whitespace_and_comments(t):(this.handle_whitespace_and_comments(t),this.print_newline()),this._flags.do_block&&!this._flags.do_while){if(v(t,"while"))return this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0,void(this._flags.do_while=!0);this.print_newline(),this._flags.do_block=!1}if(this._flags.if_block)if(!this._flags.else_block&&v(t,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}return this._flags.in_case_statement&&E(t,["case","default"])?(this.print_newline(),this._flags.last_token.type!==k.END_BLOCK&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(t),void(this._flags.in_case=!0)):(this._flags.last_token.type!==k.COMMA&&this._flags.last_token.type!==k.START_EXPR&&this._flags.last_token.type!==k.EQUALS&&this._flags.last_token.type!==k.OPERATOR||this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t),v(t,"function")?((x(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!x(this._flags.last_token.text,["(","[","{",":","=",","])&&this._flags.last_token.type!==k.OPERATOR)&&(this._output.just_added_blankline()||t.comments_before||(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===k.RESERVED||this._flags.last_token.type===k.WORD?E(this._flags.last_token,["get","set","new","export"])||E(this._flags.last_token,h)||v(this._flags.last_token,"default")&&"export"===this._last_last_text||"declare"===this._flags.last_token.text?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===k.OPERATOR||"="===this._flags.last_token.text?this._output.space_before_token=!0:!this._flags.multiline_frame&&(R(this._flags.mode)||T(this._flags.mode))||this.print_newline(),this.print_token(t),void(this._flags.last_word=t.text)):(e="NONE",this._flags.last_token.type===k.END_BLOCK?this._previous_flags.inline_frame?e="SPACE":!E(t,["else","catch","finally","from"])||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines?e="NEWLINE":(e="SPACE",this._output.space_before_token=!0):this._flags.last_token.type===k.SEMICOLON&&this._flags.mode===d?e="NEWLINE":this._flags.last_token.type===k.SEMICOLON&&R(this._flags.mode)?e="SPACE":this._flags.last_token.type===k.STRING?e="NEWLINE":this._flags.last_token.type===k.RESERVED||this._flags.last_token.type===k.WORD||"*"===this._flags.last_token.text&&(x(this._last_last_text,["function","yield"])||this._flags.mode===a&&x(this._last_last_text,["{",","]))?e="SPACE":this._flags.last_token.type===k.START_BLOCK?e=this._flags.inline_frame?"SPACE":"NEWLINE":this._flags.last_token.type===k.END_EXPR&&( +this._output.space_before_token=!0,e="NEWLINE"),E(t,y)&&")"!==this._flags.last_token.text&&(e=this._flags.inline_frame||"else"===this._flags.last_token.text||"export"===this._flags.last_token.text?"SPACE":"NEWLINE"),E(t,["else","catch","finally"])?(this._flags.last_token.type!==k.END_BLOCK||this._previous_flags.mode!==d||"expand"===this._options.brace_style||"end-expand"===this._options.brace_style||"none"===this._options.brace_style&&t.newlines)&&!this._flags.inline_frame?this.print_newline():(this._output.trim(!0),"}"!==this._output.current_line.last()&&this.print_newline(),this._output.space_before_token=!0):"NEWLINE"===e?E(this._flags.last_token,p)||"declare"===this._flags.last_token.text&&E(t,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==k.END_EXPR?this._flags.last_token.type===k.START_EXPR&&E(t,["var","let","const"])||":"===this._flags.last_token.text||(v(t,"if")&&v(t.previous,"else")?this._output.space_before_token=!0:this.print_newline()):E(t,y)&&")"!==this._flags.last_token.text&&this.print_newline():this._flags.multiline_frame&&T(this._flags.mode)&&","===this._flags.last_token.text&&"}"===this._last_last_text?this.print_newline():"SPACE"===e&&(this._output.space_before_token=!0),!t.previous||t.previous.type!==k.WORD&&t.previous.type!==k.RESERVED||(this._output.space_before_token=!0),this.print_token(t),this._flags.last_word=t.text,void(t.type===k.RESERVED&&("do"===t.text?this._flags.do_block=!0:"if"===t.text?this._flags.if_block=!0:"import"===t.text?this._flags.import_block=!0:this._flags.import_block&&v(t,"from")&&(this._flags.import_block=!1)))))},A.prototype.handle_semicolon=function(t){this.start_of_statement(t)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(t);for(var e=this._tokens.peek();!(this._flags.mode!==f||this._flags.if_block&&v(e,"else")||this._flags.do_block);)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(t)},A.prototype.handle_string=function(t){t.text.startsWith("`")&&0===t.newlines&&""===t.whitespace_before&&(")"===t.previous.text||this._flags.last_token.type===k.WORD)||(this.start_of_statement(t)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(t),this._flags.last_token.type===k.RESERVED||this._flags.last_token.type===k.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===k.COMMA||this._flags.last_token.type===k.START_EXPR||this._flags.last_token.type===k.EQUALS||this._flags.last_token.type===k.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(t):!t.text.startsWith("`")||this._flags.last_token.type!==k.END_EXPR||"]"!==t.previous.text&&")"!==t.previous.text||0!==t.newlines?this.print_newline():this._output.space_before_token=!0)),this.print_token(t)},A.prototype.handle_equals=function(t){this.start_of_statement(t)||this.handle_whitespace_and_comments(t),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(t),this._output.space_before_token=!0},A.prototype.handle_comma=function(t){this.handle_whitespace_and_comments(t,!0),this.print_token(t),this._output.space_before_token=!0,this._flags.declaration_statement?(R(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)):this._flags.mode===a||this._flags.mode===f&&this._flags.parent.mode===a?(this._flags.mode===f&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(t)},A.prototype.handle_operator=function(t){var e,n,i,_,s,r,a,o,h="*"===t.text&&(E(this._flags.last_token,["function","yield"])||x(this._flags.last_token.type,[k.START_BLOCK,k.COMMA,k.END_BLOCK,k.SEMICOLON])),u=x(t.text,["-","+"])&&(x(this._flags.last_token.type,[k.START_BLOCK,k.START_EXPR,k.EQUALS,k.OPERATOR])||x(this._flags.last_token.text,y)||","===this._flags.last_token.text);if(this.start_of_statement(t)||(e=!h,this.handle_whitespace_and_comments(t,e)),E(this._flags.last_token,p))return this._output.space_before_token=!0,void this.print_token(t);if("*"!==t.text||this._flags.last_token.type!==k.DOT)if("::"!==t.text){if(this._flags.last_token.type===k.OPERATOR&&x(this._options.operator_position,c)&&this.allow_wrap_or_preserved_newline(t),":"===t.text&&this._flags.in_case)return this.print_token(t),this._flags.in_case=!1,this._flags.case_body=!0,void(this._tokens.peek().type!==k.START_BLOCK?(this.indent(),this.print_newline()):this._output.space_before_token=!0);if(_=!(i=n=!0),":"===t.text?0===this._flags.ternary_depth?n=!1:(--this._flags.ternary_depth,_=!0):"?"===t.text&&(this._flags.ternary_depth+=1),!u&&!h&&this._options.preserve_newlines&&x(t.text,w))switch(r=(s=":"===t.text)&&_,a=s&&!_,this._options.operator_position){case l.before_newline:return this._output.space_before_token=!a,this.print_token(t),s&&!r||this.allow_wrap_or_preserved_newline(t),void(this._output.space_before_token=!0);case l.after_newline:return this._output.space_before_token=!0,!s||r?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(t):this._output.space_before_token=!1,this.print_token(t),void(this._output.space_before_token=!0);case l.preserve_newline:return a||this.allow_wrap_or_preserved_newline(t),n=!(this._output.just_added_newline()||a),this._output.space_before_token=n,this.print_token(t),void(this._output.space_before_token=!0)}h?(this.allow_wrap_or_preserved_newline(t),n=!1,i=(o=this._tokens.peek())&&x(o.type,[k.WORD,k.RESERVED])):"..."===t.text?(this.allow_wrap_or_preserved_newline(t),n=this._flags.last_token.type===k.START_BLOCK,i=!1):(x(t.text,["--","++","!","~"])||u)&&(this._flags.last_token.type!==k.COMMA&&this._flags.last_token.type!==k.START_EXPR||this.allow_wrap_or_preserved_newline(t), +i=n=!1,!t.newlines||"--"!==t.text&&"++"!==t.text||this.print_newline(!1,!0),";"===this._flags.last_token.text&&R(this._flags.mode)&&(n=!0),this._flags.last_token.type===k.RESERVED?n=!0:this._flags.last_token.type===k.END_EXPR?n=!("]"===this._flags.last_token.text&&("--"===t.text||"++"===t.text)):this._flags.last_token.type===k.OPERATOR&&(n=x(t.text,["--","-","++","+"])&&x(this._flags.last_token.text,["--","-","++","+"]),x(t.text,["+","-"])&&x(this._flags.last_token.text,["--","++"])&&(i=!0)),(this._flags.mode!==d||this._flags.inline_frame)&&this._flags.mode!==f||"{"!==this._flags.last_token.text&&";"!==this._flags.last_token.text||this.print_newline()),this._output.space_before_token=this._output.space_before_token||n,this.print_token(t),this._output.space_before_token=i}else this.print_token(t);else this.print_token(t)},A.prototype.handle_block_comment=function(t,e){return this._output.raw?(this._output.add_raw_token(t),void(t.directives&&"end"===t.directives.preserve&&(this._output.raw=this._options.test_output_raw))):t.directives?(this.print_newline(!1,e),this.print_token(t),"start"===t.directives.preserve&&(this._output.raw=!0),void this.print_newline(!1,!0)):g.newline.test(t.text)||t.newlines?void this.print_block_commment(t,e):(this._output.space_before_token=!0,this.print_token(t),void(this._output.space_before_token=!0))},A.prototype.print_block_commment=function(t,e){var n,i=function o(t){for(var e=[],n=(t=t.replace(g.allLineBreaks,"\n")).indexOf("\n");-1!==n;)e.push(t.substring(0,n)),n=(t=t.substring(n+1)).indexOf("\n");return t.length&&e.push(t),e}(t.text),_=!1,s=!1,r=t.whitespace_before,a=r.length;if(this.print_newline(!1,e),this.print_token_line_indentation(t),this._output.add_token(i[0]),this.print_newline(!1,e),1this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},_.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),--t.__character_count),!0}return!1},_.prototype.is_empty=function(){return 0===this.__items.length},_.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},_.prototype.push=function(t){this.__items.push(t +);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},_.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},_.prototype._remove_indent=function(){0=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},e.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},e.prototype.get_line_number=function(){return this.__lines.length},e.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},e.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},e.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},e.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},e.prototype.get_code=function(t){var e,n;return this.trim(!0),(e=this.current_line.pop())&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline(),n=this.__lines.join("\n"),"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},e.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},e.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),1>> === !== << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),o=(o="\\?\\.(?!\\d) "+(o=(o=">>>= ... >>= <<= === >>> !== **= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |").replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"))).replace(/ /g,"|"),u=new RegExp(o),l=(p="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(",")).concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),c=new RegExp("^(?:"+l.join("|")+")$"),(f=function(t,e){var n,i;m.call(this,t,e),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source),n=new k(this._input),i=new x(this._input).read_options(this._options),this.__patterns={template:i,identifier:i.starting_with(w.identifier).matching(w.identifierMatch),number:n.matching(s),punct:n.matching(u),comment:n.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:n.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:n.matching(//),include:n.starting_with(/#include/).until_after(w.lineBreak),shebang:n.starting_with(/#!/).until_after(w.lineBreak),xml:n.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/),single_quote:i.until(/['\\\n\r\u2028\u2029]/),double_quote:i.until(/["\\\n\r\u2028\u2029]/),template_text:i.until(/[`\\$]/),template_expression:i.until(/[`}\\]/)}}).prototype=new m,f.prototype._is_comment=function(t){return t.type===h.COMMENT||t.type===h.BLOCK_COMMENT||t.type===h.UNKNOWN},f.prototype._is_opening=function(t){return t.type===h.START_BLOCK||t.type===h.START_EXPR},f.prototype._is_closing=function(t,e){return(t.type===h.END_BLOCK||t.type===h.END_EXPR)&&e&&("]"===t.text&&"["===e.text||")"===t.text&&"("===e.text||"}"===t.text&&"{"===e.text)},f.prototype._reset=function(){d=!1},f.prototype._get_next_token=function(t,e){var n,i=null;return this._readWhitespace(),null===(n=this._input.peek())?this._create_token(h.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_non_javascript(n))||this._read_string(n))||this._read_word(t))||this._read_singles(n))||this._read_comment(n))||this._read_regexp(n,t))||this._read_xml(n,t))||this._read_punctuation())||this._create_token(h.UNKNOWN,this._input.next())},f.prototype._read_word=function(t){var e;return""!==(e=this.__patterns.identifier.read())?(e=e.replace(w.allLineBreaks,"\n"),t.type!==h.DOT&&(t.type!==h.RESERVED||"set"!==t.text&&"get"!==t.text)&&c.test(e)?"in"===e||"of"===e?this._create_token(h.OPERATOR,e):this._create_token(h.RESERVED,e):this._create_token(h.WORD,e)):""!==(e=this.__patterns.number.read())?this._create_token(h.WORD,e):void 0},f.prototype._read_singles=function(t){var e=null;return"("===t||"["===t?e=this._create_token(h.START_EXPR,t):")"===t||"]"===t?e=this._create_token(h.END_EXPR,t):"{"===t?e=this._create_token(h.START_BLOCK,t):"}"===t?e=this._create_token(h.END_BLOCK,t):";"===t?e=this._create_token(h.SEMICOLON,t):"."===t&&r.test(this._input.peek(1))?e=this._create_token(h.DOT,t):","===t&&(e=this._create_token(h.COMMA,t)),e&&this._input.next(),e},f.prototype._read_punctuation=function(){var t=this.__patterns.punct.read();if(""!==t)return"="===t?this._create_token(h.EQUALS,t):"?."===t?this._create_token(h.DOT,t):this._create_token(h.OPERATOR,t)},f.prototype._read_non_javascript=function(t){var e,n="";if("#"===t){if(this._is_first_token()&&(n=this.__patterns.shebang.read()))return this._create_token(h.UNKNOWN,n.trim()+"\n");if(n=this.__patterns.include.read())return this._create_token(h.UNKNOWN,n.trim()+"\n");if(t=this._input.next(),e="#",this._input.hasNext()&&this._input.testChar(i)){for(;e+=t=this._input.next(),this._input.hasNext()&&"#"!==t&&"="!==t;); +return"#"===t||("["===this._input.peek()&&"]"===this._input.peek(1)?(e+="[]",this._input.next(),this._input.next()):"{"===this._input.peek()&&"}"===this._input.peek(1)&&(e+="{}",this._input.next(),this._input.next())),this._create_token(h.WORD,e)}this._input.back()}else if("<"===t&&this._is_first_token()){if(n=this.__patterns.html_comment_start.read()){for(;this._input.hasNext()&&!this._input.testChar(w.newline);)n+=this._input.next();return d=!0,this._create_token(h.COMMENT,n)}}else if(d&&"-"===t&&(n=this.__patterns.html_comment_end.read()))return d=!1,this._create_token(h.COMMENT,n);return null},f.prototype._read_comment=function(t){var e,n,i=null;return"/"===t&&(e="","*"===this._input.peek(1)?(e=this.__patterns.block_comment.read(),(n=_.get_directives(e))&&"start"===n.ignore&&(e+=_.readIgnored(this._input)),e=e.replace(w.allLineBreaks,"\n"),(i=this._create_token(h.BLOCK_COMMENT,e)).directives=n):"/"===this._input.peek(1)&&(e=this.__patterns.comment.read(),i=this._create_token(h.COMMENT,e))),i},f.prototype._read_string=function(t){if("`"!==t&&"'"!==t&&'"'!==t)return null;var e=this._input.next();return this.has_char_escapes=!1,e+="`"===t?this._read_string_recursive("`",!0,"${"):this._read_string_recursive(t),this.has_char_escapes&&this._options.unescape_strings&&(e=function s(t){var e="",n=0,i=new g(t),_=null;for(;i.hasNext();)if((_=i.match(/([\s]|[^\\]|\\\\)+/g))&&(e+=_[0]),"\\"===i.peek()){if(i.next(),"x"===i.peek())_=i.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==i.peek()){e+="\\",i.hasNext()&&(e+=i.next());continue}_=i.match(/u([0-9A-Fa-f]{4})/g)}if(!_)return t;if(126<(n=parseInt(_[1],16))&&n<=255&&0===_[0].indexOf("x"))return t;if(0<=n&&n<32){e+="\\"+_[0];continue}e+=34===n||39===n||92===n?"\\"+String.fromCharCode(n):String.fromCharCode(n)}return e}(e)),this._input.peek()===t&&(e+=this._input.next()),e=e.replace(w.allLineBreaks,"\n"),this._create_token(h.STRING,e)},f.prototype._allow_regexp_or_xml=function(t){return t.type===h.RESERVED&&v(t.text,["return","case","throw","else","do","typeof","yield"])||t.type===h.END_EXPR&&")"===t.text&&t.opened.previous.type===h.RESERVED&&v(t.opened.previous.text,["if","while","for"])||v(t.type,[h.COMMENT,h.START_EXPR,h.START_BLOCK,h.START,h.END_BLOCK,h.OPERATOR,h.EQUALS,h.EOF,h.SEMICOLON,h.COMMA])},f.prototype._read_regexp=function(t,e){var n,i,_;if("/"===t&&this._allow_regexp_or_xml(e)){for(n=this._input.next(),_=i=!1;this._input.hasNext()&&(i||_||this._input.peek()!==t)&&!this._input.testChar(w.newline);)n+=this._input.peek(),i?i=!1:(i="\\"===this._input.peek(),"["===this._input.peek()?_=!0:"]"===this._input.peek()&&(_=!1)),this._input.next();return this._input.peek()===t&&(n+=this._input.next(),n+=this._input.read(w.identifier)),this._create_token(h.STRING,n)}return null},f.prototype._read_xml=function(t,e){var n,i,_,s,r,a,o;if(this._options.e4x&&"<"===t&&this._allow_regexp_or_xml(e)&&(n="",i=this.__patterns.xml.read_match())){for(s=0===(_=i[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}")).indexOf("{"),r=0;i&&(a=!!i[1],o=i[2],!(!!i[i.length-1]||"![CDATA["===o.slice(0,8))&&(o===_||s&&o.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(a?--r:++r),n+=i[0],!(r<=0));)i=this.__patterns.xml.read_match();return i||(n+=this._input.match(/[\s\S]*/g)[0]),n=n.replace(w.allLineBreaks,"\n"),this._create_token(h.STRING,n)}return null},f.prototype._read_string_recursive=function(t,e,n){var i,_,s,r;for("'"===t?_=this.__patterns.single_quote:'"'===t?_=this.__patterns.double_quote:"`"===t?_=this.__patterns.template_text:"}"===t&&(_=this.__patterns.template_expression),s=_.read(),r="";this._input.hasNext();){if((r=this._input.next())===t||!e&&w.newline.test(r)){this._input.back();break}"\\"===r&&this._input.hasNext()?("x"===(i=this._input.peek())||"u"===i?this.has_char_escapes=!0:"\r"===i&&"\n"===this._input.peek(1)&&this._input.next(),r+=this._input.next()):n&&("${"===n&&"$"===r&&"{"===this._input.peek()&&(r+=this._input.next()),n===r&&(r+="`"===t?this._read_string_recursive("}",e,"`"):this._read_string_recursive("`",e,"${"),this._input.hasNext()&&(r+=this._input.next()))),s+=r+=_.read()}return s},t.exports.Tokenizer=f,t.exports.TOKEN=h,t.exports.positionable_operators=a.slice(),t.exports.line_starters=p.slice()},function(t){var _=RegExp.prototype.hasOwnProperty("sticky");function e(t){this.__input=t||"",this.__input_length=this.__input.length,this.__position=0}e.prototype.restart=function(){this.__position=0},e.prototype.back=function(){0=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=e},function(t,e,n){var i=n(8).InputScanner,s=n(3).Token,r=n(10).TokenStream,_=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(t,e){this._input=new i(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new _(this._input)};o.prototype.tokenize=function(){var t,e,n,i,_;for(this._input.restart(),this.__tokens=new r,this._reset(),e=new s(a.START,""),n=null,i=[],_=new r;e.type!==a.EOF;){for(t=this._get_next_token(e,n);this._is_comment(t);)_.add(t),t=this._get_next_token(e,n);_.isEmpty()||(t.comments_before=_,_=new r),t.parent=n,this._is_opening(t)?(i.push(n),n=t):n&&this._is_closing(t,n)&&((t.opened=n).closed=t,n=i.pop(),t.parent=n),(t.previous=e).next=t,this.__tokens.add(t),e=t}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},o.prototype._is_comment=function(t){return!1},o.prototype._is_opening=function(t){return!1},o.prototype._is_closing=function(t,e){return!1},o.prototype._create_token=function(t,e){return new s(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},t.exports.Tokenizer=o,t.exports.TOKEN=a},function(t){function e(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return 0===this.__tokens_length},e.prototype.hasNext=function(){return this.__position/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}(s.prototype=new i)._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},s.prototype.read_options=function(t){var e,n=this._create();for(e in _)n._disabled[e]=-1===t.templating.indexOf(e);return n._update(),n},s.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},s.prototype.read=function(){var t,e="";for(e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern),t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},s.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},s.prototype._read_template=function(){var t,e="",n=this._input.peek();return"<"===n?(t=this._input.peek(1),this._disabled.php||this._excluded.php||"?"!==t||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==t||(e=e||this.__patterns.erb.read())):"{"===n&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read())),e},t.exports.TemplatablePattern=s}],_={};t=function s(t){var e,n=_[t];return n!==undefined?n.exports:(e=_[t]={exports:{}},i[t](e,e.exports,s),e.exports)}(0),n=t}(),i=n,"function"==typeof p&&p.amd?p([],function(){return{js_beautify:i}}):void 0!==u?u.js_beautify=i:"undefined"!=typeof window?window.js_beautify=i:"undefined"!=typeof global&&(global.js_beautify=i),function(){"use strict";var t,i=[,,function(t){function _(t){this.__parent=t,this.__character_count=0,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=[]}function n(t,e){this.__cache=[""],this.__indent_size=t.indent_size,this.__indent_string=t.indent_char,t.indent_with_tabs||(this.__indent_string=new Array(t.indent_size+1).join(t.indent_char)),e=e||"",0this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},_.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count, +this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),--t.__character_count),!0}return!1},_.prototype.is_empty=function(){return 0===this.__items.length},_.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},_.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},_.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},_.prototype._remove_indent=function(){0=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},e.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},e.prototype.get_line_number=function(){return this.__lines.length},e.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},e.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},e.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},e.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},e.prototype.get_code=function(t){var e,n;return this.trim(!0),(e=this.current_line.pop())&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline(),n=this.__lines.join("\n"),"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},e.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},e.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),1=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=e},,,,,function(t){function e(t,e){t="string"==typeof t?t:t.source,e="string"==typeof e?e:e.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+e,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+e,"g")}e.prototype.get_directives=function(t){var e,n;if(!t.match(this.__directives_block_pattern))return null;for(e={},this.__directive_pattern.lastIndex=0,n=this.__directive_pattern.exec(t);n;)e[n[1]]=n[2],n=this.__directive_pattern.exec(t);return e},e.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},t.exports.Directives=e},,function(t,e,n){var i=n(16).Beautifier,_=n(17).Options;t.exports=function s(t,e){return new i(t,e).beautify()},t.exports.defaultOptions=function(){return new _}},function(t,e,n){var i=n(17).Options,f=n(2).Output,g=n(8).InputScanner,_=n(13).Directives,m=new _(/\/\*/,/\*\//),b=/\r\n|[\r\n]/,y=/\r\n|[\r\n]/g,w=/\s/,k=/(?:\s|\n)+/g,x=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,v=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function s(t,e){this._source_text=t||"",this._options=new i(e),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}s.prototype.eatString=function(t){var e="";for(this._ch=this._input.next();this._ch;){if(e+=this._ch,"\\"===this._ch)e+=this._input.next();else if(-1!==t.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return e},s.prototype.eatWhitespace=function(t){for(var e=w.test(this._input.peek()),n=0;w.test(this._input.peek());)this._ch=this._input.next(),t&&"\n"===this._ch&&(0===n||n=this._nestedLevel):this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&_&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line()):"}"===this._ch?(this.outdent(),this._output.add_new_line(),"{"===p&&this._output.trim(!0),a=o=!1,s&&(this.outdent(),s=!1),this.print_string(this._ch),_=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0)):":"===this._ch?!_&&!r||this._input.lookBack("&")||this.foundNestedPseudoClass()||this._input.lookBack("(")||a||0!==i?(this._input.lookBack(" ")&&(this._output.space_before_token=!0),":"===this._input.peek()?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":")):(this.print_string(":"),s||(s=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):'"'===this._ch||"'"===this._ch?(this.preserveSingleSpace(u),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)):";"===this._ch?0===i?(s&&(this.outdent(),s=!1),o=a=!1,this.print_string(this._ch),this.eatWhitespace(!0),"/"!==this._input.peek()&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0):"("===this._ch?this._input.lookBack("url")?(this.print_string(this._ch),this.eatWhitespace(),i++,this.indent(),this._ch=this._input.next(),")"===this._ch||'"'===this._ch||"'"===this._ch?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),i&&(i--,this.outdent()))):(this.preserveSingleSpace(u),this.print_string(this._ch),this.eatWhitespace(),i++,this.indent()):")"===this._ch?(i&&(i--,this.outdent()),this.print_string(this._ch)):","===this._ch?(this.print_string(this._ch),this.eatWhitespace(!0),!this._options.selector_separator_newline||s||0!==i||o||a?this._output.space_before_token=!0:this._output.add_new_line()):">"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||s||0!==i?"]"===this._ch?this.print_string(this._ch):"["===this._ch?(this.preserveSingleSpace(u),this.print_string(this._ch)):"="===this._ch?(this.eatWhitespace(),this.print_string("="),w.test(this._ch)&&(this._ch="")):("!"!==this._ch||this._input.lookBack("\\")?this.preserveSingleSpace(u):this.print_string(" "),this.print_string(this._ch)):this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&w.test(this._ch)&&(this._ch=""));return this._output.get_code(e)},t.exports.Beautifier=s},function(t,e,n){var _=n(6).Options;function i(t){var e,n,i;for(_.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0),e=this._get_boolean("space_around_selector_separator"),this.space_around_combinator=this._get_boolean("space_around_combinator")||e,n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]),this.brace_style="collapse",i=0;ithis.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},_.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var t=this.__parent.current_line;return t.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),t.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),t.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===t.__items[0]&&(t.__items.splice(0,1),--t.__character_count),!0}return!1},_.prototype.is_empty=function(){return 0===this.__items.length},_.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},_.prototype.push=function(t){this.__items.push(t);var e=t.lastIndexOf("\n");-1!==e?this.__character_count=t.length-e:this.__character_count+=t.length},_.prototype.pop=function(){var t=null;return this.is_empty()||(t=this.__items.pop(),this.__character_count-=t.length),t},_.prototype._remove_indent=function(){0=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var t=this.__cache.length,e=0,n="";this.__indent_size&&t>=this.__indent_size&&(t-=(e=Math.floor(t/this.__indent_size))*this.__indent_size,n=new Array(e+1).join(this.__indent_string)),t&&(n+=new Array(t+1).join(" ")),this.__cache.push(n)},e.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},e.prototype.get_line_number=function(){return this.__lines.length},e.prototype.get_indent_string=function(t,e){return this.__indent_cache.get_indent_string(t,e)},e.prototype.get_indent_size=function(t,e){return this.__indent_cache.get_indent_size(t,e)},e.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},e.prototype.add_new_line=function(t){return!(this.is_empty()||!t&&this.just_added_newline())&&(this.raw||this.__add_outputline(),!0)},e.prototype.get_code=function(t){var e,n;return this.trim(!0),(e=this.current_line.pop())&&("\n"===e[e.length-1]&&(e=e.replace(/\n+$/g,"")),this.current_line.push(e)),this._end_with_newline&&this.__add_outputline(),n=this.__lines.join("\n"),"\n"!==t&&(n=n.replace(/[\n]/g,t)),n},e.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},e.prototype.set_indent=function(t,e){return t=t||0,e=e||0,this.next_line.set_indent(t,e),1=t.length&&this.__input.substring(e-t.length,e).toLowerCase()===t},t.exports.InputScanner=e},function(t,e,n){var i=n(8).InputScanner,s=n(3).Token,r=n(10).TokenStream,_=n(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},o=function(t,e){this._input=new i(t),this._options=e||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new _(this._input)};o.prototype.tokenize=function(){var t,e,n,i,_;for(this._input.restart(),this.__tokens=new r,this._reset(),e=new s(a.START,""),n=null,i=[],_=new r;e.type!==a.EOF;){for( +t=this._get_next_token(e,n);this._is_comment(t);)_.add(t),t=this._get_next_token(e,n);_.isEmpty()||(t.comments_before=_,_=new r),t.parent=n,this._is_opening(t)?(i.push(n),n=t):n&&this._is_closing(t,n)&&((t.opened=n).closed=t,n=i.pop(),t.parent=n),(t.previous=e).next=t,this.__tokens.add(t),e=t}return this.__tokens},o.prototype._is_first_token=function(){return this.__tokens.isEmpty()},o.prototype._reset=function(){},o.prototype._get_next_token=function(t,e){this._readWhitespace();var n=this._input.read(/.+/g);return n?this._create_token(a.RAW,n):this._create_token(a.EOF,"")},o.prototype._is_comment=function(t){return!1},o.prototype._is_opening=function(t){return!1},o.prototype._is_closing=function(t,e){return!1},o.prototype._create_token=function(t,e){return new s(t,e,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token)},o.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},t.exports.Tokenizer=o,t.exports.TOKEN=a},function(t){function e(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return 0===this.__tokens_length},e.prototype.hasNext=function(){return this.__position/),erb:n.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:n.starting_with(/{%/).until_after(/%}/),django_value:n.starting_with(/{{/).until_after(/}}/),django_comment:n.starting_with(/{#/).until_after(/#}/),smarty:n.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:n.starting_with(/{\*/).until_after(/\*}/),smarty_literal:n.starting_with(/{literal}/).until_after(/{\/literal}/)}}(s.prototype=new i)._create=function(){return new s(this._input,this)},s.prototype._update=function( +){this.__set_templated_pattern()},s.prototype.disable=function(t){var e=this._create();return e._disabled[t]=!0,e._update(),e},s.prototype.read_options=function(t){var e,n=this._create();for(e in _)n._disabled[e]=-1===t.templating.indexOf(e);return n._update(),n},s.prototype.exclude=function(t){var e=this._create();return e._excluded[t]=!0,e._update(),e},s.prototype.read=function(){var t,e="";for(e=this._match_pattern?this._input.read(this._starting_pattern):this._input.read(this._starting_pattern,this.__template_pattern),t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),e+=t,t=this._read_template();return this._until_after&&(e+=this._input.readUntilAfter(this._until_pattern)),e},s.prototype.__set_templated_pattern=function(){var t=[];this._disabled.php||t.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||t.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||t.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(t.push(this.__patterns.django._starting_pattern.source),t.push(this.__patterns.django_value._starting_pattern.source),t.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||t.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&t.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+t.join("|")+")")},s.prototype._read_template=function(){var t,e="",n=this._input.peek();return"<"===n?(t=this._input.peek(1),this._disabled.php||this._excluded.php||"?"!==t||(e=e||this.__patterns.php.read()),this._disabled.erb||this._excluded.erb||"%"!==t||(e=e||this.__patterns.erb.read())):"{"===n&&(this._disabled.handlebars||this._excluded.handlebars||(e=(e=(e=e||this.__patterns.handlebars_comment.read())||this.__patterns.handlebars_unescaped.read())||this.__patterns.handlebars.read()),this._disabled.django||(this._excluded.django||this._excluded.handlebars||(e=e||this.__patterns.django_value.read()),this._excluded.django||(e=(e=e||this.__patterns.django_comment.read())||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(e=(e=(e=e||this.__patterns.smarty_comment.read())||this.__patterns.smarty_literal.read())||this.__patterns.smarty.read())),e},t.exports.TemplatablePattern=s},,,,function(t,e,n){var _=n(19).Beautifier,i=n(20).Options;t.exports=function s(t,e,n,i){return new _(t,e,n,i).beautify()},t.exports.defaultOptions=function(){return new i}},function(t,e,n){var _,r,h,i,s,a=n(20).Options,o=n(2).Output,u=n(21).Tokenizer,p=n(21).TOKEN,l=/\r\n|[\r\n]/,c=/\r\n|[\r\n]/g,d=function(t,e){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=t.max_preserve_newlines,this.preserve_newlines=t.preserve_newlines,this._output=new o(t,e)};function f(t,e){return-1!==e.indexOf(t)}function g(t,e,n){this.parent=t||null,this.tag=e?e.tag_name:"",this.indent_level=n||0,this.parser_token=e||null}function m(t){this._printer=t,this._current_frame=null}function b(t,e,n,i){this._source_text=t||"",e=e||{},this._js_beautify=n,this._css_beautify=i,this._tag_stack=null;var _=new a(e,"html");this._options=_,this._is_wrap_attributes_force="force"===this._options.wrap_attributes.substr(0,"force".length),this._is_wrap_attributes_force_expand_multiline="force-expand-multiline"===this._options.wrap_attributes,this._is_wrap_attributes_force_aligned="force-aligned"===this._options.wrap_attributes,this._is_wrap_attributes_aligned_multiple="aligned-multiple"===this._options.wrap_attributes,this._is_wrap_attributes_preserve="preserve"===this._options.wrap_attributes.substr(0,"preserve".length),this._is_wrap_attributes_preserve_aligned="preserve-aligned"===this._options.wrap_attributes}d.prototype.current_line_has_match=function(t){return this._output.current_line.has_match(t)},d.prototype.set_space_before_token=function(t,e){this._output.space_before_token=t,this._output.non_breaking_space=e},d.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},d.prototype.add_raw_token=function(t){this._output.add_raw_token(t)},d.prototype.print_preserved_newlines=function(t){var e,n=0;for(t.type!==p.TEXT&&t.previous.type!==p.TEXT&&(n=t.newlines?1:0),this.preserve_newlines&&(n=t.newlines|]]>)$/.exec(i)))return void t.add_raw_token(e);r=o+h[1]+"\n",i=h[4],h[5]&&(a=o+h[5]),i=i.replace(/\n[ \t]*$/,""),(h[2]||-1!==h[3].indexOf("\n"))&&(h=h[3].match(/[ \t]+$/))&&(e.whitespace_before=h[0])}i=i&&(_?((u=function(){this.eol="\n"}).prototype=this._options.raw_options,_(o+i,new u)):((p=e.whitespace_before)&&(i=i.replace(new RegExp("\n("+p+")?","g"),"\n")),o+i.replace(/\n/g,"\n"+o))),r&&(i=i?r+i+"\n"+a:r+a),t.print_newline(!1),i&&(e.text=i,e.whitespace_before="",e.newlines=0,t.add_raw_token(e),t.print_newline(!0))}},b.prototype._handle_tag_open=function(t,e,n,i){var _=this._get_tag_open_token(e);return!n.is_unformatted&&!n.is_content_unformatted||n.is_empty_element||e.type!==p.TAG_OPEN||0!==e.text.indexOf("]*)/),this.tag_check=n?n[1]:""):(n=e.text.match(/^{{(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=n?n[1]:"","{{#>"===e.text&&">"===this.tag_check&&null!==e.next&&(this.tag_check=e.next.text)),this.tag_check=this.tag_check.toLowerCase(),e.type===p.COMMENT&&(this.tag_complete=!0),this.is_start_tag="/"!==this.tag_check.charAt(0), +this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||e.closed&&"/>"===e.closed.text,this.is_end_tag=this.is_end_tag||"{"===this.tag_start_char&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(2)))):this.tag_complete=!0},b.prototype._get_tag_open_token=function(t){var e=new h(this._tag_stack.get_parser_token(),t);return e.alignment_size=this._options.wrap_attributes_indent_size,e.is_end_tag=e.is_end_tag||f(e.tag_check,this._options.void_elements),e.is_empty_element=e.tag_complete||e.is_start_tag&&e.is_end_tag,e.is_unformatted=!e.tag_complete&&f(e.tag_check,this._options.unformatted),e.is_content_unformatted=!e.is_empty_element&&f(e.tag_check,this._options.content_unformatted),e.is_inline_element=f(e.tag_name,this._options.inline)||"{"===e.tag_start_char,e},b.prototype._set_tag_position=function(t,e,n,i,_){var s;n.is_empty_element||(n.is_end_tag?n.start_tag_token=this._tag_stack.try_pop(n.tag_name):(this._do_optional_end_element(n)&&(n.is_inline_element||t.print_newline(!1)),this._tag_stack.record_tag(n),"script"!==n.tag_name&&"style"!==n.tag_name||n.is_unformatted||n.is_content_unformatted||(n.custom_beautifier_name=r(n.tag_check,e)))),f(n.tag_check,this._options.extra_liners)&&(t.print_newline(!1),t._output.just_added_blankline()||t.print_newline(!0)),n.is_empty_element?("{"===n.tag_start_char&&"else"===n.tag_check&&(this._tag_stack.indent_to_tag(["if","unless","each"]),n.indent_content=!0,t.current_line_has_match(/{{#if/)||t.print_newline(!1)),"!--"===n.tag_name&&_.type===p.TAG_CLOSE&&i.is_end_tag&&-1===n.text.indexOf("\n")||(n.is_inline_element||n.is_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n))):n.is_end_tag?(s=!1,s=(s=n.start_tag_token&&n.start_tag_token.multiline_content)||!n.is_inline_element&&!(i.is_inline_element||i.is_unformatted)&&!(_.type===p.TAG_CLOSE&&n.start_tag_token===i)&&"TK_CONTENT"!==_.type,(n.is_content_unformatted||n.is_unformatted)&&(s=!1),s&&t.print_newline(!1)):(n.indent_content=!n.custom_beautifier_name,"<"===n.tag_start_char&&("html"===n.tag_name?n.indent_content=this._options.indent_inner_html:"head"===n.tag_name?n.indent_content=this._options.indent_head_inner_html:"body"===n.tag_name&&(n.indent_content=this._options.indent_body_inner_html)),n.is_inline_element||n.is_unformatted||"TK_CONTENT"===_.type&&!n.is_content_unformatted||t.print_newline(!1),this._calcluate_parent_multiline(t,n))},b.prototype._calcluate_parent_multiline=function(t,e){!e.parent||!t._output.just_added_newline()||(e.is_inline_element||e.is_unformatted)&&e.parent.is_inline_element||(e.parent.multiline_content=!0)},i=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],s=["a","audio","del","ins","map","noscript","video"],b.prototype._do_optional_end_element=function(t){var e,n=null;if(!t.is_empty_element&&t.is_start_tag&&t.parent)return"body"===t.tag_name?n=n||this._tag_stack.try_pop("head"):"li"===t.tag_name?n=n||this._tag_stack.try_pop("li",["ol","ul"]):"dd"===t.tag_name||"dt"===t.tag_name?n=(n=n||this._tag_stack.try_pop("dt",["dl"]))||this._tag_stack.try_pop("dd",["dl"]):"p"===t.parent.tag_name&&-1!==i.indexOf(t.tag_name)?(e=t.parent.parent)&&-1!==s.indexOf(e.tag_name)||(n=n||this._tag_stack.try_pop("p")):"rp"===t.tag_name||"rt"===t.tag_name?n=(n=n||this._tag_stack.try_pop("rt",["ruby","rtc"]))||this._tag_stack.try_pop("rp",["ruby","rtc"]):"optgroup"===t.tag_name?n=n||this._tag_stack.try_pop("optgroup",["select"]):"option"===t.tag_name?n=n||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):"colgroup"===t.tag_name?n=n||this._tag_stack.try_pop("caption",["table"]):"thead"===t.tag_name?n=(n=n||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]):"tbody"===t.tag_name||"tfoot"===t.tag_name?n=(n=(n=(n=n||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("thead",["table"]))||this._tag_stack.try_pop("tbody",["table"]):"tr"===t.tag_name?n=(n=(n=n||this._tag_stack.try_pop("caption",["table"]))||this._tag_stack.try_pop("colgroup",["table"]))||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"]):"th"!==t.tag_name&&"td"!==t.tag_name||(n=(n=n||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]))||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"])),t.parent=this._tag_stack.get_parser_token(),n},t.exports.Beautifier=b},function(t,e,n){var i=n(6).Options;function _(t){i.call(this,t,"html"),1===this.templating.length&&"auto"===this.templating[0]&&(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",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),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"]),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","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source", +"track","wbr","!doctype","?xml","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"])}_.prototype=new i,t.exports.Options=_},function(t,e,n){var s=n(9).Tokenizer,i=n(9).TOKEN,_=n(13).Directives,r=n(14).TemplatablePattern,a=n(12).Pattern,o={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:i.START,RAW:i.RAW,EOF:i.EOF},h=new _(/<\!--/,/-->/),u=function(t,e){var n,i,_;s.call(this,t,e),this._current_tag_name="",n=new r(this._input).read_options(this._options),i=new a(this._input),this.__patterns={word:n.until(/[\n\r\t <]/),single_quote:n.until_after(/'/),double_quote:n.until_after(/"/),attribute:n.until(/[\n\r\t =>]|\/>/),element_name:n.until(/[\n\r\t >\/]/),handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),handlebars_open:i.until(/[\n\r\t }]/),handlebars_raw_close:i.until(/}}/),comment:i.starting_with(//),cdata:i.starting_with(//),conditional_comment:i.starting_with(//),processing:i.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter&&(_=this._input.get_literal_regexp(this._options.unformatted_content_delimiter),this.__patterns.unformatted_content_delimiter=i.matching(_).until_after(_))};u.prototype=new s,u.prototype._is_comment=function(t){return!1},u.prototype._is_opening=function(t){return t.type===o.TAG_OPEN},u.prototype._is_closing=function(t,e){return t.type===o.TAG_CLOSE&&e&&((">"===t.text||"/>"===t.text)&&"<"===e.text[0]||"}}"===t.text&&"{"===e.text[0]&&"{"===e.text[1])},u.prototype._reset=function(){this._current_tag_name=""},u.prototype._get_next_token=function(t,e){var n,i=null;return this._readWhitespace(),null===(n=this._input.peek())?this._create_token(o.EOF,""):i=(i=(i=(i=(i=(i=(i=(i=(i=i||this._read_open_handlebars(n,e))||this._read_attribute(n,t,e))||this._read_close(n,e))||this._read_raw_content(n,t,e))||this._read_content_word(n))||this._read_comment_or_cdata(n))||this._read_processing(n))||this._read_open(n,e))||this._create_token(o.UNKNOWN,this._input.next())},u.prototype._read_comment_or_cdata=function(t){var e=null,n=null,i=null;return"<"===t&&("!"===this._input.peek(1)&&((n=this.__patterns.comment.read())?(i=h.get_directives(n))&&"start"===i.ignore&&(n+=h.readIgnored(this._input)):n=this.__patterns.cdata.read()),n&&((e=this._create_token(o.COMMENT,n)).directives=i)),e},u.prototype._read_processing=function(t){var e,n=null,i=null,_=null;return"<"===t&&("!"!==(e=this._input.peek(1))&&"?"!==e||(i=(i=this.__patterns.conditional_comment.read())||this.__patterns.processing.read()),i&&((n=this._create_token(o.COMMENT,i)).directives=_)),n},u.prototype._read_open=function(t,e){var n=null,i=null;return e||"<"===t&&(n=this._input.next(),"/"===this._input.peek()&&(n+=this._input.next()),n+=this.__patterns.element_name.read(),i=this._create_token(o.TAG_OPEN,n)),i},u.prototype._read_open_handlebars=function(t,e){var n=null,i=null;return e||this._options.indent_handlebars&&"{"===t&&"{"===this._input.peek(1)&&(i="!"===this._input.peek(2)?(n=(n=this.__patterns.handlebars_comment.read())||this.__patterns.handlebars.read(),this._create_token(o.COMMENT,n)):(n=this.__patterns.handlebars_open.read(),this._create_token(o.TAG_OPEN,n))),i},u.prototype._read_close=function(t,e){var n=null,i=null;return e&&("<"===e.text[0]&&(">"===t||"/"===t&&">"===this._input.peek(1))?(n=this._input.next(),"/"===t&&(n+=this._input.next()),i=this._create_token(o.TAG_CLOSE,n)):"{"===e.text[0]&&"}"===t&&"}"===this._input.peek(1)&&(this._input.next(),this._input.next(),i=this._create_token(o.TAG_CLOSE,"}}"))),i},u.prototype._read_attribute=function(t,e,n){var i,_=null,s="";return n&&"<"===n.text[0]&&("="===t?_=this._create_token(o.EQUALS,this._input.next()):'"'===t||"'"===t?(i=this._input.next(),i+='"'===t?this.__patterns.double_quote.read():this.__patterns.single_quote.read(),_=this._create_token(o.VALUE,i)):(s=this.__patterns.attribute.read())&&(_=e.type===o.EQUALS?this._create_token(o.VALUE,s):this._create_token(o.ATTRIBUTE,s))),_},u.prototype._is_content_unformatted=function(t){return-1===this._options.void_elements.indexOf(t)&&(-1!==this._options.content_unformatted.indexOf(t)||-1!==this._options.unformatted.indexOf(t))},u.prototype._read_raw_content=function(t,e,n){var i,_,s="";if(n&&"{"===n.text[0])s=this.__patterns.handlebars_raw_close.read();else if(e.type===o.TAG_CLOSE&&"<"===e.opened.text[0]&&"/"!==e.text[0])if("script"===(i=e.opened.text.substr(1).toLowerCase())||"style"===i){if(_=this._read_comment_or_cdata(t))return _.type=o.TEXT,_;s=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(i)&&(s=this._input.readUntil(new RegExp("","ig")));return s?this._create_token(o.TEXT,s):null},u.prototype._read_content_word=function(t){var e="";if(this._options.unformatted_content_delimiter&&t===this._options.unformatted_content_delimiter[0]&&(e=this.__patterns.unformatted_content_delimiter.read()),e=e||this.__patterns.word.read())return this._create_token(o.TEXT,e)},t.exports.Tokenizer=u,t.exports.TOKEN=o}],_={};t=function s(t){var e,n=_[t];return n!==undefined?n.exports:(e=_[t]={exports:{}},i[t](e,e.exports,s),e.exports)}(18),a=t}(),s=a,"function"==typeof p&&p.amd?p(["require","./beautify","./beautify-css"],function(t){var n=t("./beautify"),i=t("./beautify-css");return{html_beautify:function(t,e){return s(t,e,n.js_beautify,i.css_beautify)}}} +):void 0!==u?(o=l("./beautify.js"),h=l("./beautify-css.js"),u.html_beautify=function(t,e){return s(t,e,o.js_beautify,h.css_beautify)}):"undefined"!=typeof window?window.html_beautify=function(t,e){return s(t,e,window.js_beautify,window.css_beautify)}:"undefined"!=typeof global&&(global.html_beautify=function(t,e){return s(t,e,global.js_beautify,global.css_beautify)})},"@VERSION@"); \ No newline at end of file diff --git a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify.js b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify.js index ad3648722fa..9db40eb0564 100644 --- a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify.js +++ b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify.js @@ -106,98 +106,13 @@ Y.namespace('M.atto_html').beautify = exports; (function() { /* GENERATED_BUILD_OUTPUT */ -var legacy_beautify_js = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ([ +var legacy_beautify_js; +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ([ /* 0 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -244,9 +159,8 @@ module.exports.defaultOptions = function() { /***/ }), /* 1 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -795,7 +709,7 @@ Beautifier.prototype.handle_start_expr = function(current_token) { } } - if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) { + 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 { @@ -803,7 +717,7 @@ Beautifier.prototype.handle_start_expr = function(current_token) { 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'])) { + } 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'])) { @@ -1306,7 +1220,9 @@ Beautifier.prototype.handle_semicolon = function(current_token) { }; Beautifier.prototype.handle_string = function(current_token) { - if (this.start_of_statement(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; @@ -1318,6 +1234,8 @@ Beautifier.prototype.handle_string = function(current_token) { 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(); } @@ -1706,9 +1624,8 @@ module.exports.Beautifier = Beautifier; /***/ }), /* 2 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* The MIT License (MIT) @@ -2132,9 +2049,8 @@ module.exports.Output = Output; /***/ }), /* 3 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -2193,9 +2109,8 @@ module.exports.Token = Token; /***/ }), /* 4 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports) { -"use strict"; /* jshint node: true, curly: false */ // Parts of this section of code is taken from acorn. // @@ -2257,9 +2172,8 @@ exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g'); /***/ }), /* 5 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -2357,9 +2271,8 @@ module.exports.Options = Options; /***/ }), /* 6 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -2429,10 +2342,10 @@ function Options(options, merge_child_field) { this.indent_empty_lines = this._get_boolean('indent_empty_lines'); - // valid templating languages ['django', 'erb', 'handlebars', 'php'] + // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty'] // For now, 'auto' = all off for javascript, all on for html (and inline javascript). // other values ignored - this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']); + this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); } Options.prototype._get_array = function(name, default_value) { @@ -2557,9 +2470,8 @@ module.exports.mergeOpts = _mergeOpts; /***/ }), /* 7 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -2628,7 +2540,7 @@ var TOKEN = { var directives_core = new Directives(/\/\*/, /\*\//); -var number_pattern = /0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/; +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]/; @@ -2688,7 +2600,7 @@ var Tokenizer = function(input_string, options) { 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_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/), + xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/), single_quote: templatable.until(/['\\\n\r\u2028\u2029]/), double_quote: templatable.until(/["\\\n\r\u2028\u2029]/), template_text: templatable.until(/[`\\$]/), @@ -3130,9 +3042,8 @@ module.exports.line_starters = line_starters.slice(); /***/ }), /* 8 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -3329,9 +3240,8 @@ module.exports.InputScanner = InputScanner; /***/ }), /* 9 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -3476,9 +3386,8 @@ module.exports.TOKEN = TOKEN; /***/ }), /* 10 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -3561,9 +3470,8 @@ module.exports.TokenStream = TokenStream; /***/ }), /* 11 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -3673,9 +3581,8 @@ module.exports.WhitespacePattern = WhitespacePattern; /***/ }), /* 12 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -3774,9 +3681,8 @@ module.exports.Pattern = Pattern; /***/ }), /* 13 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -3843,9 +3749,8 @@ module.exports.Directives = Directives; /***/ }), /* 14 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -3883,7 +3788,8 @@ var template_names = { django: false, erb: false, handlebars: false, - php: false + php: false, + smarty: false }; // This lets templates appear anywhere we would do a readUntil @@ -3904,12 +3810,15 @@ function TemplatablePattern(input_scanner, parent) { 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(/\?>/), + 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(/#}/) + 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(); @@ -3983,9 +3892,14 @@ TemplatablePattern.prototype.__set_templated_pattern = function() { } 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); @@ -4031,6 +3945,17 @@ TemplatablePattern.prototype._read_template = function() { 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; }; @@ -4040,7 +3965,42 @@ module.exports.TemplatablePattern = TemplatablePattern; /***/ }) -/******/ ]); +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(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, __webpack_require__); +/******/ +/******/ // 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 __webpack_exports__ = __webpack_require__(0); +/******/ legacy_beautify_js = __webpack_exports__; +/******/ +/******/ })() +; var js_beautify = legacy_beautify_js; /* Footer */ if (typeof define === "function" && define.amd) { @@ -4129,100 +4089,15 @@ if (typeof define === "function" && define.amd) { (function() { /* GENERATED_BUILD_OUTPUT */ -var legacy_beautify_css = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 15); -/******/ }) -/************************************************************************/ -/******/ ([ +var legacy_beautify_css; +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ([ /* 0 */, /* 1 */, /* 2 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* The MIT License (MIT) @@ -4649,9 +4524,8 @@ module.exports.Output = Output; /* 4 */, /* 5 */, /* 6 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -4721,10 +4595,10 @@ function Options(options, merge_child_field) { this.indent_empty_lines = this._get_boolean('indent_empty_lines'); - // valid templating languages ['django', 'erb', 'handlebars', 'php'] + // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty'] // For now, 'auto' = all off for javascript, all on for html (and inline javascript). // other values ignored - this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']); + this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); } Options.prototype._get_array = function(name, default_value) { @@ -4850,9 +4724,8 @@ module.exports.mergeOpts = _mergeOpts; /***/ }), /* 7 */, /* 8 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -5053,9 +4926,8 @@ module.exports.InputScanner = InputScanner; /* 11 */, /* 12 */, /* 13 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -5123,9 +4995,8 @@ module.exports.Directives = Directives; /***/ }), /* 14 */, /* 15 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -5172,9 +5043,8 @@ module.exports.defaultOptions = function() { /***/ }), /* 16 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -5268,13 +5138,12 @@ Beautifier.prototype.eatString = function(endChars) { // the first newline will be output Beautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) { var result = whitespaceChar.test(this._input.peek()); - var isFirstNewLine = true; - + var newline_count = 0; while (whitespaceChar.test(this._input.peek())) { this._ch = this._input.next(); if (allowAtLeastOneNewLine && this._ch === '\n') { - if (this._options.preserve_newlines || isFirstNewLine) { - isFirstNewLine = false; + if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) { + newline_count++; this._output.add_new_line(true); } } @@ -5611,7 +5480,7 @@ Beautifier.prototype.beautify = function() { } else if (this._ch === ',') { this.print_string(this._ch); this.eatWhitespace(true); - if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport) { + if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport && !insideAtExtend) { this._output.add_new_line(); } else { this._output.space_before_token = true; @@ -5660,9 +5529,8 @@ module.exports.Beautifier = Beautifier; /***/ }), /* 17 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -5722,7 +5590,42 @@ module.exports.Options = Options; /***/ }) -/******/ ]); +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(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, __webpack_require__); +/******/ +/******/ // 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 __webpack_exports__ = __webpack_require__(15); +/******/ legacy_beautify_css = __webpack_exports__; +/******/ +/******/ })() +; var css_beautify = legacy_beautify_css; /* Footer */ if (typeof define === "function" && define.amd) { @@ -5822,100 +5725,15 @@ if (typeof define === "function" && define.amd) { (function() { /* GENERATED_BUILD_OUTPUT */ -var legacy_beautify_html = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 18); -/******/ }) -/************************************************************************/ -/******/ ([ +var legacy_beautify_html; +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ([ /* 0 */, /* 1 */, /* 2 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* The MIT License (MIT) @@ -6339,9 +6157,8 @@ module.exports.Output = Output; /***/ }), /* 3 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -6402,9 +6219,8 @@ module.exports.Token = Token; /* 4 */, /* 5 */, /* 6 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -6474,10 +6290,10 @@ function Options(options, merge_child_field) { this.indent_empty_lines = this._get_boolean('indent_empty_lines'); - // valid templating languages ['django', 'erb', 'handlebars', 'php'] + // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty'] // For now, 'auto' = all off for javascript, all on for html (and inline javascript). // other values ignored - this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']); + this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); } Options.prototype._get_array = function(name, default_value) { @@ -6603,9 +6419,8 @@ module.exports.mergeOpts = _mergeOpts; /***/ }), /* 7 */, /* 8 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -6802,9 +6617,8 @@ module.exports.InputScanner = InputScanner; /***/ }), /* 9 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -6949,9 +6763,8 @@ module.exports.TOKEN = TOKEN; /***/ }), /* 10 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -7034,9 +6847,8 @@ module.exports.TokenStream = TokenStream; /***/ }), /* 11 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -7146,9 +6958,8 @@ module.exports.WhitespacePattern = WhitespacePattern; /***/ }), /* 12 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -7247,9 +7058,8 @@ module.exports.Pattern = Pattern; /***/ }), /* 13 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -7316,9 +7126,8 @@ module.exports.Directives = Directives; /***/ }), /* 14 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -7356,7 +7165,8 @@ var template_names = { django: false, erb: false, handlebars: false, - php: false + php: false, + smarty: false }; // This lets templates appear anywhere we would do a readUntil @@ -7377,12 +7187,15 @@ function TemplatablePattern(input_scanner, parent) { 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(/\?>/), + 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(/#}/) + 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(); @@ -7456,9 +7269,14 @@ TemplatablePattern.prototype.__set_templated_pattern = function() { } 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); @@ -7504,6 +7322,17 @@ TemplatablePattern.prototype._read_template = function() { 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; }; @@ -7517,9 +7346,8 @@ module.exports.TemplatablePattern = TemplatablePattern; /* 16 */, /* 17 */, /* 18 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -7566,9 +7394,8 @@ module.exports.defaultOptions = function() { /***/ }), /* 19 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -8438,9 +8265,8 @@ module.exports.Beautifier = Beautifier; /***/ }), /* 20 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -8536,9 +8362,8 @@ module.exports.Options = Options; /***/ }), /* 21 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -8874,7 +8699,42 @@ module.exports.TOKEN = TOKEN; /***/ }) -/******/ ]); +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(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, __webpack_require__); +/******/ +/******/ // 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 __webpack_exports__ = __webpack_require__(18); +/******/ legacy_beautify_html = __webpack_exports__; +/******/ +/******/ })() +; var style_html = legacy_beautify_html; /* Footer */ if (typeof define === "function" && define.amd) { diff --git a/lib/editor/atto/plugins/html/yui/src/beautify/js/beautify-css.js b/lib/editor/atto/plugins/html/yui/src/beautify/js/beautify-css.js index 42cf64a8565..79f65643de2 100644 --- a/lib/editor/atto/plugins/html/yui/src/beautify/js/beautify-css.js +++ b/lib/editor/atto/plugins/html/yui/src/beautify/js/beautify-css.js @@ -65,100 +65,15 @@ (function() { /* GENERATED_BUILD_OUTPUT */ -var legacy_beautify_css = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 15); -/******/ }) -/************************************************************************/ -/******/ ([ +var legacy_beautify_css; +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ([ /* 0 */, /* 1 */, /* 2 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* The MIT License (MIT) @@ -585,9 +500,8 @@ module.exports.Output = Output; /* 4 */, /* 5 */, /* 6 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -657,10 +571,10 @@ function Options(options, merge_child_field) { this.indent_empty_lines = this._get_boolean('indent_empty_lines'); - // valid templating languages ['django', 'erb', 'handlebars', 'php'] + // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty'] // For now, 'auto' = all off for javascript, all on for html (and inline javascript). // other values ignored - this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']); + this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); } Options.prototype._get_array = function(name, default_value) { @@ -786,9 +700,8 @@ module.exports.mergeOpts = _mergeOpts; /***/ }), /* 7 */, /* 8 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -989,9 +902,8 @@ module.exports.InputScanner = InputScanner; /* 11 */, /* 12 */, /* 13 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -1059,9 +971,8 @@ module.exports.Directives = Directives; /***/ }), /* 14 */, /* 15 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -1108,9 +1019,8 @@ module.exports.defaultOptions = function() { /***/ }), /* 16 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -1204,13 +1114,12 @@ Beautifier.prototype.eatString = function(endChars) { // the first newline will be output Beautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) { var result = whitespaceChar.test(this._input.peek()); - var isFirstNewLine = true; - + var newline_count = 0; while (whitespaceChar.test(this._input.peek())) { this._ch = this._input.next(); if (allowAtLeastOneNewLine && this._ch === '\n') { - if (this._options.preserve_newlines || isFirstNewLine) { - isFirstNewLine = false; + if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) { + newline_count++; this._output.add_new_line(true); } } @@ -1547,7 +1456,7 @@ Beautifier.prototype.beautify = function() { } else if (this._ch === ',') { this.print_string(this._ch); this.eatWhitespace(true); - if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport) { + if (this._options.selector_separator_newline && !insidePropertyValue && parenLevel === 0 && !insideAtImport && !insideAtExtend) { this._output.add_new_line(); } else { this._output.space_before_token = true; @@ -1596,9 +1505,8 @@ module.exports.Beautifier = Beautifier; /***/ }), /* 17 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -1658,7 +1566,42 @@ module.exports.Options = Options; /***/ }) -/******/ ]); +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(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, __webpack_require__); +/******/ +/******/ // 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 __webpack_exports__ = __webpack_require__(15); +/******/ legacy_beautify_css = __webpack_exports__; +/******/ +/******/ })() +; var css_beautify = legacy_beautify_css; /* Footer */ if (typeof define === "function" && define.amd) { diff --git a/lib/editor/atto/plugins/html/yui/src/beautify/js/beautify-html.js b/lib/editor/atto/plugins/html/yui/src/beautify/js/beautify-html.js index 7ba12e852c4..f69c07e6435 100644 --- a/lib/editor/atto/plugins/html/yui/src/beautify/js/beautify-html.js +++ b/lib/editor/atto/plugins/html/yui/src/beautify/js/beautify-html.js @@ -75,100 +75,15 @@ (function() { /* GENERATED_BUILD_OUTPUT */ -var legacy_beautify_html = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 18); -/******/ }) -/************************************************************************/ -/******/ ([ +var legacy_beautify_html; +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ([ /* 0 */, /* 1 */, /* 2 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* The MIT License (MIT) @@ -592,9 +507,8 @@ module.exports.Output = Output; /***/ }), /* 3 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -655,9 +569,8 @@ module.exports.Token = Token; /* 4 */, /* 5 */, /* 6 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -727,10 +640,10 @@ function Options(options, merge_child_field) { this.indent_empty_lines = this._get_boolean('indent_empty_lines'); - // valid templating languages ['django', 'erb', 'handlebars', 'php'] + // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty'] // For now, 'auto' = all off for javascript, all on for html (and inline javascript). // other values ignored - this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']); + this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); } Options.prototype._get_array = function(name, default_value) { @@ -856,9 +769,8 @@ module.exports.mergeOpts = _mergeOpts; /***/ }), /* 7 */, /* 8 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -1055,9 +967,8 @@ module.exports.InputScanner = InputScanner; /***/ }), /* 9 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -1202,9 +1113,8 @@ module.exports.TOKEN = TOKEN; /***/ }), /* 10 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -1287,9 +1197,8 @@ module.exports.TokenStream = TokenStream; /***/ }), /* 11 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -1399,9 +1308,8 @@ module.exports.WhitespacePattern = WhitespacePattern; /***/ }), /* 12 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -1500,9 +1408,8 @@ module.exports.Pattern = Pattern; /***/ }), /* 13 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -1569,9 +1476,8 @@ module.exports.Directives = Directives; /***/ }), /* 14 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -1609,7 +1515,8 @@ var template_names = { django: false, erb: false, handlebars: false, - php: false + php: false, + smarty: false }; // This lets templates appear anywhere we would do a readUntil @@ -1630,12 +1537,15 @@ function TemplatablePattern(input_scanner, parent) { 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(/\?>/), + 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(/#}/) + 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(); @@ -1709,9 +1619,14 @@ TemplatablePattern.prototype.__set_templated_pattern = function() { } 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); @@ -1757,6 +1672,17 @@ TemplatablePattern.prototype._read_template = function() { 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; }; @@ -1770,9 +1696,8 @@ module.exports.TemplatablePattern = TemplatablePattern; /* 16 */, /* 17 */, /* 18 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -1819,9 +1744,8 @@ module.exports.defaultOptions = function() { /***/ }), /* 19 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -2691,9 +2615,8 @@ module.exports.Beautifier = Beautifier; /***/ }), /* 20 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -2789,9 +2712,8 @@ module.exports.Options = Options; /***/ }), /* 21 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -3127,7 +3049,42 @@ module.exports.TOKEN = TOKEN; /***/ }) -/******/ ]); +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(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, __webpack_require__); +/******/ +/******/ // 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 __webpack_exports__ = __webpack_require__(18); +/******/ legacy_beautify_html = __webpack_exports__; +/******/ +/******/ })() +; var style_html = legacy_beautify_html; /* Footer */ if (typeof define === "function" && define.amd) { diff --git a/lib/editor/atto/plugins/html/yui/src/beautify/js/beautify.js b/lib/editor/atto/plugins/html/yui/src/beautify/js/beautify.js index 2ec67f8ddc0..3ddd92b8db0 100644 --- a/lib/editor/atto/plugins/html/yui/src/beautify/js/beautify.js +++ b/lib/editor/atto/plugins/html/yui/src/beautify/js/beautify.js @@ -88,98 +88,13 @@ (function() { /* GENERATED_BUILD_OUTPUT */ -var legacy_beautify_js = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 0); -/******/ }) -/************************************************************************/ -/******/ ([ +var legacy_beautify_js; +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ([ /* 0 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -226,9 +141,8 @@ module.exports.defaultOptions = function() { /***/ }), /* 1 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -777,7 +691,7 @@ Beautifier.prototype.handle_start_expr = function(current_token) { } } - if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR])) { + 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 { @@ -785,7 +699,7 @@ Beautifier.prototype.handle_start_expr = function(current_token) { 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'])) { + } 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'])) { @@ -1288,7 +1202,9 @@ Beautifier.prototype.handle_semicolon = function(current_token) { }; Beautifier.prototype.handle_string = function(current_token) { - if (this.start_of_statement(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; @@ -1300,6 +1216,8 @@ Beautifier.prototype.handle_string = function(current_token) { 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(); } @@ -1688,9 +1606,8 @@ module.exports.Beautifier = Beautifier; /***/ }), /* 2 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* The MIT License (MIT) @@ -2114,9 +2031,8 @@ module.exports.Output = Output; /***/ }), /* 3 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -2175,9 +2091,8 @@ module.exports.Token = Token; /***/ }), /* 4 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(__unused_webpack_module, exports) { -"use strict"; /* jshint node: true, curly: false */ // Parts of this section of code is taken from acorn. // @@ -2239,9 +2154,8 @@ exports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g'); /***/ }), /* 5 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -2339,9 +2253,8 @@ module.exports.Options = Options; /***/ }), /* 6 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -2411,10 +2324,10 @@ function Options(options, merge_child_field) { this.indent_empty_lines = this._get_boolean('indent_empty_lines'); - // valid templating languages ['django', 'erb', 'handlebars', 'php'] + // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty'] // For now, 'auto' = all off for javascript, all on for html (and inline javascript). // other values ignored - this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php'], ['auto']); + this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']); } Options.prototype._get_array = function(name, default_value) { @@ -2539,9 +2452,8 @@ module.exports.mergeOpts = _mergeOpts; /***/ }), /* 7 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -2610,7 +2522,7 @@ var TOKEN = { var directives_core = new Directives(/\/\*/, /\*\//); -var number_pattern = /0[xX][0123456789abcdefABCDEF]*|0[oO][01234567]*|0[bB][01]*|\d+n|(?:\.\d+|\d+\.?\d*)(?:[eE][+-]?\d+)?/; +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]/; @@ -2670,7 +2582,7 @@ var Tokenizer = function(input_string, options) { 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_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/), + xml: pattern_reader.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\]|)(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/), single_quote: templatable.until(/['\\\n\r\u2028\u2029]/), double_quote: templatable.until(/["\\\n\r\u2028\u2029]/), template_text: templatable.until(/[`\\$]/), @@ -3112,9 +3024,8 @@ module.exports.line_starters = line_starters.slice(); /***/ }), /* 8 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -3311,9 +3222,8 @@ module.exports.InputScanner = InputScanner; /***/ }), /* 9 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -3458,9 +3368,8 @@ module.exports.TOKEN = TOKEN; /***/ }), /* 10 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -3543,9 +3452,8 @@ module.exports.TokenStream = TokenStream; /***/ }), /* 11 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -3655,9 +3563,8 @@ module.exports.WhitespacePattern = WhitespacePattern; /***/ }), /* 12 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -3756,9 +3663,8 @@ module.exports.Pattern = Pattern; /***/ }), /* 13 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module) { -"use strict"; /*jshint node:true */ /* @@ -3825,9 +3731,8 @@ module.exports.Directives = Directives; /***/ }), /* 14 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, __unused_webpack_exports, __webpack_require__) { -"use strict"; /*jshint node:true */ /* @@ -3865,7 +3770,8 @@ var template_names = { django: false, erb: false, handlebars: false, - php: false + php: false, + smarty: false }; // This lets templates appear anywhere we would do a readUntil @@ -3886,12 +3792,15 @@ function TemplatablePattern(input_scanner, parent) { 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(/\?>/), + 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(/#}/) + 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(); @@ -3965,9 +3874,14 @@ TemplatablePattern.prototype.__set_templated_pattern = function() { } 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); @@ -4013,6 +3927,17 @@ TemplatablePattern.prototype._read_template = function() { 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; }; @@ -4022,7 +3947,42 @@ module.exports.TemplatablePattern = TemplatablePattern; /***/ }) -/******/ ]); +/******/ ]); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(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, __webpack_require__); +/******/ +/******/ // 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 __webpack_exports__ = __webpack_require__(0); +/******/ legacy_beautify_js = __webpack_exports__; +/******/ +/******/ })() +; var js_beautify = legacy_beautify_js; /* Footer */ if (typeof define === "function" && define.amd) {