diff --git a/functions/render/index.js b/functions/render/index.js index df20702..ac6638c 100644 --- a/functions/render/index.js +++ b/functions/render/index.js @@ -235,8 +235,8 @@ async function fetch(url, options_) { request_.setTimeout(0); const headers = fromRawHeaders(response_.rawHeaders); if (isRedirect(response_.statusCode)) { - const location3 = headers.get("Location"); - const locationURL = location3 === null ? null : new URL(location3, request.url); + const location2 = headers.get("Location"); + const locationURL = location2 === null ? null : new URL(location2, request.url); switch (request.redirect) { case "error": reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, "no-redirect")); @@ -358,7 +358,7 @@ async function fetch(url, options_) { writeToStream(request_, request); }); } -var import_http, import_https, import_zlib, import_stream, import_util, import_crypto, import_url, src, Readable, wm, Blob2, fetchBlob, FetchBaseError, FetchError, NAME, isURLSearchParameters, isBlob, isAbortSignal, carriage, dashes, carriageLength, getFooter, getBoundary, INTERNALS$2, Body, clone, extractContentType, getTotalBytes, writeToStream, validateHeaderName, validateHeaderValue, Headers, redirectStatus, isRedirect, INTERNALS$1, Response, getSearch, INTERNALS, isRequest, Request, getNodeRequestOptions, AbortError, supportedSchemas; +var import_http, import_https, import_zlib, import_stream, import_util, import_crypto, import_url, src, Readable, wm, Blob, fetchBlob, FetchBaseError, FetchError, NAME, isURLSearchParameters, isBlob, isAbortSignal, carriage, dashes, carriageLength, getFooter, getBoundary, INTERNALS$2, Body, clone, extractContentType, getTotalBytes, writeToStream, validateHeaderName, validateHeaderValue, Headers, redirectStatus, isRedirect, INTERNALS$1, Response, getSearch, INTERNALS, isRequest, Request, getNodeRequestOptions, AbortError, supportedSchemas; var init_install_fetch = __esm({ "node_modules/@sveltejs/kit/dist/install-fetch.js"() { init_shims(); @@ -372,7 +372,7 @@ var init_install_fetch = __esm({ src = dataUriToBuffer; ({ Readable } = import_stream.default); wm = new WeakMap(); - Blob2 = class { + Blob = class { constructor(blobParts = [], options2 = {}) { let size = 0; const parts = blobParts.map((element) => { @@ -383,7 +383,7 @@ var init_install_fetch = __esm({ buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); } else if (element instanceof ArrayBuffer) { buffer = Buffer.from(element); - } else if (element instanceof Blob2) { + } else if (element instanceof Blob) { buffer = element; } else { buffer = Buffer.from(typeof element === "string" ? element : String(element)); @@ -442,7 +442,7 @@ var init_install_fetch = __esm({ } } } - const blob = new Blob2([], { type: String(type).toLowerCase() }); + const blob = new Blob([], { type: String(type).toLowerCase() }); Object.assign(wm.get(blob), { size: span, parts: blobParts }); return blob; } @@ -453,12 +453,12 @@ var init_install_fetch = __esm({ return object && typeof object === "object" && typeof object.stream === "function" && object.stream.length === 0 && typeof object.constructor === "function" && /^(Blob|File)$/.test(object[Symbol.toStringTag]); } }; - Object.defineProperties(Blob2.prototype, { + Object.defineProperties(Blob.prototype, { size: { enumerable: true }, type: { enumerable: true }, slice: { enumerable: true } }); - fetchBlob = Blob2; + fetchBlob = Blob; FetchBaseError = class extends Error { constructor(message, type) { super(message); @@ -2747,14 +2747,14 @@ var require_Parser = __commonJS({ return parser.parseInline(tokens); } parse(tokens, top = true) { - let out = "", i, j, k, l2, l3, row, cell, header, body, token, ordered, start, loose, itemBody, item, checked, task, checkbox, ret2; + let out = "", i, j, k, l2, l3, row, cell, header, body, token, ordered, start, loose, itemBody, item, checked, task, checkbox, ret; const l = tokens.length; for (i = 0; i < l; i++) { token = tokens[i]; if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) { - ret2 = this.options.extensions.renderers[token.type].call(this, token); - if (ret2 !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(token.type)) { - out += ret2 || ""; + ret = this.options.extensions.renderers[token.type].call(this, token); + if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(token.type)) { + out += ret || ""; continue; } } @@ -2868,14 +2868,14 @@ var require_Parser = __commonJS({ } parseInline(tokens, renderer) { renderer = renderer || this.renderer; - let out = "", i, token, ret2; + let out = "", i, token, ret; const l = tokens.length; for (i = 0; i < l; i++) { token = tokens[i]; if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) { - ret2 = this.options.extensions.renderers[token.type].call(this, token); - if (ret2 !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(token.type)) { - out += ret2 || ""; + ret = this.options.extensions.renderers[token.type].call(this, token); + if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(token.type)) { + out += ret || ""; continue; } } @@ -3061,11 +3061,11 @@ var require_marked = __commonJS({ const prevRenderer = extensions.renderers ? extensions.renderers[ext.name] : null; if (prevRenderer) { extensions.renderers[ext.name] = function(...args2) { - let ret2 = ext.renderer.apply(this, args2); - if (ret2 === false) { - ret2 = prevRenderer.apply(this, args2); + let ret = ext.renderer.apply(this, args2); + if (ret === false) { + ret = prevRenderer.apply(this, args2); } - return ret2; + return ret; }; } else { extensions.renderers[ext.name] = ext.renderer; @@ -3106,11 +3106,11 @@ var require_marked = __commonJS({ for (const prop in pack.renderer) { const prevRenderer = renderer[prop]; renderer[prop] = (...args2) => { - let ret2 = pack.renderer[prop].apply(renderer, args2); - if (ret2 === false) { - ret2 = prevRenderer.apply(renderer, args2); + let ret = pack.renderer[prop].apply(renderer, args2); + if (ret === false) { + ret = prevRenderer.apply(renderer, args2); } - return ret2; + return ret; }; } opts.renderer = renderer; @@ -3120,11 +3120,11 @@ var require_marked = __commonJS({ for (const prop in pack.tokenizer) { const prevTokenizer = tokenizer[prop]; tokenizer[prop] = (...args2) => { - let ret2 = pack.tokenizer[prop].apply(tokenizer, args2); - if (ret2 === false) { - ret2 = prevTokenizer.apply(tokenizer, args2); + let ret = pack.tokenizer[prop].apply(tokenizer, args2); + if (ret === false) { + ret = prevTokenizer.apply(tokenizer, args2); } - return ret2; + return ret; }; } opts.tokenizer = tokenizer; @@ -3241,7 +3241,7 @@ var require_kind_of = __commonJS({ return "arguments"; if (isDate(val)) return "date"; - if (isError2(val)) + if (isError(val)) return "error"; if (isRegexp(val)) return "regexp"; @@ -3303,7 +3303,7 @@ var require_kind_of = __commonJS({ return Array.isArray(val); return val instanceof Array; } - function isError2(val) { + function isError(val) { return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number"; } function isDate(val) { @@ -3359,15 +3359,15 @@ var require_extend_shallow = __commonJS({ "node_modules/extend-shallow/index.js"(exports2, module2) { init_shims(); "use strict"; - var isObject2 = require_is_extendable(); + var isObject = require_is_extendable(); module2.exports = function extend(o) { - if (!isObject2(o)) { + if (!isObject(o)) { o = {}; } var len = arguments.length; for (var i = 1; i < len; i++) { var obj = arguments[i]; - if (isObject2(obj)) { + if (isObject(obj)) { assign2(o, obj); } } @@ -3502,7 +3502,7 @@ var require_common = __commonJS({ function isNothing(subject) { return typeof subject === "undefined" || subject === null; } - function isObject2(subject) { + function isObject(subject) { return typeof subject === "object" && subject !== null; } function toArray(sequence) { @@ -3534,7 +3534,7 @@ var require_common = __commonJS({ return number === 0 && Number.NEGATIVE_INFINITY === 1 / number; } module2.exports.isNothing = isNothing; - module2.exports.isObject = isObject2; + module2.exports.isObject = isObject; module2.exports.toArray = toArray; module2.exports.repeat = repeat; module2.exports.isNegativeZero = isNegativeZero; @@ -3702,20 +3702,20 @@ var require_schema = __commonJS({ var YAMLException = require_exception(); var Type = require_type(); function compileList(schema, name, result) { - var exclude2 = []; + var exclude = []; schema.include.forEach(function(includedSchema) { result = compileList(includedSchema, name, result); }); schema[name].forEach(function(currentType) { result.forEach(function(previousType, previousIndex) { if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { - exclude2.push(previousIndex); + exclude.push(previousIndex); } }); result.push(currentType); }); return result.filter(function(type, index2) { - return exclude2.indexOf(index2) === -1; + return exclude.indexOf(index2) === -1; }); } function compileMap() { @@ -5760,7 +5760,7 @@ var require_loader = __commonJS({ iterator(documents[index2]); } } - function load2(input, options2) { + function load3(input, options2) { var documents = loadDocuments(input, options2); if (documents.length === 0) { return void 0; @@ -5777,10 +5777,10 @@ var require_loader = __commonJS({ return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2)); } function safeLoad(input, options2) { - return load2(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2)); + return load3(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options2)); } module2.exports.loadAll = loadAll; - module2.exports.load = load2; + module2.exports.load = load3; module2.exports.safeLoadAll = safeLoadAll; module2.exports.safeLoad = safeLoad; } @@ -6576,12 +6576,12 @@ var require_stringify = __commonJS({ throw new TypeError('expected "' + language + '.stringify" to be a function'); } data = Object.assign({}, file.data, data); - const open2 = opts.delimiters[0]; + const open = opts.delimiters[0]; const close = opts.delimiters[1]; const matter = engine.stringify(data, options2).trim(); let buf = ""; if (matter !== "{}") { - buf = newline(open2) + newline(matter) + newline(close); + buf = newline(open) + newline(matter) + newline(close); } if (typeof file.excerpt === "string" && file.excerpt !== "") { if (str.indexOf(file.excerpt.trim()) === -1) { @@ -6709,18 +6709,18 @@ var require_gray_matter = __commonJS({ } function parseMatter(file, options2) { const opts = defaults2(options2); - const open2 = opts.delimiters[0]; + const open = opts.delimiters[0]; const close = "\n" + opts.delimiters[1]; let str = file.content; if (opts.language) { file.language = opts.language; } - const openLen = open2.length; - if (!utils.startsWith(str, open2, openLen)) { + const openLen = open.length; + if (!utils.startsWith(str, open, openLen)) { excerpt(file, opts); return file; } - if (str.charAt(openLen) === open2.slice(-1)) { + if (str.charAt(openLen) === open.slice(-1)) { return file; } str = str.slice(openLen); @@ -6777,9 +6777,9 @@ var require_gray_matter = __commonJS({ }; matter.language = function(str, options2) { const opts = defaults2(options2); - const open2 = opts.delimiters[0]; + const open = opts.delimiters[0]; if (matter.test(str)) { - str = str.slice(open2.length); + str = str.slice(open.length); } const language = str.slice(0, str.search(/\r?\n/)); return { @@ -6795,14169 +6795,13585 @@ var require_gray_matter = __commonJS({ } }); -// node_modules/bluebird/js/release/es5.js -var require_es5 = __commonJS({ - "node_modules/bluebird/js/release/es5.js"(exports2, module2) { +// node_modules/tslib/tslib.js +var require_tslib = __commonJS({ + "node_modules/tslib/tslib.js"(exports2, module2) { init_shims(); - var isES5 = function() { - "use strict"; - return this === void 0; - }(); - if (isES5) { - module2.exports = { - freeze: Object.freeze, - defineProperty: Object.defineProperty, - getDescriptor: Object.getOwnPropertyDescriptor, - keys: Object.keys, - names: Object.getOwnPropertyNames, - getPrototypeOf: Object.getPrototypeOf, - isArray: Array.isArray, - isES5, - propertyIsWritable: function(obj, prop) { - var descriptor = Object.getOwnPropertyDescriptor(obj, prop); - return !!(!descriptor || descriptor.writable || descriptor.set); + var __extends; + var __assign; + var __rest; + var __decorate; + var __param; + var __metadata; + var __awaiter; + var __generator; + var __exportStar; + var __values; + var __read; + var __spread; + var __spreadArrays; + var __spreadArray; + var __await; + var __asyncGenerator; + var __asyncDelegator; + var __asyncValues; + var __makeTemplateObject; + var __importStar; + var __importDefault; + var __classPrivateFieldGet; + var __classPrivateFieldSet; + var __createBinding; + (function(factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function(exports3) { + factory(createExporter(root, createExporter(exports3))); + }); + } else if (typeof module2 === "object" && typeof module2.exports === "object") { + factory(createExporter(root, createExporter(module2.exports))); + } else { + factory(createExporter(root)); + } + function createExporter(exports3, previous) { + if (exports3 !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports3, "__esModule", { value: true }); + } else { + exports3.__esModule = true; + } } + return function(id, v) { + return exports3[id] = previous ? previous(id, v) : v; + }; + } + })(function(exporter) { + var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b) { + d2.__proto__ = b; + } || function(d2, b) { + for (var p in b) + if (Object.prototype.hasOwnProperty.call(b, p)) + d2[p] = b[p]; + }; + __extends = function(d2, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d2, b); + function __() { + this.constructor = d2; + } + d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + __assign = Object.assign || function(t) { + for (var s2, i = 1, n = arguments.length; i < n; i++) { + s2 = arguments[i]; + for (var p in s2) + if (Object.prototype.hasOwnProperty.call(s2, p)) + t[p] = s2[p]; + } + return t; + }; + __rest = function(s2, e) { + var t = {}; + for (var p in s2) + if (Object.prototype.hasOwnProperty.call(s2, p) && e.indexOf(p) < 0) + t[p] = s2[p]; + if (s2 != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s2); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p[i])) + t[p[i]] = s2[p[i]]; + } + return t; + }; + __decorate = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") + r = Reflect.decorate(decorators, target, key, desc); + else + for (var i = decorators.length - 1; i >= 0; i--) + if (d2 = decorators[i]) + r = (c < 3 ? d2(r) : c > 3 ? d2(target, key, r) : d2(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + __param = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; }; - } else { - has = {}.hasOwnProperty; - str = {}.toString; - proto = {}.constructor.prototype; - ObjectKeys = function(o) { - var ret2 = []; - for (var key in o) { - if (has.call(o, key)) { - ret2.push(key); + __metadata = function(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") + return Reflect.metadata(metadataKey, metadataValue); + }; + __awaiter = function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + __generator = function(thisArg, body) { + var _ = { label: 0, sent: function() { + if (t[0] & 1) + throw t[1]; + return t[1]; + }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); + }; } - return ret2; + function step(op) { + if (f) + throw new TypeError("Generator is already executing."); + while (_) + try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) + return t; + if (y = 0, t) + op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) + _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) + throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + __exportStar = function(m, o) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) + __createBinding(o, m, p); + }; + __createBinding = Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + o[k2] = m[k]; + }; + __values = function(o) { + var s2 = typeof Symbol === "function" && Symbol.iterator, m = s2 && o[s2], i = 0; + if (m) + return m.call(o); + if (o && typeof o.length === "number") + return { + next: function() { + if (o && i >= o.length) + o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined."); }; - ObjectGetDescriptor = function(o, key) { - return { value: o[key] }; + __read = function(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) + return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) + ar.push(r.value); + } catch (error3) { + e = { error: error3 }; + } finally { + try { + if (r && !r.done && (m = i["return"])) + m.call(i); + } finally { + if (e) + throw e.error; + } + } + return ar; + }; + __spread = function() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + __spreadArrays = function() { + for (var s2 = 0, i = 0, il = arguments.length; i < il; i++) + s2 += arguments[i].length; + for (var r = Array(s2), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + __spreadArray = function(to, from, pack) { + if (pack || arguments.length === 2) + for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); }; - ObjectDefineProperty = function(o, key, desc) { - o[key] = desc.value; - return o; + __await = function(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); }; - ObjectFreeze = function(obj) { - return obj; + __asyncGenerator = function(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) + i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; + } + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); + } + } + function step(r) { + r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + } + function fulfill(value) { + resume("next", value); + } + function reject(value) { + resume("throw", value); + } + function settle(f, v) { + if (f(v), q.shift(), q.length) + resume(q[0][0], q[0][1]); + } }; - ObjectGetPrototypeOf = function(obj) { - try { - return Object(obj).constructor.prototype; - } catch (e) { - return proto; + __asyncDelegator = function(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function(e) { + throw e; + }), verb("return"), i[Symbol.iterator] = function() { + return this; + }, i; + function verb(n, f) { + i[n] = o[n] ? function(v) { + return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; + } : f; + } + }; + __asyncValues = function(o) { + if (!Symbol.asyncIterator) + throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i); + function verb(n) { + i[n] = o[n] && function(v) { + return new Promise(function(resolve2, reject) { + v = o[n](v), settle(resolve2, reject, v.done, v.value); + }); + }; + } + function settle(resolve2, reject, d2, v) { + Promise.resolve(v).then(function(v2) { + resolve2({ value: v2, done: d2 }); + }, reject); } }; - ArrayIsArray = function(obj) { - try { - return str.call(obj) === "[object Array]"; - } catch (e) { - return false; + __makeTemplateObject = function(cooked, raw) { + if (Object.defineProperty) { + Object.defineProperty(cooked, "raw", { value: raw }); + } else { + cooked.raw = raw; } + return cooked; }; - module2.exports = { - isArray: ArrayIsArray, - keys: ObjectKeys, - names: ObjectKeys, - defineProperty: ObjectDefineProperty, - getDescriptor: ObjectGetDescriptor, - freeze: ObjectFreeze, - getPrototypeOf: ObjectGetPrototypeOf, - isES5, - propertyIsWritable: function() { - return true; + var __setModuleDefault = Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }; + __importStar = function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); } + __setModuleDefault(result, mod); + return result; }; - } - var has; - var str; - var proto; - var ObjectKeys; - var ObjectGetDescriptor; - var ObjectDefineProperty; - var ObjectFreeze; - var ObjectGetPrototypeOf; - var ArrayIsArray; + __importDefault = function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + __classPrivateFieldGet = function(receiver, state, kind, f) { + if (kind === "a" && !f) + throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) + throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); + }; + __classPrivateFieldSet = function(receiver, state, value, kind, f) { + if (kind === "m") + throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) + throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) + throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; + }; + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__spreadArray", __spreadArray); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); + }); } }); -// node_modules/bluebird/js/release/util.js -var require_util = __commonJS({ - "node_modules/bluebird/js/release/util.js"(exports, module) { +// node_modules/cheerio/lib/types.js +var require_types = __commonJS({ + "node_modules/cheerio/lib/types.js"(exports2) { init_shims(); "use strict"; - var es5 = require_es5(); - var canEvaluate = typeof navigator == "undefined"; - var errorObj = { e: {} }; - var tryCatchTarget; - var globalObject = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : exports !== void 0 ? exports : null; - function tryCatcher() { - try { - var target = tryCatchTarget; - tryCatchTarget = null; - return target.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } - } - function tryCatch(fn) { - tryCatchTarget = fn; - return tryCatcher; - } - var inherits = function(Child, Parent) { - var hasProp = {}.hasOwnProperty; - function T() { - this.constructor = Child; - this.constructor$ = Parent; - for (var propertyName in Parent.prototype) { - if (hasProp.call(Parent.prototype, propertyName) && propertyName.charAt(propertyName.length - 1) !== "$") { - this[propertyName + "$"] = Parent.prototype[propertyName]; - } - } - } - T.prototype = Parent.prototype; - Child.prototype = new T(); - return Child.prototype; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// node_modules/cheerio/lib/options.js +var require_options = __commonJS({ + "node_modules/cheerio/lib/options.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.flatten = void 0; + var tslib_1 = require_tslib(); + var defaultOpts = { + xml: false, + decodeEntities: true }; - function isPrimitive(val) { - return val == null || val === true || val === false || typeof val === "string" || typeof val === "number"; - } - function isObject(value) { - return typeof value === "function" || typeof value === "object" && value !== null; - } - function maybeWrapAsError(maybeError) { - if (!isPrimitive(maybeError)) - return maybeError; - return new Error(safeToString(maybeError)); - } - function withAppended(target, appendee) { - var len = target.length; - var ret2 = new Array(len + 1); - var i; - for (i = 0; i < len; ++i) { - ret2[i] = target[i]; - } - ret2[i] = appendee; - return ret2; - } - function getDataPropertyOrDefault(obj, key, defaultValue) { - if (es5.isES5) { - var desc = Object.getOwnPropertyDescriptor(obj, key); - if (desc != null) { - return desc.get == null && desc.set == null ? desc.value : defaultValue; - } - } else { - return {}.hasOwnProperty.call(obj, key) ? obj[key] : void 0; - } + exports2.default = defaultOpts; + var xmlModeDefault = { + _useHtmlParser2: true, + xmlMode: true + }; + function flatten(options2) { + return (options2 === null || options2 === void 0 ? void 0 : options2.xml) ? typeof options2.xml === "boolean" ? xmlModeDefault : tslib_1.__assign(tslib_1.__assign({}, xmlModeDefault), options2.xml) : options2 !== null && options2 !== void 0 ? options2 : void 0; } - function notEnumerableProp(obj, name, value) { - if (isPrimitive(obj)) - return obj; - var descriptor = { - value, - configurable: true, - enumerable: false, - writable: true - }; - es5.defineProperty(obj, name, descriptor); - return obj; + exports2.flatten = flatten; + } +}); + +// node_modules/css-what/lib/parse.js +var require_parse2 = __commonJS({ + "node_modules/css-what/lib/parse.js"(exports2) { + init_shims(); + "use strict"; + var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) { + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) + to[j] = from[i]; + return to; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isTraversal = void 0; + var reName = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/; + var reEscape = /\\([\da-f]{1,6}\s?|(\s)|.)/gi; + var actionTypes = new Map([ + ["~", "element"], + ["^", "start"], + ["$", "end"], + ["*", "any"], + ["!", "not"], + ["|", "hyphen"] + ]); + var Traversals = { + ">": "child", + "<": "parent", + "~": "sibling", + "+": "adjacent" + }; + var attribSelectors = { + "#": ["id", "equals"], + ".": ["class", "element"] + }; + var unpackPseudos = new Set([ + "has", + "not", + "matches", + "is", + "host", + "host-context" + ]); + var traversalNames = new Set(__spreadArray([ + "descendant" + ], Object.keys(Traversals).map(function(k) { + return Traversals[k]; + }))); + var caseInsensitiveAttributes = new Set([ + "accept", + "accept-charset", + "align", + "alink", + "axis", + "bgcolor", + "charset", + "checked", + "clear", + "codetype", + "color", + "compact", + "declare", + "defer", + "dir", + "direction", + "disabled", + "enctype", + "face", + "frame", + "hreflang", + "http-equiv", + "lang", + "language", + "link", + "media", + "method", + "multiple", + "nohref", + "noresize", + "noshade", + "nowrap", + "readonly", + "rel", + "rev", + "rules", + "scope", + "scrolling", + "selected", + "shape", + "target", + "text", + "type", + "valign", + "valuetype", + "vlink" + ]); + function isTraversal(selector) { + return traversalNames.has(selector.type); + } + exports2.isTraversal = isTraversal; + var stripQuotesFromPseudos = new Set(["contains", "icontains"]); + var quotes = new Set(['"', "'"]); + function funescape(_, escaped3, escapedWhitespace) { + var high = parseInt(escaped3, 16) - 65536; + return high !== high || escapedWhitespace ? escaped3 : high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320); + } + function unescapeCSS(str) { + return str.replace(reEscape, funescape); } - function thrower(r) { - throw r; - } - var inheritedDataKeys = function() { - var excludedPrototypes = [ - Array.prototype, - Object.prototype, - Function.prototype - ]; - var isExcludedProto = function(val) { - for (var i = 0; i < excludedPrototypes.length; ++i) { - if (excludedPrototypes[i] === val) { - return true; - } - } - return false; - }; - if (es5.isES5) { - var getKeys = Object.getOwnPropertyNames; - return function(obj) { - var ret2 = []; - var visitedKeys = Object.create(null); - while (obj != null && !isExcludedProto(obj)) { - var keys; - try { - keys = getKeys(obj); - } catch (e) { - return ret2; + function isWhitespace(c) { + return c === " " || c === "\n" || c === " " || c === "\f" || c === "\r"; + } + function parse(selector, options2) { + var subselects = []; + var endIndex = parseSelector(subselects, "" + selector, options2, 0); + if (endIndex < selector.length) { + throw new Error("Unmatched selector: " + selector.slice(endIndex)); + } + return subselects; + } + exports2.default = parse; + function parseSelector(subselects, selector, options2, selectorIndex) { + var _a, _b; + if (options2 === void 0) { + options2 = {}; + } + var tokens = []; + var sawWS = false; + function getName2(offset) { + var match = selector.slice(selectorIndex + offset).match(reName); + if (!match) { + throw new Error("Expected name, found " + selector.slice(selectorIndex)); + } + var name = match[0]; + selectorIndex += offset + name.length; + return unescapeCSS(name); + } + function stripWhitespace(offset) { + while (isWhitespace(selector.charAt(selectorIndex + offset))) + offset++; + selectorIndex += offset; + } + function isEscaped(pos) { + var slashCount = 0; + while (selector.charAt(--pos) === "\\") + slashCount++; + return (slashCount & 1) === 1; + } + function ensureNotTraversal() { + if (tokens.length > 0 && isTraversal(tokens[tokens.length - 1])) { + throw new Error("Did not expect successive traversals."); + } + } + stripWhitespace(0); + while (selector !== "") { + var firstChar = selector.charAt(selectorIndex); + if (isWhitespace(firstChar)) { + sawWS = true; + stripWhitespace(1); + } else if (firstChar in Traversals) { + ensureNotTraversal(); + tokens.push({ type: Traversals[firstChar] }); + sawWS = false; + stripWhitespace(1); + } else if (firstChar === ",") { + if (tokens.length === 0) { + throw new Error("Empty sub-selector"); + } + subselects.push(tokens); + tokens = []; + sawWS = false; + stripWhitespace(1); + } else if (selector.startsWith("/*", selectorIndex)) { + var endIndex = selector.indexOf("*/", selectorIndex + 2); + if (endIndex < 0) { + throw new Error("Comment was not terminated"); + } + selectorIndex = endIndex + 2; + } else { + if (sawWS) { + ensureNotTraversal(); + tokens.push({ type: "descendant" }); + sawWS = false; + } + if (firstChar in attribSelectors) { + var _c = attribSelectors[firstChar], name_1 = _c[0], action = _c[1]; + tokens.push({ + type: "attribute", + name: name_1, + action, + value: getName2(1), + namespace: null, + ignoreCase: options2.xmlMode ? null : false + }); + } else if (firstChar === "[") { + stripWhitespace(1); + var name_2 = void 0; + var namespace = null; + if (selector.charAt(selectorIndex) === "|") { + namespace = ""; + selectorIndex += 1; } - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (visitedKeys[key]) - continue; - visitedKeys[key] = true; - var desc = Object.getOwnPropertyDescriptor(obj, key); - if (desc != null && desc.get == null && desc.set == null) { - ret2.push(key); + if (selector.startsWith("*|", selectorIndex)) { + namespace = "*"; + selectorIndex += 2; + } + name_2 = getName2(0); + if (namespace === null && selector.charAt(selectorIndex) === "|" && selector.charAt(selectorIndex + 1) !== "=") { + namespace = name_2; + name_2 = getName2(1); + } + if ((_a = options2.lowerCaseAttributeNames) !== null && _a !== void 0 ? _a : !options2.xmlMode) { + name_2 = name_2.toLowerCase(); + } + stripWhitespace(0); + var action = "exists"; + var possibleAction = actionTypes.get(selector.charAt(selectorIndex)); + if (possibleAction) { + action = possibleAction; + if (selector.charAt(selectorIndex + 1) !== "=") { + throw new Error("Expected `=`"); } + stripWhitespace(2); + } else if (selector.charAt(selectorIndex) === "=") { + action = "equals"; + stripWhitespace(1); } - obj = es5.getPrototypeOf(obj); - } - return ret2; - }; - } else { - var hasProp = {}.hasOwnProperty; - return function(obj) { - if (isExcludedProto(obj)) - return []; - var ret2 = []; - enumeration: - for (var key in obj) { - if (hasProp.call(obj, key)) { - ret2.push(key); + var value = ""; + var ignoreCase = null; + if (action !== "exists") { + if (quotes.has(selector.charAt(selectorIndex))) { + var quote = selector.charAt(selectorIndex); + var sectionEnd = selectorIndex + 1; + while (sectionEnd < selector.length && (selector.charAt(sectionEnd) !== quote || isEscaped(sectionEnd))) { + sectionEnd += 1; + } + if (selector.charAt(sectionEnd) !== quote) { + throw new Error("Attribute value didn't end"); + } + value = unescapeCSS(selector.slice(selectorIndex + 1, sectionEnd)); + selectorIndex = sectionEnd + 1; + } else { + var valueStart = selectorIndex; + while (selectorIndex < selector.length && (!isWhitespace(selector.charAt(selectorIndex)) && selector.charAt(selectorIndex) !== "]" || isEscaped(selectorIndex))) { + selectorIndex += 1; + } + value = unescapeCSS(selector.slice(valueStart, selectorIndex)); + } + stripWhitespace(0); + var forceIgnore = selector.charAt(selectorIndex); + if (forceIgnore === "s" || forceIgnore === "S") { + ignoreCase = false; + stripWhitespace(1); + } else if (forceIgnore === "i" || forceIgnore === "I") { + ignoreCase = true; + stripWhitespace(1); + } + } + if (!options2.xmlMode) { + ignoreCase !== null && ignoreCase !== void 0 ? ignoreCase : ignoreCase = caseInsensitiveAttributes.has(name_2); + } + if (selector.charAt(selectorIndex) !== "]") { + throw new Error("Attribute selector didn't terminate"); + } + selectorIndex += 1; + var attributeSelector = { + type: "attribute", + name: name_2, + action, + value, + namespace, + ignoreCase + }; + tokens.push(attributeSelector); + } else if (firstChar === ":") { + if (selector.charAt(selectorIndex + 1) === ":") { + tokens.push({ + type: "pseudo-element", + name: getName2(2).toLowerCase() + }); + continue; + } + var name_3 = getName2(1).toLowerCase(); + var data = null; + if (selector.charAt(selectorIndex) === "(") { + if (unpackPseudos.has(name_3)) { + if (quotes.has(selector.charAt(selectorIndex + 1))) { + throw new Error("Pseudo-selector " + name_3 + " cannot be quoted"); + } + data = []; + selectorIndex = parseSelector(data, selector, options2, selectorIndex + 1); + if (selector.charAt(selectorIndex) !== ")") { + throw new Error("Missing closing parenthesis in :" + name_3 + " (" + selector + ")"); + } + selectorIndex += 1; } else { - for (var i = 0; i < excludedPrototypes.length; ++i) { - if (hasProp.call(excludedPrototypes[i], key)) { - continue enumeration; + selectorIndex += 1; + var start = selectorIndex; + var counter = 1; + for (; counter > 0 && selectorIndex < selector.length; selectorIndex++) { + if (selector.charAt(selectorIndex) === "(" && !isEscaped(selectorIndex)) { + counter++; + } else if (selector.charAt(selectorIndex) === ")" && !isEscaped(selectorIndex)) { + counter--; } } - ret2.push(key); + if (counter) { + throw new Error("Parenthesis not matched"); + } + data = selector.slice(start, selectorIndex - 1); + if (stripQuotesFromPseudos.has(name_3)) { + var quot = data.charAt(0); + if (quot === data.slice(-1) && quotes.has(quot)) { + data = data.slice(1, -1); + } + data = unescapeCSS(data); + } } } - return ret2; - }; - } - }(); - var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; - function isClass(fn) { - try { - if (typeof fn === "function") { - var keys = es5.names(fn.prototype); - var hasMethods = es5.isES5 && keys.length > 1; - var hasMethodsOtherThanConstructor = keys.length > 0 && !(keys.length === 1 && keys[0] === "constructor"); - var hasThisAssignmentAndStaticMethods = thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; - if (hasMethods || hasMethodsOtherThanConstructor || hasThisAssignmentAndStaticMethods) { - return true; - } - } - return false; - } catch (e) { - return false; - } - } - function toFastProperties(obj) { - function FakeConstructor() { - } - FakeConstructor.prototype = obj; - var receiver = new FakeConstructor(); - function ic() { - return typeof receiver.foo; - } - ic(); - ic(); - return obj; - eval(obj); - } - var rident = /^[a-z$_][a-z$_0-9]*$/i; - function isIdentifier(str) { - return rident.test(str); - } - function filledRange(count, prefix, suffix) { - var ret2 = new Array(count); - for (var i = 0; i < count; ++i) { - ret2[i] = prefix + i + suffix; - } - return ret2; - } - function safeToString(obj) { - try { - return obj + ""; - } catch (e) { - return "[no string representation]"; - } - } - function isError(obj) { - return obj instanceof Error || obj !== null && typeof obj === "object" && typeof obj.message === "string" && typeof obj.name === "string"; - } - function markAsOriginatingFromRejection(e) { - try { - notEnumerableProp(e, "isOperational", true); - } catch (ignore) { - } - } - function originatesFromRejection(e) { - if (e == null) - return false; - return e instanceof Error["__BluebirdErrorTypes__"].OperationalError || e["isOperational"] === true; - } - function canAttachTrace(obj) { - return isError(obj) && es5.propertyIsWritable(obj, "stack"); - } - var ensureErrorObject = function() { - if (!("stack" in new Error())) { - return function(value) { - if (canAttachTrace(value)) - return value; - try { - throw new Error(safeToString(value)); - } catch (err) { - return err; - } - }; - } else { - return function(value) { - if (canAttachTrace(value)) - return value; - return new Error(safeToString(value)); - }; - } - }(); - function classString(obj) { - return {}.toString.call(obj); - } - function copyDescriptors(from, to, filter) { - var keys = es5.names(from); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (filter(key)) { - try { - es5.defineProperty(to, key, es5.getDescriptor(from, key)); - } catch (ignore) { - } - } - } - } - var asArray = function(v) { - if (es5.isArray(v)) { - return v; - } - return null; - }; - if (typeof Symbol !== "undefined" && Symbol.iterator) { - ArrayFrom = typeof Array.from === "function" ? function(v) { - return Array.from(v); - } : function(v) { - var ret2 = []; - var it = v[Symbol.iterator](); - var itResult; - while (!(itResult = it.next()).done) { - ret2.push(itResult.value); - } - return ret2; - }; - asArray = function(v) { - if (es5.isArray(v)) { - return v; - } else if (v != null && typeof v[Symbol.iterator] === "function") { - return ArrayFrom(v); - } - return null; - }; - } - var ArrayFrom; - var isNode = typeof process !== "undefined" && classString(process).toLowerCase() === "[object process]"; - var hasEnvVariables = typeof process !== "undefined" && typeof process.env !== "undefined"; - function env(key) { - return hasEnvVariables ? process.env[key] : void 0; - } - function getNativePromise() { - if (typeof Promise === "function") { - try { - var promise = new Promise(function() { - }); - if (classString(promise) === "[object Promise]") { - return Promise; + tokens.push({ type: "pseudo", name: name_3, data }); + } else { + var namespace = null; + var name_4 = void 0; + if (firstChar === "*") { + selectorIndex += 1; + name_4 = "*"; + } else if (reName.test(selector.slice(selectorIndex))) { + if (selector.charAt(selectorIndex) === "|") { + namespace = ""; + selectorIndex += 1; + } + name_4 = getName2(0); + } else { + if (tokens.length && tokens[tokens.length - 1].type === "descendant") { + tokens.pop(); + } + addToken(subselects, tokens); + return selectorIndex; + } + if (selector.charAt(selectorIndex) === "|") { + namespace = name_4; + if (selector.charAt(selectorIndex + 1) === "*") { + name_4 = "*"; + selectorIndex += 2; + } else { + name_4 = getName2(1); + } + } + if (name_4 === "*") { + tokens.push({ type: "universal", namespace }); + } else { + if ((_b = options2.lowerCaseTags) !== null && _b !== void 0 ? _b : !options2.xmlMode) { + name_4 = name_4.toLowerCase(); + } + tokens.push({ type: "tag", name: name_4, namespace }); + } } - } catch (e) { } } + addToken(subselects, tokens); + return selectorIndex; } - var reflectHandler; - function contextBind(ctx, cb) { - if (ctx === null || typeof cb !== "function" || cb === reflectHandler) { - return cb; - } - if (ctx.domain !== null) { - cb = ctx.domain.bind(cb); - } - var async = ctx.async; - if (async !== null) { - var old = cb; - cb = function() { - var $_len = arguments.length + 2; - var args = new Array($_len); - for (var $_i = 2; $_i < $_len; ++$_i) { - args[$_i] = arguments[$_i - 2]; - } - ; - args[0] = old; - args[1] = this; - return async.runInAsyncScope.apply(async, args); - }; - } - return cb; - } - var ret = { - setReflectHandler: function(fn) { - reflectHandler = fn; - }, - isClass, - isIdentifier, - inheritedDataKeys, - getDataPropertyOrDefault, - thrower, - isArray: es5.isArray, - asArray, - notEnumerableProp, - isPrimitive, - isObject, - isError, - canEvaluate, - errorObj, - tryCatch, - inherits, - withAppended, - maybeWrapAsError, - toFastProperties, - filledRange, - toString: safeToString, - canAttachTrace, - ensureErrorObject, - originatesFromRejection, - markAsOriginatingFromRejection, - classString, - copyDescriptors, - isNode, - hasEnvVariables, - env, - global: globalObject, - getNativePromise, - contextBind - }; - ret.isRecentNode = ret.isNode && function() { - var version; - if (process.versions && process.versions.node) { - version = process.versions.node.split(".").map(Number); - } else if (process.version) { - version = process.version.split(".").map(Number); - } - return version[0] === 0 && version[1] > 10 || version[0] > 0; - }(); - ret.nodeSupportsAsyncResource = ret.isNode && function() { - var supportsAsync = false; - try { - var res2 = require("async_hooks").AsyncResource; - supportsAsync = typeof res2.prototype.runInAsyncScope === "function"; - } catch (e) { - supportsAsync = false; + function addToken(subselects, tokens) { + if (subselects.length > 0 && tokens.length === 0) { + throw new Error("Empty sub-selector"); } - return supportsAsync; - }(); - if (ret.isNode) - ret.toFastProperties(process); - try { - throw new Error(); - } catch (e) { - ret.lastLineError = e; + subselects.push(tokens); } - module.exports = ret; } }); -// node_modules/bluebird/js/release/schedule.js -var require_schedule = __commonJS({ - "node_modules/bluebird/js/release/schedule.js"(exports2, module2) { +// node_modules/css-what/lib/stringify.js +var require_stringify2 = __commonJS({ + "node_modules/css-what/lib/stringify.js"(exports2) { init_shims(); "use strict"; - var util = require_util(); - var schedule; - var noAsyncScheduler = function() { - throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n"); - }; - var NativePromise = util.getNativePromise(); - if (util.isNode && typeof MutationObserver === "undefined") { - GlobalSetImmediate = global.setImmediate; - ProcessNextTick = process.nextTick; - schedule = util.isRecentNode ? function(fn) { - GlobalSetImmediate.call(global, fn); - } : function(fn) { - ProcessNextTick.call(process, fn); - }; - } else if (typeof NativePromise === "function" && typeof NativePromise.resolve === "function") { - nativePromise = NativePromise.resolve(); - schedule = function(fn) { - nativePromise.then(fn); - }; - } else if (typeof MutationObserver !== "undefined" && !(typeof window !== "undefined" && window.navigator && (window.navigator.standalone || window.cordova)) && "classList" in document.documentElement) { - schedule = function() { - var div = document.createElement("div"); - var opts = { attributes: true }; - var toggleScheduled = false; - var div2 = document.createElement("div"); - var o2 = new MutationObserver(function() { - div.classList.toggle("foo"); - toggleScheduled = false; - }); - o2.observe(div2, opts); - var scheduleToggle = function() { - if (toggleScheduled) - return; - toggleScheduled = true; - div2.classList.toggle("foo"); - }; - return function schedule2(fn) { - var o = new MutationObserver(function() { - o.disconnect(); - fn(); - }); - o.observe(div, opts); - scheduleToggle(); - }; - }(); - } else if (typeof setImmediate !== "undefined") { - schedule = function(fn) { - setImmediate(fn); - }; - } else if (typeof setTimeout !== "undefined") { - schedule = function(fn) { - setTimeout(fn, 0); - }; - } else { - schedule = noAsyncScheduler; - } - var GlobalSetImmediate; - var ProcessNextTick; - var nativePromise; - module2.exports = schedule; - } -}); - -// node_modules/bluebird/js/release/queue.js -var require_queue = __commonJS({ - "node_modules/bluebird/js/release/queue.js"(exports2, module2) { + var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) { + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) + to[j] = from[i]; + return to; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + var actionTypes = { + equals: "", + element: "~", + start: "^", + end: "$", + any: "*", + not: "!", + hyphen: "|" + }; + var charsToEscape = new Set(__spreadArray(__spreadArray([], Object.keys(actionTypes).map(function(typeKey) { + return actionTypes[typeKey]; + }).filter(Boolean)), [ + ":", + "[", + "]", + " ", + "\\", + "(", + ")", + "'" + ])); + function stringify(selector) { + return selector.map(stringifySubselector).join(", "); + } + exports2.default = stringify; + function stringifySubselector(token) { + return token.map(stringifyToken).join(""); + } + function stringifyToken(token) { + switch (token.type) { + case "child": + return " > "; + case "parent": + return " < "; + case "sibling": + return " ~ "; + case "adjacent": + return " + "; + case "descendant": + return " "; + case "universal": + return getNamespace(token.namespace) + "*"; + case "tag": + return getNamespacedName(token); + case "pseudo-element": + return "::" + escapeName(token.name); + case "pseudo": + if (token.data === null) + return ":" + escapeName(token.name); + if (typeof token.data === "string") { + return ":" + escapeName(token.name) + "(" + escapeName(token.data) + ")"; + } + return ":" + escapeName(token.name) + "(" + stringify(token.data) + ")"; + case "attribute": { + if (token.name === "id" && token.action === "equals" && !token.ignoreCase && !token.namespace) { + return "#" + escapeName(token.value); + } + if (token.name === "class" && token.action === "element" && !token.ignoreCase && !token.namespace) { + return "." + escapeName(token.value); + } + var name_1 = getNamespacedName(token); + if (token.action === "exists") { + return "[" + name_1 + "]"; + } + return "[" + name_1 + actionTypes[token.action] + "='" + escapeName(token.value) + "'" + (token.ignoreCase ? "i" : token.ignoreCase === false ? "s" : "") + "]"; + } + } + } + function getNamespacedName(token) { + return "" + getNamespace(token.namespace) + escapeName(token.name); + } + function getNamespace(namespace) { + return namespace !== null ? (namespace === "*" ? "*" : escapeName(namespace)) + "|" : ""; + } + function escapeName(str) { + return str.split("").map(function(c) { + return charsToEscape.has(c) ? "\\" + c : c; + }).join(""); + } + } +}); + +// node_modules/css-what/lib/index.js +var require_lib = __commonJS({ + "node_modules/css-what/lib/index.js"(exports2) { init_shims(); "use strict"; - function arrayMove(src2, srcIndex, dst, dstIndex, len) { - for (var j = 0; j < len; ++j) { - dst[j + dstIndex] = src2[j + srcIndex]; - src2[j + srcIndex] = void 0; - } - } - function Queue(capacity) { - this._capacity = capacity; - this._length = 0; - this._front = 0; - } - Queue.prototype._willBeOverCapacity = function(size) { - return this._capacity < size; - }; - Queue.prototype._pushOne = function(arg) { - var length = this.length(); - this._checkCapacity(length + 1); - var i = this._front + length & this._capacity - 1; - this[i] = arg; - this._length = length + 1; - }; - Queue.prototype.push = function(fn, receiver, arg) { - var length = this.length() + 3; - if (this._willBeOverCapacity(length)) { - this._pushOne(fn); - this._pushOne(receiver); - this._pushOne(arg); - return; - } - var j = this._front + length - 3; - this._checkCapacity(length); - var wrapMask = this._capacity - 1; - this[j + 0 & wrapMask] = fn; - this[j + 1 & wrapMask] = receiver; - this[j + 2 & wrapMask] = arg; - this._length = length; - }; - Queue.prototype.shift = function() { - var front = this._front, ret2 = this[front]; - this[front] = void 0; - this._front = front + 1 & this._capacity - 1; - this._length--; - return ret2; - }; - Queue.prototype.length = function() { - return this._length; - }; - Queue.prototype._checkCapacity = function(size) { - if (this._capacity < size) { - this._resizeTo(this._capacity << 1); - } - }; - Queue.prototype._resizeTo = function(capacity) { - var oldCapacity = this._capacity; - this._capacity = capacity; - var front = this._front; - var length = this._length; - var moveItemsCount = front + length & oldCapacity - 1; - arrayMove(this, 0, this, oldCapacity, moveItemsCount); - }; - module2.exports = Queue; + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + o[k2] = m[k]; + }); + var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) + __createBinding(exports3, m, p); + }; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.stringify = exports2.parse = void 0; + __exportStar(require_parse2(), exports2); + var parse_1 = require_parse2(); + Object.defineProperty(exports2, "parse", { enumerable: true, get: function() { + return __importDefault(parse_1).default; + } }); + var stringify_1 = require_stringify2(); + Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() { + return __importDefault(stringify_1).default; + } }); } }); -// node_modules/bluebird/js/release/async.js -var require_async = __commonJS({ - "node_modules/bluebird/js/release/async.js"(exports2, module2) { +// node_modules/domelementtype/lib/index.js +var require_lib2 = __commonJS({ + "node_modules/domelementtype/lib/index.js"(exports2) { init_shims(); "use strict"; - var firstLineError; - try { - throw new Error(); - } catch (e) { - firstLineError = e; - } - var schedule = require_schedule(); - var Queue = require_queue(); - function Async() { - this._customScheduler = false; - this._isTickUsed = false; - this._lateQueue = new Queue(16); - this._normalQueue = new Queue(16); - this._haveDrainedQueues = false; - var self2 = this; - this.drainQueues = function() { - self2._drainQueues(); - }; - this._schedule = schedule; - } - Async.prototype.setScheduler = function(fn) { - var prev = this._schedule; - this._schedule = fn; - this._customScheduler = true; - return prev; - }; - Async.prototype.hasCustomScheduler = function() { - return this._customScheduler; - }; - Async.prototype.haveItemsQueued = function() { - return this._isTickUsed || this._haveDrainedQueues; - }; - Async.prototype.fatalError = function(e, isNode2) { - if (isNode2) { - process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) + "\n"); - process.exit(2); - } else { - this.throwLater(e); - } - }; - Async.prototype.throwLater = function(fn, arg) { - if (arguments.length === 1) { - arg = fn; - fn = function() { - throw arg; - }; - } - if (typeof setTimeout !== "undefined") { - setTimeout(function() { - fn(arg); - }, 0); - } else - try { - this._schedule(function() { - fn(arg); - }); - } catch (e) { - throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n"); - } - }; - function AsyncInvokeLater(fn, receiver, arg) { - this._lateQueue.push(fn, receiver, arg); - this._queueTick(); - } - function AsyncInvoke(fn, receiver, arg) { - this._normalQueue.push(fn, receiver, arg); - this._queueTick(); - } - function AsyncSettlePromises(promise) { - this._normalQueue._pushOne(promise); - this._queueTick(); - } - Async.prototype.invokeLater = AsyncInvokeLater; - Async.prototype.invoke = AsyncInvoke; - Async.prototype.settlePromises = AsyncSettlePromises; - function _drainQueue(queue) { - while (queue.length() > 0) { - _drainQueueStep(queue); - } - } - function _drainQueueStep(queue) { - var fn = queue.shift(); - if (typeof fn !== "function") { - fn._settlePromises(); - } else { - var receiver = queue.shift(); - var arg = queue.shift(); - fn.call(receiver, arg); - } - } - Async.prototype._drainQueues = function() { - _drainQueue(this._normalQueue); - this._reset(); - this._haveDrainedQueues = true; - _drainQueue(this._lateQueue); - }; - Async.prototype._queueTick = function() { - if (!this._isTickUsed) { - this._isTickUsed = true; - this._schedule(this.drainQueues); - } - }; - Async.prototype._reset = function() { - this._isTickUsed = false; - }; - module2.exports = Async; - module2.exports.firstLineError = firstLineError; - } -}); - -// node_modules/bluebird/js/release/errors.js -var require_errors = __commonJS({ - "node_modules/bluebird/js/release/errors.js"(exports2, module2) { + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Doctype = exports2.CDATA = exports2.Tag = exports2.Style = exports2.Script = exports2.Comment = exports2.Directive = exports2.Text = exports2.Root = exports2.isTag = exports2.ElementType = void 0; + var ElementType; + (function(ElementType2) { + ElementType2["Root"] = "root"; + ElementType2["Text"] = "text"; + ElementType2["Directive"] = "directive"; + ElementType2["Comment"] = "comment"; + ElementType2["Script"] = "script"; + ElementType2["Style"] = "style"; + ElementType2["Tag"] = "tag"; + ElementType2["CDATA"] = "cdata"; + ElementType2["Doctype"] = "doctype"; + })(ElementType = exports2.ElementType || (exports2.ElementType = {})); + function isTag(elem) { + return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style; + } + exports2.isTag = isTag; + exports2.Root = ElementType.Root; + exports2.Text = ElementType.Text; + exports2.Directive = ElementType.Directive; + exports2.Comment = ElementType.Comment; + exports2.Script = ElementType.Script; + exports2.Style = ElementType.Style; + exports2.Tag = ElementType.Tag; + exports2.CDATA = ElementType.CDATA; + exports2.Doctype = ElementType.Doctype; + } +}); + +// node_modules/domhandler/lib/node.js +var require_node = __commonJS({ + "node_modules/domhandler/lib/node.js"(exports2) { init_shims(); "use strict"; - var es52 = require_es5(); - var Objectfreeze = es52.freeze; - var util = require_util(); - var inherits2 = util.inherits; - var notEnumerableProp2 = util.notEnumerableProp; - function subError(nameProperty, defaultMessage) { - function SubError(message) { - if (!(this instanceof SubError)) - return new SubError(message); - notEnumerableProp2(this, "message", typeof message === "string" ? message : defaultMessage); - notEnumerableProp2(this, "name", nameProperty); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - Error.call(this); + var __extends = exports2 && exports2.__extends || function() { + var extendStatics = function(d2, b) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) { + d3.__proto__ = b2; + } || function(d3, b2) { + for (var p in b2) + if (Object.prototype.hasOwnProperty.call(b2, p)) + d3[p] = b2[p]; + }; + return extendStatics(d2, b); + }; + return function(d2, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d2, b); + function __() { + this.constructor = d2; } - } - inherits2(SubError, Error); - return SubError; - } - var _TypeError; - var _RangeError; - var Warning = subError("Warning", "warning"); - var CancellationError = subError("CancellationError", "cancellation error"); - var TimeoutError = subError("TimeoutError", "timeout error"); - var AggregateError = subError("AggregateError", "aggregate error"); - try { - _TypeError = TypeError; - _RangeError = RangeError; - } catch (e) { - _TypeError = subError("TypeError", "type error"); - _RangeError = subError("RangeError", "range error"); - } - var methods = "join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "); - for (var i = 0; i < methods.length; ++i) { - if (typeof Array.prototype[methods[i]] === "function") { - AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; - } - } - es52.defineProperty(AggregateError.prototype, "length", { - value: 0, - configurable: false, - writable: true, - enumerable: true - }); - AggregateError.prototype["isOperational"] = true; - var level = 0; - AggregateError.prototype.toString = function() { - var indent = Array(level * 4 + 1).join(" "); - var ret2 = "\n" + indent + "AggregateError of:\n"; - level++; - indent = Array(level * 4 + 1).join(" "); - for (var i2 = 0; i2 < this.length; ++i2) { - var str = this[i2] === this ? "[Circular AggregateError]" : this[i2] + ""; - var lines = str.split("\n"); - for (var j = 0; j < lines.length; ++j) { - lines[j] = indent + lines[j]; - } - str = lines.join("\n"); - ret2 += str + "\n"; - } - level--; - return ret2; - }; - function OperationalError(message) { - if (!(this instanceof OperationalError)) - return new OperationalError(message); - notEnumerableProp2(this, "name", "OperationalError"); - notEnumerableProp2(this, "message", message); - this.cause = message; - this["isOperational"] = true; - if (message instanceof Error) { - notEnumerableProp2(this, "message", message.message); - notEnumerableProp2(this, "stack", message.stack); - } else if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - } - inherits2(OperationalError, Error); - var errorTypes = Error["__BluebirdErrorTypes__"]; - if (!errorTypes) { - errorTypes = Objectfreeze({ - CancellationError, - TimeoutError, - OperationalError, - RejectionError: OperationalError, - AggregateError + d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + }(); + var __assign = exports2 && exports2.__assign || function() { + __assign = Object.assign || function(t) { + for (var s2, i = 1, n = arguments.length; i < n; i++) { + s2 = arguments[i]; + for (var p in s2) + if (Object.prototype.hasOwnProperty.call(s2, p)) + t[p] = s2[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.cloneNode = exports2.hasChildren = exports2.isDocument = exports2.isDirective = exports2.isComment = exports2.isText = exports2.isCDATA = exports2.isTag = exports2.Element = exports2.Document = exports2.NodeWithChildren = exports2.ProcessingInstruction = exports2.Comment = exports2.Text = exports2.DataNode = exports2.Node = void 0; + var domelementtype_1 = require_lib2(); + var nodeTypes = new Map([ + [domelementtype_1.ElementType.Tag, 1], + [domelementtype_1.ElementType.Script, 1], + [domelementtype_1.ElementType.Style, 1], + [domelementtype_1.ElementType.Directive, 1], + [domelementtype_1.ElementType.Text, 3], + [domelementtype_1.ElementType.CDATA, 4], + [domelementtype_1.ElementType.Comment, 8], + [domelementtype_1.ElementType.Root, 9] + ]); + var Node = function() { + function Node2(type) { + this.type = type; + this.parent = null; + this.prev = null; + this.next = null; + this.startIndex = null; + this.endIndex = null; + } + Object.defineProperty(Node2.prototype, "nodeType", { + get: function() { + var _a; + return (_a = nodeTypes.get(this.type)) !== null && _a !== void 0 ? _a : 1; + }, + enumerable: false, + configurable: true }); - es52.defineProperty(Error, "__BluebirdErrorTypes__", { - value: errorTypes, - writable: false, + Object.defineProperty(Node2.prototype, "parentNode", { + get: function() { + return this.parent; + }, + set: function(parent) { + this.parent = parent; + }, enumerable: false, - configurable: false + configurable: true }); - } - module2.exports = { - Error, - TypeError: _TypeError, - RangeError: _RangeError, - CancellationError: errorTypes.CancellationError, - OperationalError: errorTypes.OperationalError, - TimeoutError: errorTypes.TimeoutError, - AggregateError: errorTypes.AggregateError, - Warning - }; - } -}); - -// node_modules/bluebird/js/release/thenables.js -var require_thenables = __commonJS({ - "node_modules/bluebird/js/release/thenables.js"(exports2, module2) { - init_shims(); - "use strict"; - module2.exports = function(Promise2, INTERNAL) { - var util = require_util(); - var errorObj2 = util.errorObj; - var isObject2 = util.isObject; - function tryConvertToPromise(obj, context) { - if (isObject2(obj)) { - if (obj instanceof Promise2) - return obj; - var then = getThen(obj); - if (then === errorObj2) { - if (context) - context._pushContext(); - var ret2 = Promise2.reject(then.e); - if (context) - context._popContext(); - return ret2; - } else if (typeof then === "function") { - if (isAnyBluebirdPromise(obj)) { - var ret2 = new Promise2(INTERNAL); - obj._then(ret2._fulfill, ret2._reject, void 0, ret2, null); - return ret2; - } - return doThenable(obj, then, context); - } - } - return obj; - } - function doGetThen(obj) { - return obj.then; - } - function getThen(obj) { - try { - return doGetThen(obj); - } catch (e) { - errorObj2.e = e; - return errorObj2; - } - } - var hasProp = {}.hasOwnProperty; - function isAnyBluebirdPromise(obj) { - try { - return hasProp.call(obj, "_promise0"); - } catch (e) { - return false; + Object.defineProperty(Node2.prototype, "previousSibling", { + get: function() { + return this.prev; + }, + set: function(prev) { + this.prev = prev; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Node2.prototype, "nextSibling", { + get: function() { + return this.next; + }, + set: function(next) { + this.next = next; + }, + enumerable: false, + configurable: true + }); + Node2.prototype.cloneNode = function(recursive) { + if (recursive === void 0) { + recursive = false; } + return cloneNode(this, recursive); + }; + return Node2; + }(); + exports2.Node = Node; + var DataNode = function(_super) { + __extends(DataNode2, _super); + function DataNode2(type, data) { + var _this = _super.call(this, type) || this; + _this.data = data; + return _this; + } + Object.defineProperty(DataNode2.prototype, "nodeValue", { + get: function() { + return this.data; + }, + set: function(data) { + this.data = data; + }, + enumerable: false, + configurable: true + }); + return DataNode2; + }(Node); + exports2.DataNode = DataNode; + var Text = function(_super) { + __extends(Text2, _super); + function Text2(data) { + return _super.call(this, domelementtype_1.ElementType.Text, data) || this; + } + return Text2; + }(DataNode); + exports2.Text = Text; + var Comment = function(_super) { + __extends(Comment2, _super); + function Comment2(data) { + return _super.call(this, domelementtype_1.ElementType.Comment, data) || this; + } + return Comment2; + }(DataNode); + exports2.Comment = Comment; + var ProcessingInstruction = function(_super) { + __extends(ProcessingInstruction2, _super); + function ProcessingInstruction2(name, data) { + var _this = _super.call(this, domelementtype_1.ElementType.Directive, data) || this; + _this.name = name; + return _this; + } + return ProcessingInstruction2; + }(DataNode); + exports2.ProcessingInstruction = ProcessingInstruction; + var NodeWithChildren = function(_super) { + __extends(NodeWithChildren2, _super); + function NodeWithChildren2(type, children) { + var _this = _super.call(this, type) || this; + _this.children = children; + return _this; + } + Object.defineProperty(NodeWithChildren2.prototype, "firstChild", { + get: function() { + var _a; + return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(NodeWithChildren2.prototype, "lastChild", { + get: function() { + return this.children.length > 0 ? this.children[this.children.length - 1] : null; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(NodeWithChildren2.prototype, "childNodes", { + get: function() { + return this.children; + }, + set: function(children) { + this.children = children; + }, + enumerable: false, + configurable: true + }); + return NodeWithChildren2; + }(Node); + exports2.NodeWithChildren = NodeWithChildren; + var Document = function(_super) { + __extends(Document2, _super); + function Document2(children) { + return _super.call(this, domelementtype_1.ElementType.Root, children) || this; + } + return Document2; + }(NodeWithChildren); + exports2.Document = Document; + var Element = function(_super) { + __extends(Element2, _super); + function Element2(name, attribs, children, type) { + if (children === void 0) { + children = []; + } + if (type === void 0) { + type = name === "script" ? domelementtype_1.ElementType.Script : name === "style" ? domelementtype_1.ElementType.Style : domelementtype_1.ElementType.Tag; + } + var _this = _super.call(this, type, children) || this; + _this.name = name; + _this.attribs = attribs; + return _this; + } + Object.defineProperty(Element2.prototype, "tagName", { + get: function() { + return this.name; + }, + set: function(name) { + this.name = name; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(Element2.prototype, "attributes", { + get: function() { + var _this = this; + return Object.keys(this.attribs).map(function(name) { + var _a, _b; + return { + name, + value: _this.attribs[name], + namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name], + prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name] + }; + }); + }, + enumerable: false, + configurable: true + }); + return Element2; + }(NodeWithChildren); + exports2.Element = Element; + function isTag(node) { + return domelementtype_1.isTag(node); + } + exports2.isTag = isTag; + function isCDATA(node) { + return node.type === domelementtype_1.ElementType.CDATA; + } + exports2.isCDATA = isCDATA; + function isText(node) { + return node.type === domelementtype_1.ElementType.Text; + } + exports2.isText = isText; + function isComment(node) { + return node.type === domelementtype_1.ElementType.Comment; + } + exports2.isComment = isComment; + function isDirective(node) { + return node.type === domelementtype_1.ElementType.Directive; + } + exports2.isDirective = isDirective; + function isDocument(node) { + return node.type === domelementtype_1.ElementType.Root; + } + exports2.isDocument = isDocument; + function hasChildren(node) { + return Object.prototype.hasOwnProperty.call(node, "children"); + } + exports2.hasChildren = hasChildren; + function cloneNode(node, recursive) { + if (recursive === void 0) { + recursive = false; + } + var result; + if (isText(node)) { + result = new Text(node.data); + } else if (isComment(node)) { + result = new Comment(node.data); + } else if (isTag(node)) { + var children = recursive ? cloneChildren(node.children) : []; + var clone_1 = new Element(node.name, __assign({}, node.attribs), children); + children.forEach(function(child) { + return child.parent = clone_1; + }); + if (node["x-attribsNamespace"]) { + clone_1["x-attribsNamespace"] = __assign({}, node["x-attribsNamespace"]); + } + if (node["x-attribsPrefix"]) { + clone_1["x-attribsPrefix"] = __assign({}, node["x-attribsPrefix"]); + } + result = clone_1; + } else if (isCDATA(node)) { + var children = recursive ? cloneChildren(node.children) : []; + var clone_2 = new NodeWithChildren(domelementtype_1.ElementType.CDATA, children); + children.forEach(function(child) { + return child.parent = clone_2; + }); + result = clone_2; + } else if (isDocument(node)) { + var children = recursive ? cloneChildren(node.children) : []; + var clone_3 = new Document(children); + children.forEach(function(child) { + return child.parent = clone_3; + }); + if (node["x-mode"]) { + clone_3["x-mode"] = node["x-mode"]; + } + result = clone_3; + } else if (isDirective(node)) { + var instruction = new ProcessingInstruction(node.name, node.data); + if (node["x-name"] != null) { + instruction["x-name"] = node["x-name"]; + instruction["x-publicId"] = node["x-publicId"]; + instruction["x-systemId"] = node["x-systemId"]; + } + result = instruction; + } else { + throw new Error("Not implemented yet: " + node.type); } - function doThenable(x, then, context) { - var promise = new Promise2(INTERNAL); - var ret2 = promise; - if (context) - context._pushContext(); - promise._captureStackTrace(); - if (context) - context._popContext(); - var synchronous = true; - var result = util.tryCatch(then).call(x, resolve2, reject); - synchronous = false; - if (promise && result === errorObj2) { - promise._rejectCallback(result.e, true, true); - promise = null; - } - function resolve2(value) { - if (!promise) - return; - promise._resolveCallback(value); - promise = null; - } - function reject(reason) { - if (!promise) - return; - promise._rejectCallback(reason, synchronous, true); - promise = null; - } - return ret2; + result.startIndex = node.startIndex; + result.endIndex = node.endIndex; + return result; + } + exports2.cloneNode = cloneNode; + function cloneChildren(childs) { + var children = childs.map(function(child) { + return cloneNode(child, true); + }); + for (var i = 1; i < children.length; i++) { + children[i].prev = children[i - 1]; + children[i - 1].next = children[i]; } - return tryConvertToPromise; - }; + return children; + } } }); -// node_modules/bluebird/js/release/promise_array.js -var require_promise_array = __commonJS({ - "node_modules/bluebird/js/release/promise_array.js"(exports2, module2) { +// node_modules/domhandler/lib/index.js +var require_lib3 = __commonJS({ + "node_modules/domhandler/lib/index.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, apiRejection, Proxyable) { - var util = require_util(); - var isArray = util.isArray; - function toResolutionValue(val) { - switch (val) { - case -2: - return []; - case -3: - return {}; - case -6: - return new Map(); - } - } - function PromiseArray(values) { - var promise = this._promise = new Promise2(INTERNAL); - if (values instanceof Promise2) { - promise._propagateFrom(values, 3); - values.suppressUnhandledRejections(); - } - promise._setOnCancel(this); - this._values = values; - this._length = 0; - this._totalResolved = 0; - this._init(void 0, -2); - } - util.inherits(PromiseArray, Proxyable); - PromiseArray.prototype.length = function() { - return this._length; - }; - PromiseArray.prototype.promise = function() { - return this._promise; - }; - PromiseArray.prototype._init = function init2(_, resolveValueIfEmpty) { - var values = tryConvertToPromise(this._values, this._promise); - if (values instanceof Promise2) { - values = values._target(); - var bitField = values._bitField; - ; - this._values = values; - if ((bitField & 50397184) === 0) { - this._promise._setAsyncGuaranteed(); - return values._then(init2, this._reject, void 0, this, resolveValueIfEmpty); - } else if ((bitField & 33554432) !== 0) { - values = values._value(); - } else if ((bitField & 16777216) !== 0) { - return this._reject(values._reason()); - } else { - return this._cancel(); - } - } - values = util.asArray(values); - if (values === null) { - var err = apiRejection("expecting an array or an iterable object but got " + util.classString(values)).reason(); - this._promise._rejectCallback(err, false); - return; - } - if (values.length === 0) { - if (resolveValueIfEmpty === -5) { - this._resolveEmptyArray(); - } else { - this._resolve(toResolutionValue(resolveValueIfEmpty)); - } + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + o[k2] = m[k]; + }); + var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) + __createBinding(exports3, m, p); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DomHandler = void 0; + var domelementtype_1 = require_lib2(); + var node_1 = require_node(); + __exportStar(require_node(), exports2); + var reWhitespace = /\s+/g; + var defaultOpts = { + normalizeWhitespace: false, + withStartIndices: false, + withEndIndices: false + }; + var DomHandler = function() { + function DomHandler2(callback, options2, elementCB) { + this.dom = []; + this.root = new node_1.Document(this.dom); + this.done = false; + this.tagStack = [this.root]; + this.lastNode = null; + this.parser = null; + if (typeof options2 === "function") { + elementCB = options2; + options2 = defaultOpts; + } + if (typeof callback === "object") { + options2 = callback; + callback = void 0; + } + this.callback = callback !== null && callback !== void 0 ? callback : null; + this.options = options2 !== null && options2 !== void 0 ? options2 : defaultOpts; + this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null; + } + DomHandler2.prototype.onparserinit = function(parser) { + this.parser = parser; + }; + DomHandler2.prototype.onreset = function() { + var _a; + this.dom = []; + this.root = new node_1.Document(this.dom); + this.done = false; + this.tagStack = [this.root]; + this.lastNode = null; + this.parser = (_a = this.parser) !== null && _a !== void 0 ? _a : null; + }; + DomHandler2.prototype.onend = function() { + if (this.done) return; - } - this._iterate(values); - }; - PromiseArray.prototype._iterate = function(values) { - var len = this.getActualLength(values.length); - this._length = len; - this._values = this.shouldCopyValues() ? new Array(len) : this._values; - var result = this._promise; - var isResolved = false; - var bitField = null; - for (var i = 0; i < len; ++i) { - var maybePromise = tryConvertToPromise(values[i], result); - if (maybePromise instanceof Promise2) { - maybePromise = maybePromise._target(); - bitField = maybePromise._bitField; + this.done = true; + this.parser = null; + this.handleCallback(null); + }; + DomHandler2.prototype.onerror = function(error3) { + this.handleCallback(error3); + }; + DomHandler2.prototype.onclosetag = function() { + this.lastNode = null; + var elem = this.tagStack.pop(); + if (this.options.withEndIndices) { + elem.endIndex = this.parser.endIndex; + } + if (this.elementCB) + this.elementCB(elem); + }; + DomHandler2.prototype.onopentag = function(name, attribs) { + var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : void 0; + var element = new node_1.Element(name, attribs, void 0, type); + this.addNode(element); + this.tagStack.push(element); + }; + DomHandler2.prototype.ontext = function(data) { + var normalizeWhitespace = this.options.normalizeWhitespace; + var lastNode = this.lastNode; + if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) { + if (normalizeWhitespace) { + lastNode.data = (lastNode.data + data).replace(reWhitespace, " "); } else { - bitField = null; + lastNode.data += data; } - if (isResolved) { - if (bitField !== null) { - maybePromise.suppressUnhandledRejections(); - } - } else if (bitField !== null) { - if ((bitField & 50397184) === 0) { - maybePromise._proxy(this, i); - this._values[i] = maybePromise; - } else if ((bitField & 33554432) !== 0) { - isResolved = this._promiseFulfilled(maybePromise._value(), i); - } else if ((bitField & 16777216) !== 0) { - isResolved = this._promiseRejected(maybePromise._reason(), i); - } else { - isResolved = this._promiseCancelled(i); - } - } else { - isResolved = this._promiseFulfilled(maybePromise, i); + } else { + if (normalizeWhitespace) { + data = data.replace(reWhitespace, " "); } + var node = new node_1.Text(data); + this.addNode(node); + this.lastNode = node; } - if (!isResolved) - result._setAsyncGuaranteed(); - }; - PromiseArray.prototype._isResolved = function() { - return this._values === null; }; - PromiseArray.prototype._resolve = function(value) { - this._values = null; - this._promise._fulfill(value); - }; - PromiseArray.prototype._cancel = function() { - if (this._isResolved() || !this._promise._isCancellable()) + DomHandler2.prototype.oncomment = function(data) { + if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) { + this.lastNode.data += data; return; - this._values = null; - this._promise._cancel(); + } + var node = new node_1.Comment(data); + this.addNode(node); + this.lastNode = node; }; - PromiseArray.prototype._reject = function(reason) { - this._values = null; - this._promise._rejectCallback(reason, false); + DomHandler2.prototype.oncommentend = function() { + this.lastNode = null; }; - PromiseArray.prototype._promiseFulfilled = function(value, index2) { - this._values[index2] = value; - var totalResolved = ++this._totalResolved; - if (totalResolved >= this._length) { - this._resolve(this._values); - return true; - } - return false; + DomHandler2.prototype.oncdatastart = function() { + var text = new node_1.Text(""); + var node = new node_1.NodeWithChildren(domelementtype_1.ElementType.CDATA, [text]); + this.addNode(node); + text.parent = node; + this.lastNode = text; }; - PromiseArray.prototype._promiseCancelled = function() { - this._cancel(); - return true; + DomHandler2.prototype.oncdataend = function() { + this.lastNode = null; }; - PromiseArray.prototype._promiseRejected = function(reason) { - this._totalResolved++; - this._reject(reason); - return true; + DomHandler2.prototype.onprocessinginstruction = function(name, data) { + var node = new node_1.ProcessingInstruction(name, data); + this.addNode(node); }; - PromiseArray.prototype._resultCancelled = function() { - if (this._isResolved()) - return; - var values = this._values; - this._cancel(); - if (values instanceof Promise2) { - values.cancel(); - } else { - for (var i = 0; i < values.length; ++i) { - if (values[i] instanceof Promise2) { - values[i].cancel(); - } - } + DomHandler2.prototype.handleCallback = function(error3) { + if (typeof this.callback === "function") { + this.callback(error3, this.dom); + } else if (error3) { + throw error3; } }; - PromiseArray.prototype.shouldCopyValues = function() { - return true; - }; - PromiseArray.prototype.getActualLength = function(len) { - return len; + DomHandler2.prototype.addNode = function(node) { + var parent = this.tagStack[this.tagStack.length - 1]; + var previousSibling = parent.children[parent.children.length - 1]; + if (this.options.withStartIndices) { + node.startIndex = this.parser.startIndex; + } + if (this.options.withEndIndices) { + node.endIndex = this.parser.endIndex; + } + parent.children.push(node); + if (previousSibling) { + node.prev = previousSibling; + previousSibling.next = node; + } + node.parent = parent; + this.lastNode = null; }; - return PromiseArray; - }; + return DomHandler2; + }(); + exports2.DomHandler = DomHandler; + exports2.default = DomHandler; + } +}); + +// node_modules/entities/lib/maps/entities.json +var require_entities = __commonJS({ + "node_modules/entities/lib/maps/entities.json"(exports2, module2) { + module2.exports = { Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", Acy: "\u0410", acy: "\u0430", AElig: "\xC6", aelig: "\xE6", af: "\u2061", Afr: "\u{1D504}", afr: "\u{1D51E}", Agrave: "\xC0", agrave: "\xE0", alefsym: "\u2135", aleph: "\u2135", Alpha: "\u0391", alpha: "\u03B1", Amacr: "\u0100", amacr: "\u0101", amalg: "\u2A3F", amp: "&", AMP: "&", andand: "\u2A55", And: "\u2A53", and: "\u2227", andd: "\u2A5C", andslope: "\u2A58", andv: "\u2A5A", ang: "\u2220", ange: "\u29A4", angle: "\u2220", angmsdaa: "\u29A8", angmsdab: "\u29A9", angmsdac: "\u29AA", angmsdad: "\u29AB", angmsdae: "\u29AC", angmsdaf: "\u29AD", angmsdag: "\u29AE", angmsdah: "\u29AF", angmsd: "\u2221", angrt: "\u221F", angrtvb: "\u22BE", angrtvbd: "\u299D", angsph: "\u2222", angst: "\xC5", angzarr: "\u237C", Aogon: "\u0104", aogon: "\u0105", Aopf: "\u{1D538}", aopf: "\u{1D552}", apacir: "\u2A6F", ap: "\u2248", apE: "\u2A70", ape: "\u224A", apid: "\u224B", apos: "'", ApplyFunction: "\u2061", approx: "\u2248", approxeq: "\u224A", Aring: "\xC5", aring: "\xE5", Ascr: "\u{1D49C}", ascr: "\u{1D4B6}", Assign: "\u2254", ast: "*", asymp: "\u2248", asympeq: "\u224D", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", awconint: "\u2233", awint: "\u2A11", backcong: "\u224C", backepsilon: "\u03F6", backprime: "\u2035", backsim: "\u223D", backsimeq: "\u22CD", Backslash: "\u2216", Barv: "\u2AE7", barvee: "\u22BD", barwed: "\u2305", Barwed: "\u2306", barwedge: "\u2305", bbrk: "\u23B5", bbrktbrk: "\u23B6", bcong: "\u224C", Bcy: "\u0411", bcy: "\u0431", bdquo: "\u201E", becaus: "\u2235", because: "\u2235", Because: "\u2235", bemptyv: "\u29B0", bepsi: "\u03F6", bernou: "\u212C", Bernoullis: "\u212C", Beta: "\u0392", beta: "\u03B2", beth: "\u2136", between: "\u226C", Bfr: "\u{1D505}", bfr: "\u{1D51F}", bigcap: "\u22C2", bigcirc: "\u25EF", bigcup: "\u22C3", bigodot: "\u2A00", bigoplus: "\u2A01", bigotimes: "\u2A02", bigsqcup: "\u2A06", bigstar: "\u2605", bigtriangledown: "\u25BD", bigtriangleup: "\u25B3", biguplus: "\u2A04", bigvee: "\u22C1", bigwedge: "\u22C0", bkarow: "\u290D", blacklozenge: "\u29EB", blacksquare: "\u25AA", blacktriangle: "\u25B4", blacktriangledown: "\u25BE", blacktriangleleft: "\u25C2", blacktriangleright: "\u25B8", blank: "\u2423", blk12: "\u2592", blk14: "\u2591", blk34: "\u2593", block: "\u2588", bne: "=\u20E5", bnequiv: "\u2261\u20E5", bNot: "\u2AED", bnot: "\u2310", Bopf: "\u{1D539}", bopf: "\u{1D553}", bot: "\u22A5", bottom: "\u22A5", bowtie: "\u22C8", boxbox: "\u29C9", boxdl: "\u2510", boxdL: "\u2555", boxDl: "\u2556", boxDL: "\u2557", boxdr: "\u250C", boxdR: "\u2552", boxDr: "\u2553", boxDR: "\u2554", boxh: "\u2500", boxH: "\u2550", boxhd: "\u252C", boxHd: "\u2564", boxhD: "\u2565", boxHD: "\u2566", boxhu: "\u2534", boxHu: "\u2567", boxhU: "\u2568", boxHU: "\u2569", boxminus: "\u229F", boxplus: "\u229E", boxtimes: "\u22A0", boxul: "\u2518", boxuL: "\u255B", boxUl: "\u255C", boxUL: "\u255D", boxur: "\u2514", boxuR: "\u2558", boxUr: "\u2559", boxUR: "\u255A", boxv: "\u2502", boxV: "\u2551", boxvh: "\u253C", boxvH: "\u256A", boxVh: "\u256B", boxVH: "\u256C", boxvl: "\u2524", boxvL: "\u2561", boxVl: "\u2562", boxVL: "\u2563", boxvr: "\u251C", boxvR: "\u255E", boxVr: "\u255F", boxVR: "\u2560", bprime: "\u2035", breve: "\u02D8", Breve: "\u02D8", brvbar: "\xA6", bscr: "\u{1D4B7}", Bscr: "\u212C", bsemi: "\u204F", bsim: "\u223D", bsime: "\u22CD", bsolb: "\u29C5", bsol: "\\", bsolhsub: "\u27C8", bull: "\u2022", bullet: "\u2022", bump: "\u224E", bumpE: "\u2AAE", bumpe: "\u224F", Bumpeq: "\u224E", bumpeq: "\u224F", Cacute: "\u0106", cacute: "\u0107", capand: "\u2A44", capbrcup: "\u2A49", capcap: "\u2A4B", cap: "\u2229", Cap: "\u22D2", capcup: "\u2A47", capdot: "\u2A40", CapitalDifferentialD: "\u2145", caps: "\u2229\uFE00", caret: "\u2041", caron: "\u02C7", Cayleys: "\u212D", ccaps: "\u2A4D", Ccaron: "\u010C", ccaron: "\u010D", Ccedil: "\xC7", ccedil: "\xE7", Ccirc: "\u0108", ccirc: "\u0109", Cconint: "\u2230", ccups: "\u2A4C", ccupssm: "\u2A50", Cdot: "\u010A", cdot: "\u010B", cedil: "\xB8", Cedilla: "\xB8", cemptyv: "\u29B2", cent: "\xA2", centerdot: "\xB7", CenterDot: "\xB7", cfr: "\u{1D520}", Cfr: "\u212D", CHcy: "\u0427", chcy: "\u0447", check: "\u2713", checkmark: "\u2713", Chi: "\u03A7", chi: "\u03C7", circ: "\u02C6", circeq: "\u2257", circlearrowleft: "\u21BA", circlearrowright: "\u21BB", circledast: "\u229B", circledcirc: "\u229A", circleddash: "\u229D", CircleDot: "\u2299", circledR: "\xAE", circledS: "\u24C8", CircleMinus: "\u2296", CirclePlus: "\u2295", CircleTimes: "\u2297", cir: "\u25CB", cirE: "\u29C3", cire: "\u2257", cirfnint: "\u2A10", cirmid: "\u2AEF", cirscir: "\u29C2", ClockwiseContourIntegral: "\u2232", CloseCurlyDoubleQuote: "\u201D", CloseCurlyQuote: "\u2019", clubs: "\u2663", clubsuit: "\u2663", colon: ":", Colon: "\u2237", Colone: "\u2A74", colone: "\u2254", coloneq: "\u2254", comma: ",", commat: "@", comp: "\u2201", compfn: "\u2218", complement: "\u2201", complexes: "\u2102", cong: "\u2245", congdot: "\u2A6D", Congruent: "\u2261", conint: "\u222E", Conint: "\u222F", ContourIntegral: "\u222E", copf: "\u{1D554}", Copf: "\u2102", coprod: "\u2210", Coproduct: "\u2210", copy: "\xA9", COPY: "\xA9", copysr: "\u2117", CounterClockwiseContourIntegral: "\u2233", crarr: "\u21B5", cross: "\u2717", Cross: "\u2A2F", Cscr: "\u{1D49E}", cscr: "\u{1D4B8}", csub: "\u2ACF", csube: "\u2AD1", csup: "\u2AD0", csupe: "\u2AD2", ctdot: "\u22EF", cudarrl: "\u2938", cudarrr: "\u2935", cuepr: "\u22DE", cuesc: "\u22DF", cularr: "\u21B6", cularrp: "\u293D", cupbrcap: "\u2A48", cupcap: "\u2A46", CupCap: "\u224D", cup: "\u222A", Cup: "\u22D3", cupcup: "\u2A4A", cupdot: "\u228D", cupor: "\u2A45", cups: "\u222A\uFE00", curarr: "\u21B7", curarrm: "\u293C", curlyeqprec: "\u22DE", curlyeqsucc: "\u22DF", curlyvee: "\u22CE", curlywedge: "\u22CF", curren: "\xA4", curvearrowleft: "\u21B6", curvearrowright: "\u21B7", cuvee: "\u22CE", cuwed: "\u22CF", cwconint: "\u2232", cwint: "\u2231", cylcty: "\u232D", dagger: "\u2020", Dagger: "\u2021", daleth: "\u2138", darr: "\u2193", Darr: "\u21A1", dArr: "\u21D3", dash: "\u2010", Dashv: "\u2AE4", dashv: "\u22A3", dbkarow: "\u290F", dblac: "\u02DD", Dcaron: "\u010E", dcaron: "\u010F", Dcy: "\u0414", dcy: "\u0434", ddagger: "\u2021", ddarr: "\u21CA", DD: "\u2145", dd: "\u2146", DDotrahd: "\u2911", ddotseq: "\u2A77", deg: "\xB0", Del: "\u2207", Delta: "\u0394", delta: "\u03B4", demptyv: "\u29B1", dfisht: "\u297F", Dfr: "\u{1D507}", dfr: "\u{1D521}", dHar: "\u2965", dharl: "\u21C3", dharr: "\u21C2", DiacriticalAcute: "\xB4", DiacriticalDot: "\u02D9", DiacriticalDoubleAcute: "\u02DD", DiacriticalGrave: "`", DiacriticalTilde: "\u02DC", diam: "\u22C4", diamond: "\u22C4", Diamond: "\u22C4", diamondsuit: "\u2666", diams: "\u2666", die: "\xA8", DifferentialD: "\u2146", digamma: "\u03DD", disin: "\u22F2", div: "\xF7", divide: "\xF7", divideontimes: "\u22C7", divonx: "\u22C7", DJcy: "\u0402", djcy: "\u0452", dlcorn: "\u231E", dlcrop: "\u230D", dollar: "$", Dopf: "\u{1D53B}", dopf: "\u{1D555}", Dot: "\xA8", dot: "\u02D9", DotDot: "\u20DC", doteq: "\u2250", doteqdot: "\u2251", DotEqual: "\u2250", dotminus: "\u2238", dotplus: "\u2214", dotsquare: "\u22A1", doublebarwedge: "\u2306", DoubleContourIntegral: "\u222F", DoubleDot: "\xA8", DoubleDownArrow: "\u21D3", DoubleLeftArrow: "\u21D0", DoubleLeftRightArrow: "\u21D4", DoubleLeftTee: "\u2AE4", DoubleLongLeftArrow: "\u27F8", DoubleLongLeftRightArrow: "\u27FA", DoubleLongRightArrow: "\u27F9", DoubleRightArrow: "\u21D2", DoubleRightTee: "\u22A8", DoubleUpArrow: "\u21D1", DoubleUpDownArrow: "\u21D5", DoubleVerticalBar: "\u2225", DownArrowBar: "\u2913", downarrow: "\u2193", DownArrow: "\u2193", Downarrow: "\u21D3", DownArrowUpArrow: "\u21F5", DownBreve: "\u0311", downdownarrows: "\u21CA", downharpoonleft: "\u21C3", downharpoonright: "\u21C2", DownLeftRightVector: "\u2950", DownLeftTeeVector: "\u295E", DownLeftVectorBar: "\u2956", DownLeftVector: "\u21BD", DownRightTeeVector: "\u295F", DownRightVectorBar: "\u2957", DownRightVector: "\u21C1", DownTeeArrow: "\u21A7", DownTee: "\u22A4", drbkarow: "\u2910", drcorn: "\u231F", drcrop: "\u230C", Dscr: "\u{1D49F}", dscr: "\u{1D4B9}", DScy: "\u0405", dscy: "\u0455", dsol: "\u29F6", Dstrok: "\u0110", dstrok: "\u0111", dtdot: "\u22F1", dtri: "\u25BF", dtrif: "\u25BE", duarr: "\u21F5", duhar: "\u296F", dwangle: "\u29A6", DZcy: "\u040F", dzcy: "\u045F", dzigrarr: "\u27FF", Eacute: "\xC9", eacute: "\xE9", easter: "\u2A6E", Ecaron: "\u011A", ecaron: "\u011B", Ecirc: "\xCA", ecirc: "\xEA", ecir: "\u2256", ecolon: "\u2255", Ecy: "\u042D", ecy: "\u044D", eDDot: "\u2A77", Edot: "\u0116", edot: "\u0117", eDot: "\u2251", ee: "\u2147", efDot: "\u2252", Efr: "\u{1D508}", efr: "\u{1D522}", eg: "\u2A9A", Egrave: "\xC8", egrave: "\xE8", egs: "\u2A96", egsdot: "\u2A98", el: "\u2A99", Element: "\u2208", elinters: "\u23E7", ell: "\u2113", els: "\u2A95", elsdot: "\u2A97", Emacr: "\u0112", emacr: "\u0113", empty: "\u2205", emptyset: "\u2205", EmptySmallSquare: "\u25FB", emptyv: "\u2205", EmptyVerySmallSquare: "\u25AB", emsp13: "\u2004", emsp14: "\u2005", emsp: "\u2003", ENG: "\u014A", eng: "\u014B", ensp: "\u2002", Eogon: "\u0118", eogon: "\u0119", Eopf: "\u{1D53C}", eopf: "\u{1D556}", epar: "\u22D5", eparsl: "\u29E3", eplus: "\u2A71", epsi: "\u03B5", Epsilon: "\u0395", epsilon: "\u03B5", epsiv: "\u03F5", eqcirc: "\u2256", eqcolon: "\u2255", eqsim: "\u2242", eqslantgtr: "\u2A96", eqslantless: "\u2A95", Equal: "\u2A75", equals: "=", EqualTilde: "\u2242", equest: "\u225F", Equilibrium: "\u21CC", equiv: "\u2261", equivDD: "\u2A78", eqvparsl: "\u29E5", erarr: "\u2971", erDot: "\u2253", escr: "\u212F", Escr: "\u2130", esdot: "\u2250", Esim: "\u2A73", esim: "\u2242", Eta: "\u0397", eta: "\u03B7", ETH: "\xD0", eth: "\xF0", Euml: "\xCB", euml: "\xEB", euro: "\u20AC", excl: "!", exist: "\u2203", Exists: "\u2203", expectation: "\u2130", exponentiale: "\u2147", ExponentialE: "\u2147", fallingdotseq: "\u2252", Fcy: "\u0424", fcy: "\u0444", female: "\u2640", ffilig: "\uFB03", fflig: "\uFB00", ffllig: "\uFB04", Ffr: "\u{1D509}", ffr: "\u{1D523}", filig: "\uFB01", FilledSmallSquare: "\u25FC", FilledVerySmallSquare: "\u25AA", fjlig: "fj", flat: "\u266D", fllig: "\uFB02", fltns: "\u25B1", fnof: "\u0192", Fopf: "\u{1D53D}", fopf: "\u{1D557}", forall: "\u2200", ForAll: "\u2200", fork: "\u22D4", forkv: "\u2AD9", Fouriertrf: "\u2131", fpartint: "\u2A0D", frac12: "\xBD", frac13: "\u2153", frac14: "\xBC", frac15: "\u2155", frac16: "\u2159", frac18: "\u215B", frac23: "\u2154", frac25: "\u2156", frac34: "\xBE", frac35: "\u2157", frac38: "\u215C", frac45: "\u2158", frac56: "\u215A", frac58: "\u215D", frac78: "\u215E", frasl: "\u2044", frown: "\u2322", fscr: "\u{1D4BB}", Fscr: "\u2131", gacute: "\u01F5", Gamma: "\u0393", gamma: "\u03B3", Gammad: "\u03DC", gammad: "\u03DD", gap: "\u2A86", Gbreve: "\u011E", gbreve: "\u011F", Gcedil: "\u0122", Gcirc: "\u011C", gcirc: "\u011D", Gcy: "\u0413", gcy: "\u0433", Gdot: "\u0120", gdot: "\u0121", ge: "\u2265", gE: "\u2267", gEl: "\u2A8C", gel: "\u22DB", geq: "\u2265", geqq: "\u2267", geqslant: "\u2A7E", gescc: "\u2AA9", ges: "\u2A7E", gesdot: "\u2A80", gesdoto: "\u2A82", gesdotol: "\u2A84", gesl: "\u22DB\uFE00", gesles: "\u2A94", Gfr: "\u{1D50A}", gfr: "\u{1D524}", gg: "\u226B", Gg: "\u22D9", ggg: "\u22D9", gimel: "\u2137", GJcy: "\u0403", gjcy: "\u0453", gla: "\u2AA5", gl: "\u2277", glE: "\u2A92", glj: "\u2AA4", gnap: "\u2A8A", gnapprox: "\u2A8A", gne: "\u2A88", gnE: "\u2269", gneq: "\u2A88", gneqq: "\u2269", gnsim: "\u22E7", Gopf: "\u{1D53E}", gopf: "\u{1D558}", grave: "`", GreaterEqual: "\u2265", GreaterEqualLess: "\u22DB", GreaterFullEqual: "\u2267", GreaterGreater: "\u2AA2", GreaterLess: "\u2277", GreaterSlantEqual: "\u2A7E", GreaterTilde: "\u2273", Gscr: "\u{1D4A2}", gscr: "\u210A", gsim: "\u2273", gsime: "\u2A8E", gsiml: "\u2A90", gtcc: "\u2AA7", gtcir: "\u2A7A", gt: ">", GT: ">", Gt: "\u226B", gtdot: "\u22D7", gtlPar: "\u2995", gtquest: "\u2A7C", gtrapprox: "\u2A86", gtrarr: "\u2978", gtrdot: "\u22D7", gtreqless: "\u22DB", gtreqqless: "\u2A8C", gtrless: "\u2277", gtrsim: "\u2273", gvertneqq: "\u2269\uFE00", gvnE: "\u2269\uFE00", Hacek: "\u02C7", hairsp: "\u200A", half: "\xBD", hamilt: "\u210B", HARDcy: "\u042A", hardcy: "\u044A", harrcir: "\u2948", harr: "\u2194", hArr: "\u21D4", harrw: "\u21AD", Hat: "^", hbar: "\u210F", Hcirc: "\u0124", hcirc: "\u0125", hearts: "\u2665", heartsuit: "\u2665", hellip: "\u2026", hercon: "\u22B9", hfr: "\u{1D525}", Hfr: "\u210C", HilbertSpace: "\u210B", hksearow: "\u2925", hkswarow: "\u2926", hoarr: "\u21FF", homtht: "\u223B", hookleftarrow: "\u21A9", hookrightarrow: "\u21AA", hopf: "\u{1D559}", Hopf: "\u210D", horbar: "\u2015", HorizontalLine: "\u2500", hscr: "\u{1D4BD}", Hscr: "\u210B", hslash: "\u210F", Hstrok: "\u0126", hstrok: "\u0127", HumpDownHump: "\u224E", HumpEqual: "\u224F", hybull: "\u2043", hyphen: "\u2010", Iacute: "\xCD", iacute: "\xED", ic: "\u2063", Icirc: "\xCE", icirc: "\xEE", Icy: "\u0418", icy: "\u0438", Idot: "\u0130", IEcy: "\u0415", iecy: "\u0435", iexcl: "\xA1", iff: "\u21D4", ifr: "\u{1D526}", Ifr: "\u2111", Igrave: "\xCC", igrave: "\xEC", ii: "\u2148", iiiint: "\u2A0C", iiint: "\u222D", iinfin: "\u29DC", iiota: "\u2129", IJlig: "\u0132", ijlig: "\u0133", Imacr: "\u012A", imacr: "\u012B", image: "\u2111", ImaginaryI: "\u2148", imagline: "\u2110", imagpart: "\u2111", imath: "\u0131", Im: "\u2111", imof: "\u22B7", imped: "\u01B5", Implies: "\u21D2", incare: "\u2105", in: "\u2208", infin: "\u221E", infintie: "\u29DD", inodot: "\u0131", intcal: "\u22BA", int: "\u222B", Int: "\u222C", integers: "\u2124", Integral: "\u222B", intercal: "\u22BA", Intersection: "\u22C2", intlarhk: "\u2A17", intprod: "\u2A3C", InvisibleComma: "\u2063", InvisibleTimes: "\u2062", IOcy: "\u0401", iocy: "\u0451", Iogon: "\u012E", iogon: "\u012F", Iopf: "\u{1D540}", iopf: "\u{1D55A}", Iota: "\u0399", iota: "\u03B9", iprod: "\u2A3C", iquest: "\xBF", iscr: "\u{1D4BE}", Iscr: "\u2110", isin: "\u2208", isindot: "\u22F5", isinE: "\u22F9", isins: "\u22F4", isinsv: "\u22F3", isinv: "\u2208", it: "\u2062", Itilde: "\u0128", itilde: "\u0129", Iukcy: "\u0406", iukcy: "\u0456", Iuml: "\xCF", iuml: "\xEF", Jcirc: "\u0134", jcirc: "\u0135", Jcy: "\u0419", jcy: "\u0439", Jfr: "\u{1D50D}", jfr: "\u{1D527}", jmath: "\u0237", Jopf: "\u{1D541}", jopf: "\u{1D55B}", Jscr: "\u{1D4A5}", jscr: "\u{1D4BF}", Jsercy: "\u0408", jsercy: "\u0458", Jukcy: "\u0404", jukcy: "\u0454", Kappa: "\u039A", kappa: "\u03BA", kappav: "\u03F0", Kcedil: "\u0136", kcedil: "\u0137", Kcy: "\u041A", kcy: "\u043A", Kfr: "\u{1D50E}", kfr: "\u{1D528}", kgreen: "\u0138", KHcy: "\u0425", khcy: "\u0445", KJcy: "\u040C", kjcy: "\u045C", Kopf: "\u{1D542}", kopf: "\u{1D55C}", Kscr: "\u{1D4A6}", kscr: "\u{1D4C0}", lAarr: "\u21DA", Lacute: "\u0139", lacute: "\u013A", laemptyv: "\u29B4", lagran: "\u2112", Lambda: "\u039B", lambda: "\u03BB", lang: "\u27E8", Lang: "\u27EA", langd: "\u2991", langle: "\u27E8", lap: "\u2A85", Laplacetrf: "\u2112", laquo: "\xAB", larrb: "\u21E4", larrbfs: "\u291F", larr: "\u2190", Larr: "\u219E", lArr: "\u21D0", larrfs: "\u291D", larrhk: "\u21A9", larrlp: "\u21AB", larrpl: "\u2939", larrsim: "\u2973", larrtl: "\u21A2", latail: "\u2919", lAtail: "\u291B", lat: "\u2AAB", late: "\u2AAD", lates: "\u2AAD\uFE00", lbarr: "\u290C", lBarr: "\u290E", lbbrk: "\u2772", lbrace: "{", lbrack: "[", lbrke: "\u298B", lbrksld: "\u298F", lbrkslu: "\u298D", Lcaron: "\u013D", lcaron: "\u013E", Lcedil: "\u013B", lcedil: "\u013C", lceil: "\u2308", lcub: "{", Lcy: "\u041B", lcy: "\u043B", ldca: "\u2936", ldquo: "\u201C", ldquor: "\u201E", ldrdhar: "\u2967", ldrushar: "\u294B", ldsh: "\u21B2", le: "\u2264", lE: "\u2266", LeftAngleBracket: "\u27E8", LeftArrowBar: "\u21E4", leftarrow: "\u2190", LeftArrow: "\u2190", Leftarrow: "\u21D0", LeftArrowRightArrow: "\u21C6", leftarrowtail: "\u21A2", LeftCeiling: "\u2308", LeftDoubleBracket: "\u27E6", LeftDownTeeVector: "\u2961", LeftDownVectorBar: "\u2959", LeftDownVector: "\u21C3", LeftFloor: "\u230A", leftharpoondown: "\u21BD", leftharpoonup: "\u21BC", leftleftarrows: "\u21C7", leftrightarrow: "\u2194", LeftRightArrow: "\u2194", Leftrightarrow: "\u21D4", leftrightarrows: "\u21C6", leftrightharpoons: "\u21CB", leftrightsquigarrow: "\u21AD", LeftRightVector: "\u294E", LeftTeeArrow: "\u21A4", LeftTee: "\u22A3", LeftTeeVector: "\u295A", leftthreetimes: "\u22CB", LeftTriangleBar: "\u29CF", LeftTriangle: "\u22B2", LeftTriangleEqual: "\u22B4", LeftUpDownVector: "\u2951", LeftUpTeeVector: "\u2960", LeftUpVectorBar: "\u2958", LeftUpVector: "\u21BF", LeftVectorBar: "\u2952", LeftVector: "\u21BC", lEg: "\u2A8B", leg: "\u22DA", leq: "\u2264", leqq: "\u2266", leqslant: "\u2A7D", lescc: "\u2AA8", les: "\u2A7D", lesdot: "\u2A7F", lesdoto: "\u2A81", lesdotor: "\u2A83", lesg: "\u22DA\uFE00", lesges: "\u2A93", lessapprox: "\u2A85", lessdot: "\u22D6", lesseqgtr: "\u22DA", lesseqqgtr: "\u2A8B", LessEqualGreater: "\u22DA", LessFullEqual: "\u2266", LessGreater: "\u2276", lessgtr: "\u2276", LessLess: "\u2AA1", lesssim: "\u2272", LessSlantEqual: "\u2A7D", LessTilde: "\u2272", lfisht: "\u297C", lfloor: "\u230A", Lfr: "\u{1D50F}", lfr: "\u{1D529}", lg: "\u2276", lgE: "\u2A91", lHar: "\u2962", lhard: "\u21BD", lharu: "\u21BC", lharul: "\u296A", lhblk: "\u2584", LJcy: "\u0409", ljcy: "\u0459", llarr: "\u21C7", ll: "\u226A", Ll: "\u22D8", llcorner: "\u231E", Lleftarrow: "\u21DA", llhard: "\u296B", lltri: "\u25FA", Lmidot: "\u013F", lmidot: "\u0140", lmoustache: "\u23B0", lmoust: "\u23B0", lnap: "\u2A89", lnapprox: "\u2A89", lne: "\u2A87", lnE: "\u2268", lneq: "\u2A87", lneqq: "\u2268", lnsim: "\u22E6", loang: "\u27EC", loarr: "\u21FD", lobrk: "\u27E6", longleftarrow: "\u27F5", LongLeftArrow: "\u27F5", Longleftarrow: "\u27F8", longleftrightarrow: "\u27F7", LongLeftRightArrow: "\u27F7", Longleftrightarrow: "\u27FA", longmapsto: "\u27FC", longrightarrow: "\u27F6", LongRightArrow: "\u27F6", Longrightarrow: "\u27F9", looparrowleft: "\u21AB", looparrowright: "\u21AC", lopar: "\u2985", Lopf: "\u{1D543}", lopf: "\u{1D55D}", loplus: "\u2A2D", lotimes: "\u2A34", lowast: "\u2217", lowbar: "_", LowerLeftArrow: "\u2199", LowerRightArrow: "\u2198", loz: "\u25CA", lozenge: "\u25CA", lozf: "\u29EB", lpar: "(", lparlt: "\u2993", lrarr: "\u21C6", lrcorner: "\u231F", lrhar: "\u21CB", lrhard: "\u296D", lrm: "\u200E", lrtri: "\u22BF", lsaquo: "\u2039", lscr: "\u{1D4C1}", Lscr: "\u2112", lsh: "\u21B0", Lsh: "\u21B0", lsim: "\u2272", lsime: "\u2A8D", lsimg: "\u2A8F", lsqb: "[", lsquo: "\u2018", lsquor: "\u201A", Lstrok: "\u0141", lstrok: "\u0142", ltcc: "\u2AA6", ltcir: "\u2A79", lt: "<", LT: "<", Lt: "\u226A", ltdot: "\u22D6", lthree: "\u22CB", ltimes: "\u22C9", ltlarr: "\u2976", ltquest: "\u2A7B", ltri: "\u25C3", ltrie: "\u22B4", ltrif: "\u25C2", ltrPar: "\u2996", lurdshar: "\u294A", luruhar: "\u2966", lvertneqq: "\u2268\uFE00", lvnE: "\u2268\uFE00", macr: "\xAF", male: "\u2642", malt: "\u2720", maltese: "\u2720", Map: "\u2905", map: "\u21A6", mapsto: "\u21A6", mapstodown: "\u21A7", mapstoleft: "\u21A4", mapstoup: "\u21A5", marker: "\u25AE", mcomma: "\u2A29", Mcy: "\u041C", mcy: "\u043C", mdash: "\u2014", mDDot: "\u223A", measuredangle: "\u2221", MediumSpace: "\u205F", Mellintrf: "\u2133", Mfr: "\u{1D510}", mfr: "\u{1D52A}", mho: "\u2127", micro: "\xB5", midast: "*", midcir: "\u2AF0", mid: "\u2223", middot: "\xB7", minusb: "\u229F", minus: "\u2212", minusd: "\u2238", minusdu: "\u2A2A", MinusPlus: "\u2213", mlcp: "\u2ADB", mldr: "\u2026", mnplus: "\u2213", models: "\u22A7", Mopf: "\u{1D544}", mopf: "\u{1D55E}", mp: "\u2213", mscr: "\u{1D4C2}", Mscr: "\u2133", mstpos: "\u223E", Mu: "\u039C", mu: "\u03BC", multimap: "\u22B8", mumap: "\u22B8", nabla: "\u2207", Nacute: "\u0143", nacute: "\u0144", nang: "\u2220\u20D2", nap: "\u2249", napE: "\u2A70\u0338", napid: "\u224B\u0338", napos: "\u0149", napprox: "\u2249", natural: "\u266E", naturals: "\u2115", natur: "\u266E", nbsp: "\xA0", nbump: "\u224E\u0338", nbumpe: "\u224F\u0338", ncap: "\u2A43", Ncaron: "\u0147", ncaron: "\u0148", Ncedil: "\u0145", ncedil: "\u0146", ncong: "\u2247", ncongdot: "\u2A6D\u0338", ncup: "\u2A42", Ncy: "\u041D", ncy: "\u043D", ndash: "\u2013", nearhk: "\u2924", nearr: "\u2197", neArr: "\u21D7", nearrow: "\u2197", ne: "\u2260", nedot: "\u2250\u0338", NegativeMediumSpace: "\u200B", NegativeThickSpace: "\u200B", NegativeThinSpace: "\u200B", NegativeVeryThinSpace: "\u200B", nequiv: "\u2262", nesear: "\u2928", nesim: "\u2242\u0338", NestedGreaterGreater: "\u226B", NestedLessLess: "\u226A", NewLine: "\n", nexist: "\u2204", nexists: "\u2204", Nfr: "\u{1D511}", nfr: "\u{1D52B}", ngE: "\u2267\u0338", nge: "\u2271", ngeq: "\u2271", ngeqq: "\u2267\u0338", ngeqslant: "\u2A7E\u0338", nges: "\u2A7E\u0338", nGg: "\u22D9\u0338", ngsim: "\u2275", nGt: "\u226B\u20D2", ngt: "\u226F", ngtr: "\u226F", nGtv: "\u226B\u0338", nharr: "\u21AE", nhArr: "\u21CE", nhpar: "\u2AF2", ni: "\u220B", nis: "\u22FC", nisd: "\u22FA", niv: "\u220B", NJcy: "\u040A", njcy: "\u045A", nlarr: "\u219A", nlArr: "\u21CD", nldr: "\u2025", nlE: "\u2266\u0338", nle: "\u2270", nleftarrow: "\u219A", nLeftarrow: "\u21CD", nleftrightarrow: "\u21AE", nLeftrightarrow: "\u21CE", nleq: "\u2270", nleqq: "\u2266\u0338", nleqslant: "\u2A7D\u0338", nles: "\u2A7D\u0338", nless: "\u226E", nLl: "\u22D8\u0338", nlsim: "\u2274", nLt: "\u226A\u20D2", nlt: "\u226E", nltri: "\u22EA", nltrie: "\u22EC", nLtv: "\u226A\u0338", nmid: "\u2224", NoBreak: "\u2060", NonBreakingSpace: "\xA0", nopf: "\u{1D55F}", Nopf: "\u2115", Not: "\u2AEC", not: "\xAC", NotCongruent: "\u2262", NotCupCap: "\u226D", NotDoubleVerticalBar: "\u2226", NotElement: "\u2209", NotEqual: "\u2260", NotEqualTilde: "\u2242\u0338", NotExists: "\u2204", NotGreater: "\u226F", NotGreaterEqual: "\u2271", NotGreaterFullEqual: "\u2267\u0338", NotGreaterGreater: "\u226B\u0338", NotGreaterLess: "\u2279", NotGreaterSlantEqual: "\u2A7E\u0338", NotGreaterTilde: "\u2275", NotHumpDownHump: "\u224E\u0338", NotHumpEqual: "\u224F\u0338", notin: "\u2209", notindot: "\u22F5\u0338", notinE: "\u22F9\u0338", notinva: "\u2209", notinvb: "\u22F7", notinvc: "\u22F6", NotLeftTriangleBar: "\u29CF\u0338", NotLeftTriangle: "\u22EA", NotLeftTriangleEqual: "\u22EC", NotLess: "\u226E", NotLessEqual: "\u2270", NotLessGreater: "\u2278", NotLessLess: "\u226A\u0338", NotLessSlantEqual: "\u2A7D\u0338", NotLessTilde: "\u2274", NotNestedGreaterGreater: "\u2AA2\u0338", NotNestedLessLess: "\u2AA1\u0338", notni: "\u220C", notniva: "\u220C", notnivb: "\u22FE", notnivc: "\u22FD", NotPrecedes: "\u2280", NotPrecedesEqual: "\u2AAF\u0338", NotPrecedesSlantEqual: "\u22E0", NotReverseElement: "\u220C", NotRightTriangleBar: "\u29D0\u0338", NotRightTriangle: "\u22EB", NotRightTriangleEqual: "\u22ED", NotSquareSubset: "\u228F\u0338", NotSquareSubsetEqual: "\u22E2", NotSquareSuperset: "\u2290\u0338", NotSquareSupersetEqual: "\u22E3", NotSubset: "\u2282\u20D2", NotSubsetEqual: "\u2288", NotSucceeds: "\u2281", NotSucceedsEqual: "\u2AB0\u0338", NotSucceedsSlantEqual: "\u22E1", NotSucceedsTilde: "\u227F\u0338", NotSuperset: "\u2283\u20D2", NotSupersetEqual: "\u2289", NotTilde: "\u2241", NotTildeEqual: "\u2244", NotTildeFullEqual: "\u2247", NotTildeTilde: "\u2249", NotVerticalBar: "\u2224", nparallel: "\u2226", npar: "\u2226", nparsl: "\u2AFD\u20E5", npart: "\u2202\u0338", npolint: "\u2A14", npr: "\u2280", nprcue: "\u22E0", nprec: "\u2280", npreceq: "\u2AAF\u0338", npre: "\u2AAF\u0338", nrarrc: "\u2933\u0338", nrarr: "\u219B", nrArr: "\u21CF", nrarrw: "\u219D\u0338", nrightarrow: "\u219B", nRightarrow: "\u21CF", nrtri: "\u22EB", nrtrie: "\u22ED", nsc: "\u2281", nsccue: "\u22E1", nsce: "\u2AB0\u0338", Nscr: "\u{1D4A9}", nscr: "\u{1D4C3}", nshortmid: "\u2224", nshortparallel: "\u2226", nsim: "\u2241", nsime: "\u2244", nsimeq: "\u2244", nsmid: "\u2224", nspar: "\u2226", nsqsube: "\u22E2", nsqsupe: "\u22E3", nsub: "\u2284", nsubE: "\u2AC5\u0338", nsube: "\u2288", nsubset: "\u2282\u20D2", nsubseteq: "\u2288", nsubseteqq: "\u2AC5\u0338", nsucc: "\u2281", nsucceq: "\u2AB0\u0338", nsup: "\u2285", nsupE: "\u2AC6\u0338", nsupe: "\u2289", nsupset: "\u2283\u20D2", nsupseteq: "\u2289", nsupseteqq: "\u2AC6\u0338", ntgl: "\u2279", Ntilde: "\xD1", ntilde: "\xF1", ntlg: "\u2278", ntriangleleft: "\u22EA", ntrianglelefteq: "\u22EC", ntriangleright: "\u22EB", ntrianglerighteq: "\u22ED", Nu: "\u039D", nu: "\u03BD", num: "#", numero: "\u2116", numsp: "\u2007", nvap: "\u224D\u20D2", nvdash: "\u22AC", nvDash: "\u22AD", nVdash: "\u22AE", nVDash: "\u22AF", nvge: "\u2265\u20D2", nvgt: ">\u20D2", nvHarr: "\u2904", nvinfin: "\u29DE", nvlArr: "\u2902", nvle: "\u2264\u20D2", nvlt: "<\u20D2", nvltrie: "\u22B4\u20D2", nvrArr: "\u2903", nvrtrie: "\u22B5\u20D2", nvsim: "\u223C\u20D2", nwarhk: "\u2923", nwarr: "\u2196", nwArr: "\u21D6", nwarrow: "\u2196", nwnear: "\u2927", Oacute: "\xD3", oacute: "\xF3", oast: "\u229B", Ocirc: "\xD4", ocirc: "\xF4", ocir: "\u229A", Ocy: "\u041E", ocy: "\u043E", odash: "\u229D", Odblac: "\u0150", odblac: "\u0151", odiv: "\u2A38", odot: "\u2299", odsold: "\u29BC", OElig: "\u0152", oelig: "\u0153", ofcir: "\u29BF", Ofr: "\u{1D512}", ofr: "\u{1D52C}", ogon: "\u02DB", Ograve: "\xD2", ograve: "\xF2", ogt: "\u29C1", ohbar: "\u29B5", ohm: "\u03A9", oint: "\u222E", olarr: "\u21BA", olcir: "\u29BE", olcross: "\u29BB", oline: "\u203E", olt: "\u29C0", Omacr: "\u014C", omacr: "\u014D", Omega: "\u03A9", omega: "\u03C9", Omicron: "\u039F", omicron: "\u03BF", omid: "\u29B6", ominus: "\u2296", Oopf: "\u{1D546}", oopf: "\u{1D560}", opar: "\u29B7", OpenCurlyDoubleQuote: "\u201C", OpenCurlyQuote: "\u2018", operp: "\u29B9", oplus: "\u2295", orarr: "\u21BB", Or: "\u2A54", or: "\u2228", ord: "\u2A5D", order: "\u2134", orderof: "\u2134", ordf: "\xAA", ordm: "\xBA", origof: "\u22B6", oror: "\u2A56", orslope: "\u2A57", orv: "\u2A5B", oS: "\u24C8", Oscr: "\u{1D4AA}", oscr: "\u2134", Oslash: "\xD8", oslash: "\xF8", osol: "\u2298", Otilde: "\xD5", otilde: "\xF5", otimesas: "\u2A36", Otimes: "\u2A37", otimes: "\u2297", Ouml: "\xD6", ouml: "\xF6", ovbar: "\u233D", OverBar: "\u203E", OverBrace: "\u23DE", OverBracket: "\u23B4", OverParenthesis: "\u23DC", para: "\xB6", parallel: "\u2225", par: "\u2225", parsim: "\u2AF3", parsl: "\u2AFD", part: "\u2202", PartialD: "\u2202", Pcy: "\u041F", pcy: "\u043F", percnt: "%", period: ".", permil: "\u2030", perp: "\u22A5", pertenk: "\u2031", Pfr: "\u{1D513}", pfr: "\u{1D52D}", Phi: "\u03A6", phi: "\u03C6", phiv: "\u03D5", phmmat: "\u2133", phone: "\u260E", Pi: "\u03A0", pi: "\u03C0", pitchfork: "\u22D4", piv: "\u03D6", planck: "\u210F", planckh: "\u210E", plankv: "\u210F", plusacir: "\u2A23", plusb: "\u229E", pluscir: "\u2A22", plus: "+", plusdo: "\u2214", plusdu: "\u2A25", pluse: "\u2A72", PlusMinus: "\xB1", plusmn: "\xB1", plussim: "\u2A26", plustwo: "\u2A27", pm: "\xB1", Poincareplane: "\u210C", pointint: "\u2A15", popf: "\u{1D561}", Popf: "\u2119", pound: "\xA3", prap: "\u2AB7", Pr: "\u2ABB", pr: "\u227A", prcue: "\u227C", precapprox: "\u2AB7", prec: "\u227A", preccurlyeq: "\u227C", Precedes: "\u227A", PrecedesEqual: "\u2AAF", PrecedesSlantEqual: "\u227C", PrecedesTilde: "\u227E", preceq: "\u2AAF", precnapprox: "\u2AB9", precneqq: "\u2AB5", precnsim: "\u22E8", pre: "\u2AAF", prE: "\u2AB3", precsim: "\u227E", prime: "\u2032", Prime: "\u2033", primes: "\u2119", prnap: "\u2AB9", prnE: "\u2AB5", prnsim: "\u22E8", prod: "\u220F", Product: "\u220F", profalar: "\u232E", profline: "\u2312", profsurf: "\u2313", prop: "\u221D", Proportional: "\u221D", Proportion: "\u2237", propto: "\u221D", prsim: "\u227E", prurel: "\u22B0", Pscr: "\u{1D4AB}", pscr: "\u{1D4C5}", Psi: "\u03A8", psi: "\u03C8", puncsp: "\u2008", Qfr: "\u{1D514}", qfr: "\u{1D52E}", qint: "\u2A0C", qopf: "\u{1D562}", Qopf: "\u211A", qprime: "\u2057", Qscr: "\u{1D4AC}", qscr: "\u{1D4C6}", quaternions: "\u210D", quatint: "\u2A16", quest: "?", questeq: "\u225F", quot: '"', QUOT: '"', rAarr: "\u21DB", race: "\u223D\u0331", Racute: "\u0154", racute: "\u0155", radic: "\u221A", raemptyv: "\u29B3", rang: "\u27E9", Rang: "\u27EB", rangd: "\u2992", range: "\u29A5", rangle: "\u27E9", raquo: "\xBB", rarrap: "\u2975", rarrb: "\u21E5", rarrbfs: "\u2920", rarrc: "\u2933", rarr: "\u2192", Rarr: "\u21A0", rArr: "\u21D2", rarrfs: "\u291E", rarrhk: "\u21AA", rarrlp: "\u21AC", rarrpl: "\u2945", rarrsim: "\u2974", Rarrtl: "\u2916", rarrtl: "\u21A3", rarrw: "\u219D", ratail: "\u291A", rAtail: "\u291C", ratio: "\u2236", rationals: "\u211A", rbarr: "\u290D", rBarr: "\u290F", RBarr: "\u2910", rbbrk: "\u2773", rbrace: "}", rbrack: "]", rbrke: "\u298C", rbrksld: "\u298E", rbrkslu: "\u2990", Rcaron: "\u0158", rcaron: "\u0159", Rcedil: "\u0156", rcedil: "\u0157", rceil: "\u2309", rcub: "}", Rcy: "\u0420", rcy: "\u0440", rdca: "\u2937", rdldhar: "\u2969", rdquo: "\u201D", rdquor: "\u201D", rdsh: "\u21B3", real: "\u211C", realine: "\u211B", realpart: "\u211C", reals: "\u211D", Re: "\u211C", rect: "\u25AD", reg: "\xAE", REG: "\xAE", ReverseElement: "\u220B", ReverseEquilibrium: "\u21CB", ReverseUpEquilibrium: "\u296F", rfisht: "\u297D", rfloor: "\u230B", rfr: "\u{1D52F}", Rfr: "\u211C", rHar: "\u2964", rhard: "\u21C1", rharu: "\u21C0", rharul: "\u296C", Rho: "\u03A1", rho: "\u03C1", rhov: "\u03F1", RightAngleBracket: "\u27E9", RightArrowBar: "\u21E5", rightarrow: "\u2192", RightArrow: "\u2192", Rightarrow: "\u21D2", RightArrowLeftArrow: "\u21C4", rightarrowtail: "\u21A3", RightCeiling: "\u2309", RightDoubleBracket: "\u27E7", RightDownTeeVector: "\u295D", RightDownVectorBar: "\u2955", RightDownVector: "\u21C2", RightFloor: "\u230B", rightharpoondown: "\u21C1", rightharpoonup: "\u21C0", rightleftarrows: "\u21C4", rightleftharpoons: "\u21CC", rightrightarrows: "\u21C9", rightsquigarrow: "\u219D", RightTeeArrow: "\u21A6", RightTee: "\u22A2", RightTeeVector: "\u295B", rightthreetimes: "\u22CC", RightTriangleBar: "\u29D0", RightTriangle: "\u22B3", RightTriangleEqual: "\u22B5", RightUpDownVector: "\u294F", RightUpTeeVector: "\u295C", RightUpVectorBar: "\u2954", RightUpVector: "\u21BE", RightVectorBar: "\u2953", RightVector: "\u21C0", ring: "\u02DA", risingdotseq: "\u2253", rlarr: "\u21C4", rlhar: "\u21CC", rlm: "\u200F", rmoustache: "\u23B1", rmoust: "\u23B1", rnmid: "\u2AEE", roang: "\u27ED", roarr: "\u21FE", robrk: "\u27E7", ropar: "\u2986", ropf: "\u{1D563}", Ropf: "\u211D", roplus: "\u2A2E", rotimes: "\u2A35", RoundImplies: "\u2970", rpar: ")", rpargt: "\u2994", rppolint: "\u2A12", rrarr: "\u21C9", Rrightarrow: "\u21DB", rsaquo: "\u203A", rscr: "\u{1D4C7}", Rscr: "\u211B", rsh: "\u21B1", Rsh: "\u21B1", rsqb: "]", rsquo: "\u2019", rsquor: "\u2019", rthree: "\u22CC", rtimes: "\u22CA", rtri: "\u25B9", rtrie: "\u22B5", rtrif: "\u25B8", rtriltri: "\u29CE", RuleDelayed: "\u29F4", ruluhar: "\u2968", rx: "\u211E", Sacute: "\u015A", sacute: "\u015B", sbquo: "\u201A", scap: "\u2AB8", Scaron: "\u0160", scaron: "\u0161", Sc: "\u2ABC", sc: "\u227B", sccue: "\u227D", sce: "\u2AB0", scE: "\u2AB4", Scedil: "\u015E", scedil: "\u015F", Scirc: "\u015C", scirc: "\u015D", scnap: "\u2ABA", scnE: "\u2AB6", scnsim: "\u22E9", scpolint: "\u2A13", scsim: "\u227F", Scy: "\u0421", scy: "\u0441", sdotb: "\u22A1", sdot: "\u22C5", sdote: "\u2A66", searhk: "\u2925", searr: "\u2198", seArr: "\u21D8", searrow: "\u2198", sect: "\xA7", semi: ";", seswar: "\u2929", setminus: "\u2216", setmn: "\u2216", sext: "\u2736", Sfr: "\u{1D516}", sfr: "\u{1D530}", sfrown: "\u2322", sharp: "\u266F", SHCHcy: "\u0429", shchcy: "\u0449", SHcy: "\u0428", shcy: "\u0448", ShortDownArrow: "\u2193", ShortLeftArrow: "\u2190", shortmid: "\u2223", shortparallel: "\u2225", ShortRightArrow: "\u2192", ShortUpArrow: "\u2191", shy: "\xAD", Sigma: "\u03A3", sigma: "\u03C3", sigmaf: "\u03C2", sigmav: "\u03C2", sim: "\u223C", simdot: "\u2A6A", sime: "\u2243", simeq: "\u2243", simg: "\u2A9E", simgE: "\u2AA0", siml: "\u2A9D", simlE: "\u2A9F", simne: "\u2246", simplus: "\u2A24", simrarr: "\u2972", slarr: "\u2190", SmallCircle: "\u2218", smallsetminus: "\u2216", smashp: "\u2A33", smeparsl: "\u29E4", smid: "\u2223", smile: "\u2323", smt: "\u2AAA", smte: "\u2AAC", smtes: "\u2AAC\uFE00", SOFTcy: "\u042C", softcy: "\u044C", solbar: "\u233F", solb: "\u29C4", sol: "/", Sopf: "\u{1D54A}", sopf: "\u{1D564}", spades: "\u2660", spadesuit: "\u2660", spar: "\u2225", sqcap: "\u2293", sqcaps: "\u2293\uFE00", sqcup: "\u2294", sqcups: "\u2294\uFE00", Sqrt: "\u221A", sqsub: "\u228F", sqsube: "\u2291", sqsubset: "\u228F", sqsubseteq: "\u2291", sqsup: "\u2290", sqsupe: "\u2292", sqsupset: "\u2290", sqsupseteq: "\u2292", square: "\u25A1", Square: "\u25A1", SquareIntersection: "\u2293", SquareSubset: "\u228F", SquareSubsetEqual: "\u2291", SquareSuperset: "\u2290", SquareSupersetEqual: "\u2292", SquareUnion: "\u2294", squarf: "\u25AA", squ: "\u25A1", squf: "\u25AA", srarr: "\u2192", Sscr: "\u{1D4AE}", sscr: "\u{1D4C8}", ssetmn: "\u2216", ssmile: "\u2323", sstarf: "\u22C6", Star: "\u22C6", star: "\u2606", starf: "\u2605", straightepsilon: "\u03F5", straightphi: "\u03D5", strns: "\xAF", sub: "\u2282", Sub: "\u22D0", subdot: "\u2ABD", subE: "\u2AC5", sube: "\u2286", subedot: "\u2AC3", submult: "\u2AC1", subnE: "\u2ACB", subne: "\u228A", subplus: "\u2ABF", subrarr: "\u2979", subset: "\u2282", Subset: "\u22D0", subseteq: "\u2286", subseteqq: "\u2AC5", SubsetEqual: "\u2286", subsetneq: "\u228A", subsetneqq: "\u2ACB", subsim: "\u2AC7", subsub: "\u2AD5", subsup: "\u2AD3", succapprox: "\u2AB8", succ: "\u227B", succcurlyeq: "\u227D", Succeeds: "\u227B", SucceedsEqual: "\u2AB0", SucceedsSlantEqual: "\u227D", SucceedsTilde: "\u227F", succeq: "\u2AB0", succnapprox: "\u2ABA", succneqq: "\u2AB6", succnsim: "\u22E9", succsim: "\u227F", SuchThat: "\u220B", sum: "\u2211", Sum: "\u2211", sung: "\u266A", sup1: "\xB9", sup2: "\xB2", sup3: "\xB3", sup: "\u2283", Sup: "\u22D1", supdot: "\u2ABE", supdsub: "\u2AD8", supE: "\u2AC6", supe: "\u2287", supedot: "\u2AC4", Superset: "\u2283", SupersetEqual: "\u2287", suphsol: "\u27C9", suphsub: "\u2AD7", suplarr: "\u297B", supmult: "\u2AC2", supnE: "\u2ACC", supne: "\u228B", supplus: "\u2AC0", supset: "\u2283", Supset: "\u22D1", supseteq: "\u2287", supseteqq: "\u2AC6", supsetneq: "\u228B", supsetneqq: "\u2ACC", supsim: "\u2AC8", supsub: "\u2AD4", supsup: "\u2AD6", swarhk: "\u2926", swarr: "\u2199", swArr: "\u21D9", swarrow: "\u2199", swnwar: "\u292A", szlig: "\xDF", Tab: " ", target: "\u2316", Tau: "\u03A4", tau: "\u03C4", tbrk: "\u23B4", Tcaron: "\u0164", tcaron: "\u0165", Tcedil: "\u0162", tcedil: "\u0163", Tcy: "\u0422", tcy: "\u0442", tdot: "\u20DB", telrec: "\u2315", Tfr: "\u{1D517}", tfr: "\u{1D531}", there4: "\u2234", therefore: "\u2234", Therefore: "\u2234", Theta: "\u0398", theta: "\u03B8", thetasym: "\u03D1", thetav: "\u03D1", thickapprox: "\u2248", thicksim: "\u223C", ThickSpace: "\u205F\u200A", ThinSpace: "\u2009", thinsp: "\u2009", thkap: "\u2248", thksim: "\u223C", THORN: "\xDE", thorn: "\xFE", tilde: "\u02DC", Tilde: "\u223C", TildeEqual: "\u2243", TildeFullEqual: "\u2245", TildeTilde: "\u2248", timesbar: "\u2A31", timesb: "\u22A0", times: "\xD7", timesd: "\u2A30", tint: "\u222D", toea: "\u2928", topbot: "\u2336", topcir: "\u2AF1", top: "\u22A4", Topf: "\u{1D54B}", topf: "\u{1D565}", topfork: "\u2ADA", tosa: "\u2929", tprime: "\u2034", trade: "\u2122", TRADE: "\u2122", triangle: "\u25B5", triangledown: "\u25BF", triangleleft: "\u25C3", trianglelefteq: "\u22B4", triangleq: "\u225C", triangleright: "\u25B9", trianglerighteq: "\u22B5", tridot: "\u25EC", trie: "\u225C", triminus: "\u2A3A", TripleDot: "\u20DB", triplus: "\u2A39", trisb: "\u29CD", tritime: "\u2A3B", trpezium: "\u23E2", Tscr: "\u{1D4AF}", tscr: "\u{1D4C9}", TScy: "\u0426", tscy: "\u0446", TSHcy: "\u040B", tshcy: "\u045B", Tstrok: "\u0166", tstrok: "\u0167", twixt: "\u226C", twoheadleftarrow: "\u219E", twoheadrightarrow: "\u21A0", Uacute: "\xDA", uacute: "\xFA", uarr: "\u2191", Uarr: "\u219F", uArr: "\u21D1", Uarrocir: "\u2949", Ubrcy: "\u040E", ubrcy: "\u045E", Ubreve: "\u016C", ubreve: "\u016D", Ucirc: "\xDB", ucirc: "\xFB", Ucy: "\u0423", ucy: "\u0443", udarr: "\u21C5", Udblac: "\u0170", udblac: "\u0171", udhar: "\u296E", ufisht: "\u297E", Ufr: "\u{1D518}", ufr: "\u{1D532}", Ugrave: "\xD9", ugrave: "\xF9", uHar: "\u2963", uharl: "\u21BF", uharr: "\u21BE", uhblk: "\u2580", ulcorn: "\u231C", ulcorner: "\u231C", ulcrop: "\u230F", ultri: "\u25F8", Umacr: "\u016A", umacr: "\u016B", uml: "\xA8", UnderBar: "_", UnderBrace: "\u23DF", UnderBracket: "\u23B5", UnderParenthesis: "\u23DD", Union: "\u22C3", UnionPlus: "\u228E", Uogon: "\u0172", uogon: "\u0173", Uopf: "\u{1D54C}", uopf: "\u{1D566}", UpArrowBar: "\u2912", uparrow: "\u2191", UpArrow: "\u2191", Uparrow: "\u21D1", UpArrowDownArrow: "\u21C5", updownarrow: "\u2195", UpDownArrow: "\u2195", Updownarrow: "\u21D5", UpEquilibrium: "\u296E", upharpoonleft: "\u21BF", upharpoonright: "\u21BE", uplus: "\u228E", UpperLeftArrow: "\u2196", UpperRightArrow: "\u2197", upsi: "\u03C5", Upsi: "\u03D2", upsih: "\u03D2", Upsilon: "\u03A5", upsilon: "\u03C5", UpTeeArrow: "\u21A5", UpTee: "\u22A5", upuparrows: "\u21C8", urcorn: "\u231D", urcorner: "\u231D", urcrop: "\u230E", Uring: "\u016E", uring: "\u016F", urtri: "\u25F9", Uscr: "\u{1D4B0}", uscr: "\u{1D4CA}", utdot: "\u22F0", Utilde: "\u0168", utilde: "\u0169", utri: "\u25B5", utrif: "\u25B4", uuarr: "\u21C8", Uuml: "\xDC", uuml: "\xFC", uwangle: "\u29A7", vangrt: "\u299C", varepsilon: "\u03F5", varkappa: "\u03F0", varnothing: "\u2205", varphi: "\u03D5", varpi: "\u03D6", varpropto: "\u221D", varr: "\u2195", vArr: "\u21D5", varrho: "\u03F1", varsigma: "\u03C2", varsubsetneq: "\u228A\uFE00", varsubsetneqq: "\u2ACB\uFE00", varsupsetneq: "\u228B\uFE00", varsupsetneqq: "\u2ACC\uFE00", vartheta: "\u03D1", vartriangleleft: "\u22B2", vartriangleright: "\u22B3", vBar: "\u2AE8", Vbar: "\u2AEB", vBarv: "\u2AE9", Vcy: "\u0412", vcy: "\u0432", vdash: "\u22A2", vDash: "\u22A8", Vdash: "\u22A9", VDash: "\u22AB", Vdashl: "\u2AE6", veebar: "\u22BB", vee: "\u2228", Vee: "\u22C1", veeeq: "\u225A", vellip: "\u22EE", verbar: "|", Verbar: "\u2016", vert: "|", Vert: "\u2016", VerticalBar: "\u2223", VerticalLine: "|", VerticalSeparator: "\u2758", VerticalTilde: "\u2240", VeryThinSpace: "\u200A", Vfr: "\u{1D519}", vfr: "\u{1D533}", vltri: "\u22B2", vnsub: "\u2282\u20D2", vnsup: "\u2283\u20D2", Vopf: "\u{1D54D}", vopf: "\u{1D567}", vprop: "\u221D", vrtri: "\u22B3", Vscr: "\u{1D4B1}", vscr: "\u{1D4CB}", vsubnE: "\u2ACB\uFE00", vsubne: "\u228A\uFE00", vsupnE: "\u2ACC\uFE00", vsupne: "\u228B\uFE00", Vvdash: "\u22AA", vzigzag: "\u299A", Wcirc: "\u0174", wcirc: "\u0175", wedbar: "\u2A5F", wedge: "\u2227", Wedge: "\u22C0", wedgeq: "\u2259", weierp: "\u2118", Wfr: "\u{1D51A}", wfr: "\u{1D534}", Wopf: "\u{1D54E}", wopf: "\u{1D568}", wp: "\u2118", wr: "\u2240", wreath: "\u2240", Wscr: "\u{1D4B2}", wscr: "\u{1D4CC}", xcap: "\u22C2", xcirc: "\u25EF", xcup: "\u22C3", xdtri: "\u25BD", Xfr: "\u{1D51B}", xfr: "\u{1D535}", xharr: "\u27F7", xhArr: "\u27FA", Xi: "\u039E", xi: "\u03BE", xlarr: "\u27F5", xlArr: "\u27F8", xmap: "\u27FC", xnis: "\u22FB", xodot: "\u2A00", Xopf: "\u{1D54F}", xopf: "\u{1D569}", xoplus: "\u2A01", xotime: "\u2A02", xrarr: "\u27F6", xrArr: "\u27F9", Xscr: "\u{1D4B3}", xscr: "\u{1D4CD}", xsqcup: "\u2A06", xuplus: "\u2A04", xutri: "\u25B3", xvee: "\u22C1", xwedge: "\u22C0", Yacute: "\xDD", yacute: "\xFD", YAcy: "\u042F", yacy: "\u044F", Ycirc: "\u0176", ycirc: "\u0177", Ycy: "\u042B", ycy: "\u044B", yen: "\xA5", Yfr: "\u{1D51C}", yfr: "\u{1D536}", YIcy: "\u0407", yicy: "\u0457", Yopf: "\u{1D550}", yopf: "\u{1D56A}", Yscr: "\u{1D4B4}", yscr: "\u{1D4CE}", YUcy: "\u042E", yucy: "\u044E", yuml: "\xFF", Yuml: "\u0178", Zacute: "\u0179", zacute: "\u017A", Zcaron: "\u017D", zcaron: "\u017E", Zcy: "\u0417", zcy: "\u0437", Zdot: "\u017B", zdot: "\u017C", zeetrf: "\u2128", ZeroWidthSpace: "\u200B", Zeta: "\u0396", zeta: "\u03B6", zfr: "\u{1D537}", Zfr: "\u2128", ZHcy: "\u0416", zhcy: "\u0436", zigrarr: "\u21DD", zopf: "\u{1D56B}", Zopf: "\u2124", Zscr: "\u{1D4B5}", zscr: "\u{1D4CF}", zwj: "\u200D", zwnj: "\u200C" }; + } +}); + +// node_modules/entities/lib/maps/legacy.json +var require_legacy = __commonJS({ + "node_modules/entities/lib/maps/legacy.json"(exports2, module2) { + module2.exports = { Aacute: "\xC1", aacute: "\xE1", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", AElig: "\xC6", aelig: "\xE6", Agrave: "\xC0", agrave: "\xE0", amp: "&", AMP: "&", Aring: "\xC5", aring: "\xE5", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", brvbar: "\xA6", Ccedil: "\xC7", ccedil: "\xE7", cedil: "\xB8", cent: "\xA2", copy: "\xA9", COPY: "\xA9", curren: "\xA4", deg: "\xB0", divide: "\xF7", Eacute: "\xC9", eacute: "\xE9", Ecirc: "\xCA", ecirc: "\xEA", Egrave: "\xC8", egrave: "\xE8", ETH: "\xD0", eth: "\xF0", Euml: "\xCB", euml: "\xEB", frac12: "\xBD", frac14: "\xBC", frac34: "\xBE", gt: ">", GT: ">", Iacute: "\xCD", iacute: "\xED", Icirc: "\xCE", icirc: "\xEE", iexcl: "\xA1", Igrave: "\xCC", igrave: "\xEC", iquest: "\xBF", Iuml: "\xCF", iuml: "\xEF", laquo: "\xAB", lt: "<", LT: "<", macr: "\xAF", micro: "\xB5", middot: "\xB7", nbsp: "\xA0", not: "\xAC", Ntilde: "\xD1", ntilde: "\xF1", Oacute: "\xD3", oacute: "\xF3", Ocirc: "\xD4", ocirc: "\xF4", Ograve: "\xD2", ograve: "\xF2", ordf: "\xAA", ordm: "\xBA", Oslash: "\xD8", oslash: "\xF8", Otilde: "\xD5", otilde: "\xF5", Ouml: "\xD6", ouml: "\xF6", para: "\xB6", plusmn: "\xB1", pound: "\xA3", quot: '"', QUOT: '"', raquo: "\xBB", reg: "\xAE", REG: "\xAE", sect: "\xA7", shy: "\xAD", sup1: "\xB9", sup2: "\xB2", sup3: "\xB3", szlig: "\xDF", THORN: "\xDE", thorn: "\xFE", times: "\xD7", Uacute: "\xDA", uacute: "\xFA", Ucirc: "\xDB", ucirc: "\xFB", Ugrave: "\xD9", ugrave: "\xF9", uml: "\xA8", Uuml: "\xDC", uuml: "\xFC", Yacute: "\xDD", yacute: "\xFD", yen: "\xA5", yuml: "\xFF" }; } }); -// node_modules/bluebird/js/release/context.js -var require_context = __commonJS({ - "node_modules/bluebird/js/release/context.js"(exports2, module2) { +// node_modules/entities/lib/maps/xml.json +var require_xml = __commonJS({ + "node_modules/entities/lib/maps/xml.json"(exports2, module2) { + module2.exports = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' }; + } +}); + +// node_modules/entities/lib/maps/decode.json +var require_decode = __commonJS({ + "node_modules/entities/lib/maps/decode.json"(exports2, module2) { + module2.exports = { "0": 65533, "128": 8364, "130": 8218, "131": 402, "132": 8222, "133": 8230, "134": 8224, "135": 8225, "136": 710, "137": 8240, "138": 352, "139": 8249, "140": 338, "142": 381, "145": 8216, "146": 8217, "147": 8220, "148": 8221, "149": 8226, "150": 8211, "151": 8212, "152": 732, "153": 8482, "154": 353, "155": 8250, "156": 339, "158": 382, "159": 376 }; + } +}); + +// node_modules/entities/lib/decode_codepoint.js +var require_decode_codepoint = __commonJS({ + "node_modules/entities/lib/decode_codepoint.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2) { - var longStackTraces = false; - var contextStack = []; - Promise2.prototype._promiseCreated = function() { - }; - Promise2.prototype._pushContext = function() { - }; - Promise2.prototype._popContext = function() { - return null; - }; - Promise2._peekContext = Promise2.prototype._peekContext = function() { - }; - function Context() { - this._trace = new Context.CapturedTrace(peekContext()); + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + var decode_json_1 = __importDefault(require_decode()); + var fromCodePoint = String.fromCodePoint || function(codePoint) { + var output = ""; + if (codePoint > 65535) { + codePoint -= 65536; + output += String.fromCharCode(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + output += String.fromCharCode(codePoint); + return output; + }; + function decodeCodePoint(codePoint) { + if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) { + return "\uFFFD"; } - Context.prototype._pushContext = function() { - if (this._trace !== void 0) { - this._trace._promiseCreated = null; - contextStack.push(this._trace); - } - }; - Context.prototype._popContext = function() { - if (this._trace !== void 0) { - var trace = contextStack.pop(); - var ret2 = trace._promiseCreated; - trace._promiseCreated = null; - return ret2; - } - return null; - }; - function createContext() { - if (longStackTraces) - return new Context(); + if (codePoint in decode_json_1.default) { + codePoint = decode_json_1.default[codePoint]; } - function peekContext() { - var lastIndex = contextStack.length - 1; - if (lastIndex >= 0) { - return contextStack[lastIndex]; + return fromCodePoint(codePoint); + } + exports2.default = decodeCodePoint; + } +}); + +// node_modules/entities/lib/decode.js +var require_decode2 = __commonJS({ + "node_modules/entities/lib/decode.js"(exports2) { + init_shims(); + "use strict"; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.decodeHTML = exports2.decodeHTMLStrict = exports2.decodeXML = void 0; + var entities_json_1 = __importDefault(require_entities()); + var legacy_json_1 = __importDefault(require_legacy()); + var xml_json_1 = __importDefault(require_xml()); + var decode_codepoint_1 = __importDefault(require_decode_codepoint()); + var strictEntityRe = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g; + exports2.decodeXML = getStrictDecoder(xml_json_1.default); + exports2.decodeHTMLStrict = getStrictDecoder(entities_json_1.default); + function getStrictDecoder(map) { + var replace = getReplacer(map); + return function(str) { + return String(str).replace(strictEntityRe, replace); + }; + } + var sorter = function(a, b) { + return a < b ? 1 : -1; + }; + exports2.decodeHTML = function() { + var legacy = Object.keys(legacy_json_1.default).sort(sorter); + var keys = Object.keys(entities_json_1.default).sort(sorter); + for (var i = 0, j = 0; i < keys.length; i++) { + if (legacy[j] === keys[i]) { + keys[i] += ";?"; + j++; + } else { + keys[i] += ";"; } - return void 0; } - Context.CapturedTrace = null; - Context.create = createContext; - Context.deactivateLongStackTraces = function() { + var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"); + var replace = getReplacer(entities_json_1.default); + function replacer(str) { + if (str.substr(-1) !== ";") + str += ";"; + return replace(str); + } + return function(str) { + return String(str).replace(re, replacer); }; - Context.activateLongStackTraces = function() { - var Promise_pushContext = Promise2.prototype._pushContext; - var Promise_popContext = Promise2.prototype._popContext; - var Promise_PeekContext = Promise2._peekContext; - var Promise_peekContext = Promise2.prototype._peekContext; - var Promise_promiseCreated = Promise2.prototype._promiseCreated; - Context.deactivateLongStackTraces = function() { - Promise2.prototype._pushContext = Promise_pushContext; - Promise2.prototype._popContext = Promise_popContext; - Promise2._peekContext = Promise_PeekContext; - Promise2.prototype._peekContext = Promise_peekContext; - Promise2.prototype._promiseCreated = Promise_promiseCreated; - longStackTraces = false; - }; - longStackTraces = true; - Promise2.prototype._pushContext = Context.prototype._pushContext; - Promise2.prototype._popContext = Context.prototype._popContext; - Promise2._peekContext = Promise2.prototype._peekContext = peekContext; - Promise2.prototype._promiseCreated = function() { - var ctx = this._peekContext(); - if (ctx && ctx._promiseCreated == null) - ctx._promiseCreated = this; - }; + }(); + function getReplacer(map) { + return function replace(str) { + if (str.charAt(1) === "#") { + var secondChar = str.charAt(2); + if (secondChar === "X" || secondChar === "x") { + return decode_codepoint_1.default(parseInt(str.substr(3), 16)); + } + return decode_codepoint_1.default(parseInt(str.substr(2), 10)); + } + return map[str.slice(1, -1)] || str; }; - return Context; - }; + } } }); -// node_modules/bluebird/js/release/debuggability.js -var require_debuggability = __commonJS({ - "node_modules/bluebird/js/release/debuggability.js"(exports2, module2) { +// node_modules/entities/lib/encode.js +var require_encode = __commonJS({ + "node_modules/entities/lib/encode.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2, Context, enableAsyncHooks, disableAsyncHooks) { - var async = Promise2._async; - var Warning = require_errors().Warning; - var util = require_util(); - var es52 = require_es5(); - var canAttachTrace2 = util.canAttachTrace; - var unhandledRejectionHandled; - var possiblyUnhandledRejection; - var bluebirdFramePattern = /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; - var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; - var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; - var stackFramePattern = null; - var formatStack = null; - var indentStackFrames = false; - var printWarning; - var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && (util.env("BLUEBIRD_DEBUG") || util.env("NODE_ENV") === "development")); - var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && (debugging || util.env("BLUEBIRD_WARNINGS"))); - var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); - var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); - var deferUnhandledRejectionCheck; - (function() { - var promises = []; - function unhandledRejectionCheck() { - for (var i = 0; i < promises.length; ++i) { - promises[i]._notifyUnhandledRejection(); - } - unhandledRejectionClear(); - } - function unhandledRejectionClear() { - promises.length = 0; - } - deferUnhandledRejectionCheck = function(promise) { - promises.push(promise); - setTimeout(unhandledRejectionCheck, 1); - }; - es52.defineProperty(Promise2, "_unhandledRejectionCheck", { - value: unhandledRejectionCheck - }); - es52.defineProperty(Promise2, "_unhandledRejectionClear", { - value: unhandledRejectionClear - }); - })(); - Promise2.prototype.suppressUnhandledRejections = function() { - var target = this._target(); - target._bitField = target._bitField & ~1048576 | 524288; - }; - Promise2.prototype._ensurePossibleRejectionHandled = function() { - if ((this._bitField & 524288) !== 0) - return; - this._setRejectionIsUnhandled(); - deferUnhandledRejectionCheck(this); - }; - Promise2.prototype._notifyUnhandledRejectionIsHandled = function() { - fireRejectionEvent("rejectionHandled", unhandledRejectionHandled, void 0, this); - }; - Promise2.prototype._setReturnedNonUndefined = function() { - this._bitField = this._bitField | 268435456; - }; - Promise2.prototype._returnedNonUndefined = function() { - return (this._bitField & 268435456) !== 0; - }; - Promise2.prototype._notifyUnhandledRejection = function() { - if (this._isRejectionUnhandled()) { - var reason = this._settledValue(); - this._setUnhandledRejectionIsNotified(); - fireRejectionEvent("unhandledRejection", possiblyUnhandledRejection, reason, this); + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.escapeUTF8 = exports2.escape = exports2.encodeNonAsciiHTML = exports2.encodeHTML = exports2.encodeXML = void 0; + var xml_json_1 = __importDefault(require_xml()); + var inverseXML = getInverseObj(xml_json_1.default); + var xmlReplacer = getInverseReplacer(inverseXML); + exports2.encodeXML = getASCIIEncoder(inverseXML); + var entities_json_1 = __importDefault(require_entities()); + var inverseHTML = getInverseObj(entities_json_1.default); + var htmlReplacer = getInverseReplacer(inverseHTML); + exports2.encodeHTML = getInverse(inverseHTML, htmlReplacer); + exports2.encodeNonAsciiHTML = getASCIIEncoder(inverseHTML); + function getInverseObj(obj) { + return Object.keys(obj).sort().reduce(function(inverse, name) { + inverse[obj[name]] = "&" + name + ";"; + return inverse; + }, {}); + } + function getInverseReplacer(inverse) { + var single = []; + var multiple = []; + for (var _i = 0, _a = Object.keys(inverse); _i < _a.length; _i++) { + var k = _a[_i]; + if (k.length === 1) { + single.push("\\" + k); + } else { + multiple.push(k); } - }; - Promise2.prototype._setUnhandledRejectionIsNotified = function() { - this._bitField = this._bitField | 262144; - }; - Promise2.prototype._unsetUnhandledRejectionIsNotified = function() { - this._bitField = this._bitField & ~262144; - }; - Promise2.prototype._isUnhandledRejectionNotified = function() { - return (this._bitField & 262144) > 0; - }; - Promise2.prototype._setRejectionIsUnhandled = function() { - this._bitField = this._bitField | 1048576; - }; - Promise2.prototype._unsetRejectionIsUnhandled = function() { - this._bitField = this._bitField & ~1048576; - if (this._isUnhandledRejectionNotified()) { - this._unsetUnhandledRejectionIsNotified(); - this._notifyUnhandledRejectionIsHandled(); + } + single.sort(); + for (var start = 0; start < single.length - 1; start++) { + var end = start; + while (end < single.length - 1 && single[end].charCodeAt(1) + 1 === single[end + 1].charCodeAt(1)) { + end += 1; } + var count = 1 + end - start; + if (count < 3) + continue; + single.splice(start, count, single[start] + "-" + single[end]); + } + multiple.unshift("[" + single.join("") + "]"); + return new RegExp(multiple.join("|"), "g"); + } + var reNonASCII = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g; + var getCodePoint = String.prototype.codePointAt != null ? function(str) { + return str.codePointAt(0); + } : function(c) { + return (c.charCodeAt(0) - 55296) * 1024 + c.charCodeAt(1) - 56320 + 65536; + }; + function singleCharReplacer(c) { + return "&#x" + (c.length > 1 ? getCodePoint(c) : c.charCodeAt(0)).toString(16).toUpperCase() + ";"; + } + function getInverse(inverse, re) { + return function(data) { + return data.replace(re, function(name) { + return inverse[name]; + }).replace(reNonASCII, singleCharReplacer); }; - Promise2.prototype._isRejectionUnhandled = function() { - return (this._bitField & 1048576) > 0; - }; - Promise2.prototype._warn = function(message, shouldUseOwnTrace, promise) { - return warn(message, shouldUseOwnTrace, promise || this); - }; - Promise2.onPossiblyUnhandledRejection = function(fn) { - var context = Promise2._getContext(); - possiblyUnhandledRejection = util.contextBind(context, fn); - }; - Promise2.onUnhandledRejectionHandled = function(fn) { - var context = Promise2._getContext(); - unhandledRejectionHandled = util.contextBind(context, fn); - }; - var disableLongStackTraces = function() { + } + var reEscapeChars = new RegExp(xmlReplacer.source + "|" + reNonASCII.source, "g"); + function escape3(data) { + return data.replace(reEscapeChars, singleCharReplacer); + } + exports2.escape = escape3; + function escapeUTF8(data) { + return data.replace(xmlReplacer, singleCharReplacer); + } + exports2.escapeUTF8 = escapeUTF8; + function getASCIIEncoder(obj) { + return function(data) { + return data.replace(reEscapeChars, function(c) { + return obj[c] || singleCharReplacer(c); + }); }; - Promise2.longStackTraces = function() { - if (async.haveItemsQueued() && !config.longStackTraces) { - throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n"); - } - if (!config.longStackTraces && longStackTracesIsSupported()) { - var Promise_captureStackTrace = Promise2.prototype._captureStackTrace; - var Promise_attachExtraTrace = Promise2.prototype._attachExtraTrace; - var Promise_dereferenceTrace = Promise2.prototype._dereferenceTrace; - config.longStackTraces = true; - disableLongStackTraces = function() { - if (async.haveItemsQueued() && !config.longStackTraces) { - throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n"); - } - Promise2.prototype._captureStackTrace = Promise_captureStackTrace; - Promise2.prototype._attachExtraTrace = Promise_attachExtraTrace; - Promise2.prototype._dereferenceTrace = Promise_dereferenceTrace; - Context.deactivateLongStackTraces(); - config.longStackTraces = false; - }; - Promise2.prototype._captureStackTrace = longStackTracesCaptureStackTrace; - Promise2.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; - Promise2.prototype._dereferenceTrace = longStackTracesDereferenceTrace; - Context.activateLongStackTraces(); + } + } +}); + +// node_modules/entities/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/entities/lib/index.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.decodeXMLStrict = exports2.decodeHTML5Strict = exports2.decodeHTML4Strict = exports2.decodeHTML5 = exports2.decodeHTML4 = exports2.decodeHTMLStrict = exports2.decodeHTML = exports2.decodeXML = exports2.encodeHTML5 = exports2.encodeHTML4 = exports2.escapeUTF8 = exports2.escape = exports2.encodeNonAsciiHTML = exports2.encodeHTML = exports2.encodeXML = exports2.encode = exports2.decodeStrict = exports2.decode = void 0; + var decode_1 = require_decode2(); + var encode_1 = require_encode(); + function decode(data, level) { + return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data); + } + exports2.decode = decode; + function decodeStrict(data, level) { + return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data); + } + exports2.decodeStrict = decodeStrict; + function encode(data, level) { + return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data); + } + exports2.encode = encode; + var encode_2 = require_encode(); + Object.defineProperty(exports2, "encodeXML", { enumerable: true, get: function() { + return encode_2.encodeXML; + } }); + Object.defineProperty(exports2, "encodeHTML", { enumerable: true, get: function() { + return encode_2.encodeHTML; + } }); + Object.defineProperty(exports2, "encodeNonAsciiHTML", { enumerable: true, get: function() { + return encode_2.encodeNonAsciiHTML; + } }); + Object.defineProperty(exports2, "escape", { enumerable: true, get: function() { + return encode_2.escape; + } }); + Object.defineProperty(exports2, "escapeUTF8", { enumerable: true, get: function() { + return encode_2.escapeUTF8; + } }); + Object.defineProperty(exports2, "encodeHTML4", { enumerable: true, get: function() { + return encode_2.encodeHTML; + } }); + Object.defineProperty(exports2, "encodeHTML5", { enumerable: true, get: function() { + return encode_2.encodeHTML; + } }); + var decode_2 = require_decode2(); + Object.defineProperty(exports2, "decodeXML", { enumerable: true, get: function() { + return decode_2.decodeXML; + } }); + Object.defineProperty(exports2, "decodeHTML", { enumerable: true, get: function() { + return decode_2.decodeHTML; + } }); + Object.defineProperty(exports2, "decodeHTMLStrict", { enumerable: true, get: function() { + return decode_2.decodeHTMLStrict; + } }); + Object.defineProperty(exports2, "decodeHTML4", { enumerable: true, get: function() { + return decode_2.decodeHTML; + } }); + Object.defineProperty(exports2, "decodeHTML5", { enumerable: true, get: function() { + return decode_2.decodeHTML; + } }); + Object.defineProperty(exports2, "decodeHTML4Strict", { enumerable: true, get: function() { + return decode_2.decodeHTMLStrict; + } }); + Object.defineProperty(exports2, "decodeHTML5Strict", { enumerable: true, get: function() { + return decode_2.decodeHTMLStrict; + } }); + Object.defineProperty(exports2, "decodeXMLStrict", { enumerable: true, get: function() { + return decode_2.decodeXML; + } }); + } +}); + +// node_modules/dom-serializer/lib/foreignNames.js +var require_foreignNames = __commonJS({ + "node_modules/dom-serializer/lib/foreignNames.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.attributeNames = exports2.elementNames = void 0; + exports2.elementNames = new Map([ + ["altglyph", "altGlyph"], + ["altglyphdef", "altGlyphDef"], + ["altglyphitem", "altGlyphItem"], + ["animatecolor", "animateColor"], + ["animatemotion", "animateMotion"], + ["animatetransform", "animateTransform"], + ["clippath", "clipPath"], + ["feblend", "feBlend"], + ["fecolormatrix", "feColorMatrix"], + ["fecomponenttransfer", "feComponentTransfer"], + ["fecomposite", "feComposite"], + ["feconvolvematrix", "feConvolveMatrix"], + ["fediffuselighting", "feDiffuseLighting"], + ["fedisplacementmap", "feDisplacementMap"], + ["fedistantlight", "feDistantLight"], + ["fedropshadow", "feDropShadow"], + ["feflood", "feFlood"], + ["fefunca", "feFuncA"], + ["fefuncb", "feFuncB"], + ["fefuncg", "feFuncG"], + ["fefuncr", "feFuncR"], + ["fegaussianblur", "feGaussianBlur"], + ["feimage", "feImage"], + ["femerge", "feMerge"], + ["femergenode", "feMergeNode"], + ["femorphology", "feMorphology"], + ["feoffset", "feOffset"], + ["fepointlight", "fePointLight"], + ["fespecularlighting", "feSpecularLighting"], + ["fespotlight", "feSpotLight"], + ["fetile", "feTile"], + ["feturbulence", "feTurbulence"], + ["foreignobject", "foreignObject"], + ["glyphref", "glyphRef"], + ["lineargradient", "linearGradient"], + ["radialgradient", "radialGradient"], + ["textpath", "textPath"] + ]); + exports2.attributeNames = new Map([ + ["definitionurl", "definitionURL"], + ["attributename", "attributeName"], + ["attributetype", "attributeType"], + ["basefrequency", "baseFrequency"], + ["baseprofile", "baseProfile"], + ["calcmode", "calcMode"], + ["clippathunits", "clipPathUnits"], + ["diffuseconstant", "diffuseConstant"], + ["edgemode", "edgeMode"], + ["filterunits", "filterUnits"], + ["glyphref", "glyphRef"], + ["gradienttransform", "gradientTransform"], + ["gradientunits", "gradientUnits"], + ["kernelmatrix", "kernelMatrix"], + ["kernelunitlength", "kernelUnitLength"], + ["keypoints", "keyPoints"], + ["keysplines", "keySplines"], + ["keytimes", "keyTimes"], + ["lengthadjust", "lengthAdjust"], + ["limitingconeangle", "limitingConeAngle"], + ["markerheight", "markerHeight"], + ["markerunits", "markerUnits"], + ["markerwidth", "markerWidth"], + ["maskcontentunits", "maskContentUnits"], + ["maskunits", "maskUnits"], + ["numoctaves", "numOctaves"], + ["pathlength", "pathLength"], + ["patterncontentunits", "patternContentUnits"], + ["patterntransform", "patternTransform"], + ["patternunits", "patternUnits"], + ["pointsatx", "pointsAtX"], + ["pointsaty", "pointsAtY"], + ["pointsatz", "pointsAtZ"], + ["preservealpha", "preserveAlpha"], + ["preserveaspectratio", "preserveAspectRatio"], + ["primitiveunits", "primitiveUnits"], + ["refx", "refX"], + ["refy", "refY"], + ["repeatcount", "repeatCount"], + ["repeatdur", "repeatDur"], + ["requiredextensions", "requiredExtensions"], + ["requiredfeatures", "requiredFeatures"], + ["specularconstant", "specularConstant"], + ["specularexponent", "specularExponent"], + ["spreadmethod", "spreadMethod"], + ["startoffset", "startOffset"], + ["stddeviation", "stdDeviation"], + ["stitchtiles", "stitchTiles"], + ["surfacescale", "surfaceScale"], + ["systemlanguage", "systemLanguage"], + ["tablevalues", "tableValues"], + ["targetx", "targetX"], + ["targety", "targetY"], + ["textlength", "textLength"], + ["viewbox", "viewBox"], + ["viewtarget", "viewTarget"], + ["xchannelselector", "xChannelSelector"], + ["ychannelselector", "yChannelSelector"], + ["zoomandpan", "zoomAndPan"] + ]); + } +}); + +// node_modules/dom-serializer/lib/index.js +var require_lib5 = __commonJS({ + "node_modules/dom-serializer/lib/index.js"(exports2) { + init_shims(); + "use strict"; + var __assign = exports2 && exports2.__assign || function() { + __assign = Object.assign || function(t) { + for (var s2, i = 1, n = arguments.length; i < n; i++) { + s2 = arguments[i]; + for (var p in s2) + if (Object.prototype.hasOwnProperty.call(s2, p)) + t[p] = s2[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }); + var __importStar = exports2 && exports2.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + var ElementType = __importStar(require_lib2()); + var entities_1 = require_lib4(); + var foreignNames_1 = require_foreignNames(); + var unencodedElements = new Set([ + "style", + "script", + "xmp", + "iframe", + "noembed", + "noframes", + "plaintext", + "noscript" + ]); + function formatAttributes(attributes, opts) { + if (!attributes) + return; + return Object.keys(attributes).map(function(key) { + var _a, _b; + var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : ""; + if (opts.xmlMode === "foreign") { + key = (_b = foreignNames_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key; + } + if (!opts.emptyAttrs && !opts.xmlMode && value === "") { + return key; + } + return key + '="' + (opts.decodeEntities !== false ? entities_1.encodeXML(value) : value.replace(/"/g, """)) + '"'; + }).join(" "); + } + var singleTag = new Set([ + "area", + "base", + "basefont", + "br", + "col", + "command", + "embed", + "frame", + "hr", + "img", + "input", + "isindex", + "keygen", + "link", + "meta", + "param", + "source", + "track", + "wbr" + ]); + function render2(node, options2) { + if (options2 === void 0) { + options2 = {}; + } + var nodes = "length" in node ? node : [node]; + var output = ""; + for (var i = 0; i < nodes.length; i++) { + output += renderNode(nodes[i], options2); + } + return output; + } + exports2.default = render2; + function renderNode(node, options2) { + switch (node.type) { + case ElementType.Root: + return render2(node.children, options2); + case ElementType.Directive: + case ElementType.Doctype: + return renderDirective(node); + case ElementType.Comment: + return renderComment(node); + case ElementType.CDATA: + return renderCdata(node); + case ElementType.Script: + case ElementType.Style: + case ElementType.Tag: + return renderTag(node, options2); + case ElementType.Text: + return renderText(node, options2); + } + } + var foreignModeIntegrationPoints = new Set([ + "mi", + "mo", + "mn", + "ms", + "mtext", + "annotation-xml", + "foreignObject", + "desc", + "title" + ]); + var foreignElements = new Set(["svg", "math"]); + function renderTag(elem, opts) { + var _a; + if (opts.xmlMode === "foreign") { + elem.name = (_a = foreignNames_1.elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name; + if (elem.parent && foreignModeIntegrationPoints.has(elem.parent.name)) { + opts = __assign(__assign({}, opts), { xmlMode: false }); + } + } + if (!opts.xmlMode && foreignElements.has(elem.name)) { + opts = __assign(__assign({}, opts), { xmlMode: "foreign" }); + } + var tag = "<" + elem.name; + var attribs = formatAttributes(elem.attribs, opts); + if (attribs) { + tag += " " + attribs; + } + if (elem.children.length === 0 && (opts.xmlMode ? opts.selfClosingTags !== false : opts.selfClosingTags && singleTag.has(elem.name))) { + if (!opts.xmlMode) + tag += " "; + tag += "/>"; + } else { + tag += ">"; + if (elem.children.length > 0) { + tag += render2(elem.children, opts); } - }; - Promise2.hasLongStackTraces = function() { - return config.longStackTraces && longStackTracesIsSupported(); - }; - var legacyHandlers = { - unhandledrejection: { - before: function() { - var ret2 = util.global.onunhandledrejection; - util.global.onunhandledrejection = null; - return ret2; - }, - after: function(fn) { - util.global.onunhandledrejection = fn; - } - }, - rejectionhandled: { - before: function() { - var ret2 = util.global.onrejectionhandled; - util.global.onrejectionhandled = null; - return ret2; - }, - after: function(fn) { - util.global.onrejectionhandled = fn; - } + if (opts.xmlMode || !singleTag.has(elem.name)) { + tag += ""; } - }; - var fireDomEvent = function() { - var dispatch = function(legacy, e) { - if (legacy) { - var fn; - try { - fn = legacy.before(); - return !util.global.dispatchEvent(e); - } finally { - legacy.after(fn); - } - } else { - return !util.global.dispatchEvent(e); - } - }; - try { - if (typeof CustomEvent === "function") { - var event = new CustomEvent("CustomEvent"); - util.global.dispatchEvent(event); - return function(name, event2) { - name = name.toLowerCase(); - var eventData = { - detail: event2, - cancelable: true - }; - var domEvent = new CustomEvent(name, eventData); - es52.defineProperty(domEvent, "promise", { value: event2.promise }); - es52.defineProperty(domEvent, "reason", { value: event2.reason }); - return dispatch(legacyHandlers[name], domEvent); - }; - } else if (typeof Event === "function") { - var event = new Event("CustomEvent"); - util.global.dispatchEvent(event); - return function(name, event2) { - name = name.toLowerCase(); - var domEvent = new Event(name, { - cancelable: true - }); - domEvent.detail = event2; - es52.defineProperty(domEvent, "promise", { value: event2.promise }); - es52.defineProperty(domEvent, "reason", { value: event2.reason }); - return dispatch(legacyHandlers[name], domEvent); - }; - } else { - var event = document.createEvent("CustomEvent"); - event.initCustomEvent("testingtheevent", false, true, {}); - util.global.dispatchEvent(event); - return function(name, event2) { - name = name.toLowerCase(); - var domEvent = document.createEvent("CustomEvent"); - domEvent.initCustomEvent(name, false, true, event2); - return dispatch(legacyHandlers[name], domEvent); - }; - } - } catch (e) { + } + return tag; + } + function renderDirective(elem) { + return "<" + elem.data + ">"; + } + function renderText(elem, opts) { + var data = elem.data || ""; + if (opts.decodeEntities !== false && !(!opts.xmlMode && elem.parent && unencodedElements.has(elem.parent.name))) { + data = entities_1.encodeXML(data); + } + return data; + } + function renderCdata(elem) { + return ""; + } + function renderComment(elem) { + return ""; + } + } +}); + +// node_modules/domutils/lib/stringify.js +var require_stringify3 = __commonJS({ + "node_modules/domutils/lib/stringify.js"(exports2) { + init_shims(); + "use strict"; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.innerText = exports2.textContent = exports2.getText = exports2.getInnerHTML = exports2.getOuterHTML = void 0; + var domhandler_1 = require_lib3(); + var dom_serializer_1 = __importDefault(require_lib5()); + var domelementtype_1 = require_lib2(); + function getOuterHTML(node, options2) { + return dom_serializer_1.default(node, options2); + } + exports2.getOuterHTML = getOuterHTML; + function getInnerHTML(node, options2) { + return domhandler_1.hasChildren(node) ? node.children.map(function(node2) { + return getOuterHTML(node2, options2); + }).join("") : ""; + } + exports2.getInnerHTML = getInnerHTML; + function getText(node) { + if (Array.isArray(node)) + return node.map(getText).join(""); + if (domhandler_1.isTag(node)) + return node.name === "br" ? "\n" : getText(node.children); + if (domhandler_1.isCDATA(node)) + return getText(node.children); + if (domhandler_1.isText(node)) + return node.data; + return ""; + } + exports2.getText = getText; + function textContent(node) { + if (Array.isArray(node)) + return node.map(textContent).join(""); + if (domhandler_1.isTag(node)) + return textContent(node.children); + if (domhandler_1.isCDATA(node)) + return textContent(node.children); + if (domhandler_1.isText(node)) + return node.data; + return ""; + } + exports2.textContent = textContent; + function innerText(node) { + if (Array.isArray(node)) + return node.map(innerText).join(""); + if (domhandler_1.hasChildren(node) && node.type === domelementtype_1.ElementType.Tag) { + return innerText(node.children); + } + if (domhandler_1.isCDATA(node)) + return innerText(node.children); + if (domhandler_1.isText(node)) + return node.data; + return ""; + } + exports2.innerText = innerText; + } +}); + +// node_modules/domutils/lib/traversal.js +var require_traversal = __commonJS({ + "node_modules/domutils/lib/traversal.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.prevElementSibling = exports2.nextElementSibling = exports2.getName = exports2.hasAttrib = exports2.getAttributeValue = exports2.getSiblings = exports2.getParent = exports2.getChildren = void 0; + var domhandler_1 = require_lib3(); + var emptyArray = []; + function getChildren(elem) { + var _a; + return (_a = elem.children) !== null && _a !== void 0 ? _a : emptyArray; + } + exports2.getChildren = getChildren; + function getParent(elem) { + return elem.parent || null; + } + exports2.getParent = getParent; + function getSiblings(elem) { + var _a, _b; + var parent = getParent(elem); + if (parent != null) + return getChildren(parent); + var siblings = [elem]; + var prev = elem.prev, next = elem.next; + while (prev != null) { + siblings.unshift(prev); + _a = prev, prev = _a.prev; + } + while (next != null) { + siblings.push(next); + _b = next, next = _b.next; + } + return siblings; + } + exports2.getSiblings = getSiblings; + function getAttributeValue(elem, name) { + var _a; + return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[name]; + } + exports2.getAttributeValue = getAttributeValue; + function hasAttrib(elem, name) { + return elem.attribs != null && Object.prototype.hasOwnProperty.call(elem.attribs, name) && elem.attribs[name] != null; + } + exports2.hasAttrib = hasAttrib; + function getName2(elem) { + return elem.name; + } + exports2.getName = getName2; + function nextElementSibling(elem) { + var _a; + var next = elem.next; + while (next !== null && !domhandler_1.isTag(next)) + _a = next, next = _a.next; + return next; + } + exports2.nextElementSibling = nextElementSibling; + function prevElementSibling(elem) { + var _a; + var prev = elem.prev; + while (prev !== null && !domhandler_1.isTag(prev)) + _a = prev, prev = _a.prev; + return prev; + } + exports2.prevElementSibling = prevElementSibling; + } +}); + +// node_modules/domutils/lib/manipulation.js +var require_manipulation = __commonJS({ + "node_modules/domutils/lib/manipulation.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.prepend = exports2.prependChild = exports2.append = exports2.appendChild = exports2.replaceElement = exports2.removeElement = void 0; + function removeElement(elem) { + if (elem.prev) + elem.prev.next = elem.next; + if (elem.next) + elem.next.prev = elem.prev; + if (elem.parent) { + var childs = elem.parent.children; + childs.splice(childs.lastIndexOf(elem), 1); + } + } + exports2.removeElement = removeElement; + function replaceElement(elem, replacement) { + var prev = replacement.prev = elem.prev; + if (prev) { + prev.next = replacement; + } + var next = replacement.next = elem.next; + if (next) { + next.prev = replacement; + } + var parent = replacement.parent = elem.parent; + if (parent) { + var childs = parent.children; + childs[childs.lastIndexOf(elem)] = replacement; + } + } + exports2.replaceElement = replaceElement; + function appendChild(elem, child) { + removeElement(child); + child.next = null; + child.parent = elem; + if (elem.children.push(child) > 1) { + var sibling = elem.children[elem.children.length - 2]; + sibling.next = child; + child.prev = sibling; + } else { + child.prev = null; + } + } + exports2.appendChild = appendChild; + function append(elem, next) { + removeElement(next); + var parent = elem.parent; + var currNext = elem.next; + next.next = currNext; + next.prev = elem; + elem.next = next; + next.parent = parent; + if (currNext) { + currNext.prev = next; + if (parent) { + var childs = parent.children; + childs.splice(childs.lastIndexOf(currNext), 0, next); + } + } else if (parent) { + parent.children.push(next); + } + } + exports2.append = append; + function prependChild(elem, child) { + removeElement(child); + child.parent = elem; + child.prev = null; + if (elem.children.unshift(child) !== 1) { + var sibling = elem.children[1]; + sibling.prev = child; + child.next = sibling; + } else { + child.next = null; + } + } + exports2.prependChild = prependChild; + function prepend(elem, prev) { + removeElement(prev); + var parent = elem.parent; + if (parent) { + var childs = parent.children; + childs.splice(childs.indexOf(elem), 0, prev); + } + if (elem.prev) { + elem.prev.next = prev; + } + prev.parent = parent; + prev.prev = elem.prev; + prev.next = elem; + elem.prev = prev; + } + exports2.prepend = prepend; + } +}); + +// node_modules/domutils/lib/querying.js +var require_querying = __commonJS({ + "node_modules/domutils/lib/querying.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.findAll = exports2.existsOne = exports2.findOne = exports2.findOneChild = exports2.find = exports2.filter = void 0; + var domhandler_1 = require_lib3(); + function filter(test, node, recurse, limit) { + if (recurse === void 0) { + recurse = true; + } + if (limit === void 0) { + limit = Infinity; + } + if (!Array.isArray(node)) + node = [node]; + return find(test, node, recurse, limit); + } + exports2.filter = filter; + function find(test, nodes, recurse, limit) { + var result = []; + for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) { + var elem = nodes_1[_i]; + if (test(elem)) { + result.push(elem); + if (--limit <= 0) + break; } - return function() { - return false; - }; - }(); - var fireGlobalEvent = function() { - if (util.isNode) { - return function() { - return process.emit.apply(process, arguments); - }; - } else { - if (!util.global) { - return function() { - return false; - }; - } - return function(name) { - var methodName = "on" + name.toLowerCase(); - var method = util.global[methodName]; - if (!method) - return false; - method.apply(util.global, [].slice.call(arguments, 1)); - return true; - }; + if (recurse && domhandler_1.hasChildren(elem) && elem.children.length > 0) { + var children = find(test, elem.children, recurse, limit); + result.push.apply(result, children); + limit -= children.length; + if (limit <= 0) + break; } - }(); - function generatePromiseLifecycleEventObject(name, promise) { - return { promise }; - } - var eventToObjectGenerator = { - promiseCreated: generatePromiseLifecycleEventObject, - promiseFulfilled: generatePromiseLifecycleEventObject, - promiseRejected: generatePromiseLifecycleEventObject, - promiseResolved: generatePromiseLifecycleEventObject, - promiseCancelled: generatePromiseLifecycleEventObject, - promiseChained: function(name, promise, child) { - return { promise, child }; - }, - warning: function(name, warning) { - return { warning }; - }, - unhandledRejection: function(name, reason, promise) { - return { reason, promise }; - }, - rejectionHandled: generatePromiseLifecycleEventObject - }; - var activeFireEvent = function(name) { - var globalEventFired = false; - try { - globalEventFired = fireGlobalEvent.apply(null, arguments); - } catch (e) { - async.throwLater(e); - globalEventFired = true; + } + return result; + } + exports2.find = find; + function findOneChild(test, nodes) { + return nodes.find(test); + } + exports2.findOneChild = findOneChild; + function findOne(test, nodes, recurse) { + if (recurse === void 0) { + recurse = true; + } + var elem = null; + for (var i = 0; i < nodes.length && !elem; i++) { + var checked = nodes[i]; + if (!domhandler_1.isTag(checked)) { + continue; + } else if (test(checked)) { + elem = checked; + } else if (recurse && checked.children.length > 0) { + elem = findOne(test, checked.children); } - var domEventFired = false; - try { - domEventFired = fireDomEvent(name, eventToObjectGenerator[name].apply(null, arguments)); - } catch (e) { - async.throwLater(e); - domEventFired = true; + } + return elem; + } + exports2.findOne = findOne; + function existsOne(test, nodes) { + return nodes.some(function(checked) { + return domhandler_1.isTag(checked) && (test(checked) || checked.children.length > 0 && existsOne(test, checked.children)); + }); + } + exports2.existsOne = existsOne; + function findAll(test, nodes) { + var _a; + var result = []; + var stack = nodes.filter(domhandler_1.isTag); + var elem; + while (elem = stack.shift()) { + var children = (_a = elem.children) === null || _a === void 0 ? void 0 : _a.filter(domhandler_1.isTag); + if (children && children.length > 0) { + stack.unshift.apply(stack, children); } - return domEventFired || globalEventFired; - }; - Promise2.config = function(opts) { - opts = Object(opts); - if ("longStackTraces" in opts) { - if (opts.longStackTraces) { - Promise2.longStackTraces(); - } else if (!opts.longStackTraces && Promise2.hasLongStackTraces()) { - disableLongStackTraces(); - } - } - if ("warnings" in opts) { - var warningsOption = opts.warnings; - config.warnings = !!warningsOption; - wForgottenReturn = config.warnings; - if (util.isObject(warningsOption)) { - if ("wForgottenReturn" in warningsOption) { - wForgottenReturn = !!warningsOption.wForgottenReturn; - } - } + if (test(elem)) + result.push(elem); + } + return result; + } + exports2.findAll = findAll; + } +}); + +// node_modules/domutils/lib/legacy.js +var require_legacy2 = __commonJS({ + "node_modules/domutils/lib/legacy.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getElementsByTagType = exports2.getElementsByTagName = exports2.getElementById = exports2.getElements = exports2.testElement = void 0; + var domhandler_1 = require_lib3(); + var querying_1 = require_querying(); + var Checks = { + tag_name: function(name) { + if (typeof name === "function") { + return function(elem) { + return domhandler_1.isTag(elem) && name(elem.name); + }; + } else if (name === "*") { + return domhandler_1.isTag; } - if ("cancellation" in opts && opts.cancellation && !config.cancellation) { - if (async.haveItemsQueued()) { - throw new Error("cannot enable cancellation after promises are in use"); - } - Promise2.prototype._clearCancellationData = cancellationClearCancellationData; - Promise2.prototype._propagateFrom = cancellationPropagateFrom; - Promise2.prototype._onCancel = cancellationOnCancel; - Promise2.prototype._setOnCancel = cancellationSetOnCancel; - Promise2.prototype._attachCancellationCallback = cancellationAttachCancellationCallback; - Promise2.prototype._execute = cancellationExecute; - propagateFromFunction = cancellationPropagateFrom; - config.cancellation = true; - } - if ("monitoring" in opts) { - if (opts.monitoring && !config.monitoring) { - config.monitoring = true; - Promise2.prototype._fireEvent = activeFireEvent; - } else if (!opts.monitoring && config.monitoring) { - config.monitoring = false; - Promise2.prototype._fireEvent = defaultFireEvent; - } - } - if ("asyncHooks" in opts && util.nodeSupportsAsyncResource) { - var prev = config.asyncHooks; - var cur = !!opts.asyncHooks; - if (prev !== cur) { - config.asyncHooks = cur; - if (cur) { - enableAsyncHooks(); - } else { - disableAsyncHooks(); - } - } + return function(elem) { + return domhandler_1.isTag(elem) && elem.name === name; + }; + }, + tag_type: function(type) { + if (typeof type === "function") { + return function(elem) { + return type(elem.type); + }; } - return Promise2; - }; - function defaultFireEvent() { - return false; - } - Promise2.prototype._fireEvent = defaultFireEvent; - Promise2.prototype._execute = function(executor, resolve2, reject) { - try { - executor(resolve2, reject); - } catch (e) { - return e; + return function(elem) { + return elem.type === type; + }; + }, + tag_contains: function(data) { + if (typeof data === "function") { + return function(elem) { + return domhandler_1.isText(elem) && data(elem.data); + }; } + return function(elem) { + return domhandler_1.isText(elem) && elem.data === data; + }; + } + }; + function getAttribCheck(attrib, value) { + if (typeof value === "function") { + return function(elem) { + return domhandler_1.isTag(elem) && value(elem.attribs[attrib]); + }; + } + return function(elem) { + return domhandler_1.isTag(elem) && elem.attribs[attrib] === value; }; - Promise2.prototype._onCancel = function() { - }; - Promise2.prototype._setOnCancel = function(handler2) { - ; - }; - Promise2.prototype._attachCancellationCallback = function(onCancel) { - ; - }; - Promise2.prototype._captureStackTrace = function() { - }; - Promise2.prototype._attachExtraTrace = function() { - }; - Promise2.prototype._dereferenceTrace = function() { - }; - Promise2.prototype._clearCancellationData = function() { - }; - Promise2.prototype._propagateFrom = function(parent, flags) { - ; - ; + } + function combineFuncs(a, b) { + return function(elem) { + return a(elem) || b(elem); }; - function cancellationExecute(executor, resolve2, reject) { - var promise = this; - try { - executor(resolve2, reject, function(onCancel) { - if (typeof onCancel !== "function") { - throw new TypeError("onCancel must be a function, got: " + util.toString(onCancel)); - } - promise._attachCancellationCallback(onCancel); - }); - } catch (e) { - return e; - } + } + function compileTest(options2) { + var funcs = Object.keys(options2).map(function(key) { + var value = options2[key]; + return key in Checks ? Checks[key](value) : getAttribCheck(key, value); + }); + return funcs.length === 0 ? null : funcs.reduce(combineFuncs); + } + function testElement(options2, node) { + var test = compileTest(options2); + return test ? test(node) : true; + } + exports2.testElement = testElement; + function getElements(options2, nodes, recurse, limit) { + if (limit === void 0) { + limit = Infinity; } - function cancellationAttachCancellationCallback(onCancel) { - if (!this._isCancellable()) - return this; - var previousOnCancel = this._onCancel(); - if (previousOnCancel !== void 0) { - if (util.isArray(previousOnCancel)) { - previousOnCancel.push(onCancel); - } else { - this._setOnCancel([previousOnCancel, onCancel]); - } - } else { - this._setOnCancel(onCancel); - } + var test = compileTest(options2); + return test ? querying_1.filter(test, nodes, recurse, limit) : []; + } + exports2.getElements = getElements; + function getElementById(id, nodes, recurse) { + if (recurse === void 0) { + recurse = true; } - function cancellationOnCancel() { - return this._onCancelField; + if (!Array.isArray(nodes)) + nodes = [nodes]; + return querying_1.findOne(getAttribCheck("id", id), nodes, recurse); + } + exports2.getElementById = getElementById; + function getElementsByTagName(tagName, nodes, recurse, limit) { + if (recurse === void 0) { + recurse = true; } - function cancellationSetOnCancel(onCancel) { - this._onCancelField = onCancel; + if (limit === void 0) { + limit = Infinity; } - function cancellationClearCancellationData() { - this._cancellationParent = void 0; - this._onCancelField = void 0; + return querying_1.filter(Checks.tag_name(tagName), nodes, recurse, limit); + } + exports2.getElementsByTagName = getElementsByTagName; + function getElementsByTagType(type, nodes, recurse, limit) { + if (recurse === void 0) { + recurse = true; } - function cancellationPropagateFrom(parent, flags) { - if ((flags & 1) !== 0) { - this._cancellationParent = parent; - var branchesRemainingToCancel = parent._branchesRemainingToCancel; - if (branchesRemainingToCancel === void 0) { - branchesRemainingToCancel = 0; - } - parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; - } - if ((flags & 2) !== 0 && parent._isBound()) { - this._setBoundTo(parent._boundTo); - } + if (limit === void 0) { + limit = Infinity; } - function bindingPropagateFrom(parent, flags) { - if ((flags & 2) !== 0 && parent._isBound()) { - this._setBoundTo(parent._boundTo); + return querying_1.filter(Checks.tag_type(type), nodes, recurse, limit); + } + exports2.getElementsByTagType = getElementsByTagType; + } +}); + +// node_modules/domutils/lib/helpers.js +var require_helpers2 = __commonJS({ + "node_modules/domutils/lib/helpers.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.uniqueSort = exports2.compareDocumentPosition = exports2.removeSubsets = void 0; + var domhandler_1 = require_lib3(); + function removeSubsets(nodes) { + var idx = nodes.length; + while (--idx >= 0) { + var node = nodes[idx]; + if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) { + nodes.splice(idx, 1); + continue; } - } - var propagateFromFunction = bindingPropagateFrom; - function boundValueFunction() { - var ret2 = this._boundTo; - if (ret2 !== void 0) { - if (ret2 instanceof Promise2) { - if (ret2.isFulfilled()) { - return ret2.value(); - } else { - return void 0; - } + for (var ancestor = node.parent; ancestor; ancestor = ancestor.parent) { + if (nodes.includes(ancestor)) { + nodes.splice(idx, 1); + break; } } - return ret2; } - function longStackTracesCaptureStackTrace() { - this._trace = new CapturedTrace(this._peekContext()); + return nodes; + } + exports2.removeSubsets = removeSubsets; + function compareDocumentPosition(nodeA, nodeB) { + var aParents = []; + var bParents = []; + if (nodeA === nodeB) { + return 0; } - function longStackTracesAttachExtraTrace(error3, ignoreSelf) { - if (canAttachTrace2(error3)) { - var trace = this._trace; - if (trace !== void 0) { - if (ignoreSelf) - trace = trace._parent; - } - if (trace !== void 0) { - trace.attachExtraTrace(error3); - } else if (!error3.__stackCleaned__) { - var parsed = parseStackAndMessage(error3); - util.notEnumerableProp(error3, "stack", parsed.message + "\n" + parsed.stack.join("\n")); - util.notEnumerableProp(error3, "__stackCleaned__", true); - } - } + var current = domhandler_1.hasChildren(nodeA) ? nodeA : nodeA.parent; + while (current) { + aParents.unshift(current); + current = current.parent; } - function longStackTracesDereferenceTrace() { - this._trace = void 0; + current = domhandler_1.hasChildren(nodeB) ? nodeB : nodeB.parent; + while (current) { + bParents.unshift(current); + current = current.parent; } - function checkForgottenReturns(returnValue, promiseCreated, name, promise, parent) { - if (returnValue === void 0 && promiseCreated !== null && wForgottenReturn) { - if (parent !== void 0 && parent._returnedNonUndefined()) - return; - if ((promise._bitField & 65535) === 0) - return; - if (name) - name = name + " "; - var handlerLine = ""; - var creatorLine = ""; - if (promiseCreated._trace) { - var traceLines = promiseCreated._trace.stack.split("\n"); - var stack = cleanStack(traceLines); - for (var i = stack.length - 1; i >= 0; --i) { - var line = stack[i]; - if (!nodeFramePattern.test(line)) { - var lineMatches = line.match(parseLinePattern); - if (lineMatches) { - handlerLine = "at " + lineMatches[1] + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; - } - break; - } - } - if (stack.length > 0) { - var firstUserLine = stack[0]; - for (var i = 0; i < traceLines.length; ++i) { - if (traceLines[i] === firstUserLine) { - if (i > 0) { - creatorLine = "\n" + traceLines[i - 1]; - } - break; - } - } - } - } - var msg = "a promise was created in a " + name + "handler " + handlerLine + "but was not returned from it, see http://goo.gl/rRqMUw" + creatorLine; - promise._warn(msg, true, promiseCreated); - } + var maxIdx = Math.min(aParents.length, bParents.length); + var idx = 0; + while (idx < maxIdx && aParents[idx] === bParents[idx]) { + idx++; } - function deprecated(name, replacement) { - var message = name + " is deprecated and will be removed in a future version."; - if (replacement) - message += " Use " + replacement + " instead."; - return warn(message); + if (idx === 0) { + return 1; } - function warn(message, shouldUseOwnTrace, promise) { - if (!config.warnings) - return; - var warning = new Warning(message); - var ctx; - if (shouldUseOwnTrace) { - promise._attachExtraTrace(warning); - } else if (config.longStackTraces && (ctx = Promise2._peekContext())) { - ctx.attachExtraTrace(warning); - } else { - var parsed = parseStackAndMessage(warning); - warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); - } - if (!activeFireEvent("warning", warning)) { - formatAndLogError(warning, "", true); + var sharedParent = aParents[idx - 1]; + var siblings = sharedParent.children; + var aSibling = aParents[idx]; + var bSibling = bParents[idx]; + if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) { + if (sharedParent === nodeB) { + return 4 | 16; } + return 4; } - function reconstructStack(message, stacks) { - for (var i = 0; i < stacks.length - 1; ++i) { - stacks[i].push("From previous event:"); - stacks[i] = stacks[i].join("\n"); - } - if (i < stacks.length) { - stacks[i] = stacks[i].join("\n"); - } - return message + "\n" + stacks.join("\n"); + if (sharedParent === nodeA) { + return 2 | 8; } - function removeDuplicateOrEmptyJumps(stacks) { - for (var i = 0; i < stacks.length; ++i) { - if (stacks[i].length === 0 || i + 1 < stacks.length && stacks[i][0] === stacks[i + 1][0]) { - stacks.splice(i, 1); - i--; - } + return 2; + } + exports2.compareDocumentPosition = compareDocumentPosition; + function uniqueSort(nodes) { + nodes = nodes.filter(function(node, i, arr) { + return !arr.includes(node, i + 1); + }); + nodes.sort(function(a, b) { + var relative = compareDocumentPosition(a, b); + if (relative & 2) { + return -1; + } else if (relative & 4) { + return 1; } + return 0; + }); + return nodes; + } + exports2.uniqueSort = uniqueSort; + } +}); + +// node_modules/domutils/lib/index.js +var require_lib6 = __commonJS({ + "node_modules/domutils/lib/index.js"(exports2) { + init_shims(); + "use strict"; + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + o[k2] = m[k]; + }); + var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) + __createBinding(exports3, m, p); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hasChildren = exports2.isDocument = exports2.isComment = exports2.isText = exports2.isCDATA = exports2.isTag = void 0; + __exportStar(require_stringify3(), exports2); + __exportStar(require_traversal(), exports2); + __exportStar(require_manipulation(), exports2); + __exportStar(require_querying(), exports2); + __exportStar(require_legacy2(), exports2); + __exportStar(require_helpers2(), exports2); + var domhandler_1 = require_lib3(); + Object.defineProperty(exports2, "isTag", { enumerable: true, get: function() { + return domhandler_1.isTag; + } }); + Object.defineProperty(exports2, "isCDATA", { enumerable: true, get: function() { + return domhandler_1.isCDATA; + } }); + Object.defineProperty(exports2, "isText", { enumerable: true, get: function() { + return domhandler_1.isText; + } }); + Object.defineProperty(exports2, "isComment", { enumerable: true, get: function() { + return domhandler_1.isComment; + } }); + Object.defineProperty(exports2, "isDocument", { enumerable: true, get: function() { + return domhandler_1.isDocument; + } }); + Object.defineProperty(exports2, "hasChildren", { enumerable: true, get: function() { + return domhandler_1.hasChildren; + } }); + } +}); + +// node_modules/boolbase/index.js +var require_boolbase = __commonJS({ + "node_modules/boolbase/index.js"(exports2, module2) { + init_shims(); + module2.exports = { + trueFunc: function trueFunc() { + return true; + }, + falseFunc: function falseFunc() { + return false; } - function removeCommonRoots(stacks) { - var current = stacks[0]; - for (var i = 1; i < stacks.length; ++i) { - var prev = stacks[i]; - var currentLastIndex = current.length - 1; - var currentLastLine = current[currentLastIndex]; - var commonRootMeetPoint = -1; - for (var j = prev.length - 1; j >= 0; --j) { - if (prev[j] === currentLastLine) { - commonRootMeetPoint = j; - break; - } - } - for (var j = commonRootMeetPoint; j >= 0; --j) { - var line = prev[j]; - if (current[currentLastIndex] === line) { - current.pop(); - currentLastIndex--; - } else { + }; + } +}); + +// node_modules/css-select/lib/procedure.js +var require_procedure = __commonJS({ + "node_modules/css-select/lib/procedure.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isTraversal = exports2.procedure = void 0; + exports2.procedure = { + universal: 50, + tag: 30, + attribute: 1, + pseudo: 0, + "pseudo-element": 0, + descendant: -1, + child: -1, + parent: -1, + sibling: -1, + adjacent: -1, + _flexibleDescendant: -1 + }; + function isTraversal(t) { + return exports2.procedure[t.type] < 0; + } + exports2.isTraversal = isTraversal; + } +}); + +// node_modules/css-select/lib/sort.js +var require_sort = __commonJS({ + "node_modules/css-select/lib/sort.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var procedure_1 = require_procedure(); + var attributes = { + exists: 10, + equals: 8, + not: 7, + start: 6, + end: 6, + any: 5, + hyphen: 4, + element: 4 + }; + function sortByProcedure(arr) { + var procs = arr.map(getProcedure); + for (var i = 1; i < arr.length; i++) { + var procNew = procs[i]; + if (procNew < 0) + continue; + for (var j = i - 1; j >= 0 && procNew < procs[j]; j--) { + var token = arr[j + 1]; + arr[j + 1] = arr[j]; + arr[j] = token; + procs[j + 1] = procs[j]; + procs[j] = procNew; + } + } + } + exports2.default = sortByProcedure; + function getProcedure(token) { + var proc = procedure_1.procedure[token.type]; + if (token.type === "attribute") { + proc = attributes[token.action]; + if (proc === attributes.equals && token.name === "id") { + proc = 9; + } + if (token.ignoreCase) { + proc >>= 1; + } + } else if (token.type === "pseudo") { + if (!token.data) { + proc = 3; + } else if (token.name === "has" || token.name === "contains") { + proc = 0; + } else if (Array.isArray(token.data)) { + proc = 0; + for (var i = 0; i < token.data.length; i++) { + if (token.data[i].length !== 1) + continue; + var cur = getProcedure(token.data[i][0]); + if (cur === 0) { + proc = 0; break; } + if (cur > proc) + proc = cur; } - current = prev; - } - } - function cleanStack(stack) { - var ret2 = []; - for (var i = 0; i < stack.length; ++i) { - var line = stack[i]; - var isTraceLine = line === " (No stack trace)" || stackFramePattern.test(line); - var isInternalFrame = isTraceLine && shouldIgnore(line); - if (isTraceLine && !isInternalFrame) { - if (indentStackFrames && line.charAt(0) !== " ") { - line = " " + line; - } - ret2.push(line); - } + if (token.data.length > 1 && proc > 0) + proc -= 1; + } else { + proc = 1; } - return ret2; } - function stackFramesAsArray(error3) { - var stack = error3.stack.replace(/\s+$/g, "").split("\n"); - for (var i = 0; i < stack.length; ++i) { - var line = stack[i]; - if (line === " (No stack trace)" || stackFramePattern.test(line)) { - break; - } + return proc; + } + } +}); + +// node_modules/css-select/lib/attributes.js +var require_attributes = __commonJS({ + "node_modules/css-select/lib/attributes.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.attributeRules = void 0; + var boolbase_1 = require_boolbase(); + var reChars = /[-[\]{}()*+?.,\\^$|#\s]/g; + function escapeRegex(value) { + return value.replace(reChars, "\\$&"); + } + exports2.attributeRules = { + equals: function(next, data, _a) { + var adapter = _a.adapter; + var name = data.name; + var value = data.value; + if (data.ignoreCase) { + value = value.toLowerCase(); + return function(elem) { + var attr = adapter.getAttributeValue(elem, name); + return attr != null && attr.length === value.length && attr.toLowerCase() === value && next(elem); + }; } - if (i > 0 && error3.name != "SyntaxError") { - stack = stack.slice(i); + return function(elem) { + return adapter.getAttributeValue(elem, name) === value && next(elem); + }; + }, + hyphen: function(next, data, _a) { + var adapter = _a.adapter; + var name = data.name; + var value = data.value; + var len = value.length; + if (data.ignoreCase) { + value = value.toLowerCase(); + return function hyphenIC(elem) { + var attr = adapter.getAttributeValue(elem, name); + return attr != null && (attr.length === len || attr.charAt(len) === "-") && attr.substr(0, len).toLowerCase() === value && next(elem); + }; } - return stack; - } - function parseStackAndMessage(error3) { - var stack = error3.stack; - var message = error3.toString(); - stack = typeof stack === "string" && stack.length > 0 ? stackFramesAsArray(error3) : [" (No stack trace)"]; - return { - message, - stack: error3.name == "SyntaxError" ? stack : cleanStack(stack) + return function hyphen(elem) { + var attr = adapter.getAttributeValue(elem, name); + return attr != null && (attr.length === len || attr.charAt(len) === "-") && attr.substr(0, len) === value && next(elem); }; - } - function formatAndLogError(error3, title, isSoft) { - if (typeof console !== "undefined") { - var message; - if (util.isObject(error3)) { - var stack = error3.stack; - message = title + formatStack(stack, error3); - } else { - message = title + String(error3); - } - if (typeof printWarning === "function") { - printWarning(message, isSoft); - } else if (typeof console.log === "function" || typeof console.log === "object") { - console.log(message); - } + }, + element: function(next, _a, _b) { + var name = _a.name, value = _a.value, ignoreCase = _a.ignoreCase; + var adapter = _b.adapter; + if (/\s/.test(value)) { + return boolbase_1.falseFunc; + } + var regex = new RegExp("(?:^|\\s)" + escapeRegex(value) + "(?:$|\\s)", ignoreCase ? "i" : ""); + return function element(elem) { + var attr = adapter.getAttributeValue(elem, name); + return attr != null && attr.length >= value.length && regex.test(attr) && next(elem); + }; + }, + exists: function(next, _a, _b) { + var name = _a.name; + var adapter = _b.adapter; + return function(elem) { + return adapter.hasAttrib(elem, name) && next(elem); + }; + }, + start: function(next, data, _a) { + var adapter = _a.adapter; + var name = data.name; + var value = data.value; + var len = value.length; + if (len === 0) { + return boolbase_1.falseFunc; } - } - function fireRejectionEvent(name, localHandler, reason, promise) { - var localEventFired = false; - try { - if (typeof localHandler === "function") { - localEventFired = true; - if (name === "rejectionHandled") { - localHandler(promise); - } else { - localHandler(reason, promise); - } - } - } catch (e) { - async.throwLater(e); + if (data.ignoreCase) { + value = value.toLowerCase(); + return function(elem) { + var attr = adapter.getAttributeValue(elem, name); + return attr != null && attr.length >= len && attr.substr(0, len).toLowerCase() === value && next(elem); + }; } - if (name === "unhandledRejection") { - if (!activeFireEvent(name, reason, promise) && !localEventFired) { - formatAndLogError(reason, "Unhandled rejection "); - } - } else { - activeFireEvent(name, promise); - } - } - function formatNonError(obj) { - var str; - if (typeof obj === "function") { - str = "[function " + (obj.name || "anonymous") + "]"; - } else { - str = obj && typeof obj.toString === "function" ? obj.toString() : util.toString(obj); - var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; - if (ruselessToString.test(str)) { - try { - var newStr = JSON.stringify(obj); - str = newStr; - } catch (e) { - } - } - if (str.length === 0) { - str = "(empty array)"; - } - } - return "(<" + snip(str) + ">, no stack trace)"; - } - function snip(str) { - var maxChars = 41; - if (str.length < maxChars) { - return str; - } - return str.substr(0, maxChars - 3) + "..."; - } - function longStackTracesIsSupported() { - return typeof captureStackTrace === "function"; - } - var shouldIgnore = function() { - return false; - }; - var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; - function parseLineInfo(line) { - var matches = line.match(parseLineInfoRegex); - if (matches) { - return { - fileName: matches[1], - line: parseInt(matches[2], 10) - }; - } - } - function setBounds(firstLineError, lastLineError) { - if (!longStackTracesIsSupported()) - return; - var firstStackLines = (firstLineError.stack || "").split("\n"); - var lastStackLines = (lastLineError.stack || "").split("\n"); - var firstIndex = -1; - var lastIndex = -1; - var firstFileName; - var lastFileName; - for (var i = 0; i < firstStackLines.length; ++i) { - var result = parseLineInfo(firstStackLines[i]); - if (result) { - firstFileName = result.fileName; - firstIndex = result.line; - break; - } - } - for (var i = 0; i < lastStackLines.length; ++i) { - var result = parseLineInfo(lastStackLines[i]); - if (result) { - lastFileName = result.fileName; - lastIndex = result.line; - break; - } - } - if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || firstFileName !== lastFileName || firstIndex >= lastIndex) { - return; - } - shouldIgnore = function(line) { - if (bluebirdFramePattern.test(line)) - return true; - var info = parseLineInfo(line); - if (info) { - if (info.fileName === firstFileName && (firstIndex <= info.line && info.line <= lastIndex)) { - return true; - } - } - return false; - }; - } - function CapturedTrace(parent) { - this._parent = parent; - this._promisesCreated = 0; - var length = this._length = 1 + (parent === void 0 ? 0 : parent._length); - captureStackTrace(this, CapturedTrace); - if (length > 32) - this.uncycle(); - } - util.inherits(CapturedTrace, Error); - Context.CapturedTrace = CapturedTrace; - CapturedTrace.prototype.uncycle = function() { - var length = this._length; - if (length < 2) - return; - var nodes = []; - var stackToIndex = {}; - for (var i = 0, node = this; node !== void 0; ++i) { - nodes.push(node); - node = node._parent; - } - length = this._length = i; - for (var i = length - 1; i >= 0; --i) { - var stack = nodes[i].stack; - if (stackToIndex[stack] === void 0) { - stackToIndex[stack] = i; - } - } - for (var i = 0; i < length; ++i) { - var currentStack = nodes[i].stack; - var index2 = stackToIndex[currentStack]; - if (index2 !== void 0 && index2 !== i) { - if (index2 > 0) { - nodes[index2 - 1]._parent = void 0; - nodes[index2 - 1]._length = 1; - } - nodes[i]._parent = void 0; - nodes[i]._length = 1; - var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; - if (index2 < length - 1) { - cycleEdgeNode._parent = nodes[index2 + 1]; - cycleEdgeNode._parent.uncycle(); - cycleEdgeNode._length = cycleEdgeNode._parent._length + 1; - } else { - cycleEdgeNode._parent = void 0; - cycleEdgeNode._length = 1; - } - var currentChildLength = cycleEdgeNode._length + 1; - for (var j = i - 2; j >= 0; --j) { - nodes[j]._length = currentChildLength; - currentChildLength++; - } - return; - } - } - }; - CapturedTrace.prototype.attachExtraTrace = function(error3) { - if (error3.__stackCleaned__) - return; - this.uncycle(); - var parsed = parseStackAndMessage(error3); - var message = parsed.message; - var stacks = [parsed.stack]; - var trace = this; - while (trace !== void 0) { - stacks.push(cleanStack(trace.stack.split("\n"))); - trace = trace._parent; - } - removeCommonRoots(stacks); - removeDuplicateOrEmptyJumps(stacks); - util.notEnumerableProp(error3, "stack", reconstructStack(message, stacks)); - util.notEnumerableProp(error3, "__stackCleaned__", true); - }; - var captureStackTrace = function stackDetection() { - var v8stackFramePattern = /^\s*at\s*/; - var v8stackFormatter = function(stack, error3) { - if (typeof stack === "string") - return stack; - if (error3.name !== void 0 && error3.message !== void 0) { - return error3.toString(); - } - return formatNonError(error3); + return function(elem) { + var _a2; + return !!((_a2 = adapter.getAttributeValue(elem, name)) === null || _a2 === void 0 ? void 0 : _a2.startsWith(value)) && next(elem); }; - if (typeof Error.stackTraceLimit === "number" && typeof Error.captureStackTrace === "function") { - Error.stackTraceLimit += 6; - stackFramePattern = v8stackFramePattern; - formatStack = v8stackFormatter; - var captureStackTrace2 = Error.captureStackTrace; - shouldIgnore = function(line) { - return bluebirdFramePattern.test(line); - }; - return function(receiver, ignoreUntil) { - Error.stackTraceLimit += 6; - captureStackTrace2(receiver, ignoreUntil); - Error.stackTraceLimit -= 6; - }; + }, + end: function(next, data, _a) { + var adapter = _a.adapter; + var name = data.name; + var value = data.value; + var len = -value.length; + if (len === 0) { + return boolbase_1.falseFunc; } - var err = new Error(); - if (typeof err.stack === "string" && err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { - stackFramePattern = /@/; - formatStack = v8stackFormatter; - indentStackFrames = true; - return function captureStackTrace3(o) { - o.stack = new Error().stack; + if (data.ignoreCase) { + value = value.toLowerCase(); + return function(elem) { + var _a2; + return ((_a2 = adapter.getAttributeValue(elem, name)) === null || _a2 === void 0 ? void 0 : _a2.substr(len).toLowerCase()) === value && next(elem); }; } - var hasStackAfterThrow; - try { - throw new Error(); - } catch (e) { - hasStackAfterThrow = "stack" in e; - } - if (!("stack" in err) && hasStackAfterThrow && typeof Error.stackTraceLimit === "number") { - stackFramePattern = v8stackFramePattern; - formatStack = v8stackFormatter; - return function captureStackTrace3(o) { - Error.stackTraceLimit += 6; - try { - throw new Error(); - } catch (e) { - o.stack = e.stack; - } - Error.stackTraceLimit -= 6; + return function(elem) { + var _a2; + return !!((_a2 = adapter.getAttributeValue(elem, name)) === null || _a2 === void 0 ? void 0 : _a2.endsWith(value)) && next(elem); + }; + }, + any: function(next, data, _a) { + var adapter = _a.adapter; + var name = data.name, value = data.value; + if (value === "") { + return boolbase_1.falseFunc; + } + if (data.ignoreCase) { + var regex_1 = new RegExp(escapeRegex(value), "i"); + return function anyIC(elem) { + var attr = adapter.getAttributeValue(elem, name); + return attr != null && attr.length >= value.length && regex_1.test(attr) && next(elem); }; } - formatStack = function(stack, error3) { - if (typeof stack === "string") - return stack; - if ((typeof error3 === "object" || typeof error3 === "function") && error3.name !== void 0 && error3.message !== void 0) { - return error3.toString(); - } - return formatNonError(error3); - }; - return null; - }([]); - if (typeof console !== "undefined" && typeof console.warn !== "undefined") { - printWarning = function(message) { - console.warn(message); + return function(elem) { + var _a2; + return !!((_a2 = adapter.getAttributeValue(elem, name)) === null || _a2 === void 0 ? void 0 : _a2.includes(value)) && next(elem); }; - if (util.isNode && process.stderr.isTTY) { - printWarning = function(message, isSoft) { - var color = isSoft ? "" : ""; - console.warn(color + message + "\n"); + }, + not: function(next, data, _a) { + var adapter = _a.adapter; + var name = data.name; + var value = data.value; + if (value === "") { + return function(elem) { + return !!adapter.getAttributeValue(elem, name) && next(elem); }; - } else if (!util.isNode && typeof new Error().stack === "string") { - printWarning = function(message, isSoft) { - console.warn("%c" + message, isSoft ? "color: darkorange" : "color: red"); + } else if (data.ignoreCase) { + value = value.toLowerCase(); + return function(elem) { + var attr = adapter.getAttributeValue(elem, name); + return (attr == null || attr.length !== value.length || attr.toLowerCase() !== value) && next(elem); }; } - } - var config = { - warnings, - longStackTraces: false, - cancellation: false, - monitoring: false, - asyncHooks: false - }; - if (longStackTraces) - Promise2.longStackTraces(); - return { - asyncHooks: function() { - return config.asyncHooks; - }, - longStackTraces: function() { - return config.longStackTraces; - }, - warnings: function() { - return config.warnings; - }, - cancellation: function() { - return config.cancellation; - }, - monitoring: function() { - return config.monitoring; - }, - propagateFromFunction: function() { - return propagateFromFunction; - }, - boundValueFunction: function() { - return boundValueFunction; - }, - checkForgottenReturns, - setBounds, - warn, - deprecated, - CapturedTrace, - fireDomEvent, - fireGlobalEvent - }; - }; - } -}); - -// node_modules/bluebird/js/release/catch_filter.js -var require_catch_filter = __commonJS({ - "node_modules/bluebird/js/release/catch_filter.js"(exports2, module2) { - init_shims(); - "use strict"; - module2.exports = function(NEXT_FILTER) { - var util = require_util(); - var getKeys = require_es5().keys; - var tryCatch2 = util.tryCatch; - var errorObj2 = util.errorObj; - function catchFilter(instances, cb, promise) { - return function(e) { - var boundTo = promise._boundValue(); - predicateLoop: - for (var i = 0; i < instances.length; ++i) { - var item = instances[i]; - if (item === Error || item != null && item.prototype instanceof Error) { - if (e instanceof item) { - return tryCatch2(cb).call(boundTo, e); - } - } else if (typeof item === "function") { - var matchesPredicate = tryCatch2(item).call(boundTo, e); - if (matchesPredicate === errorObj2) { - return matchesPredicate; - } else if (matchesPredicate) { - return tryCatch2(cb).call(boundTo, e); - } - } else if (util.isObject(e)) { - var keys = getKeys(item); - for (var j = 0; j < keys.length; ++j) { - var key = keys[j]; - if (item[key] != e[key]) { - continue predicateLoop; - } - } - return tryCatch2(cb).call(boundTo, e); - } - } - return NEXT_FILTER; + return function(elem) { + return adapter.getAttributeValue(elem, name) !== value && next(elem); }; } - return catchFilter; }; } }); -// node_modules/bluebird/js/release/finally.js -var require_finally = __commonJS({ - "node_modules/bluebird/js/release/finally.js"(exports2, module2) { +// node_modules/nth-check/lib/parse.js +var require_parse3 = __commonJS({ + "node_modules/nth-check/lib/parse.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2, tryConvertToPromise, NEXT_FILTER) { - var util = require_util(); - var CancellationError = Promise2.CancellationError; - var errorObj2 = util.errorObj; - var catchFilter = require_catch_filter()(NEXT_FILTER); - function PassThroughHandlerContext(promise, type, handler2) { - this.promise = promise; - this.type = type; - this.handler = handler2; - this.called = false; - this.cancelPromise = null; - } - PassThroughHandlerContext.prototype.isFinallyHandler = function() { - return this.type === 0; - }; - function FinallyHandlerCancelReaction(finallyHandler2) { - this.finallyHandler = finallyHandler2; - } - FinallyHandlerCancelReaction.prototype._resultCancelled = function() { - checkCancel(this.finallyHandler); - }; - function checkCancel(ctx, reason) { - if (ctx.cancelPromise != null) { - if (arguments.length > 1) { - ctx.cancelPromise._reject(reason); - } else { - ctx.cancelPromise._cancel(); - } - ctx.cancelPromise = null; - return true; - } - return false; - } - function succeed() { - return finallyHandler.call(this, this.promise._target()._settledValue()); - } - function fail(reason) { - if (checkCancel(this, reason)) - return; - errorObj2.e = reason; - return errorObj2; - } - function finallyHandler(reasonOrValue) { - var promise = this.promise; - var handler2 = this.handler; - if (!this.called) { - this.called = true; - var ret2 = this.isFinallyHandler() ? handler2.call(promise._boundValue()) : handler2.call(promise._boundValue(), reasonOrValue); - if (ret2 === NEXT_FILTER) { - return ret2; - } else if (ret2 !== void 0) { - promise._setReturnedNonUndefined(); - var maybePromise = tryConvertToPromise(ret2, promise); - if (maybePromise instanceof Promise2) { - if (this.cancelPromise != null) { - if (maybePromise._isCancelled()) { - var reason = new CancellationError("late cancellation observer"); - promise._attachExtraTrace(reason); - errorObj2.e = reason; - return errorObj2; - } else if (maybePromise.isPending()) { - maybePromise._attachCancellationCallback(new FinallyHandlerCancelReaction(this)); - } - } - return maybePromise._then(succeed, fail, void 0, this, void 0); - } - } - } - if (promise.isRejected()) { - checkCancel(this); - errorObj2.e = reasonOrValue; - return errorObj2; - } else { - checkCancel(this); - return reasonOrValue; - } - } - Promise2.prototype._passThrough = function(handler2, type, success, fail2) { - if (typeof handler2 !== "function") - return this.then(); - return this._then(success, fail2, void 0, new PassThroughHandlerContext(this, type, handler2), void 0); - }; - Promise2.prototype.lastly = Promise2.prototype["finally"] = function(handler2) { - return this._passThrough(handler2, 0, finallyHandler, finallyHandler); - }; - Promise2.prototype.tap = function(handler2) { - return this._passThrough(handler2, 1, finallyHandler); - }; - Promise2.prototype.tapCatch = function(handlerOrPredicate) { - var len = arguments.length; - if (len === 1) { - return this._passThrough(handlerOrPredicate, 1, void 0, finallyHandler); - } else { - var catchInstances = new Array(len - 1), j = 0, i; - for (i = 0; i < len - 1; ++i) { - var item = arguments[i]; - if (util.isObject(item)) { - catchInstances[j++] = item; - } else { - return Promise2.reject(new TypeError("tapCatch statement predicate: expecting an object but got " + util.classString(item))); - } - } - catchInstances.length = j; - var handler2 = arguments[i]; - return this._passThrough(catchFilter(catchInstances, handler2, this), 1, void 0, finallyHandler); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.parse = void 0; + var RE_NTH_ELEMENT = /^([+-]?\d*n)?\s*(?:([+-]?)\s*(\d+))?$/; + function parse(formula) { + formula = formula.trim().toLowerCase(); + if (formula === "even") { + return [2, 0]; + } else if (formula === "odd") { + return [2, 1]; + } + var parsed = formula.match(RE_NTH_ELEMENT); + if (!parsed) { + throw new Error("n-th rule couldn't be parsed ('" + formula + "')"); + } + var a; + if (parsed[1]) { + a = parseInt(parsed[1], 10); + if (isNaN(a)) { + a = parsed[1].startsWith("-") ? -1 : 1; } - }; - return PassThroughHandlerContext; - }; + } else + a = 0; + var b = (parsed[2] === "-" ? -1 : 1) * (parsed[3] ? parseInt(parsed[3], 10) : 0); + return [a, b]; + } + exports2.parse = parse; } }); -// node_modules/bluebird/js/release/nodeback.js -var require_nodeback = __commonJS({ - "node_modules/bluebird/js/release/nodeback.js"(exports2, module2) { +// node_modules/nth-check/lib/compile.js +var require_compile = __commonJS({ + "node_modules/nth-check/lib/compile.js"(exports2) { init_shims(); "use strict"; - var util = require_util(); - var maybeWrapAsError2 = util.maybeWrapAsError; - var errors = require_errors(); - var OperationalError = errors.OperationalError; - var es52 = require_es5(); - function isUntypedError(obj) { - return obj instanceof Error && es52.getPrototypeOf(obj) === Error.prototype; - } - var rErrorKey = /^(?:name|message|stack|cause)$/; - function wrapAsOperationalError(obj) { - var ret2; - if (isUntypedError(obj)) { - ret2 = new OperationalError(obj); - ret2.name = obj.name; - ret2.message = obj.message; - ret2.stack = obj.stack; - var keys = es52.keys(obj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (!rErrorKey.test(key)) { - ret2[key] = obj[key]; - } - } - return ret2; - } - util.markAsOriginatingFromRejection(obj); - return obj; - } - function nodebackForPromise(promise, multiArgs) { - return function(err, value) { - if (promise === null) - return; - if (err) { - var wrapped = wrapAsOperationalError(maybeWrapAsError2(err)); - promise._attachExtraTrace(wrapped); - promise._reject(wrapped); - } else if (!multiArgs) { - promise._fulfill(value); - } else { - var $_len = arguments.length; - var args = new Array(Math.max($_len - 1, 0)); - for (var $_i = 1; $_i < $_len; ++$_i) { - args[$_i - 1] = arguments[$_i]; - } - ; - promise._fulfill(args); - } - promise = null; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.compile = void 0; + var boolbase_1 = require_boolbase(); + function compile(parsed) { + var a = parsed[0]; + var b = parsed[1] - 1; + if (b < 0 && a <= 0) + return boolbase_1.falseFunc; + if (a === -1) + return function(index2) { + return index2 <= b; + }; + if (a === 0) + return function(index2) { + return index2 === b; + }; + if (a === 1) + return b < 0 ? boolbase_1.trueFunc : function(index2) { + return index2 >= b; + }; + var absA = Math.abs(a); + var bMod = (b % absA + absA) % absA; + return a > 1 ? function(index2) { + return index2 >= b && index2 % absA === bMod; + } : function(index2) { + return index2 <= b && index2 % absA === bMod; }; } - module2.exports = nodebackForPromise; + exports2.compile = compile; } }); -// node_modules/bluebird/js/release/method.js -var require_method = __commonJS({ - "node_modules/bluebird/js/release/method.js"(exports2, module2) { +// node_modules/nth-check/lib/index.js +var require_lib7 = __commonJS({ + "node_modules/nth-check/lib/index.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, apiRejection, debug) { - var util = require_util(); - var tryCatch2 = util.tryCatch; - Promise2.method = function(fn) { - if (typeof fn !== "function") { - throw new Promise2.TypeError("expecting a function but got " + util.classString(fn)); - } - return function() { - var ret2 = new Promise2(INTERNAL); - ret2._captureStackTrace(); - ret2._pushContext(); - var value = tryCatch2(fn).apply(this, arguments); - var promiseCreated = ret2._popContext(); - debug.checkForgottenReturns(value, promiseCreated, "Promise.method", ret2); - ret2._resolveFromSyncValue(value); - return ret2; - }; - }; - Promise2.attempt = Promise2["try"] = function(fn) { - if (typeof fn !== "function") { - return apiRejection("expecting a function but got " + util.classString(fn)); - } - var ret2 = new Promise2(INTERNAL); - ret2._captureStackTrace(); - ret2._pushContext(); - var value; - if (arguments.length > 1) { - debug.deprecated("calling Promise.try with more than 1 argument"); - var arg = arguments[1]; - var ctx = arguments[2]; - value = util.isArray(arg) ? tryCatch2(fn).apply(ctx, arg) : tryCatch2(fn).call(ctx, arg); - } else { - value = tryCatch2(fn)(); - } - var promiseCreated = ret2._popContext(); - debug.checkForgottenReturns(value, promiseCreated, "Promise.try", ret2); - ret2._resolveFromSyncValue(value); - return ret2; - }; - Promise2.prototype._resolveFromSyncValue = function(value) { - if (value === util.errorObj) { - this._rejectCallback(value.e, false); - } else { - this._resolveCallback(value, true); - } - }; - }; - } -}); - -// node_modules/bluebird/js/release/bind.js -var require_bind = __commonJS({ - "node_modules/bluebird/js/release/bind.js"(exports2, module2) { + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.compile = exports2.parse = void 0; + var parse_1 = require_parse3(); + Object.defineProperty(exports2, "parse", { enumerable: true, get: function() { + return parse_1.parse; + } }); + var compile_1 = require_compile(); + Object.defineProperty(exports2, "compile", { enumerable: true, get: function() { + return compile_1.compile; + } }); + function nthCheck(formula) { + return compile_1.compile(parse_1.parse(formula)); + } + exports2.default = nthCheck; + } +}); + +// node_modules/css-select/lib/pseudo-selectors/filters.js +var require_filters = __commonJS({ + "node_modules/css-select/lib/pseudo-selectors/filters.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, debug) { - var calledBind = false; - var rejectThis = function(_, e) { - this._reject(e); - }; - var targetRejected = function(e, context) { - context.promiseRejectionQueued = true; - context.bindingPromise._then(rejectThis, rejectThis, null, this, e); - }; - var bindingResolved = function(thisArg, context) { - if ((this._bitField & 50397184) === 0) { - this._resolveCallback(context.target); - } - }; - var bindingRejected = function(e, context) { - if (!context.promiseRejectionQueued) - this._reject(e); - }; - Promise2.prototype.bind = function(thisArg) { - if (!calledBind) { - calledBind = true; - Promise2.prototype._propagateFrom = debug.propagateFromFunction(); - Promise2.prototype._boundValue = debug.boundValueFunction(); - } - var maybePromise = tryConvertToPromise(thisArg); - var ret2 = new Promise2(INTERNAL); - ret2._propagateFrom(this, 1); - var target = this._target(); - ret2._setBoundTo(maybePromise); - if (maybePromise instanceof Promise2) { - var context = { - promiseRejectionQueued: false, - promise: ret2, - target, - bindingPromise: maybePromise + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.filters = void 0; + var nth_check_1 = __importDefault(require_lib7()); + var boolbase_1 = require_boolbase(); + function getChildFunc(next, adapter) { + return function(elem) { + var parent = adapter.getParent(elem); + return parent != null && adapter.isTag(parent) && next(elem); + }; + } + exports2.filters = { + contains: function(next, text, _a) { + var adapter = _a.adapter; + return function contains(elem) { + return next(elem) && adapter.getText(elem).includes(text); + }; + }, + icontains: function(next, text, _a) { + var adapter = _a.adapter; + var itext = text.toLowerCase(); + return function icontains(elem) { + return next(elem) && adapter.getText(elem).toLowerCase().includes(itext); + }; + }, + "nth-child": function(next, rule, _a) { + var adapter = _a.adapter, equals = _a.equals; + var func = nth_check_1.default(rule); + if (func === boolbase_1.falseFunc) + return boolbase_1.falseFunc; + if (func === boolbase_1.trueFunc) + return getChildFunc(next, adapter); + return function nthChild(elem) { + var siblings = adapter.getSiblings(elem); + var pos = 0; + for (var i = 0; i < siblings.length; i++) { + if (equals(elem, siblings[i])) + break; + if (adapter.isTag(siblings[i])) { + pos++; + } + } + return func(pos) && next(elem); + }; + }, + "nth-last-child": function(next, rule, _a) { + var adapter = _a.adapter, equals = _a.equals; + var func = nth_check_1.default(rule); + if (func === boolbase_1.falseFunc) + return boolbase_1.falseFunc; + if (func === boolbase_1.trueFunc) + return getChildFunc(next, adapter); + return function nthLastChild(elem) { + var siblings = adapter.getSiblings(elem); + var pos = 0; + for (var i = siblings.length - 1; i >= 0; i--) { + if (equals(elem, siblings[i])) + break; + if (adapter.isTag(siblings[i])) { + pos++; + } + } + return func(pos) && next(elem); + }; + }, + "nth-of-type": function(next, rule, _a) { + var adapter = _a.adapter, equals = _a.equals; + var func = nth_check_1.default(rule); + if (func === boolbase_1.falseFunc) + return boolbase_1.falseFunc; + if (func === boolbase_1.trueFunc) + return getChildFunc(next, adapter); + return function nthOfType(elem) { + var siblings = adapter.getSiblings(elem); + var pos = 0; + for (var i = 0; i < siblings.length; i++) { + var currentSibling = siblings[i]; + if (equals(elem, currentSibling)) + break; + if (adapter.isTag(currentSibling) && adapter.getName(currentSibling) === adapter.getName(elem)) { + pos++; + } + } + return func(pos) && next(elem); + }; + }, + "nth-last-of-type": function(next, rule, _a) { + var adapter = _a.adapter, equals = _a.equals; + var func = nth_check_1.default(rule); + if (func === boolbase_1.falseFunc) + return boolbase_1.falseFunc; + if (func === boolbase_1.trueFunc) + return getChildFunc(next, adapter); + return function nthLastOfType(elem) { + var siblings = adapter.getSiblings(elem); + var pos = 0; + for (var i = siblings.length - 1; i >= 0; i--) { + var currentSibling = siblings[i]; + if (equals(elem, currentSibling)) + break; + if (adapter.isTag(currentSibling) && adapter.getName(currentSibling) === adapter.getName(elem)) { + pos++; + } + } + return func(pos) && next(elem); + }; + }, + root: function(next, _rule, _a) { + var adapter = _a.adapter; + return function(elem) { + var parent = adapter.getParent(elem); + return (parent == null || !adapter.isTag(parent)) && next(elem); + }; + }, + scope: function(next, rule, options2, context) { + var equals = options2.equals; + if (!context || context.length === 0) { + return exports2.filters.root(next, rule, options2); + } + if (context.length === 1) { + return function(elem) { + return equals(context[0], elem) && next(elem); }; - target._then(INTERNAL, targetRejected, void 0, ret2, context); - maybePromise._then(bindingResolved, bindingRejected, void 0, ret2, context); - ret2._setOnCancel(maybePromise); - } else { - ret2._resolveCallback(target); } - return ret2; - }; - Promise2.prototype._setBoundTo = function(obj) { - if (obj !== void 0) { - this._bitField = this._bitField | 2097152; - this._boundTo = obj; - } else { - this._bitField = this._bitField & ~2097152; - } - }; - Promise2.prototype._isBound = function() { - return (this._bitField & 2097152) === 2097152; - }; - Promise2.bind = function(thisArg, value) { - return Promise2.resolve(value).bind(thisArg); + return function(elem) { + return context.includes(elem) && next(elem); + }; + }, + hover: dynamicStatePseudo("isHovered"), + visited: dynamicStatePseudo("isVisited"), + active: dynamicStatePseudo("isActive") + }; + function dynamicStatePseudo(name) { + return function dynamicPseudo(next, _rule, _a) { + var adapter = _a.adapter; + var func = adapter[name]; + if (typeof func !== "function") { + return boolbase_1.falseFunc; + } + return function active(elem) { + return func(elem) && next(elem); + }; }; - }; + } } }); -// node_modules/bluebird/js/release/cancel.js -var require_cancel = __commonJS({ - "node_modules/bluebird/js/release/cancel.js"(exports2, module2) { +// node_modules/css-select/lib/pseudo-selectors/pseudos.js +var require_pseudos = __commonJS({ + "node_modules/css-select/lib/pseudo-selectors/pseudos.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2, PromiseArray, apiRejection, debug) { - var util = require_util(); - var tryCatch2 = util.tryCatch; - var errorObj2 = util.errorObj; - var async = Promise2._async; - Promise2.prototype["break"] = Promise2.prototype.cancel = function() { - if (!debug.cancellation()) - return this._warn("cancellation is disabled"); - var promise = this; - var child = promise; - while (promise._isCancellable()) { - if (!promise._cancelBy(child)) { - if (child._isFollowing()) { - child._followee().cancel(); - } else { - child._cancelBranched(); - } - break; - } - var parent = promise._cancellationParent; - if (parent == null || !parent._isCancellable()) { - if (promise._isFollowing()) { - promise._followee().cancel(); - } else { - promise._cancelBranched(); - } + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.verifyPseudoArgs = exports2.pseudos = void 0; + exports2.pseudos = { + empty: function(elem, _a) { + var adapter = _a.adapter; + return !adapter.getChildren(elem).some(function(elem2) { + return adapter.isTag(elem2) || adapter.getText(elem2) !== ""; + }); + }, + "first-child": function(elem, _a) { + var adapter = _a.adapter, equals = _a.equals; + var firstChild = adapter.getSiblings(elem).find(function(elem2) { + return adapter.isTag(elem2); + }); + return firstChild != null && equals(elem, firstChild); + }, + "last-child": function(elem, _a) { + var adapter = _a.adapter, equals = _a.equals; + var siblings = adapter.getSiblings(elem); + for (var i = siblings.length - 1; i >= 0; i--) { + if (equals(elem, siblings[i])) + return true; + if (adapter.isTag(siblings[i])) break; - } else { - if (promise._isFollowing()) - promise._followee().cancel(); - promise._setWillBeCancelled(); - child = promise; - promise = parent; - } } - }; - Promise2.prototype._branchHasCancelled = function() { - this._branchesRemainingToCancel--; - }; - Promise2.prototype._enoughBranchesHaveCancelled = function() { - return this._branchesRemainingToCancel === void 0 || this._branchesRemainingToCancel <= 0; - }; - Promise2.prototype._cancelBy = function(canceller) { - if (canceller === this) { - this._branchesRemainingToCancel = 0; - this._invokeOnCancel(); - return true; - } else { - this._branchHasCancelled(); - if (this._enoughBranchesHaveCancelled()) { - this._invokeOnCancel(); + return false; + }, + "first-of-type": function(elem, _a) { + var adapter = _a.adapter, equals = _a.equals; + var siblings = adapter.getSiblings(elem); + var elemName = adapter.getName(elem); + for (var i = 0; i < siblings.length; i++) { + var currentSibling = siblings[i]; + if (equals(elem, currentSibling)) return true; + if (adapter.isTag(currentSibling) && adapter.getName(currentSibling) === elemName) { + break; } } return false; - }; - Promise2.prototype._cancelBranched = function() { - if (this._enoughBranchesHaveCancelled()) { - this._cancel(); - } - }; - Promise2.prototype._cancel = function() { - if (!this._isCancellable()) - return; - this._setCancelled(); - async.invoke(this._cancelPromises, this, void 0); - }; - Promise2.prototype._cancelPromises = function() { - if (this._length() > 0) - this._settlePromises(); - }; - Promise2.prototype._unsetOnCancel = function() { - this._onCancelField = void 0; - }; - Promise2.prototype._isCancellable = function() { - return this.isPending() && !this._isCancelled(); - }; - Promise2.prototype.isCancellable = function() { - return this.isPending() && !this.isCancelled(); - }; - Promise2.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { - if (util.isArray(onCancelCallback)) { - for (var i = 0; i < onCancelCallback.length; ++i) { - this._doInvokeOnCancel(onCancelCallback[i], internalOnly); - } - } else if (onCancelCallback !== void 0) { - if (typeof onCancelCallback === "function") { - if (!internalOnly) { - var e = tryCatch2(onCancelCallback).call(this._boundValue()); - if (e === errorObj2) { - this._attachExtraTrace(e.e); - async.throwLater(e.e); - } - } - } else { - onCancelCallback._resultCancelled(this); + }, + "last-of-type": function(elem, _a) { + var adapter = _a.adapter, equals = _a.equals; + var siblings = adapter.getSiblings(elem); + var elemName = adapter.getName(elem); + for (var i = siblings.length - 1; i >= 0; i--) { + var currentSibling = siblings[i]; + if (equals(elem, currentSibling)) + return true; + if (adapter.isTag(currentSibling) && adapter.getName(currentSibling) === elemName) { + break; } } - }; - Promise2.prototype._invokeOnCancel = function() { - var onCancelCallback = this._onCancel(); - this._unsetOnCancel(); - async.invoke(this._doInvokeOnCancel, this, onCancelCallback); - }; - Promise2.prototype._invokeInternalOnCancel = function() { - if (this._isCancellable()) { - this._doInvokeOnCancel(this._onCancel(), true); - this._unsetOnCancel(); - } - }; - Promise2.prototype._resultCancelled = function() { - this.cancel(); - }; + return false; + }, + "only-of-type": function(elem, _a) { + var adapter = _a.adapter, equals = _a.equals; + var elemName = adapter.getName(elem); + return adapter.getSiblings(elem).every(function(sibling) { + return equals(elem, sibling) || !adapter.isTag(sibling) || adapter.getName(sibling) !== elemName; + }); + }, + "only-child": function(elem, _a) { + var adapter = _a.adapter, equals = _a.equals; + return adapter.getSiblings(elem).every(function(sibling) { + return equals(elem, sibling) || !adapter.isTag(sibling); + }); + } }; + function verifyPseudoArgs(func, name, subselect) { + if (subselect === null) { + if (func.length > 2) { + throw new Error("pseudo-selector :" + name + " requires an argument"); + } + } else if (func.length === 2) { + throw new Error("pseudo-selector :" + name + " doesn't have any arguments"); + } + } + exports2.verifyPseudoArgs = verifyPseudoArgs; } }); -// node_modules/bluebird/js/release/direct_resolve.js -var require_direct_resolve = __commonJS({ - "node_modules/bluebird/js/release/direct_resolve.js"(exports2, module2) { +// node_modules/css-select/lib/pseudo-selectors/aliases.js +var require_aliases = __commonJS({ + "node_modules/css-select/lib/pseudo-selectors/aliases.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2) { - function returner() { - return this.value; - } - function thrower2() { - throw this.reason; - } - Promise2.prototype["return"] = Promise2.prototype.thenReturn = function(value) { - if (value instanceof Promise2) - value.suppressUnhandledRejections(); - return this._then(returner, void 0, void 0, { value }, void 0); - }; - Promise2.prototype["throw"] = Promise2.prototype.thenThrow = function(reason) { - return this._then(thrower2, void 0, void 0, { reason }, void 0); - }; - Promise2.prototype.catchThrow = function(reason) { - if (arguments.length <= 1) { - return this._then(void 0, thrower2, void 0, { reason }, void 0); - } else { - var _reason = arguments[1]; - var handler2 = function() { - throw _reason; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.aliases = void 0; + exports2.aliases = { + "any-link": ":is(a, area, link)[href]", + link: ":any-link:not(:visited)", + disabled: ":is(\n :is(button, input, select, textarea, optgroup, option)[disabled],\n optgroup[disabled] > option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )", + enabled: ":not(:disabled)", + checked: ":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)", + required: ":is(input, select, textarea)[required]", + optional: ":is(input, select, textarea):not([required])", + selected: "option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)", + checkbox: "[type=checkbox]", + file: "[type=file]", + password: "[type=password]", + radio: "[type=radio]", + reset: "[type=reset]", + image: "[type=image]", + submit: "[type=submit]", + parent: ":not(:empty)", + header: ":is(h1, h2, h3, h4, h5, h6)", + button: ":is(button, input[type=button])", + input: ":is(input, textarea, select, button)", + text: "input:is(:not([type!='']), [type=text])" + }; + } +}); + +// node_modules/css-select/lib/pseudo-selectors/subselects.js +var require_subselects = __commonJS({ + "node_modules/css-select/lib/pseudo-selectors/subselects.js"(exports2) { + init_shims(); + "use strict"; + var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) { + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) + to[j] = from[i]; + return to; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.subselects = exports2.getNextSiblings = exports2.ensureIsTag = exports2.PLACEHOLDER_ELEMENT = void 0; + var boolbase_1 = require_boolbase(); + var procedure_1 = require_procedure(); + exports2.PLACEHOLDER_ELEMENT = {}; + function ensureIsTag(next, adapter) { + if (next === boolbase_1.falseFunc) + return boolbase_1.falseFunc; + return function(elem) { + return adapter.isTag(elem) && next(elem); + }; + } + exports2.ensureIsTag = ensureIsTag; + function getNextSiblings(elem, adapter) { + var siblings = adapter.getSiblings(elem); + if (siblings.length <= 1) + return []; + var elemIndex = siblings.indexOf(elem); + if (elemIndex < 0 || elemIndex === siblings.length - 1) + return []; + return siblings.slice(elemIndex + 1).filter(adapter.isTag); + } + exports2.getNextSiblings = getNextSiblings; + var is = function(next, token, options2, context, compileToken) { + var opts = { + xmlMode: !!options2.xmlMode, + adapter: options2.adapter, + equals: options2.equals + }; + var func = compileToken(token, opts, context); + return function(elem) { + return func(elem) && next(elem); + }; + }; + exports2.subselects = { + is, + matches: is, + not: function(next, token, options2, context, compileToken) { + var opts = { + xmlMode: !!options2.xmlMode, + adapter: options2.adapter, + equals: options2.equals + }; + var func = compileToken(token, opts, context); + if (func === boolbase_1.falseFunc) + return next; + if (func === boolbase_1.trueFunc) + return boolbase_1.falseFunc; + return function not(elem) { + return !func(elem) && next(elem); + }; + }, + has: function(next, subselect, options2, _context, compileToken) { + var adapter = options2.adapter; + var opts = { + xmlMode: !!options2.xmlMode, + adapter, + equals: options2.equals + }; + var context = subselect.some(function(s2) { + return s2.some(procedure_1.isTraversal); + }) ? [exports2.PLACEHOLDER_ELEMENT] : void 0; + var compiled = compileToken(subselect, opts, context); + if (compiled === boolbase_1.falseFunc) + return boolbase_1.falseFunc; + if (compiled === boolbase_1.trueFunc) { + return function(elem) { + return adapter.getChildren(elem).some(adapter.isTag) && next(elem); }; - return this.caught(reason, handler2); } - }; - Promise2.prototype.catchReturn = function(value) { - if (arguments.length <= 1) { - if (value instanceof Promise2) - value.suppressUnhandledRejections(); - return this._then(void 0, returner, void 0, { value }, void 0); - } else { - var _value = arguments[1]; - if (_value instanceof Promise2) - _value.suppressUnhandledRejections(); - var handler2 = function() { - return _value; + var hasElement = ensureIsTag(compiled, adapter); + var _a = compiled.shouldTestNextSiblings, shouldTestNextSiblings = _a === void 0 ? false : _a; + if (context) { + return function(elem) { + context[0] = elem; + var childs = adapter.getChildren(elem); + var nextElements = shouldTestNextSiblings ? __spreadArray(__spreadArray([], childs), getNextSiblings(elem, adapter)) : childs; + return next(elem) && adapter.existsOne(hasElement, nextElements); }; - return this.caught(value, handler2); } - }; + return function(elem) { + return next(elem) && adapter.existsOne(hasElement, adapter.getChildren(elem)); + }; + } }; } }); -// node_modules/bluebird/js/release/synchronous_inspection.js -var require_synchronous_inspection = __commonJS({ - "node_modules/bluebird/js/release/synchronous_inspection.js"(exports2, module2) { +// node_modules/css-select/lib/pseudo-selectors/index.js +var require_pseudo_selectors = __commonJS({ + "node_modules/css-select/lib/pseudo-selectors/index.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2) { - function PromiseInspection(promise) { - if (promise !== void 0) { - promise = promise._target(); - this._bitField = promise._bitField; - this._settledValueField = promise._isFateSealed() ? promise._settledValue() : void 0; - } else { - this._bitField = 0; - this._settledValueField = void 0; - } + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.compilePseudoSelector = exports2.aliases = exports2.pseudos = exports2.filters = void 0; + var boolbase_1 = require_boolbase(); + var css_what_1 = require_lib(); + var filters_1 = require_filters(); + Object.defineProperty(exports2, "filters", { enumerable: true, get: function() { + return filters_1.filters; + } }); + var pseudos_1 = require_pseudos(); + Object.defineProperty(exports2, "pseudos", { enumerable: true, get: function() { + return pseudos_1.pseudos; + } }); + var aliases_1 = require_aliases(); + Object.defineProperty(exports2, "aliases", { enumerable: true, get: function() { + return aliases_1.aliases; + } }); + var subselects_1 = require_subselects(); + function compilePseudoSelector(next, selector, options2, context, compileToken) { + var name = selector.name, data = selector.data; + if (Array.isArray(data)) { + return subselects_1.subselects[name](next, data, options2, context, compileToken); + } + if (name in aliases_1.aliases) { + if (data != null) { + throw new Error("Pseudo " + name + " doesn't have any arguments"); + } + var alias = css_what_1.parse(aliases_1.aliases[name], options2); + return subselects_1.subselects.is(next, alias, options2, context, compileToken); + } + if (name in filters_1.filters) { + return filters_1.filters[name](next, data, options2, context); + } + if (name in pseudos_1.pseudos) { + var pseudo_1 = pseudos_1.pseudos[name]; + pseudos_1.verifyPseudoArgs(pseudo_1, name, data); + return pseudo_1 === boolbase_1.falseFunc ? boolbase_1.falseFunc : next === boolbase_1.trueFunc ? function(elem) { + return pseudo_1(elem, options2, data); + } : function(elem) { + return pseudo_1(elem, options2, data) && next(elem); + }; } - PromiseInspection.prototype._settledValue = function() { - return this._settledValueField; - }; - var value = PromiseInspection.prototype.value = function() { - if (!this.isFulfilled()) { - throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n"); - } - return this._settledValue(); - }; - var reason = PromiseInspection.prototype.error = PromiseInspection.prototype.reason = function() { - if (!this.isRejected()) { - throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n"); - } - return this._settledValue(); - }; - var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { - return (this._bitField & 33554432) !== 0; - }; - var isRejected = PromiseInspection.prototype.isRejected = function() { - return (this._bitField & 16777216) !== 0; - }; - var isPending = PromiseInspection.prototype.isPending = function() { - return (this._bitField & 50397184) === 0; - }; - var isResolved = PromiseInspection.prototype.isResolved = function() { - return (this._bitField & 50331648) !== 0; - }; - PromiseInspection.prototype.isCancelled = function() { - return (this._bitField & 8454144) !== 0; - }; - Promise2.prototype.__isCancelled = function() { - return (this._bitField & 65536) === 65536; - }; - Promise2.prototype._isCancelled = function() { - return this._target().__isCancelled(); - }; - Promise2.prototype.isCancelled = function() { - return (this._target()._bitField & 8454144) !== 0; - }; - Promise2.prototype.isPending = function() { - return isPending.call(this._target()); - }; - Promise2.prototype.isRejected = function() { - return isRejected.call(this._target()); - }; - Promise2.prototype.isFulfilled = function() { - return isFulfilled.call(this._target()); - }; - Promise2.prototype.isResolved = function() { - return isResolved.call(this._target()); - }; - Promise2.prototype.value = function() { - return value.call(this._target()); - }; - Promise2.prototype.reason = function() { - var target = this._target(); - target._unsetRejectionIsUnhandled(); - return reason.call(target); - }; - Promise2.prototype._value = function() { - return this._settledValue(); - }; - Promise2.prototype._reason = function() { - this._unsetRejectionIsUnhandled(); - return this._settledValue(); - }; - Promise2.PromiseInspection = PromiseInspection; - }; + throw new Error("unmatched pseudo-class :" + name); + } + exports2.compilePseudoSelector = compilePseudoSelector; } }); -// node_modules/bluebird/js/release/join.js -var require_join = __commonJS({ - "node_modules/bluebird/js/release/join.js"(exports2, module2) { +// node_modules/css-select/lib/general.js +var require_general = __commonJS({ + "node_modules/css-select/lib/general.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2, PromiseArray, tryConvertToPromise, INTERNAL, async) { - var util = require_util(); - var canEvaluate2 = util.canEvaluate; - var tryCatch2 = util.tryCatch; - var errorObj2 = util.errorObj; - var reject; - if (true) { - if (canEvaluate2) { - var thenCallback = function(i2) { - return new Function("value", "holder", " \n 'use strict'; \n holder.pIndex = value; \n holder.checkFulfillment(this); \n ".replace(/Index/g, i2)); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.compileGeneralSelector = void 0; + var attributes_1 = require_attributes(); + var pseudo_selectors_1 = require_pseudo_selectors(); + function compileGeneralSelector(next, selector, options2, context, compileToken) { + var adapter = options2.adapter, equals = options2.equals; + switch (selector.type) { + case "pseudo-element": + throw new Error("Pseudo-elements are not supported by css-select"); + case "attribute": + return attributes_1.attributeRules[selector.action](next, selector, options2); + case "pseudo": + return pseudo_selectors_1.compilePseudoSelector(next, selector, options2, context, compileToken); + case "tag": + return function tag(elem) { + return adapter.getName(elem) === selector.name && next(elem); }; - var promiseSetter = function(i2) { - return new Function("promise", "holder", " \n 'use strict'; \n holder.pIndex = promise; \n ".replace(/Index/g, i2)); - }; - var generateHolderClass = function(total) { - var props = new Array(total); - for (var i2 = 0; i2 < props.length; ++i2) { - props[i2] = "this.p" + (i2 + 1); + case "descendant": + if (options2.cacheResults === false || typeof WeakSet === "undefined") { + return function descendant(elem) { + var current = elem; + while (current = adapter.getParent(current)) { + if (adapter.isTag(current) && next(current)) { + return true; + } + } + return false; + }; + } + var isFalseCache_1 = new WeakSet(); + return function cachedDescendant(elem) { + var current = elem; + while (current = adapter.getParent(current)) { + if (!isFalseCache_1.has(current)) { + if (adapter.isTag(current) && next(current)) { + return true; + } + isFalseCache_1.add(current); + } } - var assignment = props.join(" = ") + " = null;"; - var cancellationCode = "var promise;\n" + props.map(function(prop) { - return " \n promise = " + prop + "; \n if (promise instanceof Promise) { \n promise.cancel(); \n } \n "; - }).join("\n"); - var passedArguments = props.join(", "); - var name = "Holder$" + total; - var code = "return function(tryCatch, errorObj, Promise, async) { \n 'use strict'; \n function [TheName](fn) { \n [TheProperties] \n this.fn = fn; \n this.asyncNeeded = true; \n this.now = 0; \n } \n \n [TheName].prototype._callFunction = function(promise) { \n promise._pushContext(); \n var ret = tryCatch(this.fn)([ThePassedArguments]); \n promise._popContext(); \n if (ret === errorObj) { \n promise._rejectCallback(ret.e, false); \n } else { \n promise._resolveCallback(ret); \n } \n }; \n \n [TheName].prototype.checkFulfillment = function(promise) { \n var now = ++this.now; \n if (now === [TheTotal]) { \n if (this.asyncNeeded) { \n async.invoke(this._callFunction, this, promise); \n } else { \n this._callFunction(promise); \n } \n \n } \n }; \n \n [TheName].prototype._resultCancelled = function() { \n [CancellationCode] \n }; \n \n return [TheName]; \n }(tryCatch, errorObj, Promise, async); \n "; - code = code.replace(/\[TheName\]/g, name).replace(/\[TheTotal\]/g, total).replace(/\[ThePassedArguments\]/g, passedArguments).replace(/\[TheProperties\]/g, assignment).replace(/\[CancellationCode\]/g, cancellationCode); - return new Function("tryCatch", "errorObj", "Promise", "async", code)(tryCatch2, errorObj2, Promise2, async); + return false; }; - var holderClasses = []; - var thenCallbacks = []; - var promiseSetters = []; - for (var i = 0; i < 8; ++i) { - holderClasses.push(generateHolderClass(i + 1)); - thenCallbacks.push(thenCallback(i + 1)); - promiseSetters.push(promiseSetter(i + 1)); - } - reject = function(reason) { - this._reject(reason); + case "_flexibleDescendant": + return function flexibleDescendant(elem) { + var current = elem; + do { + if (adapter.isTag(current) && next(current)) + return true; + } while (current = adapter.getParent(current)); + return false; }; - } - } - Promise2.join = function() { - var last = arguments.length - 1; - var fn; - if (last > 0 && typeof arguments[last] === "function") { - fn = arguments[last]; - if (true) { - if (last <= 8 && canEvaluate2) { - var ret2 = new Promise2(INTERNAL); - ret2._captureStackTrace(); - var HolderClass = holderClasses[last - 1]; - var holder = new HolderClass(fn); - var callbacks = thenCallbacks; - for (var i2 = 0; i2 < last; ++i2) { - var maybePromise = tryConvertToPromise(arguments[i2], ret2); - if (maybePromise instanceof Promise2) { - maybePromise = maybePromise._target(); - var bitField = maybePromise._bitField; - ; - if ((bitField & 50397184) === 0) { - maybePromise._then(callbacks[i2], reject, void 0, ret2, holder); - promiseSetters[i2](maybePromise, holder); - holder.asyncNeeded = false; - } else if ((bitField & 33554432) !== 0) { - callbacks[i2].call(ret2, maybePromise._value(), holder); - } else if ((bitField & 16777216) !== 0) { - ret2._reject(maybePromise._reason()); - } else { - ret2._cancel(); - } - } else { - callbacks[i2].call(ret2, maybePromise, holder); - } + case "parent": + return function parent(elem) { + return adapter.getChildren(elem).some(function(elem2) { + return adapter.isTag(elem2) && next(elem2); + }); + }; + case "child": + return function child(elem) { + var parent = adapter.getParent(elem); + return parent != null && adapter.isTag(parent) && next(parent); + }; + case "sibling": + return function sibling(elem) { + var siblings = adapter.getSiblings(elem); + for (var i = 0; i < siblings.length; i++) { + var currentSibling = siblings[i]; + if (equals(elem, currentSibling)) + break; + if (adapter.isTag(currentSibling) && next(currentSibling)) { + return true; } - if (!ret2._isFateSealed()) { - if (holder.asyncNeeded) { - var context = Promise2._getContext(); - holder.fn = util.contextBind(context, holder.fn); - } - ret2._setAsyncGuaranteed(); - ret2._setOnCancel(holder); + } + return false; + }; + case "adjacent": + return function adjacent(elem) { + var siblings = adapter.getSiblings(elem); + var lastElement; + for (var i = 0; i < siblings.length; i++) { + var currentSibling = siblings[i]; + if (equals(elem, currentSibling)) + break; + if (adapter.isTag(currentSibling)) { + lastElement = currentSibling; } - return ret2; } - } + return !!lastElement && next(lastElement); + }; + case "universal": + return next; + } + } + exports2.compileGeneralSelector = compileGeneralSelector; + } +}); + +// node_modules/css-select/lib/compile.js +var require_compile2 = __commonJS({ + "node_modules/css-select/lib/compile.js"(exports2) { + init_shims(); + "use strict"; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.compileToken = exports2.compileUnsafe = exports2.compile = void 0; + var css_what_1 = require_lib(); + var boolbase_1 = require_boolbase(); + var sort_1 = __importDefault(require_sort()); + var procedure_1 = require_procedure(); + var general_1 = require_general(); + var subselects_1 = require_subselects(); + function compile(selector, options2, context) { + var next = compileUnsafe(selector, options2, context); + return subselects_1.ensureIsTag(next, options2.adapter); + } + exports2.compile = compile; + function compileUnsafe(selector, options2, context) { + var token = typeof selector === "string" ? css_what_1.parse(selector, options2) : selector; + return compileToken(token, options2, context); + } + exports2.compileUnsafe = compileUnsafe; + function includesScopePseudo(t) { + return t.type === "pseudo" && (t.name === "scope" || Array.isArray(t.data) && t.data.some(function(data) { + return data.some(includesScopePseudo); + })); + } + var DESCENDANT_TOKEN = { type: "descendant" }; + var FLEXIBLE_DESCENDANT_TOKEN = { + type: "_flexibleDescendant" + }; + var SCOPE_TOKEN = { type: "pseudo", name: "scope", data: null }; + function absolutize(token, _a, context) { + var adapter = _a.adapter; + var hasContext = !!(context === null || context === void 0 ? void 0 : context.every(function(e) { + var parent = adapter.isTag(e) && adapter.getParent(e); + return e === subselects_1.PLACEHOLDER_ELEMENT || parent && adapter.isTag(parent); + })); + for (var _i = 0, token_1 = token; _i < token_1.length; _i++) { + var t = token_1[_i]; + if (t.length > 0 && procedure_1.isTraversal(t[0]) && t[0].type !== "descendant") { + } else if (hasContext && !t.some(includesScopePseudo)) { + t.unshift(DESCENDANT_TOKEN); + } else { + continue; } - var $_len = arguments.length; - var args = new Array($_len); - for (var $_i = 0; $_i < $_len; ++$_i) { - args[$_i] = arguments[$_i]; + t.unshift(SCOPE_TOKEN); + } + } + function compileToken(token, options2, context) { + var _a; + token = token.filter(function(t) { + return t.length > 0; + }); + token.forEach(sort_1.default); + context = (_a = options2.context) !== null && _a !== void 0 ? _a : context; + var isArrayContext = Array.isArray(context); + var finalContext = context && (Array.isArray(context) ? context : [context]); + absolutize(token, options2, finalContext); + var shouldTestNextSiblings = false; + var query = token.map(function(rules) { + if (rules.length >= 2) { + var first = rules[0], second = rules[1]; + if (first.type !== "pseudo" || first.name !== "scope") { + } else if (isArrayContext && second.type === "descendant") { + rules[1] = FLEXIBLE_DESCENDANT_TOKEN; + } else if (second.type === "adjacent" || second.type === "sibling") { + shouldTestNextSiblings = true; + } } - ; - if (fn) - args.pop(); - var ret2 = new PromiseArray(args).promise(); - return fn !== void 0 ? ret2.spread(fn) : ret2; + return compileRules(rules, options2, finalContext); + }).reduce(reduceRules, boolbase_1.falseFunc); + query.shouldTestNextSiblings = shouldTestNextSiblings; + return query; + } + exports2.compileToken = compileToken; + function compileRules(rules, options2, context) { + var _a; + return rules.reduce(function(previous, rule) { + return previous === boolbase_1.falseFunc ? boolbase_1.falseFunc : general_1.compileGeneralSelector(previous, rule, options2, context, compileToken); + }, (_a = options2.rootFunc) !== null && _a !== void 0 ? _a : boolbase_1.trueFunc); + } + function reduceRules(a, b) { + if (b === boolbase_1.falseFunc || a === boolbase_1.trueFunc) { + return a; + } + if (a === boolbase_1.falseFunc || b === boolbase_1.trueFunc) { + return b; + } + return function combine(elem) { + return a(elem) || b(elem); }; - }; + } } }); -// node_modules/bluebird/js/release/call_get.js -var require_call_get = __commonJS({ - "node_modules/bluebird/js/release/call_get.js"(exports2, module2) { +// node_modules/css-select/lib/index.js +var require_lib8 = __commonJS({ + "node_modules/css-select/lib/index.js"(exports2) { init_shims(); "use strict"; - var cr = Object.create; - if (cr) { - callerCache = cr(null); - getterCache = cr(null); - callerCache[" size"] = getterCache[" size"] = 0; - } - var callerCache; - var getterCache; - module2.exports = function(Promise2) { - var util = require_util(); - var canEvaluate2 = util.canEvaluate; - var isIdentifier2 = util.isIdentifier; - var getMethodCaller; - var getGetter; - if (true) { - var makeMethodCaller = function(methodName) { - return new Function("ensureMethod", " \n return function(obj) { \n 'use strict' \n var len = this.length; \n ensureMethod(obj, 'methodName'); \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: \n return obj.methodName.apply(obj, this); \n } \n }; \n ".replace(/methodName/g, methodName))(ensureMethod); - }; - var makeGetter = function(propertyName) { - return new Function("obj", " \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName", propertyName)); - }; - var getCompiled = function(name, compiler, cache) { - var ret2 = cache[name]; - if (typeof ret2 !== "function") { - if (!isIdentifier2(name)) { - return null; - } - ret2 = compiler(name); - cache[name] = ret2; - cache[" size"]++; - if (cache[" size"] > 512) { - var keys = Object.keys(cache); - for (var i = 0; i < 256; ++i) - delete cache[keys[i]]; - cache[" size"] = keys.length - 256; - } - } - return ret2; - }; - getMethodCaller = function(name) { - return getCompiled(name, makeMethodCaller, callerCache); - }; - getGetter = function(name) { - return getCompiled(name, makeGetter, getterCache); - }; + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }); + var __importStar = exports2 && exports2.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); } - function ensureMethod(obj, methodName) { - var fn; - if (obj != null) - fn = obj[methodName]; - if (typeof fn !== "function") { - var message = "Object " + util.classString(obj) + " has no method '" + util.toString(methodName) + "'"; - throw new Promise2.TypeError(message); - } - return fn; - } - function caller(obj) { - var methodName = this.pop(); - var fn = ensureMethod(obj, methodName); - return fn.apply(obj, this); - } - Promise2.prototype.call = function(methodName) { - var $_len = arguments.length; - var args = new Array(Math.max($_len - 1, 0)); - for (var $_i = 1; $_i < $_len; ++$_i) { - args[$_i - 1] = arguments[$_i]; - } - ; - if (true) { - if (canEvaluate2) { - var maybeCaller = getMethodCaller(methodName); - if (maybeCaller !== null) { - return this._then(maybeCaller, void 0, void 0, args, void 0); - } - } + __setModuleDefault(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.aliases = exports2.pseudos = exports2.filters = exports2.is = exports2.selectOne = exports2.selectAll = exports2.prepareContext = exports2._compileToken = exports2._compileUnsafe = exports2.compile = void 0; + var DomUtils = __importStar(require_lib6()); + var boolbase_1 = require_boolbase(); + var compile_1 = require_compile2(); + var subselects_1 = require_subselects(); + var defaultEquals = function(a, b) { + return a === b; + }; + var defaultOptions = { + adapter: DomUtils, + equals: defaultEquals + }; + function convertOptionFormats(options2) { + var _a, _b, _c, _d; + var opts = options2 !== null && options2 !== void 0 ? options2 : defaultOptions; + (_a = opts.adapter) !== null && _a !== void 0 ? _a : opts.adapter = DomUtils; + (_b = opts.equals) !== null && _b !== void 0 ? _b : opts.equals = (_d = (_c = opts.adapter) === null || _c === void 0 ? void 0 : _c.equals) !== null && _d !== void 0 ? _d : defaultEquals; + return opts; + } + function wrapCompile(func) { + return function addAdapter(selector, options2, context) { + var opts = convertOptionFormats(options2); + return func(selector, opts, context); + }; + } + exports2.compile = wrapCompile(compile_1.compile); + exports2._compileUnsafe = wrapCompile(compile_1.compileUnsafe); + exports2._compileToken = wrapCompile(compile_1.compileToken); + function getSelectorFunc(searchFunc) { + return function select(query, elements, options2) { + var opts = convertOptionFormats(options2); + if (typeof query !== "function") { + query = compile_1.compileUnsafe(query, opts, elements); } - args.push(methodName); - return this._then(caller, void 0, void 0, args, void 0); + var filteredElements = prepareContext(elements, opts.adapter, query.shouldTestNextSiblings); + return searchFunc(query, filteredElements, opts); }; - function namedGetter(obj) { - return obj[this]; + } + function prepareContext(elems, adapter, shouldTestNextSiblings) { + if (shouldTestNextSiblings === void 0) { + shouldTestNextSiblings = false; } - function indexedGetter(obj) { - var index2 = +this; - if (index2 < 0) - index2 = Math.max(0, index2 + obj.length); - return obj[index2]; - } - Promise2.prototype.get = function(propertyName) { - var isIndex = typeof propertyName === "number"; - var getter; - if (!isIndex) { - if (canEvaluate2) { - var maybeGetter = getGetter(propertyName); - getter = maybeGetter !== null ? maybeGetter : namedGetter; - } else { - getter = namedGetter; - } + if (shouldTestNextSiblings) { + elems = appendNextSiblings(elems, adapter); + } + return Array.isArray(elems) ? adapter.removeSubsets(elems) : adapter.getChildren(elems); + } + exports2.prepareContext = prepareContext; + function appendNextSiblings(elem, adapter) { + var elems = Array.isArray(elem) ? elem.slice(0) : [elem]; + for (var i = 0; i < elems.length; i++) { + var nextSiblings = subselects_1.getNextSiblings(elems[i], adapter); + elems.push.apply(elems, nextSiblings); + } + return elems; + } + exports2.selectAll = getSelectorFunc(function(query, elems, options2) { + return query === boolbase_1.falseFunc || !elems || elems.length === 0 ? [] : options2.adapter.findAll(query, elems); + }); + exports2.selectOne = getSelectorFunc(function(query, elems, options2) { + return query === boolbase_1.falseFunc || !elems || elems.length === 0 ? null : options2.adapter.findOne(query, elems); + }); + function is(elem, query, options2) { + var opts = convertOptionFormats(options2); + return (typeof query === "function" ? query : compile_1.compile(query, opts))(elem); + } + exports2.is = is; + exports2.default = exports2.selectAll; + var pseudo_selectors_1 = require_pseudo_selectors(); + Object.defineProperty(exports2, "filters", { enumerable: true, get: function() { + return pseudo_selectors_1.filters; + } }); + Object.defineProperty(exports2, "pseudos", { enumerable: true, get: function() { + return pseudo_selectors_1.pseudos; + } }); + Object.defineProperty(exports2, "aliases", { enumerable: true, get: function() { + return pseudo_selectors_1.aliases; + } }); + } +}); + +// node_modules/cheerio-select/lib/positionals.js +var require_positionals = __commonJS({ + "node_modules/cheerio-select/lib/positionals.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getLimit = exports2.isFilter = exports2.filterNames = void 0; + exports2.filterNames = new Set([ + "first", + "last", + "eq", + "gt", + "nth", + "lt", + "even", + "odd" + ]); + function isFilter(s2) { + if (s2.type !== "pseudo") + return false; + if (exports2.filterNames.has(s2.name)) + return true; + if (s2.name === "not" && Array.isArray(s2.data)) { + return s2.data.some(function(s3) { + return s3.some(isFilter); + }); + } + return false; + } + exports2.isFilter = isFilter; + function getLimit(filter, data) { + var num = data != null ? parseInt(data, 10) : NaN; + switch (filter) { + case "first": + return 1; + case "nth": + case "eq": + return isFinite(num) ? num >= 0 ? num + 1 : Infinity : 0; + case "lt": + return isFinite(num) ? num >= 0 ? num : Infinity : 0; + case "gt": + return isFinite(num) ? Infinity : 0; + default: + return Infinity; + } + } + exports2.getLimit = getLimit; + } +}); + +// node_modules/cheerio-select/lib/helpers.js +var require_helpers3 = __commonJS({ + "node_modules/cheerio-select/lib/helpers.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.groupSelectors = exports2.getDocumentRoot = void 0; + var positionals_1 = require_positionals(); + function getDocumentRoot(node) { + while (node.parent) + node = node.parent; + return node; + } + exports2.getDocumentRoot = getDocumentRoot; + function groupSelectors(selectors) { + var filteredSelectors = []; + var plainSelectors = []; + for (var _i = 0, selectors_1 = selectors; _i < selectors_1.length; _i++) { + var selector = selectors_1[_i]; + if (selector.some(positionals_1.isFilter)) { + filteredSelectors.push(selector); } else { - getter = indexedGetter; + plainSelectors.push(selector); } - return this._then(getter, void 0, void 0, propertyName, void 0); - }; - }; + } + return [plainSelectors, filteredSelectors]; + } + exports2.groupSelectors = groupSelectors; } }); -// node_modules/bluebird/js/release/generators.js -var require_generators = __commonJS({ - "node_modules/bluebird/js/release/generators.js"(exports2, module2) { +// node_modules/cheerio-select/lib/index.js +var require_lib9 = __commonJS({ + "node_modules/cheerio-select/lib/index.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug) { - var errors = require_errors(); - var TypeError2 = errors.TypeError; - var util = require_util(); - var errorObj2 = util.errorObj; - var tryCatch2 = util.tryCatch; - var yieldHandlers = []; - function promiseFromYieldHandler(value, yieldHandlers2, traceParent) { - for (var i = 0; i < yieldHandlers2.length; ++i) { - traceParent._pushContext(); - var result = tryCatch2(yieldHandlers2[i])(value); - traceParent._popContext(); - if (result === errorObj2) { - traceParent._pushContext(); - var ret2 = Promise2.reject(errorObj2.e); - traceParent._popContext(); - return ret2; - } - var maybePromise = tryConvertToPromise(result, traceParent); - if (maybePromise instanceof Promise2) - return maybePromise; - } - return null; + var __assign = exports2 && exports2.__assign || function() { + __assign = Object.assign || function(t) { + for (var s2, i = 1, n = arguments.length; i < n; i++) { + s2 = arguments[i]; + for (var p in s2) + if (Object.prototype.hasOwnProperty.call(s2, p)) + t[p] = s2[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }); + var __importStar = exports2 && exports2.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); } - function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { - if (debug.cancellation()) { - var internal = new Promise2(INTERNAL); - var _finallyPromise = this._finallyPromise = new Promise2(INTERNAL); - this._promise = internal.lastly(function() { - return _finallyPromise; + __setModuleDefault(result, mod); + return result; + }; + var __spreadArray = exports2 && exports2.__spreadArray || function(to, from) { + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) + to[j] = from[i]; + return to; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.select = exports2.filter = exports2.some = exports2.is = exports2.aliases = exports2.pseudos = exports2.filters = void 0; + var css_what_1 = require_lib(); + var css_select_1 = require_lib8(); + var DomUtils = __importStar(require_lib6()); + var helpers_1 = require_helpers3(); + var positionals_1 = require_positionals(); + var css_select_2 = require_lib8(); + Object.defineProperty(exports2, "filters", { enumerable: true, get: function() { + return css_select_2.filters; + } }); + Object.defineProperty(exports2, "pseudos", { enumerable: true, get: function() { + return css_select_2.pseudos; + } }); + Object.defineProperty(exports2, "aliases", { enumerable: true, get: function() { + return css_select_2.aliases; + } }); + var SCOPE_PSEUDO = { + type: "pseudo", + name: "scope", + data: null + }; + var CUSTOM_SCOPE_PSEUDO = __assign({}, SCOPE_PSEUDO); + var UNIVERSAL_SELECTOR = { type: "universal", namespace: null }; + function is(element, selector, options2) { + if (options2 === void 0) { + options2 = {}; + } + return some([element], selector, options2); + } + exports2.is = is; + function some(elements, selector, options2) { + if (options2 === void 0) { + options2 = {}; + } + if (typeof selector === "function") + return elements.some(selector); + var _a = helpers_1.groupSelectors(css_what_1.parse(selector, options2)), plain = _a[0], filtered = _a[1]; + return plain.length > 0 && elements.some(css_select_1._compileToken(plain, options2)) || filtered.some(function(sel) { + return filterBySelector(sel, elements, options2).length > 0; + }); + } + exports2.some = some; + function filterByPosition(filter2, elems, data, options2) { + var num = typeof data === "string" ? parseInt(data, 10) : NaN; + switch (filter2) { + case "first": + case "lt": + return elems; + case "last": + return elems.length > 0 ? [elems[elems.length - 1]] : elems; + case "nth": + case "eq": + return isFinite(num) && Math.abs(num) < elems.length ? [num < 0 ? elems[elems.length + num] : elems[num]] : []; + case "gt": + return isFinite(num) ? elems.slice(num + 1) : []; + case "even": + return elems.filter(function(_, i) { + return i % 2 === 0; }); - internal._captureStackTrace(); - internal._setOnCancel(this); + case "odd": + return elems.filter(function(_, i) { + return i % 2 === 1; + }); + case "not": { + var filtered_1 = new Set(filterParsed(data, elems, options2)); + return elems.filter(function(e) { + return !filtered_1.has(e); + }); + } + } + } + function filter(selector, elements, options2) { + if (options2 === void 0) { + options2 = {}; + } + return filterParsed(css_what_1.parse(selector, options2), elements, options2); + } + exports2.filter = filter; + function filterParsed(selector, elements, options2) { + if (elements.length === 0) + return []; + var _a = helpers_1.groupSelectors(selector), plainSelectors = _a[0], filteredSelectors = _a[1]; + var found; + if (plainSelectors.length) { + var filtered = filterElements(elements, plainSelectors, options2); + if (filteredSelectors.length === 0) { + return filtered; + } + if (filtered.length) { + found = new Set(filtered); + } + } + for (var i = 0; i < filteredSelectors.length && (found === null || found === void 0 ? void 0 : found.size) !== elements.length; i++) { + var filteredSelector = filteredSelectors[i]; + var missing = found ? elements.filter(function(e) { + return DomUtils.isTag(e) && !found.has(e); + }) : elements; + if (missing.length === 0) + break; + var filtered = filterBySelector(filteredSelector, elements, options2); + if (filtered.length) { + if (!found) { + if (i === filteredSelectors.length - 1) { + return filtered; + } + found = new Set(filtered); + } else { + filtered.forEach(function(el) { + return found.add(el); + }); + } + } + } + return typeof found !== "undefined" ? found.size === elements.length ? elements : elements.filter(function(el) { + return found.has(el); + }) : []; + } + function filterBySelector(selector, elements, options2) { + var _a; + if (selector.some(css_what_1.isTraversal)) { + var root = (_a = options2.root) !== null && _a !== void 0 ? _a : helpers_1.getDocumentRoot(elements[0]); + var sel = __spreadArray(__spreadArray([], selector), [CUSTOM_SCOPE_PSEUDO]); + return findFilterElements(root, sel, options2, true, elements); + } + return findFilterElements(elements, selector, options2, false); + } + function select(selector, root, options2) { + if (options2 === void 0) { + options2 = {}; + } + if (typeof selector === "function") { + return find(root, selector); + } + var _a = helpers_1.groupSelectors(css_what_1.parse(selector, options2)), plain = _a[0], filtered = _a[1]; + var results = filtered.map(function(sel) { + return findFilterElements(root, sel, options2, true); + }); + if (plain.length) { + results.push(findElements(root, plain, options2, Infinity)); + } + if (results.length === 1) { + return results[0]; + } + return DomUtils.uniqueSort(results.reduce(function(a, b) { + return __spreadArray(__spreadArray([], a), b); + })); + } + exports2.select = select; + var specialTraversal = new Set(["descendant", "adjacent"]); + function includesScopePseudo(t) { + return t !== SCOPE_PSEUDO && t.type === "pseudo" && (t.name === "scope" || Array.isArray(t.data) && t.data.some(function(data) { + return data.some(includesScopePseudo); + })); + } + function addContextIfScope(selector, options2, scopeContext) { + return scopeContext && selector.some(includesScopePseudo) ? __assign(__assign({}, options2), { context: scopeContext }) : options2; + } + function findFilterElements(root, selector, options2, queryForSelector, scopeContext) { + var filterIndex = selector.findIndex(positionals_1.isFilter); + var sub = selector.slice(0, filterIndex); + var filter2 = selector[filterIndex]; + var limit = positionals_1.getLimit(filter2.name, filter2.data); + if (limit === 0) + return []; + var subOpts = addContextIfScope(sub, options2, scopeContext); + var elemsNoLimit = sub.length === 0 && !Array.isArray(root) ? DomUtils.getChildren(root).filter(DomUtils.isTag) : sub.length === 0 || sub.length === 1 && sub[0] === SCOPE_PSEUDO ? (Array.isArray(root) ? root : [root]).filter(DomUtils.isTag) : queryForSelector || sub.some(css_what_1.isTraversal) ? findElements(root, [sub], subOpts, limit) : filterElements(root, [sub], subOpts); + var elems = elemsNoLimit.slice(0, limit); + var result = filterByPosition(filter2.name, elems, filter2.data, options2); + if (result.length === 0 || selector.length === filterIndex + 1) { + return result; + } + var remainingSelector = selector.slice(filterIndex + 1); + var remainingHasTraversal = remainingSelector.some(css_what_1.isTraversal); + var remainingOpts = addContextIfScope(remainingSelector, options2, scopeContext); + if (remainingHasTraversal) { + if (specialTraversal.has(remainingSelector[0].type)) { + remainingSelector.unshift(UNIVERSAL_SELECTOR); + } + remainingSelector.unshift(SCOPE_PSEUDO); + } + return remainingSelector.some(positionals_1.isFilter) ? findFilterElements(result, remainingSelector, options2, false, scopeContext) : remainingHasTraversal ? findElements(result, [remainingSelector], remainingOpts, Infinity) : filterElements(result, [remainingSelector], remainingOpts); + } + function findElements(root, sel, options2, limit) { + if (limit === 0) + return []; + var query = css_select_1._compileToken(sel, options2, root); + return find(root, query, limit); + } + function find(root, query, limit) { + if (limit === void 0) { + limit = Infinity; + } + var elems = css_select_1.prepareContext(root, DomUtils, query.shouldTestNextSiblings); + return DomUtils.find(function(node) { + return DomUtils.isTag(node) && query(node); + }, elems, true, limit); + } + function filterElements(elements, sel, options2) { + var els = (Array.isArray(elements) ? elements : [elements]).filter(DomUtils.isTag); + if (els.length === 0) + return els; + var query = css_select_1._compileToken(sel, options2); + return els.filter(query); + } + } +}); + +// node_modules/htmlparser2/lib/Tokenizer.js +var require_Tokenizer2 = __commonJS({ + "node_modules/htmlparser2/lib/Tokenizer.js"(exports2) { + init_shims(); + "use strict"; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + var decode_codepoint_1 = __importDefault(require_decode_codepoint()); + var entities_json_1 = __importDefault(require_entities()); + var legacy_json_1 = __importDefault(require_legacy()); + var xml_json_1 = __importDefault(require_xml()); + function whitespace(c) { + return c === " " || c === "\n" || c === " " || c === "\f" || c === "\r"; + } + function isASCIIAlpha(c) { + return c >= "a" && c <= "z" || c >= "A" && c <= "Z"; + } + function ifElseState(upper, SUCCESS, FAILURE) { + var lower = upper.toLowerCase(); + if (upper === lower) { + return function(t, c) { + if (c === lower) { + t._state = SUCCESS; + } else { + t._state = FAILURE; + t._index--; + } + }; + } + return function(t, c) { + if (c === lower || c === upper) { + t._state = SUCCESS; + } else { + t._state = FAILURE; + t._index--; + } + }; + } + function consumeSpecialNameChar(upper, NEXT_STATE) { + var lower = upper.toLowerCase(); + return function(t, c) { + if (c === lower || c === upper) { + t._state = NEXT_STATE; + } else { + t._state = 3; + t._index--; + } + }; + } + var stateBeforeCdata1 = ifElseState("C", 24, 16); + var stateBeforeCdata2 = ifElseState("D", 25, 16); + var stateBeforeCdata3 = ifElseState("A", 26, 16); + var stateBeforeCdata4 = ifElseState("T", 27, 16); + var stateBeforeCdata5 = ifElseState("A", 28, 16); + var stateBeforeScript1 = consumeSpecialNameChar("R", 35); + var stateBeforeScript2 = consumeSpecialNameChar("I", 36); + var stateBeforeScript3 = consumeSpecialNameChar("P", 37); + var stateBeforeScript4 = consumeSpecialNameChar("T", 38); + var stateAfterScript1 = ifElseState("R", 40, 1); + var stateAfterScript2 = ifElseState("I", 41, 1); + var stateAfterScript3 = ifElseState("P", 42, 1); + var stateAfterScript4 = ifElseState("T", 43, 1); + var stateBeforeStyle1 = consumeSpecialNameChar("Y", 45); + var stateBeforeStyle2 = consumeSpecialNameChar("L", 46); + var stateBeforeStyle3 = consumeSpecialNameChar("E", 47); + var stateAfterStyle1 = ifElseState("Y", 49, 1); + var stateAfterStyle2 = ifElseState("L", 50, 1); + var stateAfterStyle3 = ifElseState("E", 51, 1); + var stateBeforeSpecialT = consumeSpecialNameChar("I", 54); + var stateBeforeTitle1 = consumeSpecialNameChar("T", 55); + var stateBeforeTitle2 = consumeSpecialNameChar("L", 56); + var stateBeforeTitle3 = consumeSpecialNameChar("E", 57); + var stateAfterSpecialTEnd = ifElseState("I", 58, 1); + var stateAfterTitle1 = ifElseState("T", 59, 1); + var stateAfterTitle2 = ifElseState("L", 60, 1); + var stateAfterTitle3 = ifElseState("E", 61, 1); + var stateBeforeEntity = ifElseState("#", 63, 64); + var stateBeforeNumericEntity = ifElseState("X", 66, 65); + var Tokenizer = function() { + function Tokenizer2(options2, cbs) { + var _a; + this._state = 1; + this.buffer = ""; + this.sectionStart = 0; + this._index = 0; + this.bufferOffset = 0; + this.baseState = 1; + this.special = 1; + this.running = true; + this.ended = false; + this.cbs = cbs; + this.xmlMode = !!(options2 === null || options2 === void 0 ? void 0 : options2.xmlMode); + this.decodeEntities = (_a = options2 === null || options2 === void 0 ? void 0 : options2.decodeEntities) !== null && _a !== void 0 ? _a : true; + } + Tokenizer2.prototype.reset = function() { + this._state = 1; + this.buffer = ""; + this.sectionStart = 0; + this._index = 0; + this.bufferOffset = 0; + this.baseState = 1; + this.special = 1; + this.running = true; + this.ended = false; + }; + Tokenizer2.prototype.write = function(chunk) { + if (this.ended) + this.cbs.onerror(Error(".write() after done!")); + this.buffer += chunk; + this.parse(); + }; + Tokenizer2.prototype.end = function(chunk) { + if (this.ended) + this.cbs.onerror(Error(".end() after done!")); + if (chunk) + this.write(chunk); + this.ended = true; + if (this.running) + this.finish(); + }; + Tokenizer2.prototype.pause = function() { + this.running = false; + }; + Tokenizer2.prototype.resume = function() { + this.running = true; + if (this._index < this.buffer.length) { + this.parse(); + } + if (this.ended) { + this.finish(); + } + }; + Tokenizer2.prototype.getAbsoluteIndex = function() { + return this.bufferOffset + this._index; + }; + Tokenizer2.prototype.stateText = function(c) { + if (c === "<") { + if (this._index > this.sectionStart) { + this.cbs.ontext(this.getSection()); + } + this._state = 2; + this.sectionStart = this._index; + } else if (this.decodeEntities && c === "&" && (this.special === 1 || this.special === 4)) { + if (this._index > this.sectionStart) { + this.cbs.ontext(this.getSection()); + } + this.baseState = 1; + this._state = 62; + this.sectionStart = this._index; + } + }; + Tokenizer2.prototype.isTagStartChar = function(c) { + return isASCIIAlpha(c) || this.xmlMode && !whitespace(c) && c !== "/" && c !== ">"; + }; + Tokenizer2.prototype.stateBeforeTagName = function(c) { + if (c === "/") { + this._state = 5; + } else if (c === "<") { + this.cbs.ontext(this.getSection()); + this.sectionStart = this._index; + } else if (c === ">" || this.special !== 1 || whitespace(c)) { + this._state = 1; + } else if (c === "!") { + this._state = 15; + this.sectionStart = this._index + 1; + } else if (c === "?") { + this._state = 17; + this.sectionStart = this._index + 1; + } else if (!this.isTagStartChar(c)) { + this._state = 1; + } else { + this._state = !this.xmlMode && (c === "s" || c === "S") ? 32 : !this.xmlMode && (c === "t" || c === "T") ? 52 : 3; + this.sectionStart = this._index; + } + }; + Tokenizer2.prototype.stateInTagName = function(c) { + if (c === "/" || c === ">" || whitespace(c)) { + this.emitToken("onopentagname"); + this._state = 8; + this._index--; + } + }; + Tokenizer2.prototype.stateBeforeClosingTagName = function(c) { + if (whitespace(c)) { + } else if (c === ">") { + this._state = 1; + } else if (this.special !== 1) { + if (this.special !== 4 && (c === "s" || c === "S")) { + this._state = 33; + } else if (this.special === 4 && (c === "t" || c === "T")) { + this._state = 53; + } else { + this._state = 1; + this._index--; + } + } else if (!this.isTagStartChar(c)) { + this._state = 20; + this.sectionStart = this._index; } else { - var promise = this._promise = new Promise2(INTERNAL); - promise._captureStackTrace(); - } - this._stack = stack; - this._generatorFunction = generatorFunction; - this._receiver = receiver; - this._generator = void 0; - this._yieldHandlers = typeof yieldHandler === "function" ? [yieldHandler].concat(yieldHandlers) : yieldHandlers; - this._yieldedPromise = null; - this._cancellationPhase = false; - } - util.inherits(PromiseSpawn, Proxyable); - PromiseSpawn.prototype._isResolved = function() { - return this._promise === null; + this._state = 6; + this.sectionStart = this._index; + } + }; + Tokenizer2.prototype.stateInClosingTagName = function(c) { + if (c === ">" || whitespace(c)) { + this.emitToken("onclosetag"); + this._state = 7; + this._index--; + } + }; + Tokenizer2.prototype.stateAfterClosingTagName = function(c) { + if (c === ">") { + this._state = 1; + this.sectionStart = this._index + 1; + } + }; + Tokenizer2.prototype.stateBeforeAttributeName = function(c) { + if (c === ">") { + this.cbs.onopentagend(); + this._state = 1; + this.sectionStart = this._index + 1; + } else if (c === "/") { + this._state = 4; + } else if (!whitespace(c)) { + this._state = 9; + this.sectionStart = this._index; + } + }; + Tokenizer2.prototype.stateInSelfClosingTag = function(c) { + if (c === ">") { + this.cbs.onselfclosingtag(); + this._state = 1; + this.sectionStart = this._index + 1; + this.special = 1; + } else if (!whitespace(c)) { + this._state = 8; + this._index--; + } + }; + Tokenizer2.prototype.stateInAttributeName = function(c) { + if (c === "=" || c === "/" || c === ">" || whitespace(c)) { + this.cbs.onattribname(this.getSection()); + this.sectionStart = -1; + this._state = 10; + this._index--; + } + }; + Tokenizer2.prototype.stateAfterAttributeName = function(c) { + if (c === "=") { + this._state = 11; + } else if (c === "/" || c === ">") { + this.cbs.onattribend(void 0); + this._state = 8; + this._index--; + } else if (!whitespace(c)) { + this.cbs.onattribend(void 0); + this._state = 9; + this.sectionStart = this._index; + } + }; + Tokenizer2.prototype.stateBeforeAttributeValue = function(c) { + if (c === '"') { + this._state = 12; + this.sectionStart = this._index + 1; + } else if (c === "'") { + this._state = 13; + this.sectionStart = this._index + 1; + } else if (!whitespace(c)) { + this._state = 14; + this.sectionStart = this._index; + this._index--; + } + }; + Tokenizer2.prototype.handleInAttributeValue = function(c, quote) { + if (c === quote) { + this.emitToken("onattribdata"); + this.cbs.onattribend(quote); + this._state = 8; + } else if (this.decodeEntities && c === "&") { + this.emitToken("onattribdata"); + this.baseState = this._state; + this._state = 62; + this.sectionStart = this._index; + } + }; + Tokenizer2.prototype.stateInAttributeValueDoubleQuotes = function(c) { + this.handleInAttributeValue(c, '"'); + }; + Tokenizer2.prototype.stateInAttributeValueSingleQuotes = function(c) { + this.handleInAttributeValue(c, "'"); + }; + Tokenizer2.prototype.stateInAttributeValueNoQuotes = function(c) { + if (whitespace(c) || c === ">") { + this.emitToken("onattribdata"); + this.cbs.onattribend(null); + this._state = 8; + this._index--; + } else if (this.decodeEntities && c === "&") { + this.emitToken("onattribdata"); + this.baseState = this._state; + this._state = 62; + this.sectionStart = this._index; + } + }; + Tokenizer2.prototype.stateBeforeDeclaration = function(c) { + this._state = c === "[" ? 23 : c === "-" ? 18 : 16; + }; + Tokenizer2.prototype.stateInDeclaration = function(c) { + if (c === ">") { + this.cbs.ondeclaration(this.getSection()); + this._state = 1; + this.sectionStart = this._index + 1; + } + }; + Tokenizer2.prototype.stateInProcessingInstruction = function(c) { + if (c === ">") { + this.cbs.onprocessinginstruction(this.getSection()); + this._state = 1; + this.sectionStart = this._index + 1; + } + }; + Tokenizer2.prototype.stateBeforeComment = function(c) { + if (c === "-") { + this._state = 19; + this.sectionStart = this._index + 1; + } else { + this._state = 16; + } }; - PromiseSpawn.prototype._cleanup = function() { - this._promise = this._generator = null; - if (debug.cancellation() && this._finallyPromise !== null) { - this._finallyPromise._fulfill(); - this._finallyPromise = null; + Tokenizer2.prototype.stateInComment = function(c) { + if (c === "-") + this._state = 21; + }; + Tokenizer2.prototype.stateInSpecialComment = function(c) { + if (c === ">") { + this.cbs.oncomment(this.buffer.substring(this.sectionStart, this._index)); + this._state = 1; + this.sectionStart = this._index + 1; } }; - PromiseSpawn.prototype._promiseCancelled = function() { - if (this._isResolved()) - return; - var implementsReturn = typeof this._generator["return"] !== "undefined"; - var result; - if (!implementsReturn) { - var reason = new Promise2.CancellationError("generator .return() sentinel"); - Promise2.coroutine.returnSentinel = reason; - this._promise._attachExtraTrace(reason); - this._promise._pushContext(); - result = tryCatch2(this._generator["throw"]).call(this._generator, reason); - this._promise._popContext(); + Tokenizer2.prototype.stateAfterComment1 = function(c) { + if (c === "-") { + this._state = 22; } else { - this._promise._pushContext(); - result = tryCatch2(this._generator["return"]).call(this._generator, void 0); - this._promise._popContext(); + this._state = 19; + } + }; + Tokenizer2.prototype.stateAfterComment2 = function(c) { + if (c === ">") { + this.cbs.oncomment(this.buffer.substring(this.sectionStart, this._index - 2)); + this._state = 1; + this.sectionStart = this._index + 1; + } else if (c !== "-") { + this._state = 19; } - this._cancellationPhase = true; - this._yieldedPromise = null; - this._continue(result); }; - PromiseSpawn.prototype._promiseFulfilled = function(value) { - this._yieldedPromise = null; - this._promise._pushContext(); - var result = tryCatch2(this._generator.next).call(this._generator, value); - this._promise._popContext(); - this._continue(result); + Tokenizer2.prototype.stateBeforeCdata6 = function(c) { + if (c === "[") { + this._state = 29; + this.sectionStart = this._index + 1; + } else { + this._state = 16; + this._index--; + } }; - PromiseSpawn.prototype._promiseRejected = function(reason) { - this._yieldedPromise = null; - this._promise._attachExtraTrace(reason); - this._promise._pushContext(); - var result = tryCatch2(this._generator["throw"]).call(this._generator, reason); - this._promise._popContext(); - this._continue(result); + Tokenizer2.prototype.stateInCdata = function(c) { + if (c === "]") + this._state = 30; }; - PromiseSpawn.prototype._resultCancelled = function() { - if (this._yieldedPromise instanceof Promise2) { - var promise = this._yieldedPromise; - this._yieldedPromise = null; - promise.cancel(); + Tokenizer2.prototype.stateAfterCdata1 = function(c) { + if (c === "]") + this._state = 31; + else + this._state = 29; + }; + Tokenizer2.prototype.stateAfterCdata2 = function(c) { + if (c === ">") { + this.cbs.oncdata(this.buffer.substring(this.sectionStart, this._index - 2)); + this._state = 1; + this.sectionStart = this._index + 1; + } else if (c !== "]") { + this._state = 29; + } + }; + Tokenizer2.prototype.stateBeforeSpecialS = function(c) { + if (c === "c" || c === "C") { + this._state = 34; + } else if (c === "t" || c === "T") { + this._state = 44; + } else { + this._state = 3; + this._index--; + } + }; + Tokenizer2.prototype.stateBeforeSpecialSEnd = function(c) { + if (this.special === 2 && (c === "c" || c === "C")) { + this._state = 39; + } else if (this.special === 3 && (c === "t" || c === "T")) { + this._state = 48; + } else + this._state = 1; + }; + Tokenizer2.prototype.stateBeforeSpecialLast = function(c, special) { + if (c === "/" || c === ">" || whitespace(c)) { + this.special = special; + } + this._state = 3; + this._index--; + }; + Tokenizer2.prototype.stateAfterSpecialLast = function(c, sectionStartOffset) { + if (c === ">" || whitespace(c)) { + this.special = 1; + this._state = 6; + this.sectionStart = this._index - sectionStartOffset; + this._index--; + } else + this._state = 1; + }; + Tokenizer2.prototype.parseFixedEntity = function(map) { + if (map === void 0) { + map = this.xmlMode ? xml_json_1.default : entities_json_1.default; + } + if (this.sectionStart + 1 < this._index) { + var entity = this.buffer.substring(this.sectionStart + 1, this._index); + if (Object.prototype.hasOwnProperty.call(map, entity)) { + this.emitPartial(map[entity]); + this.sectionStart = this._index + 1; + } + } + }; + Tokenizer2.prototype.parseLegacyEntity = function() { + var start = this.sectionStart + 1; + var limit = Math.min(this._index - start, 6); + while (limit >= 2) { + var entity = this.buffer.substr(start, limit); + if (Object.prototype.hasOwnProperty.call(legacy_json_1.default, entity)) { + this.emitPartial(legacy_json_1.default[entity]); + this.sectionStart += limit + 1; + return; + } + limit--; } }; - PromiseSpawn.prototype.promise = function() { - return this._promise; + Tokenizer2.prototype.stateInNamedEntity = function(c) { + if (c === ";") { + this.parseFixedEntity(); + if (this.baseState === 1 && this.sectionStart + 1 < this._index && !this.xmlMode) { + this.parseLegacyEntity(); + } + this._state = this.baseState; + } else if ((c < "0" || c > "9") && !isASCIIAlpha(c)) { + if (this.xmlMode || this.sectionStart + 1 === this._index) { + } else if (this.baseState !== 1) { + if (c !== "=") { + this.parseFixedEntity(legacy_json_1.default); + } + } else { + this.parseLegacyEntity(); + } + this._state = this.baseState; + this._index--; + } }; - PromiseSpawn.prototype._run = function() { - this._generator = this._generatorFunction.call(this._receiver); - this._receiver = this._generatorFunction = void 0; - this._promiseFulfilled(void 0); + Tokenizer2.prototype.decodeNumericEntity = function(offset, base2, strict) { + var sectionStart = this.sectionStart + offset; + if (sectionStart !== this._index) { + var entity = this.buffer.substring(sectionStart, this._index); + var parsed = parseInt(entity, base2); + this.emitPartial(decode_codepoint_1.default(parsed)); + this.sectionStart = strict ? this._index + 1 : this._index; + } + this._state = this.baseState; }; - PromiseSpawn.prototype._continue = function(result) { - var promise = this._promise; - if (result === errorObj2) { - this._cleanup(); - if (this._cancellationPhase) { - return promise.cancel(); + Tokenizer2.prototype.stateInNumericEntity = function(c) { + if (c === ";") { + this.decodeNumericEntity(2, 10, true); + } else if (c < "0" || c > "9") { + if (!this.xmlMode) { + this.decodeNumericEntity(2, 10, false); } else { - return promise._rejectCallback(result.e, false); + this._state = this.baseState; } + this._index--; } - var value = result.value; - if (result.done === true) { - this._cleanup(); - if (this._cancellationPhase) { - return promise.cancel(); + }; + Tokenizer2.prototype.stateInHexEntity = function(c) { + if (c === ";") { + this.decodeNumericEntity(3, 16, true); + } else if ((c < "a" || c > "f") && (c < "A" || c > "F") && (c < "0" || c > "9")) { + if (!this.xmlMode) { + this.decodeNumericEntity(3, 16, false); } else { - return promise._resolveCallback(value); + this._state = this.baseState; } - } else { - var maybePromise = tryConvertToPromise(value, this._promise); - if (!(maybePromise instanceof Promise2)) { - maybePromise = promiseFromYieldHandler(maybePromise, this._yieldHandlers, this._promise); - if (maybePromise === null) { - this._promiseRejected(new TypeError2("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s", String(value)) + "From coroutine:\n" + this._stack.split("\n").slice(1, -7).join("\n"))); - return; + this._index--; + } + }; + Tokenizer2.prototype.cleanup = function() { + if (this.sectionStart < 0) { + this.buffer = ""; + this.bufferOffset += this._index; + this._index = 0; + } else if (this.running) { + if (this._state === 1) { + if (this.sectionStart !== this._index) { + this.cbs.ontext(this.buffer.substr(this.sectionStart)); } - } - maybePromise = maybePromise._target(); - var bitField = maybePromise._bitField; - ; - if ((bitField & 50397184) === 0) { - this._yieldedPromise = maybePromise; - maybePromise._proxy(this, null); - } else if ((bitField & 33554432) !== 0) { - Promise2._async.invoke(this._promiseFulfilled, this, maybePromise._value()); - } else if ((bitField & 16777216) !== 0) { - Promise2._async.invoke(this._promiseRejected, this, maybePromise._reason()); + this.buffer = ""; + this.bufferOffset += this._index; + this._index = 0; + } else if (this.sectionStart === this._index) { + this.buffer = ""; + this.bufferOffset += this._index; + this._index = 0; + } else { + this.buffer = this.buffer.substr(this.sectionStart); + this._index -= this.sectionStart; + this.bufferOffset += this.sectionStart; + } + this.sectionStart = 0; + } + }; + Tokenizer2.prototype.parse = function() { + while (this._index < this.buffer.length && this.running) { + var c = this.buffer.charAt(this._index); + if (this._state === 1) { + this.stateText(c); + } else if (this._state === 12) { + this.stateInAttributeValueDoubleQuotes(c); + } else if (this._state === 9) { + this.stateInAttributeName(c); + } else if (this._state === 19) { + this.stateInComment(c); + } else if (this._state === 20) { + this.stateInSpecialComment(c); + } else if (this._state === 8) { + this.stateBeforeAttributeName(c); + } else if (this._state === 3) { + this.stateInTagName(c); + } else if (this._state === 6) { + this.stateInClosingTagName(c); + } else if (this._state === 2) { + this.stateBeforeTagName(c); + } else if (this._state === 10) { + this.stateAfterAttributeName(c); + } else if (this._state === 13) { + this.stateInAttributeValueSingleQuotes(c); + } else if (this._state === 11) { + this.stateBeforeAttributeValue(c); + } else if (this._state === 5) { + this.stateBeforeClosingTagName(c); + } else if (this._state === 7) { + this.stateAfterClosingTagName(c); + } else if (this._state === 32) { + this.stateBeforeSpecialS(c); + } else if (this._state === 21) { + this.stateAfterComment1(c); + } else if (this._state === 14) { + this.stateInAttributeValueNoQuotes(c); + } else if (this._state === 4) { + this.stateInSelfClosingTag(c); + } else if (this._state === 16) { + this.stateInDeclaration(c); + } else if (this._state === 15) { + this.stateBeforeDeclaration(c); + } else if (this._state === 22) { + this.stateAfterComment2(c); + } else if (this._state === 18) { + this.stateBeforeComment(c); + } else if (this._state === 33) { + this.stateBeforeSpecialSEnd(c); + } else if (this._state === 53) { + stateAfterSpecialTEnd(this, c); + } else if (this._state === 39) { + stateAfterScript1(this, c); + } else if (this._state === 40) { + stateAfterScript2(this, c); + } else if (this._state === 41) { + stateAfterScript3(this, c); + } else if (this._state === 34) { + stateBeforeScript1(this, c); + } else if (this._state === 35) { + stateBeforeScript2(this, c); + } else if (this._state === 36) { + stateBeforeScript3(this, c); + } else if (this._state === 37) { + stateBeforeScript4(this, c); + } else if (this._state === 38) { + this.stateBeforeSpecialLast(c, 2); + } else if (this._state === 42) { + stateAfterScript4(this, c); + } else if (this._state === 43) { + this.stateAfterSpecialLast(c, 6); + } else if (this._state === 44) { + stateBeforeStyle1(this, c); + } else if (this._state === 29) { + this.stateInCdata(c); + } else if (this._state === 45) { + stateBeforeStyle2(this, c); + } else if (this._state === 46) { + stateBeforeStyle3(this, c); + } else if (this._state === 47) { + this.stateBeforeSpecialLast(c, 3); + } else if (this._state === 48) { + stateAfterStyle1(this, c); + } else if (this._state === 49) { + stateAfterStyle2(this, c); + } else if (this._state === 50) { + stateAfterStyle3(this, c); + } else if (this._state === 51) { + this.stateAfterSpecialLast(c, 5); + } else if (this._state === 52) { + stateBeforeSpecialT(this, c); + } else if (this._state === 54) { + stateBeforeTitle1(this, c); + } else if (this._state === 55) { + stateBeforeTitle2(this, c); + } else if (this._state === 56) { + stateBeforeTitle3(this, c); + } else if (this._state === 57) { + this.stateBeforeSpecialLast(c, 4); + } else if (this._state === 58) { + stateAfterTitle1(this, c); + } else if (this._state === 59) { + stateAfterTitle2(this, c); + } else if (this._state === 60) { + stateAfterTitle3(this, c); + } else if (this._state === 61) { + this.stateAfterSpecialLast(c, 5); + } else if (this._state === 17) { + this.stateInProcessingInstruction(c); + } else if (this._state === 64) { + this.stateInNamedEntity(c); + } else if (this._state === 23) { + stateBeforeCdata1(this, c); + } else if (this._state === 62) { + stateBeforeEntity(this, c); + } else if (this._state === 24) { + stateBeforeCdata2(this, c); + } else if (this._state === 25) { + stateBeforeCdata3(this, c); + } else if (this._state === 30) { + this.stateAfterCdata1(c); + } else if (this._state === 31) { + this.stateAfterCdata2(c); + } else if (this._state === 26) { + stateBeforeCdata4(this, c); + } else if (this._state === 27) { + stateBeforeCdata5(this, c); + } else if (this._state === 28) { + this.stateBeforeCdata6(c); + } else if (this._state === 66) { + this.stateInHexEntity(c); + } else if (this._state === 65) { + this.stateInNumericEntity(c); + } else if (this._state === 63) { + stateBeforeNumericEntity(this, c); } else { - this._promiseCancelled(); + this.cbs.onerror(Error("unknown _state"), this._state); } + this._index++; } + this.cleanup(); }; - Promise2.coroutine = function(generatorFunction, options2) { - if (typeof generatorFunction !== "function") { - throw new TypeError2("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n"); - } - var yieldHandler = Object(options2).yieldHandler; - var PromiseSpawn$ = PromiseSpawn; - var stack = new Error().stack; - return function() { - var generator = generatorFunction.apply(this, arguments); - var spawn = new PromiseSpawn$(void 0, void 0, yieldHandler, stack); - var ret2 = spawn.promise(); - spawn._generator = generator; - spawn._promiseFulfilled(void 0); - return ret2; - }; + Tokenizer2.prototype.finish = function() { + if (this.sectionStart < this._index) { + this.handleTrailingData(); + } + this.cbs.onend(); }; - Promise2.coroutine.addYieldHandler = function(fn) { - if (typeof fn !== "function") { - throw new TypeError2("expecting a function but got " + util.classString(fn)); + Tokenizer2.prototype.handleTrailingData = function() { + var data = this.buffer.substr(this.sectionStart); + if (this._state === 29 || this._state === 30 || this._state === 31) { + this.cbs.oncdata(data); + } else if (this._state === 19 || this._state === 21 || this._state === 22) { + this.cbs.oncomment(data); + } else if (this._state === 64 && !this.xmlMode) { + this.parseLegacyEntity(); + if (this.sectionStart < this._index) { + this._state = this.baseState; + this.handleTrailingData(); + } + } else if (this._state === 65 && !this.xmlMode) { + this.decodeNumericEntity(2, 10, false); + if (this.sectionStart < this._index) { + this._state = this.baseState; + this.handleTrailingData(); + } + } else if (this._state === 66 && !this.xmlMode) { + this.decodeNumericEntity(3, 16, false); + if (this.sectionStart < this._index) { + this._state = this.baseState; + this.handleTrailingData(); + } + } else if (this._state !== 3 && this._state !== 8 && this._state !== 11 && this._state !== 10 && this._state !== 9 && this._state !== 13 && this._state !== 12 && this._state !== 14 && this._state !== 6) { + this.cbs.ontext(data); } - yieldHandlers.push(fn); }; - Promise2.spawn = function(generatorFunction) { - debug.deprecated("Promise.spawn()", "Promise.coroutine()"); - if (typeof generatorFunction !== "function") { - return apiRejection("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n"); - } - var spawn = new PromiseSpawn(generatorFunction, this); - var ret2 = spawn.promise(); - spawn._run(Promise2.spawn); - return ret2; + Tokenizer2.prototype.getSection = function() { + return this.buffer.substring(this.sectionStart, this._index); }; - }; + Tokenizer2.prototype.emitToken = function(name) { + this.cbs[name](this.getSection()); + this.sectionStart = -1; + }; + Tokenizer2.prototype.emitPartial = function(value) { + if (this.baseState !== 1) { + this.cbs.onattribdata(value); + } else { + this.cbs.ontext(value); + } + }; + return Tokenizer2; + }(); + exports2.default = Tokenizer; } }); -// node_modules/bluebird/js/release/map.js -var require_map2 = __commonJS({ - "node_modules/bluebird/js/release/map.js"(exports2, module2) { +// node_modules/htmlparser2/lib/Parser.js +var require_Parser2 = __commonJS({ + "node_modules/htmlparser2/lib/Parser.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) { - var util = require_util(); - var tryCatch2 = util.tryCatch; - var errorObj2 = util.errorObj; - var async = Promise2._async; - function MappingPromiseArray(promises, fn, limit, _filter) { - this.constructor$(promises); - this._promise._captureStackTrace(); - var context = Promise2._getContext(); - this._callback = util.contextBind(context, fn); - this._preservedValues = _filter === INTERNAL ? new Array(this.length()) : null; - this._limit = limit; - this._inFlight = 0; - this._queue = []; - async.invoke(this._asyncInit, this, void 0); - if (util.isArray(promises)) { - for (var i = 0; i < promises.length; ++i) { - var maybePromise = promises[i]; - if (maybePromise instanceof Promise2) { - maybePromise.suppressUnhandledRejections(); - } - } - } - } - util.inherits(MappingPromiseArray, PromiseArray); - MappingPromiseArray.prototype._asyncInit = function() { - this._init$(void 0, -2); - }; - MappingPromiseArray.prototype._init = function() { - }; - MappingPromiseArray.prototype._promiseFulfilled = function(value, index2) { - var values = this._values; - var length = this.length(); - var preservedValues = this._preservedValues; - var limit = this._limit; - if (index2 < 0) { - index2 = index2 * -1 - 1; - values[index2] = value; - if (limit >= 1) { - this._inFlight--; - this._drainQueue(); - if (this._isResolved()) - return true; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Parser = void 0; + var Tokenizer_1 = __importDefault(require_Tokenizer2()); + var formTags = new Set([ + "input", + "option", + "optgroup", + "select", + "button", + "datalist", + "textarea" + ]); + var pTag = new Set(["p"]); + var openImpliesClose = { + tr: new Set(["tr", "th", "td"]), + th: new Set(["th"]), + td: new Set(["thead", "th", "td"]), + body: new Set(["head", "link", "script"]), + li: new Set(["li"]), + p: pTag, + h1: pTag, + h2: pTag, + h3: pTag, + h4: pTag, + h5: pTag, + h6: pTag, + select: formTags, + input: formTags, + output: formTags, + button: formTags, + datalist: formTags, + textarea: formTags, + option: new Set(["option"]), + optgroup: new Set(["optgroup", "option"]), + dd: new Set(["dt", "dd"]), + dt: new Set(["dt", "dd"]), + address: pTag, + article: pTag, + aside: pTag, + blockquote: pTag, + details: pTag, + div: pTag, + dl: pTag, + fieldset: pTag, + figcaption: pTag, + figure: pTag, + footer: pTag, + form: pTag, + header: pTag, + hr: pTag, + main: pTag, + nav: pTag, + ol: pTag, + pre: pTag, + section: pTag, + table: pTag, + ul: pTag, + rt: new Set(["rt", "rp"]), + rp: new Set(["rt", "rp"]), + tbody: new Set(["thead", "tbody"]), + tfoot: new Set(["thead", "tbody"]) + }; + var voidElements = new Set([ + "area", + "base", + "basefont", + "br", + "col", + "command", + "embed", + "frame", + "hr", + "img", + "input", + "isindex", + "keygen", + "link", + "meta", + "param", + "source", + "track", + "wbr" + ]); + var foreignContextElements = new Set(["math", "svg"]); + var htmlIntegrationElements = new Set([ + "mi", + "mo", + "mn", + "ms", + "mtext", + "annotation-xml", + "foreignObject", + "desc", + "title" + ]); + var reNameEnd = /\s|\//; + var Parser = function() { + function Parser2(cbs, options2) { + if (options2 === void 0) { + options2 = {}; + } + var _a, _b, _c, _d, _e; + this.startIndex = 0; + this.endIndex = null; + this.tagname = ""; + this.attribname = ""; + this.attribvalue = ""; + this.attribs = null; + this.stack = []; + this.foreignContext = []; + this.options = options2; + this.cbs = cbs !== null && cbs !== void 0 ? cbs : {}; + this.lowerCaseTagNames = (_a = options2.lowerCaseTags) !== null && _a !== void 0 ? _a : !options2.xmlMode; + this.lowerCaseAttributeNames = (_b = options2.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : !options2.xmlMode; + this.tokenizer = new ((_c = options2.Tokenizer) !== null && _c !== void 0 ? _c : Tokenizer_1.default)(this.options, this); + (_e = (_d = this.cbs).onparserinit) === null || _e === void 0 ? void 0 : _e.call(_d, this); + } + Parser2.prototype.updatePosition = function(initialOffset) { + if (this.endIndex === null) { + if (this.tokenizer.sectionStart <= initialOffset) { + this.startIndex = 0; + } else { + this.startIndex = this.tokenizer.sectionStart - initialOffset; } } else { - if (limit >= 1 && this._inFlight >= limit) { - values[index2] = value; - this._queue.push(index2); - return false; - } - if (preservedValues !== null) - preservedValues[index2] = value; - var promise = this._promise; - var callback = this._callback; - var receiver = promise._boundValue(); - promise._pushContext(); - var ret2 = tryCatch2(callback).call(receiver, value, index2, length); - var promiseCreated = promise._popContext(); - debug.checkForgottenReturns(ret2, promiseCreated, preservedValues !== null ? "Promise.filter" : "Promise.map", promise); - if (ret2 === errorObj2) { - this._reject(ret2.e); - return true; - } - var maybePromise = tryConvertToPromise(ret2, this._promise); - if (maybePromise instanceof Promise2) { - maybePromise = maybePromise._target(); - var bitField = maybePromise._bitField; - ; - if ((bitField & 50397184) === 0) { - if (limit >= 1) - this._inFlight++; - values[index2] = maybePromise; - maybePromise._proxy(this, (index2 + 1) * -1); - return false; - } else if ((bitField & 33554432) !== 0) { - ret2 = maybePromise._value(); - } else if ((bitField & 16777216) !== 0) { - this._reject(maybePromise._reason()); - return true; - } else { - this._cancel(); - return true; - } + this.startIndex = this.endIndex + 1; + } + this.endIndex = this.tokenizer.getAbsoluteIndex(); + }; + Parser2.prototype.ontext = function(data) { + var _a, _b; + this.updatePosition(1); + this.endIndex--; + (_b = (_a = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a, data); + }; + Parser2.prototype.onopentagname = function(name) { + var _a, _b; + if (this.lowerCaseTagNames) { + name = name.toLowerCase(); + } + this.tagname = name; + if (!this.options.xmlMode && Object.prototype.hasOwnProperty.call(openImpliesClose, name)) { + var el = void 0; + while (this.stack.length > 0 && openImpliesClose[name].has(el = this.stack[this.stack.length - 1])) { + this.onclosetag(el); + } + } + if (this.options.xmlMode || !voidElements.has(name)) { + this.stack.push(name); + if (foreignContextElements.has(name)) { + this.foreignContext.push(true); + } else if (htmlIntegrationElements.has(name)) { + this.foreignContext.push(false); + } + } + (_b = (_a = this.cbs).onopentagname) === null || _b === void 0 ? void 0 : _b.call(_a, name); + if (this.cbs.onopentag) + this.attribs = {}; + }; + Parser2.prototype.onopentagend = function() { + var _a, _b; + this.updatePosition(1); + if (this.attribs) { + (_b = (_a = this.cbs).onopentag) === null || _b === void 0 ? void 0 : _b.call(_a, this.tagname, this.attribs); + this.attribs = null; + } + if (!this.options.xmlMode && this.cbs.onclosetag && voidElements.has(this.tagname)) { + this.cbs.onclosetag(this.tagname); + } + this.tagname = ""; + }; + Parser2.prototype.onclosetag = function(name) { + this.updatePosition(1); + if (this.lowerCaseTagNames) { + name = name.toLowerCase(); + } + if (foreignContextElements.has(name) || htmlIntegrationElements.has(name)) { + this.foreignContext.pop(); + } + if (this.stack.length && (this.options.xmlMode || !voidElements.has(name))) { + var pos = this.stack.lastIndexOf(name); + if (pos !== -1) { + if (this.cbs.onclosetag) { + pos = this.stack.length - pos; + while (pos--) { + this.cbs.onclosetag(this.stack.pop()); + } + } else + this.stack.length = pos; + } else if (name === "p" && !this.options.xmlMode) { + this.onopentagname(name); + this.closeCurrentTag(); } - values[index2] = ret2; + } else if (!this.options.xmlMode && (name === "br" || name === "p")) { + this.onopentagname(name); + this.closeCurrentTag(); } - var totalResolved = ++this._totalResolved; - if (totalResolved >= length) { - if (preservedValues !== null) { - this._filter(values, preservedValues); - } else { - this._resolve(values); - } - return true; + }; + Parser2.prototype.onselfclosingtag = function() { + if (this.options.xmlMode || this.options.recognizeSelfClosing || this.foreignContext[this.foreignContext.length - 1]) { + this.closeCurrentTag(); + } else { + this.onopentagend(); } - return false; }; - MappingPromiseArray.prototype._drainQueue = function() { - var queue = this._queue; - var limit = this._limit; - var values = this._values; - while (queue.length > 0 && this._inFlight < limit) { - if (this._isResolved()) - return; - var index2 = queue.pop(); - this._promiseFulfilled(values[index2], index2); + Parser2.prototype.closeCurrentTag = function() { + var _a, _b; + var name = this.tagname; + this.onopentagend(); + if (this.stack[this.stack.length - 1] === name) { + (_b = (_a = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a, name); + this.stack.pop(); } }; - MappingPromiseArray.prototype._filter = function(booleans, values) { - var len = values.length; - var ret2 = new Array(len); - var j = 0; - for (var i = 0; i < len; ++i) { - if (booleans[i]) - ret2[j++] = values[i]; + Parser2.prototype.onattribname = function(name) { + if (this.lowerCaseAttributeNames) { + name = name.toLowerCase(); } - ret2.length = j; - this._resolve(ret2); + this.attribname = name; }; - MappingPromiseArray.prototype.preservedValues = function() { - return this._preservedValues; + Parser2.prototype.onattribdata = function(value) { + this.attribvalue += value; }; - function map(promises, fn, options2, _filter) { - if (typeof fn !== "function") { - return apiRejection("expecting a function but got " + util.classString(fn)); - } - var limit = 0; - if (options2 !== void 0) { - if (typeof options2 === "object" && options2 !== null) { - if (typeof options2.concurrency !== "number") { - return Promise2.reject(new TypeError("'concurrency' must be a number but it is " + util.classString(options2.concurrency))); - } - limit = options2.concurrency; - } else { - return Promise2.reject(new TypeError("options argument must be an object but it is " + util.classString(options2))); - } + Parser2.prototype.onattribend = function(quote) { + var _a, _b; + (_b = (_a = this.cbs).onattribute) === null || _b === void 0 ? void 0 : _b.call(_a, this.attribname, this.attribvalue, quote); + if (this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname)) { + this.attribs[this.attribname] = this.attribvalue; } - limit = typeof limit === "number" && isFinite(limit) && limit >= 1 ? limit : 0; - return new MappingPromiseArray(promises, fn, limit, _filter).promise(); - } - Promise2.prototype.map = function(fn, options2) { - return map(this, fn, options2, null); + this.attribname = ""; + this.attribvalue = ""; }; - Promise2.map = function(promises, fn, options2, _filter) { - return map(promises, fn, options2, _filter); + Parser2.prototype.getInstructionName = function(value) { + var idx = value.search(reNameEnd); + var name = idx < 0 ? value : value.substr(0, idx); + if (this.lowerCaseTagNames) { + name = name.toLowerCase(); + } + return name; }; - }; - } -}); - -// node_modules/bluebird/js/release/nodeify.js -var require_nodeify = __commonJS({ - "node_modules/bluebird/js/release/nodeify.js"(exports2, module2) { - init_shims(); - "use strict"; - module2.exports = function(Promise2) { - var util = require_util(); - var async = Promise2._async; - var tryCatch2 = util.tryCatch; - var errorObj2 = util.errorObj; - function spreadAdapter(val, nodeback) { - var promise = this; - if (!util.isArray(val)) - return successAdapter.call(promise, val, nodeback); - var ret2 = tryCatch2(nodeback).apply(promise._boundValue(), [null].concat(val)); - if (ret2 === errorObj2) { - async.throwLater(ret2.e); - } - } - function successAdapter(val, nodeback) { - var promise = this; - var receiver = promise._boundValue(); - var ret2 = val === void 0 ? tryCatch2(nodeback).call(receiver, null) : tryCatch2(nodeback).call(receiver, null, val); - if (ret2 === errorObj2) { - async.throwLater(ret2.e); - } - } - function errorAdapter(reason, nodeback) { - var promise = this; - if (!reason) { - var newReason = new Error(reason + ""); - newReason.cause = reason; - reason = newReason; - } - var ret2 = tryCatch2(nodeback).call(promise._boundValue(), reason); - if (ret2 === errorObj2) { - async.throwLater(ret2.e); - } - } - Promise2.prototype.asCallback = Promise2.prototype.nodeify = function(nodeback, options2) { - if (typeof nodeback == "function") { - var adapter = successAdapter; - if (options2 !== void 0 && Object(options2).spread) { - adapter = spreadAdapter; - } - this._then(adapter, errorAdapter, void 0, this, nodeback); + Parser2.prototype.ondeclaration = function(value) { + if (this.cbs.onprocessinginstruction) { + var name_1 = this.getInstructionName(value); + this.cbs.onprocessinginstruction("!" + name_1, "!" + value); } - return this; }; - }; - } -}); - -// node_modules/bluebird/js/release/promisify.js -var require_promisify = __commonJS({ - "node_modules/bluebird/js/release/promisify.js"(exports2, module2) { - init_shims(); - "use strict"; - module2.exports = function(Promise2, INTERNAL) { - var THIS = {}; - var util = require_util(); - var nodebackForPromise = require_nodeback(); - var withAppended2 = util.withAppended; - var maybeWrapAsError2 = util.maybeWrapAsError; - var canEvaluate2 = util.canEvaluate; - var TypeError2 = require_errors().TypeError; - var defaultSuffix = "Async"; - var defaultPromisified = { __isPromisified__: true }; - var noCopyProps = [ - "arity", - "length", - "name", - "arguments", - "caller", - "callee", - "prototype", - "__isPromisified__" - ]; - var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); - var defaultFilter = function(name) { - return util.isIdentifier(name) && name.charAt(0) !== "_" && name !== "constructor"; - }; - function propsFilter(key) { - return !noCopyPropsPattern.test(key); - } - function isPromisified(fn) { - try { - return fn.__isPromisified__ === true; - } catch (e) { - return false; - } - } - function hasPromisified(obj, key, suffix) { - var val = util.getDataPropertyOrDefault(obj, key + suffix, defaultPromisified); - return val ? isPromisified(val) : false; - } - function checkValid(ret2, suffix, suffixRegexp) { - for (var i = 0; i < ret2.length; i += 2) { - var key = ret2[i]; - if (suffixRegexp.test(key)) { - var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); - for (var j = 0; j < ret2.length; j += 2) { - if (ret2[j] === keyWithoutAsyncSuffix) { - throw new TypeError2("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s", suffix)); - } - } - } - } - } - function promisifiableMethods(obj, suffix, suffixRegexp, filter) { - var keys = util.inheritedDataKeys(obj); - var ret2 = []; - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var value = obj[key]; - var passesDefaultFilter = filter === defaultFilter ? true : defaultFilter(key, value, obj); - if (typeof value === "function" && !isPromisified(value) && !hasPromisified(obj, key, suffix) && filter(key, value, obj, passesDefaultFilter)) { - ret2.push(key, value); - } + Parser2.prototype.onprocessinginstruction = function(value) { + if (this.cbs.onprocessinginstruction) { + var name_2 = this.getInstructionName(value); + this.cbs.onprocessinginstruction("?" + name_2, "?" + value); } - checkValid(ret2, suffix, suffixRegexp); - return ret2; - } - var escapeIdentRegex = function(str) { - return str.replace(/([$])/, "\\$"); }; - var makeNodePromisifiedEval; - if (true) { - var switchCaseArgumentOrder = function(likelyArgumentCount) { - var ret2 = [likelyArgumentCount]; - var min = Math.max(0, likelyArgumentCount - 1 - 3); - for (var i = likelyArgumentCount - 1; i >= min; --i) { - ret2.push(i); - } - for (var i = likelyArgumentCount + 1; i <= 3; ++i) { - ret2.push(i); - } - return ret2; - }; - var argumentSequence = function(argumentCount) { - return util.filledRange(argumentCount, "_arg", ""); - }; - var parameterDeclaration = function(parameterCount2) { - return util.filledRange(Math.max(parameterCount2, 3), "_arg", ""); - }; - var parameterCount = function(fn) { - if (typeof fn.length === "number") { - return Math.max(Math.min(fn.length, 1023 + 1), 0); - } - return 0; - }; - makeNodePromisifiedEval = function(callback, receiver, originalName, fn, _, multiArgs) { - var newParameterCount = Math.max(0, parameterCount(fn) - 1); - var argumentOrder = switchCaseArgumentOrder(newParameterCount); - var shouldProxyThis = typeof callback === "string" || receiver === THIS; - function generateCallForArgumentCount(count) { - var args = argumentSequence(count).join(", "); - var comma = count > 0 ? ", " : ""; - var ret2; - if (shouldProxyThis) { - ret2 = "ret = callback.call(this, {{args}}, nodeback); break;\n"; - } else { - ret2 = receiver === void 0 ? "ret = callback({{args}}, nodeback); break;\n" : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; - } - return ret2.replace("{{args}}", args).replace(", ", comma); - } - function generateArgumentSwitchCase() { - var ret2 = ""; - for (var i = 0; i < argumentOrder.length; ++i) { - ret2 += "case " + argumentOrder[i] + ":" + generateCallForArgumentCount(argumentOrder[i]); - } - ret2 += " \n default: \n var args = new Array(len + 1); \n var i = 0; \n for (var i = 0; i < len; ++i) { \n args[i] = arguments[i]; \n } \n args[i] = nodeback; \n [CodeForCall] \n break; \n ".replace("[CodeForCall]", shouldProxyThis ? "ret = callback.apply(this, args);\n" : "ret = callback.apply(receiver, args);\n"); - return ret2; - } - var getFunctionCode = typeof callback === "string" ? "this != null ? this['" + callback + "'] : fn" : "fn"; - var body = "'use strict'; \n var ret = function (Parameters) { \n 'use strict'; \n var len = arguments.length; \n var promise = new Promise(INTERNAL); \n promise._captureStackTrace(); \n var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n var ret; \n var callback = tryCatch([GetFunctionCode]); \n switch(len) { \n [CodeForSwitchCase] \n } \n if (ret === errorObj) { \n promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n } \n if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n return promise; \n }; \n notEnumerableProp(ret, '__isPromisified__', true); \n return ret; \n ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()).replace("[GetFunctionCode]", getFunctionCode); - body = body.replace("Parameters", parameterDeclaration(newParameterCount)); - return new Function("Promise", "fn", "receiver", "withAppended", "maybeWrapAsError", "nodebackForPromise", "tryCatch", "errorObj", "notEnumerableProp", "INTERNAL", body)(Promise2, fn, receiver, withAppended2, maybeWrapAsError2, nodebackForPromise, util.tryCatch, util.errorObj, util.notEnumerableProp, INTERNAL); - }; - } - function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) { - var defaultThis = function() { - return this; - }(); - var method = callback; - if (typeof method === "string") { - callback = fn; - } - function promisified() { - var _receiver = receiver; - if (receiver === THIS) - _receiver = this; - var promise = new Promise2(INTERNAL); - promise._captureStackTrace(); - var cb = typeof method === "string" && this !== defaultThis ? this[method] : callback; - var fn2 = nodebackForPromise(promise, multiArgs); - try { - cb.apply(_receiver, withAppended2(arguments, fn2)); - } catch (e) { - promise._rejectCallback(maybeWrapAsError2(e), true, true); - } - if (!promise._isFateSealed()) - promise._setAsyncGuaranteed(); - return promise; - } - util.notEnumerableProp(promisified, "__isPromisified__", true); - return promisified; - } - var makeNodePromisified = canEvaluate2 ? makeNodePromisifiedEval : makeNodePromisifiedClosure; - function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { - var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); - var methods = promisifiableMethods(obj, suffix, suffixRegexp, filter); - for (var i = 0, len = methods.length; i < len; i += 2) { - var key = methods[i]; - var fn = methods[i + 1]; - var promisifiedKey = key + suffix; - if (promisifier === makeNodePromisified) { - obj[promisifiedKey] = makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); - } else { - var promisified = promisifier(fn, function() { - return makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); - }); - util.notEnumerableProp(promisified, "__isPromisified__", true); - obj[promisifiedKey] = promisified; - } - } - util.toFastProperties(obj); - return obj; - } - function promisify(callback, receiver, multiArgs) { - return makeNodePromisified(callback, receiver, void 0, callback, null, multiArgs); - } - Promise2.promisify = function(fn, options2) { - if (typeof fn !== "function") { - throw new TypeError2("expecting a function but got " + util.classString(fn)); + Parser2.prototype.oncomment = function(value) { + var _a, _b, _c, _d; + this.updatePosition(4); + (_b = (_a = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a, value); + (_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c); + }; + Parser2.prototype.oncdata = function(value) { + var _a, _b, _c, _d, _e, _f; + this.updatePosition(1); + if (this.options.xmlMode || this.options.recognizeCDATA) { + (_b = (_a = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a); + (_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value); + (_f = (_e = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e); + } else { + this.oncomment("[CDATA[" + value + "]]"); } - if (isPromisified(fn)) { - return fn; + }; + Parser2.prototype.onerror = function(err) { + var _a, _b; + (_b = (_a = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a, err); + }; + Parser2.prototype.onend = function() { + var _a, _b; + if (this.cbs.onclosetag) { + for (var i = this.stack.length; i > 0; this.cbs.onclosetag(this.stack[--i])) + ; } - options2 = Object(options2); - var receiver = options2.context === void 0 ? THIS : options2.context; - var multiArgs = !!options2.multiArgs; - var ret2 = promisify(fn, receiver, multiArgs); - util.copyDescriptors(fn, ret2, propsFilter); - return ret2; + (_b = (_a = this.cbs).onend) === null || _b === void 0 ? void 0 : _b.call(_a); }; - Promise2.promisifyAll = function(target, options2) { - if (typeof target !== "function" && typeof target !== "object") { - throw new TypeError2("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n"); - } - options2 = Object(options2); - var multiArgs = !!options2.multiArgs; - var suffix = options2.suffix; - if (typeof suffix !== "string") - suffix = defaultSuffix; - var filter = options2.filter; - if (typeof filter !== "function") - filter = defaultFilter; - var promisifier = options2.promisifier; - if (typeof promisifier !== "function") - promisifier = makeNodePromisified; - if (!util.isIdentifier(suffix)) { - throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n"); - } - var keys = util.inheritedDataKeys(target); - for (var i = 0; i < keys.length; ++i) { - var value = target[keys[i]]; - if (keys[i] !== "constructor" && util.isClass(value)) { - promisifyAll(value.prototype, suffix, filter, promisifier, multiArgs); - promisifyAll(value, suffix, filter, promisifier, multiArgs); - } - } - return promisifyAll(target, suffix, filter, promisifier, multiArgs); + Parser2.prototype.reset = function() { + var _a, _b, _c, _d; + (_b = (_a = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a); + this.tokenizer.reset(); + this.tagname = ""; + this.attribname = ""; + this.attribs = null; + this.stack = []; + (_d = (_c = this.cbs).onparserinit) === null || _d === void 0 ? void 0 : _d.call(_c, this); }; - }; + Parser2.prototype.parseComplete = function(data) { + this.reset(); + this.end(data); + }; + Parser2.prototype.write = function(chunk) { + this.tokenizer.write(chunk); + }; + Parser2.prototype.end = function(chunk) { + this.tokenizer.end(chunk); + }; + Parser2.prototype.pause = function() { + this.tokenizer.pause(); + }; + Parser2.prototype.resume = function() { + this.tokenizer.resume(); + }; + Parser2.prototype.parseChunk = function(chunk) { + this.write(chunk); + }; + Parser2.prototype.done = function(chunk) { + this.end(chunk); + }; + return Parser2; + }(); + exports2.Parser = Parser; } }); -// node_modules/bluebird/js/release/props.js -var require_props = __commonJS({ - "node_modules/bluebird/js/release/props.js"(exports2, module2) { +// node_modules/htmlparser2/lib/FeedHandler.js +var require_FeedHandler = __commonJS({ + "node_modules/htmlparser2/lib/FeedHandler.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2, PromiseArray, tryConvertToPromise, apiRejection) { - var util = require_util(); - var isObject2 = util.isObject; - var es52 = require_es5(); - var Es6Map; - if (typeof Map === "function") - Es6Map = Map; - var mapToEntries = function() { - var index2 = 0; - var size = 0; - function extractEntry(value, key) { - this[index2] = value; - this[index2 + size] = key; - index2++; - } - return function mapToEntries2(map) { - size = map.size; - index2 = 0; - var ret2 = new Array(map.size * 2); - map.forEach(extractEntry, ret2); - return ret2; + var __extends = exports2 && exports2.__extends || function() { + var extendStatics = function(d2, b) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) { + d3.__proto__ = b2; + } || function(d3, b2) { + for (var p in b2) + if (Object.prototype.hasOwnProperty.call(b2, p)) + d3[p] = b2[p]; }; - }(); - var entriesToMap = function(entries) { - var ret2 = new Es6Map(); - var length = entries.length / 2 | 0; - for (var i = 0; i < length; ++i) { - var key = entries[length + i]; - var value = entries[i]; - ret2.set(key, value); - } - return ret2; + return extendStatics(d2, b); }; - function PropertiesPromiseArray(obj) { - var isMap = false; - var entries; - if (Es6Map !== void 0 && obj instanceof Es6Map) { - entries = mapToEntries(obj); - isMap = true; - } else { - var keys = es52.keys(obj); - var len = keys.length; - entries = new Array(len * 2); - for (var i = 0; i < len; ++i) { - var key = keys[i]; - entries[i] = obj[key]; - entries[i + len] = key; - } + return function(d2, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d2, b); + function __() { + this.constructor = d2; } - this.constructor$(entries); - this._isMap = isMap; - this._init$(void 0, isMap ? -6 : -3); - } - util.inherits(PropertiesPromiseArray, PromiseArray); - PropertiesPromiseArray.prototype._init = function() { + d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; - PropertiesPromiseArray.prototype._promiseFulfilled = function(value, index2) { - this._values[index2] = value; - var totalResolved = ++this._totalResolved; - if (totalResolved >= this._length) { - var val; - if (this._isMap) { - val = entriesToMap(this._values); - } else { - val = {}; - var keyOffset = this.length(); - for (var i = 0, len = this.length(); i < len; ++i) { - val[this._values[i + keyOffset]] = this._values[i]; - } - } - this._resolve(val); - return true; + }(); + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }); + var __importStar = exports2 && exports2.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + } + __setModuleDefault(result, mod); + return result; + }; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.parseFeed = exports2.FeedHandler = void 0; + var domhandler_1 = __importDefault(require_lib3()); + var DomUtils = __importStar(require_lib6()); + var Parser_1 = require_Parser2(); + var FeedItemMediaMedium; + (function(FeedItemMediaMedium2) { + FeedItemMediaMedium2[FeedItemMediaMedium2["image"] = 0] = "image"; + FeedItemMediaMedium2[FeedItemMediaMedium2["audio"] = 1] = "audio"; + FeedItemMediaMedium2[FeedItemMediaMedium2["video"] = 2] = "video"; + FeedItemMediaMedium2[FeedItemMediaMedium2["document"] = 3] = "document"; + FeedItemMediaMedium2[FeedItemMediaMedium2["executable"] = 4] = "executable"; + })(FeedItemMediaMedium || (FeedItemMediaMedium = {})); + var FeedItemMediaExpression; + (function(FeedItemMediaExpression2) { + FeedItemMediaExpression2[FeedItemMediaExpression2["sample"] = 0] = "sample"; + FeedItemMediaExpression2[FeedItemMediaExpression2["full"] = 1] = "full"; + FeedItemMediaExpression2[FeedItemMediaExpression2["nonstop"] = 2] = "nonstop"; + })(FeedItemMediaExpression || (FeedItemMediaExpression = {})); + var FeedHandler = function(_super) { + __extends(FeedHandler2, _super); + function FeedHandler2(callback, options2) { + var _this = this; + if (typeof callback === "object") { + callback = void 0; + options2 = callback; + } + _this = _super.call(this, callback, options2) || this; + return _this; + } + FeedHandler2.prototype.onend = function() { + var _a, _b; + var feedRoot = getOneElement(isValidFeed, this.dom); + if (!feedRoot) { + this.handleCallback(new Error("couldn't find root of feed")); + return; } - return false; - }; - PropertiesPromiseArray.prototype.shouldCopyValues = function() { - return false; - }; - PropertiesPromiseArray.prototype.getActualLength = function(len) { - return len >> 1; - }; - function props(promises) { - var ret2; - var castValue = tryConvertToPromise(promises); - if (!isObject2(castValue)) { - return apiRejection("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n"); - } else if (castValue instanceof Promise2) { - ret2 = castValue._then(Promise2.props, void 0, void 0, void 0, void 0); + var feed = {}; + if (feedRoot.name === "feed") { + var childs = feedRoot.children; + feed.type = "atom"; + addConditionally(feed, "id", "id", childs); + addConditionally(feed, "title", "title", childs); + var href = getAttribute("href", getOneElement("link", childs)); + if (href) { + feed.link = href; + } + addConditionally(feed, "description", "subtitle", childs); + var updated = fetch2("updated", childs); + if (updated) { + feed.updated = new Date(updated); + } + addConditionally(feed, "author", "email", childs, true); + feed.items = getElements("entry", childs).map(function(item) { + var entry = {}; + var children = item.children; + addConditionally(entry, "id", "id", children); + addConditionally(entry, "title", "title", children); + var href2 = getAttribute("href", getOneElement("link", children)); + if (href2) { + entry.link = href2; + } + var description = fetch2("summary", children) || fetch2("content", children); + if (description) { + entry.description = description; + } + var pubDate = fetch2("updated", children); + if (pubDate) { + entry.pubDate = new Date(pubDate); + } + entry.media = getMediaElements(children); + return entry; + }); } else { - ret2 = new PropertiesPromiseArray(castValue).promise(); + var childs = (_b = (_a = getOneElement("channel", feedRoot.children)) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : []; + feed.type = feedRoot.name.substr(0, 3); + feed.id = ""; + addConditionally(feed, "title", "title", childs); + addConditionally(feed, "link", "link", childs); + addConditionally(feed, "description", "description", childs); + var updated = fetch2("lastBuildDate", childs); + if (updated) { + feed.updated = new Date(updated); + } + addConditionally(feed, "author", "managingEditor", childs, true); + feed.items = getElements("item", feedRoot.children).map(function(item) { + var entry = {}; + var children = item.children; + addConditionally(entry, "id", "guid", children); + addConditionally(entry, "title", "title", children); + addConditionally(entry, "link", "link", children); + addConditionally(entry, "description", "description", children); + var pubDate = fetch2("pubDate", children); + if (pubDate) + entry.pubDate = new Date(pubDate); + entry.media = getMediaElements(children); + return entry; + }); + } + this.feed = feed; + this.handleCallback(null); + }; + return FeedHandler2; + }(domhandler_1.default); + exports2.FeedHandler = FeedHandler; + function getMediaElements(where) { + return getElements("media:content", where).map(function(elem) { + var media = { + medium: elem.attribs.medium, + isDefault: !!elem.attribs.isDefault + }; + if (elem.attribs.url) { + media.url = elem.attribs.url; + } + if (elem.attribs.fileSize) { + media.fileSize = parseInt(elem.attribs.fileSize, 10); + } + if (elem.attribs.type) { + media.type = elem.attribs.type; + } + if (elem.attribs.expression) { + media.expression = elem.attribs.expression; } - if (castValue instanceof Promise2) { - ret2._propagateFrom(castValue, 2); + if (elem.attribs.bitrate) { + media.bitrate = parseInt(elem.attribs.bitrate, 10); } - return ret2; + if (elem.attribs.framerate) { + media.framerate = parseInt(elem.attribs.framerate, 10); + } + if (elem.attribs.samplingrate) { + media.samplingrate = parseInt(elem.attribs.samplingrate, 10); + } + if (elem.attribs.channels) { + media.channels = parseInt(elem.attribs.channels, 10); + } + if (elem.attribs.duration) { + media.duration = parseInt(elem.attribs.duration, 10); + } + if (elem.attribs.height) { + media.height = parseInt(elem.attribs.height, 10); + } + if (elem.attribs.width) { + media.width = parseInt(elem.attribs.width, 10); + } + if (elem.attribs.lang) { + media.lang = elem.attribs.lang; + } + return media; + }); + } + function getElements(tagName, where) { + return DomUtils.getElementsByTagName(tagName, where, true); + } + function getOneElement(tagName, node) { + return DomUtils.getElementsByTagName(tagName, node, true, 1)[0]; + } + function fetch2(tagName, where, recurse) { + if (recurse === void 0) { + recurse = false; } - Promise2.prototype.props = function() { - return props(this); - }; - Promise2.props = function(promises) { - return props(promises); - }; - }; + return DomUtils.getText(DomUtils.getElementsByTagName(tagName, where, recurse, 1)).trim(); + } + function getAttribute(name, elem) { + if (!elem) { + return null; + } + var attribs = elem.attribs; + return attribs[name]; + } + function addConditionally(obj, prop, what, where, recurse) { + if (recurse === void 0) { + recurse = false; + } + var tmp = fetch2(what, where, recurse); + if (tmp) + obj[prop] = tmp; + } + function isValidFeed(value) { + return value === "rss" || value === "feed" || value === "rdf:RDF"; + } + function parseFeed(feed, options2) { + if (options2 === void 0) { + options2 = { xmlMode: true }; + } + var handler2 = new FeedHandler(options2); + new Parser_1.Parser(handler2, options2).end(feed); + return handler2.feed; + } + exports2.parseFeed = parseFeed; } }); -// node_modules/bluebird/js/release/race.js -var require_race = __commonJS({ - "node_modules/bluebird/js/release/race.js"(exports2, module2) { +// node_modules/htmlparser2/lib/index.js +var require_lib10 = __commonJS({ + "node_modules/htmlparser2/lib/index.js"(exports2) { init_shims(); "use strict"; - module2.exports = function(Promise2, INTERNAL, tryConvertToPromise, apiRejection) { - var util = require_util(); - var raceLater = function(promise) { - return promise.then(function(array) { - return race(array, promise); - }); - }; - function race(promises, parent) { - var maybePromise = tryConvertToPromise(promises); - if (maybePromise instanceof Promise2) { - return raceLater(maybePromise); - } else { - promises = util.asArray(promises); - if (promises === null) - return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); - } - var ret2 = new Promise2(INTERNAL); - if (parent !== void 0) { - ret2._propagateFrom(parent, 3); - } - var fulfill = ret2._fulfill; - var reject = ret2._reject; - for (var i = 0, len = promises.length; i < len; ++i) { - var val = promises[i]; - if (val === void 0 && !(i in promises)) { - continue; - } - Promise2.cast(val)._then(fulfill, reject, void 0, ret2, null); - } - return ret2; + var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { + return m[k]; + } }); + } : function(o, m, k, k2) { + if (k2 === void 0) + k2 = k; + o[k2] = m[k]; + }); + var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } : function(o, v) { + o["default"] = v; + }); + var __importStar = exports2 && exports2.__importStar || function(mod) { + if (mod && mod.__esModule) + return mod; + var result = {}; + if (mod != null) { + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); } - Promise2.race = function(promises) { - return race(promises, void 0); - }; - Promise2.prototype.race = function() { - return race(this, void 0); - }; + __setModuleDefault(result, mod); + return result; }; - } -}); - -// node_modules/bluebird/js/release/reduce.js -var require_reduce = __commonJS({ - "node_modules/bluebird/js/release/reduce.js"(exports2, module2) { + var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) + __createBinding(exports3, m, p); + }; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RssHandler = exports2.DefaultHandler = exports2.DomUtils = exports2.ElementType = exports2.Tokenizer = exports2.createDomStream = exports2.parseDOM = exports2.parseDocument = exports2.DomHandler = exports2.Parser = void 0; + var Parser_1 = require_Parser2(); + Object.defineProperty(exports2, "Parser", { enumerable: true, get: function() { + return Parser_1.Parser; + } }); + var domhandler_1 = require_lib3(); + Object.defineProperty(exports2, "DomHandler", { enumerable: true, get: function() { + return domhandler_1.DomHandler; + } }); + Object.defineProperty(exports2, "DefaultHandler", { enumerable: true, get: function() { + return domhandler_1.DomHandler; + } }); + function parseDocument(data, options2) { + var handler2 = new domhandler_1.DomHandler(void 0, options2); + new Parser_1.Parser(handler2, options2).end(data); + return handler2.root; + } + exports2.parseDocument = parseDocument; + function parseDOM(data, options2) { + return parseDocument(data, options2).children; + } + exports2.parseDOM = parseDOM; + function createDomStream(cb, options2, elementCb) { + var handler2 = new domhandler_1.DomHandler(cb, options2, elementCb); + return new Parser_1.Parser(handler2, options2); + } + exports2.createDomStream = createDomStream; + var Tokenizer_1 = require_Tokenizer2(); + Object.defineProperty(exports2, "Tokenizer", { enumerable: true, get: function() { + return __importDefault(Tokenizer_1).default; + } }); + var ElementType = __importStar(require_lib2()); + exports2.ElementType = ElementType; + __exportStar(require_FeedHandler(), exports2); + exports2.DomUtils = __importStar(require_lib6()); + var FeedHandler_1 = require_FeedHandler(); + Object.defineProperty(exports2, "RssHandler", { enumerable: true, get: function() { + return FeedHandler_1.FeedHandler; + } }); + } +}); + +// node_modules/parse5/lib/common/unicode.js +var require_unicode = __commonJS({ + "node_modules/parse5/lib/common/unicode.js"(exports2) { + init_shims(); + "use strict"; + var UNDEFINED_CODE_POINTS = [ + 65534, + 65535, + 131070, + 131071, + 196606, + 196607, + 262142, + 262143, + 327678, + 327679, + 393214, + 393215, + 458750, + 458751, + 524286, + 524287, + 589822, + 589823, + 655358, + 655359, + 720894, + 720895, + 786430, + 786431, + 851966, + 851967, + 917502, + 917503, + 983038, + 983039, + 1048574, + 1048575, + 1114110, + 1114111 + ]; + exports2.REPLACEMENT_CHARACTER = "\uFFFD"; + exports2.CODE_POINTS = { + EOF: -1, + NULL: 0, + TABULATION: 9, + CARRIAGE_RETURN: 13, + LINE_FEED: 10, + FORM_FEED: 12, + SPACE: 32, + EXCLAMATION_MARK: 33, + QUOTATION_MARK: 34, + NUMBER_SIGN: 35, + AMPERSAND: 38, + APOSTROPHE: 39, + HYPHEN_MINUS: 45, + SOLIDUS: 47, + DIGIT_0: 48, + DIGIT_9: 57, + SEMICOLON: 59, + LESS_THAN_SIGN: 60, + EQUALS_SIGN: 61, + GREATER_THAN_SIGN: 62, + QUESTION_MARK: 63, + LATIN_CAPITAL_A: 65, + LATIN_CAPITAL_F: 70, + LATIN_CAPITAL_X: 88, + LATIN_CAPITAL_Z: 90, + RIGHT_SQUARE_BRACKET: 93, + GRAVE_ACCENT: 96, + LATIN_SMALL_A: 97, + LATIN_SMALL_F: 102, + LATIN_SMALL_X: 120, + LATIN_SMALL_Z: 122, + REPLACEMENT_CHARACTER: 65533 + }; + exports2.CODE_POINT_SEQUENCES = { + DASH_DASH_STRING: [45, 45], + DOCTYPE_STRING: [68, 79, 67, 84, 89, 80, 69], + CDATA_START_STRING: [91, 67, 68, 65, 84, 65, 91], + SCRIPT_STRING: [115, 99, 114, 105, 112, 116], + PUBLIC_STRING: [80, 85, 66, 76, 73, 67], + SYSTEM_STRING: [83, 89, 83, 84, 69, 77] + }; + exports2.isSurrogate = function(cp) { + return cp >= 55296 && cp <= 57343; + }; + exports2.isSurrogatePair = function(cp) { + return cp >= 56320 && cp <= 57343; + }; + exports2.getSurrogatePairCodePoint = function(cp1, cp2) { + return (cp1 - 55296) * 1024 + 9216 + cp2; + }; + exports2.isControlCodePoint = function(cp) { + return cp !== 32 && cp !== 10 && cp !== 13 && cp !== 9 && cp !== 12 && cp >= 1 && cp <= 31 || cp >= 127 && cp <= 159; + }; + exports2.isUndefinedCodePoint = function(cp) { + return cp >= 64976 && cp <= 65007 || UNDEFINED_CODE_POINTS.indexOf(cp) > -1; + }; + } +}); + +// node_modules/parse5/lib/common/error-codes.js +var require_error_codes = __commonJS({ + "node_modules/parse5/lib/common/error-codes.js"(exports2, module2) { + init_shims(); + "use strict"; + module2.exports = { + controlCharacterInInputStream: "control-character-in-input-stream", + noncharacterInInputStream: "noncharacter-in-input-stream", + surrogateInInputStream: "surrogate-in-input-stream", + nonVoidHtmlElementStartTagWithTrailingSolidus: "non-void-html-element-start-tag-with-trailing-solidus", + endTagWithAttributes: "end-tag-with-attributes", + endTagWithTrailingSolidus: "end-tag-with-trailing-solidus", + unexpectedSolidusInTag: "unexpected-solidus-in-tag", + unexpectedNullCharacter: "unexpected-null-character", + unexpectedQuestionMarkInsteadOfTagName: "unexpected-question-mark-instead-of-tag-name", + invalidFirstCharacterOfTagName: "invalid-first-character-of-tag-name", + unexpectedEqualsSignBeforeAttributeName: "unexpected-equals-sign-before-attribute-name", + missingEndTagName: "missing-end-tag-name", + unexpectedCharacterInAttributeName: "unexpected-character-in-attribute-name", + unknownNamedCharacterReference: "unknown-named-character-reference", + missingSemicolonAfterCharacterReference: "missing-semicolon-after-character-reference", + unexpectedCharacterAfterDoctypeSystemIdentifier: "unexpected-character-after-doctype-system-identifier", + unexpectedCharacterInUnquotedAttributeValue: "unexpected-character-in-unquoted-attribute-value", + eofBeforeTagName: "eof-before-tag-name", + eofInTag: "eof-in-tag", + missingAttributeValue: "missing-attribute-value", + missingWhitespaceBetweenAttributes: "missing-whitespace-between-attributes", + missingWhitespaceAfterDoctypePublicKeyword: "missing-whitespace-after-doctype-public-keyword", + missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers: "missing-whitespace-between-doctype-public-and-system-identifiers", + missingWhitespaceAfterDoctypeSystemKeyword: "missing-whitespace-after-doctype-system-keyword", + missingQuoteBeforeDoctypePublicIdentifier: "missing-quote-before-doctype-public-identifier", + missingQuoteBeforeDoctypeSystemIdentifier: "missing-quote-before-doctype-system-identifier", + missingDoctypePublicIdentifier: "missing-doctype-public-identifier", + missingDoctypeSystemIdentifier: "missing-doctype-system-identifier", + abruptDoctypePublicIdentifier: "abrupt-doctype-public-identifier", + abruptDoctypeSystemIdentifier: "abrupt-doctype-system-identifier", + cdataInHtmlContent: "cdata-in-html-content", + incorrectlyOpenedComment: "incorrectly-opened-comment", + eofInScriptHtmlCommentLikeText: "eof-in-script-html-comment-like-text", + eofInDoctype: "eof-in-doctype", + nestedComment: "nested-comment", + abruptClosingOfEmptyComment: "abrupt-closing-of-empty-comment", + eofInComment: "eof-in-comment", + incorrectlyClosedComment: "incorrectly-closed-comment", + eofInCdata: "eof-in-cdata", + absenceOfDigitsInNumericCharacterReference: "absence-of-digits-in-numeric-character-reference", + nullCharacterReference: "null-character-reference", + surrogateCharacterReference: "surrogate-character-reference", + characterReferenceOutsideUnicodeRange: "character-reference-outside-unicode-range", + controlCharacterReference: "control-character-reference", + noncharacterCharacterReference: "noncharacter-character-reference", + missingWhitespaceBeforeDoctypeName: "missing-whitespace-before-doctype-name", + missingDoctypeName: "missing-doctype-name", + invalidCharacterSequenceAfterDoctypeName: "invalid-character-sequence-after-doctype-name", + duplicateAttribute: "duplicate-attribute", + nonConformingDoctype: "non-conforming-doctype", + missingDoctype: "missing-doctype", + misplacedDoctype: "misplaced-doctype", + endTagWithoutMatchingOpenElement: "end-tag-without-matching-open-element", + closingOfElementWithOpenChildElements: "closing-of-element-with-open-child-elements", + disallowedContentInNoscriptInHead: "disallowed-content-in-noscript-in-head", + openElementsLeftAfterEof: "open-elements-left-after-eof", + abandonedHeadElementChild: "abandoned-head-element-child", + misplacedStartTagForHeadElement: "misplaced-start-tag-for-head-element", + nestedNoscriptInHead: "nested-noscript-in-head", + eofInElementThatCanContainOnlyText: "eof-in-element-that-can-contain-only-text" + }; + } +}); + +// node_modules/parse5/lib/tokenizer/preprocessor.js +var require_preprocessor = __commonJS({ + "node_modules/parse5/lib/tokenizer/preprocessor.js"(exports2, module2) { init_shims(); "use strict"; - module2.exports = function(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug) { - var util = require_util(); - var tryCatch2 = util.tryCatch; - function ReductionPromiseArray(promises, fn, initialValue, _each) { - this.constructor$(promises); - var context = Promise2._getContext(); - this._fn = util.contextBind(context, fn); - if (initialValue !== void 0) { - initialValue = Promise2.resolve(initialValue); - initialValue._attachCancellationCallback(this); - } - this._initialValue = initialValue; - this._currentCancellable = null; - if (_each === INTERNAL) { - this._eachValues = Array(this._length); - } else if (_each === 0) { - this._eachValues = null; + var unicode = require_unicode(); + var ERR = require_error_codes(); + var $ = unicode.CODE_POINTS; + var DEFAULT_BUFFER_WATERLINE = 1 << 16; + var Preprocessor = class { + constructor() { + this.html = null; + this.pos = -1; + this.lastGapPos = -1; + this.lastCharPos = -1; + this.gapStack = []; + this.skipNextNewLine = false; + this.lastChunkWritten = false; + this.endOfChunkHit = false; + this.bufferWaterline = DEFAULT_BUFFER_WATERLINE; + } + _err() { + } + _addGap() { + this.gapStack.push(this.lastGapPos); + this.lastGapPos = this.pos; + } + _processSurrogate(cp) { + if (this.pos !== this.lastCharPos) { + const nextCp = this.html.charCodeAt(this.pos + 1); + if (unicode.isSurrogatePair(nextCp)) { + this.pos++; + this._addGap(); + return unicode.getSurrogatePairCodePoint(cp, nextCp); + } + } else if (!this.lastChunkWritten) { + this.endOfChunkHit = true; + return $.EOF; + } + this._err(ERR.surrogateInInputStream); + return cp; + } + dropParsedChunk() { + if (this.pos > this.bufferWaterline) { + this.lastCharPos -= this.pos; + this.html = this.html.substring(this.pos); + this.pos = 0; + this.lastGapPos = -1; + this.gapStack = []; + } + } + write(chunk, isLastChunk) { + if (this.html) { + this.html += chunk; } else { - this._eachValues = void 0; + this.html = chunk; } - this._promise._captureStackTrace(); - this._init$(void 0, -5); + this.lastCharPos = this.html.length - 1; + this.endOfChunkHit = false; + this.lastChunkWritten = isLastChunk; } - util.inherits(ReductionPromiseArray, PromiseArray); - ReductionPromiseArray.prototype._gotAccum = function(accum) { - if (this._eachValues !== void 0 && this._eachValues !== null && accum !== INTERNAL) { - this._eachValues.push(accum); - } - }; - ReductionPromiseArray.prototype._eachComplete = function(value) { - if (this._eachValues !== null) { - this._eachValues.push(value); - } - return this._eachValues; - }; - ReductionPromiseArray.prototype._init = function() { - }; - ReductionPromiseArray.prototype._resolveEmptyArray = function() { - this._resolve(this._eachValues !== void 0 ? this._eachValues : this._initialValue); - }; - ReductionPromiseArray.prototype.shouldCopyValues = function() { - return false; - }; - ReductionPromiseArray.prototype._resolve = function(value) { - this._promise._resolveCallback(value); - this._values = null; - }; - ReductionPromiseArray.prototype._resultCancelled = function(sender) { - if (sender === this._initialValue) - return this._cancel(); - if (this._isResolved()) - return; - this._resultCancelled$(); - if (this._currentCancellable instanceof Promise2) { - this._currentCancellable.cancel(); - } - if (this._initialValue instanceof Promise2) { - this._initialValue.cancel(); + insertHtmlAtCurrentPos(chunk) { + this.html = this.html.substring(0, this.pos + 1) + chunk + this.html.substring(this.pos + 1, this.html.length); + this.lastCharPos = this.html.length - 1; + this.endOfChunkHit = false; + } + advance() { + this.pos++; + if (this.pos > this.lastCharPos) { + this.endOfChunkHit = !this.lastChunkWritten; + return $.EOF; } - }; - ReductionPromiseArray.prototype._iterate = function(values) { - this._values = values; - var value; - var i; - var length = values.length; - if (this._initialValue !== void 0) { - value = this._initialValue; - i = 0; - } else { - value = Promise2.resolve(values[0]); - i = 1; - } - this._currentCancellable = value; - for (var j = i; j < length; ++j) { - var maybePromise = values[j]; - if (maybePromise instanceof Promise2) { - maybePromise.suppressUnhandledRejections(); - } - } - if (!value.isRejected()) { - for (; i < length; ++i) { - var ctx = { - accum: null, - value: values[i], - index: i, - length, - array: this - }; - value = value._then(gotAccum, void 0, void 0, ctx, void 0); - if ((i & 127) === 0) { - value._setNoAsyncGuarantee(); - } - } + let cp = this.html.charCodeAt(this.pos); + if (this.skipNextNewLine && cp === $.LINE_FEED) { + this.skipNextNewLine = false; + this._addGap(); + return this.advance(); } - if (this._eachValues !== void 0) { - value = value._then(this._eachComplete, void 0, void 0, this, void 0); + if (cp === $.CARRIAGE_RETURN) { + this.skipNextNewLine = true; + return $.LINE_FEED; } - value._then(completed, completed, void 0, value, this); - }; - Promise2.prototype.reduce = function(fn, initialValue) { - return reduce(this, fn, initialValue, null); - }; - Promise2.reduce = function(promises, fn, initialValue, _each) { - return reduce(promises, fn, initialValue, _each); - }; - function completed(valueOrReason, array) { - if (this.isFulfilled()) { - array._resolve(valueOrReason); - } else { - array._reject(valueOrReason); + this.skipNextNewLine = false; + if (unicode.isSurrogate(cp)) { + cp = this._processSurrogate(cp); } - } - function reduce(promises, fn, initialValue, _each) { - if (typeof fn !== "function") { - return apiRejection("expecting a function but got " + util.classString(fn)); + const isCommonValidRange = cp > 31 && cp < 127 || cp === $.LINE_FEED || cp === $.CARRIAGE_RETURN || cp > 159 && cp < 64976; + if (!isCommonValidRange) { + this._checkForProblematicCharacters(cp); } - var array = new ReductionPromiseArray(promises, fn, initialValue, _each); - return array.promise(); + return cp; } - function gotAccum(accum) { - this.accum = accum; - this.array._gotAccum(accum); - var value = tryConvertToPromise(this.value, this.array._promise); - if (value instanceof Promise2) { - this.array._currentCancellable = value; - return value._then(gotValue, void 0, void 0, this, void 0); - } else { - return gotValue.call(this, value); + _checkForProblematicCharacters(cp) { + if (unicode.isControlCodePoint(cp)) { + this._err(ERR.controlCharacterInInputStream); + } else if (unicode.isUndefinedCodePoint(cp)) { + this._err(ERR.noncharacterInInputStream); } } - function gotValue(value) { - var array = this.array; - var promise = array._promise; - var fn = tryCatch2(array._fn); - promise._pushContext(); - var ret2; - if (array._eachValues !== void 0) { - ret2 = fn.call(promise._boundValue(), value, this.index, this.length); - } else { - ret2 = fn.call(promise._boundValue(), this.accum, value, this.index, this.length); - } - if (ret2 instanceof Promise2) { - array._currentCancellable = ret2; + retreat() { + if (this.pos === this.lastGapPos) { + this.lastGapPos = this.gapStack.pop(); + this.pos--; } - var promiseCreated = promise._popContext(); - debug.checkForgottenReturns(ret2, promiseCreated, array._eachValues !== void 0 ? "Promise.each" : "Promise.reduce", promise); - return ret2; + this.pos--; } }; + module2.exports = Preprocessor; } }); -// node_modules/bluebird/js/release/settle.js -var require_settle = __commonJS({ - "node_modules/bluebird/js/release/settle.js"(exports2, module2) { +// node_modules/parse5/lib/tokenizer/named-entity-data.js +var require_named_entity_data = __commonJS({ + "node_modules/parse5/lib/tokenizer/named-entity-data.js"(exports2, module2) { init_shims(); "use strict"; - module2.exports = function(Promise2, PromiseArray, debug) { - var PromiseInspection = Promise2.PromiseInspection; - var util = require_util(); - function SettledPromiseArray(values) { - this.constructor$(values); - } - util.inherits(SettledPromiseArray, PromiseArray); - SettledPromiseArray.prototype._promiseResolved = function(index2, inspection) { - this._values[index2] = inspection; - var totalResolved = ++this._totalResolved; - if (totalResolved >= this._length) { - this._resolve(this._values); - return true; - } - return false; - }; - SettledPromiseArray.prototype._promiseFulfilled = function(value, index2) { - var ret2 = new PromiseInspection(); - ret2._bitField = 33554432; - ret2._settledValueField = value; - return this._promiseResolved(index2, ret2); - }; - SettledPromiseArray.prototype._promiseRejected = function(reason, index2) { - var ret2 = new PromiseInspection(); - ret2._bitField = 16777216; - ret2._settledValueField = reason; - return this._promiseResolved(index2, ret2); - }; - Promise2.settle = function(promises) { - debug.deprecated(".settle()", ".reflect()"); - return new SettledPromiseArray(promises).promise(); - }; - Promise2.allSettled = function(promises) { - return new SettledPromiseArray(promises).promise(); - }; - Promise2.prototype.settle = function() { - return Promise2.settle(this); - }; - }; + module2.exports = new Uint16Array([4, 52, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 106, 303, 412, 810, 1432, 1701, 1796, 1987, 2114, 2360, 2420, 2484, 3170, 3251, 4140, 4393, 4575, 4610, 5106, 5512, 5728, 6117, 6274, 6315, 6345, 6427, 6516, 7002, 7910, 8733, 9323, 9870, 10170, 10631, 10893, 11318, 11386, 11467, 12773, 13092, 14474, 14922, 15448, 15542, 16419, 17666, 18166, 18611, 19004, 19095, 19298, 19397, 4, 16, 69, 77, 97, 98, 99, 102, 103, 108, 109, 110, 111, 112, 114, 115, 116, 117, 140, 150, 158, 169, 176, 194, 199, 210, 216, 222, 226, 242, 256, 266, 283, 294, 108, 105, 103, 5, 198, 1, 59, 148, 1, 198, 80, 5, 38, 1, 59, 156, 1, 38, 99, 117, 116, 101, 5, 193, 1, 59, 167, 1, 193, 114, 101, 118, 101, 59, 1, 258, 4, 2, 105, 121, 182, 191, 114, 99, 5, 194, 1, 59, 189, 1, 194, 59, 1, 1040, 114, 59, 3, 55349, 56580, 114, 97, 118, 101, 5, 192, 1, 59, 208, 1, 192, 112, 104, 97, 59, 1, 913, 97, 99, 114, 59, 1, 256, 100, 59, 1, 10835, 4, 2, 103, 112, 232, 237, 111, 110, 59, 1, 260, 102, 59, 3, 55349, 56632, 112, 108, 121, 70, 117, 110, 99, 116, 105, 111, 110, 59, 1, 8289, 105, 110, 103, 5, 197, 1, 59, 264, 1, 197, 4, 2, 99, 115, 272, 277, 114, 59, 3, 55349, 56476, 105, 103, 110, 59, 1, 8788, 105, 108, 100, 101, 5, 195, 1, 59, 292, 1, 195, 109, 108, 5, 196, 1, 59, 301, 1, 196, 4, 8, 97, 99, 101, 102, 111, 114, 115, 117, 321, 350, 354, 383, 388, 394, 400, 405, 4, 2, 99, 114, 327, 336, 107, 115, 108, 97, 115, 104, 59, 1, 8726, 4, 2, 118, 119, 342, 345, 59, 1, 10983, 101, 100, 59, 1, 8966, 121, 59, 1, 1041, 4, 3, 99, 114, 116, 362, 369, 379, 97, 117, 115, 101, 59, 1, 8757, 110, 111, 117, 108, 108, 105, 115, 59, 1, 8492, 97, 59, 1, 914, 114, 59, 3, 55349, 56581, 112, 102, 59, 3, 55349, 56633, 101, 118, 101, 59, 1, 728, 99, 114, 59, 1, 8492, 109, 112, 101, 113, 59, 1, 8782, 4, 14, 72, 79, 97, 99, 100, 101, 102, 104, 105, 108, 111, 114, 115, 117, 442, 447, 456, 504, 542, 547, 569, 573, 577, 616, 678, 784, 790, 796, 99, 121, 59, 1, 1063, 80, 89, 5, 169, 1, 59, 454, 1, 169, 4, 3, 99, 112, 121, 464, 470, 497, 117, 116, 101, 59, 1, 262, 4, 2, 59, 105, 476, 478, 1, 8914, 116, 97, 108, 68, 105, 102, 102, 101, 114, 101, 110, 116, 105, 97, 108, 68, 59, 1, 8517, 108, 101, 121, 115, 59, 1, 8493, 4, 4, 97, 101, 105, 111, 514, 520, 530, 535, 114, 111, 110, 59, 1, 268, 100, 105, 108, 5, 199, 1, 59, 528, 1, 199, 114, 99, 59, 1, 264, 110, 105, 110, 116, 59, 1, 8752, 111, 116, 59, 1, 266, 4, 2, 100, 110, 553, 560, 105, 108, 108, 97, 59, 1, 184, 116, 101, 114, 68, 111, 116, 59, 1, 183, 114, 59, 1, 8493, 105, 59, 1, 935, 114, 99, 108, 101, 4, 4, 68, 77, 80, 84, 591, 596, 603, 609, 111, 116, 59, 1, 8857, 105, 110, 117, 115, 59, 1, 8854, 108, 117, 115, 59, 1, 8853, 105, 109, 101, 115, 59, 1, 8855, 111, 4, 2, 99, 115, 623, 646, 107, 119, 105, 115, 101, 67, 111, 110, 116, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 1, 8754, 101, 67, 117, 114, 108, 121, 4, 2, 68, 81, 658, 671, 111, 117, 98, 108, 101, 81, 117, 111, 116, 101, 59, 1, 8221, 117, 111, 116, 101, 59, 1, 8217, 4, 4, 108, 110, 112, 117, 688, 701, 736, 753, 111, 110, 4, 2, 59, 101, 696, 698, 1, 8759, 59, 1, 10868, 4, 3, 103, 105, 116, 709, 717, 722, 114, 117, 101, 110, 116, 59, 1, 8801, 110, 116, 59, 1, 8751, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 1, 8750, 4, 2, 102, 114, 742, 745, 59, 1, 8450, 111, 100, 117, 99, 116, 59, 1, 8720, 110, 116, 101, 114, 67, 108, 111, 99, 107, 119, 105, 115, 101, 67, 111, 110, 116, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 1, 8755, 111, 115, 115, 59, 1, 10799, 99, 114, 59, 3, 55349, 56478, 112, 4, 2, 59, 67, 803, 805, 1, 8915, 97, 112, 59, 1, 8781, 4, 11, 68, 74, 83, 90, 97, 99, 101, 102, 105, 111, 115, 834, 850, 855, 860, 865, 888, 903, 916, 921, 1011, 1415, 4, 2, 59, 111, 840, 842, 1, 8517, 116, 114, 97, 104, 100, 59, 1, 10513, 99, 121, 59, 1, 1026, 99, 121, 59, 1, 1029, 99, 121, 59, 1, 1039, 4, 3, 103, 114, 115, 873, 879, 883, 103, 101, 114, 59, 1, 8225, 114, 59, 1, 8609, 104, 118, 59, 1, 10980, 4, 2, 97, 121, 894, 900, 114, 111, 110, 59, 1, 270, 59, 1, 1044, 108, 4, 2, 59, 116, 910, 912, 1, 8711, 97, 59, 1, 916, 114, 59, 3, 55349, 56583, 4, 2, 97, 102, 927, 998, 4, 2, 99, 109, 933, 992, 114, 105, 116, 105, 99, 97, 108, 4, 4, 65, 68, 71, 84, 950, 957, 978, 985, 99, 117, 116, 101, 59, 1, 180, 111, 4, 2, 116, 117, 964, 967, 59, 1, 729, 98, 108, 101, 65, 99, 117, 116, 101, 59, 1, 733, 114, 97, 118, 101, 59, 1, 96, 105, 108, 100, 101, 59, 1, 732, 111, 110, 100, 59, 1, 8900, 102, 101, 114, 101, 110, 116, 105, 97, 108, 68, 59, 1, 8518, 4, 4, 112, 116, 117, 119, 1021, 1026, 1048, 1249, 102, 59, 3, 55349, 56635, 4, 3, 59, 68, 69, 1034, 1036, 1041, 1, 168, 111, 116, 59, 1, 8412, 113, 117, 97, 108, 59, 1, 8784, 98, 108, 101, 4, 6, 67, 68, 76, 82, 85, 86, 1065, 1082, 1101, 1189, 1211, 1236, 111, 110, 116, 111, 117, 114, 73, 110, 116, 101, 103, 114, 97, 108, 59, 1, 8751, 111, 4, 2, 116, 119, 1089, 1092, 59, 1, 168, 110, 65, 114, 114, 111, 119, 59, 1, 8659, 4, 2, 101, 111, 1107, 1141, 102, 116, 4, 3, 65, 82, 84, 1117, 1124, 1136, 114, 114, 111, 119, 59, 1, 8656, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 8660, 101, 101, 59, 1, 10980, 110, 103, 4, 2, 76, 82, 1149, 1177, 101, 102, 116, 4, 2, 65, 82, 1158, 1165, 114, 114, 111, 119, 59, 1, 10232, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 10234, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 10233, 105, 103, 104, 116, 4, 2, 65, 84, 1199, 1206, 114, 114, 111, 119, 59, 1, 8658, 101, 101, 59, 1, 8872, 112, 4, 2, 65, 68, 1218, 1225, 114, 114, 111, 119, 59, 1, 8657, 111, 119, 110, 65, 114, 114, 111, 119, 59, 1, 8661, 101, 114, 116, 105, 99, 97, 108, 66, 97, 114, 59, 1, 8741, 110, 4, 6, 65, 66, 76, 82, 84, 97, 1264, 1292, 1299, 1352, 1391, 1408, 114, 114, 111, 119, 4, 3, 59, 66, 85, 1276, 1278, 1283, 1, 8595, 97, 114, 59, 1, 10515, 112, 65, 114, 114, 111, 119, 59, 1, 8693, 114, 101, 118, 101, 59, 1, 785, 101, 102, 116, 4, 3, 82, 84, 86, 1310, 1323, 1334, 105, 103, 104, 116, 86, 101, 99, 116, 111, 114, 59, 1, 10576, 101, 101, 86, 101, 99, 116, 111, 114, 59, 1, 10590, 101, 99, 116, 111, 114, 4, 2, 59, 66, 1345, 1347, 1, 8637, 97, 114, 59, 1, 10582, 105, 103, 104, 116, 4, 2, 84, 86, 1362, 1373, 101, 101, 86, 101, 99, 116, 111, 114, 59, 1, 10591, 101, 99, 116, 111, 114, 4, 2, 59, 66, 1384, 1386, 1, 8641, 97, 114, 59, 1, 10583, 101, 101, 4, 2, 59, 65, 1399, 1401, 1, 8868, 114, 114, 111, 119, 59, 1, 8615, 114, 114, 111, 119, 59, 1, 8659, 4, 2, 99, 116, 1421, 1426, 114, 59, 3, 55349, 56479, 114, 111, 107, 59, 1, 272, 4, 16, 78, 84, 97, 99, 100, 102, 103, 108, 109, 111, 112, 113, 115, 116, 117, 120, 1466, 1470, 1478, 1489, 1515, 1520, 1525, 1536, 1544, 1593, 1609, 1617, 1650, 1664, 1668, 1677, 71, 59, 1, 330, 72, 5, 208, 1, 59, 1476, 1, 208, 99, 117, 116, 101, 5, 201, 1, 59, 1487, 1, 201, 4, 3, 97, 105, 121, 1497, 1503, 1512, 114, 111, 110, 59, 1, 282, 114, 99, 5, 202, 1, 59, 1510, 1, 202, 59, 1, 1069, 111, 116, 59, 1, 278, 114, 59, 3, 55349, 56584, 114, 97, 118, 101, 5, 200, 1, 59, 1534, 1, 200, 101, 109, 101, 110, 116, 59, 1, 8712, 4, 2, 97, 112, 1550, 1555, 99, 114, 59, 1, 274, 116, 121, 4, 2, 83, 86, 1563, 1576, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 1, 9723, 101, 114, 121, 83, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 1, 9643, 4, 2, 103, 112, 1599, 1604, 111, 110, 59, 1, 280, 102, 59, 3, 55349, 56636, 115, 105, 108, 111, 110, 59, 1, 917, 117, 4, 2, 97, 105, 1624, 1640, 108, 4, 2, 59, 84, 1631, 1633, 1, 10869, 105, 108, 100, 101, 59, 1, 8770, 108, 105, 98, 114, 105, 117, 109, 59, 1, 8652, 4, 2, 99, 105, 1656, 1660, 114, 59, 1, 8496, 109, 59, 1, 10867, 97, 59, 1, 919, 109, 108, 5, 203, 1, 59, 1675, 1, 203, 4, 2, 105, 112, 1683, 1689, 115, 116, 115, 59, 1, 8707, 111, 110, 101, 110, 116, 105, 97, 108, 69, 59, 1, 8519, 4, 5, 99, 102, 105, 111, 115, 1713, 1717, 1722, 1762, 1791, 121, 59, 1, 1060, 114, 59, 3, 55349, 56585, 108, 108, 101, 100, 4, 2, 83, 86, 1732, 1745, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 1, 9724, 101, 114, 121, 83, 109, 97, 108, 108, 83, 113, 117, 97, 114, 101, 59, 1, 9642, 4, 3, 112, 114, 117, 1770, 1775, 1781, 102, 59, 3, 55349, 56637, 65, 108, 108, 59, 1, 8704, 114, 105, 101, 114, 116, 114, 102, 59, 1, 8497, 99, 114, 59, 1, 8497, 4, 12, 74, 84, 97, 98, 99, 100, 102, 103, 111, 114, 115, 116, 1822, 1827, 1834, 1848, 1855, 1877, 1882, 1887, 1890, 1896, 1978, 1984, 99, 121, 59, 1, 1027, 5, 62, 1, 59, 1832, 1, 62, 109, 109, 97, 4, 2, 59, 100, 1843, 1845, 1, 915, 59, 1, 988, 114, 101, 118, 101, 59, 1, 286, 4, 3, 101, 105, 121, 1863, 1869, 1874, 100, 105, 108, 59, 1, 290, 114, 99, 59, 1, 284, 59, 1, 1043, 111, 116, 59, 1, 288, 114, 59, 3, 55349, 56586, 59, 1, 8921, 112, 102, 59, 3, 55349, 56638, 101, 97, 116, 101, 114, 4, 6, 69, 70, 71, 76, 83, 84, 1915, 1933, 1944, 1953, 1959, 1971, 113, 117, 97, 108, 4, 2, 59, 76, 1925, 1927, 1, 8805, 101, 115, 115, 59, 1, 8923, 117, 108, 108, 69, 113, 117, 97, 108, 59, 1, 8807, 114, 101, 97, 116, 101, 114, 59, 1, 10914, 101, 115, 115, 59, 1, 8823, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 1, 10878, 105, 108, 100, 101, 59, 1, 8819, 99, 114, 59, 3, 55349, 56482, 59, 1, 8811, 4, 8, 65, 97, 99, 102, 105, 111, 115, 117, 2005, 2012, 2026, 2032, 2036, 2049, 2073, 2089, 82, 68, 99, 121, 59, 1, 1066, 4, 2, 99, 116, 2018, 2023, 101, 107, 59, 1, 711, 59, 1, 94, 105, 114, 99, 59, 1, 292, 114, 59, 1, 8460, 108, 98, 101, 114, 116, 83, 112, 97, 99, 101, 59, 1, 8459, 4, 2, 112, 114, 2055, 2059, 102, 59, 1, 8461, 105, 122, 111, 110, 116, 97, 108, 76, 105, 110, 101, 59, 1, 9472, 4, 2, 99, 116, 2079, 2083, 114, 59, 1, 8459, 114, 111, 107, 59, 1, 294, 109, 112, 4, 2, 68, 69, 2097, 2107, 111, 119, 110, 72, 117, 109, 112, 59, 1, 8782, 113, 117, 97, 108, 59, 1, 8783, 4, 14, 69, 74, 79, 97, 99, 100, 102, 103, 109, 110, 111, 115, 116, 117, 2144, 2149, 2155, 2160, 2171, 2189, 2194, 2198, 2209, 2245, 2307, 2329, 2334, 2341, 99, 121, 59, 1, 1045, 108, 105, 103, 59, 1, 306, 99, 121, 59, 1, 1025, 99, 117, 116, 101, 5, 205, 1, 59, 2169, 1, 205, 4, 2, 105, 121, 2177, 2186, 114, 99, 5, 206, 1, 59, 2184, 1, 206, 59, 1, 1048, 111, 116, 59, 1, 304, 114, 59, 1, 8465, 114, 97, 118, 101, 5, 204, 1, 59, 2207, 1, 204, 4, 3, 59, 97, 112, 2217, 2219, 2238, 1, 8465, 4, 2, 99, 103, 2225, 2229, 114, 59, 1, 298, 105, 110, 97, 114, 121, 73, 59, 1, 8520, 108, 105, 101, 115, 59, 1, 8658, 4, 2, 116, 118, 2251, 2281, 4, 2, 59, 101, 2257, 2259, 1, 8748, 4, 2, 103, 114, 2265, 2271, 114, 97, 108, 59, 1, 8747, 115, 101, 99, 116, 105, 111, 110, 59, 1, 8898, 105, 115, 105, 98, 108, 101, 4, 2, 67, 84, 2293, 2300, 111, 109, 109, 97, 59, 1, 8291, 105, 109, 101, 115, 59, 1, 8290, 4, 3, 103, 112, 116, 2315, 2320, 2325, 111, 110, 59, 1, 302, 102, 59, 3, 55349, 56640, 97, 59, 1, 921, 99, 114, 59, 1, 8464, 105, 108, 100, 101, 59, 1, 296, 4, 2, 107, 109, 2347, 2352, 99, 121, 59, 1, 1030, 108, 5, 207, 1, 59, 2358, 1, 207, 4, 5, 99, 102, 111, 115, 117, 2372, 2386, 2391, 2397, 2414, 4, 2, 105, 121, 2378, 2383, 114, 99, 59, 1, 308, 59, 1, 1049, 114, 59, 3, 55349, 56589, 112, 102, 59, 3, 55349, 56641, 4, 2, 99, 101, 2403, 2408, 114, 59, 3, 55349, 56485, 114, 99, 121, 59, 1, 1032, 107, 99, 121, 59, 1, 1028, 4, 7, 72, 74, 97, 99, 102, 111, 115, 2436, 2441, 2446, 2452, 2467, 2472, 2478, 99, 121, 59, 1, 1061, 99, 121, 59, 1, 1036, 112, 112, 97, 59, 1, 922, 4, 2, 101, 121, 2458, 2464, 100, 105, 108, 59, 1, 310, 59, 1, 1050, 114, 59, 3, 55349, 56590, 112, 102, 59, 3, 55349, 56642, 99, 114, 59, 3, 55349, 56486, 4, 11, 74, 84, 97, 99, 101, 102, 108, 109, 111, 115, 116, 2508, 2513, 2520, 2562, 2585, 2981, 2986, 3004, 3011, 3146, 3167, 99, 121, 59, 1, 1033, 5, 60, 1, 59, 2518, 1, 60, 4, 5, 99, 109, 110, 112, 114, 2532, 2538, 2544, 2548, 2558, 117, 116, 101, 59, 1, 313, 98, 100, 97, 59, 1, 923, 103, 59, 1, 10218, 108, 97, 99, 101, 116, 114, 102, 59, 1, 8466, 114, 59, 1, 8606, 4, 3, 97, 101, 121, 2570, 2576, 2582, 114, 111, 110, 59, 1, 317, 100, 105, 108, 59, 1, 315, 59, 1, 1051, 4, 2, 102, 115, 2591, 2907, 116, 4, 10, 65, 67, 68, 70, 82, 84, 85, 86, 97, 114, 2614, 2663, 2672, 2728, 2735, 2760, 2820, 2870, 2888, 2895, 4, 2, 110, 114, 2620, 2633, 103, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 1, 10216, 114, 111, 119, 4, 3, 59, 66, 82, 2644, 2646, 2651, 1, 8592, 97, 114, 59, 1, 8676, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 8646, 101, 105, 108, 105, 110, 103, 59, 1, 8968, 111, 4, 2, 117, 119, 2679, 2692, 98, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 1, 10214, 110, 4, 2, 84, 86, 2699, 2710, 101, 101, 86, 101, 99, 116, 111, 114, 59, 1, 10593, 101, 99, 116, 111, 114, 4, 2, 59, 66, 2721, 2723, 1, 8643, 97, 114, 59, 1, 10585, 108, 111, 111, 114, 59, 1, 8970, 105, 103, 104, 116, 4, 2, 65, 86, 2745, 2752, 114, 114, 111, 119, 59, 1, 8596, 101, 99, 116, 111, 114, 59, 1, 10574, 4, 2, 101, 114, 2766, 2792, 101, 4, 3, 59, 65, 86, 2775, 2777, 2784, 1, 8867, 114, 114, 111, 119, 59, 1, 8612, 101, 99, 116, 111, 114, 59, 1, 10586, 105, 97, 110, 103, 108, 101, 4, 3, 59, 66, 69, 2806, 2808, 2813, 1, 8882, 97, 114, 59, 1, 10703, 113, 117, 97, 108, 59, 1, 8884, 112, 4, 3, 68, 84, 86, 2829, 2841, 2852, 111, 119, 110, 86, 101, 99, 116, 111, 114, 59, 1, 10577, 101, 101, 86, 101, 99, 116, 111, 114, 59, 1, 10592, 101, 99, 116, 111, 114, 4, 2, 59, 66, 2863, 2865, 1, 8639, 97, 114, 59, 1, 10584, 101, 99, 116, 111, 114, 4, 2, 59, 66, 2881, 2883, 1, 8636, 97, 114, 59, 1, 10578, 114, 114, 111, 119, 59, 1, 8656, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8660, 115, 4, 6, 69, 70, 71, 76, 83, 84, 2922, 2936, 2947, 2956, 2962, 2974, 113, 117, 97, 108, 71, 114, 101, 97, 116, 101, 114, 59, 1, 8922, 117, 108, 108, 69, 113, 117, 97, 108, 59, 1, 8806, 114, 101, 97, 116, 101, 114, 59, 1, 8822, 101, 115, 115, 59, 1, 10913, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 1, 10877, 105, 108, 100, 101, 59, 1, 8818, 114, 59, 3, 55349, 56591, 4, 2, 59, 101, 2992, 2994, 1, 8920, 102, 116, 97, 114, 114, 111, 119, 59, 1, 8666, 105, 100, 111, 116, 59, 1, 319, 4, 3, 110, 112, 119, 3019, 3110, 3115, 103, 4, 4, 76, 82, 108, 114, 3030, 3058, 3070, 3098, 101, 102, 116, 4, 2, 65, 82, 3039, 3046, 114, 114, 111, 119, 59, 1, 10229, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 10231, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 10230, 101, 102, 116, 4, 2, 97, 114, 3079, 3086, 114, 114, 111, 119, 59, 1, 10232, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 10234, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 10233, 102, 59, 3, 55349, 56643, 101, 114, 4, 2, 76, 82, 3123, 3134, 101, 102, 116, 65, 114, 114, 111, 119, 59, 1, 8601, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 8600, 4, 3, 99, 104, 116, 3154, 3158, 3161, 114, 59, 1, 8466, 59, 1, 8624, 114, 111, 107, 59, 1, 321, 59, 1, 8810, 4, 8, 97, 99, 101, 102, 105, 111, 115, 117, 3188, 3192, 3196, 3222, 3227, 3237, 3243, 3248, 112, 59, 1, 10501, 121, 59, 1, 1052, 4, 2, 100, 108, 3202, 3213, 105, 117, 109, 83, 112, 97, 99, 101, 59, 1, 8287, 108, 105, 110, 116, 114, 102, 59, 1, 8499, 114, 59, 3, 55349, 56592, 110, 117, 115, 80, 108, 117, 115, 59, 1, 8723, 112, 102, 59, 3, 55349, 56644, 99, 114, 59, 1, 8499, 59, 1, 924, 4, 9, 74, 97, 99, 101, 102, 111, 115, 116, 117, 3271, 3276, 3283, 3306, 3422, 3427, 4120, 4126, 4137, 99, 121, 59, 1, 1034, 99, 117, 116, 101, 59, 1, 323, 4, 3, 97, 101, 121, 3291, 3297, 3303, 114, 111, 110, 59, 1, 327, 100, 105, 108, 59, 1, 325, 59, 1, 1053, 4, 3, 103, 115, 119, 3314, 3380, 3415, 97, 116, 105, 118, 101, 4, 3, 77, 84, 86, 3327, 3340, 3365, 101, 100, 105, 117, 109, 83, 112, 97, 99, 101, 59, 1, 8203, 104, 105, 4, 2, 99, 110, 3348, 3357, 107, 83, 112, 97, 99, 101, 59, 1, 8203, 83, 112, 97, 99, 101, 59, 1, 8203, 101, 114, 121, 84, 104, 105, 110, 83, 112, 97, 99, 101, 59, 1, 8203, 116, 101, 100, 4, 2, 71, 76, 3389, 3405, 114, 101, 97, 116, 101, 114, 71, 114, 101, 97, 116, 101, 114, 59, 1, 8811, 101, 115, 115, 76, 101, 115, 115, 59, 1, 8810, 76, 105, 110, 101, 59, 1, 10, 114, 59, 3, 55349, 56593, 4, 4, 66, 110, 112, 116, 3437, 3444, 3460, 3464, 114, 101, 97, 107, 59, 1, 8288, 66, 114, 101, 97, 107, 105, 110, 103, 83, 112, 97, 99, 101, 59, 1, 160, 102, 59, 1, 8469, 4, 13, 59, 67, 68, 69, 71, 72, 76, 78, 80, 82, 83, 84, 86, 3492, 3494, 3517, 3536, 3578, 3657, 3685, 3784, 3823, 3860, 3915, 4066, 4107, 1, 10988, 4, 2, 111, 117, 3500, 3510, 110, 103, 114, 117, 101, 110, 116, 59, 1, 8802, 112, 67, 97, 112, 59, 1, 8813, 111, 117, 98, 108, 101, 86, 101, 114, 116, 105, 99, 97, 108, 66, 97, 114, 59, 1, 8742, 4, 3, 108, 113, 120, 3544, 3552, 3571, 101, 109, 101, 110, 116, 59, 1, 8713, 117, 97, 108, 4, 2, 59, 84, 3561, 3563, 1, 8800, 105, 108, 100, 101, 59, 3, 8770, 824, 105, 115, 116, 115, 59, 1, 8708, 114, 101, 97, 116, 101, 114, 4, 7, 59, 69, 70, 71, 76, 83, 84, 3600, 3602, 3609, 3621, 3631, 3637, 3650, 1, 8815, 113, 117, 97, 108, 59, 1, 8817, 117, 108, 108, 69, 113, 117, 97, 108, 59, 3, 8807, 824, 114, 101, 97, 116, 101, 114, 59, 3, 8811, 824, 101, 115, 115, 59, 1, 8825, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 3, 10878, 824, 105, 108, 100, 101, 59, 1, 8821, 117, 109, 112, 4, 2, 68, 69, 3666, 3677, 111, 119, 110, 72, 117, 109, 112, 59, 3, 8782, 824, 113, 117, 97, 108, 59, 3, 8783, 824, 101, 4, 2, 102, 115, 3692, 3724, 116, 84, 114, 105, 97, 110, 103, 108, 101, 4, 3, 59, 66, 69, 3709, 3711, 3717, 1, 8938, 97, 114, 59, 3, 10703, 824, 113, 117, 97, 108, 59, 1, 8940, 115, 4, 6, 59, 69, 71, 76, 83, 84, 3739, 3741, 3748, 3757, 3764, 3777, 1, 8814, 113, 117, 97, 108, 59, 1, 8816, 114, 101, 97, 116, 101, 114, 59, 1, 8824, 101, 115, 115, 59, 3, 8810, 824, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 3, 10877, 824, 105, 108, 100, 101, 59, 1, 8820, 101, 115, 116, 101, 100, 4, 2, 71, 76, 3795, 3812, 114, 101, 97, 116, 101, 114, 71, 114, 101, 97, 116, 101, 114, 59, 3, 10914, 824, 101, 115, 115, 76, 101, 115, 115, 59, 3, 10913, 824, 114, 101, 99, 101, 100, 101, 115, 4, 3, 59, 69, 83, 3838, 3840, 3848, 1, 8832, 113, 117, 97, 108, 59, 3, 10927, 824, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 1, 8928, 4, 2, 101, 105, 3866, 3881, 118, 101, 114, 115, 101, 69, 108, 101, 109, 101, 110, 116, 59, 1, 8716, 103, 104, 116, 84, 114, 105, 97, 110, 103, 108, 101, 4, 3, 59, 66, 69, 3900, 3902, 3908, 1, 8939, 97, 114, 59, 3, 10704, 824, 113, 117, 97, 108, 59, 1, 8941, 4, 2, 113, 117, 3921, 3973, 117, 97, 114, 101, 83, 117, 4, 2, 98, 112, 3933, 3952, 115, 101, 116, 4, 2, 59, 69, 3942, 3945, 3, 8847, 824, 113, 117, 97, 108, 59, 1, 8930, 101, 114, 115, 101, 116, 4, 2, 59, 69, 3963, 3966, 3, 8848, 824, 113, 117, 97, 108, 59, 1, 8931, 4, 3, 98, 99, 112, 3981, 4e3, 4045, 115, 101, 116, 4, 2, 59, 69, 3990, 3993, 3, 8834, 8402, 113, 117, 97, 108, 59, 1, 8840, 99, 101, 101, 100, 115, 4, 4, 59, 69, 83, 84, 4015, 4017, 4025, 4037, 1, 8833, 113, 117, 97, 108, 59, 3, 10928, 824, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 1, 8929, 105, 108, 100, 101, 59, 3, 8831, 824, 101, 114, 115, 101, 116, 4, 2, 59, 69, 4056, 4059, 3, 8835, 8402, 113, 117, 97, 108, 59, 1, 8841, 105, 108, 100, 101, 4, 4, 59, 69, 70, 84, 4080, 4082, 4089, 4100, 1, 8769, 113, 117, 97, 108, 59, 1, 8772, 117, 108, 108, 69, 113, 117, 97, 108, 59, 1, 8775, 105, 108, 100, 101, 59, 1, 8777, 101, 114, 116, 105, 99, 97, 108, 66, 97, 114, 59, 1, 8740, 99, 114, 59, 3, 55349, 56489, 105, 108, 100, 101, 5, 209, 1, 59, 4135, 1, 209, 59, 1, 925, 4, 14, 69, 97, 99, 100, 102, 103, 109, 111, 112, 114, 115, 116, 117, 118, 4170, 4176, 4187, 4205, 4212, 4217, 4228, 4253, 4259, 4292, 4295, 4316, 4337, 4346, 108, 105, 103, 59, 1, 338, 99, 117, 116, 101, 5, 211, 1, 59, 4185, 1, 211, 4, 2, 105, 121, 4193, 4202, 114, 99, 5, 212, 1, 59, 4200, 1, 212, 59, 1, 1054, 98, 108, 97, 99, 59, 1, 336, 114, 59, 3, 55349, 56594, 114, 97, 118, 101, 5, 210, 1, 59, 4226, 1, 210, 4, 3, 97, 101, 105, 4236, 4241, 4246, 99, 114, 59, 1, 332, 103, 97, 59, 1, 937, 99, 114, 111, 110, 59, 1, 927, 112, 102, 59, 3, 55349, 56646, 101, 110, 67, 117, 114, 108, 121, 4, 2, 68, 81, 4272, 4285, 111, 117, 98, 108, 101, 81, 117, 111, 116, 101, 59, 1, 8220, 117, 111, 116, 101, 59, 1, 8216, 59, 1, 10836, 4, 2, 99, 108, 4301, 4306, 114, 59, 3, 55349, 56490, 97, 115, 104, 5, 216, 1, 59, 4314, 1, 216, 105, 4, 2, 108, 109, 4323, 4332, 100, 101, 5, 213, 1, 59, 4330, 1, 213, 101, 115, 59, 1, 10807, 109, 108, 5, 214, 1, 59, 4344, 1, 214, 101, 114, 4, 2, 66, 80, 4354, 4380, 4, 2, 97, 114, 4360, 4364, 114, 59, 1, 8254, 97, 99, 4, 2, 101, 107, 4372, 4375, 59, 1, 9182, 101, 116, 59, 1, 9140, 97, 114, 101, 110, 116, 104, 101, 115, 105, 115, 59, 1, 9180, 4, 9, 97, 99, 102, 104, 105, 108, 111, 114, 115, 4413, 4422, 4426, 4431, 4435, 4438, 4448, 4471, 4561, 114, 116, 105, 97, 108, 68, 59, 1, 8706, 121, 59, 1, 1055, 114, 59, 3, 55349, 56595, 105, 59, 1, 934, 59, 1, 928, 117, 115, 77, 105, 110, 117, 115, 59, 1, 177, 4, 2, 105, 112, 4454, 4467, 110, 99, 97, 114, 101, 112, 108, 97, 110, 101, 59, 1, 8460, 102, 59, 1, 8473, 4, 4, 59, 101, 105, 111, 4481, 4483, 4526, 4531, 1, 10939, 99, 101, 100, 101, 115, 4, 4, 59, 69, 83, 84, 4498, 4500, 4507, 4519, 1, 8826, 113, 117, 97, 108, 59, 1, 10927, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 1, 8828, 105, 108, 100, 101, 59, 1, 8830, 109, 101, 59, 1, 8243, 4, 2, 100, 112, 4537, 4543, 117, 99, 116, 59, 1, 8719, 111, 114, 116, 105, 111, 110, 4, 2, 59, 97, 4555, 4557, 1, 8759, 108, 59, 1, 8733, 4, 2, 99, 105, 4567, 4572, 114, 59, 3, 55349, 56491, 59, 1, 936, 4, 4, 85, 102, 111, 115, 4585, 4594, 4599, 4604, 79, 84, 5, 34, 1, 59, 4592, 1, 34, 114, 59, 3, 55349, 56596, 112, 102, 59, 1, 8474, 99, 114, 59, 3, 55349, 56492, 4, 12, 66, 69, 97, 99, 101, 102, 104, 105, 111, 114, 115, 117, 4636, 4642, 4650, 4681, 4704, 4763, 4767, 4771, 5047, 5069, 5081, 5094, 97, 114, 114, 59, 1, 10512, 71, 5, 174, 1, 59, 4648, 1, 174, 4, 3, 99, 110, 114, 4658, 4664, 4668, 117, 116, 101, 59, 1, 340, 103, 59, 1, 10219, 114, 4, 2, 59, 116, 4675, 4677, 1, 8608, 108, 59, 1, 10518, 4, 3, 97, 101, 121, 4689, 4695, 4701, 114, 111, 110, 59, 1, 344, 100, 105, 108, 59, 1, 342, 59, 1, 1056, 4, 2, 59, 118, 4710, 4712, 1, 8476, 101, 114, 115, 101, 4, 2, 69, 85, 4722, 4748, 4, 2, 108, 113, 4728, 4736, 101, 109, 101, 110, 116, 59, 1, 8715, 117, 105, 108, 105, 98, 114, 105, 117, 109, 59, 1, 8651, 112, 69, 113, 117, 105, 108, 105, 98, 114, 105, 117, 109, 59, 1, 10607, 114, 59, 1, 8476, 111, 59, 1, 929, 103, 104, 116, 4, 8, 65, 67, 68, 70, 84, 85, 86, 97, 4792, 4840, 4849, 4905, 4912, 4972, 5022, 5040, 4, 2, 110, 114, 4798, 4811, 103, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 1, 10217, 114, 111, 119, 4, 3, 59, 66, 76, 4822, 4824, 4829, 1, 8594, 97, 114, 59, 1, 8677, 101, 102, 116, 65, 114, 114, 111, 119, 59, 1, 8644, 101, 105, 108, 105, 110, 103, 59, 1, 8969, 111, 4, 2, 117, 119, 4856, 4869, 98, 108, 101, 66, 114, 97, 99, 107, 101, 116, 59, 1, 10215, 110, 4, 2, 84, 86, 4876, 4887, 101, 101, 86, 101, 99, 116, 111, 114, 59, 1, 10589, 101, 99, 116, 111, 114, 4, 2, 59, 66, 4898, 4900, 1, 8642, 97, 114, 59, 1, 10581, 108, 111, 111, 114, 59, 1, 8971, 4, 2, 101, 114, 4918, 4944, 101, 4, 3, 59, 65, 86, 4927, 4929, 4936, 1, 8866, 114, 114, 111, 119, 59, 1, 8614, 101, 99, 116, 111, 114, 59, 1, 10587, 105, 97, 110, 103, 108, 101, 4, 3, 59, 66, 69, 4958, 4960, 4965, 1, 8883, 97, 114, 59, 1, 10704, 113, 117, 97, 108, 59, 1, 8885, 112, 4, 3, 68, 84, 86, 4981, 4993, 5004, 111, 119, 110, 86, 101, 99, 116, 111, 114, 59, 1, 10575, 101, 101, 86, 101, 99, 116, 111, 114, 59, 1, 10588, 101, 99, 116, 111, 114, 4, 2, 59, 66, 5015, 5017, 1, 8638, 97, 114, 59, 1, 10580, 101, 99, 116, 111, 114, 4, 2, 59, 66, 5033, 5035, 1, 8640, 97, 114, 59, 1, 10579, 114, 114, 111, 119, 59, 1, 8658, 4, 2, 112, 117, 5053, 5057, 102, 59, 1, 8477, 110, 100, 73, 109, 112, 108, 105, 101, 115, 59, 1, 10608, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8667, 4, 2, 99, 104, 5087, 5091, 114, 59, 1, 8475, 59, 1, 8625, 108, 101, 68, 101, 108, 97, 121, 101, 100, 59, 1, 10740, 4, 13, 72, 79, 97, 99, 102, 104, 105, 109, 111, 113, 115, 116, 117, 5134, 5150, 5157, 5164, 5198, 5203, 5259, 5265, 5277, 5283, 5374, 5380, 5385, 4, 2, 67, 99, 5140, 5146, 72, 99, 121, 59, 1, 1065, 121, 59, 1, 1064, 70, 84, 99, 121, 59, 1, 1068, 99, 117, 116, 101, 59, 1, 346, 4, 5, 59, 97, 101, 105, 121, 5176, 5178, 5184, 5190, 5195, 1, 10940, 114, 111, 110, 59, 1, 352, 100, 105, 108, 59, 1, 350, 114, 99, 59, 1, 348, 59, 1, 1057, 114, 59, 3, 55349, 56598, 111, 114, 116, 4, 4, 68, 76, 82, 85, 5216, 5227, 5238, 5250, 111, 119, 110, 65, 114, 114, 111, 119, 59, 1, 8595, 101, 102, 116, 65, 114, 114, 111, 119, 59, 1, 8592, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 8594, 112, 65, 114, 114, 111, 119, 59, 1, 8593, 103, 109, 97, 59, 1, 931, 97, 108, 108, 67, 105, 114, 99, 108, 101, 59, 1, 8728, 112, 102, 59, 3, 55349, 56650, 4, 2, 114, 117, 5289, 5293, 116, 59, 1, 8730, 97, 114, 101, 4, 4, 59, 73, 83, 85, 5306, 5308, 5322, 5367, 1, 9633, 110, 116, 101, 114, 115, 101, 99, 116, 105, 111, 110, 59, 1, 8851, 117, 4, 2, 98, 112, 5329, 5347, 115, 101, 116, 4, 2, 59, 69, 5338, 5340, 1, 8847, 113, 117, 97, 108, 59, 1, 8849, 101, 114, 115, 101, 116, 4, 2, 59, 69, 5358, 5360, 1, 8848, 113, 117, 97, 108, 59, 1, 8850, 110, 105, 111, 110, 59, 1, 8852, 99, 114, 59, 3, 55349, 56494, 97, 114, 59, 1, 8902, 4, 4, 98, 99, 109, 112, 5395, 5420, 5475, 5478, 4, 2, 59, 115, 5401, 5403, 1, 8912, 101, 116, 4, 2, 59, 69, 5411, 5413, 1, 8912, 113, 117, 97, 108, 59, 1, 8838, 4, 2, 99, 104, 5426, 5468, 101, 101, 100, 115, 4, 4, 59, 69, 83, 84, 5440, 5442, 5449, 5461, 1, 8827, 113, 117, 97, 108, 59, 1, 10928, 108, 97, 110, 116, 69, 113, 117, 97, 108, 59, 1, 8829, 105, 108, 100, 101, 59, 1, 8831, 84, 104, 97, 116, 59, 1, 8715, 59, 1, 8721, 4, 3, 59, 101, 115, 5486, 5488, 5507, 1, 8913, 114, 115, 101, 116, 4, 2, 59, 69, 5498, 5500, 1, 8835, 113, 117, 97, 108, 59, 1, 8839, 101, 116, 59, 1, 8913, 4, 11, 72, 82, 83, 97, 99, 102, 104, 105, 111, 114, 115, 5536, 5546, 5552, 5567, 5579, 5602, 5607, 5655, 5695, 5701, 5711, 79, 82, 78, 5, 222, 1, 59, 5544, 1, 222, 65, 68, 69, 59, 1, 8482, 4, 2, 72, 99, 5558, 5563, 99, 121, 59, 1, 1035, 121, 59, 1, 1062, 4, 2, 98, 117, 5573, 5576, 59, 1, 9, 59, 1, 932, 4, 3, 97, 101, 121, 5587, 5593, 5599, 114, 111, 110, 59, 1, 356, 100, 105, 108, 59, 1, 354, 59, 1, 1058, 114, 59, 3, 55349, 56599, 4, 2, 101, 105, 5613, 5631, 4, 2, 114, 116, 5619, 5627, 101, 102, 111, 114, 101, 59, 1, 8756, 97, 59, 1, 920, 4, 2, 99, 110, 5637, 5647, 107, 83, 112, 97, 99, 101, 59, 3, 8287, 8202, 83, 112, 97, 99, 101, 59, 1, 8201, 108, 100, 101, 4, 4, 59, 69, 70, 84, 5668, 5670, 5677, 5688, 1, 8764, 113, 117, 97, 108, 59, 1, 8771, 117, 108, 108, 69, 113, 117, 97, 108, 59, 1, 8773, 105, 108, 100, 101, 59, 1, 8776, 112, 102, 59, 3, 55349, 56651, 105, 112, 108, 101, 68, 111, 116, 59, 1, 8411, 4, 2, 99, 116, 5717, 5722, 114, 59, 3, 55349, 56495, 114, 111, 107, 59, 1, 358, 4, 14, 97, 98, 99, 100, 102, 103, 109, 110, 111, 112, 114, 115, 116, 117, 5758, 5789, 5805, 5823, 5830, 5835, 5846, 5852, 5921, 5937, 6089, 6095, 6101, 6108, 4, 2, 99, 114, 5764, 5774, 117, 116, 101, 5, 218, 1, 59, 5772, 1, 218, 114, 4, 2, 59, 111, 5781, 5783, 1, 8607, 99, 105, 114, 59, 1, 10569, 114, 4, 2, 99, 101, 5796, 5800, 121, 59, 1, 1038, 118, 101, 59, 1, 364, 4, 2, 105, 121, 5811, 5820, 114, 99, 5, 219, 1, 59, 5818, 1, 219, 59, 1, 1059, 98, 108, 97, 99, 59, 1, 368, 114, 59, 3, 55349, 56600, 114, 97, 118, 101, 5, 217, 1, 59, 5844, 1, 217, 97, 99, 114, 59, 1, 362, 4, 2, 100, 105, 5858, 5905, 101, 114, 4, 2, 66, 80, 5866, 5892, 4, 2, 97, 114, 5872, 5876, 114, 59, 1, 95, 97, 99, 4, 2, 101, 107, 5884, 5887, 59, 1, 9183, 101, 116, 59, 1, 9141, 97, 114, 101, 110, 116, 104, 101, 115, 105, 115, 59, 1, 9181, 111, 110, 4, 2, 59, 80, 5913, 5915, 1, 8899, 108, 117, 115, 59, 1, 8846, 4, 2, 103, 112, 5927, 5932, 111, 110, 59, 1, 370, 102, 59, 3, 55349, 56652, 4, 8, 65, 68, 69, 84, 97, 100, 112, 115, 5955, 5985, 5996, 6009, 6026, 6033, 6044, 6075, 114, 114, 111, 119, 4, 3, 59, 66, 68, 5967, 5969, 5974, 1, 8593, 97, 114, 59, 1, 10514, 111, 119, 110, 65, 114, 114, 111, 119, 59, 1, 8645, 111, 119, 110, 65, 114, 114, 111, 119, 59, 1, 8597, 113, 117, 105, 108, 105, 98, 114, 105, 117, 109, 59, 1, 10606, 101, 101, 4, 2, 59, 65, 6017, 6019, 1, 8869, 114, 114, 111, 119, 59, 1, 8613, 114, 114, 111, 119, 59, 1, 8657, 111, 119, 110, 97, 114, 114, 111, 119, 59, 1, 8661, 101, 114, 4, 2, 76, 82, 6052, 6063, 101, 102, 116, 65, 114, 114, 111, 119, 59, 1, 8598, 105, 103, 104, 116, 65, 114, 114, 111, 119, 59, 1, 8599, 105, 4, 2, 59, 108, 6082, 6084, 1, 978, 111, 110, 59, 1, 933, 105, 110, 103, 59, 1, 366, 99, 114, 59, 3, 55349, 56496, 105, 108, 100, 101, 59, 1, 360, 109, 108, 5, 220, 1, 59, 6115, 1, 220, 4, 9, 68, 98, 99, 100, 101, 102, 111, 115, 118, 6137, 6143, 6148, 6152, 6166, 6250, 6255, 6261, 6267, 97, 115, 104, 59, 1, 8875, 97, 114, 59, 1, 10987, 121, 59, 1, 1042, 97, 115, 104, 4, 2, 59, 108, 6161, 6163, 1, 8873, 59, 1, 10982, 4, 2, 101, 114, 6172, 6175, 59, 1, 8897, 4, 3, 98, 116, 121, 6183, 6188, 6238, 97, 114, 59, 1, 8214, 4, 2, 59, 105, 6194, 6196, 1, 8214, 99, 97, 108, 4, 4, 66, 76, 83, 84, 6209, 6214, 6220, 6231, 97, 114, 59, 1, 8739, 105, 110, 101, 59, 1, 124, 101, 112, 97, 114, 97, 116, 111, 114, 59, 1, 10072, 105, 108, 100, 101, 59, 1, 8768, 84, 104, 105, 110, 83, 112, 97, 99, 101, 59, 1, 8202, 114, 59, 3, 55349, 56601, 112, 102, 59, 3, 55349, 56653, 99, 114, 59, 3, 55349, 56497, 100, 97, 115, 104, 59, 1, 8874, 4, 5, 99, 101, 102, 111, 115, 6286, 6292, 6298, 6303, 6309, 105, 114, 99, 59, 1, 372, 100, 103, 101, 59, 1, 8896, 114, 59, 3, 55349, 56602, 112, 102, 59, 3, 55349, 56654, 99, 114, 59, 3, 55349, 56498, 4, 4, 102, 105, 111, 115, 6325, 6330, 6333, 6339, 114, 59, 3, 55349, 56603, 59, 1, 926, 112, 102, 59, 3, 55349, 56655, 99, 114, 59, 3, 55349, 56499, 4, 9, 65, 73, 85, 97, 99, 102, 111, 115, 117, 6365, 6370, 6375, 6380, 6391, 6405, 6410, 6416, 6422, 99, 121, 59, 1, 1071, 99, 121, 59, 1, 1031, 99, 121, 59, 1, 1070, 99, 117, 116, 101, 5, 221, 1, 59, 6389, 1, 221, 4, 2, 105, 121, 6397, 6402, 114, 99, 59, 1, 374, 59, 1, 1067, 114, 59, 3, 55349, 56604, 112, 102, 59, 3, 55349, 56656, 99, 114, 59, 3, 55349, 56500, 109, 108, 59, 1, 376, 4, 8, 72, 97, 99, 100, 101, 102, 111, 115, 6445, 6450, 6457, 6472, 6477, 6501, 6505, 6510, 99, 121, 59, 1, 1046, 99, 117, 116, 101, 59, 1, 377, 4, 2, 97, 121, 6463, 6469, 114, 111, 110, 59, 1, 381, 59, 1, 1047, 111, 116, 59, 1, 379, 4, 2, 114, 116, 6483, 6497, 111, 87, 105, 100, 116, 104, 83, 112, 97, 99, 101, 59, 1, 8203, 97, 59, 1, 918, 114, 59, 1, 8488, 112, 102, 59, 1, 8484, 99, 114, 59, 3, 55349, 56501, 4, 16, 97, 98, 99, 101, 102, 103, 108, 109, 110, 111, 112, 114, 115, 116, 117, 119, 6550, 6561, 6568, 6612, 6622, 6634, 6645, 6672, 6699, 6854, 6870, 6923, 6933, 6963, 6974, 6983, 99, 117, 116, 101, 5, 225, 1, 59, 6559, 1, 225, 114, 101, 118, 101, 59, 1, 259, 4, 6, 59, 69, 100, 105, 117, 121, 6582, 6584, 6588, 6591, 6600, 6609, 1, 8766, 59, 3, 8766, 819, 59, 1, 8767, 114, 99, 5, 226, 1, 59, 6598, 1, 226, 116, 101, 5, 180, 1, 59, 6607, 1, 180, 59, 1, 1072, 108, 105, 103, 5, 230, 1, 59, 6620, 1, 230, 4, 2, 59, 114, 6628, 6630, 1, 8289, 59, 3, 55349, 56606, 114, 97, 118, 101, 5, 224, 1, 59, 6643, 1, 224, 4, 2, 101, 112, 6651, 6667, 4, 2, 102, 112, 6657, 6663, 115, 121, 109, 59, 1, 8501, 104, 59, 1, 8501, 104, 97, 59, 1, 945, 4, 2, 97, 112, 6678, 6692, 4, 2, 99, 108, 6684, 6688, 114, 59, 1, 257, 103, 59, 1, 10815, 5, 38, 1, 59, 6697, 1, 38, 4, 2, 100, 103, 6705, 6737, 4, 5, 59, 97, 100, 115, 118, 6717, 6719, 6724, 6727, 6734, 1, 8743, 110, 100, 59, 1, 10837, 59, 1, 10844, 108, 111, 112, 101, 59, 1, 10840, 59, 1, 10842, 4, 7, 59, 101, 108, 109, 114, 115, 122, 6753, 6755, 6758, 6762, 6814, 6835, 6848, 1, 8736, 59, 1, 10660, 101, 59, 1, 8736, 115, 100, 4, 2, 59, 97, 6770, 6772, 1, 8737, 4, 8, 97, 98, 99, 100, 101, 102, 103, 104, 6790, 6793, 6796, 6799, 6802, 6805, 6808, 6811, 59, 1, 10664, 59, 1, 10665, 59, 1, 10666, 59, 1, 10667, 59, 1, 10668, 59, 1, 10669, 59, 1, 10670, 59, 1, 10671, 116, 4, 2, 59, 118, 6821, 6823, 1, 8735, 98, 4, 2, 59, 100, 6830, 6832, 1, 8894, 59, 1, 10653, 4, 2, 112, 116, 6841, 6845, 104, 59, 1, 8738, 59, 1, 197, 97, 114, 114, 59, 1, 9084, 4, 2, 103, 112, 6860, 6865, 111, 110, 59, 1, 261, 102, 59, 3, 55349, 56658, 4, 7, 59, 69, 97, 101, 105, 111, 112, 6886, 6888, 6891, 6897, 6900, 6904, 6908, 1, 8776, 59, 1, 10864, 99, 105, 114, 59, 1, 10863, 59, 1, 8778, 100, 59, 1, 8779, 115, 59, 1, 39, 114, 111, 120, 4, 2, 59, 101, 6917, 6919, 1, 8776, 113, 59, 1, 8778, 105, 110, 103, 5, 229, 1, 59, 6931, 1, 229, 4, 3, 99, 116, 121, 6941, 6946, 6949, 114, 59, 3, 55349, 56502, 59, 1, 42, 109, 112, 4, 2, 59, 101, 6957, 6959, 1, 8776, 113, 59, 1, 8781, 105, 108, 100, 101, 5, 227, 1, 59, 6972, 1, 227, 109, 108, 5, 228, 1, 59, 6981, 1, 228, 4, 2, 99, 105, 6989, 6997, 111, 110, 105, 110, 116, 59, 1, 8755, 110, 116, 59, 1, 10769, 4, 16, 78, 97, 98, 99, 100, 101, 102, 105, 107, 108, 110, 111, 112, 114, 115, 117, 7036, 7041, 7119, 7135, 7149, 7155, 7219, 7224, 7347, 7354, 7463, 7489, 7786, 7793, 7814, 7866, 111, 116, 59, 1, 10989, 4, 2, 99, 114, 7047, 7094, 107, 4, 4, 99, 101, 112, 115, 7058, 7064, 7073, 7080, 111, 110, 103, 59, 1, 8780, 112, 115, 105, 108, 111, 110, 59, 1, 1014, 114, 105, 109, 101, 59, 1, 8245, 105, 109, 4, 2, 59, 101, 7088, 7090, 1, 8765, 113, 59, 1, 8909, 4, 2, 118, 119, 7100, 7105, 101, 101, 59, 1, 8893, 101, 100, 4, 2, 59, 103, 7113, 7115, 1, 8965, 101, 59, 1, 8965, 114, 107, 4, 2, 59, 116, 7127, 7129, 1, 9141, 98, 114, 107, 59, 1, 9142, 4, 2, 111, 121, 7141, 7146, 110, 103, 59, 1, 8780, 59, 1, 1073, 113, 117, 111, 59, 1, 8222, 4, 5, 99, 109, 112, 114, 116, 7167, 7181, 7188, 7193, 7199, 97, 117, 115, 4, 2, 59, 101, 7176, 7178, 1, 8757, 59, 1, 8757, 112, 116, 121, 118, 59, 1, 10672, 115, 105, 59, 1, 1014, 110, 111, 117, 59, 1, 8492, 4, 3, 97, 104, 119, 7207, 7210, 7213, 59, 1, 946, 59, 1, 8502, 101, 101, 110, 59, 1, 8812, 114, 59, 3, 55349, 56607, 103, 4, 7, 99, 111, 115, 116, 117, 118, 119, 7241, 7262, 7288, 7305, 7328, 7335, 7340, 4, 3, 97, 105, 117, 7249, 7253, 7258, 112, 59, 1, 8898, 114, 99, 59, 1, 9711, 112, 59, 1, 8899, 4, 3, 100, 112, 116, 7270, 7275, 7281, 111, 116, 59, 1, 10752, 108, 117, 115, 59, 1, 10753, 105, 109, 101, 115, 59, 1, 10754, 4, 2, 113, 116, 7294, 7300, 99, 117, 112, 59, 1, 10758, 97, 114, 59, 1, 9733, 114, 105, 97, 110, 103, 108, 101, 4, 2, 100, 117, 7318, 7324, 111, 119, 110, 59, 1, 9661, 112, 59, 1, 9651, 112, 108, 117, 115, 59, 1, 10756, 101, 101, 59, 1, 8897, 101, 100, 103, 101, 59, 1, 8896, 97, 114, 111, 119, 59, 1, 10509, 4, 3, 97, 107, 111, 7362, 7436, 7458, 4, 2, 99, 110, 7368, 7432, 107, 4, 3, 108, 115, 116, 7377, 7386, 7394, 111, 122, 101, 110, 103, 101, 59, 1, 10731, 113, 117, 97, 114, 101, 59, 1, 9642, 114, 105, 97, 110, 103, 108, 101, 4, 4, 59, 100, 108, 114, 7411, 7413, 7419, 7425, 1, 9652, 111, 119, 110, 59, 1, 9662, 101, 102, 116, 59, 1, 9666, 105, 103, 104, 116, 59, 1, 9656, 107, 59, 1, 9251, 4, 2, 49, 51, 7442, 7454, 4, 2, 50, 52, 7448, 7451, 59, 1, 9618, 59, 1, 9617, 52, 59, 1, 9619, 99, 107, 59, 1, 9608, 4, 2, 101, 111, 7469, 7485, 4, 2, 59, 113, 7475, 7478, 3, 61, 8421, 117, 105, 118, 59, 3, 8801, 8421, 116, 59, 1, 8976, 4, 4, 112, 116, 119, 120, 7499, 7504, 7517, 7523, 102, 59, 3, 55349, 56659, 4, 2, 59, 116, 7510, 7512, 1, 8869, 111, 109, 59, 1, 8869, 116, 105, 101, 59, 1, 8904, 4, 12, 68, 72, 85, 86, 98, 100, 104, 109, 112, 116, 117, 118, 7549, 7571, 7597, 7619, 7655, 7660, 7682, 7708, 7715, 7721, 7728, 7750, 4, 4, 76, 82, 108, 114, 7559, 7562, 7565, 7568, 59, 1, 9559, 59, 1, 9556, 59, 1, 9558, 59, 1, 9555, 4, 5, 59, 68, 85, 100, 117, 7583, 7585, 7588, 7591, 7594, 1, 9552, 59, 1, 9574, 59, 1, 9577, 59, 1, 9572, 59, 1, 9575, 4, 4, 76, 82, 108, 114, 7607, 7610, 7613, 7616, 59, 1, 9565, 59, 1, 9562, 59, 1, 9564, 59, 1, 9561, 4, 7, 59, 72, 76, 82, 104, 108, 114, 7635, 7637, 7640, 7643, 7646, 7649, 7652, 1, 9553, 59, 1, 9580, 59, 1, 9571, 59, 1, 9568, 59, 1, 9579, 59, 1, 9570, 59, 1, 9567, 111, 120, 59, 1, 10697, 4, 4, 76, 82, 108, 114, 7670, 7673, 7676, 7679, 59, 1, 9557, 59, 1, 9554, 59, 1, 9488, 59, 1, 9484, 4, 5, 59, 68, 85, 100, 117, 7694, 7696, 7699, 7702, 7705, 1, 9472, 59, 1, 9573, 59, 1, 9576, 59, 1, 9516, 59, 1, 9524, 105, 110, 117, 115, 59, 1, 8863, 108, 117, 115, 59, 1, 8862, 105, 109, 101, 115, 59, 1, 8864, 4, 4, 76, 82, 108, 114, 7738, 7741, 7744, 7747, 59, 1, 9563, 59, 1, 9560, 59, 1, 9496, 59, 1, 9492, 4, 7, 59, 72, 76, 82, 104, 108, 114, 7766, 7768, 7771, 7774, 7777, 7780, 7783, 1, 9474, 59, 1, 9578, 59, 1, 9569, 59, 1, 9566, 59, 1, 9532, 59, 1, 9508, 59, 1, 9500, 114, 105, 109, 101, 59, 1, 8245, 4, 2, 101, 118, 7799, 7804, 118, 101, 59, 1, 728, 98, 97, 114, 5, 166, 1, 59, 7812, 1, 166, 4, 4, 99, 101, 105, 111, 7824, 7829, 7834, 7846, 114, 59, 3, 55349, 56503, 109, 105, 59, 1, 8271, 109, 4, 2, 59, 101, 7841, 7843, 1, 8765, 59, 1, 8909, 108, 4, 3, 59, 98, 104, 7855, 7857, 7860, 1, 92, 59, 1, 10693, 115, 117, 98, 59, 1, 10184, 4, 2, 108, 109, 7872, 7885, 108, 4, 2, 59, 101, 7879, 7881, 1, 8226, 116, 59, 1, 8226, 112, 4, 3, 59, 69, 101, 7894, 7896, 7899, 1, 8782, 59, 1, 10926, 4, 2, 59, 113, 7905, 7907, 1, 8783, 59, 1, 8783, 4, 15, 97, 99, 100, 101, 102, 104, 105, 108, 111, 114, 115, 116, 117, 119, 121, 7942, 8021, 8075, 8080, 8121, 8126, 8157, 8279, 8295, 8430, 8446, 8485, 8491, 8707, 8726, 4, 3, 99, 112, 114, 7950, 7956, 8007, 117, 116, 101, 59, 1, 263, 4, 6, 59, 97, 98, 99, 100, 115, 7970, 7972, 7977, 7984, 7998, 8003, 1, 8745, 110, 100, 59, 1, 10820, 114, 99, 117, 112, 59, 1, 10825, 4, 2, 97, 117, 7990, 7994, 112, 59, 1, 10827, 112, 59, 1, 10823, 111, 116, 59, 1, 10816, 59, 3, 8745, 65024, 4, 2, 101, 111, 8013, 8017, 116, 59, 1, 8257, 110, 59, 1, 711, 4, 4, 97, 101, 105, 117, 8031, 8046, 8056, 8061, 4, 2, 112, 114, 8037, 8041, 115, 59, 1, 10829, 111, 110, 59, 1, 269, 100, 105, 108, 5, 231, 1, 59, 8054, 1, 231, 114, 99, 59, 1, 265, 112, 115, 4, 2, 59, 115, 8069, 8071, 1, 10828, 109, 59, 1, 10832, 111, 116, 59, 1, 267, 4, 3, 100, 109, 110, 8088, 8097, 8104, 105, 108, 5, 184, 1, 59, 8095, 1, 184, 112, 116, 121, 118, 59, 1, 10674, 116, 5, 162, 2, 59, 101, 8112, 8114, 1, 162, 114, 100, 111, 116, 59, 1, 183, 114, 59, 3, 55349, 56608, 4, 3, 99, 101, 105, 8134, 8138, 8154, 121, 59, 1, 1095, 99, 107, 4, 2, 59, 109, 8146, 8148, 1, 10003, 97, 114, 107, 59, 1, 10003, 59, 1, 967, 114, 4, 7, 59, 69, 99, 101, 102, 109, 115, 8174, 8176, 8179, 8258, 8261, 8268, 8273, 1, 9675, 59, 1, 10691, 4, 3, 59, 101, 108, 8187, 8189, 8193, 1, 710, 113, 59, 1, 8791, 101, 4, 2, 97, 100, 8200, 8223, 114, 114, 111, 119, 4, 2, 108, 114, 8210, 8216, 101, 102, 116, 59, 1, 8634, 105, 103, 104, 116, 59, 1, 8635, 4, 5, 82, 83, 97, 99, 100, 8235, 8238, 8241, 8246, 8252, 59, 1, 174, 59, 1, 9416, 115, 116, 59, 1, 8859, 105, 114, 99, 59, 1, 8858, 97, 115, 104, 59, 1, 8861, 59, 1, 8791, 110, 105, 110, 116, 59, 1, 10768, 105, 100, 59, 1, 10991, 99, 105, 114, 59, 1, 10690, 117, 98, 115, 4, 2, 59, 117, 8288, 8290, 1, 9827, 105, 116, 59, 1, 9827, 4, 4, 108, 109, 110, 112, 8305, 8326, 8376, 8400, 111, 110, 4, 2, 59, 101, 8313, 8315, 1, 58, 4, 2, 59, 113, 8321, 8323, 1, 8788, 59, 1, 8788, 4, 2, 109, 112, 8332, 8344, 97, 4, 2, 59, 116, 8339, 8341, 1, 44, 59, 1, 64, 4, 3, 59, 102, 108, 8352, 8354, 8358, 1, 8705, 110, 59, 1, 8728, 101, 4, 2, 109, 120, 8365, 8371, 101, 110, 116, 59, 1, 8705, 101, 115, 59, 1, 8450, 4, 2, 103, 105, 8382, 8395, 4, 2, 59, 100, 8388, 8390, 1, 8773, 111, 116, 59, 1, 10861, 110, 116, 59, 1, 8750, 4, 3, 102, 114, 121, 8408, 8412, 8417, 59, 3, 55349, 56660, 111, 100, 59, 1, 8720, 5, 169, 2, 59, 115, 8424, 8426, 1, 169, 114, 59, 1, 8471, 4, 2, 97, 111, 8436, 8441, 114, 114, 59, 1, 8629, 115, 115, 59, 1, 10007, 4, 2, 99, 117, 8452, 8457, 114, 59, 3, 55349, 56504, 4, 2, 98, 112, 8463, 8474, 4, 2, 59, 101, 8469, 8471, 1, 10959, 59, 1, 10961, 4, 2, 59, 101, 8480, 8482, 1, 10960, 59, 1, 10962, 100, 111, 116, 59, 1, 8943, 4, 7, 100, 101, 108, 112, 114, 118, 119, 8507, 8522, 8536, 8550, 8600, 8697, 8702, 97, 114, 114, 4, 2, 108, 114, 8516, 8519, 59, 1, 10552, 59, 1, 10549, 4, 2, 112, 115, 8528, 8532, 114, 59, 1, 8926, 99, 59, 1, 8927, 97, 114, 114, 4, 2, 59, 112, 8545, 8547, 1, 8630, 59, 1, 10557, 4, 6, 59, 98, 99, 100, 111, 115, 8564, 8566, 8573, 8587, 8592, 8596, 1, 8746, 114, 99, 97, 112, 59, 1, 10824, 4, 2, 97, 117, 8579, 8583, 112, 59, 1, 10822, 112, 59, 1, 10826, 111, 116, 59, 1, 8845, 114, 59, 1, 10821, 59, 3, 8746, 65024, 4, 4, 97, 108, 114, 118, 8610, 8623, 8663, 8672, 114, 114, 4, 2, 59, 109, 8618, 8620, 1, 8631, 59, 1, 10556, 121, 4, 3, 101, 118, 119, 8632, 8651, 8656, 113, 4, 2, 112, 115, 8639, 8645, 114, 101, 99, 59, 1, 8926, 117, 99, 99, 59, 1, 8927, 101, 101, 59, 1, 8910, 101, 100, 103, 101, 59, 1, 8911, 101, 110, 5, 164, 1, 59, 8670, 1, 164, 101, 97, 114, 114, 111, 119, 4, 2, 108, 114, 8684, 8690, 101, 102, 116, 59, 1, 8630, 105, 103, 104, 116, 59, 1, 8631, 101, 101, 59, 1, 8910, 101, 100, 59, 1, 8911, 4, 2, 99, 105, 8713, 8721, 111, 110, 105, 110, 116, 59, 1, 8754, 110, 116, 59, 1, 8753, 108, 99, 116, 121, 59, 1, 9005, 4, 19, 65, 72, 97, 98, 99, 100, 101, 102, 104, 105, 106, 108, 111, 114, 115, 116, 117, 119, 122, 8773, 8778, 8783, 8821, 8839, 8854, 8887, 8914, 8930, 8944, 9036, 9041, 9058, 9197, 9227, 9258, 9281, 9297, 9305, 114, 114, 59, 1, 8659, 97, 114, 59, 1, 10597, 4, 4, 103, 108, 114, 115, 8793, 8799, 8805, 8809, 103, 101, 114, 59, 1, 8224, 101, 116, 104, 59, 1, 8504, 114, 59, 1, 8595, 104, 4, 2, 59, 118, 8816, 8818, 1, 8208, 59, 1, 8867, 4, 2, 107, 108, 8827, 8834, 97, 114, 111, 119, 59, 1, 10511, 97, 99, 59, 1, 733, 4, 2, 97, 121, 8845, 8851, 114, 111, 110, 59, 1, 271, 59, 1, 1076, 4, 3, 59, 97, 111, 8862, 8864, 8880, 1, 8518, 4, 2, 103, 114, 8870, 8876, 103, 101, 114, 59, 1, 8225, 114, 59, 1, 8650, 116, 115, 101, 113, 59, 1, 10871, 4, 3, 103, 108, 109, 8895, 8902, 8907, 5, 176, 1, 59, 8900, 1, 176, 116, 97, 59, 1, 948, 112, 116, 121, 118, 59, 1, 10673, 4, 2, 105, 114, 8920, 8926, 115, 104, 116, 59, 1, 10623, 59, 3, 55349, 56609, 97, 114, 4, 2, 108, 114, 8938, 8941, 59, 1, 8643, 59, 1, 8642, 4, 5, 97, 101, 103, 115, 118, 8956, 8986, 8989, 8996, 9001, 109, 4, 3, 59, 111, 115, 8965, 8967, 8983, 1, 8900, 110, 100, 4, 2, 59, 115, 8975, 8977, 1, 8900, 117, 105, 116, 59, 1, 9830, 59, 1, 9830, 59, 1, 168, 97, 109, 109, 97, 59, 1, 989, 105, 110, 59, 1, 8946, 4, 3, 59, 105, 111, 9009, 9011, 9031, 1, 247, 100, 101, 5, 247, 2, 59, 111, 9020, 9022, 1, 247, 110, 116, 105, 109, 101, 115, 59, 1, 8903, 110, 120, 59, 1, 8903, 99, 121, 59, 1, 1106, 99, 4, 2, 111, 114, 9048, 9053, 114, 110, 59, 1, 8990, 111, 112, 59, 1, 8973, 4, 5, 108, 112, 116, 117, 119, 9070, 9076, 9081, 9130, 9144, 108, 97, 114, 59, 1, 36, 102, 59, 3, 55349, 56661, 4, 5, 59, 101, 109, 112, 115, 9093, 9095, 9109, 9116, 9122, 1, 729, 113, 4, 2, 59, 100, 9102, 9104, 1, 8784, 111, 116, 59, 1, 8785, 105, 110, 117, 115, 59, 1, 8760, 108, 117, 115, 59, 1, 8724, 113, 117, 97, 114, 101, 59, 1, 8865, 98, 108, 101, 98, 97, 114, 119, 101, 100, 103, 101, 59, 1, 8966, 110, 4, 3, 97, 100, 104, 9153, 9160, 9172, 114, 114, 111, 119, 59, 1, 8595, 111, 119, 110, 97, 114, 114, 111, 119, 115, 59, 1, 8650, 97, 114, 112, 111, 111, 110, 4, 2, 108, 114, 9184, 9190, 101, 102, 116, 59, 1, 8643, 105, 103, 104, 116, 59, 1, 8642, 4, 2, 98, 99, 9203, 9211, 107, 97, 114, 111, 119, 59, 1, 10512, 4, 2, 111, 114, 9217, 9222, 114, 110, 59, 1, 8991, 111, 112, 59, 1, 8972, 4, 3, 99, 111, 116, 9235, 9248, 9252, 4, 2, 114, 121, 9241, 9245, 59, 3, 55349, 56505, 59, 1, 1109, 108, 59, 1, 10742, 114, 111, 107, 59, 1, 273, 4, 2, 100, 114, 9264, 9269, 111, 116, 59, 1, 8945, 105, 4, 2, 59, 102, 9276, 9278, 1, 9663, 59, 1, 9662, 4, 2, 97, 104, 9287, 9292, 114, 114, 59, 1, 8693, 97, 114, 59, 1, 10607, 97, 110, 103, 108, 101, 59, 1, 10662, 4, 2, 99, 105, 9311, 9315, 121, 59, 1, 1119, 103, 114, 97, 114, 114, 59, 1, 10239, 4, 18, 68, 97, 99, 100, 101, 102, 103, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 120, 9361, 9376, 9398, 9439, 9444, 9447, 9462, 9495, 9531, 9585, 9598, 9614, 9659, 9755, 9771, 9792, 9808, 9826, 4, 2, 68, 111, 9367, 9372, 111, 116, 59, 1, 10871, 116, 59, 1, 8785, 4, 2, 99, 115, 9382, 9392, 117, 116, 101, 5, 233, 1, 59, 9390, 1, 233, 116, 101, 114, 59, 1, 10862, 4, 4, 97, 105, 111, 121, 9408, 9414, 9430, 9436, 114, 111, 110, 59, 1, 283, 114, 4, 2, 59, 99, 9421, 9423, 1, 8790, 5, 234, 1, 59, 9428, 1, 234, 108, 111, 110, 59, 1, 8789, 59, 1, 1101, 111, 116, 59, 1, 279, 59, 1, 8519, 4, 2, 68, 114, 9453, 9458, 111, 116, 59, 1, 8786, 59, 3, 55349, 56610, 4, 3, 59, 114, 115, 9470, 9472, 9482, 1, 10906, 97, 118, 101, 5, 232, 1, 59, 9480, 1, 232, 4, 2, 59, 100, 9488, 9490, 1, 10902, 111, 116, 59, 1, 10904, 4, 4, 59, 105, 108, 115, 9505, 9507, 9515, 9518, 1, 10905, 110, 116, 101, 114, 115, 59, 1, 9191, 59, 1, 8467, 4, 2, 59, 100, 9524, 9526, 1, 10901, 111, 116, 59, 1, 10903, 4, 3, 97, 112, 115, 9539, 9544, 9564, 99, 114, 59, 1, 275, 116, 121, 4, 3, 59, 115, 118, 9554, 9556, 9561, 1, 8709, 101, 116, 59, 1, 8709, 59, 1, 8709, 112, 4, 2, 49, 59, 9571, 9583, 4, 2, 51, 52, 9577, 9580, 59, 1, 8196, 59, 1, 8197, 1, 8195, 4, 2, 103, 115, 9591, 9594, 59, 1, 331, 112, 59, 1, 8194, 4, 2, 103, 112, 9604, 9609, 111, 110, 59, 1, 281, 102, 59, 3, 55349, 56662, 4, 3, 97, 108, 115, 9622, 9635, 9640, 114, 4, 2, 59, 115, 9629, 9631, 1, 8917, 108, 59, 1, 10723, 117, 115, 59, 1, 10865, 105, 4, 3, 59, 108, 118, 9649, 9651, 9656, 1, 949, 111, 110, 59, 1, 949, 59, 1, 1013, 4, 4, 99, 115, 117, 118, 9669, 9686, 9716, 9747, 4, 2, 105, 111, 9675, 9680, 114, 99, 59, 1, 8790, 108, 111, 110, 59, 1, 8789, 4, 2, 105, 108, 9692, 9696, 109, 59, 1, 8770, 97, 110, 116, 4, 2, 103, 108, 9705, 9710, 116, 114, 59, 1, 10902, 101, 115, 115, 59, 1, 10901, 4, 3, 97, 101, 105, 9724, 9729, 9734, 108, 115, 59, 1, 61, 115, 116, 59, 1, 8799, 118, 4, 2, 59, 68, 9741, 9743, 1, 8801, 68, 59, 1, 10872, 112, 97, 114, 115, 108, 59, 1, 10725, 4, 2, 68, 97, 9761, 9766, 111, 116, 59, 1, 8787, 114, 114, 59, 1, 10609, 4, 3, 99, 100, 105, 9779, 9783, 9788, 114, 59, 1, 8495, 111, 116, 59, 1, 8784, 109, 59, 1, 8770, 4, 2, 97, 104, 9798, 9801, 59, 1, 951, 5, 240, 1, 59, 9806, 1, 240, 4, 2, 109, 114, 9814, 9822, 108, 5, 235, 1, 59, 9820, 1, 235, 111, 59, 1, 8364, 4, 3, 99, 105, 112, 9834, 9838, 9843, 108, 59, 1, 33, 115, 116, 59, 1, 8707, 4, 2, 101, 111, 9849, 9859, 99, 116, 97, 116, 105, 111, 110, 59, 1, 8496, 110, 101, 110, 116, 105, 97, 108, 101, 59, 1, 8519, 4, 12, 97, 99, 101, 102, 105, 106, 108, 110, 111, 112, 114, 115, 9896, 9910, 9914, 9921, 9954, 9960, 9967, 9989, 9994, 10027, 10036, 10164, 108, 108, 105, 110, 103, 100, 111, 116, 115, 101, 113, 59, 1, 8786, 121, 59, 1, 1092, 109, 97, 108, 101, 59, 1, 9792, 4, 3, 105, 108, 114, 9929, 9935, 9950, 108, 105, 103, 59, 1, 64259, 4, 2, 105, 108, 9941, 9945, 103, 59, 1, 64256, 105, 103, 59, 1, 64260, 59, 3, 55349, 56611, 108, 105, 103, 59, 1, 64257, 108, 105, 103, 59, 3, 102, 106, 4, 3, 97, 108, 116, 9975, 9979, 9984, 116, 59, 1, 9837, 105, 103, 59, 1, 64258, 110, 115, 59, 1, 9649, 111, 102, 59, 1, 402, 4, 2, 112, 114, 1e4, 10005, 102, 59, 3, 55349, 56663, 4, 2, 97, 107, 10011, 10016, 108, 108, 59, 1, 8704, 4, 2, 59, 118, 10022, 10024, 1, 8916, 59, 1, 10969, 97, 114, 116, 105, 110, 116, 59, 1, 10765, 4, 2, 97, 111, 10042, 10159, 4, 2, 99, 115, 10048, 10155, 4, 6, 49, 50, 51, 52, 53, 55, 10062, 10102, 10114, 10135, 10139, 10151, 4, 6, 50, 51, 52, 53, 54, 56, 10076, 10083, 10086, 10093, 10096, 10099, 5, 189, 1, 59, 10081, 1, 189, 59, 1, 8531, 5, 188, 1, 59, 10091, 1, 188, 59, 1, 8533, 59, 1, 8537, 59, 1, 8539, 4, 2, 51, 53, 10108, 10111, 59, 1, 8532, 59, 1, 8534, 4, 3, 52, 53, 56, 10122, 10129, 10132, 5, 190, 1, 59, 10127, 1, 190, 59, 1, 8535, 59, 1, 8540, 53, 59, 1, 8536, 4, 2, 54, 56, 10145, 10148, 59, 1, 8538, 59, 1, 8541, 56, 59, 1, 8542, 108, 59, 1, 8260, 119, 110, 59, 1, 8994, 99, 114, 59, 3, 55349, 56507, 4, 17, 69, 97, 98, 99, 100, 101, 102, 103, 105, 106, 108, 110, 111, 114, 115, 116, 118, 10206, 10217, 10247, 10254, 10268, 10273, 10358, 10363, 10374, 10380, 10385, 10406, 10458, 10464, 10470, 10497, 10610, 4, 2, 59, 108, 10212, 10214, 1, 8807, 59, 1, 10892, 4, 3, 99, 109, 112, 10225, 10231, 10244, 117, 116, 101, 59, 1, 501, 109, 97, 4, 2, 59, 100, 10239, 10241, 1, 947, 59, 1, 989, 59, 1, 10886, 114, 101, 118, 101, 59, 1, 287, 4, 2, 105, 121, 10260, 10265, 114, 99, 59, 1, 285, 59, 1, 1075, 111, 116, 59, 1, 289, 4, 4, 59, 108, 113, 115, 10283, 10285, 10288, 10308, 1, 8805, 59, 1, 8923, 4, 3, 59, 113, 115, 10296, 10298, 10301, 1, 8805, 59, 1, 8807, 108, 97, 110, 116, 59, 1, 10878, 4, 4, 59, 99, 100, 108, 10318, 10320, 10324, 10345, 1, 10878, 99, 59, 1, 10921, 111, 116, 4, 2, 59, 111, 10332, 10334, 1, 10880, 4, 2, 59, 108, 10340, 10342, 1, 10882, 59, 1, 10884, 4, 2, 59, 101, 10351, 10354, 3, 8923, 65024, 115, 59, 1, 10900, 114, 59, 3, 55349, 56612, 4, 2, 59, 103, 10369, 10371, 1, 8811, 59, 1, 8921, 109, 101, 108, 59, 1, 8503, 99, 121, 59, 1, 1107, 4, 4, 59, 69, 97, 106, 10395, 10397, 10400, 10403, 1, 8823, 59, 1, 10898, 59, 1, 10917, 59, 1, 10916, 4, 4, 69, 97, 101, 115, 10416, 10419, 10434, 10453, 59, 1, 8809, 112, 4, 2, 59, 112, 10426, 10428, 1, 10890, 114, 111, 120, 59, 1, 10890, 4, 2, 59, 113, 10440, 10442, 1, 10888, 4, 2, 59, 113, 10448, 10450, 1, 10888, 59, 1, 8809, 105, 109, 59, 1, 8935, 112, 102, 59, 3, 55349, 56664, 97, 118, 101, 59, 1, 96, 4, 2, 99, 105, 10476, 10480, 114, 59, 1, 8458, 109, 4, 3, 59, 101, 108, 10489, 10491, 10494, 1, 8819, 59, 1, 10894, 59, 1, 10896, 5, 62, 6, 59, 99, 100, 108, 113, 114, 10512, 10514, 10527, 10532, 10538, 10545, 1, 62, 4, 2, 99, 105, 10520, 10523, 59, 1, 10919, 114, 59, 1, 10874, 111, 116, 59, 1, 8919, 80, 97, 114, 59, 1, 10645, 117, 101, 115, 116, 59, 1, 10876, 4, 5, 97, 100, 101, 108, 115, 10557, 10574, 10579, 10599, 10605, 4, 2, 112, 114, 10563, 10570, 112, 114, 111, 120, 59, 1, 10886, 114, 59, 1, 10616, 111, 116, 59, 1, 8919, 113, 4, 2, 108, 113, 10586, 10592, 101, 115, 115, 59, 1, 8923, 108, 101, 115, 115, 59, 1, 10892, 101, 115, 115, 59, 1, 8823, 105, 109, 59, 1, 8819, 4, 2, 101, 110, 10616, 10626, 114, 116, 110, 101, 113, 113, 59, 3, 8809, 65024, 69, 59, 3, 8809, 65024, 4, 10, 65, 97, 98, 99, 101, 102, 107, 111, 115, 121, 10653, 10658, 10713, 10718, 10724, 10760, 10765, 10786, 10850, 10875, 114, 114, 59, 1, 8660, 4, 4, 105, 108, 109, 114, 10668, 10674, 10678, 10684, 114, 115, 112, 59, 1, 8202, 102, 59, 1, 189, 105, 108, 116, 59, 1, 8459, 4, 2, 100, 114, 10690, 10695, 99, 121, 59, 1, 1098, 4, 3, 59, 99, 119, 10703, 10705, 10710, 1, 8596, 105, 114, 59, 1, 10568, 59, 1, 8621, 97, 114, 59, 1, 8463, 105, 114, 99, 59, 1, 293, 4, 3, 97, 108, 114, 10732, 10748, 10754, 114, 116, 115, 4, 2, 59, 117, 10741, 10743, 1, 9829, 105, 116, 59, 1, 9829, 108, 105, 112, 59, 1, 8230, 99, 111, 110, 59, 1, 8889, 114, 59, 3, 55349, 56613, 115, 4, 2, 101, 119, 10772, 10779, 97, 114, 111, 119, 59, 1, 10533, 97, 114, 111, 119, 59, 1, 10534, 4, 5, 97, 109, 111, 112, 114, 10798, 10803, 10809, 10839, 10844, 114, 114, 59, 1, 8703, 116, 104, 116, 59, 1, 8763, 107, 4, 2, 108, 114, 10816, 10827, 101, 102, 116, 97, 114, 114, 111, 119, 59, 1, 8617, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8618, 102, 59, 3, 55349, 56665, 98, 97, 114, 59, 1, 8213, 4, 3, 99, 108, 116, 10858, 10863, 10869, 114, 59, 3, 55349, 56509, 97, 115, 104, 59, 1, 8463, 114, 111, 107, 59, 1, 295, 4, 2, 98, 112, 10881, 10887, 117, 108, 108, 59, 1, 8259, 104, 101, 110, 59, 1, 8208, 4, 15, 97, 99, 101, 102, 103, 105, 106, 109, 110, 111, 112, 113, 115, 116, 117, 10925, 10936, 10958, 10977, 10990, 11001, 11039, 11045, 11101, 11192, 11220, 11226, 11237, 11285, 11299, 99, 117, 116, 101, 5, 237, 1, 59, 10934, 1, 237, 4, 3, 59, 105, 121, 10944, 10946, 10955, 1, 8291, 114, 99, 5, 238, 1, 59, 10953, 1, 238, 59, 1, 1080, 4, 2, 99, 120, 10964, 10968, 121, 59, 1, 1077, 99, 108, 5, 161, 1, 59, 10975, 1, 161, 4, 2, 102, 114, 10983, 10986, 59, 1, 8660, 59, 3, 55349, 56614, 114, 97, 118, 101, 5, 236, 1, 59, 10999, 1, 236, 4, 4, 59, 105, 110, 111, 11011, 11013, 11028, 11034, 1, 8520, 4, 2, 105, 110, 11019, 11024, 110, 116, 59, 1, 10764, 116, 59, 1, 8749, 102, 105, 110, 59, 1, 10716, 116, 97, 59, 1, 8489, 108, 105, 103, 59, 1, 307, 4, 3, 97, 111, 112, 11053, 11092, 11096, 4, 3, 99, 103, 116, 11061, 11065, 11088, 114, 59, 1, 299, 4, 3, 101, 108, 112, 11073, 11076, 11082, 59, 1, 8465, 105, 110, 101, 59, 1, 8464, 97, 114, 116, 59, 1, 8465, 104, 59, 1, 305, 102, 59, 1, 8887, 101, 100, 59, 1, 437, 4, 5, 59, 99, 102, 111, 116, 11113, 11115, 11121, 11136, 11142, 1, 8712, 97, 114, 101, 59, 1, 8453, 105, 110, 4, 2, 59, 116, 11129, 11131, 1, 8734, 105, 101, 59, 1, 10717, 100, 111, 116, 59, 1, 305, 4, 5, 59, 99, 101, 108, 112, 11154, 11156, 11161, 11179, 11186, 1, 8747, 97, 108, 59, 1, 8890, 4, 2, 103, 114, 11167, 11173, 101, 114, 115, 59, 1, 8484, 99, 97, 108, 59, 1, 8890, 97, 114, 104, 107, 59, 1, 10775, 114, 111, 100, 59, 1, 10812, 4, 4, 99, 103, 112, 116, 11202, 11206, 11211, 11216, 121, 59, 1, 1105, 111, 110, 59, 1, 303, 102, 59, 3, 55349, 56666, 97, 59, 1, 953, 114, 111, 100, 59, 1, 10812, 117, 101, 115, 116, 5, 191, 1, 59, 11235, 1, 191, 4, 2, 99, 105, 11243, 11248, 114, 59, 3, 55349, 56510, 110, 4, 5, 59, 69, 100, 115, 118, 11261, 11263, 11266, 11271, 11282, 1, 8712, 59, 1, 8953, 111, 116, 59, 1, 8949, 4, 2, 59, 118, 11277, 11279, 1, 8948, 59, 1, 8947, 59, 1, 8712, 4, 2, 59, 105, 11291, 11293, 1, 8290, 108, 100, 101, 59, 1, 297, 4, 2, 107, 109, 11305, 11310, 99, 121, 59, 1, 1110, 108, 5, 239, 1, 59, 11316, 1, 239, 4, 6, 99, 102, 109, 111, 115, 117, 11332, 11346, 11351, 11357, 11363, 11380, 4, 2, 105, 121, 11338, 11343, 114, 99, 59, 1, 309, 59, 1, 1081, 114, 59, 3, 55349, 56615, 97, 116, 104, 59, 1, 567, 112, 102, 59, 3, 55349, 56667, 4, 2, 99, 101, 11369, 11374, 114, 59, 3, 55349, 56511, 114, 99, 121, 59, 1, 1112, 107, 99, 121, 59, 1, 1108, 4, 8, 97, 99, 102, 103, 104, 106, 111, 115, 11404, 11418, 11433, 11438, 11445, 11450, 11455, 11461, 112, 112, 97, 4, 2, 59, 118, 11413, 11415, 1, 954, 59, 1, 1008, 4, 2, 101, 121, 11424, 11430, 100, 105, 108, 59, 1, 311, 59, 1, 1082, 114, 59, 3, 55349, 56616, 114, 101, 101, 110, 59, 1, 312, 99, 121, 59, 1, 1093, 99, 121, 59, 1, 1116, 112, 102, 59, 3, 55349, 56668, 99, 114, 59, 3, 55349, 56512, 4, 23, 65, 66, 69, 72, 97, 98, 99, 100, 101, 102, 103, 104, 106, 108, 109, 110, 111, 112, 114, 115, 116, 117, 118, 11515, 11538, 11544, 11555, 11560, 11721, 11780, 11818, 11868, 12136, 12160, 12171, 12203, 12208, 12246, 12275, 12327, 12509, 12523, 12569, 12641, 12732, 12752, 4, 3, 97, 114, 116, 11523, 11528, 11532, 114, 114, 59, 1, 8666, 114, 59, 1, 8656, 97, 105, 108, 59, 1, 10523, 97, 114, 114, 59, 1, 10510, 4, 2, 59, 103, 11550, 11552, 1, 8806, 59, 1, 10891, 97, 114, 59, 1, 10594, 4, 9, 99, 101, 103, 109, 110, 112, 113, 114, 116, 11580, 11586, 11594, 11600, 11606, 11624, 11627, 11636, 11694, 117, 116, 101, 59, 1, 314, 109, 112, 116, 121, 118, 59, 1, 10676, 114, 97, 110, 59, 1, 8466, 98, 100, 97, 59, 1, 955, 103, 4, 3, 59, 100, 108, 11615, 11617, 11620, 1, 10216, 59, 1, 10641, 101, 59, 1, 10216, 59, 1, 10885, 117, 111, 5, 171, 1, 59, 11634, 1, 171, 114, 4, 8, 59, 98, 102, 104, 108, 112, 115, 116, 11655, 11657, 11669, 11673, 11677, 11681, 11685, 11690, 1, 8592, 4, 2, 59, 102, 11663, 11665, 1, 8676, 115, 59, 1, 10527, 115, 59, 1, 10525, 107, 59, 1, 8617, 112, 59, 1, 8619, 108, 59, 1, 10553, 105, 109, 59, 1, 10611, 108, 59, 1, 8610, 4, 3, 59, 97, 101, 11702, 11704, 11709, 1, 10923, 105, 108, 59, 1, 10521, 4, 2, 59, 115, 11715, 11717, 1, 10925, 59, 3, 10925, 65024, 4, 3, 97, 98, 114, 11729, 11734, 11739, 114, 114, 59, 1, 10508, 114, 107, 59, 1, 10098, 4, 2, 97, 107, 11745, 11758, 99, 4, 2, 101, 107, 11752, 11755, 59, 1, 123, 59, 1, 91, 4, 2, 101, 115, 11764, 11767, 59, 1, 10635, 108, 4, 2, 100, 117, 11774, 11777, 59, 1, 10639, 59, 1, 10637, 4, 4, 97, 101, 117, 121, 11790, 11796, 11811, 11815, 114, 111, 110, 59, 1, 318, 4, 2, 100, 105, 11802, 11807, 105, 108, 59, 1, 316, 108, 59, 1, 8968, 98, 59, 1, 123, 59, 1, 1083, 4, 4, 99, 113, 114, 115, 11828, 11832, 11845, 11864, 97, 59, 1, 10550, 117, 111, 4, 2, 59, 114, 11840, 11842, 1, 8220, 59, 1, 8222, 4, 2, 100, 117, 11851, 11857, 104, 97, 114, 59, 1, 10599, 115, 104, 97, 114, 59, 1, 10571, 104, 59, 1, 8626, 4, 5, 59, 102, 103, 113, 115, 11880, 11882, 12008, 12011, 12031, 1, 8804, 116, 4, 5, 97, 104, 108, 114, 116, 11895, 11913, 11935, 11947, 11996, 114, 114, 111, 119, 4, 2, 59, 116, 11905, 11907, 1, 8592, 97, 105, 108, 59, 1, 8610, 97, 114, 112, 111, 111, 110, 4, 2, 100, 117, 11925, 11931, 111, 119, 110, 59, 1, 8637, 112, 59, 1, 8636, 101, 102, 116, 97, 114, 114, 111, 119, 115, 59, 1, 8647, 105, 103, 104, 116, 4, 3, 97, 104, 115, 11959, 11974, 11984, 114, 114, 111, 119, 4, 2, 59, 115, 11969, 11971, 1, 8596, 59, 1, 8646, 97, 114, 112, 111, 111, 110, 115, 59, 1, 8651, 113, 117, 105, 103, 97, 114, 114, 111, 119, 59, 1, 8621, 104, 114, 101, 101, 116, 105, 109, 101, 115, 59, 1, 8907, 59, 1, 8922, 4, 3, 59, 113, 115, 12019, 12021, 12024, 1, 8804, 59, 1, 8806, 108, 97, 110, 116, 59, 1, 10877, 4, 5, 59, 99, 100, 103, 115, 12043, 12045, 12049, 12070, 12083, 1, 10877, 99, 59, 1, 10920, 111, 116, 4, 2, 59, 111, 12057, 12059, 1, 10879, 4, 2, 59, 114, 12065, 12067, 1, 10881, 59, 1, 10883, 4, 2, 59, 101, 12076, 12079, 3, 8922, 65024, 115, 59, 1, 10899, 4, 5, 97, 100, 101, 103, 115, 12095, 12103, 12108, 12126, 12131, 112, 112, 114, 111, 120, 59, 1, 10885, 111, 116, 59, 1, 8918, 113, 4, 2, 103, 113, 12115, 12120, 116, 114, 59, 1, 8922, 103, 116, 114, 59, 1, 10891, 116, 114, 59, 1, 8822, 105, 109, 59, 1, 8818, 4, 3, 105, 108, 114, 12144, 12150, 12156, 115, 104, 116, 59, 1, 10620, 111, 111, 114, 59, 1, 8970, 59, 3, 55349, 56617, 4, 2, 59, 69, 12166, 12168, 1, 8822, 59, 1, 10897, 4, 2, 97, 98, 12177, 12198, 114, 4, 2, 100, 117, 12184, 12187, 59, 1, 8637, 4, 2, 59, 108, 12193, 12195, 1, 8636, 59, 1, 10602, 108, 107, 59, 1, 9604, 99, 121, 59, 1, 1113, 4, 5, 59, 97, 99, 104, 116, 12220, 12222, 12227, 12235, 12241, 1, 8810, 114, 114, 59, 1, 8647, 111, 114, 110, 101, 114, 59, 1, 8990, 97, 114, 100, 59, 1, 10603, 114, 105, 59, 1, 9722, 4, 2, 105, 111, 12252, 12258, 100, 111, 116, 59, 1, 320, 117, 115, 116, 4, 2, 59, 97, 12267, 12269, 1, 9136, 99, 104, 101, 59, 1, 9136, 4, 4, 69, 97, 101, 115, 12285, 12288, 12303, 12322, 59, 1, 8808, 112, 4, 2, 59, 112, 12295, 12297, 1, 10889, 114, 111, 120, 59, 1, 10889, 4, 2, 59, 113, 12309, 12311, 1, 10887, 4, 2, 59, 113, 12317, 12319, 1, 10887, 59, 1, 8808, 105, 109, 59, 1, 8934, 4, 8, 97, 98, 110, 111, 112, 116, 119, 122, 12345, 12359, 12364, 12421, 12446, 12467, 12474, 12490, 4, 2, 110, 114, 12351, 12355, 103, 59, 1, 10220, 114, 59, 1, 8701, 114, 107, 59, 1, 10214, 103, 4, 3, 108, 109, 114, 12373, 12401, 12409, 101, 102, 116, 4, 2, 97, 114, 12382, 12389, 114, 114, 111, 119, 59, 1, 10229, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 10231, 97, 112, 115, 116, 111, 59, 1, 10236, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 10230, 112, 97, 114, 114, 111, 119, 4, 2, 108, 114, 12433, 12439, 101, 102, 116, 59, 1, 8619, 105, 103, 104, 116, 59, 1, 8620, 4, 3, 97, 102, 108, 12454, 12458, 12462, 114, 59, 1, 10629, 59, 3, 55349, 56669, 117, 115, 59, 1, 10797, 105, 109, 101, 115, 59, 1, 10804, 4, 2, 97, 98, 12480, 12485, 115, 116, 59, 1, 8727, 97, 114, 59, 1, 95, 4, 3, 59, 101, 102, 12498, 12500, 12506, 1, 9674, 110, 103, 101, 59, 1, 9674, 59, 1, 10731, 97, 114, 4, 2, 59, 108, 12517, 12519, 1, 40, 116, 59, 1, 10643, 4, 5, 97, 99, 104, 109, 116, 12535, 12540, 12548, 12561, 12564, 114, 114, 59, 1, 8646, 111, 114, 110, 101, 114, 59, 1, 8991, 97, 114, 4, 2, 59, 100, 12556, 12558, 1, 8651, 59, 1, 10605, 59, 1, 8206, 114, 105, 59, 1, 8895, 4, 6, 97, 99, 104, 105, 113, 116, 12583, 12589, 12594, 12597, 12614, 12635, 113, 117, 111, 59, 1, 8249, 114, 59, 3, 55349, 56513, 59, 1, 8624, 109, 4, 3, 59, 101, 103, 12606, 12608, 12611, 1, 8818, 59, 1, 10893, 59, 1, 10895, 4, 2, 98, 117, 12620, 12623, 59, 1, 91, 111, 4, 2, 59, 114, 12630, 12632, 1, 8216, 59, 1, 8218, 114, 111, 107, 59, 1, 322, 5, 60, 8, 59, 99, 100, 104, 105, 108, 113, 114, 12660, 12662, 12675, 12680, 12686, 12692, 12698, 12705, 1, 60, 4, 2, 99, 105, 12668, 12671, 59, 1, 10918, 114, 59, 1, 10873, 111, 116, 59, 1, 8918, 114, 101, 101, 59, 1, 8907, 109, 101, 115, 59, 1, 8905, 97, 114, 114, 59, 1, 10614, 117, 101, 115, 116, 59, 1, 10875, 4, 2, 80, 105, 12711, 12716, 97, 114, 59, 1, 10646, 4, 3, 59, 101, 102, 12724, 12726, 12729, 1, 9667, 59, 1, 8884, 59, 1, 9666, 114, 4, 2, 100, 117, 12739, 12746, 115, 104, 97, 114, 59, 1, 10570, 104, 97, 114, 59, 1, 10598, 4, 2, 101, 110, 12758, 12768, 114, 116, 110, 101, 113, 113, 59, 3, 8808, 65024, 69, 59, 3, 8808, 65024, 4, 14, 68, 97, 99, 100, 101, 102, 104, 105, 108, 110, 111, 112, 115, 117, 12803, 12809, 12893, 12908, 12914, 12928, 12933, 12937, 13011, 13025, 13032, 13049, 13052, 13069, 68, 111, 116, 59, 1, 8762, 4, 4, 99, 108, 112, 114, 12819, 12827, 12849, 12887, 114, 5, 175, 1, 59, 12825, 1, 175, 4, 2, 101, 116, 12833, 12836, 59, 1, 9794, 4, 2, 59, 101, 12842, 12844, 1, 10016, 115, 101, 59, 1, 10016, 4, 2, 59, 115, 12855, 12857, 1, 8614, 116, 111, 4, 4, 59, 100, 108, 117, 12869, 12871, 12877, 12883, 1, 8614, 111, 119, 110, 59, 1, 8615, 101, 102, 116, 59, 1, 8612, 112, 59, 1, 8613, 107, 101, 114, 59, 1, 9646, 4, 2, 111, 121, 12899, 12905, 109, 109, 97, 59, 1, 10793, 59, 1, 1084, 97, 115, 104, 59, 1, 8212, 97, 115, 117, 114, 101, 100, 97, 110, 103, 108, 101, 59, 1, 8737, 114, 59, 3, 55349, 56618, 111, 59, 1, 8487, 4, 3, 99, 100, 110, 12945, 12954, 12985, 114, 111, 5, 181, 1, 59, 12952, 1, 181, 4, 4, 59, 97, 99, 100, 12964, 12966, 12971, 12976, 1, 8739, 115, 116, 59, 1, 42, 105, 114, 59, 1, 10992, 111, 116, 5, 183, 1, 59, 12983, 1, 183, 117, 115, 4, 3, 59, 98, 100, 12995, 12997, 13e3, 1, 8722, 59, 1, 8863, 4, 2, 59, 117, 13006, 13008, 1, 8760, 59, 1, 10794, 4, 2, 99, 100, 13017, 13021, 112, 59, 1, 10971, 114, 59, 1, 8230, 112, 108, 117, 115, 59, 1, 8723, 4, 2, 100, 112, 13038, 13044, 101, 108, 115, 59, 1, 8871, 102, 59, 3, 55349, 56670, 59, 1, 8723, 4, 2, 99, 116, 13058, 13063, 114, 59, 3, 55349, 56514, 112, 111, 115, 59, 1, 8766, 4, 3, 59, 108, 109, 13077, 13079, 13087, 1, 956, 116, 105, 109, 97, 112, 59, 1, 8888, 97, 112, 59, 1, 8888, 4, 24, 71, 76, 82, 86, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 108, 109, 111, 112, 114, 115, 116, 117, 118, 119, 13142, 13165, 13217, 13229, 13247, 13330, 13359, 13414, 13420, 13508, 13513, 13579, 13602, 13626, 13631, 13762, 13767, 13855, 13936, 13995, 14214, 14285, 14312, 14432, 4, 2, 103, 116, 13148, 13152, 59, 3, 8921, 824, 4, 2, 59, 118, 13158, 13161, 3, 8811, 8402, 59, 3, 8811, 824, 4, 3, 101, 108, 116, 13173, 13200, 13204, 102, 116, 4, 2, 97, 114, 13181, 13188, 114, 114, 111, 119, 59, 1, 8653, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8654, 59, 3, 8920, 824, 4, 2, 59, 118, 13210, 13213, 3, 8810, 8402, 59, 3, 8810, 824, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8655, 4, 2, 68, 100, 13235, 13241, 97, 115, 104, 59, 1, 8879, 97, 115, 104, 59, 1, 8878, 4, 5, 98, 99, 110, 112, 116, 13259, 13264, 13270, 13275, 13308, 108, 97, 59, 1, 8711, 117, 116, 101, 59, 1, 324, 103, 59, 3, 8736, 8402, 4, 5, 59, 69, 105, 111, 112, 13287, 13289, 13293, 13298, 13302, 1, 8777, 59, 3, 10864, 824, 100, 59, 3, 8779, 824, 115, 59, 1, 329, 114, 111, 120, 59, 1, 8777, 117, 114, 4, 2, 59, 97, 13316, 13318, 1, 9838, 108, 4, 2, 59, 115, 13325, 13327, 1, 9838, 59, 1, 8469, 4, 2, 115, 117, 13336, 13344, 112, 5, 160, 1, 59, 13342, 1, 160, 109, 112, 4, 2, 59, 101, 13352, 13355, 3, 8782, 824, 59, 3, 8783, 824, 4, 5, 97, 101, 111, 117, 121, 13371, 13385, 13391, 13407, 13411, 4, 2, 112, 114, 13377, 13380, 59, 1, 10819, 111, 110, 59, 1, 328, 100, 105, 108, 59, 1, 326, 110, 103, 4, 2, 59, 100, 13399, 13401, 1, 8775, 111, 116, 59, 3, 10861, 824, 112, 59, 1, 10818, 59, 1, 1085, 97, 115, 104, 59, 1, 8211, 4, 7, 59, 65, 97, 100, 113, 115, 120, 13436, 13438, 13443, 13466, 13472, 13478, 13494, 1, 8800, 114, 114, 59, 1, 8663, 114, 4, 2, 104, 114, 13450, 13454, 107, 59, 1, 10532, 4, 2, 59, 111, 13460, 13462, 1, 8599, 119, 59, 1, 8599, 111, 116, 59, 3, 8784, 824, 117, 105, 118, 59, 1, 8802, 4, 2, 101, 105, 13484, 13489, 97, 114, 59, 1, 10536, 109, 59, 3, 8770, 824, 105, 115, 116, 4, 2, 59, 115, 13503, 13505, 1, 8708, 59, 1, 8708, 114, 59, 3, 55349, 56619, 4, 4, 69, 101, 115, 116, 13523, 13527, 13563, 13568, 59, 3, 8807, 824, 4, 3, 59, 113, 115, 13535, 13537, 13559, 1, 8817, 4, 3, 59, 113, 115, 13545, 13547, 13551, 1, 8817, 59, 3, 8807, 824, 108, 97, 110, 116, 59, 3, 10878, 824, 59, 3, 10878, 824, 105, 109, 59, 1, 8821, 4, 2, 59, 114, 13574, 13576, 1, 8815, 59, 1, 8815, 4, 3, 65, 97, 112, 13587, 13592, 13597, 114, 114, 59, 1, 8654, 114, 114, 59, 1, 8622, 97, 114, 59, 1, 10994, 4, 3, 59, 115, 118, 13610, 13612, 13623, 1, 8715, 4, 2, 59, 100, 13618, 13620, 1, 8956, 59, 1, 8954, 59, 1, 8715, 99, 121, 59, 1, 1114, 4, 7, 65, 69, 97, 100, 101, 115, 116, 13647, 13652, 13656, 13661, 13665, 13737, 13742, 114, 114, 59, 1, 8653, 59, 3, 8806, 824, 114, 114, 59, 1, 8602, 114, 59, 1, 8229, 4, 4, 59, 102, 113, 115, 13675, 13677, 13703, 13725, 1, 8816, 116, 4, 2, 97, 114, 13684, 13691, 114, 114, 111, 119, 59, 1, 8602, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8622, 4, 3, 59, 113, 115, 13711, 13713, 13717, 1, 8816, 59, 3, 8806, 824, 108, 97, 110, 116, 59, 3, 10877, 824, 4, 2, 59, 115, 13731, 13734, 3, 10877, 824, 59, 1, 8814, 105, 109, 59, 1, 8820, 4, 2, 59, 114, 13748, 13750, 1, 8814, 105, 4, 2, 59, 101, 13757, 13759, 1, 8938, 59, 1, 8940, 105, 100, 59, 1, 8740, 4, 2, 112, 116, 13773, 13778, 102, 59, 3, 55349, 56671, 5, 172, 3, 59, 105, 110, 13787, 13789, 13829, 1, 172, 110, 4, 4, 59, 69, 100, 118, 13800, 13802, 13806, 13812, 1, 8713, 59, 3, 8953, 824, 111, 116, 59, 3, 8949, 824, 4, 3, 97, 98, 99, 13820, 13823, 13826, 59, 1, 8713, 59, 1, 8951, 59, 1, 8950, 105, 4, 2, 59, 118, 13836, 13838, 1, 8716, 4, 3, 97, 98, 99, 13846, 13849, 13852, 59, 1, 8716, 59, 1, 8958, 59, 1, 8957, 4, 3, 97, 111, 114, 13863, 13892, 13899, 114, 4, 4, 59, 97, 115, 116, 13874, 13876, 13883, 13888, 1, 8742, 108, 108, 101, 108, 59, 1, 8742, 108, 59, 3, 11005, 8421, 59, 3, 8706, 824, 108, 105, 110, 116, 59, 1, 10772, 4, 3, 59, 99, 101, 13907, 13909, 13914, 1, 8832, 117, 101, 59, 1, 8928, 4, 2, 59, 99, 13920, 13923, 3, 10927, 824, 4, 2, 59, 101, 13929, 13931, 1, 8832, 113, 59, 3, 10927, 824, 4, 4, 65, 97, 105, 116, 13946, 13951, 13971, 13982, 114, 114, 59, 1, 8655, 114, 114, 4, 3, 59, 99, 119, 13961, 13963, 13967, 1, 8603, 59, 3, 10547, 824, 59, 3, 8605, 824, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8603, 114, 105, 4, 2, 59, 101, 13990, 13992, 1, 8939, 59, 1, 8941, 4, 7, 99, 104, 105, 109, 112, 113, 117, 14011, 14036, 14060, 14080, 14085, 14090, 14106, 4, 4, 59, 99, 101, 114, 14021, 14023, 14028, 14032, 1, 8833, 117, 101, 59, 1, 8929, 59, 3, 10928, 824, 59, 3, 55349, 56515, 111, 114, 116, 4, 2, 109, 112, 14045, 14050, 105, 100, 59, 1, 8740, 97, 114, 97, 108, 108, 101, 108, 59, 1, 8742, 109, 4, 2, 59, 101, 14067, 14069, 1, 8769, 4, 2, 59, 113, 14075, 14077, 1, 8772, 59, 1, 8772, 105, 100, 59, 1, 8740, 97, 114, 59, 1, 8742, 115, 117, 4, 2, 98, 112, 14098, 14102, 101, 59, 1, 8930, 101, 59, 1, 8931, 4, 3, 98, 99, 112, 14114, 14157, 14171, 4, 4, 59, 69, 101, 115, 14124, 14126, 14130, 14133, 1, 8836, 59, 3, 10949, 824, 59, 1, 8840, 101, 116, 4, 2, 59, 101, 14141, 14144, 3, 8834, 8402, 113, 4, 2, 59, 113, 14151, 14153, 1, 8840, 59, 3, 10949, 824, 99, 4, 2, 59, 101, 14164, 14166, 1, 8833, 113, 59, 3, 10928, 824, 4, 4, 59, 69, 101, 115, 14181, 14183, 14187, 14190, 1, 8837, 59, 3, 10950, 824, 59, 1, 8841, 101, 116, 4, 2, 59, 101, 14198, 14201, 3, 8835, 8402, 113, 4, 2, 59, 113, 14208, 14210, 1, 8841, 59, 3, 10950, 824, 4, 4, 103, 105, 108, 114, 14224, 14228, 14238, 14242, 108, 59, 1, 8825, 108, 100, 101, 5, 241, 1, 59, 14236, 1, 241, 103, 59, 1, 8824, 105, 97, 110, 103, 108, 101, 4, 2, 108, 114, 14254, 14269, 101, 102, 116, 4, 2, 59, 101, 14263, 14265, 1, 8938, 113, 59, 1, 8940, 105, 103, 104, 116, 4, 2, 59, 101, 14279, 14281, 1, 8939, 113, 59, 1, 8941, 4, 2, 59, 109, 14291, 14293, 1, 957, 4, 3, 59, 101, 115, 14301, 14303, 14308, 1, 35, 114, 111, 59, 1, 8470, 112, 59, 1, 8199, 4, 9, 68, 72, 97, 100, 103, 105, 108, 114, 115, 14332, 14338, 14344, 14349, 14355, 14369, 14376, 14408, 14426, 97, 115, 104, 59, 1, 8877, 97, 114, 114, 59, 1, 10500, 112, 59, 3, 8781, 8402, 97, 115, 104, 59, 1, 8876, 4, 2, 101, 116, 14361, 14365, 59, 3, 8805, 8402, 59, 3, 62, 8402, 110, 102, 105, 110, 59, 1, 10718, 4, 3, 65, 101, 116, 14384, 14389, 14393, 114, 114, 59, 1, 10498, 59, 3, 8804, 8402, 4, 2, 59, 114, 14399, 14402, 3, 60, 8402, 105, 101, 59, 3, 8884, 8402, 4, 2, 65, 116, 14414, 14419, 114, 114, 59, 1, 10499, 114, 105, 101, 59, 3, 8885, 8402, 105, 109, 59, 3, 8764, 8402, 4, 3, 65, 97, 110, 14440, 14445, 14468, 114, 114, 59, 1, 8662, 114, 4, 2, 104, 114, 14452, 14456, 107, 59, 1, 10531, 4, 2, 59, 111, 14462, 14464, 1, 8598, 119, 59, 1, 8598, 101, 97, 114, 59, 1, 10535, 4, 18, 83, 97, 99, 100, 101, 102, 103, 104, 105, 108, 109, 111, 112, 114, 115, 116, 117, 118, 14512, 14515, 14535, 14560, 14597, 14603, 14618, 14643, 14657, 14662, 14701, 14741, 14747, 14769, 14851, 14877, 14907, 14916, 59, 1, 9416, 4, 2, 99, 115, 14521, 14531, 117, 116, 101, 5, 243, 1, 59, 14529, 1, 243, 116, 59, 1, 8859, 4, 2, 105, 121, 14541, 14557, 114, 4, 2, 59, 99, 14548, 14550, 1, 8858, 5, 244, 1, 59, 14555, 1, 244, 59, 1, 1086, 4, 5, 97, 98, 105, 111, 115, 14572, 14577, 14583, 14587, 14591, 115, 104, 59, 1, 8861, 108, 97, 99, 59, 1, 337, 118, 59, 1, 10808, 116, 59, 1, 8857, 111, 108, 100, 59, 1, 10684, 108, 105, 103, 59, 1, 339, 4, 2, 99, 114, 14609, 14614, 105, 114, 59, 1, 10687, 59, 3, 55349, 56620, 4, 3, 111, 114, 116, 14626, 14630, 14640, 110, 59, 1, 731, 97, 118, 101, 5, 242, 1, 59, 14638, 1, 242, 59, 1, 10689, 4, 2, 98, 109, 14649, 14654, 97, 114, 59, 1, 10677, 59, 1, 937, 110, 116, 59, 1, 8750, 4, 4, 97, 99, 105, 116, 14672, 14677, 14693, 14698, 114, 114, 59, 1, 8634, 4, 2, 105, 114, 14683, 14687, 114, 59, 1, 10686, 111, 115, 115, 59, 1, 10683, 110, 101, 59, 1, 8254, 59, 1, 10688, 4, 3, 97, 101, 105, 14709, 14714, 14719, 99, 114, 59, 1, 333, 103, 97, 59, 1, 969, 4, 3, 99, 100, 110, 14727, 14733, 14736, 114, 111, 110, 59, 1, 959, 59, 1, 10678, 117, 115, 59, 1, 8854, 112, 102, 59, 3, 55349, 56672, 4, 3, 97, 101, 108, 14755, 14759, 14764, 114, 59, 1, 10679, 114, 112, 59, 1, 10681, 117, 115, 59, 1, 8853, 4, 7, 59, 97, 100, 105, 111, 115, 118, 14785, 14787, 14792, 14831, 14837, 14841, 14848, 1, 8744, 114, 114, 59, 1, 8635, 4, 4, 59, 101, 102, 109, 14802, 14804, 14817, 14824, 1, 10845, 114, 4, 2, 59, 111, 14811, 14813, 1, 8500, 102, 59, 1, 8500, 5, 170, 1, 59, 14822, 1, 170, 5, 186, 1, 59, 14829, 1, 186, 103, 111, 102, 59, 1, 8886, 114, 59, 1, 10838, 108, 111, 112, 101, 59, 1, 10839, 59, 1, 10843, 4, 3, 99, 108, 111, 14859, 14863, 14873, 114, 59, 1, 8500, 97, 115, 104, 5, 248, 1, 59, 14871, 1, 248, 108, 59, 1, 8856, 105, 4, 2, 108, 109, 14884, 14893, 100, 101, 5, 245, 1, 59, 14891, 1, 245, 101, 115, 4, 2, 59, 97, 14901, 14903, 1, 8855, 115, 59, 1, 10806, 109, 108, 5, 246, 1, 59, 14914, 1, 246, 98, 97, 114, 59, 1, 9021, 4, 12, 97, 99, 101, 102, 104, 105, 108, 109, 111, 114, 115, 117, 14948, 14992, 14996, 15033, 15038, 15068, 15090, 15189, 15192, 15222, 15427, 15441, 114, 4, 4, 59, 97, 115, 116, 14959, 14961, 14976, 14989, 1, 8741, 5, 182, 2, 59, 108, 14968, 14970, 1, 182, 108, 101, 108, 59, 1, 8741, 4, 2, 105, 108, 14982, 14986, 109, 59, 1, 10995, 59, 1, 11005, 59, 1, 8706, 121, 59, 1, 1087, 114, 4, 5, 99, 105, 109, 112, 116, 15009, 15014, 15019, 15024, 15027, 110, 116, 59, 1, 37, 111, 100, 59, 1, 46, 105, 108, 59, 1, 8240, 59, 1, 8869, 101, 110, 107, 59, 1, 8241, 114, 59, 3, 55349, 56621, 4, 3, 105, 109, 111, 15046, 15057, 15063, 4, 2, 59, 118, 15052, 15054, 1, 966, 59, 1, 981, 109, 97, 116, 59, 1, 8499, 110, 101, 59, 1, 9742, 4, 3, 59, 116, 118, 15076, 15078, 15087, 1, 960, 99, 104, 102, 111, 114, 107, 59, 1, 8916, 59, 1, 982, 4, 2, 97, 117, 15096, 15119, 110, 4, 2, 99, 107, 15103, 15115, 107, 4, 2, 59, 104, 15110, 15112, 1, 8463, 59, 1, 8462, 118, 59, 1, 8463, 115, 4, 9, 59, 97, 98, 99, 100, 101, 109, 115, 116, 15140, 15142, 15148, 15151, 15156, 15168, 15171, 15179, 15184, 1, 43, 99, 105, 114, 59, 1, 10787, 59, 1, 8862, 105, 114, 59, 1, 10786, 4, 2, 111, 117, 15162, 15165, 59, 1, 8724, 59, 1, 10789, 59, 1, 10866, 110, 5, 177, 1, 59, 15177, 1, 177, 105, 109, 59, 1, 10790, 119, 111, 59, 1, 10791, 59, 1, 177, 4, 3, 105, 112, 117, 15200, 15208, 15213, 110, 116, 105, 110, 116, 59, 1, 10773, 102, 59, 3, 55349, 56673, 110, 100, 5, 163, 1, 59, 15220, 1, 163, 4, 10, 59, 69, 97, 99, 101, 105, 110, 111, 115, 117, 15244, 15246, 15249, 15253, 15258, 15334, 15347, 15367, 15416, 15421, 1, 8826, 59, 1, 10931, 112, 59, 1, 10935, 117, 101, 59, 1, 8828, 4, 2, 59, 99, 15264, 15266, 1, 10927, 4, 6, 59, 97, 99, 101, 110, 115, 15280, 15282, 15290, 15299, 15303, 15329, 1, 8826, 112, 112, 114, 111, 120, 59, 1, 10935, 117, 114, 108, 121, 101, 113, 59, 1, 8828, 113, 59, 1, 10927, 4, 3, 97, 101, 115, 15311, 15319, 15324, 112, 112, 114, 111, 120, 59, 1, 10937, 113, 113, 59, 1, 10933, 105, 109, 59, 1, 8936, 105, 109, 59, 1, 8830, 109, 101, 4, 2, 59, 115, 15342, 15344, 1, 8242, 59, 1, 8473, 4, 3, 69, 97, 115, 15355, 15358, 15362, 59, 1, 10933, 112, 59, 1, 10937, 105, 109, 59, 1, 8936, 4, 3, 100, 102, 112, 15375, 15378, 15404, 59, 1, 8719, 4, 3, 97, 108, 115, 15386, 15392, 15398, 108, 97, 114, 59, 1, 9006, 105, 110, 101, 59, 1, 8978, 117, 114, 102, 59, 1, 8979, 4, 2, 59, 116, 15410, 15412, 1, 8733, 111, 59, 1, 8733, 105, 109, 59, 1, 8830, 114, 101, 108, 59, 1, 8880, 4, 2, 99, 105, 15433, 15438, 114, 59, 3, 55349, 56517, 59, 1, 968, 110, 99, 115, 112, 59, 1, 8200, 4, 6, 102, 105, 111, 112, 115, 117, 15462, 15467, 15472, 15478, 15485, 15491, 114, 59, 3, 55349, 56622, 110, 116, 59, 1, 10764, 112, 102, 59, 3, 55349, 56674, 114, 105, 109, 101, 59, 1, 8279, 99, 114, 59, 3, 55349, 56518, 4, 3, 97, 101, 111, 15499, 15520, 15534, 116, 4, 2, 101, 105, 15506, 15515, 114, 110, 105, 111, 110, 115, 59, 1, 8461, 110, 116, 59, 1, 10774, 115, 116, 4, 2, 59, 101, 15528, 15530, 1, 63, 113, 59, 1, 8799, 116, 5, 34, 1, 59, 15540, 1, 34, 4, 21, 65, 66, 72, 97, 98, 99, 100, 101, 102, 104, 105, 108, 109, 110, 111, 112, 114, 115, 116, 117, 120, 15586, 15609, 15615, 15620, 15796, 15855, 15893, 15931, 15977, 16001, 16039, 16183, 16204, 16222, 16228, 16285, 16312, 16318, 16363, 16408, 16416, 4, 3, 97, 114, 116, 15594, 15599, 15603, 114, 114, 59, 1, 8667, 114, 59, 1, 8658, 97, 105, 108, 59, 1, 10524, 97, 114, 114, 59, 1, 10511, 97, 114, 59, 1, 10596, 4, 7, 99, 100, 101, 110, 113, 114, 116, 15636, 15651, 15656, 15664, 15687, 15696, 15770, 4, 2, 101, 117, 15642, 15646, 59, 3, 8765, 817, 116, 101, 59, 1, 341, 105, 99, 59, 1, 8730, 109, 112, 116, 121, 118, 59, 1, 10675, 103, 4, 4, 59, 100, 101, 108, 15675, 15677, 15680, 15683, 1, 10217, 59, 1, 10642, 59, 1, 10661, 101, 59, 1, 10217, 117, 111, 5, 187, 1, 59, 15694, 1, 187, 114, 4, 11, 59, 97, 98, 99, 102, 104, 108, 112, 115, 116, 119, 15721, 15723, 15727, 15739, 15742, 15746, 15750, 15754, 15758, 15763, 15767, 1, 8594, 112, 59, 1, 10613, 4, 2, 59, 102, 15733, 15735, 1, 8677, 115, 59, 1, 10528, 59, 1, 10547, 115, 59, 1, 10526, 107, 59, 1, 8618, 112, 59, 1, 8620, 108, 59, 1, 10565, 105, 109, 59, 1, 10612, 108, 59, 1, 8611, 59, 1, 8605, 4, 2, 97, 105, 15776, 15781, 105, 108, 59, 1, 10522, 111, 4, 2, 59, 110, 15788, 15790, 1, 8758, 97, 108, 115, 59, 1, 8474, 4, 3, 97, 98, 114, 15804, 15809, 15814, 114, 114, 59, 1, 10509, 114, 107, 59, 1, 10099, 4, 2, 97, 107, 15820, 15833, 99, 4, 2, 101, 107, 15827, 15830, 59, 1, 125, 59, 1, 93, 4, 2, 101, 115, 15839, 15842, 59, 1, 10636, 108, 4, 2, 100, 117, 15849, 15852, 59, 1, 10638, 59, 1, 10640, 4, 4, 97, 101, 117, 121, 15865, 15871, 15886, 15890, 114, 111, 110, 59, 1, 345, 4, 2, 100, 105, 15877, 15882, 105, 108, 59, 1, 343, 108, 59, 1, 8969, 98, 59, 1, 125, 59, 1, 1088, 4, 4, 99, 108, 113, 115, 15903, 15907, 15914, 15927, 97, 59, 1, 10551, 100, 104, 97, 114, 59, 1, 10601, 117, 111, 4, 2, 59, 114, 15922, 15924, 1, 8221, 59, 1, 8221, 104, 59, 1, 8627, 4, 3, 97, 99, 103, 15939, 15966, 15970, 108, 4, 4, 59, 105, 112, 115, 15950, 15952, 15957, 15963, 1, 8476, 110, 101, 59, 1, 8475, 97, 114, 116, 59, 1, 8476, 59, 1, 8477, 116, 59, 1, 9645, 5, 174, 1, 59, 15975, 1, 174, 4, 3, 105, 108, 114, 15985, 15991, 15997, 115, 104, 116, 59, 1, 10621, 111, 111, 114, 59, 1, 8971, 59, 3, 55349, 56623, 4, 2, 97, 111, 16007, 16028, 114, 4, 2, 100, 117, 16014, 16017, 59, 1, 8641, 4, 2, 59, 108, 16023, 16025, 1, 8640, 59, 1, 10604, 4, 2, 59, 118, 16034, 16036, 1, 961, 59, 1, 1009, 4, 3, 103, 110, 115, 16047, 16167, 16171, 104, 116, 4, 6, 97, 104, 108, 114, 115, 116, 16063, 16081, 16103, 16130, 16143, 16155, 114, 114, 111, 119, 4, 2, 59, 116, 16073, 16075, 1, 8594, 97, 105, 108, 59, 1, 8611, 97, 114, 112, 111, 111, 110, 4, 2, 100, 117, 16093, 16099, 111, 119, 110, 59, 1, 8641, 112, 59, 1, 8640, 101, 102, 116, 4, 2, 97, 104, 16112, 16120, 114, 114, 111, 119, 115, 59, 1, 8644, 97, 114, 112, 111, 111, 110, 115, 59, 1, 8652, 105, 103, 104, 116, 97, 114, 114, 111, 119, 115, 59, 1, 8649, 113, 117, 105, 103, 97, 114, 114, 111, 119, 59, 1, 8605, 104, 114, 101, 101, 116, 105, 109, 101, 115, 59, 1, 8908, 103, 59, 1, 730, 105, 110, 103, 100, 111, 116, 115, 101, 113, 59, 1, 8787, 4, 3, 97, 104, 109, 16191, 16196, 16201, 114, 114, 59, 1, 8644, 97, 114, 59, 1, 8652, 59, 1, 8207, 111, 117, 115, 116, 4, 2, 59, 97, 16214, 16216, 1, 9137, 99, 104, 101, 59, 1, 9137, 109, 105, 100, 59, 1, 10990, 4, 4, 97, 98, 112, 116, 16238, 16252, 16257, 16278, 4, 2, 110, 114, 16244, 16248, 103, 59, 1, 10221, 114, 59, 1, 8702, 114, 107, 59, 1, 10215, 4, 3, 97, 102, 108, 16265, 16269, 16273, 114, 59, 1, 10630, 59, 3, 55349, 56675, 117, 115, 59, 1, 10798, 105, 109, 101, 115, 59, 1, 10805, 4, 2, 97, 112, 16291, 16304, 114, 4, 2, 59, 103, 16298, 16300, 1, 41, 116, 59, 1, 10644, 111, 108, 105, 110, 116, 59, 1, 10770, 97, 114, 114, 59, 1, 8649, 4, 4, 97, 99, 104, 113, 16328, 16334, 16339, 16342, 113, 117, 111, 59, 1, 8250, 114, 59, 3, 55349, 56519, 59, 1, 8625, 4, 2, 98, 117, 16348, 16351, 59, 1, 93, 111, 4, 2, 59, 114, 16358, 16360, 1, 8217, 59, 1, 8217, 4, 3, 104, 105, 114, 16371, 16377, 16383, 114, 101, 101, 59, 1, 8908, 109, 101, 115, 59, 1, 8906, 105, 4, 4, 59, 101, 102, 108, 16394, 16396, 16399, 16402, 1, 9657, 59, 1, 8885, 59, 1, 9656, 116, 114, 105, 59, 1, 10702, 108, 117, 104, 97, 114, 59, 1, 10600, 59, 1, 8478, 4, 19, 97, 98, 99, 100, 101, 102, 104, 105, 108, 109, 111, 112, 113, 114, 115, 116, 117, 119, 122, 16459, 16466, 16472, 16572, 16590, 16672, 16687, 16746, 16844, 16850, 16924, 16963, 16988, 17115, 17121, 17154, 17206, 17614, 17656, 99, 117, 116, 101, 59, 1, 347, 113, 117, 111, 59, 1, 8218, 4, 10, 59, 69, 97, 99, 101, 105, 110, 112, 115, 121, 16494, 16496, 16499, 16513, 16518, 16531, 16536, 16556, 16564, 16569, 1, 8827, 59, 1, 10932, 4, 2, 112, 114, 16505, 16508, 59, 1, 10936, 111, 110, 59, 1, 353, 117, 101, 59, 1, 8829, 4, 2, 59, 100, 16524, 16526, 1, 10928, 105, 108, 59, 1, 351, 114, 99, 59, 1, 349, 4, 3, 69, 97, 115, 16544, 16547, 16551, 59, 1, 10934, 112, 59, 1, 10938, 105, 109, 59, 1, 8937, 111, 108, 105, 110, 116, 59, 1, 10771, 105, 109, 59, 1, 8831, 59, 1, 1089, 111, 116, 4, 3, 59, 98, 101, 16582, 16584, 16587, 1, 8901, 59, 1, 8865, 59, 1, 10854, 4, 7, 65, 97, 99, 109, 115, 116, 120, 16606, 16611, 16634, 16642, 16646, 16652, 16668, 114, 114, 59, 1, 8664, 114, 4, 2, 104, 114, 16618, 16622, 107, 59, 1, 10533, 4, 2, 59, 111, 16628, 16630, 1, 8600, 119, 59, 1, 8600, 116, 5, 167, 1, 59, 16640, 1, 167, 105, 59, 1, 59, 119, 97, 114, 59, 1, 10537, 109, 4, 2, 105, 110, 16659, 16665, 110, 117, 115, 59, 1, 8726, 59, 1, 8726, 116, 59, 1, 10038, 114, 4, 2, 59, 111, 16679, 16682, 3, 55349, 56624, 119, 110, 59, 1, 8994, 4, 4, 97, 99, 111, 121, 16697, 16702, 16716, 16739, 114, 112, 59, 1, 9839, 4, 2, 104, 121, 16708, 16713, 99, 121, 59, 1, 1097, 59, 1, 1096, 114, 116, 4, 2, 109, 112, 16724, 16729, 105, 100, 59, 1, 8739, 97, 114, 97, 108, 108, 101, 108, 59, 1, 8741, 5, 173, 1, 59, 16744, 1, 173, 4, 2, 103, 109, 16752, 16770, 109, 97, 4, 3, 59, 102, 118, 16762, 16764, 16767, 1, 963, 59, 1, 962, 59, 1, 962, 4, 8, 59, 100, 101, 103, 108, 110, 112, 114, 16788, 16790, 16795, 16806, 16817, 16828, 16832, 16838, 1, 8764, 111, 116, 59, 1, 10858, 4, 2, 59, 113, 16801, 16803, 1, 8771, 59, 1, 8771, 4, 2, 59, 69, 16812, 16814, 1, 10910, 59, 1, 10912, 4, 2, 59, 69, 16823, 16825, 1, 10909, 59, 1, 10911, 101, 59, 1, 8774, 108, 117, 115, 59, 1, 10788, 97, 114, 114, 59, 1, 10610, 97, 114, 114, 59, 1, 8592, 4, 4, 97, 101, 105, 116, 16860, 16883, 16891, 16904, 4, 2, 108, 115, 16866, 16878, 108, 115, 101, 116, 109, 105, 110, 117, 115, 59, 1, 8726, 104, 112, 59, 1, 10803, 112, 97, 114, 115, 108, 59, 1, 10724, 4, 2, 100, 108, 16897, 16900, 59, 1, 8739, 101, 59, 1, 8995, 4, 2, 59, 101, 16910, 16912, 1, 10922, 4, 2, 59, 115, 16918, 16920, 1, 10924, 59, 3, 10924, 65024, 4, 3, 102, 108, 112, 16932, 16938, 16958, 116, 99, 121, 59, 1, 1100, 4, 2, 59, 98, 16944, 16946, 1, 47, 4, 2, 59, 97, 16952, 16954, 1, 10692, 114, 59, 1, 9023, 102, 59, 3, 55349, 56676, 97, 4, 2, 100, 114, 16970, 16985, 101, 115, 4, 2, 59, 117, 16978, 16980, 1, 9824, 105, 116, 59, 1, 9824, 59, 1, 8741, 4, 3, 99, 115, 117, 16996, 17028, 17089, 4, 2, 97, 117, 17002, 17015, 112, 4, 2, 59, 115, 17009, 17011, 1, 8851, 59, 3, 8851, 65024, 112, 4, 2, 59, 115, 17022, 17024, 1, 8852, 59, 3, 8852, 65024, 117, 4, 2, 98, 112, 17035, 17062, 4, 3, 59, 101, 115, 17043, 17045, 17048, 1, 8847, 59, 1, 8849, 101, 116, 4, 2, 59, 101, 17056, 17058, 1, 8847, 113, 59, 1, 8849, 4, 3, 59, 101, 115, 17070, 17072, 17075, 1, 8848, 59, 1, 8850, 101, 116, 4, 2, 59, 101, 17083, 17085, 1, 8848, 113, 59, 1, 8850, 4, 3, 59, 97, 102, 17097, 17099, 17112, 1, 9633, 114, 4, 2, 101, 102, 17106, 17109, 59, 1, 9633, 59, 1, 9642, 59, 1, 9642, 97, 114, 114, 59, 1, 8594, 4, 4, 99, 101, 109, 116, 17131, 17136, 17142, 17148, 114, 59, 3, 55349, 56520, 116, 109, 110, 59, 1, 8726, 105, 108, 101, 59, 1, 8995, 97, 114, 102, 59, 1, 8902, 4, 2, 97, 114, 17160, 17172, 114, 4, 2, 59, 102, 17167, 17169, 1, 9734, 59, 1, 9733, 4, 2, 97, 110, 17178, 17202, 105, 103, 104, 116, 4, 2, 101, 112, 17188, 17197, 112, 115, 105, 108, 111, 110, 59, 1, 1013, 104, 105, 59, 1, 981, 115, 59, 1, 175, 4, 5, 98, 99, 109, 110, 112, 17218, 17351, 17420, 17423, 17427, 4, 9, 59, 69, 100, 101, 109, 110, 112, 114, 115, 17238, 17240, 17243, 17248, 17261, 17267, 17279, 17285, 17291, 1, 8834, 59, 1, 10949, 111, 116, 59, 1, 10941, 4, 2, 59, 100, 17254, 17256, 1, 8838, 111, 116, 59, 1, 10947, 117, 108, 116, 59, 1, 10945, 4, 2, 69, 101, 17273, 17276, 59, 1, 10955, 59, 1, 8842, 108, 117, 115, 59, 1, 10943, 97, 114, 114, 59, 1, 10617, 4, 3, 101, 105, 117, 17299, 17335, 17339, 116, 4, 3, 59, 101, 110, 17308, 17310, 17322, 1, 8834, 113, 4, 2, 59, 113, 17317, 17319, 1, 8838, 59, 1, 10949, 101, 113, 4, 2, 59, 113, 17330, 17332, 1, 8842, 59, 1, 10955, 109, 59, 1, 10951, 4, 2, 98, 112, 17345, 17348, 59, 1, 10965, 59, 1, 10963, 99, 4, 6, 59, 97, 99, 101, 110, 115, 17366, 17368, 17376, 17385, 17389, 17415, 1, 8827, 112, 112, 114, 111, 120, 59, 1, 10936, 117, 114, 108, 121, 101, 113, 59, 1, 8829, 113, 59, 1, 10928, 4, 3, 97, 101, 115, 17397, 17405, 17410, 112, 112, 114, 111, 120, 59, 1, 10938, 113, 113, 59, 1, 10934, 105, 109, 59, 1, 8937, 105, 109, 59, 1, 8831, 59, 1, 8721, 103, 59, 1, 9834, 4, 13, 49, 50, 51, 59, 69, 100, 101, 104, 108, 109, 110, 112, 115, 17455, 17462, 17469, 17476, 17478, 17481, 17496, 17509, 17524, 17530, 17536, 17548, 17554, 5, 185, 1, 59, 17460, 1, 185, 5, 178, 1, 59, 17467, 1, 178, 5, 179, 1, 59, 17474, 1, 179, 1, 8835, 59, 1, 10950, 4, 2, 111, 115, 17487, 17491, 116, 59, 1, 10942, 117, 98, 59, 1, 10968, 4, 2, 59, 100, 17502, 17504, 1, 8839, 111, 116, 59, 1, 10948, 115, 4, 2, 111, 117, 17516, 17520, 108, 59, 1, 10185, 98, 59, 1, 10967, 97, 114, 114, 59, 1, 10619, 117, 108, 116, 59, 1, 10946, 4, 2, 69, 101, 17542, 17545, 59, 1, 10956, 59, 1, 8843, 108, 117, 115, 59, 1, 10944, 4, 3, 101, 105, 117, 17562, 17598, 17602, 116, 4, 3, 59, 101, 110, 17571, 17573, 17585, 1, 8835, 113, 4, 2, 59, 113, 17580, 17582, 1, 8839, 59, 1, 10950, 101, 113, 4, 2, 59, 113, 17593, 17595, 1, 8843, 59, 1, 10956, 109, 59, 1, 10952, 4, 2, 98, 112, 17608, 17611, 59, 1, 10964, 59, 1, 10966, 4, 3, 65, 97, 110, 17622, 17627, 17650, 114, 114, 59, 1, 8665, 114, 4, 2, 104, 114, 17634, 17638, 107, 59, 1, 10534, 4, 2, 59, 111, 17644, 17646, 1, 8601, 119, 59, 1, 8601, 119, 97, 114, 59, 1, 10538, 108, 105, 103, 5, 223, 1, 59, 17664, 1, 223, 4, 13, 97, 98, 99, 100, 101, 102, 104, 105, 111, 112, 114, 115, 119, 17694, 17709, 17714, 17737, 17742, 17749, 17754, 17860, 17905, 17957, 17964, 18090, 18122, 4, 2, 114, 117, 17700, 17706, 103, 101, 116, 59, 1, 8982, 59, 1, 964, 114, 107, 59, 1, 9140, 4, 3, 97, 101, 121, 17722, 17728, 17734, 114, 111, 110, 59, 1, 357, 100, 105, 108, 59, 1, 355, 59, 1, 1090, 111, 116, 59, 1, 8411, 108, 114, 101, 99, 59, 1, 8981, 114, 59, 3, 55349, 56625, 4, 4, 101, 105, 107, 111, 17764, 17805, 17836, 17851, 4, 2, 114, 116, 17770, 17786, 101, 4, 2, 52, 102, 17777, 17780, 59, 1, 8756, 111, 114, 101, 59, 1, 8756, 97, 4, 3, 59, 115, 118, 17795, 17797, 17802, 1, 952, 121, 109, 59, 1, 977, 59, 1, 977, 4, 2, 99, 110, 17811, 17831, 107, 4, 2, 97, 115, 17818, 17826, 112, 112, 114, 111, 120, 59, 1, 8776, 105, 109, 59, 1, 8764, 115, 112, 59, 1, 8201, 4, 2, 97, 115, 17842, 17846, 112, 59, 1, 8776, 105, 109, 59, 1, 8764, 114, 110, 5, 254, 1, 59, 17858, 1, 254, 4, 3, 108, 109, 110, 17868, 17873, 17901, 100, 101, 59, 1, 732, 101, 115, 5, 215, 3, 59, 98, 100, 17884, 17886, 17898, 1, 215, 4, 2, 59, 97, 17892, 17894, 1, 8864, 114, 59, 1, 10801, 59, 1, 10800, 116, 59, 1, 8749, 4, 3, 101, 112, 115, 17913, 17917, 17953, 97, 59, 1, 10536, 4, 4, 59, 98, 99, 102, 17927, 17929, 17934, 17939, 1, 8868, 111, 116, 59, 1, 9014, 105, 114, 59, 1, 10993, 4, 2, 59, 111, 17945, 17948, 3, 55349, 56677, 114, 107, 59, 1, 10970, 97, 59, 1, 10537, 114, 105, 109, 101, 59, 1, 8244, 4, 3, 97, 105, 112, 17972, 17977, 18082, 100, 101, 59, 1, 8482, 4, 7, 97, 100, 101, 109, 112, 115, 116, 17993, 18051, 18056, 18059, 18066, 18072, 18076, 110, 103, 108, 101, 4, 5, 59, 100, 108, 113, 114, 18009, 18011, 18017, 18032, 18035, 1, 9653, 111, 119, 110, 59, 1, 9663, 101, 102, 116, 4, 2, 59, 101, 18026, 18028, 1, 9667, 113, 59, 1, 8884, 59, 1, 8796, 105, 103, 104, 116, 4, 2, 59, 101, 18045, 18047, 1, 9657, 113, 59, 1, 8885, 111, 116, 59, 1, 9708, 59, 1, 8796, 105, 110, 117, 115, 59, 1, 10810, 108, 117, 115, 59, 1, 10809, 98, 59, 1, 10701, 105, 109, 101, 59, 1, 10811, 101, 122, 105, 117, 109, 59, 1, 9186, 4, 3, 99, 104, 116, 18098, 18111, 18116, 4, 2, 114, 121, 18104, 18108, 59, 3, 55349, 56521, 59, 1, 1094, 99, 121, 59, 1, 1115, 114, 111, 107, 59, 1, 359, 4, 2, 105, 111, 18128, 18133, 120, 116, 59, 1, 8812, 104, 101, 97, 100, 4, 2, 108, 114, 18143, 18154, 101, 102, 116, 97, 114, 114, 111, 119, 59, 1, 8606, 105, 103, 104, 116, 97, 114, 114, 111, 119, 59, 1, 8608, 4, 18, 65, 72, 97, 98, 99, 100, 102, 103, 104, 108, 109, 111, 112, 114, 115, 116, 117, 119, 18204, 18209, 18214, 18234, 18250, 18268, 18292, 18308, 18319, 18343, 18379, 18397, 18413, 18504, 18547, 18553, 18584, 18603, 114, 114, 59, 1, 8657, 97, 114, 59, 1, 10595, 4, 2, 99, 114, 18220, 18230, 117, 116, 101, 5, 250, 1, 59, 18228, 1, 250, 114, 59, 1, 8593, 114, 4, 2, 99, 101, 18241, 18245, 121, 59, 1, 1118, 118, 101, 59, 1, 365, 4, 2, 105, 121, 18256, 18265, 114, 99, 5, 251, 1, 59, 18263, 1, 251, 59, 1, 1091, 4, 3, 97, 98, 104, 18276, 18281, 18287, 114, 114, 59, 1, 8645, 108, 97, 99, 59, 1, 369, 97, 114, 59, 1, 10606, 4, 2, 105, 114, 18298, 18304, 115, 104, 116, 59, 1, 10622, 59, 3, 55349, 56626, 114, 97, 118, 101, 5, 249, 1, 59, 18317, 1, 249, 4, 2, 97, 98, 18325, 18338, 114, 4, 2, 108, 114, 18332, 18335, 59, 1, 8639, 59, 1, 8638, 108, 107, 59, 1, 9600, 4, 2, 99, 116, 18349, 18374, 4, 2, 111, 114, 18355, 18369, 114, 110, 4, 2, 59, 101, 18363, 18365, 1, 8988, 114, 59, 1, 8988, 111, 112, 59, 1, 8975, 114, 105, 59, 1, 9720, 4, 2, 97, 108, 18385, 18390, 99, 114, 59, 1, 363, 5, 168, 1, 59, 18395, 1, 168, 4, 2, 103, 112, 18403, 18408, 111, 110, 59, 1, 371, 102, 59, 3, 55349, 56678, 4, 6, 97, 100, 104, 108, 115, 117, 18427, 18434, 18445, 18470, 18475, 18494, 114, 114, 111, 119, 59, 1, 8593, 111, 119, 110, 97, 114, 114, 111, 119, 59, 1, 8597, 97, 114, 112, 111, 111, 110, 4, 2, 108, 114, 18457, 18463, 101, 102, 116, 59, 1, 8639, 105, 103, 104, 116, 59, 1, 8638, 117, 115, 59, 1, 8846, 105, 4, 3, 59, 104, 108, 18484, 18486, 18489, 1, 965, 59, 1, 978, 111, 110, 59, 1, 965, 112, 97, 114, 114, 111, 119, 115, 59, 1, 8648, 4, 3, 99, 105, 116, 18512, 18537, 18542, 4, 2, 111, 114, 18518, 18532, 114, 110, 4, 2, 59, 101, 18526, 18528, 1, 8989, 114, 59, 1, 8989, 111, 112, 59, 1, 8974, 110, 103, 59, 1, 367, 114, 105, 59, 1, 9721, 99, 114, 59, 3, 55349, 56522, 4, 3, 100, 105, 114, 18561, 18566, 18572, 111, 116, 59, 1, 8944, 108, 100, 101, 59, 1, 361, 105, 4, 2, 59, 102, 18579, 18581, 1, 9653, 59, 1, 9652, 4, 2, 97, 109, 18590, 18595, 114, 114, 59, 1, 8648, 108, 5, 252, 1, 59, 18601, 1, 252, 97, 110, 103, 108, 101, 59, 1, 10663, 4, 15, 65, 66, 68, 97, 99, 100, 101, 102, 108, 110, 111, 112, 114, 115, 122, 18643, 18648, 18661, 18667, 18847, 18851, 18857, 18904, 18909, 18915, 18931, 18937, 18943, 18949, 18996, 114, 114, 59, 1, 8661, 97, 114, 4, 2, 59, 118, 18656, 18658, 1, 10984, 59, 1, 10985, 97, 115, 104, 59, 1, 8872, 4, 2, 110, 114, 18673, 18679, 103, 114, 116, 59, 1, 10652, 4, 7, 101, 107, 110, 112, 114, 115, 116, 18695, 18704, 18711, 18720, 18742, 18754, 18810, 112, 115, 105, 108, 111, 110, 59, 1, 1013, 97, 112, 112, 97, 59, 1, 1008, 111, 116, 104, 105, 110, 103, 59, 1, 8709, 4, 3, 104, 105, 114, 18728, 18732, 18735, 105, 59, 1, 981, 59, 1, 982, 111, 112, 116, 111, 59, 1, 8733, 4, 2, 59, 104, 18748, 18750, 1, 8597, 111, 59, 1, 1009, 4, 2, 105, 117, 18760, 18766, 103, 109, 97, 59, 1, 962, 4, 2, 98, 112, 18772, 18791, 115, 101, 116, 110, 101, 113, 4, 2, 59, 113, 18784, 18787, 3, 8842, 65024, 59, 3, 10955, 65024, 115, 101, 116, 110, 101, 113, 4, 2, 59, 113, 18803, 18806, 3, 8843, 65024, 59, 3, 10956, 65024, 4, 2, 104, 114, 18816, 18822, 101, 116, 97, 59, 1, 977, 105, 97, 110, 103, 108, 101, 4, 2, 108, 114, 18834, 18840, 101, 102, 116, 59, 1, 8882, 105, 103, 104, 116, 59, 1, 8883, 121, 59, 1, 1074, 97, 115, 104, 59, 1, 8866, 4, 3, 101, 108, 114, 18865, 18884, 18890, 4, 3, 59, 98, 101, 18873, 18875, 18880, 1, 8744, 97, 114, 59, 1, 8891, 113, 59, 1, 8794, 108, 105, 112, 59, 1, 8942, 4, 2, 98, 116, 18896, 18901, 97, 114, 59, 1, 124, 59, 1, 124, 114, 59, 3, 55349, 56627, 116, 114, 105, 59, 1, 8882, 115, 117, 4, 2, 98, 112, 18923, 18927, 59, 3, 8834, 8402, 59, 3, 8835, 8402, 112, 102, 59, 3, 55349, 56679, 114, 111, 112, 59, 1, 8733, 116, 114, 105, 59, 1, 8883, 4, 2, 99, 117, 18955, 18960, 114, 59, 3, 55349, 56523, 4, 2, 98, 112, 18966, 18981, 110, 4, 2, 69, 101, 18973, 18977, 59, 3, 10955, 65024, 59, 3, 8842, 65024, 110, 4, 2, 69, 101, 18988, 18992, 59, 3, 10956, 65024, 59, 3, 8843, 65024, 105, 103, 122, 97, 103, 59, 1, 10650, 4, 7, 99, 101, 102, 111, 112, 114, 115, 19020, 19026, 19061, 19066, 19072, 19075, 19089, 105, 114, 99, 59, 1, 373, 4, 2, 100, 105, 19032, 19055, 4, 2, 98, 103, 19038, 19043, 97, 114, 59, 1, 10847, 101, 4, 2, 59, 113, 19050, 19052, 1, 8743, 59, 1, 8793, 101, 114, 112, 59, 1, 8472, 114, 59, 3, 55349, 56628, 112, 102, 59, 3, 55349, 56680, 59, 1, 8472, 4, 2, 59, 101, 19081, 19083, 1, 8768, 97, 116, 104, 59, 1, 8768, 99, 114, 59, 3, 55349, 56524, 4, 14, 99, 100, 102, 104, 105, 108, 109, 110, 111, 114, 115, 117, 118, 119, 19125, 19146, 19152, 19157, 19173, 19176, 19192, 19197, 19202, 19236, 19252, 19269, 19286, 19291, 4, 3, 97, 105, 117, 19133, 19137, 19142, 112, 59, 1, 8898, 114, 99, 59, 1, 9711, 112, 59, 1, 8899, 116, 114, 105, 59, 1, 9661, 114, 59, 3, 55349, 56629, 4, 2, 65, 97, 19163, 19168, 114, 114, 59, 1, 10234, 114, 114, 59, 1, 10231, 59, 1, 958, 4, 2, 65, 97, 19182, 19187, 114, 114, 59, 1, 10232, 114, 114, 59, 1, 10229, 97, 112, 59, 1, 10236, 105, 115, 59, 1, 8955, 4, 3, 100, 112, 116, 19210, 19215, 19230, 111, 116, 59, 1, 10752, 4, 2, 102, 108, 19221, 19225, 59, 3, 55349, 56681, 117, 115, 59, 1, 10753, 105, 109, 101, 59, 1, 10754, 4, 2, 65, 97, 19242, 19247, 114, 114, 59, 1, 10233, 114, 114, 59, 1, 10230, 4, 2, 99, 113, 19258, 19263, 114, 59, 3, 55349, 56525, 99, 117, 112, 59, 1, 10758, 4, 2, 112, 116, 19275, 19281, 108, 117, 115, 59, 1, 10756, 114, 105, 59, 1, 9651, 101, 101, 59, 1, 8897, 101, 100, 103, 101, 59, 1, 8896, 4, 8, 97, 99, 101, 102, 105, 111, 115, 117, 19316, 19335, 19349, 19357, 19362, 19367, 19373, 19379, 99, 4, 2, 117, 121, 19323, 19332, 116, 101, 5, 253, 1, 59, 19330, 1, 253, 59, 1, 1103, 4, 2, 105, 121, 19341, 19346, 114, 99, 59, 1, 375, 59, 1, 1099, 110, 5, 165, 1, 59, 19355, 1, 165, 114, 59, 3, 55349, 56630, 99, 121, 59, 1, 1111, 112, 102, 59, 3, 55349, 56682, 99, 114, 59, 3, 55349, 56526, 4, 2, 99, 109, 19385, 19389, 121, 59, 1, 1102, 108, 5, 255, 1, 59, 19395, 1, 255, 4, 10, 97, 99, 100, 101, 102, 104, 105, 111, 115, 119, 19419, 19426, 19441, 19446, 19462, 19467, 19472, 19480, 19486, 19492, 99, 117, 116, 101, 59, 1, 378, 4, 2, 97, 121, 19432, 19438, 114, 111, 110, 59, 1, 382, 59, 1, 1079, 111, 116, 59, 1, 380, 4, 2, 101, 116, 19452, 19458, 116, 114, 102, 59, 1, 8488, 97, 59, 1, 950, 114, 59, 3, 55349, 56631, 99, 121, 59, 1, 1078, 103, 114, 97, 114, 114, 59, 1, 8669, 112, 102, 59, 3, 55349, 56683, 99, 114, 59, 3, 55349, 56527, 4, 2, 106, 110, 19498, 19501, 59, 1, 8205, 106, 59, 1, 8204]); } }); -// node_modules/bluebird/js/release/some.js -var require_some = __commonJS({ - "node_modules/bluebird/js/release/some.js"(exports2, module2) { +// node_modules/parse5/lib/tokenizer/index.js +var require_tokenizer = __commonJS({ + "node_modules/parse5/lib/tokenizer/index.js"(exports2, module2) { init_shims(); "use strict"; - module2.exports = function(Promise2, PromiseArray, apiRejection) { - var util = require_util(); - var RangeError2 = require_errors().RangeError; - var AggregateError = require_errors().AggregateError; - var isArray = util.isArray; - var CANCELLATION = {}; - function SomePromiseArray(values) { - this.constructor$(values); - this._howMany = 0; - this._unwrap = false; - this._initialized = false; - } - util.inherits(SomePromiseArray, PromiseArray); - SomePromiseArray.prototype._init = function() { - if (!this._initialized) { - return; - } - if (this._howMany === 0) { - this._resolve([]); - return; - } - this._init$(void 0, -5); - var isArrayResolved = isArray(this._values); - if (!this._isResolved() && isArrayResolved && this._howMany > this._canPossiblyFulfill()) { - this._reject(this._getRangeError(this.length())); - } - }; - SomePromiseArray.prototype.init = function() { - this._initialized = true; - this._init(); - }; - SomePromiseArray.prototype.setUnwrap = function() { - this._unwrap = true; - }; - SomePromiseArray.prototype.howMany = function() { - return this._howMany; - }; - SomePromiseArray.prototype.setHowMany = function(count) { - this._howMany = count; - }; - SomePromiseArray.prototype._promiseFulfilled = function(value) { - this._addFulfilled(value); - if (this._fulfilled() === this.howMany()) { - this._values.length = this.howMany(); - if (this.howMany() === 1 && this._unwrap) { - this._resolve(this._values[0]); - } else { - this._resolve(this._values); - } - return true; - } - return false; - }; - SomePromiseArray.prototype._promiseRejected = function(reason) { - this._addRejected(reason); - return this._checkOutcome(); - }; - SomePromiseArray.prototype._promiseCancelled = function() { - if (this._values instanceof Promise2 || this._values == null) { - return this._cancel(); + var Preprocessor = require_preprocessor(); + var unicode = require_unicode(); + var neTree = require_named_entity_data(); + var ERR = require_error_codes(); + var $ = unicode.CODE_POINTS; + var $$ = unicode.CODE_POINT_SEQUENCES; + var C1_CONTROLS_REFERENCE_REPLACEMENTS = { + 128: 8364, + 130: 8218, + 131: 402, + 132: 8222, + 133: 8230, + 134: 8224, + 135: 8225, + 136: 710, + 137: 8240, + 138: 352, + 139: 8249, + 140: 338, + 142: 381, + 145: 8216, + 146: 8217, + 147: 8220, + 148: 8221, + 149: 8226, + 150: 8211, + 151: 8212, + 152: 732, + 153: 8482, + 154: 353, + 155: 8250, + 156: 339, + 158: 382, + 159: 376 + }; + var HAS_DATA_FLAG = 1 << 0; + var DATA_DUPLET_FLAG = 1 << 1; + var HAS_BRANCHES_FLAG = 1 << 2; + var MAX_BRANCH_MARKER_VALUE = HAS_DATA_FLAG | DATA_DUPLET_FLAG | HAS_BRANCHES_FLAG; + var DATA_STATE = "DATA_STATE"; + var RCDATA_STATE = "RCDATA_STATE"; + var RAWTEXT_STATE = "RAWTEXT_STATE"; + var SCRIPT_DATA_STATE = "SCRIPT_DATA_STATE"; + var PLAINTEXT_STATE = "PLAINTEXT_STATE"; + var TAG_OPEN_STATE = "TAG_OPEN_STATE"; + var END_TAG_OPEN_STATE = "END_TAG_OPEN_STATE"; + var TAG_NAME_STATE = "TAG_NAME_STATE"; + var RCDATA_LESS_THAN_SIGN_STATE = "RCDATA_LESS_THAN_SIGN_STATE"; + var RCDATA_END_TAG_OPEN_STATE = "RCDATA_END_TAG_OPEN_STATE"; + var RCDATA_END_TAG_NAME_STATE = "RCDATA_END_TAG_NAME_STATE"; + var RAWTEXT_LESS_THAN_SIGN_STATE = "RAWTEXT_LESS_THAN_SIGN_STATE"; + var RAWTEXT_END_TAG_OPEN_STATE = "RAWTEXT_END_TAG_OPEN_STATE"; + var RAWTEXT_END_TAG_NAME_STATE = "RAWTEXT_END_TAG_NAME_STATE"; + var SCRIPT_DATA_LESS_THAN_SIGN_STATE = "SCRIPT_DATA_LESS_THAN_SIGN_STATE"; + var SCRIPT_DATA_END_TAG_OPEN_STATE = "SCRIPT_DATA_END_TAG_OPEN_STATE"; + var SCRIPT_DATA_END_TAG_NAME_STATE = "SCRIPT_DATA_END_TAG_NAME_STATE"; + var SCRIPT_DATA_ESCAPE_START_STATE = "SCRIPT_DATA_ESCAPE_START_STATE"; + var SCRIPT_DATA_ESCAPE_START_DASH_STATE = "SCRIPT_DATA_ESCAPE_START_DASH_STATE"; + var SCRIPT_DATA_ESCAPED_STATE = "SCRIPT_DATA_ESCAPED_STATE"; + var SCRIPT_DATA_ESCAPED_DASH_STATE = "SCRIPT_DATA_ESCAPED_DASH_STATE"; + var SCRIPT_DATA_ESCAPED_DASH_DASH_STATE = "SCRIPT_DATA_ESCAPED_DASH_DASH_STATE"; + var SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE"; + var SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE"; + var SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE = "SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE"; + var SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE = "SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE"; + var SCRIPT_DATA_DOUBLE_ESCAPED_STATE = "SCRIPT_DATA_DOUBLE_ESCAPED_STATE"; + var SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE"; + var SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE"; + var SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE"; + var SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE = "SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE"; + var BEFORE_ATTRIBUTE_NAME_STATE = "BEFORE_ATTRIBUTE_NAME_STATE"; + var ATTRIBUTE_NAME_STATE = "ATTRIBUTE_NAME_STATE"; + var AFTER_ATTRIBUTE_NAME_STATE = "AFTER_ATTRIBUTE_NAME_STATE"; + var BEFORE_ATTRIBUTE_VALUE_STATE = "BEFORE_ATTRIBUTE_VALUE_STATE"; + var ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE = "ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE"; + var ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE = "ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE"; + var ATTRIBUTE_VALUE_UNQUOTED_STATE = "ATTRIBUTE_VALUE_UNQUOTED_STATE"; + var AFTER_ATTRIBUTE_VALUE_QUOTED_STATE = "AFTER_ATTRIBUTE_VALUE_QUOTED_STATE"; + var SELF_CLOSING_START_TAG_STATE = "SELF_CLOSING_START_TAG_STATE"; + var BOGUS_COMMENT_STATE = "BOGUS_COMMENT_STATE"; + var MARKUP_DECLARATION_OPEN_STATE = "MARKUP_DECLARATION_OPEN_STATE"; + var COMMENT_START_STATE = "COMMENT_START_STATE"; + var COMMENT_START_DASH_STATE = "COMMENT_START_DASH_STATE"; + var COMMENT_STATE = "COMMENT_STATE"; + var COMMENT_LESS_THAN_SIGN_STATE = "COMMENT_LESS_THAN_SIGN_STATE"; + var COMMENT_LESS_THAN_SIGN_BANG_STATE = "COMMENT_LESS_THAN_SIGN_BANG_STATE"; + var COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE = "COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE"; + var COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE"; + var COMMENT_END_DASH_STATE = "COMMENT_END_DASH_STATE"; + var COMMENT_END_STATE = "COMMENT_END_STATE"; + var COMMENT_END_BANG_STATE = "COMMENT_END_BANG_STATE"; + var DOCTYPE_STATE = "DOCTYPE_STATE"; + var BEFORE_DOCTYPE_NAME_STATE = "BEFORE_DOCTYPE_NAME_STATE"; + var DOCTYPE_NAME_STATE = "DOCTYPE_NAME_STATE"; + var AFTER_DOCTYPE_NAME_STATE = "AFTER_DOCTYPE_NAME_STATE"; + var AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE = "AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE"; + var BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE"; + var DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE"; + var DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE"; + var AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE"; + var BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE"; + var AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE = "AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE"; + var BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE"; + var DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"; + var DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"; + var AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE"; + var BOGUS_DOCTYPE_STATE = "BOGUS_DOCTYPE_STATE"; + var CDATA_SECTION_STATE = "CDATA_SECTION_STATE"; + var CDATA_SECTION_BRACKET_STATE = "CDATA_SECTION_BRACKET_STATE"; + var CDATA_SECTION_END_STATE = "CDATA_SECTION_END_STATE"; + var CHARACTER_REFERENCE_STATE = "CHARACTER_REFERENCE_STATE"; + var NAMED_CHARACTER_REFERENCE_STATE = "NAMED_CHARACTER_REFERENCE_STATE"; + var AMBIGUOUS_AMPERSAND_STATE = "AMBIGUOS_AMPERSAND_STATE"; + var NUMERIC_CHARACTER_REFERENCE_STATE = "NUMERIC_CHARACTER_REFERENCE_STATE"; + var HEXADEMICAL_CHARACTER_REFERENCE_START_STATE = "HEXADEMICAL_CHARACTER_REFERENCE_START_STATE"; + var DECIMAL_CHARACTER_REFERENCE_START_STATE = "DECIMAL_CHARACTER_REFERENCE_START_STATE"; + var HEXADEMICAL_CHARACTER_REFERENCE_STATE = "HEXADEMICAL_CHARACTER_REFERENCE_STATE"; + var DECIMAL_CHARACTER_REFERENCE_STATE = "DECIMAL_CHARACTER_REFERENCE_STATE"; + var NUMERIC_CHARACTER_REFERENCE_END_STATE = "NUMERIC_CHARACTER_REFERENCE_END_STATE"; + function isWhitespace(cp) { + return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED; + } + function isAsciiDigit(cp) { + return cp >= $.DIGIT_0 && cp <= $.DIGIT_9; + } + function isAsciiUpper(cp) { + return cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_Z; + } + function isAsciiLower(cp) { + return cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_Z; + } + function isAsciiLetter(cp) { + return isAsciiLower(cp) || isAsciiUpper(cp); + } + function isAsciiAlphaNumeric(cp) { + return isAsciiLetter(cp) || isAsciiDigit(cp); + } + function isAsciiUpperHexDigit(cp) { + return cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_F; + } + function isAsciiLowerHexDigit(cp) { + return cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_F; + } + function isAsciiHexDigit(cp) { + return isAsciiDigit(cp) || isAsciiUpperHexDigit(cp) || isAsciiLowerHexDigit(cp); + } + function toAsciiLowerCodePoint(cp) { + return cp + 32; + } + function toChar(cp) { + if (cp <= 65535) { + return String.fromCharCode(cp); + } + cp -= 65536; + return String.fromCharCode(cp >>> 10 & 1023 | 55296) + String.fromCharCode(56320 | cp & 1023); + } + function toAsciiLowerChar(cp) { + return String.fromCharCode(toAsciiLowerCodePoint(cp)); + } + function findNamedEntityTreeBranch(nodeIx, cp) { + const branchCount = neTree[++nodeIx]; + let lo = ++nodeIx; + let hi = lo + branchCount - 1; + while (lo <= hi) { + const mid = lo + hi >>> 1; + const midCp = neTree[mid]; + if (midCp < cp) { + lo = mid + 1; + } else if (midCp > cp) { + hi = mid - 1; + } else { + return neTree[mid + branchCount]; } - this._addRejected(CANCELLATION); - return this._checkOutcome(); - }; - SomePromiseArray.prototype._checkOutcome = function() { - if (this.howMany() > this._canPossiblyFulfill()) { - var e = new AggregateError(); - for (var i = this.length(); i < this._values.length; ++i) { - if (this._values[i] !== CANCELLATION) { - e.push(this._values[i]); - } - } - if (e.length > 0) { - this._reject(e); - } else { - this._cancel(); - } + } + return -1; + } + var Tokenizer = class { + constructor() { + this.preprocessor = new Preprocessor(); + this.tokenQueue = []; + this.allowCDATA = false; + this.state = DATA_STATE; + this.returnState = ""; + this.charRefCode = -1; + this.tempBuff = []; + this.lastStartTagName = ""; + this.consumedAfterSnapshot = -1; + this.active = false; + this.currentCharacterToken = null; + this.currentToken = null; + this.currentAttr = null; + } + _err() { + } + _errOnNextCodePoint(err) { + this._consume(); + this._err(err); + this._unconsume(); + } + getNextToken() { + while (!this.tokenQueue.length && this.active) { + this.consumedAfterSnapshot = 0; + const cp = this._consume(); + if (!this._ensureHibernation()) { + this[this.state](cp); + } + } + return this.tokenQueue.shift(); + } + write(chunk, isLastChunk) { + this.active = true; + this.preprocessor.write(chunk, isLastChunk); + } + insertHtmlAtCurrentPos(chunk) { + this.active = true; + this.preprocessor.insertHtmlAtCurrentPos(chunk); + } + _ensureHibernation() { + if (this.preprocessor.endOfChunkHit) { + for (; this.consumedAfterSnapshot > 0; this.consumedAfterSnapshot--) { + this.preprocessor.retreat(); + } + this.active = false; + this.tokenQueue.push({ type: Tokenizer.HIBERNATION_TOKEN }); return true; } return false; - }; - SomePromiseArray.prototype._fulfilled = function() { - return this._totalResolved; - }; - SomePromiseArray.prototype._rejected = function() { - return this._values.length - this.length(); - }; - SomePromiseArray.prototype._addRejected = function(reason) { - this._values.push(reason); - }; - SomePromiseArray.prototype._addFulfilled = function(value) { - this._values[this._totalResolved++] = value; - }; - SomePromiseArray.prototype._canPossiblyFulfill = function() { - return this.length() - this._rejected(); - }; - SomePromiseArray.prototype._getRangeError = function(count) { - var message = "Input array must contain at least " + this._howMany + " items but contains only " + count + " items"; - return new RangeError2(message); - }; - SomePromiseArray.prototype._resolveEmptyArray = function() { - this._reject(this._getRangeError(0)); - }; - function some(promises, howMany) { - if ((howMany | 0) !== howMany || howMany < 0) { - return apiRejection("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n"); - } - var ret2 = new SomePromiseArray(promises); - var promise = ret2.promise(); - ret2.setHowMany(howMany); - ret2.init(); - return promise; - } - Promise2.some = function(promises, howMany) { - return some(promises, howMany); - }; - Promise2.prototype.some = function(howMany) { - return some(this, howMany); - }; - Promise2._SomePromiseArray = SomePromiseArray; - }; - } -}); - -// node_modules/bluebird/js/release/timers.js -var require_timers = __commonJS({ - "node_modules/bluebird/js/release/timers.js"(exports2, module2) { - init_shims(); - "use strict"; - module2.exports = function(Promise2, INTERNAL, debug) { - var util = require_util(); - var TimeoutError = Promise2.TimeoutError; - function HandleWrapper(handle2) { - this.handle = handle2; - } - HandleWrapper.prototype._resultCancelled = function() { - clearTimeout(this.handle); - }; - var afterValue = function(value) { - return delay(+this).thenReturn(value); - }; - var delay = Promise2.delay = function(ms, value) { - var ret2; - var handle2; - if (value !== void 0) { - ret2 = Promise2.resolve(value)._then(afterValue, null, null, ms, void 0); - if (debug.cancellation() && value instanceof Promise2) { - ret2._setOnCancel(value); + } + _consume() { + this.consumedAfterSnapshot++; + return this.preprocessor.advance(); + } + _unconsume() { + this.consumedAfterSnapshot--; + this.preprocessor.retreat(); + } + _reconsumeInState(state) { + this.state = state; + this._unconsume(); + } + _consumeSequenceIfMatch(pattern, startCp, caseSensitive) { + let consumedCount = 0; + let isMatch = true; + const patternLength = pattern.length; + let patternPos = 0; + let cp = startCp; + let patternCp = void 0; + for (; patternPos < patternLength; patternPos++) { + if (patternPos > 0) { + cp = this._consume(); + consumedCount++; + } + if (cp === $.EOF) { + isMatch = false; + break; } - } else { - ret2 = new Promise2(INTERNAL); - handle2 = setTimeout(function() { - ret2._fulfill(); - }, +ms); - if (debug.cancellation()) { - ret2._setOnCancel(new HandleWrapper(handle2)); + patternCp = pattern[patternPos]; + if (cp !== patternCp && (caseSensitive || cp !== toAsciiLowerCodePoint(patternCp))) { + isMatch = false; + break; } - ret2._captureStackTrace(); } - ret2._setAsyncGuaranteed(); - return ret2; - }; - Promise2.prototype.delay = function(ms) { - return delay(ms, this); - }; - var afterTimeout = function(promise, message, parent) { - var err; - if (typeof message !== "string") { - if (message instanceof Error) { - err = message; - } else { - err = new TimeoutError("operation timed out"); + if (!isMatch) { + while (consumedCount--) { + this._unconsume(); } - } else { - err = new TimeoutError(message); - } - util.markAsOriginatingFromRejection(err); - promise._attachExtraTrace(err); - promise._reject(err); - if (parent != null) { - parent.cancel(); } - }; - function successClear(value) { - clearTimeout(this.handle); - return value; + return isMatch; } - function failureClear(reason) { - clearTimeout(this.handle); - throw reason; - } - Promise2.prototype.timeout = function(ms, message) { - ms = +ms; - var ret2, parent; - var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() { - if (ret2.isPending()) { - afterTimeout(ret2, message, parent); - } - }, ms)); - if (debug.cancellation()) { - parent = this.then(); - ret2 = parent._then(successClear, failureClear, void 0, handleWrapper, void 0); - ret2._setOnCancel(handleWrapper); - } else { - ret2 = this._then(successClear, failureClear, void 0, handleWrapper, void 0); + _isTempBufferEqualToScriptString() { + if (this.tempBuff.length !== $$.SCRIPT_STRING.length) { + return false; } - return ret2; - }; - }; - } -}); - -// node_modules/bluebird/js/release/using.js -var require_using = __commonJS({ - "node_modules/bluebird/js/release/using.js"(exports2, module2) { - init_shims(); - "use strict"; - module2.exports = function(Promise2, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug) { - var util = require_util(); - var TypeError2 = require_errors().TypeError; - var inherits2 = require_util().inherits; - var errorObj2 = util.errorObj; - var tryCatch2 = util.tryCatch; - var NULL = {}; - function thrower2(e) { - setTimeout(function() { - throw e; - }, 0); - } - function castPreservingDisposable(thenable) { - var maybePromise = tryConvertToPromise(thenable); - if (maybePromise !== thenable && typeof thenable._isDisposable === "function" && typeof thenable._getDisposer === "function" && thenable._isDisposable()) { - maybePromise._setDisposable(thenable._getDisposer()); - } - return maybePromise; - } - function dispose(resources, inspection) { - var i = 0; - var len = resources.length; - var ret2 = new Promise2(INTERNAL); - function iterator() { - if (i >= len) - return ret2._fulfill(); - var maybePromise = castPreservingDisposable(resources[i++]); - if (maybePromise instanceof Promise2 && maybePromise._isDisposable()) { - try { - maybePromise = tryConvertToPromise(maybePromise._getDisposer().tryDispose(inspection), resources.promise); - } catch (e) { - return thrower2(e); - } - if (maybePromise instanceof Promise2) { - return maybePromise._then(iterator, thrower2, null, null, null); - } + for (let i = 0; i < this.tempBuff.length; i++) { + if (this.tempBuff[i] !== $$.SCRIPT_STRING[i]) { + return false; } - iterator(); } - iterator(); - return ret2; + return true; } - function Disposer(data, promise, context) { - this._data = data; - this._promise = promise; - this._context = context; + _createStartTagToken() { + this.currentToken = { + type: Tokenizer.START_TAG_TOKEN, + tagName: "", + selfClosing: false, + ackSelfClosing: false, + attrs: [] + }; } - Disposer.prototype.data = function() { - return this._data; - }; - Disposer.prototype.promise = function() { - return this._promise; - }; - Disposer.prototype.resource = function() { - if (this.promise().isFulfilled()) { - return this.promise().value(); - } - return NULL; - }; - Disposer.prototype.tryDispose = function(inspection) { - var resource = this.resource(); - var context = this._context; - if (context !== void 0) - context._pushContext(); - var ret2 = resource !== NULL ? this.doDispose(resource, inspection) : null; - if (context !== void 0) - context._popContext(); - this._promise._unsetDisposable(); - this._data = null; - return ret2; - }; - Disposer.isDisposer = function(d2) { - return d2 != null && typeof d2.resource === "function" && typeof d2.tryDispose === "function"; - }; - function FunctionDisposer(fn, promise, context) { - this.constructor$(fn, promise, context); + _createEndTagToken() { + this.currentToken = { + type: Tokenizer.END_TAG_TOKEN, + tagName: "", + selfClosing: false, + attrs: [] + }; } - inherits2(FunctionDisposer, Disposer); - FunctionDisposer.prototype.doDispose = function(resource, inspection) { - var fn = this.data(); - return fn.call(resource, resource, inspection); - }; - function maybeUnwrapDisposer(value) { - if (Disposer.isDisposer(value)) { - this.resources[this.index]._setDisposable(value); - return value.promise(); - } - return value; + _createCommentToken() { + this.currentToken = { + type: Tokenizer.COMMENT_TOKEN, + data: "" + }; } - function ResourceList(length) { - this.length = length; - this.promise = null; - this[length - 1] = null; + _createDoctypeToken(initialName) { + this.currentToken = { + type: Tokenizer.DOCTYPE_TOKEN, + name: initialName, + forceQuirks: false, + publicId: null, + systemId: null + }; } - ResourceList.prototype._resultCancelled = function() { - var len = this.length; - for (var i = 0; i < len; ++i) { - var item = this[i]; - if (item instanceof Promise2) { - item.cancel(); - } - } - }; - Promise2.using = function() { - var len = arguments.length; - if (len < 2) - return apiRejection("you must pass at least 2 arguments to Promise.using"); - var fn = arguments[len - 1]; - if (typeof fn !== "function") { - return apiRejection("expecting a function but got " + util.classString(fn)); - } - var input; - var spreadArgs = true; - if (len === 2 && Array.isArray(arguments[0])) { - input = arguments[0]; - len = input.length; - spreadArgs = false; + _createCharacterToken(type, ch) { + this.currentCharacterToken = { + type, + chars: ch + }; + } + _createEOFToken() { + this.currentToken = { type: Tokenizer.EOF_TOKEN }; + } + _createAttr(attrNameFirstCh) { + this.currentAttr = { + name: attrNameFirstCh, + value: "" + }; + } + _leaveAttrName(toState) { + if (Tokenizer.getTokenAttr(this.currentToken, this.currentAttr.name) === null) { + this.currentToken.attrs.push(this.currentAttr); } else { - input = arguments; - len--; - } - var resources = new ResourceList(len); - for (var i = 0; i < len; ++i) { - var resource = input[i]; - if (Disposer.isDisposer(resource)) { - var disposer = resource; - resource = resource.promise(); - resource._setDisposable(disposer); - } else { - var maybePromise = tryConvertToPromise(resource); - if (maybePromise instanceof Promise2) { - resource = maybePromise._then(maybeUnwrapDisposer, null, null, { - resources, - index: i - }, void 0); - } - } - resources[i] = resource; + this._err(ERR.duplicateAttribute); } - var reflectedResources = new Array(resources.length); - for (var i = 0; i < reflectedResources.length; ++i) { - reflectedResources[i] = Promise2.resolve(resources[i]).reflect(); + this.state = toState; + } + _leaveAttrValue(toState) { + this.state = toState; + } + _emitCurrentToken() { + this._emitCurrentCharacterToken(); + const ct = this.currentToken; + this.currentToken = null; + if (ct.type === Tokenizer.START_TAG_TOKEN) { + this.lastStartTagName = ct.tagName; + } else if (ct.type === Tokenizer.END_TAG_TOKEN) { + if (ct.attrs.length > 0) { + this._err(ERR.endTagWithAttributes); + } + if (ct.selfClosing) { + this._err(ERR.endTagWithTrailingSolidus); + } } - var resultPromise = Promise2.all(reflectedResources).then(function(inspections) { - for (var i2 = 0; i2 < inspections.length; ++i2) { - var inspection = inspections[i2]; - if (inspection.isRejected()) { - errorObj2.e = inspection.error(); - return errorObj2; - } else if (!inspection.isFulfilled()) { - resultPromise.cancel(); - return; - } - inspections[i2] = inspection.value(); - } - promise._pushContext(); - fn = tryCatch2(fn); - var ret2 = spreadArgs ? fn.apply(void 0, inspections) : fn(inspections); - var promiseCreated = promise._popContext(); - debug.checkForgottenReturns(ret2, promiseCreated, "Promise.using", promise); - return ret2; - }); - var promise = resultPromise.lastly(function() { - var inspection = new Promise2.PromiseInspection(resultPromise); - return dispose(resources, inspection); - }); - resources.promise = promise; - promise._setOnCancel(resources); - return promise; - }; - Promise2.prototype._setDisposable = function(disposer) { - this._bitField = this._bitField | 131072; - this._disposer = disposer; - }; - Promise2.prototype._isDisposable = function() { - return (this._bitField & 131072) > 0; - }; - Promise2.prototype._getDisposer = function() { - return this._disposer; - }; - Promise2.prototype._unsetDisposable = function() { - this._bitField = this._bitField & ~131072; - this._disposer = void 0; - }; - Promise2.prototype.disposer = function(fn) { - if (typeof fn === "function") { - return new FunctionDisposer(fn, this, createContext()); + this.tokenQueue.push(ct); + } + _emitCurrentCharacterToken() { + if (this.currentCharacterToken) { + this.tokenQueue.push(this.currentCharacterToken); + this.currentCharacterToken = null; } - throw new TypeError2(); - }; - }; - } -}); - -// node_modules/bluebird/js/release/any.js -var require_any = __commonJS({ - "node_modules/bluebird/js/release/any.js"(exports2, module2) { - init_shims(); - "use strict"; - module2.exports = function(Promise2) { - var SomePromiseArray = Promise2._SomePromiseArray; - function any(promises) { - var ret2 = new SomePromiseArray(promises); - var promise = ret2.promise(); - ret2.setHowMany(1); - ret2.setUnwrap(); - ret2.init(); - return promise; - } - Promise2.any = function(promises) { - return any(promises); - }; - Promise2.prototype.any = function() { - return any(this); - }; - }; - } -}); - -// node_modules/bluebird/js/release/each.js -var require_each = __commonJS({ - "node_modules/bluebird/js/release/each.js"(exports2, module2) { - init_shims(); - "use strict"; - module2.exports = function(Promise2, INTERNAL) { - var PromiseReduce = Promise2.reduce; - var PromiseAll = Promise2.all; - function promiseAllThis() { - return PromiseAll(this); } - function PromiseMapSeries(promises, fn) { - return PromiseReduce(promises, fn, INTERNAL, INTERNAL); + _emitEOFToken() { + this._createEOFToken(); + this._emitCurrentToken(); } - Promise2.prototype.each = function(fn) { - return PromiseReduce(this, fn, INTERNAL, 0)._then(promiseAllThis, void 0, void 0, this, void 0); - }; - Promise2.prototype.mapSeries = function(fn) { - return PromiseReduce(this, fn, INTERNAL, INTERNAL); - }; - Promise2.each = function(promises, fn) { - return PromiseReduce(promises, fn, INTERNAL, 0)._then(promiseAllThis, void 0, void 0, promises, void 0); - }; - Promise2.mapSeries = PromiseMapSeries; - }; - } -}); - -// node_modules/bluebird/js/release/filter.js -var require_filter = __commonJS({ - "node_modules/bluebird/js/release/filter.js"(exports2, module2) { - init_shims(); - "use strict"; - module2.exports = function(Promise2, INTERNAL) { - var PromiseMap = Promise2.map; - Promise2.prototype.filter = function(fn, options2) { - return PromiseMap(this, fn, options2, INTERNAL); - }; - Promise2.filter = function(promises, fn, options2) { - return PromiseMap(promises, fn, options2, INTERNAL); - }; - }; - } -}); - -// node_modules/bluebird/js/release/promise.js -var require_promise = __commonJS({ - "node_modules/bluebird/js/release/promise.js"(exports2, module2) { - init_shims(); - "use strict"; - module2.exports = function() { - var makeSelfResolutionError = function() { - return new TypeError2("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n"); - }; - var reflectHandler2 = function() { - return new Promise2.PromiseInspection(this._target()); - }; - var apiRejection = function(msg) { - return Promise2.reject(new TypeError2(msg)); - }; - function Proxyable() { - } - var UNDEFINED_BINDING = {}; - var util = require_util(); - util.setReflectHandler(reflectHandler2); - var getDomain = function() { - var domain = process.domain; - if (domain === void 0) { - return null; + _appendCharToCurrentCharacterToken(type, ch) { + if (this.currentCharacterToken && this.currentCharacterToken.type !== type) { + this._emitCurrentCharacterToken(); } - return domain; - }; - var getContextDefault = function() { - return null; - }; - var getContextDomain = function() { - return { - domain: getDomain(), - async: null - }; - }; - var AsyncResource = util.isNode && util.nodeSupportsAsyncResource ? require("async_hooks").AsyncResource : null; - var getContextAsyncHooks = function() { - return { - domain: getDomain(), - async: new AsyncResource("Bluebird::Promise") - }; - }; - var getContext = util.isNode ? getContextDomain : getContextDefault; - util.notEnumerableProp(Promise2, "_getContext", getContext); - var enableAsyncHooks = function() { - getContext = getContextAsyncHooks; - util.notEnumerableProp(Promise2, "_getContext", getContextAsyncHooks); - }; - var disableAsyncHooks = function() { - getContext = getContextDomain; - util.notEnumerableProp(Promise2, "_getContext", getContextDomain); - }; - var es52 = require_es5(); - var Async = require_async(); - var async = new Async(); - es52.defineProperty(Promise2, "_async", { value: async }); - var errors = require_errors(); - var TypeError2 = Promise2.TypeError = errors.TypeError; - Promise2.RangeError = errors.RangeError; - var CancellationError = Promise2.CancellationError = errors.CancellationError; - Promise2.TimeoutError = errors.TimeoutError; - Promise2.OperationalError = errors.OperationalError; - Promise2.RejectionError = errors.OperationalError; - Promise2.AggregateError = errors.AggregateError; - var INTERNAL = function() { - }; - var APPLY = {}; - var NEXT_FILTER = {}; - var tryConvertToPromise = require_thenables()(Promise2, INTERNAL); - var PromiseArray = require_promise_array()(Promise2, INTERNAL, tryConvertToPromise, apiRejection, Proxyable); - var Context = require_context()(Promise2); - var createContext = Context.create; - var debug = require_debuggability()(Promise2, Context, enableAsyncHooks, disableAsyncHooks); - var CapturedTrace = debug.CapturedTrace; - var PassThroughHandlerContext = require_finally()(Promise2, tryConvertToPromise, NEXT_FILTER); - var catchFilter = require_catch_filter()(NEXT_FILTER); - var nodebackForPromise = require_nodeback(); - var errorObj2 = util.errorObj; - var tryCatch2 = util.tryCatch; - function check(self2, executor) { - if (self2 == null || self2.constructor !== Promise2) { - throw new TypeError2("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n"); - } - if (typeof executor !== "function") { - throw new TypeError2("expecting a function but got " + util.classString(executor)); - } - } - function Promise2(executor) { - if (executor !== INTERNAL) { - check(this, executor); - } - this._bitField = 0; - this._fulfillmentHandler0 = void 0; - this._rejectionHandler0 = void 0; - this._promise0 = void 0; - this._receiver0 = void 0; - this._resolveFromExecutor(executor); - this._promiseCreated(); - this._fireEvent("promiseCreated", this); - } - Promise2.prototype.toString = function() { - return "[object Promise]"; - }; - Promise2.prototype.caught = Promise2.prototype["catch"] = function(fn) { - var len = arguments.length; - if (len > 1) { - var catchInstances = new Array(len - 1), j = 0, i; - for (i = 0; i < len - 1; ++i) { - var item = arguments[i]; - if (util.isObject(item)) { - catchInstances[j++] = item; - } else { - return apiRejection("Catch statement predicate: expecting an object but got " + util.classString(item)); - } + if (this.currentCharacterToken) { + this.currentCharacterToken.chars += ch; + } else { + this._createCharacterToken(type, ch); + } + } + _emitCodePoint(cp) { + let type = Tokenizer.CHARACTER_TOKEN; + if (isWhitespace(cp)) { + type = Tokenizer.WHITESPACE_CHARACTER_TOKEN; + } else if (cp === $.NULL) { + type = Tokenizer.NULL_CHARACTER_TOKEN; + } + this._appendCharToCurrentCharacterToken(type, toChar(cp)); + } + _emitSeveralCodePoints(codePoints) { + for (let i = 0; i < codePoints.length; i++) { + this._emitCodePoint(codePoints[i]); + } + } + _emitChars(ch) { + this._appendCharToCurrentCharacterToken(Tokenizer.CHARACTER_TOKEN, ch); + } + _matchNamedCharacterReference(startCp) { + let result = null; + let excess = 1; + let i = findNamedEntityTreeBranch(0, startCp); + this.tempBuff.push(startCp); + while (i > -1) { + const current = neTree[i]; + const inNode = current < MAX_BRANCH_MARKER_VALUE; + const nodeWithData = inNode && current & HAS_DATA_FLAG; + if (nodeWithData) { + result = current & DATA_DUPLET_FLAG ? [neTree[++i], neTree[++i]] : [neTree[++i]]; + excess = 0; + } + const cp = this._consume(); + this.tempBuff.push(cp); + excess++; + if (cp === $.EOF) { + break; } - catchInstances.length = j; - fn = arguments[i]; - if (typeof fn !== "function") { - throw new TypeError2("The last argument to .catch() must be a function, got " + util.toString(fn)); + if (inNode) { + i = current & HAS_BRANCHES_FLAG ? findNamedEntityTreeBranch(i, cp) : -1; + } else { + i = cp === current ? ++i : -1; } - return this.then(void 0, catchFilter(catchInstances, fn, this)); } - return this.then(void 0, fn); - }; - Promise2.prototype.reflect = function() { - return this._then(reflectHandler2, reflectHandler2, void 0, this, void 0); - }; - Promise2.prototype.then = function(didFulfill, didReject) { - if (debug.warnings() && arguments.length > 0 && typeof didFulfill !== "function" && typeof didReject !== "function") { - var msg = ".then() only accepts functions but was passed: " + util.classString(didFulfill); - if (arguments.length > 1) { - msg += ", " + util.classString(didReject); + while (excess--) { + this.tempBuff.pop(); + this._unconsume(); + } + return result; + } + _isCharacterReferenceInAttribute() { + return this.returnState === ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE || this.returnState === ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE || this.returnState === ATTRIBUTE_VALUE_UNQUOTED_STATE; + } + _isCharacterReferenceAttributeQuirk(withSemicolon) { + if (!withSemicolon && this._isCharacterReferenceInAttribute()) { + const nextCp = this._consume(); + this._unconsume(); + return nextCp === $.EQUALS_SIGN || isAsciiAlphaNumeric(nextCp); + } + return false; + } + _flushCodePointsConsumedAsCharacterReference() { + if (this._isCharacterReferenceInAttribute()) { + for (let i = 0; i < this.tempBuff.length; i++) { + this.currentAttr.value += toChar(this.tempBuff[i]); } - this._warn(msg); + } else { + this._emitSeveralCodePoints(this.tempBuff); + } + this.tempBuff = []; + } + [DATA_STATE](cp) { + this.preprocessor.dropParsedChunk(); + if (cp === $.LESS_THAN_SIGN) { + this.state = TAG_OPEN_STATE; + } else if (cp === $.AMPERSAND) { + this.returnState = DATA_STATE; + this.state = CHARACTER_REFERENCE_STATE; + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this._emitCodePoint(cp); + } else if (cp === $.EOF) { + this._emitEOFToken(); + } else { + this._emitCodePoint(cp); + } + } + [RCDATA_STATE](cp) { + this.preprocessor.dropParsedChunk(); + if (cp === $.AMPERSAND) { + this.returnState = RCDATA_STATE; + this.state = CHARACTER_REFERENCE_STATE; + } else if (cp === $.LESS_THAN_SIGN) { + this.state = RCDATA_LESS_THAN_SIGN_STATE; + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this._emitChars(unicode.REPLACEMENT_CHARACTER); + } else if (cp === $.EOF) { + this._emitEOFToken(); + } else { + this._emitCodePoint(cp); + } + } + [RAWTEXT_STATE](cp) { + this.preprocessor.dropParsedChunk(); + if (cp === $.LESS_THAN_SIGN) { + this.state = RAWTEXT_LESS_THAN_SIGN_STATE; + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this._emitChars(unicode.REPLACEMENT_CHARACTER); + } else if (cp === $.EOF) { + this._emitEOFToken(); + } else { + this._emitCodePoint(cp); + } + } + [SCRIPT_DATA_STATE](cp) { + this.preprocessor.dropParsedChunk(); + if (cp === $.LESS_THAN_SIGN) { + this.state = SCRIPT_DATA_LESS_THAN_SIGN_STATE; + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this._emitChars(unicode.REPLACEMENT_CHARACTER); + } else if (cp === $.EOF) { + this._emitEOFToken(); + } else { + this._emitCodePoint(cp); } - return this._then(didFulfill, didReject, void 0, void 0, void 0); - }; - Promise2.prototype.done = function(didFulfill, didReject) { - var promise = this._then(didFulfill, didReject, void 0, void 0, void 0); - promise._setIsFinal(); - }; - Promise2.prototype.spread = function(fn) { - if (typeof fn !== "function") { - return apiRejection("expecting a function but got " + util.classString(fn)); + } + [PLAINTEXT_STATE](cp) { + this.preprocessor.dropParsedChunk(); + if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this._emitChars(unicode.REPLACEMENT_CHARACTER); + } else if (cp === $.EOF) { + this._emitEOFToken(); + } else { + this._emitCodePoint(cp); + } + } + [TAG_OPEN_STATE](cp) { + if (cp === $.EXCLAMATION_MARK) { + this.state = MARKUP_DECLARATION_OPEN_STATE; + } else if (cp === $.SOLIDUS) { + this.state = END_TAG_OPEN_STATE; + } else if (isAsciiLetter(cp)) { + this._createStartTagToken(); + this._reconsumeInState(TAG_NAME_STATE); + } else if (cp === $.QUESTION_MARK) { + this._err(ERR.unexpectedQuestionMarkInsteadOfTagName); + this._createCommentToken(); + this._reconsumeInState(BOGUS_COMMENT_STATE); + } else if (cp === $.EOF) { + this._err(ERR.eofBeforeTagName); + this._emitChars("<"); + this._emitEOFToken(); + } else { + this._err(ERR.invalidFirstCharacterOfTagName); + this._emitChars("<"); + this._reconsumeInState(DATA_STATE); + } + } + [END_TAG_OPEN_STATE](cp) { + if (isAsciiLetter(cp)) { + this._createEndTagToken(); + this._reconsumeInState(TAG_NAME_STATE); + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.missingEndTagName); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this._err(ERR.eofBeforeTagName); + this._emitChars(" 0) { - this._warn(".all() was passed arguments but it does not take any"); + } + [RCDATA_LESS_THAN_SIGN_STATE](cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = RCDATA_END_TAG_OPEN_STATE; + } else { + this._emitChars("<"); + this._reconsumeInState(RCDATA_STATE); } - return new PromiseArray(this).promise(); - }; - Promise2.prototype.error = function(fn) { - return this.caught(util.originatesFromRejection, fn); - }; - Promise2.getNewLibraryCopy = module2.exports; - Promise2.is = function(val) { - return val instanceof Promise2; - }; - Promise2.fromNode = Promise2.fromCallback = function(fn) { - var ret2 = new Promise2(INTERNAL); - ret2._captureStackTrace(); - var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs : false; - var result = tryCatch2(fn)(nodebackForPromise(ret2, multiArgs)); - if (result === errorObj2) { - ret2._rejectCallback(result.e, true); - } - if (!ret2._isFateSealed()) - ret2._setAsyncGuaranteed(); - return ret2; - }; - Promise2.all = function(promises) { - return new PromiseArray(promises).promise(); - }; - Promise2.cast = function(obj) { - var ret2 = tryConvertToPromise(obj); - if (!(ret2 instanceof Promise2)) { - ret2 = new Promise2(INTERNAL); - ret2._captureStackTrace(); - ret2._setFulfilled(); - ret2._rejectionHandler0 = obj; - } - return ret2; - }; - Promise2.resolve = Promise2.fulfilled = Promise2.cast; - Promise2.reject = Promise2.rejected = function(reason) { - var ret2 = new Promise2(INTERNAL); - ret2._captureStackTrace(); - ret2._rejectCallback(reason, true); - return ret2; - }; - Promise2.setScheduler = function(fn) { - if (typeof fn !== "function") { - throw new TypeError2("expecting a function but got " + util.classString(fn)); + } + [RCDATA_END_TAG_OPEN_STATE](cp) { + if (isAsciiLetter(cp)) { + this._createEndTagToken(); + this._reconsumeInState(RCDATA_END_TAG_NAME_STATE); + } else { + this._emitChars(" 0; - }; - Promise2.prototype._unsetCancelled = function() { - this._bitField = this._bitField & ~65536; - }; - Promise2.prototype._setCancelled = function() { - this._bitField = this._bitField | 65536; - this._fireEvent("promiseCancelled", this); - }; - Promise2.prototype._setWillBeCancelled = function() { - this._bitField = this._bitField | 8388608; - }; - Promise2.prototype._setAsyncGuaranteed = function() { - if (async.hasCustomScheduler()) - return; - var bitField = this._bitField; - this._bitField = bitField | (bitField & 536870912) >> 2 ^ 134217728; - }; - Promise2.prototype._setNoAsyncGuarantee = function() { - this._bitField = (this._bitField | 536870912) & ~134217728; - }; - Promise2.prototype._receiverAt = function(index2) { - var ret2 = index2 === 0 ? this._receiver0 : this[index2 * 4 - 4 + 3]; - if (ret2 === UNDEFINED_BINDING) { - return void 0; - } else if (ret2 === void 0 && this._isBound()) { - return this._boundValue(); - } - return ret2; - }; - Promise2.prototype._promiseAt = function(index2) { - return this[index2 * 4 - 4 + 2]; - }; - Promise2.prototype._fulfillmentHandlerAt = function(index2) { - return this[index2 * 4 - 4 + 0]; - }; - Promise2.prototype._rejectionHandlerAt = function(index2) { - return this[index2 * 4 - 4 + 1]; - }; - Promise2.prototype._boundValue = function() { - }; - Promise2.prototype._migrateCallback0 = function(follower) { - var bitField = follower._bitField; - var fulfill = follower._fulfillmentHandler0; - var reject = follower._rejectionHandler0; - var promise = follower._promise0; - var receiver = follower._receiverAt(0); - if (receiver === void 0) - receiver = UNDEFINED_BINDING; - this._addCallbacks(fulfill, reject, promise, receiver, null); - }; - Promise2.prototype._migrateCallbackAt = function(follower, index2) { - var fulfill = follower._fulfillmentHandlerAt(index2); - var reject = follower._rejectionHandlerAt(index2); - var promise = follower._promiseAt(index2); - var receiver = follower._receiverAt(index2); - if (receiver === void 0) - receiver = UNDEFINED_BINDING; - this._addCallbacks(fulfill, reject, promise, receiver, null); - }; - Promise2.prototype._addCallbacks = function(fulfill, reject, promise, receiver, context) { - var index2 = this._length(); - if (index2 >= 65535 - 4) { - index2 = 0; - this._setLength(0); + } + [RAWTEXT_END_TAG_OPEN_STATE](cp) { + if (isAsciiLetter(cp)) { + this._createEndTagToken(); + this._reconsumeInState(RAWTEXT_END_TAG_NAME_STATE); + } else { + this._emitChars(" 0) - promise._migrateCallback0(this); - for (var i = 1; i < len; ++i) { - promise._migrateCallbackAt(this, i); - } - this._setFollowing(); - this._setLength(0); - this._setFollowee(maybePromise); - } else if ((bitField & 33554432) !== 0) { - this._fulfill(promise._value()); - } else if ((bitField & 16777216) !== 0) { - this._reject(promise._reason()); + } + [SCRIPT_DATA_LESS_THAN_SIGN_STATE](cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = SCRIPT_DATA_END_TAG_OPEN_STATE; + } else if (cp === $.EXCLAMATION_MARK) { + this.state = SCRIPT_DATA_ESCAPE_START_STATE; + this._emitChars(""); + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this.state = SCRIPT_DATA_ESCAPED_STATE; + this._emitChars(unicode.REPLACEMENT_CHARACTER); + } else if (cp === $.EOF) { + this._err(ERR.eofInScriptHtmlCommentLikeText); + this._emitEOFToken(); + } else { + this.state = SCRIPT_DATA_ESCAPED_STATE; + this._emitCodePoint(cp); + } + } + [SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE](cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE; + } else if (isAsciiLetter(cp)) { + this.tempBuff = []; + this._emitChars("<"); + this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE); + } else { + this._emitChars("<"); + this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); } - }; - Promise2.prototype._target = function() { - var ret2 = this; - while (ret2._isFollowing()) - ret2 = ret2._followee(); - return ret2; - }; - Promise2.prototype._followee = function() { - return this._rejectionHandler0; - }; - Promise2.prototype._setFollowee = function(promise) { - this._rejectionHandler0 = promise; - }; - Promise2.prototype._settlePromise = function(promise, handler2, receiver, value) { - var isPromise = promise instanceof Promise2; - var bitField = this._bitField; - var asyncGuaranteed = (bitField & 134217728) !== 0; - if ((bitField & 65536) !== 0) { - if (isPromise) - promise._invokeInternalOnCancel(); - if (receiver instanceof PassThroughHandlerContext && receiver.isFinallyHandler()) { - receiver.cancelPromise = promise; - if (tryCatch2(handler2).call(receiver, value) === errorObj2) { - promise._reject(errorObj2.e); + } + [SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE](cp) { + if (isAsciiLetter(cp)) { + this._createEndTagToken(); + this._reconsumeInState(SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE); + } else { + this._emitChars(""); + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; + this._emitChars(unicode.REPLACEMENT_CHARACTER); + } else if (cp === $.EOF) { + this._err(ERR.eofInScriptHtmlCommentLikeText); + this._emitEOFToken(); + } else { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; + this._emitCodePoint(cp); } - }; - Promise2.prototype._settlePromiseLateCancellationObserver = function(ctx) { - var handler2 = ctx.handler; - var promise = ctx.promise; - var receiver = ctx.receiver; - var value = ctx.value; - if (typeof handler2 === "function") { - if (!(promise instanceof Promise2)) { - handler2.call(receiver, value, promise); - } else { - this._settlePromiseFromHandler(handler2, receiver, value, promise); - } - } else if (promise instanceof Promise2) { - promise._reject(value); + } + [SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE](cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE; + this._emitChars("/"); + } else { + this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE); + } + } + [SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE](cp) { + if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) { + this.state = this._isTempBufferEqualToScriptString() ? SCRIPT_DATA_ESCAPED_STATE : SCRIPT_DATA_DOUBLE_ESCAPED_STATE; + this._emitCodePoint(cp); + } else if (isAsciiUpper(cp)) { + this.tempBuff.push(toAsciiLowerCodePoint(cp)); + this._emitCodePoint(cp); + } else if (isAsciiLower(cp)) { + this.tempBuff.push(cp); + this._emitCodePoint(cp); + } else { + this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE); } - }; - Promise2.prototype._settlePromiseCtx = function(ctx) { - this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); - }; - Promise2.prototype._settlePromise0 = function(handler2, value, bitField) { - var promise = this._promise0; - var receiver = this._receiverAt(0); - this._promise0 = void 0; - this._receiver0 = void 0; - this._settlePromise(promise, handler2, receiver, value); - }; - Promise2.prototype._clearCallbackDataAtIndex = function(index2) { - var base2 = index2 * 4 - 4; - this[base2 + 2] = this[base2 + 3] = this[base2 + 0] = this[base2 + 1] = void 0; - }; - Promise2.prototype._fulfill = function(value) { - var bitField = this._bitField; - if ((bitField & 117506048) >>> 16) + } + [BEFORE_ATTRIBUTE_NAME_STATE](cp) { + if (isWhitespace(cp)) { return; - if (value === this) { - var err = makeSelfResolutionError(); - this._attachExtraTrace(err); - return this._reject(err); - } - this._setFulfilled(); - this._rejectionHandler0 = value; - if ((bitField & 65535) > 0) { - if ((bitField & 134217728) !== 0) { - this._settlePromises(); - } else { - async.settlePromises(this); - } - this._dereferenceTrace(); } - }; - Promise2.prototype._reject = function(reason) { - var bitField = this._bitField; - if ((bitField & 117506048) >>> 16) + if (cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN || cp === $.EOF) { + this._reconsumeInState(AFTER_ATTRIBUTE_NAME_STATE); + } else if (cp === $.EQUALS_SIGN) { + this._err(ERR.unexpectedEqualsSignBeforeAttributeName); + this._createAttr("="); + this.state = ATTRIBUTE_NAME_STATE; + } else { + this._createAttr(""); + this._reconsumeInState(ATTRIBUTE_NAME_STATE); + } + } + [ATTRIBUTE_NAME_STATE](cp) { + if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN || cp === $.EOF) { + this._leaveAttrName(AFTER_ATTRIBUTE_NAME_STATE); + this._unconsume(); + } else if (cp === $.EQUALS_SIGN) { + this._leaveAttrName(BEFORE_ATTRIBUTE_VALUE_STATE); + } else if (isAsciiUpper(cp)) { + this.currentAttr.name += toAsciiLowerChar(cp); + } else if (cp === $.QUOTATION_MARK || cp === $.APOSTROPHE || cp === $.LESS_THAN_SIGN) { + this._err(ERR.unexpectedCharacterInAttributeName); + this.currentAttr.name += toChar(cp); + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this.currentAttr.name += unicode.REPLACEMENT_CHARACTER; + } else { + this.currentAttr.name += toChar(cp); + } + } + [AFTER_ATTRIBUTE_NAME_STATE](cp) { + if (isWhitespace(cp)) { return; - this._setRejected(); - this._fulfillmentHandler0 = reason; - if (this._isFinal()) { - return async.fatalError(reason, util.isNode); } - if ((bitField & 65535) > 0) { - async.settlePromises(this); + if (cp === $.SOLIDUS) { + this.state = SELF_CLOSING_START_TAG_STATE; + } else if (cp === $.EQUALS_SIGN) { + this.state = BEFORE_ATTRIBUTE_VALUE_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this._err(ERR.eofInTag); + this._emitEOFToken(); } else { - this._ensurePossibleRejectionHandled(); - } - }; - Promise2.prototype._fulfillPromises = function(len, value) { - for (var i = 1; i < len; i++) { - var handler2 = this._fulfillmentHandlerAt(i); - var promise = this._promiseAt(i); - var receiver = this._receiverAt(i); - this._clearCallbackDataAtIndex(i); - this._settlePromise(promise, handler2, receiver, value); + this._createAttr(""); + this._reconsumeInState(ATTRIBUTE_NAME_STATE); } - }; - Promise2.prototype._rejectPromises = function(len, reason) { - for (var i = 1; i < len; i++) { - var handler2 = this._rejectionHandlerAt(i); - var promise = this._promiseAt(i); - var receiver = this._receiverAt(i); - this._clearCallbackDataAtIndex(i); - this._settlePromise(promise, handler2, receiver, reason); + } + [BEFORE_ATTRIBUTE_VALUE_STATE](cp) { + if (isWhitespace(cp)) { + return; } - }; - Promise2.prototype._settlePromises = function() { - var bitField = this._bitField; - var len = bitField & 65535; - if (len > 0) { - if ((bitField & 16842752) !== 0) { - var reason = this._fulfillmentHandler0; - this._settlePromise0(this._rejectionHandler0, reason, bitField); - this._rejectPromises(len, reason); + if (cp === $.QUOTATION_MARK) { + this.state = ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE; + } else if (cp === $.APOSTROPHE) { + this.state = ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.missingAttributeValue); + this.state = DATA_STATE; + this._emitCurrentToken(); + } else { + this._reconsumeInState(ATTRIBUTE_VALUE_UNQUOTED_STATE); + } + } + [ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE](cp) { + if (cp === $.QUOTATION_MARK) { + this.state = AFTER_ATTRIBUTE_VALUE_QUOTED_STATE; + } else if (cp === $.AMPERSAND) { + this.returnState = ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE; + this.state = CHARACTER_REFERENCE_STATE; + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this.currentAttr.value += unicode.REPLACEMENT_CHARACTER; + } else if (cp === $.EOF) { + this._err(ERR.eofInTag); + this._emitEOFToken(); + } else { + this.currentAttr.value += toChar(cp); + } + } + [ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE](cp) { + if (cp === $.APOSTROPHE) { + this.state = AFTER_ATTRIBUTE_VALUE_QUOTED_STATE; + } else if (cp === $.AMPERSAND) { + this.returnState = ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE; + this.state = CHARACTER_REFERENCE_STATE; + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this.currentAttr.value += unicode.REPLACEMENT_CHARACTER; + } else if (cp === $.EOF) { + this._err(ERR.eofInTag); + this._emitEOFToken(); + } else { + this.currentAttr.value += toChar(cp); + } + } + [ATTRIBUTE_VALUE_UNQUOTED_STATE](cp) { + if (isWhitespace(cp)) { + this._leaveAttrValue(BEFORE_ATTRIBUTE_NAME_STATE); + } else if (cp === $.AMPERSAND) { + this.returnState = ATTRIBUTE_VALUE_UNQUOTED_STATE; + this.state = CHARACTER_REFERENCE_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this._leaveAttrValue(DATA_STATE); + this._emitCurrentToken(); + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this.currentAttr.value += unicode.REPLACEMENT_CHARACTER; + } else if (cp === $.QUOTATION_MARK || cp === $.APOSTROPHE || cp === $.LESS_THAN_SIGN || cp === $.EQUALS_SIGN || cp === $.GRAVE_ACCENT) { + this._err(ERR.unexpectedCharacterInUnquotedAttributeValue); + this.currentAttr.value += toChar(cp); + } else if (cp === $.EOF) { + this._err(ERR.eofInTag); + this._emitEOFToken(); + } else { + this.currentAttr.value += toChar(cp); + } + } + [AFTER_ATTRIBUTE_VALUE_QUOTED_STATE](cp) { + if (isWhitespace(cp)) { + this._leaveAttrValue(BEFORE_ATTRIBUTE_NAME_STATE); + } else if (cp === $.SOLIDUS) { + this._leaveAttrValue(SELF_CLOSING_START_TAG_STATE); + } else if (cp === $.GREATER_THAN_SIGN) { + this._leaveAttrValue(DATA_STATE); + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this._err(ERR.eofInTag); + this._emitEOFToken(); + } else { + this._err(ERR.missingWhitespaceBetweenAttributes); + this._reconsumeInState(BEFORE_ATTRIBUTE_NAME_STATE); + } + } + [SELF_CLOSING_START_TAG_STATE](cp) { + if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.selfClosing = true; + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this._err(ERR.eofInTag); + this._emitEOFToken(); + } else { + this._err(ERR.unexpectedSolidusInTag); + this._reconsumeInState(BEFORE_ATTRIBUTE_NAME_STATE); + } + } + [BOGUS_COMMENT_STATE](cp) { + if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this._emitCurrentToken(); + this._emitEOFToken(); + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this.currentToken.data += unicode.REPLACEMENT_CHARACTER; + } else { + this.currentToken.data += toChar(cp); + } + } + [MARKUP_DECLARATION_OPEN_STATE](cp) { + if (this._consumeSequenceIfMatch($$.DASH_DASH_STRING, cp, true)) { + this._createCommentToken(); + this.state = COMMENT_START_STATE; + } else if (this._consumeSequenceIfMatch($$.DOCTYPE_STRING, cp, false)) { + this.state = DOCTYPE_STATE; + } else if (this._consumeSequenceIfMatch($$.CDATA_START_STRING, cp, true)) { + if (this.allowCDATA) { + this.state = CDATA_SECTION_STATE; } else { - var value = this._rejectionHandler0; - this._settlePromise0(this._fulfillmentHandler0, value, bitField); - this._fulfillPromises(len, value); - } - this._setLength(0); + this._err(ERR.cdataInHtmlContent); + this._createCommentToken(); + this.currentToken.data = "[CDATA["; + this.state = BOGUS_COMMENT_STATE; + } + } else if (!this._ensureHibernation()) { + this._err(ERR.incorrectlyOpenedComment); + this._createCommentToken(); + this._reconsumeInState(BOGUS_COMMENT_STATE); + } + } + [COMMENT_START_STATE](cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = COMMENT_START_DASH_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.abruptClosingOfEmptyComment); + this.state = DATA_STATE; + this._emitCurrentToken(); + } else { + this._reconsumeInState(COMMENT_STATE); + } + } + [COMMENT_START_DASH_STATE](cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = COMMENT_END_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.abruptClosingOfEmptyComment); + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this._err(ERR.eofInComment); + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this.currentToken.data += "-"; + this._reconsumeInState(COMMENT_STATE); + } + } + [COMMENT_STATE](cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = COMMENT_END_DASH_STATE; + } else if (cp === $.LESS_THAN_SIGN) { + this.currentToken.data += "<"; + this.state = COMMENT_LESS_THAN_SIGN_STATE; + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this.currentToken.data += unicode.REPLACEMENT_CHARACTER; + } else if (cp === $.EOF) { + this._err(ERR.eofInComment); + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this.currentToken.data += toChar(cp); } - this._clearCancellationData(); - }; - Promise2.prototype._settledValue = function() { - var bitField = this._bitField; - if ((bitField & 33554432) !== 0) { - return this._rejectionHandler0; - } else if ((bitField & 16777216) !== 0) { - return this._fulfillmentHandler0; + } + [COMMENT_LESS_THAN_SIGN_STATE](cp) { + if (cp === $.EXCLAMATION_MARK) { + this.currentToken.data += "!"; + this.state = COMMENT_LESS_THAN_SIGN_BANG_STATE; + } else if (cp === $.LESS_THAN_SIGN) { + this.currentToken.data += "!"; + } else { + this._reconsumeInState(COMMENT_STATE); } - }; - if (typeof Symbol !== "undefined" && Symbol.toStringTag) { - es52.defineProperty(Promise2.prototype, Symbol.toStringTag, { - get: function() { - return "Object"; - } - }); } - function deferResolve(v) { - this.promise._resolveCallback(v); + [COMMENT_LESS_THAN_SIGN_BANG_STATE](cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE; + } else { + this._reconsumeInState(COMMENT_STATE); + } } - function deferReject(v) { - this.promise._rejectCallback(v, false); + [COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE](cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE; + } else { + this._reconsumeInState(COMMENT_END_DASH_STATE); + } } - Promise2.defer = Promise2.pending = function() { - debug.deprecated("Promise.defer", "new Promise"); - var promise = new Promise2(INTERNAL); - return { - promise, - resolve: deferResolve, - reject: deferReject - }; - }; - util.notEnumerableProp(Promise2, "_makeSelfResolutionError", makeSelfResolutionError); - require_method()(Promise2, INTERNAL, tryConvertToPromise, apiRejection, debug); - require_bind()(Promise2, INTERNAL, tryConvertToPromise, debug); - require_cancel()(Promise2, PromiseArray, apiRejection, debug); - require_direct_resolve()(Promise2); - require_synchronous_inspection()(Promise2); - require_join()(Promise2, PromiseArray, tryConvertToPromise, INTERNAL, async); - Promise2.Promise = Promise2; - Promise2.version = "3.7.2"; - require_call_get()(Promise2); - require_generators()(Promise2, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); - require_map2()(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); - require_nodeify()(Promise2); - require_promisify()(Promise2, INTERNAL); - require_props()(Promise2, PromiseArray, tryConvertToPromise, apiRejection); - require_race()(Promise2, INTERNAL, tryConvertToPromise, apiRejection); - require_reduce()(Promise2, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); - require_settle()(Promise2, PromiseArray, debug); - require_some()(Promise2, PromiseArray, apiRejection); - require_timers()(Promise2, INTERNAL, debug); - require_using()(Promise2, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); - require_any()(Promise2); - require_each()(Promise2, INTERNAL); - require_filter()(Promise2, INTERNAL); - util.toFastProperties(Promise2); - util.toFastProperties(Promise2.prototype); - function fillTypes(value) { - var p = new Promise2(INTERNAL); - p._fulfillmentHandler0 = value; - p._rejectionHandler0 = value; - p._promise0 = value; - p._receiver0 = value; - } - fillTypes({ a: 1 }); - fillTypes({ b: 2 }); - fillTypes({ c: 3 }); - fillTypes(1); - fillTypes(function() { - }); - fillTypes(void 0); - fillTypes(false); - fillTypes(new Promise2(INTERNAL)); - debug.setBounds(Async.firstLineError, util.lastLineError); - return Promise2; - }; - } -}); - -// node_modules/bluebird/js/release/bluebird.js -var require_bluebird = __commonJS({ - "node_modules/bluebird/js/release/bluebird.js"(exports2, module2) { - init_shims(); - "use strict"; - var old; - if (typeof Promise !== "undefined") - old = Promise; - function noConflict() { - try { - if (Promise === bluebird) - Promise = old; - } catch (e) { + [COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE](cp) { + if (cp !== $.GREATER_THAN_SIGN && cp !== $.EOF) { + this._err(ERR.nestedComment); + } + this._reconsumeInState(COMMENT_END_STATE); } - return bluebird; - } - var bluebird = require_promise()(); - bluebird.noConflict = noConflict; - module2.exports = bluebird; - } -}); - -// node_modules/process-nextick-args/index.js -var require_process_nextick_args = __commonJS({ - "node_modules/process-nextick-args/index.js"(exports2, module2) { - init_shims(); - "use strict"; - if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) { - module2.exports = { nextTick }; - } else { - module2.exports = process; - } - function nextTick(fn, arg1, arg2, arg3) { - if (typeof fn !== "function") { - throw new TypeError('"callback" argument must be a function'); + [COMMENT_END_DASH_STATE](cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = COMMENT_END_STATE; + } else if (cp === $.EOF) { + this._err(ERR.eofInComment); + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this.currentToken.data += "-"; + this._reconsumeInState(COMMENT_STATE); + } + } + [COMMENT_END_STATE](cp) { + if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EXCLAMATION_MARK) { + this.state = COMMENT_END_BANG_STATE; + } else if (cp === $.HYPHEN_MINUS) { + this.currentToken.data += "-"; + } else if (cp === $.EOF) { + this._err(ERR.eofInComment); + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this.currentToken.data += "--"; + this._reconsumeInState(COMMENT_STATE); + } + } + [COMMENT_END_BANG_STATE](cp) { + if (cp === $.HYPHEN_MINUS) { + this.currentToken.data += "--!"; + this.state = COMMENT_END_DASH_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.incorrectlyClosedComment); + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this._err(ERR.eofInComment); + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this.currentToken.data += "--!"; + this._reconsumeInState(COMMENT_STATE); + } + } + [DOCTYPE_STATE](cp) { + if (isWhitespace(cp)) { + this.state = BEFORE_DOCTYPE_NAME_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this._reconsumeInState(BEFORE_DOCTYPE_NAME_STATE); + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this._createDoctypeToken(null); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this._err(ERR.missingWhitespaceBeforeDoctypeName); + this._reconsumeInState(BEFORE_DOCTYPE_NAME_STATE); + } } - var len = arguments.length; - var args, i; - switch (len) { - case 0: - case 1: - return process.nextTick(fn); - case 2: - return process.nextTick(function afterTickOne() { - fn.call(null, arg1); - }); - case 3: - return process.nextTick(function afterTickTwo() { - fn.call(null, arg1, arg2); - }); - case 4: - return process.nextTick(function afterTickThree() { - fn.call(null, arg1, arg2, arg3); - }); - default: - args = new Array(len - 1); - i = 0; - while (i < args.length) { - args[i++] = arguments[i]; - } - return process.nextTick(function afterTick() { - fn.apply(null, args); - }); + [BEFORE_DOCTYPE_NAME_STATE](cp) { + if (isWhitespace(cp)) { + return; + } + if (isAsciiUpper(cp)) { + this._createDoctypeToken(toAsciiLowerChar(cp)); + this.state = DOCTYPE_NAME_STATE; + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this._createDoctypeToken(unicode.REPLACEMENT_CHARACTER); + this.state = DOCTYPE_NAME_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.missingDoctypeName); + this._createDoctypeToken(null); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this._createDoctypeToken(null); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this._createDoctypeToken(toChar(cp)); + this.state = DOCTYPE_NAME_STATE; + } + } + [DOCTYPE_NAME_STATE](cp) { + if (isWhitespace(cp)) { + this.state = AFTER_DOCTYPE_NAME_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (isAsciiUpper(cp)) { + this.currentToken.name += toAsciiLowerChar(cp); + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this.currentToken.name += unicode.REPLACEMENT_CHARACTER; + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this.currentToken.name += toChar(cp); + } } - } - } -}); - -// node_modules/isarray/index.js -var require_isarray = __commonJS({ - "node_modules/isarray/index.js"(exports2, module2) { - init_shims(); - var toString = {}.toString; - module2.exports = Array.isArray || function(arr) { - return toString.call(arr) == "[object Array]"; - }; - } -}); - -// node_modules/readable-stream/lib/internal/streams/stream.js -var require_stream = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/stream.js"(exports2, module2) { - init_shims(); - module2.exports = require("stream"); - } -}); - -// node_modules/safe-buffer/index.js -var require_safe_buffer = __commonJS({ - "node_modules/safe-buffer/index.js"(exports2, module2) { - init_shims(); - var buffer = require("buffer"); - var Buffer2 = buffer.Buffer; - function copyProps(src2, dst) { - for (var key in src2) { - dst[key] = src2[key]; + [AFTER_DOCTYPE_NAME_STATE](cp) { + if (isWhitespace(cp)) { + return; + } + if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else if (this._consumeSequenceIfMatch($$.PUBLIC_STRING, cp, false)) { + this.state = AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE; + } else if (this._consumeSequenceIfMatch($$.SYSTEM_STRING, cp, false)) { + this.state = AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE; + } else if (!this._ensureHibernation()) { + this._err(ERR.invalidCharacterSequenceAfterDoctypeName); + this.currentToken.forceQuirks = true; + this._reconsumeInState(BOGUS_DOCTYPE_STATE); + } + } + [AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE](cp) { + if (isWhitespace(cp)) { + this.state = BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE; + } else if (cp === $.QUOTATION_MARK) { + this._err(ERR.missingWhitespaceAfterDoctypePublicKeyword); + this.currentToken.publicId = ""; + this.state = DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE; + } else if (cp === $.APOSTROPHE) { + this._err(ERR.missingWhitespaceAfterDoctypePublicKeyword); + this.currentToken.publicId = ""; + this.state = DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.missingDoctypePublicIdentifier); + this.currentToken.forceQuirks = true; + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier); + this.currentToken.forceQuirks = true; + this._reconsumeInState(BOGUS_DOCTYPE_STATE); + } } - } - if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { - module2.exports = buffer; - } else { - copyProps(buffer, exports2); - exports2.Buffer = SafeBuffer; - } - function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer2(arg, encodingOrOffset, length); - } - copyProps(Buffer2, SafeBuffer); - SafeBuffer.from = function(arg, encodingOrOffset, length) { - if (typeof arg === "number") { - throw new TypeError("Argument must not be a number"); + [BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE](cp) { + if (isWhitespace(cp)) { + return; + } + if (cp === $.QUOTATION_MARK) { + this.currentToken.publicId = ""; + this.state = DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE; + } else if (cp === $.APOSTROPHE) { + this.currentToken.publicId = ""; + this.state = DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.missingDoctypePublicIdentifier); + this.currentToken.forceQuirks = true; + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier); + this.currentToken.forceQuirks = true; + this._reconsumeInState(BOGUS_DOCTYPE_STATE); + } + } + [DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE](cp) { + if (cp === $.QUOTATION_MARK) { + this.state = AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE; + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this.currentToken.publicId += unicode.REPLACEMENT_CHARACTER; + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.abruptDoctypePublicIdentifier); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this.currentToken.publicId += toChar(cp); + } + } + [DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE](cp) { + if (cp === $.APOSTROPHE) { + this.state = AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE; + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this.currentToken.publicId += unicode.REPLACEMENT_CHARACTER; + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.abruptDoctypePublicIdentifier); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this.currentToken.publicId += toChar(cp); + } + } + [AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE](cp) { + if (isWhitespace(cp)) { + this.state = BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.QUOTATION_MARK) { + this._err(ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers); + this.currentToken.systemId = ""; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE; + } else if (cp === $.APOSTROPHE) { + this._err(ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers); + this.currentToken.systemId = ""; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE; + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier); + this.currentToken.forceQuirks = true; + this._reconsumeInState(BOGUS_DOCTYPE_STATE); + } } - return Buffer2(arg, encodingOrOffset, length); - }; - SafeBuffer.alloc = function(size, fill, encoding) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); + [BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE](cp) { + if (isWhitespace(cp)) { + return; + } + if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.QUOTATION_MARK) { + this.currentToken.systemId = ""; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE; + } else if (cp === $.APOSTROPHE) { + this.currentToken.systemId = ""; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE; + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier); + this.currentToken.forceQuirks = true; + this._reconsumeInState(BOGUS_DOCTYPE_STATE); + } + } + [AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE](cp) { + if (isWhitespace(cp)) { + this.state = BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE; + } else if (cp === $.QUOTATION_MARK) { + this._err(ERR.missingWhitespaceAfterDoctypeSystemKeyword); + this.currentToken.systemId = ""; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE; + } else if (cp === $.APOSTROPHE) { + this._err(ERR.missingWhitespaceAfterDoctypeSystemKeyword); + this.currentToken.systemId = ""; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.missingDoctypeSystemIdentifier); + this.currentToken.forceQuirks = true; + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier); + this.currentToken.forceQuirks = true; + this._reconsumeInState(BOGUS_DOCTYPE_STATE); + } } - var buf = Buffer2(size); - if (fill !== void 0) { - if (typeof encoding === "string") { - buf.fill(fill, encoding); + [BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE](cp) { + if (isWhitespace(cp)) { + return; + } + if (cp === $.QUOTATION_MARK) { + this.currentToken.systemId = ""; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE; + } else if (cp === $.APOSTROPHE) { + this.currentToken.systemId = ""; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE; + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.missingDoctypeSystemIdentifier); + this.currentToken.forceQuirks = true; + this.state = DATA_STATE; + this._emitCurrentToken(); + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier); + this.currentToken.forceQuirks = true; + this._reconsumeInState(BOGUS_DOCTYPE_STATE); + } + } + [DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE](cp) { + if (cp === $.QUOTATION_MARK) { + this.state = AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE; + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this.currentToken.systemId += unicode.REPLACEMENT_CHARACTER; + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.abruptDoctypeSystemIdentifier); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); } else { - buf.fill(fill); + this.currentToken.systemId += toChar(cp); + } + } + [DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE](cp) { + if (cp === $.APOSTROPHE) { + this.state = AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE; + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + this.currentToken.systemId += unicode.REPLACEMENT_CHARACTER; + } else if (cp === $.GREATER_THAN_SIGN) { + this._err(ERR.abruptDoctypeSystemIdentifier); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this.currentToken.systemId += toChar(cp); } - } else { - buf.fill(0); } - return buf; - }; - SafeBuffer.allocUnsafe = function(size) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); + [AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE](cp) { + if (isWhitespace(cp)) { + return; + } + if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.EOF) { + this._err(ERR.eofInDoctype); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._emitEOFToken(); + } else { + this._err(ERR.unexpectedCharacterAfterDoctypeSystemIdentifier); + this._reconsumeInState(BOGUS_DOCTYPE_STATE); + } + } + [BOGUS_DOCTYPE_STATE](cp) { + if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + } else if (cp === $.NULL) { + this._err(ERR.unexpectedNullCharacter); + } else if (cp === $.EOF) { + this._emitCurrentToken(); + this._emitEOFToken(); + } + } + [CDATA_SECTION_STATE](cp) { + if (cp === $.RIGHT_SQUARE_BRACKET) { + this.state = CDATA_SECTION_BRACKET_STATE; + } else if (cp === $.EOF) { + this._err(ERR.eofInCdata); + this._emitEOFToken(); + } else { + this._emitCodePoint(cp); + } } - return Buffer2(size); - }; - SafeBuffer.allocUnsafeSlow = function(size) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); + [CDATA_SECTION_BRACKET_STATE](cp) { + if (cp === $.RIGHT_SQUARE_BRACKET) { + this.state = CDATA_SECTION_END_STATE; + } else { + this._emitChars("]"); + this._reconsumeInState(CDATA_SECTION_STATE); + } } - return buffer.SlowBuffer(size); - }; - } -}); - -// node_modules/core-util-is/lib/util.js -var require_util2 = __commonJS({ - "node_modules/core-util-is/lib/util.js"(exports2) { - init_shims(); - function isArray(arg) { - if (Array.isArray) { - return Array.isArray(arg); + [CDATA_SECTION_END_STATE](cp) { + if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + } else if (cp === $.RIGHT_SQUARE_BRACKET) { + this._emitChars("]"); + } else { + this._emitChars("]]"); + this._reconsumeInState(CDATA_SECTION_STATE); + } } - return objectToString(arg) === "[object Array]"; - } - exports2.isArray = isArray; - function isBoolean(arg) { - return typeof arg === "boolean"; - } - exports2.isBoolean = isBoolean; - function isNull(arg) { - return arg === null; - } - exports2.isNull = isNull; - function isNullOrUndefined(arg) { - return arg == null; - } - exports2.isNullOrUndefined = isNullOrUndefined; - function isNumber(arg) { - return typeof arg === "number"; - } - exports2.isNumber = isNumber; - function isString(arg) { - return typeof arg === "string"; - } - exports2.isString = isString; - function isSymbol(arg) { - return typeof arg === "symbol"; - } - exports2.isSymbol = isSymbol; - function isUndefined(arg) { - return arg === void 0; - } - exports2.isUndefined = isUndefined; - function isRegExp(re) { - return objectToString(re) === "[object RegExp]"; - } - exports2.isRegExp = isRegExp; - function isObject2(arg) { - return typeof arg === "object" && arg !== null; - } - exports2.isObject = isObject2; - function isDate(d2) { - return objectToString(d2) === "[object Date]"; - } - exports2.isDate = isDate; - function isError2(e) { - return objectToString(e) === "[object Error]" || e instanceof Error; - } - exports2.isError = isError2; - function isFunction(arg) { - return typeof arg === "function"; - } - exports2.isFunction = isFunction; - function isPrimitive3(arg) { - return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined"; - } - exports2.isPrimitive = isPrimitive3; - exports2.isBuffer = Buffer.isBuffer; - function objectToString(o) { - return Object.prototype.toString.call(o); - } - } -}); - -// node_modules/inherits/inherits_browser.js -var require_inherits_browser = __commonJS({ - "node_modules/inherits/inherits_browser.js"(exports2, module2) { - init_shims(); - if (typeof Object.create === "function") { - module2.exports = function inherits2(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true + [CHARACTER_REFERENCE_STATE](cp) { + this.tempBuff = [$.AMPERSAND]; + if (cp === $.NUMBER_SIGN) { + this.tempBuff.push(cp); + this.state = NUMERIC_CHARACTER_REFERENCE_STATE; + } else if (isAsciiAlphaNumeric(cp)) { + this._reconsumeInState(NAMED_CHARACTER_REFERENCE_STATE); + } else { + this._flushCodePointsConsumedAsCharacterReference(); + this._reconsumeInState(this.returnState); + } + } + [NAMED_CHARACTER_REFERENCE_STATE](cp) { + const matchResult = this._matchNamedCharacterReference(cp); + if (this._ensureHibernation()) { + this.tempBuff = [$.AMPERSAND]; + } else if (matchResult) { + const withSemicolon = this.tempBuff[this.tempBuff.length - 1] === $.SEMICOLON; + if (!this._isCharacterReferenceAttributeQuirk(withSemicolon)) { + if (!withSemicolon) { + this._errOnNextCodePoint(ERR.missingSemicolonAfterCharacterReference); } - }); - } - }; - } else { - module2.exports = function inherits2(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - var TempCtor = function() { - }; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; + this.tempBuff = matchResult; + } + this._flushCodePointsConsumedAsCharacterReference(); + this.state = this.returnState; + } else { + this._flushCodePointsConsumedAsCharacterReference(); + this.state = AMBIGUOUS_AMPERSAND_STATE; } - }; - } - } -}); - -// node_modules/inherits/inherits.js -var require_inherits = __commonJS({ - "node_modules/inherits/inherits.js"(exports2, module2) { - init_shims(); - try { - util = require("util"); - if (typeof util.inherits !== "function") - throw ""; - module2.exports = util.inherits; - } catch (e) { - module2.exports = require_inherits_browser(); - } - var util; - } -}); - -// node_modules/readable-stream/lib/internal/streams/BufferList.js -var require_BufferList = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/BufferList.js"(exports2, module2) { - init_shims(); - "use strict"; - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - var Buffer2 = require_safe_buffer().Buffer; - var util = require("util"); - function copyBuffer(src2, target, offset) { - src2.copy(target, offset); - } - module2.exports = function() { - function BufferList() { - _classCallCheck(this, BufferList); - this.head = null; - this.tail = null; - this.length = 0; } - BufferList.prototype.push = function push(v) { - var entry = { data: v, next: null }; - if (this.length > 0) - this.tail.next = entry; - else - this.head = entry; - this.tail = entry; - ++this.length; - }; - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) - this.tail = entry; - this.head = entry; - ++this.length; - }; - BufferList.prototype.shift = function shift() { - if (this.length === 0) - return; - var ret2 = this.head.data; - if (this.length === 1) - this.head = this.tail = null; - else - this.head = this.head.next; - --this.length; - return ret2; - }; - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; - BufferList.prototype.join = function join(s2) { - if (this.length === 0) - return ""; - var p = this.head; - var ret2 = "" + p.data; - while (p = p.next) { - ret2 += s2 + p.data; - } - return ret2; - }; - BufferList.prototype.concat = function concat(n) { - if (this.length === 0) - return Buffer2.alloc(0); - if (this.length === 1) - return this.head.data; - var ret2 = Buffer2.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret2, i); - i += p.data.length; - p = p.next; - } - return ret2; - }; - return BufferList; - }(); - if (util && util.inspect && util.inspect.custom) { - module2.exports.prototype[util.inspect.custom] = function() { - var obj = util.inspect({ length: this.length }); - return this.constructor.name + " " + obj; - }; - } - } -}); - -// node_modules/readable-stream/lib/internal/streams/destroy.js -var require_destroy = __commonJS({ - "node_modules/readable-stream/lib/internal/streams/destroy.js"(exports2, module2) { - init_shims(); - "use strict"; - var pna = require_process_nextick_args(); - function destroy(err, cb) { - var _this = this; - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - pna.nextTick(emitErrorNT, this, err); + [AMBIGUOUS_AMPERSAND_STATE](cp) { + if (isAsciiAlphaNumeric(cp)) { + if (this._isCharacterReferenceInAttribute()) { + this.currentAttr.value += toChar(cp); + } else { + this._emitCodePoint(cp); + } + } else { + if (cp === $.SEMICOLON) { + this._err(ERR.unknownNamedCharacterReference); + } + this._reconsumeInState(this.returnState); } - return this; } - if (this._readableState) { - this._readableState.destroyed = true; + [NUMERIC_CHARACTER_REFERENCE_STATE](cp) { + this.charRefCode = 0; + if (cp === $.LATIN_SMALL_X || cp === $.LATIN_CAPITAL_X) { + this.tempBuff.push(cp); + this.state = HEXADEMICAL_CHARACTER_REFERENCE_START_STATE; + } else { + this._reconsumeInState(DECIMAL_CHARACTER_REFERENCE_START_STATE); + } } - if (this._writableState) { - this._writableState.destroyed = true; + [HEXADEMICAL_CHARACTER_REFERENCE_START_STATE](cp) { + if (isAsciiHexDigit(cp)) { + this._reconsumeInState(HEXADEMICAL_CHARACTER_REFERENCE_STATE); + } else { + this._err(ERR.absenceOfDigitsInNumericCharacterReference); + this._flushCodePointsConsumedAsCharacterReference(); + this._reconsumeInState(this.returnState); + } } - this._destroy(err || null, function(err2) { - if (!cb && err2) { - pna.nextTick(emitErrorNT, _this, err2); - if (_this._writableState) { - _this._writableState.errorEmitted = true; - } - } else if (cb) { - cb(err2); + [DECIMAL_CHARACTER_REFERENCE_START_STATE](cp) { + if (isAsciiDigit(cp)) { + this._reconsumeInState(DECIMAL_CHARACTER_REFERENCE_STATE); + } else { + this._err(ERR.absenceOfDigitsInNumericCharacterReference); + this._flushCodePointsConsumedAsCharacterReference(); + this._reconsumeInState(this.returnState); + } + } + [HEXADEMICAL_CHARACTER_REFERENCE_STATE](cp) { + if (isAsciiUpperHexDigit(cp)) { + this.charRefCode = this.charRefCode * 16 + cp - 55; + } else if (isAsciiLowerHexDigit(cp)) { + this.charRefCode = this.charRefCode * 16 + cp - 87; + } else if (isAsciiDigit(cp)) { + this.charRefCode = this.charRefCode * 16 + cp - 48; + } else if (cp === $.SEMICOLON) { + this.state = NUMERIC_CHARACTER_REFERENCE_END_STATE; + } else { + this._err(ERR.missingSemicolonAfterCharacterReference); + this._reconsumeInState(NUMERIC_CHARACTER_REFERENCE_END_STATE); } - }); - return this; - } - function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; } - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; + [DECIMAL_CHARACTER_REFERENCE_STATE](cp) { + if (isAsciiDigit(cp)) { + this.charRefCode = this.charRefCode * 10 + cp - 48; + } else if (cp === $.SEMICOLON) { + this.state = NUMERIC_CHARACTER_REFERENCE_END_STATE; + } else { + this._err(ERR.missingSemicolonAfterCharacterReference); + this._reconsumeInState(NUMERIC_CHARACTER_REFERENCE_END_STATE); + } + } + [NUMERIC_CHARACTER_REFERENCE_END_STATE]() { + if (this.charRefCode === $.NULL) { + this._err(ERR.nullCharacterReference); + this.charRefCode = $.REPLACEMENT_CHARACTER; + } else if (this.charRefCode > 1114111) { + this._err(ERR.characterReferenceOutsideUnicodeRange); + this.charRefCode = $.REPLACEMENT_CHARACTER; + } else if (unicode.isSurrogate(this.charRefCode)) { + this._err(ERR.surrogateCharacterReference); + this.charRefCode = $.REPLACEMENT_CHARACTER; + } else if (unicode.isUndefinedCodePoint(this.charRefCode)) { + this._err(ERR.noncharacterCharacterReference); + } else if (unicode.isControlCodePoint(this.charRefCode) || this.charRefCode === $.CARRIAGE_RETURN) { + this._err(ERR.controlCharacterReference); + const replacement = C1_CONTROLS_REFERENCE_REPLACEMENTS[this.charRefCode]; + if (replacement) { + this.charRefCode = replacement; + } + } + this.tempBuff = [this.charRefCode]; + this._flushCodePointsConsumedAsCharacterReference(); + this._reconsumeInState(this.returnState); + } + }; + Tokenizer.CHARACTER_TOKEN = "CHARACTER_TOKEN"; + Tokenizer.NULL_CHARACTER_TOKEN = "NULL_CHARACTER_TOKEN"; + Tokenizer.WHITESPACE_CHARACTER_TOKEN = "WHITESPACE_CHARACTER_TOKEN"; + Tokenizer.START_TAG_TOKEN = "START_TAG_TOKEN"; + Tokenizer.END_TAG_TOKEN = "END_TAG_TOKEN"; + Tokenizer.COMMENT_TOKEN = "COMMENT_TOKEN"; + Tokenizer.DOCTYPE_TOKEN = "DOCTYPE_TOKEN"; + Tokenizer.EOF_TOKEN = "EOF_TOKEN"; + Tokenizer.HIBERNATION_TOKEN = "HIBERNATION_TOKEN"; + Tokenizer.MODE = { + DATA: DATA_STATE, + RCDATA: RCDATA_STATE, + RAWTEXT: RAWTEXT_STATE, + SCRIPT_DATA: SCRIPT_DATA_STATE, + PLAINTEXT: PLAINTEXT_STATE + }; + Tokenizer.getTokenAttr = function(token, attrName) { + for (let i = token.attrs.length - 1; i >= 0; i--) { + if (token.attrs[i].name === attrName) { + return token.attrs[i].value; + } } - } - function emitErrorNT(self2, err) { - self2.emit("error", err); - } - module2.exports = { - destroy, - undestroy + return null; }; + module2.exports = Tokenizer; } }); -// node_modules/util-deprecate/node.js -var require_node = __commonJS({ - "node_modules/util-deprecate/node.js"(exports2, module2) { +// node_modules/parse5/lib/common/html.js +var require_html = __commonJS({ + "node_modules/parse5/lib/common/html.js"(exports2) { init_shims(); - module2.exports = require("util").deprecate; + "use strict"; + var NS = exports2.NAMESPACES = { + HTML: "http://www.w3.org/1999/xhtml", + MATHML: "http://www.w3.org/1998/Math/MathML", + SVG: "http://www.w3.org/2000/svg", + XLINK: "http://www.w3.org/1999/xlink", + XML: "http://www.w3.org/XML/1998/namespace", + XMLNS: "http://www.w3.org/2000/xmlns/" + }; + exports2.ATTRS = { + TYPE: "type", + ACTION: "action", + ENCODING: "encoding", + PROMPT: "prompt", + NAME: "name", + COLOR: "color", + FACE: "face", + SIZE: "size" + }; + exports2.DOCUMENT_MODE = { + NO_QUIRKS: "no-quirks", + QUIRKS: "quirks", + LIMITED_QUIRKS: "limited-quirks" + }; + var $ = exports2.TAG_NAMES = { + A: "a", + ADDRESS: "address", + ANNOTATION_XML: "annotation-xml", + APPLET: "applet", + AREA: "area", + ARTICLE: "article", + ASIDE: "aside", + B: "b", + BASE: "base", + BASEFONT: "basefont", + BGSOUND: "bgsound", + BIG: "big", + BLOCKQUOTE: "blockquote", + BODY: "body", + BR: "br", + BUTTON: "button", + CAPTION: "caption", + CENTER: "center", + CODE: "code", + COL: "col", + COLGROUP: "colgroup", + DD: "dd", + DESC: "desc", + DETAILS: "details", + DIALOG: "dialog", + DIR: "dir", + DIV: "div", + DL: "dl", + DT: "dt", + EM: "em", + EMBED: "embed", + FIELDSET: "fieldset", + FIGCAPTION: "figcaption", + FIGURE: "figure", + FONT: "font", + FOOTER: "footer", + FOREIGN_OBJECT: "foreignObject", + FORM: "form", + FRAME: "frame", + FRAMESET: "frameset", + H1: "h1", + H2: "h2", + H3: "h3", + H4: "h4", + H5: "h5", + H6: "h6", + HEAD: "head", + HEADER: "header", + HGROUP: "hgroup", + HR: "hr", + HTML: "html", + I: "i", + IMG: "img", + IMAGE: "image", + INPUT: "input", + IFRAME: "iframe", + KEYGEN: "keygen", + LABEL: "label", + LI: "li", + LINK: "link", + LISTING: "listing", + MAIN: "main", + MALIGNMARK: "malignmark", + MARQUEE: "marquee", + MATH: "math", + MENU: "menu", + META: "meta", + MGLYPH: "mglyph", + MI: "mi", + MO: "mo", + MN: "mn", + MS: "ms", + MTEXT: "mtext", + NAV: "nav", + NOBR: "nobr", + NOFRAMES: "noframes", + NOEMBED: "noembed", + NOSCRIPT: "noscript", + OBJECT: "object", + OL: "ol", + OPTGROUP: "optgroup", + OPTION: "option", + P: "p", + PARAM: "param", + PLAINTEXT: "plaintext", + PRE: "pre", + RB: "rb", + RP: "rp", + RT: "rt", + RTC: "rtc", + RUBY: "ruby", + S: "s", + SCRIPT: "script", + SECTION: "section", + SELECT: "select", + SOURCE: "source", + SMALL: "small", + SPAN: "span", + STRIKE: "strike", + STRONG: "strong", + STYLE: "style", + SUB: "sub", + SUMMARY: "summary", + SUP: "sup", + TABLE: "table", + TBODY: "tbody", + TEMPLATE: "template", + TEXTAREA: "textarea", + TFOOT: "tfoot", + TD: "td", + TH: "th", + THEAD: "thead", + TITLE: "title", + TR: "tr", + TRACK: "track", + TT: "tt", + U: "u", + UL: "ul", + SVG: "svg", + VAR: "var", + WBR: "wbr", + XMP: "xmp" + }; + exports2.SPECIAL_ELEMENTS = { + [NS.HTML]: { + [$.ADDRESS]: true, + [$.APPLET]: true, + [$.AREA]: true, + [$.ARTICLE]: true, + [$.ASIDE]: true, + [$.BASE]: true, + [$.BASEFONT]: true, + [$.BGSOUND]: true, + [$.BLOCKQUOTE]: true, + [$.BODY]: true, + [$.BR]: true, + [$.BUTTON]: true, + [$.CAPTION]: true, + [$.CENTER]: true, + [$.COL]: true, + [$.COLGROUP]: true, + [$.DD]: true, + [$.DETAILS]: true, + [$.DIR]: true, + [$.DIV]: true, + [$.DL]: true, + [$.DT]: true, + [$.EMBED]: true, + [$.FIELDSET]: true, + [$.FIGCAPTION]: true, + [$.FIGURE]: true, + [$.FOOTER]: true, + [$.FORM]: true, + [$.FRAME]: true, + [$.FRAMESET]: true, + [$.H1]: true, + [$.H2]: true, + [$.H3]: true, + [$.H4]: true, + [$.H5]: true, + [$.H6]: true, + [$.HEAD]: true, + [$.HEADER]: true, + [$.HGROUP]: true, + [$.HR]: true, + [$.HTML]: true, + [$.IFRAME]: true, + [$.IMG]: true, + [$.INPUT]: true, + [$.LI]: true, + [$.LINK]: true, + [$.LISTING]: true, + [$.MAIN]: true, + [$.MARQUEE]: true, + [$.MENU]: true, + [$.META]: true, + [$.NAV]: true, + [$.NOEMBED]: true, + [$.NOFRAMES]: true, + [$.NOSCRIPT]: true, + [$.OBJECT]: true, + [$.OL]: true, + [$.P]: true, + [$.PARAM]: true, + [$.PLAINTEXT]: true, + [$.PRE]: true, + [$.SCRIPT]: true, + [$.SECTION]: true, + [$.SELECT]: true, + [$.SOURCE]: true, + [$.STYLE]: true, + [$.SUMMARY]: true, + [$.TABLE]: true, + [$.TBODY]: true, + [$.TD]: true, + [$.TEMPLATE]: true, + [$.TEXTAREA]: true, + [$.TFOOT]: true, + [$.TH]: true, + [$.THEAD]: true, + [$.TITLE]: true, + [$.TR]: true, + [$.TRACK]: true, + [$.UL]: true, + [$.WBR]: true, + [$.XMP]: true + }, + [NS.MATHML]: { + [$.MI]: true, + [$.MO]: true, + [$.MN]: true, + [$.MS]: true, + [$.MTEXT]: true, + [$.ANNOTATION_XML]: true + }, + [NS.SVG]: { + [$.TITLE]: true, + [$.FOREIGN_OBJECT]: true, + [$.DESC]: true + } + }; } }); -// node_modules/readable-stream/lib/_stream_writable.js -var require_stream_writable = __commonJS({ - "node_modules/readable-stream/lib/_stream_writable.js"(exports2, module2) { +// node_modules/parse5/lib/parser/open-element-stack.js +var require_open_element_stack = __commonJS({ + "node_modules/parse5/lib/parser/open-element-stack.js"(exports2, module2) { init_shims(); "use strict"; - var pna = require_process_nextick_args(); - module2.exports = Writable; - function CorkedRequest(state) { - var _this = this; - this.next = null; - this.entry = null; - this.finish = function() { - onCorkedFinish(_this, state); - }; - } - var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; - var Duplex; - Writable.WritableState = WritableState; - var util = Object.create(require_util2()); - util.inherits = require_inherits(); - var internalUtil = { - deprecate: require_node() - }; - var Stream2 = require_stream(); - var Buffer2 = require_safe_buffer().Buffer; - var OurUint8Array = global.Uint8Array || function() { - }; - function _uint8ArrayToBuffer(chunk) { - return Buffer2.from(chunk); - } - function _isUint8Array(obj) { - return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; - } - var destroyImpl = require_destroy(); - util.inherits(Writable, Stream2); - function nop() { - } - function WritableState(options2, stream) { - Duplex = Duplex || require_stream_duplex(); - options2 = options2 || {}; - var isDuplex = stream instanceof Duplex; - this.objectMode = !!options2.objectMode; - if (isDuplex) - this.objectMode = this.objectMode || !!options2.writableObjectMode; - var hwm = options2.highWaterMark; - var writableHwm = options2.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - if (hwm || hwm === 0) - this.highWaterMark = hwm; - else if (isDuplex && (writableHwm || writableHwm === 0)) - this.highWaterMark = writableHwm; - else - this.highWaterMark = defaultHwm; - this.highWaterMark = Math.floor(this.highWaterMark); - this.finalCalled = false; - this.needDrain = false; - this.ending = false; - this.ended = false; - this.finished = false; - this.destroyed = false; - var noDecode = options2.decodeStrings === false; - this.decodeStrings = !noDecode; - this.defaultEncoding = options2.defaultEncoding || "utf8"; - this.length = 0; - this.writing = false; - this.corked = 0; - this.sync = true; - this.bufferProcessing = false; - this.onwrite = function(er) { - onwrite(stream, er); - }; - this.writecb = null; - this.writelen = 0; - this.bufferedRequest = null; - this.lastBufferedRequest = null; - this.pendingcb = 0; - this.prefinished = false; - this.errorEmitted = false; - this.bufferedRequestCount = 0; - this.corkedRequestsFree = new CorkedRequest(this); - } - WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; + var HTML = require_html(); + var $ = HTML.TAG_NAMES; + var NS = HTML.NAMESPACES; + function isImpliedEndTagRequired(tn) { + switch (tn.length) { + case 1: + return tn === $.P; + case 2: + return tn === $.RB || tn === $.RP || tn === $.RT || tn === $.DD || tn === $.DT || tn === $.LI; + case 3: + return tn === $.RTC; + case 6: + return tn === $.OPTION; + case 8: + return tn === $.OPTGROUP; } - return out; - }; - (function() { - try { - Object.defineProperty(WritableState.prototype, "buffer", { - get: internalUtil.deprecate(function() { - return this.getBuffer(); - }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") - }); - } catch (_) { - } - })(); - var realHasInstance; - if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function(object) { - if (realHasInstance.call(this, object)) - return true; - if (this !== Writable) - return false; - return object && object._writableState instanceof WritableState; - } - }); - } else { - realHasInstance = function(object) { - return object instanceof this; - }; + return false; } - function Writable(options2) { - Duplex = Duplex || require_stream_duplex(); - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options2); - } - this._writableState = new WritableState(options2, this); - this.writable = true; - if (options2) { - if (typeof options2.write === "function") - this._write = options2.write; - if (typeof options2.writev === "function") - this._writev = options2.writev; - if (typeof options2.destroy === "function") - this._destroy = options2.destroy; - if (typeof options2.final === "function") - this._final = options2.final; - } - Stream2.call(this); - } - Writable.prototype.pipe = function() { - this.emit("error", new Error("Cannot pipe, not readable")); - }; - function writeAfterEnd(stream, cb) { - var er = new Error("write after end"); - stream.emit("error", er); - pna.nextTick(cb, er); - } - function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - if (chunk === null) { - er = new TypeError("May not write null values to stream"); - } else if (typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) { - er = new TypeError("Invalid non-string/buffer chunk"); - } - if (er) { - stream.emit("error", er); - pna.nextTick(cb, er); - valid = false; - } - return valid; - } - Writable.prototype.write = function(chunk, encoding, cb) { - var state = this._writableState; - var ret2 = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - if (isBuf && !Buffer2.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (typeof encoding === "function") { - cb = encoding; - encoding = null; - } - if (isBuf) - encoding = "buffer"; - else if (!encoding) - encoding = state.defaultEncoding; - if (typeof cb !== "function") - cb = nop; - if (state.ended) - writeAfterEnd(this, cb); - else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret2 = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - return ret2; - }; - Writable.prototype.cork = function() { - var state = this._writableState; - state.corked++; - }; - Writable.prototype.uncork = function() { - var state = this._writableState; - if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) - clearBuffer(this, state); - } - }; - Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - if (typeof encoding === "string") - encoding = encoding.toLowerCase(); - if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) - throw new TypeError("Unknown encoding: " + encoding); - this._writableState.defaultEncoding = encoding; - return this; - }; - function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") { - chunk = Buffer2.from(chunk, encoding); + function isImpliedEndTagRequiredThoroughly(tn) { + switch (tn.length) { + case 1: + return tn === $.P; + case 2: + return tn === $.RB || tn === $.RP || tn === $.RT || tn === $.DD || tn === $.DT || tn === $.LI || tn === $.TD || tn === $.TH || tn === $.TR; + case 3: + return tn === $.RTC; + case 5: + return tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD; + case 6: + return tn === $.OPTION; + case 7: + return tn === $.CAPTION; + case 8: + return tn === $.OPTGROUP || tn === $.COLGROUP; } - return chunk; + return false; } - Object.defineProperty(Writable.prototype, "writableHighWaterMark", { - enumerable: false, - get: function() { - return this._writableState.highWaterMark; + function isScopingElement(tn, ns) { + switch (tn.length) { + case 2: + if (tn === $.TD || tn === $.TH) { + return ns === NS.HTML; + } else if (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS) { + return ns === NS.MATHML; + } + break; + case 4: + if (tn === $.HTML) { + return ns === NS.HTML; + } else if (tn === $.DESC) { + return ns === NS.SVG; + } + break; + case 5: + if (tn === $.TABLE) { + return ns === NS.HTML; + } else if (tn === $.MTEXT) { + return ns === NS.MATHML; + } else if (tn === $.TITLE) { + return ns === NS.SVG; + } + break; + case 6: + return (tn === $.APPLET || tn === $.OBJECT) && ns === NS.HTML; + case 7: + return (tn === $.CAPTION || tn === $.MARQUEE) && ns === NS.HTML; + case 8: + return tn === $.TEMPLATE && ns === NS.HTML; + case 13: + return tn === $.FOREIGN_OBJECT && ns === NS.SVG; + case 14: + return tn === $.ANNOTATION_XML && ns === NS.MATHML; } - }); - function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = "buffer"; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - state.length += len; - var ret2 = state.length < state.highWaterMark; - if (!ret2) - state.needDrain = true; - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk, - encoding, - isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - return ret2; - } - function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) - stream._writev(chunk, state.onwrite); - else - stream._write(chunk, encoding, state.onwrite); - state.sync = false; - } - function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) { - pna.nextTick(cb, er); - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit("error", er); - } else { - cb(er); - stream._writableState.errorEmitted = true; - stream.emit("error", er); - finishMaybe(stream, state); - } - } - function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; - } - function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - onwriteStateUpdate(state); - if (er) - onwriteError(stream, state, sync, er, cb); - else { - var finished = needFinish(state); - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - if (sync) { - asyncWrite(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } - } - function afterWrite(stream, state, finished, cb) { - if (!finished) - onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); - } - function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit("drain"); - } - } - function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - if (stream._writev && entry && entry.next) { - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) - allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - doWrite(stream, state, true, state.length, buffer, "", holder.finish); - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - if (state.writing) { + return false; + } + var OpenElementStack = class { + constructor(document2, treeAdapter) { + this.stackTop = -1; + this.items = []; + this.current = document2; + this.currentTagName = null; + this.currentTmplContent = null; + this.tmplCount = 0; + this.treeAdapter = treeAdapter; + } + _indexOf(element) { + let idx = -1; + for (let i = this.stackTop; i >= 0; i--) { + if (this.items[i] === element) { + idx = i; break; } } - if (entry === null) - state.lastBufferedRequest = null; + return idx; } - state.bufferedRequest = entry; - state.bufferProcessing = false; - } - Writable.prototype._write = function(chunk, encoding, cb) { - cb(new Error("_write() is not implemented")); - }; - Writable.prototype._writev = null; - Writable.prototype.end = function(chunk, encoding, cb) { - var state = this._writableState; - if (typeof chunk === "function") { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === "function") { - cb = encoding; - encoding = null; + _isInTemplate() { + return this.currentTagName === $.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === NS.HTML; } - if (chunk !== null && chunk !== void 0) - this.write(chunk, encoding); - if (state.corked) { - state.corked = 1; - this.uncork(); + _updateCurrentElement() { + this.current = this.items[this.stackTop]; + this.currentTagName = this.current && this.treeAdapter.getTagName(this.current); + this.currentTmplContent = this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : null; } - if (!state.ending && !state.finished) - endWritable(this, state, cb); - }; - function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; - } - function callFinal(stream, state) { - stream._final(function(err) { - state.pendingcb--; - if (err) { - stream.emit("error", err); - } - state.prefinished = true; - stream.emit("prefinish"); - finishMaybe(stream, state); - }); - } - function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === "function") { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit("prefinish"); + push(element) { + this.items[++this.stackTop] = element; + this._updateCurrentElement(); + if (this._isInTemplate()) { + this.tmplCount++; } } - } - function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit("finish"); + pop() { + this.stackTop--; + if (this.tmplCount > 0 && this._isInTemplate()) { + this.tmplCount--; } + this._updateCurrentElement(); } - return need; - } - function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) - pna.nextTick(cb); - else - stream.once("finish", cb); - } - state.ended = true; - stream.writable = false; - } - function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = corkReq; - } else { - state.corkedRequestsFree = corkReq; - } - } - Object.defineProperty(Writable.prototype, "destroyed", { - get: function() { - if (this._writableState === void 0) { - return false; + replace(oldElement, newElement) { + const idx = this._indexOf(oldElement); + this.items[idx] = newElement; + if (idx === this.stackTop) { + this._updateCurrentElement(); } - return this._writableState.destroyed; - }, - set: function(value) { - if (!this._writableState) { - return; + } + insertAfter(referenceElement, newElement) { + const insertionIdx = this._indexOf(referenceElement) + 1; + this.items.splice(insertionIdx, 0, newElement); + if (insertionIdx === ++this.stackTop) { + this._updateCurrentElement(); } - this._writableState.destroyed = value; } - }); - Writable.prototype.destroy = destroyImpl.destroy; - Writable.prototype._undestroy = destroyImpl.undestroy; - Writable.prototype._destroy = function(err, cb) { - this.end(); - cb(err); - }; - } -}); - -// node_modules/readable-stream/lib/_stream_duplex.js -var require_stream_duplex = __commonJS({ - "node_modules/readable-stream/lib/_stream_duplex.js"(exports2, module2) { - init_shims(); - "use strict"; - var pna = require_process_nextick_args(); - var objectKeys = Object.keys || function(obj) { - var keys2 = []; - for (var key in obj) { - keys2.push(key); - } - return keys2; - }; - module2.exports = Duplex; - var util = Object.create(require_util2()); - util.inherits = require_inherits(); - var Readable2 = require_stream_readable(); - var Writable = require_stream_writable(); - util.inherits(Duplex, Readable2); - { - keys = objectKeys(Writable.prototype); - for (v = 0; v < keys.length; v++) { - method = keys[v]; - if (!Duplex.prototype[method]) - Duplex.prototype[method] = Writable.prototype[method]; - } - } - var keys; - var method; - var v; - function Duplex(options2) { - if (!(this instanceof Duplex)) - return new Duplex(options2); - Readable2.call(this, options2); - Writable.call(this, options2); - if (options2 && options2.readable === false) - this.readable = false; - if (options2 && options2.writable === false) - this.writable = false; - this.allowHalfOpen = true; - if (options2 && options2.allowHalfOpen === false) - this.allowHalfOpen = false; - this.once("end", onend); - } - Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { - enumerable: false, - get: function() { - return this._writableState.highWaterMark; - } - }); - function onend() { - if (this.allowHalfOpen || this._writableState.ended) - return; - pna.nextTick(onEndNT, this); - } - function onEndNT(self2) { - self2.end(); - } - Object.defineProperty(Duplex.prototype, "destroyed", { - get: function() { - if (this._readableState === void 0 || this._writableState === void 0) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function(value) { - if (this._readableState === void 0 || this._writableState === void 0) { - return; + popUntilTagNamePopped(tagName) { + while (this.stackTop > -1) { + const tn = this.currentTagName; + const ns = this.treeAdapter.getNamespaceURI(this.current); + this.pop(); + if (tn === tagName && ns === NS.HTML) { + break; + } } - this._readableState.destroyed = value; - this._writableState.destroyed = value; } - }); - Duplex.prototype._destroy = function(err, cb) { - this.push(null); - this.end(); - pna.nextTick(cb, err); - }; - } -}); - -// node_modules/readable-stream/lib/_stream_readable.js -var require_stream_readable = __commonJS({ - "node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) { - init_shims(); - "use strict"; - var pna = require_process_nextick_args(); - module2.exports = Readable2; - var isArray = require_isarray(); - var Duplex; - Readable2.ReadableState = ReadableState; - var EE = require("events").EventEmitter; - var EElistenerCount = function(emitter, type) { - return emitter.listeners(type).length; - }; - var Stream2 = require_stream(); - var Buffer2 = require_safe_buffer().Buffer; - var OurUint8Array = global.Uint8Array || function() { - }; - function _uint8ArrayToBuffer(chunk) { - return Buffer2.from(chunk); - } - function _isUint8Array(obj) { - return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; - } - var util = Object.create(require_util2()); - util.inherits = require_inherits(); - var debugUtil = require("util"); - var debug = void 0; - if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog("stream"); - } else { - debug = function() { - }; - } - var BufferList = require_BufferList(); - var destroyImpl = require_destroy(); - var StringDecoder; - util.inherits(Readable2, Stream2); - var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; - function prependListener(emitter, event, fn) { - if (typeof emitter.prependListener === "function") - return emitter.prependListener(event, fn); - if (!emitter._events || !emitter._events[event]) - emitter.on(event, fn); - else if (isArray(emitter._events[event])) - emitter._events[event].unshift(fn); - else - emitter._events[event] = [fn, emitter._events[event]]; - } - function ReadableState(options2, stream) { - Duplex = Duplex || require_stream_duplex(); - options2 = options2 || {}; - var isDuplex = stream instanceof Duplex; - this.objectMode = !!options2.objectMode; - if (isDuplex) - this.objectMode = this.objectMode || !!options2.readableObjectMode; - var hwm = options2.highWaterMark; - var readableHwm = options2.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - if (hwm || hwm === 0) - this.highWaterMark = hwm; - else if (isDuplex && (readableHwm || readableHwm === 0)) - this.highWaterMark = readableHwm; - else - this.highWaterMark = defaultHwm; - this.highWaterMark = Math.floor(this.highWaterMark); - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - this.sync = true; - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - this.destroyed = false; - this.defaultEncoding = options2.defaultEncoding || "utf8"; - this.awaitDrain = 0; - this.readingMore = false; - this.decoder = null; - this.encoding = null; - if (options2.encoding) { - if (!StringDecoder) - StringDecoder = require("string_decoder/").StringDecoder; - this.decoder = new StringDecoder(options2.encoding); - this.encoding = options2.encoding; - } - } - function Readable2(options2) { - Duplex = Duplex || require_stream_duplex(); - if (!(this instanceof Readable2)) - return new Readable2(options2); - this._readableState = new ReadableState(options2, this); - this.readable = true; - if (options2) { - if (typeof options2.read === "function") - this._read = options2.read; - if (typeof options2.destroy === "function") - this._destroy = options2.destroy; - } - Stream2.call(this); - } - Object.defineProperty(Readable2.prototype, "destroyed", { - get: function() { - if (this._readableState === void 0) { - return false; - } - return this._readableState.destroyed; - }, - set: function(value) { - if (!this._readableState) { - return; + popUntilElementPopped(element) { + while (this.stackTop > -1) { + const poppedElement = this.current; + this.pop(); + if (poppedElement === element) { + break; + } } - this._readableState.destroyed = value; } - }); - Readable2.prototype.destroy = destroyImpl.destroy; - Readable2.prototype._undestroy = destroyImpl.undestroy; - Readable2.prototype._destroy = function(err, cb) { - this.push(null); - cb(err); - }; - Readable2.prototype.push = function(chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - if (!state.objectMode) { - if (typeof chunk === "string") { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer2.from(chunk, encoding); - encoding = ""; - } - skipChunkCheck = true; + popUntilNumberedHeaderPopped() { + while (this.stackTop > -1) { + const tn = this.currentTagName; + const ns = this.treeAdapter.getNamespaceURI(this.current); + this.pop(); + if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6 && ns === NS.HTML) { + break; + } } - } else { - skipChunkCheck = true; } - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); - }; - Readable2.prototype.unshift = function(chunk) { - return readableAddChunk(this, chunk, null, true, false); - }; - function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) - er = chunkInvalid(state, chunk); - if (er) { - stream.emit("error", er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (addToFront) { - if (state.endEmitted) - stream.emit("error", new Error("stream.unshift() after end event")); - else - addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit("error", new Error("stream.push() after EOF")); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) - addChunk(stream, state, chunk, false); - else - maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } + popUntilTableCellPopped() { + while (this.stackTop > -1) { + const tn = this.currentTagName; + const ns = this.treeAdapter.getNamespaceURI(this.current); + this.pop(); + if (tn === $.TD || tn === $.TH && ns === NS.HTML) { + break; } - } else if (!addToFront) { - state.reading = false; } } - return needMoreData(state); - } - function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit("data", chunk); - stream.read(0); - } else { - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) - state.buffer.unshift(chunk); - else - state.buffer.push(chunk); - if (state.needReadable) - emitReadable(stream); + popAllUpToHtmlElement() { + this.stackTop = 0; + this._updateCurrentElement(); } - maybeReadMore(stream, state); - } - function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) { - er = new TypeError("Invalid non-string/buffer chunk"); + clearBackToTableContext() { + while (this.currentTagName !== $.TABLE && this.currentTagName !== $.TEMPLATE && this.currentTagName !== $.HTML || this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML) { + this.pop(); + } } - return er; - } - function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); - } - Readable2.prototype.isPaused = function() { - return this._readableState.flowing === false; - }; - Readable2.prototype.setEncoding = function(enc) { - if (!StringDecoder) - StringDecoder = require("string_decoder/").StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; - }; - var MAX_HWM = 8388608; - function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; + clearBackToTableBodyContext() { + while (this.currentTagName !== $.TBODY && this.currentTagName !== $.TFOOT && this.currentTagName !== $.THEAD && this.currentTagName !== $.TEMPLATE && this.currentTagName !== $.HTML || this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML) { + this.pop(); + } } - return n; - } - function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) - return 0; - if (state.objectMode) - return 1; - if (n !== n) { - if (state.flowing && state.length) - return state.buffer.head.data.length; - else - return state.length; - } - if (n > state.highWaterMark) - state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) - return n; - if (!state.ended) { - state.needReadable = true; - return 0; + clearBackToTableRowContext() { + while (this.currentTagName !== $.TR && this.currentTagName !== $.TEMPLATE && this.currentTagName !== $.HTML || this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML) { + this.pop(); + } } - return state.length; - } - Readable2.prototype.read = function(n) { - debug("read", n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - if (n !== 0) - state.emittedReadable = false; - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug("read: emitReadable", state.length, state.ended); - if (state.length === 0 && state.ended) - endReadable(this); - else - emitReadable(this); - return null; + remove(element) { + for (let i = this.stackTop; i >= 0; i--) { + if (this.items[i] === element) { + this.items.splice(i, 1); + this.stackTop--; + this._updateCurrentElement(); + break; + } + } } - n = howMuchToRead(n, state); - if (n === 0 && state.ended) { - if (state.length === 0) - endReadable(this); - return null; + tryPeekProperlyNestedBodyElement() { + const element = this.items[1]; + return element && this.treeAdapter.getTagName(element) === $.BODY ? element : null; } - var doRead = state.needReadable; - debug("need readable", doRead); - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug("length less than watermark", doRead); - } - if (state.ended || state.reading) { - doRead = false; - debug("reading or ended", doRead); - } else if (doRead) { - debug("do read"); - state.reading = true; - state.sync = true; - if (state.length === 0) - state.needReadable = true; - this._read(state.highWaterMark); - state.sync = false; - if (!state.reading) - n = howMuchToRead(nOrig, state); - } - var ret2; - if (n > 0) - ret2 = fromList(n, state); - else - ret2 = null; - if (ret2 === null) { - state.needReadable = true; - n = 0; - } else { - state.length -= n; + contains(element) { + return this._indexOf(element) > -1; } - if (state.length === 0) { - if (!state.ended) - state.needReadable = true; - if (nOrig !== n && state.ended) - endReadable(this); + getCommonAncestor(element) { + let elementIdx = this._indexOf(element); + return --elementIdx >= 0 ? this.items[elementIdx] : null; } - if (ret2 !== null) - this.emit("data", ret2); - return ret2; - }; - function onEofChunk(stream, state) { - if (state.ended) - return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - emitReadable(stream); - } - function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug("emitReadable", state.flowing); - state.emittedReadable = true; - if (state.sync) - pna.nextTick(emitReadable_, stream); - else - emitReadable_(stream); + isRootHtmlElementCurrent() { + return this.stackTop === 0 && this.currentTagName === $.HTML; } - } - function emitReadable_(stream) { - debug("emit readable"); - stream.emit("readable"); - flow(stream); - } - function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream, state); + hasInScope(tagName) { + for (let i = this.stackTop; i >= 0; i--) { + const tn = this.treeAdapter.getTagName(this.items[i]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i]); + if (tn === tagName && ns === NS.HTML) { + return true; + } + if (isScopingElement(tn, ns)) { + return false; + } + } + return true; } - } - function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug("maybeReadMore read 0"); - stream.read(0); - if (len === state.length) - break; - else - len = state.length; + hasNumberedHeaderInScope() { + for (let i = this.stackTop; i >= 0; i--) { + const tn = this.treeAdapter.getTagName(this.items[i]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i]); + if ((tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) && ns === NS.HTML) { + return true; + } + if (isScopingElement(tn, ns)) { + return false; + } + } + return true; } - state.readingMore = false; - } - Readable2.prototype._read = function(n) { - this.emit("error", new Error("_read() is not implemented")); - }; - Readable2.prototype.pipe = function(dest, pipeOpts) { - var src2 = this; - var state = this._readableState; - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; + hasInListItemScope(tagName) { + for (let i = this.stackTop; i >= 0; i--) { + const tn = this.treeAdapter.getTagName(this.items[i]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i]); + if (tn === tagName && ns === NS.HTML) { + return true; + } + if ((tn === $.UL || tn === $.OL) && ns === NS.HTML || isScopingElement(tn, ns)) { + return false; + } + } + return true; } - state.pipesCount += 1; - debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) - pna.nextTick(endFn); - else - src2.once("end", endFn); - dest.on("unpipe", onunpipe); - function onunpipe(readable, unpipeInfo) { - debug("onunpipe"); - if (readable === src2) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - function onend() { - debug("onend"); - dest.end(); + hasInButtonScope(tagName) { + for (let i = this.stackTop; i >= 0; i--) { + const tn = this.treeAdapter.getTagName(this.items[i]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i]); + if (tn === tagName && ns === NS.HTML) { + return true; + } + if (tn === $.BUTTON && ns === NS.HTML || isScopingElement(tn, ns)) { + return false; + } + } + return true; } - var ondrain = pipeOnDrain(src2); - dest.on("drain", ondrain); - var cleanedUp = false; - function cleanup() { - debug("cleanup"); - dest.removeListener("close", onclose); - dest.removeListener("finish", onfinish); - dest.removeListener("drain", ondrain); - dest.removeListener("error", onerror); - dest.removeListener("unpipe", onunpipe); - src2.removeListener("end", onend); - src2.removeListener("end", unpipe); - src2.removeListener("data", ondata); - cleanedUp = true; - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) - ondrain(); - } - var increasedAwaitDrain = false; - src2.on("data", ondata); - function ondata(chunk) { - debug("ondata"); - increasedAwaitDrain = false; - var ret2 = dest.write(chunk); - if (ret2 === false && !increasedAwaitDrain) { - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug("false write response, pause", src2._readableState.awaitDrain); - src2._readableState.awaitDrain++; - increasedAwaitDrain = true; - } - src2.pause(); - } - } - function onerror(er) { - debug("onerror", er); - unpipe(); - dest.removeListener("error", onerror); - if (EElistenerCount(dest, "error") === 0) - dest.emit("error", er); - } - prependListener(dest, "error", onerror); - function onclose() { - dest.removeListener("finish", onfinish); - unpipe(); - } - dest.once("close", onclose); - function onfinish() { - debug("onfinish"); - dest.removeListener("close", onclose); - unpipe(); - } - dest.once("finish", onfinish); - function unpipe() { - debug("unpipe"); - src2.unpipe(dest); - } - dest.emit("pipe", src2); - if (!state.flowing) { - debug("pipe resume"); - src2.resume(); - } - return dest; - }; - function pipeOnDrain(src2) { - return function() { - var state = src2._readableState; - debug("pipeOnDrain", state.awaitDrain); - if (state.awaitDrain) - state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src2, "data")) { - state.flowing = true; - flow(src2); + hasInTableScope(tagName) { + for (let i = this.stackTop; i >= 0; i--) { + const tn = this.treeAdapter.getTagName(this.items[i]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i]); + if (ns !== NS.HTML) { + continue; + } + if (tn === tagName) { + return true; + } + if (tn === $.TABLE || tn === $.TEMPLATE || tn === $.HTML) { + return false; + } } - }; - } - Readable2.prototype.unpipe = function(dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; - if (state.pipesCount === 0) - return this; - if (state.pipesCount === 1) { - if (dest && dest !== state.pipes) - return this; - if (!dest) - dest = state.pipes; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) - dest.emit("unpipe", this, unpipeInfo); - return this; + return true; } - if (!dest) { - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - for (var i = 0; i < len; i++) { - dests[i].emit("unpipe", this, unpipeInfo); + hasTableBodyContextInTableScope() { + for (let i = this.stackTop; i >= 0; i--) { + const tn = this.treeAdapter.getTagName(this.items[i]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i]); + if (ns !== NS.HTML) { + continue; + } + if (tn === $.TBODY || tn === $.THEAD || tn === $.TFOOT) { + return true; + } + if (tn === $.TABLE || tn === $.HTML) { + return false; + } } - return this; + return true; } - var index2 = indexOf(state.pipes, dest); - if (index2 === -1) - return this; - state.pipes.splice(index2, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) - state.pipes = state.pipes[0]; - dest.emit("unpipe", this, unpipeInfo); - return this; - }; - Readable2.prototype.on = function(ev, fn) { - var res2 = Stream2.prototype.on.call(this, ev, fn); - if (ev === "data") { - if (this._readableState.flowing !== false) - this.resume(); - } else if (ev === "readable") { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } - } - return res2; - }; - Readable2.prototype.addListener = Readable2.prototype.on; - function nReadingNextTick(self2) { - debug("readable nexttick read 0"); - self2.read(0); - } - Readable2.prototype.resume = function() { - var state = this._readableState; - if (!state.flowing) { - debug("resume"); - state.flowing = true; - resume(this, state); + hasInSelectScope(tagName) { + for (let i = this.stackTop; i >= 0; i--) { + const tn = this.treeAdapter.getTagName(this.items[i]); + const ns = this.treeAdapter.getNamespaceURI(this.items[i]); + if (ns !== NS.HTML) { + continue; + } + if (tn === tagName) { + return true; + } + if (tn !== $.OPTION && tn !== $.OPTGROUP) { + return false; + } + } + return true; } - return this; - }; - function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); + generateImpliedEndTags() { + while (isImpliedEndTagRequired(this.currentTagName)) { + this.pop(); + } } - } - function resume_(stream, state) { - if (!state.reading) { - debug("resume read 0"); - stream.read(0); + generateImpliedEndTagsThoroughly() { + while (isImpliedEndTagRequiredThoroughly(this.currentTagName)) { + this.pop(); + } } - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit("resume"); - flow(stream); - if (state.flowing && !state.reading) - stream.read(0); - } - Readable2.prototype.pause = function() { - debug("call pause flowing=%j", this._readableState.flowing); - if (this._readableState.flowing !== false) { - debug("pause"); - this._readableState.flowing = false; - this.emit("pause"); + generateImpliedEndTagsWithExclusion(exclusionTagName) { + while (isImpliedEndTagRequired(this.currentTagName) && this.currentTagName !== exclusionTagName) { + this.pop(); + } } - return this; }; - function flow(stream) { - var state = stream._readableState; - debug("flow", state.flowing); - while (state.flowing && stream.read() !== null) { - } - } - Readable2.prototype.wrap = function(stream) { - var _this = this; - var state = this._readableState; - var paused = false; - stream.on("end", function() { - debug("wrapped end"); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) - _this.push(chunk); - } - _this.push(null); - }); - stream.on("data", function(chunk) { - debug("wrapped data"); - if (state.decoder) - chunk = state.decoder.write(chunk); - if (state.objectMode && (chunk === null || chunk === void 0)) - return; - else if (!state.objectMode && (!chunk || !chunk.length)) - return; - var ret2 = _this.push(chunk); - if (!ret2) { - paused = true; - stream.pause(); + module2.exports = OpenElementStack; + } +}); + +// node_modules/parse5/lib/parser/formatting-element-list.js +var require_formatting_element_list = __commonJS({ + "node_modules/parse5/lib/parser/formatting-element-list.js"(exports2, module2) { + init_shims(); + "use strict"; + var NOAH_ARK_CAPACITY = 3; + var FormattingElementList = class { + constructor(treeAdapter) { + this.length = 0; + this.entries = []; + this.treeAdapter = treeAdapter; + this.bookmark = null; + } + _getNoahArkConditionCandidates(newElement) { + const candidates = []; + if (this.length >= NOAH_ARK_CAPACITY) { + const neAttrsLength = this.treeAdapter.getAttrList(newElement).length; + const neTagName = this.treeAdapter.getTagName(newElement); + const neNamespaceURI = this.treeAdapter.getNamespaceURI(newElement); + for (let i = this.length - 1; i >= 0; i--) { + const entry = this.entries[i]; + if (entry.type === FormattingElementList.MARKER_ENTRY) { + break; + } + const element = entry.element; + const elementAttrs = this.treeAdapter.getAttrList(element); + const isCandidate = this.treeAdapter.getTagName(element) === neTagName && this.treeAdapter.getNamespaceURI(element) === neNamespaceURI && elementAttrs.length === neAttrsLength; + if (isCandidate) { + candidates.push({ idx: i, attrs: elementAttrs }); + } + } } - }); - for (var i in stream) { - if (this[i] === void 0 && typeof stream[i] === "function") { - this[i] = function(method) { - return function() { - return stream[method].apply(stream, arguments); - }; - }(i); + return candidates.length < NOAH_ARK_CAPACITY ? [] : candidates; + } + _ensureNoahArkCondition(newElement) { + const candidates = this._getNoahArkConditionCandidates(newElement); + let cLength = candidates.length; + if (cLength) { + const neAttrs = this.treeAdapter.getAttrList(newElement); + const neAttrsLength = neAttrs.length; + const neAttrsMap = Object.create(null); + for (let i = 0; i < neAttrsLength; i++) { + const neAttr = neAttrs[i]; + neAttrsMap[neAttr.name] = neAttr.value; + } + for (let i = 0; i < neAttrsLength; i++) { + for (let j = 0; j < cLength; j++) { + const cAttr = candidates[j].attrs[i]; + if (neAttrsMap[cAttr.name] !== cAttr.value) { + candidates.splice(j, 1); + cLength--; + } + if (candidates.length < NOAH_ARK_CAPACITY) { + return; + } + } + } + for (let i = cLength - 1; i >= NOAH_ARK_CAPACITY - 1; i--) { + this.entries.splice(candidates[i].idx, 1); + this.length--; + } } } - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - this._read = function(n2) { - debug("wrapped _read", n2); - if (paused) { - paused = false; - stream.resume(); - } - }; - return this; - }; - Object.defineProperty(Readable2.prototype, "readableHighWaterMark", { - enumerable: false, - get: function() { - return this._readableState.highWaterMark; + insertMarker() { + this.entries.push({ type: FormattingElementList.MARKER_ENTRY }); + this.length++; } - }); - Readable2._fromList = fromList; - function fromList(n, state) { - if (state.length === 0) - return null; - var ret2; - if (state.objectMode) - ret2 = state.buffer.shift(); - else if (!n || n >= state.length) { - if (state.decoder) - ret2 = state.buffer.join(""); - else if (state.buffer.length === 1) - ret2 = state.buffer.head.data; - else - ret2 = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - ret2 = fromListPartial(n, state.buffer, state.decoder); + pushElement(element, token) { + this._ensureNoahArkCondition(element); + this.entries.push({ + type: FormattingElementList.ELEMENT_ENTRY, + element, + token + }); + this.length++; } - return ret2; - } - function fromListPartial(n, list, hasStrings) { - var ret2; - if (n < list.head.data.length) { - ret2 = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - ret2 = list.shift(); - } else { - ret2 = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret2; - } - function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret2 = p.data; - n -= ret2.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) - ret2 += str; - else - ret2 += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) - list.head = p.next; - else - list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); + insertElementAfterBookmark(element, token) { + let bookmarkIdx = this.length - 1; + for (; bookmarkIdx >= 0; bookmarkIdx--) { + if (this.entries[bookmarkIdx] === this.bookmark) { + break; } - break; } - ++c; - } - list.length -= c; - return ret2; - } - function copyFromBuffer(n, list) { - var ret2 = Buffer2.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret2); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret2, ret2.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) - list.head = p.next; - else - list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); + this.entries.splice(bookmarkIdx + 1, 0, { + type: FormattingElementList.ELEMENT_ENTRY, + element, + token + }); + this.length++; + } + removeEntry(entry) { + for (let i = this.length - 1; i >= 0; i--) { + if (this.entries[i] === entry) { + this.entries.splice(i, 1); + this.length--; + break; } - break; } - ++c; } - list.length -= c; - return ret2; - } - function endReadable(stream) { - var state = stream._readableState; - if (state.length > 0) - throw new Error('"endReadable()" called on non-empty stream'); - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); + clearToLastMarker() { + while (this.length) { + const entry = this.entries.pop(); + this.length--; + if (entry.type === FormattingElementList.MARKER_ENTRY) { + break; + } + } } - } - function endReadableNT(state, stream) { - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit("end"); + getElementEntryInScopeWithTagName(tagName) { + for (let i = this.length - 1; i >= 0; i--) { + const entry = this.entries[i]; + if (entry.type === FormattingElementList.MARKER_ENTRY) { + return null; + } + if (this.treeAdapter.getTagName(entry.element) === tagName) { + return entry; + } + } + return null; } - } - function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) - return i; + getElementEntry(element) { + for (let i = this.length - 1; i >= 0; i--) { + const entry = this.entries[i]; + if (entry.type === FormattingElementList.ELEMENT_ENTRY && entry.element === element) { + return entry; + } + } + return null; } - return -1; - } + }; + FormattingElementList.MARKER_ENTRY = "MARKER_ENTRY"; + FormattingElementList.ELEMENT_ENTRY = "ELEMENT_ENTRY"; + module2.exports = FormattingElementList; } }); -// node_modules/readable-stream/lib/_stream_transform.js -var require_stream_transform = __commonJS({ - "node_modules/readable-stream/lib/_stream_transform.js"(exports2, module2) { +// node_modules/parse5/lib/utils/mixin.js +var require_mixin = __commonJS({ + "node_modules/parse5/lib/utils/mixin.js"(exports2, module2) { init_shims(); "use strict"; - module2.exports = Transform; - var Duplex = require_stream_duplex(); - var util = Object.create(require_util2()); - util.inherits = require_inherits(); - util.inherits(Transform, Duplex); - function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - var cb = ts.writecb; - if (!cb) { - return this.emit("error", new Error("write callback called multiple times")); - } - ts.writechunk = null; - ts.writecb = null; - if (data != null) - this.push(data); - cb(er); - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } - } - function Transform(options2) { - if (!(this instanceof Transform)) - return new Transform(options2); - Duplex.call(this, options2); - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - this._readableState.needReadable = true; - this._readableState.sync = false; - if (options2) { - if (typeof options2.transform === "function") - this._transform = options2.transform; - if (typeof options2.flush === "function") - this._flush = options2.flush; + var Mixin = class { + constructor(host) { + const originalMethods = {}; + const overriddenMethods = this._getOverriddenMethods(this, originalMethods); + for (const key of Object.keys(overriddenMethods)) { + if (typeof overriddenMethods[key] === "function") { + originalMethods[key] = host[key]; + host[key] = overriddenMethods[key]; + } + } } - this.on("prefinish", prefinish); - } - function prefinish() { - var _this = this; - if (typeof this._flush === "function") { - this._flush(function(er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); + _getOverriddenMethods() { + throw new Error("Not implemented"); } - } - Transform.prototype.push = function(chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); }; - Transform.prototype._transform = function(chunk, encoding, cb) { - throw new Error("_transform() is not implemented"); - }; - Transform.prototype._write = function(chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) - this._read(rs.highWaterMark); + Mixin.install = function(host, Ctor, opts) { + if (!host.__mixins) { + host.__mixins = []; } - }; - Transform.prototype._read = function(n) { - var ts = this._transformState; - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - ts.needTransform = true; + for (let i = 0; i < host.__mixins.length; i++) { + if (host.__mixins[i].constructor === Ctor) { + return host.__mixins[i]; + } } + const mixin = new Ctor(host, opts); + host.__mixins.push(mixin); + return mixin; }; - Transform.prototype._destroy = function(err, cb) { - var _this2 = this; - Duplex.prototype._destroy.call(this, err, function(err2) { - cb(err2); - _this2.emit("close"); - }); - }; - function done(stream, er, data) { - if (er) - return stream.emit("error", er); - if (data != null) - stream.push(data); - if (stream._writableState.length) - throw new Error("Calling transform done when ws.length != 0"); - if (stream._transformState.transforming) - throw new Error("Calling transform done when still transforming"); - return stream.push(null); - } + module2.exports = Mixin; } }); -// node_modules/readable-stream/lib/_stream_passthrough.js -var require_stream_passthrough = __commonJS({ - "node_modules/readable-stream/lib/_stream_passthrough.js"(exports2, module2) { +// node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js +var require_preprocessor_mixin = __commonJS({ + "node_modules/parse5/lib/extensions/position-tracking/preprocessor-mixin.js"(exports2, module2) { init_shims(); "use strict"; - module2.exports = PassThrough2; - var Transform = require_stream_transform(); - var util = Object.create(require_util2()); - util.inherits = require_inherits(); - util.inherits(PassThrough2, Transform); - function PassThrough2(options2) { - if (!(this instanceof PassThrough2)) - return new PassThrough2(options2); - Transform.call(this, options2); - } - PassThrough2.prototype._transform = function(chunk, encoding, cb) { - cb(null, chunk); + var Mixin = require_mixin(); + var PositionTrackingPreprocessorMixin = class extends Mixin { + constructor(preprocessor) { + super(preprocessor); + this.preprocessor = preprocessor; + this.isEol = false; + this.lineStartPos = 0; + this.droppedBufferSize = 0; + this.offset = 0; + this.col = 0; + this.line = 1; + } + _getOverriddenMethods(mxn, orig) { + return { + advance() { + const pos = this.pos + 1; + const ch = this.html[pos]; + if (mxn.isEol) { + mxn.isEol = false; + mxn.line++; + mxn.lineStartPos = pos; + } + if (ch === "\n" || ch === "\r" && this.html[pos + 1] !== "\n") { + mxn.isEol = true; + } + mxn.col = pos - mxn.lineStartPos + 1; + mxn.offset = mxn.droppedBufferSize + pos; + return orig.advance.call(this); + }, + retreat() { + orig.retreat.call(this); + mxn.isEol = false; + mxn.col = this.pos - mxn.lineStartPos + 1; + }, + dropParsedChunk() { + const prevPos = this.pos; + orig.dropParsedChunk.call(this); + const reduction = prevPos - this.pos; + mxn.lineStartPos -= reduction; + mxn.droppedBufferSize += reduction; + mxn.offset = mxn.droppedBufferSize + this.pos; + } + }; + } }; + module2.exports = PositionTrackingPreprocessorMixin; } }); -// node_modules/readable-stream/readable.js -var require_readable = __commonJS({ - "node_modules/readable-stream/readable.js"(exports2, module2) { - init_shims(); - var Stream2 = require("stream"); - if (process.env.READABLE_STREAM === "disable" && Stream2) { - module2.exports = Stream2; - exports2 = module2.exports = Stream2.Readable; - exports2.Readable = Stream2.Readable; - exports2.Writable = Stream2.Writable; - exports2.Duplex = Stream2.Duplex; - exports2.Transform = Stream2.Transform; - exports2.PassThrough = Stream2.PassThrough; - exports2.Stream = Stream2; - } else { - exports2 = module2.exports = require_stream_readable(); - exports2.Stream = Stream2 || exports2; - exports2.Readable = exports2; - exports2.Writable = require_stream_writable(); - exports2.Duplex = require_stream_duplex(); - exports2.Transform = require_stream_transform(); - exports2.PassThrough = require_stream_passthrough(); - } - } -}); - -// node_modules/jszip/lib/support.js -var require_support = __commonJS({ - "node_modules/jszip/lib/support.js"(exports2) { +// node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js +var require_tokenizer_mixin = __commonJS({ + "node_modules/parse5/lib/extensions/location-info/tokenizer-mixin.js"(exports2, module2) { init_shims(); "use strict"; - exports2.base64 = true; - exports2.array = true; - exports2.string = true; - exports2.arraybuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined"; - exports2.nodebuffer = typeof Buffer !== "undefined"; - exports2.uint8array = typeof Uint8Array !== "undefined"; - if (typeof ArrayBuffer === "undefined") { - exports2.blob = false; - } else { - buffer = new ArrayBuffer(0); - try { - exports2.blob = new Blob([buffer], { - type: "application/zip" - }).size === 0; - } catch (e) { - try { - Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder; - builder = new Builder(); - builder.append(buffer); - exports2.blob = builder.getBlob("application/zip").size === 0; - } catch (e2) { - exports2.blob = false; - } + var Mixin = require_mixin(); + var Tokenizer = require_tokenizer(); + var PositionTrackingPreprocessorMixin = require_preprocessor_mixin(); + var LocationInfoTokenizerMixin = class extends Mixin { + constructor(tokenizer) { + super(tokenizer); + this.tokenizer = tokenizer; + this.posTracker = Mixin.install(tokenizer.preprocessor, PositionTrackingPreprocessorMixin); + this.currentAttrLocation = null; + this.ctLoc = null; + } + _getCurrentLocation() { + return { + startLine: this.posTracker.line, + startCol: this.posTracker.col, + startOffset: this.posTracker.offset, + endLine: -1, + endCol: -1, + endOffset: -1 + }; } - } - var buffer; - var Builder; - var builder; - try { - exports2.nodestream = !!require_readable().Readable; - } catch (e) { - exports2.nodestream = false; - } + _attachCurrentAttrLocationInfo() { + this.currentAttrLocation.endLine = this.posTracker.line; + this.currentAttrLocation.endCol = this.posTracker.col; + this.currentAttrLocation.endOffset = this.posTracker.offset; + const currentToken = this.tokenizer.currentToken; + const currentAttr = this.tokenizer.currentAttr; + if (!currentToken.location.attrs) { + currentToken.location.attrs = Object.create(null); + } + currentToken.location.attrs[currentAttr.name] = this.currentAttrLocation; + } + _getOverriddenMethods(mxn, orig) { + const methods = { + _createStartTagToken() { + orig._createStartTagToken.call(this); + this.currentToken.location = mxn.ctLoc; + }, + _createEndTagToken() { + orig._createEndTagToken.call(this); + this.currentToken.location = mxn.ctLoc; + }, + _createCommentToken() { + orig._createCommentToken.call(this); + this.currentToken.location = mxn.ctLoc; + }, + _createDoctypeToken(initialName) { + orig._createDoctypeToken.call(this, initialName); + this.currentToken.location = mxn.ctLoc; + }, + _createCharacterToken(type, ch) { + orig._createCharacterToken.call(this, type, ch); + this.currentCharacterToken.location = mxn.ctLoc; + }, + _createEOFToken() { + orig._createEOFToken.call(this); + this.currentToken.location = mxn._getCurrentLocation(); + }, + _createAttr(attrNameFirstCh) { + orig._createAttr.call(this, attrNameFirstCh); + mxn.currentAttrLocation = mxn._getCurrentLocation(); + }, + _leaveAttrName(toState) { + orig._leaveAttrName.call(this, toState); + mxn._attachCurrentAttrLocationInfo(); + }, + _leaveAttrValue(toState) { + orig._leaveAttrValue.call(this, toState); + mxn._attachCurrentAttrLocationInfo(); + }, + _emitCurrentToken() { + const ctLoc = this.currentToken.location; + if (this.currentCharacterToken) { + this.currentCharacterToken.location.endLine = ctLoc.startLine; + this.currentCharacterToken.location.endCol = ctLoc.startCol; + this.currentCharacterToken.location.endOffset = ctLoc.startOffset; + } + if (this.currentToken.type === Tokenizer.EOF_TOKEN) { + ctLoc.endLine = ctLoc.startLine; + ctLoc.endCol = ctLoc.startCol; + ctLoc.endOffset = ctLoc.startOffset; + } else { + ctLoc.endLine = mxn.posTracker.line; + ctLoc.endCol = mxn.posTracker.col + 1; + ctLoc.endOffset = mxn.posTracker.offset + 1; + } + orig._emitCurrentToken.call(this); + }, + _emitCurrentCharacterToken() { + const ctLoc = this.currentCharacterToken && this.currentCharacterToken.location; + if (ctLoc && ctLoc.endOffset === -1) { + ctLoc.endLine = mxn.posTracker.line; + ctLoc.endCol = mxn.posTracker.col; + ctLoc.endOffset = mxn.posTracker.offset; + } + orig._emitCurrentCharacterToken.call(this); + } + }; + Object.keys(Tokenizer.MODE).forEach((modeName) => { + const state = Tokenizer.MODE[modeName]; + methods[state] = function(cp) { + mxn.ctLoc = mxn._getCurrentLocation(); + orig[state].call(this, cp); + }; + }); + return methods; + } + }; + module2.exports = LocationInfoTokenizerMixin; } }); -// node_modules/jszip/lib/base64.js -var require_base64 = __commonJS({ - "node_modules/jszip/lib/base64.js"(exports2) { +// node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js +var require_open_element_stack_mixin = __commonJS({ + "node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js"(exports2, module2) { init_shims(); "use strict"; - var utils = require_utils2(); - var support = require_support(); - var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - exports2.encode = function(input) { - var output = []; - var chr1, chr2, chr3, enc1, enc2, enc3, enc4; - var i = 0, len = input.length, remainingBytes = len; - var isArray = utils.getTypeOf(input) !== "string"; - while (i < input.length) { - remainingBytes = len - i; - if (!isArray) { - chr1 = input.charCodeAt(i++); - chr2 = i < len ? input.charCodeAt(i++) : 0; - chr3 = i < len ? input.charCodeAt(i++) : 0; - } else { - chr1 = input[i++]; - chr2 = i < len ? input[i++] : 0; - chr3 = i < len ? input[i++] : 0; - } - enc1 = chr1 >> 2; - enc2 = (chr1 & 3) << 4 | chr2 >> 4; - enc3 = remainingBytes > 1 ? (chr2 & 15) << 2 | chr3 >> 6 : 64; - enc4 = remainingBytes > 2 ? chr3 & 63 : 64; - output.push(_keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4)); - } - return output.join(""); - }; - exports2.decode = function(input) { - var chr1, chr2, chr3; - var enc1, enc2, enc3, enc4; - var i = 0, resultIndex = 0; - var dataUrlPrefix = "data:"; - if (input.substr(0, dataUrlPrefix.length) === dataUrlPrefix) { - throw new Error("Invalid base64 input, it looks like a data url."); - } - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - var totalLength = input.length * 3 / 4; - if (input.charAt(input.length - 1) === _keyStr.charAt(64)) { - totalLength--; - } - if (input.charAt(input.length - 2) === _keyStr.charAt(64)) { - totalLength--; - } - if (totalLength % 1 !== 0) { - throw new Error("Invalid base64 input, bad content length."); - } - var output; - if (support.uint8array) { - output = new Uint8Array(totalLength | 0); - } else { - output = new Array(totalLength | 0); + var Mixin = require_mixin(); + var LocationInfoOpenElementStackMixin = class extends Mixin { + constructor(stack, opts) { + super(stack); + this.onItemPop = opts.onItemPop; } - while (i < input.length) { - enc1 = _keyStr.indexOf(input.charAt(i++)); - enc2 = _keyStr.indexOf(input.charAt(i++)); - enc3 = _keyStr.indexOf(input.charAt(i++)); - enc4 = _keyStr.indexOf(input.charAt(i++)); - chr1 = enc1 << 2 | enc2 >> 4; - chr2 = (enc2 & 15) << 4 | enc3 >> 2; - chr3 = (enc3 & 3) << 6 | enc4; - output[resultIndex++] = chr1; - if (enc3 !== 64) { - output[resultIndex++] = chr2; - } - if (enc4 !== 64) { - output[resultIndex++] = chr3; - } + _getOverriddenMethods(mxn, orig) { + return { + pop() { + mxn.onItemPop(this.current); + orig.pop.call(this); + }, + popAllUpToHtmlElement() { + for (let i = this.stackTop; i > 0; i--) { + mxn.onItemPop(this.items[i]); + } + orig.popAllUpToHtmlElement.call(this); + }, + remove(element) { + mxn.onItemPop(this.current); + orig.remove.call(this, element); + } + }; } - return output; }; + module2.exports = LocationInfoOpenElementStackMixin; } }); -// node_modules/jszip/lib/nodejsUtils.js -var require_nodejsUtils = __commonJS({ - "node_modules/jszip/lib/nodejsUtils.js"(exports2, module2) { +// node_modules/parse5/lib/extensions/location-info/parser-mixin.js +var require_parser_mixin = __commonJS({ + "node_modules/parse5/lib/extensions/location-info/parser-mixin.js"(exports2, module2) { init_shims(); "use strict"; - module2.exports = { - isNode: typeof Buffer !== "undefined", - newBufferFrom: function(data, encoding) { - if (Buffer.from && Buffer.from !== Uint8Array.from) { - return Buffer.from(data, encoding); - } else { - if (typeof data === "number") { - throw new Error('The "data" argument must not be a number'); + var Mixin = require_mixin(); + var Tokenizer = require_tokenizer(); + var LocationInfoTokenizerMixin = require_tokenizer_mixin(); + var LocationInfoOpenElementStackMixin = require_open_element_stack_mixin(); + var HTML = require_html(); + var $ = HTML.TAG_NAMES; + var LocationInfoParserMixin = class extends Mixin { + constructor(parser) { + super(parser); + this.parser = parser; + this.treeAdapter = this.parser.treeAdapter; + this.posTracker = null; + this.lastStartTagToken = null; + this.lastFosterParentingLocation = null; + this.currentToken = null; + } + _setStartLocation(element) { + let loc = null; + if (this.lastStartTagToken) { + loc = Object.assign({}, this.lastStartTagToken.location); + loc.startTag = this.lastStartTagToken.location; + } + this.treeAdapter.setNodeSourceCodeLocation(element, loc); + } + _setEndLocation(element, closingToken) { + const loc = this.treeAdapter.getNodeSourceCodeLocation(element); + if (loc) { + if (closingToken.location) { + const ctLoc = closingToken.location; + const tn = this.treeAdapter.getTagName(element); + const isClosingEndTag = closingToken.type === Tokenizer.END_TAG_TOKEN && tn === closingToken.tagName; + const endLoc = {}; + if (isClosingEndTag) { + endLoc.endTag = Object.assign({}, ctLoc); + endLoc.endLine = ctLoc.endLine; + endLoc.endCol = ctLoc.endCol; + endLoc.endOffset = ctLoc.endOffset; + } else { + endLoc.endLine = ctLoc.startLine; + endLoc.endCol = ctLoc.startCol; + endLoc.endOffset = ctLoc.startOffset; + } + this.treeAdapter.updateNodeSourceCodeLocation(element, endLoc); } - return new Buffer(data, encoding); } - }, - allocBuffer: function(size) { - if (Buffer.alloc) { - return Buffer.alloc(size); - } else { - var buf = new Buffer(size); - buf.fill(0); - return buf; - } - }, - isBuffer: function(b) { - return Buffer.isBuffer(b); - }, - isStream: function(obj) { - return obj && typeof obj.on === "function" && typeof obj.pause === "function" && typeof obj.resume === "function"; + } + _getOverriddenMethods(mxn, orig) { + return { + _bootstrap(document2, fragmentContext) { + orig._bootstrap.call(this, document2, fragmentContext); + mxn.lastStartTagToken = null; + mxn.lastFosterParentingLocation = null; + mxn.currentToken = null; + const tokenizerMixin = Mixin.install(this.tokenizer, LocationInfoTokenizerMixin); + mxn.posTracker = tokenizerMixin.posTracker; + Mixin.install(this.openElements, LocationInfoOpenElementStackMixin, { + onItemPop: function(element) { + mxn._setEndLocation(element, mxn.currentToken); + } + }); + }, + _runParsingLoop(scriptHandler) { + orig._runParsingLoop.call(this, scriptHandler); + for (let i = this.openElements.stackTop; i >= 0; i--) { + mxn._setEndLocation(this.openElements.items[i], mxn.currentToken); + } + }, + _processTokenInForeignContent(token) { + mxn.currentToken = token; + orig._processTokenInForeignContent.call(this, token); + }, + _processToken(token) { + mxn.currentToken = token; + orig._processToken.call(this, token); + const requireExplicitUpdate = token.type === Tokenizer.END_TAG_TOKEN && (token.tagName === $.HTML || token.tagName === $.BODY && this.openElements.hasInScope($.BODY)); + if (requireExplicitUpdate) { + for (let i = this.openElements.stackTop; i >= 0; i--) { + const element = this.openElements.items[i]; + if (this.treeAdapter.getTagName(element) === token.tagName) { + mxn._setEndLocation(element, token); + break; + } + } + } + }, + _setDocumentType(token) { + orig._setDocumentType.call(this, token); + const documentChildren = this.treeAdapter.getChildNodes(this.document); + const cnLength = documentChildren.length; + for (let i = 0; i < cnLength; i++) { + const node = documentChildren[i]; + if (this.treeAdapter.isDocumentTypeNode(node)) { + this.treeAdapter.setNodeSourceCodeLocation(node, token.location); + break; + } + } + }, + _attachElementToTree(element) { + mxn._setStartLocation(element); + mxn.lastStartTagToken = null; + orig._attachElementToTree.call(this, element); + }, + _appendElement(token, namespaceURI) { + mxn.lastStartTagToken = token; + orig._appendElement.call(this, token, namespaceURI); + }, + _insertElement(token, namespaceURI) { + mxn.lastStartTagToken = token; + orig._insertElement.call(this, token, namespaceURI); + }, + _insertTemplate(token) { + mxn.lastStartTagToken = token; + orig._insertTemplate.call(this, token); + const tmplContent = this.treeAdapter.getTemplateContent(this.openElements.current); + this.treeAdapter.setNodeSourceCodeLocation(tmplContent, null); + }, + _insertFakeRootElement() { + orig._insertFakeRootElement.call(this); + this.treeAdapter.setNodeSourceCodeLocation(this.openElements.current, null); + }, + _appendCommentNode(token, parent) { + orig._appendCommentNode.call(this, token, parent); + const children = this.treeAdapter.getChildNodes(parent); + const commentNode = children[children.length - 1]; + this.treeAdapter.setNodeSourceCodeLocation(commentNode, token.location); + }, + _findFosterParentingLocation() { + mxn.lastFosterParentingLocation = orig._findFosterParentingLocation.call(this); + return mxn.lastFosterParentingLocation; + }, + _insertCharacters(token) { + orig._insertCharacters.call(this, token); + const hasFosterParent = this._shouldFosterParentOnInsertion(); + const parent = hasFosterParent && mxn.lastFosterParentingLocation.parent || this.openElements.currentTmplContent || this.openElements.current; + const siblings = this.treeAdapter.getChildNodes(parent); + const textNodeIdx = hasFosterParent && mxn.lastFosterParentingLocation.beforeElement ? siblings.indexOf(mxn.lastFosterParentingLocation.beforeElement) - 1 : siblings.length - 1; + const textNode = siblings[textNodeIdx]; + const tnLoc = this.treeAdapter.getNodeSourceCodeLocation(textNode); + if (tnLoc) { + const { endLine, endCol, endOffset } = token.location; + this.treeAdapter.updateNodeSourceCodeLocation(textNode, { endLine, endCol, endOffset }); + } else { + this.treeAdapter.setNodeSourceCodeLocation(textNode, token.location); + } + } + }; } }; + module2.exports = LocationInfoParserMixin; } }); -// node_modules/set-immediate-shim/index.js -var require_set_immediate_shim = __commonJS({ - "node_modules/set-immediate-shim/index.js"(exports2, module2) { +// node_modules/parse5/lib/extensions/error-reporting/mixin-base.js +var require_mixin_base = __commonJS({ + "node_modules/parse5/lib/extensions/error-reporting/mixin-base.js"(exports2, module2) { init_shims(); "use strict"; - module2.exports = typeof setImmediate === "function" ? setImmediate : function setImmediate2() { - var args = [].slice.apply(arguments); - args.splice(1, 0, 0); - setTimeout.apply(null, args); + var Mixin = require_mixin(); + var ErrorReportingMixinBase = class extends Mixin { + constructor(host, opts) { + super(host); + this.posTracker = null; + this.onParseError = opts.onParseError; + } + _setErrorLocation(err) { + err.startLine = err.endLine = this.posTracker.line; + err.startCol = err.endCol = this.posTracker.col; + err.startOffset = err.endOffset = this.posTracker.offset; + } + _reportError(code) { + const err = { + code, + startLine: -1, + startCol: -1, + startOffset: -1, + endLine: -1, + endCol: -1, + endOffset: -1 + }; + this._setErrorLocation(err); + this.onParseError(err); + } + _getOverriddenMethods(mxn) { + return { + _err(code) { + mxn._reportError(code); + } + }; + } }; + module2.exports = ErrorReportingMixinBase; } }); -// node_modules/immediate/lib/index.js -var require_lib = __commonJS({ - "node_modules/immediate/lib/index.js"(exports2, module2) { +// node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js +var require_preprocessor_mixin2 = __commonJS({ + "node_modules/parse5/lib/extensions/error-reporting/preprocessor-mixin.js"(exports2, module2) { init_shims(); "use strict"; - var Mutation = global.MutationObserver || global.WebKitMutationObserver; - var scheduleDrain; - if (process.browser) { - if (Mutation) { - called = 0; - observer = new Mutation(nextTick); - element = global.document.createTextNode(""); - observer.observe(element, { - characterData: true - }); - scheduleDrain = function() { - element.data = called = ++called % 2; - }; - } else if (!global.setImmediate && typeof global.MessageChannel !== "undefined") { - channel = new global.MessageChannel(); - channel.port1.onmessage = nextTick; - scheduleDrain = function() { - channel.port2.postMessage(0); - }; - } else if ("document" in global && "onreadystatechange" in global.document.createElement("script")) { - scheduleDrain = function() { - var scriptEl = global.document.createElement("script"); - scriptEl.onreadystatechange = function() { - nextTick(); - scriptEl.onreadystatechange = null; - scriptEl.parentNode.removeChild(scriptEl); - scriptEl = null; - }; - global.document.documentElement.appendChild(scriptEl); - }; - } else { - scheduleDrain = function() { - setTimeout(nextTick, 0); - }; + var ErrorReportingMixinBase = require_mixin_base(); + var PositionTrackingPreprocessorMixin = require_preprocessor_mixin(); + var Mixin = require_mixin(); + var ErrorReportingPreprocessorMixin = class extends ErrorReportingMixinBase { + constructor(preprocessor, opts) { + super(preprocessor, opts); + this.posTracker = Mixin.install(preprocessor, PositionTrackingPreprocessorMixin); + this.lastErrOffset = -1; } - } else { - scheduleDrain = function() { - process.nextTick(nextTick); - }; - } - var called; - var observer; - var element; - var channel; - var draining; - var queue = []; - function nextTick() { - draining = true; - var i, oldQueue; - var len = queue.length; - while (len) { - oldQueue = queue; - queue = []; - i = -1; - while (++i < len) { - oldQueue[i](); - } - len = queue.length; - } - draining = false; - } - module2.exports = immediate; - function immediate(task) { - if (queue.push(task) === 1 && !draining) { - scheduleDrain(); + _reportError(code) { + if (this.lastErrOffset !== this.posTracker.offset) { + this.lastErrOffset = this.posTracker.offset; + super._reportError(code); + } } - } + }; + module2.exports = ErrorReportingPreprocessorMixin; } }); -// node_modules/lie/lib/index.js -var require_lib2 = __commonJS({ - "node_modules/lie/lib/index.js"(exports2, module2) { +// node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js +var require_tokenizer_mixin2 = __commonJS({ + "node_modules/parse5/lib/extensions/error-reporting/tokenizer-mixin.js"(exports2, module2) { init_shims(); "use strict"; - var immediate = require_lib(); - function INTERNAL() { - } - var handlers = {}; - var REJECTED = ["REJECTED"]; - var FULFILLED = ["FULFILLED"]; - var PENDING = ["PENDING"]; - if (!process.browser) { - UNHANDLED = ["UNHANDLED"]; - } - var UNHANDLED; - module2.exports = Promise2; - function Promise2(resolver) { - if (typeof resolver !== "function") { - throw new TypeError("resolver must be a function"); - } - this.state = PENDING; - this.queue = []; - this.outcome = void 0; - if (!process.browser) { - this.handled = UNHANDLED; - } - if (resolver !== INTERNAL) { - safelyResolveThenable(this, resolver); - } - } - Promise2.prototype.finally = function(callback) { - if (typeof callback !== "function") { - return this; - } - var p = this.constructor; - return this.then(resolve3, reject2); - function resolve3(value) { - function yes() { - return value; - } - return p.resolve(callback()).then(yes); + var ErrorReportingMixinBase = require_mixin_base(); + var ErrorReportingPreprocessorMixin = require_preprocessor_mixin2(); + var Mixin = require_mixin(); + var ErrorReportingTokenizerMixin = class extends ErrorReportingMixinBase { + constructor(tokenizer, opts) { + super(tokenizer, opts); + const preprocessorMixin = Mixin.install(tokenizer.preprocessor, ErrorReportingPreprocessorMixin, opts); + this.posTracker = preprocessorMixin.posTracker; } - function reject2(reason) { - function no() { - throw reason; - } - return p.resolve(callback()).then(no); + }; + module2.exports = ErrorReportingTokenizerMixin; + } +}); + +// node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js +var require_parser_mixin2 = __commonJS({ + "node_modules/parse5/lib/extensions/error-reporting/parser-mixin.js"(exports2, module2) { + init_shims(); + "use strict"; + var ErrorReportingMixinBase = require_mixin_base(); + var ErrorReportingTokenizerMixin = require_tokenizer_mixin2(); + var LocationInfoTokenizerMixin = require_tokenizer_mixin(); + var Mixin = require_mixin(); + var ErrorReportingParserMixin = class extends ErrorReportingMixinBase { + constructor(parser, opts) { + super(parser, opts); + this.opts = opts; + this.ctLoc = null; + this.locBeforeToken = false; + } + _setErrorLocation(err) { + if (this.ctLoc) { + err.startLine = this.ctLoc.startLine; + err.startCol = this.ctLoc.startCol; + err.startOffset = this.ctLoc.startOffset; + err.endLine = this.locBeforeToken ? this.ctLoc.startLine : this.ctLoc.endLine; + err.endCol = this.locBeforeToken ? this.ctLoc.startCol : this.ctLoc.endCol; + err.endOffset = this.locBeforeToken ? this.ctLoc.startOffset : this.ctLoc.endOffset; + } + } + _getOverriddenMethods(mxn, orig) { + return { + _bootstrap(document2, fragmentContext) { + orig._bootstrap.call(this, document2, fragmentContext); + Mixin.install(this.tokenizer, ErrorReportingTokenizerMixin, mxn.opts); + Mixin.install(this.tokenizer, LocationInfoTokenizerMixin); + }, + _processInputToken(token) { + mxn.ctLoc = token.location; + orig._processInputToken.call(this, token); + }, + _err(code, options2) { + mxn.locBeforeToken = options2 && options2.beforeToken; + mxn._reportError(code); + } + }; } }; - Promise2.prototype.catch = function(onRejected) { - return this.then(null, onRejected); + module2.exports = ErrorReportingParserMixin; + } +}); + +// node_modules/parse5/lib/tree-adapters/default.js +var require_default = __commonJS({ + "node_modules/parse5/lib/tree-adapters/default.js"(exports2) { + init_shims(); + "use strict"; + var { DOCUMENT_MODE } = require_html(); + exports2.createDocument = function() { + return { + nodeName: "#document", + mode: DOCUMENT_MODE.NO_QUIRKS, + childNodes: [] + }; + }; + exports2.createDocumentFragment = function() { + return { + nodeName: "#document-fragment", + childNodes: [] + }; }; - Promise2.prototype.then = function(onFulfilled, onRejected) { - if (typeof onFulfilled !== "function" && this.state === FULFILLED || typeof onRejected !== "function" && this.state === REJECTED) { - return this; - } - var promise = new this.constructor(INTERNAL); - if (!process.browser) { - if (this.handled === UNHANDLED) { - this.handled = null; - } - } - if (this.state !== PENDING) { - var resolver = this.state === FULFILLED ? onFulfilled : onRejected; - unwrap(promise, resolver, this.outcome); - } else { - this.queue.push(new QueueItem(promise, onFulfilled, onRejected)); - } - return promise; + exports2.createElement = function(tagName, namespaceURI, attrs) { + return { + nodeName: tagName, + tagName, + attrs, + namespaceURI, + childNodes: [], + parentNode: null + }; }; - function QueueItem(promise, onFulfilled, onRejected) { - this.promise = promise; - if (typeof onFulfilled === "function") { - this.onFulfilled = onFulfilled; - this.callFulfilled = this.otherCallFulfilled; - } - if (typeof onRejected === "function") { - this.onRejected = onRejected; - this.callRejected = this.otherCallRejected; - } - } - QueueItem.prototype.callFulfilled = function(value) { - handlers.resolve(this.promise, value); + exports2.createCommentNode = function(data) { + return { + nodeName: "#comment", + data, + parentNode: null + }; }; - QueueItem.prototype.otherCallFulfilled = function(value) { - unwrap(this.promise, this.onFulfilled, value); + var createTextNode = function(value) { + return { + nodeName: "#text", + value, + parentNode: null + }; }; - QueueItem.prototype.callRejected = function(value) { - handlers.reject(this.promise, value); + var appendChild = exports2.appendChild = function(parentNode, newNode) { + parentNode.childNodes.push(newNode); + newNode.parentNode = parentNode; }; - QueueItem.prototype.otherCallRejected = function(value) { - unwrap(this.promise, this.onRejected, value); + var insertBefore = exports2.insertBefore = function(parentNode, newNode, referenceNode) { + const insertionIdx = parentNode.childNodes.indexOf(referenceNode); + parentNode.childNodes.splice(insertionIdx, 0, newNode); + newNode.parentNode = parentNode; }; - function unwrap(promise, func, value) { - immediate(function() { - var returnValue; - try { - returnValue = func(value); - } catch (e) { - return handlers.reject(promise, e); - } - if (returnValue === promise) { - handlers.reject(promise, new TypeError("Cannot resolve promise with itself")); - } else { - handlers.resolve(promise, returnValue); + exports2.setTemplateContent = function(templateElement, contentElement) { + templateElement.content = contentElement; + }; + exports2.getTemplateContent = function(templateElement) { + return templateElement.content; + }; + exports2.setDocumentType = function(document2, name, publicId, systemId) { + let doctypeNode = null; + for (let i = 0; i < document2.childNodes.length; i++) { + if (document2.childNodes[i].nodeName === "#documentType") { + doctypeNode = document2.childNodes[i]; + break; } - }); - } - handlers.resolve = function(self2, value) { - var result = tryCatch2(getThen, value); - if (result.status === "error") { - return handlers.reject(self2, result.value); } - var thenable = result.value; - if (thenable) { - safelyResolveThenable(self2, thenable); + if (doctypeNode) { + doctypeNode.name = name; + doctypeNode.publicId = publicId; + doctypeNode.systemId = systemId; } else { - self2.state = FULFILLED; - self2.outcome = value; - var i = -1; - var len = self2.queue.length; - while (++i < len) { - self2.queue[i].callFulfilled(value); - } - } - return self2; - }; - handlers.reject = function(self2, error3) { - self2.state = REJECTED; - self2.outcome = error3; - if (!process.browser) { - if (self2.handled === UNHANDLED) { - immediate(function() { - if (self2.handled === UNHANDLED) { - process.emit("unhandledRejection", error3, self2); - } - }); - } - } - var i = -1; - var len = self2.queue.length; - while (++i < len) { - self2.queue[i].callRejected(error3); + appendChild(document2, { + nodeName: "#documentType", + name, + publicId, + systemId + }); } - return self2; }; - function getThen(obj) { - var then = obj && obj.then; - if (obj && (typeof obj === "object" || typeof obj === "function") && typeof then === "function") { - return function appyThen() { - then.apply(obj, arguments); - }; - } - } - function safelyResolveThenable(self2, thenable) { - var called = false; - function onError(value) { - if (called) { - return; - } - called = true; - handlers.reject(self2, value); + exports2.setDocumentMode = function(document2, mode) { + document2.mode = mode; + }; + exports2.getDocumentMode = function(document2) { + return document2.mode; + }; + exports2.detachNode = function(node) { + if (node.parentNode) { + const idx = node.parentNode.childNodes.indexOf(node); + node.parentNode.childNodes.splice(idx, 1); + node.parentNode = null; } - function onSuccess(value) { - if (called) { + }; + exports2.insertText = function(parentNode, text) { + if (parentNode.childNodes.length) { + const prevNode = parentNode.childNodes[parentNode.childNodes.length - 1]; + if (prevNode.nodeName === "#text") { + prevNode.value += text; return; } - called = true; - handlers.resolve(self2, value); - } - function tryToUnwrap() { - thenable(onSuccess, onError); } - var result = tryCatch2(tryToUnwrap); - if (result.status === "error") { - onError(result.value); - } - } - function tryCatch2(func, value) { - var out = {}; - try { - out.value = func(value); - out.status = "success"; - } catch (e) { - out.status = "error"; - out.value = e; + appendChild(parentNode, createTextNode(text)); + }; + exports2.insertTextBefore = function(parentNode, text, referenceNode) { + const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1]; + if (prevNode && prevNode.nodeName === "#text") { + prevNode.value += text; + } else { + insertBefore(parentNode, createTextNode(text), referenceNode); } - return out; - } - Promise2.resolve = resolve2; - function resolve2(value) { - if (value instanceof this) { - return value; + }; + exports2.adoptAttributes = function(recipient, attrs) { + const recipientAttrsMap = []; + for (let i = 0; i < recipient.attrs.length; i++) { + recipientAttrsMap.push(recipient.attrs[i].name); } - return handlers.resolve(new this(INTERNAL), value); - } - Promise2.reject = reject; - function reject(reason) { - var promise = new this(INTERNAL); - return handlers.reject(promise, reason); - } - Promise2.all = all; - function all(iterable) { - var self2 = this; - if (Object.prototype.toString.call(iterable) !== "[object Array]") { - return this.reject(new TypeError("must be an array")); - } - var len = iterable.length; - var called = false; - if (!len) { - return this.resolve([]); - } - var values = new Array(len); - var resolved = 0; - var i = -1; - var promise = new this(INTERNAL); - while (++i < len) { - allResolver(iterable[i], i); - } - return promise; - function allResolver(value, i2) { - self2.resolve(value).then(resolveFromAll, function(error3) { - if (!called) { - called = true; - handlers.reject(promise, error3); - } - }); - function resolveFromAll(outValue) { - values[i2] = outValue; - if (++resolved === len && !called) { - called = true; - handlers.resolve(promise, values); - } + for (let j = 0; j < attrs.length; j++) { + if (recipientAttrsMap.indexOf(attrs[j].name) === -1) { + recipient.attrs.push(attrs[j]); } } - } - Promise2.race = race; - function race(iterable) { - var self2 = this; - if (Object.prototype.toString.call(iterable) !== "[object Array]") { - return this.reject(new TypeError("must be an array")); - } - var len = iterable.length; - var called = false; - if (!len) { - return this.resolve([]); - } - var i = -1; - var promise = new this(INTERNAL); - while (++i < len) { - resolver(iterable[i]); - } - return promise; - function resolver(value) { - self2.resolve(value).then(function(response) { - if (!called) { - called = true; - handlers.resolve(promise, response); - } - }, function(error3) { - if (!called) { - called = true; - handlers.reject(promise, error3); - } - }); - } - } + }; + exports2.getFirstChild = function(node) { + return node.childNodes[0]; + }; + exports2.getChildNodes = function(node) { + return node.childNodes; + }; + exports2.getParentNode = function(node) { + return node.parentNode; + }; + exports2.getAttrList = function(element) { + return element.attrs; + }; + exports2.getTagName = function(element) { + return element.tagName; + }; + exports2.getNamespaceURI = function(element) { + return element.namespaceURI; + }; + exports2.getTextNodeContent = function(textNode) { + return textNode.value; + }; + exports2.getCommentNodeContent = function(commentNode) { + return commentNode.data; + }; + exports2.getDocumentTypeNodeName = function(doctypeNode) { + return doctypeNode.name; + }; + exports2.getDocumentTypeNodePublicId = function(doctypeNode) { + return doctypeNode.publicId; + }; + exports2.getDocumentTypeNodeSystemId = function(doctypeNode) { + return doctypeNode.systemId; + }; + exports2.isTextNode = function(node) { + return node.nodeName === "#text"; + }; + exports2.isCommentNode = function(node) { + return node.nodeName === "#comment"; + }; + exports2.isDocumentTypeNode = function(node) { + return node.nodeName === "#documentType"; + }; + exports2.isElementNode = function(node) { + return !!node.tagName; + }; + exports2.setNodeSourceCodeLocation = function(node, location2) { + node.sourceCodeLocation = location2; + }; + exports2.getNodeSourceCodeLocation = function(node) { + return node.sourceCodeLocation; + }; + exports2.updateNodeSourceCodeLocation = function(node, endLocation) { + node.sourceCodeLocation = Object.assign(node.sourceCodeLocation, endLocation); + }; } }); -// node_modules/jszip/lib/external.js -var require_external = __commonJS({ - "node_modules/jszip/lib/external.js"(exports2, module2) { +// node_modules/parse5/lib/utils/merge-options.js +var require_merge_options = __commonJS({ + "node_modules/parse5/lib/utils/merge-options.js"(exports2, module2) { init_shims(); "use strict"; - var ES6Promise = null; - if (typeof Promise !== "undefined") { - ES6Promise = Promise; - } else { - ES6Promise = require_lib2(); - } - module2.exports = { - Promise: ES6Promise + module2.exports = function mergeOptions(defaults2, options2) { + options2 = options2 || Object.create(null); + return [defaults2, options2].reduce((merged, optObj) => { + Object.keys(optObj).forEach((key) => { + merged[key] = optObj[key]; + }); + return merged; + }, Object.create(null)); }; } }); -// node_modules/jszip/lib/utils.js -var require_utils2 = __commonJS({ - "node_modules/jszip/lib/utils.js"(exports2) { +// node_modules/parse5/lib/common/doctype.js +var require_doctype = __commonJS({ + "node_modules/parse5/lib/common/doctype.js"(exports2) { init_shims(); "use strict"; - var support = require_support(); - var base64 = require_base64(); - var nodejsUtils = require_nodejsUtils(); - var setImmediate2 = require_set_immediate_shim(); - var external = require_external(); - function string2binary(str) { - var result = null; - if (support.uint8array) { - result = new Uint8Array(str.length); - } else { - result = new Array(str.length); - } - return stringToArrayLike(str, result); - } - exports2.newBlob = function(part, type) { - exports2.checkSupport("blob"); - try { - return new Blob([part], { - type - }); - } catch (e) { - try { - var Builder = self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder; - var builder = new Builder(); - builder.append(part); - return builder.getBlob(type); - } catch (e2) { - throw new Error("Bug : can't construct the Blob."); + var { DOCUMENT_MODE } = require_html(); + var VALID_DOCTYPE_NAME = "html"; + var VALID_SYSTEM_ID = "about:legacy-compat"; + var QUIRKS_MODE_SYSTEM_ID = "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"; + var QUIRKS_MODE_PUBLIC_ID_PREFIXES = [ + "+//silmaril//dtd html pro v0r11 19970101//", + "-//as//dtd html 3.0 aswedit + extensions//", + "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", + "-//ietf//dtd html 2.0 level 1//", + "-//ietf//dtd html 2.0 level 2//", + "-//ietf//dtd html 2.0 strict level 1//", + "-//ietf//dtd html 2.0 strict level 2//", + "-//ietf//dtd html 2.0 strict//", + "-//ietf//dtd html 2.0//", + "-//ietf//dtd html 2.1e//", + "-//ietf//dtd html 3.0//", + "-//ietf//dtd html 3.2 final//", + "-//ietf//dtd html 3.2//", + "-//ietf//dtd html 3//", + "-//ietf//dtd html level 0//", + "-//ietf//dtd html level 1//", + "-//ietf//dtd html level 2//", + "-//ietf//dtd html level 3//", + "-//ietf//dtd html strict level 0//", + "-//ietf//dtd html strict level 1//", + "-//ietf//dtd html strict level 2//", + "-//ietf//dtd html strict level 3//", + "-//ietf//dtd html strict//", + "-//ietf//dtd html//", + "-//metrius//dtd metrius presentational//", + "-//microsoft//dtd internet explorer 2.0 html strict//", + "-//microsoft//dtd internet explorer 2.0 html//", + "-//microsoft//dtd internet explorer 2.0 tables//", + "-//microsoft//dtd internet explorer 3.0 html strict//", + "-//microsoft//dtd internet explorer 3.0 html//", + "-//microsoft//dtd internet explorer 3.0 tables//", + "-//netscape comm. corp.//dtd html//", + "-//netscape comm. corp.//dtd strict html//", + "-//o'reilly and associates//dtd html 2.0//", + "-//o'reilly and associates//dtd html extended 1.0//", + "-//o'reilly and associates//dtd html extended relaxed 1.0//", + "-//sq//dtd html 2.0 hotmetal + extensions//", + "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", + "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", + "-//spyglass//dtd html 2.0 extended//", + "-//sun microsystems corp.//dtd hotjava html//", + "-//sun microsystems corp.//dtd hotjava strict html//", + "-//w3c//dtd html 3 1995-03-24//", + "-//w3c//dtd html 3.2 draft//", + "-//w3c//dtd html 3.2 final//", + "-//w3c//dtd html 3.2//", + "-//w3c//dtd html 3.2s draft//", + "-//w3c//dtd html 4.0 frameset//", + "-//w3c//dtd html 4.0 transitional//", + "-//w3c//dtd html experimental 19960712//", + "-//w3c//dtd html experimental 970421//", + "-//w3c//dtd w3 html//", + "-//w3o//dtd w3 html 3.0//", + "-//webtechs//dtd mozilla html 2.0//", + "-//webtechs//dtd mozilla html//" + ]; + var QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = QUIRKS_MODE_PUBLIC_ID_PREFIXES.concat([ + "-//w3c//dtd html 4.01 frameset//", + "-//w3c//dtd html 4.01 transitional//" + ]); + var QUIRKS_MODE_PUBLIC_IDS = ["-//w3o//dtd w3 html strict 3.0//en//", "-/w3c/dtd html 4.0 transitional/en", "html"]; + var LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = ["-//w3c//dtd xhtml 1.0 frameset//", "-//w3c//dtd xhtml 1.0 transitional//"]; + var LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = LIMITED_QUIRKS_PUBLIC_ID_PREFIXES.concat([ + "-//w3c//dtd html 4.01 frameset//", + "-//w3c//dtd html 4.01 transitional//" + ]); + function enquoteDoctypeId(id) { + const quote = id.indexOf('"') !== -1 ? "'" : '"'; + return quote + id + quote; + } + function hasPrefix(publicId, prefixes) { + for (let i = 0; i < prefixes.length; i++) { + if (publicId.indexOf(prefixes[i]) === 0) { + return true; } } - }; - function identity2(input) { - return input; + return false; } - function stringToArrayLike(str, array) { - for (var i = 0; i < str.length; ++i) { - array[i] = str.charCodeAt(i) & 255; + exports2.isConforming = function(token) { + return token.name === VALID_DOCTYPE_NAME && token.publicId === null && (token.systemId === null || token.systemId === VALID_SYSTEM_ID); + }; + exports2.getDocumentMode = function(token) { + if (token.name !== VALID_DOCTYPE_NAME) { + return DOCUMENT_MODE.QUIRKS; } - return array; - } - var arrayToStringHelper = { - stringifyByChunk: function(array, type, chunk) { - var result = [], k = 0, len = array.length; - if (len <= chunk) { - return String.fromCharCode.apply(null, array); + const systemId = token.systemId; + if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) { + return DOCUMENT_MODE.QUIRKS; + } + let publicId = token.publicId; + if (publicId !== null) { + publicId = publicId.toLowerCase(); + if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1) { + return DOCUMENT_MODE.QUIRKS; } - while (k < len) { - if (type === "array" || type === "nodebuffer") { - result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len)))); - } else { - result.push(String.fromCharCode.apply(null, array.subarray(k, Math.min(k + chunk, len)))); - } - k += chunk; + let prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES; + if (hasPrefix(publicId, prefixes)) { + return DOCUMENT_MODE.QUIRKS; } - return result.join(""); - }, - stringifyByChar: function(array) { - var resultStr = ""; - for (var i = 0; i < array.length; i++) { - resultStr += String.fromCharCode(array[i]); + prefixes = systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES; + if (hasPrefix(publicId, prefixes)) { + return DOCUMENT_MODE.LIMITED_QUIRKS; } - return resultStr; - }, - applyCanBeUsed: { - uint8array: function() { - try { - return support.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1; - } catch (e) { - return false; - } - }(), - nodebuffer: function() { - try { - return support.nodebuffer && String.fromCharCode.apply(null, nodejsUtils.allocBuffer(1)).length === 1; - } catch (e) { - return false; - } - }() } + return DOCUMENT_MODE.NO_QUIRKS; }; - function arrayLikeToString(array) { - var chunk = 65536, type = exports2.getTypeOf(array), canUseApply = true; - if (type === "uint8array") { - canUseApply = arrayToStringHelper.applyCanBeUsed.uint8array; - } else if (type === "nodebuffer") { - canUseApply = arrayToStringHelper.applyCanBeUsed.nodebuffer; + exports2.serializeContent = function(name, publicId, systemId) { + let str = "!DOCTYPE "; + if (name) { + str += name; } - if (canUseApply) { - while (chunk > 1) { - try { - return arrayToStringHelper.stringifyByChunk(array, type, chunk); - } catch (e) { - chunk = Math.floor(chunk / 2); - } - } + if (publicId) { + str += " PUBLIC " + enquoteDoctypeId(publicId); + } else if (systemId) { + str += " SYSTEM"; } - return arrayToStringHelper.stringifyByChar(array); - } - exports2.applyFromCharCode = arrayLikeToString; - function arrayLikeToArrayLike(arrayFrom, arrayTo) { - for (var i = 0; i < arrayFrom.length; i++) { - arrayTo[i] = arrayFrom[i]; + if (systemId !== null) { + str += " " + enquoteDoctypeId(systemId); } - return arrayTo; - } - var transform = {}; - transform["string"] = { - "string": identity2, - "array": function(input) { - return stringToArrayLike(input, new Array(input.length)); - }, - "arraybuffer": function(input) { - return transform["string"]["uint8array"](input).buffer; - }, - "uint8array": function(input) { - return stringToArrayLike(input, new Uint8Array(input.length)); - }, - "nodebuffer": function(input) { - return stringToArrayLike(input, nodejsUtils.allocBuffer(input.length)); + return str; + }; + } +}); + +// node_modules/parse5/lib/common/foreign-content.js +var require_foreign_content = __commonJS({ + "node_modules/parse5/lib/common/foreign-content.js"(exports2) { + init_shims(); + "use strict"; + var Tokenizer = require_tokenizer(); + var HTML = require_html(); + var $ = HTML.TAG_NAMES; + var NS = HTML.NAMESPACES; + var ATTRS = HTML.ATTRS; + var MIME_TYPES = { + TEXT_HTML: "text/html", + APPLICATION_XML: "application/xhtml+xml" + }; + var DEFINITION_URL_ATTR = "definitionurl"; + var ADJUSTED_DEFINITION_URL_ATTR = "definitionURL"; + var SVG_ATTRS_ADJUSTMENT_MAP = { + attributename: "attributeName", + attributetype: "attributeType", + basefrequency: "baseFrequency", + baseprofile: "baseProfile", + calcmode: "calcMode", + clippathunits: "clipPathUnits", + diffuseconstant: "diffuseConstant", + edgemode: "edgeMode", + filterunits: "filterUnits", + glyphref: "glyphRef", + gradienttransform: "gradientTransform", + gradientunits: "gradientUnits", + kernelmatrix: "kernelMatrix", + kernelunitlength: "kernelUnitLength", + keypoints: "keyPoints", + keysplines: "keySplines", + keytimes: "keyTimes", + lengthadjust: "lengthAdjust", + limitingconeangle: "limitingConeAngle", + markerheight: "markerHeight", + markerunits: "markerUnits", + markerwidth: "markerWidth", + maskcontentunits: "maskContentUnits", + maskunits: "maskUnits", + numoctaves: "numOctaves", + pathlength: "pathLength", + patterncontentunits: "patternContentUnits", + patterntransform: "patternTransform", + patternunits: "patternUnits", + pointsatx: "pointsAtX", + pointsaty: "pointsAtY", + pointsatz: "pointsAtZ", + preservealpha: "preserveAlpha", + preserveaspectratio: "preserveAspectRatio", + primitiveunits: "primitiveUnits", + refx: "refX", + refy: "refY", + repeatcount: "repeatCount", + repeatdur: "repeatDur", + requiredextensions: "requiredExtensions", + requiredfeatures: "requiredFeatures", + specularconstant: "specularConstant", + specularexponent: "specularExponent", + spreadmethod: "spreadMethod", + startoffset: "startOffset", + stddeviation: "stdDeviation", + stitchtiles: "stitchTiles", + surfacescale: "surfaceScale", + systemlanguage: "systemLanguage", + tablevalues: "tableValues", + targetx: "targetX", + targety: "targetY", + textlength: "textLength", + viewbox: "viewBox", + viewtarget: "viewTarget", + xchannelselector: "xChannelSelector", + ychannelselector: "yChannelSelector", + zoomandpan: "zoomAndPan" + }; + var XML_ATTRS_ADJUSTMENT_MAP = { + "xlink:actuate": { prefix: "xlink", name: "actuate", namespace: NS.XLINK }, + "xlink:arcrole": { prefix: "xlink", name: "arcrole", namespace: NS.XLINK }, + "xlink:href": { prefix: "xlink", name: "href", namespace: NS.XLINK }, + "xlink:role": { prefix: "xlink", name: "role", namespace: NS.XLINK }, + "xlink:show": { prefix: "xlink", name: "show", namespace: NS.XLINK }, + "xlink:title": { prefix: "xlink", name: "title", namespace: NS.XLINK }, + "xlink:type": { prefix: "xlink", name: "type", namespace: NS.XLINK }, + "xml:base": { prefix: "xml", name: "base", namespace: NS.XML }, + "xml:lang": { prefix: "xml", name: "lang", namespace: NS.XML }, + "xml:space": { prefix: "xml", name: "space", namespace: NS.XML }, + xmlns: { prefix: "", name: "xmlns", namespace: NS.XMLNS }, + "xmlns:xlink": { prefix: "xmlns", name: "xlink", namespace: NS.XMLNS } + }; + var SVG_TAG_NAMES_ADJUSTMENT_MAP = exports2.SVG_TAG_NAMES_ADJUSTMENT_MAP = { + altglyph: "altGlyph", + altglyphdef: "altGlyphDef", + altglyphitem: "altGlyphItem", + animatecolor: "animateColor", + animatemotion: "animateMotion", + animatetransform: "animateTransform", + clippath: "clipPath", + feblend: "feBlend", + fecolormatrix: "feColorMatrix", + fecomponenttransfer: "feComponentTransfer", + fecomposite: "feComposite", + feconvolvematrix: "feConvolveMatrix", + fediffuselighting: "feDiffuseLighting", + fedisplacementmap: "feDisplacementMap", + fedistantlight: "feDistantLight", + feflood: "feFlood", + fefunca: "feFuncA", + fefuncb: "feFuncB", + fefuncg: "feFuncG", + fefuncr: "feFuncR", + fegaussianblur: "feGaussianBlur", + feimage: "feImage", + femerge: "feMerge", + femergenode: "feMergeNode", + femorphology: "feMorphology", + feoffset: "feOffset", + fepointlight: "fePointLight", + fespecularlighting: "feSpecularLighting", + fespotlight: "feSpotLight", + fetile: "feTile", + feturbulence: "feTurbulence", + foreignobject: "foreignObject", + glyphref: "glyphRef", + lineargradient: "linearGradient", + radialgradient: "radialGradient", + textpath: "textPath" + }; + var EXITS_FOREIGN_CONTENT = { + [$.B]: true, + [$.BIG]: true, + [$.BLOCKQUOTE]: true, + [$.BODY]: true, + [$.BR]: true, + [$.CENTER]: true, + [$.CODE]: true, + [$.DD]: true, + [$.DIV]: true, + [$.DL]: true, + [$.DT]: true, + [$.EM]: true, + [$.EMBED]: true, + [$.H1]: true, + [$.H2]: true, + [$.H3]: true, + [$.H4]: true, + [$.H5]: true, + [$.H6]: true, + [$.HEAD]: true, + [$.HR]: true, + [$.I]: true, + [$.IMG]: true, + [$.LI]: true, + [$.LISTING]: true, + [$.MENU]: true, + [$.META]: true, + [$.NOBR]: true, + [$.OL]: true, + [$.P]: true, + [$.PRE]: true, + [$.RUBY]: true, + [$.S]: true, + [$.SMALL]: true, + [$.SPAN]: true, + [$.STRONG]: true, + [$.STRIKE]: true, + [$.SUB]: true, + [$.SUP]: true, + [$.TABLE]: true, + [$.TT]: true, + [$.U]: true, + [$.UL]: true, + [$.VAR]: true + }; + exports2.causesExit = function(startTagToken) { + const tn = startTagToken.tagName; + const isFontWithAttrs = tn === $.FONT && (Tokenizer.getTokenAttr(startTagToken, ATTRS.COLOR) !== null || Tokenizer.getTokenAttr(startTagToken, ATTRS.SIZE) !== null || Tokenizer.getTokenAttr(startTagToken, ATTRS.FACE) !== null); + return isFontWithAttrs ? true : EXITS_FOREIGN_CONTENT[tn]; + }; + exports2.adjustTokenMathMLAttrs = function(token) { + for (let i = 0; i < token.attrs.length; i++) { + if (token.attrs[i].name === DEFINITION_URL_ATTR) { + token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR; + break; + } } }; - transform["array"] = { - "string": arrayLikeToString, - "array": identity2, - "arraybuffer": function(input) { - return new Uint8Array(input).buffer; - }, - "uint8array": function(input) { - return new Uint8Array(input); - }, - "nodebuffer": function(input) { - return nodejsUtils.newBufferFrom(input); + exports2.adjustTokenSVGAttrs = function(token) { + for (let i = 0; i < token.attrs.length; i++) { + const adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; + if (adjustedAttrName) { + token.attrs[i].name = adjustedAttrName; + } } }; - transform["arraybuffer"] = { - "string": function(input) { - return arrayLikeToString(new Uint8Array(input)); - }, - "array": function(input) { - return arrayLikeToArrayLike(new Uint8Array(input), new Array(input.byteLength)); - }, - "arraybuffer": identity2, - "uint8array": function(input) { - return new Uint8Array(input); - }, - "nodebuffer": function(input) { - return nodejsUtils.newBufferFrom(new Uint8Array(input)); + exports2.adjustTokenXMLAttrs = function(token) { + for (let i = 0; i < token.attrs.length; i++) { + const adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; + if (adjustedAttrEntry) { + token.attrs[i].prefix = adjustedAttrEntry.prefix; + token.attrs[i].name = adjustedAttrEntry.name; + token.attrs[i].namespace = adjustedAttrEntry.namespace; + } } }; - transform["uint8array"] = { - "string": arrayLikeToString, - "array": function(input) { - return arrayLikeToArrayLike(input, new Array(input.length)); - }, - "arraybuffer": function(input) { - return input.buffer; - }, - "uint8array": identity2, - "nodebuffer": function(input) { - return nodejsUtils.newBufferFrom(input); + exports2.adjustTokenSVGTagName = function(token) { + const adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP[token.tagName]; + if (adjustedTagName) { + token.tagName = adjustedTagName; } }; - transform["nodebuffer"] = { - "string": arrayLikeToString, - "array": function(input) { - return arrayLikeToArrayLike(input, new Array(input.length)); - }, - "arraybuffer": function(input) { - return transform["nodebuffer"]["uint8array"](input).buffer; - }, - "uint8array": function(input) { - return arrayLikeToArrayLike(input, new Uint8Array(input.length)); - }, - "nodebuffer": identity2 - }; - exports2.transformTo = function(outputType, input) { - if (!input) { - input = ""; - } - if (!outputType) { - return input; - } - exports2.checkSupport(outputType); - var inputType = exports2.getTypeOf(input); - var result = transform[inputType][outputType](input); - return result; - }; - exports2.getTypeOf = function(input) { - if (typeof input === "string") { - return "string"; - } - if (Object.prototype.toString.call(input) === "[object Array]") { - return "array"; - } - if (support.nodebuffer && nodejsUtils.isBuffer(input)) { - return "nodebuffer"; - } - if (support.uint8array && input instanceof Uint8Array) { - return "uint8array"; - } - if (support.arraybuffer && input instanceof ArrayBuffer) { - return "arraybuffer"; - } - }; - exports2.checkSupport = function(type) { - var supported = support[type.toLowerCase()]; - if (!supported) { - throw new Error(type + " is not supported by this platform"); - } - }; - exports2.MAX_VALUE_16BITS = 65535; - exports2.MAX_VALUE_32BITS = -1; - exports2.pretty = function(str) { - var res2 = "", code, i; - for (i = 0; i < (str || "").length; i++) { - code = str.charCodeAt(i); - res2 += "\\x" + (code < 16 ? "0" : "") + code.toString(16).toUpperCase(); - } - return res2; - }; - exports2.delay = function(callback, args, self2) { - setImmediate2(function() { - callback.apply(self2 || null, args || []); - }); - }; - exports2.inherits = function(ctor, superCtor) { - var Obj = function() { - }; - Obj.prototype = superCtor.prototype; - ctor.prototype = new Obj(); - }; - exports2.extend = function() { - var result = {}, i, attr; - for (i = 0; i < arguments.length; i++) { - for (attr in arguments[i]) { - if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === "undefined") { - result[attr] = arguments[i][attr]; + function isMathMLTextIntegrationPoint(tn, ns) { + return ns === NS.MATHML && (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS || tn === $.MTEXT); + } + function isHtmlIntegrationPoint(tn, ns, attrs) { + if (ns === NS.MATHML && tn === $.ANNOTATION_XML) { + for (let i = 0; i < attrs.length; i++) { + if (attrs[i].name === ATTRS.ENCODING) { + const value = attrs[i].value.toLowerCase(); + return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML; } } } - return result; - }; - exports2.prepareContent = function(name, inputData, isBinary, isOptimizedBinaryString, isBase64) { - var promise = external.Promise.resolve(inputData).then(function(data) { - var isBlob2 = support.blob && (data instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(data)) !== -1); - if (isBlob2 && typeof FileReader !== "undefined") { - return new external.Promise(function(resolve2, reject) { - var reader = new FileReader(); - reader.onload = function(e) { - resolve2(e.target.result); - }; - reader.onerror = function(e) { - reject(e.target.error); - }; - reader.readAsArrayBuffer(data); - }); - } else { - return data; - } - }); - return promise.then(function(data) { - var dataType = exports2.getTypeOf(data); - if (!dataType) { - return external.Promise.reject(new Error("Can't read the data of '" + name + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?")); - } - if (dataType === "arraybuffer") { - data = exports2.transformTo("uint8array", data); - } else if (dataType === "string") { - if (isBase64) { - data = base64.decode(data); - } else if (isBinary) { - if (isOptimizedBinaryString !== true) { - data = string2binary(data); - } - } - } - return data; - }); + return ns === NS.SVG && (tn === $.FOREIGN_OBJECT || tn === $.DESC || tn === $.TITLE); + } + exports2.isIntegrationPoint = function(tn, ns, attrs, foreignNS) { + if ((!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs)) { + return true; + } + if ((!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns)) { + return true; + } + return false; }; } }); -// node_modules/jszip/lib/stream/GenericWorker.js -var require_GenericWorker = __commonJS({ - "node_modules/jszip/lib/stream/GenericWorker.js"(exports2, module2) { +// node_modules/parse5/lib/parser/index.js +var require_parser = __commonJS({ + "node_modules/parse5/lib/parser/index.js"(exports2, module2) { init_shims(); "use strict"; - function GenericWorker(name) { - this.name = name || "default"; - this.streamInfo = {}; - this.generatedError = null; - this.extraStreamInfo = {}; - this.isPaused = true; - this.isFinished = false; - this.isLocked = false; - this._listeners = { - "data": [], - "end": [], - "error": [] - }; - this.previous = null; - } - GenericWorker.prototype = { - push: function(chunk) { - this.emit("data", chunk); + var Tokenizer = require_tokenizer(); + var OpenElementStack = require_open_element_stack(); + var FormattingElementList = require_formatting_element_list(); + var LocationInfoParserMixin = require_parser_mixin(); + var ErrorReportingParserMixin = require_parser_mixin2(); + var Mixin = require_mixin(); + var defaultTreeAdapter = require_default(); + var mergeOptions = require_merge_options(); + var doctype = require_doctype(); + var foreignContent = require_foreign_content(); + var ERR = require_error_codes(); + var unicode = require_unicode(); + var HTML = require_html(); + var $ = HTML.TAG_NAMES; + var NS = HTML.NAMESPACES; + var ATTRS = HTML.ATTRS; + var DEFAULT_OPTIONS = { + scriptingEnabled: true, + sourceCodeLocationInfo: false, + onParseError: null, + treeAdapter: defaultTreeAdapter + }; + var HIDDEN_INPUT_TYPE = "hidden"; + var AA_OUTER_LOOP_ITER = 8; + var AA_INNER_LOOP_ITER = 3; + var INITIAL_MODE = "INITIAL_MODE"; + var BEFORE_HTML_MODE = "BEFORE_HTML_MODE"; + var BEFORE_HEAD_MODE = "BEFORE_HEAD_MODE"; + var IN_HEAD_MODE = "IN_HEAD_MODE"; + var IN_HEAD_NO_SCRIPT_MODE = "IN_HEAD_NO_SCRIPT_MODE"; + var AFTER_HEAD_MODE = "AFTER_HEAD_MODE"; + var IN_BODY_MODE = "IN_BODY_MODE"; + var TEXT_MODE = "TEXT_MODE"; + var IN_TABLE_MODE = "IN_TABLE_MODE"; + var IN_TABLE_TEXT_MODE = "IN_TABLE_TEXT_MODE"; + var IN_CAPTION_MODE = "IN_CAPTION_MODE"; + var IN_COLUMN_GROUP_MODE = "IN_COLUMN_GROUP_MODE"; + var IN_TABLE_BODY_MODE = "IN_TABLE_BODY_MODE"; + var IN_ROW_MODE = "IN_ROW_MODE"; + var IN_CELL_MODE = "IN_CELL_MODE"; + var IN_SELECT_MODE = "IN_SELECT_MODE"; + var IN_SELECT_IN_TABLE_MODE = "IN_SELECT_IN_TABLE_MODE"; + var IN_TEMPLATE_MODE = "IN_TEMPLATE_MODE"; + var AFTER_BODY_MODE = "AFTER_BODY_MODE"; + var IN_FRAMESET_MODE = "IN_FRAMESET_MODE"; + var AFTER_FRAMESET_MODE = "AFTER_FRAMESET_MODE"; + var AFTER_AFTER_BODY_MODE = "AFTER_AFTER_BODY_MODE"; + var AFTER_AFTER_FRAMESET_MODE = "AFTER_AFTER_FRAMESET_MODE"; + var INSERTION_MODE_RESET_MAP = { + [$.TR]: IN_ROW_MODE, + [$.TBODY]: IN_TABLE_BODY_MODE, + [$.THEAD]: IN_TABLE_BODY_MODE, + [$.TFOOT]: IN_TABLE_BODY_MODE, + [$.CAPTION]: IN_CAPTION_MODE, + [$.COLGROUP]: IN_COLUMN_GROUP_MODE, + [$.TABLE]: IN_TABLE_MODE, + [$.BODY]: IN_BODY_MODE, + [$.FRAMESET]: IN_FRAMESET_MODE + }; + var TEMPLATE_INSERTION_MODE_SWITCH_MAP = { + [$.CAPTION]: IN_TABLE_MODE, + [$.COLGROUP]: IN_TABLE_MODE, + [$.TBODY]: IN_TABLE_MODE, + [$.TFOOT]: IN_TABLE_MODE, + [$.THEAD]: IN_TABLE_MODE, + [$.COL]: IN_COLUMN_GROUP_MODE, + [$.TR]: IN_TABLE_BODY_MODE, + [$.TD]: IN_ROW_MODE, + [$.TH]: IN_ROW_MODE + }; + var TOKEN_HANDLERS = { + [INITIAL_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: tokenInInitialMode, + [Tokenizer.NULL_CHARACTER_TOKEN]: tokenInInitialMode, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: doctypeInInitialMode, + [Tokenizer.START_TAG_TOKEN]: tokenInInitialMode, + [Tokenizer.END_TAG_TOKEN]: tokenInInitialMode, + [Tokenizer.EOF_TOKEN]: tokenInInitialMode }, - end: function() { - if (this.isFinished) { - return false; - } - this.flush(); - try { - this.emit("end"); - this.cleanUp(); - this.isFinished = true; - } catch (e) { - this.emit("error", e); - } - return true; + [BEFORE_HTML_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: tokenBeforeHtml, + [Tokenizer.NULL_CHARACTER_TOKEN]: tokenBeforeHtml, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagBeforeHtml, + [Tokenizer.END_TAG_TOKEN]: endTagBeforeHtml, + [Tokenizer.EOF_TOKEN]: tokenBeforeHtml }, - error: function(e) { - if (this.isFinished) { - return false; - } - if (this.isPaused) { - this.generatedError = e; - } else { - this.isFinished = true; - this.emit("error", e); - if (this.previous) { - this.previous.error(e); - } - this.cleanUp(); - } - return true; + [BEFORE_HEAD_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: tokenBeforeHead, + [Tokenizer.NULL_CHARACTER_TOKEN]: tokenBeforeHead, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: misplacedDoctype, + [Tokenizer.START_TAG_TOKEN]: startTagBeforeHead, + [Tokenizer.END_TAG_TOKEN]: endTagBeforeHead, + [Tokenizer.EOF_TOKEN]: tokenBeforeHead }, - on: function(name, listener) { - this._listeners[name].push(listener); - return this; + [IN_HEAD_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: tokenInHead, + [Tokenizer.NULL_CHARACTER_TOKEN]: tokenInHead, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: insertCharacters, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: misplacedDoctype, + [Tokenizer.START_TAG_TOKEN]: startTagInHead, + [Tokenizer.END_TAG_TOKEN]: endTagInHead, + [Tokenizer.EOF_TOKEN]: tokenInHead }, - cleanUp: function() { - this.streamInfo = this.generatedError = this.extraStreamInfo = null; - this._listeners = []; + [IN_HEAD_NO_SCRIPT_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: tokenInHeadNoScript, + [Tokenizer.NULL_CHARACTER_TOKEN]: tokenInHeadNoScript, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: insertCharacters, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: misplacedDoctype, + [Tokenizer.START_TAG_TOKEN]: startTagInHeadNoScript, + [Tokenizer.END_TAG_TOKEN]: endTagInHeadNoScript, + [Tokenizer.EOF_TOKEN]: tokenInHeadNoScript }, - emit: function(name, arg) { - if (this._listeners[name]) { - for (var i = 0; i < this._listeners[name].length; i++) { - this._listeners[name][i].call(this, arg); - } - } + [AFTER_HEAD_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: tokenAfterHead, + [Tokenizer.NULL_CHARACTER_TOKEN]: tokenAfterHead, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: insertCharacters, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: misplacedDoctype, + [Tokenizer.START_TAG_TOKEN]: startTagAfterHead, + [Tokenizer.END_TAG_TOKEN]: endTagAfterHead, + [Tokenizer.EOF_TOKEN]: tokenAfterHead }, - pipe: function(next) { - return next.registerPrevious(this); + [IN_BODY_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: characterInBody, + [Tokenizer.NULL_CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagInBody, + [Tokenizer.END_TAG_TOKEN]: endTagInBody, + [Tokenizer.EOF_TOKEN]: eofInBody }, - registerPrevious: function(previous) { - if (this.isLocked) { - throw new Error("The stream '" + this + "' has already been used."); - } - this.streamInfo = previous.streamInfo; - this.mergeStreamInfo(); - this.previous = previous; - var self2 = this; - previous.on("data", function(chunk) { - self2.processChunk(chunk); - }); - previous.on("end", function() { - self2.end(); - }); - previous.on("error", function(e) { - self2.error(e); - }); - return this; + [TEXT_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: insertCharacters, + [Tokenizer.NULL_CHARACTER_TOKEN]: insertCharacters, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: insertCharacters, + [Tokenizer.COMMENT_TOKEN]: ignoreToken, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: ignoreToken, + [Tokenizer.END_TAG_TOKEN]: endTagInText, + [Tokenizer.EOF_TOKEN]: eofInText }, - pause: function() { - if (this.isPaused || this.isFinished) { - return false; - } - this.isPaused = true; - if (this.previous) { - this.previous.pause(); - } - return true; + [IN_TABLE_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: characterInTable, + [Tokenizer.NULL_CHARACTER_TOKEN]: characterInTable, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: characterInTable, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagInTable, + [Tokenizer.END_TAG_TOKEN]: endTagInTable, + [Tokenizer.EOF_TOKEN]: eofInBody }, - resume: function() { - if (!this.isPaused || this.isFinished) { - return false; - } - this.isPaused = false; - var withError = false; - if (this.generatedError) { - this.error(this.generatedError); - withError = true; - } - if (this.previous) { - this.previous.resume(); - } - return !withError; + [IN_TABLE_TEXT_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: characterInTableText, + [Tokenizer.NULL_CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInTableText, + [Tokenizer.COMMENT_TOKEN]: tokenInTableText, + [Tokenizer.DOCTYPE_TOKEN]: tokenInTableText, + [Tokenizer.START_TAG_TOKEN]: tokenInTableText, + [Tokenizer.END_TAG_TOKEN]: tokenInTableText, + [Tokenizer.EOF_TOKEN]: tokenInTableText }, - flush: function() { + [IN_CAPTION_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: characterInBody, + [Tokenizer.NULL_CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagInCaption, + [Tokenizer.END_TAG_TOKEN]: endTagInCaption, + [Tokenizer.EOF_TOKEN]: eofInBody }, - processChunk: function(chunk) { - this.push(chunk); + [IN_COLUMN_GROUP_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: tokenInColumnGroup, + [Tokenizer.NULL_CHARACTER_TOKEN]: tokenInColumnGroup, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: insertCharacters, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagInColumnGroup, + [Tokenizer.END_TAG_TOKEN]: endTagInColumnGroup, + [Tokenizer.EOF_TOKEN]: eofInBody }, - withStreamInfo: function(key, value) { - this.extraStreamInfo[key] = value; - this.mergeStreamInfo(); - return this; + [IN_TABLE_BODY_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: characterInTable, + [Tokenizer.NULL_CHARACTER_TOKEN]: characterInTable, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: characterInTable, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagInTableBody, + [Tokenizer.END_TAG_TOKEN]: endTagInTableBody, + [Tokenizer.EOF_TOKEN]: eofInBody }, - mergeStreamInfo: function() { - for (var key in this.extraStreamInfo) { - if (!this.extraStreamInfo.hasOwnProperty(key)) { - continue; - } - this.streamInfo[key] = this.extraStreamInfo[key]; - } + [IN_ROW_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: characterInTable, + [Tokenizer.NULL_CHARACTER_TOKEN]: characterInTable, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: characterInTable, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagInRow, + [Tokenizer.END_TAG_TOKEN]: endTagInRow, + [Tokenizer.EOF_TOKEN]: eofInBody + }, + [IN_CELL_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: characterInBody, + [Tokenizer.NULL_CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagInCell, + [Tokenizer.END_TAG_TOKEN]: endTagInCell, + [Tokenizer.EOF_TOKEN]: eofInBody + }, + [IN_SELECT_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: insertCharacters, + [Tokenizer.NULL_CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: insertCharacters, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagInSelect, + [Tokenizer.END_TAG_TOKEN]: endTagInSelect, + [Tokenizer.EOF_TOKEN]: eofInBody + }, + [IN_SELECT_IN_TABLE_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: insertCharacters, + [Tokenizer.NULL_CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: insertCharacters, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagInSelectInTable, + [Tokenizer.END_TAG_TOKEN]: endTagInSelectInTable, + [Tokenizer.EOF_TOKEN]: eofInBody + }, + [IN_TEMPLATE_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: characterInBody, + [Tokenizer.NULL_CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagInTemplate, + [Tokenizer.END_TAG_TOKEN]: endTagInTemplate, + [Tokenizer.EOF_TOKEN]: eofInTemplate }, - lock: function() { - if (this.isLocked) { - throw new Error("The stream '" + this + "' has already been used."); + [AFTER_BODY_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: tokenAfterBody, + [Tokenizer.NULL_CHARACTER_TOKEN]: tokenAfterBody, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody, + [Tokenizer.COMMENT_TOKEN]: appendCommentToRootHtmlElement, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagAfterBody, + [Tokenizer.END_TAG_TOKEN]: endTagAfterBody, + [Tokenizer.EOF_TOKEN]: stopParsing + }, + [IN_FRAMESET_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.NULL_CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: insertCharacters, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagInFrameset, + [Tokenizer.END_TAG_TOKEN]: endTagInFrameset, + [Tokenizer.EOF_TOKEN]: stopParsing + }, + [AFTER_FRAMESET_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.NULL_CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: insertCharacters, + [Tokenizer.COMMENT_TOKEN]: appendComment, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagAfterFrameset, + [Tokenizer.END_TAG_TOKEN]: endTagAfterFrameset, + [Tokenizer.EOF_TOKEN]: stopParsing + }, + [AFTER_AFTER_BODY_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: tokenAfterAfterBody, + [Tokenizer.NULL_CHARACTER_TOKEN]: tokenAfterAfterBody, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody, + [Tokenizer.COMMENT_TOKEN]: appendCommentToDocument, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagAfterAfterBody, + [Tokenizer.END_TAG_TOKEN]: tokenAfterAfterBody, + [Tokenizer.EOF_TOKEN]: stopParsing + }, + [AFTER_AFTER_FRAMESET_MODE]: { + [Tokenizer.CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.NULL_CHARACTER_TOKEN]: ignoreToken, + [Tokenizer.WHITESPACE_CHARACTER_TOKEN]: whitespaceCharacterInBody, + [Tokenizer.COMMENT_TOKEN]: appendCommentToDocument, + [Tokenizer.DOCTYPE_TOKEN]: ignoreToken, + [Tokenizer.START_TAG_TOKEN]: startTagAfterAfterFrameset, + [Tokenizer.END_TAG_TOKEN]: ignoreToken, + [Tokenizer.EOF_TOKEN]: stopParsing + } + }; + var Parser = class { + constructor(options2) { + this.options = mergeOptions(DEFAULT_OPTIONS, options2); + this.treeAdapter = this.options.treeAdapter; + this.pendingScript = null; + if (this.options.sourceCodeLocationInfo) { + Mixin.install(this, LocationInfoParserMixin); + } + if (this.options.onParseError) { + Mixin.install(this, ErrorReportingParserMixin, { onParseError: this.options.onParseError }); + } + } + parse(html) { + const document2 = this.treeAdapter.createDocument(); + this._bootstrap(document2, null); + this.tokenizer.write(html, true); + this._runParsingLoop(null); + return document2; + } + parseFragment(html, fragmentContext) { + if (!fragmentContext) { + fragmentContext = this.treeAdapter.createElement($.TEMPLATE, NS.HTML, []); + } + const documentMock = this.treeAdapter.createElement("documentmock", NS.HTML, []); + this._bootstrap(documentMock, fragmentContext); + if (this.treeAdapter.getTagName(fragmentContext) === $.TEMPLATE) { + this._pushTmplInsertionMode(IN_TEMPLATE_MODE); + } + this._initTokenizerForFragmentParsing(); + this._insertFakeRootElement(); + this._resetInsertionMode(); + this._findFormInFragmentContext(); + this.tokenizer.write(html, true); + this._runParsingLoop(null); + const rootElement = this.treeAdapter.getFirstChild(documentMock); + const fragment = this.treeAdapter.createDocumentFragment(); + this._adoptNodes(rootElement, fragment); + return fragment; + } + _bootstrap(document2, fragmentContext) { + this.tokenizer = new Tokenizer(this.options); + this.stopped = false; + this.insertionMode = INITIAL_MODE; + this.originalInsertionMode = ""; + this.document = document2; + this.fragmentContext = fragmentContext; + this.headElement = null; + this.formElement = null; + this.openElements = new OpenElementStack(this.document, this.treeAdapter); + this.activeFormattingElements = new FormattingElementList(this.treeAdapter); + this.tmplInsertionModeStack = []; + this.tmplInsertionModeStackTop = -1; + this.currentTmplInsertionMode = null; + this.pendingCharacterTokens = []; + this.hasNonWhitespacePendingCharacterToken = false; + this.framesetOk = true; + this.skipNextNewLine = false; + this.fosterParentingEnabled = false; + } + _err() { + } + _runParsingLoop(scriptHandler) { + while (!this.stopped) { + this._setupTokenizerCDATAMode(); + const token = this.tokenizer.getNextToken(); + if (token.type === Tokenizer.HIBERNATION_TOKEN) { + break; + } + if (this.skipNextNewLine) { + this.skipNextNewLine = false; + if (token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN && token.chars[0] === "\n") { + if (token.chars.length === 1) { + continue; + } + token.chars = token.chars.substr(1); + } + } + this._processInputToken(token); + if (scriptHandler && this.pendingScript) { + break; + } } - this.isLocked = true; - if (this.previous) { - this.previous.lock(); + } + runParsingLoopForCurrentChunk(writeCallback, scriptHandler) { + this._runParsingLoop(scriptHandler); + if (scriptHandler && this.pendingScript) { + const script = this.pendingScript; + this.pendingScript = null; + scriptHandler(script); + return; } - }, - toString: function() { - var me = "Worker " + this.name; - if (this.previous) { - return this.previous + " -> " + me; - } else { - return me; + if (writeCallback) { + writeCallback(); } } - }; - module2.exports = GenericWorker; - } -}); - -// node_modules/jszip/lib/utf8.js -var require_utf8 = __commonJS({ - "node_modules/jszip/lib/utf8.js"(exports2) { - init_shims(); - "use strict"; - var utils = require_utils2(); - var support = require_support(); - var nodejsUtils = require_nodejsUtils(); - var GenericWorker = require_GenericWorker(); - var _utf8len = new Array(256); - for (var i = 0; i < 256; i++) { - _utf8len[i] = i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1; - } - _utf8len[254] = _utf8len[254] = 1; - var string2buf = function(str) { - var buf, c, c2, m_pos, i2, str_len = str.length, buf_len = 0; - for (m_pos = 0; m_pos < str_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 64512) === 55296 && m_pos + 1 < str_len) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 64512) === 56320) { - c = 65536 + (c - 55296 << 10) + (c2 - 56320); - m_pos++; + _setupTokenizerCDATAMode() { + const current = this._getAdjustedCurrentElement(); + this.tokenizer.allowCDATA = current && current !== this.document && this.treeAdapter.getNamespaceURI(current) !== NS.HTML && !this._isIntegrationPoint(current); + } + _switchToTextParsing(currentToken, nextTokenizerState) { + this._insertElement(currentToken, NS.HTML); + this.tokenizer.state = nextTokenizerState; + this.originalInsertionMode = this.insertionMode; + this.insertionMode = TEXT_MODE; + } + switchToPlaintextParsing() { + this.insertionMode = TEXT_MODE; + this.originalInsertionMode = IN_BODY_MODE; + this.tokenizer.state = Tokenizer.MODE.PLAINTEXT; + } + _getAdjustedCurrentElement() { + return this.openElements.stackTop === 0 && this.fragmentContext ? this.fragmentContext : this.openElements.current; + } + _findFormInFragmentContext() { + let node = this.fragmentContext; + do { + if (this.treeAdapter.getTagName(node) === $.FORM) { + this.formElement = node; + break; + } + node = this.treeAdapter.getParentNode(node); + } while (node); + } + _initTokenizerForFragmentParsing() { + if (this.treeAdapter.getNamespaceURI(this.fragmentContext) === NS.HTML) { + const tn = this.treeAdapter.getTagName(this.fragmentContext); + if (tn === $.TITLE || tn === $.TEXTAREA) { + this.tokenizer.state = Tokenizer.MODE.RCDATA; + } else if (tn === $.STYLE || tn === $.XMP || tn === $.IFRAME || tn === $.NOEMBED || tn === $.NOFRAMES || tn === $.NOSCRIPT) { + this.tokenizer.state = Tokenizer.MODE.RAWTEXT; + } else if (tn === $.SCRIPT) { + this.tokenizer.state = Tokenizer.MODE.SCRIPT_DATA; + } else if (tn === $.PLAINTEXT) { + this.tokenizer.state = Tokenizer.MODE.PLAINTEXT; } } - buf_len += c < 128 ? 1 : c < 2048 ? 2 : c < 65536 ? 3 : 4; } - if (support.uint8array) { - buf = new Uint8Array(buf_len); - } else { - buf = new Array(buf_len); - } - for (i2 = 0, m_pos = 0; i2 < buf_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 64512) === 55296 && m_pos + 1 < str_len) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 64512) === 56320) { - c = 65536 + (c - 55296 << 10) + (c2 - 56320); - m_pos++; - } - } - if (c < 128) { - buf[i2++] = c; - } else if (c < 2048) { - buf[i2++] = 192 | c >>> 6; - buf[i2++] = 128 | c & 63; - } else if (c < 65536) { - buf[i2++] = 224 | c >>> 12; - buf[i2++] = 128 | c >>> 6 & 63; - buf[i2++] = 128 | c & 63; + _setDocumentType(token) { + const name = token.name || ""; + const publicId = token.publicId || ""; + const systemId = token.systemId || ""; + this.treeAdapter.setDocumentType(this.document, name, publicId, systemId); + } + _attachElementToTree(element) { + if (this._shouldFosterParentOnInsertion()) { + this._fosterParentElement(element); + } else { + const parent = this.openElements.currentTmplContent || this.openElements.current; + this.treeAdapter.appendChild(parent, element); + } + } + _appendElement(token, namespaceURI) { + const element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs); + this._attachElementToTree(element); + } + _insertElement(token, namespaceURI) { + const element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs); + this._attachElementToTree(element); + this.openElements.push(element); + } + _insertFakeElement(tagName) { + const element = this.treeAdapter.createElement(tagName, NS.HTML, []); + this._attachElementToTree(element); + this.openElements.push(element); + } + _insertTemplate(token) { + const tmpl = this.treeAdapter.createElement(token.tagName, NS.HTML, token.attrs); + const content = this.treeAdapter.createDocumentFragment(); + this.treeAdapter.setTemplateContent(tmpl, content); + this._attachElementToTree(tmpl); + this.openElements.push(tmpl); + } + _insertFakeRootElement() { + const element = this.treeAdapter.createElement($.HTML, NS.HTML, []); + this.treeAdapter.appendChild(this.openElements.current, element); + this.openElements.push(element); + } + _appendCommentNode(token, parent) { + const commentNode = this.treeAdapter.createCommentNode(token.data); + this.treeAdapter.appendChild(parent, commentNode); + } + _insertCharacters(token) { + if (this._shouldFosterParentOnInsertion()) { + this._fosterParentText(token.chars); } else { - buf[i2++] = 240 | c >>> 18; - buf[i2++] = 128 | c >>> 12 & 63; - buf[i2++] = 128 | c >>> 6 & 63; - buf[i2++] = 128 | c & 63; + const parent = this.openElements.currentTmplContent || this.openElements.current; + this.treeAdapter.insertText(parent, token.chars); } } - return buf; - }; - var utf8border = function(buf, max) { - var pos; - max = max || buf.length; - if (max > buf.length) { - max = buf.length; + _adoptNodes(donor, recipient) { + for (let child = this.treeAdapter.getFirstChild(donor); child; child = this.treeAdapter.getFirstChild(donor)) { + this.treeAdapter.detachNode(child); + this.treeAdapter.appendChild(recipient, child); + } + } + _shouldProcessTokenInForeignContent(token) { + const current = this._getAdjustedCurrentElement(); + if (!current || current === this.document) { + return false; + } + const ns = this.treeAdapter.getNamespaceURI(current); + if (ns === NS.HTML) { + return false; + } + if (this.treeAdapter.getTagName(current) === $.ANNOTATION_XML && ns === NS.MATHML && token.type === Tokenizer.START_TAG_TOKEN && token.tagName === $.SVG) { + return false; + } + const isCharacterToken = token.type === Tokenizer.CHARACTER_TOKEN || token.type === Tokenizer.NULL_CHARACTER_TOKEN || token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN; + const isMathMLTextStartTag = token.type === Tokenizer.START_TAG_TOKEN && token.tagName !== $.MGLYPH && token.tagName !== $.MALIGNMARK; + if ((isMathMLTextStartTag || isCharacterToken) && this._isIntegrationPoint(current, NS.MATHML)) { + return false; + } + if ((token.type === Tokenizer.START_TAG_TOKEN || isCharacterToken) && this._isIntegrationPoint(current, NS.HTML)) { + return false; + } + return token.type !== Tokenizer.EOF_TOKEN; } - pos = max - 1; - while (pos >= 0 && (buf[pos] & 192) === 128) { - pos--; + _processToken(token) { + TOKEN_HANDLERS[this.insertionMode][token.type](this, token); } - if (pos < 0) { - return max; + _processTokenInBodyMode(token) { + TOKEN_HANDLERS[IN_BODY_MODE][token.type](this, token); } - if (pos === 0) { - return max; + _processTokenInForeignContent(token) { + if (token.type === Tokenizer.CHARACTER_TOKEN) { + characterInForeignContent(this, token); + } else if (token.type === Tokenizer.NULL_CHARACTER_TOKEN) { + nullCharacterInForeignContent(this, token); + } else if (token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN) { + insertCharacters(this, token); + } else if (token.type === Tokenizer.COMMENT_TOKEN) { + appendComment(this, token); + } else if (token.type === Tokenizer.START_TAG_TOKEN) { + startTagInForeignContent(this, token); + } else if (token.type === Tokenizer.END_TAG_TOKEN) { + endTagInForeignContent(this, token); + } } - return pos + _utf8len[buf[pos]] > max ? pos : max; - }; - var buf2string = function(buf) { - var str, i2, out, c, c_len; - var len = buf.length; - var utf16buf = new Array(len * 2); - for (out = 0, i2 = 0; i2 < len; ) { - c = buf[i2++]; - if (c < 128) { - utf16buf[out++] = c; - continue; + _processInputToken(token) { + if (this._shouldProcessTokenInForeignContent(token)) { + this._processTokenInForeignContent(token); + } else { + this._processToken(token); } - c_len = _utf8len[c]; - if (c_len > 4) { - utf16buf[out++] = 65533; - i2 += c_len - 1; - continue; + if (token.type === Tokenizer.START_TAG_TOKEN && token.selfClosing && !token.ackSelfClosing) { + this._err(ERR.nonVoidHtmlElementStartTagWithTrailingSolidus); + } + } + _isIntegrationPoint(element, foreignNS) { + const tn = this.treeAdapter.getTagName(element); + const ns = this.treeAdapter.getNamespaceURI(element); + const attrs = this.treeAdapter.getAttrList(element); + return foreignContent.isIntegrationPoint(tn, ns, attrs, foreignNS); + } + _reconstructActiveFormattingElements() { + const listLength = this.activeFormattingElements.length; + if (listLength) { + let unopenIdx = listLength; + let entry = null; + do { + unopenIdx--; + entry = this.activeFormattingElements.entries[unopenIdx]; + if (entry.type === FormattingElementList.MARKER_ENTRY || this.openElements.contains(entry.element)) { + unopenIdx++; + break; + } + } while (unopenIdx > 0); + for (let i = unopenIdx; i < listLength; i++) { + entry = this.activeFormattingElements.entries[i]; + this._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element)); + entry.element = this.openElements.current; + } + } + } + _closeTableCell() { + this.openElements.generateImpliedEndTags(); + this.openElements.popUntilTableCellPopped(); + this.activeFormattingElements.clearToLastMarker(); + this.insertionMode = IN_ROW_MODE; + } + _closePElement() { + this.openElements.generateImpliedEndTagsWithExclusion($.P); + this.openElements.popUntilTagNamePopped($.P); + } + _resetInsertionMode() { + for (let i = this.openElements.stackTop, last = false; i >= 0; i--) { + let element = this.openElements.items[i]; + if (i === 0) { + last = true; + if (this.fragmentContext) { + element = this.fragmentContext; + } + } + const tn = this.treeAdapter.getTagName(element); + const newInsertionMode = INSERTION_MODE_RESET_MAP[tn]; + if (newInsertionMode) { + this.insertionMode = newInsertionMode; + break; + } else if (!last && (tn === $.TD || tn === $.TH)) { + this.insertionMode = IN_CELL_MODE; + break; + } else if (!last && tn === $.HEAD) { + this.insertionMode = IN_HEAD_MODE; + break; + } else if (tn === $.SELECT) { + this._resetInsertionModeForSelect(i); + break; + } else if (tn === $.TEMPLATE) { + this.insertionMode = this.currentTmplInsertionMode; + break; + } else if (tn === $.HTML) { + this.insertionMode = this.headElement ? AFTER_HEAD_MODE : BEFORE_HEAD_MODE; + break; + } else if (last) { + this.insertionMode = IN_BODY_MODE; + break; + } } - c &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7; - while (c_len > 1 && i2 < len) { - c = c << 6 | buf[i2++] & 63; - c_len--; + } + _resetInsertionModeForSelect(selectIdx) { + if (selectIdx > 0) { + for (let i = selectIdx - 1; i > 0; i--) { + const ancestor = this.openElements.items[i]; + const tn = this.treeAdapter.getTagName(ancestor); + if (tn === $.TEMPLATE) { + break; + } else if (tn === $.TABLE) { + this.insertionMode = IN_SELECT_IN_TABLE_MODE; + return; + } + } } - if (c_len > 1) { - utf16buf[out++] = 65533; - continue; + this.insertionMode = IN_SELECT_MODE; + } + _pushTmplInsertionMode(mode) { + this.tmplInsertionModeStack.push(mode); + this.tmplInsertionModeStackTop++; + this.currentTmplInsertionMode = mode; + } + _popTmplInsertionMode() { + this.tmplInsertionModeStack.pop(); + this.tmplInsertionModeStackTop--; + this.currentTmplInsertionMode = this.tmplInsertionModeStack[this.tmplInsertionModeStackTop]; + } + _isElementCausesFosterParenting(element) { + const tn = this.treeAdapter.getTagName(element); + return tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR; + } + _shouldFosterParentOnInsertion() { + return this.fosterParentingEnabled && this._isElementCausesFosterParenting(this.openElements.current); + } + _findFosterParentingLocation() { + const location2 = { + parent: null, + beforeElement: null + }; + for (let i = this.openElements.stackTop; i >= 0; i--) { + const openElement = this.openElements.items[i]; + const tn = this.treeAdapter.getTagName(openElement); + const ns = this.treeAdapter.getNamespaceURI(openElement); + if (tn === $.TEMPLATE && ns === NS.HTML) { + location2.parent = this.treeAdapter.getTemplateContent(openElement); + break; + } else if (tn === $.TABLE) { + location2.parent = this.treeAdapter.getParentNode(openElement); + if (location2.parent) { + location2.beforeElement = openElement; + } else { + location2.parent = this.openElements.items[i - 1]; + } + break; + } + } + if (!location2.parent) { + location2.parent = this.openElements.items[0]; } - if (c < 65536) { - utf16buf[out++] = c; + return location2; + } + _fosterParentElement(element) { + const location2 = this._findFosterParentingLocation(); + if (location2.beforeElement) { + this.treeAdapter.insertBefore(location2.parent, element, location2.beforeElement); } else { - c -= 65536; - utf16buf[out++] = 55296 | c >> 10 & 1023; - utf16buf[out++] = 56320 | c & 1023; + this.treeAdapter.appendChild(location2.parent, element); } } - if (utf16buf.length !== out) { - if (utf16buf.subarray) { - utf16buf = utf16buf.subarray(0, out); + _fosterParentText(chars2) { + const location2 = this._findFosterParentingLocation(); + if (location2.beforeElement) { + this.treeAdapter.insertTextBefore(location2.parent, chars2, location2.beforeElement); } else { - utf16buf.length = out; + this.treeAdapter.insertText(location2.parent, chars2); } } - return utils.applyFromCharCode(utf16buf); - }; - exports2.utf8encode = function utf8encode(str) { - if (support.nodebuffer) { - return nodejsUtils.newBufferFrom(str, "utf-8"); + _isSpecialElement(element) { + const tn = this.treeAdapter.getTagName(element); + const ns = this.treeAdapter.getNamespaceURI(element); + return HTML.SPECIAL_ELEMENTS[ns][tn]; } - return string2buf(str); }; - exports2.utf8decode = function utf8decode(buf) { - if (support.nodebuffer) { - return utils.transformTo("nodebuffer", buf).toString("utf-8"); + module2.exports = Parser; + function aaObtainFormattingElementEntry(p, token) { + let formattingElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName(token.tagName); + if (formattingElementEntry) { + if (!p.openElements.contains(formattingElementEntry.element)) { + p.activeFormattingElements.removeEntry(formattingElementEntry); + formattingElementEntry = null; + } else if (!p.openElements.hasInScope(token.tagName)) { + formattingElementEntry = null; + } + } else { + genericEndTagInBody(p, token); } - buf = utils.transformTo(support.uint8array ? "uint8array" : "array", buf); - return buf2string(buf); - }; - function Utf8DecodeWorker() { - GenericWorker.call(this, "utf-8 decode"); - this.leftOver = null; + return formattingElementEntry; } - utils.inherits(Utf8DecodeWorker, GenericWorker); - Utf8DecodeWorker.prototype.processChunk = function(chunk) { - var data = utils.transformTo(support.uint8array ? "uint8array" : "array", chunk.data); - if (this.leftOver && this.leftOver.length) { - if (support.uint8array) { - var previousData = data; - data = new Uint8Array(previousData.length + this.leftOver.length); - data.set(this.leftOver, 0); - data.set(previousData, this.leftOver.length); - } else { - data = this.leftOver.concat(data); + function aaObtainFurthestBlock(p, formattingElementEntry) { + let furthestBlock = null; + for (let i = p.openElements.stackTop; i >= 0; i--) { + const element = p.openElements.items[i]; + if (element === formattingElementEntry.element) { + break; + } + if (p._isSpecialElement(element)) { + furthestBlock = element; } - this.leftOver = null; } - var nextBoundary = utf8border(data); - var usableData = data; - if (nextBoundary !== data.length) { - if (support.uint8array) { - usableData = data.subarray(0, nextBoundary); - this.leftOver = data.subarray(nextBoundary, data.length); + if (!furthestBlock) { + p.openElements.popUntilElementPopped(formattingElementEntry.element); + p.activeFormattingElements.removeEntry(formattingElementEntry); + } + return furthestBlock; + } + function aaInnerLoop(p, furthestBlock, formattingElement) { + let lastElement = furthestBlock; + let nextElement = p.openElements.getCommonAncestor(furthestBlock); + for (let i = 0, element = nextElement; element !== formattingElement; i++, element = nextElement) { + nextElement = p.openElements.getCommonAncestor(element); + const elementEntry = p.activeFormattingElements.getElementEntry(element); + const counterOverflow = elementEntry && i >= AA_INNER_LOOP_ITER; + const shouldRemoveFromOpenElements = !elementEntry || counterOverflow; + if (shouldRemoveFromOpenElements) { + if (counterOverflow) { + p.activeFormattingElements.removeEntry(elementEntry); + } + p.openElements.remove(element); } else { - usableData = data.slice(0, nextBoundary); - this.leftOver = data.slice(nextBoundary, data.length); + element = aaRecreateElementFromEntry(p, elementEntry); + if (lastElement === furthestBlock) { + p.activeFormattingElements.bookmark = elementEntry; + } + p.treeAdapter.detachNode(lastElement); + p.treeAdapter.appendChild(element, lastElement); + lastElement = element; } } - this.push({ - data: exports2.utf8decode(usableData), - meta: chunk.meta - }); - }; - Utf8DecodeWorker.prototype.flush = function() { - if (this.leftOver && this.leftOver.length) { - this.push({ - data: exports2.utf8decode(this.leftOver), - meta: {} - }); - this.leftOver = null; - } - }; - exports2.Utf8DecodeWorker = Utf8DecodeWorker; - function Utf8EncodeWorker() { - GenericWorker.call(this, "utf-8 encode"); + return lastElement; } - utils.inherits(Utf8EncodeWorker, GenericWorker); - Utf8EncodeWorker.prototype.processChunk = function(chunk) { - this.push({ - data: exports2.utf8encode(chunk.data), - meta: chunk.meta - }); - }; - exports2.Utf8EncodeWorker = Utf8EncodeWorker; - } -}); - -// node_modules/jszip/lib/stream/ConvertWorker.js -var require_ConvertWorker = __commonJS({ - "node_modules/jszip/lib/stream/ConvertWorker.js"(exports2, module2) { - init_shims(); - "use strict"; - var GenericWorker = require_GenericWorker(); - var utils = require_utils2(); - function ConvertWorker(destType) { - GenericWorker.call(this, "ConvertWorker to " + destType); - this.destType = destType; - } - utils.inherits(ConvertWorker, GenericWorker); - ConvertWorker.prototype.processChunk = function(chunk) { - this.push({ - data: utils.transformTo(this.destType, chunk.data), - meta: chunk.meta - }); - }; - module2.exports = ConvertWorker; - } -}); - -// node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js -var require_NodejsStreamOutputAdapter = __commonJS({ - "node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js"(exports2, module2) { - init_shims(); - "use strict"; - var Readable2 = require_readable().Readable; - var utils = require_utils2(); - utils.inherits(NodejsStreamOutputAdapter, Readable2); - function NodejsStreamOutputAdapter(helper, options2, updateCb) { - Readable2.call(this, options2); - this._helper = helper; - var self2 = this; - helper.on("data", function(data, meta) { - if (!self2.push(data)) { - self2._helper.pause(); - } - if (updateCb) { - updateCb(meta); - } - }).on("error", function(e) { - self2.emit("error", e); - }).on("end", function() { - self2.push(null); - }); + function aaRecreateElementFromEntry(p, elementEntry) { + const ns = p.treeAdapter.getNamespaceURI(elementEntry.element); + const newElement = p.treeAdapter.createElement(elementEntry.token.tagName, ns, elementEntry.token.attrs); + p.openElements.replace(elementEntry.element, newElement); + elementEntry.element = newElement; + return newElement; } - NodejsStreamOutputAdapter.prototype._read = function() { - this._helper.resume(); - }; - module2.exports = NodejsStreamOutputAdapter; - } -}); - -// node_modules/jszip/lib/stream/StreamHelper.js -var require_StreamHelper = __commonJS({ - "node_modules/jszip/lib/stream/StreamHelper.js"(exports2, module2) { - init_shims(); - "use strict"; - var utils = require_utils2(); - var ConvertWorker = require_ConvertWorker(); - var GenericWorker = require_GenericWorker(); - var base64 = require_base64(); - var support = require_support(); - var external = require_external(); - var NodejsStreamOutputAdapter = null; - if (support.nodestream) { - try { - NodejsStreamOutputAdapter = require_NodejsStreamOutputAdapter(); - } catch (e) { + function aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement) { + if (p._isElementCausesFosterParenting(commonAncestor)) { + p._fosterParentElement(lastElement); + } else { + const tn = p.treeAdapter.getTagName(commonAncestor); + const ns = p.treeAdapter.getNamespaceURI(commonAncestor); + if (tn === $.TEMPLATE && ns === NS.HTML) { + commonAncestor = p.treeAdapter.getTemplateContent(commonAncestor); + } + p.treeAdapter.appendChild(commonAncestor, lastElement); + } + } + function aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry) { + const ns = p.treeAdapter.getNamespaceURI(formattingElementEntry.element); + const token = formattingElementEntry.token; + const newElement = p.treeAdapter.createElement(token.tagName, ns, token.attrs); + p._adoptNodes(furthestBlock, newElement); + p.treeAdapter.appendChild(furthestBlock, newElement); + p.activeFormattingElements.insertElementAfterBookmark(newElement, formattingElementEntry.token); + p.activeFormattingElements.removeEntry(formattingElementEntry); + p.openElements.remove(formattingElementEntry.element); + p.openElements.insertAfter(furthestBlock, newElement); + } + function callAdoptionAgency(p, token) { + let formattingElementEntry; + for (let i = 0; i < AA_OUTER_LOOP_ITER; i++) { + formattingElementEntry = aaObtainFormattingElementEntry(p, token, formattingElementEntry); + if (!formattingElementEntry) { + break; + } + const furthestBlock = aaObtainFurthestBlock(p, formattingElementEntry); + if (!furthestBlock) { + break; + } + p.activeFormattingElements.bookmark = formattingElementEntry; + const lastElement = aaInnerLoop(p, furthestBlock, formattingElementEntry.element); + const commonAncestor = p.openElements.getCommonAncestor(formattingElementEntry.element); + p.treeAdapter.detachNode(lastElement); + aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement); + aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry); } } - function transformZipOutput(type, content, mimeType) { - switch (type) { - case "blob": - return utils.newBlob(utils.transformTo("arraybuffer", content), mimeType); - case "base64": - return base64.encode(content); - default: - return utils.transformTo(type, content); + function ignoreToken() { + } + function misplacedDoctype(p) { + p._err(ERR.misplacedDoctype); + } + function appendComment(p, token) { + p._appendCommentNode(token, p.openElements.currentTmplContent || p.openElements.current); + } + function appendCommentToRootHtmlElement(p, token) { + p._appendCommentNode(token, p.openElements.items[0]); + } + function appendCommentToDocument(p, token) { + p._appendCommentNode(token, p.document); + } + function insertCharacters(p, token) { + p._insertCharacters(token); + } + function stopParsing(p) { + p.stopped = true; + } + function doctypeInInitialMode(p, token) { + p._setDocumentType(token); + const mode = token.forceQuirks ? HTML.DOCUMENT_MODE.QUIRKS : doctype.getDocumentMode(token); + if (!doctype.isConforming(token)) { + p._err(ERR.nonConformingDoctype); } + p.treeAdapter.setDocumentMode(p.document, mode); + p.insertionMode = BEFORE_HTML_MODE; } - function concat(type, dataArray) { - var i, index2 = 0, res2 = null, totalLength = 0; - for (i = 0; i < dataArray.length; i++) { - totalLength += dataArray[i].length; + function tokenInInitialMode(p, token) { + p._err(ERR.missingDoctype, { beforeToken: true }); + p.treeAdapter.setDocumentMode(p.document, HTML.DOCUMENT_MODE.QUIRKS); + p.insertionMode = BEFORE_HTML_MODE; + p._processToken(token); + } + function startTagBeforeHtml(p, token) { + if (token.tagName === $.HTML) { + p._insertElement(token, NS.HTML); + p.insertionMode = BEFORE_HEAD_MODE; + } else { + tokenBeforeHtml(p, token); } - switch (type) { - case "string": - return dataArray.join(""); - case "array": - return Array.prototype.concat.apply([], dataArray); - case "uint8array": - res2 = new Uint8Array(totalLength); - for (i = 0; i < dataArray.length; i++) { - res2.set(dataArray[i], index2); - index2 += dataArray[i].length; - } - return res2; - case "nodebuffer": - return Buffer.concat(dataArray); - default: - throw new Error("concat : unsupported type '" + type + "'"); - } - } - function accumulate(helper, updateCallback) { - return new external.Promise(function(resolve2, reject) { - var dataArray = []; - var chunkType = helper._internalType, resultType = helper._outputType, mimeType = helper._mimeType; - helper.on("data", function(data, meta) { - dataArray.push(data); - if (updateCallback) { - updateCallback(meta); - } - }).on("error", function(err) { - dataArray = []; - reject(err); - }).on("end", function() { - try { - var result = transformZipOutput(resultType, concat(chunkType, dataArray), mimeType); - resolve2(result); - } catch (e) { - reject(e); - } - dataArray = []; - }).resume(); - }); } - function StreamHelper(worker, outputType, mimeType) { - var internalType = outputType; - switch (outputType) { - case "blob": - case "arraybuffer": - internalType = "uint8array"; - break; - case "base64": - internalType = "string"; - break; + function endTagBeforeHtml(p, token) { + const tn = token.tagName; + if (tn === $.HTML || tn === $.HEAD || tn === $.BODY || tn === $.BR) { + tokenBeforeHtml(p, token); } - try { - this._internalType = internalType; - this._outputType = outputType; - this._mimeType = mimeType; - utils.checkSupport(internalType); - this._worker = worker.pipe(new ConvertWorker(internalType)); - worker.lock(); - } catch (e) { - this._worker = new GenericWorker("error"); - this._worker.error(e); + } + function tokenBeforeHtml(p, token) { + p._insertFakeRootElement(); + p.insertionMode = BEFORE_HEAD_MODE; + p._processToken(token); + } + function startTagBeforeHead(p, token) { + const tn = token.tagName; + if (tn === $.HTML) { + startTagInBody(p, token); + } else if (tn === $.HEAD) { + p._insertElement(token, NS.HTML); + p.headElement = p.openElements.current; + p.insertionMode = IN_HEAD_MODE; + } else { + tokenBeforeHead(p, token); } } - StreamHelper.prototype = { - accumulate: function(updateCb) { - return accumulate(this, updateCb); - }, - on: function(evt, fn) { - var self2 = this; - if (evt === "data") { - this._worker.on(evt, function(chunk) { - fn.call(self2, chunk.data, chunk.meta); - }); + function endTagBeforeHead(p, token) { + const tn = token.tagName; + if (tn === $.HEAD || tn === $.BODY || tn === $.HTML || tn === $.BR) { + tokenBeforeHead(p, token); + } else { + p._err(ERR.endTagWithoutMatchingOpenElement); + } + } + function tokenBeforeHead(p, token) { + p._insertFakeElement($.HEAD); + p.headElement = p.openElements.current; + p.insertionMode = IN_HEAD_MODE; + p._processToken(token); + } + function startTagInHead(p, token) { + const tn = token.tagName; + if (tn === $.HTML) { + startTagInBody(p, token); + } else if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META) { + p._appendElement(token, NS.HTML); + token.ackSelfClosing = true; + } else if (tn === $.TITLE) { + p._switchToTextParsing(token, Tokenizer.MODE.RCDATA); + } else if (tn === $.NOSCRIPT) { + if (p.options.scriptingEnabled) { + p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT); } else { - this._worker.on(evt, function() { - utils.delay(fn, arguments, self2); - }); - } - return this; - }, - resume: function() { - utils.delay(this._worker.resume, [], this._worker); - return this; - }, - pause: function() { - this._worker.pause(); - return this; - }, - toNodejsStream: function(updateCb) { - utils.checkSupport("nodestream"); - if (this._outputType !== "nodebuffer") { - throw new Error(this._outputType + " is not supported by this method"); + p._insertElement(token, NS.HTML); + p.insertionMode = IN_HEAD_NO_SCRIPT_MODE; + } + } else if (tn === $.NOFRAMES || tn === $.STYLE) { + p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT); + } else if (tn === $.SCRIPT) { + p._switchToTextParsing(token, Tokenizer.MODE.SCRIPT_DATA); + } else if (tn === $.TEMPLATE) { + p._insertTemplate(token, NS.HTML); + p.activeFormattingElements.insertMarker(); + p.framesetOk = false; + p.insertionMode = IN_TEMPLATE_MODE; + p._pushTmplInsertionMode(IN_TEMPLATE_MODE); + } else if (tn === $.HEAD) { + p._err(ERR.misplacedStartTagForHeadElement); + } else { + tokenInHead(p, token); + } + } + function endTagInHead(p, token) { + const tn = token.tagName; + if (tn === $.HEAD) { + p.openElements.pop(); + p.insertionMode = AFTER_HEAD_MODE; + } else if (tn === $.BODY || tn === $.BR || tn === $.HTML) { + tokenInHead(p, token); + } else if (tn === $.TEMPLATE) { + if (p.openElements.tmplCount > 0) { + p.openElements.generateImpliedEndTagsThoroughly(); + if (p.openElements.currentTagName !== $.TEMPLATE) { + p._err(ERR.closingOfElementWithOpenChildElements); + } + p.openElements.popUntilTagNamePopped($.TEMPLATE); + p.activeFormattingElements.clearToLastMarker(); + p._popTmplInsertionMode(); + p._resetInsertionMode(); + } else { + p._err(ERR.endTagWithoutMatchingOpenElement); } - return new NodejsStreamOutputAdapter(this, { - objectMode: this._outputType !== "nodebuffer" - }, updateCb); + } else { + p._err(ERR.endTagWithoutMatchingOpenElement); + } + } + function tokenInHead(p, token) { + p.openElements.pop(); + p.insertionMode = AFTER_HEAD_MODE; + p._processToken(token); + } + function startTagInHeadNoScript(p, token) { + const tn = token.tagName; + if (tn === $.HTML) { + startTagInBody(p, token); + } else if (tn === $.BASEFONT || tn === $.BGSOUND || tn === $.HEAD || tn === $.LINK || tn === $.META || tn === $.NOFRAMES || tn === $.STYLE) { + startTagInHead(p, token); + } else if (tn === $.NOSCRIPT) { + p._err(ERR.nestedNoscriptInHead); + } else { + tokenInHeadNoScript(p, token); } - }; - module2.exports = StreamHelper; - } -}); - -// node_modules/jszip/lib/defaults.js -var require_defaults3 = __commonJS({ - "node_modules/jszip/lib/defaults.js"(exports2) { - init_shims(); - "use strict"; - exports2.base64 = false; - exports2.binary = false; - exports2.dir = false; - exports2.createFolders = true; - exports2.date = null; - exports2.compression = null; - exports2.compressionOptions = null; - exports2.comment = null; - exports2.unixPermissions = null; - exports2.dosPermissions = null; - } -}); - -// node_modules/jszip/lib/stream/DataWorker.js -var require_DataWorker = __commonJS({ - "node_modules/jszip/lib/stream/DataWorker.js"(exports2, module2) { - init_shims(); - "use strict"; - var utils = require_utils2(); - var GenericWorker = require_GenericWorker(); - var DEFAULT_BLOCK_SIZE = 16 * 1024; - function DataWorker(dataP) { - GenericWorker.call(this, "DataWorker"); - var self2 = this; - this.dataIsReady = false; - this.index = 0; - this.max = 0; - this.data = null; - this.type = ""; - this._tickScheduled = false; - dataP.then(function(data) { - self2.dataIsReady = true; - self2.data = data; - self2.max = data && data.length || 0; - self2.type = utils.getTypeOf(data); - if (!self2.isPaused) { - self2._tickAndRepeat(); - } - }, function(e) { - self2.error(e); - }); } - utils.inherits(DataWorker, GenericWorker); - DataWorker.prototype.cleanUp = function() { - GenericWorker.prototype.cleanUp.call(this); - this.data = null; - }; - DataWorker.prototype.resume = function() { - if (!GenericWorker.prototype.resume.call(this)) { - return false; - } - if (!this._tickScheduled && this.dataIsReady) { - this._tickScheduled = true; - utils.delay(this._tickAndRepeat, [], this); - } - return true; - }; - DataWorker.prototype._tickAndRepeat = function() { - this._tickScheduled = false; - if (this.isPaused || this.isFinished) { - return; - } - this._tick(); - if (!this.isFinished) { - utils.delay(this._tickAndRepeat, [], this); - this._tickScheduled = true; - } - }; - DataWorker.prototype._tick = function() { - if (this.isPaused || this.isFinished) { - return false; + function endTagInHeadNoScript(p, token) { + const tn = token.tagName; + if (tn === $.NOSCRIPT) { + p.openElements.pop(); + p.insertionMode = IN_HEAD_MODE; + } else if (tn === $.BR) { + tokenInHeadNoScript(p, token); + } else { + p._err(ERR.endTagWithoutMatchingOpenElement); + } + } + function tokenInHeadNoScript(p, token) { + const errCode = token.type === Tokenizer.EOF_TOKEN ? ERR.openElementsLeftAfterEof : ERR.disallowedContentInNoscriptInHead; + p._err(errCode); + p.openElements.pop(); + p.insertionMode = IN_HEAD_MODE; + p._processToken(token); + } + function startTagAfterHead(p, token) { + const tn = token.tagName; + if (tn === $.HTML) { + startTagInBody(p, token); + } else if (tn === $.BODY) { + p._insertElement(token, NS.HTML); + p.framesetOk = false; + p.insertionMode = IN_BODY_MODE; + } else if (tn === $.FRAMESET) { + p._insertElement(token, NS.HTML); + p.insertionMode = IN_FRAMESET_MODE; + } else if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META || tn === $.NOFRAMES || tn === $.SCRIPT || tn === $.STYLE || tn === $.TEMPLATE || tn === $.TITLE) { + p._err(ERR.abandonedHeadElementChild); + p.openElements.push(p.headElement); + startTagInHead(p, token); + p.openElements.remove(p.headElement); + } else if (tn === $.HEAD) { + p._err(ERR.misplacedStartTagForHeadElement); + } else { + tokenAfterHead(p, token); } - var size = DEFAULT_BLOCK_SIZE; - var data = null, nextIndex = Math.min(this.max, this.index + size); - if (this.index >= this.max) { - return this.end(); + } + function endTagAfterHead(p, token) { + const tn = token.tagName; + if (tn === $.BODY || tn === $.HTML || tn === $.BR) { + tokenAfterHead(p, token); + } else if (tn === $.TEMPLATE) { + endTagInHead(p, token); } else { - switch (this.type) { - case "string": - data = this.data.substring(this.index, nextIndex); - break; - case "uint8array": - data = this.data.subarray(this.index, nextIndex); - break; - case "array": - case "nodebuffer": - data = this.data.slice(this.index, nextIndex); - break; - } - this.index = nextIndex; - return this.push({ - data, - meta: { - percent: this.max ? this.index / this.max * 100 : 0 - } - }); + p._err(ERR.endTagWithoutMatchingOpenElement); } - }; - module2.exports = DataWorker; - } -}); - -// node_modules/jszip/lib/crc32.js -var require_crc32 = __commonJS({ - "node_modules/jszip/lib/crc32.js"(exports2, module2) { - init_shims(); - "use strict"; - var utils = require_utils2(); - function makeTable() { - var c, table = []; - for (var n = 0; n < 256; n++) { - c = n; - for (var k = 0; k < 8; k++) { - c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1; - } - table[n] = c; + } + function tokenAfterHead(p, token) { + p._insertFakeElement($.BODY); + p.insertionMode = IN_BODY_MODE; + p._processToken(token); + } + function whitespaceCharacterInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertCharacters(token); + } + function characterInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertCharacters(token); + p.framesetOk = false; + } + function htmlStartTagInBody(p, token) { + if (p.openElements.tmplCount === 0) { + p.treeAdapter.adoptAttributes(p.openElements.items[0], token.attrs); } - return table; } - var crcTable = makeTable(); - function crc32(crc, buf, len, pos) { - var t = crcTable, end = pos + len; - crc = crc ^ -1; - for (var i = pos; i < end; i++) { - crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255]; + function bodyStartTagInBody(p, token) { + const bodyElement = p.openElements.tryPeekProperlyNestedBodyElement(); + if (bodyElement && p.openElements.tmplCount === 0) { + p.framesetOk = false; + p.treeAdapter.adoptAttributes(bodyElement, token.attrs); } - return crc ^ -1; } - function crc32str(crc, str, len, pos) { - var t = crcTable, end = pos + len; - crc = crc ^ -1; - for (var i = pos; i < end; i++) { - crc = crc >>> 8 ^ t[(crc ^ str.charCodeAt(i)) & 255]; + function framesetStartTagInBody(p, token) { + const bodyElement = p.openElements.tryPeekProperlyNestedBodyElement(); + if (p.framesetOk && bodyElement) { + p.treeAdapter.detachNode(bodyElement); + p.openElements.popAllUpToHtmlElement(); + p._insertElement(token, NS.HTML); + p.insertionMode = IN_FRAMESET_MODE; } - return crc ^ -1; } - module2.exports = function crc32wrapper(input, crc) { - if (typeof input === "undefined" || !input.length) { - return 0; + function addressStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) { + p._closePElement(); } - var isArray = utils.getTypeOf(input) !== "string"; - if (isArray) { - return crc32(crc | 0, input, input.length, 0); - } else { - return crc32str(crc | 0, input, input.length, 0); + p._insertElement(token, NS.HTML); + } + function numberedHeaderStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) { + p._closePElement(); } - }; - } -}); - -// node_modules/jszip/lib/stream/Crc32Probe.js -var require_Crc32Probe = __commonJS({ - "node_modules/jszip/lib/stream/Crc32Probe.js"(exports2, module2) { - init_shims(); - "use strict"; - var GenericWorker = require_GenericWorker(); - var crc32 = require_crc32(); - var utils = require_utils2(); - function Crc32Probe() { - GenericWorker.call(this, "Crc32Probe"); - this.withStreamInfo("crc32", 0); - } - utils.inherits(Crc32Probe, GenericWorker); - Crc32Probe.prototype.processChunk = function(chunk) { - this.streamInfo.crc32 = crc32(chunk.data, this.streamInfo.crc32 || 0); - this.push(chunk); - }; - module2.exports = Crc32Probe; - } -}); - -// node_modules/jszip/lib/stream/DataLengthProbe.js -var require_DataLengthProbe = __commonJS({ - "node_modules/jszip/lib/stream/DataLengthProbe.js"(exports2, module2) { - init_shims(); - "use strict"; - var utils = require_utils2(); - var GenericWorker = require_GenericWorker(); - function DataLengthProbe(propName) { - GenericWorker.call(this, "DataLengthProbe for " + propName); - this.propName = propName; - this.withStreamInfo(propName, 0); - } - utils.inherits(DataLengthProbe, GenericWorker); - DataLengthProbe.prototype.processChunk = function(chunk) { - if (chunk) { - var length = this.streamInfo[this.propName] || 0; - this.streamInfo[this.propName] = length + chunk.data.length; - } - GenericWorker.prototype.processChunk.call(this, chunk); - }; - module2.exports = DataLengthProbe; - } -}); - -// node_modules/jszip/lib/compressedObject.js -var require_compressedObject = __commonJS({ - "node_modules/jszip/lib/compressedObject.js"(exports2, module2) { - init_shims(); - "use strict"; - var external = require_external(); - var DataWorker = require_DataWorker(); - var Crc32Probe = require_Crc32Probe(); - var DataLengthProbe = require_DataLengthProbe(); - function CompressedObject(compressedSize, uncompressedSize, crc32, compression, data) { - this.compressedSize = compressedSize; - this.uncompressedSize = uncompressedSize; - this.crc32 = crc32; - this.compression = compression; - this.compressedContent = data; - } - CompressedObject.prototype = { - getContentWorker: function() { - var worker = new DataWorker(external.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new DataLengthProbe("data_length")); - var that = this; - worker.on("end", function() { - if (this.streamInfo["data_length"] !== that.uncompressedSize) { - throw new Error("Bug : uncompressed data size mismatch"); - } - }); - return worker; - }, - getCompressedWorker: function() { - return new DataWorker(external.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression); + const tn = p.openElements.currentTagName; + if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) { + p.openElements.pop(); } - }; - CompressedObject.createWorkerFrom = function(uncompressedWorker, compression, compressionOptions) { - return uncompressedWorker.pipe(new Crc32Probe()).pipe(new DataLengthProbe("uncompressedSize")).pipe(compression.compressWorker(compressionOptions)).pipe(new DataLengthProbe("compressedSize")).withStreamInfo("compression", compression); - }; - module2.exports = CompressedObject; - } -}); - -// node_modules/jszip/lib/zipObject.js -var require_zipObject = __commonJS({ - "node_modules/jszip/lib/zipObject.js"(exports2, module2) { - init_shims(); - "use strict"; - var StreamHelper = require_StreamHelper(); - var DataWorker = require_DataWorker(); - var utf8 = require_utf8(); - var CompressedObject = require_compressedObject(); - var GenericWorker = require_GenericWorker(); - var ZipObject = function(name, data, options2) { - this.name = name; - this.dir = options2.dir; - this.date = options2.date; - this.comment = options2.comment; - this.unixPermissions = options2.unixPermissions; - this.dosPermissions = options2.dosPermissions; - this._data = data; - this._dataBinary = options2.binary; - this.options = { - compression: options2.compression, - compressionOptions: options2.compressionOptions - }; - }; - ZipObject.prototype = { - internalStream: function(type) { - var result = null, outputType = "string"; - try { - if (!type) { - throw new Error("No output type specified."); - } - outputType = type.toLowerCase(); - var askUnicodeString = outputType === "string" || outputType === "text"; - if (outputType === "binarystring" || outputType === "text") { - outputType = "string"; - } - result = this._decompressWorker(); - var isUnicodeString = !this._dataBinary; - if (isUnicodeString && !askUnicodeString) { - result = result.pipe(new utf8.Utf8EncodeWorker()); - } - if (!isUnicodeString && askUnicodeString) { - result = result.pipe(new utf8.Utf8DecodeWorker()); - } - } catch (e) { - result = new GenericWorker("error"); - result.error(e); - } - return new StreamHelper(result, outputType, ""); - }, - async: function(type, onUpdate) { - return this.internalStream(type).accumulate(onUpdate); - }, - nodeStream: function(type, onUpdate) { - return this.internalStream(type || "nodebuffer").toNodejsStream(onUpdate); - }, - _compressWorker: function(compression, compressionOptions) { - if (this._data instanceof CompressedObject && this._data.compression.magic === compression.magic) { - return this._data.getCompressedWorker(); - } else { - var result = this._decompressWorker(); - if (!this._dataBinary) { - result = result.pipe(new utf8.Utf8EncodeWorker()); - } - return CompressedObject.createWorkerFrom(result, compression, compressionOptions); + p._insertElement(token, NS.HTML); + } + function preStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) { + p._closePElement(); + } + p._insertElement(token, NS.HTML); + p.skipNextNewLine = true; + p.framesetOk = false; + } + function formStartTagInBody(p, token) { + const inTemplate = p.openElements.tmplCount > 0; + if (!p.formElement || inTemplate) { + if (p.openElements.hasInButtonScope($.P)) { + p._closePElement(); } - }, - _decompressWorker: function() { - if (this._data instanceof CompressedObject) { - return this._data.getContentWorker(); - } else if (this._data instanceof GenericWorker) { - return this._data; - } else { - return new DataWorker(this._data); + p._insertElement(token, NS.HTML); + if (!inTemplate) { + p.formElement = p.openElements.current; } } - }; - var removedMethods = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"]; - var removedFn = function() { - throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); - }; - for (var i = 0; i < removedMethods.length; i++) { - ZipObject.prototype[removedMethods[i]] = removedFn; - } - module2.exports = ZipObject; - } -}); - -// node_modules/pako/lib/utils/common.js -var require_common2 = __commonJS({ - "node_modules/pako/lib/utils/common.js"(exports2) { - init_shims(); - "use strict"; - var TYPED_OK = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined"; - function _has(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); } - exports2.assign = function(obj) { - var sources = Array.prototype.slice.call(arguments, 1); - while (sources.length) { - var source = sources.shift(); - if (!source) { - continue; + function listItemStartTagInBody(p, token) { + p.framesetOk = false; + const tn = token.tagName; + for (let i = p.openElements.stackTop; i >= 0; i--) { + const element = p.openElements.items[i]; + const elementTn = p.treeAdapter.getTagName(element); + let closeTn = null; + if (tn === $.LI && elementTn === $.LI) { + closeTn = $.LI; + } else if ((tn === $.DD || tn === $.DT) && (elementTn === $.DD || elementTn === $.DT)) { + closeTn = elementTn; } - if (typeof source !== "object") { - throw new TypeError(source + "must be non-object"); + if (closeTn) { + p.openElements.generateImpliedEndTagsWithExclusion(closeTn); + p.openElements.popUntilTagNamePopped(closeTn); + break; } - for (var p in source) { - if (_has(source, p)) { - obj[p] = source[p]; - } + if (elementTn !== $.ADDRESS && elementTn !== $.DIV && elementTn !== $.P && p._isSpecialElement(element)) { + break; } } - return obj; - }; - exports2.shrinkBuf = function(buf, size) { - if (buf.length === size) { - return buf; + if (p.openElements.hasInButtonScope($.P)) { + p._closePElement(); + } + p._insertElement(token, NS.HTML); + } + function plaintextStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) { + p._closePElement(); + } + p._insertElement(token, NS.HTML); + p.tokenizer.state = Tokenizer.MODE.PLAINTEXT; + } + function buttonStartTagInBody(p, token) { + if (p.openElements.hasInScope($.BUTTON)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped($.BUTTON); + } + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.framesetOk = false; + } + function aStartTagInBody(p, token) { + const activeElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName($.A); + if (activeElementEntry) { + callAdoptionAgency(p, token); + p.openElements.remove(activeElementEntry.element); + p.activeFormattingElements.removeEntry(activeElementEntry); + } + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.activeFormattingElements.pushElement(p.openElements.current, token); + } + function bStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.activeFormattingElements.pushElement(p.openElements.current, token); + } + function nobrStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + if (p.openElements.hasInScope($.NOBR)) { + callAdoptionAgency(p, token); + p._reconstructActiveFormattingElements(); + } + p._insertElement(token, NS.HTML); + p.activeFormattingElements.pushElement(p.openElements.current, token); + } + function appletStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.activeFormattingElements.insertMarker(); + p.framesetOk = false; + } + function tableStartTagInBody(p, token) { + if (p.treeAdapter.getDocumentMode(p.document) !== HTML.DOCUMENT_MODE.QUIRKS && p.openElements.hasInButtonScope($.P)) { + p._closePElement(); + } + p._insertElement(token, NS.HTML); + p.framesetOk = false; + p.insertionMode = IN_TABLE_MODE; + } + function areaStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._appendElement(token, NS.HTML); + p.framesetOk = false; + token.ackSelfClosing = true; + } + function inputStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._appendElement(token, NS.HTML); + const inputType = Tokenizer.getTokenAttr(token, ATTRS.TYPE); + if (!inputType || inputType.toLowerCase() !== HIDDEN_INPUT_TYPE) { + p.framesetOk = false; + } + token.ackSelfClosing = true; + } + function paramStartTagInBody(p, token) { + p._appendElement(token, NS.HTML); + token.ackSelfClosing = true; + } + function hrStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) { + p._closePElement(); + } + p._appendElement(token, NS.HTML); + p.framesetOk = false; + token.ackSelfClosing = true; + } + function imageStartTagInBody(p, token) { + token.tagName = $.IMG; + areaStartTagInBody(p, token); + } + function textareaStartTagInBody(p, token) { + p._insertElement(token, NS.HTML); + p.skipNextNewLine = true; + p.tokenizer.state = Tokenizer.MODE.RCDATA; + p.originalInsertionMode = p.insertionMode; + p.framesetOk = false; + p.insertionMode = TEXT_MODE; + } + function xmpStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) { + p._closePElement(); + } + p._reconstructActiveFormattingElements(); + p.framesetOk = false; + p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT); + } + function iframeStartTagInBody(p, token) { + p.framesetOk = false; + p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT); + } + function noembedStartTagInBody(p, token) { + p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT); + } + function selectStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + p.framesetOk = false; + if (p.insertionMode === IN_TABLE_MODE || p.insertionMode === IN_CAPTION_MODE || p.insertionMode === IN_TABLE_BODY_MODE || p.insertionMode === IN_ROW_MODE || p.insertionMode === IN_CELL_MODE) { + p.insertionMode = IN_SELECT_IN_TABLE_MODE; + } else { + p.insertionMode = IN_SELECT_MODE; } - if (buf.subarray) { - return buf.subarray(0, size); + } + function optgroupStartTagInBody(p, token) { + if (p.openElements.currentTagName === $.OPTION) { + p.openElements.pop(); } - buf.length = size; - return buf; - }; - var fnTyped = { - arraySet: function(dest, src2, src_offs, len, dest_offs) { - if (src2.subarray && dest.subarray) { - dest.set(src2.subarray(src_offs, src_offs + len), dest_offs); - return; - } - for (var i = 0; i < len; i++) { - dest[dest_offs + i] = src2[src_offs + i]; - } - }, - flattenChunks: function(chunks) { - var i, l, len, pos, chunk, result; - len = 0; - for (i = 0, l = chunks.length; i < l; i++) { - len += chunks[i].length; - } - result = new Uint8Array(len); - pos = 0; - for (i = 0, l = chunks.length; i < l; i++) { - chunk = chunks[i]; - result.set(chunk, pos); - pos += chunk.length; - } - return result; + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + } + function rbStartTagInBody(p, token) { + if (p.openElements.hasInScope($.RUBY)) { + p.openElements.generateImpliedEndTags(); } - }; - var fnUntyped = { - arraySet: function(dest, src2, src_offs, len, dest_offs) { - for (var i = 0; i < len; i++) { - dest[dest_offs + i] = src2[src_offs + i]; - } - }, - flattenChunks: function(chunks) { - return [].concat.apply([], chunks); + p._insertElement(token, NS.HTML); + } + function rtStartTagInBody(p, token) { + if (p.openElements.hasInScope($.RUBY)) { + p.openElements.generateImpliedEndTagsWithExclusion($.RTC); } - }; - exports2.setTyped = function(on) { - if (on) { - exports2.Buf8 = Uint8Array; - exports2.Buf16 = Uint16Array; - exports2.Buf32 = Int32Array; - exports2.assign(exports2, fnTyped); - } else { - exports2.Buf8 = Array; - exports2.Buf16 = Array; - exports2.Buf32 = Array; - exports2.assign(exports2, fnUntyped); + p._insertElement(token, NS.HTML); + } + function menuStartTagInBody(p, token) { + if (p.openElements.hasInButtonScope($.P)) { + p._closePElement(); } - }; - exports2.setTyped(TYPED_OK); - } -}); - -// node_modules/pako/lib/zlib/trees.js -var require_trees = __commonJS({ - "node_modules/pako/lib/zlib/trees.js"(exports2) { - init_shims(); - "use strict"; - var utils = require_common2(); - var Z_FIXED = 4; - var Z_BINARY = 0; - var Z_TEXT = 1; - var Z_UNKNOWN = 2; - function zero(buf) { - var len = buf.length; - while (--len >= 0) { - buf[len] = 0; - } - } - var STORED_BLOCK = 0; - var STATIC_TREES = 1; - var DYN_TREES = 2; - var MIN_MATCH = 3; - var MAX_MATCH = 258; - var LENGTH_CODES = 29; - var LITERALS = 256; - var L_CODES = LITERALS + 1 + LENGTH_CODES; - var D_CODES = 30; - var BL_CODES = 19; - var HEAP_SIZE = 2 * L_CODES + 1; - var MAX_BITS = 15; - var Buf_size = 16; - var MAX_BL_BITS = 7; - var END_BLOCK = 256; - var REP_3_6 = 16; - var REPZ_3_10 = 17; - var REPZ_11_138 = 18; - var extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]; - var extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]; - var extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]; - var bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; - var DIST_CODE_LEN = 512; - var static_ltree = new Array((L_CODES + 2) * 2); - zero(static_ltree); - var static_dtree = new Array(D_CODES * 2); - zero(static_dtree); - var _dist_code = new Array(DIST_CODE_LEN); - zero(_dist_code); - var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); - zero(_length_code); - var base_length = new Array(LENGTH_CODES); - zero(base_length); - var base_dist = new Array(D_CODES); - zero(base_dist); - function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { - this.static_tree = static_tree; - this.extra_bits = extra_bits; - this.extra_base = extra_base; - this.elems = elems; - this.max_length = max_length; - this.has_stree = static_tree && static_tree.length; - } - var static_l_desc; - var static_d_desc; - var static_bl_desc; - function TreeDesc(dyn_tree, stat_desc) { - this.dyn_tree = dyn_tree; - this.max_code = 0; - this.stat_desc = stat_desc; - } - function d_code(dist) { - return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; - } - function put_short(s2, w) { - s2.pending_buf[s2.pending++] = w & 255; - s2.pending_buf[s2.pending++] = w >>> 8 & 255; - } - function send_bits(s2, value, length) { - if (s2.bi_valid > Buf_size - length) { - s2.bi_buf |= value << s2.bi_valid & 65535; - put_short(s2, s2.bi_buf); - s2.bi_buf = value >> Buf_size - s2.bi_valid; - s2.bi_valid += length - Buf_size; + p._insertElement(token, NS.HTML); + } + function mathStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + foreignContent.adjustTokenMathMLAttrs(token); + foreignContent.adjustTokenXMLAttrs(token); + if (token.selfClosing) { + p._appendElement(token, NS.MATHML); } else { - s2.bi_buf |= value << s2.bi_valid & 65535; - s2.bi_valid += length; - } - } - function send_code(s2, c, tree) { - send_bits(s2, tree[c * 2], tree[c * 2 + 1]); - } - function bi_reverse(code, len) { - var res2 = 0; - do { - res2 |= code & 1; - code >>>= 1; - res2 <<= 1; - } while (--len > 0); - return res2 >>> 1; - } - function bi_flush(s2) { - if (s2.bi_valid === 16) { - put_short(s2, s2.bi_buf); - s2.bi_buf = 0; - s2.bi_valid = 0; - } else if (s2.bi_valid >= 8) { - s2.pending_buf[s2.pending++] = s2.bi_buf & 255; - s2.bi_buf >>= 8; - s2.bi_valid -= 8; - } - } - function gen_bitlen(s2, desc) { - var tree = desc.dyn_tree; - var max_code = desc.max_code; - var stree = desc.stat_desc.static_tree; - var has_stree = desc.stat_desc.has_stree; - var extra = desc.stat_desc.extra_bits; - var base2 = desc.stat_desc.extra_base; - var max_length = desc.stat_desc.max_length; - var h; - var n, m; - var bits; - var xbits; - var f; - var overflow = 0; - for (bits = 0; bits <= MAX_BITS; bits++) { - s2.bl_count[bits] = 0; - } - tree[s2.heap[s2.heap_max] * 2 + 1] = 0; - for (h = s2.heap_max + 1; h < HEAP_SIZE; h++) { - n = s2.heap[h]; - bits = tree[tree[n * 2 + 1] * 2 + 1] + 1; - if (bits > max_length) { - bits = max_length; - overflow++; - } - tree[n * 2 + 1] = bits; - if (n > max_code) { - continue; - } - s2.bl_count[bits]++; - xbits = 0; - if (n >= base2) { - xbits = extra[n - base2]; - } - f = tree[n * 2]; - s2.opt_len += f * (bits + xbits); - if (has_stree) { - s2.static_len += f * (stree[n * 2 + 1] + xbits); - } + p._insertElement(token, NS.MATHML); } - if (overflow === 0) { - return; + token.ackSelfClosing = true; + } + function svgStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + foreignContent.adjustTokenSVGAttrs(token); + foreignContent.adjustTokenXMLAttrs(token); + if (token.selfClosing) { + p._appendElement(token, NS.SVG); + } else { + p._insertElement(token, NS.SVG); } - do { - bits = max_length - 1; - while (s2.bl_count[bits] === 0) { - bits--; - } - s2.bl_count[bits]--; - s2.bl_count[bits + 1] += 2; - s2.bl_count[max_length]--; - overflow -= 2; - } while (overflow > 0); - for (bits = max_length; bits !== 0; bits--) { - n = s2.bl_count[bits]; - while (n !== 0) { - m = s2.heap[--h]; - if (m > max_code) { - continue; + token.ackSelfClosing = true; + } + function genericStartTagInBody(p, token) { + p._reconstructActiveFormattingElements(); + p._insertElement(token, NS.HTML); + } + function startTagInBody(p, token) { + const tn = token.tagName; + switch (tn.length) { + case 1: + if (tn === $.I || tn === $.S || tn === $.B || tn === $.U) { + bStartTagInBody(p, token); + } else if (tn === $.P) { + addressStartTagInBody(p, token); + } else if (tn === $.A) { + aStartTagInBody(p, token); + } else { + genericStartTagInBody(p, token); } - if (tree[m * 2 + 1] !== bits) { - s2.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2]; - tree[m * 2 + 1] = bits; + break; + case 2: + if (tn === $.DL || tn === $.OL || tn === $.UL) { + addressStartTagInBody(p, token); + } else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) { + numberedHeaderStartTagInBody(p, token); + } else if (tn === $.LI || tn === $.DD || tn === $.DT) { + listItemStartTagInBody(p, token); + } else if (tn === $.EM || tn === $.TT) { + bStartTagInBody(p, token); + } else if (tn === $.BR) { + areaStartTagInBody(p, token); + } else if (tn === $.HR) { + hrStartTagInBody(p, token); + } else if (tn === $.RB) { + rbStartTagInBody(p, token); + } else if (tn === $.RT || tn === $.RP) { + rtStartTagInBody(p, token); + } else if (tn !== $.TH && tn !== $.TD && tn !== $.TR) { + genericStartTagInBody(p, token); } - n--; - } - } - } - function gen_codes(tree, max_code, bl_count) { - var next_code = new Array(MAX_BITS + 1); - var code = 0; - var bits; - var n; - for (bits = 1; bits <= MAX_BITS; bits++) { - next_code[bits] = code = code + bl_count[bits - 1] << 1; - } - for (n = 0; n <= max_code; n++) { - var len = tree[n * 2 + 1]; - if (len === 0) { - continue; - } - tree[n * 2] = bi_reverse(next_code[len]++, len); - } - } - function tr_static_init() { - var n; - var bits; - var length; - var code; - var dist; - var bl_count = new Array(MAX_BITS + 1); - length = 0; - for (code = 0; code < LENGTH_CODES - 1; code++) { - base_length[code] = length; - for (n = 0; n < 1 << extra_lbits[code]; n++) { - _length_code[length++] = code; - } - } - _length_code[length - 1] = code; - dist = 0; - for (code = 0; code < 16; code++) { - base_dist[code] = dist; - for (n = 0; n < 1 << extra_dbits[code]; n++) { - _dist_code[dist++] = code; - } - } - dist >>= 7; - for (; code < D_CODES; code++) { - base_dist[code] = dist << 7; - for (n = 0; n < 1 << extra_dbits[code] - 7; n++) { - _dist_code[256 + dist++] = code; - } - } - for (bits = 0; bits <= MAX_BITS; bits++) { - bl_count[bits] = 0; - } - n = 0; - while (n <= 143) { - static_ltree[n * 2 + 1] = 8; - n++; - bl_count[8]++; - } - while (n <= 255) { - static_ltree[n * 2 + 1] = 9; - n++; - bl_count[9]++; - } - while (n <= 279) { - static_ltree[n * 2 + 1] = 7; - n++; - bl_count[7]++; - } - while (n <= 287) { - static_ltree[n * 2 + 1] = 8; - n++; - bl_count[8]++; - } - gen_codes(static_ltree, L_CODES + 1, bl_count); - for (n = 0; n < D_CODES; n++) { - static_dtree[n * 2 + 1] = 5; - static_dtree[n * 2] = bi_reverse(n, 5); - } - static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); - static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); - static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); - } - function init_block(s2) { - var n; - for (n = 0; n < L_CODES; n++) { - s2.dyn_ltree[n * 2] = 0; - } - for (n = 0; n < D_CODES; n++) { - s2.dyn_dtree[n * 2] = 0; - } - for (n = 0; n < BL_CODES; n++) { - s2.bl_tree[n * 2] = 0; - } - s2.dyn_ltree[END_BLOCK * 2] = 1; - s2.opt_len = s2.static_len = 0; - s2.last_lit = s2.matches = 0; - } - function bi_windup(s2) { - if (s2.bi_valid > 8) { - put_short(s2, s2.bi_buf); - } else if (s2.bi_valid > 0) { - s2.pending_buf[s2.pending++] = s2.bi_buf; - } - s2.bi_buf = 0; - s2.bi_valid = 0; - } - function copy_block(s2, buf, len, header) { - bi_windup(s2); - if (header) { - put_short(s2, len); - put_short(s2, ~len); - } - utils.arraySet(s2.pending_buf, s2.window, buf, len, s2.pending); - s2.pending += len; - } - function smaller(tree, n, m, depth) { - var _n2 = n * 2; - var _m2 = m * 2; - return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m]; - } - function pqdownheap(s2, tree, k) { - var v = s2.heap[k]; - var j = k << 1; - while (j <= s2.heap_len) { - if (j < s2.heap_len && smaller(tree, s2.heap[j + 1], s2.heap[j], s2.depth)) { - j++; - } - if (smaller(tree, v, s2.heap[j], s2.depth)) { break; - } - s2.heap[k] = s2.heap[j]; - k = j; - j <<= 1; - } - s2.heap[k] = v; - } - function compress_block(s2, ltree, dtree) { - var dist; - var lc; - var lx = 0; - var code; - var extra; - if (s2.last_lit !== 0) { - do { - dist = s2.pending_buf[s2.d_buf + lx * 2] << 8 | s2.pending_buf[s2.d_buf + lx * 2 + 1]; - lc = s2.pending_buf[s2.l_buf + lx]; - lx++; - if (dist === 0) { - send_code(s2, lc, ltree); + case 3: + if (tn === $.DIV || tn === $.DIR || tn === $.NAV) { + addressStartTagInBody(p, token); + } else if (tn === $.PRE) { + preStartTagInBody(p, token); + } else if (tn === $.BIG) { + bStartTagInBody(p, token); + } else if (tn === $.IMG || tn === $.WBR) { + areaStartTagInBody(p, token); + } else if (tn === $.XMP) { + xmpStartTagInBody(p, token); + } else if (tn === $.SVG) { + svgStartTagInBody(p, token); + } else if (tn === $.RTC) { + rbStartTagInBody(p, token); + } else if (tn !== $.COL) { + genericStartTagInBody(p, token); + } + break; + case 4: + if (tn === $.HTML) { + htmlStartTagInBody(p, token); + } else if (tn === $.BASE || tn === $.LINK || tn === $.META) { + startTagInHead(p, token); + } else if (tn === $.BODY) { + bodyStartTagInBody(p, token); + } else if (tn === $.MAIN || tn === $.MENU) { + addressStartTagInBody(p, token); + } else if (tn === $.FORM) { + formStartTagInBody(p, token); + } else if (tn === $.CODE || tn === $.FONT) { + bStartTagInBody(p, token); + } else if (tn === $.NOBR) { + nobrStartTagInBody(p, token); + } else if (tn === $.AREA) { + areaStartTagInBody(p, token); + } else if (tn === $.MATH) { + mathStartTagInBody(p, token); + } else if (tn === $.MENU) { + menuStartTagInBody(p, token); + } else if (tn !== $.HEAD) { + genericStartTagInBody(p, token); + } + break; + case 5: + if (tn === $.STYLE || tn === $.TITLE) { + startTagInHead(p, token); + } else if (tn === $.ASIDE) { + addressStartTagInBody(p, token); + } else if (tn === $.SMALL) { + bStartTagInBody(p, token); + } else if (tn === $.TABLE) { + tableStartTagInBody(p, token); + } else if (tn === $.EMBED) { + areaStartTagInBody(p, token); + } else if (tn === $.INPUT) { + inputStartTagInBody(p, token); + } else if (tn === $.PARAM || tn === $.TRACK) { + paramStartTagInBody(p, token); + } else if (tn === $.IMAGE) { + imageStartTagInBody(p, token); + } else if (tn !== $.FRAME && tn !== $.TBODY && tn !== $.TFOOT && tn !== $.THEAD) { + genericStartTagInBody(p, token); + } + break; + case 6: + if (tn === $.SCRIPT) { + startTagInHead(p, token); + } else if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP || tn === $.DIALOG) { + addressStartTagInBody(p, token); + } else if (tn === $.BUTTON) { + buttonStartTagInBody(p, token); + } else if (tn === $.STRIKE || tn === $.STRONG) { + bStartTagInBody(p, token); + } else if (tn === $.APPLET || tn === $.OBJECT) { + appletStartTagInBody(p, token); + } else if (tn === $.KEYGEN) { + areaStartTagInBody(p, token); + } else if (tn === $.SOURCE) { + paramStartTagInBody(p, token); + } else if (tn === $.IFRAME) { + iframeStartTagInBody(p, token); + } else if (tn === $.SELECT) { + selectStartTagInBody(p, token); + } else if (tn === $.OPTION) { + optgroupStartTagInBody(p, token); } else { - code = _length_code[lc]; - send_code(s2, code + LITERALS + 1, ltree); - extra = extra_lbits[code]; - if (extra !== 0) { - lc -= base_length[code]; - send_bits(s2, lc, extra); - } - dist--; - code = d_code(dist); - send_code(s2, code, dtree); - extra = extra_dbits[code]; - if (extra !== 0) { - dist -= base_dist[code]; - send_bits(s2, dist, extra); + genericStartTagInBody(p, token); + } + break; + case 7: + if (tn === $.BGSOUND) { + startTagInHead(p, token); + } else if (tn === $.DETAILS || tn === $.ADDRESS || tn === $.ARTICLE || tn === $.SECTION || tn === $.SUMMARY) { + addressStartTagInBody(p, token); + } else if (tn === $.LISTING) { + preStartTagInBody(p, token); + } else if (tn === $.MARQUEE) { + appletStartTagInBody(p, token); + } else if (tn === $.NOEMBED) { + noembedStartTagInBody(p, token); + } else if (tn !== $.CAPTION) { + genericStartTagInBody(p, token); + } + break; + case 8: + if (tn === $.BASEFONT) { + startTagInHead(p, token); + } else if (tn === $.FRAMESET) { + framesetStartTagInBody(p, token); + } else if (tn === $.FIELDSET) { + addressStartTagInBody(p, token); + } else if (tn === $.TEXTAREA) { + textareaStartTagInBody(p, token); + } else if (tn === $.TEMPLATE) { + startTagInHead(p, token); + } else if (tn === $.NOSCRIPT) { + if (p.options.scriptingEnabled) { + noembedStartTagInBody(p, token); + } else { + genericStartTagInBody(p, token); } + } else if (tn === $.OPTGROUP) { + optgroupStartTagInBody(p, token); + } else if (tn !== $.COLGROUP) { + genericStartTagInBody(p, token); } - } while (lx < s2.last_lit); - } - send_code(s2, END_BLOCK, ltree); - } - function build_tree(s2, desc) { - var tree = desc.dyn_tree; - var stree = desc.stat_desc.static_tree; - var has_stree = desc.stat_desc.has_stree; - var elems = desc.stat_desc.elems; - var n, m; - var max_code = -1; - var node; - s2.heap_len = 0; - s2.heap_max = HEAP_SIZE; - for (n = 0; n < elems; n++) { - if (tree[n * 2] !== 0) { - s2.heap[++s2.heap_len] = max_code = n; - s2.depth[n] = 0; - } else { - tree[n * 2 + 1] = 0; - } - } - while (s2.heap_len < 2) { - node = s2.heap[++s2.heap_len] = max_code < 2 ? ++max_code : 0; - tree[node * 2] = 1; - s2.depth[node] = 0; - s2.opt_len--; - if (has_stree) { - s2.static_len -= stree[node * 2 + 1]; - } - } - desc.max_code = max_code; - for (n = s2.heap_len >> 1; n >= 1; n--) { - pqdownheap(s2, tree, n); - } - node = elems; - do { - n = s2.heap[1]; - s2.heap[1] = s2.heap[s2.heap_len--]; - pqdownheap(s2, tree, 1); - m = s2.heap[1]; - s2.heap[--s2.heap_max] = n; - s2.heap[--s2.heap_max] = m; - tree[node * 2] = tree[n * 2] + tree[m * 2]; - s2.depth[node] = (s2.depth[n] >= s2.depth[m] ? s2.depth[n] : s2.depth[m]) + 1; - tree[n * 2 + 1] = tree[m * 2 + 1] = node; - s2.heap[1] = node++; - pqdownheap(s2, tree, 1); - } while (s2.heap_len >= 2); - s2.heap[--s2.heap_max] = s2.heap[1]; - gen_bitlen(s2, desc); - gen_codes(tree, max_code, s2.bl_count); - } - function scan_tree(s2, tree, max_code) { - var n; - var prevlen = -1; - var curlen; - var nextlen = tree[0 * 2 + 1]; - var count = 0; - var max_count = 7; - var min_count = 4; - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } - tree[(max_code + 1) * 2 + 1] = 65535; - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[(n + 1) * 2 + 1]; - if (++count < max_count && curlen === nextlen) { - continue; - } else if (count < min_count) { - s2.bl_tree[curlen * 2] += count; - } else if (curlen !== 0) { - if (curlen !== prevlen) { - s2.bl_tree[curlen * 2]++; - } - s2.bl_tree[REP_3_6 * 2]++; - } else if (count <= 10) { - s2.bl_tree[REPZ_3_10 * 2]++; - } else { - s2.bl_tree[REPZ_11_138 * 2]++; - } - count = 0; - prevlen = curlen; - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } else if (curlen === nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } - } - } - function send_tree(s2, tree, max_code) { - var n; - var prevlen = -1; - var curlen; - var nextlen = tree[0 * 2 + 1]; - var count = 0; - var max_count = 7; - var min_count = 4; - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[(n + 1) * 2 + 1]; - if (++count < max_count && curlen === nextlen) { - continue; - } else if (count < min_count) { - do { - send_code(s2, curlen, s2.bl_tree); - } while (--count !== 0); - } else if (curlen !== 0) { - if (curlen !== prevlen) { - send_code(s2, curlen, s2.bl_tree); - count--; - } - send_code(s2, REP_3_6, s2.bl_tree); - send_bits(s2, count - 3, 2); - } else if (count <= 10) { - send_code(s2, REPZ_3_10, s2.bl_tree); - send_bits(s2, count - 3, 3); - } else { - send_code(s2, REPZ_11_138, s2.bl_tree); - send_bits(s2, count - 11, 7); - } - count = 0; - prevlen = curlen; - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } else if (curlen === nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } + break; + case 9: + if (tn === $.PLAINTEXT) { + plaintextStartTagInBody(p, token); + } else { + genericStartTagInBody(p, token); + } + break; + case 10: + if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION) { + addressStartTagInBody(p, token); + } else { + genericStartTagInBody(p, token); + } + break; + default: + genericStartTagInBody(p, token); } } - function build_bl_tree(s2) { - var max_blindex; - scan_tree(s2, s2.dyn_ltree, s2.l_desc.max_code); - scan_tree(s2, s2.dyn_dtree, s2.d_desc.max_code); - build_tree(s2, s2.bl_desc); - for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { - if (s2.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0) { - break; - } + function bodyEndTagInBody(p) { + if (p.openElements.hasInScope($.BODY)) { + p.insertionMode = AFTER_BODY_MODE; } - s2.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; - return max_blindex; } - function send_all_trees(s2, lcodes, dcodes, blcodes) { - var rank; - send_bits(s2, lcodes - 257, 5); - send_bits(s2, dcodes - 1, 5); - send_bits(s2, blcodes - 4, 4); - for (rank = 0; rank < blcodes; rank++) { - send_bits(s2, s2.bl_tree[bl_order[rank] * 2 + 1], 3); + function htmlEndTagInBody(p, token) { + if (p.openElements.hasInScope($.BODY)) { + p.insertionMode = AFTER_BODY_MODE; + p._processToken(token); } - send_tree(s2, s2.dyn_ltree, lcodes - 1); - send_tree(s2, s2.dyn_dtree, dcodes - 1); } - function detect_data_type(s2) { - var black_mask = 4093624447; - var n; - for (n = 0; n <= 31; n++, black_mask >>>= 1) { - if (black_mask & 1 && s2.dyn_ltree[n * 2] !== 0) { - return Z_BINARY; - } + function addressEndTagInBody(p, token) { + const tn = token.tagName; + if (p.openElements.hasInScope(tn)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped(tn); } - if (s2.dyn_ltree[9 * 2] !== 0 || s2.dyn_ltree[10 * 2] !== 0 || s2.dyn_ltree[13 * 2] !== 0) { - return Z_TEXT; + } + function formEndTagInBody(p) { + const inTemplate = p.openElements.tmplCount > 0; + const formElement = p.formElement; + if (!inTemplate) { + p.formElement = null; } - for (n = 32; n < LITERALS; n++) { - if (s2.dyn_ltree[n * 2] !== 0) { - return Z_TEXT; + if ((formElement || inTemplate) && p.openElements.hasInScope($.FORM)) { + p.openElements.generateImpliedEndTags(); + if (inTemplate) { + p.openElements.popUntilTagNamePopped($.FORM); + } else { + p.openElements.remove(formElement); } } - return Z_BINARY; } - var static_init_done = false; - function _tr_init(s2) { - if (!static_init_done) { - tr_static_init(); - static_init_done = true; + function pEndTagInBody(p) { + if (!p.openElements.hasInButtonScope($.P)) { + p._insertFakeElement($.P); } - s2.l_desc = new TreeDesc(s2.dyn_ltree, static_l_desc); - s2.d_desc = new TreeDesc(s2.dyn_dtree, static_d_desc); - s2.bl_desc = new TreeDesc(s2.bl_tree, static_bl_desc); - s2.bi_buf = 0; - s2.bi_valid = 0; - init_block(s2); - } - function _tr_stored_block(s2, buf, stored_len, last) { - send_bits(s2, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); - copy_block(s2, buf, stored_len, true); + p._closePElement(); } - function _tr_align(s2) { - send_bits(s2, STATIC_TREES << 1, 3); - send_code(s2, END_BLOCK, static_ltree); - bi_flush(s2); - } - function _tr_flush_block(s2, buf, stored_len, last) { - var opt_lenb, static_lenb; - var max_blindex = 0; - if (s2.level > 0) { - if (s2.strm.data_type === Z_UNKNOWN) { - s2.strm.data_type = detect_data_type(s2); - } - build_tree(s2, s2.l_desc); - build_tree(s2, s2.d_desc); - max_blindex = build_bl_tree(s2); - opt_lenb = s2.opt_len + 3 + 7 >>> 3; - static_lenb = s2.static_len + 3 + 7 >>> 3; - if (static_lenb <= opt_lenb) { - opt_lenb = static_lenb; - } - } else { - opt_lenb = static_lenb = stored_len + 5; - } - if (stored_len + 4 <= opt_lenb && buf !== -1) { - _tr_stored_block(s2, buf, stored_len, last); - } else if (s2.strategy === Z_FIXED || static_lenb === opt_lenb) { - send_bits(s2, (STATIC_TREES << 1) + (last ? 1 : 0), 3); - compress_block(s2, static_ltree, static_dtree); - } else { - send_bits(s2, (DYN_TREES << 1) + (last ? 1 : 0), 3); - send_all_trees(s2, s2.l_desc.max_code + 1, s2.d_desc.max_code + 1, max_blindex + 1); - compress_block(s2, s2.dyn_ltree, s2.dyn_dtree); - } - init_block(s2); - if (last) { - bi_windup(s2); - } - } - function _tr_tally(s2, dist, lc) { - s2.pending_buf[s2.d_buf + s2.last_lit * 2] = dist >>> 8 & 255; - s2.pending_buf[s2.d_buf + s2.last_lit * 2 + 1] = dist & 255; - s2.pending_buf[s2.l_buf + s2.last_lit] = lc & 255; - s2.last_lit++; - if (dist === 0) { - s2.dyn_ltree[lc * 2]++; - } else { - s2.matches++; - dist--; - s2.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++; - s2.dyn_dtree[d_code(dist) * 2]++; - } - return s2.last_lit === s2.lit_bufsize - 1; - } - exports2._tr_init = _tr_init; - exports2._tr_stored_block = _tr_stored_block; - exports2._tr_flush_block = _tr_flush_block; - exports2._tr_tally = _tr_tally; - exports2._tr_align = _tr_align; - } -}); - -// node_modules/pako/lib/zlib/adler32.js -var require_adler32 = __commonJS({ - "node_modules/pako/lib/zlib/adler32.js"(exports2, module2) { - init_shims(); - "use strict"; - function adler32(adler, buf, len, pos) { - var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0; - while (len !== 0) { - n = len > 2e3 ? 2e3 : len; - len -= n; - do { - s1 = s1 + buf[pos++] | 0; - s2 = s2 + s1 | 0; - } while (--n); - s1 %= 65521; - s2 %= 65521; + function liEndTagInBody(p) { + if (p.openElements.hasInListItemScope($.LI)) { + p.openElements.generateImpliedEndTagsWithExclusion($.LI); + p.openElements.popUntilTagNamePopped($.LI); } - return s1 | s2 << 16 | 0; } - module2.exports = adler32; - } -}); - -// node_modules/pako/lib/zlib/crc32.js -var require_crc322 = __commonJS({ - "node_modules/pako/lib/zlib/crc32.js"(exports2, module2) { - init_shims(); - "use strict"; - function makeTable() { - var c, table = []; - for (var n = 0; n < 256; n++) { - c = n; - for (var k = 0; k < 8; k++) { - c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1; - } - table[n] = c; + function ddEndTagInBody(p, token) { + const tn = token.tagName; + if (p.openElements.hasInScope(tn)) { + p.openElements.generateImpliedEndTagsWithExclusion(tn); + p.openElements.popUntilTagNamePopped(tn); } - return table; } - var crcTable = makeTable(); - function crc32(crc, buf, len, pos) { - var t = crcTable, end = pos + len; - crc ^= -1; - for (var i = pos; i < end; i++) { - crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255]; + function numberedHeaderEndTagInBody(p) { + if (p.openElements.hasNumberedHeaderInScope()) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilNumberedHeaderPopped(); } - return crc ^ -1; } - module2.exports = crc32; - } -}); - -// node_modules/pako/lib/zlib/messages.js -var require_messages = __commonJS({ - "node_modules/pako/lib/zlib/messages.js"(exports2, module2) { - init_shims(); - "use strict"; - module2.exports = { - 2: "need dictionary", - 1: "stream end", - 0: "", - "-1": "file error", - "-2": "stream error", - "-3": "data error", - "-4": "insufficient memory", - "-5": "buffer error", - "-6": "incompatible version" - }; - } -}); - -// node_modules/pako/lib/zlib/deflate.js -var require_deflate = __commonJS({ - "node_modules/pako/lib/zlib/deflate.js"(exports2) { - init_shims(); - "use strict"; - var utils = require_common2(); - var trees = require_trees(); - var adler32 = require_adler32(); - var crc32 = require_crc322(); - var msg = require_messages(); - var Z_NO_FLUSH = 0; - var Z_PARTIAL_FLUSH = 1; - var Z_FULL_FLUSH = 3; - var Z_FINISH = 4; - var Z_BLOCK = 5; - var Z_OK = 0; - var Z_STREAM_END = 1; - var Z_STREAM_ERROR = -2; - var Z_DATA_ERROR = -3; - var Z_BUF_ERROR = -5; - var Z_DEFAULT_COMPRESSION = -1; - var Z_FILTERED = 1; - var Z_HUFFMAN_ONLY = 2; - var Z_RLE = 3; - var Z_FIXED = 4; - var Z_DEFAULT_STRATEGY = 0; - var Z_UNKNOWN = 2; - var Z_DEFLATED = 8; - var MAX_MEM_LEVEL = 9; - var MAX_WBITS = 15; - var DEF_MEM_LEVEL = 8; - var LENGTH_CODES = 29; - var LITERALS = 256; - var L_CODES = LITERALS + 1 + LENGTH_CODES; - var D_CODES = 30; - var BL_CODES = 19; - var HEAP_SIZE = 2 * L_CODES + 1; - var MAX_BITS = 15; - var MIN_MATCH = 3; - var MAX_MATCH = 258; - var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; - var PRESET_DICT = 32; - var INIT_STATE = 42; - var EXTRA_STATE = 69; - var NAME_STATE = 73; - var COMMENT_STATE = 91; - var HCRC_STATE = 103; - var BUSY_STATE = 113; - var FINISH_STATE = 666; - var BS_NEED_MORE = 1; - var BS_BLOCK_DONE = 2; - var BS_FINISH_STARTED = 3; - var BS_FINISH_DONE = 4; - var OS_CODE = 3; - function err(strm, errorCode) { - strm.msg = msg[errorCode]; - return errorCode; - } - function rank(f) { - return (f << 1) - (f > 4 ? 9 : 0); - } - function zero(buf) { - var len = buf.length; - while (--len >= 0) { - buf[len] = 0; - } - } - function flush_pending(strm) { - var s2 = strm.state; - var len = s2.pending; - if (len > strm.avail_out) { - len = strm.avail_out; - } - if (len === 0) { - return; + function appletEndTagInBody(p, token) { + const tn = token.tagName; + if (p.openElements.hasInScope(tn)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped(tn); + p.activeFormattingElements.clearToLastMarker(); } - utils.arraySet(strm.output, s2.pending_buf, s2.pending_out, len, strm.next_out); - strm.next_out += len; - s2.pending_out += len; - strm.total_out += len; - strm.avail_out -= len; - s2.pending -= len; - if (s2.pending === 0) { - s2.pending_out = 0; - } - } - function flush_block_only(s2, last) { - trees._tr_flush_block(s2, s2.block_start >= 0 ? s2.block_start : -1, s2.strstart - s2.block_start, last); - s2.block_start = s2.strstart; - flush_pending(s2.strm); } - function put_byte(s2, b) { - s2.pending_buf[s2.pending++] = b; - } - function putShortMSB(s2, b) { - s2.pending_buf[s2.pending++] = b >>> 8 & 255; - s2.pending_buf[s2.pending++] = b & 255; - } - function read_buf(strm, buf, start, size) { - var len = strm.avail_in; - if (len > size) { - len = size; - } - if (len === 0) { - return 0; - } - strm.avail_in -= len; - utils.arraySet(buf, strm.input, strm.next_in, len, start); - if (strm.state.wrap === 1) { - strm.adler = adler32(strm.adler, buf, len, start); - } else if (strm.state.wrap === 2) { - strm.adler = crc32(strm.adler, buf, len, start); - } - strm.next_in += len; - strm.total_in += len; - return len; + function brEndTagInBody(p) { + p._reconstructActiveFormattingElements(); + p._insertFakeElement($.BR); + p.openElements.pop(); + p.framesetOk = false; } - function longest_match(s2, cur_match) { - var chain_length = s2.max_chain_length; - var scan = s2.strstart; - var match; - var len; - var best_len = s2.prev_length; - var nice_match = s2.nice_match; - var limit = s2.strstart > s2.w_size - MIN_LOOKAHEAD ? s2.strstart - (s2.w_size - MIN_LOOKAHEAD) : 0; - var _win = s2.window; - var wmask = s2.w_mask; - var prev = s2.prev; - var strend = s2.strstart + MAX_MATCH; - var scan_end1 = _win[scan + best_len - 1]; - var scan_end = _win[scan + best_len]; - if (s2.prev_length >= s2.good_match) { - chain_length >>= 2; - } - if (nice_match > s2.lookahead) { - nice_match = s2.lookahead; - } - do { - match = cur_match; - if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) { - continue; - } - scan += 2; - match++; - do { - } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend); - len = MAX_MATCH - (strend - scan); - scan = strend - MAX_MATCH; - if (len > best_len) { - s2.match_start = cur_match; - best_len = len; - if (len >= nice_match) { - break; - } - scan_end1 = _win[scan + best_len - 1]; - scan_end = _win[scan + best_len]; - } - } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); - if (best_len <= s2.lookahead) { - return best_len; - } - return s2.lookahead; - } - function fill_window(s2) { - var _w_size = s2.w_size; - var p, n, m, more, str; - do { - more = s2.window_size - s2.lookahead - s2.strstart; - if (s2.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { - utils.arraySet(s2.window, s2.window, _w_size, _w_size, 0); - s2.match_start -= _w_size; - s2.strstart -= _w_size; - s2.block_start -= _w_size; - n = s2.hash_size; - p = n; - do { - m = s2.head[--p]; - s2.head[p] = m >= _w_size ? m - _w_size : 0; - } while (--n); - n = _w_size; - p = n; - do { - m = s2.prev[--p]; - s2.prev[p] = m >= _w_size ? m - _w_size : 0; - } while (--n); - more += _w_size; - } - if (s2.strm.avail_in === 0) { + function genericEndTagInBody(p, token) { + const tn = token.tagName; + for (let i = p.openElements.stackTop; i > 0; i--) { + const element = p.openElements.items[i]; + if (p.treeAdapter.getTagName(element) === tn) { + p.openElements.generateImpliedEndTagsWithExclusion(tn); + p.openElements.popUntilElementPopped(element); break; } - n = read_buf(s2.strm, s2.window, s2.strstart + s2.lookahead, more); - s2.lookahead += n; - if (s2.lookahead + s2.insert >= MIN_MATCH) { - str = s2.strstart - s2.insert; - s2.ins_h = s2.window[str]; - s2.ins_h = (s2.ins_h << s2.hash_shift ^ s2.window[str + 1]) & s2.hash_mask; - while (s2.insert) { - s2.ins_h = (s2.ins_h << s2.hash_shift ^ s2.window[str + MIN_MATCH - 1]) & s2.hash_mask; - s2.prev[str & s2.w_mask] = s2.head[s2.ins_h]; - s2.head[s2.ins_h] = str; - str++; - s2.insert--; - if (s2.lookahead + s2.insert < MIN_MATCH) { - break; - } - } + if (p._isSpecialElement(element)) { + break; } - } while (s2.lookahead < MIN_LOOKAHEAD && s2.strm.avail_in !== 0); - } - function deflate_stored(s2, flush) { - var max_block_size = 65535; - if (max_block_size > s2.pending_buf_size - 5) { - max_block_size = s2.pending_buf_size - 5; } - for (; ; ) { - if (s2.lookahead <= 1) { - fill_window(s2); - if (s2.lookahead === 0 && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; + } + function endTagInBody(p, token) { + const tn = token.tagName; + switch (tn.length) { + case 1: + if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U) { + callAdoptionAgency(p, token); + } else if (tn === $.P) { + pEndTagInBody(p, token); + } else { + genericEndTagInBody(p, token); } - if (s2.lookahead === 0) { - break; + break; + case 2: + if (tn === $.DL || tn === $.UL || tn === $.OL) { + addressEndTagInBody(p, token); + } else if (tn === $.LI) { + liEndTagInBody(p, token); + } else if (tn === $.DD || tn === $.DT) { + ddEndTagInBody(p, token); + } else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) { + numberedHeaderEndTagInBody(p, token); + } else if (tn === $.BR) { + brEndTagInBody(p, token); + } else if (tn === $.EM || tn === $.TT) { + callAdoptionAgency(p, token); + } else { + genericEndTagInBody(p, token); } - } - s2.strstart += s2.lookahead; - s2.lookahead = 0; - var max_start = s2.block_start + max_block_size; - if (s2.strstart === 0 || s2.strstart >= max_start) { - s2.lookahead = s2.strstart - max_start; - s2.strstart = max_start; - flush_block_only(s2, false); - if (s2.strm.avail_out === 0) { - return BS_NEED_MORE; + break; + case 3: + if (tn === $.BIG) { + callAdoptionAgency(p, token); + } else if (tn === $.DIR || tn === $.DIV || tn === $.NAV || tn === $.PRE) { + addressEndTagInBody(p, token); + } else { + genericEndTagInBody(p, token); } - } - if (s2.strstart - s2.block_start >= s2.w_size - MIN_LOOKAHEAD) { - flush_block_only(s2, false); - if (s2.strm.avail_out === 0) { - return BS_NEED_MORE; + break; + case 4: + if (tn === $.BODY) { + bodyEndTagInBody(p, token); + } else if (tn === $.HTML) { + htmlEndTagInBody(p, token); + } else if (tn === $.FORM) { + formEndTagInBody(p, token); + } else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR) { + callAdoptionAgency(p, token); + } else if (tn === $.MAIN || tn === $.MENU) { + addressEndTagInBody(p, token); + } else { + genericEndTagInBody(p, token); } - } - } - s2.insert = 0; - if (flush === Z_FINISH) { - flush_block_only(s2, true); - if (s2.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - return BS_FINISH_DONE; - } - if (s2.strstart > s2.block_start) { - flush_block_only(s2, false); - if (s2.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - return BS_NEED_MORE; - } - function deflate_fast(s2, flush) { - var hash_head; - var bflush; - for (; ; ) { - if (s2.lookahead < MIN_LOOKAHEAD) { - fill_window(s2); - if (s2.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; + break; + case 5: + if (tn === $.ASIDE) { + addressEndTagInBody(p, token); + } else if (tn === $.SMALL) { + callAdoptionAgency(p, token); + } else { + genericEndTagInBody(p, token); } - if (s2.lookahead === 0) { - break; + break; + case 6: + if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP || tn === $.DIALOG) { + addressEndTagInBody(p, token); + } else if (tn === $.APPLET || tn === $.OBJECT) { + appletEndTagInBody(p, token); + } else if (tn === $.STRIKE || tn === $.STRONG) { + callAdoptionAgency(p, token); + } else { + genericEndTagInBody(p, token); } - } - hash_head = 0; - if (s2.lookahead >= MIN_MATCH) { - s2.ins_h = (s2.ins_h << s2.hash_shift ^ s2.window[s2.strstart + MIN_MATCH - 1]) & s2.hash_mask; - hash_head = s2.prev[s2.strstart & s2.w_mask] = s2.head[s2.ins_h]; - s2.head[s2.ins_h] = s2.strstart; - } - if (hash_head !== 0 && s2.strstart - hash_head <= s2.w_size - MIN_LOOKAHEAD) { - s2.match_length = longest_match(s2, hash_head); - } - if (s2.match_length >= MIN_MATCH) { - bflush = trees._tr_tally(s2, s2.strstart - s2.match_start, s2.match_length - MIN_MATCH); - s2.lookahead -= s2.match_length; - if (s2.match_length <= s2.max_lazy_match && s2.lookahead >= MIN_MATCH) { - s2.match_length--; - do { - s2.strstart++; - s2.ins_h = (s2.ins_h << s2.hash_shift ^ s2.window[s2.strstart + MIN_MATCH - 1]) & s2.hash_mask; - hash_head = s2.prev[s2.strstart & s2.w_mask] = s2.head[s2.ins_h]; - s2.head[s2.ins_h] = s2.strstart; - } while (--s2.match_length !== 0); - s2.strstart++; + break; + case 7: + if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY || tn === $.LISTING) { + addressEndTagInBody(p, token); + } else if (tn === $.MARQUEE) { + appletEndTagInBody(p, token); } else { - s2.strstart += s2.match_length; - s2.match_length = 0; - s2.ins_h = s2.window[s2.strstart]; - s2.ins_h = (s2.ins_h << s2.hash_shift ^ s2.window[s2.strstart + 1]) & s2.hash_mask; + genericEndTagInBody(p, token); } - } else { - bflush = trees._tr_tally(s2, 0, s2.window[s2.strstart]); - s2.lookahead--; - s2.strstart++; - } - if (bflush) { - flush_block_only(s2, false); - if (s2.strm.avail_out === 0) { - return BS_NEED_MORE; + break; + case 8: + if (tn === $.FIELDSET) { + addressEndTagInBody(p, token); + } else if (tn === $.TEMPLATE) { + endTagInHead(p, token); + } else { + genericEndTagInBody(p, token); } - } + break; + case 10: + if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION) { + addressEndTagInBody(p, token); + } else { + genericEndTagInBody(p, token); + } + break; + default: + genericEndTagInBody(p, token); } - s2.insert = s2.strstart < MIN_MATCH - 1 ? s2.strstart : MIN_MATCH - 1; - if (flush === Z_FINISH) { - flush_block_only(s2, true); - if (s2.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - return BS_FINISH_DONE; + } + function eofInBody(p, token) { + if (p.tmplInsertionModeStackTop > -1) { + eofInTemplate(p, token); + } else { + p.stopped = true; + } + } + function endTagInText(p, token) { + if (token.tagName === $.SCRIPT) { + p.pendingScript = p.openElements.current; + } + p.openElements.pop(); + p.insertionMode = p.originalInsertionMode; + } + function eofInText(p, token) { + p._err(ERR.eofInElementThatCanContainOnlyText); + p.openElements.pop(); + p.insertionMode = p.originalInsertionMode; + p._processToken(token); + } + function characterInTable(p, token) { + const curTn = p.openElements.currentTagName; + if (curTn === $.TABLE || curTn === $.TBODY || curTn === $.TFOOT || curTn === $.THEAD || curTn === $.TR) { + p.pendingCharacterTokens = []; + p.hasNonWhitespacePendingCharacterToken = false; + p.originalInsertionMode = p.insertionMode; + p.insertionMode = IN_TABLE_TEXT_MODE; + p._processToken(token); + } else { + tokenInTable(p, token); + } + } + function captionStartTagInTable(p, token) { + p.openElements.clearBackToTableContext(); + p.activeFormattingElements.insertMarker(); + p._insertElement(token, NS.HTML); + p.insertionMode = IN_CAPTION_MODE; + } + function colgroupStartTagInTable(p, token) { + p.openElements.clearBackToTableContext(); + p._insertElement(token, NS.HTML); + p.insertionMode = IN_COLUMN_GROUP_MODE; + } + function colStartTagInTable(p, token) { + p.openElements.clearBackToTableContext(); + p._insertFakeElement($.COLGROUP); + p.insertionMode = IN_COLUMN_GROUP_MODE; + p._processToken(token); + } + function tbodyStartTagInTable(p, token) { + p.openElements.clearBackToTableContext(); + p._insertElement(token, NS.HTML); + p.insertionMode = IN_TABLE_BODY_MODE; + } + function tdStartTagInTable(p, token) { + p.openElements.clearBackToTableContext(); + p._insertFakeElement($.TBODY); + p.insertionMode = IN_TABLE_BODY_MODE; + p._processToken(token); + } + function tableStartTagInTable(p, token) { + if (p.openElements.hasInTableScope($.TABLE)) { + p.openElements.popUntilTagNamePopped($.TABLE); + p._resetInsertionMode(); + p._processToken(token); + } + } + function inputStartTagInTable(p, token) { + const inputType = Tokenizer.getTokenAttr(token, ATTRS.TYPE); + if (inputType && inputType.toLowerCase() === HIDDEN_INPUT_TYPE) { + p._appendElement(token, NS.HTML); + } else { + tokenInTable(p, token); } - if (s2.last_lit) { - flush_block_only(s2, false); - if (s2.strm.avail_out === 0) { - return BS_NEED_MORE; - } + token.ackSelfClosing = true; + } + function formStartTagInTable(p, token) { + if (!p.formElement && p.openElements.tmplCount === 0) { + p._insertElement(token, NS.HTML); + p.formElement = p.openElements.current; + p.openElements.pop(); } - return BS_BLOCK_DONE; } - function deflate_slow(s2, flush) { - var hash_head; - var bflush; - var max_insert; - for (; ; ) { - if (s2.lookahead < MIN_LOOKAHEAD) { - fill_window(s2); - if (s2.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; + function startTagInTable(p, token) { + const tn = token.tagName; + switch (tn.length) { + case 2: + if (tn === $.TD || tn === $.TH || tn === $.TR) { + tdStartTagInTable(p, token); + } else { + tokenInTable(p, token); } - if (s2.lookahead === 0) { - break; + break; + case 3: + if (tn === $.COL) { + colStartTagInTable(p, token); + } else { + tokenInTable(p, token); } - } - hash_head = 0; - if (s2.lookahead >= MIN_MATCH) { - s2.ins_h = (s2.ins_h << s2.hash_shift ^ s2.window[s2.strstart + MIN_MATCH - 1]) & s2.hash_mask; - hash_head = s2.prev[s2.strstart & s2.w_mask] = s2.head[s2.ins_h]; - s2.head[s2.ins_h] = s2.strstart; - } - s2.prev_length = s2.match_length; - s2.prev_match = s2.match_start; - s2.match_length = MIN_MATCH - 1; - if (hash_head !== 0 && s2.prev_length < s2.max_lazy_match && s2.strstart - hash_head <= s2.w_size - MIN_LOOKAHEAD) { - s2.match_length = longest_match(s2, hash_head); - if (s2.match_length <= 5 && (s2.strategy === Z_FILTERED || s2.match_length === MIN_MATCH && s2.strstart - s2.match_start > 4096)) { - s2.match_length = MIN_MATCH - 1; + break; + case 4: + if (tn === $.FORM) { + formStartTagInTable(p, token); + } else { + tokenInTable(p, token); } - } - if (s2.prev_length >= MIN_MATCH && s2.match_length <= s2.prev_length) { - max_insert = s2.strstart + s2.lookahead - MIN_MATCH; - bflush = trees._tr_tally(s2, s2.strstart - 1 - s2.prev_match, s2.prev_length - MIN_MATCH); - s2.lookahead -= s2.prev_length - 1; - s2.prev_length -= 2; - do { - if (++s2.strstart <= max_insert) { - s2.ins_h = (s2.ins_h << s2.hash_shift ^ s2.window[s2.strstart + MIN_MATCH - 1]) & s2.hash_mask; - hash_head = s2.prev[s2.strstart & s2.w_mask] = s2.head[s2.ins_h]; - s2.head[s2.ins_h] = s2.strstart; - } - } while (--s2.prev_length !== 0); - s2.match_available = 0; - s2.match_length = MIN_MATCH - 1; - s2.strstart++; - if (bflush) { - flush_block_only(s2, false); - if (s2.strm.avail_out === 0) { - return BS_NEED_MORE; - } + break; + case 5: + if (tn === $.TABLE) { + tableStartTagInTable(p, token); + } else if (tn === $.STYLE) { + startTagInHead(p, token); + } else if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) { + tbodyStartTagInTable(p, token); + } else if (tn === $.INPUT) { + inputStartTagInTable(p, token); + } else { + tokenInTable(p, token); } - } else if (s2.match_available) { - bflush = trees._tr_tally(s2, 0, s2.window[s2.strstart - 1]); - if (bflush) { - flush_block_only(s2, false); + break; + case 6: + if (tn === $.SCRIPT) { + startTagInHead(p, token); + } else { + tokenInTable(p, token); } - s2.strstart++; - s2.lookahead--; - if (s2.strm.avail_out === 0) { - return BS_NEED_MORE; + break; + case 7: + if (tn === $.CAPTION) { + captionStartTagInTable(p, token); + } else { + tokenInTable(p, token); } - } else { - s2.match_available = 1; - s2.strstart++; - s2.lookahead--; - } - } - if (s2.match_available) { - bflush = trees._tr_tally(s2, 0, s2.window[s2.strstart - 1]); - s2.match_available = 0; + break; + case 8: + if (tn === $.COLGROUP) { + colgroupStartTagInTable(p, token); + } else if (tn === $.TEMPLATE) { + startTagInHead(p, token); + } else { + tokenInTable(p, token); + } + break; + default: + tokenInTable(p, token); } - s2.insert = s2.strstart < MIN_MATCH - 1 ? s2.strstart : MIN_MATCH - 1; - if (flush === Z_FINISH) { - flush_block_only(s2, true); - if (s2.strm.avail_out === 0) { - return BS_FINISH_STARTED; + } + function endTagInTable(p, token) { + const tn = token.tagName; + if (tn === $.TABLE) { + if (p.openElements.hasInTableScope($.TABLE)) { + p.openElements.popUntilTagNamePopped($.TABLE); + p._resetInsertionMode(); } - return BS_FINISH_DONE; + } else if (tn === $.TEMPLATE) { + endTagInHead(p, token); + } else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML && tn !== $.TBODY && tn !== $.TD && tn !== $.TFOOT && tn !== $.TH && tn !== $.THEAD && tn !== $.TR) { + tokenInTable(p, token); } - if (s2.last_lit) { - flush_block_only(s2, false); - if (s2.strm.avail_out === 0) { - return BS_NEED_MORE; + } + function tokenInTable(p, token) { + const savedFosterParentingState = p.fosterParentingEnabled; + p.fosterParentingEnabled = true; + p._processTokenInBodyMode(token); + p.fosterParentingEnabled = savedFosterParentingState; + } + function whitespaceCharacterInTableText(p, token) { + p.pendingCharacterTokens.push(token); + } + function characterInTableText(p, token) { + p.pendingCharacterTokens.push(token); + p.hasNonWhitespacePendingCharacterToken = true; + } + function tokenInTableText(p, token) { + let i = 0; + if (p.hasNonWhitespacePendingCharacterToken) { + for (; i < p.pendingCharacterTokens.length; i++) { + tokenInTable(p, p.pendingCharacterTokens[i]); + } + } else { + for (; i < p.pendingCharacterTokens.length; i++) { + p._insertCharacters(p.pendingCharacterTokens[i]); } } - return BS_BLOCK_DONE; + p.insertionMode = p.originalInsertionMode; + p._processToken(token); } - function deflate_rle(s2, flush) { - var bflush; - var prev; - var scan, strend; - var _win = s2.window; - for (; ; ) { - if (s2.lookahead <= MAX_MATCH) { - fill_window(s2); - if (s2.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s2.lookahead === 0) { - break; - } + function startTagInCaption(p, token) { + const tn = token.tagName; + if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || tn === $.TD || tn === $.TFOOT || tn === $.TH || tn === $.THEAD || tn === $.TR) { + if (p.openElements.hasInTableScope($.CAPTION)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped($.CAPTION); + p.activeFormattingElements.clearToLastMarker(); + p.insertionMode = IN_TABLE_MODE; + p._processToken(token); } - s2.match_length = 0; - if (s2.lookahead >= MIN_MATCH && s2.strstart > 0) { - scan = s2.strstart - 1; - prev = _win[scan]; - if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { - strend = s2.strstart + MAX_MATCH; - do { - } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); - s2.match_length = MAX_MATCH - (strend - scan); - if (s2.match_length > s2.lookahead) { - s2.match_length = s2.lookahead; - } - } + } else { + startTagInBody(p, token); + } + } + function endTagInCaption(p, token) { + const tn = token.tagName; + if (tn === $.CAPTION || tn === $.TABLE) { + if (p.openElements.hasInTableScope($.CAPTION)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped($.CAPTION); + p.activeFormattingElements.clearToLastMarker(); + p.insertionMode = IN_TABLE_MODE; + if (tn === $.TABLE) { + p._processToken(token); + } + } + } else if (tn !== $.BODY && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML && tn !== $.TBODY && tn !== $.TD && tn !== $.TFOOT && tn !== $.TH && tn !== $.THEAD && tn !== $.TR) { + endTagInBody(p, token); + } + } + function startTagInColumnGroup(p, token) { + const tn = token.tagName; + if (tn === $.HTML) { + startTagInBody(p, token); + } else if (tn === $.COL) { + p._appendElement(token, NS.HTML); + token.ackSelfClosing = true; + } else if (tn === $.TEMPLATE) { + startTagInHead(p, token); + } else { + tokenInColumnGroup(p, token); + } + } + function endTagInColumnGroup(p, token) { + const tn = token.tagName; + if (tn === $.COLGROUP) { + if (p.openElements.currentTagName === $.COLGROUP) { + p.openElements.pop(); + p.insertionMode = IN_TABLE_MODE; + } + } else if (tn === $.TEMPLATE) { + endTagInHead(p, token); + } else if (tn !== $.COL) { + tokenInColumnGroup(p, token); + } + } + function tokenInColumnGroup(p, token) { + if (p.openElements.currentTagName === $.COLGROUP) { + p.openElements.pop(); + p.insertionMode = IN_TABLE_MODE; + p._processToken(token); + } + } + function startTagInTableBody(p, token) { + const tn = token.tagName; + if (tn === $.TR) { + p.openElements.clearBackToTableBodyContext(); + p._insertElement(token, NS.HTML); + p.insertionMode = IN_ROW_MODE; + } else if (tn === $.TH || tn === $.TD) { + p.openElements.clearBackToTableBodyContext(); + p._insertFakeElement($.TR); + p.insertionMode = IN_ROW_MODE; + p._processToken(token); + } else if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) { + if (p.openElements.hasTableBodyContextInTableScope()) { + p.openElements.clearBackToTableBodyContext(); + p.openElements.pop(); + p.insertionMode = IN_TABLE_MODE; + p._processToken(token); } - if (s2.match_length >= MIN_MATCH) { - bflush = trees._tr_tally(s2, 1, s2.match_length - MIN_MATCH); - s2.lookahead -= s2.match_length; - s2.strstart += s2.match_length; - s2.match_length = 0; - } else { - bflush = trees._tr_tally(s2, 0, s2.window[s2.strstart]); - s2.lookahead--; - s2.strstart++; + } else { + startTagInTable(p, token); + } + } + function endTagInTableBody(p, token) { + const tn = token.tagName; + if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) { + if (p.openElements.hasInTableScope(tn)) { + p.openElements.clearBackToTableBodyContext(); + p.openElements.pop(); + p.insertionMode = IN_TABLE_MODE; + } + } else if (tn === $.TABLE) { + if (p.openElements.hasTableBodyContextInTableScope()) { + p.openElements.clearBackToTableBodyContext(); + p.openElements.pop(); + p.insertionMode = IN_TABLE_MODE; + p._processToken(token); + } + } else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP || tn !== $.HTML && tn !== $.TD && tn !== $.TH && tn !== $.TR) { + endTagInTable(p, token); + } + } + function startTagInRow(p, token) { + const tn = token.tagName; + if (tn === $.TH || tn === $.TD) { + p.openElements.clearBackToTableRowContext(); + p._insertElement(token, NS.HTML); + p.insertionMode = IN_CELL_MODE; + p.activeFormattingElements.insertMarker(); + } else if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR) { + if (p.openElements.hasInTableScope($.TR)) { + p.openElements.clearBackToTableRowContext(); + p.openElements.pop(); + p.insertionMode = IN_TABLE_BODY_MODE; + p._processToken(token); } - if (bflush) { - flush_block_only(s2, false); - if (s2.strm.avail_out === 0) { - return BS_NEED_MORE; - } + } else { + startTagInTable(p, token); + } + } + function endTagInRow(p, token) { + const tn = token.tagName; + if (tn === $.TR) { + if (p.openElements.hasInTableScope($.TR)) { + p.openElements.clearBackToTableRowContext(); + p.openElements.pop(); + p.insertionMode = IN_TABLE_BODY_MODE; + } + } else if (tn === $.TABLE) { + if (p.openElements.hasInTableScope($.TR)) { + p.openElements.clearBackToTableRowContext(); + p.openElements.pop(); + p.insertionMode = IN_TABLE_BODY_MODE; + p._processToken(token); + } + } else if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) { + if (p.openElements.hasInTableScope(tn) || p.openElements.hasInTableScope($.TR)) { + p.openElements.clearBackToTableRowContext(); + p.openElements.pop(); + p.insertionMode = IN_TABLE_BODY_MODE; + p._processToken(token); + } + } else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP || tn !== $.HTML && tn !== $.TD && tn !== $.TH) { + endTagInTable(p, token); + } + } + function startTagInCell(p, token) { + const tn = token.tagName; + if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || tn === $.TD || tn === $.TFOOT || tn === $.TH || tn === $.THEAD || tn === $.TR) { + if (p.openElements.hasInTableScope($.TD) || p.openElements.hasInTableScope($.TH)) { + p._closeTableCell(); + p._processToken(token); } + } else { + startTagInBody(p, token); + } + } + function endTagInCell(p, token) { + const tn = token.tagName; + if (tn === $.TD || tn === $.TH) { + if (p.openElements.hasInTableScope(tn)) { + p.openElements.generateImpliedEndTags(); + p.openElements.popUntilTagNamePopped(tn); + p.activeFormattingElements.clearToLastMarker(); + p.insertionMode = IN_ROW_MODE; + } + } else if (tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR) { + if (p.openElements.hasInTableScope(tn)) { + p._closeTableCell(); + p._processToken(token); + } + } else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML) { + endTagInBody(p, token); + } + } + function startTagInSelect(p, token) { + const tn = token.tagName; + if (tn === $.HTML) { + startTagInBody(p, token); + } else if (tn === $.OPTION) { + if (p.openElements.currentTagName === $.OPTION) { + p.openElements.pop(); + } + p._insertElement(token, NS.HTML); + } else if (tn === $.OPTGROUP) { + if (p.openElements.currentTagName === $.OPTION) { + p.openElements.pop(); + } + if (p.openElements.currentTagName === $.OPTGROUP) { + p.openElements.pop(); + } + p._insertElement(token, NS.HTML); + } else if (tn === $.INPUT || tn === $.KEYGEN || tn === $.TEXTAREA || tn === $.SELECT) { + if (p.openElements.hasInSelectScope($.SELECT)) { + p.openElements.popUntilTagNamePopped($.SELECT); + p._resetInsertionMode(); + if (tn !== $.SELECT) { + p._processToken(token); + } + } + } else if (tn === $.SCRIPT || tn === $.TEMPLATE) { + startTagInHead(p, token); + } + } + function endTagInSelect(p, token) { + const tn = token.tagName; + if (tn === $.OPTGROUP) { + const prevOpenElement = p.openElements.items[p.openElements.stackTop - 1]; + const prevOpenElementTn = prevOpenElement && p.treeAdapter.getTagName(prevOpenElement); + if (p.openElements.currentTagName === $.OPTION && prevOpenElementTn === $.OPTGROUP) { + p.openElements.pop(); + } + if (p.openElements.currentTagName === $.OPTGROUP) { + p.openElements.pop(); + } + } else if (tn === $.OPTION) { + if (p.openElements.currentTagName === $.OPTION) { + p.openElements.pop(); + } + } else if (tn === $.SELECT && p.openElements.hasInSelectScope($.SELECT)) { + p.openElements.popUntilTagNamePopped($.SELECT); + p._resetInsertionMode(); + } else if (tn === $.TEMPLATE) { + endTagInHead(p, token); + } + } + function startTagInSelectInTable(p, token) { + const tn = token.tagName; + if (tn === $.CAPTION || tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR || tn === $.TD || tn === $.TH) { + p.openElements.popUntilTagNamePopped($.SELECT); + p._resetInsertionMode(); + p._processToken(token); + } else { + startTagInSelect(p, token); } - s2.insert = 0; - if (flush === Z_FINISH) { - flush_block_only(s2, true); - if (s2.strm.avail_out === 0) { - return BS_FINISH_STARTED; + } + function endTagInSelectInTable(p, token) { + const tn = token.tagName; + if (tn === $.CAPTION || tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR || tn === $.TD || tn === $.TH) { + if (p.openElements.hasInTableScope(tn)) { + p.openElements.popUntilTagNamePopped($.SELECT); + p._resetInsertionMode(); + p._processToken(token); } - return BS_FINISH_DONE; + } else { + endTagInSelect(p, token); } - if (s2.last_lit) { - flush_block_only(s2, false); - if (s2.strm.avail_out === 0) { - return BS_NEED_MORE; - } + } + function startTagInTemplate(p, token) { + const tn = token.tagName; + if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META || tn === $.NOFRAMES || tn === $.SCRIPT || tn === $.STYLE || tn === $.TEMPLATE || tn === $.TITLE) { + startTagInHead(p, token); + } else { + const newInsertionMode = TEMPLATE_INSERTION_MODE_SWITCH_MAP[tn] || IN_BODY_MODE; + p._popTmplInsertionMode(); + p._pushTmplInsertionMode(newInsertionMode); + p.insertionMode = newInsertionMode; + p._processToken(token); } - return BS_BLOCK_DONE; } - function deflate_huff(s2, flush) { - var bflush; - for (; ; ) { - if (s2.lookahead === 0) { - fill_window(s2); - if (s2.lookahead === 0) { - if (flush === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - break; - } - } - s2.match_length = 0; - bflush = trees._tr_tally(s2, 0, s2.window[s2.strstart]); - s2.lookahead--; - s2.strstart++; - if (bflush) { - flush_block_only(s2, false); - if (s2.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - } - s2.insert = 0; - if (flush === Z_FINISH) { - flush_block_only(s2, true); - if (s2.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - return BS_FINISH_DONE; - } - if (s2.last_lit) { - flush_block_only(s2, false); - if (s2.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - return BS_BLOCK_DONE; - } - function Config(good_length, max_lazy, nice_length, max_chain, func) { - this.good_length = good_length; - this.max_lazy = max_lazy; - this.nice_length = nice_length; - this.max_chain = max_chain; - this.func = func; - } - var configuration_table; - configuration_table = [ - new Config(0, 0, 0, 0, deflate_stored), - new Config(4, 4, 8, 4, deflate_fast), - new Config(4, 5, 16, 8, deflate_fast), - new Config(4, 6, 32, 32, deflate_fast), - new Config(4, 4, 16, 16, deflate_slow), - new Config(8, 16, 32, 32, deflate_slow), - new Config(8, 16, 128, 128, deflate_slow), - new Config(8, 32, 128, 256, deflate_slow), - new Config(32, 128, 258, 1024, deflate_slow), - new Config(32, 258, 258, 4096, deflate_slow) - ]; - function lm_init(s2) { - s2.window_size = 2 * s2.w_size; - zero(s2.head); - s2.max_lazy_match = configuration_table[s2.level].max_lazy; - s2.good_match = configuration_table[s2.level].good_length; - s2.nice_match = configuration_table[s2.level].nice_length; - s2.max_chain_length = configuration_table[s2.level].max_chain; - s2.strstart = 0; - s2.block_start = 0; - s2.lookahead = 0; - s2.insert = 0; - s2.match_length = s2.prev_length = MIN_MATCH - 1; - s2.match_available = 0; - s2.ins_h = 0; - } - function DeflateState() { - this.strm = null; - this.status = 0; - this.pending_buf = null; - this.pending_buf_size = 0; - this.pending_out = 0; - this.pending = 0; - this.wrap = 0; - this.gzhead = null; - this.gzindex = 0; - this.method = Z_DEFLATED; - this.last_flush = -1; - this.w_size = 0; - this.w_bits = 0; - this.w_mask = 0; - this.window = null; - this.window_size = 0; - this.prev = null; - this.head = null; - this.ins_h = 0; - this.hash_size = 0; - this.hash_bits = 0; - this.hash_mask = 0; - this.hash_shift = 0; - this.block_start = 0; - this.match_length = 0; - this.prev_match = 0; - this.match_available = 0; - this.strstart = 0; - this.match_start = 0; - this.lookahead = 0; - this.prev_length = 0; - this.max_chain_length = 0; - this.max_lazy_match = 0; - this.level = 0; - this.strategy = 0; - this.good_match = 0; - this.nice_match = 0; - this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); - this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); - this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); - zero(this.dyn_ltree); - zero(this.dyn_dtree); - zero(this.bl_tree); - this.l_desc = null; - this.d_desc = null; - this.bl_desc = null; - this.bl_count = new utils.Buf16(MAX_BITS + 1); - this.heap = new utils.Buf16(2 * L_CODES + 1); - zero(this.heap); - this.heap_len = 0; - this.heap_max = 0; - this.depth = new utils.Buf16(2 * L_CODES + 1); - zero(this.depth); - this.l_buf = 0; - this.lit_bufsize = 0; - this.last_lit = 0; - this.d_buf = 0; - this.opt_len = 0; - this.static_len = 0; - this.matches = 0; - this.insert = 0; - this.bi_buf = 0; - this.bi_valid = 0; - } - function deflateResetKeep(strm) { - var s2; - if (!strm || !strm.state) { - return err(strm, Z_STREAM_ERROR); - } - strm.total_in = strm.total_out = 0; - strm.data_type = Z_UNKNOWN; - s2 = strm.state; - s2.pending = 0; - s2.pending_out = 0; - if (s2.wrap < 0) { - s2.wrap = -s2.wrap; - } - s2.status = s2.wrap ? INIT_STATE : BUSY_STATE; - strm.adler = s2.wrap === 2 ? 0 : 1; - s2.last_flush = Z_NO_FLUSH; - trees._tr_init(s2); - return Z_OK; - } - function deflateReset(strm) { - var ret2 = deflateResetKeep(strm); - if (ret2 === Z_OK) { - lm_init(strm.state); - } - return ret2; - } - function deflateSetHeader(strm, head) { - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - if (strm.state.wrap !== 2) { - return Z_STREAM_ERROR; - } - strm.state.gzhead = head; - return Z_OK; - } - function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { - if (!strm) { - return Z_STREAM_ERROR; - } - var wrap = 1; - if (level === Z_DEFAULT_COMPRESSION) { - level = 6; - } - if (windowBits < 0) { - wrap = 0; - windowBits = -windowBits; - } else if (windowBits > 15) { - wrap = 2; - windowBits -= 16; - } - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { - return err(strm, Z_STREAM_ERROR); - } - if (windowBits === 8) { - windowBits = 9; - } - var s2 = new DeflateState(); - strm.state = s2; - s2.strm = strm; - s2.wrap = wrap; - s2.gzhead = null; - s2.w_bits = windowBits; - s2.w_size = 1 << s2.w_bits; - s2.w_mask = s2.w_size - 1; - s2.hash_bits = memLevel + 7; - s2.hash_size = 1 << s2.hash_bits; - s2.hash_mask = s2.hash_size - 1; - s2.hash_shift = ~~((s2.hash_bits + MIN_MATCH - 1) / MIN_MATCH); - s2.window = new utils.Buf8(s2.w_size * 2); - s2.head = new utils.Buf16(s2.hash_size); - s2.prev = new utils.Buf16(s2.w_size); - s2.lit_bufsize = 1 << memLevel + 6; - s2.pending_buf_size = s2.lit_bufsize * 4; - s2.pending_buf = new utils.Buf8(s2.pending_buf_size); - s2.d_buf = 1 * s2.lit_bufsize; - s2.l_buf = (1 + 2) * s2.lit_bufsize; - s2.level = level; - s2.strategy = strategy; - s2.method = method; - return deflateReset(strm); - } - function deflateInit(strm, level) { - return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); - } - function deflate(strm, flush) { - var old_flush, s2; - var beg, val; - if (!strm || !strm.state || flush > Z_BLOCK || flush < 0) { - return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; - } - s2 = strm.state; - if (!strm.output || !strm.input && strm.avail_in !== 0 || s2.status === FINISH_STATE && flush !== Z_FINISH) { - return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR); - } - s2.strm = strm; - old_flush = s2.last_flush; - s2.last_flush = flush; - if (s2.status === INIT_STATE) { - if (s2.wrap === 2) { - strm.adler = 0; - put_byte(s2, 31); - put_byte(s2, 139); - put_byte(s2, 8); - if (!s2.gzhead) { - put_byte(s2, 0); - put_byte(s2, 0); - put_byte(s2, 0); - put_byte(s2, 0); - put_byte(s2, 0); - put_byte(s2, s2.level === 9 ? 2 : s2.strategy >= Z_HUFFMAN_ONLY || s2.level < 2 ? 4 : 0); - put_byte(s2, OS_CODE); - s2.status = BUSY_STATE; - } else { - put_byte(s2, (s2.gzhead.text ? 1 : 0) + (s2.gzhead.hcrc ? 2 : 0) + (!s2.gzhead.extra ? 0 : 4) + (!s2.gzhead.name ? 0 : 8) + (!s2.gzhead.comment ? 0 : 16)); - put_byte(s2, s2.gzhead.time & 255); - put_byte(s2, s2.gzhead.time >> 8 & 255); - put_byte(s2, s2.gzhead.time >> 16 & 255); - put_byte(s2, s2.gzhead.time >> 24 & 255); - put_byte(s2, s2.level === 9 ? 2 : s2.strategy >= Z_HUFFMAN_ONLY || s2.level < 2 ? 4 : 0); - put_byte(s2, s2.gzhead.os & 255); - if (s2.gzhead.extra && s2.gzhead.extra.length) { - put_byte(s2, s2.gzhead.extra.length & 255); - put_byte(s2, s2.gzhead.extra.length >> 8 & 255); - } - if (s2.gzhead.hcrc) { - strm.adler = crc32(strm.adler, s2.pending_buf, s2.pending, 0); - } - s2.gzindex = 0; - s2.status = EXTRA_STATE; - } - } else { - var header = Z_DEFLATED + (s2.w_bits - 8 << 4) << 8; - var level_flags = -1; - if (s2.strategy >= Z_HUFFMAN_ONLY || s2.level < 2) { - level_flags = 0; - } else if (s2.level < 6) { - level_flags = 1; - } else if (s2.level === 6) { - level_flags = 2; - } else { - level_flags = 3; - } - header |= level_flags << 6; - if (s2.strstart !== 0) { - header |= PRESET_DICT; - } - header += 31 - header % 31; - s2.status = BUSY_STATE; - putShortMSB(s2, header); - if (s2.strstart !== 0) { - putShortMSB(s2, strm.adler >>> 16); - putShortMSB(s2, strm.adler & 65535); - } - strm.adler = 1; - } + function endTagInTemplate(p, token) { + if (token.tagName === $.TEMPLATE) { + endTagInHead(p, token); } - if (s2.status === EXTRA_STATE) { - if (s2.gzhead.extra) { - beg = s2.pending; - while (s2.gzindex < (s2.gzhead.extra.length & 65535)) { - if (s2.pending === s2.pending_buf_size) { - if (s2.gzhead.hcrc && s2.pending > beg) { - strm.adler = crc32(strm.adler, s2.pending_buf, s2.pending - beg, beg); - } - flush_pending(strm); - beg = s2.pending; - if (s2.pending === s2.pending_buf_size) { - break; - } - } - put_byte(s2, s2.gzhead.extra[s2.gzindex] & 255); - s2.gzindex++; - } - if (s2.gzhead.hcrc && s2.pending > beg) { - strm.adler = crc32(strm.adler, s2.pending_buf, s2.pending - beg, beg); - } - if (s2.gzindex === s2.gzhead.extra.length) { - s2.gzindex = 0; - s2.status = NAME_STATE; - } - } else { - s2.status = NAME_STATE; - } + } + function eofInTemplate(p, token) { + if (p.openElements.tmplCount > 0) { + p.openElements.popUntilTagNamePopped($.TEMPLATE); + p.activeFormattingElements.clearToLastMarker(); + p._popTmplInsertionMode(); + p._resetInsertionMode(); + p._processToken(token); + } else { + p.stopped = true; } - if (s2.status === NAME_STATE) { - if (s2.gzhead.name) { - beg = s2.pending; - do { - if (s2.pending === s2.pending_buf_size) { - if (s2.gzhead.hcrc && s2.pending > beg) { - strm.adler = crc32(strm.adler, s2.pending_buf, s2.pending - beg, beg); - } - flush_pending(strm); - beg = s2.pending; - if (s2.pending === s2.pending_buf_size) { - val = 1; - break; - } - } - if (s2.gzindex < s2.gzhead.name.length) { - val = s2.gzhead.name.charCodeAt(s2.gzindex++) & 255; - } else { - val = 0; - } - put_byte(s2, val); - } while (val !== 0); - if (s2.gzhead.hcrc && s2.pending > beg) { - strm.adler = crc32(strm.adler, s2.pending_buf, s2.pending - beg, beg); - } - if (val === 0) { - s2.gzindex = 0; - s2.status = COMMENT_STATE; - } - } else { - s2.status = COMMENT_STATE; - } + } + function startTagAfterBody(p, token) { + if (token.tagName === $.HTML) { + startTagInBody(p, token); + } else { + tokenAfterBody(p, token); } - if (s2.status === COMMENT_STATE) { - if (s2.gzhead.comment) { - beg = s2.pending; - do { - if (s2.pending === s2.pending_buf_size) { - if (s2.gzhead.hcrc && s2.pending > beg) { - strm.adler = crc32(strm.adler, s2.pending_buf, s2.pending - beg, beg); - } - flush_pending(strm); - beg = s2.pending; - if (s2.pending === s2.pending_buf_size) { - val = 1; - break; - } - } - if (s2.gzindex < s2.gzhead.comment.length) { - val = s2.gzhead.comment.charCodeAt(s2.gzindex++) & 255; - } else { - val = 0; - } - put_byte(s2, val); - } while (val !== 0); - if (s2.gzhead.hcrc && s2.pending > beg) { - strm.adler = crc32(strm.adler, s2.pending_buf, s2.pending - beg, beg); - } - if (val === 0) { - s2.status = HCRC_STATE; - } - } else { - s2.status = HCRC_STATE; + } + function endTagAfterBody(p, token) { + if (token.tagName === $.HTML) { + if (!p.fragmentContext) { + p.insertionMode = AFTER_AFTER_BODY_MODE; } + } else { + tokenAfterBody(p, token); } - if (s2.status === HCRC_STATE) { - if (s2.gzhead.hcrc) { - if (s2.pending + 2 > s2.pending_buf_size) { - flush_pending(strm); - } - if (s2.pending + 2 <= s2.pending_buf_size) { - put_byte(s2, strm.adler & 255); - put_byte(s2, strm.adler >> 8 & 255); - strm.adler = 0; - s2.status = BUSY_STATE; - } - } else { - s2.status = BUSY_STATE; - } - } - if (s2.pending !== 0) { - flush_pending(strm); - if (strm.avail_out === 0) { - s2.last_flush = -1; - return Z_OK; - } - } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) && flush !== Z_FINISH) { - return err(strm, Z_BUF_ERROR); - } - if (s2.status === FINISH_STATE && strm.avail_in !== 0) { - return err(strm, Z_BUF_ERROR); - } - if (strm.avail_in !== 0 || s2.lookahead !== 0 || flush !== Z_NO_FLUSH && s2.status !== FINISH_STATE) { - var bstate = s2.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s2, flush) : s2.strategy === Z_RLE ? deflate_rle(s2, flush) : configuration_table[s2.level].func(s2, flush); - if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { - s2.status = FINISH_STATE; - } - if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { - if (strm.avail_out === 0) { - s2.last_flush = -1; - } - return Z_OK; - } - if (bstate === BS_BLOCK_DONE) { - if (flush === Z_PARTIAL_FLUSH) { - trees._tr_align(s2); - } else if (flush !== Z_BLOCK) { - trees._tr_stored_block(s2, 0, 0, false); - if (flush === Z_FULL_FLUSH) { - zero(s2.head); - if (s2.lookahead === 0) { - s2.strstart = 0; - s2.block_start = 0; - s2.insert = 0; - } - } - } - flush_pending(strm); - if (strm.avail_out === 0) { - s2.last_flush = -1; - return Z_OK; - } + } + function tokenAfterBody(p, token) { + p.insertionMode = IN_BODY_MODE; + p._processToken(token); + } + function startTagInFrameset(p, token) { + const tn = token.tagName; + if (tn === $.HTML) { + startTagInBody(p, token); + } else if (tn === $.FRAMESET) { + p._insertElement(token, NS.HTML); + } else if (tn === $.FRAME) { + p._appendElement(token, NS.HTML); + token.ackSelfClosing = true; + } else if (tn === $.NOFRAMES) { + startTagInHead(p, token); + } + } + function endTagInFrameset(p, token) { + if (token.tagName === $.FRAMESET && !p.openElements.isRootHtmlElementCurrent()) { + p.openElements.pop(); + if (!p.fragmentContext && p.openElements.currentTagName !== $.FRAMESET) { + p.insertionMode = AFTER_FRAMESET_MODE; } } - if (flush !== Z_FINISH) { - return Z_OK; + } + function startTagAfterFrameset(p, token) { + const tn = token.tagName; + if (tn === $.HTML) { + startTagInBody(p, token); + } else if (tn === $.NOFRAMES) { + startTagInHead(p, token); } - if (s2.wrap <= 0) { - return Z_STREAM_END; + } + function endTagAfterFrameset(p, token) { + if (token.tagName === $.HTML) { + p.insertionMode = AFTER_AFTER_FRAMESET_MODE; } - if (s2.wrap === 2) { - put_byte(s2, strm.adler & 255); - put_byte(s2, strm.adler >> 8 & 255); - put_byte(s2, strm.adler >> 16 & 255); - put_byte(s2, strm.adler >> 24 & 255); - put_byte(s2, strm.total_in & 255); - put_byte(s2, strm.total_in >> 8 & 255); - put_byte(s2, strm.total_in >> 16 & 255); - put_byte(s2, strm.total_in >> 24 & 255); + } + function startTagAfterAfterBody(p, token) { + if (token.tagName === $.HTML) { + startTagInBody(p, token); } else { - putShortMSB(s2, strm.adler >>> 16); - putShortMSB(s2, strm.adler & 65535); - } - flush_pending(strm); - if (s2.wrap > 0) { - s2.wrap = -s2.wrap; - } - return s2.pending !== 0 ? Z_OK : Z_STREAM_END; - } - function deflateEnd(strm) { - var status; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - status = strm.state.status; - if (status !== INIT_STATE && status !== EXTRA_STATE && status !== NAME_STATE && status !== COMMENT_STATE && status !== HCRC_STATE && status !== BUSY_STATE && status !== FINISH_STATE) { - return err(strm, Z_STREAM_ERROR); - } - strm.state = null; - return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; - } - function deflateSetDictionary(strm, dictionary) { - var dictLength = dictionary.length; - var s2; - var str, n; - var wrap; - var avail; - var next; - var input; - var tmpDict; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - s2 = strm.state; - wrap = s2.wrap; - if (wrap === 2 || wrap === 1 && s2.status !== INIT_STATE || s2.lookahead) { - return Z_STREAM_ERROR; - } - if (wrap === 1) { - strm.adler = adler32(strm.adler, dictionary, dictLength, 0); - } - s2.wrap = 0; - if (dictLength >= s2.w_size) { - if (wrap === 0) { - zero(s2.head); - s2.strstart = 0; - s2.block_start = 0; - s2.insert = 0; - } - tmpDict = new utils.Buf8(s2.w_size); - utils.arraySet(tmpDict, dictionary, dictLength - s2.w_size, s2.w_size, 0); - dictionary = tmpDict; - dictLength = s2.w_size; - } - avail = strm.avail_in; - next = strm.next_in; - input = strm.input; - strm.avail_in = dictLength; - strm.next_in = 0; - strm.input = dictionary; - fill_window(s2); - while (s2.lookahead >= MIN_MATCH) { - str = s2.strstart; - n = s2.lookahead - (MIN_MATCH - 1); - do { - s2.ins_h = (s2.ins_h << s2.hash_shift ^ s2.window[str + MIN_MATCH - 1]) & s2.hash_mask; - s2.prev[str & s2.w_mask] = s2.head[s2.ins_h]; - s2.head[s2.ins_h] = str; - str++; - } while (--n); - s2.strstart = str; - s2.lookahead = MIN_MATCH - 1; - fill_window(s2); - } - s2.strstart += s2.lookahead; - s2.block_start = s2.strstart; - s2.insert = s2.lookahead; - s2.lookahead = 0; - s2.match_length = s2.prev_length = MIN_MATCH - 1; - s2.match_available = 0; - strm.next_in = next; - strm.input = input; - strm.avail_in = avail; - s2.wrap = wrap; - return Z_OK; - } - exports2.deflateInit = deflateInit; - exports2.deflateInit2 = deflateInit2; - exports2.deflateReset = deflateReset; - exports2.deflateResetKeep = deflateResetKeep; - exports2.deflateSetHeader = deflateSetHeader; - exports2.deflate = deflate; - exports2.deflateEnd = deflateEnd; - exports2.deflateSetDictionary = deflateSetDictionary; - exports2.deflateInfo = "pako deflate (from Nodeca project)"; - } -}); - -// node_modules/pako/lib/utils/strings.js -var require_strings = __commonJS({ - "node_modules/pako/lib/utils/strings.js"(exports2) { - init_shims(); - "use strict"; - var utils = require_common2(); - var STR_APPLY_OK = true; - var STR_APPLY_UIA_OK = true; - try { - String.fromCharCode.apply(null, [0]); - } catch (__) { - STR_APPLY_OK = false; + tokenAfterAfterBody(p, token); + } } - try { - String.fromCharCode.apply(null, new Uint8Array(1)); - } catch (__) { - STR_APPLY_UIA_OK = false; - } - var _utf8len = new utils.Buf8(256); - for (var q = 0; q < 256; q++) { - _utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1; - } - _utf8len[254] = _utf8len[254] = 1; - exports2.string2buf = function(str) { - var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; - for (m_pos = 0; m_pos < str_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 64512) === 55296 && m_pos + 1 < str_len) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 64512) === 56320) { - c = 65536 + (c - 55296 << 10) + (c2 - 56320); - m_pos++; - } - } - buf_len += c < 128 ? 1 : c < 2048 ? 2 : c < 65536 ? 3 : 4; - } - buf = new utils.Buf8(buf_len); - for (i = 0, m_pos = 0; i < buf_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 64512) === 55296 && m_pos + 1 < str_len) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 64512) === 56320) { - c = 65536 + (c - 55296 << 10) + (c2 - 56320); - m_pos++; - } - } - if (c < 128) { - buf[i++] = c; - } else if (c < 2048) { - buf[i++] = 192 | c >>> 6; - buf[i++] = 128 | c & 63; - } else if (c < 65536) { - buf[i++] = 224 | c >>> 12; - buf[i++] = 128 | c >>> 6 & 63; - buf[i++] = 128 | c & 63; + function tokenAfterAfterBody(p, token) { + p.insertionMode = IN_BODY_MODE; + p._processToken(token); + } + function startTagAfterAfterFrameset(p, token) { + const tn = token.tagName; + if (tn === $.HTML) { + startTagInBody(p, token); + } else if (tn === $.NOFRAMES) { + startTagInHead(p, token); + } + } + function nullCharacterInForeignContent(p, token) { + token.chars = unicode.REPLACEMENT_CHARACTER; + p._insertCharacters(token); + } + function characterInForeignContent(p, token) { + p._insertCharacters(token); + p.framesetOk = false; + } + function startTagInForeignContent(p, token) { + if (foreignContent.causesExit(token) && !p.fragmentContext) { + while (p.treeAdapter.getNamespaceURI(p.openElements.current) !== NS.HTML && !p._isIntegrationPoint(p.openElements.current)) { + p.openElements.pop(); + } + p._processToken(token); + } else { + const current = p._getAdjustedCurrentElement(); + const currentNs = p.treeAdapter.getNamespaceURI(current); + if (currentNs === NS.MATHML) { + foreignContent.adjustTokenMathMLAttrs(token); + } else if (currentNs === NS.SVG) { + foreignContent.adjustTokenSVGTagName(token); + foreignContent.adjustTokenSVGAttrs(token); + } + foreignContent.adjustTokenXMLAttrs(token); + if (token.selfClosing) { + p._appendElement(token, currentNs); } else { - buf[i++] = 240 | c >>> 18; - buf[i++] = 128 | c >>> 12 & 63; - buf[i++] = 128 | c >>> 6 & 63; - buf[i++] = 128 | c & 63; + p._insertElement(token, currentNs); } + token.ackSelfClosing = true; } - return buf; - }; - function buf2binstring(buf, len) { - if (len < 65534) { - if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) { - return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + function endTagInForeignContent(p, token) { + for (let i = p.openElements.stackTop; i > 0; i--) { + const element = p.openElements.items[i]; + if (p.treeAdapter.getNamespaceURI(element) === NS.HTML) { + p._processToken(token); + break; + } + if (p.treeAdapter.getTagName(element).toLowerCase() === token.tagName) { + p.openElements.popUntilElementPopped(element); + break; } } - var result = ""; - for (var i = 0; i < len; i++) { - result += String.fromCharCode(buf[i]); - } - return result; } - exports2.buf2binstring = function(buf) { - return buf2binstring(buf, buf.length); - }; - exports2.binstring2buf = function(str) { - var buf = new utils.Buf8(str.length); - for (var i = 0, len = buf.length; i < len; i++) { - buf[i] = str.charCodeAt(i); - } - return buf; - }; - exports2.buf2string = function(buf, max) { - var i, out, c, c_len; - var len = max || buf.length; - var utf16buf = new Array(len * 2); - for (out = 0, i = 0; i < len; ) { - c = buf[i++]; - if (c < 128) { - utf16buf[out++] = c; - continue; - } - c_len = _utf8len[c]; - if (c_len > 4) { - utf16buf[out++] = 65533; - i += c_len - 1; - continue; + } +}); + +// node_modules/parse5/lib/serializer/index.js +var require_serializer = __commonJS({ + "node_modules/parse5/lib/serializer/index.js"(exports2, module2) { + init_shims(); + "use strict"; + var defaultTreeAdapter = require_default(); + var mergeOptions = require_merge_options(); + var doctype = require_doctype(); + var HTML = require_html(); + var $ = HTML.TAG_NAMES; + var NS = HTML.NAMESPACES; + var DEFAULT_OPTIONS = { + treeAdapter: defaultTreeAdapter + }; + var AMP_REGEX = /&/g; + var NBSP_REGEX = /\u00a0/g; + var DOUBLE_QUOTE_REGEX = /"/g; + var LT_REGEX = //g; + var Serializer = class { + constructor(node, options2) { + this.options = mergeOptions(DEFAULT_OPTIONS, options2); + this.treeAdapter = this.options.treeAdapter; + this.html = ""; + this.startNode = node; + } + serialize() { + this._serializeChildNodes(this.startNode); + return this.html; + } + _serializeChildNodes(parentNode) { + const childNodes = this.treeAdapter.getChildNodes(parentNode); + if (childNodes) { + for (let i = 0, cnLength = childNodes.length; i < cnLength; i++) { + const currentNode = childNodes[i]; + if (this.treeAdapter.isElementNode(currentNode)) { + this._serializeElement(currentNode); + } else if (this.treeAdapter.isTextNode(currentNode)) { + this._serializeTextNode(currentNode); + } else if (this.treeAdapter.isCommentNode(currentNode)) { + this._serializeCommentNode(currentNode); + } else if (this.treeAdapter.isDocumentTypeNode(currentNode)) { + this._serializeDocumentTypeNode(currentNode); + } + } } - c &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7; - while (c_len > 1 && i < len) { - c = c << 6 | buf[i++] & 63; - c_len--; + } + _serializeElement(node) { + const tn = this.treeAdapter.getTagName(node); + const ns = this.treeAdapter.getNamespaceURI(node); + this.html += "<" + tn; + this._serializeAttributes(node); + this.html += ">"; + if (tn !== $.AREA && tn !== $.BASE && tn !== $.BASEFONT && tn !== $.BGSOUND && tn !== $.BR && tn !== $.COL && tn !== $.EMBED && tn !== $.FRAME && tn !== $.HR && tn !== $.IMG && tn !== $.INPUT && tn !== $.KEYGEN && tn !== $.LINK && tn !== $.META && tn !== $.PARAM && tn !== $.SOURCE && tn !== $.TRACK && tn !== $.WBR) { + const childNodesHolder = tn === $.TEMPLATE && ns === NS.HTML ? this.treeAdapter.getTemplateContent(node) : node; + this._serializeChildNodes(childNodesHolder); + this.html += ""; + } + } + _serializeAttributes(node) { + const attrs = this.treeAdapter.getAttrList(node); + for (let i = 0, attrsLength = attrs.length; i < attrsLength; i++) { + const attr = attrs[i]; + const value = Serializer.escapeString(attr.value, true); + this.html += " "; + if (!attr.namespace) { + this.html += attr.name; + } else if (attr.namespace === NS.XML) { + this.html += "xml:" + attr.name; + } else if (attr.namespace === NS.XMLNS) { + if (attr.name !== "xmlns") { + this.html += "xmlns:"; + } + this.html += attr.name; + } else if (attr.namespace === NS.XLINK) { + this.html += "xlink:" + attr.name; + } else { + this.html += attr.prefix + ":" + attr.name; + } + this.html += '="' + value + '"'; } - if (c_len > 1) { - utf16buf[out++] = 65533; - continue; + } + _serializeTextNode(node) { + const content = this.treeAdapter.getTextNodeContent(node); + const parent = this.treeAdapter.getParentNode(node); + let parentTn = void 0; + if (parent && this.treeAdapter.isElementNode(parent)) { + parentTn = this.treeAdapter.getTagName(parent); } - if (c < 65536) { - utf16buf[out++] = c; + if (parentTn === $.STYLE || parentTn === $.SCRIPT || parentTn === $.XMP || parentTn === $.IFRAME || parentTn === $.NOEMBED || parentTn === $.NOFRAMES || parentTn === $.PLAINTEXT || parentTn === $.NOSCRIPT) { + this.html += content; } else { - c -= 65536; - utf16buf[out++] = 55296 | c >> 10 & 1023; - utf16buf[out++] = 56320 | c & 1023; + this.html += Serializer.escapeString(content, false); } } - return buf2binstring(utf16buf, out); - }; - exports2.utf8border = function(buf, max) { - var pos; - max = max || buf.length; - if (max > buf.length) { - max = buf.length; - } - pos = max - 1; - while (pos >= 0 && (buf[pos] & 192) === 128) { - pos--; + _serializeCommentNode(node) { + this.html += ""; } - if (pos < 0) { - return max; + _serializeDocumentTypeNode(node) { + const name = this.treeAdapter.getDocumentTypeNodeName(node); + this.html += "<" + doctype.serializeContent(name, null, null) + ">"; } - if (pos === 0) { - return max; + }; + Serializer.escapeString = function(str, attrMode) { + str = str.replace(AMP_REGEX, "&").replace(NBSP_REGEX, " "); + if (attrMode) { + str = str.replace(DOUBLE_QUOTE_REGEX, """); + } else { + str = str.replace(LT_REGEX, "<").replace(GT_REGEX, ">"); } - return pos + _utf8len[buf[pos]] > max ? pos : max; + return str; }; + module2.exports = Serializer; } }); -// node_modules/pako/lib/zlib/zstream.js -var require_zstream = __commonJS({ - "node_modules/pako/lib/zlib/zstream.js"(exports2, module2) { +// node_modules/parse5/lib/index.js +var require_lib11 = __commonJS({ + "node_modules/parse5/lib/index.js"(exports2) { init_shims(); "use strict"; - function ZStream() { - this.input = null; - this.next_in = 0; - this.avail_in = 0; - this.total_in = 0; - this.output = null; - this.next_out = 0; - this.avail_out = 0; - this.total_out = 0; - this.msg = ""; - this.state = null; - this.data_type = 2; - this.adler = 0; - } - module2.exports = ZStream; + var Parser = require_parser(); + var Serializer = require_serializer(); + exports2.parse = function parse(html, options2) { + const parser = new Parser(options2); + return parser.parse(html); + }; + exports2.parseFragment = function parseFragment(fragmentContext, html, options2) { + if (typeof fragmentContext === "string") { + options2 = html; + html = fragmentContext; + fragmentContext = null; + } + const parser = new Parser(options2); + return parser.parseFragment(html, fragmentContext); + }; + exports2.serialize = function(node, options2) { + const serializer = new Serializer(node, options2); + return serializer.serialize(); + }; } }); -// node_modules/pako/lib/deflate.js -var require_deflate2 = __commonJS({ - "node_modules/pako/lib/deflate.js"(exports2) { +// node_modules/parse5-htmlparser2-tree-adapter/lib/index.js +var require_lib12 = __commonJS({ + "node_modules/parse5-htmlparser2-tree-adapter/lib/index.js"(exports2) { init_shims(); "use strict"; - var zlib_deflate = require_deflate(); - var utils = require_common2(); - var strings = require_strings(); - var msg = require_messages(); - var ZStream = require_zstream(); - var toString = Object.prototype.toString; - var Z_NO_FLUSH = 0; - var Z_FINISH = 4; - var Z_OK = 0; - var Z_STREAM_END = 1; - var Z_SYNC_FLUSH = 2; - var Z_DEFAULT_COMPRESSION = -1; - var Z_DEFAULT_STRATEGY = 0; - var Z_DEFLATED = 8; - function Deflate(options2) { - if (!(this instanceof Deflate)) - return new Deflate(options2); - this.options = utils.assign({ - level: Z_DEFAULT_COMPRESSION, - method: Z_DEFLATED, - chunkSize: 16384, - windowBits: 15, - memLevel: 8, - strategy: Z_DEFAULT_STRATEGY, - to: "" - }, options2 || {}); - var opt = this.options; - if (opt.raw && opt.windowBits > 0) { - opt.windowBits = -opt.windowBits; - } else if (opt.gzip && opt.windowBits > 0 && opt.windowBits < 16) { - opt.windowBits += 16; - } - this.err = 0; - this.msg = ""; - this.ended = false; - this.chunks = []; - this.strm = new ZStream(); - this.strm.avail_out = 0; - var status = zlib_deflate.deflateInit2(this.strm, opt.level, opt.method, opt.windowBits, opt.memLevel, opt.strategy); - if (status !== Z_OK) { - throw new Error(msg[status]); - } - if (opt.header) { - zlib_deflate.deflateSetHeader(this.strm, opt.header); - } - if (opt.dictionary) { - var dict; - if (typeof opt.dictionary === "string") { - dict = strings.string2buf(opt.dictionary); - } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") { - dict = new Uint8Array(opt.dictionary); - } else { - dict = opt.dictionary; + var doctype = require_doctype(); + var { DOCUMENT_MODE } = require_html(); + var nodeTypes = { + element: 1, + text: 3, + cdata: 4, + comment: 8 + }; + var nodePropertyShorthands = { + tagName: "name", + childNodes: "children", + parentNode: "parent", + previousSibling: "prev", + nextSibling: "next", + nodeValue: "data" + }; + var Node = class { + constructor(props) { + for (const key of Object.keys(props)) { + this[key] = props[key]; + } + } + get firstChild() { + const children = this.children; + return children && children[0] || null; + } + get lastChild() { + const children = this.children; + return children && children[children.length - 1] || null; + } + get nodeType() { + return nodeTypes[this.type] || nodeTypes.element; + } + }; + Object.keys(nodePropertyShorthands).forEach((key) => { + const shorthand = nodePropertyShorthands[key]; + Object.defineProperty(Node.prototype, key, { + get: function() { + return this[shorthand] || null; + }, + set: function(val) { + this[shorthand] = val; + return val; } - status = zlib_deflate.deflateSetDictionary(this.strm, dict); - if (status !== Z_OK) { - throw new Error(msg[status]); + }); + }); + exports2.createDocument = function() { + return new Node({ + type: "root", + name: "root", + parent: null, + prev: null, + next: null, + children: [], + "x-mode": DOCUMENT_MODE.NO_QUIRKS + }); + }; + exports2.createDocumentFragment = function() { + return new Node({ + type: "root", + name: "root", + parent: null, + prev: null, + next: null, + children: [] + }); + }; + exports2.createElement = function(tagName, namespaceURI, attrs) { + const attribs = Object.create(null); + const attribsNamespace = Object.create(null); + const attribsPrefix = Object.create(null); + for (let i = 0; i < attrs.length; i++) { + const attrName = attrs[i].name; + attribs[attrName] = attrs[i].value; + attribsNamespace[attrName] = attrs[i].namespace; + attribsPrefix[attrName] = attrs[i].prefix; + } + return new Node({ + type: tagName === "script" || tagName === "style" ? tagName : "tag", + name: tagName, + namespace: namespaceURI, + attribs, + "x-attribsNamespace": attribsNamespace, + "x-attribsPrefix": attribsPrefix, + children: [], + parent: null, + prev: null, + next: null + }); + }; + exports2.createCommentNode = function(data) { + return new Node({ + type: "comment", + data, + parent: null, + prev: null, + next: null + }); + }; + var createTextNode = function(value) { + return new Node({ + type: "text", + data: value, + parent: null, + prev: null, + next: null + }); + }; + var appendChild = exports2.appendChild = function(parentNode, newNode) { + const prev = parentNode.children[parentNode.children.length - 1]; + if (prev) { + prev.next = newNode; + newNode.prev = prev; + } + parentNode.children.push(newNode); + newNode.parent = parentNode; + }; + var insertBefore = exports2.insertBefore = function(parentNode, newNode, referenceNode) { + const insertionIdx = parentNode.children.indexOf(referenceNode); + const prev = referenceNode.prev; + if (prev) { + prev.next = newNode; + newNode.prev = prev; + } + referenceNode.prev = newNode; + newNode.next = referenceNode; + parentNode.children.splice(insertionIdx, 0, newNode); + newNode.parent = parentNode; + }; + exports2.setTemplateContent = function(templateElement, contentElement) { + appendChild(templateElement, contentElement); + }; + exports2.getTemplateContent = function(templateElement) { + return templateElement.children[0]; + }; + exports2.setDocumentType = function(document2, name, publicId, systemId) { + const data = doctype.serializeContent(name, publicId, systemId); + let doctypeNode = null; + for (let i = 0; i < document2.children.length; i++) { + if (document2.children[i].type === "directive" && document2.children[i].name === "!doctype") { + doctypeNode = document2.children[i]; + break; } - this._dict_set = true; - } - } - Deflate.prototype.push = function(data, mode) { - var strm = this.strm; - var chunkSize = this.options.chunkSize; - var status, _mode; - if (this.ended) { - return false; } - _mode = mode === ~~mode ? mode : mode === true ? Z_FINISH : Z_NO_FLUSH; - if (typeof data === "string") { - strm.input = strings.string2buf(data); - } else if (toString.call(data) === "[object ArrayBuffer]") { - strm.input = new Uint8Array(data); + if (doctypeNode) { + doctypeNode.data = data; + doctypeNode["x-name"] = name; + doctypeNode["x-publicId"] = publicId; + doctypeNode["x-systemId"] = systemId; } else { - strm.input = data; - } - strm.next_in = 0; - strm.avail_in = strm.input.length; - do { - if (strm.avail_out === 0) { - strm.output = new utils.Buf8(chunkSize); - strm.next_out = 0; - strm.avail_out = chunkSize; - } - status = zlib_deflate.deflate(strm, _mode); - if (status !== Z_STREAM_END && status !== Z_OK) { - this.onEnd(status); - this.ended = true; - return false; + appendChild(document2, new Node({ + type: "directive", + name: "!doctype", + data, + "x-name": name, + "x-publicId": publicId, + "x-systemId": systemId + })); + } + }; + exports2.setDocumentMode = function(document2, mode) { + document2["x-mode"] = mode; + }; + exports2.getDocumentMode = function(document2) { + return document2["x-mode"]; + }; + exports2.detachNode = function(node) { + if (node.parent) { + const idx = node.parent.children.indexOf(node); + const prev = node.prev; + const next = node.next; + node.prev = null; + node.next = null; + if (prev) { + prev.next = next; } - if (strm.avail_out === 0 || strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH)) { - if (this.options.to === "string") { - this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); - } else { - this.onData(utils.shrinkBuf(strm.output, strm.next_out)); - } + if (next) { + next.prev = prev; } - } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END); - if (_mode === Z_FINISH) { - status = zlib_deflate.deflateEnd(this.strm); - this.onEnd(status); - this.ended = true; - return status === Z_OK; + node.parent.children.splice(idx, 1); + node.parent = null; } - if (_mode === Z_SYNC_FLUSH) { - this.onEnd(Z_OK); - strm.avail_out = 0; - return true; + }; + exports2.insertText = function(parentNode, text) { + const lastChild = parentNode.children[parentNode.children.length - 1]; + if (lastChild && lastChild.type === "text") { + lastChild.data += text; + } else { + appendChild(parentNode, createTextNode(text)); } - return true; }; - Deflate.prototype.onData = function(chunk) { - this.chunks.push(chunk); + exports2.insertTextBefore = function(parentNode, text, referenceNode) { + const prevNode = parentNode.children[parentNode.children.indexOf(referenceNode) - 1]; + if (prevNode && prevNode.type === "text") { + prevNode.data += text; + } else { + insertBefore(parentNode, createTextNode(text), referenceNode); + } }; - Deflate.prototype.onEnd = function(status) { - if (status === Z_OK) { - if (this.options.to === "string") { - this.result = this.chunks.join(""); - } else { - this.result = utils.flattenChunks(this.chunks); + exports2.adoptAttributes = function(recipient, attrs) { + for (let i = 0; i < attrs.length; i++) { + const attrName = attrs[i].name; + if (typeof recipient.attribs[attrName] === "undefined") { + recipient.attribs[attrName] = attrs[i].value; + recipient["x-attribsNamespace"][attrName] = attrs[i].namespace; + recipient["x-attribsPrefix"][attrName] = attrs[i].prefix; } } - this.chunks = []; - this.err = status; - this.msg = this.strm.msg; }; - function deflate(input, options2) { - var deflator = new Deflate(options2); - deflator.push(input, true); - if (deflator.err) { - throw deflator.msg || msg[deflator.err]; + exports2.getFirstChild = function(node) { + return node.children[0]; + }; + exports2.getChildNodes = function(node) { + return node.children; + }; + exports2.getParentNode = function(node) { + return node.parent; + }; + exports2.getAttrList = function(element) { + const attrList = []; + for (const name in element.attribs) { + attrList.push({ + name, + value: element.attribs[name], + namespace: element["x-attribsNamespace"][name], + prefix: element["x-attribsPrefix"][name] + }); } - return deflator.result; - } - function deflateRaw(input, options2) { - options2 = options2 || {}; - options2.raw = true; - return deflate(input, options2); + return attrList; + }; + exports2.getTagName = function(element) { + return element.name; + }; + exports2.getNamespaceURI = function(element) { + return element.namespace; + }; + exports2.getTextNodeContent = function(textNode) { + return textNode.data; + }; + exports2.getCommentNodeContent = function(commentNode) { + return commentNode.data; + }; + exports2.getDocumentTypeNodeName = function(doctypeNode) { + return doctypeNode["x-name"]; + }; + exports2.getDocumentTypeNodePublicId = function(doctypeNode) { + return doctypeNode["x-publicId"]; + }; + exports2.getDocumentTypeNodeSystemId = function(doctypeNode) { + return doctypeNode["x-systemId"]; + }; + exports2.isTextNode = function(node) { + return node.type === "text"; + }; + exports2.isCommentNode = function(node) { + return node.type === "comment"; + }; + exports2.isDocumentTypeNode = function(node) { + return node.type === "directive" && node.name === "!doctype"; + }; + exports2.isElementNode = function(node) { + return !!node.attribs; + }; + exports2.setNodeSourceCodeLocation = function(node, location2) { + node.sourceCodeLocation = location2; + }; + exports2.getNodeSourceCodeLocation = function(node) { + return node.sourceCodeLocation; + }; + exports2.updateNodeSourceCodeLocation = function(node, endLocation) { + node.sourceCodeLocation = Object.assign(node.sourceCodeLocation, endLocation); + }; + } +}); + +// node_modules/cheerio/lib/parsers/parse5-adapter.js +var require_parse5_adapter = __commonJS({ + "node_modules/cheerio/lib/parsers/parse5-adapter.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.render = exports2.parse = void 0; + var tslib_1 = require_tslib(); + var domhandler_1 = require_lib3(); + var parse5_1 = require_lib11(); + var parse5_htmlparser2_tree_adapter_1 = tslib_1.__importDefault(require_lib12()); + function parse(content, options2, isDocument) { + var opts = { + scriptingEnabled: typeof options2.scriptingEnabled === "boolean" ? options2.scriptingEnabled : true, + treeAdapter: parse5_htmlparser2_tree_adapter_1.default, + sourceCodeLocationInfo: options2.sourceCodeLocationInfo + }; + var context = options2.context; + return isDocument ? parse5_1.parse(content, opts) : parse5_1.parseFragment(context, content, opts); } - function gzip(input, options2) { - options2 = options2 || {}; - options2.gzip = true; - return deflate(input, options2); + exports2.parse = parse; + function render2(dom) { + var _a; + var nodes = "length" in dom ? dom : [dom]; + for (var index2 = 0; index2 < nodes.length; index2 += 1) { + var node = nodes[index2]; + if (domhandler_1.isDocument(node)) { + (_a = Array.prototype.splice).call.apply(_a, tslib_1.__spreadArray([nodes, index2, 1], node.children)); + } + } + return parse5_1.serialize({ children: nodes }, { treeAdapter: parse5_htmlparser2_tree_adapter_1.default }); } - exports2.Deflate = Deflate; - exports2.deflate = deflate; - exports2.deflateRaw = deflateRaw; - exports2.gzip = gzip; + exports2.render = render2; } }); -// node_modules/pako/lib/zlib/inffast.js -var require_inffast = __commonJS({ - "node_modules/pako/lib/zlib/inffast.js"(exports2, module2) { +// node_modules/cheerio/lib/parsers/htmlparser2-adapter.js +var require_htmlparser2_adapter = __commonJS({ + "node_modules/cheerio/lib/parsers/htmlparser2-adapter.js"(exports2) { init_shims(); "use strict"; - var BAD = 30; - var TYPE = 12; - module2.exports = function inflate_fast(strm, start) { - var state; - var _in; - var last; - var _out; - var beg; - var end; - var dmax; - var wsize; - var whave; - var wnext; - var s_window; - var hold; - var bits; - var lcode; - var dcode; - var lmask; - var dmask; - var here; - var op; - var len; - var dist; - var from; - var from_source; - var input, output; - state = strm.state; - _in = strm.next_in; - input = strm.input; - last = _in + (strm.avail_in - 5); - _out = strm.next_out; - output = strm.output; - beg = _out - (start - strm.avail_out); - end = _out + (strm.avail_out - 257); - dmax = state.dmax; - wsize = state.wsize; - whave = state.whave; - wnext = state.wnext; - s_window = state.window; - hold = state.hold; - bits = state.bits; - lcode = state.lencode; - dcode = state.distcode; - lmask = (1 << state.lenbits) - 1; - dmask = (1 << state.distbits) - 1; - top: - do { - if (bits < 15) { - hold += input[_in++] << bits; - bits += 8; - hold += input[_in++] << bits; - bits += 8; - } - here = lcode[hold & lmask]; - dolen: - for (; ; ) { - op = here >>> 24; - hold >>>= op; - bits -= op; - op = here >>> 16 & 255; - if (op === 0) { - output[_out++] = here & 65535; - } else if (op & 16) { - len = here & 65535; - op &= 15; - if (op) { - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - } - len += hold & (1 << op) - 1; - hold >>>= op; - bits -= op; - } - if (bits < 15) { - hold += input[_in++] << bits; - bits += 8; - hold += input[_in++] << bits; - bits += 8; - } - here = dcode[hold & dmask]; - dodist: - for (; ; ) { - op = here >>> 24; - hold >>>= op; - bits -= op; - op = here >>> 16 & 255; - if (op & 16) { - dist = here & 65535; - op &= 15; - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - } - } - dist += hold & (1 << op) - 1; - if (dist > dmax) { - strm.msg = "invalid distance too far back"; - state.mode = BAD; - break top; - } - hold >>>= op; - bits -= op; - op = _out - beg; - if (dist > op) { - op = dist - op; - if (op > whave) { - if (state.sane) { - strm.msg = "invalid distance too far back"; - state.mode = BAD; - break top; - } - } - from = 0; - from_source = s_window; - if (wnext === 0) { - from += wsize - op; - if (op < len) { - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; - from_source = output; - } - } else if (wnext < op) { - from += wsize + wnext - op; - op -= wnext; - if (op < len) { - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = 0; - if (wnext < len) { - op = wnext; - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; - from_source = output; - } - } - } else { - from += wnext - op; - if (op < len) { - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; - from_source = output; - } - } - while (len > 2) { - output[_out++] = from_source[from++]; - output[_out++] = from_source[from++]; - output[_out++] = from_source[from++]; - len -= 3; - } - if (len) { - output[_out++] = from_source[from++]; - if (len > 1) { - output[_out++] = from_source[from++]; - } - } - } else { - from = _out - dist; - do { - output[_out++] = output[from++]; - output[_out++] = output[from++]; - output[_out++] = output[from++]; - len -= 3; - } while (len > 2); - if (len) { - output[_out++] = output[from++]; - if (len > 1) { - output[_out++] = output[from++]; - } - } - } - } else if ((op & 64) === 0) { - here = dcode[(here & 65535) + (hold & (1 << op) - 1)]; - continue dodist; - } else { - strm.msg = "invalid distance code"; - state.mode = BAD; - break top; - } - break; - } - } else if ((op & 64) === 0) { - here = lcode[(here & 65535) + (hold & (1 << op) - 1)]; - continue dolen; - } else if (op & 32) { - state.mode = TYPE; - break top; - } else { - strm.msg = "invalid literal/length code"; - state.mode = BAD; - break top; - } - break; - } - } while (_in < last && _out < end); - len = bits >> 3; - _in -= len; - bits -= len << 3; - hold &= (1 << bits) - 1; - strm.next_in = _in; - strm.next_out = _out; - strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last); - strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end); - state.hold = hold; - state.bits = bits; - return; + var __importDefault = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.render = exports2.parse = void 0; + var htmlparser2_1 = require_lib10(); + Object.defineProperty(exports2, "parse", { enumerable: true, get: function() { + return htmlparser2_1.parseDocument; + } }); + var dom_serializer_1 = require_lib5(); + Object.defineProperty(exports2, "render", { enumerable: true, get: function() { + return __importDefault(dom_serializer_1).default; + } }); } }); -// node_modules/pako/lib/zlib/inftrees.js -var require_inftrees = __commonJS({ - "node_modules/pako/lib/zlib/inftrees.js"(exports2, module2) { +// node_modules/cheerio/lib/static.js +var require_static = __commonJS({ + "node_modules/cheerio/lib/static.js"(exports2) { init_shims(); "use strict"; - var utils = require_common2(); - var MAXBITS = 15; - var ENOUGH_LENS = 852; - var ENOUGH_DISTS = 592; - var CODES = 0; - var LENS = 1; - var DISTS = 2; - var lbase = [ - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 13, - 15, - 17, - 19, - 23, - 27, - 31, - 35, - 43, - 51, - 59, - 67, - 83, - 99, - 115, - 131, - 163, - 195, - 227, - 258, - 0, - 0 - ]; - var lext = [ - 16, - 16, - 16, - 16, - 16, - 16, - 16, - 16, - 17, - 17, - 17, - 17, - 18, - 18, - 18, - 18, - 19, - 19, - 19, - 19, - 20, - 20, - 20, - 20, - 21, - 21, - 21, - 21, - 16, - 72, - 78 - ]; - var dbase = [ - 1, - 2, - 3, - 4, - 5, - 7, - 9, - 13, - 17, - 25, - 33, - 49, - 65, - 97, - 129, - 193, - 257, - 385, - 513, - 769, - 1025, - 1537, - 2049, - 3073, - 4097, - 6145, - 8193, - 12289, - 16385, - 24577, - 0, - 0 - ]; - var dext = [ - 16, - 16, - 16, - 16, - 17, - 17, - 18, - 18, - 19, - 19, - 20, - 20, - 21, - 21, - 22, - 22, - 23, - 23, - 24, - 24, - 25, - 25, - 26, - 26, - 27, - 27, - 28, - 28, - 29, - 29, - 64, - 64 - ]; - module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) { - var bits = opts.bits; - var len = 0; - var sym = 0; - var min = 0, max = 0; - var root = 0; - var curr = 0; - var drop = 0; - var left = 0; - var used = 0; - var huff = 0; - var incr; - var fill; - var low; - var mask; - var next; - var base2 = null; - var base_index = 0; - var end; - var count = new utils.Buf16(MAXBITS + 1); - var offs = new utils.Buf16(MAXBITS + 1); - var extra = null; - var extra_index = 0; - var here_bits, here_op, here_val; - for (len = 0; len <= MAXBITS; len++) { - count[len] = 0; - } - for (sym = 0; sym < codes; sym++) { - count[lens[lens_index + sym]]++; - } - root = bits; - for (max = MAXBITS; max >= 1; max--) { - if (count[max] !== 0) { - break; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.merge = exports2.contains = exports2.root = exports2.parseHTML = exports2.text = exports2.xml = exports2.html = void 0; + var tslib_1 = require_tslib(); + var options_1 = tslib_1.__importStar(require_options()); + var cheerio_select_1 = require_lib9(); + var htmlparser2_1 = require_lib10(); + var parse5_adapter_1 = require_parse5_adapter(); + var htmlparser2_adapter_1 = require_htmlparser2_adapter(); + function render2(that, dom, options2) { + var _a; + var toRender = dom ? typeof dom === "string" ? cheerio_select_1.select(dom, (_a = that === null || that === void 0 ? void 0 : that._root) !== null && _a !== void 0 ? _a : [], options2) : dom : that === null || that === void 0 ? void 0 : that._root.children; + if (!toRender) + return ""; + return options2.xmlMode || options2._useHtmlParser2 ? htmlparser2_adapter_1.render(toRender, options2) : parse5_adapter_1.render(toRender); + } + function isOptions(dom) { + return typeof dom === "object" && dom != null && !("length" in dom) && !("type" in dom); + } + function html(dom, options2) { + if (!options2 && isOptions(dom)) { + options2 = dom; + dom = void 0; + } + var opts = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, options_1.default), this ? this._options : {}), options_1.flatten(options2 !== null && options2 !== void 0 ? options2 : {})); + return render2(this || void 0, dom, opts); + } + exports2.html = html; + function xml(dom) { + var options2 = tslib_1.__assign(tslib_1.__assign({}, this._options), { xmlMode: true }); + return render2(this, dom, options2); + } + exports2.xml = xml; + function text(elements) { + var elems = elements ? elements : this ? this.root() : []; + var ret = ""; + for (var i = 0; i < elems.length; i++) { + var elem = elems[i]; + if (htmlparser2_1.DomUtils.isText(elem)) + ret += elem.data; + else if (htmlparser2_1.DomUtils.hasChildren(elem) && elem.type !== htmlparser2_1.ElementType.Comment && elem.type !== htmlparser2_1.ElementType.Script && elem.type !== htmlparser2_1.ElementType.Style) { + ret += text(elem.children); } } - if (root > max) { - root = max; + return ret; + } + exports2.text = text; + function parseHTML(data, context, keepScripts) { + if (keepScripts === void 0) { + keepScripts = typeof context === "boolean" ? context : false; } - if (max === 0) { - table[table_index++] = 1 << 24 | 64 << 16 | 0; - table[table_index++] = 1 << 24 | 64 << 16 | 0; - opts.bits = 1; - return 0; + if (!data || typeof data !== "string") { + return null; } - for (min = 1; min < max; min++) { - if (count[min] !== 0) { - break; - } + if (typeof context === "boolean") { + keepScripts = context; } - if (root < min) { - root = min; + var parsed = this.load(data, options_1.default, false); + if (!keepScripts) { + parsed("script").remove(); } - left = 1; - for (len = 1; len <= MAXBITS; len++) { - left <<= 1; - left -= count[len]; - if (left < 0) { - return -1; + return parsed.root()[0].children.slice(); + } + exports2.parseHTML = parseHTML; + function root() { + return this(this._root); + } + exports2.root = root; + function contains(container, contained) { + if (contained === container) { + return false; + } + var next = contained; + while (next && next !== next.parent) { + next = next.parent; + if (next === container) { + return true; } } - if (left > 0 && (type === CODES || max !== 1)) { - return -1; + return false; + } + exports2.contains = contains; + function merge(arr1, arr2) { + if (!isArrayLike(arr1) || !isArrayLike(arr2)) { + return; + } + var newLength = arr1.length; + var len = +arr2.length; + for (var i = 0; i < len; i++) { + arr1[newLength++] = arr2[i]; + } + arr1.length = newLength; + return arr1; + } + exports2.merge = merge; + function isArrayLike(item) { + if (Array.isArray(item)) { + return true; } - offs[1] = 0; - for (len = 1; len < MAXBITS; len++) { - offs[len + 1] = offs[len] + count[len]; + if (typeof item !== "object" || !Object.prototype.hasOwnProperty.call(item, "length") || typeof item.length !== "number" || item.length < 0) { + return false; } - for (sym = 0; sym < codes; sym++) { - if (lens[lens_index + sym] !== 0) { - work[offs[lens[lens_index + sym]]++] = sym; + for (var i = 0; i < item.length; i++) { + if (!(i in item)) { + return false; } } - if (type === CODES) { - base2 = extra = work; - end = 19; - } else if (type === LENS) { - base2 = lbase; - base_index -= 257; - extra = lext; - extra_index -= 257; - end = 256; + return true; + } + } +}); + +// node_modules/cheerio/lib/parse.js +var require_parse4 = __commonJS({ + "node_modules/cheerio/lib/parse.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.update = void 0; + var htmlparser2_1 = require_lib10(); + var htmlparser2_adapter_1 = require_htmlparser2_adapter(); + var parse5_adapter_1 = require_parse5_adapter(); + var domhandler_1 = require_lib3(); + function parse(content, options2, isDocument) { + if (typeof Buffer !== "undefined" && Buffer.isBuffer(content)) { + content = content.toString(); + } + if (typeof content === "string") { + return options2.xmlMode || options2._useHtmlParser2 ? htmlparser2_adapter_1.parse(content, options2) : parse5_adapter_1.parse(content, options2, isDocument); + } + var doc = content; + if (!Array.isArray(doc) && domhandler_1.isDocument(doc)) { + return doc; + } + var root = new domhandler_1.Document([]); + update(doc, root); + return root; + } + exports2.default = parse; + function update(newChilds, parent) { + var arr = Array.isArray(newChilds) ? newChilds : [newChilds]; + if (parent) { + parent.children = arr; } else { - base2 = dbase; - extra = dext; - end = -1; - } - huff = 0; - sym = 0; - len = min; - next = table_index; - curr = root; - drop = 0; - low = -1; - used = 1 << root; - mask = used - 1; - if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { - return 1; + parent = null; } - for (; ; ) { - here_bits = len - drop; - if (work[sym] < end) { - here_op = 0; - here_val = work[sym]; - } else if (work[sym] > end) { - here_op = extra[extra_index + work[sym]]; - here_val = base2[base_index + work[sym]]; - } else { - here_op = 32 + 64; - here_val = 0; + for (var i = 0; i < arr.length; i++) { + var node = arr[i]; + if (node.parent && node.parent.children !== arr) { + htmlparser2_1.DomUtils.removeElement(node); } - incr = 1 << len - drop; - fill = 1 << curr; - min = fill; - do { - fill -= incr; - table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0; - } while (fill !== 0); - incr = 1 << len - 1; - while (huff & incr) { - incr >>= 1; - } - if (incr !== 0) { - huff &= incr - 1; - huff += incr; + if (parent) { + node.prev = arr[i - 1] || null; + node.next = arr[i + 1] || null; } else { - huff = 0; + node.prev = node.next = null; } - sym++; - if (--count[len] === 0) { - if (len === max) { - break; + node.parent = parent; + } + return parent; + } + exports2.update = update; + } +}); + +// node_modules/cheerio/lib/utils.js +var require_utils2 = __commonJS({ + "node_modules/cheerio/lib/utils.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isHtml = exports2.cloneDom = exports2.domEach = exports2.cssCase = exports2.camelCase = exports2.isCheerio = exports2.isTag = void 0; + var htmlparser2_1 = require_lib10(); + var domhandler_1 = require_lib3(); + exports2.isTag = htmlparser2_1.DomUtils.isTag; + function isCheerio(maybeCheerio) { + return maybeCheerio.cheerio != null; + } + exports2.isCheerio = isCheerio; + function camelCase(str) { + return str.replace(/[_.-](\w|$)/g, function(_, x) { + return x.toUpperCase(); + }); + } + exports2.camelCase = camelCase; + function cssCase(str) { + return str.replace(/[A-Z]/g, "-$&").toLowerCase(); + } + exports2.cssCase = cssCase; + function domEach(array, fn) { + var len = array.length; + for (var i = 0; i < len; i++) + fn(array[i], i); + return array; + } + exports2.domEach = domEach; + function cloneDom(dom) { + var clone2 = "length" in dom ? Array.prototype.map.call(dom, function(el) { + return domhandler_1.cloneNode(el, true); + }) : [domhandler_1.cloneNode(dom, true)]; + var root = new domhandler_1.Document(clone2); + clone2.forEach(function(node) { + node.parent = root; + }); + return clone2; + } + exports2.cloneDom = cloneDom; + var quickExpr = /<[a-zA-Z][^]*>/; + function isHtml(str) { + return quickExpr.test(str); + } + exports2.isHtml = isHtml; + } +}); + +// node_modules/cheerio/lib/api/attributes.js +var require_attributes2 = __commonJS({ + "node_modules/cheerio/lib/api/attributes.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.toggleClass = exports2.removeClass = exports2.addClass = exports2.hasClass = exports2.removeAttr = exports2.val = exports2.data = exports2.prop = exports2.attr = void 0; + var static_1 = require_static(); + var utils_1 = require_utils2(); + var hasOwn = Object.prototype.hasOwnProperty; + var rspace = /\s+/; + var dataAttrPrefix = "data-"; + var primitives = { + null: null, + true: true, + false: false + }; + var rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i; + var rbrace = /^{[^]*}$|^\[[^]*]$/; + function getAttr(elem, name, xmlMode) { + var _a; + if (!elem || !utils_1.isTag(elem)) + return void 0; + (_a = elem.attribs) !== null && _a !== void 0 ? _a : elem.attribs = {}; + if (!name) { + return elem.attribs; + } + if (hasOwn.call(elem.attribs, name)) { + return !xmlMode && rboolean.test(name) ? name : elem.attribs[name]; + } + if (elem.name === "option" && name === "value") { + return static_1.text(elem.children); + } + if (elem.name === "input" && (elem.attribs.type === "radio" || elem.attribs.type === "checkbox") && name === "value") { + return "on"; + } + return void 0; + } + function setAttr(el, name, value) { + if (value === null) { + removeAttribute(el, name); + } else { + el.attribs[name] = "" + value; + } + } + function attr(name, value) { + if (typeof name === "object" || value !== void 0) { + if (typeof value === "function") { + if (typeof name !== "string") { + { + throw new Error("Bad combination of arguments."); + } } - len = lens[lens_index + work[sym]]; + return utils_1.domEach(this, function(el, i) { + if (utils_1.isTag(el)) + setAttr(el, name, value.call(el, i, el.attribs[name])); + }); } - if (len > root && (huff & mask) !== low) { - if (drop === 0) { - drop = root; + return utils_1.domEach(this, function(el) { + if (!utils_1.isTag(el)) + return; + if (typeof name === "object") { + Object.keys(name).forEach(function(objName) { + var objValue = name[objName]; + setAttr(el, objName, objValue); + }); + } else { + setAttr(el, name, value); } - next += min; - curr = len - drop; - left = 1 << curr; - while (curr + drop < max) { - left -= count[curr + drop]; - if (left <= 0) { - break; + }); + } + return arguments.length > 1 ? this : getAttr(this[0], name, this.options.xmlMode); + } + exports2.attr = attr; + function getProp(el, name, xmlMode) { + if (!el || !utils_1.isTag(el)) + return; + return name in el ? el[name] : !xmlMode && rboolean.test(name) ? getAttr(el, name, false) !== void 0 : getAttr(el, name, xmlMode); + } + function setProp(el, name, value, xmlMode) { + if (name in el) { + el[name] = value; + } else { + setAttr(el, name, !xmlMode && rboolean.test(name) ? value ? "" : null : "" + value); + } + } + function prop(name, value) { + var _this = this; + if (typeof name === "string" && value === void 0) { + switch (name) { + case "style": { + var property_1 = this.css(); + var keys = Object.keys(property_1); + keys.forEach(function(p, i) { + property_1[i] = p; + }); + property_1.length = keys.length; + return property_1; + } + case "tagName": + case "nodeName": { + var el = this[0]; + return utils_1.isTag(el) ? el.name.toUpperCase() : void 0; + } + case "outerHTML": + return this.clone().wrap("").parent().html(); + case "innerHTML": + return this.html(); + default: + return getProp(this[0], name, this.options.xmlMode); + } + } + if (typeof name === "object" || value !== void 0) { + if (typeof value === "function") { + if (typeof name === "object") { + throw new Error("Bad combination of arguments."); + } + return utils_1.domEach(this, function(el2, i) { + if (utils_1.isTag(el2)) + setProp(el2, name, value.call(el2, i, getProp(el2, name, _this.options.xmlMode)), _this.options.xmlMode); + }); + } + return utils_1.domEach(this, function(el2) { + if (!utils_1.isTag(el2)) + return; + if (typeof name === "object") { + Object.keys(name).forEach(function(key) { + var val2 = name[key]; + setProp(el2, key, val2, _this.options.xmlMode); + }); + } else { + setProp(el2, name, value, _this.options.xmlMode); + } + }); + } + return void 0; + } + exports2.prop = prop; + function setData(el, name, value) { + var _a; + var elem = el; + (_a = elem.data) !== null && _a !== void 0 ? _a : elem.data = {}; + if (typeof name === "object") + Object.assign(elem.data, name); + else if (typeof name === "string" && value !== void 0) { + elem.data[name] = value; + } + } + function readData(el, name) { + var domNames; + var jsNames; + var value; + if (name == null) { + domNames = Object.keys(el.attribs).filter(function(attrName) { + return attrName.startsWith(dataAttrPrefix); + }); + jsNames = domNames.map(function(domName2) { + return utils_1.camelCase(domName2.slice(dataAttrPrefix.length)); + }); + } else { + domNames = [dataAttrPrefix + utils_1.cssCase(name)]; + jsNames = [name]; + } + for (var idx = 0; idx < domNames.length; ++idx) { + var domName = domNames[idx]; + var jsName = jsNames[idx]; + if (hasOwn.call(el.attribs, domName) && !hasOwn.call(el.data, jsName)) { + value = el.attribs[domName]; + if (hasOwn.call(primitives, value)) { + value = primitives[value]; + } else if (value === String(Number(value))) { + value = Number(value); + } else if (rbrace.test(value)) { + try { + value = JSON.parse(value); + } catch (e) { + } + } + el.data[jsName] = value; + } + } + return name == null ? el.data : value; + } + function data(name, value) { + var _a; + var elem = this[0]; + if (!elem || !utils_1.isTag(elem)) + return; + var dataEl = elem; + (_a = dataEl.data) !== null && _a !== void 0 ? _a : dataEl.data = {}; + if (!name) { + return readData(dataEl); + } + if (typeof name === "object" || value !== void 0) { + utils_1.domEach(this, function(el) { + if (utils_1.isTag(el)) + if (typeof name === "object") + setData(el, name); + else + setData(el, name, value); + }); + return this; + } + if (hasOwn.call(dataEl.data, name)) { + return dataEl.data[name]; + } + return readData(dataEl, name); + } + exports2.data = data; + function val(value) { + var querying = arguments.length === 0; + var element = this[0]; + if (!element || !utils_1.isTag(element)) + return querying ? void 0 : this; + switch (element.name) { + case "textarea": + return this.text(value); + case "select": { + var option = this.find("option:selected"); + if (!querying) { + if (this.attr("multiple") == null && typeof value === "object") { + return this; } - curr++; - left <<= 1; + this.find("option").removeAttr("selected"); + var values = typeof value !== "object" ? [value] : value; + for (var i = 0; i < values.length; i++) { + this.find('option[value="' + values[i] + '"]').attr("selected", ""); + } + return this; } - used += 1 << curr; - if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { - return 1; + return this.attr("multiple") ? option.toArray().map(function(el) { + return static_1.text(el.children); + }) : option.attr("value"); + } + case "input": + case "option": + return querying ? this.attr("value") : this.attr("value", value); + } + return void 0; + } + exports2.val = val; + function removeAttribute(elem, name) { + if (!elem.attribs || !hasOwn.call(elem.attribs, name)) + return; + delete elem.attribs[name]; + } + function splitNames(names) { + return names ? names.trim().split(rspace) : []; + } + function removeAttr(name) { + var attrNames = splitNames(name); + var _loop_1 = function(i2) { + utils_1.domEach(this_1, function(elem) { + if (utils_1.isTag(elem)) + removeAttribute(elem, attrNames[i2]); + }); + }; + var this_1 = this; + for (var i = 0; i < attrNames.length; i++) { + _loop_1(i); + } + return this; + } + exports2.removeAttr = removeAttr; + function hasClass(className) { + return this.toArray().some(function(elem) { + var clazz = utils_1.isTag(elem) && elem.attribs.class; + var idx = -1; + if (clazz && className.length) { + while ((idx = clazz.indexOf(className, idx + 1)) > -1) { + var end = idx + className.length; + if ((idx === 0 || rspace.test(clazz[idx - 1])) && (end === clazz.length || rspace.test(clazz[end]))) { + return true; + } } - low = huff & mask; - table[low] = root << 24 | curr << 16 | next - table_index | 0; } + return false; + }); + } + exports2.hasClass = hasClass; + function addClass(value) { + if (typeof value === "function") { + return utils_1.domEach(this, function(el2, i2) { + if (utils_1.isTag(el2)) { + var className2 = el2.attribs.class || ""; + addClass.call([el2], value.call(el2, i2, className2)); + } + }); } - if (huff !== 0) { - table[next + huff] = len - drop << 24 | 64 << 16 | 0; + if (!value || typeof value !== "string") + return this; + var classNames = value.split(rspace); + var numElements = this.length; + for (var i = 0; i < numElements; i++) { + var el = this[i]; + if (!utils_1.isTag(el)) + continue; + var className = getAttr(el, "class", false); + if (!className) { + setAttr(el, "class", classNames.join(" ").trim()); + } else { + var setClass = " " + className + " "; + for (var j = 0; j < classNames.length; j++) { + var appendClass = classNames[j] + " "; + if (!setClass.includes(" " + appendClass)) + setClass += appendClass; + } + setAttr(el, "class", setClass.trim()); + } } - opts.bits = root; - return 0; - }; + return this; + } + exports2.addClass = addClass; + function removeClass(name) { + if (typeof name === "function") { + return utils_1.domEach(this, function(el, i) { + if (utils_1.isTag(el)) + removeClass.call([el], name.call(el, i, el.attribs.class || "")); + }); + } + var classes = splitNames(name); + var numClasses = classes.length; + var removeAll = arguments.length === 0; + return utils_1.domEach(this, function(el) { + if (!utils_1.isTag(el)) + return; + if (removeAll) { + el.attribs.class = ""; + } else { + var elClasses = splitNames(el.attribs.class); + var changed = false; + for (var j = 0; j < numClasses; j++) { + var index2 = elClasses.indexOf(classes[j]); + if (index2 >= 0) { + elClasses.splice(index2, 1); + changed = true; + j--; + } + } + if (changed) { + el.attribs.class = elClasses.join(" "); + } + } + }); + } + exports2.removeClass = removeClass; + function toggleClass(value, stateVal) { + if (typeof value === "function") { + return utils_1.domEach(this, function(el2, i2) { + if (utils_1.isTag(el2)) { + toggleClass.call([el2], value.call(el2, i2, el2.attribs.class || "", stateVal), stateVal); + } + }); + } + if (!value || typeof value !== "string") + return this; + var classNames = value.split(rspace); + var numClasses = classNames.length; + var state = typeof stateVal === "boolean" ? stateVal ? 1 : -1 : 0; + var numElements = this.length; + for (var i = 0; i < numElements; i++) { + var el = this[i]; + if (!utils_1.isTag(el)) + continue; + var elementClasses = splitNames(el.attribs.class); + for (var j = 0; j < numClasses; j++) { + var index2 = elementClasses.indexOf(classNames[j]); + if (state >= 0 && index2 < 0) { + elementClasses.push(classNames[j]); + } else if (state <= 0 && index2 >= 0) { + elementClasses.splice(index2, 1); + } + } + el.attribs.class = elementClasses.join(" "); + } + return this; + } + exports2.toggleClass = toggleClass; } }); -// node_modules/pako/lib/zlib/inflate.js -var require_inflate = __commonJS({ - "node_modules/pako/lib/zlib/inflate.js"(exports2) { +// node_modules/cheerio/lib/api/traversing.js +var require_traversing = __commonJS({ + "node_modules/cheerio/lib/api/traversing.js"(exports2) { init_shims(); "use strict"; - var utils = require_common2(); - var adler32 = require_adler32(); - var crc32 = require_crc322(); - var inflate_fast = require_inffast(); - var inflate_table = require_inftrees(); - var CODES = 0; - var LENS = 1; - var DISTS = 2; - var Z_FINISH = 4; - var Z_BLOCK = 5; - var Z_TREES = 6; - var Z_OK = 0; - var Z_STREAM_END = 1; - var Z_NEED_DICT = 2; - var Z_STREAM_ERROR = -2; - var Z_DATA_ERROR = -3; - var Z_MEM_ERROR = -4; - var Z_BUF_ERROR = -5; - var Z_DEFLATED = 8; - var HEAD = 1; - var FLAGS = 2; - var TIME = 3; - var OS = 4; - var EXLEN = 5; - var EXTRA = 6; - var NAME2 = 7; - var COMMENT = 8; - var HCRC = 9; - var DICTID = 10; - var DICT = 11; - var TYPE = 12; - var TYPEDO = 13; - var STORED = 14; - var COPY_ = 15; - var COPY = 16; - var TABLE = 17; - var LENLENS = 18; - var CODELENS = 19; - var LEN_ = 20; - var LEN = 21; - var LENEXT = 22; - var DIST = 23; - var DISTEXT = 24; - var MATCH = 25; - var LIT = 26; - var CHECK = 27; - var LENGTH = 28; - var DONE = 29; - var BAD = 30; - var MEM = 31; - var SYNC = 32; - var ENOUGH_LENS = 852; - var ENOUGH_DISTS = 592; - var MAX_WBITS = 15; - var DEF_WBITS = MAX_WBITS; - function zswap32(q) { - return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24); - } - function InflateState() { - this.mode = 0; - this.last = false; - this.wrap = 0; - this.havedict = false; - this.flags = 0; - this.dmax = 0; - this.check = 0; - this.total = 0; - this.head = null; - this.wbits = 0; - this.wsize = 0; - this.whave = 0; - this.wnext = 0; - this.window = null; - this.hold = 0; - this.bits = 0; - this.length = 0; - this.offset = 0; - this.extra = 0; - this.lencode = null; - this.distcode = null; - this.lenbits = 0; - this.distbits = 0; - this.ncode = 0; - this.nlen = 0; - this.ndist = 0; - this.have = 0; - this.next = null; - this.lens = new utils.Buf16(320); - this.work = new utils.Buf16(288); - this.lendyn = null; - this.distdyn = null; - this.sane = 0; - this.back = 0; - this.was = 0; - } - function inflateResetKeep(strm) { - var state; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - state = strm.state; - strm.total_in = strm.total_out = state.total = 0; - strm.msg = ""; - if (state.wrap) { - strm.adler = state.wrap & 1; - } - state.mode = HEAD; - state.last = 0; - state.havedict = 0; - state.dmax = 32768; - state.head = null; - state.hold = 0; - state.bits = 0; - state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); - state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); - state.sane = 1; - state.back = -1; - return Z_OK; - } - function inflateReset(strm) { - var state; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - state = strm.state; - state.wsize = 0; - state.whave = 0; - state.wnext = 0; - return inflateResetKeep(strm); - } - function inflateReset2(strm, windowBits) { - var wrap; - var state; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - state = strm.state; - if (windowBits < 0) { - wrap = 0; - windowBits = -windowBits; - } else { - wrap = (windowBits >> 4) + 1; - if (windowBits < 48) { - windowBits &= 15; - } - } - if (windowBits && (windowBits < 8 || windowBits > 15)) { - return Z_STREAM_ERROR; - } - if (state.window !== null && state.wbits !== windowBits) { - state.window = null; - } - state.wrap = wrap; - state.wbits = windowBits; - return inflateReset(strm); - } - function inflateInit2(strm, windowBits) { - var ret2; - var state; - if (!strm) { - return Z_STREAM_ERROR; - } - state = new InflateState(); - strm.state = state; - state.window = null; - ret2 = inflateReset2(strm, windowBits); - if (ret2 !== Z_OK) { - strm.state = null; - } - return ret2; - } - function inflateInit(strm) { - return inflateInit2(strm, DEF_WBITS); - } - var virgin = true; - var lenfix; - var distfix; - function fixedtables(state) { - if (virgin) { - var sym; - lenfix = new utils.Buf32(512); - distfix = new utils.Buf32(32); - sym = 0; - while (sym < 144) { - state.lens[sym++] = 8; - } - while (sym < 256) { - state.lens[sym++] = 9; - } - while (sym < 280) { - state.lens[sym++] = 7; - } - while (sym < 288) { - state.lens[sym++] = 8; - } - inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); - sym = 0; - while (sym < 32) { - state.lens[sym++] = 5; - } - inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); - virgin = false; - } - state.lencode = lenfix; - state.lenbits = 9; - state.distcode = distfix; - state.distbits = 5; - } - function updatewindow(strm, src2, end, copy) { - var dist; - var state = strm.state; - if (state.window === null) { - state.wsize = 1 << state.wbits; - state.wnext = 0; - state.whave = 0; - state.window = new utils.Buf8(state.wsize); - } - if (copy >= state.wsize) { - utils.arraySet(state.window, src2, end - state.wsize, state.wsize, 0); - state.wnext = 0; - state.whave = state.wsize; - } else { - dist = state.wsize - state.wnext; - if (dist > copy) { - dist = copy; - } - utils.arraySet(state.window, src2, end - copy, dist, state.wnext); - copy -= dist; - if (copy) { - utils.arraySet(state.window, src2, end - copy, copy, 0); - state.wnext = copy; - state.whave = state.wsize; - } else { - state.wnext += dist; - if (state.wnext === state.wsize) { - state.wnext = 0; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.addBack = exports2.add = exports2.end = exports2.slice = exports2.index = exports2.toArray = exports2.get = exports2.eq = exports2.last = exports2.first = exports2.has = exports2.not = exports2.is = exports2.filterArray = exports2.filter = exports2.map = exports2.each = exports2.contents = exports2.children = exports2.siblings = exports2.prevUntil = exports2.prevAll = exports2.prev = exports2.nextUntil = exports2.nextAll = exports2.next = exports2.closest = exports2.parentsUntil = exports2.parents = exports2.parent = exports2.find = void 0; + var tslib_1 = require_tslib(); + var domhandler_1 = require_lib3(); + var select = tslib_1.__importStar(require_lib9()); + var utils_1 = require_utils2(); + var static_1 = require_static(); + var htmlparser2_1 = require_lib10(); + var uniqueSort = htmlparser2_1.DomUtils.uniqueSort; + var reSiblingSelector = /^\s*[~+]/; + function find(selectorOrHaystack) { + var _a; + if (!selectorOrHaystack) { + return this._make([]); + } + var context = this.toArray(); + if (typeof selectorOrHaystack !== "string") { + var haystack = utils_1.isCheerio(selectorOrHaystack) ? selectorOrHaystack.toArray() : [selectorOrHaystack]; + return this._make(haystack.filter(function(elem) { + return context.some(function(node) { + return static_1.contains(node, elem); + }); + })); + } + var elems = reSiblingSelector.test(selectorOrHaystack) ? context : this.children().toArray(); + var options2 = { + context, + root: (_a = this._root) === null || _a === void 0 ? void 0 : _a[0], + xmlMode: this.options.xmlMode + }; + return this._make(select.select(selectorOrHaystack, elems, options2)); + } + exports2.find = find; + function _getMatcher(matchMap) { + return function(fn) { + var postFns = []; + for (var _i = 1; _i < arguments.length; _i++) { + postFns[_i - 1] = arguments[_i]; + } + return function(selector) { + var _a; + var matched = matchMap(fn, this); + if (selector) { + matched = filterArray(matched, selector, this.options.xmlMode, (_a = this._root) === null || _a === void 0 ? void 0 : _a[0]); + } + return this._make(this.length > 1 && matched.length > 1 ? postFns.reduce(function(elems, fn2) { + return fn2(elems); + }, matched) : matched); + }; + }; + } + var _matcher = _getMatcher(function(fn, elems) { + var _a; + var ret = []; + for (var i = 0; i < elems.length; i++) { + var value = fn(elems[i]); + ret.push(value); + } + return (_a = new Array()).concat.apply(_a, ret); + }); + var _singleMatcher = _getMatcher(function(fn, elems) { + var ret = []; + for (var i = 0; i < elems.length; i++) { + var value = fn(elems[i]); + if (value !== null) { + ret.push(value); + } + } + return ret; + }); + function _matchUntil(nextElem) { + var postFns = []; + for (var _i = 1; _i < arguments.length; _i++) { + postFns[_i - 1] = arguments[_i]; + } + var matches = null; + var innerMatcher = _getMatcher(function(nextElem2, elems) { + var matched = []; + utils_1.domEach(elems, function(elem) { + for (var next_1; next_1 = nextElem2(elem); elem = next_1) { + if (matches === null || matches === void 0 ? void 0 : matches(next_1, matched.length)) + break; + matched.push(next_1); } - if (state.whave < state.wsize) { - state.whave += dist; + }); + return matched; + }).apply(void 0, tslib_1.__spreadArray([nextElem], postFns)); + return function(selector, filterSelector) { + var _this = this; + matches = typeof selector === "string" ? function(elem) { + return select.is(elem, selector, _this.options); + } : selector ? getFilterFn(selector) : null; + var ret = innerMatcher.call(this, filterSelector); + matches = null; + return ret; + }; + } + function _removeDuplicates(elems) { + return Array.from(new Set(elems)); + } + exports2.parent = _singleMatcher(function(_a) { + var parent = _a.parent; + return parent && !domhandler_1.isDocument(parent) ? parent : null; + }, _removeDuplicates); + exports2.parents = _matcher(function(elem) { + var matched = []; + while (elem.parent && !domhandler_1.isDocument(elem.parent)) { + matched.push(elem.parent); + elem = elem.parent; + } + return matched; + }, uniqueSort, function(elems) { + return elems.reverse(); + }); + exports2.parentsUntil = _matchUntil(function(_a) { + var parent = _a.parent; + return parent && !domhandler_1.isDocument(parent) ? parent : null; + }, uniqueSort, function(elems) { + return elems.reverse(); + }); + function closest(selector) { + var _this = this; + var set = []; + if (!selector) { + return this._make(set); + } + utils_1.domEach(this, function(elem) { + var _a; + while (elem && elem.type !== "root") { + if (!selector || filterArray([elem], selector, _this.options.xmlMode, (_a = _this._root) === null || _a === void 0 ? void 0 : _a[0]).length) { + if (elem && !set.includes(elem)) { + set.push(elem); + } + break; } + elem = elem.parent; + } + }); + return this._make(set); + } + exports2.closest = closest; + exports2.next = _singleMatcher(function(elem) { + return htmlparser2_1.DomUtils.nextElementSibling(elem); + }); + exports2.nextAll = _matcher(function(elem) { + var matched = []; + while (elem.next) { + elem = elem.next; + if (utils_1.isTag(elem)) + matched.push(elem); + } + return matched; + }, _removeDuplicates); + exports2.nextUntil = _matchUntil(function(el) { + return htmlparser2_1.DomUtils.nextElementSibling(el); + }, _removeDuplicates); + exports2.prev = _singleMatcher(function(elem) { + return htmlparser2_1.DomUtils.prevElementSibling(elem); + }); + exports2.prevAll = _matcher(function(elem) { + var matched = []; + while (elem.prev) { + elem = elem.prev; + if (utils_1.isTag(elem)) + matched.push(elem); + } + return matched; + }, _removeDuplicates); + exports2.prevUntil = _matchUntil(function(el) { + return htmlparser2_1.DomUtils.prevElementSibling(el); + }, _removeDuplicates); + exports2.siblings = _matcher(function(elem) { + return htmlparser2_1.DomUtils.getSiblings(elem).filter(function(el) { + return utils_1.isTag(el) && el !== elem; + }); + }, uniqueSort); + exports2.children = _matcher(function(elem) { + return htmlparser2_1.DomUtils.getChildren(elem).filter(utils_1.isTag); + }, _removeDuplicates); + function contents() { + var elems = this.toArray().reduce(function(newElems, elem) { + return domhandler_1.hasChildren(elem) ? newElems.concat(elem.children) : newElems; + }, []); + return this._make(elems); + } + exports2.contents = contents; + function each2(fn) { + var i = 0; + var len = this.length; + while (i < len && fn.call(this[i], i, this[i]) !== false) + ++i; + return this; + } + exports2.each = each2; + function map(fn) { + var elems = []; + for (var i = 0; i < this.length; i++) { + var el = this[i]; + var val = fn.call(el, i, el); + if (val != null) { + elems = elems.concat(val); } } - return 0; + return this._make(elems); } - function inflate(strm, flush) { - var state; - var input, output; - var next; - var put; - var have, left; - var hold; - var bits; - var _in, _out; - var copy; - var from; - var from_source; - var here = 0; - var here_bits, here_op, here_val; - var last_bits, last_op, last_val; - var len; - var ret2; - var hbuf = new utils.Buf8(4); - var opts; - var n; - var order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; - if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) { - return Z_STREAM_ERROR; - } - state = strm.state; - if (state.mode === TYPE) { - state.mode = TYPEDO; - } - put = strm.next_out; - output = strm.output; - left = strm.avail_out; - next = strm.next_in; - input = strm.input; - have = strm.avail_in; - hold = state.hold; - bits = state.bits; - _in = have; - _out = left; - ret2 = Z_OK; - inf_leave: - for (; ; ) { - switch (state.mode) { - case HEAD: - if (state.wrap === 0) { - state.mode = TYPEDO; - break; - } - while (bits < 16) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (state.wrap & 2 && hold === 35615) { - state.check = 0; - hbuf[0] = hold & 255; - hbuf[1] = hold >>> 8 & 255; - state.check = crc32(state.check, hbuf, 2, 0); - hold = 0; - bits = 0; - state.mode = FLAGS; - break; - } - state.flags = 0; - if (state.head) { - state.head.done = false; - } - if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) { - strm.msg = "incorrect header check"; - state.mode = BAD; - break; - } - if ((hold & 15) !== Z_DEFLATED) { - strm.msg = "unknown compression method"; - state.mode = BAD; - break; - } - hold >>>= 4; - bits -= 4; - len = (hold & 15) + 8; - if (state.wbits === 0) { - state.wbits = len; - } else if (len > state.wbits) { - strm.msg = "invalid window size"; - state.mode = BAD; - break; - } - state.dmax = 1 << len; - strm.adler = state.check = 1; - state.mode = hold & 512 ? DICTID : TYPE; - hold = 0; - bits = 0; - break; - case FLAGS: - while (bits < 16) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.flags = hold; - if ((state.flags & 255) !== Z_DEFLATED) { - strm.msg = "unknown compression method"; - state.mode = BAD; - break; - } - if (state.flags & 57344) { - strm.msg = "unknown header flags set"; - state.mode = BAD; - break; - } - if (state.head) { - state.head.text = hold >> 8 & 1; - } - if (state.flags & 512) { - hbuf[0] = hold & 255; - hbuf[1] = hold >>> 8 & 255; - state.check = crc32(state.check, hbuf, 2, 0); - } - hold = 0; - bits = 0; - state.mode = TIME; - case TIME: - while (bits < 32) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (state.head) { - state.head.time = hold; - } - if (state.flags & 512) { - hbuf[0] = hold & 255; - hbuf[1] = hold >>> 8 & 255; - hbuf[2] = hold >>> 16 & 255; - hbuf[3] = hold >>> 24 & 255; - state.check = crc32(state.check, hbuf, 4, 0); - } - hold = 0; - bits = 0; - state.mode = OS; - case OS: - while (bits < 16) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (state.head) { - state.head.xflags = hold & 255; - state.head.os = hold >> 8; - } - if (state.flags & 512) { - hbuf[0] = hold & 255; - hbuf[1] = hold >>> 8 & 255; - state.check = crc32(state.check, hbuf, 2, 0); - } - hold = 0; - bits = 0; - state.mode = EXLEN; - case EXLEN: - if (state.flags & 1024) { - while (bits < 16) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.length = hold; - if (state.head) { - state.head.extra_len = hold; - } - if (state.flags & 512) { - hbuf[0] = hold & 255; - hbuf[1] = hold >>> 8 & 255; - state.check = crc32(state.check, hbuf, 2, 0); - } - hold = 0; - bits = 0; - } else if (state.head) { - state.head.extra = null; - } - state.mode = EXTRA; - case EXTRA: - if (state.flags & 1024) { - copy = state.length; - if (copy > have) { - copy = have; - } - if (copy) { - if (state.head) { - len = state.head.extra_len - state.length; - if (!state.head.extra) { - state.head.extra = new Array(state.head.extra_len); - } - utils.arraySet(state.head.extra, input, next, copy, len); - } - if (state.flags & 512) { - state.check = crc32(state.check, input, copy, next); - } - have -= copy; - next += copy; - state.length -= copy; - } - if (state.length) { - break inf_leave; - } - } - state.length = 0; - state.mode = NAME2; - case NAME2: - if (state.flags & 2048) { - if (have === 0) { - break inf_leave; - } - copy = 0; - do { - len = input[next + copy++]; - if (state.head && len && state.length < 65536) { - state.head.name += String.fromCharCode(len); - } - } while (len && copy < have); - if (state.flags & 512) { - state.check = crc32(state.check, input, copy, next); - } - have -= copy; - next += copy; - if (len) { - break inf_leave; - } - } else if (state.head) { - state.head.name = null; - } - state.length = 0; - state.mode = COMMENT; - case COMMENT: - if (state.flags & 4096) { - if (have === 0) { - break inf_leave; - } - copy = 0; - do { - len = input[next + copy++]; - if (state.head && len && state.length < 65536) { - state.head.comment += String.fromCharCode(len); - } - } while (len && copy < have); - if (state.flags & 512) { - state.check = crc32(state.check, input, copy, next); - } - have -= copy; - next += copy; - if (len) { - break inf_leave; - } - } else if (state.head) { - state.head.comment = null; - } - state.mode = HCRC; - case HCRC: - if (state.flags & 512) { - while (bits < 16) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (hold !== (state.check & 65535)) { - strm.msg = "header crc mismatch"; - state.mode = BAD; - break; - } - hold = 0; - bits = 0; - } - if (state.head) { - state.head.hcrc = state.flags >> 9 & 1; - state.head.done = true; - } - strm.adler = state.check = 0; - state.mode = TYPE; - break; - case DICTID: - while (bits < 32) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - strm.adler = state.check = zswap32(hold); - hold = 0; - bits = 0; - state.mode = DICT; - case DICT: - if (state.havedict === 0) { - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - return Z_NEED_DICT; - } - strm.adler = state.check = 1; - state.mode = TYPE; - case TYPE: - if (flush === Z_BLOCK || flush === Z_TREES) { - break inf_leave; - } - case TYPEDO: - if (state.last) { - hold >>>= bits & 7; - bits -= bits & 7; - state.mode = CHECK; - break; - } - while (bits < 3) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.last = hold & 1; - hold >>>= 1; - bits -= 1; - switch (hold & 3) { - case 0: - state.mode = STORED; - break; - case 1: - fixedtables(state); - state.mode = LEN_; - if (flush === Z_TREES) { - hold >>>= 2; - bits -= 2; - break inf_leave; - } - break; - case 2: - state.mode = TABLE; - break; - case 3: - strm.msg = "invalid block type"; - state.mode = BAD; - } - hold >>>= 2; - bits -= 2; - break; - case STORED: - hold >>>= bits & 7; - bits -= bits & 7; - while (bits < 32) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if ((hold & 65535) !== (hold >>> 16 ^ 65535)) { - strm.msg = "invalid stored block lengths"; - state.mode = BAD; - break; - } - state.length = hold & 65535; - hold = 0; - bits = 0; - state.mode = COPY_; - if (flush === Z_TREES) { - break inf_leave; - } - case COPY_: - state.mode = COPY; - case COPY: - copy = state.length; - if (copy) { - if (copy > have) { - copy = have; - } - if (copy > left) { - copy = left; - } - if (copy === 0) { - break inf_leave; - } - utils.arraySet(output, input, next, copy, put); - have -= copy; - next += copy; - left -= copy; - put += copy; - state.length -= copy; - break; - } - state.mode = TYPE; - break; - case TABLE: - while (bits < 14) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.nlen = (hold & 31) + 257; - hold >>>= 5; - bits -= 5; - state.ndist = (hold & 31) + 1; - hold >>>= 5; - bits -= 5; - state.ncode = (hold & 15) + 4; - hold >>>= 4; - bits -= 4; - if (state.nlen > 286 || state.ndist > 30) { - strm.msg = "too many length or distance symbols"; - state.mode = BAD; - break; - } - state.have = 0; - state.mode = LENLENS; - case LENLENS: - while (state.have < state.ncode) { - while (bits < 3) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.lens[order[state.have++]] = hold & 7; - hold >>>= 3; - bits -= 3; - } - while (state.have < 19) { - state.lens[order[state.have++]] = 0; - } - state.lencode = state.lendyn; - state.lenbits = 7; - opts = { bits: state.lenbits }; - ret2 = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); - state.lenbits = opts.bits; - if (ret2) { - strm.msg = "invalid code lengths set"; - state.mode = BAD; - break; - } - state.have = 0; - state.mode = CODELENS; - case CODELENS: - while (state.have < state.nlen + state.ndist) { - for (; ; ) { - here = state.lencode[hold & (1 << state.lenbits) - 1]; - here_bits = here >>> 24; - here_op = here >>> 16 & 255; - here_val = here & 65535; - if (here_bits <= bits) { - break; - } - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (here_val < 16) { - hold >>>= here_bits; - bits -= here_bits; - state.lens[state.have++] = here_val; - } else { - if (here_val === 16) { - n = here_bits + 2; - while (bits < n) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - hold >>>= here_bits; - bits -= here_bits; - if (state.have === 0) { - strm.msg = "invalid bit length repeat"; - state.mode = BAD; - break; - } - len = state.lens[state.have - 1]; - copy = 3 + (hold & 3); - hold >>>= 2; - bits -= 2; - } else if (here_val === 17) { - n = here_bits + 3; - while (bits < n) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - hold >>>= here_bits; - bits -= here_bits; - len = 0; - copy = 3 + (hold & 7); - hold >>>= 3; - bits -= 3; - } else { - n = here_bits + 7; - while (bits < n) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - hold >>>= here_bits; - bits -= here_bits; - len = 0; - copy = 11 + (hold & 127); - hold >>>= 7; - bits -= 7; - } - if (state.have + copy > state.nlen + state.ndist) { - strm.msg = "invalid bit length repeat"; - state.mode = BAD; - break; - } - while (copy--) { - state.lens[state.have++] = len; - } - } - } - if (state.mode === BAD) { - break; - } - if (state.lens[256] === 0) { - strm.msg = "invalid code -- missing end-of-block"; - state.mode = BAD; - break; - } - state.lenbits = 9; - opts = { bits: state.lenbits }; - ret2 = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); - state.lenbits = opts.bits; - if (ret2) { - strm.msg = "invalid literal/lengths set"; - state.mode = BAD; - break; - } - state.distbits = 6; - state.distcode = state.distdyn; - opts = { bits: state.distbits }; - ret2 = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); - state.distbits = opts.bits; - if (ret2) { - strm.msg = "invalid distances set"; - state.mode = BAD; - break; - } - state.mode = LEN_; - if (flush === Z_TREES) { - break inf_leave; - } - case LEN_: - state.mode = LEN; - case LEN: - if (have >= 6 && left >= 258) { - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - inflate_fast(strm, _out); - put = strm.next_out; - output = strm.output; - left = strm.avail_out; - next = strm.next_in; - input = strm.input; - have = strm.avail_in; - hold = state.hold; - bits = state.bits; - if (state.mode === TYPE) { - state.back = -1; - } - break; - } - state.back = 0; - for (; ; ) { - here = state.lencode[hold & (1 << state.lenbits) - 1]; - here_bits = here >>> 24; - here_op = here >>> 16 & 255; - here_val = here & 65535; - if (here_bits <= bits) { - break; - } - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (here_op && (here_op & 240) === 0) { - last_bits = here_bits; - last_op = here_op; - last_val = here_val; - for (; ; ) { - here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; - here_bits = here >>> 24; - here_op = here >>> 16 & 255; - here_val = here & 65535; - if (last_bits + here_bits <= bits) { - break; - } - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - hold >>>= last_bits; - bits -= last_bits; - state.back += last_bits; - } - hold >>>= here_bits; - bits -= here_bits; - state.back += here_bits; - state.length = here_val; - if (here_op === 0) { - state.mode = LIT; - break; - } - if (here_op & 32) { - state.back = -1; - state.mode = TYPE; - break; - } - if (here_op & 64) { - strm.msg = "invalid literal/length code"; - state.mode = BAD; - break; - } - state.extra = here_op & 15; - state.mode = LENEXT; - case LENEXT: - if (state.extra) { - n = state.extra; - while (bits < n) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.length += hold & (1 << state.extra) - 1; - hold >>>= state.extra; - bits -= state.extra; - state.back += state.extra; - } - state.was = state.length; - state.mode = DIST; - case DIST: - for (; ; ) { - here = state.distcode[hold & (1 << state.distbits) - 1]; - here_bits = here >>> 24; - here_op = here >>> 16 & 255; - here_val = here & 65535; - if (here_bits <= bits) { - break; - } - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if ((here_op & 240) === 0) { - last_bits = here_bits; - last_op = here_op; - last_val = here_val; - for (; ; ) { - here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; - here_bits = here >>> 24; - here_op = here >>> 16 & 255; - here_val = here & 65535; - if (last_bits + here_bits <= bits) { - break; - } - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - hold >>>= last_bits; - bits -= last_bits; - state.back += last_bits; - } - hold >>>= here_bits; - bits -= here_bits; - state.back += here_bits; - if (here_op & 64) { - strm.msg = "invalid distance code"; - state.mode = BAD; - break; - } - state.offset = here_val; - state.extra = here_op & 15; - state.mode = DISTEXT; - case DISTEXT: - if (state.extra) { - n = state.extra; - while (bits < n) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.offset += hold & (1 << state.extra) - 1; - hold >>>= state.extra; - bits -= state.extra; - state.back += state.extra; - } - if (state.offset > state.dmax) { - strm.msg = "invalid distance too far back"; - state.mode = BAD; - break; - } - state.mode = MATCH; - case MATCH: - if (left === 0) { - break inf_leave; - } - copy = _out - left; - if (state.offset > copy) { - copy = state.offset - copy; - if (copy > state.whave) { - if (state.sane) { - strm.msg = "invalid distance too far back"; - state.mode = BAD; - break; - } - } - if (copy > state.wnext) { - copy -= state.wnext; - from = state.wsize - copy; - } else { - from = state.wnext - copy; - } - if (copy > state.length) { - copy = state.length; - } - from_source = state.window; - } else { - from_source = output; - from = put - state.offset; - copy = state.length; - } - if (copy > left) { - copy = left; - } - left -= copy; - state.length -= copy; - do { - output[put++] = from_source[from++]; - } while (--copy); - if (state.length === 0) { - state.mode = LEN; - } - break; - case LIT: - if (left === 0) { - break inf_leave; - } - output[put++] = state.length; - left--; - state.mode = LEN; - break; - case CHECK: - if (state.wrap) { - while (bits < 32) { - if (have === 0) { - break inf_leave; - } - have--; - hold |= input[next++] << bits; - bits += 8; - } - _out -= left; - strm.total_out += _out; - state.total += _out; - if (_out) { - strm.adler = state.check = state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out); - } - _out = left; - if ((state.flags ? hold : zswap32(hold)) !== state.check) { - strm.msg = "incorrect data check"; - state.mode = BAD; - break; - } - hold = 0; - bits = 0; - } - state.mode = LENGTH; - case LENGTH: - if (state.wrap && state.flags) { - while (bits < 32) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (hold !== (state.total & 4294967295)) { - strm.msg = "incorrect length check"; - state.mode = BAD; - break; - } - hold = 0; - bits = 0; - } - state.mode = DONE; - case DONE: - ret2 = Z_STREAM_END; - break inf_leave; - case BAD: - ret2 = Z_DATA_ERROR; - break inf_leave; - case MEM: - return Z_MEM_ERROR; - case SYNC: - default: - return Z_STREAM_ERROR; - } - } - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) { - if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { - state.mode = MEM; - return Z_MEM_ERROR; - } - } - _in -= strm.avail_in; - _out -= strm.avail_out; - strm.total_in += _in; - strm.total_out += _out; - state.total += _out; - if (state.wrap && _out) { - strm.adler = state.check = state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out); - } - strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); - if ((_in === 0 && _out === 0 || flush === Z_FINISH) && ret2 === Z_OK) { - ret2 = Z_BUF_ERROR; - } - return ret2; - } - function inflateEnd(strm) { - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - var state = strm.state; - if (state.window) { - state.window = null; - } - strm.state = null; - return Z_OK; - } - function inflateGetHeader(strm, head) { - var state; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - state = strm.state; - if ((state.wrap & 2) === 0) { - return Z_STREAM_ERROR; - } - state.head = head; - head.done = false; - return Z_OK; - } - function inflateSetDictionary(strm, dictionary) { - var dictLength = dictionary.length; - var state; - var dictid; - var ret2; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - state = strm.state; - if (state.wrap !== 0 && state.mode !== DICT) { - return Z_STREAM_ERROR; - } - if (state.mode === DICT) { - dictid = 1; - dictid = adler32(dictid, dictionary, dictLength, 0); - if (dictid !== state.check) { - return Z_DATA_ERROR; - } - } - ret2 = updatewindow(strm, dictionary, dictLength, dictLength); - if (ret2) { - state.mode = MEM; - return Z_MEM_ERROR; - } - state.havedict = 1; - return Z_OK; - } - exports2.inflateReset = inflateReset; - exports2.inflateReset2 = inflateReset2; - exports2.inflateResetKeep = inflateResetKeep; - exports2.inflateInit = inflateInit; - exports2.inflateInit2 = inflateInit2; - exports2.inflate = inflate; - exports2.inflateEnd = inflateEnd; - exports2.inflateGetHeader = inflateGetHeader; - exports2.inflateSetDictionary = inflateSetDictionary; - exports2.inflateInfo = "pako inflate (from Nodeca project)"; - } -}); - -// node_modules/pako/lib/zlib/constants.js -var require_constants = __commonJS({ - "node_modules/pako/lib/zlib/constants.js"(exports2, module2) { - init_shims(); - "use strict"; - module2.exports = { - Z_NO_FLUSH: 0, - Z_PARTIAL_FLUSH: 1, - Z_SYNC_FLUSH: 2, - Z_FULL_FLUSH: 3, - Z_FINISH: 4, - Z_BLOCK: 5, - Z_TREES: 6, - Z_OK: 0, - Z_STREAM_END: 1, - Z_NEED_DICT: 2, - Z_ERRNO: -1, - Z_STREAM_ERROR: -2, - Z_DATA_ERROR: -3, - Z_BUF_ERROR: -5, - Z_NO_COMPRESSION: 0, - Z_BEST_SPEED: 1, - Z_BEST_COMPRESSION: 9, - Z_DEFAULT_COMPRESSION: -1, - Z_FILTERED: 1, - Z_HUFFMAN_ONLY: 2, - Z_RLE: 3, - Z_FIXED: 4, - Z_DEFAULT_STRATEGY: 0, - Z_BINARY: 0, - Z_TEXT: 1, - Z_UNKNOWN: 2, - Z_DEFLATED: 8 - }; - } -}); - -// node_modules/pako/lib/zlib/gzheader.js -var require_gzheader = __commonJS({ - "node_modules/pako/lib/zlib/gzheader.js"(exports2, module2) { - init_shims(); - "use strict"; - function GZheader() { - this.text = 0; - this.time = 0; - this.xflags = 0; - this.os = 0; - this.extra = null; - this.extra_len = 0; - this.name = ""; - this.comment = ""; - this.hcrc = 0; - this.done = false; - } - module2.exports = GZheader; - } -}); - -// node_modules/pako/lib/inflate.js -var require_inflate2 = __commonJS({ - "node_modules/pako/lib/inflate.js"(exports2) { - init_shims(); - "use strict"; - var zlib_inflate = require_inflate(); - var utils = require_common2(); - var strings = require_strings(); - var c = require_constants(); - var msg = require_messages(); - var ZStream = require_zstream(); - var GZheader = require_gzheader(); - var toString = Object.prototype.toString; - function Inflate(options2) { - if (!(this instanceof Inflate)) - return new Inflate(options2); - this.options = utils.assign({ - chunkSize: 16384, - windowBits: 0, - to: "" - }, options2 || {}); - var opt = this.options; - if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) { - opt.windowBits = -opt.windowBits; - if (opt.windowBits === 0) { - opt.windowBits = -15; - } - } - if (opt.windowBits >= 0 && opt.windowBits < 16 && !(options2 && options2.windowBits)) { - opt.windowBits += 32; - } - if (opt.windowBits > 15 && opt.windowBits < 48) { - if ((opt.windowBits & 15) === 0) { - opt.windowBits |= 15; - } - } - this.err = 0; - this.msg = ""; - this.ended = false; - this.chunks = []; - this.strm = new ZStream(); - this.strm.avail_out = 0; - var status = zlib_inflate.inflateInit2(this.strm, opt.windowBits); - if (status !== c.Z_OK) { - throw new Error(msg[status]); - } - this.header = new GZheader(); - zlib_inflate.inflateGetHeader(this.strm, this.header); - if (opt.dictionary) { - if (typeof opt.dictionary === "string") { - opt.dictionary = strings.string2buf(opt.dictionary); - } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") { - opt.dictionary = new Uint8Array(opt.dictionary); - } - if (opt.raw) { - status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary); - if (status !== c.Z_OK) { - throw new Error(msg[status]); - } - } - } - } - Inflate.prototype.push = function(data, mode) { - var strm = this.strm; - var chunkSize = this.options.chunkSize; - var dictionary = this.options.dictionary; - var status, _mode; - var next_out_utf8, tail, utf8str; - var allowBufError = false; - if (this.ended) { - return false; - } - _mode = mode === ~~mode ? mode : mode === true ? c.Z_FINISH : c.Z_NO_FLUSH; - if (typeof data === "string") { - strm.input = strings.binstring2buf(data); - } else if (toString.call(data) === "[object ArrayBuffer]") { - strm.input = new Uint8Array(data); - } else { - strm.input = data; - } - strm.next_in = 0; - strm.avail_in = strm.input.length; - do { - if (strm.avail_out === 0) { - strm.output = new utils.Buf8(chunkSize); - strm.next_out = 0; - strm.avail_out = chunkSize; - } - status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); - if (status === c.Z_NEED_DICT && dictionary) { - status = zlib_inflate.inflateSetDictionary(this.strm, dictionary); - } - if (status === c.Z_BUF_ERROR && allowBufError === true) { - status = c.Z_OK; - allowBufError = false; - } - if (status !== c.Z_STREAM_END && status !== c.Z_OK) { - this.onEnd(status); - this.ended = true; - return false; - } - if (strm.next_out) { - if (strm.avail_out === 0 || status === c.Z_STREAM_END || strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH)) { - if (this.options.to === "string") { - next_out_utf8 = strings.utf8border(strm.output, strm.next_out); - tail = strm.next_out - next_out_utf8; - utf8str = strings.buf2string(strm.output, next_out_utf8); - strm.next_out = tail; - strm.avail_out = chunkSize - tail; - if (tail) { - utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); - } - this.onData(utf8str); - } else { - this.onData(utils.shrinkBuf(strm.output, strm.next_out)); - } - } - } - if (strm.avail_in === 0 && strm.avail_out === 0) { - allowBufError = true; - } - } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END); - if (status === c.Z_STREAM_END) { - _mode = c.Z_FINISH; - } - if (_mode === c.Z_FINISH) { - status = zlib_inflate.inflateEnd(this.strm); - this.onEnd(status); - this.ended = true; - return status === c.Z_OK; - } - if (_mode === c.Z_SYNC_FLUSH) { - this.onEnd(c.Z_OK); - strm.avail_out = 0; - return true; - } - return true; - }; - Inflate.prototype.onData = function(chunk) { - this.chunks.push(chunk); - }; - Inflate.prototype.onEnd = function(status) { - if (status === c.Z_OK) { - if (this.options.to === "string") { - this.result = this.chunks.join(""); - } else { - this.result = utils.flattenChunks(this.chunks); - } + exports2.map = map; + function getFilterFn(match) { + if (typeof match === "function") { + return function(el, i) { + return match.call(el, i, el); + }; } - this.chunks = []; - this.err = status; - this.msg = this.strm.msg; - }; - function inflate(input, options2) { - var inflator = new Inflate(options2); - inflator.push(input, true); - if (inflator.err) { - throw inflator.msg || msg[inflator.err]; + if (utils_1.isCheerio(match)) { + return function(el) { + return Array.prototype.includes.call(match, el); + }; } - return inflator.result; + return function(el) { + return match === el; + }; } - function inflateRaw(input, options2) { - options2 = options2 || {}; - options2.raw = true; - return inflate(input, options2); + function filter(match) { + var _a; + return this._make(filterArray(this.toArray(), match, this.options.xmlMode, (_a = this._root) === null || _a === void 0 ? void 0 : _a[0])); } - exports2.Inflate = Inflate; - exports2.inflate = inflate; - exports2.inflateRaw = inflateRaw; - exports2.ungzip = inflate; - } -}); - -// node_modules/pako/index.js -var require_pako = __commonJS({ - "node_modules/pako/index.js"(exports2, module2) { - init_shims(); - "use strict"; - var assign2 = require_common2().assign; - var deflate = require_deflate2(); - var inflate = require_inflate2(); - var constants = require_constants(); - var pako = {}; - assign2(pako, deflate, inflate, constants); - module2.exports = pako; - } -}); - -// node_modules/jszip/lib/flate.js -var require_flate = __commonJS({ - "node_modules/jszip/lib/flate.js"(exports2) { - init_shims(); - "use strict"; - var USE_TYPEDARRAY = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Uint32Array !== "undefined"; - var pako = require_pako(); - var utils = require_utils2(); - var GenericWorker = require_GenericWorker(); - var ARRAY_TYPE = USE_TYPEDARRAY ? "uint8array" : "array"; - exports2.magic = "\b\0"; - function FlateWorker(action, options2) { - GenericWorker.call(this, "FlateWorker/" + action); - this._pako = null; - this._pakoAction = action; - this._pakoOptions = options2; - this.meta = {}; - } - utils.inherits(FlateWorker, GenericWorker); - FlateWorker.prototype.processChunk = function(chunk) { - this.meta = chunk.meta; - if (this._pako === null) { - this._createPako(); - } - this._pako.push(utils.transformTo(ARRAY_TYPE, chunk.data), false); - }; - FlateWorker.prototype.flush = function() { - GenericWorker.prototype.flush.call(this); - if (this._pako === null) { - this._createPako(); - } - this._pako.push([], true); - }; - FlateWorker.prototype.cleanUp = function() { - GenericWorker.prototype.cleanUp.call(this); - this._pako = null; - }; - FlateWorker.prototype._createPako = function() { - this._pako = new pako[this._pakoAction]({ - raw: true, - level: this._pakoOptions.level || -1 - }); - var self2 = this; - this._pako.onData = function(data) { - self2.push({ - data, - meta: self2.meta - }); - }; - }; - exports2.compressWorker = function(compressionOptions) { - return new FlateWorker("Deflate", compressionOptions); - }; - exports2.uncompressWorker = function() { - return new FlateWorker("Inflate", {}); - }; - } -}); - -// node_modules/jszip/lib/compressions.js -var require_compressions = __commonJS({ - "node_modules/jszip/lib/compressions.js"(exports2) { - init_shims(); - "use strict"; - var GenericWorker = require_GenericWorker(); - exports2.STORE = { - magic: "\0\0", - compressWorker: function(compressionOptions) { - return new GenericWorker("STORE compression"); - }, - uncompressWorker: function() { - return new GenericWorker("STORE decompression"); - } - }; - exports2.DEFLATE = require_flate(); - } -}); - -// node_modules/jszip/lib/signature.js -var require_signature = __commonJS({ - "node_modules/jszip/lib/signature.js"(exports2) { - init_shims(); - "use strict"; - exports2.LOCAL_FILE_HEADER = "PK"; - exports2.CENTRAL_FILE_HEADER = "PK"; - exports2.CENTRAL_DIRECTORY_END = "PK"; - exports2.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x07"; - exports2.ZIP64_CENTRAL_DIRECTORY_END = "PK"; - exports2.DATA_DESCRIPTOR = "PK\x07\b"; - } -}); - -// node_modules/jszip/lib/generate/ZipFileWorker.js -var require_ZipFileWorker = __commonJS({ - "node_modules/jszip/lib/generate/ZipFileWorker.js"(exports2, module2) { - init_shims(); - "use strict"; - var utils = require_utils2(); - var GenericWorker = require_GenericWorker(); - var utf8 = require_utf8(); - var crc32 = require_crc32(); - var signature = require_signature(); - var decToHex = function(dec, bytes) { - var hex = "", i; - for (i = 0; i < bytes; i++) { - hex += String.fromCharCode(dec & 255); - dec = dec >>> 8; - } - return hex; - }; - var generateUnixExternalFileAttr = function(unixPermissions, isDir) { - var result = unixPermissions; - if (!unixPermissions) { - result = isDir ? 16893 : 33204; - } - return (result & 65535) << 16; - }; - var generateDosExternalFileAttr = function(dosPermissions, isDir) { - return (dosPermissions || 0) & 63; - }; - var generateZipParts = function(streamInfo, streamedContent, streamingEnded, offset, platform, encodeFileName) { - var file = streamInfo["file"], compression = streamInfo["compression"], useCustomEncoding = encodeFileName !== utf8.utf8encode, encodedFileName = utils.transformTo("string", encodeFileName(file.name)), utfEncodedFileName = utils.transformTo("string", utf8.utf8encode(file.name)), comment = file.comment, encodedComment = utils.transformTo("string", encodeFileName(comment)), utfEncodedComment = utils.transformTo("string", utf8.utf8encode(comment)), useUTF8ForFileName = utfEncodedFileName.length !== file.name.length, useUTF8ForComment = utfEncodedComment.length !== comment.length, dosTime, dosDate, extraFields = "", unicodePathExtraField = "", unicodeCommentExtraField = "", dir = file.dir, date = file.date; - var dataInfo = { - crc32: 0, - compressedSize: 0, - uncompressedSize: 0 - }; - if (!streamedContent || streamingEnded) { - dataInfo.crc32 = streamInfo["crc32"]; - dataInfo.compressedSize = streamInfo["compressedSize"]; - dataInfo.uncompressedSize = streamInfo["uncompressedSize"]; - } - var bitflag = 0; - if (streamedContent) { - bitflag |= 8; - } - if (!useCustomEncoding && (useUTF8ForFileName || useUTF8ForComment)) { - bitflag |= 2048; - } - var extFileAttr = 0; - var versionMadeBy = 0; - if (dir) { - extFileAttr |= 16; - } - if (platform === "UNIX") { - versionMadeBy = 798; - extFileAttr |= generateUnixExternalFileAttr(file.unixPermissions, dir); - } else { - versionMadeBy = 20; - extFileAttr |= generateDosExternalFileAttr(file.dosPermissions, dir); - } - dosTime = date.getUTCHours(); - dosTime = dosTime << 6; - dosTime = dosTime | date.getUTCMinutes(); - dosTime = dosTime << 5; - dosTime = dosTime | date.getUTCSeconds() / 2; - dosDate = date.getUTCFullYear() - 1980; - dosDate = dosDate << 4; - dosDate = dosDate | date.getUTCMonth() + 1; - dosDate = dosDate << 5; - dosDate = dosDate | date.getUTCDate(); - if (useUTF8ForFileName) { - unicodePathExtraField = decToHex(1, 1) + decToHex(crc32(encodedFileName), 4) + utfEncodedFileName; - extraFields += "up" + decToHex(unicodePathExtraField.length, 2) + unicodePathExtraField; - } - if (useUTF8ForComment) { - unicodeCommentExtraField = decToHex(1, 1) + decToHex(crc32(encodedComment), 4) + utfEncodedComment; - extraFields += "uc" + decToHex(unicodeCommentExtraField.length, 2) + unicodeCommentExtraField; - } - var header = ""; - header += "\n\0"; - header += decToHex(bitflag, 2); - header += compression.magic; - header += decToHex(dosTime, 2); - header += decToHex(dosDate, 2); - header += decToHex(dataInfo.crc32, 4); - header += decToHex(dataInfo.compressedSize, 4); - header += decToHex(dataInfo.uncompressedSize, 4); - header += decToHex(encodedFileName.length, 2); - header += decToHex(extraFields.length, 2); - var fileRecord = signature.LOCAL_FILE_HEADER + header + encodedFileName + extraFields; - var dirRecord = signature.CENTRAL_FILE_HEADER + decToHex(versionMadeBy, 2) + header + decToHex(encodedComment.length, 2) + "\0\0\0\0" + decToHex(extFileAttr, 4) + decToHex(offset, 4) + encodedFileName + extraFields + encodedComment; - return { - fileRecord, - dirRecord - }; - }; - var generateCentralDirectoryEnd = function(entriesCount, centralDirLength, localDirLength, comment, encodeFileName) { - var dirEnd = ""; - var encodedComment = utils.transformTo("string", encodeFileName(comment)); - dirEnd = signature.CENTRAL_DIRECTORY_END + "\0\0\0\0" + decToHex(entriesCount, 2) + decToHex(entriesCount, 2) + decToHex(centralDirLength, 4) + decToHex(localDirLength, 4) + decToHex(encodedComment.length, 2) + encodedComment; - return dirEnd; - }; - var generateDataDescriptors = function(streamInfo) { - var descriptor = ""; - descriptor = signature.DATA_DESCRIPTOR + decToHex(streamInfo["crc32"], 4) + decToHex(streamInfo["compressedSize"], 4) + decToHex(streamInfo["uncompressedSize"], 4); - return descriptor; - }; - function ZipFileWorker(streamFiles, comment, platform, encodeFileName) { - GenericWorker.call(this, "ZipFileWorker"); - this.bytesWritten = 0; - this.zipComment = comment; - this.zipPlatform = platform; - this.encodeFileName = encodeFileName; - this.streamFiles = streamFiles; - this.accumulate = false; - this.contentBuffer = []; - this.dirRecords = []; - this.currentSourceOffset = 0; - this.entriesCount = 0; - this.currentFile = null; - this._sources = []; - } - utils.inherits(ZipFileWorker, GenericWorker); - ZipFileWorker.prototype.push = function(chunk) { - var currentFilePercent = chunk.meta.percent || 0; - var entriesCount = this.entriesCount; - var remainingFiles = this._sources.length; - if (this.accumulate) { - this.contentBuffer.push(chunk); - } else { - this.bytesWritten += chunk.data.length; - GenericWorker.prototype.push.call(this, { - data: chunk.data, - meta: { - currentFile: this.currentFile, - percent: entriesCount ? (currentFilePercent + 100 * (entriesCount - remainingFiles - 1)) / entriesCount : 100 - } - }); - } - }; - ZipFileWorker.prototype.openedSource = function(streamInfo) { - this.currentSourceOffset = this.bytesWritten; - this.currentFile = streamInfo["file"].name; - var streamedContent = this.streamFiles && !streamInfo["file"].dir; - if (streamedContent) { - var record = generateZipParts(streamInfo, streamedContent, false, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); - this.push({ - data: record.fileRecord, - meta: { percent: 0 } - }); - } else { - this.accumulate = true; - } - }; - ZipFileWorker.prototype.closedSource = function(streamInfo) { - this.accumulate = false; - var streamedContent = this.streamFiles && !streamInfo["file"].dir; - var record = generateZipParts(streamInfo, streamedContent, true, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); - this.dirRecords.push(record.dirRecord); - if (streamedContent) { - this.push({ - data: generateDataDescriptors(streamInfo), - meta: { percent: 100 } - }); - } else { - this.push({ - data: record.fileRecord, - meta: { percent: 0 } - }); - while (this.contentBuffer.length) { - this.push(this.contentBuffer.shift()); - } - } - this.currentFile = null; - }; - ZipFileWorker.prototype.flush = function() { - var localDirLength = this.bytesWritten; - for (var i = 0; i < this.dirRecords.length; i++) { - this.push({ - data: this.dirRecords[i], - meta: { percent: 100 } - }); - } - var centralDirLength = this.bytesWritten - localDirLength; - var dirEnd = generateCentralDirectoryEnd(this.dirRecords.length, centralDirLength, localDirLength, this.zipComment, this.encodeFileName); - this.push({ - data: dirEnd, - meta: { percent: 100 } - }); - }; - ZipFileWorker.prototype.prepareNextSource = function() { - this.previous = this._sources.shift(); - this.openedSource(this.previous.streamInfo); - if (this.isPaused) { - this.previous.pause(); - } else { - this.previous.resume(); - } - }; - ZipFileWorker.prototype.registerPrevious = function(previous) { - this._sources.push(previous); - var self2 = this; - previous.on("data", function(chunk) { - self2.processChunk(chunk); - }); - previous.on("end", function() { - self2.closedSource(self2.previous.streamInfo); - if (self2._sources.length) { - self2.prepareNextSource(); - } else { - self2.end(); - } - }); - previous.on("error", function(e) { - self2.error(e); - }); - return this; - }; - ZipFileWorker.prototype.resume = function() { - if (!GenericWorker.prototype.resume.call(this)) { - return false; - } - if (!this.previous && this._sources.length) { - this.prepareNextSource(); - return true; - } - if (!this.previous && !this._sources.length && !this.generatedError) { - this.end(); - return true; - } - }; - ZipFileWorker.prototype.error = function(e) { - var sources = this._sources; - if (!GenericWorker.prototype.error.call(this, e)) { - return false; - } - for (var i = 0; i < sources.length; i++) { - try { - sources[i].error(e); - } catch (e2) { - } - } - return true; - }; - ZipFileWorker.prototype.lock = function() { - GenericWorker.prototype.lock.call(this); - var sources = this._sources; - for (var i = 0; i < sources.length; i++) { - sources[i].lock(); - } - }; - module2.exports = ZipFileWorker; - } -}); - -// node_modules/jszip/lib/generate/index.js -var require_generate = __commonJS({ - "node_modules/jszip/lib/generate/index.js"(exports2) { - init_shims(); - "use strict"; - var compressions = require_compressions(); - var ZipFileWorker = require_ZipFileWorker(); - var getCompression = function(fileCompression, zipCompression) { - var compressionName = fileCompression || zipCompression; - var compression = compressions[compressionName]; - if (!compression) { - throw new Error(compressionName + " is not a valid compression method !"); - } - return compression; - }; - exports2.generateWorker = function(zip, options2, comment) { - var zipFileWorker = new ZipFileWorker(options2.streamFiles, comment, options2.platform, options2.encodeFileName); - var entriesCount = 0; - try { - zip.forEach(function(relativePath, file) { - entriesCount++; - var compression = getCompression(file.options.compression, options2.compression); - var compressionOptions = file.options.compressionOptions || options2.compressionOptions || {}; - var dir = file.dir, date = file.date; - file._compressWorker(compression, compressionOptions).withStreamInfo("file", { - name: relativePath, - dir, - date, - comment: file.comment || "", - unixPermissions: file.unixPermissions, - dosPermissions: file.dosPermissions - }).pipe(zipFileWorker); - }); - zipFileWorker.entriesCount = entriesCount; - } catch (e) { - zipFileWorker.error(e); - } - return zipFileWorker; - }; - } -}); - -// node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js -var require_NodejsStreamInputAdapter = __commonJS({ - "node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js"(exports2, module2) { - init_shims(); - "use strict"; - var utils = require_utils2(); - var GenericWorker = require_GenericWorker(); - function NodejsStreamInputAdapter(filename, stream) { - GenericWorker.call(this, "Nodejs stream input adapter for " + filename); - this._upstreamEnded = false; - this._bindStream(stream); - } - utils.inherits(NodejsStreamInputAdapter, GenericWorker); - NodejsStreamInputAdapter.prototype._bindStream = function(stream) { - var self2 = this; - this._stream = stream; - stream.pause(); - stream.on("data", function(chunk) { - self2.push({ - data: chunk, - meta: { - percent: 0 - } + exports2.filter = filter; + function filterArray(nodes, match, xmlMode, root) { + return typeof match === "string" ? select.filter(match, nodes, { xmlMode, root }) : nodes.filter(getFilterFn(match)); + } + exports2.filterArray = filterArray; + function is(selector) { + var nodes = this.toArray(); + return typeof selector === "string" ? select.some(nodes.filter(utils_1.isTag), selector, this.options) : selector ? nodes.some(getFilterFn(selector)) : false; + } + exports2.is = is; + function not(match) { + var nodes = this.toArray(); + if (typeof match === "string") { + var matches_1 = new Set(select.filter(match, nodes, this.options)); + nodes = nodes.filter(function(el) { + return !matches_1.has(el); }); - }).on("error", function(e) { - if (self2.isPaused) { - this.generatedError = e; - } else { - self2.error(e); - } - }).on("end", function() { - if (self2.isPaused) { - self2._upstreamEnded = true; - } else { - self2.end(); - } - }); - }; - NodejsStreamInputAdapter.prototype.pause = function() { - if (!GenericWorker.prototype.pause.call(this)) { - return false; - } - this._stream.pause(); - return true; - }; - NodejsStreamInputAdapter.prototype.resume = function() { - if (!GenericWorker.prototype.resume.call(this)) { - return false; - } - if (this._upstreamEnded) { - this.end(); } else { - this._stream.resume(); - } - return true; - }; - module2.exports = NodejsStreamInputAdapter; - } -}); - -// node_modules/jszip/lib/object.js -var require_object = __commonJS({ - "node_modules/jszip/lib/object.js"(exports2, module2) { - init_shims(); - "use strict"; - var utf8 = require_utf8(); - var utils = require_utils2(); - var GenericWorker = require_GenericWorker(); - var StreamHelper = require_StreamHelper(); - var defaults2 = require_defaults3(); - var CompressedObject = require_compressedObject(); - var ZipObject = require_zipObject(); - var generate = require_generate(); - var nodejsUtils = require_nodejsUtils(); - var NodejsStreamInputAdapter = require_NodejsStreamInputAdapter(); - var fileAdd = function(name, data, originalOptions) { - var dataType = utils.getTypeOf(data), parent; - var o = utils.extend(originalOptions || {}, defaults2); - o.date = o.date || new Date(); - if (o.compression !== null) { - o.compression = o.compression.toUpperCase(); - } - if (typeof o.unixPermissions === "string") { - o.unixPermissions = parseInt(o.unixPermissions, 8); - } - if (o.unixPermissions && o.unixPermissions & 16384) { - o.dir = true; - } - if (o.dosPermissions && o.dosPermissions & 16) { - o.dir = true; - } - if (o.dir) { - name = forceTrailingSlash(name); - } - if (o.createFolders && (parent = parentFolder(name))) { - folderAdd.call(this, parent, true); - } - var isUnicodeString = dataType === "string" && o.binary === false && o.base64 === false; - if (!originalOptions || typeof originalOptions.binary === "undefined") { - o.binary = !isUnicodeString; - } - var isCompressedEmpty = data instanceof CompressedObject && data.uncompressedSize === 0; - if (isCompressedEmpty || o.dir || !data || data.length === 0) { - o.base64 = false; - o.binary = true; - data = ""; - o.compression = "STORE"; - dataType = "string"; - } - var zipObjectContent = null; - if (data instanceof CompressedObject || data instanceof GenericWorker) { - zipObjectContent = data; - } else if (nodejsUtils.isNode && nodejsUtils.isStream(data)) { - zipObjectContent = new NodejsStreamInputAdapter(name, data); - } else { - zipObjectContent = utils.prepareContent(name, data, o.binary, o.optimizedBinaryString, o.base64); - } - var object = new ZipObject(name, zipObjectContent, o); - this.files[name] = object; - }; - var parentFolder = function(path2) { - if (path2.slice(-1) === "/") { - path2 = path2.substring(0, path2.length - 1); - } - var lastSlash = path2.lastIndexOf("/"); - return lastSlash > 0 ? path2.substring(0, lastSlash) : ""; - }; - var forceTrailingSlash = function(path2) { - if (path2.slice(-1) !== "/") { - path2 += "/"; - } - return path2; - }; - var folderAdd = function(name, createFolders) { - createFolders = typeof createFolders !== "undefined" ? createFolders : defaults2.createFolders; - name = forceTrailingSlash(name); - if (!this.files[name]) { - fileAdd.call(this, name, null, { - dir: true, - createFolders + var filterFn_1 = getFilterFn(match); + nodes = nodes.filter(function(el, i) { + return !filterFn_1(el, i); }); } - return this.files[name]; - }; - function isRegExp(object) { - return Object.prototype.toString.call(object) === "[object RegExp]"; - } - var out = { - load: function() { - throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); - }, - forEach: function(cb) { - var filename, relativePath, file; - for (filename in this.files) { - file = this.files[filename]; - relativePath = filename.slice(this.root.length, filename.length); - if (relativePath && filename.slice(0, this.root.length) === this.root) { - cb(relativePath, file); - } - } - }, - filter: function(search) { - var result = []; - this.forEach(function(relativePath, entry) { - if (search(relativePath, entry)) { - result.push(entry); - } - }); - return result; - }, - file: function(name, data, o) { - if (arguments.length === 1) { - if (isRegExp(name)) { - var regexp = name; - return this.filter(function(relativePath, file) { - return !file.dir && regexp.test(relativePath); - }); - } else { - var obj = this.files[this.root + name]; - if (obj && !obj.dir) { - return obj; - } else { - return null; - } - } - } else { - name = this.root + name; - fileAdd.call(this, name, data, o); - } - return this; - }, - folder: function(arg) { - if (!arg) { - return this; - } - if (isRegExp(arg)) { - return this.filter(function(relativePath, file) { - return file.dir && arg.test(relativePath); - }); - } - var name = this.root + arg; - var newFolder = folderAdd.call(this, name); - var ret2 = this.clone(); - ret2.root = newFolder.name; - return ret2; - }, - remove: function(name) { - name = this.root + name; - var file = this.files[name]; - if (!file) { - if (name.slice(-1) !== "/") { - name += "/"; - } - file = this.files[name]; - } - if (file && !file.dir) { - delete this.files[name]; - } else { - var kids = this.filter(function(relativePath, file2) { - return file2.name.slice(0, name.length) === name; - }); - for (var i = 0; i < kids.length; i++) { - delete this.files[kids[i].name]; - } - } - return this; - }, - generate: function(options2) { - throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); - }, - generateInternalStream: function(options2) { - var worker, opts = {}; - try { - opts = utils.extend(options2 || {}, { - streamFiles: false, - compression: "STORE", - compressionOptions: null, - type: "", - platform: "DOS", - comment: null, - mimeType: "application/zip", - encodeFileName: utf8.utf8encode - }); - opts.type = opts.type.toLowerCase(); - opts.compression = opts.compression.toUpperCase(); - if (opts.type === "binarystring") { - opts.type = "string"; - } - if (!opts.type) { - throw new Error("No output type specified."); - } - utils.checkSupport(opts.type); - if (opts.platform === "darwin" || opts.platform === "freebsd" || opts.platform === "linux" || opts.platform === "sunos") { - opts.platform = "UNIX"; - } - if (opts.platform === "win32") { - opts.platform = "DOS"; - } - var comment = opts.comment || this.comment || ""; - worker = generate.generateWorker(this, opts, comment); - } catch (e) { - worker = new GenericWorker("error"); - worker.error(e); - } - return new StreamHelper(worker, opts.type || "string", opts.mimeType); - }, - generateAsync: function(options2, onUpdate) { - return this.generateInternalStream(options2).accumulate(onUpdate); - }, - generateNodeStream: function(options2, onUpdate) { - options2 = options2 || {}; - if (!options2.type) { - options2.type = "nodebuffer"; - } - return this.generateInternalStream(options2).toNodejsStream(onUpdate); - } - }; - module2.exports = out; - } -}); - -// node_modules/jszip/lib/reader/DataReader.js -var require_DataReader = __commonJS({ - "node_modules/jszip/lib/reader/DataReader.js"(exports2, module2) { - init_shims(); - "use strict"; - var utils = require_utils2(); - function DataReader(data) { - this.data = data; - this.length = data.length; - this.index = 0; - this.zero = 0; - } - DataReader.prototype = { - checkOffset: function(offset) { - this.checkIndex(this.index + offset); - }, - checkIndex: function(newIndex) { - if (this.length < this.zero + newIndex || newIndex < 0) { - throw new Error("End of data reached (data length = " + this.length + ", asked index = " + newIndex + "). Corrupted zip ?"); - } - }, - setIndex: function(newIndex) { - this.checkIndex(newIndex); - this.index = newIndex; - }, - skip: function(n) { - this.setIndex(this.index + n); - }, - byteAt: function(i) { - }, - readInt: function(size) { - var result = 0, i; - this.checkOffset(size); - for (i = this.index + size - 1; i >= this.index; i--) { - result = (result << 8) + this.byteAt(i); - } - this.index += size; - return result; - }, - readString: function(size) { - return utils.transformTo("string", this.readData(size)); - }, - readData: function(size) { - }, - lastIndexOfSignature: function(sig) { - }, - readAndCheckSignature: function(sig) { - }, - readDate: function() { - var dostime = this.readInt(4); - return new Date(Date.UTC((dostime >> 25 & 127) + 1980, (dostime >> 21 & 15) - 1, dostime >> 16 & 31, dostime >> 11 & 31, dostime >> 5 & 63, (dostime & 31) << 1)); - } - }; - module2.exports = DataReader; + return this._make(nodes); + } + exports2.not = not; + function has(selectorOrHaystack) { + var _this = this; + return this.filter(typeof selectorOrHaystack === "string" ? ":has(" + selectorOrHaystack + ")" : function(_, el) { + return _this._make(el).find(selectorOrHaystack).length > 0; + }); + } + exports2.has = has; + function first() { + return this.length > 1 ? this._make(this[0]) : this; + } + exports2.first = first; + function last() { + return this.length > 0 ? this._make(this[this.length - 1]) : this; + } + exports2.last = last; + function eq(i) { + var _a; + i = +i; + if (i === 0 && this.length <= 1) + return this; + if (i < 0) + i = this.length + i; + return this._make((_a = this[i]) !== null && _a !== void 0 ? _a : []); + } + exports2.eq = eq; + function get2(i) { + if (i == null) { + return this.toArray(); + } + return this[i < 0 ? this.length + i : i]; + } + exports2.get = get2; + function toArray() { + return Array.prototype.slice.call(this); + } + exports2.toArray = toArray; + function index2(selectorOrNeedle) { + var $haystack; + var needle; + if (selectorOrNeedle == null) { + $haystack = this.parent().children(); + needle = this[0]; + } else if (typeof selectorOrNeedle === "string") { + $haystack = this._make(selectorOrNeedle); + needle = this[0]; + } else { + $haystack = this; + needle = utils_1.isCheerio(selectorOrNeedle) ? selectorOrNeedle[0] : selectorOrNeedle; + } + return Array.prototype.indexOf.call($haystack, needle); + } + exports2.index = index2; + function slice(start, end2) { + return this._make(Array.prototype.slice.call(this, start, end2)); + } + exports2.slice = slice; + function end() { + var _a; + return (_a = this.prevObject) !== null && _a !== void 0 ? _a : this._make([]); + } + exports2.end = end; + function add(other, context) { + var selection = this._make(other, context); + var contents2 = uniqueSort(tslib_1.__spreadArray(tslib_1.__spreadArray([], this.get()), selection.get())); + return this._make(contents2); + } + exports2.add = add; + function addBack(selector) { + return this.prevObject ? this.add(selector ? this.prevObject.filter(selector) : this.prevObject) : this; + } + exports2.addBack = addBack; } }); -// node_modules/jszip/lib/reader/ArrayReader.js -var require_ArrayReader = __commonJS({ - "node_modules/jszip/lib/reader/ArrayReader.js"(exports2, module2) { +// node_modules/cheerio/lib/api/manipulation.js +var require_manipulation2 = __commonJS({ + "node_modules/cheerio/lib/api/manipulation.js"(exports2) { init_shims(); "use strict"; - var DataReader = require_DataReader(); - var utils = require_utils2(); - function ArrayReader(data) { - DataReader.call(this, data); - for (var i = 0; i < this.data.length; i++) { - data[i] = data[i] & 255; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.clone = exports2.text = exports2.toString = exports2.html = exports2.empty = exports2.replaceWith = exports2.remove = exports2.insertBefore = exports2.before = exports2.insertAfter = exports2.after = exports2.wrapAll = exports2.unwrap = exports2.wrapInner = exports2.wrap = exports2.prepend = exports2.append = exports2.prependTo = exports2.appendTo = exports2._makeDomArray = void 0; + var tslib_1 = require_tslib(); + var domhandler_1 = require_lib3(); + var domhandler_2 = require_lib3(); + var parse_1 = tslib_1.__importStar(require_parse4()); + var static_1 = require_static(); + var utils_1 = require_utils2(); + var htmlparser2_1 = require_lib10(); + function _makeDomArray(elem, clone3) { + var _this = this; + if (elem == null) { + return []; } - } - utils.inherits(ArrayReader, DataReader); - ArrayReader.prototype.byteAt = function(i) { - return this.data[this.zero + i]; - }; - ArrayReader.prototype.lastIndexOfSignature = function(sig) { - var sig0 = sig.charCodeAt(0), sig1 = sig.charCodeAt(1), sig2 = sig.charCodeAt(2), sig3 = sig.charCodeAt(3); - for (var i = this.length - 4; i >= 0; --i) { - if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) { - return i - this.zero; - } + if (utils_1.isCheerio(elem)) { + return clone3 ? utils_1.cloneDom(elem.get()) : elem.get(); } - return -1; - }; - ArrayReader.prototype.readAndCheckSignature = function(sig) { - var sig0 = sig.charCodeAt(0), sig1 = sig.charCodeAt(1), sig2 = sig.charCodeAt(2), sig3 = sig.charCodeAt(3), data = this.readData(4); - return sig0 === data[0] && sig1 === data[1] && sig2 === data[2] && sig3 === data[3]; - }; - ArrayReader.prototype.readData = function(size) { - this.checkOffset(size); - if (size === 0) { - return []; + if (Array.isArray(elem)) { + return elem.reduce(function(newElems, el) { + return newElems.concat(_this._makeDomArray(el, clone3)); + }, []); } - var result = this.data.slice(this.zero + this.index, this.zero + this.index + size); - this.index += size; - return result; - }; - module2.exports = ArrayReader; - } -}); - -// node_modules/jszip/lib/reader/StringReader.js -var require_StringReader = __commonJS({ - "node_modules/jszip/lib/reader/StringReader.js"(exports2, module2) { - init_shims(); - "use strict"; - var DataReader = require_DataReader(); - var utils = require_utils2(); - function StringReader(data) { - DataReader.call(this, data); - } - utils.inherits(StringReader, DataReader); - StringReader.prototype.byteAt = function(i) { - return this.data.charCodeAt(this.zero + i); - }; - StringReader.prototype.lastIndexOfSignature = function(sig) { - return this.data.lastIndexOf(sig) - this.zero; - }; - StringReader.prototype.readAndCheckSignature = function(sig) { - var data = this.readData(4); - return sig === data; - }; - StringReader.prototype.readData = function(size) { - this.checkOffset(size); - var result = this.data.slice(this.zero + this.index, this.zero + this.index + size); - this.index += size; - return result; - }; - module2.exports = StringReader; - } -}); - -// node_modules/jszip/lib/reader/Uint8ArrayReader.js -var require_Uint8ArrayReader = __commonJS({ - "node_modules/jszip/lib/reader/Uint8ArrayReader.js"(exports2, module2) { - init_shims(); - "use strict"; - var ArrayReader = require_ArrayReader(); - var utils = require_utils2(); - function Uint8ArrayReader(data) { - ArrayReader.call(this, data); - } - utils.inherits(Uint8ArrayReader, ArrayReader); - Uint8ArrayReader.prototype.readData = function(size) { - this.checkOffset(size); - if (size === 0) { - return new Uint8Array(0); - } - var result = this.data.subarray(this.zero + this.index, this.zero + this.index + size); - this.index += size; - return result; - }; - module2.exports = Uint8ArrayReader; - } -}); - -// node_modules/jszip/lib/reader/NodeBufferReader.js -var require_NodeBufferReader = __commonJS({ - "node_modules/jszip/lib/reader/NodeBufferReader.js"(exports2, module2) { - init_shims(); - "use strict"; - var Uint8ArrayReader = require_Uint8ArrayReader(); - var utils = require_utils2(); - function NodeBufferReader(data) { - Uint8ArrayReader.call(this, data); - } - utils.inherits(NodeBufferReader, Uint8ArrayReader); - NodeBufferReader.prototype.readData = function(size) { - this.checkOffset(size); - var result = this.data.slice(this.zero + this.index, this.zero + this.index + size); - this.index += size; - return result; - }; - module2.exports = NodeBufferReader; - } -}); - -// node_modules/jszip/lib/reader/readerFor.js -var require_readerFor = __commonJS({ - "node_modules/jszip/lib/reader/readerFor.js"(exports2, module2) { - init_shims(); - "use strict"; - var utils = require_utils2(); - var support = require_support(); - var ArrayReader = require_ArrayReader(); - var StringReader = require_StringReader(); - var NodeBufferReader = require_NodeBufferReader(); - var Uint8ArrayReader = require_Uint8ArrayReader(); - module2.exports = function(data) { - var type = utils.getTypeOf(data); - utils.checkSupport(type); - if (type === "string" && !support.uint8array) { - return new StringReader(data); - } - if (type === "nodebuffer") { - return new NodeBufferReader(data); - } - if (support.uint8array) { - return new Uint8ArrayReader(utils.transformTo("uint8array", data)); - } - return new ArrayReader(utils.transformTo("array", data)); - }; - } -}); - -// node_modules/jszip/lib/zipEntry.js -var require_zipEntry = __commonJS({ - "node_modules/jszip/lib/zipEntry.js"(exports2, module2) { - init_shims(); - "use strict"; - var readerFor = require_readerFor(); - var utils = require_utils2(); - var CompressedObject = require_compressedObject(); - var crc32fn = require_crc32(); - var utf8 = require_utf8(); - var compressions = require_compressions(); - var support = require_support(); - var MADE_BY_DOS = 0; - var MADE_BY_UNIX = 3; - var findCompression = function(compressionMethod) { - for (var method in compressions) { - if (!compressions.hasOwnProperty(method)) { - continue; - } - if (compressions[method].magic === compressionMethod) { - return compressions[method]; - } + if (typeof elem === "string") { + return parse_1.default(elem, this.options, false).children; } - return null; - }; - function ZipEntry(options2, loadOptions) { - this.options = options2; - this.loadOptions = loadOptions; + return clone3 ? utils_1.cloneDom([elem]) : [elem]; } - ZipEntry.prototype = { - isEncrypted: function() { - return (this.bitFlag & 1) === 1; - }, - useUTF8: function() { - return (this.bitFlag & 2048) === 2048; - }, - readLocalPart: function(reader) { - var compression, localExtraFieldsLength; - reader.skip(22); - this.fileNameLength = reader.readInt(2); - localExtraFieldsLength = reader.readInt(2); - this.fileName = reader.readData(this.fileNameLength); - reader.skip(localExtraFieldsLength); - if (this.compressedSize === -1 || this.uncompressedSize === -1) { - throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)"); - } - compression = findCompression(this.compressionMethod); - if (compression === null) { - throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + utils.transformTo("string", this.fileName) + ")"); - } - this.decompressed = new CompressedObject(this.compressedSize, this.uncompressedSize, this.crc32, compression, reader.readData(this.compressedSize)); - }, - readCentralPart: function(reader) { - this.versionMadeBy = reader.readInt(2); - reader.skip(2); - this.bitFlag = reader.readInt(2); - this.compressionMethod = reader.readString(2); - this.date = reader.readDate(); - this.crc32 = reader.readInt(4); - this.compressedSize = reader.readInt(4); - this.uncompressedSize = reader.readInt(4); - var fileNameLength = reader.readInt(2); - this.extraFieldsLength = reader.readInt(2); - this.fileCommentLength = reader.readInt(2); - this.diskNumberStart = reader.readInt(2); - this.internalFileAttributes = reader.readInt(2); - this.externalFileAttributes = reader.readInt(4); - this.localHeaderOffset = reader.readInt(4); - if (this.isEncrypted()) { - throw new Error("Encrypted zip are not supported"); - } - reader.skip(fileNameLength); - this.readExtraFields(reader); - this.parseZIP64ExtraField(reader); - this.fileComment = reader.readData(this.fileCommentLength); - }, - processAttributes: function() { - this.unixPermissions = null; - this.dosPermissions = null; - var madeBy = this.versionMadeBy >> 8; - this.dir = this.externalFileAttributes & 16 ? true : false; - if (madeBy === MADE_BY_DOS) { - this.dosPermissions = this.externalFileAttributes & 63; + exports2._makeDomArray = _makeDomArray; + function _insert(concatenator) { + return function() { + var _this = this; + var elems = []; + for (var _i = 0; _i < arguments.length; _i++) { + elems[_i] = arguments[_i]; + } + var lastIdx = this.length - 1; + return utils_1.domEach(this, function(el, i) { + if (!domhandler_1.hasChildren(el)) + return; + var domSrc = typeof elems[0] === "function" ? elems[0].call(el, i, static_1.html(el.children)) : elems; + var dom = _this._makeDomArray(domSrc, i < lastIdx); + concatenator(dom, el.children, el); + }); + }; + } + function uniqueSplice(array, spliceIdx, spliceCount, newElems, parent) { + var _a, _b; + var spliceArgs = tslib_1.__spreadArray([ + spliceIdx, + spliceCount + ], newElems); + var prev = array[spliceIdx - 1] || null; + var next = array[spliceIdx + spliceCount] || null; + for (var idx = 0; idx < newElems.length; ++idx) { + var node = newElems[idx]; + var oldParent = node.parent; + if (oldParent) { + var prevIdx = oldParent.children.indexOf(newElems[idx]); + if (prevIdx > -1) { + oldParent.children.splice(prevIdx, 1); + if (parent === oldParent && spliceIdx > prevIdx) { + spliceArgs[0]--; + } + } } - if (madeBy === MADE_BY_UNIX) { - this.unixPermissions = this.externalFileAttributes >> 16 & 65535; + node.parent = parent; + if (node.prev) { + node.prev.next = (_a = node.next) !== null && _a !== void 0 ? _a : null; } - if (!this.dir && this.fileNameStr.slice(-1) === "/") { - this.dir = true; + if (node.next) { + node.next.prev = (_b = node.prev) !== null && _b !== void 0 ? _b : null; } - }, - parseZIP64ExtraField: function(reader) { - if (!this.extraFields[1]) { - return; + node.prev = newElems[idx - 1] || prev; + node.next = newElems[idx + 1] || next; + } + if (prev) { + prev.next = newElems[0]; + } + if (next) { + next.prev = newElems[newElems.length - 1]; + } + return array.splice.apply(array, spliceArgs); + } + function appendTo(target) { + var appendTarget = utils_1.isCheerio(target) ? target : this._make(target); + appendTarget.append(this); + return this; + } + exports2.appendTo = appendTo; + function prependTo(target) { + var prependTarget = utils_1.isCheerio(target) ? target : this._make(target); + prependTarget.prepend(this); + return this; + } + exports2.prependTo = prependTo; + exports2.append = _insert(function(dom, children, parent) { + uniqueSplice(children, children.length, 0, dom, parent); + }); + exports2.prepend = _insert(function(dom, children, parent) { + uniqueSplice(children, 0, 0, dom, parent); + }); + function _wrap(insert) { + return function(wrapper) { + var lastIdx = this.length - 1; + var lastParent = this.parents().last(); + for (var i = 0; i < this.length; i++) { + var el = this[i]; + var wrap_1 = typeof wrapper === "function" ? wrapper.call(el, i, el) : typeof wrapper === "string" && !utils_1.isHtml(wrapper) ? lastParent.find(wrapper).clone() : wrapper; + var wrapperDom = this._makeDomArray(wrap_1, i < lastIdx)[0]; + if (!wrapperDom || !htmlparser2_1.DomUtils.hasChildren(wrapperDom)) + continue; + var elInsertLocation = wrapperDom; + var j = 0; + while (j < elInsertLocation.children.length) { + var child = elInsertLocation.children[j]; + if (utils_1.isTag(child)) { + elInsertLocation = child; + j = 0; + } else { + j++; + } + } + insert(el, elInsertLocation, [wrapperDom]); } - var extraReader = readerFor(this.extraFields[1].value); - if (this.uncompressedSize === utils.MAX_VALUE_32BITS) { - this.uncompressedSize = extraReader.readInt(8); + return this; + }; + } + exports2.wrap = _wrap(function(el, elInsertLocation, wrapperDom) { + var parent = el.parent; + if (!parent) + return; + var siblings = parent.children; + var index2 = siblings.indexOf(el); + parse_1.update([el], elInsertLocation); + uniqueSplice(siblings, index2, 0, wrapperDom, parent); + }); + exports2.wrapInner = _wrap(function(el, elInsertLocation, wrapperDom) { + if (!domhandler_1.hasChildren(el)) + return; + parse_1.update(el.children, elInsertLocation); + parse_1.update(wrapperDom, el); + }); + function unwrap(selector) { + var _this = this; + this.parent(selector).not("body").each(function(_, el) { + _this._make(el).replaceWith(el.children); + }); + return this; + } + exports2.unwrap = unwrap; + function wrapAll(wrapper) { + var el = this[0]; + if (el) { + var wrap_2 = this._make(typeof wrapper === "function" ? wrapper.call(el, 0, el) : wrapper).insertBefore(el); + var elInsertLocation = void 0; + for (var i = 0; i < wrap_2.length; i++) { + if (wrap_2[i].type === "tag") + elInsertLocation = wrap_2[i]; } - if (this.compressedSize === utils.MAX_VALUE_32BITS) { - this.compressedSize = extraReader.readInt(8); + var j = 0; + while (elInsertLocation && j < elInsertLocation.children.length) { + var child = elInsertLocation.children[j]; + if (child.type === "tag") { + elInsertLocation = child; + j = 0; + } else { + j++; + } } - if (this.localHeaderOffset === utils.MAX_VALUE_32BITS) { - this.localHeaderOffset = extraReader.readInt(8); + if (elInsertLocation) + this._make(elInsertLocation).append(this); + } + return this; + } + exports2.wrapAll = wrapAll; + function after() { + var _this = this; + var elems = []; + for (var _i = 0; _i < arguments.length; _i++) { + elems[_i] = arguments[_i]; + } + var lastIdx = this.length - 1; + return utils_1.domEach(this, function(el, i) { + var parent = el.parent; + if (!htmlparser2_1.DomUtils.hasChildren(el) || !parent) { + return; } - if (this.diskNumberStart === utils.MAX_VALUE_32BITS) { - this.diskNumberStart = extraReader.readInt(4); + var siblings = parent.children; + var index2 = siblings.indexOf(el); + if (index2 < 0) + return; + var domSrc = typeof elems[0] === "function" ? elems[0].call(el, i, static_1.html(el.children)) : elems; + var dom = _this._makeDomArray(domSrc, i < lastIdx); + uniqueSplice(siblings, index2 + 1, 0, dom, parent); + }); + } + exports2.after = after; + function insertAfter(target) { + var _this = this; + if (typeof target === "string") { + target = this._make(target); + } + this.remove(); + var clones = []; + this._makeDomArray(target).forEach(function(el) { + var clonedSelf = _this.clone().toArray(); + var parent = el.parent; + if (!parent) { + return; } - }, - readExtraFields: function(reader) { - var end = reader.index + this.extraFieldsLength, extraFieldId, extraFieldLength, extraFieldValue; - if (!this.extraFields) { - this.extraFields = {}; - } - while (reader.index + 4 < end) { - extraFieldId = reader.readInt(2); - extraFieldLength = reader.readInt(2); - extraFieldValue = reader.readData(extraFieldLength); - this.extraFields[extraFieldId] = { - id: extraFieldId, - length: extraFieldLength, - value: extraFieldValue - }; + var siblings = parent.children; + var index2 = siblings.indexOf(el); + if (index2 < 0) + return; + uniqueSplice(siblings, index2 + 1, 0, clonedSelf, parent); + clones.push.apply(clones, clonedSelf); + }); + return this._make(clones); + } + exports2.insertAfter = insertAfter; + function before() { + var _this = this; + var elems = []; + for (var _i = 0; _i < arguments.length; _i++) { + elems[_i] = arguments[_i]; + } + var lastIdx = this.length - 1; + return utils_1.domEach(this, function(el, i) { + var parent = el.parent; + if (!htmlparser2_1.DomUtils.hasChildren(el) || !parent) { + return; } - reader.setIndex(end); - }, - handleUTF8: function() { - var decodeParamType = support.uint8array ? "uint8array" : "array"; - if (this.useUTF8()) { - this.fileNameStr = utf8.utf8decode(this.fileName); - this.fileCommentStr = utf8.utf8decode(this.fileComment); - } else { - var upath = this.findExtraFieldUnicodePath(); - if (upath !== null) { - this.fileNameStr = upath; - } else { - var fileNameByteArray = utils.transformTo(decodeParamType, this.fileName); - this.fileNameStr = this.loadOptions.decodeFileName(fileNameByteArray); - } - var ucomment = this.findExtraFieldUnicodeComment(); - if (ucomment !== null) { - this.fileCommentStr = ucomment; - } else { - var commentByteArray = utils.transformTo(decodeParamType, this.fileComment); - this.fileCommentStr = this.loadOptions.decodeFileName(commentByteArray); - } + var siblings = parent.children; + var index2 = siblings.indexOf(el); + if (index2 < 0) + return; + var domSrc = typeof elems[0] === "function" ? elems[0].call(el, i, static_1.html(el.children)) : elems; + var dom = _this._makeDomArray(domSrc, i < lastIdx); + uniqueSplice(siblings, index2, 0, dom, parent); + }); + } + exports2.before = before; + function insertBefore(target) { + var _this = this; + var targetArr = this._make(target); + this.remove(); + var clones = []; + utils_1.domEach(targetArr, function(el) { + var clonedSelf = _this.clone().toArray(); + var parent = el.parent; + if (!parent) { + return; } - }, - findExtraFieldUnicodePath: function() { - var upathField = this.extraFields[28789]; - if (upathField) { - var extraReader = readerFor(upathField.value); - if (extraReader.readInt(1) !== 1) { - return null; - } - if (crc32fn(this.fileName) !== extraReader.readInt(4)) { - return null; - } - return utf8.utf8decode(extraReader.readData(upathField.length - 5)); + var siblings = parent.children; + var index2 = siblings.indexOf(el); + if (index2 < 0) + return; + uniqueSplice(siblings, index2, 0, clonedSelf, parent); + clones.push.apply(clones, clonedSelf); + }); + return this._make(clones); + } + exports2.insertBefore = insertBefore; + function remove(selector) { + var elems = selector ? this.filter(selector) : this; + utils_1.domEach(elems, function(el) { + htmlparser2_1.DomUtils.removeElement(el); + el.prev = el.next = el.parent = null; + }); + return this; + } + exports2.remove = remove; + function replaceWith(content) { + var _this = this; + return utils_1.domEach(this, function(el, i) { + var parent = el.parent; + if (!parent) { + return; } - return null; - }, - findExtraFieldUnicodeComment: function() { - var ucommentField = this.extraFields[25461]; - if (ucommentField) { - var extraReader = readerFor(ucommentField.value); - if (extraReader.readInt(1) !== 1) { - return null; - } - if (crc32fn(this.fileComment) !== extraReader.readInt(4)) { - return null; - } - return utf8.utf8decode(extraReader.readData(ucommentField.length - 5)); + var siblings = parent.children; + var cont = typeof content === "function" ? content.call(el, i, el) : content; + var dom = _this._makeDomArray(cont); + parse_1.update(dom, null); + var index2 = siblings.indexOf(el); + uniqueSplice(siblings, index2, 1, dom, parent); + if (!dom.includes(el)) { + el.parent = el.prev = el.next = null; } - return null; + }); + } + exports2.replaceWith = replaceWith; + function empty2() { + return utils_1.domEach(this, function(el) { + if (!htmlparser2_1.DomUtils.hasChildren(el)) + return; + el.children.forEach(function(child) { + child.next = child.prev = child.parent = null; + }); + el.children.length = 0; + }); + } + exports2.empty = empty2; + function html(str) { + if (str === void 0) { + var el = this[0]; + if (!el || !htmlparser2_1.DomUtils.hasChildren(el)) + return null; + return static_1.html(el.children, this.options); } - }; - module2.exports = ZipEntry; + var opts = tslib_1.__assign(tslib_1.__assign({}, this.options), { context: null }); + return utils_1.domEach(this, function(el2) { + if (!htmlparser2_1.DomUtils.hasChildren(el2)) + return; + el2.children.forEach(function(child) { + child.next = child.prev = child.parent = null; + }); + opts.context = el2; + var content = utils_1.isCheerio(str) ? str.toArray() : parse_1.default("" + str, opts, false).children; + parse_1.update(content, el2); + }); + } + exports2.html = html; + function toString() { + return static_1.html(this, this.options); + } + exports2.toString = toString; + function text(str) { + var _this = this; + if (str === void 0) { + return static_1.text(this); + } + if (typeof str === "function") { + return utils_1.domEach(this, function(el, i) { + text.call(_this._make(el), str.call(el, i, static_1.text([el]))); + }); + } + return utils_1.domEach(this, function(el) { + if (!htmlparser2_1.DomUtils.hasChildren(el)) + return; + el.children.forEach(function(child) { + child.next = child.prev = child.parent = null; + }); + var textNode = new domhandler_2.Text(str); + parse_1.update(textNode, el); + }); + } + exports2.text = text; + function clone2() { + return this._make(utils_1.cloneDom(this.get())); + } + exports2.clone = clone2; } }); -// node_modules/jszip/lib/zipEntries.js -var require_zipEntries = __commonJS({ - "node_modules/jszip/lib/zipEntries.js"(exports2, module2) { +// node_modules/cheerio/lib/api/css.js +var require_css = __commonJS({ + "node_modules/cheerio/lib/api/css.js"(exports2) { init_shims(); "use strict"; - var readerFor = require_readerFor(); - var utils = require_utils2(); - var sig = require_signature(); - var ZipEntry = require_zipEntry(); - var utf8 = require_utf8(); - var support = require_support(); - function ZipEntries(loadOptions) { - this.files = []; - this.loadOptions = loadOptions; - } - ZipEntries.prototype = { - checkSignature: function(expectedSignature) { - if (!this.reader.readAndCheckSignature(expectedSignature)) { - this.reader.index -= 4; - var signature = this.reader.readString(4); - throw new Error("Corrupted zip or bug: unexpected signature (" + utils.pretty(signature) + ", expected " + utils.pretty(expectedSignature) + ")"); - } - }, - isSignature: function(askedIndex, expectedSignature) { - var currentIndex = this.reader.index; - this.reader.setIndex(askedIndex); - var signature = this.reader.readString(4); - var result = signature === expectedSignature; - this.reader.setIndex(currentIndex); - return result; - }, - readBlockEndOfCentral: function() { - this.diskNumber = this.reader.readInt(2); - this.diskWithCentralDirStart = this.reader.readInt(2); - this.centralDirRecordsOnThisDisk = this.reader.readInt(2); - this.centralDirRecords = this.reader.readInt(2); - this.centralDirSize = this.reader.readInt(4); - this.centralDirOffset = this.reader.readInt(4); - this.zipCommentLength = this.reader.readInt(2); - var zipComment = this.reader.readData(this.zipCommentLength); - var decodeParamType = support.uint8array ? "uint8array" : "array"; - var decodeContent = utils.transformTo(decodeParamType, zipComment); - this.zipComment = this.loadOptions.decodeFileName(decodeContent); - }, - readBlockZip64EndOfCentral: function() { - this.zip64EndOfCentralSize = this.reader.readInt(8); - this.reader.skip(4); - this.diskNumber = this.reader.readInt(4); - this.diskWithCentralDirStart = this.reader.readInt(4); - this.centralDirRecordsOnThisDisk = this.reader.readInt(8); - this.centralDirRecords = this.reader.readInt(8); - this.centralDirSize = this.reader.readInt(8); - this.centralDirOffset = this.reader.readInt(8); - this.zip64ExtensibleData = {}; - var extraDataSize = this.zip64EndOfCentralSize - 44, index2 = 0, extraFieldId, extraFieldLength, extraFieldValue; - while (index2 < extraDataSize) { - extraFieldId = this.reader.readInt(2); - extraFieldLength = this.reader.readInt(4); - extraFieldValue = this.reader.readData(extraFieldLength); - this.zip64ExtensibleData[extraFieldId] = { - id: extraFieldId, - length: extraFieldLength, - value: extraFieldValue - }; - } - }, - readBlockZip64EndOfCentralLocator: function() { - this.diskWithZip64CentralDirStart = this.reader.readInt(4); - this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8); - this.disksCount = this.reader.readInt(4); - if (this.disksCount > 1) { - throw new Error("Multi-volumes zip are not supported"); - } - }, - readLocalFiles: function() { - var i, file; - for (i = 0; i < this.files.length; i++) { - file = this.files[i]; - this.reader.setIndex(file.localHeaderOffset); - this.checkSignature(sig.LOCAL_FILE_HEADER); - file.readLocalPart(this.reader); - file.handleUTF8(); - file.processAttributes(); - } - }, - readCentralDir: function() { - var file; - this.reader.setIndex(this.centralDirOffset); - while (this.reader.readAndCheckSignature(sig.CENTRAL_FILE_HEADER)) { - file = new ZipEntry({ - zip64: this.zip64 - }, this.loadOptions); - file.readCentralPart(this.reader); - this.files.push(file); - } - if (this.centralDirRecords !== this.files.length) { - if (this.centralDirRecords !== 0 && this.files.length === 0) { - throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length); - } else { - } - } - }, - readEndOfCentral: function() { - var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END); - if (offset < 0) { - var isGarbage = !this.isSignature(0, sig.LOCAL_FILE_HEADER); - if (isGarbage) { - throw new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"); - } else { - throw new Error("Corrupted zip: can't find end of central directory"); - } - } - this.reader.setIndex(offset); - var endOfCentralDirOffset = offset; - this.checkSignature(sig.CENTRAL_DIRECTORY_END); - this.readBlockEndOfCentral(); - if (this.diskNumber === utils.MAX_VALUE_16BITS || this.diskWithCentralDirStart === utils.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === utils.MAX_VALUE_16BITS || this.centralDirRecords === utils.MAX_VALUE_16BITS || this.centralDirSize === utils.MAX_VALUE_32BITS || this.centralDirOffset === utils.MAX_VALUE_32BITS) { - this.zip64 = true; - offset = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR); - if (offset < 0) { - throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator"); - } - this.reader.setIndex(offset); - this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR); - this.readBlockZip64EndOfCentralLocator(); - if (!this.isSignature(this.relativeOffsetEndOfZip64CentralDir, sig.ZIP64_CENTRAL_DIRECTORY_END)) { - this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_END); - if (this.relativeOffsetEndOfZip64CentralDir < 0) { - throw new Error("Corrupted zip: can't find the ZIP64 end of central directory"); - } + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.css = void 0; + var utils_1 = require_utils2(); + function css2(prop, val) { + if (prop != null && val != null || typeof prop === "object" && !Array.isArray(prop)) { + return utils_1.domEach(this, function(el, i) { + if (utils_1.isTag(el)) { + setCss(el, prop, val, i); } - this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir); - this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END); - this.readBlockZip64EndOfCentral(); - } - var expectedEndOfCentralDirOffset = this.centralDirOffset + this.centralDirSize; - if (this.zip64) { - expectedEndOfCentralDirOffset += 20; - expectedEndOfCentralDirOffset += 12 + this.zip64EndOfCentralSize; - } - var extraBytes = endOfCentralDirOffset - expectedEndOfCentralDirOffset; - if (extraBytes > 0) { - if (this.isSignature(endOfCentralDirOffset, sig.CENTRAL_FILE_HEADER)) { - } else { - this.reader.zero = extraBytes; + }); + } + return getCss(this[0], prop); + } + exports2.css = css2; + function setCss(el, prop, value, idx) { + if (typeof prop === "string") { + var styles = getCss(el); + var val = typeof value === "function" ? value.call(el, idx, styles[prop]) : value; + if (val === "") { + delete styles[prop]; + } else if (val != null) { + styles[prop] = val; + } + el.attribs.style = stringify(styles); + } else if (typeof prop === "object") { + Object.keys(prop).forEach(function(k, i) { + setCss(el, k, prop[k], i); + }); + } + } + function getCss(el, prop) { + if (!el || !utils_1.isTag(el)) + return; + var styles = parse(el.attribs.style); + if (typeof prop === "string") { + return styles[prop]; + } + if (Array.isArray(prop)) { + var newStyles_1 = {}; + prop.forEach(function(item) { + if (styles[item] != null) { + newStyles_1[item] = styles[item]; } - } else if (extraBytes < 0) { - throw new Error("Corrupted zip: missing " + Math.abs(extraBytes) + " bytes."); - } - }, - prepareReader: function(data) { - this.reader = readerFor(data); - }, - load: function(data) { - this.prepareReader(data); - this.readEndOfCentral(); - this.readCentralDir(); - this.readLocalFiles(); + }); + return newStyles_1; } - }; - module2.exports = ZipEntries; + return styles; + } + function stringify(obj) { + return Object.keys(obj).reduce(function(str, prop) { + return "" + str + (str ? " " : "") + prop + ": " + obj[prop] + ";"; + }, ""); + } + function parse(styles) { + styles = (styles || "").trim(); + if (!styles) + return {}; + return styles.split(";").reduce(function(obj, str) { + var n = str.indexOf(":"); + if (n < 1 || n === str.length - 1) + return obj; + obj[str.slice(0, n).trim()] = str.slice(n + 1).trim(); + return obj; + }, {}); + } } }); -// node_modules/jszip/lib/load.js -var require_load = __commonJS({ - "node_modules/jszip/lib/load.js"(exports2, module2) { +// node_modules/cheerio/lib/api/forms.js +var require_forms = __commonJS({ + "node_modules/cheerio/lib/api/forms.js"(exports2) { init_shims(); "use strict"; - var utils = require_utils2(); - var external = require_external(); - var utf8 = require_utf8(); - var ZipEntries = require_zipEntries(); - var Crc32Probe = require_Crc32Probe(); - var nodejsUtils = require_nodejsUtils(); - function checkEntryCRC32(zipEntry) { - return new external.Promise(function(resolve2, reject) { - var worker = zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe()); - worker.on("error", function(e) { - reject(e); - }).on("end", function() { - if (worker.streamInfo.crc32 !== zipEntry.decompressed.crc32) { - reject(new Error("Corrupted zip : CRC32 mismatch")); - } else { - resolve2(); - } - }).resume(); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.serializeArray = exports2.serialize = void 0; + var utils_1 = require_utils2(); + var submittableSelector = "input,select,textarea,keygen"; + var r20 = /%20/g; + var rCRLF = /\r?\n/g; + function serialize() { + var arr = this.serializeArray(); + var retArr = arr.map(function(data) { + return encodeURIComponent(data.name) + "=" + encodeURIComponent(data.value); }); + return retArr.join("&").replace(r20, "+"); } - module2.exports = function(data, options2) { - var zip = this; - options2 = utils.extend(options2 || {}, { - base64: false, - checkCRC32: false, - optimizedBinaryString: false, - createFolders: false, - decodeFileName: utf8.utf8decode - }); - if (nodejsUtils.isNode && nodejsUtils.isStream(data)) { - return external.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")); - } - return utils.prepareContent("the loaded zip file", data, true, options2.optimizedBinaryString, options2.base64).then(function(data2) { - var zipEntries = new ZipEntries(options2); - zipEntries.load(data2); - return zipEntries; - }).then(function checkCRC32(zipEntries) { - var promises = [external.Promise.resolve(zipEntries)]; - var files = zipEntries.files; - if (options2.checkCRC32) { - for (var i = 0; i < files.length; i++) { - promises.push(checkEntryCRC32(files[i])); - } - } - return external.Promise.all(promises); - }).then(function addFiles(results) { - var zipEntries = results.shift(); - var files = zipEntries.files; - for (var i = 0; i < files.length; i++) { - var input = files[i]; - zip.file(input.fileNameStr, input.decompressed, { - binary: true, - optimizedBinaryString: true, - date: input.date, - dir: input.dir, - comment: input.fileCommentStr.length ? input.fileCommentStr : null, - unixPermissions: input.unixPermissions, - dosPermissions: input.dosPermissions, - createFolders: options2.createFolders + exports2.serialize = serialize; + function serializeArray() { + var _this = this; + return this.map(function(_, elem) { + var $elem = _this._make(elem); + if (utils_1.isTag(elem) && elem.name === "form") { + return $elem.find(submittableSelector).toArray(); + } + return $elem.filter(submittableSelector).toArray(); + }).filter('[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))').map(function(_, elem) { + var _a; + var $elem = _this._make(elem); + var name = $elem.attr("name"); + var value = (_a = $elem.val()) !== null && _a !== void 0 ? _a : ""; + if (Array.isArray(value)) { + return value.map(function(val) { + return { name, value: val.replace(rCRLF, "\r\n") }; }); } - if (zipEntries.zipComment.length) { - zip.comment = zipEntries.zipComment; - } - return zip; - }); - }; + return { name, value: value.replace(rCRLF, "\r\n") }; + }).toArray(); + } + exports2.serializeArray = serializeArray; } }); -// node_modules/jszip/lib/index.js -var require_lib3 = __commonJS({ - "node_modules/jszip/lib/index.js"(exports2, module2) { +// node_modules/cheerio/lib/cheerio.js +var require_cheerio = __commonJS({ + "node_modules/cheerio/lib/cheerio.js"(exports2) { init_shims(); "use strict"; - function JSZip() { - if (!(this instanceof JSZip)) { - return new JSZip(); - } - if (arguments.length) { - throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide."); - } - this.files = Object.create(null); - this.comment = null; - this.root = ""; - this.clone = function() { - var newObj = new JSZip(); - for (var i in this) { - if (typeof this[i] !== "function") { - newObj[i] = this[i]; - } + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.Cheerio = void 0; + var tslib_1 = require_tslib(); + var parse_1 = tslib_1.__importDefault(require_parse4()); + var options_1 = tslib_1.__importDefault(require_options()); + var utils_1 = require_utils2(); + var Attributes = tslib_1.__importStar(require_attributes2()); + var Traversing = tslib_1.__importStar(require_traversing()); + var Manipulation = tslib_1.__importStar(require_manipulation2()); + var Css = tslib_1.__importStar(require_css()); + var Forms = tslib_1.__importStar(require_forms()); + var Cheerio = function() { + function Cheerio2(selector, context, root, options2) { + var _this = this; + if (options2 === void 0) { + options2 = options_1.default; + } + this.length = 0; + this.options = options2; + if (!selector) + return this; + if (root) { + if (typeof root === "string") + root = parse_1.default(root, this.options, false); + this._root = new this.constructor(root, null, null, this.options); + this._root._root = this._root; + } + if (utils_1.isCheerio(selector)) + return selector; + var elements = typeof selector === "string" && utils_1.isHtml(selector) ? parse_1.default(selector, this.options, false).children : isNode(selector) ? [selector] : Array.isArray(selector) ? selector : null; + if (elements) { + elements.forEach(function(elem, idx) { + _this[idx] = elem; + }); + this.length = elements.length; + return this; } - return newObj; + var search = selector; + var searchContext = !context ? this._root : typeof context === "string" ? utils_1.isHtml(context) ? this._make(parse_1.default(context, this.options, false)) : (search = context + " " + search, this._root) : utils_1.isCheerio(context) ? context : this._make(context); + if (!searchContext) + return this; + return searchContext.find(search); + } + Cheerio2.prototype._make = function(dom, context) { + var cheerio2 = new this.constructor(dom, context, this._root, this.options); + cheerio2.prevObject = this; + return cheerio2; }; + return Cheerio2; + }(); + exports2.Cheerio = Cheerio; + Cheerio.prototype.cheerio = "[cheerio object]"; + Cheerio.prototype.splice = Array.prototype.splice; + Cheerio.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator]; + Object.assign(Cheerio.prototype, Attributes, Traversing, Manipulation, Css, Forms); + function isNode(obj) { + return !!obj.name || obj.type === "root" || obj.type === "text" || obj.type === "comment"; } - JSZip.prototype = require_object(); - JSZip.prototype.loadAsync = require_load(); - JSZip.support = require_support(); - JSZip.defaults = require_defaults3(); - JSZip.version = "3.7.1"; - JSZip.loadAsync = function(content, options2) { - return new JSZip().loadAsync(content, options2); - }; - JSZip.external = require_external(); - module2.exports = JSZip; } }); -// node_modules/file-saver/dist/FileSaver.min.js -var require_FileSaver_min = __commonJS({ - "node_modules/file-saver/dist/FileSaver.min.js"(exports2, module2) { +// node_modules/cheerio/lib/load.js +var require_load = __commonJS({ + "node_modules/cheerio/lib/load.js"(exports2) { init_shims(); - (function(a, b) { - if (typeof define == "function" && define.amd) - define([], b); - else if (typeof exports2 != "undefined") - b(); - else { - b(), a.FileSaver = { exports: {} }.exports; - } - })(exports2, function() { - "use strict"; - function b(a2, b2) { - return typeof b2 == "undefined" ? b2 = { autoBom: false } : typeof b2 != "object" && (console.warn("Deprecated: Expected third argument to be a object"), b2 = { autoBom: !b2 }), b2.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a2.type) ? new Blob(["\uFEFF", a2], { type: a2.type }) : a2; - } - function c(a2, b2, c2) { - var d3 = new XMLHttpRequest(); - d3.open("GET", a2), d3.responseType = "blob", d3.onload = function() { - g(d3.response, b2, c2); - }, d3.onerror = function() { - console.error("could not download file"); - }, d3.send(); - } - function d2(a2) { - var b2 = new XMLHttpRequest(); - b2.open("HEAD", a2, false); - try { - b2.send(); - } catch (a3) { - } - return 200 <= b2.status && 299 >= b2.status; - } - function e(a2) { - try { - a2.dispatchEvent(new MouseEvent("click")); - } catch (c2) { - var b2 = document.createEvent("MouseEvents"); - b2.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null), a2.dispatchEvent(b2); - } - } - var f = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof global == "object" && global.global === global ? global : void 0, a = f.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), g = f.saveAs || (typeof window != "object" || window !== f ? function() { - } : "download" in HTMLAnchorElement.prototype && !a ? function(b2, g2, h) { - var i = f.URL || f.webkitURL, j = document.createElement("a"); - g2 = g2 || b2.name || "download", j.download = g2, j.rel = "noopener", typeof b2 == "string" ? (j.href = b2, j.origin === location.origin ? e(j) : d2(j.href) ? c(b2, g2, h) : e(j, j.target = "_blank")) : (j.href = i.createObjectURL(b2), setTimeout(function() { - i.revokeObjectURL(j.href); - }, 4e4), setTimeout(function() { - e(j); - }, 0)); - } : "msSaveOrOpenBlob" in navigator ? function(f2, g2, h) { - if (g2 = g2 || f2.name || "download", typeof f2 != "string") - navigator.msSaveOrOpenBlob(b(f2, h), g2); - else if (d2(f2)) - c(f2, g2, h); - else { - var i = document.createElement("a"); - i.href = f2, i.target = "_blank", setTimeout(function() { - e(i); - }); - } - } : function(b2, d3, e2, g2) { - if (g2 = g2 || open("", "_blank"), g2 && (g2.document.title = g2.document.body.innerText = "downloading..."), typeof b2 == "string") - return c(b2, d3, e2); - var h = b2.type === "application/octet-stream", i = /constructor/i.test(f.HTMLElement) || f.safari, j = /CriOS\/[\d]+/.test(navigator.userAgent); - if ((j || h && i || a) && typeof FileReader != "undefined") { - var k = new FileReader(); - k.onloadend = function() { - var a2 = k.result; - a2 = j ? a2 : a2.replace(/^data:[^;]*;/, "data:attachment/file;"), g2 ? g2.location.href = a2 : location = a2, g2 = null; - }, k.readAsDataURL(b2); - } else { - var l = f.URL || f.webkitURL, m = l.createObjectURL(b2); - g2 ? g2.location = m : location.href = m, g2 = null, setTimeout(function() { - l.revokeObjectURL(m); - }, 4e4); - } + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.load = void 0; + var tslib_1 = require_tslib(); + var options_1 = tslib_1.__importStar(require_options()); + var staticMethods = tslib_1.__importStar(require_static()); + var cheerio_1 = require_cheerio(); + var parse_1 = tslib_1.__importDefault(require_parse4()); + function load3(content, options2, isDocument) { + if (isDocument === void 0) { + isDocument = true; + } + if (content == null) { + throw new Error("cheerio.load() expects a string"); + } + var internalOpts = tslib_1.__assign(tslib_1.__assign({}, options_1.default), options_1.flatten(options2)); + var root = parse_1.default(content, internalOpts, isDocument); + var LoadedCheerio = function(_super) { + tslib_1.__extends(LoadedCheerio2, _super); + function LoadedCheerio2() { + return _super !== null && _super.apply(this, arguments) || this; + } + return LoadedCheerio2; + }(cheerio_1.Cheerio); + function initialize(selector, context, r, opts) { + if (r === void 0) { + r = root; + } + return new LoadedCheerio(selector, context, r, tslib_1.__assign(tslib_1.__assign({}, internalOpts), options_1.flatten(opts))); + } + Object.assign(initialize, staticMethods, { + load: load3, + _root: root, + _options: internalOpts, + fn: LoadedCheerio.prototype, + prototype: LoadedCheerio.prototype }); - f.saveAs = g.saveAs = g, typeof module2 != "undefined" && (module2.exports = g); - }); + return initialize; + } + exports2.load = load3; + } +}); + +// node_modules/cheerio/lib/index.js +var require_lib13 = __commonJS({ + "node_modules/cheerio/lib/index.js"(exports2) { + init_shims(); + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.root = exports2.parseHTML = exports2.merge = exports2.contains = void 0; + var tslib_1 = require_tslib(); + tslib_1.__exportStar(require_types(), exports2); + tslib_1.__exportStar(require_load(), exports2); + var load_1 = require_load(); + exports2.default = load_1.load([]); + var staticMethods = tslib_1.__importStar(require_static()); + exports2.contains = staticMethods.contains; + exports2.merge = staticMethods.merge; + exports2.parseHTML = staticMethods.parseHTML; + exports2.root = staticMethods.root; } }); @@ -21012,7 +20428,7 @@ function devalue(value) { return; } counts.set(thing, 1); - if (!isPrimitive2(thing)) { + if (!isPrimitive(thing)) { var type = getType(thing); switch (type) { case "Number": @@ -21055,7 +20471,7 @@ function devalue(value) { if (names.has(thing)) { return names.get(thing); } - if (isPrimitive2(thing)) { + if (isPrimitive(thing)) { return stringifyPrimitive(thing); } var type = getType(thing); @@ -21095,7 +20511,7 @@ function devalue(value) { var values_1 = []; names.forEach(function(name, thing) { params_1.push(name); - if (isPrimitive2(thing)) { + if (isPrimitive(thing)) { values_1.push(stringifyPrimitive(thing)); return; } @@ -21152,7 +20568,7 @@ function getName(num) { } while (num >= 0); return reserved.test(name) ? name + "_" : name; } -function isPrimitive2(thing) { +function isPrimitive(thing) { return Object(thing) !== thing; } function stringifyPrimitive(thing) { @@ -22241,9 +21657,7 @@ var import_fs = __toModule(require("fs")); var import_path = __toModule(require("path")); var import_marked = __toModule(require_marked()); var import_gray_matter = __toModule(require_gray_matter()); -var import_bluebird = __toModule(require_bluebird()); -var import_jszip = __toModule(require_lib3()); -var import_file_saver = __toModule(require_FileSaver_min()); +var cheerio = __toModule(require_lib13()); function noop2() { } var identity = (x) => x; @@ -22252,6 +21666,9 @@ function assign(tar, src2) { tar[k] = src2[k]; return tar; } +function is_promise(value) { + return value && typeof value === "object" && typeof value.then === "function"; +} function run(fn) { return fn(); } @@ -22328,58 +21745,6 @@ function setContext(key, context) { get_current_component().$$.context.set(key, context); } Promise.resolve(); -var boolean_attributes = new Set([ - "allowfullscreen", - "allowpaymentrequest", - "async", - "autofocus", - "autoplay", - "checked", - "controls", - "default", - "defer", - "disabled", - "formnovalidate", - "hidden", - "ismap", - "loop", - "multiple", - "muted", - "nomodule", - "novalidate", - "open", - "playsinline", - "readonly", - "required", - "reversed", - "selected" -]); -var invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u; -function spread(args, classes_to_add) { - const attributes = Object.assign({}, ...args); - if (classes_to_add) { - if (attributes.class == null) { - attributes.class = classes_to_add; - } else { - attributes.class += " " + classes_to_add; - } - } - let str = ""; - Object.keys(attributes).forEach((name) => { - if (invalid_attribute_name_character.test(name)) - return; - const value = attributes[name]; - if (value === true) - str += " " + name; - else if (boolean_attributes.has(name.toLowerCase())) { - if (value) - str += " " + name; - } else if (value != null) { - str += ` ${name}="${value}"`; - } - }); - return str; -} var escaped2 = { '"': """, "'": "'", @@ -22390,16 +21755,6 @@ var escaped2 = { function escape2(html) { return String(html).replace(/["'&<>]/g, (match) => escaped2[match]); } -function escape_attribute_value(value) { - return typeof value === "string" ? escape2(value) : value; -} -function escape_object(obj) { - const result = {}; - for (const key in obj) { - result[key] = escape_attribute_value(obj[key]); - } - return result; -} function each(items, fn) { let str = ""; for (let i = 0; i < items.length; i += 1) { @@ -22524,7 +21879,7 @@ var user_hooks = /* @__PURE__ */ Object.freeze({ [Symbol.toStringTag]: "Module", handle }); -var template = ({ head, body }) => '\n\n \n \n \n \n\n ' + head + '\n \n \n
' + body + "
\n \n\n"; +var template = ({ head, body }) => '\n\n \n \n \n \n\n ' + head + '\n \n \n
' + body + '
\n \n diff --git a/src/guides/urban/cases/true-color-image/interpret.md b/src/guides/urban/cases/true-color-image/interpret.md new file mode 100644 index 0000000..bad5013 --- /dev/null +++ b/src/guides/urban/cases/true-color-image/interpret.md @@ -0,0 +1,11 @@ +--- +case: 'true-color' +content: 'interpret' +--- + +**Dive deeper into this topic:** \ +You should never blindly rely on data. They know no context. That means the correct reading and interpretation of the data is up to you. Therefore, you should familiarize yourself with the false color composite, its strengths and weaknesses, before publishing your findings or making decisions based on them. + +Here we have some further resources for you: + +- Article: [More examples on RGB composites (Sentinel Hub)](https://custom-scripts.sentinel-hub.com/custom-scripts/sentinel-2/composites/) \ No newline at end of file diff --git a/src/guides/urban/cases/true-color-image/introduction.md b/src/guides/urban/cases/true-color-image/introduction.md new file mode 100644 index 0000000..6c91fb6 --- /dev/null +++ b/src/guides/urban/cases/true-color-image/introduction.md @@ -0,0 +1,10 @@ +--- +case: 'true-color' +content: 'introduction' +--- + +In the next 20-30 minutes we will use satellite data to get a true color picture of the region you have chosen. For this we will combine different bands of the satellite. Don't worry, it sounds more complicated than it is. We will guide you step-by-step through this process. And sure, at the end you will know what satellite bands are! + +Don't worry, if you get stuck, just use our forum. We and other users are happy to help you. + +Sounds good? Then go ahead... \ No newline at end of file diff --git a/src/guides/urban/cases/true-color-image/process.md b/src/guides/urban/cases/true-color-image/process.md new file mode 100644 index 0000000..3458cea --- /dev/null +++ b/src/guides/urban/cases/true-color-image/process.md @@ -0,0 +1,162 @@ +--- +case: 'true-color' +content: 'process' +--- +### Step 1: Download and install QGis +QGis is a free geographic information system application that supports viewing, editing, and analysis of geospatial data. Although it is free, it is a very professional software that is also used by satellite imagary professionals. + +QGis can be installed on all major operating systems. These include Mac OS, Microsoft Windows and also Linux. + +Installation instructions and the download for the software itself can be found here: [https://www.qgis.org/en/site/forusers/download.html](https://www.qgis.org/en/site/forusers/download.html) + +The installation requires 15-25 minutes. After completion, you can skip to step two. + +### Step 2: Open QGis and start a new project +Great, you've cleared the first hurdle. Now the fun begins, because we are going to edit the satellite data! + +The first thing to do is to start the QGis software you just installed. Now go to Project in the menu and then select `New`. + +![](/img/ndvi-2-start-project.png) + +For the next steps: Depending on which operating system you are using, the display of QGis may be slightly different. However, the corresponding options and fields should still be available. + +And one more thing: Of course, I don't use the same data on the screenshots that you do. In other words, my data may look different. Don't let this confuse you. + +### Step 3: Open the data +It sounds complicated to open satellite data, doesn't it? But it's not so bad, QGis does most of the work for us. + +It’s pretty easy to open the files: Just go to the directory where your satellite data is saved, probably in the downloads directory, select the files and drag them into the layers panel in QGis. Just take a look on my screen to know exactly where to drag them: + + + +*Note: If you have downloaded the files as a ZIP file, unpack them first.* + +No you can see your data in the layers panel and on the right, big panel you can see your data visualized. A bit too grey, isn't it? We'll take care of that in a moment... + +Make sure that you save your project. Do this by clicking on `Project` and then on `Save as`. A new window opens and you can choose the right directory on your PC and give your project a suitable name. Then just click on `Save`. + +### Step 4: Add a map for better orientation +So that we can orient ourselves better on the data, we put a map on top of the data. You can imagine it like Google Maps. So we can see better where we are. In technical language, such maps are called basemaps. That’s, too, super simple. So, let's add a basemap. + +Go to the `browser panel` (on top of the layers panel) and look for the entry `XYZ Tiles`. Click on the small arrow on the left. Now just double click on `OpenStreetMap`. + + + +
+ What is OpenStreetMap? +

OpenStreetMap, or OSM in short, is an alternative to Google Maps. The cool thing is it is completely free to use and open source. That means everybody can contribute to the maps and you can do whatever you want with the data. But that's not important for us now. If you are interested in OSM, take a look at their website.

+
+ +**Congratulations**, you’ve added a basemap to your project. + +But, what happened there! Sometimes the basemap lays on top of your satellite data and you can't see it anymore, other times the basemap lays between or under the data and you cant see the basemap anymore. No problem, we will fix this. + +Depending on what you want to do, you can change the opacity of the layers, the order or hide specific layers. For now, we will just put the basemap behind our data. To do that, we just can rearrange the order of the layers with simple drag and drop. Select the OpenStreetMap layer and drag it to the bottom of the list. + + + +### Step 5: Learn about your data and how to delineate open water features from it +Well, brace yourself: now comes the magic. What happens now? We will process the data so that we can see our area like a real photo. + +**How do we do that?** \ +We will combine different bands of a satellite. This is called a True Color Composite. But, let's start from the beginning. What exactly is our satellite data? + +This all sounds very complicated, doesn't it? Let's start from the beginning. What exactly is our satellite data? + +*Note: This content is optional. If you are not interested in the theoretical background, just jump to Step 6.* + +
+ So, what does 'raster data' mean? + +

Raster data is like a picture that you would take with a digital camera: at the lowest level of abstraction, it is a list of pixels with values. When you ‘zoom in’ and look closer at raster data, at some point you’ll see these discrete pixels, and it will look pixelated.

+

Raster data is used in pictures of the Earth, like those taken by satellites - but that is just the beginning. Pixels don’t need to have colors - instead, each pixel can have a number that represents height and the raster data as a whole stores elevation data. Or pixels can store temperature or reflection data and be useful for environmental work.

+
+ +Cool, we have raster data. But why do you have multiple files of the same location and why do they look different? That’s are different bands. On this project we use Band 2, Band 3 and Band 4 of the satellite. + +
+ What are satellite bands? +

The pixels in raster data are not necessarily just filled color: we call its contents ‘bands’. A normal image has three familiar bands: Red, Green, and Blue. Combined, they make a picture we’re familiar with. Some raster data can have fewer bands, like just one for elevation, or some can have a lot more - not just visible colors, but wavelengths we can’t see, like infrared and ultraviolet. When raster data is analyzed and displayed, you can combine and pick different bands to use to suit what you’re looking for.

+
+ +*Sure, raster data, bands, but what the heck is a False Color Composite?* Great question, my friend. In this specific composite we will combine the Bands 2, 3 and 4. Why? Read on: + +
+ How does a True Color Composite with this bands work? +

True color composite uses visible light bands red (B04), green (B03) and blue (B02) in the corresponding red, green and blue color channels, resulting in a natural colored result, that is a good representation of the Earth as humans would see it naturally.

+
+ +Enough dry theory. Now it's down to the nitty-gritty. + +### Step 6: Create a virtual raster +Let’s get ready to rumble. What we will do now, create a virtual raster with our bands you’ve downloaded. A virtual raster is something like a group of our bands. + +We want to stack the red band (B04) to the red channel, the green band (B03) to the green channel and the blue channel (B02) to the blue channel. But step by step... + +First, we have to create a virtual raster: + +1. Click on `Raster` in the top menu. +2. Choose `Miscellaneous` and select `Build Virtual Raster`. A new window should open now. +3. Beside the field Input layer is a button with 3 points. Click on it and check your three bands: B04, B03 and B02. Click `OK`. +4. Under Resolution choose `Highest`. +5. Select `Place each input file into a seperate band` and `Open output file after running algorithm`. +6. Click `Run`. +7. Wait for it… Voila. + + + +That’s all. Almost. + +### Step 7: Combine the bands +Now, we have to combine the bands in our new virtual raster the right way. Following this steps for that: + +1. Click on the small brush in the layer panel. +2. Choose `Virtual` in the first dropdown. +3. On Red band select `Band 3` and on Blue band select `Band 1`. + + + +That’s all. Almost. + +### Step 8: Analyze your data +There are now two ways to take a closer look at the data. Either via QGis itself or you export. Both have their advantages and disadvantages. I will explain them to you in the following: + +**Use QGis to move around the data**\ +QGis offers a variety of ways to dive deep into your data. You can zoom in and out of the layers, move freely on the map and make individual layers more transparent to get an even better overview. + +To make your layer more transparent so that you can see the basemap better, you first have to hide the two bands. We don't need them any more. Just click on the tick in front of the layer. My recommendation: Only tick the layers you really need. That way you keep the overview. In our case it is the virtual layer and the basemap: + + + +Then click on the small brush in the layers panel. A new area has opened on the right side. Click on `Transparency` to set the transparency for each layer under `Global Transparency`. Make sure that you have selected the right layer. I set the transparency a little lower so that I can see the basemap underneath better. This makes it easier for me to orientate myself. + + + +**Export the image**\ +To be able to share your data with others or to print them, it is useful to export the data - for example as PDF or JPG. You can then share the files with other people without them having to have QGis installed. Practical, isn't it? + +To do this, simply take the following steps: + +1. Go to `Project` in the menu. +2. Select `Import/Export` and choose `Export Map to Image` or `Export Map to PDF`. +3. If you have selected PDF: Check the box `Create Geospatial PDF (GeoPDF)`. +4. Now click `Save`. +5. Select the location where you want to save the file, enter a file name and click `Save`. + + \ No newline at end of file diff --git a/src/guides/urban/cases/visualize-urban-areas/interpret.md b/src/guides/urban/cases/visualize-urban-areas/interpret.md new file mode 100644 index 0000000..ac4e92f --- /dev/null +++ b/src/guides/urban/cases/visualize-urban-areas/interpret.md @@ -0,0 +1,15 @@ +--- +case: 'urban-development' +content: 'interpret' +--- +**How to read the colors:** \ +Green (variety of shades): Vegetation \ +White, grey, or purple: Urbanized area \ +Black or blue: Snow, ice and water + +**Dive deeper into this topic:** \ +You should never blindly rely on data. They know no context. That means the correct reading and interpretation of the data is up to you. Therefore, you should familiarize yourself with the false color composite, its strengths and weaknesses, before publishing your findings or making decisions based on them. + +Here we have some further resources for you: + +- Article: [More examples on RGB/false color composites (Sentinel Hub)](https://custom-scripts.sentinel-hub.com/custom-scripts/sentinel-2/composites/) \ No newline at end of file diff --git a/src/guides/urban/cases/visualize-urban-areas/introduction.md b/src/guides/urban/cases/visualize-urban-areas/introduction.md new file mode 100644 index 0000000..41a1ffa --- /dev/null +++ b/src/guides/urban/cases/visualize-urban-areas/introduction.md @@ -0,0 +1,10 @@ +--- +case: 'urban-development' +content: 'introduction' +--- + +In the next 20-30 minutes we will use satellite data to highlight urbanized areas in the region you have chosen. For this we will combine different bands of the satellite. Don't worry, it sounds more complicated than it is. We will guide you step-by-step through this process. And sure, at the end you will know what satellite bands are! + +Don't worry, if you get stuck, just use our forum. We and other users are happy to help you. + +Sounds good? Then go ahead... \ No newline at end of file diff --git a/src/guides/urban/cases/visualize-urban-areas/process.md b/src/guides/urban/cases/visualize-urban-areas/process.md new file mode 100644 index 0000000..6be02b4 --- /dev/null +++ b/src/guides/urban/cases/visualize-urban-areas/process.md @@ -0,0 +1,151 @@ +--- +case: 'urban-development' +content: 'process' +--- +### Step 1: Download and install QGis +QGis is a free geographic information system application that supports viewing, editing, and analysis of geospatial data. Although it is free, it is a very professional software that is also used by satellite imagary professionals. + +QGis can be installed on all major operating systems. These include Mac OS, Microsoft Windows and also Linux. + +Installation instructions and the download for the software itself can be found here: [https://www.qgis.org/en/site/forusers/download.html](https://www.qgis.org/en/site/forusers/download.html) + +The installation requires 15-25 minutes. After completion, you can skip to step two. + +### Step 2: Open QGis and start a new project +Great, you've cleared the first hurdle. Now the fun begins, because we are going to edit the satellite data! + +The first thing to do is to start the QGis software you just installed. Now go to Project in the menu and then select `New`. + +![](/img/ndvi-2-start-project.png) + +For the next steps: Depending on which operating system you are using, the display of QGis may be slightly different. However, the corresponding options and fields should still be available. + +And one more thing: Of course, I don't use the same data on the screenshots that you do. In other words, my data may look different. Don't let this confuse you. + +### Step 3: Open the data +It sounds complicated to open satellite data, doesn't it? But it's not so bad, QGis does most of the work for us. + +It’s pretty easy to open the files: Just go to the directory where your satellite data is saved, probably in the downloads directory, select the files and drag them into the layers panel in QGis. Just take a look on my screen to know exactly where to drag them: + + + +*Note: If you have downloaded the files as a ZIP file, unpack them first.* + +No you can see your data in the layers panel and on the right, big panel you can see your data visualized. A bit too grey, isn't it? We'll take care of that in a moment... + +Make sure that you save your project. Do this by clicking on `Project` and then on `Save as`. A new window opens and you can choose the right directory on your PC and give your project a suitable name. Then just click on `Save`. + +### Step 4: Add a map for better orientation +So that we can orient ourselves better on the data, we put a map on top of the data. You can imagine it like Google Maps. So we can see better where we are. In technical language, such maps are called basemaps. That’s, too, super simple. So, let's add a basemap. + +Go to the `browser panel` (on top of the layers panel) and look for the entry `XYZ Tiles`. Click on the small arrow on the left. Now just double click on `OpenStreetMap`. + + + +
+ What is OpenStreetMap? +

OpenStreetMap, or OSM in short, is an alternative to Google Maps. The cool thing is it is completely free to use and open source. That means everybody can contribute to the maps and you can do whatever you want with the data. But that's not important for us now. If you are interested in OSM, take a look at their website.

+
+ +**Congratulations**, you’ve added a basemap to your project. + +But, what happened there! Sometimes the basemap lays on top of your satellite data and you can't see it anymore, other times the basemap lays between or under the data and you cant see the basemap anymore. No problem, we will fix this. + +Depending on what you want to do, you can change the opacity of the layers, the order or hide specific layers. For now, we will just put the basemap behind our data. To do that, we just can rearrange the order of the layers with simple drag and drop. Select the OpenStreetMap layer and drag it to the bottom of the list. + + + +### Step 5: Learn about your data and how to highligt the urbanized areas +Well, brace yourself: now comes the magic. What happens now? We will process the data so that we can clearly see urbanized areas. + +**How do we do that?** \ +We will combine different bands of a satellite. This is called a False Color Composite. But, let's start from the beginning. What exactly is our satellite data? + +This all sounds very complicated, doesn't it? Let's start from the beginning. What exactly is our satellite data? + +*Note: This content is optional. If you are not interested in the theoretical background, just jump to Step 6.* + +
+ So, what does 'raster data' mean? + +

Raster data is like a picture that you would take with a digital camera: at the lowest level of abstraction, it is a list of pixels with values. When you ‘zoom in’ and look closer at raster data, at some point you’ll see these discrete pixels, and it will look pixelated.

+

Raster data is used in pictures of the Earth, like those taken by satellites - but that is just the beginning. Pixels don’t need to have colors - instead, each pixel can have a number that represents height and the raster data as a whole stores elevation data. Or pixels can store temperature or reflection data and be useful for environmental work.

+
+ +Cool, we have raster data. But why do you have multiple files of the same location and why do they look different? That’s are different bands. On this project we use Band 4, Band 11 and Band 12 of the satellite. + +
+ What are satellite bands? +

The pixels in raster data are not necessarily just filled color: we call its contents ‘bands’. A normal image has three familiar bands: Red, Green, and Blue. Combined, they make a picture we’re familiar with. Some raster data can have fewer bands, like just one for elevation, or some can have a lot more - not just visible colors, but wavelengths we can’t see, like infrared and ultraviolet. When raster data is analyzed and displayed, you can combine and pick different bands to use to suit what you’re looking for.

+
+ +*Sure, raster data, bands, but what the heck is a False Color Composite?* Great question, my friend. In this specific composite we will combine the Bands 4, 11 and 12. Why? Read on: + +
+ How does a False Color Composite with this bands work? +

A false color image is one in which the R,G, and B values do not correspond to the true colors of red, green and blue.

+

False color composites allow us to visualize the wavelengths the human eye does not see. Such images are a representation of a multispectral image created using ranges other than visible red, green and blue, such as red, green and blue image components. There are many false color compositions, each highlighting different features in the image.

+

In our band combination vegetation is visible in shades of green, urbanized areas are represented by white, gray, or purple, and soils, sand, and minerals are shown in a variety of colors.

+
+ +Enough dry theory. Now it's down to the nitty-gritty. + +### Step 6: Create a virtual raster +Let’s get ready to rumble. What we will do now, create a virtual raster with our bands you’ve downloaded. A virtual raster is something like a group of our bands. + +We want to stack the red band (B04) to the blue channel, and the first short wave infrared (B11) band to the green channel and the second SWIR band (B12) to the red channel. But steo by step... + +First, we have to create a virtual raster: + +1. Click on `Raster` in the top menu. +2. Choose `Miscellaneous` and select `Build Virtual Raster`. A new window should open now. +3. Beside the field Input layer is a button with 3 points. Click on it and check your three bands: B04, B11 and B12. Click `OK`. +4. Under Resolution choose `Highest`. +5. Select `Place each input file into a seperate band` and `Open output file after running algorithm`. +6. Click `Run`. +7. Wait for it… Voila. + + + +That’s all. Almost. + +### Step 7: Analyze your data +There are now two ways to take a closer look at the data. Either via QGis itself or you export. Both have their advantages and disadvantages. I will explain them to you in the following: + +**Use QGis to move around the data**\ +QGis offers a variety of ways to dive deep into your data. You can zoom in and out of the layers, move freely on the map and make individual layers more transparent to get an even better overview. + +To make your layer more transparent so that you can see the basemap better, you first have to hide the two bands. We don't need them any more. Just click on the tick in front of the layer. My recommendation: Only tick the layers you really need. That way you keep the overview. In our case it is the virtual layer and the basemap: + + + +Then click on the small brush in the layers panel. A new area has opened on the right side. Click on `Transparency` to set the transparency for each layer under `Global Transparency`. Make sure that you have selected the right layer. I set the transparency a little lower so that I can see the basemap underneath better. This makes it easier for me to orientate myself. + + + +**Export the image**\ +To be able to share your data with others or to print them, it is useful to export the data - for example as PDF or JPG. You can then share the files with other people without them having to have QGis installed. Practical, isn't it? + +To do this, simply take the following steps: + +1. Go to `Project` in the menu. +2. Select `Import/Export` and choose `Export Map to Image` or `Export Map to PDF`. +3. If you have selected PDF: Check the box `Create Geospatial PDF (GeoPDF)`. +4. Now click `Save`. +5. Select the location where you want to save the file, enter a file name and click `Save`. + + \ No newline at end of file diff --git a/src/guides/vegetation/cases/barren-soil/case.md b/src/guides/vegetation/cases/barren-soil/case.md deleted file mode 100644 index 34c6692..0000000 --- a/src/guides/vegetation/cases/barren-soil/case.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -heading: 'Visualizing Barren Soil' -difficulty: 'moderate' -id: 'barren-soil' ---- \ No newline at end of file diff --git a/src/guides/vegetation/cases/barren-soil/interpret.md b/src/guides/vegetation/cases/barren-soil/interpret.md deleted file mode 100644 index 0efdf10..0000000 --- a/src/guides/vegetation/cases/barren-soil/interpret.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -case: 'barren-soil' -content: 'interpret' ---- - -How to read the colors: Red colored areas correspond to empty areas of rocks, sand or snow. Moderate values, mostly orange to yellow, represent shrubs and meadows, while bright green areas indicate temperate and tropical forests. - -Dive deeper into this topic: You should never blindly rely on data. They know no context. That means the correct reading and interpretation of the data is up to you. Therefore, you should familiarize yourself with the NDVI, its strengths and weaknesses, before publishing your findings or making decisions based on them. - -Here we have some further resources for you: - -- [Get started with the NDVI (EOS)](https://www.google.com) -- [What is NDVI and how can you benefit (Broadwater Contracting)](https://www.google.com) -- [Performance and limitations (Wikipedia)](https://www.google.com) -- [Measuring Vegetation with NDVI & EVI (NASA Earth Observatory)](https://www.google.com) \ No newline at end of file diff --git a/src/guides/vegetation/cases/barren-soil/introduction.md b/src/guides/vegetation/cases/barren-soil/introduction.md deleted file mode 100644 index 8bfdbec..0000000 --- a/src/guides/vegetation/cases/barren-soil/introduction.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -case: 'barren-soil' -content: 'introduction' ---- - -In the next 20-30 minutes we will analyze the green vegetation on a satellite image showing the region you have chosen. For this we will use a scientific indicator - the Normalized Difference Vegetation Index. Or NDVI for short. Don't worry, it sounds more complicated than it is. We will guide you step-by-step through this process. - -At the end you will get a picture where healthy vegetation is colored green and unhealthy vegetation, i.e. vegetation with low or no chlorophyll content, is colored orange or red. This gives you a quick overview of the state of the vegetation in your study area. - -Don't worry, if you get stuck, just use our forum. We and other users are happy to help you. - -Sounds good? Then go ahead... \ No newline at end of file diff --git a/src/guides/vegetation/cases/barren-soil/process.md b/src/guides/vegetation/cases/barren-soil/process.md deleted file mode 100644 index ff281fc..0000000 --- a/src/guides/vegetation/cases/barren-soil/process.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -case: 'barren-soil' -content: 'process' ---- -## Step 1: Downloading & Installing QGis - -Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. - -## Step 2: Open the image - -Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. \ No newline at end of file diff --git a/src/lib/css/utilities/_button.css b/src/lib/css/utilities/_button.css index be7ee2b..5d4175a 100644 --- a/src/lib/css/utilities/_button.css +++ b/src/lib/css/utilities/_button.css @@ -4,7 +4,7 @@ a.button { font-family: 'nowayregular', -apple-system, BlinkMacSystemFont, sans-serif; color: #fff; padding: 20px 16px; - width: 80%; + width: 100%; font-size: 21px; margin: 2rem auto 2rem 0; box-shadow: #000 1px 2px 0; @@ -15,10 +15,14 @@ a.button { gap: var(--size-500); justify-content: center; align-items: center; - text-shadow: none; + text-shadow: none; transition: box-shadow 0.2s ease-out; } +a.formButton { + margin-left: 140px; +} + a.button:not(.disableButton):hover, a.button:not(.disableButton):focus { box-shadow: none; } diff --git a/src/routes/404/__layout.reset.svelte b/src/routes/404/__layout.reset.svelte new file mode 100644 index 0000000..d9b523b --- /dev/null +++ b/src/routes/404/__layout.reset.svelte @@ -0,0 +1,23 @@ + + + + OpenSpaceData | Cannot find page + + +
+ +
+ +
+ +