diff --git a/packages/kbot/dist-in/data/openai_models.json b/packages/kbot/dist-in/data/openai_models.json index 8518de32..5e50be70 100644 --- a/packages/kbot/dist-in/data/openai_models.json +++ b/packages/kbot/dist-in/data/openai_models.json @@ -1,5 +1,5 @@ { - "timestamp": 1757758318142, + "timestamp": 1757760643663, "models": [ { "id": "gpt-4-0613", diff --git a/packages/kbot/dist-in/data/openrouter_models.json b/packages/kbot/dist-in/data/openrouter_models.json index 5e5410fe..8c393a17 100644 --- a/packages/kbot/dist-in/data/openrouter_models.json +++ b/packages/kbot/dist-in/data/openrouter_models.json @@ -1,5 +1,5 @@ { - "timestamp": 1757758318388, + "timestamp": 1757760644021, "models": [ { "id": "qwen/qwen3-next-80b-a3b-thinking", diff --git a/packages/kbot/dist-in/zod_types.d.ts b/packages/kbot/dist-in/zod_types.d.ts index cd7168b2..9e477dac 100644 --- a/packages/kbot/dist-in/zod_types.d.ts +++ b/packages/kbot/dist-in/zod_types.d.ts @@ -39,6 +39,8 @@ export interface IKBotOptions { aion-labs/aion-1.0-mini | paid aion-labs/aion-rp-llama-3.1-8b | paid alfredpros/codellama-7b-instruct-solidity | paid + allenai/molmo-7b-d | paid + allenai/olmo-2-0325-32b-instruct | paid amazon/nova-lite-v1 | paid amazon/nova-micro-v1 | paid amazon/nova-pro-v1 | paid @@ -64,6 +66,7 @@ export interface IKBotOptions { baidu/ernie-4.5-300b-a47b | paid baidu/ernie-4.5-vl-28b-a3b | paid baidu/ernie-4.5-vl-424b-a47b | paid + bytedance/seed-oss-36b-instruct | paid bytedance/ui-tars-1.5-7b | paid deepcogito/cogito-v2-preview-llama-109b-moe | paid cohere/command | paid @@ -113,7 +116,6 @@ export interface IKBotOptions { google/gemini-2.5-flash-lite | paid google/gemini-2.5-flash-lite-preview-06-17 | paid google/gemini-2.5-pro | paid - google/gemini-2.5-pro-exp-03-25 | paid google/gemini-2.5-pro-preview-05-06 | paid google/gemini-2.5-pro-preview | paid google/gemma-2-27b-it | paid @@ -130,7 +132,6 @@ export interface IKBotOptions { google/gemma-3n-e4b-it:free | free inception/mercury | paid inception/mercury-coder | paid - infermatic/mn-inferor-12b | paid inflection/inflection-3-pi | paid inflection/inflection-3-productivity | paid liquid/lfm-3b | paid @@ -139,6 +140,7 @@ export interface IKBotOptions { anthracite-org/magnum-v2-72b | paid anthracite-org/magnum-v4-72b | paid mancer/weaver | paid + meituan/longcat-flash-chat | paid meta-llama/llama-3-70b-instruct | paid meta-llama/llama-3-8b-instruct | paid meta-llama/llama-3.1-405b | paid @@ -210,6 +212,7 @@ export interface IKBotOptions { moonshotai/kimi-dev-72b:free | free moonshotai/kimi-k2 | paid moonshotai/kimi-k2:free | free + moonshotai/kimi-k2-0905 | paid moonshotai/kimi-vl-a3b-thinking | paid moonshotai/kimi-vl-a3b-thinking:free | free morph/morph-v3-fast | paid @@ -228,7 +231,8 @@ export interface IKBotOptions { nvidia/llama-3.1-nemotron-70b-instruct | paid nvidia/llama-3.1-nemotron-ultra-253b-v1 | paid nvidia/llama-3.1-nemotron-ultra-253b-v1:free | free - nvidia/llama-3.3-nemotron-super-49b-v1 | paid + nvidia/nemotron-nano-9b-v2 | paid + nvidia/nemotron-nano-9b-v2:free | free openai/chatgpt-4o-latest | paid openai/codex-mini | paid openai/gpt-3.5-turbo | paid @@ -277,7 +281,8 @@ export interface IKBotOptions { perplexity/sonar-pro | paid perplexity/sonar-reasoning | paid perplexity/sonar-reasoning-pro | paid - pygmalionai/mythalion-13b | paid + qwen/qwen-plus-2025-07-28 | paid + qwen/qwen-plus-2025-07-28:thinking | paid qwen/qwen-vl-max | paid qwen/qwen-vl-plus | paid qwen/qwen-max | paid @@ -305,6 +310,9 @@ export interface IKBotOptions { qwen/qwen3-coder-30b-a3b-instruct | paid qwen/qwen3-coder | paid qwen/qwen3-coder:free | free + qwen/qwen3-max | paid + qwen/qwen3-next-80b-a3b-instruct | paid + qwen/qwen3-next-80b-a3b-thinking | paid qwen/qwq-32b | paid qwen/qwq-32b:free | free qwen/qwq-32b-preview | paid @@ -321,7 +329,10 @@ export interface IKBotOptions { sao10k/l3.3-euryale-70b | paid shisa-ai/shisa-v2-llama3.3-70b | paid shisa-ai/shisa-v2-llama3.3-70b:free | free + openrouter/sonoma-dusk-alpha | paid + openrouter/sonoma-sky-alpha | paid raifle/sorcererlm-8x22b | paid + stepfun-ai/step3 | paid switchpoint/router | paid tencent/hunyuan-a13b-instruct | paid tencent/hunyuan-a13b-instruct:free | free @@ -346,7 +357,6 @@ export interface IKBotOptions { x-ai/grok-3-mini-beta | paid x-ai/grok-4 | paid x-ai/grok-code-fast-1 | paid - x-ai/grok-vision-beta | paid z-ai/glm-4-32b | paid z-ai/glm-4.5 | paid z-ai/glm-4.5-air | paid diff --git a/packages/kbot/dist/main_node.cjs b/packages/kbot/dist/main_node.cjs index 61bf96c1..f7de8d1a 100644 --- a/packages/kbot/dist/main_node.cjs +++ b/packages/kbot/dist/main_node.cjs @@ -1266,17136 +1266,6 @@ exports.ud = deferred; __webpack_unused_export__ = deferred; //# sourceMappingURL=index.js.map -/***/ }), - -/***/ 53141: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const { parse } = __webpack_require__(72636); - -module.exports = function (elt) { - const style = new CSSStyleDeclaration(elt) - const handler = { - get: function(target, property) { - return property in target ? target[property] : target.getPropertyValue(dasherizeProperty(property)); - }, - has: function(target, key) { - return true; - }, - set: function(target, property, value) { - if (property in target) { - target[property] = value; - } else { - target.setProperty(dasherizeProperty(property), value ?? undefined); - } - - return true; - } - }; - - return new Proxy(style, handler); -}; - -function dasherizeProperty(property) { - return property.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); -} - - -function CSSStyleDeclaration(elt) { - this._element = elt; -} - -const IMPORTANT_BANG = '!important'; - -// Utility function for parsing style declarations -// Pass in a string like "margin-left: 5px; border-style: solid" -// and this function returns an object like -// {"margin-left":"5px", "border-style":"solid"} -function parseStyles(value) { - const result = { - property: {}, - priority: {}, - } - - if (!value) { - return result; - } - - const styleValues = parse(value); - if (styleValues.length < 2) { - return result; - } - - for (let i = 0; i < styleValues.length; i += 2) { - const name = styleValues[i]; - let value = styleValues[i+1]; - - if (value.endsWith(IMPORTANT_BANG)) { - result.priority[name] = 'important'; - value = value.slice(0, -IMPORTANT_BANG.length).trim(); - } - - result.property[name] = value; - } - - return result; -} - -var NO_CHANGE = {}; // Private marker object - -CSSStyleDeclaration.prototype = Object.create(Object.prototype, { - - // Return the parsed form of the element's style attribute. - // If the element's style attribute has never been parsed - // or if it has changed since the last parse, then reparse it - // Note that the styles don't get parsed until they're actually needed - _parsed: { get: function() { - if (!this._parsedStyles || this.cssText !== this._lastParsedText) { - var text = this.cssText; - this._parsedStyles = parseStyles(text); - this._lastParsedText = text; - delete this._names; - } - return this._parsedStyles; - }}, - - // Call this method any time the parsed representation of the - // style changes. It converts the style properties to a string and - // sets cssText and the element's style attribute - _serialize: { value: function() { - var styles = this._parsed; - var s = ""; - - for(var name in styles.property) { - if (s) s += " "; - s += name + ": " + styles.property[name]; - if (styles.priority[name]) { - s += " !" + styles.priority[name]; - } - s += ";"; - } - - this.cssText = s; // also sets the style attribute - this._lastParsedText = s; // so we don't reparse - delete this._names; - }}, - - cssText: { - get: function() { - // XXX: this is a CSSStyleDeclaration for an element. - // A different impl might be necessary for a set of styles - // associated returned by getComputedStyle(), e.g. - return this._element.getAttribute("style"); - }, - set: function(value) { - // XXX: I should parse and serialize the value to - // normalize it and remove errors. FF and chrome do that. - this._element.setAttribute("style", value); - } - }, - - length: { get: function() { - if (!this._names) - this._names = Object.getOwnPropertyNames(this._parsed.property); - return this._names.length; - }}, - - item: { value: function(n) { - if (!this._names) - this._names = Object.getOwnPropertyNames(this._parsed.property); - return this._names[n]; - }}, - - getPropertyValue: { value: function(property) { - property = property.toLowerCase(); - return this._parsed.property[property] || ""; - }}, - - getPropertyPriority: { value: function(property) { - property = property.toLowerCase(); - return this._parsed.priority[property] || ""; - }}, - - setProperty: { value: function(property, value, priority) { - property = property.toLowerCase(); - if (value === null || value === undefined) { - value = ""; - } - if (priority === null || priority === undefined) { - priority = ""; - } - - // String coercion - if (value !== NO_CHANGE) { - value = "" + value; - } - - value = value.trim(); - if (value === "") { - this.removeProperty(property); - return; - } - - if (priority !== "" && priority !== NO_CHANGE && - !/^important$/i.test(priority)) { - return; - } - - var styles = this._parsed; - if (value === NO_CHANGE) { - if (!styles.property[property]) { - return; // Not a valid property name. - } - if (priority !== "") { - styles.priority[property] = "important"; - } else { - delete styles.priority[property]; - } - } else { - // We don't just accept the property value. Instead - // we parse it to ensure that it is something valid. - // If it contains a semicolon it is invalid - if (value.indexOf(";") !== -1) return; - - var newprops = parseStyles(property + ":" + value); - if (Object.getOwnPropertyNames(newprops.property).length === 0) { - return; // no valid property found - } - if (Object.getOwnPropertyNames(newprops.priority).length !== 0) { - return; // if the value included '!important' it wasn't valid. - } - - // XXX handle shorthand properties - - for (var p in newprops.property) { - styles.property[p] = newprops.property[p]; - if (priority === NO_CHANGE) { - continue; - } else if (priority !== "") { - styles.priority[p] = "important"; - } else if (styles.priority[p]) { - delete styles.priority[p]; - } - } - } - - // Serialize and update cssText and element.style! - this._serialize(); - }}, - - setPropertyValue: { value: function(property, value) { - return this.setProperty(property, value, NO_CHANGE); - }}, - - setPropertyPriority: { value: function(property, priority) { - return this.setProperty(property, NO_CHANGE, priority); - }}, - - removeProperty: { value: function(property) { - property = property.toLowerCase(); - var styles = this._parsed; - if (property in styles.property) { - delete styles.property[property]; - delete styles.priority[property]; - - // Serialize and update cssText and element.style! - this._serialize(); - } - }}, -}); - - -/***/ }), - -/***/ 90086: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/* jshint bitwise: false */ - -module.exports = CharacterData; - -var Leaf = __webpack_require__(8161); -var utils = __webpack_require__(89076); -var ChildNode = __webpack_require__(52091); -var NonDocumentTypeChildNode = __webpack_require__(32001); - -function CharacterData() { - Leaf.call(this); -} - -CharacterData.prototype = Object.create(Leaf.prototype, { - // DOMString substringData(unsigned long offset, - // unsigned long count); - // The substringData(offset, count) method must run these steps: - // - // If offset is greater than the context object's - // length, throw an INDEX_SIZE_ERR exception and - // terminate these steps. - // - // If offset+count is greater than the context - // object's length, return a DOMString whose value is - // the UTF-16 code units from the offsetth UTF-16 code - // unit to the end of data. - // - // Return a DOMString whose value is the UTF-16 code - // units from the offsetth UTF-16 code unit to the - // offset+countth UTF-16 code unit in data. - substringData: { value: function substringData(offset, count) { - if (arguments.length < 2) { throw new TypeError("Not enough arguments"); } - // Convert arguments to WebIDL "unsigned long" - offset = offset >>> 0; - count = count >>> 0; - if (offset > this.data.length || offset < 0 || count < 0) { - utils.IndexSizeError(); - } - return this.data.substring(offset, offset+count); - }}, - - // void appendData(DOMString data); - // The appendData(data) method must append data to the context - // object's data. - appendData: { value: function appendData(data) { - if (arguments.length < 1) { throw new TypeError("Not enough arguments"); } - this.data += String(data); - }}, - - // void insertData(unsigned long offset, DOMString data); - // The insertData(offset, data) method must run these steps: - // - // If offset is greater than the context object's - // length, throw an INDEX_SIZE_ERR exception and - // terminate these steps. - // - // Insert data into the context object's data after - // offset UTF-16 code units. - // - insertData: { value: function insertData(offset, data) { - return this.replaceData(offset, 0, data); - }}, - - - // void deleteData(unsigned long offset, unsigned long count); - // The deleteData(offset, count) method must run these steps: - // - // If offset is greater than the context object's - // length, throw an INDEX_SIZE_ERR exception and - // terminate these steps. - // - // If offset+count is greater than the context - // object's length var count be length-offset. - // - // Starting from offset UTF-16 code units remove count - // UTF-16 code units from the context object's data. - deleteData: { value: function deleteData(offset, count) { - return this.replaceData(offset, count, ''); - }}, - - - // void replaceData(unsigned long offset, unsigned long count, - // DOMString data); - // - // The replaceData(offset, count, data) method must act as - // if the deleteData() method is invoked with offset and - // count as arguments followed by the insertData() method - // with offset and data as arguments and re-throw any - // exceptions these methods might have thrown. - replaceData: { value: function replaceData(offset, count, data) { - var curtext = this.data, len = curtext.length; - // Convert arguments to correct WebIDL type - offset = offset >>> 0; - count = count >>> 0; - data = String(data); - - if (offset > len || offset < 0) utils.IndexSizeError(); - - if (offset+count > len) - count = len - offset; - - var prefix = curtext.substring(0, offset), - suffix = curtext.substring(offset+count); - - this.data = prefix + data + suffix; - }}, - - // Utility method that Node.isEqualNode() calls to test Text and - // Comment nodes for equality. It is okay to put it here, since - // Node will have already verified that nodeType is equal - isEqual: { value: function isEqual(n) { - return this._data === n._data; - }}, - - length: { get: function() { return this.data.length; }} - -}); - -Object.defineProperties(CharacterData.prototype, ChildNode); -Object.defineProperties(CharacterData.prototype, NonDocumentTypeChildNode); - - -/***/ }), - -/***/ 52091: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var Node = __webpack_require__(97537); -var LinkedList = __webpack_require__(41360); - -var createDocumentFragmentFromArguments = function(document, args) { - var docFrag = document.createDocumentFragment(); - - for (var i=0; i { - -"use strict"; - -module.exports = Comment; - -var Node = __webpack_require__(97537); -var CharacterData = __webpack_require__(90086); - -function Comment(doc, data) { - CharacterData.call(this); - this.nodeType = Node.COMMENT_NODE; - this.ownerDocument = doc; - this._data = data; -} - -var nodeValue = { - get: function() { return this._data; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } else { v = String(v); } - this._data = v; - if (this.rooted) - this.ownerDocument.mutateValue(this); - } -}; - -Comment.prototype = Object.create(CharacterData.prototype, { - nodeName: { value: '#comment' }, - nodeValue: nodeValue, - textContent: nodeValue, - innerText: nodeValue, - data: { - get: nodeValue.get, - set: function(v) { - nodeValue.set.call(this, v===null ? '' : String(v)); - }, - }, - - // Utility methods - clone: { value: function clone() { - return new Comment(this.ownerDocument, this._data); - }}, -}); - - -/***/ }), - -/***/ 38554: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = ContainerNode; - -var Node = __webpack_require__(97537); -var NodeList = __webpack_require__(64965); - -// This class defines common functionality for node subtypes that -// can have children - -function ContainerNode() { - Node.call(this); - this._firstChild = this._childNodes = null; -} - -// Primary representation is a circular linked list of siblings -ContainerNode.prototype = Object.create(Node.prototype, { - - hasChildNodes: { value: function() { - if (this._childNodes) { - return this._childNodes.length > 0; - } - return this._firstChild !== null; - }}, - - childNodes: { get: function() { - this._ensureChildNodes(); - return this._childNodes; - }}, - - firstChild: { get: function() { - if (this._childNodes) { - return this._childNodes.length === 0 ? null : this._childNodes[0]; - } - return this._firstChild; - }}, - - lastChild: { get: function() { - var kids = this._childNodes, first; - if (kids) { - return kids.length === 0 ? null: kids[kids.length-1]; - } - first = this._firstChild; - if (first === null) { return null; } - return first._previousSibling; // circular linked list - }}, - - _ensureChildNodes: { value: function() { - if (this._childNodes) { return; } - var first = this._firstChild, - kid = first, - childNodes = this._childNodes = new NodeList(); - if (first) do { - childNodes.push(kid); - kid = kid._nextSibling; - } while (kid !== first); // circular linked list - this._firstChild = null; // free memory - }}, - - // Remove all of this node's children. This is a minor - // optimization that only calls modify() once. - removeChildren: { value: function removeChildren() { - var root = this.rooted ? this.ownerDocument : null, - next = this.firstChild, - kid; - while (next !== null) { - kid = next; - next = kid.nextSibling; - - if (root) root.mutateRemove(kid); - kid.parentNode = null; - } - if (this._childNodes) { - this._childNodes.length = 0; - } else { - this._firstChild = null; - } - this.modify(); // Update last modified type once only - }}, - -}); - - -/***/ }), - -/***/ 22112: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = CustomEvent; - -var Event = __webpack_require__(13441); - -function CustomEvent(type, dictionary) { - // Just use the superclass constructor to initialize - Event.call(this, type, dictionary); -} -CustomEvent.prototype = Object.create(Event.prototype, { - constructor: { value: CustomEvent } -}); - - -/***/ }), - -/***/ 46364: -/***/ ((module) => { - -"use strict"; - -module.exports = DOMException; - -var INDEX_SIZE_ERR = 1; -var HIERARCHY_REQUEST_ERR = 3; -var WRONG_DOCUMENT_ERR = 4; -var INVALID_CHARACTER_ERR = 5; -var NO_MODIFICATION_ALLOWED_ERR = 7; -var NOT_FOUND_ERR = 8; -var NOT_SUPPORTED_ERR = 9; -var INVALID_STATE_ERR = 11; -var SYNTAX_ERR = 12; -var INVALID_MODIFICATION_ERR = 13; -var NAMESPACE_ERR = 14; -var INVALID_ACCESS_ERR = 15; -var TYPE_MISMATCH_ERR = 17; -var SECURITY_ERR = 18; -var NETWORK_ERR = 19; -var ABORT_ERR = 20; -var URL_MISMATCH_ERR = 21; -var QUOTA_EXCEEDED_ERR = 22; -var TIMEOUT_ERR = 23; -var INVALID_NODE_TYPE_ERR = 24; -var DATA_CLONE_ERR = 25; - -// Code to name -var names = [ - null, // No error with code 0 - 'INDEX_SIZE_ERR', - null, // historical - 'HIERARCHY_REQUEST_ERR', - 'WRONG_DOCUMENT_ERR', - 'INVALID_CHARACTER_ERR', - null, // historical - 'NO_MODIFICATION_ALLOWED_ERR', - 'NOT_FOUND_ERR', - 'NOT_SUPPORTED_ERR', - 'INUSE_ATTRIBUTE_ERR', // historical - 'INVALID_STATE_ERR', - 'SYNTAX_ERR', - 'INVALID_MODIFICATION_ERR', - 'NAMESPACE_ERR', - 'INVALID_ACCESS_ERR', - null, // historical - 'TYPE_MISMATCH_ERR', - 'SECURITY_ERR', - 'NETWORK_ERR', - 'ABORT_ERR', - 'URL_MISMATCH_ERR', - 'QUOTA_EXCEEDED_ERR', - 'TIMEOUT_ERR', - 'INVALID_NODE_TYPE_ERR', - 'DATA_CLONE_ERR', -]; - -// Code to message -// These strings are from the 13 May 2011 Editor's Draft of DOM Core. -// http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html -// Copyright © 2011 W3C® (MIT, ERCIM, Keio), All Rights Reserved. -// Used under the terms of the W3C Document License: -// http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231 -var messages = [ - null, // No error with code 0 - 'INDEX_SIZE_ERR (1): the index is not in the allowed range', - null, - 'HIERARCHY_REQUEST_ERR (3): the operation would yield an incorrect nodes model', - 'WRONG_DOCUMENT_ERR (4): the object is in the wrong Document, a call to importNode is required', - 'INVALID_CHARACTER_ERR (5): the string contains invalid characters', - null, - 'NO_MODIFICATION_ALLOWED_ERR (7): the object can not be modified', - 'NOT_FOUND_ERR (8): the object can not be found here', - 'NOT_SUPPORTED_ERR (9): this operation is not supported', - 'INUSE_ATTRIBUTE_ERR (10): setAttributeNode called on owned Attribute', - 'INVALID_STATE_ERR (11): the object is in an invalid state', - 'SYNTAX_ERR (12): the string did not match the expected pattern', - 'INVALID_MODIFICATION_ERR (13): the object can not be modified in this way', - 'NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML', - 'INVALID_ACCESS_ERR (15): the object does not support the operation or argument', - null, - 'TYPE_MISMATCH_ERR (17): the type of the object does not match the expected type', - 'SECURITY_ERR (18): the operation is insecure', - 'NETWORK_ERR (19): a network error occurred', - 'ABORT_ERR (20): the user aborted an operation', - 'URL_MISMATCH_ERR (21): the given URL does not match another URL', - 'QUOTA_EXCEEDED_ERR (22): the quota has been exceeded', - 'TIMEOUT_ERR (23): a timeout occurred', - 'INVALID_NODE_TYPE_ERR (24): the supplied node is invalid or has an invalid ancestor for this operation', - 'DATA_CLONE_ERR (25): the object can not be cloned.' -]; - -// Name to code -var constants = { - INDEX_SIZE_ERR: INDEX_SIZE_ERR, - DOMSTRING_SIZE_ERR: 2, // historical - HIERARCHY_REQUEST_ERR: HIERARCHY_REQUEST_ERR, - WRONG_DOCUMENT_ERR: WRONG_DOCUMENT_ERR, - INVALID_CHARACTER_ERR: INVALID_CHARACTER_ERR, - NO_DATA_ALLOWED_ERR: 6, // historical - NO_MODIFICATION_ALLOWED_ERR: NO_MODIFICATION_ALLOWED_ERR, - NOT_FOUND_ERR: NOT_FOUND_ERR, - NOT_SUPPORTED_ERR: NOT_SUPPORTED_ERR, - INUSE_ATTRIBUTE_ERR: 10, // historical - INVALID_STATE_ERR: INVALID_STATE_ERR, - SYNTAX_ERR: SYNTAX_ERR, - INVALID_MODIFICATION_ERR: INVALID_MODIFICATION_ERR, - NAMESPACE_ERR: NAMESPACE_ERR, - INVALID_ACCESS_ERR: INVALID_ACCESS_ERR, - VALIDATION_ERR: 16, // historical - TYPE_MISMATCH_ERR: TYPE_MISMATCH_ERR, - SECURITY_ERR: SECURITY_ERR, - NETWORK_ERR: NETWORK_ERR, - ABORT_ERR: ABORT_ERR, - URL_MISMATCH_ERR: URL_MISMATCH_ERR, - QUOTA_EXCEEDED_ERR: QUOTA_EXCEEDED_ERR, - TIMEOUT_ERR: TIMEOUT_ERR, - INVALID_NODE_TYPE_ERR: INVALID_NODE_TYPE_ERR, - DATA_CLONE_ERR: DATA_CLONE_ERR -}; - -function DOMException(code) { - Error.call(this); - Error.captureStackTrace(this, this.constructor); - this.code = code; - this.message = messages[code]; - this.name = names[code]; -} -DOMException.prototype.__proto__ = Error.prototype; - -// Initialize the constants on DOMException and DOMException.prototype -for(var c in constants) { - var v = { value: constants[c] }; - Object.defineProperty(DOMException, c, v); - Object.defineProperty(DOMException.prototype, c, v); -} - - -/***/ }), - -/***/ 80931: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = DOMImplementation; - -var Document = __webpack_require__(35452); -var DocumentType = __webpack_require__(73092); -var HTMLParser = __webpack_require__(91895); -var utils = __webpack_require__(89076); -var xml = __webpack_require__(66798); - -// Each document must have its own instance of the domimplementation object -function DOMImplementation(contextObject) { - this.contextObject = contextObject; -} - - -// Feature/version pairs that DOMImplementation.hasFeature() returns -// true for. It returns false for anything else. -var supportedFeatures = { - 'xml': { '': true, '1.0': true, '2.0': true }, // DOM Core - 'core': { '': true, '2.0': true }, // DOM Core - 'html': { '': true, '1.0': true, '2.0': true} , // HTML - 'xhtml': { '': true, '1.0': true, '2.0': true} , // HTML -}; - -DOMImplementation.prototype = { - hasFeature: function hasFeature(feature, version) { - var f = supportedFeatures[(feature || '').toLowerCase()]; - return (f && f[version || '']) || false; - }, - - createDocumentType: function createDocumentType(qualifiedName, publicId, systemId) { - if (!xml.isValidQName(qualifiedName)) utils.InvalidCharacterError(); - - return new DocumentType(this.contextObject, qualifiedName, publicId, systemId); - }, - - createDocument: function createDocument(namespace, qualifiedName, doctype) { - // - // Note that the current DOMCore spec makes it impossible to - // create an HTML document with this function, even if the - // namespace and doctype are propertly set. See this thread: - // http://lists.w3.org/Archives/Public/www-dom/2011AprJun/0132.html - // - var d = new Document(false, null); - var e; - - if (qualifiedName) - e = d.createElementNS(namespace, qualifiedName); - else - e = null; - - if (doctype) { - d.appendChild(doctype); - } - - if (e) d.appendChild(e); - if (namespace === utils.NAMESPACE.HTML) { - d._contentType = 'application/xhtml+xml'; - } else if (namespace === utils.NAMESPACE.SVG) { - d._contentType = 'image/svg+xml'; - } else { - d._contentType = 'application/xml'; - } - - return d; - }, - - createHTMLDocument: function createHTMLDocument(titleText) { - var d = new Document(true, null); - d.appendChild(new DocumentType(d, 'html')); - var html = d.createElement('html'); - d.appendChild(html); - var head = d.createElement('head'); - html.appendChild(head); - if (titleText !== undefined) { - var title = d.createElement('title'); - head.appendChild(title); - title.appendChild(d.createTextNode(titleText)); - } - html.appendChild(d.createElement('body')); - d.modclock = 1; // Start tracking modifications - return d; - }, - - mozSetOutputMutationHandler: function(doc, handler) { - doc.mutationHandler = handler; - }, - - mozGetInputMutationHandler: function(doc) { - utils.nyi(); - }, - - mozHTMLParser: HTMLParser, -}; - - -/***/ }), - -/***/ 82840: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -// DOMTokenList implementation based on https://github.com/Raynos/DOM-shim -var utils = __webpack_require__(89076); - -module.exports = DOMTokenList; - -function DOMTokenList(getter, setter) { - this._getString = getter; - this._setString = setter; - this._length = 0; - this._lastStringValue = ''; - this._update(); -} - -Object.defineProperties(DOMTokenList.prototype, { - length: { get: function() { return this._length; } }, - item: { value: function(index) { - var list = getList(this); - if (index < 0 || index >= list.length) { - return null; - } - return list[index]; - }}, - - contains: { value: function(token) { - token = String(token); // no error checking for contains() - var list = getList(this); - return list.indexOf(token) > -1; - }}, - - add: { value: function() { - var list = getList(this); - for (var i = 0, len = arguments.length; i < len; i++) { - var token = handleErrors(arguments[i]); - if (list.indexOf(token) < 0) { - list.push(token); - } - } - // Note: as per spec, if handleErrors() throws any errors, we never - // make it here and none of the changes take effect. - // Also per spec: we run the "update steps" even if no change was - // made (ie, if the token already existed) - this._update(list); - }}, - - remove: { value: function() { - var list = getList(this); - for (var i = 0, len = arguments.length; i < len; i++) { - var token = handleErrors(arguments[i]); - var index = list.indexOf(token); - if (index > -1) { - list.splice(index, 1); - } - } - // Note: as per spec, if handleErrors() throws any errors, we never - // make it here and none of the changes take effect. - // Also per spec: we run the "update steps" even if no change was - // made (ie, if the token wasn't previously present) - this._update(list); - }}, - - toggle: { value: function toggle(token, force) { - token = handleErrors(token); - if (this.contains(token)) { - if (force === undefined || force === false) { - this.remove(token); - return false; - } - return true; - } else { - if (force === undefined || force === true) { - this.add(token); - return true; - } - return false; - } - }}, - - replace: { value: function replace(token, newToken) { - // weird corner case of spec: if `token` contains whitespace, but - // `newToken` is the empty string, we must throw SyntaxError not - // InvalidCharacterError (sigh) - if (String(newToken)==='') { utils.SyntaxError(); } - token = handleErrors(token); - newToken = handleErrors(newToken); - var list = getList(this); - var idx = list.indexOf(token); - if (idx < 0) { - // Note that, per spec, we do not run the update steps on this path. - return false; - } - var idx2 = list.indexOf(newToken); - if (idx2 < 0) { - list[idx] = newToken; - } else { - // "replace the first instance of either `token` or `newToken` with - // `newToken` and remove all other instances" - if (idx < idx2) { - list[idx] = newToken; - list.splice(idx2, 1); - } else { - // idx2 is already `newToken` - list.splice(idx, 1); - } - } - this._update(list); - return true; - }}, - - toString: { value: function() { - return this._getString(); - }}, - - value: { - get: function() { - return this._getString(); - }, - set: function(v) { - this._setString(v); - this._update(); - } - }, - - // Called when the setter is called from outside this interface. - _update: { value: function(list) { - if (list) { - fixIndex(this, list); - this._setString(list.join(" ").trim()); - } else { - fixIndex(this, getList(this)); - } - this._lastStringValue = this._getString(); - } }, -}); - -function fixIndex(clist, list) { - var oldLength = clist._length; - var i; - clist._length = list.length; - for (i = 0; i < list.length; i++) { - clist[i] = list[i]; - } - // Clear/free old entries. - for (; i < oldLength; i++) { - clist[i] = undefined; - } -} - -function handleErrors(token) { - token = String(token); - if (token === "") { - utils.SyntaxError(); - } - if (/[ \t\r\n\f]/.test(token)) { - utils.InvalidCharacterError(); - } - return token; -} - -function toArray(clist) { - var length = clist._length; - var arr = Array(length); - for (var i = 0; i < length; i++) { - arr[i] = clist[i]; - } - return arr; -} - -function getList(clist) { - var strProp = clist._getString(); - if (strProp === clist._lastStringValue) { - return toArray(clist); - } - var str = strProp.replace(/(^[ \t\r\n\f]+)|([ \t\r\n\f]+$)/g, ''); - if (str === "") { - return []; - } else { - var seen = Object.create(null); - return str.split(/[ \t\r\n\f]+/g).filter(function(n) { - var key = '$' + n; - if (seen[key]) { return false; } - seen[key] = true; - return true; - }); - } -} - - -/***/ }), - -/***/ 35452: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = Document; - -var Node = __webpack_require__(97537); -var NodeList = __webpack_require__(64965); -var ContainerNode = __webpack_require__(38554); -var Element = __webpack_require__(77301); -var Text = __webpack_require__(58210); -var Comment = __webpack_require__(17548); -var Event = __webpack_require__(13441); -var DocumentFragment = __webpack_require__(17948); -var ProcessingInstruction = __webpack_require__(81248); -var DOMImplementation = __webpack_require__(80931); -var TreeWalker = __webpack_require__(44507); -var NodeIterator = __webpack_require__(30419); -var NodeFilter = __webpack_require__(383); -var URL = __webpack_require__(85184); -var select = __webpack_require__(23509); -var events = __webpack_require__(18196); -var xml = __webpack_require__(66798); -var html = __webpack_require__(96324); -var svg = __webpack_require__(967); -var utils = __webpack_require__(89076); -var MUTATE = __webpack_require__(40993); -var NAMESPACE = utils.NAMESPACE; -var isApiWritable = (__webpack_require__(66139)/* .isApiWritable */ .h); - -function Document(isHTML, address) { - ContainerNode.call(this); - this.nodeType = Node.DOCUMENT_NODE; - this.isHTML = isHTML; - this._address = address || 'about:blank'; - this.readyState = 'loading'; - this.implementation = new DOMImplementation(this); - - // DOMCore says that documents are always associated with themselves - this.ownerDocument = null; // ... but W3C tests expect null - this._contentType = isHTML ? 'text/html' : 'application/xml'; - - // These will be initialized by our custom versions of - // appendChild and insertBefore that override the inherited - // Node methods. - // XXX: override those methods! - this.doctype = null; - this.documentElement = null; - - // "Associated inert template document" - this._templateDocCache = null; - // List of active NodeIterators, see NodeIterator#_preremove() - this._nodeIterators = null; - - // Documents are always rooted, by definition - this._nid = 1; - this._nextnid = 2; // For numbering children of the document - this._nodes = [null, this]; // nid to node map - - // This maintains the mapping from element ids to element nodes. - // We may need to update this mapping every time a node is rooted - // or uprooted, and any time an attribute is added, removed or changed - // on a rooted element. - this.byId = Object.create(null); - - // This property holds a monotonically increasing value akin to - // a timestamp used to record the last modification time of nodes - // and their subtrees. See the lastModTime attribute and modify() - // method of the Node class. And see FilteredElementList for an example - // of the use of lastModTime - this.modclock = 0; -} - -// Map from lowercase event category names (used as arguments to -// createEvent()) to the property name in the impl object of the -// event constructor. -var supportedEvents = { - event: 'Event', - customevent: 'CustomEvent', - uievent: 'UIEvent', - mouseevent: 'MouseEvent' -}; - -// Certain arguments to document.createEvent() must be treated specially -var replacementEvent = { - events: 'event', - htmlevents: 'event', - mouseevents: 'mouseevent', - mutationevents: 'mutationevent', - uievents: 'uievent' -}; - -var mirrorAttr = function(f, name, defaultValue) { - return { - get: function() { - var o = f.call(this); - if (o) { return o[name]; } - return defaultValue; - }, - set: function(value) { - var o = f.call(this); - if (o) { o[name] = value; } - }, - }; -}; - -/** @spec https://dom.spec.whatwg.org/#validate-and-extract */ -function validateAndExtract(namespace, qualifiedName) { - var prefix, localName, pos; - if (namespace==='') { namespace = null; } - // See https://github.com/whatwg/dom/issues/671 - // and https://github.com/whatwg/dom/issues/319 - if (!xml.isValidQName(qualifiedName)) { - utils.InvalidCharacterError(); - } - prefix = null; - localName = qualifiedName; - - pos = qualifiedName.indexOf(':'); - if (pos >= 0) { - prefix = qualifiedName.substring(0, pos); - localName = qualifiedName.substring(pos+1); - } - if (prefix !== null && namespace === null) { - utils.NamespaceError(); - } - if (prefix === 'xml' && namespace !== NAMESPACE.XML) { - utils.NamespaceError(); - } - if ((prefix === 'xmlns' || qualifiedName === 'xmlns') && - namespace !== NAMESPACE.XMLNS) { - utils.NamespaceError(); - } - if (namespace === NAMESPACE.XMLNS && !(prefix==='xmlns' || qualifiedName==='xmlns')) { - utils.NamespaceError(); - } - return { namespace: namespace, prefix: prefix, localName: localName }; -} - -Document.prototype = Object.create(ContainerNode.prototype, { - // This method allows dom.js to communicate with a renderer - // that displays the document in some way - // XXX: I should probably move this to the window object - _setMutationHandler: { value: function(handler) { - this.mutationHandler = handler; - }}, - - // This method allows dom.js to receive event notifications - // from the renderer. - // XXX: I should probably move this to the window object - _dispatchRendererEvent: { value: function(targetNid, type, details) { - var target = this._nodes[targetNid]; - if (!target) return; - target._dispatchEvent(new Event(type, details), true); - }}, - - nodeName: { value: '#document'}, - nodeValue: { - get: function() { - return null; - }, - set: function() {} - }, - - // XXX: DOMCore may remove documentURI, so it is NYI for now - documentURI: { get: function() { return this._address; }, set: utils.nyi }, - compatMode: { get: function() { - // The _quirks property is set by the HTML parser - return this._quirks ? 'BackCompat' : 'CSS1Compat'; - }}, - - createTextNode: { value: function(data) { - return new Text(this, String(data)); - }}, - createComment: { value: function(data) { - return new Comment(this, data); - }}, - createDocumentFragment: { value: function() { - return new DocumentFragment(this); - }}, - createProcessingInstruction: { value: function(target, data) { - if (!xml.isValidName(target) || data.indexOf('?>') !== -1) - utils.InvalidCharacterError(); - return new ProcessingInstruction(this, target, data); - }}, - - createAttribute: { value: function(localName) { - localName = String(localName); - if (!xml.isValidName(localName)) utils.InvalidCharacterError(); - if (this.isHTML) { - localName = utils.toASCIILowerCase(localName); - } - return new Element._Attr(null, localName, null, null, ''); - }}, - createAttributeNS: { value: function(namespace, qualifiedName) { - // Convert parameter types according to WebIDL - namespace = - (namespace === null || namespace === undefined || namespace === '') ? null : - String(namespace); - qualifiedName = String(qualifiedName); - var ve = validateAndExtract(namespace, qualifiedName); - return new Element._Attr(null, ve.localName, ve.prefix, ve.namespace, ''); - }}, - - createElement: { value: function(localName) { - localName = String(localName); - if (!xml.isValidName(localName)) utils.InvalidCharacterError(); - // Per spec, namespace should be HTML namespace if "context object is - // an HTML document or context object's content type is - // "application/xhtml+xml", and null otherwise. - if (this.isHTML) { - if (/[A-Z]/.test(localName)) - localName = utils.toASCIILowerCase(localName); - return html.createElement(this, localName, null); - } else if (this.contentType === 'application/xhtml+xml') { - return html.createElement(this, localName, null); - } else { - return new Element(this, localName, null, null); - } - }, writable: isApiWritable }, - - createElementNS: { value: function(namespace, qualifiedName) { - // Convert parameter types according to WebIDL - namespace = - (namespace === null || namespace === undefined || namespace === '') ? null : - String(namespace); - qualifiedName = String(qualifiedName); - var ve = validateAndExtract(namespace, qualifiedName); - return this._createElementNS(ve.localName, ve.namespace, ve.prefix); - }, writable: isApiWritable }, - - // This is used directly by HTML parser, which allows it to create - // elements with localNames containing ':' and non-default namespaces - _createElementNS: { value: function(localName, namespace, prefix) { - if (namespace === NAMESPACE.HTML) { - return html.createElement(this, localName, prefix); - } - else if (namespace === NAMESPACE.SVG) { - return svg.createElement(this, localName, prefix); - } - - return new Element(this, localName, namespace, prefix); - }}, - - createEvent: { value: function createEvent(interfaceName) { - interfaceName = interfaceName.toLowerCase(); - var name = replacementEvent[interfaceName] || interfaceName; - var constructor = events[supportedEvents[name]]; - - if (constructor) { - var e = new constructor(); - e._initialized = false; - return e; - } - else { - utils.NotSupportedError(); - } - }}, - - // See: http://www.w3.org/TR/dom/#dom-document-createtreewalker - createTreeWalker: {value: function (root, whatToShow, filter) { - if (!root) { throw new TypeError("root argument is required"); } - if (!(root instanceof Node)) { throw new TypeError("root not a node"); } - whatToShow = whatToShow === undefined ? NodeFilter.SHOW_ALL : (+whatToShow); - filter = filter === undefined ? null : filter; - - return new TreeWalker(root, whatToShow, filter); - }}, - - // See: http://www.w3.org/TR/dom/#dom-document-createnodeiterator - createNodeIterator: {value: function (root, whatToShow, filter) { - if (!root) { throw new TypeError("root argument is required"); } - if (!(root instanceof Node)) { throw new TypeError("root not a node"); } - whatToShow = whatToShow === undefined ? NodeFilter.SHOW_ALL : (+whatToShow); - filter = filter === undefined ? null : filter; - - return new NodeIterator(root, whatToShow, filter); - }}, - - _attachNodeIterator: { value: function(ni) { - // XXX ideally this should be a weak reference from Document to NodeIterator - if (!this._nodeIterators) { this._nodeIterators = []; } - this._nodeIterators.push(ni); - }}, - - _detachNodeIterator: { value: function(ni) { - // ni should always be in list of node iterators - var idx = this._nodeIterators.indexOf(ni); - this._nodeIterators.splice(idx, 1); - }}, - - _preremoveNodeIterators: { value: function(toBeRemoved) { - if (this._nodeIterators) { - this._nodeIterators.forEach(function(ni) { ni._preremove(toBeRemoved); }); - } - }}, - - // Maintain the documentElement and - // doctype properties of the document. Each of the following - // methods chains to the Node implementation of the method - // to do the actual inserting, removal or replacement. - - _updateDocTypeElement: { value: function _updateDocTypeElement() { - this.doctype = this.documentElement = null; - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === Node.DOCUMENT_TYPE_NODE) - this.doctype = kid; - else if (kid.nodeType === Node.ELEMENT_NODE) - this.documentElement = kid; - } - }}, - - insertBefore: { value: function insertBefore(child, refChild) { - Node.prototype.insertBefore.call(this, child, refChild); - this._updateDocTypeElement(); - return child; - }}, - - replaceChild: { value: function replaceChild(node, child) { - Node.prototype.replaceChild.call(this, node, child); - this._updateDocTypeElement(); - return child; - }}, - - removeChild: { value: function removeChild(child) { - Node.prototype.removeChild.call(this, child); - this._updateDocTypeElement(); - return child; - }}, - - getElementById: { value: function(id) { - var n = this.byId[id]; - if (!n) return null; - if (n instanceof MultiId) { // there was more than one element with this id - return n.getFirst(); - } - return n; - }}, - - _hasMultipleElementsWithId: { value: function(id) { - // Used internally by querySelectorAll optimization - return (this.byId[id] instanceof MultiId); - }}, - - // Just copy this method from the Element prototype - getElementsByName: { value: Element.prototype.getElementsByName }, - getElementsByTagName: { value: Element.prototype.getElementsByTagName }, - getElementsByTagNameNS: { value: Element.prototype.getElementsByTagNameNS }, - getElementsByClassName: { value: Element.prototype.getElementsByClassName }, - - adoptNode: { value: function adoptNode(node) { - if (node.nodeType === Node.DOCUMENT_NODE) utils.NotSupportedError(); - if (node.nodeType === Node.ATTRIBUTE_NODE) { return node; } - - if (node.parentNode) node.parentNode.removeChild(node); - - if (node.ownerDocument !== this) - recursivelySetOwner(node, this); - - return node; - }}, - - importNode: { value: function importNode(node, deep) { - return this.adoptNode(node.cloneNode(deep)); - }, writable: isApiWritable }, - - // The following attributes and methods are from the HTML spec - origin: { get: function origin() { return null; } }, - characterSet: { get: function characterSet() { return "UTF-8"; } }, - contentType: { get: function contentType() { return this._contentType; } }, - URL: { get: function URL() { return this._address; } }, - domain: { get: utils.nyi, set: utils.nyi }, - referrer: { get: utils.nyi }, - cookie: { get: utils.nyi, set: utils.nyi }, - lastModified: { get: utils.nyi }, - location: { - get: function() { - return this.defaultView ? this.defaultView.location : null; // gh #75 - }, - set: utils.nyi - }, - _titleElement: { - get: function() { - // The title element of a document is the first title element in the - // document in tree order, if there is one, or null otherwise. - return this.getElementsByTagName('title').item(0) || null; - } - }, - title: { - get: function() { - var elt = this._titleElement; - // The child text content of the title element, or '' if null. - var value = elt ? elt.textContent : ''; - // Strip and collapse whitespace in value - return value.replace(/[ \t\n\r\f]+/g, ' ').replace(/(^ )|( $)/g, ''); - }, - set: function(value) { - var elt = this._titleElement; - var head = this.head; - if (!elt && !head) { return; /* according to spec */ } - if (!elt) { - elt = this.createElement('title'); - head.appendChild(elt); - } - elt.textContent = value; - } - }, - dir: mirrorAttr(function() { - var htmlElement = this.documentElement; - if (htmlElement && htmlElement.tagName === 'HTML') { return htmlElement; } - }, 'dir', ''), - fgColor: mirrorAttr(function() { return this.body; }, 'text', ''), - linkColor: mirrorAttr(function() { return this.body; }, 'link', ''), - vlinkColor: mirrorAttr(function() { return this.body; }, 'vLink', ''), - alinkColor: mirrorAttr(function() { return this.body; }, 'aLink', ''), - bgColor: mirrorAttr(function() { return this.body; }, 'bgColor', ''), - - // Historical aliases of Document#characterSet - charset: { get: function() { return this.characterSet; } }, - inputEncoding: { get: function() { return this.characterSet; } }, - - scrollingElement: { - get: function() { - return this._quirks ? this.body : this.documentElement; - } - }, - - // Return the first child of the document element. - // XXX For now, setting this attribute is not implemented. - body: { - get: function() { - return namedHTMLChild(this.documentElement, 'body'); - }, - set: utils.nyi - }, - // Return the first child of the document element. - head: { get: function() { - return namedHTMLChild(this.documentElement, 'head'); - }}, - images: { get: utils.nyi }, - embeds: { get: utils.nyi }, - plugins: { get: utils.nyi }, - links: { get: utils.nyi }, - forms: { get: utils.nyi }, - scripts: { get: utils.nyi }, - applets: { get: function() { return []; } }, - activeElement: { get: function() { return null; } }, - innerHTML: { - get: function() { return this.serialize(); }, - set: utils.nyi - }, - outerHTML: { - get: function() { return this.serialize(); }, - set: utils.nyi - }, - - write: { value: function(args) { - if (!this.isHTML) utils.InvalidStateError(); - - // XXX: still have to implement the ignore part - if (!this._parser /* && this._ignore_destructive_writes > 0 */ ) - return; - - if (!this._parser) { - // XXX call document.open, etc. - } - - var s = arguments.join(''); - - // If the Document object's reload override flag is set, then - // append the string consisting of the concatenation of all the - // arguments to the method to the Document's reload override - // buffer. - // XXX: don't know what this is about. Still have to do it - - // If there is no pending parsing-blocking script, have the - // tokenizer process the characters that were inserted, one at a - // time, processing resulting tokens as they are emitted, and - // stopping when the tokenizer reaches the insertion point or when - // the processing of the tokenizer is aborted by the tree - // construction stage (this can happen if a script end tag token is - // emitted by the tokenizer). - - // XXX: still have to do the above. Sounds as if we don't - // always call parse() here. If we're blocked, then we just - // insert the text into the stream but don't parse it reentrantly... - - // Invoke the parser reentrantly - this._parser.parse(s); - }}, - - writeln: { value: function writeln(args) { - this.write(Array.prototype.join.call(arguments, '') + '\n'); - }}, - - open: { value: function() { - this.documentElement = null; - }}, - - close: { value: function() { - this.readyState = 'interactive'; - this._dispatchEvent(new Event('readystatechange'), true); - this._dispatchEvent(new Event('DOMContentLoaded'), true); - this.readyState = 'complete'; - this._dispatchEvent(new Event('readystatechange'), true); - if (this.defaultView) { - this.defaultView._dispatchEvent(new Event('load'), true); - } - }}, - - // Utility methods - clone: { value: function clone() { - var d = new Document(this.isHTML, this._address); - d._quirks = this._quirks; - d._contentType = this._contentType; - return d; - }}, - - // We need to adopt the nodes if we do a deep clone - cloneNode: { value: function cloneNode(deep) { - var clone = Node.prototype.cloneNode.call(this, false); - if (deep) { - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - clone._appendChild(clone.importNode(kid, true)); - } - } - clone._updateDocTypeElement(); - return clone; - }}, - - isEqual: { value: function isEqual(n) { - // Any two documents are shallowly equal. - // Node.isEqualNode will also test the children - return true; - }}, - - // Implementation-specific function. Called when a text, comment, - // or pi value changes. - mutateValue: { value: function(node) { - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.VALUE, - target: node, - data: node.data - }); - } - }}, - - // Invoked when an attribute's value changes. Attr holds the new - // value. oldval is the old value. Attribute mutations can also - // involve changes to the prefix (and therefore the qualified name) - mutateAttr: { value: function(attr, oldval) { - // Manage id->element mapping for getElementsById() - // XXX: this special case id handling should not go here, - // but in the attribute declaration for the id attribute - /* - if (attr.localName === 'id' && attr.namespaceURI === null) { - if (oldval) delId(oldval, attr.ownerElement); - addId(attr.value, attr.ownerElement); - } - */ - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.ATTR, - target: attr.ownerElement, - attr: attr - }); - } - }}, - - // Used by removeAttribute and removeAttributeNS for attributes. - mutateRemoveAttr: { value: function(attr) { -/* -* This is now handled in Attributes.js - // Manage id to element mapping - if (attr.localName === 'id' && attr.namespaceURI === null) { - this.delId(attr.value, attr.ownerElement); - } -*/ - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.REMOVE_ATTR, - target: attr.ownerElement, - attr: attr - }); - } - }}, - - // Called by Node.removeChild, etc. to remove a rooted element from - // the tree. Only needs to generate a single mutation event when a - // node is removed, but must recursively mark all descendants as not - // rooted. - mutateRemove: { value: function(node) { - // Send a single mutation event - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.REMOVE, - target: node.parentNode, - node: node - }); - } - - // Mark this and all descendants as not rooted - recursivelyUproot(node); - }}, - - // Called when a new element becomes rooted. It must recursively - // generate mutation events for each of the children, and mark them all - // as rooted. - mutateInsert: { value: function(node) { - // Mark node and its descendants as rooted - recursivelyRoot(node); - - // Send a single mutation event - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.INSERT, - target: node.parentNode, - node: node - }); - } - }}, - - // Called when a rooted element is moved within the document - mutateMove: { value: function(node) { - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.MOVE, - target: node - }); - } - }}, - - - // Add a mapping from id to n for n.ownerDocument - addId: { value: function addId(id, n) { - var val = this.byId[id]; - if (!val) { - this.byId[id] = n; - } - else { - // TODO: Add a way to opt-out console warnings - //console.warn('Duplicate element id ' + id); - if (!(val instanceof MultiId)) { - val = new MultiId(val); - this.byId[id] = val; - } - val.add(n); - } - }}, - - // Delete the mapping from id to n for n.ownerDocument - delId: { value: function delId(id, n) { - var val = this.byId[id]; - utils.assert(val); - - if (val instanceof MultiId) { - val.del(n); - if (val.length === 1) { // convert back to a single node - this.byId[id] = val.downgrade(); - } - } - else { - this.byId[id] = undefined; - } - }}, - - _resolve: { value: function(href) { - //XXX: Cache the URL - return new URL(this._documentBaseURL).resolve(href); - }}, - - _documentBaseURL: { get: function() { - // XXX: This is not implemented correctly yet - var url = this._address; - if (url === 'about:blank') url = '/'; - - var base = this.querySelector('base[href]'); - if (base) { - return new URL(url).resolve(base.getAttribute('href')); - } - return url; - - // The document base URL of a Document object is the - // absolute URL obtained by running these substeps: - - // Let fallback base url be the document's address. - - // If fallback base url is about:blank, and the - // Document's browsing context has a creator browsing - // context, then let fallback base url be the document - // base URL of the creator Document instead. - - // If the Document is an iframe srcdoc document, then - // let fallback base url be the document base URL of - // the Document's browsing context's browsing context - // container's Document instead. - - // If there is no base element that has an href - // attribute, then the document base URL is fallback - // base url; abort these steps. Otherwise, let url be - // the value of the href attribute of the first such - // element. - - // Resolve url relative to fallback base url (thus, - // the base href attribute isn't affected by xml:base - // attributes). - - // The document base URL is the result of the previous - // step if it was successful; otherwise it is fallback - // base url. - }}, - - _templateDoc: { get: function() { - if (!this._templateDocCache) { - // "associated inert template document" - var newDoc = new Document(this.isHTML, this._address); - this._templateDocCache = newDoc._templateDocCache = newDoc; - } - return this._templateDocCache; - }}, - - querySelector: { value: function(selector) { - return select(selector, this)[0]; - }}, - - querySelectorAll: { value: function(selector) { - var nodes = select(selector, this); - return nodes.item ? nodes : new NodeList(nodes); - }} - -}); - - -var eventHandlerTypes = [ - 'abort', 'canplay', 'canplaythrough', 'change', 'click', 'contextmenu', - 'cuechange', 'dblclick', 'drag', 'dragend', 'dragenter', 'dragleave', - 'dragover', 'dragstart', 'drop', 'durationchange', 'emptied', 'ended', - 'input', 'invalid', 'keydown', 'keypress', 'keyup', 'loadeddata', - 'loadedmetadata', 'loadstart', 'mousedown', 'mousemove', 'mouseout', - 'mouseover', 'mouseup', 'mousewheel', 'pause', 'play', 'playing', - 'progress', 'ratechange', 'readystatechange', 'reset', 'seeked', - 'seeking', 'select', 'show', 'stalled', 'submit', 'suspend', - 'timeupdate', 'volumechange', 'waiting', - - 'blur', 'error', 'focus', 'load', 'scroll' -]; - -// Add event handler idl attribute getters and setters to Document -eventHandlerTypes.forEach(function(type) { - // Define the event handler registration IDL attribute for this type - Object.defineProperty(Document.prototype, 'on' + type, { - get: function() { - return this._getEventHandler(type); - }, - set: function(v) { - this._setEventHandler(type, v); - } - }); -}); - -function namedHTMLChild(parent, name) { - if (parent && parent.isHTML) { - for (var kid = parent.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === Node.ELEMENT_NODE && - kid.localName === name && - kid.namespaceURI === NAMESPACE.HTML) { - return kid; - } - } - } - return null; -} - -function root(n) { - n._nid = n.ownerDocument._nextnid++; - n.ownerDocument._nodes[n._nid] = n; - // Manage id to element mapping - if (n.nodeType === Node.ELEMENT_NODE) { - var id = n.getAttribute('id'); - if (id) n.ownerDocument.addId(id, n); - - // Script elements need to know when they're inserted - // into the document - if (n._roothook) n._roothook(); - } -} - -function uproot(n) { - // Manage id to element mapping - if (n.nodeType === Node.ELEMENT_NODE) { - var id = n.getAttribute('id'); - if (id) n.ownerDocument.delId(id, n); - } - n.ownerDocument._nodes[n._nid] = undefined; - n._nid = undefined; -} - -function recursivelyRoot(node) { - root(node); - // XXX: - // accessing childNodes on a leaf node creates a new array the - // first time, so be careful to write this loop so that it - // doesn't do that. node is polymorphic, so maybe this is hard to - // optimize? Try switching on nodeType? -/* - if (node.hasChildNodes()) { - var kids = node.childNodes; - for(var i = 0, n = kids.length; i < n; i++) - recursivelyRoot(kids[i]); - } -*/ - if (node.nodeType === Node.ELEMENT_NODE) { - for (var kid = node.firstChild; kid !== null; kid = kid.nextSibling) - recursivelyRoot(kid); - } -} - -function recursivelyUproot(node) { - uproot(node); - for (var kid = node.firstChild; kid !== null; kid = kid.nextSibling) - recursivelyUproot(kid); -} - -function recursivelySetOwner(node, owner) { - node.ownerDocument = owner; - node._lastModTime = undefined; // mod times are document-based - if (Object.prototype.hasOwnProperty.call(node, '_tagName')) { - node._tagName = undefined; // Element subclasses might need to change case - } - for (var kid = node.firstChild; kid !== null; kid = kid.nextSibling) - recursivelySetOwner(kid, owner); -} - -// A class for storing multiple nodes with the same ID -function MultiId(node) { - this.nodes = Object.create(null); - this.nodes[node._nid] = node; - this.length = 1; - this.firstNode = undefined; -} - -// Add a node to the list, with O(1) time -MultiId.prototype.add = function(node) { - if (!this.nodes[node._nid]) { - this.nodes[node._nid] = node; - this.length++; - this.firstNode = undefined; - } -}; - -// Remove a node from the list, with O(1) time -MultiId.prototype.del = function(node) { - if (this.nodes[node._nid]) { - delete this.nodes[node._nid]; - this.length--; - this.firstNode = undefined; - } -}; - -// Get the first node from the list, in the document order -// Takes O(N) time in the size of the list, with a cache that is invalidated -// when the list is modified. -MultiId.prototype.getFirst = function() { - /* jshint bitwise: false */ - if (!this.firstNode) { - var nid; - for (nid in this.nodes) { - if (this.firstNode === undefined || - this.firstNode.compareDocumentPosition(this.nodes[nid]) & Node.DOCUMENT_POSITION_PRECEDING) { - this.firstNode = this.nodes[nid]; - } - } - } - return this.firstNode; -}; - -// If there is only one node left, return it. Otherwise return "this". -MultiId.prototype.downgrade = function() { - if (this.length === 1) { - var nid; - for (nid in this.nodes) { - return this.nodes[nid]; - } - } - return this; -}; - - -/***/ }), - -/***/ 17948: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = DocumentFragment; - -var Node = __webpack_require__(97537); -var NodeList = __webpack_require__(64965); -var ContainerNode = __webpack_require__(38554); -var Element = __webpack_require__(77301); -var select = __webpack_require__(23509); -var utils = __webpack_require__(89076); - -function DocumentFragment(doc) { - ContainerNode.call(this); - this.nodeType = Node.DOCUMENT_FRAGMENT_NODE; - this.ownerDocument = doc; -} - -DocumentFragment.prototype = Object.create(ContainerNode.prototype, { - nodeName: { value: '#document-fragment' }, - nodeValue: { - get: function() { - return null; - }, - set: function() {} - }, - // Copy the text content getter/setter from Element - textContent: Object.getOwnPropertyDescriptor(Element.prototype, 'textContent'), - - // Copy the text content getter/setter from Element - innerText: Object.getOwnPropertyDescriptor(Element.prototype, 'innerText'), - - querySelector: { value: function(selector) { - // implement in terms of querySelectorAll - var nodes = this.querySelectorAll(selector); - return nodes.length ? nodes[0] : null; - }}, - querySelectorAll: { value: function(selector) { - // create a context - var context = Object.create(this); - // add some methods to the context for zest implementation, without - // adding them to the public DocumentFragment API - context.isHTML = true; // in HTML namespace (case-insensitive match) - context.getElementsByTagName = Element.prototype.getElementsByTagName; - context.nextElement = - Object.getOwnPropertyDescriptor(Element.prototype, 'firstElementChild'). - get; - // invoke zest - var nodes = select(selector, context); - return nodes.item ? nodes : new NodeList(nodes); - }}, - - // Utility methods - clone: { value: function clone() { - return new DocumentFragment(this.ownerDocument); - }}, - isEqual: { value: function isEqual(n) { - // Any two document fragments are shallowly equal. - // Node.isEqualNode() will test their children for equality - return true; - }}, - - // Non-standard, but useful (github issue #73) - innerHTML: { - get: function() { return this.serialize(); }, - set: utils.nyi - }, - outerHTML: { - get: function() { return this.serialize(); }, - set: utils.nyi - }, - -}); - - -/***/ }), - -/***/ 73092: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = DocumentType; - -var Node = __webpack_require__(97537); -var Leaf = __webpack_require__(8161); -var ChildNode = __webpack_require__(52091); - -function DocumentType(ownerDocument, name, publicId, systemId) { - Leaf.call(this); - this.nodeType = Node.DOCUMENT_TYPE_NODE; - this.ownerDocument = ownerDocument || null; - this.name = name; - this.publicId = publicId || ""; - this.systemId = systemId || ""; -} - -DocumentType.prototype = Object.create(Leaf.prototype, { - nodeName: { get: function() { return this.name; }}, - nodeValue: { - get: function() { return null; }, - set: function() {} - }, - - // Utility methods - clone: { value: function clone() { - return new DocumentType(this.ownerDocument, this.name, this.publicId, this.systemId); - }}, - - isEqual: { value: function isEqual(n) { - return this.name === n.name && - this.publicId === n.publicId && - this.systemId === n.systemId; - }} -}); - -Object.defineProperties(DocumentType.prototype, ChildNode); - - -/***/ }), - -/***/ 77301: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = Element; - -var xml = __webpack_require__(66798); -var utils = __webpack_require__(89076); -var NAMESPACE = utils.NAMESPACE; -var attributes = __webpack_require__(6548); -var Node = __webpack_require__(97537); -var NodeList = __webpack_require__(64965); -var NodeUtils = __webpack_require__(41608); -var FilteredElementList = __webpack_require__(61676); -var DOMException = __webpack_require__(46364); -var DOMTokenList = __webpack_require__(82840); -var select = __webpack_require__(23509); -var ContainerNode = __webpack_require__(38554); -var ChildNode = __webpack_require__(52091); -var NonDocumentTypeChildNode = __webpack_require__(32001); -var NamedNodeMap = __webpack_require__(49492); - -var uppercaseCache = Object.create(null); - -function Element(doc, localName, namespaceURI, prefix) { - ContainerNode.call(this); - this.nodeType = Node.ELEMENT_NODE; - this.ownerDocument = doc; - this.localName = localName; - this.namespaceURI = namespaceURI; - this.prefix = prefix; - this._tagName = undefined; - - // These properties maintain the set of attributes - this._attrsByQName = Object.create(null); // The qname->Attr map - this._attrsByLName = Object.create(null); // The ns|lname->Attr map - this._attrKeys = []; // attr index -> ns|lname -} - -function recursiveGetText(node, a) { - if (node.nodeType === Node.TEXT_NODE) { - a.push(node._data); - } - else { - for(var i = 0, n = node.childNodes.length; i < n; i++) - recursiveGetText(node.childNodes[i], a); - } -} - -Element.prototype = Object.create(ContainerNode.prototype, { - isHTML: { get: function isHTML() { - return this.namespaceURI === NAMESPACE.HTML && this.ownerDocument.isHTML; - }}, - tagName: { get: function tagName() { - if (this._tagName === undefined) { - var tn; - if (this.prefix === null) { - tn = this.localName; - } else { - tn = this.prefix + ':' + this.localName; - } - if (this.isHTML) { - var up = uppercaseCache[tn]; - if (!up) { - // Converting to uppercase can be slow, so cache the conversion. - uppercaseCache[tn] = up = utils.toASCIIUpperCase(tn); - } - tn = up; - } - this._tagName = tn; - } - return this._tagName; - }}, - nodeName: { get: function() { return this.tagName; }}, - nodeValue: { - get: function() { - return null; - }, - set: function() {} - }, - textContent: { - get: function() { - var strings = []; - recursiveGetText(this, strings); - return strings.join(''); - }, - set: function(newtext) { - this.removeChildren(); - if (newtext !== null && newtext !== undefined && newtext !== '') { - this._appendChild(this.ownerDocument.createTextNode(newtext)); - } - } - }, - innerText: { - get: function() { - var strings = []; - recursiveGetText(this, strings); - // Strip and collapse whitespace - // This doesn't 100% match the browser behavior, - // but should cover most of the cases. This is also similar to - // how Angular's renderer used to work: the `textContent` and `innerText` - // were almost equivalent from the renderer perspective. - // See: https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent#differences_from_innertext - return strings.join('').replace(/[ \t\n\f\r]+/g, ' ').trim(); - }, - set: function(newtext) { - this.removeChildren(); - if (newtext !== null && newtext !== undefined && newtext !== '') { - this._appendChild(this.ownerDocument.createTextNode(newtext)); - } - } - }, - innerHTML: { - get: function() { - return this.serialize(); - }, - set: utils.nyi - }, - outerHTML: { - get: function() { - // "the attribute must return the result of running the HTML fragment - // serialization algorithm on a fictional node whose only child is - // the context object" - // - // The serialization logic is intentionally implemented in a separate - // `NodeUtils` helper instead of the more obvious choice of a private - // `_serializeOne()` method on the `Node.prototype` in order to avoid - // the megamorphic `this._serializeOne` property access, which reduces - // performance unnecessarily. If you need specialized behavior for a - // certain subclass, you'll need to implement that in `NodeUtils`. - // See https://github.com/fgnass/domino/pull/142 for more information. - return NodeUtils.serializeOne(this, { nodeType: 0 }); - }, - set: function(v) { - var document = this.ownerDocument; - var parent = this.parentNode; - if (parent === null) { return; } - if (parent.nodeType === Node.DOCUMENT_NODE) { - utils.NoModificationAllowedError(); - } - if (parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { - parent = parent.ownerDocument.createElement("body"); - } - var parser = document.implementation.mozHTMLParser( - document._address, - parent - ); - parser.parse(v===null?'':String(v), true); - this.replaceWith(parser._asDocumentFragment()); - }, - }, - - _insertAdjacent: { value: function _insertAdjacent(position, node) { - var first = false; - switch(position) { - case 'beforebegin': - first = true; - /* falls through */ - case 'afterend': - var parent = this.parentNode; - if (parent === null) { return null; } - return parent.insertBefore(node, first ? this : this.nextSibling); - case 'afterbegin': - first = true; - /* falls through */ - case 'beforeend': - return this.insertBefore(node, first ? this.firstChild : null); - default: - return utils.SyntaxError(); - } - }}, - - insertAdjacentElement: { value: function insertAdjacentElement(position, element) { - if (element.nodeType !== Node.ELEMENT_NODE) { - throw new TypeError('not an element'); - } - position = utils.toASCIILowerCase(String(position)); - return this._insertAdjacent(position, element); - }}, - - insertAdjacentText: { value: function insertAdjacentText(position, data) { - var textNode = this.ownerDocument.createTextNode(data); - position = utils.toASCIILowerCase(String(position)); - this._insertAdjacent(position, textNode); - // "This method returns nothing because it existed before we had a chance - // to design it." - }}, - - insertAdjacentHTML: { value: function insertAdjacentHTML(position, text) { - position = utils.toASCIILowerCase(String(position)); - text = String(text); - var context; - switch(position) { - case 'beforebegin': - case 'afterend': - context = this.parentNode; - if (context === null || context.nodeType === Node.DOCUMENT_NODE) { - utils.NoModificationAllowedError(); - } - break; - case 'afterbegin': - case 'beforeend': - context = this; - break; - default: - utils.SyntaxError(); - } - if ( (!(context instanceof Element)) || ( - context.ownerDocument.isHTML && - context.localName === 'html' && - context.namespaceURI === NAMESPACE.HTML - ) ) { - context = context.ownerDocument.createElementNS(NAMESPACE.HTML, 'body'); - } - var parser = this.ownerDocument.implementation.mozHTMLParser( - this.ownerDocument._address, context - ); - parser.parse(text, true); - this._insertAdjacent(position, parser._asDocumentFragment()); - }}, - - children: { get: function() { - if (!this._children) { - this._children = new ChildrenCollection(this); - } - return this._children; - }}, - - attributes: { get: function() { - if (!this._attributes) { - this._attributes = new AttributesArray(this); - } - return this._attributes; - }}, - - - firstElementChild: { get: function() { - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === Node.ELEMENT_NODE) return kid; - } - return null; - }}, - - lastElementChild: { get: function() { - for (var kid = this.lastChild; kid !== null; kid = kid.previousSibling) { - if (kid.nodeType === Node.ELEMENT_NODE) return kid; - } - return null; - }}, - - childElementCount: { get: function() { - return this.children.length; - }}, - - - // Return the next element, in source order, after this one or - // null if there are no more. If root element is specified, - // then don't traverse beyond its subtree. - // - // This is not a DOM method, but is convenient for - // lazy traversals of the tree. - nextElement: { value: function(root) { - if (!root) root = this.ownerDocument.documentElement; - var next = this.firstElementChild; - if (!next) { - // don't use sibling if we're at root - if (this===root) return null; - next = this.nextElementSibling; - } - if (next) return next; - - // If we can't go down or across, then we have to go up - // and across to the parent sibling or another ancestor's - // sibling. Be careful, though: if we reach the root - // element, or if we reach the documentElement, then - // the traversal ends. - for(var parent = this.parentElement; - parent && parent !== root; - parent = parent.parentElement) { - - next = parent.nextElementSibling; - if (next) return next; - } - - return null; - }}, - - // XXX: - // Tests are currently failing for this function. - // Awaiting resolution of: - // http://lists.w3.org/Archives/Public/www-dom/2011JulSep/0016.html - getElementsByTagName: { value: function getElementsByTagName(lname) { - var filter; - if (!lname) return new NodeList(); - if (lname === '*') - filter = function() { return true; }; - else if (this.isHTML) - filter = htmlLocalNameElementFilter(lname); - else - filter = localNameElementFilter(lname); - - return new FilteredElementList(this, filter); - }}, - - getElementsByTagNameNS: { value: function getElementsByTagNameNS(ns, lname){ - var filter; - if (ns === '*' && lname === '*') - filter = function() { return true; }; - else if (ns === '*') - filter = localNameElementFilter(lname); - else if (lname === '*') - filter = namespaceElementFilter(ns); - else - filter = namespaceLocalNameElementFilter(ns, lname); - - return new FilteredElementList(this, filter); - }}, - - getElementsByClassName: { value: function getElementsByClassName(names){ - names = String(names).trim(); - if (names === '') { - var result = new NodeList(); // Empty node list - return result; - } - names = names.split(/[ \t\r\n\f]+/); // Split on ASCII whitespace - return new FilteredElementList(this, classNamesElementFilter(names)); - }}, - - getElementsByName: { value: function getElementsByName(name) { - return new FilteredElementList(this, elementNameFilter(String(name))); - }}, - - // Utility methods used by the public API methods above - clone: { value: function clone() { - var e; - - // XXX: - // Modify this to use the constructor directly or - // avoid error checking in some other way. In case we try - // to clone an invalid node that the parser inserted. - // - if (this.namespaceURI !== NAMESPACE.HTML || this.prefix || !this.ownerDocument.isHTML) { - e = this.ownerDocument.createElementNS( - this.namespaceURI, (this.prefix !== null) ? - (this.prefix + ':' + this.localName) : this.localName - ); - } else { - e = this.ownerDocument.createElement(this.localName); - } - - for(var i = 0, n = this._attrKeys.length; i < n; i++) { - var lname = this._attrKeys[i]; - var a = this._attrsByLName[lname]; - var b = a.cloneNode(); - b._setOwnerElement(e); - e._attrsByLName[lname] = b; - e._addQName(b); - } - e._attrKeys = this._attrKeys.concat(); - - return e; - }}, - - isEqual: { value: function isEqual(that) { - if (this.localName !== that.localName || - this.namespaceURI !== that.namespaceURI || - this.prefix !== that.prefix || - this._numattrs !== that._numattrs) - return false; - - // Compare the sets of attributes, ignoring order - // and ignoring attribute prefixes. - for(var i = 0, n = this._numattrs; i < n; i++) { - var a = this._attr(i); - if (!that.hasAttributeNS(a.namespaceURI, a.localName)) - return false; - if (that.getAttributeNS(a.namespaceURI,a.localName) !== a.value) - return false; - } - - return true; - }}, - - // This is the 'locate a namespace prefix' algorithm from the - // DOM specification. It is used by Node.lookupPrefix() - // (Be sure to compare DOM3 and DOM4 versions of spec.) - _lookupNamespacePrefix: { value: function _lookupNamespacePrefix(ns, originalElement) { - if ( - this.namespaceURI && - this.namespaceURI === ns && - this.prefix !== null && - originalElement.lookupNamespaceURI(this.prefix) === ns - ) { - return this.prefix; - } - - for(var i = 0, n = this._numattrs; i < n; i++) { - var a = this._attr(i); - if ( - a.prefix === 'xmlns' && - a.value === ns && - originalElement.lookupNamespaceURI(a.localName) === ns - ) { - return a.localName; - } - } - - var parent = this.parentElement; - return parent ? parent._lookupNamespacePrefix(ns, originalElement) : null; - }}, - - // This is the 'locate a namespace' algorithm for Element nodes - // from the DOM Core spec. It is used by Node#lookupNamespaceURI() - lookupNamespaceURI: { value: function lookupNamespaceURI(prefix) { - if (prefix === '' || prefix === undefined) { prefix = null; } - if (this.namespaceURI !== null && this.prefix === prefix) - return this.namespaceURI; - - for(var i = 0, n = this._numattrs; i < n; i++) { - var a = this._attr(i); - if (a.namespaceURI === NAMESPACE.XMLNS) { - if ( - (a.prefix === 'xmlns' && a.localName === prefix) || - (prefix === null && a.prefix === null && a.localName === 'xmlns') - ) { - return a.value || null; - } - } - } - - var parent = this.parentElement; - return parent ? parent.lookupNamespaceURI(prefix) : null; - }}, - - // - // Attribute handling methods and utilities - // - - /* - * Attributes in the DOM are tricky: - * - * - there are the 8 basic get/set/has/removeAttribute{NS} methods - * - * - but many HTML attributes are also 'reflected' through IDL - * attributes which means that they can be queried and set through - * regular properties of the element. There is just one attribute - * value, but two ways to get and set it. - * - * - Different HTML element types have different sets of reflected - attributes. - * - * - attributes can also be queried and set through the .attributes - * property of an element. This property behaves like an array of - * Attr objects. The value property of each Attr is writeable, so - * this is a third way to read and write attributes. - * - * - for efficiency, we really want to store attributes in some kind - * of name->attr map. But the attributes[] array is an array, not a - * map, which is kind of unnatural. - * - * - When using namespaces and prefixes, and mixing the NS methods - * with the non-NS methods, it is apparently actually possible for - * an attributes[] array to have more than one attribute with the - * same qualified name. And certain methods must operate on only - * the first attribute with such a name. So for these methods, an - * inefficient array-like data structure would be easier to - * implement. - * - * - The attributes[] array is live, not a snapshot, so changes to the - * attributes must be immediately visible through existing arrays. - * - * - When attributes are queried and set through IDL properties - * (instead of the get/setAttributes() method or the attributes[] - * array) they may be subject to type conversions, URL - * normalization, etc., so some extra processing is required in that - * case. - * - * - But access through IDL properties is probably the most common - * case, so we'd like that to be as fast as possible. - * - * - We can't just store attribute values in their parsed idl form, - * because setAttribute() has to return whatever string is passed to - * getAttribute even if it is not a legal, parseable value. So - * attribute values must be stored in unparsed string form. - * - * - We need to be able to send change notifications or mutation - * events of some sort to the renderer whenever an attribute value - * changes, regardless of the way in which it changes. - * - * - Some attributes, such as id and class affect other parts of the - * DOM API, like getElementById and getElementsByClassName and so - * for efficiency, we need to specially track changes to these - * special attributes. - * - * - Some attributes like class have different names (className) when - * reflected. - * - * - Attributes whose names begin with the string 'data-' are treated - specially. - * - * - Reflected attributes that have a boolean type in IDL have special - * behavior: setting them to false (in IDL) is the same as removing - * them with removeAttribute() - * - * - numeric attributes (like HTMLElement.tabIndex) can have default - * values that must be returned by the idl getter even if the - * content attribute does not exist. (The default tabIndex value - * actually varies based on the type of the element, so that is a - * tricky one). - * - * See - * http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflect - * for rules on how attributes are reflected. - * - */ - - getAttribute: { value: function getAttribute(qname) { - var attr = this.getAttributeNode(qname); - return attr ? attr.value : null; - }}, - - getAttributeNS: { value: function getAttributeNS(ns, lname) { - var attr = this.getAttributeNodeNS(ns, lname); - return attr ? attr.value : null; - }}, - - getAttributeNode: { value: function getAttributeNode(qname) { - qname = String(qname); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - var attr = this._attrsByQName[qname]; - if (!attr) return null; - - if (Array.isArray(attr)) // If there is more than one - attr = attr[0]; // use the first - - return attr; - }}, - - getAttributeNodeNS: { value: function getAttributeNodeNS(ns, lname) { - ns = (ns === undefined || ns === null) ? '' : String(ns); - lname = String(lname); - var attr = this._attrsByLName[ns + '|' + lname]; - return attr ? attr : null; - }}, - - hasAttribute: { value: function hasAttribute(qname) { - qname = String(qname); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - return this._attrsByQName[qname] !== undefined; - }}, - - hasAttributeNS: { value: function hasAttributeNS(ns, lname) { - ns = (ns === undefined || ns === null) ? '' : String(ns); - lname = String(lname); - var key = ns + '|' + lname; - return this._attrsByLName[key] !== undefined; - }}, - - hasAttributes: { value: function hasAttributes() { - return this._numattrs > 0; - }}, - - toggleAttribute: { value: function toggleAttribute(qname, force) { - qname = String(qname); - if (!xml.isValidName(qname)) utils.InvalidCharacterError(); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - var a = this._attrsByQName[qname]; - if (a === undefined) { - if (force === undefined || force === true) { - this._setAttribute(qname, ''); - return true; - } - return false; - } else { - if (force === undefined || force === false) { - this.removeAttribute(qname); - return false; - } - return true; - } - }}, - - // Set the attribute without error checking. The parser uses this. - _setAttribute: { value: function _setAttribute(qname, value) { - // XXX: the spec says that this next search should be done - // on the local name, but I think that is an error. - // email pending on www-dom about it. - var attr = this._attrsByQName[qname]; - var isnew; - if (!attr) { - attr = this._newattr(qname); - isnew = true; - } - else { - if (Array.isArray(attr)) attr = attr[0]; - } - - // Now set the attribute value on the new or existing Attr object. - // The Attr.value setter method handles mutation events, etc. - attr.value = value; - if (this._attributes) this._attributes[qname] = attr; - if (isnew && this._newattrhook) this._newattrhook(qname, value); - }}, - - // Check for errors, and then set the attribute - setAttribute: { value: function setAttribute(qname, value) { - qname = String(qname); - if (!xml.isValidName(qname)) utils.InvalidCharacterError(); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - this._setAttribute(qname, String(value)); - }}, - - - // The version with no error checking used by the parser - _setAttributeNS: { value: function _setAttributeNS(ns, qname, value) { - var pos = qname.indexOf(':'), prefix, lname; - if (pos < 0) { - prefix = null; - lname = qname; - } - else { - prefix = qname.substring(0, pos); - lname = qname.substring(pos+1); - } - - if (ns === '' || ns === undefined) ns = null; - var key = (ns === null ? '' : ns) + '|' + lname; - - var attr = this._attrsByLName[key]; - var isnew; - if (!attr) { - attr = new Attr(this, lname, prefix, ns); - isnew = true; - this._attrsByLName[key] = attr; - if (this._attributes) { - this._attributes[this._attrKeys.length] = attr; - } - this._attrKeys.push(key); - - // We also have to make the attr searchable by qname. - // But we have to be careful because there may already - // be an attr with this qname. - this._addQName(attr); - } - else if (false /* changed in DOM 4 */) {} - attr.value = value; // Automatically sends mutation event - if (isnew && this._newattrhook) this._newattrhook(qname, value); - }}, - - // Do error checking then call _setAttributeNS - setAttributeNS: { value: function setAttributeNS(ns, qname, value) { - // Convert parameter types according to WebIDL - ns = (ns === null || ns === undefined || ns === '') ? null : String(ns); - qname = String(qname); - if (!xml.isValidQName(qname)) utils.InvalidCharacterError(); - - var pos = qname.indexOf(':'); - var prefix = (pos < 0) ? null : qname.substring(0, pos); - - if ((prefix !== null && ns === null) || - (prefix === 'xml' && ns !== NAMESPACE.XML) || - ((qname === 'xmlns' || prefix === 'xmlns') && - (ns !== NAMESPACE.XMLNS)) || - (ns === NAMESPACE.XMLNS && - !(qname === 'xmlns' || prefix === 'xmlns'))) - utils.NamespaceError(); - - this._setAttributeNS(ns, qname, String(value)); - }}, - - setAttributeNode: { value: function setAttributeNode(attr) { - if (attr.ownerElement !== null && attr.ownerElement !== this) { - throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR); - } - var result = null; - var oldAttrs = this._attrsByQName[attr.name]; - if (oldAttrs) { - if (!Array.isArray(oldAttrs)) { oldAttrs = [ oldAttrs ]; } - if (oldAttrs.some(function(a) { return a===attr; })) { - return attr; - } else if (attr.ownerElement !== null) { - throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR); - } - oldAttrs.forEach(function(a) { this.removeAttributeNode(a); }, this); - result = oldAttrs[0]; - } - this.setAttributeNodeNS(attr); - return result; - }}, - - setAttributeNodeNS: { value: function setAttributeNodeNS(attr) { - if (attr.ownerElement !== null) { - throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR); - } - var ns = attr.namespaceURI; - var key = (ns === null ? '' : ns) + '|' + attr.localName; - var oldAttr = this._attrsByLName[key]; - if (oldAttr) { this.removeAttributeNode(oldAttr); } - attr._setOwnerElement(this); - this._attrsByLName[key] = attr; - if (this._attributes) { - this._attributes[this._attrKeys.length] = attr; - } - this._attrKeys.push(key); - this._addQName(attr); - if (this._newattrhook) this._newattrhook(attr.name, attr.value); - return oldAttr || null; - }}, - - removeAttribute: { value: function removeAttribute(qname) { - qname = String(qname); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - - var attr = this._attrsByQName[qname]; - if (!attr) return; - - // If there is more than one match for this qname - // so don't delete the qname mapping, just remove the first - // element from it. - if (Array.isArray(attr)) { - if (attr.length > 2) { - attr = attr.shift(); // remove it from the array - } - else { - this._attrsByQName[qname] = attr[1]; - attr = attr[0]; - } - } - else { - // only a single match, so remove the qname mapping - this._attrsByQName[qname] = undefined; - } - - var ns = attr.namespaceURI; - // Now attr is the removed attribute. Figure out its - // ns+lname key and remove it from the other mapping as well. - var key = (ns === null ? '' : ns) + '|' + attr.localName; - this._attrsByLName[key] = undefined; - - var i = this._attrKeys.indexOf(key); - if (this._attributes) { - Array.prototype.splice.call(this._attributes, i, 1); - this._attributes[qname] = undefined; - } - this._attrKeys.splice(i, 1); - - // Onchange handler for the attribute - var onchange = attr.onchange; - attr._setOwnerElement(null); - if (onchange) { - onchange.call(attr, this, attr.localName, attr.value, null); - } - // Mutation event - if (this.rooted) this.ownerDocument.mutateRemoveAttr(attr); - }}, - - removeAttributeNS: { value: function removeAttributeNS(ns, lname) { - ns = (ns === undefined || ns === null) ? '' : String(ns); - lname = String(lname); - var key = ns + '|' + lname; - var attr = this._attrsByLName[key]; - if (!attr) return; - - this._attrsByLName[key] = undefined; - - var i = this._attrKeys.indexOf(key); - if (this._attributes) { - Array.prototype.splice.call(this._attributes, i, 1); - } - this._attrKeys.splice(i, 1); - - // Now find the same Attr object in the qname mapping and remove it - // But be careful because there may be more than one match. - this._removeQName(attr); - - // Onchange handler for the attribute - var onchange = attr.onchange; - attr._setOwnerElement(null); - if (onchange) { - onchange.call(attr, this, attr.localName, attr.value, null); - } - // Mutation event - if (this.rooted) this.ownerDocument.mutateRemoveAttr(attr); - }}, - - removeAttributeNode: { value: function removeAttributeNode(attr) { - var ns = attr.namespaceURI; - var key = (ns === null ? '' : ns) + '|' + attr.localName; - if (this._attrsByLName[key] !== attr) { - utils.NotFoundError(); - } - this.removeAttributeNS(ns, attr.localName); - return attr; - }}, - - getAttributeNames: { value: function getAttributeNames() { - var elt = this; - return this._attrKeys.map(function(key) { - return elt._attrsByLName[key].name; - }); - }}, - - // This 'raw' version of getAttribute is used by the getter functions - // of reflected attributes. It skips some error checking and - // namespace steps - _getattr: { value: function _getattr(qname) { - // Assume that qname is already lowercased, so don't do it here. - // Also don't check whether attr is an array: a qname with no - // prefix will never have two matching Attr objects (because - // setAttributeNS doesn't allow a non-null namespace with a - // null prefix. - var attr = this._attrsByQName[qname]; - return attr ? attr.value : null; - }}, - - // The raw version of setAttribute for reflected idl attributes. - _setattr: { value: function _setattr(qname, value) { - var attr = this._attrsByQName[qname]; - var isnew; - if (!attr) { - attr = this._newattr(qname); - isnew = true; - } - attr.value = String(value); - if (this._attributes) this._attributes[qname] = attr; - if (isnew && this._newattrhook) this._newattrhook(qname, value); - }}, - - // Create a new Attr object, insert it, and return it. - // Used by setAttribute() and by set() - _newattr: { value: function _newattr(qname) { - var attr = new Attr(this, qname, null, null); - var key = '|' + qname; - this._attrsByQName[qname] = attr; - this._attrsByLName[key] = attr; - if (this._attributes) { - this._attributes[this._attrKeys.length] = attr; - } - this._attrKeys.push(key); - return attr; - }}, - - // Add a qname->Attr mapping to the _attrsByQName object, taking into - // account that there may be more than one attr object with the - // same qname - _addQName: { value: function(attr) { - var qname = attr.name; - var existing = this._attrsByQName[qname]; - if (!existing) { - this._attrsByQName[qname] = attr; - } - else if (Array.isArray(existing)) { - existing.push(attr); - } - else { - this._attrsByQName[qname] = [existing, attr]; - } - if (this._attributes) this._attributes[qname] = attr; - }}, - - // Remove a qname->Attr mapping to the _attrsByQName object, taking into - // account that there may be more than one attr object with the - // same qname - _removeQName: { value: function(attr) { - var qname = attr.name; - var target = this._attrsByQName[qname]; - - if (Array.isArray(target)) { - var idx = target.indexOf(attr); - utils.assert(idx !== -1); // It must be here somewhere - if (target.length === 2) { - this._attrsByQName[qname] = target[1-idx]; - if (this._attributes) { - this._attributes[qname] = this._attrsByQName[qname]; - } - } else { - target.splice(idx, 1); - if (this._attributes && this._attributes[qname] === attr) { - this._attributes[qname] = target[0]; - } - } - } - else { - utils.assert(target === attr); // If only one, it must match - this._attrsByQName[qname] = undefined; - if (this._attributes) { - this._attributes[qname] = undefined; - } - } - }}, - - // Return the number of attributes - _numattrs: { get: function() { return this._attrKeys.length; }}, - // Return the nth Attr object - _attr: { value: function(n) { - return this._attrsByLName[this._attrKeys[n]]; - }}, - - // Define getters and setters for an 'id' property that reflects - // the content attribute 'id'. - id: attributes.property({name: 'id'}), - - // Define getters and setters for a 'className' property that reflects - // the content attribute 'class'. - className: attributes.property({name: 'class'}), - - classList: { get: function() { - var self = this; - if (this._classList) { - return this._classList; - } - var dtlist = new DOMTokenList( - function() { - return self.className || ""; - }, - function(v) { - self.className = v; - } - ); - this._classList = dtlist; - return dtlist; - }, set: function(v) { this.className = v; }}, - - matches: { value: function(selector) { - return select.matches(this, selector); - }}, - - closest: { value: function(selector) { - var el = this; - do { - if (el.matches && el.matches(selector)) { return el; } - el = el.parentElement || el.parentNode; - } while (el !== null && el.nodeType === Node.ELEMENT_NODE); - return null; - }}, - - querySelector: { value: function(selector) { - return select(selector, this)[0]; - }}, - - querySelectorAll: { value: function(selector) { - var nodes = select(selector, this); - return nodes.item ? nodes : new NodeList(nodes); - }} - -}); - -Object.defineProperties(Element.prototype, ChildNode); -Object.defineProperties(Element.prototype, NonDocumentTypeChildNode); - -// Register special handling for the id attribute -attributes.registerChangeHandler(Element, 'id', - function(element, lname, oldval, newval) { - if (element.rooted) { - if (oldval) { - element.ownerDocument.delId(oldval, element); - } - if (newval) { - element.ownerDocument.addId(newval, element); - } - } - } -); -attributes.registerChangeHandler(Element, 'class', - function(element, lname, oldval, newval) { - if (element._classList) { element._classList._update(); } - } -); - -// The Attr class represents a single attribute. The values in -// _attrsByQName and _attrsByLName are instances of this class. -function Attr(elt, lname, prefix, namespace, value) { - // localName and namespace are constant for any attr object. - // But value may change. And so can prefix, and so, therefore can name. - this.localName = lname; - this.prefix = (prefix===null || prefix==='') ? null : ('' + prefix); - this.namespaceURI = (namespace===null || namespace==='') ? null : ('' + namespace); - this.data = value; - // Set ownerElement last to ensure it is hooked up to onchange handler - this._setOwnerElement(elt); -} - -// In DOM 3 Attr was supposed to extend Node; in DOM 4 that was abandoned. -Attr.prototype = Object.create(Object.prototype, { - ownerElement: { - get: function() { return this._ownerElement; }, - }, - _setOwnerElement: { value: function _setOwnerElement(elt) { - this._ownerElement = elt; - if (this.prefix === null && this.namespaceURI === null && elt) { - this.onchange = elt._attributeChangeHandlers[this.localName]; - } else { - this.onchange = null; - } - }}, - - name: { get: function() { - return this.prefix ? this.prefix + ':' + this.localName : this.localName; - }}, - - specified: { get: function() { - // Deprecated - return true; - }}, - - value: { - get: function() { - return this.data; - }, - set: function(value) { - var oldval = this.data; - value = (value === undefined) ? '' : value + ''; - if (value === oldval) return; - - this.data = value; - - // Run the onchange hook for the attribute - // if there is one. - if (this.ownerElement) { - if (this.onchange) - this.onchange(this.ownerElement,this.localName, oldval, value); - - // Generate a mutation event if the element is rooted - if (this.ownerElement.rooted) - this.ownerElement.ownerDocument.mutateAttr(this, oldval); - } - }, - }, - - cloneNode: { value: function cloneNode(deep) { - // Both this method and Document#createAttribute*() create unowned Attrs - return new Attr( - null, this.localName, this.prefix, this.namespaceURI, this.data - ); - }}, - - // Legacy aliases (see gh#70 and https://dom.spec.whatwg.org/#interface-attr) - nodeType: { get: function() { return Node.ATTRIBUTE_NODE; } }, - nodeName: { get: function() { return this.name; } }, - nodeValue: { - get: function() { return this.value; }, - set: function(v) { this.value = v; }, - }, - textContent: { - get: function() { return this.value; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } - this.value = v; - }, - }, - innerText: { - get: function() { return this.value; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } - this.value = v; - }, - }, -}); -// Sneakily export this class for use by Document.createAttribute() -Element._Attr = Attr; - -// The attributes property of an Element will be an instance of this class. -// This class is really just a dummy, though. It only defines a length -// property and an item() method. The AttrArrayProxy that -// defines the public API just uses the Element object itself. -function AttributesArray(elt) { - NamedNodeMap.call(this, elt); - for (var name in elt._attrsByQName) { - this[name] = elt._attrsByQName[name]; - } - for (var i = 0; i < elt._attrKeys.length; i++) { - this[i] = elt._attrsByLName[elt._attrKeys[i]]; - } -} -AttributesArray.prototype = Object.create(NamedNodeMap.prototype, { - length: { get: function() { - return this.element._attrKeys.length; - }, set: function() { /* ignore */ } }, - item: { value: function(n) { - /* jshint bitwise: false */ - n = n >>> 0; - if (n >= this.length) { return null; } - return this.element._attrsByLName[this.element._attrKeys[n]]; - /* jshint bitwise: true */ - } }, -}); - -// We can't make direct array access work (without Proxies, node >=6) -// but we can make `Array.from(node.attributes)` and for-of loops work. -if (globalThis.Symbol?.iterator) { - AttributesArray.prototype[globalThis.Symbol.iterator] = function() { - var i=0, n=this.length, self=this; - return { - next: function() { - if (ielement map. - // It is not part of the HTMLCollection API, but we need it in - // src/HTMLCollectionProxy - namedItems: { get: function() { - this.updateCache(); - return this.childrenByName; - } }, - - updateCache: { value: function updateCache() { - var namedElts = /^(a|applet|area|embed|form|frame|frameset|iframe|img|object)$/; - if (this.lastModTime !== this.element.lastModTime) { - this.lastModTime = this.element.lastModTime; - - var n = this.childrenByNumber && this.childrenByNumber.length || 0; - for(var i = 0; i < n; i++) { - this[i] = undefined; - } - - this.childrenByNumber = []; - this.childrenByName = Object.create(null); - - for (var c = this.element.firstChild; c !== null; c = c.nextSibling) { - if (c.nodeType === Node.ELEMENT_NODE) { - - this[this.childrenByNumber.length] = c; - this.childrenByNumber.push(c); - - // XXX Are there any requirements about the namespace - // of the id property? - var id = c.getAttribute('id'); - - // If there is an id that is not already in use... - if (id && !this.childrenByName[id]) - this.childrenByName[id] = c; - - // For certain HTML elements we check the name attribute - var name = c.getAttribute('name'); - if (name && - this.element.namespaceURI === NAMESPACE.HTML && - namedElts.test(this.element.localName) && - !this.childrenByName[name]) - this.childrenByName[id] = c; - } - } - } - } }, -}); - -// These functions return predicates for filtering elements. -// They're used by the Document and Element classes for methods like -// getElementsByTagName and getElementsByClassName - -function localNameElementFilter(lname) { - return function(e) { return e.localName === lname; }; -} - -function htmlLocalNameElementFilter(lname) { - var lclname = utils.toASCIILowerCase(lname); - if (lclname === lname) - return localNameElementFilter(lname); - - return function(e) { - return e.isHTML ? e.localName === lclname : e.localName === lname; - }; -} - -function namespaceElementFilter(ns) { - return function(e) { return e.namespaceURI === ns; }; -} - -function namespaceLocalNameElementFilter(ns, lname) { - return function(e) { - return e.namespaceURI === ns && e.localName === lname; - }; -} - -function classNamesElementFilter(names) { - return function(e) { - return names.every(function(n) { return e.classList.contains(n); }); - }; -} - -function elementNameFilter(name) { - return function(e) { - // All the *HTML elements* in the document with the given name attribute - if (e.namespaceURI !== NAMESPACE.HTML) { return false; } - return e.getAttribute('name') === name; - }; -} - - -/***/ }), - -/***/ 13441: -/***/ ((module) => { - -"use strict"; - -module.exports = Event; - -Event.CAPTURING_PHASE = 1; -Event.AT_TARGET = 2; -Event.BUBBLING_PHASE = 3; - -function Event(type, dictionary) { - // Initialize basic event properties - this.type = ''; - this.target = null; - this.currentTarget = null; - this.eventPhase = Event.AT_TARGET; - this.bubbles = false; - this.cancelable = false; - this.isTrusted = false; - this.defaultPrevented = false; - this.timeStamp = Date.now(); - - // Initialize internal flags - // XXX: Would it be better to inherit these defaults from the prototype? - this._propagationStopped = false; - this._immediatePropagationStopped = false; - this._initialized = true; - this._dispatching = false; - - // Now initialize based on the constructor arguments (if any) - if (type) this.type = type; - if (dictionary) { - for(var p in dictionary) { - this[p] = dictionary[p]; - } - } -} - -Event.prototype = Object.create(Object.prototype, { - constructor: { value: Event }, - stopPropagation: { value: function stopPropagation() { - this._propagationStopped = true; - }}, - - stopImmediatePropagation: { value: function stopImmediatePropagation() { - this._propagationStopped = true; - this._immediatePropagationStopped = true; - }}, - - preventDefault: { value: function preventDefault() { - if (this.cancelable) this.defaultPrevented = true; - }}, - - initEvent: { value: function initEvent(type, bubbles, cancelable) { - this._initialized = true; - if (this._dispatching) return; - - this._propagationStopped = false; - this._immediatePropagationStopped = false; - this.defaultPrevented = false; - this.isTrusted = false; - - this.target = null; - this.type = type; - this.bubbles = bubbles; - this.cancelable = cancelable; - }}, - -}); - - -/***/ }), - -/***/ 22356: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var Event = __webpack_require__(13441); -var MouseEvent = __webpack_require__(21440); -var utils = __webpack_require__(89076); - -module.exports = EventTarget; - -function EventTarget() {} - -EventTarget.prototype = { - // XXX - // See WebIDL §4.8 for details on object event handlers - // and how they should behave. We actually have to accept - // any object to addEventListener... Can't type check it. - // on registration. - - // XXX: - // Capturing event listeners are sort of rare. I think I can optimize - // them so that dispatchEvent can skip the capturing phase (or much of - // it). Each time a capturing listener is added, increment a flag on - // the target node and each of its ancestors. Decrement when removed. - // And update the counter when nodes are added and removed from the - // tree as well. Then, in dispatch event, the capturing phase can - // abort if it sees any node with a zero count. - addEventListener: function addEventListener(type, listener, capture) { - if (!listener) return; - if (capture === undefined) capture = false; - if (!this._listeners) this._listeners = Object.create(null); - if (!this._listeners[type]) this._listeners[type] = []; - var list = this._listeners[type]; - - // If this listener has already been registered, just return - for(var i = 0, n = list.length; i < n; i++) { - var l = list[i]; - if (l.listener === listener && l.capture === capture) - return; - } - - // Add an object to the list of listeners - var obj = { listener: listener, capture: capture }; - if (typeof listener === 'function') obj.f = listener; - list.push(obj); - }, - - removeEventListener: function removeEventListener(type, - listener, - capture) { - if (capture === undefined) capture = false; - if (this._listeners) { - var list = this._listeners[type]; - if (list) { - // Find the listener in the list and remove it - for(var i = 0, n = list.length; i < n; i++) { - var l = list[i]; - if (l.listener === listener && l.capture === capture) { - if (list.length === 1) { - this._listeners[type] = undefined; - } - else { - list.splice(i, 1); - } - return; - } - } - } - } - }, - - // This is the public API for dispatching untrusted public events. - // See _dispatchEvent for the implementation - dispatchEvent: function dispatchEvent(event) { - // Dispatch an untrusted event - return this._dispatchEvent(event, false); - }, - - // - // See DOMCore §4.4 - // XXX: I'll probably need another version of this method for - // internal use, one that does not set isTrusted to false. - // XXX: see Document._dispatchEvent: perhaps that and this could - // call a common internal function with different settings of - // a trusted boolean argument - // - // XXX: - // The spec has changed in how to deal with handlers registered - // on idl or content attributes rather than with addEventListener. - // Used to say that they always ran first. That's how webkit does it - // Spec now says that they run in a position determined by - // when they were first set. FF does it that way. See: - // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handlers - // - _dispatchEvent: function _dispatchEvent(event, trusted) { - if (typeof trusted !== 'boolean') trusted = false; - function invoke(target, event) { - var type = event.type, phase = event.eventPhase; - event.currentTarget = target; - - // If there was an individual handler defined, invoke it first - // XXX: see comment above: this shouldn't always be first. - if (phase !== Event.CAPTURING_PHASE && - target._handlers && target._handlers[type]) - { - var handler = target._handlers[type]; - var rv; - if (typeof handler === 'function') { - rv=handler.call(event.currentTarget, event); - } - else { - var f = handler.handleEvent; - if (typeof f !== 'function') - throw new TypeError('handleEvent property of ' + - 'event handler object is' + - 'not a function.'); - rv=f.call(handler, event); - } - - switch(event.type) { - case 'mouseover': - if (rv === true) // Historical baggage - event.preventDefault(); - break; - case 'beforeunload': - // XXX: eventually we need a special case here - /* falls through */ - default: - if (rv === false) - event.preventDefault(); - break; - } - } - - // Now invoke list list of listeners for this target and type - var list = target._listeners && target._listeners[type]; - if (!list) return; - list = list.slice(); - for(var i = 0, n = list.length; i < n; i++) { - if (event._immediatePropagationStopped) return; - var l = list[i]; - if ((phase === Event.CAPTURING_PHASE && !l.capture) || - (phase === Event.BUBBLING_PHASE && l.capture)) - continue; - if (l.f) { - l.f.call(event.currentTarget, event); - } - else { - var fn = l.listener.handleEvent; - if (typeof fn !== 'function') - throw new TypeError('handleEvent property of event listener object is not a function.'); - fn.call(l.listener, event); - } - } - } - - if (!event._initialized || event._dispatching) utils.InvalidStateError(); - event.isTrusted = trusted; - - // Begin dispatching the event now - event._dispatching = true; - event.target = this; - - // Build the list of targets for the capturing and bubbling phases - // XXX: we'll eventually have to add Window to this list. - var ancestors = []; - for(var n = this.parentNode; n; n = n.parentNode) - ancestors.push(n); - - // Capturing phase - event.eventPhase = Event.CAPTURING_PHASE; - for(var i = ancestors.length-1; i >= 0; i--) { - invoke(ancestors[i], event); - if (event._propagationStopped) break; - } - - // At target phase - if (!event._propagationStopped) { - event.eventPhase = Event.AT_TARGET; - invoke(this, event); - } - - // Bubbling phase - if (event.bubbles && !event._propagationStopped) { - event.eventPhase = Event.BUBBLING_PHASE; - for(var ii = 0, nn = ancestors.length; ii < nn; ii++) { - invoke(ancestors[ii], event); - if (event._propagationStopped) break; - } - } - - event._dispatching = false; - event.eventPhase = Event.AT_TARGET; - event.currentTarget = null; - - // Deal with mouse events and figure out when - // a click has happened - if (trusted && !event.defaultPrevented && event instanceof MouseEvent) { - switch(event.type) { - case 'mousedown': - this._armed = { - x: event.clientX, - y: event.clientY, - t: event.timeStamp - }; - break; - case 'mouseout': - case 'mouseover': - this._armed = null; - break; - case 'mouseup': - if (this._isClick(event)) this._doClick(event); - this._armed = null; - break; - } - } - - - - return !event.defaultPrevented; - }, - - // Determine whether a click occurred - // XXX We don't support double clicks for now - _isClick: function(event) { - return (this._armed !== null && - event.type === 'mouseup' && - event.isTrusted && - event.button === 0 && - event.timeStamp - this._armed.t < 1000 && - Math.abs(event.clientX - this._armed.x) < 10 && - Math.abs(event.clientY - this._armed.Y) < 10); - }, - - // Clicks are handled like this: - // http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#interactive-content-0 - // - // Note that this method is similar to the HTMLElement.click() method - // The event argument must be the trusted mouseup event - _doClick: function(event) { - if (this._click_in_progress) return; - this._click_in_progress = true; - - // Find the nearest enclosing element that is activatable - // An element is activatable if it has a - // _post_click_activation_steps hook - var activated = this; - while(activated && !activated._post_click_activation_steps) - activated = activated.parentNode; - - if (activated && activated._pre_click_activation_steps) { - activated._pre_click_activation_steps(); - } - - var click = this.ownerDocument.createEvent('MouseEvent'); - click.initMouseEvent('click', true, true, - this.ownerDocument.defaultView, 1, - event.screenX, event.screenY, - event.clientX, event.clientY, - event.ctrlKey, event.altKey, - event.shiftKey, event.metaKey, - event.button, null); - - var result = this._dispatchEvent(click, true); - - if (activated) { - if (result) { - // This is where hyperlinks get followed, for example. - if (activated._post_click_activation_steps) - activated._post_click_activation_steps(click); - } - else { - if (activated._cancelled_activation_steps) - activated._cancelled_activation_steps(); - } - } - }, - - // - // An event handler is like an event listener, but it registered - // by setting an IDL or content attribute like onload or onclick. - // There can only be one of these at a time for any event type. - // This is an internal method for the attribute accessors and - // content attribute handlers that need to register events handlers. - // The type argument is the same as in addEventListener(). - // The handler argument is the same as listeners in addEventListener: - // it can be a function or an object. Pass null to remove any existing - // handler. Handlers are always invoked before any listeners of - // the same type. They are not invoked during the capturing phase - // of event dispatch. - // - _setEventHandler: function _setEventHandler(type, handler) { - if (!this._handlers) this._handlers = Object.create(null); - this._handlers[type] = handler; - }, - - _getEventHandler: function _getEventHandler(type) { - return (this._handlers && this._handlers[type]) || null; - } - -}; - - -/***/ }), - -/***/ 61676: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = FilteredElementList; - -var Node = __webpack_require__(97537); - -// -// This file defines node list implementation that lazily traverses -// the document tree (or a subtree rooted at any element) and includes -// only those elements for which a specified filter function returns true. -// It is used to implement the -// {Document,Element}.getElementsBy{TagName,ClassName}{,NS} methods. -// -// XXX this should inherit from NodeList - -function FilteredElementList(root, filter) { - this.root = root; - this.filter = filter; - this.lastModTime = root.lastModTime; - this.done = false; - this.cache = []; - this.traverse(); -} - -FilteredElementList.prototype = Object.create(Object.prototype, { - length: { get: function() { - this.checkcache(); - if (!this.done) this.traverse(); - return this.cache.length; - } }, - - item: { value: function(n) { - this.checkcache(); - if (!this.done && n >= this.cache.length) { - // This can lead to O(N^2) behavior if we stop when we get to n - // and the caller is iterating through the items in order; so - // be sure to do the full traverse here. - this.traverse(/*n*/); - } - return this.cache[n]; - } }, - - checkcache: { value: function() { - if (this.lastModTime !== this.root.lastModTime) { - // subtree has changed, so invalidate cache - for (var i = this.cache.length-1; i>=0; i--) { - this[i] = undefined; - } - this.cache.length = 0; - this.done = false; - this.lastModTime = this.root.lastModTime; - } - } }, - - // If n is specified, then traverse the tree until we've found the nth - // item (or until we've found all items). If n is not specified, - // traverse until we've found all items. - traverse: { value: function(n) { - // increment n so we can compare to length, and so it is never falsy - if (n !== undefined) n++; - - var elt; - while ((elt = this.next()) !== null) { - this[this.cache.length] = elt; //XXX Use proxy instead - this.cache.push(elt); - if (n && this.cache.length === n) return; - } - - // no next element, so we've found everything - this.done = true; - } }, - - // Return the next element under root that matches filter - next: { value: function() { - var start = (this.cache.length === 0) ? this.root // Start at the root or at - : this.cache[this.cache.length-1]; // the last element we found - - var elt; - if (start.nodeType === Node.DOCUMENT_NODE) - elt = start.documentElement; - else - elt = start.nextElement(this.root); - - while(elt) { - if (this.filter(elt)) { - return elt; - } - - elt = elt.nextElement(this.root); - } - return null; - } }, -}); - - -/***/ }), - -/***/ 91895: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = HTMLParser; - -var Document = __webpack_require__(35452); -var DocumentType = __webpack_require__(73092); -var Node = __webpack_require__(97537); -var NAMESPACE = (__webpack_require__(89076).NAMESPACE); -var html = __webpack_require__(96324); -var impl = html.elements; - -var pushAll = Function.prototype.apply.bind(Array.prototype.push); - -/* - * This file contains an implementation of the HTML parsing algorithm. - * The algorithm and the implementation are complex because HTML - * explicitly defines how the parser should behave for all possible - * valid and invalid inputs. - * - * Usage: - * - * The file defines a single HTMLParser() function, which dom.js exposes - * publicly as document.implementation.mozHTMLParser(). This is a - * factory function, not a constructor. - * - * When you call document.implementation.mozHTMLParser(), it returns - * an object that has parse() and document() methods. To parse HTML text, - * pass the text (in one or more chunks) to the parse() method. When - * you've passed all the text (on the last chunk, or afterward) pass - * true as the second argument to parse() to tell the parser that there - * is no more coming. Call document() to get the document object that - * the parser is parsing into. You can call this at any time, before - * or after calling parse(). - * - * The first argument to mozHTMLParser is the absolute URL of the document. - * - * The second argument is optional and is for internal use only. Pass an - * element as the fragmentContext to do innerHTML parsing for the - * element. To do innerHTML parsing on a document, pass null. Otherwise, - * omit the 2nd argument. See HTMLElement.innerHTML for an example. Note - * that if you pass a context element, the end() method will return an - * unwrapped document instead of a wrapped one. - * - * Implementation details: - * - * This is a long file of almost 7000 lines. It is structured as one - * big function nested within another big function. The outer - * function defines a bunch of constant data, utility functions - * that use that data, and a couple of classes used by the parser. - * The outer function also defines and returns the - * inner function. This inner function is the HTMLParser factory - * function that implements the parser and holds all the parser state - * as local variables. The HTMLParser function is quite big because - * it defines many nested functions that use those local variables. - * - * There are three tightly coupled parser stages: a scanner, a - * tokenizer and a tree builder. In a (possibly misguided) attempt at - * efficiency, the stages are not implemented as separate classes: - * everything shares state and is (mostly) implemented in imperative - * (rather than OO) style. - * - * The stages of the parser work like this: When the client code calls - * the parser's parse() method, the specified string is passed to - * scanChars(). The scanner loops through that string and passes characters - * (sometimes one at a time, sometimes in chunks) to the tokenizer stage. - * The tokenizer groups the characters into tokens: tags, endtags, runs - * of text, comments, doctype declarations, and the end-of-file (EOF) - * token. These tokens are then passed to the tree building stage via - * the insertToken() function. The tree building stage builds up the - * document tree. - * - * The tokenizer stage is a finite state machine. Each state is - * implemented as a function with a name that ends in "_state". The - * initial state is data_state(). The current tokenizer state is stored - * in the variable 'tokenizer'. Most state functions expect a single - * integer argument which represents a single UTF-16 codepoint. Some - * states want more characters and set a lookahead property on - * themselves. The scanChars() function in the scanner checks for this - * lookahead property. If it doesn't exist, then scanChars() just passes - * the next input character to the current tokenizer state function. - * Otherwise, scanChars() looks ahead (a given # of characters, or for a - * matching string, or for a matching regexp) and passes a string of - * characters to the current tokenizer state function. - * - * As a shortcut, certain states of the tokenizer use regular expressions - * to look ahead in the scanner's input buffer for runs of text, simple - * tags and attributes. For well-formed input, these shortcuts skip a - * lot of state transitions and speed things up a bit. - * - * When a tokenizer state function has consumed a complete token, it - * emits that token, by calling insertToken(), or by calling a utility - * function that itself calls insertToken(). These tokens are passed to - * the tree building stage, which is also a state machine. Like the - * tokenizer, the tree building states are implemented as functions, and - * these functions have names that end with _mode (because the HTML spec - * refers to them as insertion modes). The current insertion mode is held - * by the 'parser' variable. Each insertion mode function takes up to 4 - * arguments. The first is a token type, represented by the constants - * TAG, ENDTAG, TEXT, COMMENT, DOCTYPE and EOF. The second argument is - * the value of the token: the text or comment data, or tagname or - * doctype. For tags, the 3rd argument is an array of attributes. For - * DOCTYPES it is the optional public id. For tags, the 4th argument is - * true if the tag is self-closing. For doctypes, the 4th argument is the - * optional system id. - * - * Search for "***" to find the major sub-divisions in the code. - */ - - -/*** - * Data prolog. Lots of constants declared here, including some - * very large objects. They're used throughout the code that follows - */ -// Token types for the tree builder. -var EOF = -1; -var TEXT = 1; -var TAG = 2; -var ENDTAG = 3; -var COMMENT = 4; -var DOCTYPE = 5; - -// A re-usable empty array -var NOATTRS = []; - -// These DTD public ids put the browser in quirks mode -var quirkyPublicIds = /^HTML$|^-\/\/W3O\/\/DTD W3 HTML Strict 3\.0\/\/EN\/\/$|^-\/W3C\/DTD HTML 4\.0 Transitional\/EN$|^\+\/\/Silmaril\/\/dtd html Pro v0r11 19970101\/\/|^-\/\/AdvaSoft Ltd\/\/DTD HTML 3\.0 asWedit \+ extensions\/\/|^-\/\/AS\/\/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\/\/|^-\/\/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\/\/|^-\/\/SQ\/\/DTD HTML 2\.0 HoTMetaL \+ extensions\/\/|^-\/\/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\/\//i; - -var quirkySystemId = "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"; - -var conditionallyQuirkyPublicIds = /^-\/\/W3C\/\/DTD HTML 4\.01 Frameset\/\/|^-\/\/W3C\/\/DTD HTML 4\.01 Transitional\/\//i; - -// These DTD public ids put the browser in limited quirks mode -var limitedQuirkyPublicIds = /^-\/\/W3C\/\/DTD XHTML 1\.0 Frameset\/\/|^-\/\/W3C\/\/DTD XHTML 1\.0 Transitional\/\//i; - - -// Element sets below. See the isA() function for a way to test -// whether an element is a member of a set -var specialSet = Object.create(null); -specialSet[NAMESPACE.HTML] = { - __proto__: null, - "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, - // Note that "xmp" was removed from the "special" set in the latest - // spec, apparently by accident; see - // https://github.com/whatwg/html/pull/1919 - "ul":true, "wbr":true, "xmp":true -}; -specialSet[NAMESPACE.SVG] = { - __proto__: null, - "foreignObject": true, "desc": true, "title": true -}; -specialSet[NAMESPACE.MATHML] = { - __proto__: null, - "mi":true, "mo":true, "mn":true, "ms":true, - "mtext":true, "annotation-xml":true -}; - -// The set of address, div, and p HTML tags -var addressdivpSet = Object.create(null); -addressdivpSet[NAMESPACE.HTML] = { - __proto__: null, - "address":true, "div":true, "p":true -}; - -var dddtSet = Object.create(null); -dddtSet[NAMESPACE.HTML] = { - __proto__: null, - "dd":true, "dt":true -}; - -var tablesectionrowSet = Object.create(null); -tablesectionrowSet[NAMESPACE.HTML] = { - __proto__: null, - "table":true, "thead":true, "tbody":true, "tfoot":true, "tr":true -}; - -var impliedEndTagsSet = Object.create(null); -impliedEndTagsSet[NAMESPACE.HTML] = { - __proto__: null, - "dd": true, "dt": true, "li": true, "menuitem": true, "optgroup": true, - "option": true, "p": true, "rb": true, "rp": true, "rt": true, "rtc": true -}; - -var thoroughImpliedEndTagsSet = Object.create(null); -thoroughImpliedEndTagsSet[NAMESPACE.HTML] = { - __proto__: null, - "caption": true, "colgroup": true, "dd": true, "dt": true, "li": true, - "optgroup": true, "option": true, "p": true, "rb": true, "rp": true, - "rt": true, "rtc": true, "tbody": true, "td": true, "tfoot": true, - "th": true, "thead": true, "tr": true -}; - -var tableContextSet = Object.create(null); -tableContextSet[NAMESPACE.HTML] = { - __proto__: null, - "table": true, "template": true, "html": true -}; - -var tableBodyContextSet = Object.create(null); -tableBodyContextSet[NAMESPACE.HTML] = { - __proto__: null, - "tbody": true, "tfoot": true, "thead": true, "template": true, "html": true -}; - -var tableRowContextSet = Object.create(null); -tableRowContextSet[NAMESPACE.HTML] = { - __proto__: null, - "tr": true, "template": true, "html": true -}; - -// See http://www.w3.org/TR/html5/forms.html#form-associated-element -var formassociatedSet = Object.create(null); -formassociatedSet[NAMESPACE.HTML] = { - __proto__: null, - "button": true, "fieldset": true, "input": true, "keygen": true, - "object": true, "output": true, "select": true, "textarea": true, - "img": true -}; - -var inScopeSet = Object.create(null); -inScopeSet[NAMESPACE.HTML]= { - __proto__: null, - "applet":true, "caption":true, "html":true, "table":true, - "td":true, "th":true, "marquee":true, "object":true, - "template":true -}; -inScopeSet[NAMESPACE.MATHML] = { - __proto__: null, - "mi":true, "mo":true, "mn":true, "ms":true, - "mtext":true, "annotation-xml":true -}; -inScopeSet[NAMESPACE.SVG] = { - __proto__: null, - "foreignObject":true, "desc":true, "title":true -}; - -var inListItemScopeSet = Object.create(inScopeSet); -inListItemScopeSet[NAMESPACE.HTML] = - Object.create(inScopeSet[NAMESPACE.HTML]); -inListItemScopeSet[NAMESPACE.HTML].ol = true; -inListItemScopeSet[NAMESPACE.HTML].ul = true; - -var inButtonScopeSet = Object.create(inScopeSet); -inButtonScopeSet[NAMESPACE.HTML] = - Object.create(inScopeSet[NAMESPACE.HTML]); -inButtonScopeSet[NAMESPACE.HTML].button = true; - -var inTableScopeSet = Object.create(null); -inTableScopeSet[NAMESPACE.HTML] = { - __proto__: null, - "html":true, "table":true, "template":true -}; - -// The set of elements for select scope is the everything *except* these -var invertedSelectScopeSet = Object.create(null); -invertedSelectScopeSet[NAMESPACE.HTML] = { - __proto__: null, - "optgroup":true, "option":true -}; - -var mathmlTextIntegrationPointSet = Object.create(null); -mathmlTextIntegrationPointSet[NAMESPACE.MATHML] = { - __proto__: null, - mi: true, - mo: true, - mn: true, - ms: true, - mtext: true -}; - -var htmlIntegrationPointSet = Object.create(null); -htmlIntegrationPointSet[NAMESPACE.SVG] = { - __proto__: null, - foreignObject: true, - desc: true, - title: true -}; - -var foreignAttributes = { - __proto__: null, - "xlink:actuate": NAMESPACE.XLINK, "xlink:arcrole": NAMESPACE.XLINK, - "xlink:href": NAMESPACE.XLINK, "xlink:role": NAMESPACE.XLINK, - "xlink:show": NAMESPACE.XLINK, "xlink:title": NAMESPACE.XLINK, - "xlink:type": NAMESPACE.XLINK, "xml:base": NAMESPACE.XML, - "xml:lang": NAMESPACE.XML, "xml:space": NAMESPACE.XML, - "xmlns": NAMESPACE.XMLNS, "xmlns:xlink": NAMESPACE.XMLNS -}; - - -// Lowercase to mixed case mapping for SVG attributes and tagnames -var svgAttrAdjustments = { - __proto__: null, - 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 svgTagNameAdjustments = { - __proto__: null, - 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" -}; - - -// Data for parsing numeric and named character references -// These next 3 objects are direct translations of tables -// in the HTML spec into JavaScript object format -var numericCharRefReplacements = { - __proto__: null, - 0x00:0xFFFD, 0x80:0x20AC, 0x82:0x201A, 0x83:0x0192, 0x84:0x201E, - 0x85:0x2026, 0x86:0x2020, 0x87:0x2021, 0x88:0x02C6, 0x89:0x2030, - 0x8A:0x0160, 0x8B:0x2039, 0x8C:0x0152, 0x8E:0x017D, 0x91:0x2018, - 0x92:0x2019, 0x93:0x201C, 0x94:0x201D, 0x95:0x2022, 0x96:0x2013, - 0x97:0x2014, 0x98:0x02DC, 0x99:0x2122, 0x9A:0x0161, 0x9B:0x203A, - 0x9C:0x0153, 0x9E:0x017E, 0x9F:0x0178 -}; - -/* - * This table is generated with test/tools/update-entities.js - */ -var namedCharRefs = { - __proto__: null, - "AElig":0xc6, "AElig;":0xc6, - "AMP":0x26, "AMP;":0x26, - "Aacute":0xc1, "Aacute;":0xc1, - "Abreve;":0x102, "Acirc":0xc2, - "Acirc;":0xc2, "Acy;":0x410, - "Afr;":[0xd835,0xdd04], "Agrave":0xc0, - "Agrave;":0xc0, "Alpha;":0x391, - "Amacr;":0x100, "And;":0x2a53, - "Aogon;":0x104, "Aopf;":[0xd835,0xdd38], - "ApplyFunction;":0x2061, "Aring":0xc5, - "Aring;":0xc5, "Ascr;":[0xd835,0xdc9c], - "Assign;":0x2254, "Atilde":0xc3, - "Atilde;":0xc3, "Auml":0xc4, - "Auml;":0xc4, "Backslash;":0x2216, - "Barv;":0x2ae7, "Barwed;":0x2306, - "Bcy;":0x411, "Because;":0x2235, - "Bernoullis;":0x212c, "Beta;":0x392, - "Bfr;":[0xd835,0xdd05], "Bopf;":[0xd835,0xdd39], - "Breve;":0x2d8, "Bscr;":0x212c, - "Bumpeq;":0x224e, "CHcy;":0x427, - "COPY":0xa9, "COPY;":0xa9, - "Cacute;":0x106, "Cap;":0x22d2, - "CapitalDifferentialD;":0x2145, "Cayleys;":0x212d, - "Ccaron;":0x10c, "Ccedil":0xc7, - "Ccedil;":0xc7, "Ccirc;":0x108, - "Cconint;":0x2230, "Cdot;":0x10a, - "Cedilla;":0xb8, "CenterDot;":0xb7, - "Cfr;":0x212d, "Chi;":0x3a7, - "CircleDot;":0x2299, "CircleMinus;":0x2296, - "CirclePlus;":0x2295, "CircleTimes;":0x2297, - "ClockwiseContourIntegral;":0x2232, "CloseCurlyDoubleQuote;":0x201d, - "CloseCurlyQuote;":0x2019, "Colon;":0x2237, - "Colone;":0x2a74, "Congruent;":0x2261, - "Conint;":0x222f, "ContourIntegral;":0x222e, - "Copf;":0x2102, "Coproduct;":0x2210, - "CounterClockwiseContourIntegral;":0x2233, "Cross;":0x2a2f, - "Cscr;":[0xd835,0xdc9e], "Cup;":0x22d3, - "CupCap;":0x224d, "DD;":0x2145, - "DDotrahd;":0x2911, "DJcy;":0x402, - "DScy;":0x405, "DZcy;":0x40f, - "Dagger;":0x2021, "Darr;":0x21a1, - "Dashv;":0x2ae4, "Dcaron;":0x10e, - "Dcy;":0x414, "Del;":0x2207, - "Delta;":0x394, "Dfr;":[0xd835,0xdd07], - "DiacriticalAcute;":0xb4, "DiacriticalDot;":0x2d9, - "DiacriticalDoubleAcute;":0x2dd, "DiacriticalGrave;":0x60, - "DiacriticalTilde;":0x2dc, "Diamond;":0x22c4, - "DifferentialD;":0x2146, "Dopf;":[0xd835,0xdd3b], - "Dot;":0xa8, "DotDot;":0x20dc, - "DotEqual;":0x2250, "DoubleContourIntegral;":0x222f, - "DoubleDot;":0xa8, "DoubleDownArrow;":0x21d3, - "DoubleLeftArrow;":0x21d0, "DoubleLeftRightArrow;":0x21d4, - "DoubleLeftTee;":0x2ae4, "DoubleLongLeftArrow;":0x27f8, - "DoubleLongLeftRightArrow;":0x27fa, "DoubleLongRightArrow;":0x27f9, - "DoubleRightArrow;":0x21d2, "DoubleRightTee;":0x22a8, - "DoubleUpArrow;":0x21d1, "DoubleUpDownArrow;":0x21d5, - "DoubleVerticalBar;":0x2225, "DownArrow;":0x2193, - "DownArrowBar;":0x2913, "DownArrowUpArrow;":0x21f5, - "DownBreve;":0x311, "DownLeftRightVector;":0x2950, - "DownLeftTeeVector;":0x295e, "DownLeftVector;":0x21bd, - "DownLeftVectorBar;":0x2956, "DownRightTeeVector;":0x295f, - "DownRightVector;":0x21c1, "DownRightVectorBar;":0x2957, - "DownTee;":0x22a4, "DownTeeArrow;":0x21a7, - "Downarrow;":0x21d3, "Dscr;":[0xd835,0xdc9f], - "Dstrok;":0x110, "ENG;":0x14a, - "ETH":0xd0, "ETH;":0xd0, - "Eacute":0xc9, "Eacute;":0xc9, - "Ecaron;":0x11a, "Ecirc":0xca, - "Ecirc;":0xca, "Ecy;":0x42d, - "Edot;":0x116, "Efr;":[0xd835,0xdd08], - "Egrave":0xc8, "Egrave;":0xc8, - "Element;":0x2208, "Emacr;":0x112, - "EmptySmallSquare;":0x25fb, "EmptyVerySmallSquare;":0x25ab, - "Eogon;":0x118, "Eopf;":[0xd835,0xdd3c], - "Epsilon;":0x395, "Equal;":0x2a75, - "EqualTilde;":0x2242, "Equilibrium;":0x21cc, - "Escr;":0x2130, "Esim;":0x2a73, - "Eta;":0x397, "Euml":0xcb, - "Euml;":0xcb, "Exists;":0x2203, - "ExponentialE;":0x2147, "Fcy;":0x424, - "Ffr;":[0xd835,0xdd09], "FilledSmallSquare;":0x25fc, - "FilledVerySmallSquare;":0x25aa, "Fopf;":[0xd835,0xdd3d], - "ForAll;":0x2200, "Fouriertrf;":0x2131, - "Fscr;":0x2131, "GJcy;":0x403, - "GT":0x3e, "GT;":0x3e, - "Gamma;":0x393, "Gammad;":0x3dc, - "Gbreve;":0x11e, "Gcedil;":0x122, - "Gcirc;":0x11c, "Gcy;":0x413, - "Gdot;":0x120, "Gfr;":[0xd835,0xdd0a], - "Gg;":0x22d9, "Gopf;":[0xd835,0xdd3e], - "GreaterEqual;":0x2265, "GreaterEqualLess;":0x22db, - "GreaterFullEqual;":0x2267, "GreaterGreater;":0x2aa2, - "GreaterLess;":0x2277, "GreaterSlantEqual;":0x2a7e, - "GreaterTilde;":0x2273, "Gscr;":[0xd835,0xdca2], - "Gt;":0x226b, "HARDcy;":0x42a, - "Hacek;":0x2c7, "Hat;":0x5e, - "Hcirc;":0x124, "Hfr;":0x210c, - "HilbertSpace;":0x210b, "Hopf;":0x210d, - "HorizontalLine;":0x2500, "Hscr;":0x210b, - "Hstrok;":0x126, "HumpDownHump;":0x224e, - "HumpEqual;":0x224f, "IEcy;":0x415, - "IJlig;":0x132, "IOcy;":0x401, - "Iacute":0xcd, "Iacute;":0xcd, - "Icirc":0xce, "Icirc;":0xce, - "Icy;":0x418, "Idot;":0x130, - "Ifr;":0x2111, "Igrave":0xcc, - "Igrave;":0xcc, "Im;":0x2111, - "Imacr;":0x12a, "ImaginaryI;":0x2148, - "Implies;":0x21d2, "Int;":0x222c, - "Integral;":0x222b, "Intersection;":0x22c2, - "InvisibleComma;":0x2063, "InvisibleTimes;":0x2062, - "Iogon;":0x12e, "Iopf;":[0xd835,0xdd40], - "Iota;":0x399, "Iscr;":0x2110, - "Itilde;":0x128, "Iukcy;":0x406, - "Iuml":0xcf, "Iuml;":0xcf, - "Jcirc;":0x134, "Jcy;":0x419, - "Jfr;":[0xd835,0xdd0d], "Jopf;":[0xd835,0xdd41], - "Jscr;":[0xd835,0xdca5], "Jsercy;":0x408, - "Jukcy;":0x404, "KHcy;":0x425, - "KJcy;":0x40c, "Kappa;":0x39a, - "Kcedil;":0x136, "Kcy;":0x41a, - "Kfr;":[0xd835,0xdd0e], "Kopf;":[0xd835,0xdd42], - "Kscr;":[0xd835,0xdca6], "LJcy;":0x409, - "LT":0x3c, "LT;":0x3c, - "Lacute;":0x139, "Lambda;":0x39b, - "Lang;":0x27ea, "Laplacetrf;":0x2112, - "Larr;":0x219e, "Lcaron;":0x13d, - "Lcedil;":0x13b, "Lcy;":0x41b, - "LeftAngleBracket;":0x27e8, "LeftArrow;":0x2190, - "LeftArrowBar;":0x21e4, "LeftArrowRightArrow;":0x21c6, - "LeftCeiling;":0x2308, "LeftDoubleBracket;":0x27e6, - "LeftDownTeeVector;":0x2961, "LeftDownVector;":0x21c3, - "LeftDownVectorBar;":0x2959, "LeftFloor;":0x230a, - "LeftRightArrow;":0x2194, "LeftRightVector;":0x294e, - "LeftTee;":0x22a3, "LeftTeeArrow;":0x21a4, - "LeftTeeVector;":0x295a, "LeftTriangle;":0x22b2, - "LeftTriangleBar;":0x29cf, "LeftTriangleEqual;":0x22b4, - "LeftUpDownVector;":0x2951, "LeftUpTeeVector;":0x2960, - "LeftUpVector;":0x21bf, "LeftUpVectorBar;":0x2958, - "LeftVector;":0x21bc, "LeftVectorBar;":0x2952, - "Leftarrow;":0x21d0, "Leftrightarrow;":0x21d4, - "LessEqualGreater;":0x22da, "LessFullEqual;":0x2266, - "LessGreater;":0x2276, "LessLess;":0x2aa1, - "LessSlantEqual;":0x2a7d, "LessTilde;":0x2272, - "Lfr;":[0xd835,0xdd0f], "Ll;":0x22d8, - "Lleftarrow;":0x21da, "Lmidot;":0x13f, - "LongLeftArrow;":0x27f5, "LongLeftRightArrow;":0x27f7, - "LongRightArrow;":0x27f6, "Longleftarrow;":0x27f8, - "Longleftrightarrow;":0x27fa, "Longrightarrow;":0x27f9, - "Lopf;":[0xd835,0xdd43], "LowerLeftArrow;":0x2199, - "LowerRightArrow;":0x2198, "Lscr;":0x2112, - "Lsh;":0x21b0, "Lstrok;":0x141, - "Lt;":0x226a, "Map;":0x2905, - "Mcy;":0x41c, "MediumSpace;":0x205f, - "Mellintrf;":0x2133, "Mfr;":[0xd835,0xdd10], - "MinusPlus;":0x2213, "Mopf;":[0xd835,0xdd44], - "Mscr;":0x2133, "Mu;":0x39c, - "NJcy;":0x40a, "Nacute;":0x143, - "Ncaron;":0x147, "Ncedil;":0x145, - "Ncy;":0x41d, "NegativeMediumSpace;":0x200b, - "NegativeThickSpace;":0x200b, "NegativeThinSpace;":0x200b, - "NegativeVeryThinSpace;":0x200b, "NestedGreaterGreater;":0x226b, - "NestedLessLess;":0x226a, "NewLine;":0xa, - "Nfr;":[0xd835,0xdd11], "NoBreak;":0x2060, - "NonBreakingSpace;":0xa0, "Nopf;":0x2115, - "Not;":0x2aec, "NotCongruent;":0x2262, - "NotCupCap;":0x226d, "NotDoubleVerticalBar;":0x2226, - "NotElement;":0x2209, "NotEqual;":0x2260, - "NotEqualTilde;":[0x2242,0x338], "NotExists;":0x2204, - "NotGreater;":0x226f, "NotGreaterEqual;":0x2271, - "NotGreaterFullEqual;":[0x2267,0x338], "NotGreaterGreater;":[0x226b,0x338], - "NotGreaterLess;":0x2279, "NotGreaterSlantEqual;":[0x2a7e,0x338], - "NotGreaterTilde;":0x2275, "NotHumpDownHump;":[0x224e,0x338], - "NotHumpEqual;":[0x224f,0x338], "NotLeftTriangle;":0x22ea, - "NotLeftTriangleBar;":[0x29cf,0x338], "NotLeftTriangleEqual;":0x22ec, - "NotLess;":0x226e, "NotLessEqual;":0x2270, - "NotLessGreater;":0x2278, "NotLessLess;":[0x226a,0x338], - "NotLessSlantEqual;":[0x2a7d,0x338], "NotLessTilde;":0x2274, - "NotNestedGreaterGreater;":[0x2aa2,0x338], "NotNestedLessLess;":[0x2aa1,0x338], - "NotPrecedes;":0x2280, "NotPrecedesEqual;":[0x2aaf,0x338], - "NotPrecedesSlantEqual;":0x22e0, "NotReverseElement;":0x220c, - "NotRightTriangle;":0x22eb, "NotRightTriangleBar;":[0x29d0,0x338], - "NotRightTriangleEqual;":0x22ed, "NotSquareSubset;":[0x228f,0x338], - "NotSquareSubsetEqual;":0x22e2, "NotSquareSuperset;":[0x2290,0x338], - "NotSquareSupersetEqual;":0x22e3, "NotSubset;":[0x2282,0x20d2], - "NotSubsetEqual;":0x2288, "NotSucceeds;":0x2281, - "NotSucceedsEqual;":[0x2ab0,0x338], "NotSucceedsSlantEqual;":0x22e1, - "NotSucceedsTilde;":[0x227f,0x338], "NotSuperset;":[0x2283,0x20d2], - "NotSupersetEqual;":0x2289, "NotTilde;":0x2241, - "NotTildeEqual;":0x2244, "NotTildeFullEqual;":0x2247, - "NotTildeTilde;":0x2249, "NotVerticalBar;":0x2224, - "Nscr;":[0xd835,0xdca9], "Ntilde":0xd1, - "Ntilde;":0xd1, "Nu;":0x39d, - "OElig;":0x152, "Oacute":0xd3, - "Oacute;":0xd3, "Ocirc":0xd4, - "Ocirc;":0xd4, "Ocy;":0x41e, - "Odblac;":0x150, "Ofr;":[0xd835,0xdd12], - "Ograve":0xd2, "Ograve;":0xd2, - "Omacr;":0x14c, "Omega;":0x3a9, - "Omicron;":0x39f, "Oopf;":[0xd835,0xdd46], - "OpenCurlyDoubleQuote;":0x201c, "OpenCurlyQuote;":0x2018, - "Or;":0x2a54, "Oscr;":[0xd835,0xdcaa], - "Oslash":0xd8, "Oslash;":0xd8, - "Otilde":0xd5, "Otilde;":0xd5, - "Otimes;":0x2a37, "Ouml":0xd6, - "Ouml;":0xd6, "OverBar;":0x203e, - "OverBrace;":0x23de, "OverBracket;":0x23b4, - "OverParenthesis;":0x23dc, "PartialD;":0x2202, - "Pcy;":0x41f, "Pfr;":[0xd835,0xdd13], - "Phi;":0x3a6, "Pi;":0x3a0, - "PlusMinus;":0xb1, "Poincareplane;":0x210c, - "Popf;":0x2119, "Pr;":0x2abb, - "Precedes;":0x227a, "PrecedesEqual;":0x2aaf, - "PrecedesSlantEqual;":0x227c, "PrecedesTilde;":0x227e, - "Prime;":0x2033, "Product;":0x220f, - "Proportion;":0x2237, "Proportional;":0x221d, - "Pscr;":[0xd835,0xdcab], "Psi;":0x3a8, - "QUOT":0x22, "QUOT;":0x22, - "Qfr;":[0xd835,0xdd14], "Qopf;":0x211a, - "Qscr;":[0xd835,0xdcac], "RBarr;":0x2910, - "REG":0xae, "REG;":0xae, - "Racute;":0x154, "Rang;":0x27eb, - "Rarr;":0x21a0, "Rarrtl;":0x2916, - "Rcaron;":0x158, "Rcedil;":0x156, - "Rcy;":0x420, "Re;":0x211c, - "ReverseElement;":0x220b, "ReverseEquilibrium;":0x21cb, - "ReverseUpEquilibrium;":0x296f, "Rfr;":0x211c, - "Rho;":0x3a1, "RightAngleBracket;":0x27e9, - "RightArrow;":0x2192, "RightArrowBar;":0x21e5, - "RightArrowLeftArrow;":0x21c4, "RightCeiling;":0x2309, - "RightDoubleBracket;":0x27e7, "RightDownTeeVector;":0x295d, - "RightDownVector;":0x21c2, "RightDownVectorBar;":0x2955, - "RightFloor;":0x230b, "RightTee;":0x22a2, - "RightTeeArrow;":0x21a6, "RightTeeVector;":0x295b, - "RightTriangle;":0x22b3, "RightTriangleBar;":0x29d0, - "RightTriangleEqual;":0x22b5, "RightUpDownVector;":0x294f, - "RightUpTeeVector;":0x295c, "RightUpVector;":0x21be, - "RightUpVectorBar;":0x2954, "RightVector;":0x21c0, - "RightVectorBar;":0x2953, "Rightarrow;":0x21d2, - "Ropf;":0x211d, "RoundImplies;":0x2970, - "Rrightarrow;":0x21db, "Rscr;":0x211b, - "Rsh;":0x21b1, "RuleDelayed;":0x29f4, - "SHCHcy;":0x429, "SHcy;":0x428, - "SOFTcy;":0x42c, "Sacute;":0x15a, - "Sc;":0x2abc, "Scaron;":0x160, - "Scedil;":0x15e, "Scirc;":0x15c, - "Scy;":0x421, "Sfr;":[0xd835,0xdd16], - "ShortDownArrow;":0x2193, "ShortLeftArrow;":0x2190, - "ShortRightArrow;":0x2192, "ShortUpArrow;":0x2191, - "Sigma;":0x3a3, "SmallCircle;":0x2218, - "Sopf;":[0xd835,0xdd4a], "Sqrt;":0x221a, - "Square;":0x25a1, "SquareIntersection;":0x2293, - "SquareSubset;":0x228f, "SquareSubsetEqual;":0x2291, - "SquareSuperset;":0x2290, "SquareSupersetEqual;":0x2292, - "SquareUnion;":0x2294, "Sscr;":[0xd835,0xdcae], - "Star;":0x22c6, "Sub;":0x22d0, - "Subset;":0x22d0, "SubsetEqual;":0x2286, - "Succeeds;":0x227b, "SucceedsEqual;":0x2ab0, - "SucceedsSlantEqual;":0x227d, "SucceedsTilde;":0x227f, - "SuchThat;":0x220b, "Sum;":0x2211, - "Sup;":0x22d1, "Superset;":0x2283, - "SupersetEqual;":0x2287, "Supset;":0x22d1, - "THORN":0xde, "THORN;":0xde, - "TRADE;":0x2122, "TSHcy;":0x40b, - "TScy;":0x426, "Tab;":0x9, - "Tau;":0x3a4, "Tcaron;":0x164, - "Tcedil;":0x162, "Tcy;":0x422, - "Tfr;":[0xd835,0xdd17], "Therefore;":0x2234, - "Theta;":0x398, "ThickSpace;":[0x205f,0x200a], - "ThinSpace;":0x2009, "Tilde;":0x223c, - "TildeEqual;":0x2243, "TildeFullEqual;":0x2245, - "TildeTilde;":0x2248, "Topf;":[0xd835,0xdd4b], - "TripleDot;":0x20db, "Tscr;":[0xd835,0xdcaf], - "Tstrok;":0x166, "Uacute":0xda, - "Uacute;":0xda, "Uarr;":0x219f, - "Uarrocir;":0x2949, "Ubrcy;":0x40e, - "Ubreve;":0x16c, "Ucirc":0xdb, - "Ucirc;":0xdb, "Ucy;":0x423, - "Udblac;":0x170, "Ufr;":[0xd835,0xdd18], - "Ugrave":0xd9, "Ugrave;":0xd9, - "Umacr;":0x16a, "UnderBar;":0x5f, - "UnderBrace;":0x23df, "UnderBracket;":0x23b5, - "UnderParenthesis;":0x23dd, "Union;":0x22c3, - "UnionPlus;":0x228e, "Uogon;":0x172, - "Uopf;":[0xd835,0xdd4c], "UpArrow;":0x2191, - "UpArrowBar;":0x2912, "UpArrowDownArrow;":0x21c5, - "UpDownArrow;":0x2195, "UpEquilibrium;":0x296e, - "UpTee;":0x22a5, "UpTeeArrow;":0x21a5, - "Uparrow;":0x21d1, "Updownarrow;":0x21d5, - "UpperLeftArrow;":0x2196, "UpperRightArrow;":0x2197, - "Upsi;":0x3d2, "Upsilon;":0x3a5, - "Uring;":0x16e, "Uscr;":[0xd835,0xdcb0], - "Utilde;":0x168, "Uuml":0xdc, - "Uuml;":0xdc, "VDash;":0x22ab, - "Vbar;":0x2aeb, "Vcy;":0x412, - "Vdash;":0x22a9, "Vdashl;":0x2ae6, - "Vee;":0x22c1, "Verbar;":0x2016, - "Vert;":0x2016, "VerticalBar;":0x2223, - "VerticalLine;":0x7c, "VerticalSeparator;":0x2758, - "VerticalTilde;":0x2240, "VeryThinSpace;":0x200a, - "Vfr;":[0xd835,0xdd19], "Vopf;":[0xd835,0xdd4d], - "Vscr;":[0xd835,0xdcb1], "Vvdash;":0x22aa, - "Wcirc;":0x174, "Wedge;":0x22c0, - "Wfr;":[0xd835,0xdd1a], "Wopf;":[0xd835,0xdd4e], - "Wscr;":[0xd835,0xdcb2], "Xfr;":[0xd835,0xdd1b], - "Xi;":0x39e, "Xopf;":[0xd835,0xdd4f], - "Xscr;":[0xd835,0xdcb3], "YAcy;":0x42f, - "YIcy;":0x407, "YUcy;":0x42e, - "Yacute":0xdd, "Yacute;":0xdd, - "Ycirc;":0x176, "Ycy;":0x42b, - "Yfr;":[0xd835,0xdd1c], "Yopf;":[0xd835,0xdd50], - "Yscr;":[0xd835,0xdcb4], "Yuml;":0x178, - "ZHcy;":0x416, "Zacute;":0x179, - "Zcaron;":0x17d, "Zcy;":0x417, - "Zdot;":0x17b, "ZeroWidthSpace;":0x200b, - "Zeta;":0x396, "Zfr;":0x2128, - "Zopf;":0x2124, "Zscr;":[0xd835,0xdcb5], - "aacute":0xe1, "aacute;":0xe1, - "abreve;":0x103, "ac;":0x223e, - "acE;":[0x223e,0x333], "acd;":0x223f, - "acirc":0xe2, "acirc;":0xe2, - "acute":0xb4, "acute;":0xb4, - "acy;":0x430, "aelig":0xe6, - "aelig;":0xe6, "af;":0x2061, - "afr;":[0xd835,0xdd1e], "agrave":0xe0, - "agrave;":0xe0, "alefsym;":0x2135, - "aleph;":0x2135, "alpha;":0x3b1, - "amacr;":0x101, "amalg;":0x2a3f, - "amp":0x26, "amp;":0x26, - "and;":0x2227, "andand;":0x2a55, - "andd;":0x2a5c, "andslope;":0x2a58, - "andv;":0x2a5a, "ang;":0x2220, - "ange;":0x29a4, "angle;":0x2220, - "angmsd;":0x2221, "angmsdaa;":0x29a8, - "angmsdab;":0x29a9, "angmsdac;":0x29aa, - "angmsdad;":0x29ab, "angmsdae;":0x29ac, - "angmsdaf;":0x29ad, "angmsdag;":0x29ae, - "angmsdah;":0x29af, "angrt;":0x221f, - "angrtvb;":0x22be, "angrtvbd;":0x299d, - "angsph;":0x2222, "angst;":0xc5, - "angzarr;":0x237c, "aogon;":0x105, - "aopf;":[0xd835,0xdd52], "ap;":0x2248, - "apE;":0x2a70, "apacir;":0x2a6f, - "ape;":0x224a, "apid;":0x224b, - "apos;":0x27, "approx;":0x2248, - "approxeq;":0x224a, "aring":0xe5, - "aring;":0xe5, "ascr;":[0xd835,0xdcb6], - "ast;":0x2a, "asymp;":0x2248, - "asympeq;":0x224d, "atilde":0xe3, - "atilde;":0xe3, "auml":0xe4, - "auml;":0xe4, "awconint;":0x2233, - "awint;":0x2a11, "bNot;":0x2aed, - "backcong;":0x224c, "backepsilon;":0x3f6, - "backprime;":0x2035, "backsim;":0x223d, - "backsimeq;":0x22cd, "barvee;":0x22bd, - "barwed;":0x2305, "barwedge;":0x2305, - "bbrk;":0x23b5, "bbrktbrk;":0x23b6, - "bcong;":0x224c, "bcy;":0x431, - "bdquo;":0x201e, "becaus;":0x2235, - "because;":0x2235, "bemptyv;":0x29b0, - "bepsi;":0x3f6, "bernou;":0x212c, - "beta;":0x3b2, "beth;":0x2136, - "between;":0x226c, "bfr;":[0xd835,0xdd1f], - "bigcap;":0x22c2, "bigcirc;":0x25ef, - "bigcup;":0x22c3, "bigodot;":0x2a00, - "bigoplus;":0x2a01, "bigotimes;":0x2a02, - "bigsqcup;":0x2a06, "bigstar;":0x2605, - "bigtriangledown;":0x25bd, "bigtriangleup;":0x25b3, - "biguplus;":0x2a04, "bigvee;":0x22c1, - "bigwedge;":0x22c0, "bkarow;":0x290d, - "blacklozenge;":0x29eb, "blacksquare;":0x25aa, - "blacktriangle;":0x25b4, "blacktriangledown;":0x25be, - "blacktriangleleft;":0x25c2, "blacktriangleright;":0x25b8, - "blank;":0x2423, "blk12;":0x2592, - "blk14;":0x2591, "blk34;":0x2593, - "block;":0x2588, "bne;":[0x3d,0x20e5], - "bnequiv;":[0x2261,0x20e5], "bnot;":0x2310, - "bopf;":[0xd835,0xdd53], "bot;":0x22a5, - "bottom;":0x22a5, "bowtie;":0x22c8, - "boxDL;":0x2557, "boxDR;":0x2554, - "boxDl;":0x2556, "boxDr;":0x2553, - "boxH;":0x2550, "boxHD;":0x2566, - "boxHU;":0x2569, "boxHd;":0x2564, - "boxHu;":0x2567, "boxUL;":0x255d, - "boxUR;":0x255a, "boxUl;":0x255c, - "boxUr;":0x2559, "boxV;":0x2551, - "boxVH;":0x256c, "boxVL;":0x2563, - "boxVR;":0x2560, "boxVh;":0x256b, - "boxVl;":0x2562, "boxVr;":0x255f, - "boxbox;":0x29c9, "boxdL;":0x2555, - "boxdR;":0x2552, "boxdl;":0x2510, - "boxdr;":0x250c, "boxh;":0x2500, - "boxhD;":0x2565, "boxhU;":0x2568, - "boxhd;":0x252c, "boxhu;":0x2534, - "boxminus;":0x229f, "boxplus;":0x229e, - "boxtimes;":0x22a0, "boxuL;":0x255b, - "boxuR;":0x2558, "boxul;":0x2518, - "boxur;":0x2514, "boxv;":0x2502, - "boxvH;":0x256a, "boxvL;":0x2561, - "boxvR;":0x255e, "boxvh;":0x253c, - "boxvl;":0x2524, "boxvr;":0x251c, - "bprime;":0x2035, "breve;":0x2d8, - "brvbar":0xa6, "brvbar;":0xa6, - "bscr;":[0xd835,0xdcb7], "bsemi;":0x204f, - "bsim;":0x223d, "bsime;":0x22cd, - "bsol;":0x5c, "bsolb;":0x29c5, - "bsolhsub;":0x27c8, "bull;":0x2022, - "bullet;":0x2022, "bump;":0x224e, - "bumpE;":0x2aae, "bumpe;":0x224f, - "bumpeq;":0x224f, "cacute;":0x107, - "cap;":0x2229, "capand;":0x2a44, - "capbrcup;":0x2a49, "capcap;":0x2a4b, - "capcup;":0x2a47, "capdot;":0x2a40, - "caps;":[0x2229,0xfe00], "caret;":0x2041, - "caron;":0x2c7, "ccaps;":0x2a4d, - "ccaron;":0x10d, "ccedil":0xe7, - "ccedil;":0xe7, "ccirc;":0x109, - "ccups;":0x2a4c, "ccupssm;":0x2a50, - "cdot;":0x10b, "cedil":0xb8, - "cedil;":0xb8, "cemptyv;":0x29b2, - "cent":0xa2, "cent;":0xa2, - "centerdot;":0xb7, "cfr;":[0xd835,0xdd20], - "chcy;":0x447, "check;":0x2713, - "checkmark;":0x2713, "chi;":0x3c7, - "cir;":0x25cb, "cirE;":0x29c3, - "circ;":0x2c6, "circeq;":0x2257, - "circlearrowleft;":0x21ba, "circlearrowright;":0x21bb, - "circledR;":0xae, "circledS;":0x24c8, - "circledast;":0x229b, "circledcirc;":0x229a, - "circleddash;":0x229d, "cire;":0x2257, - "cirfnint;":0x2a10, "cirmid;":0x2aef, - "cirscir;":0x29c2, "clubs;":0x2663, - "clubsuit;":0x2663, "colon;":0x3a, - "colone;":0x2254, "coloneq;":0x2254, - "comma;":0x2c, "commat;":0x40, - "comp;":0x2201, "compfn;":0x2218, - "complement;":0x2201, "complexes;":0x2102, - "cong;":0x2245, "congdot;":0x2a6d, - "conint;":0x222e, "copf;":[0xd835,0xdd54], - "coprod;":0x2210, "copy":0xa9, - "copy;":0xa9, "copysr;":0x2117, - "crarr;":0x21b5, "cross;":0x2717, - "cscr;":[0xd835,0xdcb8], "csub;":0x2acf, - "csube;":0x2ad1, "csup;":0x2ad0, - "csupe;":0x2ad2, "ctdot;":0x22ef, - "cudarrl;":0x2938, "cudarrr;":0x2935, - "cuepr;":0x22de, "cuesc;":0x22df, - "cularr;":0x21b6, "cularrp;":0x293d, - "cup;":0x222a, "cupbrcap;":0x2a48, - "cupcap;":0x2a46, "cupcup;":0x2a4a, - "cupdot;":0x228d, "cupor;":0x2a45, - "cups;":[0x222a,0xfe00], "curarr;":0x21b7, - "curarrm;":0x293c, "curlyeqprec;":0x22de, - "curlyeqsucc;":0x22df, "curlyvee;":0x22ce, - "curlywedge;":0x22cf, "curren":0xa4, - "curren;":0xa4, "curvearrowleft;":0x21b6, - "curvearrowright;":0x21b7, "cuvee;":0x22ce, - "cuwed;":0x22cf, "cwconint;":0x2232, - "cwint;":0x2231, "cylcty;":0x232d, - "dArr;":0x21d3, "dHar;":0x2965, - "dagger;":0x2020, "daleth;":0x2138, - "darr;":0x2193, "dash;":0x2010, - "dashv;":0x22a3, "dbkarow;":0x290f, - "dblac;":0x2dd, "dcaron;":0x10f, - "dcy;":0x434, "dd;":0x2146, - "ddagger;":0x2021, "ddarr;":0x21ca, - "ddotseq;":0x2a77, "deg":0xb0, - "deg;":0xb0, "delta;":0x3b4, - "demptyv;":0x29b1, "dfisht;":0x297f, - "dfr;":[0xd835,0xdd21], "dharl;":0x21c3, - "dharr;":0x21c2, "diam;":0x22c4, - "diamond;":0x22c4, "diamondsuit;":0x2666, - "diams;":0x2666, "die;":0xa8, - "digamma;":0x3dd, "disin;":0x22f2, - "div;":0xf7, "divide":0xf7, - "divide;":0xf7, "divideontimes;":0x22c7, - "divonx;":0x22c7, "djcy;":0x452, - "dlcorn;":0x231e, "dlcrop;":0x230d, - "dollar;":0x24, "dopf;":[0xd835,0xdd55], - "dot;":0x2d9, "doteq;":0x2250, - "doteqdot;":0x2251, "dotminus;":0x2238, - "dotplus;":0x2214, "dotsquare;":0x22a1, - "doublebarwedge;":0x2306, "downarrow;":0x2193, - "downdownarrows;":0x21ca, "downharpoonleft;":0x21c3, - "downharpoonright;":0x21c2, "drbkarow;":0x2910, - "drcorn;":0x231f, "drcrop;":0x230c, - "dscr;":[0xd835,0xdcb9], "dscy;":0x455, - "dsol;":0x29f6, "dstrok;":0x111, - "dtdot;":0x22f1, "dtri;":0x25bf, - "dtrif;":0x25be, "duarr;":0x21f5, - "duhar;":0x296f, "dwangle;":0x29a6, - "dzcy;":0x45f, "dzigrarr;":0x27ff, - "eDDot;":0x2a77, "eDot;":0x2251, - "eacute":0xe9, "eacute;":0xe9, - "easter;":0x2a6e, "ecaron;":0x11b, - "ecir;":0x2256, "ecirc":0xea, - "ecirc;":0xea, "ecolon;":0x2255, - "ecy;":0x44d, "edot;":0x117, - "ee;":0x2147, "efDot;":0x2252, - "efr;":[0xd835,0xdd22], "eg;":0x2a9a, - "egrave":0xe8, "egrave;":0xe8, - "egs;":0x2a96, "egsdot;":0x2a98, - "el;":0x2a99, "elinters;":0x23e7, - "ell;":0x2113, "els;":0x2a95, - "elsdot;":0x2a97, "emacr;":0x113, - "empty;":0x2205, "emptyset;":0x2205, - "emptyv;":0x2205, "emsp13;":0x2004, - "emsp14;":0x2005, "emsp;":0x2003, - "eng;":0x14b, "ensp;":0x2002, - "eogon;":0x119, "eopf;":[0xd835,0xdd56], - "epar;":0x22d5, "eparsl;":0x29e3, - "eplus;":0x2a71, "epsi;":0x3b5, - "epsilon;":0x3b5, "epsiv;":0x3f5, - "eqcirc;":0x2256, "eqcolon;":0x2255, - "eqsim;":0x2242, "eqslantgtr;":0x2a96, - "eqslantless;":0x2a95, "equals;":0x3d, - "equest;":0x225f, "equiv;":0x2261, - "equivDD;":0x2a78, "eqvparsl;":0x29e5, - "erDot;":0x2253, "erarr;":0x2971, - "escr;":0x212f, "esdot;":0x2250, - "esim;":0x2242, "eta;":0x3b7, - "eth":0xf0, "eth;":0xf0, - "euml":0xeb, "euml;":0xeb, - "euro;":0x20ac, "excl;":0x21, - "exist;":0x2203, "expectation;":0x2130, - "exponentiale;":0x2147, "fallingdotseq;":0x2252, - "fcy;":0x444, "female;":0x2640, - "ffilig;":0xfb03, "fflig;":0xfb00, - "ffllig;":0xfb04, "ffr;":[0xd835,0xdd23], - "filig;":0xfb01, "fjlig;":[0x66,0x6a], - "flat;":0x266d, "fllig;":0xfb02, - "fltns;":0x25b1, "fnof;":0x192, - "fopf;":[0xd835,0xdd57], "forall;":0x2200, - "fork;":0x22d4, "forkv;":0x2ad9, - "fpartint;":0x2a0d, "frac12":0xbd, - "frac12;":0xbd, "frac13;":0x2153, - "frac14":0xbc, "frac14;":0xbc, - "frac15;":0x2155, "frac16;":0x2159, - "frac18;":0x215b, "frac23;":0x2154, - "frac25;":0x2156, "frac34":0xbe, - "frac34;":0xbe, "frac35;":0x2157, - "frac38;":0x215c, "frac45;":0x2158, - "frac56;":0x215a, "frac58;":0x215d, - "frac78;":0x215e, "frasl;":0x2044, - "frown;":0x2322, "fscr;":[0xd835,0xdcbb], - "gE;":0x2267, "gEl;":0x2a8c, - "gacute;":0x1f5, "gamma;":0x3b3, - "gammad;":0x3dd, "gap;":0x2a86, - "gbreve;":0x11f, "gcirc;":0x11d, - "gcy;":0x433, "gdot;":0x121, - "ge;":0x2265, "gel;":0x22db, - "geq;":0x2265, "geqq;":0x2267, - "geqslant;":0x2a7e, "ges;":0x2a7e, - "gescc;":0x2aa9, "gesdot;":0x2a80, - "gesdoto;":0x2a82, "gesdotol;":0x2a84, - "gesl;":[0x22db,0xfe00], "gesles;":0x2a94, - "gfr;":[0xd835,0xdd24], "gg;":0x226b, - "ggg;":0x22d9, "gimel;":0x2137, - "gjcy;":0x453, "gl;":0x2277, - "glE;":0x2a92, "gla;":0x2aa5, - "glj;":0x2aa4, "gnE;":0x2269, - "gnap;":0x2a8a, "gnapprox;":0x2a8a, - "gne;":0x2a88, "gneq;":0x2a88, - "gneqq;":0x2269, "gnsim;":0x22e7, - "gopf;":[0xd835,0xdd58], "grave;":0x60, - "gscr;":0x210a, "gsim;":0x2273, - "gsime;":0x2a8e, "gsiml;":0x2a90, - "gt":0x3e, "gt;":0x3e, - "gtcc;":0x2aa7, "gtcir;":0x2a7a, - "gtdot;":0x22d7, "gtlPar;":0x2995, - "gtquest;":0x2a7c, "gtrapprox;":0x2a86, - "gtrarr;":0x2978, "gtrdot;":0x22d7, - "gtreqless;":0x22db, "gtreqqless;":0x2a8c, - "gtrless;":0x2277, "gtrsim;":0x2273, - "gvertneqq;":[0x2269,0xfe00], "gvnE;":[0x2269,0xfe00], - "hArr;":0x21d4, "hairsp;":0x200a, - "half;":0xbd, "hamilt;":0x210b, - "hardcy;":0x44a, "harr;":0x2194, - "harrcir;":0x2948, "harrw;":0x21ad, - "hbar;":0x210f, "hcirc;":0x125, - "hearts;":0x2665, "heartsuit;":0x2665, - "hellip;":0x2026, "hercon;":0x22b9, - "hfr;":[0xd835,0xdd25], "hksearow;":0x2925, - "hkswarow;":0x2926, "hoarr;":0x21ff, - "homtht;":0x223b, "hookleftarrow;":0x21a9, - "hookrightarrow;":0x21aa, "hopf;":[0xd835,0xdd59], - "horbar;":0x2015, "hscr;":[0xd835,0xdcbd], - "hslash;":0x210f, "hstrok;":0x127, - "hybull;":0x2043, "hyphen;":0x2010, - "iacute":0xed, "iacute;":0xed, - "ic;":0x2063, "icirc":0xee, - "icirc;":0xee, "icy;":0x438, - "iecy;":0x435, "iexcl":0xa1, - "iexcl;":0xa1, "iff;":0x21d4, - "ifr;":[0xd835,0xdd26], "igrave":0xec, - "igrave;":0xec, "ii;":0x2148, - "iiiint;":0x2a0c, "iiint;":0x222d, - "iinfin;":0x29dc, "iiota;":0x2129, - "ijlig;":0x133, "imacr;":0x12b, - "image;":0x2111, "imagline;":0x2110, - "imagpart;":0x2111, "imath;":0x131, - "imof;":0x22b7, "imped;":0x1b5, - "in;":0x2208, "incare;":0x2105, - "infin;":0x221e, "infintie;":0x29dd, - "inodot;":0x131, "int;":0x222b, - "intcal;":0x22ba, "integers;":0x2124, - "intercal;":0x22ba, "intlarhk;":0x2a17, - "intprod;":0x2a3c, "iocy;":0x451, - "iogon;":0x12f, "iopf;":[0xd835,0xdd5a], - "iota;":0x3b9, "iprod;":0x2a3c, - "iquest":0xbf, "iquest;":0xbf, - "iscr;":[0xd835,0xdcbe], "isin;":0x2208, - "isinE;":0x22f9, "isindot;":0x22f5, - "isins;":0x22f4, "isinsv;":0x22f3, - "isinv;":0x2208, "it;":0x2062, - "itilde;":0x129, "iukcy;":0x456, - "iuml":0xef, "iuml;":0xef, - "jcirc;":0x135, "jcy;":0x439, - "jfr;":[0xd835,0xdd27], "jmath;":0x237, - "jopf;":[0xd835,0xdd5b], "jscr;":[0xd835,0xdcbf], - "jsercy;":0x458, "jukcy;":0x454, - "kappa;":0x3ba, "kappav;":0x3f0, - "kcedil;":0x137, "kcy;":0x43a, - "kfr;":[0xd835,0xdd28], "kgreen;":0x138, - "khcy;":0x445, "kjcy;":0x45c, - "kopf;":[0xd835,0xdd5c], "kscr;":[0xd835,0xdcc0], - "lAarr;":0x21da, "lArr;":0x21d0, - "lAtail;":0x291b, "lBarr;":0x290e, - "lE;":0x2266, "lEg;":0x2a8b, - "lHar;":0x2962, "lacute;":0x13a, - "laemptyv;":0x29b4, "lagran;":0x2112, - "lambda;":0x3bb, "lang;":0x27e8, - "langd;":0x2991, "langle;":0x27e8, - "lap;":0x2a85, "laquo":0xab, - "laquo;":0xab, "larr;":0x2190, - "larrb;":0x21e4, "larrbfs;":0x291f, - "larrfs;":0x291d, "larrhk;":0x21a9, - "larrlp;":0x21ab, "larrpl;":0x2939, - "larrsim;":0x2973, "larrtl;":0x21a2, - "lat;":0x2aab, "latail;":0x2919, - "late;":0x2aad, "lates;":[0x2aad,0xfe00], - "lbarr;":0x290c, "lbbrk;":0x2772, - "lbrace;":0x7b, "lbrack;":0x5b, - "lbrke;":0x298b, "lbrksld;":0x298f, - "lbrkslu;":0x298d, "lcaron;":0x13e, - "lcedil;":0x13c, "lceil;":0x2308, - "lcub;":0x7b, "lcy;":0x43b, - "ldca;":0x2936, "ldquo;":0x201c, - "ldquor;":0x201e, "ldrdhar;":0x2967, - "ldrushar;":0x294b, "ldsh;":0x21b2, - "le;":0x2264, "leftarrow;":0x2190, - "leftarrowtail;":0x21a2, "leftharpoondown;":0x21bd, - "leftharpoonup;":0x21bc, "leftleftarrows;":0x21c7, - "leftrightarrow;":0x2194, "leftrightarrows;":0x21c6, - "leftrightharpoons;":0x21cb, "leftrightsquigarrow;":0x21ad, - "leftthreetimes;":0x22cb, "leg;":0x22da, - "leq;":0x2264, "leqq;":0x2266, - "leqslant;":0x2a7d, "les;":0x2a7d, - "lescc;":0x2aa8, "lesdot;":0x2a7f, - "lesdoto;":0x2a81, "lesdotor;":0x2a83, - "lesg;":[0x22da,0xfe00], "lesges;":0x2a93, - "lessapprox;":0x2a85, "lessdot;":0x22d6, - "lesseqgtr;":0x22da, "lesseqqgtr;":0x2a8b, - "lessgtr;":0x2276, "lesssim;":0x2272, - "lfisht;":0x297c, "lfloor;":0x230a, - "lfr;":[0xd835,0xdd29], "lg;":0x2276, - "lgE;":0x2a91, "lhard;":0x21bd, - "lharu;":0x21bc, "lharul;":0x296a, - "lhblk;":0x2584, "ljcy;":0x459, - "ll;":0x226a, "llarr;":0x21c7, - "llcorner;":0x231e, "llhard;":0x296b, - "lltri;":0x25fa, "lmidot;":0x140, - "lmoust;":0x23b0, "lmoustache;":0x23b0, - "lnE;":0x2268, "lnap;":0x2a89, - "lnapprox;":0x2a89, "lne;":0x2a87, - "lneq;":0x2a87, "lneqq;":0x2268, - "lnsim;":0x22e6, "loang;":0x27ec, - "loarr;":0x21fd, "lobrk;":0x27e6, - "longleftarrow;":0x27f5, "longleftrightarrow;":0x27f7, - "longmapsto;":0x27fc, "longrightarrow;":0x27f6, - "looparrowleft;":0x21ab, "looparrowright;":0x21ac, - "lopar;":0x2985, "lopf;":[0xd835,0xdd5d], - "loplus;":0x2a2d, "lotimes;":0x2a34, - "lowast;":0x2217, "lowbar;":0x5f, - "loz;":0x25ca, "lozenge;":0x25ca, - "lozf;":0x29eb, "lpar;":0x28, - "lparlt;":0x2993, "lrarr;":0x21c6, - "lrcorner;":0x231f, "lrhar;":0x21cb, - "lrhard;":0x296d, "lrm;":0x200e, - "lrtri;":0x22bf, "lsaquo;":0x2039, - "lscr;":[0xd835,0xdcc1], "lsh;":0x21b0, - "lsim;":0x2272, "lsime;":0x2a8d, - "lsimg;":0x2a8f, "lsqb;":0x5b, - "lsquo;":0x2018, "lsquor;":0x201a, - "lstrok;":0x142, "lt":0x3c, - "lt;":0x3c, "ltcc;":0x2aa6, - "ltcir;":0x2a79, "ltdot;":0x22d6, - "lthree;":0x22cb, "ltimes;":0x22c9, - "ltlarr;":0x2976, "ltquest;":0x2a7b, - "ltrPar;":0x2996, "ltri;":0x25c3, - "ltrie;":0x22b4, "ltrif;":0x25c2, - "lurdshar;":0x294a, "luruhar;":0x2966, - "lvertneqq;":[0x2268,0xfe00], "lvnE;":[0x2268,0xfe00], - "mDDot;":0x223a, "macr":0xaf, - "macr;":0xaf, "male;":0x2642, - "malt;":0x2720, "maltese;":0x2720, - "map;":0x21a6, "mapsto;":0x21a6, - "mapstodown;":0x21a7, "mapstoleft;":0x21a4, - "mapstoup;":0x21a5, "marker;":0x25ae, - "mcomma;":0x2a29, "mcy;":0x43c, - "mdash;":0x2014, "measuredangle;":0x2221, - "mfr;":[0xd835,0xdd2a], "mho;":0x2127, - "micro":0xb5, "micro;":0xb5, - "mid;":0x2223, "midast;":0x2a, - "midcir;":0x2af0, "middot":0xb7, - "middot;":0xb7, "minus;":0x2212, - "minusb;":0x229f, "minusd;":0x2238, - "minusdu;":0x2a2a, "mlcp;":0x2adb, - "mldr;":0x2026, "mnplus;":0x2213, - "models;":0x22a7, "mopf;":[0xd835,0xdd5e], - "mp;":0x2213, "mscr;":[0xd835,0xdcc2], - "mstpos;":0x223e, "mu;":0x3bc, - "multimap;":0x22b8, "mumap;":0x22b8, - "nGg;":[0x22d9,0x338], "nGt;":[0x226b,0x20d2], - "nGtv;":[0x226b,0x338], "nLeftarrow;":0x21cd, - "nLeftrightarrow;":0x21ce, "nLl;":[0x22d8,0x338], - "nLt;":[0x226a,0x20d2], "nLtv;":[0x226a,0x338], - "nRightarrow;":0x21cf, "nVDash;":0x22af, - "nVdash;":0x22ae, "nabla;":0x2207, - "nacute;":0x144, "nang;":[0x2220,0x20d2], - "nap;":0x2249, "napE;":[0x2a70,0x338], - "napid;":[0x224b,0x338], "napos;":0x149, - "napprox;":0x2249, "natur;":0x266e, - "natural;":0x266e, "naturals;":0x2115, - "nbsp":0xa0, "nbsp;":0xa0, - "nbump;":[0x224e,0x338], "nbumpe;":[0x224f,0x338], - "ncap;":0x2a43, "ncaron;":0x148, - "ncedil;":0x146, "ncong;":0x2247, - "ncongdot;":[0x2a6d,0x338], "ncup;":0x2a42, - "ncy;":0x43d, "ndash;":0x2013, - "ne;":0x2260, "neArr;":0x21d7, - "nearhk;":0x2924, "nearr;":0x2197, - "nearrow;":0x2197, "nedot;":[0x2250,0x338], - "nequiv;":0x2262, "nesear;":0x2928, - "nesim;":[0x2242,0x338], "nexist;":0x2204, - "nexists;":0x2204, "nfr;":[0xd835,0xdd2b], - "ngE;":[0x2267,0x338], "nge;":0x2271, - "ngeq;":0x2271, "ngeqq;":[0x2267,0x338], - "ngeqslant;":[0x2a7e,0x338], "nges;":[0x2a7e,0x338], - "ngsim;":0x2275, "ngt;":0x226f, - "ngtr;":0x226f, "nhArr;":0x21ce, - "nharr;":0x21ae, "nhpar;":0x2af2, - "ni;":0x220b, "nis;":0x22fc, - "nisd;":0x22fa, "niv;":0x220b, - "njcy;":0x45a, "nlArr;":0x21cd, - "nlE;":[0x2266,0x338], "nlarr;":0x219a, - "nldr;":0x2025, "nle;":0x2270, - "nleftarrow;":0x219a, "nleftrightarrow;":0x21ae, - "nleq;":0x2270, "nleqq;":[0x2266,0x338], - "nleqslant;":[0x2a7d,0x338], "nles;":[0x2a7d,0x338], - "nless;":0x226e, "nlsim;":0x2274, - "nlt;":0x226e, "nltri;":0x22ea, - "nltrie;":0x22ec, "nmid;":0x2224, - "nopf;":[0xd835,0xdd5f], "not":0xac, - "not;":0xac, "notin;":0x2209, - "notinE;":[0x22f9,0x338], "notindot;":[0x22f5,0x338], - "notinva;":0x2209, "notinvb;":0x22f7, - "notinvc;":0x22f6, "notni;":0x220c, - "notniva;":0x220c, "notnivb;":0x22fe, - "notnivc;":0x22fd, "npar;":0x2226, - "nparallel;":0x2226, "nparsl;":[0x2afd,0x20e5], - "npart;":[0x2202,0x338], "npolint;":0x2a14, - "npr;":0x2280, "nprcue;":0x22e0, - "npre;":[0x2aaf,0x338], "nprec;":0x2280, - "npreceq;":[0x2aaf,0x338], "nrArr;":0x21cf, - "nrarr;":0x219b, "nrarrc;":[0x2933,0x338], - "nrarrw;":[0x219d,0x338], "nrightarrow;":0x219b, - "nrtri;":0x22eb, "nrtrie;":0x22ed, - "nsc;":0x2281, "nsccue;":0x22e1, - "nsce;":[0x2ab0,0x338], "nscr;":[0xd835,0xdcc3], - "nshortmid;":0x2224, "nshortparallel;":0x2226, - "nsim;":0x2241, "nsime;":0x2244, - "nsimeq;":0x2244, "nsmid;":0x2224, - "nspar;":0x2226, "nsqsube;":0x22e2, - "nsqsupe;":0x22e3, "nsub;":0x2284, - "nsubE;":[0x2ac5,0x338], "nsube;":0x2288, - "nsubset;":[0x2282,0x20d2], "nsubseteq;":0x2288, - "nsubseteqq;":[0x2ac5,0x338], "nsucc;":0x2281, - "nsucceq;":[0x2ab0,0x338], "nsup;":0x2285, - "nsupE;":[0x2ac6,0x338], "nsupe;":0x2289, - "nsupset;":[0x2283,0x20d2], "nsupseteq;":0x2289, - "nsupseteqq;":[0x2ac6,0x338], "ntgl;":0x2279, - "ntilde":0xf1, "ntilde;":0xf1, - "ntlg;":0x2278, "ntriangleleft;":0x22ea, - "ntrianglelefteq;":0x22ec, "ntriangleright;":0x22eb, - "ntrianglerighteq;":0x22ed, "nu;":0x3bd, - "num;":0x23, "numero;":0x2116, - "numsp;":0x2007, "nvDash;":0x22ad, - "nvHarr;":0x2904, "nvap;":[0x224d,0x20d2], - "nvdash;":0x22ac, "nvge;":[0x2265,0x20d2], - "nvgt;":[0x3e,0x20d2], "nvinfin;":0x29de, - "nvlArr;":0x2902, "nvle;":[0x2264,0x20d2], - "nvlt;":[0x3c,0x20d2], "nvltrie;":[0x22b4,0x20d2], - "nvrArr;":0x2903, "nvrtrie;":[0x22b5,0x20d2], - "nvsim;":[0x223c,0x20d2], "nwArr;":0x21d6, - "nwarhk;":0x2923, "nwarr;":0x2196, - "nwarrow;":0x2196, "nwnear;":0x2927, - "oS;":0x24c8, "oacute":0xf3, - "oacute;":0xf3, "oast;":0x229b, - "ocir;":0x229a, "ocirc":0xf4, - "ocirc;":0xf4, "ocy;":0x43e, - "odash;":0x229d, "odblac;":0x151, - "odiv;":0x2a38, "odot;":0x2299, - "odsold;":0x29bc, "oelig;":0x153, - "ofcir;":0x29bf, "ofr;":[0xd835,0xdd2c], - "ogon;":0x2db, "ograve":0xf2, - "ograve;":0xf2, "ogt;":0x29c1, - "ohbar;":0x29b5, "ohm;":0x3a9, - "oint;":0x222e, "olarr;":0x21ba, - "olcir;":0x29be, "olcross;":0x29bb, - "oline;":0x203e, "olt;":0x29c0, - "omacr;":0x14d, "omega;":0x3c9, - "omicron;":0x3bf, "omid;":0x29b6, - "ominus;":0x2296, "oopf;":[0xd835,0xdd60], - "opar;":0x29b7, "operp;":0x29b9, - "oplus;":0x2295, "or;":0x2228, - "orarr;":0x21bb, "ord;":0x2a5d, - "order;":0x2134, "orderof;":0x2134, - "ordf":0xaa, "ordf;":0xaa, - "ordm":0xba, "ordm;":0xba, - "origof;":0x22b6, "oror;":0x2a56, - "orslope;":0x2a57, "orv;":0x2a5b, - "oscr;":0x2134, "oslash":0xf8, - "oslash;":0xf8, "osol;":0x2298, - "otilde":0xf5, "otilde;":0xf5, - "otimes;":0x2297, "otimesas;":0x2a36, - "ouml":0xf6, "ouml;":0xf6, - "ovbar;":0x233d, "par;":0x2225, - "para":0xb6, "para;":0xb6, - "parallel;":0x2225, "parsim;":0x2af3, - "parsl;":0x2afd, "part;":0x2202, - "pcy;":0x43f, "percnt;":0x25, - "period;":0x2e, "permil;":0x2030, - "perp;":0x22a5, "pertenk;":0x2031, - "pfr;":[0xd835,0xdd2d], "phi;":0x3c6, - "phiv;":0x3d5, "phmmat;":0x2133, - "phone;":0x260e, "pi;":0x3c0, - "pitchfork;":0x22d4, "piv;":0x3d6, - "planck;":0x210f, "planckh;":0x210e, - "plankv;":0x210f, "plus;":0x2b, - "plusacir;":0x2a23, "plusb;":0x229e, - "pluscir;":0x2a22, "plusdo;":0x2214, - "plusdu;":0x2a25, "pluse;":0x2a72, - "plusmn":0xb1, "plusmn;":0xb1, - "plussim;":0x2a26, "plustwo;":0x2a27, - "pm;":0xb1, "pointint;":0x2a15, - "popf;":[0xd835,0xdd61], "pound":0xa3, - "pound;":0xa3, "pr;":0x227a, - "prE;":0x2ab3, "prap;":0x2ab7, - "prcue;":0x227c, "pre;":0x2aaf, - "prec;":0x227a, "precapprox;":0x2ab7, - "preccurlyeq;":0x227c, "preceq;":0x2aaf, - "precnapprox;":0x2ab9, "precneqq;":0x2ab5, - "precnsim;":0x22e8, "precsim;":0x227e, - "prime;":0x2032, "primes;":0x2119, - "prnE;":0x2ab5, "prnap;":0x2ab9, - "prnsim;":0x22e8, "prod;":0x220f, - "profalar;":0x232e, "profline;":0x2312, - "profsurf;":0x2313, "prop;":0x221d, - "propto;":0x221d, "prsim;":0x227e, - "prurel;":0x22b0, "pscr;":[0xd835,0xdcc5], - "psi;":0x3c8, "puncsp;":0x2008, - "qfr;":[0xd835,0xdd2e], "qint;":0x2a0c, - "qopf;":[0xd835,0xdd62], "qprime;":0x2057, - "qscr;":[0xd835,0xdcc6], "quaternions;":0x210d, - "quatint;":0x2a16, "quest;":0x3f, - "questeq;":0x225f, "quot":0x22, - "quot;":0x22, "rAarr;":0x21db, - "rArr;":0x21d2, "rAtail;":0x291c, - "rBarr;":0x290f, "rHar;":0x2964, - "race;":[0x223d,0x331], "racute;":0x155, - "radic;":0x221a, "raemptyv;":0x29b3, - "rang;":0x27e9, "rangd;":0x2992, - "range;":0x29a5, "rangle;":0x27e9, - "raquo":0xbb, "raquo;":0xbb, - "rarr;":0x2192, "rarrap;":0x2975, - "rarrb;":0x21e5, "rarrbfs;":0x2920, - "rarrc;":0x2933, "rarrfs;":0x291e, - "rarrhk;":0x21aa, "rarrlp;":0x21ac, - "rarrpl;":0x2945, "rarrsim;":0x2974, - "rarrtl;":0x21a3, "rarrw;":0x219d, - "ratail;":0x291a, "ratio;":0x2236, - "rationals;":0x211a, "rbarr;":0x290d, - "rbbrk;":0x2773, "rbrace;":0x7d, - "rbrack;":0x5d, "rbrke;":0x298c, - "rbrksld;":0x298e, "rbrkslu;":0x2990, - "rcaron;":0x159, "rcedil;":0x157, - "rceil;":0x2309, "rcub;":0x7d, - "rcy;":0x440, "rdca;":0x2937, - "rdldhar;":0x2969, "rdquo;":0x201d, - "rdquor;":0x201d, "rdsh;":0x21b3, - "real;":0x211c, "realine;":0x211b, - "realpart;":0x211c, "reals;":0x211d, - "rect;":0x25ad, "reg":0xae, - "reg;":0xae, "rfisht;":0x297d, - "rfloor;":0x230b, "rfr;":[0xd835,0xdd2f], - "rhard;":0x21c1, "rharu;":0x21c0, - "rharul;":0x296c, "rho;":0x3c1, - "rhov;":0x3f1, "rightarrow;":0x2192, - "rightarrowtail;":0x21a3, "rightharpoondown;":0x21c1, - "rightharpoonup;":0x21c0, "rightleftarrows;":0x21c4, - "rightleftharpoons;":0x21cc, "rightrightarrows;":0x21c9, - "rightsquigarrow;":0x219d, "rightthreetimes;":0x22cc, - "ring;":0x2da, "risingdotseq;":0x2253, - "rlarr;":0x21c4, "rlhar;":0x21cc, - "rlm;":0x200f, "rmoust;":0x23b1, - "rmoustache;":0x23b1, "rnmid;":0x2aee, - "roang;":0x27ed, "roarr;":0x21fe, - "robrk;":0x27e7, "ropar;":0x2986, - "ropf;":[0xd835,0xdd63], "roplus;":0x2a2e, - "rotimes;":0x2a35, "rpar;":0x29, - "rpargt;":0x2994, "rppolint;":0x2a12, - "rrarr;":0x21c9, "rsaquo;":0x203a, - "rscr;":[0xd835,0xdcc7], "rsh;":0x21b1, - "rsqb;":0x5d, "rsquo;":0x2019, - "rsquor;":0x2019, "rthree;":0x22cc, - "rtimes;":0x22ca, "rtri;":0x25b9, - "rtrie;":0x22b5, "rtrif;":0x25b8, - "rtriltri;":0x29ce, "ruluhar;":0x2968, - "rx;":0x211e, "sacute;":0x15b, - "sbquo;":0x201a, "sc;":0x227b, - "scE;":0x2ab4, "scap;":0x2ab8, - "scaron;":0x161, "sccue;":0x227d, - "sce;":0x2ab0, "scedil;":0x15f, - "scirc;":0x15d, "scnE;":0x2ab6, - "scnap;":0x2aba, "scnsim;":0x22e9, - "scpolint;":0x2a13, "scsim;":0x227f, - "scy;":0x441, "sdot;":0x22c5, - "sdotb;":0x22a1, "sdote;":0x2a66, - "seArr;":0x21d8, "searhk;":0x2925, - "searr;":0x2198, "searrow;":0x2198, - "sect":0xa7, "sect;":0xa7, - "semi;":0x3b, "seswar;":0x2929, - "setminus;":0x2216, "setmn;":0x2216, - "sext;":0x2736, "sfr;":[0xd835,0xdd30], - "sfrown;":0x2322, "sharp;":0x266f, - "shchcy;":0x449, "shcy;":0x448, - "shortmid;":0x2223, "shortparallel;":0x2225, - "shy":0xad, "shy;":0xad, - "sigma;":0x3c3, "sigmaf;":0x3c2, - "sigmav;":0x3c2, "sim;":0x223c, - "simdot;":0x2a6a, "sime;":0x2243, - "simeq;":0x2243, "simg;":0x2a9e, - "simgE;":0x2aa0, "siml;":0x2a9d, - "simlE;":0x2a9f, "simne;":0x2246, - "simplus;":0x2a24, "simrarr;":0x2972, - "slarr;":0x2190, "smallsetminus;":0x2216, - "smashp;":0x2a33, "smeparsl;":0x29e4, - "smid;":0x2223, "smile;":0x2323, - "smt;":0x2aaa, "smte;":0x2aac, - "smtes;":[0x2aac,0xfe00], "softcy;":0x44c, - "sol;":0x2f, "solb;":0x29c4, - "solbar;":0x233f, "sopf;":[0xd835,0xdd64], - "spades;":0x2660, "spadesuit;":0x2660, - "spar;":0x2225, "sqcap;":0x2293, - "sqcaps;":[0x2293,0xfe00], "sqcup;":0x2294, - "sqcups;":[0x2294,0xfe00], "sqsub;":0x228f, - "sqsube;":0x2291, "sqsubset;":0x228f, - "sqsubseteq;":0x2291, "sqsup;":0x2290, - "sqsupe;":0x2292, "sqsupset;":0x2290, - "sqsupseteq;":0x2292, "squ;":0x25a1, - "square;":0x25a1, "squarf;":0x25aa, - "squf;":0x25aa, "srarr;":0x2192, - "sscr;":[0xd835,0xdcc8], "ssetmn;":0x2216, - "ssmile;":0x2323, "sstarf;":0x22c6, - "star;":0x2606, "starf;":0x2605, - "straightepsilon;":0x3f5, "straightphi;":0x3d5, - "strns;":0xaf, "sub;":0x2282, - "subE;":0x2ac5, "subdot;":0x2abd, - "sube;":0x2286, "subedot;":0x2ac3, - "submult;":0x2ac1, "subnE;":0x2acb, - "subne;":0x228a, "subplus;":0x2abf, - "subrarr;":0x2979, "subset;":0x2282, - "subseteq;":0x2286, "subseteqq;":0x2ac5, - "subsetneq;":0x228a, "subsetneqq;":0x2acb, - "subsim;":0x2ac7, "subsub;":0x2ad5, - "subsup;":0x2ad3, "succ;":0x227b, - "succapprox;":0x2ab8, "succcurlyeq;":0x227d, - "succeq;":0x2ab0, "succnapprox;":0x2aba, - "succneqq;":0x2ab6, "succnsim;":0x22e9, - "succsim;":0x227f, "sum;":0x2211, - "sung;":0x266a, "sup1":0xb9, - "sup1;":0xb9, "sup2":0xb2, - "sup2;":0xb2, "sup3":0xb3, - "sup3;":0xb3, "sup;":0x2283, - "supE;":0x2ac6, "supdot;":0x2abe, - "supdsub;":0x2ad8, "supe;":0x2287, - "supedot;":0x2ac4, "suphsol;":0x27c9, - "suphsub;":0x2ad7, "suplarr;":0x297b, - "supmult;":0x2ac2, "supnE;":0x2acc, - "supne;":0x228b, "supplus;":0x2ac0, - "supset;":0x2283, "supseteq;":0x2287, - "supseteqq;":0x2ac6, "supsetneq;":0x228b, - "supsetneqq;":0x2acc, "supsim;":0x2ac8, - "supsub;":0x2ad4, "supsup;":0x2ad6, - "swArr;":0x21d9, "swarhk;":0x2926, - "swarr;":0x2199, "swarrow;":0x2199, - "swnwar;":0x292a, "szlig":0xdf, - "szlig;":0xdf, "target;":0x2316, - "tau;":0x3c4, "tbrk;":0x23b4, - "tcaron;":0x165, "tcedil;":0x163, - "tcy;":0x442, "tdot;":0x20db, - "telrec;":0x2315, "tfr;":[0xd835,0xdd31], - "there4;":0x2234, "therefore;":0x2234, - "theta;":0x3b8, "thetasym;":0x3d1, - "thetav;":0x3d1, "thickapprox;":0x2248, - "thicksim;":0x223c, "thinsp;":0x2009, - "thkap;":0x2248, "thksim;":0x223c, - "thorn":0xfe, "thorn;":0xfe, - "tilde;":0x2dc, "times":0xd7, - "times;":0xd7, "timesb;":0x22a0, - "timesbar;":0x2a31, "timesd;":0x2a30, - "tint;":0x222d, "toea;":0x2928, - "top;":0x22a4, "topbot;":0x2336, - "topcir;":0x2af1, "topf;":[0xd835,0xdd65], - "topfork;":0x2ada, "tosa;":0x2929, - "tprime;":0x2034, "trade;":0x2122, - "triangle;":0x25b5, "triangledown;":0x25bf, - "triangleleft;":0x25c3, "trianglelefteq;":0x22b4, - "triangleq;":0x225c, "triangleright;":0x25b9, - "trianglerighteq;":0x22b5, "tridot;":0x25ec, - "trie;":0x225c, "triminus;":0x2a3a, - "triplus;":0x2a39, "trisb;":0x29cd, - "tritime;":0x2a3b, "trpezium;":0x23e2, - "tscr;":[0xd835,0xdcc9], "tscy;":0x446, - "tshcy;":0x45b, "tstrok;":0x167, - "twixt;":0x226c, "twoheadleftarrow;":0x219e, - "twoheadrightarrow;":0x21a0, "uArr;":0x21d1, - "uHar;":0x2963, "uacute":0xfa, - "uacute;":0xfa, "uarr;":0x2191, - "ubrcy;":0x45e, "ubreve;":0x16d, - "ucirc":0xfb, "ucirc;":0xfb, - "ucy;":0x443, "udarr;":0x21c5, - "udblac;":0x171, "udhar;":0x296e, - "ufisht;":0x297e, "ufr;":[0xd835,0xdd32], - "ugrave":0xf9, "ugrave;":0xf9, - "uharl;":0x21bf, "uharr;":0x21be, - "uhblk;":0x2580, "ulcorn;":0x231c, - "ulcorner;":0x231c, "ulcrop;":0x230f, - "ultri;":0x25f8, "umacr;":0x16b, - "uml":0xa8, "uml;":0xa8, - "uogon;":0x173, "uopf;":[0xd835,0xdd66], - "uparrow;":0x2191, "updownarrow;":0x2195, - "upharpoonleft;":0x21bf, "upharpoonright;":0x21be, - "uplus;":0x228e, "upsi;":0x3c5, - "upsih;":0x3d2, "upsilon;":0x3c5, - "upuparrows;":0x21c8, "urcorn;":0x231d, - "urcorner;":0x231d, "urcrop;":0x230e, - "uring;":0x16f, "urtri;":0x25f9, - "uscr;":[0xd835,0xdcca], "utdot;":0x22f0, - "utilde;":0x169, "utri;":0x25b5, - "utrif;":0x25b4, "uuarr;":0x21c8, - "uuml":0xfc, "uuml;":0xfc, - "uwangle;":0x29a7, "vArr;":0x21d5, - "vBar;":0x2ae8, "vBarv;":0x2ae9, - "vDash;":0x22a8, "vangrt;":0x299c, - "varepsilon;":0x3f5, "varkappa;":0x3f0, - "varnothing;":0x2205, "varphi;":0x3d5, - "varpi;":0x3d6, "varpropto;":0x221d, - "varr;":0x2195, "varrho;":0x3f1, - "varsigma;":0x3c2, "varsubsetneq;":[0x228a,0xfe00], - "varsubsetneqq;":[0x2acb,0xfe00], "varsupsetneq;":[0x228b,0xfe00], - "varsupsetneqq;":[0x2acc,0xfe00], "vartheta;":0x3d1, - "vartriangleleft;":0x22b2, "vartriangleright;":0x22b3, - "vcy;":0x432, "vdash;":0x22a2, - "vee;":0x2228, "veebar;":0x22bb, - "veeeq;":0x225a, "vellip;":0x22ee, - "verbar;":0x7c, "vert;":0x7c, - "vfr;":[0xd835,0xdd33], "vltri;":0x22b2, - "vnsub;":[0x2282,0x20d2], "vnsup;":[0x2283,0x20d2], - "vopf;":[0xd835,0xdd67], "vprop;":0x221d, - "vrtri;":0x22b3, "vscr;":[0xd835,0xdccb], - "vsubnE;":[0x2acb,0xfe00], "vsubne;":[0x228a,0xfe00], - "vsupnE;":[0x2acc,0xfe00], "vsupne;":[0x228b,0xfe00], - "vzigzag;":0x299a, "wcirc;":0x175, - "wedbar;":0x2a5f, "wedge;":0x2227, - "wedgeq;":0x2259, "weierp;":0x2118, - "wfr;":[0xd835,0xdd34], "wopf;":[0xd835,0xdd68], - "wp;":0x2118, "wr;":0x2240, - "wreath;":0x2240, "wscr;":[0xd835,0xdccc], - "xcap;":0x22c2, "xcirc;":0x25ef, - "xcup;":0x22c3, "xdtri;":0x25bd, - "xfr;":[0xd835,0xdd35], "xhArr;":0x27fa, - "xharr;":0x27f7, "xi;":0x3be, - "xlArr;":0x27f8, "xlarr;":0x27f5, - "xmap;":0x27fc, "xnis;":0x22fb, - "xodot;":0x2a00, "xopf;":[0xd835,0xdd69], - "xoplus;":0x2a01, "xotime;":0x2a02, - "xrArr;":0x27f9, "xrarr;":0x27f6, - "xscr;":[0xd835,0xdccd], "xsqcup;":0x2a06, - "xuplus;":0x2a04, "xutri;":0x25b3, - "xvee;":0x22c1, "xwedge;":0x22c0, - "yacute":0xfd, "yacute;":0xfd, - "yacy;":0x44f, "ycirc;":0x177, - "ycy;":0x44b, "yen":0xa5, - "yen;":0xa5, "yfr;":[0xd835,0xdd36], - "yicy;":0x457, "yopf;":[0xd835,0xdd6a], - "yscr;":[0xd835,0xdcce], "yucy;":0x44e, - "yuml":0xff, "yuml;":0xff, - "zacute;":0x17a, "zcaron;":0x17e, - "zcy;":0x437, "zdot;":0x17c, - "zeetrf;":0x2128, "zeta;":0x3b6, - "zfr;":[0xd835,0xdd37], "zhcy;":0x436, - "zigrarr;":0x21dd, "zopf;":[0xd835,0xdd6b], - "zscr;":[0xd835,0xdccf], "zwj;":0x200d, - "zwnj;":0x200c, -}; -/* - * This regexp is generated with test/tools/update-entities.js - * It will always match at least one character -- but note that there - * are no entities whose names are a single character long. - */ -var NAMEDCHARREF = /(A(?:Elig;?|MP;?|acute;?|breve;|c(?:irc;?|y;)|fr;|grave;?|lpha;|macr;|nd;|o(?:gon;|pf;)|pplyFunction;|ring;?|s(?:cr;|sign;)|tilde;?|uml;?)|B(?:a(?:ckslash;|r(?:v;|wed;))|cy;|e(?:cause;|rnoullis;|ta;)|fr;|opf;|reve;|scr;|umpeq;)|C(?:Hcy;|OPY;?|a(?:cute;|p(?:;|italDifferentialD;)|yleys;)|c(?:aron;|edil;?|irc;|onint;)|dot;|e(?:dilla;|nterDot;)|fr;|hi;|ircle(?:Dot;|Minus;|Plus;|Times;)|lo(?:ckwiseContourIntegral;|seCurly(?:DoubleQuote;|Quote;))|o(?:lon(?:;|e;)|n(?:gruent;|int;|tourIntegral;)|p(?:f;|roduct;)|unterClockwiseContourIntegral;)|ross;|scr;|up(?:;|Cap;))|D(?:D(?:;|otrahd;)|Jcy;|Scy;|Zcy;|a(?:gger;|rr;|shv;)|c(?:aron;|y;)|el(?:;|ta;)|fr;|i(?:a(?:critical(?:Acute;|Do(?:t;|ubleAcute;)|Grave;|Tilde;)|mond;)|fferentialD;)|o(?:pf;|t(?:;|Dot;|Equal;)|uble(?:ContourIntegral;|Do(?:t;|wnArrow;)|L(?:eft(?:Arrow;|RightArrow;|Tee;)|ong(?:Left(?:Arrow;|RightArrow;)|RightArrow;))|Right(?:Arrow;|Tee;)|Up(?:Arrow;|DownArrow;)|VerticalBar;)|wn(?:Arrow(?:;|Bar;|UpArrow;)|Breve;|Left(?:RightVector;|TeeVector;|Vector(?:;|Bar;))|Right(?:TeeVector;|Vector(?:;|Bar;))|Tee(?:;|Arrow;)|arrow;))|s(?:cr;|trok;))|E(?:NG;|TH;?|acute;?|c(?:aron;|irc;?|y;)|dot;|fr;|grave;?|lement;|m(?:acr;|pty(?:SmallSquare;|VerySmallSquare;))|o(?:gon;|pf;)|psilon;|qu(?:al(?:;|Tilde;)|ilibrium;)|s(?:cr;|im;)|ta;|uml;?|x(?:ists;|ponentialE;))|F(?:cy;|fr;|illed(?:SmallSquare;|VerySmallSquare;)|o(?:pf;|rAll;|uriertrf;)|scr;)|G(?:Jcy;|T;?|amma(?:;|d;)|breve;|c(?:edil;|irc;|y;)|dot;|fr;|g;|opf;|reater(?:Equal(?:;|Less;)|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;)|scr;|t;)|H(?:ARDcy;|a(?:cek;|t;)|circ;|fr;|ilbertSpace;|o(?:pf;|rizontalLine;)|s(?:cr;|trok;)|ump(?:DownHump;|Equal;))|I(?:Ecy;|Jlig;|Ocy;|acute;?|c(?:irc;?|y;)|dot;|fr;|grave;?|m(?:;|a(?:cr;|ginaryI;)|plies;)|n(?:t(?:;|e(?:gral;|rsection;))|visible(?:Comma;|Times;))|o(?:gon;|pf;|ta;)|scr;|tilde;|u(?:kcy;|ml;?))|J(?:c(?:irc;|y;)|fr;|opf;|s(?:cr;|ercy;)|ukcy;)|K(?:Hcy;|Jcy;|appa;|c(?:edil;|y;)|fr;|opf;|scr;)|L(?:Jcy;|T;?|a(?:cute;|mbda;|ng;|placetrf;|rr;)|c(?:aron;|edil;|y;)|e(?:ft(?:A(?:ngleBracket;|rrow(?:;|Bar;|RightArrow;))|Ceiling;|Do(?:ubleBracket;|wn(?:TeeVector;|Vector(?:;|Bar;)))|Floor;|Right(?:Arrow;|Vector;)|T(?:ee(?:;|Arrow;|Vector;)|riangle(?:;|Bar;|Equal;))|Up(?:DownVector;|TeeVector;|Vector(?:;|Bar;))|Vector(?:;|Bar;)|arrow;|rightarrow;)|ss(?:EqualGreater;|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;))|fr;|l(?:;|eftarrow;)|midot;|o(?:ng(?:Left(?:Arrow;|RightArrow;)|RightArrow;|left(?:arrow;|rightarrow;)|rightarrow;)|pf;|wer(?:LeftArrow;|RightArrow;))|s(?:cr;|h;|trok;)|t;)|M(?:ap;|cy;|e(?:diumSpace;|llintrf;)|fr;|inusPlus;|opf;|scr;|u;)|N(?:Jcy;|acute;|c(?:aron;|edil;|y;)|e(?:gative(?:MediumSpace;|Thi(?:ckSpace;|nSpace;)|VeryThinSpace;)|sted(?:GreaterGreater;|LessLess;)|wLine;)|fr;|o(?:Break;|nBreakingSpace;|pf;|t(?:;|C(?:ongruent;|upCap;)|DoubleVerticalBar;|E(?:lement;|qual(?:;|Tilde;)|xists;)|Greater(?:;|Equal;|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;)|Hump(?:DownHump;|Equal;)|Le(?:ftTriangle(?:;|Bar;|Equal;)|ss(?:;|Equal;|Greater;|Less;|SlantEqual;|Tilde;))|Nested(?:GreaterGreater;|LessLess;)|Precedes(?:;|Equal;|SlantEqual;)|R(?:everseElement;|ightTriangle(?:;|Bar;|Equal;))|S(?:quareSu(?:bset(?:;|Equal;)|perset(?:;|Equal;))|u(?:bset(?:;|Equal;)|cceeds(?:;|Equal;|SlantEqual;|Tilde;)|perset(?:;|Equal;)))|Tilde(?:;|Equal;|FullEqual;|Tilde;)|VerticalBar;))|scr;|tilde;?|u;)|O(?:Elig;|acute;?|c(?:irc;?|y;)|dblac;|fr;|grave;?|m(?:acr;|ega;|icron;)|opf;|penCurly(?:DoubleQuote;|Quote;)|r;|s(?:cr;|lash;?)|ti(?:lde;?|mes;)|uml;?|ver(?:B(?:ar;|rac(?:e;|ket;))|Parenthesis;))|P(?:artialD;|cy;|fr;|hi;|i;|lusMinus;|o(?:incareplane;|pf;)|r(?:;|ecedes(?:;|Equal;|SlantEqual;|Tilde;)|ime;|o(?:duct;|portion(?:;|al;)))|s(?:cr;|i;))|Q(?:UOT;?|fr;|opf;|scr;)|R(?:Barr;|EG;?|a(?:cute;|ng;|rr(?:;|tl;))|c(?:aron;|edil;|y;)|e(?:;|verse(?:E(?:lement;|quilibrium;)|UpEquilibrium;))|fr;|ho;|ight(?:A(?:ngleBracket;|rrow(?:;|Bar;|LeftArrow;))|Ceiling;|Do(?:ubleBracket;|wn(?:TeeVector;|Vector(?:;|Bar;)))|Floor;|T(?:ee(?:;|Arrow;|Vector;)|riangle(?:;|Bar;|Equal;))|Up(?:DownVector;|TeeVector;|Vector(?:;|Bar;))|Vector(?:;|Bar;)|arrow;)|o(?:pf;|undImplies;)|rightarrow;|s(?:cr;|h;)|uleDelayed;)|S(?:H(?:CHcy;|cy;)|OFTcy;|acute;|c(?:;|aron;|edil;|irc;|y;)|fr;|hort(?:DownArrow;|LeftArrow;|RightArrow;|UpArrow;)|igma;|mallCircle;|opf;|q(?:rt;|uare(?:;|Intersection;|Su(?:bset(?:;|Equal;)|perset(?:;|Equal;))|Union;))|scr;|tar;|u(?:b(?:;|set(?:;|Equal;))|c(?:ceeds(?:;|Equal;|SlantEqual;|Tilde;)|hThat;)|m;|p(?:;|erset(?:;|Equal;)|set;)))|T(?:HORN;?|RADE;|S(?:Hcy;|cy;)|a(?:b;|u;)|c(?:aron;|edil;|y;)|fr;|h(?:e(?:refore;|ta;)|i(?:ckSpace;|nSpace;))|ilde(?:;|Equal;|FullEqual;|Tilde;)|opf;|ripleDot;|s(?:cr;|trok;))|U(?:a(?:cute;?|rr(?:;|ocir;))|br(?:cy;|eve;)|c(?:irc;?|y;)|dblac;|fr;|grave;?|macr;|n(?:der(?:B(?:ar;|rac(?:e;|ket;))|Parenthesis;)|ion(?:;|Plus;))|o(?:gon;|pf;)|p(?:Arrow(?:;|Bar;|DownArrow;)|DownArrow;|Equilibrium;|Tee(?:;|Arrow;)|arrow;|downarrow;|per(?:LeftArrow;|RightArrow;)|si(?:;|lon;))|ring;|scr;|tilde;|uml;?)|V(?:Dash;|bar;|cy;|dash(?:;|l;)|e(?:e;|r(?:bar;|t(?:;|ical(?:Bar;|Line;|Separator;|Tilde;))|yThinSpace;))|fr;|opf;|scr;|vdash;)|W(?:circ;|edge;|fr;|opf;|scr;)|X(?:fr;|i;|opf;|scr;)|Y(?:Acy;|Icy;|Ucy;|acute;?|c(?:irc;|y;)|fr;|opf;|scr;|uml;)|Z(?:Hcy;|acute;|c(?:aron;|y;)|dot;|e(?:roWidthSpace;|ta;)|fr;|opf;|scr;)|a(?:acute;?|breve;|c(?:;|E;|d;|irc;?|ute;?|y;)|elig;?|f(?:;|r;)|grave;?|l(?:e(?:fsym;|ph;)|pha;)|m(?:a(?:cr;|lg;)|p;?)|n(?:d(?:;|and;|d;|slope;|v;)|g(?:;|e;|le;|msd(?:;|a(?:a;|b;|c;|d;|e;|f;|g;|h;))|rt(?:;|vb(?:;|d;))|s(?:ph;|t;)|zarr;))|o(?:gon;|pf;)|p(?:;|E;|acir;|e;|id;|os;|prox(?:;|eq;))|ring;?|s(?:cr;|t;|ymp(?:;|eq;))|tilde;?|uml;?|w(?:conint;|int;))|b(?:Not;|a(?:ck(?:cong;|epsilon;|prime;|sim(?:;|eq;))|r(?:vee;|wed(?:;|ge;)))|brk(?:;|tbrk;)|c(?:ong;|y;)|dquo;|e(?:caus(?:;|e;)|mptyv;|psi;|rnou;|t(?:a;|h;|ween;))|fr;|ig(?:c(?:ap;|irc;|up;)|o(?:dot;|plus;|times;)|s(?:qcup;|tar;)|triangle(?:down;|up;)|uplus;|vee;|wedge;)|karow;|l(?:a(?:ck(?:lozenge;|square;|triangle(?:;|down;|left;|right;))|nk;)|k(?:1(?:2;|4;)|34;)|ock;)|n(?:e(?:;|quiv;)|ot;)|o(?:pf;|t(?:;|tom;)|wtie;|x(?:D(?:L;|R;|l;|r;)|H(?:;|D;|U;|d;|u;)|U(?:L;|R;|l;|r;)|V(?:;|H;|L;|R;|h;|l;|r;)|box;|d(?:L;|R;|l;|r;)|h(?:;|D;|U;|d;|u;)|minus;|plus;|times;|u(?:L;|R;|l;|r;)|v(?:;|H;|L;|R;|h;|l;|r;)))|prime;|r(?:eve;|vbar;?)|s(?:cr;|emi;|im(?:;|e;)|ol(?:;|b;|hsub;))|u(?:ll(?:;|et;)|mp(?:;|E;|e(?:;|q;))))|c(?:a(?:cute;|p(?:;|and;|brcup;|c(?:ap;|up;)|dot;|s;)|r(?:et;|on;))|c(?:a(?:ps;|ron;)|edil;?|irc;|ups(?:;|sm;))|dot;|e(?:dil;?|mptyv;|nt(?:;|erdot;|))|fr;|h(?:cy;|eck(?:;|mark;)|i;)|ir(?:;|E;|c(?:;|eq;|le(?:arrow(?:left;|right;)|d(?:R;|S;|ast;|circ;|dash;)))|e;|fnint;|mid;|scir;)|lubs(?:;|uit;)|o(?:lon(?:;|e(?:;|q;))|m(?:ma(?:;|t;)|p(?:;|fn;|le(?:ment;|xes;)))|n(?:g(?:;|dot;)|int;)|p(?:f;|rod;|y(?:;|sr;|)))|r(?:arr;|oss;)|s(?:cr;|u(?:b(?:;|e;)|p(?:;|e;)))|tdot;|u(?:darr(?:l;|r;)|e(?:pr;|sc;)|larr(?:;|p;)|p(?:;|brcap;|c(?:ap;|up;)|dot;|or;|s;)|r(?:arr(?:;|m;)|ly(?:eq(?:prec;|succ;)|vee;|wedge;)|ren;?|vearrow(?:left;|right;))|vee;|wed;)|w(?:conint;|int;)|ylcty;)|d(?:Arr;|Har;|a(?:gger;|leth;|rr;|sh(?:;|v;))|b(?:karow;|lac;)|c(?:aron;|y;)|d(?:;|a(?:gger;|rr;)|otseq;)|e(?:g;?|lta;|mptyv;)|f(?:isht;|r;)|har(?:l;|r;)|i(?:am(?:;|ond(?:;|suit;)|s;)|e;|gamma;|sin;|v(?:;|ide(?:;|ontimes;|)|onx;))|jcy;|lc(?:orn;|rop;)|o(?:llar;|pf;|t(?:;|eq(?:;|dot;)|minus;|plus;|square;)|ublebarwedge;|wn(?:arrow;|downarrows;|harpoon(?:left;|right;)))|r(?:bkarow;|c(?:orn;|rop;))|s(?:c(?:r;|y;)|ol;|trok;)|t(?:dot;|ri(?:;|f;))|u(?:arr;|har;)|wangle;|z(?:cy;|igrarr;))|e(?:D(?:Dot;|ot;)|a(?:cute;?|ster;)|c(?:aron;|ir(?:;|c;?)|olon;|y;)|dot;|e;|f(?:Dot;|r;)|g(?:;|rave;?|s(?:;|dot;))|l(?:;|inters;|l;|s(?:;|dot;))|m(?:acr;|pty(?:;|set;|v;)|sp(?:1(?:3;|4;)|;))|n(?:g;|sp;)|o(?:gon;|pf;)|p(?:ar(?:;|sl;)|lus;|si(?:;|lon;|v;))|q(?:c(?:irc;|olon;)|s(?:im;|lant(?:gtr;|less;))|u(?:als;|est;|iv(?:;|DD;))|vparsl;)|r(?:Dot;|arr;)|s(?:cr;|dot;|im;)|t(?:a;|h;?)|u(?:ml;?|ro;)|x(?:cl;|ist;|p(?:ectation;|onentiale;)))|f(?:allingdotseq;|cy;|emale;|f(?:ilig;|l(?:ig;|lig;)|r;)|ilig;|jlig;|l(?:at;|lig;|tns;)|nof;|o(?:pf;|r(?:all;|k(?:;|v;)))|partint;|r(?:a(?:c(?:1(?:2;?|3;|4;?|5;|6;|8;)|2(?:3;|5;)|3(?:4;?|5;|8;)|45;|5(?:6;|8;)|78;)|sl;)|own;)|scr;)|g(?:E(?:;|l;)|a(?:cute;|mma(?:;|d;)|p;)|breve;|c(?:irc;|y;)|dot;|e(?:;|l;|q(?:;|q;|slant;)|s(?:;|cc;|dot(?:;|o(?:;|l;))|l(?:;|es;)))|fr;|g(?:;|g;)|imel;|jcy;|l(?:;|E;|a;|j;)|n(?:E;|ap(?:;|prox;)|e(?:;|q(?:;|q;))|sim;)|opf;|rave;|s(?:cr;|im(?:;|e;|l;))|t(?:;|c(?:c;|ir;)|dot;|lPar;|quest;|r(?:a(?:pprox;|rr;)|dot;|eq(?:less;|qless;)|less;|sim;)|)|v(?:ertneqq;|nE;))|h(?:Arr;|a(?:irsp;|lf;|milt;|r(?:dcy;|r(?:;|cir;|w;)))|bar;|circ;|e(?:arts(?:;|uit;)|llip;|rcon;)|fr;|ks(?:earow;|warow;)|o(?:arr;|mtht;|ok(?:leftarrow;|rightarrow;)|pf;|rbar;)|s(?:cr;|lash;|trok;)|y(?:bull;|phen;))|i(?:acute;?|c(?:;|irc;?|y;)|e(?:cy;|xcl;?)|f(?:f;|r;)|grave;?|i(?:;|i(?:int;|nt;)|nfin;|ota;)|jlig;|m(?:a(?:cr;|g(?:e;|line;|part;)|th;)|of;|ped;)|n(?:;|care;|fin(?:;|tie;)|odot;|t(?:;|cal;|e(?:gers;|rcal;)|larhk;|prod;))|o(?:cy;|gon;|pf;|ta;)|prod;|quest;?|s(?:cr;|in(?:;|E;|dot;|s(?:;|v;)|v;))|t(?:;|ilde;)|u(?:kcy;|ml;?))|j(?:c(?:irc;|y;)|fr;|math;|opf;|s(?:cr;|ercy;)|ukcy;)|k(?:appa(?:;|v;)|c(?:edil;|y;)|fr;|green;|hcy;|jcy;|opf;|scr;)|l(?:A(?:arr;|rr;|tail;)|Barr;|E(?:;|g;)|Har;|a(?:cute;|emptyv;|gran;|mbda;|ng(?:;|d;|le;)|p;|quo;?|rr(?:;|b(?:;|fs;)|fs;|hk;|lp;|pl;|sim;|tl;)|t(?:;|ail;|e(?:;|s;)))|b(?:arr;|brk;|r(?:ac(?:e;|k;)|k(?:e;|sl(?:d;|u;))))|c(?:aron;|e(?:dil;|il;)|ub;|y;)|d(?:ca;|quo(?:;|r;)|r(?:dhar;|ushar;)|sh;)|e(?:;|ft(?:arrow(?:;|tail;)|harpoon(?:down;|up;)|leftarrows;|right(?:arrow(?:;|s;)|harpoons;|squigarrow;)|threetimes;)|g;|q(?:;|q;|slant;)|s(?:;|cc;|dot(?:;|o(?:;|r;))|g(?:;|es;)|s(?:approx;|dot;|eq(?:gtr;|qgtr;)|gtr;|sim;)))|f(?:isht;|loor;|r;)|g(?:;|E;)|h(?:ar(?:d;|u(?:;|l;))|blk;)|jcy;|l(?:;|arr;|corner;|hard;|tri;)|m(?:idot;|oust(?:;|ache;))|n(?:E;|ap(?:;|prox;)|e(?:;|q(?:;|q;))|sim;)|o(?:a(?:ng;|rr;)|brk;|ng(?:left(?:arrow;|rightarrow;)|mapsto;|rightarrow;)|oparrow(?:left;|right;)|p(?:ar;|f;|lus;)|times;|w(?:ast;|bar;)|z(?:;|enge;|f;))|par(?:;|lt;)|r(?:arr;|corner;|har(?:;|d;)|m;|tri;)|s(?:aquo;|cr;|h;|im(?:;|e;|g;)|q(?:b;|uo(?:;|r;))|trok;)|t(?:;|c(?:c;|ir;)|dot;|hree;|imes;|larr;|quest;|r(?:Par;|i(?:;|e;|f;))|)|ur(?:dshar;|uhar;)|v(?:ertneqq;|nE;))|m(?:DDot;|a(?:cr;?|l(?:e;|t(?:;|ese;))|p(?:;|sto(?:;|down;|left;|up;))|rker;)|c(?:omma;|y;)|dash;|easuredangle;|fr;|ho;|i(?:cro;?|d(?:;|ast;|cir;|dot;?)|nus(?:;|b;|d(?:;|u;)))|l(?:cp;|dr;)|nplus;|o(?:dels;|pf;)|p;|s(?:cr;|tpos;)|u(?:;|ltimap;|map;))|n(?:G(?:g;|t(?:;|v;))|L(?:eft(?:arrow;|rightarrow;)|l;|t(?:;|v;))|Rightarrow;|V(?:Dash;|dash;)|a(?:bla;|cute;|ng;|p(?:;|E;|id;|os;|prox;)|tur(?:;|al(?:;|s;)))|b(?:sp;?|ump(?:;|e;))|c(?:a(?:p;|ron;)|edil;|ong(?:;|dot;)|up;|y;)|dash;|e(?:;|Arr;|ar(?:hk;|r(?:;|ow;))|dot;|quiv;|s(?:ear;|im;)|xist(?:;|s;))|fr;|g(?:E;|e(?:;|q(?:;|q;|slant;)|s;)|sim;|t(?:;|r;))|h(?:Arr;|arr;|par;)|i(?:;|s(?:;|d;)|v;)|jcy;|l(?:Arr;|E;|arr;|dr;|e(?:;|ft(?:arrow;|rightarrow;)|q(?:;|q;|slant;)|s(?:;|s;))|sim;|t(?:;|ri(?:;|e;)))|mid;|o(?:pf;|t(?:;|in(?:;|E;|dot;|v(?:a;|b;|c;))|ni(?:;|v(?:a;|b;|c;))|))|p(?:ar(?:;|allel;|sl;|t;)|olint;|r(?:;|cue;|e(?:;|c(?:;|eq;))))|r(?:Arr;|arr(?:;|c;|w;)|ightarrow;|tri(?:;|e;))|s(?:c(?:;|cue;|e;|r;)|hort(?:mid;|parallel;)|im(?:;|e(?:;|q;))|mid;|par;|qsu(?:be;|pe;)|u(?:b(?:;|E;|e;|set(?:;|eq(?:;|q;)))|cc(?:;|eq;)|p(?:;|E;|e;|set(?:;|eq(?:;|q;)))))|t(?:gl;|ilde;?|lg;|riangle(?:left(?:;|eq;)|right(?:;|eq;)))|u(?:;|m(?:;|ero;|sp;))|v(?:Dash;|Harr;|ap;|dash;|g(?:e;|t;)|infin;|l(?:Arr;|e;|t(?:;|rie;))|r(?:Arr;|trie;)|sim;)|w(?:Arr;|ar(?:hk;|r(?:;|ow;))|near;))|o(?:S;|a(?:cute;?|st;)|c(?:ir(?:;|c;?)|y;)|d(?:ash;|blac;|iv;|ot;|sold;)|elig;|f(?:cir;|r;)|g(?:on;|rave;?|t;)|h(?:bar;|m;)|int;|l(?:arr;|c(?:ir;|ross;)|ine;|t;)|m(?:acr;|ega;|i(?:cron;|d;|nus;))|opf;|p(?:ar;|erp;|lus;)|r(?:;|arr;|d(?:;|er(?:;|of;)|f;?|m;?)|igof;|or;|slope;|v;)|s(?:cr;|lash;?|ol;)|ti(?:lde;?|mes(?:;|as;))|uml;?|vbar;)|p(?:ar(?:;|a(?:;|llel;|)|s(?:im;|l;)|t;)|cy;|er(?:cnt;|iod;|mil;|p;|tenk;)|fr;|h(?:i(?:;|v;)|mmat;|one;)|i(?:;|tchfork;|v;)|l(?:an(?:ck(?:;|h;)|kv;)|us(?:;|acir;|b;|cir;|d(?:o;|u;)|e;|mn;?|sim;|two;))|m;|o(?:intint;|pf;|und;?)|r(?:;|E;|ap;|cue;|e(?:;|c(?:;|approx;|curlyeq;|eq;|n(?:approx;|eqq;|sim;)|sim;))|ime(?:;|s;)|n(?:E;|ap;|sim;)|o(?:d;|f(?:alar;|line;|surf;)|p(?:;|to;))|sim;|urel;)|s(?:cr;|i;)|uncsp;)|q(?:fr;|int;|opf;|prime;|scr;|u(?:at(?:ernions;|int;)|est(?:;|eq;)|ot;?))|r(?:A(?:arr;|rr;|tail;)|Barr;|Har;|a(?:c(?:e;|ute;)|dic;|emptyv;|ng(?:;|d;|e;|le;)|quo;?|rr(?:;|ap;|b(?:;|fs;)|c;|fs;|hk;|lp;|pl;|sim;|tl;|w;)|t(?:ail;|io(?:;|nals;)))|b(?:arr;|brk;|r(?:ac(?:e;|k;)|k(?:e;|sl(?:d;|u;))))|c(?:aron;|e(?:dil;|il;)|ub;|y;)|d(?:ca;|ldhar;|quo(?:;|r;)|sh;)|e(?:al(?:;|ine;|part;|s;)|ct;|g;?)|f(?:isht;|loor;|r;)|h(?:ar(?:d;|u(?:;|l;))|o(?:;|v;))|i(?:ght(?:arrow(?:;|tail;)|harpoon(?:down;|up;)|left(?:arrows;|harpoons;)|rightarrows;|squigarrow;|threetimes;)|ng;|singdotseq;)|l(?:arr;|har;|m;)|moust(?:;|ache;)|nmid;|o(?:a(?:ng;|rr;)|brk;|p(?:ar;|f;|lus;)|times;)|p(?:ar(?:;|gt;)|polint;)|rarr;|s(?:aquo;|cr;|h;|q(?:b;|uo(?:;|r;)))|t(?:hree;|imes;|ri(?:;|e;|f;|ltri;))|uluhar;|x;)|s(?:acute;|bquo;|c(?:;|E;|a(?:p;|ron;)|cue;|e(?:;|dil;)|irc;|n(?:E;|ap;|sim;)|polint;|sim;|y;)|dot(?:;|b;|e;)|e(?:Arr;|ar(?:hk;|r(?:;|ow;))|ct;?|mi;|swar;|tm(?:inus;|n;)|xt;)|fr(?:;|own;)|h(?:arp;|c(?:hcy;|y;)|ort(?:mid;|parallel;)|y;?)|i(?:gma(?:;|f;|v;)|m(?:;|dot;|e(?:;|q;)|g(?:;|E;)|l(?:;|E;)|ne;|plus;|rarr;))|larr;|m(?:a(?:llsetminus;|shp;)|eparsl;|i(?:d;|le;)|t(?:;|e(?:;|s;)))|o(?:ftcy;|l(?:;|b(?:;|ar;))|pf;)|pa(?:des(?:;|uit;)|r;)|q(?:c(?:ap(?:;|s;)|up(?:;|s;))|su(?:b(?:;|e;|set(?:;|eq;))|p(?:;|e;|set(?:;|eq;)))|u(?:;|ar(?:e;|f;)|f;))|rarr;|s(?:cr;|etmn;|mile;|tarf;)|t(?:ar(?:;|f;)|r(?:aight(?:epsilon;|phi;)|ns;))|u(?:b(?:;|E;|dot;|e(?:;|dot;)|mult;|n(?:E;|e;)|plus;|rarr;|s(?:et(?:;|eq(?:;|q;)|neq(?:;|q;))|im;|u(?:b;|p;)))|cc(?:;|approx;|curlyeq;|eq;|n(?:approx;|eqq;|sim;)|sim;)|m;|ng;|p(?:1;?|2;?|3;?|;|E;|d(?:ot;|sub;)|e(?:;|dot;)|hs(?:ol;|ub;)|larr;|mult;|n(?:E;|e;)|plus;|s(?:et(?:;|eq(?:;|q;)|neq(?:;|q;))|im;|u(?:b;|p;))))|w(?:Arr;|ar(?:hk;|r(?:;|ow;))|nwar;)|zlig;?)|t(?:a(?:rget;|u;)|brk;|c(?:aron;|edil;|y;)|dot;|elrec;|fr;|h(?:e(?:re(?:4;|fore;)|ta(?:;|sym;|v;))|i(?:ck(?:approx;|sim;)|nsp;)|k(?:ap;|sim;)|orn;?)|i(?:lde;|mes(?:;|b(?:;|ar;)|d;|)|nt;)|o(?:ea;|p(?:;|bot;|cir;|f(?:;|ork;))|sa;)|prime;|r(?:ade;|i(?:angle(?:;|down;|left(?:;|eq;)|q;|right(?:;|eq;))|dot;|e;|minus;|plus;|sb;|time;)|pezium;)|s(?:c(?:r;|y;)|hcy;|trok;)|w(?:ixt;|ohead(?:leftarrow;|rightarrow;)))|u(?:Arr;|Har;|a(?:cute;?|rr;)|br(?:cy;|eve;)|c(?:irc;?|y;)|d(?:arr;|blac;|har;)|f(?:isht;|r;)|grave;?|h(?:ar(?:l;|r;)|blk;)|l(?:c(?:orn(?:;|er;)|rop;)|tri;)|m(?:acr;|l;?)|o(?:gon;|pf;)|p(?:arrow;|downarrow;|harpoon(?:left;|right;)|lus;|si(?:;|h;|lon;)|uparrows;)|r(?:c(?:orn(?:;|er;)|rop;)|ing;|tri;)|scr;|t(?:dot;|ilde;|ri(?:;|f;))|u(?:arr;|ml;?)|wangle;)|v(?:Arr;|Bar(?:;|v;)|Dash;|a(?:ngrt;|r(?:epsilon;|kappa;|nothing;|p(?:hi;|i;|ropto;)|r(?:;|ho;)|s(?:igma;|u(?:bsetneq(?:;|q;)|psetneq(?:;|q;)))|t(?:heta;|riangle(?:left;|right;))))|cy;|dash;|e(?:e(?:;|bar;|eq;)|llip;|r(?:bar;|t;))|fr;|ltri;|nsu(?:b;|p;)|opf;|prop;|rtri;|s(?:cr;|u(?:bn(?:E;|e;)|pn(?:E;|e;)))|zigzag;)|w(?:circ;|e(?:d(?:bar;|ge(?:;|q;))|ierp;)|fr;|opf;|p;|r(?:;|eath;)|scr;)|x(?:c(?:ap;|irc;|up;)|dtri;|fr;|h(?:Arr;|arr;)|i;|l(?:Arr;|arr;)|map;|nis;|o(?:dot;|p(?:f;|lus;)|time;)|r(?:Arr;|arr;)|s(?:cr;|qcup;)|u(?:plus;|tri;)|vee;|wedge;)|y(?:ac(?:ute;?|y;)|c(?:irc;|y;)|en;?|fr;|icy;|opf;|scr;|u(?:cy;|ml;?))|z(?:acute;|c(?:aron;|y;)|dot;|e(?:etrf;|ta;)|fr;|hcy;|igrarr;|opf;|scr;|w(?:j;|nj;)))|[\s\S]/g; - -var NAMEDCHARREF_MAXLEN = 32; - -// Regular expression constants used by the tokenizer and parser - -// Note that \r is included in all of these regexps because it will need -// to be converted to LF by the scanChars() function. -var DBLQUOTEATTRVAL = /[^\r"&\u0000]+/g; -var SINGLEQUOTEATTRVAL = /[^\r'&\u0000]+/g; -var UNQUOTEDATTRVAL = /[^\r\t\n\f &>\u0000]+/g; -var TAGNAME = /[^\r\t\n\f \/>A-Z\u0000]+/g; -var ATTRNAME = /[^\r\t\n\f \/=>A-Z\u0000]+/g; - -var CDATATEXT = /[^\]\r\u0000\uffff]*/g; -var DATATEXT = /[^&<\r\u0000\uffff]*/g; -var RAWTEXT = /[^<\r\u0000\uffff]*/g; -var PLAINTEXT = /[^\r\u0000\uffff]*/g; -// Since we don't have the 'sticky tag', add '|.' to the end of SIMPLETAG -// and SIMPLEATTR so that we are guaranteed to always match. This prevents -// us from scanning past the lastIndex set. (Note that the desired matches -// are always greater than 1 char long, so longest-match will ensure that . -// is not matched unless the desired match fails.) -var SIMPLETAG = /(?:(\/)?([a-z]+)>)|[\s\S]/g; -var SIMPLEATTR = /(?:([-a-z]+)[ \t\n\f]*=[ \t\n\f]*('[^'&\r\u0000]*'|"[^"&\r\u0000]*"|[^\t\n\r\f "&'\u0000>][^&> \t\n\r\f\u0000]*[ \t\n\f]))|[\s\S]/g; - -var NONWS = /[^\x09\x0A\x0C\x0D\x20]/; -var ALLNONWS = /[^\x09\x0A\x0C\x0D\x20]/g; // like above, with g flag -var NONWSNONNUL = /[^\x00\x09\x0A\x0C\x0D\x20]/; // don't allow NUL either -var LEADINGWS = /^[\x09\x0A\x0C\x0D\x20]+/; -var NULCHARS = /\x00/g; - -/*** - * These are utility functions that don't use any of the parser's - * internal state. - */ -function buf2str(buf) { - var CHUNKSIZE=16384; - if (buf.length < CHUNKSIZE) { - return String.fromCharCode.apply(String, buf); - } - // special case for large strings, to avoid busting the stack. - var result = ''; - for (var i = 0; i < buf.length; i += CHUNKSIZE) { - result += String.fromCharCode.apply(String, buf.slice(i, i+CHUNKSIZE)); - } - return result; -} - -function str2buf(s) { - var result = []; - for (var i=0; i 0; i--) { - var e = this.elements[i]; - if (isA(e, tag)) break; - } - this.elements.length = i; - this.top = this.elements[i-1]; -}; - -// Pop elements off the stack up to and including the first -// element that is an instance of the specified type -HTMLParser.ElementStack.prototype.popElementType = function(type) { - for(var i = this.elements.length-1; i > 0; i--) { - if (this.elements[i] instanceof type) break; - } - this.elements.length = i; - this.top = this.elements[i-1]; -}; - -// Pop elements off the stack up to and including the element e. -// Note that this is very different from removeElement() -// This requires that e is on the stack. -HTMLParser.ElementStack.prototype.popElement = function(e) { - for(var i = this.elements.length-1; i > 0; i--) { - if (this.elements[i] === e) break; - } - this.elements.length = i; - this.top = this.elements[i-1]; -}; - -// Remove a specific element from the stack. -// Do nothing if the element is not on the stack -HTMLParser.ElementStack.prototype.removeElement = function(e) { - if (this.top === e) this.pop(); - else { - var idx = this.elements.lastIndexOf(e); - if (idx !== -1) - this.elements.splice(idx, 1); - } -}; - -HTMLParser.ElementStack.prototype.clearToContext = function(set) { - // Note that we don't loop to 0. Never pop the elt off. - for(var i = this.elements.length-1; i > 0; i--) { - if (isA(this.elements[i], set)) break; - } - this.elements.length = i+1; - this.top = this.elements[i]; -}; - -HTMLParser.ElementStack.prototype.contains = function(tag) { - return this.inSpecificScope(tag, Object.create(null)); -}; - -HTMLParser.ElementStack.prototype.inSpecificScope = function(tag, set) { - for(var i = this.elements.length-1; i >= 0; i--) { - var elt = this.elements[i]; - if (isA(elt, tag)) return true; - if (isA(elt, set)) return false; - } - return false; -}; - -// Like the above, but for a specific element, not a tagname -HTMLParser.ElementStack.prototype.elementInSpecificScope = function(target, set) { - for(var i = this.elements.length-1; i >= 0; i--) { - var elt = this.elements[i]; - if (elt === target) return true; - if (isA(elt, set)) return false; - } - return false; -}; - -// Like the above, but for an element interface, not a tagname -HTMLParser.ElementStack.prototype.elementTypeInSpecificScope = function(target, set) { - for(var i = this.elements.length-1; i >= 0; i--) { - var elt = this.elements[i]; - if (elt instanceof target) return true; - if (isA(elt, set)) return false; - } - return false; -}; - -HTMLParser.ElementStack.prototype.inScope = function(tag) { - return this.inSpecificScope(tag, inScopeSet); -}; - -HTMLParser.ElementStack.prototype.elementInScope = function(e) { - return this.elementInSpecificScope(e, inScopeSet); -}; - -HTMLParser.ElementStack.prototype.elementTypeInScope = function(type) { - return this.elementTypeInSpecificScope(type, inScopeSet); -}; - -HTMLParser.ElementStack.prototype.inButtonScope = function(tag) { - return this.inSpecificScope(tag, inButtonScopeSet); -}; - -HTMLParser.ElementStack.prototype.inListItemScope = function(tag) { - return this.inSpecificScope(tag, inListItemScopeSet); -}; - -HTMLParser.ElementStack.prototype.inTableScope = function(tag) { - return this.inSpecificScope(tag, inTableScopeSet); -}; - -HTMLParser.ElementStack.prototype.inSelectScope = function(tag) { - // Can't implement this one with inSpecificScope, since it involves - // a set defined by inverting another set. So implement manually. - for(var i = this.elements.length-1; i >= 0; i--) { - var elt = this.elements[i]; - if (elt.namespaceURI !== NAMESPACE.HTML) return false; - var localname = elt.localName; - if (localname === tag) return true; - if (localname !== "optgroup" && localname !== "option") - return false; - } - return false; -}; - -HTMLParser.ElementStack.prototype.generateImpliedEndTags = function(butnot, thorough) { - var endTagSet = thorough ? thoroughImpliedEndTagsSet : impliedEndTagsSet; - for(var i = this.elements.length-1; i >= 0; i--) { - var e = this.elements[i]; - if (butnot && isA(e, butnot)) break; - if (!isA(this.elements[i], endTagSet)) break; - } - - this.elements.length = i+1; - this.top = this.elements[i]; -}; - -/*** - * The ActiveFormattingElements class - */ -HTMLParser.ActiveFormattingElements = function AFE() { - this.list = []; // elements - this.attrs = []; // attribute tokens for cloning -}; - -HTMLParser.ActiveFormattingElements.prototype.MARKER = { localName: "|" }; - -/* -// For debugging -HTMLParser.ActiveFormattingElements.prototype.toString = function() { - return "AFE: " + - this.list.map(function(e) { return e.localName; }).join("-"); -} -*/ - -HTMLParser.ActiveFormattingElements.prototype.insertMarker = function() { - this.list.push(this.MARKER); - this.attrs.push(this.MARKER); -}; - -HTMLParser.ActiveFormattingElements.prototype.push = function(elt, attrs) { - // Scan backwards: if there are already 3 copies of this element - // before we encounter a marker, then drop the last one - var count = 0; - for(var i = this.list.length-1; i >= 0; i--) { - if (this.list[i] === this.MARKER) break; - // equal() is defined below - if (equal(elt, this.list[i], this.attrs[i])) { - count++; - if (count === 3) { - this.list.splice(i, 1); - this.attrs.splice(i, 1); - break; - } - } - } - - - // Now push the element onto the list - this.list.push(elt); - - // Copy the attributes and push those on, too - var attrcopy = []; - for(var ii = 0; ii < attrs.length; ii++) { - attrcopy[ii] = attrs[ii]; - } - - this.attrs.push(attrcopy); - - // This function defines equality of two elements for the purposes - // of the AFE list. Note that it compares the new elements - // attributes to the saved array of attributes associated with - // the old element because a script could have changed the - // old element's set of attributes - function equal(newelt, oldelt, oldattrs) { - if (newelt.localName !== oldelt.localName) return false; - if (newelt._numattrs !== oldattrs.length) return false; - for(var i = 0, n = oldattrs.length; i < n; i++) { - var oldname = oldattrs[i][0]; - var oldval = oldattrs[i][1]; - if (!newelt.hasAttribute(oldname)) return false; - if (newelt.getAttribute(oldname) !== oldval) return false; - } - return true; - } -}; - -HTMLParser.ActiveFormattingElements.prototype.clearToMarker = function() { - for(var i = this.list.length-1; i >= 0; i--) { - if (this.list[i] === this.MARKER) break; - } - if (i < 0) i = 0; - this.list.length = i; - this.attrs.length = i; -}; - -// Find and return the last element with the specified tag between the -// end of the list and the last marker on the list. -// Used when parsing in_body_mode() -HTMLParser.ActiveFormattingElements.prototype.findElementByTag = function(tag) { - for(var i = this.list.length-1; i >= 0; i--) { - var elt = this.list[i]; - if (elt === this.MARKER) break; - if (elt.localName === tag) return elt; - } - return null; -}; - -HTMLParser.ActiveFormattingElements.prototype.indexOf = function(e) { - return this.list.lastIndexOf(e); -}; - -// Find the element e in the list and remove it -// Used when parsing in_body() -HTMLParser.ActiveFormattingElements.prototype.remove = function(e) { - var idx = this.list.lastIndexOf(e); - if (idx !== -1) { - this.list.splice(idx, 1); - this.attrs.splice(idx, 1); - } -}; - -// Find element a in the list and replace it with element b -// XXX: Do I need to handle attributes here? -HTMLParser.ActiveFormattingElements.prototype.replace = function(a, b, attrs) { - var idx = this.list.lastIndexOf(a); - if (idx !== -1) { - this.list[idx] = b; - this.attrs[idx] = attrs; - } -}; - -// Find a in the list and insert b after it -// This is only used for insert a bookmark object, so the -// attrs array doesn't really matter -HTMLParser.ActiveFormattingElements.prototype.insertAfter = function(a,b) { - var idx = this.list.lastIndexOf(a); - if (idx !== -1) { - this.list.splice(idx, 0, b); - this.attrs.splice(idx, 0, b); - } -}; - - - - -/*** - * This is the parser factory function. It is the return value of - * the outer closure that it is defined within. Most of the parser - * implementation details are inside this function. - */ -function HTMLParser(address, fragmentContext, options) { - /*** - * These are the parser's state variables - */ - // Scanner state - var chars = null; - var numchars = 0; // Length of chars - var nextchar = 0; // Index of next char - var input_complete = false; // Becomes true when end() called. - var scanner_skip_newline = false; // If previous char was CR - var reentrant_invocations = 0; - var saved_scanner_state = []; - var leftovers = ""; - var first_batch = true; - var paused = 0; // Becomes non-zero while loading scripts - - - // Tokenizer state - var tokenizer = data_state; // Current tokenizer state - var return_state; - var character_reference_code; - var tagnamebuf = ""; - var lasttagname = ""; // holds the target end tag for text states - var tempbuf = []; - var attrnamebuf = ""; - var attrvaluebuf = ""; - var commentbuf = []; - var doctypenamebuf = []; - var doctypepublicbuf = []; - var doctypesystembuf = []; - var attributes = []; - var is_end_tag = false; - - // Tree builder state - var parser = initial_mode; // Current insertion mode - var originalInsertionMode = null; // A saved insertion mode - var templateInsertionModes = []; // Stack of template insertion modes. - var stack = new HTMLParser.ElementStack(); // Stack of open elements - var afe = new HTMLParser.ActiveFormattingElements(); // mis-nested tags - var fragment = (fragmentContext!==undefined); // For innerHTML, etc. - var head_element_pointer = null; - var form_element_pointer = null; - var scripting_enabled = true; - if (fragmentContext) { - scripting_enabled = fragmentContext.ownerDocument._scripting_enabled; - } - if (options && options.scripting_enabled === false) - scripting_enabled = false; - var frameset_ok = true; - var force_quirks = false; - var pending_table_text; - var text_integration_mode; // XXX a spec bug workaround? - - // A single run of characters, buffered up to be sent to - // the parser as a single string. - var textrun = []; - var textIncludesNUL = false; - var ignore_linefeed = false; - - /*** - * This is the parser object that will be the return value of this - * factory function, which is some 5000 lines below. - * Note that the variable "parser" is the current state of the - * parser's state machine. This variable "htmlparser" is the - * return value and defines the public API of the parser - */ - var htmlparser = { - document: function() { - return doc; - }, - - // Convenience function for internal use. Can only be called once, - // as it removes the nodes from `doc` to add them to fragment. - _asDocumentFragment: function() { - var frag = doc.createDocumentFragment(); - var root = doc.firstChild; - while(root.hasChildNodes()) { - frag.appendChild(root.firstChild); - } - return frag; - }, - - // Internal function used from HTMLScriptElement to pause the - // parser while a script is being loaded from the network - pause: function() { - // print("pausing parser"); - paused++; - }, - - // Called when a script finishes loading - resume: function() { - // print("resuming parser"); - paused--; - // XXX: added this to force a resumption. - // Is this the right thing to do? - this.parse(""); - }, - - // Parse the HTML text s. - // The second argument should be true if there is no more - // text to be parsed, and should be false or omitted otherwise. - // The second argument must not be set for recursive invocations - // from document.write() - parse: function(s, end, shouldPauseFunc) { - var moreToDo; - - // If we're paused, remember the text to parse, but - // don't parse it now. - // (Don't invoke shouldPauseFunc because we haven't handled 'end' yet.) - if (paused > 0) { - leftovers += s; - return true; // more to do - } - - - if (reentrant_invocations === 0) { - // A normal, top-level invocation - if (leftovers) { - s = leftovers + s; - leftovers = ""; - } - - // Add a special marker character to the end of - // the buffer. If the scanner is at the end of - // the buffer and input_complete is set, then this - // character will transform into an EOF token. - // Having an actual character that represents EOF - // in the character buffer makes lookahead regexp - // matching work more easily, and this is - // important for character references. - if (end) { - s += "\uFFFF"; - input_complete = true; // Makes scanChars() send EOF - } - - chars = s; - numchars = s.length; - nextchar = 0; - - if (first_batch) { - // We skip a leading Byte Order Mark (\uFEFF) - // on first batch of text we're given - first_batch = false; - if (chars.charCodeAt(0) === 0xFEFF) nextchar = 1; - } - - reentrant_invocations++; - moreToDo = scanChars(shouldPauseFunc); - leftovers = chars.substring(nextchar, numchars); - reentrant_invocations--; - } - else { - // This is the re-entrant case, which we have to - // handle a little differently. - reentrant_invocations++; - - // Save current scanner state - saved_scanner_state.push(chars, numchars, nextchar); - - // Set new scanner state - chars = s; - numchars = s.length; - nextchar = 0; - - // Now scan as many of these new chars as we can - scanChars(); - moreToDo = false; - - leftovers = chars.substring(nextchar, numchars); - - // restore old scanner state - nextchar = saved_scanner_state.pop(); - numchars = saved_scanner_state.pop(); - chars = saved_scanner_state.pop(); - - // If there were leftover chars from this invocation - // insert them into the pending invocation's buffer - // and trim already processed chars at the same time - if (leftovers) { - chars = leftovers + chars.substring(nextchar); - numchars = chars.length; - nextchar = 0; - leftovers = ""; - } - - // Decrement the counter - reentrant_invocations--; - } - return moreToDo; - } - }; - - - // This is the document we'll be building up - var doc = new Document(true, address); - - // The document needs to know about the parser, for document.write(). - // This _parser property will be deleted when we're done parsing. - doc._parser = htmlparser; - - // XXX I think that any document we use this parser on should support - // scripts. But I may need to configure that through a parser parameter - // Only documents with windows ("browsing contexts" to be precise) - // allow scripting. - doc._scripting_enabled = scripting_enabled; - - - /*** - * The actual code of the HTMLParser() factory function begins here. - */ - - if (fragmentContext) { // for innerHTML parsing - if (fragmentContext.ownerDocument._quirks) - doc._quirks = true; - if (fragmentContext.ownerDocument._limitedQuirks) - doc._limitedQuirks = true; - - // Set the initial tokenizer state - if (fragmentContext.namespaceURI === NAMESPACE.HTML) { - switch(fragmentContext.localName) { - case "title": - case "textarea": - tokenizer = rcdata_state; - break; - case "style": - case "xmp": - case "iframe": - case "noembed": - case "noframes": - case "script": - case "plaintext": - tokenizer = plaintext_state; - break; - } - } - - var root = doc.createElement("html"); - doc._appendChild(root); - stack.push(root); - if (fragmentContext instanceof impl.HTMLTemplateElement) { - templateInsertionModes.push(in_template_mode); - } - resetInsertionMode(); - - for(var e = fragmentContext; e !== null; e = e.parentElement) { - if (e instanceof impl.HTMLFormElement) { - form_element_pointer = e; - break; - } - } - } - - /*** - * Scanner functions - */ - // Loop through the characters in chars, and pass them one at a time - // to the tokenizer FSM. Return when no more characters can be processed - // (This may leave 1 or more characters in the buffer: like a CR - // waiting to see if the next char is LF, or for states that require - // lookahead...) - function scanChars(shouldPauseFunc) { - var codepoint, s, pattern, eof; - - while(nextchar < numchars) { - - // If we just tokenized a tag, then the paused flag - // may have been set to tell us to stop tokenizing while - // the script is loading - if (paused > 0 || (shouldPauseFunc && shouldPauseFunc())) { - return true; - } - - - switch(typeof tokenizer.lookahead) { - case 'undefined': - codepoint = chars.charCodeAt(nextchar++); - if (scanner_skip_newline) { - scanner_skip_newline = false; - if (codepoint === 0x000A) { - nextchar++; - continue; - } - } - switch(codepoint) { - case 0x000D: - // CR always turns into LF, but if the next character - // is LF, then that second LF is skipped. - if (nextchar < numchars) { - if (chars.charCodeAt(nextchar) === 0x000A) - nextchar++; - } - else { - // We don't know the next char right now, so we - // can't check if it is a LF. So set a flag - scanner_skip_newline = true; - } - - // In either case, emit a LF - tokenizer(0x000A); - - break; - case 0xFFFF: - if (input_complete && nextchar === numchars) { - tokenizer(EOF); // codepoint will be 0xFFFF here - break; - } - /* falls through */ - default: - tokenizer(codepoint); - break; - } - break; - - case 'number': - codepoint = chars.charCodeAt(nextchar); - - // The only tokenizer states that require fixed lookahead - // only consume alphanum characters, so we don't have - // to worry about CR and LF in this case - - // tokenizer wants n chars of lookahead - var n = tokenizer.lookahead; - var needsString = true; - if (n < 0) { - needsString = false; - n = -n; - } - - if (n < numchars - nextchar) { - // If we can look ahead that far - s = needsString ? chars.substring(nextchar, nextchar+n) : null; - eof = false; - } - else { // if we don't have that many characters - if (input_complete) { // If no more are coming - // Just return what we have - s = needsString ? chars.substring(nextchar, numchars) : null; - eof = true; - if (codepoint === 0xFFFF && nextchar === numchars-1) - codepoint = EOF; - } - else { - // Return now and wait for more chars later - return true; - } - } - tokenizer(codepoint, s, eof); - break; - case 'string': - codepoint = chars.charCodeAt(nextchar); - - // tokenizer wants characters up to a matching string - pattern = tokenizer.lookahead; - var pos = chars.indexOf(pattern, nextchar); - if (pos !== -1) { - s = chars.substring(nextchar, pos + pattern.length); - eof = false; - } - else { // No match - // If more characters coming, wait for them - if (!input_complete) return true; - - // Otherwise, we've got to return what we've got - s = chars.substring(nextchar, numchars); - if (codepoint === 0xFFFF && nextchar === numchars-1) - codepoint = EOF; - eof = true; - } - - // The tokenizer states that require this kind of - // lookahead have to be careful to handle CR characters - // correctly - tokenizer(codepoint, s, eof); - break; - } - } - return false; // no more characters to scan! - } - - - /*** - * Tokenizer utility functions - */ - function addAttribute(name,value) { - // Make sure there isn't already an attribute with this name - // If there is, ignore this one. - for(var i = 0; i < attributes.length; i++) { - if (attributes[i][0] === name) return; - } - - if (value !== undefined) { - attributes.push([name, value]); - } - else { - attributes.push([name]); - } - } - - // Shortcut for simple attributes - function handleSimpleAttribute() { - SIMPLEATTR.lastIndex = nextchar-1; - var matched = SIMPLEATTR.exec(chars); - if (!matched) throw new Error("should never happen"); - var name = matched[1]; - if (!name) return false; - var value = matched[2]; - var len = value.length; - switch(value[0]) { - case '"': - case "'": - value = value.substring(1, len-1); - nextchar += (matched[0].length-1); - tokenizer = after_attribute_value_quoted_state; - break; - default: - tokenizer = before_attribute_name_state; - nextchar += (matched[0].length-1); - value = value.substring(0, len-1); - break; - } - - // Make sure there isn't already an attribute with this name - // If there is, ignore this one. - for(var i = 0; i < attributes.length; i++) { - if (attributes[i][0] === name) return true; - } - - attributes.push([name, value]); - return true; - } - - function beginTagName() { - is_end_tag = false; - tagnamebuf = ""; - attributes.length = 0; - } - function beginEndTagName() { - is_end_tag = true; - tagnamebuf = ""; - attributes.length = 0; - } - - function beginTempBuf() { tempbuf.length = 0; } - function beginAttrName() { attrnamebuf = ""; } - function beginAttrValue() { attrvaluebuf = ""; } - function beginComment() { commentbuf.length = 0; } - function beginDoctype() { - doctypenamebuf.length = 0; - doctypepublicbuf = null; - doctypesystembuf = null; - } - function beginDoctypePublicId() { doctypepublicbuf = []; } - function beginDoctypeSystemId() { doctypesystembuf = []; } - function forcequirks() { force_quirks = true; } - function cdataAllowed() { - return stack.top && - stack.top.namespaceURI !== "http://www.w3.org/1999/xhtml"; - } - - // Return true if the codepoints in the specified buffer match the - // characters of lasttagname - function appropriateEndTag(buf) { - return lasttagname === buf; - } - - function flushText() { - if (textrun.length > 0) { - var s = buf2str(textrun); - textrun.length = 0; - - if (ignore_linefeed) { - ignore_linefeed = false; - if (s[0] === "\n") s = s.substring(1); - if (s.length === 0) return; - } - - insertToken(TEXT, s); - textIncludesNUL = false; - } - ignore_linefeed = false; - } - - // Consume chars matched by the pattern and return them as a string. Starts - // matching at the current position, so users should drop the current char - // otherwise. - function getMatchingChars(pattern) { - pattern.lastIndex = nextchar - 1; - var match = pattern.exec(chars); - if (match && match.index === nextchar - 1) { - match = match[0]; - nextchar += match.length - 1; - /* Careful! Make sure we haven't matched the EOF character! */ - if (input_complete && nextchar === numchars) { - // Oops, backup one. - match = match.slice(0, -1); - nextchar--; - } - return match; - } else { - throw new Error("should never happen"); - } - } - - // emit a string of chars that match a regexp - // Returns false if no chars matched. - function emitCharsWhile(pattern) { - pattern.lastIndex = nextchar-1; - var match = pattern.exec(chars)[0]; - if (!match) return false; - emitCharString(match); - nextchar += match.length - 1; - return true; - } - - // This is used by CDATA sections - function emitCharString(s) { - if (textrun.length > 0) flushText(); - - if (ignore_linefeed) { - ignore_linefeed = false; - if (s[0] === "\n") s = s.substring(1); - if (s.length === 0) return; - } - - insertToken(TEXT, s); - } - - function emitTag() { - if (is_end_tag) insertToken(ENDTAG, tagnamebuf); - else { - // Remember the last open tag we emitted - var tagname = tagnamebuf; - tagnamebuf = ""; - lasttagname = tagname; - insertToken(TAG, tagname, attributes); - } - } - - - // A shortcut: look ahead and if this is a open or close tag - // in lowercase with no spaces and no attributes, just emit it now. - function emitSimpleTag() { - if (nextchar === numchars) { return false; /* not even 1 char left */ } - SIMPLETAG.lastIndex = nextchar; - var matched = SIMPLETAG.exec(chars); - if (!matched) throw new Error("should never happen"); - var tagname = matched[2]; - if (!tagname) return false; - var endtag = matched[1]; - if (endtag) { - nextchar += (tagname.length+2); - insertToken(ENDTAG, tagname); - } - else { - nextchar += (tagname.length+1); - lasttagname = tagname; - insertToken(TAG, tagname, NOATTRS); - } - return true; - } - - function emitSelfClosingTag() { - if (is_end_tag) insertToken(ENDTAG, tagnamebuf, null, true); - else { - insertToken(TAG, tagnamebuf, attributes, true); - } - } - - function emitDoctype() { - insertToken(DOCTYPE, - buf2str(doctypenamebuf), - doctypepublicbuf ? buf2str(doctypepublicbuf) : undefined, - doctypesystembuf ? buf2str(doctypesystembuf) : undefined); - } - - function emitEOF() { - flushText(); - parser(EOF); // EOF never goes to insertForeignContent() - doc.modclock = 1; // Start tracking modifications - } - - // Insert a token, either using the current parser insertion mode - // (for HTML stuff) or using the insertForeignToken() method. - var insertToken = htmlparser.insertToken = function insertToken(t, value, arg3, arg4) { - flushText(); - var current = stack.top; - - if (!current || current.namespaceURI === NAMESPACE.HTML) { - // This is the common case - parser(t, value, arg3, arg4); - } - else { - // Otherwise we may need to insert this token as foreign content - if (t !== TAG && t !== TEXT) { - insertForeignToken(t, value, arg3, arg4); - } - else { - // But in some cases we treat it as regular content - if ((isMathmlTextIntegrationPoint(current) && - (t === TEXT || - (t === TAG && - value !== "mglyph" && value !== "malignmark"))) || - (t === TAG && - value === "svg" && - current.namespaceURI === NAMESPACE.MATHML && - current.localName === "annotation-xml") || - isHTMLIntegrationPoint(current)) { - - // XXX: the text_integration_mode stuff is an - // attempted bug workaround of mine - text_integration_mode = true; - parser(t, value, arg3, arg4); - text_integration_mode = false; - } - // Otherwise it is foreign content - else { - insertForeignToken(t, value, arg3, arg4); - } - } - } - }; - - - /*** - * Tree building utility functions - */ - function insertComment(data) { - var parent = stack.top; - if (foster_parent_mode && isA(parent, tablesectionrowSet)) { - fosterParent(function(doc) { return doc.createComment(data); }); - } else { - // "If the adjusted insertion location is inside a template element, - // let it instead be inside the template element's template contents" - if (parent instanceof impl.HTMLTemplateElement) { - parent = parent.content; - } - parent._appendChild(parent.ownerDocument.createComment(data)); - } - } - - function insertText(s) { - var parent = stack.top; - if (foster_parent_mode && isA(parent, tablesectionrowSet)) { - fosterParent(function(doc) { return doc.createTextNode(s); }); - } else { - // "If the adjusted insertion location is inside a template element, - // let it instead be inside the template element's template contents" - if (parent instanceof impl.HTMLTemplateElement) { - parent = parent.content; - } - // "If there is a Text node immediately before the adjusted insertion - // location, then append data to that Text node's data." - var lastChild = parent.lastChild; - if (lastChild && lastChild.nodeType === Node.TEXT_NODE) { - lastChild.appendData(s); - } else { - parent._appendChild(parent.ownerDocument.createTextNode(s)); - } - } - } - - function createHTMLElt(doc, name, attrs) { - // Create the element this way, rather than with - // doc.createElement because createElement() does error - // checking on the element name that we need to avoid here. - var elt = html.createElement(doc, name, null); - - if (attrs) { - for(var i = 0, n = attrs.length; i < n; i++) { - // Use the _ version to avoid testing the validity - // of the attribute name - elt._setAttribute(attrs[i][0], attrs[i][1]); - } - } - // XXX - // If the element is a resettable form element, - // run its reset algorithm now - // XXX - // handle case where form-element-pointer is not null - return elt; - } - - // The in_table insertion mode turns on this flag, and that makes - // insertHTMLElement use the foster parenting algorithm for elements - // tags inside a table - var foster_parent_mode = false; - - function insertHTMLElement(name, attrs) { - var elt = insertElement(function(doc) { - return createHTMLElt(doc, name, attrs); - }); - - // XXX - // If this is a form element, set its form attribute property here - if (isA(elt, formassociatedSet)) { - elt._form = form_element_pointer; - } - - return elt; - } - - // Insert the element into the open element or foster parent it - function insertElement(eltFunc) { - var elt; - if (foster_parent_mode && isA(stack.top, tablesectionrowSet)) { - elt = fosterParent(eltFunc); - } - else if (stack.top instanceof impl.HTMLTemplateElement) { - // "If the adjusted insertion location is inside a template element, - // let it instead be inside the template element's template contents" - elt = eltFunc(stack.top.content.ownerDocument); - stack.top.content._appendChild(elt); - } else { - elt = eltFunc(stack.top.ownerDocument); - stack.top._appendChild(elt); - } - - stack.push(elt); - return elt; - } - - function insertForeignElement(name, attrs, ns) { - return insertElement(function(doc) { - // We need to prevent createElementNS from trying to parse `name` as a - // `qname`, so use an internal Document#_createElementNS() interface. - var elt = doc._createElementNS(name, ns, null); - if (attrs) { - for(var i = 0, n = attrs.length; i < n; i++) { - var attr = attrs[i]; - if (attr.length === 2) - elt._setAttribute(attr[0], attr[1]); - else { - elt._setAttributeNS(attr[2], attr[0], attr[1]); - } - } - } - return elt; - }); - } - - function lastElementOfType(type) { - for(var i = stack.elements.length-1; i >= 0; i--) { - if (stack.elements[i] instanceof type) { - return i; - } - } - return -1; - } - - function fosterParent(eltFunc) { - var parent, before, lastTable = -1, lastTemplate = -1, elt; - - lastTable = lastElementOfType(impl.HTMLTableElement); - lastTemplate = lastElementOfType(impl.HTMLTemplateElement); - - if (lastTemplate >= 0 && (lastTable < 0 || lastTemplate > lastTable)) { - parent = stack.elements[lastTemplate]; - } else if (lastTable >= 0) { - parent = stack.elements[lastTable].parentNode; - if (parent) { - before = stack.elements[lastTable]; - } else { - parent = stack.elements[lastTable - 1]; - } - } - if (!parent) parent = stack.elements[0]; // the `html` element. - - // "If the adjusted insertion location is inside a template element, - // let it instead be inside the template element's template contents" - if (parent instanceof impl.HTMLTemplateElement) { - parent = parent.content; - } - // Create element in the appropriate document. - elt = eltFunc(parent.ownerDocument); - - if (elt.nodeType === Node.TEXT_NODE) { - var prev; - if (before) prev = before.previousSibling; - else prev = parent.lastChild; - if (prev && prev.nodeType === Node.TEXT_NODE) { - prev.appendData(elt.data); - return elt; - } - } - if (before) - parent.insertBefore(elt, before); - else - parent._appendChild(elt); - return elt; - } - - - function resetInsertionMode() { - var last = false; - for(var i = stack.elements.length-1; i >= 0; i--) { - var node = stack.elements[i]; - if (i === 0) { - last = true; - if (fragment) { - node = fragmentContext; - } - } - if (node.namespaceURI === NAMESPACE.HTML) { - var tag = node.localName; - switch(tag) { - case "select": - for(var j = i; j > 0; ) { - var ancestor = stack.elements[--j]; - if (ancestor instanceof impl.HTMLTemplateElement) { - break; - } else if (ancestor instanceof impl.HTMLTableElement) { - parser = in_select_in_table_mode; - return; - } - } - parser = in_select_mode; - return; - case "tr": - parser = in_row_mode; - return; - case "tbody": - case "tfoot": - case "thead": - parser = in_table_body_mode; - return; - case "caption": - parser = in_caption_mode; - return; - case "colgroup": - parser = in_column_group_mode; - return; - case "table": - parser = in_table_mode; - return; - case "template": - parser = templateInsertionModes[templateInsertionModes.length-1]; - return; - case "body": - parser = in_body_mode; - return; - case "frameset": - parser = in_frameset_mode; - return; - case "html": - if (head_element_pointer === null) { - parser = before_head_mode; - } else { - parser = after_head_mode; - } - return; - default: - if (!last) { - if (tag === "head") { - parser = in_head_mode; - return; - } - if (tag === "td" || tag === "th") { - parser = in_cell_mode; - return; - } - } - } - } - if (last) { - parser = in_body_mode; - return; - } - } - } - - - function parseRawText(name, attrs) { - insertHTMLElement(name, attrs); - tokenizer = rawtext_state; - originalInsertionMode = parser; - parser = text_mode; - } - - function parseRCDATA(name, attrs) { - insertHTMLElement(name, attrs); - tokenizer = rcdata_state; - originalInsertionMode = parser; - parser = text_mode; - } - - // Make a copy of element i on the list of active formatting - // elements, using its original attributes, not current - // attributes (which may have been modified by a script) - function afeclone(doc, i) { - return { - elt: createHTMLElt(doc, afe.list[i].localName, afe.attrs[i]), - attrs: afe.attrs[i], - }; - } - - - function afereconstruct() { - if (afe.list.length === 0) return; - var entry = afe.list[afe.list.length-1]; - // If the last is a marker , do nothing - if (entry === afe.MARKER) return; - // Or if it is an open element, do nothing - if (stack.elements.lastIndexOf(entry) !== -1) return; - - // Loop backward through the list until we find a marker or an - // open element, and then move forward one from there. - for(var i = afe.list.length-2; i >= 0; i--) { - entry = afe.list[i]; - if (entry === afe.MARKER) break; - if (stack.elements.lastIndexOf(entry) !== -1) break; - } - - // Now loop forward, starting from the element after the current - // one, recreating formatting elements and pushing them back onto - // the list of open elements - for(i = i+1; i < afe.list.length; i++) { - var newelt = insertElement(function(doc) { return afeclone(doc, i).elt; }); - afe.list[i] = newelt; - } - } - - // Used by the adoptionAgency() function - var BOOKMARK = {localName:"BM"}; - - function adoptionAgency(tag) { - // If the current node is an HTML element whose tag name is subject, - // and the current node is not in the list of active formatting - // elements, then pop the current node off the stack of open - // elements and abort these steps. - if (isA(stack.top, tag) && afe.indexOf(stack.top) === -1) { - stack.pop(); - return true; // no more handling required - } - - // Let outer loop counter be zero. - var outer = 0; - - // Outer loop: If outer loop counter is greater than or - // equal to eight, then abort these steps. - while(outer < 8) { - // Increment outer loop counter by one. - outer++; - - // Let the formatting element be the last element in the list - // of active formatting elements that: is between the end of - // the list and the last scope marker in the list, if any, or - // the start of the list otherwise, and has the same tag name - // as the token. - var fmtelt = afe.findElementByTag(tag); - - // If there is no such node, then abort these steps and instead - // act as described in the "any other end tag" entry below. - if (!fmtelt) { - return false; // false means handle by the default case - } - - // Otherwise, if there is such a node, but that node is not in - // the stack of open elements, then this is a parse error; - // remove the element from the list, and abort these steps. - var index = stack.elements.lastIndexOf(fmtelt); - if (index === -1) { - afe.remove(fmtelt); - return true; // true means no more handling required - } - - // Otherwise, if there is such a node, and that node is also in - // the stack of open elements, but the element is not in scope, - // then this is a parse error; ignore the token, and abort - // these steps. - if (!stack.elementInScope(fmtelt)) { - return true; - } - - // Let the furthest block be the topmost node in the stack of - // open elements that is lower in the stack than the formatting - // element, and is an element in the special category. There - // might not be one. - var furthestblock = null, furthestblockindex; - for(var i = index+1; i < stack.elements.length; i++) { - if (isA(stack.elements[i], specialSet)) { - furthestblock = stack.elements[i]; - furthestblockindex = i; - break; - } - } - - // If there is no furthest block, then the UA must skip the - // subsequent steps and instead just pop all the nodes from the - // bottom of the stack of open elements, from the current node - // up to and including the formatting element, and remove the - // formatting element from the list of active formatting - // elements. - if (!furthestblock) { - stack.popElement(fmtelt); - afe.remove(fmtelt); - return true; - } - else { - // Let the common ancestor be the element immediately above - // the formatting element in the stack of open elements. - var ancestor = stack.elements[index-1]; - - // Let a bookmark note the position of the formatting - // element in the list of active formatting elements - // relative to the elements on either side of it in the - // list. - afe.insertAfter(fmtelt, BOOKMARK); - - // Let node and last node be the furthest block. - var node = furthestblock; - var lastnode = furthestblock; - var nodeindex = furthestblockindex; - var nodeafeindex; - - // Let inner loop counter be zero. - var inner = 0; - - while (true) { - - // Increment inner loop counter by one. - inner++; - - // Let node be the element immediately above node in - // the stack of open elements, or if node is no longer - // in the stack of open elements (e.g. because it got - // removed by this algorithm), the element that was - // immediately above node in the stack of open elements - // before node was removed. - node = stack.elements[--nodeindex]; - - // If node is the formatting element, then go - // to the next step in the overall algorithm. - if (node === fmtelt) break; - - // If the inner loop counter is greater than three and node - // is in the list of active formatting elements, then remove - // node from the list of active formatting elements. - nodeafeindex = afe.indexOf(node); - if (inner > 3 && nodeafeindex !== -1) { - afe.remove(node); - nodeafeindex = -1; - } - - // If node is not in the list of active formatting - // elements, then remove node from the stack of open - // elements and then go back to the step labeled inner - // loop. - if (nodeafeindex === -1) { - stack.removeElement(node); - continue; - } - - // Create an element for the token for which the - // element node was created with common ancestor as - // the intended parent, replace the entry for node - // in the list of active formatting elements with an - // entry for the new element, replace the entry for - // node in the stack of open elements with an entry for - // the new element, and let node be the new element. - var newelt = afeclone(ancestor.ownerDocument, nodeafeindex); - afe.replace(node, newelt.elt, newelt.attrs); - stack.elements[nodeindex] = newelt.elt; - node = newelt.elt; - - // If last node is the furthest block, then move the - // aforementioned bookmark to be immediately after the - // new node in the list of active formatting elements. - if (lastnode === furthestblock) { - afe.remove(BOOKMARK); - afe.insertAfter(newelt.elt, BOOKMARK); - } - - // Insert last node into node, first removing it from - // its previous parent node if any. - node._appendChild(lastnode); - - // Let last node be node. - lastnode = node; - } - - // If the common ancestor node is a table, tbody, tfoot, - // thead, or tr element, then, foster parent whatever last - // node ended up being in the previous step, first removing - // it from its previous parent node if any. - if (foster_parent_mode && isA(ancestor, tablesectionrowSet)) { - fosterParent(function() { return lastnode; }); - } - // Otherwise, append whatever last node ended up being in - // the previous step to the common ancestor node, first - // removing it from its previous parent node if any. - else if (ancestor instanceof impl.HTMLTemplateElement) { - ancestor.content._appendChild(lastnode); - } else { - ancestor._appendChild(lastnode); - } - - // Create an element for the token for which the - // formatting element was created, with furthest block - // as the intended parent. - var newelt2 = afeclone(furthestblock.ownerDocument, afe.indexOf(fmtelt)); - - // Take all of the child nodes of the furthest block and - // append them to the element created in the last step. - while(furthestblock.hasChildNodes()) { - newelt2.elt._appendChild(furthestblock.firstChild); - } - - // Append that new element to the furthest block. - furthestblock._appendChild(newelt2.elt); - - // Remove the formatting element from the list of active - // formatting elements, and insert the new element into the - // list of active formatting elements at the position of - // the aforementioned bookmark. - afe.remove(fmtelt); - afe.replace(BOOKMARK, newelt2.elt, newelt2.attrs); - - // Remove the formatting element from the stack of open - // elements, and insert the new element into the stack of - // open elements immediately below the position of the - // furthest block in that stack. - stack.removeElement(fmtelt); - var pos = stack.elements.lastIndexOf(furthestblock); - stack.elements.splice(pos+1, 0, newelt2.elt); - } - } - - return true; - } - - // We do this when we get /script in in_text_mode - function handleScriptEnd() { - // XXX: - // This is just a stub implementation right now and doesn't run scripts. - // Getting this method right involves the event loop, URL resolution - // script fetching etc. For now I just want to be able to parse - // documents and test the parser. - - //var script = stack.top; - stack.pop(); - parser = originalInsertionMode; - //script._prepare(); - return; - - // XXX: here is what this method is supposed to do - - // Provide a stable state. - - // Let script be the current node (which will be a script - // element). - - // Pop the current node off the stack of open elements. - - // Switch the insertion mode to the original insertion mode. - - // Let the old insertion point have the same value as the current - // insertion point. Let the insertion point be just before the - // next input character. - - // Increment the parser's script nesting level by one. - - // Prepare the script. This might cause some script to execute, - // which might cause new characters to be inserted into the - // tokenizer, and might cause the tokenizer to output more tokens, - // resulting in a reentrant invocation of the parser. - - // Decrement the parser's script nesting level by one. If the - // parser's script nesting level is zero, then set the parser - // pause flag to false. - - // Let the insertion point have the value of the old insertion - // point. (In other words, restore the insertion point to its - // previous value. This value might be the "undefined" value.) - - // At this stage, if there is a pending parsing-blocking script, - // then: - - // If the script nesting level is not zero: - - // Set the parser pause flag to true, and abort the processing - // of any nested invocations of the tokenizer, yielding - // control back to the caller. (Tokenization will resume when - // the caller returns to the "outer" tree construction stage.) - - // The tree construction stage of this particular parser is - // being called reentrantly, say from a call to - // document.write(). - - // Otherwise: - - // Run these steps: - - // Let the script be the pending parsing-blocking - // script. There is no longer a pending - // parsing-blocking script. - - // Block the tokenizer for this instance of the HTML - // parser, such that the event loop will not run tasks - // that invoke the tokenizer. - - // If the parser's Document has a style sheet that is - // blocking scripts or the script's "ready to be - // parser-executed" flag is not set: spin the event - // loop until the parser's Document has no style sheet - // that is blocking scripts and the script's "ready to - // be parser-executed" flag is set. - - // Unblock the tokenizer for this instance of the HTML - // parser, such that tasks that invoke the tokenizer - // can again be run. - - // Let the insertion point be just before the next - // input character. - - // Increment the parser's script nesting level by one - // (it should be zero before this step, so this sets - // it to one). - - // Execute the script. - - // Decrement the parser's script nesting level by - // one. If the parser's script nesting level is zero - // (which it always should be at this point), then set - // the parser pause flag to false. - - // Let the insertion point be undefined again. - - // If there is once again a pending parsing-blocking - // script, then repeat these steps from step 1. - - - } - - function stopParsing() { - // XXX This is just a temporary implementation to get the parser working. - // A full implementation involves scripts and events and the event loop. - - // Remove the link from document to parser. - // This is instead of "set the insertion point to undefined". - // It means that document.write() can't write into the doc anymore. - delete doc._parser; - - stack.elements.length = 0; // pop everything off - - // If there is a window object associated with the document - // then trigger an load event on it - if (doc.defaultView) { - doc.defaultView.dispatchEvent(new impl.Event("load",{})); - } - - } - - /**** - * Tokenizer states - */ - - /** - * This file was partially mechanically generated from - * http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html - * - * After mechanical conversion, it was further converted from - * prose to JS by hand, but the intent is that it is a very - * faithful rendering of the HTML tokenization spec in - * JavaScript. - * - * It is not a goal of this tokenizer to detect or report - * parse errors. - * - * XXX The tokenizer is supposed to work with straight UTF32 - * codepoints. But I don't think it has any dependencies on - * any character outside of the BMP so I think it is safe to - * pass it UTF16 characters. I don't think it will ever change - * state in the middle of a surrogate pair. - */ - - /* - * Each state is represented by a function. For most states, the - * scanner simply passes the next character (as an integer - * codepoint) to the current state function and automatically - * consumes the character. If the state function can't process - * the character it can call pushback() to push it back to the - * scanner. - * - * Some states require lookahead, though. If a state function has - * a lookahead property, then it is invoked differently. In this - * case, the scanner invokes the function with 3 arguments: 1) the - * next codepoint 2) a string of lookahead text 3) a boolean that - * is true if the lookahead goes all the way to the EOF. (XXX - * actually maybe this third is not necessary... the lookahead - * could just include \uFFFF?) - * - * If the lookahead property of a state function is an integer, it - * specifies the number of characters required. If it is a string, - * then the scanner will scan for that string and return all - * characters up to and including that sequence, or up to EOF. If - * the lookahead property is a regexp, then the scanner will match - * the regexp at the current point and return the matching string. - * - * States that require lookahead are responsible for explicitly - * consuming the characters they process. They do this by - * incrementing nextchar by the number of processed characters. - */ - function reconsume(c, new_state) { - tokenizer = new_state; - nextchar--; // pushback - } - - function data_state(c) { - switch(c) { - case 0x0026: // AMPERSAND - return_state = data_state; - tokenizer = character_reference_state; - break; - case 0x003C: // LESS-THAN SIGN - if (emitSimpleTag()) // Shortcut for

,

, etc. - break; - tokenizer = tag_open_state; - break; - case 0x0000: // NULL - // Usually null characters emitted by the tokenizer will be - // ignored by the tree builder, but sometimes they'll be - // converted to \uFFFD. I don't want to have the search every - // string emitted to replace NULs, so I'll set a flag - // if I've emitted a NUL. - textrun.push(c); - textIncludesNUL = true; - break; - case -1: // EOF - emitEOF(); - break; - default: - // Instead of just pushing a single character and then - // coming back to the very same place, lookahead and - // emit everything we can at once. - /*jshint -W030 */ - emitCharsWhile(DATATEXT) || textrun.push(c); - break; - } - } - - function rcdata_state(c) { - // Save the open tag so we can find a matching close tag - switch(c) { - case 0x0026: // AMPERSAND - return_state = rcdata_state; - tokenizer = character_reference_state; - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = rcdata_less_than_sign_state; - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - textIncludesNUL = true; - break; - case -1: // EOF - emitEOF(); - break; - default: - textrun.push(c); - break; - } - } - - function rawtext_state(c) { - switch(c) { - case 0x003C: // LESS-THAN SIGN - tokenizer = rawtext_less_than_sign_state; - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - /*jshint -W030 */ - emitCharsWhile(RAWTEXT) || textrun.push(c); - break; - } - } - - function script_data_state(c) { - switch(c) { - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_less_than_sign_state; - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - /*jshint -W030 */ - emitCharsWhile(RAWTEXT) || textrun.push(c); - break; - } - } - - function plaintext_state(c) { - switch(c) { - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - /*jshint -W030 */ - emitCharsWhile(PLAINTEXT) || textrun.push(c); - break; - } - } - - function tag_open_state(c) { - switch(c) { - case 0x0021: // EXCLAMATION MARK - tokenizer = markup_declaration_open_state; - break; - case 0x002F: // SOLIDUS - tokenizer = end_tag_open_state; - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginTagName(); - reconsume(c, tag_name_state); - break; - case 0x003F: // QUESTION MARK - reconsume(c, bogus_comment_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, data_state); - break; - } - } - - function end_tag_open_state(c) { - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, tag_name_state); - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - break; - case -1: // EOF - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - emitEOF(); - break; - default: - reconsume(c, bogus_comment_state); - break; - } - } - - function tag_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_attribute_name_state; - break; - case 0x002F: // SOLIDUS - tokenizer = self_closing_start_tag_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitTag(); - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tagnamebuf += String.fromCharCode(c + 0x0020); - break; - case 0x0000: // NULL - tagnamebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - emitEOF(); - break; - default: - tagnamebuf += getMatchingChars(TAGNAME); - break; - } - } - - function rcdata_less_than_sign_state(c) { - /* identical to the RAWTEXT less-than sign state, except s/RAWTEXT/RCDATA/g */ - if (c === 0x002F) { // SOLIDUS - beginTempBuf(); - tokenizer = rcdata_end_tag_open_state; - } - else { - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, rcdata_state); - } - } - - function rcdata_end_tag_open_state(c) { - /* identical to the RAWTEXT (and Script data) end tag open state, except s/RAWTEXT/RCDATA/g */ - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, rcdata_end_tag_name_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - reconsume(c, rcdata_state); - break; - } - } - - function rcdata_end_tag_name_state(c) { - /* identical to the RAWTEXT (and Script data) end tag name state, except s/RAWTEXT/RCDATA/g */ - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - if (appropriateEndTag(tagnamebuf)) { - tokenizer = before_attribute_name_state; - return; - } - break; - case 0x002F: // SOLIDUS - if (appropriateEndTag(tagnamebuf)) { - tokenizer = self_closing_start_tag_state; - return; - } - break; - case 0x003E: // GREATER-THAN SIGN - if (appropriateEndTag(tagnamebuf)) { - tokenizer = data_state; - emitTag(); - return; - } - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - - tagnamebuf += String.fromCharCode(c + 0x0020); - tempbuf.push(c); - return; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - - tagnamebuf += String.fromCharCode(c); - tempbuf.push(c); - return; - default: - break; - } - - // If we don't return in one of the cases above, then this was not - // an appropriately matching close tag, so back out by emitting all - // the characters as text - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - pushAll(textrun, tempbuf); - reconsume(c, rcdata_state); - } - - function rawtext_less_than_sign_state(c) { - /* identical to the RCDATA less-than sign state, except s/RCDATA/RAWTEXT/g - */ - if (c === 0x002F) { // SOLIDUS - beginTempBuf(); - tokenizer = rawtext_end_tag_open_state; - } - else { - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, rawtext_state); - } - } - - function rawtext_end_tag_open_state(c) { - /* identical to the RCDATA (and Script data) end tag open state, except s/RCDATA/RAWTEXT/g */ - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, rawtext_end_tag_name_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - reconsume(c, rawtext_state); - break; - } - } - - function rawtext_end_tag_name_state(c) { - /* identical to the RCDATA (and Script data) end tag name state, except s/RCDATA/RAWTEXT/g */ - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - if (appropriateEndTag(tagnamebuf)) { - tokenizer = before_attribute_name_state; - return; - } - break; - case 0x002F: // SOLIDUS - if (appropriateEndTag(tagnamebuf)) { - tokenizer = self_closing_start_tag_state; - return; - } - break; - case 0x003E: // GREATER-THAN SIGN - if (appropriateEndTag(tagnamebuf)) { - tokenizer = data_state; - emitTag(); - return; - } - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tagnamebuf += String.fromCharCode(c + 0x0020); - tempbuf.push(c); - return; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - tagnamebuf += String.fromCharCode(c); - tempbuf.push(c); - return; - default: - break; - } - - // If we don't return in one of the cases above, then this was not - // an appropriately matching close tag, so back out by emitting all - // the characters as text - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - pushAll(textrun,tempbuf); - reconsume(c, rawtext_state); - } - - function script_data_less_than_sign_state(c) { - switch(c) { - case 0x002F: // SOLIDUS - beginTempBuf(); - tokenizer = script_data_end_tag_open_state; - break; - case 0x0021: // EXCLAMATION MARK - tokenizer = script_data_escape_start_state; - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x0021); // EXCLAMATION MARK - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, script_data_state); - break; - } - } - - function script_data_end_tag_open_state(c) { - /* identical to the RCDATA (and RAWTEXT) end tag open state, except s/RCDATA/Script data/g */ - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, script_data_end_tag_name_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - reconsume(c, script_data_state); - break; - } - } - - function script_data_end_tag_name_state(c) { - /* identical to the RCDATA (and RAWTEXT) end tag name state, except s/RCDATA/Script data/g */ - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - if (appropriateEndTag(tagnamebuf)) { - tokenizer = before_attribute_name_state; - return; - } - break; - case 0x002F: // SOLIDUS - if (appropriateEndTag(tagnamebuf)) { - tokenizer = self_closing_start_tag_state; - return; - } - break; - case 0x003E: // GREATER-THAN SIGN - if (appropriateEndTag(tagnamebuf)) { - tokenizer = data_state; - emitTag(); - return; - } - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - - tagnamebuf += String.fromCharCode(c + 0x0020); - tempbuf.push(c); - return; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - - tagnamebuf += String.fromCharCode(c); - tempbuf.push(c); - return; - default: - break; - } - - // If we don't return in one of the cases above, then this was not - // an appropriately matching close tag, so back out by emitting all - // the characters as text - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - pushAll(textrun,tempbuf); - reconsume(c, script_data_state); - } - - function script_data_escape_start_state(c) { - if (c === 0x002D) { // HYPHEN-MINUS - tokenizer = script_data_escape_start_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - } - else { - reconsume(c, script_data_state); - } - } - - function script_data_escape_start_dash_state(c) { - if (c === 0x002D) { // HYPHEN-MINUS - tokenizer = script_data_escaped_dash_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - } - else { - reconsume(c, script_data_state); - } - } - - function script_data_escaped_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = script_data_escaped_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_escaped_less_than_sign_state; - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - textrun.push(c); - break; - } - } - - function script_data_escaped_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = script_data_escaped_dash_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_escaped_less_than_sign_state; - break; - case 0x0000: // NULL - tokenizer = script_data_escaped_state; - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - tokenizer = script_data_escaped_state; - textrun.push(c); - break; - } - } - - function script_data_escaped_dash_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_escaped_less_than_sign_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = script_data_state; - textrun.push(0x003E); // GREATER-THAN SIGN - break; - case 0x0000: // NULL - tokenizer = script_data_escaped_state; - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - tokenizer = script_data_escaped_state; - textrun.push(c); - break; - } - } - - function script_data_escaped_less_than_sign_state(c) { - switch(c) { - case 0x002F: // SOLIDUS - beginTempBuf(); - tokenizer = script_data_escaped_end_tag_open_state; - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginTempBuf(); - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, script_data_double_escape_start_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, script_data_escaped_state); - break; - } - } - - function script_data_escaped_end_tag_open_state(c) { - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, script_data_escaped_end_tag_name_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - reconsume(c, script_data_escaped_state); - break; - } - } - - function script_data_escaped_end_tag_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - if (appropriateEndTag(tagnamebuf)) { - tokenizer = before_attribute_name_state; - return; - } - break; - case 0x002F: // SOLIDUS - if (appropriateEndTag(tagnamebuf)) { - tokenizer = self_closing_start_tag_state; - return; - } - break; - case 0x003E: // GREATER-THAN SIGN - if (appropriateEndTag(tagnamebuf)) { - tokenizer = data_state; - emitTag(); - return; - } - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tagnamebuf += String.fromCharCode(c + 0x0020); - tempbuf.push(c); - return; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - tagnamebuf += String.fromCharCode(c); - tempbuf.push(c); - return; - default: - break; - } - - // We get here in the default case, and if the closing tagname - // is not an appropriate tagname. - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - pushAll(textrun,tempbuf); - reconsume(c, script_data_escaped_state); - } - - function script_data_double_escape_start_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - case 0x002F: // SOLIDUS - case 0x003E: // GREATER-THAN SIGN - if (buf2str(tempbuf) === "script") { - tokenizer = script_data_double_escaped_state; - } - else { - tokenizer = script_data_escaped_state; - } - textrun.push(c); - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tempbuf.push(c + 0x0020); - textrun.push(c); - break; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - tempbuf.push(c); - textrun.push(c); - break; - default: - reconsume(c, script_data_escaped_state); - break; - } - } - - function script_data_double_escaped_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = script_data_double_escaped_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_double_escaped_less_than_sign_state; - textrun.push(0x003C); // LESS-THAN SIGN - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - textrun.push(c); - break; - } - } - - function script_data_double_escaped_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = script_data_double_escaped_dash_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_double_escaped_less_than_sign_state; - textrun.push(0x003C); // LESS-THAN SIGN - break; - case 0x0000: // NULL - tokenizer = script_data_double_escaped_state; - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - tokenizer = script_data_double_escaped_state; - textrun.push(c); - break; - } - } - - function script_data_double_escaped_dash_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_double_escaped_less_than_sign_state; - textrun.push(0x003C); // LESS-THAN SIGN - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = script_data_state; - textrun.push(0x003E); // GREATER-THAN SIGN - break; - case 0x0000: // NULL - tokenizer = script_data_double_escaped_state; - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - tokenizer = script_data_double_escaped_state; - textrun.push(c); - break; - } - } - - function script_data_double_escaped_less_than_sign_state(c) { - if (c === 0x002F) { // SOLIDUS - beginTempBuf(); - tokenizer = script_data_double_escape_end_state; - textrun.push(0x002F); // SOLIDUS - } - else { - reconsume(c, script_data_double_escaped_state); - } - } - - function script_data_double_escape_end_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - case 0x002F: // SOLIDUS - case 0x003E: // GREATER-THAN SIGN - if (buf2str(tempbuf) === "script") { - tokenizer = script_data_escaped_state; - } - else { - tokenizer = script_data_double_escaped_state; - } - textrun.push(c); - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tempbuf.push(c + 0x0020); - textrun.push(c); - break; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - tempbuf.push(c); - textrun.push(c); - break; - default: - reconsume(c, script_data_double_escaped_state); - break; - } - } - - function before_attribute_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - // For SOLIDUS, GREATER-THAN SIGN, and EOF, spec says "reconsume in - // the after attribute name state", but in our implementation that - // state always has an active attribute in attrnamebuf. Just clone - // the rules here, without the addAttribute business. - case 0x002F: // SOLIDUS - tokenizer = self_closing_start_tag_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitTag(); - break; - case -1: // EOF - emitEOF(); - break; - case 0x003D: // EQUALS SIGN - beginAttrName(); - attrnamebuf += String.fromCharCode(c); - tokenizer = attribute_name_state; - break; - default: - if (handleSimpleAttribute()) break; - beginAttrName(); - reconsume(c, attribute_name_state); - break; - } - } - - // beginAttrName() must have been called before this point - // There is an active attribute in attrnamebuf (but not attrvaluebuf) - function attribute_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - case 0x002F: // SOLIDUS - case 0x003E: // GREATER-THAN SIGN - case -1: // EOF - reconsume(c, after_attribute_name_state); - break; - case 0x003D: // EQUALS SIGN - tokenizer = before_attribute_value_state; - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - attrnamebuf += String.fromCharCode(c + 0x0020); - break; - case 0x0000: // NULL - attrnamebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x0022: // QUOTATION MARK - case 0x0027: // APOSTROPHE - case 0x003C: // LESS-THAN SIGN - /* falls through */ - default: - attrnamebuf += getMatchingChars(ATTRNAME); - break; - } - } - - // There is an active attribute in attrnamebuf, but not yet in attrvaluebuf. - function after_attribute_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x002F: // SOLIDUS - // Keep in sync with before_attribute_name_state. - addAttribute(attrnamebuf); - tokenizer = self_closing_start_tag_state; - break; - case 0x003D: // EQUALS SIGN - tokenizer = before_attribute_value_state; - break; - case 0x003E: // GREATER-THAN SIGN - // Keep in sync with before_attribute_name_state. - tokenizer = data_state; - addAttribute(attrnamebuf); - emitTag(); - break; - case -1: // EOF - // Keep in sync with before_attribute_name_state. - addAttribute(attrnamebuf); - emitEOF(); - break; - default: - addAttribute(attrnamebuf); - beginAttrName(); - reconsume(c, attribute_name_state); - break; - } - } - - function before_attribute_value_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x0022: // QUOTATION MARK - beginAttrValue(); - tokenizer = attribute_value_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginAttrValue(); - tokenizer = attribute_value_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - /* falls through */ - default: - beginAttrValue(); - reconsume(c, attribute_value_unquoted_state); - break; - } - } - - function attribute_value_double_quoted_state(c) { - switch(c) { - case 0x0022: // QUOTATION MARK - addAttribute(attrnamebuf, attrvaluebuf); - tokenizer = after_attribute_value_quoted_state; - break; - case 0x0026: // AMPERSAND - return_state = attribute_value_double_quoted_state; - tokenizer = character_reference_state; - break; - case 0x0000: // NULL - attrvaluebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - emitEOF(); - break; - case 0x000A: // LF - // this could be a converted \r, so don't use getMatchingChars - attrvaluebuf += String.fromCharCode(c); - break; - default: - attrvaluebuf += getMatchingChars(DBLQUOTEATTRVAL); - break; - } - } - - function attribute_value_single_quoted_state(c) { - switch(c) { - case 0x0027: // APOSTROPHE - addAttribute(attrnamebuf, attrvaluebuf); - tokenizer = after_attribute_value_quoted_state; - break; - case 0x0026: // AMPERSAND - return_state = attribute_value_single_quoted_state; - tokenizer = character_reference_state; - break; - case 0x0000: // NULL - attrvaluebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - emitEOF(); - break; - case 0x000A: // LF - // this could be a converted \r, so don't use getMatchingChars - attrvaluebuf += String.fromCharCode(c); - break; - default: - attrvaluebuf += getMatchingChars(SINGLEQUOTEATTRVAL); - break; - } - } - - function attribute_value_unquoted_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - addAttribute(attrnamebuf, attrvaluebuf); - tokenizer = before_attribute_name_state; - break; - case 0x0026: // AMPERSAND - return_state = attribute_value_unquoted_state; - tokenizer = character_reference_state; - break; - case 0x003E: // GREATER-THAN SIGN - addAttribute(attrnamebuf, attrvaluebuf); - tokenizer = data_state; - emitTag(); - break; - case 0x0000: // NULL - attrvaluebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - nextchar--; // pushback - tokenizer = data_state; - break; - case 0x0022: // QUOTATION MARK - case 0x0027: // APOSTROPHE - case 0x003C: // LESS-THAN SIGN - case 0x003D: // EQUALS SIGN - case 0x0060: // GRAVE ACCENT - /* falls through */ - default: - attrvaluebuf += getMatchingChars(UNQUOTEDATTRVAL); - break; - } - } - - function after_attribute_value_quoted_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_attribute_name_state; - break; - case 0x002F: // SOLIDUS - tokenizer = self_closing_start_tag_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitTag(); - break; - case -1: // EOF - emitEOF(); - break; - default: - reconsume(c, before_attribute_name_state); - break; - } - } - - function self_closing_start_tag_state(c) { - switch(c) { - case 0x003E: // GREATER-THAN SIGN - // Set the self-closing flag of the current tag token. - tokenizer = data_state; - emitSelfClosingTag(true); - break; - case -1: // EOF - emitEOF(); - break; - default: - reconsume(c, before_attribute_name_state); - break; - } - } - - function bogus_comment_state(c, lookahead, eof) { - var len = lookahead.length; - - if (eof) { - nextchar += len-1; // don't consume the eof - } - else { - nextchar += len; - } - - var comment = lookahead.substring(0, len-1); - - comment = comment.replace(/\u0000/g,"\uFFFD"); - comment = comment.replace(/\u000D\u000A/g,"\u000A"); - comment = comment.replace(/\u000D/g,"\u000A"); - - insertToken(COMMENT, comment); - tokenizer = data_state; - } - bogus_comment_state.lookahead = ">"; - - function markup_declaration_open_state(c, lookahead, eof) { - if (lookahead[0] === "-" && lookahead[1] === "-") { - nextchar += 2; - beginComment(); - tokenizer = comment_start_state; - return; - } - - if (lookahead.toUpperCase() === "DOCTYPE") { - nextchar += 7; - tokenizer = doctype_state; - } - else if (lookahead === "[CDATA[" && cdataAllowed()) { - nextchar += 7; - tokenizer = cdata_section_state; - } - else { - tokenizer = bogus_comment_state; - } - } - markup_declaration_open_state.lookahead = 7; - - function comment_start_state(c) { - beginComment(); - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_start_dash_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - insertToken(COMMENT, buf2str(commentbuf)); - break; /* see comment in comment end state */ - default: - reconsume(c, comment_state); - break; - } - } - - function comment_start_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_end_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - insertToken(COMMENT, buf2str(commentbuf)); - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* see comment in comment end state */ - default: - commentbuf.push(0x002D /* HYPHEN-MINUS */); - reconsume(c, comment_state); - break; - } - } - - function comment_state(c) { - switch(c) { - case 0x003C: // LESS-THAN SIGN - commentbuf.push(c); - tokenizer = comment_less_than_sign_state; - break; - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_end_dash_state; - break; - case 0x0000: // NULL - commentbuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* see comment in comment end state */ - default: - commentbuf.push(c); - break; - } - } - - function comment_less_than_sign_state(c) { - switch(c) { - case 0x0021: // EXCLAMATION MARK - commentbuf.push(c); - tokenizer = comment_less_than_sign_bang_state; - break; - case 0x003C: // LESS-THAN SIGN - commentbuf.push(c); - break; - default: - reconsume(c, comment_state); - break; - } - } - - function comment_less_than_sign_bang_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_less_than_sign_bang_dash_state; - break; - default: - reconsume(c, comment_state); - break; - } - } - - function comment_less_than_sign_bang_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_less_than_sign_bang_dash_dash_state; - break; - default: - reconsume(c, comment_end_dash_state); - break; - } - } - - function comment_less_than_sign_bang_dash_dash_state(c) { - switch(c) { - case 0x003E: // GREATER-THAN SIGN - case -1: // EOF - reconsume(c, comment_end_state); - break; - default: - // parse error - reconsume(c, comment_end_state); - break; - } - } - - function comment_end_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_end_state; - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* see comment in comment end state */ - default: - commentbuf.push(0x002D /* HYPHEN-MINUS */); - reconsume(c, comment_state); - break; - } - } - - function comment_end_state(c) { - switch(c) { - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - insertToken(COMMENT, buf2str(commentbuf)); - break; - case 0x0021: // EXCLAMATION MARK - tokenizer = comment_end_bang_state; - break; - case 0x002D: // HYPHEN-MINUS - commentbuf.push(0x002D); - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* For security reasons: otherwise, hostile user could put a script in a comment e.g. in a blog comment and then DOS the server so that the end tag isn't read, and then the commented script tag would be treated as live code */ - default: - commentbuf.push(0x002D); - commentbuf.push(0x002D); - reconsume(c, comment_state); - break; - } - } - - function comment_end_bang_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - commentbuf.push(0x002D); - commentbuf.push(0x002D); - commentbuf.push(0x0021); - tokenizer = comment_end_dash_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - insertToken(COMMENT, buf2str(commentbuf)); - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* see comment in comment end state */ - default: - commentbuf.push(0x002D); - commentbuf.push(0x002D); - commentbuf.push(0x0021); - reconsume(c, comment_state); - break; - } - } - - function doctype_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_doctype_name_state; - break; - case -1: // EOF - beginDoctype(); - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - reconsume(c, before_doctype_name_state); - break; - } - } - - function before_doctype_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - beginDoctype(); - doctypenamebuf.push(c + 0x0020); - tokenizer = doctype_name_state; - break; - case 0x0000: // NULL - beginDoctype(); - doctypenamebuf.push(0xFFFD); - tokenizer = doctype_name_state; - break; - case 0x003E: // GREATER-THAN SIGN - beginDoctype(); - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - beginDoctype(); - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - beginDoctype(); - doctypenamebuf.push(c); - tokenizer = doctype_name_state; - break; - } - } - - function doctype_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = after_doctype_name_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - doctypenamebuf.push(c + 0x0020); - break; - case 0x0000: // NULL - doctypenamebuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypenamebuf.push(c); - break; - } - } - - function after_doctype_name_state(c, lookahead, eof) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - nextchar += 1; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - nextchar += 1; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - lookahead = lookahead.toUpperCase(); - if (lookahead === "PUBLIC") { - nextchar += 6; - tokenizer = after_doctype_public_keyword_state; - } - else if (lookahead === "SYSTEM") { - nextchar += 6; - tokenizer = after_doctype_system_keyword_state; - } - else { - forcequirks(); - tokenizer = bogus_doctype_state; - } - break; - } - } - after_doctype_name_state.lookahead = 6; - - function after_doctype_public_keyword_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_doctype_public_identifier_state; - break; - case 0x0022: // QUOTATION MARK - beginDoctypePublicId(); - tokenizer = doctype_public_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypePublicId(); - tokenizer = doctype_public_identifier_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function before_doctype_public_identifier_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x0022: // QUOTATION MARK - beginDoctypePublicId(); - tokenizer = doctype_public_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypePublicId(); - tokenizer = doctype_public_identifier_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function doctype_public_identifier_double_quoted_state(c) { - switch(c) { - case 0x0022: // QUOTATION MARK - tokenizer = after_doctype_public_identifier_state; - break; - case 0x0000: // NULL - doctypepublicbuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypepublicbuf.push(c); - break; - } - } - - function doctype_public_identifier_single_quoted_state(c) { - switch(c) { - case 0x0027: // APOSTROPHE - tokenizer = after_doctype_public_identifier_state; - break; - case 0x0000: // NULL - doctypepublicbuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypepublicbuf.push(c); - break; - } - } - - function after_doctype_public_identifier_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = between_doctype_public_and_system_identifiers_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case 0x0022: // QUOTATION MARK - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_single_quoted_state; - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function between_doctype_public_and_system_identifiers_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE Ignore the character. - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case 0x0022: // QUOTATION MARK - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_single_quoted_state; - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function after_doctype_system_keyword_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_doctype_system_identifier_state; - break; - case 0x0022: // QUOTATION MARK - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function before_doctype_system_identifier_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE Ignore the character. - break; - case 0x0022: // QUOTATION MARK - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function doctype_system_identifier_double_quoted_state(c) { - switch(c) { - case 0x0022: // QUOTATION MARK - tokenizer = after_doctype_system_identifier_state; - break; - case 0x0000: // NULL - doctypesystembuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypesystembuf.push(c); - break; - } - } - - function doctype_system_identifier_single_quoted_state(c) { - switch(c) { - case 0x0027: // APOSTROPHE - tokenizer = after_doctype_system_identifier_state; - break; - case 0x0000: // NULL - doctypesystembuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypesystembuf.push(c); - break; - } - } - - function after_doctype_system_identifier_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - tokenizer = bogus_doctype_state; - /* This does *not* set the DOCTYPE token's force-quirks flag. */ - break; - } - } - - function bogus_doctype_state(c) { - switch(c) { - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - emitDoctype(); - emitEOF(); - break; - default: - /* Ignore the character. */ - break; - } - } - - function cdata_section_state(c) { - switch(c) { - case 0x005D: // RIGHT SQUARE BRACKET - tokenizer = cdata_section_bracket_state; - break; - case -1: // EOF - emitEOF(); - break; - case 0x0000: // NULL - textIncludesNUL = true; - /* fall through */ - default: - // Instead of just pushing a single character and then - // coming back to the very same place, lookahead and - // emit everything we can at once. - /*jshint -W030 */ - emitCharsWhile(CDATATEXT) || textrun.push(c); - break; - } - } - - function cdata_section_bracket_state(c) { - switch(c) { - case 0x005D: // RIGHT SQUARE BRACKET - tokenizer = cdata_section_end_state; - break; - default: - textrun.push(0x005D); - reconsume(c, cdata_section_state); - break; - } - } - - function cdata_section_end_state(c) { - switch(c) { - case 0x005D: // RIGHT SQUARE BRACKET - textrun.push(0x005D); - break; - case 0x003E: // GREATER-THAN SIGN - flushText(); - tokenizer = data_state; - break; - default: - textrun.push(0x005D); - textrun.push(0x005D); - reconsume(c, cdata_section_state); - break; - } - } - - function character_reference_state(c) { - beginTempBuf(); - tempbuf.push(0x0026); - switch(c) { - case 0x0009: // TAB - case 0x000A: // LINE FEED - case 0x000C: // FORM FEED - case 0x0020: // SPACE - case 0x003C: // LESS-THAN SIGN - case 0x0026: // AMPERSAND - case -1: // EOF - reconsume(c, character_reference_end_state); - break; - case 0x0023: // NUMBER SIGN - tempbuf.push(c); - tokenizer = numeric_character_reference_state; - break; - default: - reconsume(c, named_character_reference_state); - break; - } - } - - function named_character_reference_state(c) { - NAMEDCHARREF.lastIndex = nextchar; // w/ lookahead no char has been consumed - var matched = NAMEDCHARREF.exec(chars); - if (!matched) throw new Error("should never happen"); - var name = matched[1]; - if (!name) { - // If no match can be made, switch to the character reference end state - tokenizer = character_reference_end_state; - return; - } - - // Consume the matched characters and append them to temporary buffer - nextchar += name.length; - pushAll(tempbuf, str2buf(name)); - - switch(return_state) { - case attribute_value_double_quoted_state: - case attribute_value_single_quoted_state: - case attribute_value_unquoted_state: - // If the character reference was consumed as part of an attribute... - if (name[name.length-1] !== ';') { // ...and the last char is not ; - if (/[=A-Za-z0-9]/.test(chars[nextchar])) { - tokenizer = character_reference_end_state; - return; - } - } - break; - default: - break; - } - - beginTempBuf(); - var rv = namedCharRefs[name]; - if (typeof rv === 'number') { - tempbuf.push(rv); - } else { - pushAll(tempbuf, rv); - } - tokenizer = character_reference_end_state; - } - // We might need to pause tokenization until we have enough characters - // in the buffer for longest possible character reference. - named_character_reference_state.lookahead = -NAMEDCHARREF_MAXLEN; - - function numeric_character_reference_state(c) { - character_reference_code = 0; - switch(c) { - case 0x0078: // x - case 0x0058: // X - tempbuf.push(c); - tokenizer = hexadecimal_character_reference_start_state; - break; - default: - reconsume(c, decimal_character_reference_start_state); - break; - } - } - - function hexadecimal_character_reference_start_state(c) { - switch(c) { - case 0x0030: case 0x0031: case 0x0032: case 0x0033: case 0x0034: - case 0x0035: case 0x0036: case 0x0037: case 0x0038: case 0x0039: // [0-9] - case 0x0041: case 0x0042: case 0x0043: case 0x0044: case 0x0045: - case 0x0046: // [A-F] - case 0x0061: case 0x0062: case 0x0063: case 0x0064: case 0x0065: - case 0x0066: // [a-f] - reconsume(c, hexadecimal_character_reference_state); - break; - default: - reconsume(c, character_reference_end_state); - break; - } - } - - function decimal_character_reference_start_state(c) { - switch(c) { - case 0x0030: case 0x0031: case 0x0032: case 0x0033: case 0x0034: - case 0x0035: case 0x0036: case 0x0037: case 0x0038: case 0x0039: // [0-9] - reconsume(c, decimal_character_reference_state); - break; - default: - reconsume(c, character_reference_end_state); - break; - } - } - - function hexadecimal_character_reference_state(c) { - switch(c) { - case 0x0041: case 0x0042: case 0x0043: case 0x0044: case 0x0045: - case 0x0046: // [A-F] - character_reference_code *= 16; - character_reference_code += (c - 0x0037); - break; - case 0x0061: case 0x0062: case 0x0063: case 0x0064: case 0x0065: - case 0x0066: // [a-f] - character_reference_code *= 16; - character_reference_code += (c - 0x0057); - break; - case 0x0030: case 0x0031: case 0x0032: case 0x0033: case 0x0034: - case 0x0035: case 0x0036: case 0x0037: case 0x0038: case 0x0039: // [0-9] - character_reference_code *= 16; - character_reference_code += (c - 0x0030); - break; - case 0x003B: // SEMICOLON - tokenizer = numeric_character_reference_end_state; - break; - default: - reconsume(c, numeric_character_reference_end_state); - break; - } - } - - function decimal_character_reference_state(c) { - switch(c) { - case 0x0030: case 0x0031: case 0x0032: case 0x0033: case 0x0034: - case 0x0035: case 0x0036: case 0x0037: case 0x0038: case 0x0039: // [0-9] - character_reference_code *= 10; - character_reference_code += (c - 0x0030); - break; - case 0x003B: // SEMICOLON - tokenizer = numeric_character_reference_end_state; - break; - default: - reconsume(c, numeric_character_reference_end_state); - break; - } - } - - function numeric_character_reference_end_state(c) { - if (character_reference_code in numericCharRefReplacements) { - character_reference_code = numericCharRefReplacements[character_reference_code]; - } else if (character_reference_code > 0x10FFFF || (character_reference_code >= 0xD800 && character_reference_code < 0xE000)) { - character_reference_code = 0xFFFD; - } - - beginTempBuf(); - if (character_reference_code <= 0xFFFF) { - tempbuf.push(character_reference_code); - } else { - character_reference_code = character_reference_code - 0x10000; - /* jshint bitwise: false */ - tempbuf.push(0xD800 + (character_reference_code >> 10)); - tempbuf.push(0xDC00 + (character_reference_code & 0x03FF)); - } - reconsume(c, character_reference_end_state); - } - - function character_reference_end_state(c) { - switch(return_state) { - case attribute_value_double_quoted_state: - case attribute_value_single_quoted_state: - case attribute_value_unquoted_state: - // append each character to the current attribute's value - attrvaluebuf += buf2str(tempbuf); - break; - default: - pushAll(textrun, tempbuf); - break; - } - reconsume(c, return_state); - } - - /*** - * The tree builder insertion modes - */ - - // 11.2.5.4.1 The "initial" insertion mode - function initial_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - value = value.replace(LEADINGWS, ""); // Ignore spaces - if (value.length === 0) return; // Are we done? - break; // Handle anything non-space text below - case 4: // COMMENT - doc._appendChild(doc.createComment(value)); - return; - case 5: // DOCTYPE - var name = value; - var publicid = arg3; - var systemid = arg4; - // Use the constructor directly instead of - // implementation.createDocumentType because the create - // function throws errors on invalid characters, and - // we don't want the parser to throw them. - doc.appendChild(new DocumentType(doc, name, publicid, systemid)); - - // Note that there is no public API for setting quirks mode We can - // do this here because we have access to implementation details - if (force_quirks || - name.toLowerCase() !== "html" || - quirkyPublicIds.test(publicid) || - (systemid && systemid.toLowerCase() === quirkySystemId) || - (systemid === undefined && - conditionallyQuirkyPublicIds.test(publicid))) - doc._quirks = true; - else if (limitedQuirkyPublicIds.test(publicid) || - (systemid !== undefined && - conditionallyQuirkyPublicIds.test(publicid))) - doc._limitedQuirks = true; - parser = before_html_mode; - return; - } - - // tags or non-whitespace text - doc._quirks = true; - parser = before_html_mode; - parser(t,value,arg3,arg4); - } - - // 11.2.5.4.2 The "before html" insertion mode - function before_html_mode(t,value,arg3,arg4) { - var elt; - switch(t) { - case 1: // TEXT - value = value.replace(LEADINGWS, ""); // Ignore spaces - if (value.length === 0) return; // Are we done? - break; // Handle anything non-space text below - case 5: // DOCTYPE - /* ignore the token */ - return; - case 4: // COMMENT - doc._appendChild(doc.createComment(value)); - return; - case 2: // TAG - if (value === "html") { - elt = createHTMLElt(doc, value, arg3); - stack.push(elt); - doc.appendChild(elt); - // XXX: handle application cache here - parser = before_head_mode; - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "html": - case "head": - case "body": - case "br": - break; // fall through on these - default: - return; // ignore most end tags - } - } - - // Anything that didn't get handled above is handled like this: - elt = createHTMLElt(doc, "html", null); - stack.push(elt); - doc.appendChild(elt); - // XXX: handle application cache here - parser = before_head_mode; - parser(t,value,arg3,arg4); - } - - // 11.2.5.4.3 The "before head" insertion mode - function before_head_mode(t,value,arg3,arg4) { - switch(t) { - case 1: // TEXT - value = value.replace(LEADINGWS, ""); // Ignore spaces - if (value.length === 0) return; // Are we done? - break; // Handle anything non-space text below - case 5: // DOCTYPE - /* ignore the token */ - return; - case 4: // COMMENT - insertComment(value); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t,value,arg3,arg4); - return; - case "head": - var elt = insertHTMLElement(value, arg3); - head_element_pointer = elt; - parser = in_head_mode; - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "html": - case "head": - case "body": - case "br": - break; - default: - return; // ignore most end tags - } - } - - // If not handled explicitly above - before_head_mode(TAG, "head", null); // create a head tag - parser(t, value, arg3, arg4); // then try again with this token - } - - function in_head_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - var ws = value.match(LEADINGWS); - if (ws) { - insertText(ws[0]); - value = value.substring(ws[0].length); - } - if (value.length === 0) return; - break; // Handle non-whitespace below - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "meta": - // XXX: - // May need to change the encoding based on this tag - /* falls through */ - case "base": - case "basefont": - case "bgsound": - case "link": - insertHTMLElement(value, arg3); - stack.pop(); - return; - case "title": - parseRCDATA(value, arg3); - return; - case "noscript": - if (!scripting_enabled) { - insertHTMLElement(value, arg3); - parser = in_head_noscript_mode; - return; - } - // Otherwise, if scripting is enabled... - /* falls through */ - case "noframes": - case "style": - parseRawText(value,arg3); - return; - case "script": - insertElement(function(doc) { - var elt = createHTMLElt(doc, value, arg3); - elt._parser_inserted = true; - elt._force_async = false; - if (fragment) elt._already_started = true; - flushText(); - return elt; - }); - tokenizer = script_data_state; - originalInsertionMode = parser; - parser = text_mode; - return; - case "template": - insertHTMLElement(value, arg3); - afe.insertMarker(); - frameset_ok = false; - parser = in_template_mode; - templateInsertionModes.push(parser); - return; - case "head": - return; // ignore it - } - break; - case 3: // ENDTAG - switch(value) { - case "head": - stack.pop(); - parser = after_head_mode; - return; - case "body": - case "html": - case "br": - break; // handle these at the bottom of the function - case "template": - if (!stack.contains("template")) { - return; - } - stack.generateImpliedEndTags(null, "thorough"); - stack.popTag("template"); - afe.clearToMarker(); - templateInsertionModes.pop(); - resetInsertionMode(); - return; - default: - // ignore any other end tag - return; - } - break; - } - - // If not handled above - in_head_mode(ENDTAG, "head", null); // synthetic - parser(t, value, arg3, arg4); // Then redo this one - } - - // 13.2.5.4.5 The "in head noscript" insertion mode - function in_head_noscript_mode(t, value, arg3, arg4) { - switch(t) { - case 5: // DOCTYPE - return; - case 4: // COMMENT - in_head_mode(t, value); - return; - case 1: // TEXT - var ws = value.match(LEADINGWS); - if (ws) { - in_head_mode(t, ws[0]); - value = value.substring(ws[0].length); - } - if (value.length === 0) return; // no more text - break; // Handle non-whitespace below - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "basefont": - case "bgsound": - case "link": - case "meta": - case "noframes": - case "style": - in_head_mode(t, value, arg3); - return; - case "head": - case "noscript": - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "noscript": - stack.pop(); - parser = in_head_mode; - return; - case "br": - break; // goes to the outer default - default: - return; // ignore other end tags - } - break; - } - - // If not handled above - in_head_noscript_mode(ENDTAG, "noscript", null); - parser(t, value, arg3, arg4); - } - - function after_head_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - var ws = value.match(LEADINGWS); - if (ws) { - insertText(ws[0]); - value = value.substring(ws[0].length); - } - if (value.length === 0) return; - break; // Handle non-whitespace below - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "body": - insertHTMLElement(value, arg3); - frameset_ok = false; - parser = in_body_mode; - return; - case "frameset": - insertHTMLElement(value, arg3); - parser = in_frameset_mode; - return; - case "base": - case "basefont": - case "bgsound": - case "link": - case "meta": - case "noframes": - case "script": - case "style": - case "template": - case "title": - stack.push(head_element_pointer); - in_head_mode(TAG, value, arg3); - stack.removeElement(head_element_pointer); - return; - case "head": - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "template": - return in_head_mode(t, value, arg3, arg4); - case "body": - case "html": - case "br": - break; - default: - return; // ignore any other end tag - } - break; - } - - after_head_mode(TAG, "body", null); - frameset_ok = true; - parser(t, value, arg3, arg4); - } - - // 13.2.5.4.7 The "in body" insertion mode - function in_body_mode(t,value,arg3,arg4) { - var body, i, node, elt; - switch(t) { - case 1: // TEXT - if (textIncludesNUL) { - value = value.replace(NULCHARS, ""); - if (value.length === 0) return; - } - // If any non-space characters - if (frameset_ok && NONWS.test(value)) - frameset_ok = false; - afereconstruct(); - insertText(value); - return; - case 5: // DOCTYPE - return; - case 4: // COMMENT - insertComment(value); - return; - case -1: // EOF - if (templateInsertionModes.length) { - return in_template_mode(t); - } - stopParsing(); - return; - case 2: // TAG - switch(value) { - case "html": - if (stack.contains("template")) { - return; - } - transferAttributes(arg3, stack.elements[0]); - return; - case "base": - case "basefont": - case "bgsound": - case "link": - case "meta": - case "noframes": - case "script": - case "style": - case "template": - case "title": - in_head_mode(TAG, value, arg3); - return; - case "body": - body = stack.elements[1]; - if (!body || !(body instanceof impl.HTMLBodyElement) || - stack.contains("template")) - return; - frameset_ok = false; - transferAttributes(arg3, body); - return; - case "frameset": - if (!frameset_ok) return; - body = stack.elements[1]; - if (!body || !(body instanceof impl.HTMLBodyElement)) - return; - if (body.parentNode) body.parentNode.removeChild(body); - while(!(stack.top instanceof impl.HTMLHtmlElement)) - stack.pop(); - insertHTMLElement(value, arg3); - parser = in_frameset_mode; - return; - - case "address": - case "article": - case "aside": - case "blockquote": - case "center": - case "details": - case "dialog": - case "dir": - case "div": - case "dl": - case "fieldset": - case "figcaption": - case "figure": - case "footer": - case "header": - case "hgroup": - case "main": - case "nav": - case "ol": - case "p": - case "section": - case "summary": - case "ul": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - return; - - case "menu": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - if (isA(stack.top, 'menuitem')) { - stack.pop(); - } - insertHTMLElement(value, arg3); - return; - - case "h1": - case "h2": - case "h3": - case "h4": - case "h5": - case "h6": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - if (stack.top instanceof impl.HTMLHeadingElement) - stack.pop(); - insertHTMLElement(value, arg3); - return; - - case "pre": - case "listing": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - ignore_linefeed = true; - frameset_ok = false; - return; - - case "form": - if (form_element_pointer && !stack.contains("template")) return; - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - elt = insertHTMLElement(value, arg3); - if (!stack.contains("template")) - form_element_pointer = elt; - return; - - case "li": - frameset_ok = false; - for(i = stack.elements.length-1; i >= 0; i--) { - node = stack.elements[i]; - if (node instanceof impl.HTMLLIElement) { - in_body_mode(ENDTAG, "li"); - break; - } - if (isA(node, specialSet) && !isA(node, addressdivpSet)) - break; - } - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - return; - - case "dd": - case "dt": - frameset_ok = false; - for(i = stack.elements.length-1; i >= 0; i--) { - node = stack.elements[i]; - if (isA(node, dddtSet)) { - in_body_mode(ENDTAG, node.localName); - break; - } - if (isA(node, specialSet) && !isA(node, addressdivpSet)) - break; - } - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - return; - - case "plaintext": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - tokenizer = plaintext_state; - return; - - case "button": - if (stack.inScope("button")) { - in_body_mode(ENDTAG, "button"); - parser(t, value, arg3, arg4); - } - else { - afereconstruct(); - insertHTMLElement(value, arg3); - frameset_ok = false; - } - return; - - case "a": - var activeElement = afe.findElementByTag("a"); - if (activeElement) { - in_body_mode(ENDTAG, value); - afe.remove(activeElement); - stack.removeElement(activeElement); - } - /* falls through */ - case "b": - case "big": - case "code": - case "em": - case "font": - case "i": - case "s": - case "small": - case "strike": - case "strong": - case "tt": - case "u": - afereconstruct(); - afe.push(insertHTMLElement(value,arg3), arg3); - return; - - case "nobr": - afereconstruct(); - - if (stack.inScope(value)) { - in_body_mode(ENDTAG, value); - afereconstruct(); - } - afe.push(insertHTMLElement(value,arg3), arg3); - return; - - case "applet": - case "marquee": - case "object": - afereconstruct(); - insertHTMLElement(value,arg3); - afe.insertMarker(); - frameset_ok = false; - return; - - case "table": - if (!doc._quirks && stack.inButtonScope("p")) { - in_body_mode(ENDTAG, "p"); - } - insertHTMLElement(value,arg3); - frameset_ok = false; - parser = in_table_mode; - return; - - case "area": - case "br": - case "embed": - case "img": - case "keygen": - case "wbr": - afereconstruct(); - insertHTMLElement(value,arg3); - stack.pop(); - frameset_ok = false; - return; - - case "input": - afereconstruct(); - elt = insertHTMLElement(value,arg3); - stack.pop(); - var type = elt.getAttribute("type"); - if (!type || type.toLowerCase() !== "hidden") - frameset_ok = false; - return; - - case "param": - case "source": - case "track": - insertHTMLElement(value,arg3); - stack.pop(); - return; - - case "hr": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - if (isA(stack.top, 'menuitem')) { - stack.pop(); - } - insertHTMLElement(value,arg3); - stack.pop(); - frameset_ok = false; - return; - - case "image": - in_body_mode(TAG, "img", arg3, arg4); - return; - - case "textarea": - insertHTMLElement(value,arg3); - ignore_linefeed = true; - frameset_ok = false; - tokenizer = rcdata_state; - originalInsertionMode = parser; - parser = text_mode; - return; - - case "xmp": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - afereconstruct(); - frameset_ok = false; - parseRawText(value, arg3); - return; - - case "iframe": - frameset_ok = false; - parseRawText(value, arg3); - return; - - case "noembed": - parseRawText(value,arg3); - return; - - case "select": - afereconstruct(); - insertHTMLElement(value,arg3); - frameset_ok = false; - if (parser === in_table_mode || - parser === in_caption_mode || - parser === in_table_body_mode || - parser === in_row_mode || - parser === in_cell_mode) - parser = in_select_in_table_mode; - else - parser = in_select_mode; - return; - - case "optgroup": - case "option": - if (stack.top instanceof impl.HTMLOptionElement) { - in_body_mode(ENDTAG, "option"); - } - afereconstruct(); - insertHTMLElement(value,arg3); - return; - - case "menuitem": - if (isA(stack.top, 'menuitem')) { - stack.pop(); - } - afereconstruct(); - insertHTMLElement(value, arg3); - return; - - case "rb": - case "rtc": - if (stack.inScope("ruby")) { - stack.generateImpliedEndTags(); - } - insertHTMLElement(value,arg3); - return; - - case "rp": - case "rt": - if (stack.inScope("ruby")) { - stack.generateImpliedEndTags("rtc"); - } - insertHTMLElement(value,arg3); - return; - - case "math": - afereconstruct(); - adjustMathMLAttributes(arg3); - adjustForeignAttributes(arg3); - insertForeignElement(value, arg3, NAMESPACE.MATHML); - if (arg4) // self-closing flag - stack.pop(); - return; - - case "svg": - afereconstruct(); - adjustSVGAttributes(arg3); - adjustForeignAttributes(arg3); - insertForeignElement(value, arg3, NAMESPACE.SVG); - if (arg4) // self-closing flag - stack.pop(); - return; - - case "caption": - case "col": - case "colgroup": - case "frame": - case "head": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - // Ignore table tags if we're not in_table mode - return; - } - - // Handle any other start tag here - // (and also noscript tags when scripting is disabled) - afereconstruct(); - insertHTMLElement(value,arg3); - return; - - case 3: // ENDTAG - switch(value) { - case "template": - in_head_mode(ENDTAG, value, arg3); - return; - case "body": - if (!stack.inScope("body")) return; - parser = after_body_mode; - return; - case "html": - if (!stack.inScope("body")) return; - parser = after_body_mode; - parser(t, value, arg3); - return; - - case "address": - case "article": - case "aside": - case "blockquote": - case "button": - case "center": - case "details": - case "dialog": - case "dir": - case "div": - case "dl": - case "fieldset": - case "figcaption": - case "figure": - case "footer": - case "header": - case "hgroup": - case "listing": - case "main": - case "menu": - case "nav": - case "ol": - case "pre": - case "section": - case "summary": - case "ul": - // Ignore if there is not a matching open tag - if (!stack.inScope(value)) return; - stack.generateImpliedEndTags(); - stack.popTag(value); - return; - - case "form": - if (!stack.contains("template")) { - var openform = form_element_pointer; - form_element_pointer = null; - if (!openform || !stack.elementInScope(openform)) return; - stack.generateImpliedEndTags(); - stack.removeElement(openform); - } else { - if (!stack.inScope("form")) return; - stack.generateImpliedEndTags(); - stack.popTag("form"); - } - return; - - case "p": - if (!stack.inButtonScope(value)) { - in_body_mode(TAG, value, null); - parser(t, value, arg3, arg4); - } - else { - stack.generateImpliedEndTags(value); - stack.popTag(value); - } - return; - - case "li": - if (!stack.inListItemScope(value)) return; - stack.generateImpliedEndTags(value); - stack.popTag(value); - return; - - case "dd": - case "dt": - if (!stack.inScope(value)) return; - stack.generateImpliedEndTags(value); - stack.popTag(value); - return; - - case "h1": - case "h2": - case "h3": - case "h4": - case "h5": - case "h6": - if (!stack.elementTypeInScope(impl.HTMLHeadingElement)) return; - stack.generateImpliedEndTags(); - stack.popElementType(impl.HTMLHeadingElement); - return; - - case "sarcasm": - // Take a deep breath, and then: - break; - - case "a": - case "b": - case "big": - case "code": - case "em": - case "font": - case "i": - case "nobr": - case "s": - case "small": - case "strike": - case "strong": - case "tt": - case "u": - var result = adoptionAgency(value); - if (result) return; // If we did something we're done - break; // Go to the "any other end tag" case - - case "applet": - case "marquee": - case "object": - if (!stack.inScope(value)) return; - stack.generateImpliedEndTags(); - stack.popTag(value); - afe.clearToMarker(); - return; - - case "br": - in_body_mode(TAG, value, null); // Turn
into
- return; - } - - // Any other end tag goes here - for(i = stack.elements.length-1; i >= 0; i--) { - node = stack.elements[i]; - if (isA(node, value)) { - stack.generateImpliedEndTags(value); - stack.popElement(node); - break; - } - else if (isA(node, specialSet)) { - return; - } - } - - return; - } - } - - function text_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - insertText(value); - return; - case -1: // EOF - if (stack.top instanceof impl.HTMLScriptElement) - stack.top._already_started = true; - stack.pop(); - parser = originalInsertionMode; - parser(t); - return; - case 3: // ENDTAG - if (value === "script") { - handleScriptEnd(); - } - else { - stack.pop(); - parser = originalInsertionMode; - } - return; - default: - // We should never get any other token types - return; - } - } - - function in_table_mode(t, value, arg3, arg4) { - function getTypeAttr(attrs) { - for(var i = 0, n = attrs.length; i < n; i++) { - if (attrs[i][0] === "type") - return attrs[i][1].toLowerCase(); - } - return null; - } - - switch(t) { - case 1: // TEXT - // XXX the text_integration_mode stuff is - // just a hack I made up - if (text_integration_mode) { - in_body_mode(t, value, arg3, arg4); - return; - } - else if (isA(stack.top, tablesectionrowSet)) { - pending_table_text = []; - originalInsertionMode = parser; - parser = in_table_text_mode; - parser(t, value, arg3, arg4); - return; - } - break; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case 2: // TAG - switch(value) { - case "caption": - stack.clearToContext(tableContextSet); - afe.insertMarker(); - insertHTMLElement(value,arg3); - parser = in_caption_mode; - return; - case "colgroup": - stack.clearToContext(tableContextSet); - insertHTMLElement(value,arg3); - parser = in_column_group_mode; - return; - case "col": - in_table_mode(TAG, "colgroup", null); - parser(t, value, arg3, arg4); - return; - case "tbody": - case "tfoot": - case "thead": - stack.clearToContext(tableContextSet); - insertHTMLElement(value,arg3); - parser = in_table_body_mode; - return; - case "td": - case "th": - case "tr": - in_table_mode(TAG, "tbody", null); - parser(t, value, arg3, arg4); - return; - - case "table": - if (!stack.inTableScope(value)) { - return; // Ignore the token - } - in_table_mode(ENDTAG, value); - parser(t, value, arg3, arg4); - return; - - case "style": - case "script": - case "template": - in_head_mode(t, value, arg3, arg4); - return; - - case "input": - var type = getTypeAttr(arg3); - if (type !== "hidden") break; // to the anything else case - insertHTMLElement(value,arg3); - stack.pop(); - return; - - case "form": - if (form_element_pointer || stack.contains("template")) return; - form_element_pointer = insertHTMLElement(value, arg3); - stack.popElement(form_element_pointer); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "table": - if (!stack.inTableScope(value)) return; - stack.popTag(value); - resetInsertionMode(); - return; - case "body": - case "caption": - case "col": - case "colgroup": - case "html": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - return; - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - - break; - case -1: // EOF - in_body_mode(t, value, arg3, arg4); - return; - } - - // This is the anything else case - foster_parent_mode = true; - in_body_mode(t, value, arg3, arg4); - foster_parent_mode = false; - } - - function in_table_text_mode(t, value, arg3, arg4) { - if (t === TEXT) { - if (textIncludesNUL) { - value = value.replace(NULCHARS, ""); - if (value.length === 0) return; - } - pending_table_text.push(value); - } - else { - var s = pending_table_text.join(""); - pending_table_text.length = 0; - if (NONWS.test(s)) { // If any non-whitespace characters - // This must be the same code as the "anything else" - // case of the in_table mode above. - foster_parent_mode = true; - in_body_mode(TEXT, s); - foster_parent_mode = false; - } - else { - insertText(s); - } - parser = originalInsertionMode; - parser(t, value, arg3, arg4); - } - } - - - function in_caption_mode(t, value, arg3, arg4) { - function end_caption() { - if (!stack.inTableScope("caption")) return false; - stack.generateImpliedEndTags(); - stack.popTag("caption"); - afe.clearToMarker(); - parser = in_table_mode; - return true; - } - - switch(t) { - case 2: // TAG - switch(value) { - case "caption": - case "col": - case "colgroup": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - if (end_caption()) parser(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "caption": - end_caption(); - return; - case "table": - if (end_caption()) parser(t, value, arg3, arg4); - return; - case "body": - case "col": - case "colgroup": - case "html": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - return; - } - break; - } - - // The Anything Else case - in_body_mode(t, value, arg3, arg4); - } - - function in_column_group_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - var ws = value.match(LEADINGWS); - if (ws) { - insertText(ws[0]); - value = value.substring(ws[0].length); - } - if (value.length === 0) return; - break; // Handle non-whitespace below - - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "col": - insertHTMLElement(value, arg3); - stack.pop(); - return; - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "colgroup": - if (!isA(stack.top, 'colgroup')) { - return; // Ignore the token. - } - stack.pop(); - parser = in_table_mode; - return; - case "col": - return; - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case -1: // EOF - in_body_mode(t, value, arg3, arg4); - return; - } - - // Anything else - if (!isA(stack.top, 'colgroup')) { - return; // Ignore the token. - } - in_column_group_mode(ENDTAG, "colgroup"); - parser(t, value, arg3, arg4); - } - - function in_table_body_mode(t, value, arg3, arg4) { - function endsect() { - if (!stack.inTableScope("tbody") && - !stack.inTableScope("thead") && - !stack.inTableScope("tfoot")) - return; - stack.clearToContext(tableBodyContextSet); - in_table_body_mode(ENDTAG, stack.top.localName, null); - parser(t, value, arg3, arg4); - } - - switch(t) { - case 2: // TAG - switch(value) { - case "tr": - stack.clearToContext(tableBodyContextSet); - insertHTMLElement(value, arg3); - parser = in_row_mode; - return; - case "th": - case "td": - in_table_body_mode(TAG, "tr", null); - parser(t, value, arg3, arg4); - return; - case "caption": - case "col": - case "colgroup": - case "tbody": - case "tfoot": - case "thead": - endsect(); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "table": - endsect(); - return; - case "tbody": - case "tfoot": - case "thead": - if (stack.inTableScope(value)) { - stack.clearToContext(tableBodyContextSet); - stack.pop(); - parser = in_table_mode; - } - return; - case "body": - case "caption": - case "col": - case "colgroup": - case "html": - case "td": - case "th": - case "tr": - return; - } - break; - } - - // Anything else: - in_table_mode(t, value, arg3, arg4); - } - - function in_row_mode(t, value, arg3, arg4) { - function endrow() { - if (!stack.inTableScope("tr")) return false; - stack.clearToContext(tableRowContextSet); - stack.pop(); - parser = in_table_body_mode; - return true; - } - - switch(t) { - case 2: // TAG - switch(value) { - case "th": - case "td": - stack.clearToContext(tableRowContextSet); - insertHTMLElement(value, arg3); - parser = in_cell_mode; - afe.insertMarker(); - return; - case "caption": - case "col": - case "colgroup": - case "tbody": - case "tfoot": - case "thead": - case "tr": - if (endrow()) parser(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "tr": - endrow(); - return; - case "table": - if (endrow()) parser(t, value, arg3, arg4); - return; - case "tbody": - case "tfoot": - case "thead": - if (stack.inTableScope(value)) { - if (endrow()) parser(t, value, arg3, arg4); - } - return; - case "body": - case "caption": - case "col": - case "colgroup": - case "html": - case "td": - case "th": - return; - } - break; - } - - // anything else - in_table_mode(t, value, arg3, arg4); - } - - function in_cell_mode(t, value, arg3, arg4) { - switch(t) { - case 2: // TAG - switch(value) { - case "caption": - case "col": - case "colgroup": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - if (stack.inTableScope("td")) { - in_cell_mode(ENDTAG, "td"); - parser(t, value, arg3, arg4); - } - else if (stack.inTableScope("th")) { - in_cell_mode(ENDTAG, "th"); - parser(t, value, arg3, arg4); - } - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "td": - case "th": - if (!stack.inTableScope(value)) return; - stack.generateImpliedEndTags(); - stack.popTag(value); - afe.clearToMarker(); - parser = in_row_mode; - return; - - case "body": - case "caption": - case "col": - case "colgroup": - case "html": - return; - - case "table": - case "tbody": - case "tfoot": - case "thead": - case "tr": - if (!stack.inTableScope(value)) return; - in_cell_mode(ENDTAG, stack.inTableScope("td") ? "td" : "th"); - parser(t, value, arg3, arg4); - return; - } - break; - } - - // anything else - in_body_mode(t, value, arg3, arg4); - } - - function in_select_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - if (textIncludesNUL) { - value = value.replace(NULCHARS, ""); - if (value.length === 0) return; - } - insertText(value); - return; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case -1: // EOF - in_body_mode(t, value, arg3, arg4); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "option": - if (stack.top instanceof impl.HTMLOptionElement) - in_select_mode(ENDTAG, value); - insertHTMLElement(value, arg3); - return; - case "optgroup": - if (stack.top instanceof impl.HTMLOptionElement) - in_select_mode(ENDTAG, "option"); - if (stack.top instanceof impl.HTMLOptGroupElement) - in_select_mode(ENDTAG, value); - insertHTMLElement(value, arg3); - return; - case "select": - in_select_mode(ENDTAG, value); // treat it as a close tag - return; - - case "input": - case "keygen": - case "textarea": - if (!stack.inSelectScope("select")) return; - in_select_mode(ENDTAG, "select"); - parser(t, value, arg3, arg4); - return; - - case "script": - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "optgroup": - if (stack.top instanceof impl.HTMLOptionElement && - stack.elements[stack.elements.length-2] instanceof - impl.HTMLOptGroupElement) { - in_select_mode(ENDTAG, "option"); - } - if (stack.top instanceof impl.HTMLOptGroupElement) - stack.pop(); - - return; - - case "option": - if (stack.top instanceof impl.HTMLOptionElement) - stack.pop(); - return; - - case "select": - if (!stack.inSelectScope(value)) return; - stack.popTag(value); - resetInsertionMode(); - return; - - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - - break; - } - - // anything else: just ignore the token - } - - function in_select_in_table_mode(t, value, arg3, arg4) { - switch(value) { - case "caption": - case "table": - case "tbody": - case "tfoot": - case "thead": - case "tr": - case "td": - case "th": - switch(t) { - case 2: // TAG - in_select_in_table_mode(ENDTAG, "select"); - parser(t, value, arg3, arg4); - return; - case 3: // ENDTAG - if (stack.inTableScope(value)) { - in_select_in_table_mode(ENDTAG, "select"); - parser(t, value, arg3, arg4); - } - return; - } - } - - // anything else - in_select_mode(t, value, arg3, arg4); - } - - function in_template_mode(t, value, arg3, arg4) { - function switchModeAndReprocess(mode) { - parser = mode; - templateInsertionModes[templateInsertionModes.length-1] = parser; - parser(t, value, arg3, arg4); - } - switch(t) { - case 1: // TEXT - case 4: // COMMENT - case 5: // DOCTYPE - in_body_mode(t, value, arg3, arg4); - return; - case -1: // EOF - if (!stack.contains("template")) { - stopParsing(); - } else { - stack.popTag("template"); - afe.clearToMarker(); - templateInsertionModes.pop(); - resetInsertionMode(); - parser(t, value, arg3, arg4); - } - return; - case 2: // TAG - switch(value) { - case "base": - case "basefont": - case "bgsound": - case "link": - case "meta": - case "noframes": - case "script": - case "style": - case "template": - case "title": - in_head_mode(t, value, arg3, arg4); - return; - case "caption": - case "colgroup": - case "tbody": - case "tfoot": - case "thead": - switchModeAndReprocess(in_table_mode); - return; - case "col": - switchModeAndReprocess(in_column_group_mode); - return; - case "tr": - switchModeAndReprocess(in_table_body_mode); - return; - case "td": - case "th": - switchModeAndReprocess(in_row_mode); - return; - } - switchModeAndReprocess(in_body_mode); - return; - case 3: // ENDTAG - switch(value) { - case "template": - in_head_mode(t, value, arg3, arg4); - return; - default: - return; - } - } - } - - function after_body_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // If any non-space chars, handle below - if (NONWS.test(value)) break; - in_body_mode(t, value); - return; - case 4: // COMMENT - // Append it to the element - stack.elements[0]._appendChild(doc.createComment(value)); - return; - case 5: // DOCTYPE - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - if (value === "html") { - in_body_mode(t, value, arg3, arg4); - return; - } - break; // for any other tags - case 3: // ENDTAG - if (value === "html") { - if (fragment) return; - parser = after_after_body_mode; - return; - } - break; // for any other tags - } - - // anything else - parser = in_body_mode; - parser(t, value, arg3, arg4); - } - - function in_frameset_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // Ignore any non-space characters - value = value.replace(ALLNONWS, ""); - if (value.length > 0) insertText(value); - return; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "frameset": - insertHTMLElement(value, arg3); - return; - case "frame": - insertHTMLElement(value, arg3); - stack.pop(); - return; - case "noframes": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - if (value === "frameset") { - if (fragment && stack.top instanceof impl.HTMLHtmlElement) - return; - stack.pop(); - if (!fragment && - !(stack.top instanceof impl.HTMLFrameSetElement)) - parser = after_frameset_mode; - return; - } - break; - } - - // ignore anything else - } - - function after_frameset_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // Ignore any non-space characters - value = value.replace(ALLNONWS, ""); - if (value.length > 0) insertText(value); - return; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "noframes": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - if (value === "html") { - parser = after_after_frameset_mode; - return; - } - break; - } - - // ignore anything else - } - - function after_after_body_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // If any non-space chars, handle below - if (NONWS.test(value)) break; - in_body_mode(t, value, arg3, arg4); - return; - case 4: // COMMENT - doc._appendChild(doc.createComment(value)); - return; - case 5: // DOCTYPE - in_body_mode(t, value, arg3, arg4); - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - if (value === "html") { - in_body_mode(t, value, arg3, arg4); - return; - } - break; - } - - // anything else - parser = in_body_mode; - parser(t, value, arg3, arg4); - } - - function after_after_frameset_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // Ignore any non-space characters - value = value.replace(ALLNONWS, ""); - if (value.length > 0) - in_body_mode(t, value, arg3, arg4); - return; - case 4: // COMMENT - doc._appendChild(doc.createComment(value)); - return; - case 5: // DOCTYPE - in_body_mode(t, value, arg3, arg4); - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "noframes": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - } - - // ignore anything else - } - - - // 13.2.5.5 The rules for parsing tokens in foreign content - // - // This is like one of the insertion modes above, but is - // invoked somewhat differently when the current token is not HTML. - // See the insertToken() function. - function insertForeignToken(t, value, arg3, arg4) { - // A tag is an HTML font tag if it has a color, font, or size - // attribute. Otherwise we assume it is foreign content - function isHTMLFont(attrs) { - for(var i = 0, n = attrs.length; i < n; i++) { - switch(attrs[i][0]) { - case "color": - case "face": - case "size": - return true; - } - } - return false; - } - - var current; - - switch(t) { - case 1: // TEXT - // If any non-space, non-nul characters - if (frameset_ok && NONWSNONNUL.test(value)) - frameset_ok = false; - if (textIncludesNUL) { - value = value.replace(NULCHARS, "\uFFFD"); - } - insertText(value); - return; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - // ignore it - return; - case 2: // TAG - switch(value) { - case "font": - if (!isHTMLFont(arg3)) break; - /* falls through */ - case "b": - case "big": - case "blockquote": - case "body": - case "br": - case "center": - case "code": - case "dd": - case "div": - case "dl": - case "dt": - case "em": - case "embed": - case "h1": - case "h2": - case "h3": - case "h4": - case "h5": - case "h6": - case "head": - case "hr": - case "i": - case "img": - case "li": - case "listing": - case "menu": - case "meta": - case "nobr": - case "ol": - case "p": - case "pre": - case "ruby": - case "s": - case "small": - case "span": - case "strong": - case "strike": - case "sub": - case "sup": - case "table": - case "tt": - case "u": - case "ul": - case "var": - if (fragment) { - break; - } - do { - stack.pop(); - current = stack.top; - } while(current.namespaceURI !== NAMESPACE.HTML && - !isMathmlTextIntegrationPoint(current) && - !isHTMLIntegrationPoint(current)); - - insertToken(t, value, arg3, arg4); // reprocess - return; - } - - // Any other start tag case goes here - current = (stack.elements.length===1 && fragment) ? fragmentContext : - stack.top; - if (current.namespaceURI === NAMESPACE.MATHML) { - adjustMathMLAttributes(arg3); - } - else if (current.namespaceURI === NAMESPACE.SVG) { - value = adjustSVGTagName(value); - adjustSVGAttributes(arg3); - } - adjustForeignAttributes(arg3); - - insertForeignElement(value, arg3, current.namespaceURI); - if (arg4) { // the self-closing flag - if (value === 'script' && current.namespaceURI === NAMESPACE.SVG) { - // XXX deal with SVG scripts here - } - stack.pop(); - } - return; - - case 3: // ENDTAG - current = stack.top; - if (value === "script" && - current.namespaceURI === NAMESPACE.SVG && - current.localName === "script") { - - stack.pop(); - - // XXX - // Deal with SVG scripts here - } - else { - // The any other end tag case - var i = stack.elements.length-1; - var node = stack.elements[i]; - for(;;) { - if (node.localName.toLowerCase() === value) { - stack.popElement(node); - break; - } - node = stack.elements[--i]; - // If non-html, keep looping - if (node.namespaceURI !== NAMESPACE.HTML) - continue; - // Otherwise process the end tag as html - parser(t, value, arg3, arg4); - break; - } - } - return; - } - } - - /*** - * Finally, this is the end of the HTMLParser() factory function. - * It returns the htmlparser object with the append() and end() methods. - */ - - // Sneak another method into the htmlparser object to allow us to run - // tokenizer tests. This can be commented out in production code. - // This is a hook for testing the tokenizer. It has to be here - // because the tokenizer details are all hidden away within the closure. - // It should return an array of tokens generated while parsing the - // input string. - htmlparser.testTokenizer = function(input, initialState, lastStartTag, charbychar) { - var tokens = []; - - switch(initialState) { - case "PCDATA state": - tokenizer = data_state; - break; - case "RCDATA state": - tokenizer = rcdata_state; - break; - case "RAWTEXT state": - tokenizer = rawtext_state; - break; - case "PLAINTEXT state": - tokenizer = plaintext_state; - break; - } - - if (lastStartTag) { - lasttagname = lastStartTag; - } - - insertToken = function(t, value, arg3, arg4) { - flushText(); - switch(t) { - case 1: // TEXT - if (tokens.length > 0 && - tokens[tokens.length-1][0] === "Character") { - tokens[tokens.length-1][1] += value; - } - else tokens.push(["Character", value]); - break; - case 4: // COMMENT - tokens.push(["Comment", value]); - break; - case 5: // DOCTYPE - tokens.push(["DOCTYPE", value, - arg3 === undefined ? null : arg3, - arg4 === undefined ? null : arg4, - !force_quirks]); - break; - case 2: // TAG - var attrs = Object.create(null); - for(var i = 0; i < arg3.length; i++) { - // XXX: does attribute order matter? - var a = arg3[i]; - if (a.length === 1) { - attrs[a[0]] = ""; - } - else { - attrs[a[0]] = a[1]; - } - } - var token = ["StartTag", value, attrs]; - if (arg4) token.push(true); - tokens.push(token); - break; - case 3: // ENDTAG - tokens.push(["EndTag", value]); - break; - case -1: // EOF - break; - } - }; - - if (!charbychar) { - this.parse(input, true); - } - else { - for(var i = 0; i < input.length; i++) { - this.parse(input[i]); - } - this.parse("", true); - } - return tokens; - }; - - // Return the parser object from the HTMLParser() factory function - return htmlparser; -} - - -/***/ }), - -/***/ 8161: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = Leaf; - -var Node = __webpack_require__(97537); -var NodeList = __webpack_require__(64965); -var utils = __webpack_require__(89076); -var HierarchyRequestError = utils.HierarchyRequestError; -var NotFoundError = utils.NotFoundError; - -// This class defines common functionality for node subtypes that -// can never have children -function Leaf() { - Node.call(this); -} - -Leaf.prototype = Object.create(Node.prototype, { - hasChildNodes: { value: function() { return false; }}, - firstChild: { value: null }, - lastChild: { value: null }, - insertBefore: { value: function(node, child) { - if (!node.nodeType) throw new TypeError('not a node'); - HierarchyRequestError(); - }}, - replaceChild: { value: function(node, child) { - if (!node.nodeType) throw new TypeError('not a node'); - HierarchyRequestError(); - }}, - removeChild: { value: function(node) { - if (!node.nodeType) throw new TypeError('not a node'); - NotFoundError(); - }}, - removeChildren: { value: function() { /* no op */ }}, - childNodes: { get: function() { - if (!this._childNodes) this._childNodes = new NodeList(); - return this._childNodes; - }} -}); - - -/***/ }), - -/***/ 41360: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var utils = __webpack_require__(89076); - -var LinkedList = module.exports = { - // basic validity tests on a circular linked list a - valid: function(a) { - utils.assert(a, "list falsy"); - utils.assert(a._previousSibling, "previous falsy"); - utils.assert(a._nextSibling, "next falsy"); - // xxx check that list is actually circular - return true; - }, - // insert a before b - insertBefore: function(a, b) { - utils.assert(LinkedList.valid(a) && LinkedList.valid(b)); - var a_first = a, a_last = a._previousSibling; - var b_first = b, b_last = b._previousSibling; - a_first._previousSibling = b_last; - a_last._nextSibling = b_first; - b_last._nextSibling = a_first; - b_first._previousSibling = a_last; - utils.assert(LinkedList.valid(a) && LinkedList.valid(b)); - }, - // replace a single node a with a list b (which could be null) - replace: function(a, b) { - utils.assert(LinkedList.valid(a) && (b===null || LinkedList.valid(b))); - if (b!==null) { - LinkedList.insertBefore(b, a); - } - LinkedList.remove(a); - utils.assert(LinkedList.valid(a) && (b===null || LinkedList.valid(b))); - }, - // remove single node a from its list - remove: function(a) { - utils.assert(LinkedList.valid(a)); - var prev = a._previousSibling; - if (prev === a) { return; } - var next = a._nextSibling; - prev._nextSibling = next; - next._previousSibling = prev; - a._previousSibling = a._nextSibling = a; - utils.assert(LinkedList.valid(a)); - } -}; - - -/***/ }), - -/***/ 63738: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var URL = __webpack_require__(85184); -var URLUtils = __webpack_require__(65531); - -module.exports = Location; - -function Location(window, href) { - this._window = window; - this._href = href; -} - -Location.prototype = Object.create(URLUtils.prototype, { - constructor: { value: Location }, - - // Special behavior when href is set - href: { - get: function() { return this._href; }, - set: function(v) { this.assign(v); } - }, - - assign: { value: function(url) { - // Resolve the new url against the current one - // XXX: - // This is not actually correct. It should be resolved against - // the URL of the document of the script. For now, though, I only - // support a single window and there is only one base url. - // So this is good enough for now. - var current = new URL(this._href); - var newurl = current.resolve(url); - - // Save the new url - this._href = newurl; - - // Start loading the new document! - // XXX - // This is just something hacked together. - // The real algorithm is: http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#navigate - }}, - - replace: { value: function(url) { - // XXX - // Since we aren't tracking history yet, replace is the same as assign - this.assign(url); - }}, - - reload: { value: function() { - // XXX: - // Actually, the spec is a lot more complicated than this - this.assign(this.href); - }}, - - toString: { value: function() { - return this.href; - }} - -}); - - -/***/ }), - -/***/ 21440: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var UIEvent = __webpack_require__(64259); - -module.exports = MouseEvent; - -function MouseEvent() { - // Just use the superclass constructor to initialize - UIEvent.call(this); - - this.screenX = this.screenY = this.clientX = this.clientY = 0; - this.ctrlKey = this.altKey = this.shiftKey = this.metaKey = false; - this.button = 0; - this.buttons = 1; - this.relatedTarget = null; -} -MouseEvent.prototype = Object.create(UIEvent.prototype, { - constructor: { value: MouseEvent }, - initMouseEvent: { value: function(type, bubbles, cancelable, - view, detail, - screenX, screenY, clientX, clientY, - ctrlKey, altKey, shiftKey, metaKey, - button, relatedTarget) { - - this.initEvent(type, bubbles, cancelable, view, detail); - this.screenX = screenX; - this.screenY = screenY; - this.clientX = clientX; - this.clientY = clientY; - this.ctrlKey = ctrlKey; - this.altKey = altKey; - this.shiftKey = shiftKey; - this.metaKey = metaKey; - this.button = button; - switch(button) { - case 0: this.buttons = 1; break; - case 1: this.buttons = 4; break; - case 2: this.buttons = 2; break; - default: this.buttons = 0; break; - } - this.relatedTarget = relatedTarget; - }}, - - getModifierState: { value: function(key) { - switch(key) { - case "Alt": return this.altKey; - case "Control": return this.ctrlKey; - case "Shift": return this.shiftKey; - case "Meta": return this.metaKey; - default: return false; - } - }} -}); - - -/***/ }), - -/***/ 40993: -/***/ ((module) => { - -"use strict"; - -module.exports = { - VALUE: 1, // The value of a Text, Comment or PI node changed - ATTR: 2, // A new attribute was added or an attribute value and/or prefix changed - REMOVE_ATTR: 3, // An attribute was removed - REMOVE: 4, // A node was removed - MOVE: 5, // A node was moved - INSERT: 6 // A node (or a subtree of nodes) was inserted -}; - -/***/ }), - -/***/ 49492: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = NamedNodeMap; - -var utils = __webpack_require__(89076); - -/* This is a hacky implementation of NamedNodeMap, intended primarily to - * satisfy clients (like dompurify and the web-platform-tests) which check - * to ensure that Node#attributes instanceof NamedNodeMap. */ - -function NamedNodeMap(element) { - this.element = element; -} -Object.defineProperties(NamedNodeMap.prototype, { - length: { get: utils.shouldOverride }, - item: { value: utils.shouldOverride }, - - getNamedItem: { value: function getNamedItem(qualifiedName) { - return this.element.getAttributeNode(qualifiedName); - } }, - getNamedItemNS: { value: function getNamedItemNS(namespace, localName) { - return this.element.getAttributeNodeNS(namespace, localName); - } }, - setNamedItem: { value: utils.nyi }, - setNamedItemNS: { value: utils.nyi }, - removeNamedItem: { value: function removeNamedItem(qualifiedName) { - var attr = this.element.getAttributeNode(qualifiedName); - if (attr) { - this.element.removeAttribute(qualifiedName); - return attr; - } - utils.NotFoundError(); - } }, - removeNamedItemNS: { value: function removeNamedItemNS(ns, lname) { - var attr = this.element.getAttributeNodeNS(ns, lname); - if (attr) { - this.element.removeAttributeNS(ns, lname); - return attr; - } - utils.NotFoundError(); - } }, -}); - - -/***/ }), - -/***/ 94993: -/***/ ((module) => { - -"use strict"; - - -// https://html.spec.whatwg.org/multipage/webappapis.html#navigatorid -var NavigatorID = Object.create(null, { - appCodeName: { value: "Mozilla" }, - appName: { value: "Netscape" }, - appVersion: { value: "4.0" }, - platform: { value: "" }, - product: { value: "Gecko" }, - productSub: { value: "20100101" }, - userAgent: { value: "" }, - vendor: { value: "" }, - vendorSub: { value: "" }, - taintEnabled: { value: function() { return false; } } -}); - -module.exports = NavigatorID; - - -/***/ }), - -/***/ 97537: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = Node; - -var EventTarget = __webpack_require__(22356); -var LinkedList = __webpack_require__(41360); -var NodeUtils = __webpack_require__(41608); -var utils = __webpack_require__(89076); - -// All nodes have a nodeType and an ownerDocument. -// Once inserted, they also have a parentNode. -// This is an abstract class; all nodes in a document are instances -// of a subtype, so all the properties are defined by more specific -// constructors. -function Node() { - EventTarget.call(this); - this.parentNode = null; - this._nextSibling = this._previousSibling = this; - this._index = undefined; -} - -var ELEMENT_NODE = Node.ELEMENT_NODE = 1; -var ATTRIBUTE_NODE = Node.ATTRIBUTE_NODE = 2; -var TEXT_NODE = Node.TEXT_NODE = 3; -var CDATA_SECTION_NODE = Node.CDATA_SECTION_NODE = 4; -var ENTITY_REFERENCE_NODE = Node.ENTITY_REFERENCE_NODE = 5; -var ENTITY_NODE = Node.ENTITY_NODE = 6; -var PROCESSING_INSTRUCTION_NODE = Node.PROCESSING_INSTRUCTION_NODE = 7; -var COMMENT_NODE = Node.COMMENT_NODE = 8; -var DOCUMENT_NODE = Node.DOCUMENT_NODE = 9; -var DOCUMENT_TYPE_NODE = Node.DOCUMENT_TYPE_NODE = 10; -var DOCUMENT_FRAGMENT_NODE = Node.DOCUMENT_FRAGMENT_NODE = 11; -var NOTATION_NODE = Node.NOTATION_NODE = 12; - -var DOCUMENT_POSITION_DISCONNECTED = Node.DOCUMENT_POSITION_DISCONNECTED = 0x01; -var DOCUMENT_POSITION_PRECEDING = Node.DOCUMENT_POSITION_PRECEDING = 0x02; -var DOCUMENT_POSITION_FOLLOWING = Node.DOCUMENT_POSITION_FOLLOWING = 0x04; -var DOCUMENT_POSITION_CONTAINS = Node.DOCUMENT_POSITION_CONTAINS = 0x08; -var DOCUMENT_POSITION_CONTAINED_BY = Node.DOCUMENT_POSITION_CONTAINED_BY = 0x10; -var DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; - -Node.prototype = Object.create(EventTarget.prototype, { - - // Node that are not inserted into the tree inherit a null parent - - // XXX: the baseURI attribute is defined by dom core, but - // a correct implementation of it requires HTML features, so - // we'll come back to this later. - baseURI: { get: utils.nyi }, - - parentElement: { get: function() { - return (this.parentNode && this.parentNode.nodeType===ELEMENT_NODE) ? this.parentNode : null; - }}, - - hasChildNodes: { value: utils.shouldOverride }, - - firstChild: { get: utils.shouldOverride }, - - lastChild: { get: utils.shouldOverride }, - - isConnected: { - get: function () { - let node = this; - while (node != null) { - if (node.nodeType === Node.DOCUMENT_NODE) { - return true; - } - - node = node.parentNode; - if (node != null && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { - node = node.host; - } - } - return false; - }, - }, - - previousSibling: { get: function() { - var parent = this.parentNode; - if (!parent) return null; - if (this === parent.firstChild) return null; - return this._previousSibling; - }}, - - nextSibling: { get: function() { - var parent = this.parentNode, next = this._nextSibling; - if (!parent) return null; - if (next === parent.firstChild) return null; - return next; - }}, - - textContent: { - // Should override for DocumentFragment/Element/Attr/Text/PI/Comment - get: function() { return null; }, - set: function(v) { /* do nothing */ }, - }, - - innerText: { - // Should override for DocumentFragment/Element/Attr/Text/PI/Comment - get: function() { return null; }, - set: function(v) { /* do nothing */ }, - }, - - _countChildrenOfType: { value: function(type) { - var sum = 0; - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === type) sum++; - } - return sum; - }}, - - _ensureInsertValid: { value: function _ensureInsertValid(node, child, isPreinsert) { - var parent = this, i, kid; - if (!node.nodeType) throw new TypeError('not a node'); - // 1. If parent is not a Document, DocumentFragment, or Element - // node, throw a HierarchyRequestError. - switch (parent.nodeType) { - case DOCUMENT_NODE: - case DOCUMENT_FRAGMENT_NODE: - case ELEMENT_NODE: - break; - default: utils.HierarchyRequestError(); - } - // 2. If node is a host-including inclusive ancestor of parent, - // throw a HierarchyRequestError. - if (node.isAncestor(parent)) utils.HierarchyRequestError(); - // 3. If child is not null and its parent is not parent, then - // throw a NotFoundError. (replaceChild omits the 'child is not null' - // and throws a TypeError here if child is null.) - if (child !== null || !isPreinsert) { - if (child.parentNode !== parent) utils.NotFoundError(); - } - // 4. If node is not a DocumentFragment, DocumentType, Element, - // Text, ProcessingInstruction, or Comment node, throw a - // HierarchyRequestError. - switch (node.nodeType) { - case DOCUMENT_FRAGMENT_NODE: - case DOCUMENT_TYPE_NODE: - case ELEMENT_NODE: - case TEXT_NODE: - case PROCESSING_INSTRUCTION_NODE: - case COMMENT_NODE: - break; - default: utils.HierarchyRequestError(); - } - // 5. If either node is a Text node and parent is a document, or - // node is a doctype and parent is not a document, throw a - // HierarchyRequestError. - // 6. If parent is a document, and any of the statements below, switched - // on node, are true, throw a HierarchyRequestError. - if (parent.nodeType === DOCUMENT_NODE) { - switch (node.nodeType) { - case TEXT_NODE: - utils.HierarchyRequestError(); - break; - case DOCUMENT_FRAGMENT_NODE: - // 6a1. If node has more than one element child or has a Text - // node child. - if (node._countChildrenOfType(TEXT_NODE) > 0) - utils.HierarchyRequestError(); - switch (node._countChildrenOfType(ELEMENT_NODE)) { - case 0: - break; - case 1: - // 6a2. Otherwise, if node has one element child and either - // parent has an element child, child is a doctype, or child - // is not null and a doctype is following child. [preinsert] - // 6a2. Otherwise, if node has one element child and either - // parent has an element child that is not child or a - // doctype is following child. [replaceWith] - if (child !== null /* always true here for replaceWith */) { - if (isPreinsert && child.nodeType === DOCUMENT_TYPE_NODE) - utils.HierarchyRequestError(); - for (kid = child.nextSibling; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === DOCUMENT_TYPE_NODE) - utils.HierarchyRequestError(); - } - } - i = parent._countChildrenOfType(ELEMENT_NODE); - if (isPreinsert) { - // "parent has an element child" - if (i > 0) - utils.HierarchyRequestError(); - } else { - // "parent has an element child that is not child" - if (i > 1 || (i === 1 && child.nodeType !== ELEMENT_NODE)) - utils.HierarchyRequestError(); - } - break; - default: // 6a1, continued. (more than one Element child) - utils.HierarchyRequestError(); - } - break; - case ELEMENT_NODE: - // 6b. parent has an element child, child is a doctype, or - // child is not null and a doctype is following child. [preinsert] - // 6b. parent has an element child that is not child or a - // doctype is following child. [replaceWith] - if (child !== null /* always true here for replaceWith */) { - if (isPreinsert && child.nodeType === DOCUMENT_TYPE_NODE) - utils.HierarchyRequestError(); - for (kid = child.nextSibling; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === DOCUMENT_TYPE_NODE) - utils.HierarchyRequestError(); - } - } - i = parent._countChildrenOfType(ELEMENT_NODE); - if (isPreinsert) { - // "parent has an element child" - if (i > 0) - utils.HierarchyRequestError(); - } else { - // "parent has an element child that is not child" - if (i > 1 || (i === 1 && child.nodeType !== ELEMENT_NODE)) - utils.HierarchyRequestError(); - } - break; - case DOCUMENT_TYPE_NODE: - // 6c. parent has a doctype child, child is non-null and an - // element is preceding child, or child is null and parent has - // an element child. [preinsert] - // 6c. parent has a doctype child that is not child, or an - // element is preceding child. [replaceWith] - if (child === null) { - if (parent._countChildrenOfType(ELEMENT_NODE)) - utils.HierarchyRequestError(); - } else { - // child is always non-null for [replaceWith] case - for (kid = parent.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid === child) break; - if (kid.nodeType === ELEMENT_NODE) - utils.HierarchyRequestError(); - } - } - i = parent._countChildrenOfType(DOCUMENT_TYPE_NODE); - if (isPreinsert) { - // "parent has an doctype child" - if (i > 0) - utils.HierarchyRequestError(); - } else { - // "parent has an doctype child that is not child" - if (i > 1 || (i === 1 && child.nodeType !== DOCUMENT_TYPE_NODE)) - utils.HierarchyRequestError(); - } - break; - } - } else { - // 5, continued: (parent is not a document) - if (node.nodeType === DOCUMENT_TYPE_NODE) utils.HierarchyRequestError(); - } - }}, - - insertBefore: { value: function insertBefore(node, child) { - var parent = this; - // 1. Ensure pre-insertion validity - parent._ensureInsertValid(node, child, true); - // 2. Let reference child be child. - var refChild = child; - // 3. If reference child is node, set it to node's next sibling - if (refChild === node) { refChild = node.nextSibling; } - // 4. Adopt node into parent's node document. - parent.doc.adoptNode(node); - // 5. Insert node into parent before reference child. - node._insertOrReplace(parent, refChild, false); - // 6. Return node - return node; - }}, - - - appendChild: { value: function(child) { - // This invokes _appendChild after doing validity checks. - return this.insertBefore(child, null); - }}, - - _appendChild: { value: function(child) { - child._insertOrReplace(this, null, false); - }}, - - removeChild: { value: function removeChild(child) { - var parent = this; - if (!child.nodeType) throw new TypeError('not a node'); - if (child.parentNode !== parent) utils.NotFoundError(); - child.remove(); - return child; - }}, - - // To replace a `child` with `node` within a `parent` (this) - replaceChild: { value: function replaceChild(node, child) { - var parent = this; - // Ensure validity (slight differences from pre-insertion check) - parent._ensureInsertValid(node, child, false); - // Adopt node into parent's node document. - if (node.doc !== parent.doc) { - // XXX adoptNode has side-effect of removing node from its parent - // and generating a mutation event, thus causing the _insertOrReplace - // to generate two deletes and an insert instead of a 'move' - // event. It looks like the new MutationObserver stuff avoids - // this problem, but for now let's only adopt (ie, remove `node` - // from its parent) here if we need to. - parent.doc.adoptNode(node); - } - // Do the replace. - node._insertOrReplace(parent, child, true); - return child; - }}, - - // See: http://ejohn.org/blog/comparing-document-position/ - contains: { value: function contains(node) { - if (node === null) { return false; } - if (this === node) { return true; /* inclusive descendant */ } - /* jshint bitwise: false */ - return (this.compareDocumentPosition(node) & - DOCUMENT_POSITION_CONTAINED_BY) !== 0; - }}, - - compareDocumentPosition: { value: function compareDocumentPosition(that){ - // Basic algorithm for finding the relative position of two nodes. - // Make a list the ancestors of each node, starting with the - // document element and proceeding down to the nodes themselves. - // Then, loop through the lists, looking for the first element - // that differs. The order of those two elements give the - // order of their descendant nodes. Or, if one list is a prefix - // of the other one, then that node contains the other. - - if (this === that) return 0; - - // If they're not owned by the same document or if one is rooted - // and one is not, then they're disconnected. - if (this.doc !== that.doc || - this.rooted !== that.rooted) - return (DOCUMENT_POSITION_DISCONNECTED + - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC); - - // Get arrays of ancestors for this and that - var these = [], those = []; - for(var n = this; n !== null; n = n.parentNode) these.push(n); - for(n = that; n !== null; n = n.parentNode) those.push(n); - these.reverse(); // So we start with the outermost - those.reverse(); - - if (these[0] !== those[0]) // No common ancestor - return (DOCUMENT_POSITION_DISCONNECTED + - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC); - - n = Math.min(these.length, those.length); - for(var i = 1; i < n; i++) { - if (these[i] !== those[i]) { - // We found two different ancestors, so compare - // their positions - if (these[i].index < those[i].index) - return DOCUMENT_POSITION_FOLLOWING; - else - return DOCUMENT_POSITION_PRECEDING; - } - } - - // If we get to here, then one of the nodes (the one with the - // shorter list of ancestors) contains the other one. - if (these.length < those.length) - return (DOCUMENT_POSITION_FOLLOWING + - DOCUMENT_POSITION_CONTAINED_BY); - else - return (DOCUMENT_POSITION_PRECEDING + - DOCUMENT_POSITION_CONTAINS); - }}, - - isSameNode: {value : function isSameNode(node) { - return this === node; - }}, - - - // This method implements the generic parts of node equality testing - // and defers to the (non-recursive) type-specific isEqual() method - // defined by subclasses - isEqualNode: { value: function isEqualNode(node) { - if (!node) return false; - if (node.nodeType !== this.nodeType) return false; - - // Check type-specific properties for equality - if (!this.isEqual(node)) return false; - - // Now check children for number and equality - for (var c1 = this.firstChild, c2 = node.firstChild; - c1 && c2; - c1 = c1.nextSibling, c2 = c2.nextSibling) { - if (!c1.isEqualNode(c2)) return false; - } - return c1 === null && c2 === null; - }}, - - // This method delegates shallow cloning to a clone() method - // that each concrete subclass must implement - cloneNode: { value: function(deep) { - // Clone this node - var clone = this.clone(); - - // Handle the recursive case if necessary - if (deep) { - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - clone._appendChild(kid.cloneNode(true)); - } - } - - return clone; - }}, - - lookupPrefix: { value: function lookupPrefix(ns) { - var e; - if (ns === '' || ns === null || ns === undefined) return null; - switch(this.nodeType) { - case ELEMENT_NODE: - return this._lookupNamespacePrefix(ns, this); - case DOCUMENT_NODE: - e = this.documentElement; - return e ? e.lookupPrefix(ns) : null; - case ENTITY_NODE: - case NOTATION_NODE: - case DOCUMENT_FRAGMENT_NODE: - case DOCUMENT_TYPE_NODE: - return null; - case ATTRIBUTE_NODE: - e = this.ownerElement; - return e ? e.lookupPrefix(ns) : null; - default: - e = this.parentElement; - return e ? e.lookupPrefix(ns) : null; - } - }}, - - - lookupNamespaceURI: {value: function lookupNamespaceURI(prefix) { - if (prefix === '' || prefix === undefined) { prefix = null; } - var e; - switch(this.nodeType) { - case ELEMENT_NODE: - return utils.shouldOverride(); - case DOCUMENT_NODE: - e = this.documentElement; - return e ? e.lookupNamespaceURI(prefix) : null; - case ENTITY_NODE: - case NOTATION_NODE: - case DOCUMENT_TYPE_NODE: - case DOCUMENT_FRAGMENT_NODE: - return null; - case ATTRIBUTE_NODE: - e = this.ownerElement; - return e ? e.lookupNamespaceURI(prefix) : null; - default: - e = this.parentElement; - return e ? e.lookupNamespaceURI(prefix) : null; - } - }}, - - isDefaultNamespace: { value: function isDefaultNamespace(ns) { - if (ns === '' || ns === undefined) { ns = null; } - var defaultNamespace = this.lookupNamespaceURI(null); - return (defaultNamespace === ns); - }}, - - // Utility methods for nodes. Not part of the DOM - - // Return the index of this node in its parent. - // Throw if no parent, or if this node is not a child of its parent - index: { get: function() { - var parent = this.parentNode; - if (this === parent.firstChild) return 0; // fast case - var kids = parent.childNodes; - if (this._index === undefined || kids[this._index] !== this) { - // Ensure that we don't have an O(N^2) blowup if none of the - // kids have defined indices yet and we're traversing via - // nextSibling or previousSibling - for (var i=0; i 2 ? spliceArgs[2] : null); - } else if (len > 2 && n !== null) { - LinkedList.insertBefore(spliceArgs[2], n); - } - if (parent._childNodes) { - spliceArgs[0] = (before === null) ? - parent._childNodes.length : before._index; - parent._childNodes.splice.apply(parent._childNodes, spliceArgs); - for (i=2; i 2) { - parent._firstChild = spliceArgs[2]; - } else if (isReplace) { - parent._firstChild = null; - } - } - // Remove all nodes from the document fragment - if (child._childNodes) { - child._childNodes.length = 0; - } else { - child._firstChild = null; - } - // Call the mutation handlers - // Use spliceArgs since the original array has been destroyed. The - // liveness guarantee requires us to clone the array so that - // references to the childNodes of the DocumentFragment will be empty - // when the insertion handlers are called. - if (parent.rooted) { - parent.modify(); - for (i = 2; i < len; i++) { - parent.doc.mutateInsert(spliceArgs[i]); - } - } - } else { - if (before === child) { return; } - if (bothRooted) { - // Remove the child from its current position in the tree - // without calling remove(), since we don't want to uproot it. - child._remove(); - } else if (child.parentNode) { - child.remove(); - } - - // Insert it as a child of its new parent - child.parentNode = parent; - if (isReplace) { - LinkedList.replace(n, child); - if (parent._childNodes) { - child._index = before_index; - parent._childNodes[before_index] = child; - } else if (parent._firstChild === before) { - parent._firstChild = child; - } - } else { - if (n !== null) { - LinkedList.insertBefore(child, n); - } - if (parent._childNodes) { - child._index = before_index; - parent._childNodes.splice(before_index, 0, child); - } else if (parent._firstChild === before) { - parent._firstChild = child; - } - } - if (bothRooted) { - parent.modify(); - // Generate a move mutation event - parent.doc.mutateMove(child); - } else if (parent.rooted) { - parent.modify(); - parent.doc.mutateInsert(child); - } - } - }}, - - - // Return the lastModTime value for this node. (For use as a - // cache invalidation mechanism. If the node does not already - // have one, initialize it from the owner document's modclock - // property. (Note that modclock does not return the actual - // time; it is simply a counter incremented on each document - // modification) - lastModTime: { get: function() { - if (!this._lastModTime) { - this._lastModTime = this.doc.modclock; - } - return this._lastModTime; - }}, - - // Increment the owner document's modclock and use the new - // value to update the lastModTime value for this node and - // all of its ancestors. Nodes that have never had their - // lastModTime value queried do not need to have a - // lastModTime property set on them since there is no - // previously queried value to ever compare the new value - // against, so only update nodes that already have a - // _lastModTime property. - modify: { value: function() { - if (this.doc.modclock) { // Skip while doc.modclock == 0 - var time = ++this.doc.modclock; - for(var n = this; n; n = n.parentElement) { - if (n._lastModTime) { - n._lastModTime = time; - } - } - } - }}, - - // This attribute is not part of the DOM but is quite helpful. - // It returns the document with which a node is associated. Usually - // this is the ownerDocument. But ownerDocument is null for the - // document object itself, so this is a handy way to get the document - // regardless of the node type - doc: { get: function() { - return this.ownerDocument || this; - }}, - - - // If the node has a nid (node id), then it is rooted in a document - rooted: { get: function() { - return !!this._nid; - }}, - - normalize: { value: function() { - var next; - for (var child=this.firstChild; child !== null; child=next) { - next = child.nextSibling; - - if (child.normalize) { - child.normalize(); - } - - if (child.nodeType !== Node.TEXT_NODE) { - continue; - } - - if (child.nodeValue === "") { - this.removeChild(child); - continue; - } - - var prevChild = child.previousSibling; - if (prevChild === null) { - continue; - } else if (prevChild.nodeType === Node.TEXT_NODE) { - // merge this with previous and remove the child - prevChild.appendData(child.nodeValue); - this.removeChild(child); - } - } - }}, - - // Convert the children of a node to an HTML string. - // This is used by the innerHTML getter - // The serialization spec is at: - // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#serializing-html-fragments - // - // The serialization logic is intentionally implemented in a separate - // `NodeUtils` helper instead of the more obvious choice of a private - // `_serializeOne()` method on the `Node.prototype` in order to avoid - // the megamorphic `this._serializeOne` property access, which reduces - // performance unnecessarily. If you need specialized behavior for a - // certain subclass, you'll need to implement that in `NodeUtils`. - // See https://github.com/fgnass/domino/pull/142 for more information. - serialize: { value: function() { - if (this._innerHTML) { - return this._innerHTML; - } - var s = ''; - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - s += NodeUtils.serializeOne(kid, this); - } - return s; - }}, - - // Non-standard, but often useful for debugging. - outerHTML: { - get: function() { - return NodeUtils.serializeOne(this, { nodeType: 0 }); - }, - set: utils.nyi, - }, - - // mirror node type properties in the prototype, so they are present - // in instances of Node (and subclasses) - ELEMENT_NODE: { value: ELEMENT_NODE }, - ATTRIBUTE_NODE: { value: ATTRIBUTE_NODE }, - TEXT_NODE: { value: TEXT_NODE }, - CDATA_SECTION_NODE: { value: CDATA_SECTION_NODE }, - ENTITY_REFERENCE_NODE: { value: ENTITY_REFERENCE_NODE }, - ENTITY_NODE: { value: ENTITY_NODE }, - PROCESSING_INSTRUCTION_NODE: { value: PROCESSING_INSTRUCTION_NODE }, - COMMENT_NODE: { value: COMMENT_NODE }, - DOCUMENT_NODE: { value: DOCUMENT_NODE }, - DOCUMENT_TYPE_NODE: { value: DOCUMENT_TYPE_NODE }, - DOCUMENT_FRAGMENT_NODE: { value: DOCUMENT_FRAGMENT_NODE }, - NOTATION_NODE: { value: NOTATION_NODE }, - - DOCUMENT_POSITION_DISCONNECTED: { value: DOCUMENT_POSITION_DISCONNECTED }, - DOCUMENT_POSITION_PRECEDING: { value: DOCUMENT_POSITION_PRECEDING }, - DOCUMENT_POSITION_FOLLOWING: { value: DOCUMENT_POSITION_FOLLOWING }, - DOCUMENT_POSITION_CONTAINS: { value: DOCUMENT_POSITION_CONTAINS }, - DOCUMENT_POSITION_CONTAINED_BY: { value: DOCUMENT_POSITION_CONTAINED_BY }, - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { value: DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC }, -}); - - -/***/ }), - -/***/ 383: -/***/ ((module) => { - -"use strict"; - -var NodeFilter = { - // Constants for acceptNode() - FILTER_ACCEPT: 1, - FILTER_REJECT: 2, - FILTER_SKIP: 3, - - // Constants for whatToShow - SHOW_ALL: 0xFFFFFFFF, - SHOW_ELEMENT: 0x1, - SHOW_ATTRIBUTE: 0x2, // historical - SHOW_TEXT: 0x4, - SHOW_CDATA_SECTION: 0x8, // historical - SHOW_ENTITY_REFERENCE: 0x10, // historical - SHOW_ENTITY: 0x20, // historical - SHOW_PROCESSING_INSTRUCTION: 0x40, - SHOW_COMMENT: 0x80, - SHOW_DOCUMENT: 0x100, - SHOW_DOCUMENT_TYPE: 0x200, - SHOW_DOCUMENT_FRAGMENT: 0x400, - SHOW_NOTATION: 0x800 // historical -}; - -module.exports = (NodeFilter.constructor = NodeFilter.prototype = NodeFilter); - - -/***/ }), - -/***/ 30419: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = NodeIterator; - -var NodeFilter = __webpack_require__(383); -var NodeTraversal = __webpack_require__(72059); -var utils = __webpack_require__(89076); - -/* Private methods and helpers */ - -/** - * @based on WebKit's NodeIterator::moveToNext and NodeIterator::moveToPrevious - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeIterator.cpp?rev=186279#L51 - */ -function move(node, stayWithin, directionIsNext) { - if (directionIsNext) { - return NodeTraversal.next(node, stayWithin); - } else { - if (node === stayWithin) { - return null; - } - return NodeTraversal.previous(node, null); - } -} - -function isInclusiveAncestor(node, possibleChild) { - for ( ; possibleChild; possibleChild = possibleChild.parentNode) { - if (node === possibleChild) { return true; } - } - return false; -} - -/** - * @spec http://www.w3.org/TR/dom/#concept-nodeiterator-traverse - * @method - * @access private - * @param {NodeIterator} ni - * @param {string} direction One of 'next' or 'previous'. - * @return {Node|null} - */ -function traverse(ni, directionIsNext) { - var node, beforeNode; - node = ni._referenceNode; - beforeNode = ni._pointerBeforeReferenceNode; - while (true) { - if (beforeNode === directionIsNext) { - beforeNode = !beforeNode; - } else { - node = move(node, ni._root, directionIsNext); - if (node === null) { - return null; - } - } - var result = ni._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - break; - } - } - ni._referenceNode = node; - ni._pointerBeforeReferenceNode = beforeNode; - return node; -} - -/* Public API */ - -/** - * Implemented version: http://www.w3.org/TR/2015/WD-dom-20150618/#nodeiterator - * Latest version: http://www.w3.org/TR/dom/#nodeiterator - * - * @constructor - * @param {Node} root - * @param {number} whatToShow [optional] - * @param {Function|NodeFilter} filter [optional] - * @throws Error - */ -function NodeIterator(root, whatToShow, filter) { - if (!root || !root.nodeType) { - utils.NotSupportedError(); - } - - // Read-only properties - this._root = root; - this._referenceNode = root; - this._pointerBeforeReferenceNode = true; - this._whatToShow = Number(whatToShow) || 0; - this._filter = filter || null; - this._active = false; - // Record active node iterators in the document, in order to perform - // "node iterator pre-removal steps". - root.doc._attachNodeIterator(this); -} - -Object.defineProperties(NodeIterator.prototype, { - root: { get: function root() { - return this._root; - } }, - referenceNode: { get: function referenceNode() { - return this._referenceNode; - } }, - pointerBeforeReferenceNode: { get: function pointerBeforeReferenceNode() { - return this._pointerBeforeReferenceNode; - } }, - whatToShow: { get: function whatToShow() { - return this._whatToShow; - } }, - filter: { get: function filter() { - return this._filter; - } }, - - /** - * @method - * @param {Node} node - * @return {Number} Constant NodeFilter.FILTER_ACCEPT, - * NodeFilter.FILTER_REJECT or NodeFilter.FILTER_SKIP. - */ - _internalFilter: { value: function _internalFilter(node) { - /* jshint bitwise: false */ - var result, filter; - if (this._active) { - utils.InvalidStateError(); - } - - // Maps nodeType to whatToShow - if (!(((1 << (node.nodeType - 1)) & this._whatToShow))) { - return NodeFilter.FILTER_SKIP; - } - - filter = this._filter; - if (filter === null) { - result = NodeFilter.FILTER_ACCEPT; - } else { - this._active = true; - try { - if (typeof filter === 'function') { - result = filter(node); - } else { - result = filter.acceptNode(node); - } - } finally { - this._active = false; - } - } - - // Note that coercing to a number means that - // `true` becomes `1` (which is NodeFilter.FILTER_ACCEPT) - // `false` becomes `0` (neither accept, reject, or skip) - return (+result); - } }, - - /** - * @spec https://dom.spec.whatwg.org/#nodeiterator-pre-removing-steps - * @method - * @return void - */ - _preremove: { value: function _preremove(toBeRemovedNode) { - if (isInclusiveAncestor(toBeRemovedNode, this._root)) { return; } - if (!isInclusiveAncestor(toBeRemovedNode, this._referenceNode)) { return; } - if (this._pointerBeforeReferenceNode) { - var next = toBeRemovedNode; - while (next.lastChild) { - next = next.lastChild; - } - next = NodeTraversal.next(next, this.root); - if (next) { - this._referenceNode = next; - return; - } - this._pointerBeforeReferenceNode = false; - // fall through - } - if (toBeRemovedNode.previousSibling === null) { - this._referenceNode = toBeRemovedNode.parentNode; - } else { - this._referenceNode = toBeRemovedNode.previousSibling; - var lastChild; - for (lastChild = this._referenceNode.lastChild; - lastChild; - lastChild = this._referenceNode.lastChild) { - this._referenceNode = lastChild; - } - } - } }, - - /** - * @spec http://www.w3.org/TR/dom/#dom-nodeiterator-nextnode - * @method - * @return {Node|null} - */ - nextNode: { value: function nextNode() { - return traverse(this, true); - } }, - - /** - * @spec http://www.w3.org/TR/dom/#dom-nodeiterator-previousnode - * @method - * @return {Node|null} - */ - previousNode: { value: function previousNode() { - return traverse(this, false); - } }, - - /** - * @spec http://www.w3.org/TR/dom/#dom-nodeiterator-detach - * @method - * @return void - */ - detach: { value: function detach() { - /* "The detach() method must do nothing. - * Its functionality (disabling a NodeIterator object) was removed, - * but the method itself is preserved for compatibility. - */ - } }, - - /** For compatibility with web-platform-tests. */ - toString: { value: function toString() { - return "[object NodeIterator]"; - } }, -}); - - -/***/ }), - -/***/ 52516: -/***/ ((module) => { - -"use strict"; - - -// No support for subclassing array, return an actual Array object. -function item(i) { - /* jshint validthis: true */ - return this[i] || null; -} - -function NodeList(a) { - if (!a) a = []; - a.item = item; - return a; -} - -module.exports = NodeList; - - -/***/ }), - -/***/ 77101: -/***/ ((module) => { - -"use strict"; -/* jshint esversion: 6 */ - - -module.exports = class NodeList extends Array { - constructor(a) { - super((a && a.length) || 0); - if (a) { - for (var idx in a) { this[idx] = a[idx]; } - } - } - item(i) { return this[i] || null; } -}; - - -/***/ }), - -/***/ 64965: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var NodeList; - -try { - // Attempt to use ES6-style Array subclass if possible. - NodeList = __webpack_require__(77101); -} catch (e) { - // No support for subclassing array, return an actual Array object. - NodeList = __webpack_require__(52516); -} - -module.exports = NodeList; - - -/***/ }), - -/***/ 72059: -/***/ ((module) => { - -"use strict"; - -/* exported NodeTraversal */ -var NodeTraversal = module.exports = { - nextSkippingChildren: nextSkippingChildren, - nextAncestorSibling: nextAncestorSibling, - next: next, - previous: previous, - deepLastChild: deepLastChild -}; - -/** - * @based on WebKit's NodeTraversal::nextSkippingChildren - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.h?rev=179143#L109 - */ -function nextSkippingChildren(node, stayWithin) { - if (node === stayWithin) { - return null; - } - if (node.nextSibling !== null) { - return node.nextSibling; - } - return nextAncestorSibling(node, stayWithin); -} - -/** - * @based on WebKit's NodeTraversal::nextAncestorSibling - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.cpp?rev=179143#L93 - */ -function nextAncestorSibling(node, stayWithin) { - for (node = node.parentNode; node !== null; node = node.parentNode) { - if (node === stayWithin) { - return null; - } - if (node.nextSibling !== null) { - return node.nextSibling; - } - } - return null; -} - -/** - * @based on WebKit's NodeTraversal::next - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.h?rev=179143#L99 - */ -function next(node, stayWithin) { - var n; - n = node.firstChild; - if (n !== null) { - return n; - } - if (node === stayWithin) { - return null; - } - n = node.nextSibling; - if (n !== null) { - return n; - } - return nextAncestorSibling(node, stayWithin); -} - -/** - * @based on WebKit's NodeTraversal::deepLastChild - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.cpp?rev=179143#L116 - */ -function deepLastChild(node) { - while (node.lastChild) { - node = node.lastChild; - } - return node; -} - -/** - * @based on WebKit's NodeTraversal::previous - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.h?rev=179143#L121 - */ -function previous(node, stayWithin) { - var p; - p = node.previousSibling; - if (p !== null) { - return deepLastChild(p); - } - p = node.parentNode; - if (p === stayWithin) { - return null; - } - return p; -} - - -/***/ }), - -/***/ 41608: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = { - // NOTE: The `serializeOne()` function used to live on the `Node.prototype` - // as a private method `Node#_serializeOne(child)`, however that requires - // a megamorphic property access `this._serializeOne` just to get to the - // method, and this is being done on lots of different `Node` subclasses, - // which puts a lot of pressure on V8's megamorphic stub cache. So by - // moving the helper off of the `Node.prototype` and into a separate - // function in this helper module, we get a monomorphic property access - // `NodeUtils.serializeOne` to get to the function and reduce pressure - // on the megamorphic stub cache. - // See https://github.com/fgnass/domino/pull/142 for more information. - serializeOne: serializeOne, - - // Export util functions so that we can run extra test for them. - // Note: we prefix function names with `ɵ`, similar to what we do - // with internal functions in Angular packages. - ɵescapeMatchingClosingTag: escapeMatchingClosingTag, - ɵescapeClosingCommentTag: escapeClosingCommentTag, - ɵescapeProcessingInstructionContent: escapeProcessingInstructionContent -}; - -var utils = __webpack_require__(89076); -var NAMESPACE = utils.NAMESPACE; - -var hasRawContent = { - STYLE: true, - SCRIPT: true, - XMP: true, - IFRAME: true, - NOEMBED: true, - NOFRAMES: true, - PLAINTEXT: true -}; - -var emptyElements = { - area: true, - base: true, - basefont: true, - bgsound: true, - br: true, - col: true, - embed: true, - frame: true, - hr: true, - img: true, - input: true, - keygen: true, - link: true, - meta: true, - param: true, - source: true, - track: true, - wbr: true -}; - -var extraNewLine = { - /* Removed in https://github.com/whatwg/html/issues/944 - pre: true, - textarea: true, - listing: true - */ -}; - -const ESCAPE_REGEXP = /[&<>\u00A0]/g; -const ESCAPE_ATTR_REGEXP = /[&"<>\u00A0]/g; - -function escape(s) { - if (!ESCAPE_REGEXP.test(s)) { - // nothing to do, fast path - return s; - } - - return s.replace(ESCAPE_REGEXP, (c) => { - switch (c) { - case "&": - return "&"; - case "<": - return "<"; - case ">": - return ">"; - case "\u00A0": - return " "; - } - }); -} - -function escapeAttr(s) { - if (!ESCAPE_ATTR_REGEXP.test(s)) { - // nothing to do, fast path - return s; - } - - return s.replace(ESCAPE_ATTR_REGEXP, (c) => { - switch (c) { - case "<": - return "<"; - case ">": - return ">"; - case "&": - return "&"; - case '"': - return """; - case "\u00A0": - return " "; - } - }); -} - -function attrname(a) { - var ns = a.namespaceURI; - if (!ns) - return a.localName; - if (ns === NAMESPACE.XML) - return 'xml:' + a.localName; - if (ns === NAMESPACE.XLINK) - return 'xlink:' + a.localName; - - if (ns === NAMESPACE.XMLNS) { - if (a.localName === 'xmlns') return 'xmlns'; - else return 'xmlns:' + a.localName; - } - return a.name; -} - -/** - * Escapes matching closing tag in a raw text. - * - * For example, given `)`, - * the parent tag would by "style" and the raw text is - * "". If we come across a matching closing tag - * (in out case ``) - replace `<` with `<` to avoid unexpected - * and unsafe behavior after de-serialization. - */ -function escapeMatchingClosingTag(rawText, parentTag) { - const parentClosingTag = '/; - -/** - * Escapes closing comment tag in a comment content. - * - * For example, given `#comment('-->')`, the content of a comment would be - * updated to `-->` to avoid unexpected and unsafe behavior after - * de-serialization. - */ -function escapeClosingCommentTag(rawContent) { - if (!CLOSING_COMMENT_REGEXP.test(rawContent)) { - return rawContent; // fast path - } - return rawContent.replace(/(--\!?)>/g, '$1>'); -} - -/** - * Escapes processing instruction content by replacing `>` with `>`. - */ -function escapeProcessingInstructionContent(rawContent) { - return rawContent.includes('>') - ? rawContent.replaceAll('>', '>') - : rawContent; -} - -function serializeOne(kid, parent) { - var s = ''; - switch(kid.nodeType) { - case 1: //ELEMENT_NODE - var ns = kid.namespaceURI; - var html = ns === NAMESPACE.HTML; - var tagname = (html || ns === NAMESPACE.SVG || ns === NAMESPACE.MATHML) ? kid.localName : kid.tagName; - - s += '<' + tagname; - - for(var j = 0, k = kid._numattrs; j < k; j++) { - var a = kid._attr(j); - s += ' ' + attrname(a); - if (a.value !== undefined) s += '="' + escapeAttr(a.value) + '"'; - } - s += '>'; - - if (!(html && emptyElements[tagname])) { - var ss = kid.serialize(); - // If an element can have raw content, this content may - // potentially require escaping to avoid XSS. - if (hasRawContent[tagname.toUpperCase()]) { - ss = escapeMatchingClosingTag(ss, tagname); - } - if (html && extraNewLine[tagname] && ss.charAt(0)==='\n') s += '\n'; - // Serialize children and add end tag for all others - s += ss; - s += ''; - } - break; - case 3: //TEXT_NODE - case 4: //CDATA_SECTION_NODE - var parenttag; - if (parent.nodeType === 1 /*ELEMENT_NODE*/ && - parent.namespaceURI === NAMESPACE.HTML) - parenttag = parent.tagName; - else - parenttag = ''; - - if (hasRawContent[parenttag] || - (parenttag==='NOSCRIPT' && parent.ownerDocument._scripting_enabled)) { - s += kid.data; - } else { - s += escape(kid.data); - } - break; - case 8: //COMMENT_NODE - s += ''; - break; - case 7: //PROCESSING_INSTRUCTION_NODE - const content = escapeProcessingInstructionContent(kid.data); - s += ''; - break; - case 10: //DOCUMENT_TYPE_NODE - s += ''; - break; - default: - utils.InvalidStateError(); - } - return s; -} - - -/***/ }), - -/***/ 32001: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var Node = __webpack_require__(97537); - -var NonDocumentTypeChildNode = { - - nextElementSibling: { get: function() { - if (this.parentNode) { - for (var kid = this.nextSibling; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === Node.ELEMENT_NODE) return kid; - } - } - return null; - }}, - - previousElementSibling: { get: function() { - if (this.parentNode) { - for (var kid = this.previousSibling; kid !== null; kid = kid.previousSibling) { - if (kid.nodeType === Node.ELEMENT_NODE) return kid; - } - } - return null; - }} - -}; - -module.exports = NonDocumentTypeChildNode; - - -/***/ }), - -/***/ 81248: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = ProcessingInstruction; - -var Node = __webpack_require__(97537); -var CharacterData = __webpack_require__(90086); - -function ProcessingInstruction(doc, target, data) { - CharacterData.call(this); - this.nodeType = Node.PROCESSING_INSTRUCTION_NODE; - this.ownerDocument = doc; - this.target = target; - this._data = data; -} - -var nodeValue = { - get: function() { return this._data; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } else { v = String(v); } - this._data = v; - if (this.rooted) this.ownerDocument.mutateValue(this); - } -}; - -ProcessingInstruction.prototype = Object.create(CharacterData.prototype, { - nodeName: { get: function() { return this.target; }}, - nodeValue: nodeValue, - textContent: nodeValue, - innerText: nodeValue, - data: { - get: nodeValue.get, - set: function(v) { - nodeValue.set.call(this, v===null ? '' : String(v)); - }, - }, - - // Utility methods - clone: { value: function clone() { - return new ProcessingInstruction(this.ownerDocument, this.target, this._data); - }}, - isEqual: { value: function isEqual(n) { - return this.target === n.target && this._data === n._data; - }} - -}); - - -/***/ }), - -/***/ 58210: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = Text; - -var utils = __webpack_require__(89076); -var Node = __webpack_require__(97537); -var CharacterData = __webpack_require__(90086); - -function Text(doc, data) { - CharacterData.call(this); - this.nodeType = Node.TEXT_NODE; - this.ownerDocument = doc; - this._data = data; - this._index = undefined; -} - -var nodeValue = { - get: function() { return this._data; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } else { v = String(v); } - if (v === this._data) return; - this._data = v; - if (this.rooted) - this.ownerDocument.mutateValue(this); - if (this.parentNode && - this.parentNode._textchangehook) - this.parentNode._textchangehook(this); - } -}; - -Text.prototype = Object.create(CharacterData.prototype, { - nodeName: { value: "#text" }, - // These three attributes are all the same. - // The data attribute has a [TreatNullAs=EmptyString] but we'll - // implement that at the interface level - nodeValue: nodeValue, - textContent: nodeValue, - innerText: nodeValue, - data: { - get: nodeValue.get, - set: function(v) { - nodeValue.set.call(this, v===null ? '' : String(v)); - }, - }, - - splitText: { value: function splitText(offset) { - if (offset > this._data.length || offset < 0) utils.IndexSizeError(); - - var newdata = this._data.substring(offset), - newnode = this.ownerDocument.createTextNode(newdata); - this.data = this.data.substring(0, offset); - - var parent = this.parentNode; - if (parent !== null) - parent.insertBefore(newnode, this.nextSibling); - - return newnode; - }}, - - wholeText: { get: function wholeText() { - var result = this.textContent; - for (var next = this.nextSibling; next; next = next.nextSibling) { - if (next.nodeType !== Node.TEXT_NODE) { break; } - result += next.textContent; - } - return result; - }}, - // Obsolete, removed from spec. - replaceWholeText: { value: utils.nyi }, - - // Utility methods - clone: { value: function clone() { - return new Text(this.ownerDocument, this._data); - }}, - -}); - - -/***/ }), - -/***/ 44507: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = TreeWalker; - -var Node = __webpack_require__(97537); -var NodeFilter = __webpack_require__(383); -var NodeTraversal = __webpack_require__(72059); -var utils = __webpack_require__(89076); - -var mapChild = { - first: 'firstChild', - last: 'lastChild', - next: 'firstChild', - previous: 'lastChild' -}; - -var mapSibling = { - first: 'nextSibling', - last: 'previousSibling', - next: 'nextSibling', - previous: 'previousSibling' -}; - -/* Private methods and helpers */ - -/** - * @spec https://dom.spec.whatwg.org/#concept-traverse-children - * @method - * @access private - * @param {TreeWalker} tw - * @param {string} type One of 'first' or 'last'. - * @return {Node|null} - */ -function traverseChildren(tw, type) { - var child, node, parent, result, sibling; - node = tw._currentNode[mapChild[type]]; - while (node !== null) { - result = tw._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - tw._currentNode = node; - return node; - } - if (result === NodeFilter.FILTER_SKIP) { - child = node[mapChild[type]]; - if (child !== null) { - node = child; - continue; - } - } - while (node !== null) { - sibling = node[mapSibling[type]]; - if (sibling !== null) { - node = sibling; - break; - } - parent = node.parentNode; - if (parent === null || parent === tw.root || parent === tw._currentNode) { - return null; - } else { - node = parent; - } - } - } - return null; -} - -/** - * @spec https://dom.spec.whatwg.org/#concept-traverse-siblings - * @method - * @access private - * @param {TreeWalker} tw - * @param {TreeWalker} type One of 'next' or 'previous'. - * @return {Node|nul} - */ -function traverseSiblings(tw, type) { - var node, result, sibling; - node = tw._currentNode; - if (node === tw.root) { - return null; - } - while (true) { - sibling = node[mapSibling[type]]; - while (sibling !== null) { - node = sibling; - result = tw._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - tw._currentNode = node; - return node; - } - sibling = node[mapChild[type]]; - if (result === NodeFilter.FILTER_REJECT || sibling === null) { - sibling = node[mapSibling[type]]; - } - } - node = node.parentNode; - if (node === null || node === tw.root) { - return null; - } - if (tw._internalFilter(node) === NodeFilter.FILTER_ACCEPT) { - return null; - } - } -} - - -/* Public API */ - -/** - * Latest version: https://dom.spec.whatwg.org/#treewalker - * - * @constructor - * @param {Node} root - * @param {number} whatToShow [optional] - * @param {Function|NodeFilter} filter [optional] - * @throws Error - */ -function TreeWalker(root, whatToShow, filter) { - if (!root || !root.nodeType) { - utils.NotSupportedError(); - } - - // Read-only properties - this._root = root; - this._whatToShow = Number(whatToShow) || 0; - this._filter = filter || null; - this._active = false; - // Read-write property - this._currentNode = root; -} - -Object.defineProperties(TreeWalker.prototype, { - root: { get: function() { return this._root; } }, - whatToShow: { get: function() { return this._whatToShow; } }, - filter: { get: function() { return this._filter; } }, - - currentNode: { - get: function currentNode() { - return this._currentNode; - }, - set: function setCurrentNode(v) { - if (!(v instanceof Node)) { - throw new TypeError("Not a Node"); // `null` is also not a node - } - this._currentNode = v; - }, - }, - - /** - * @method - * @param {Node} node - * @return {Number} Constant NodeFilter.FILTER_ACCEPT, - * NodeFilter.FILTER_REJECT or NodeFilter.FILTER_SKIP. - */ - _internalFilter: { value: function _internalFilter(node) { - /* jshint bitwise: false */ - var result, filter; - if (this._active) { - utils.InvalidStateError(); - } - - // Maps nodeType to whatToShow - if (!(((1 << (node.nodeType - 1)) & this._whatToShow))) { - return NodeFilter.FILTER_SKIP; - } - - filter = this._filter; - if (filter === null) { - result = NodeFilter.FILTER_ACCEPT; - } else { - this._active = true; - try { - if (typeof filter === 'function') { - result = filter(node); - } else { - result = filter.acceptNode(node); - } - } finally { - this._active = false; - } - } - - // Note that coercing to a number means that - // `true` becomes `1` (which is NodeFilter.FILTER_ACCEPT) - // `false` becomes `0` (neither accept, reject, or skip) - return (+result); - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-parentnode - * @based on WebKit's TreeWalker::parentNode - * https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/TreeWalker.cpp?rev=220453#L50 - * @method - * @return {Node|null} - */ - parentNode: { value: function parentNode() { - var node = this._currentNode; - while (node !== this.root) { - node = node.parentNode; - if (node === null) { - return null; - } - if (this._internalFilter(node) === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } - } - return null; - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-firstchild - * @method - * @return {Node|null} - */ - firstChild: { value: function firstChild() { - return traverseChildren(this, 'first'); - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-lastchild - * @method - * @return {Node|null} - */ - lastChild: { value: function lastChild() { - return traverseChildren(this, 'last'); - }}, - - /** - * @spec http://www.w3.org/TR/dom/#dom-treewalker-previoussibling - * @method - * @return {Node|null} - */ - previousSibling: { value: function previousSibling() { - return traverseSiblings(this, 'previous'); - }}, - - /** - * @spec http://www.w3.org/TR/dom/#dom-treewalker-nextsibling - * @method - * @return {Node|null} - */ - nextSibling: { value: function nextSibling() { - return traverseSiblings(this, 'next'); - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-previousnode - * @based on WebKit's TreeWalker::previousNode - * https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/TreeWalker.cpp?rev=220453#L181 - * @method - * @return {Node|null} - */ - previousNode: { value: function previousNode() { - var node, result, previousSibling, lastChild; - node = this._currentNode; - while (node !== this._root) { - for (previousSibling = node.previousSibling; - previousSibling; - previousSibling = node.previousSibling) { - node = previousSibling; - result = this._internalFilter(node); - if (result === NodeFilter.FILTER_REJECT) { - continue; - } - for (lastChild = node.lastChild; - lastChild; - lastChild = node.lastChild) { - node = lastChild; - result = this._internalFilter(node); - if (result === NodeFilter.FILTER_REJECT) { - break; - } - } - if (result === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } - } - if (node === this.root || node.parentNode === null) { - return null; - } - node = node.parentNode; - if (this._internalFilter(node) === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } - } - return null; - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-nextnode - * @based on WebKit's TreeWalker::nextNode - * https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/TreeWalker.cpp?rev=220453#L228 - * @method - * @return {Node|null} - */ - nextNode: { value: function nextNode() { - var node, result, firstChild, nextSibling; - node = this._currentNode; - result = NodeFilter.FILTER_ACCEPT; - - CHILDREN: - while (true) { - for (firstChild = node.firstChild; - firstChild; - firstChild = node.firstChild) { - node = firstChild; - result = this._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } else if (result === NodeFilter.FILTER_REJECT) { - break; - } - } - for (nextSibling = NodeTraversal.nextSkippingChildren(node, this.root); - nextSibling; - nextSibling = NodeTraversal.nextSkippingChildren(node, this.root)) { - node = nextSibling; - result = this._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } else if (result === NodeFilter.FILTER_SKIP) { - continue CHILDREN; - } - } - return null; - } - }}, - - /** For compatibility with web-platform-tests. */ - toString: { value: function toString() { - return "[object TreeWalker]"; - }}, -}); - - -/***/ }), - -/***/ 64259: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var Event = __webpack_require__(13441); - -module.exports = UIEvent; - -function UIEvent() { - // Just use the superclass constructor to initialize - Event.call(this); - this.view = null; // FF uses the current window - this.detail = 0; -} -UIEvent.prototype = Object.create(Event.prototype, { - constructor: { value: UIEvent }, - initUIEvent: { value: function(type, bubbles, cancelable, view, detail) { - this.initEvent(type, bubbles, cancelable); - this.view = view; - this.detail = detail; - }} -}); - - -/***/ }), - -/***/ 85184: -/***/ ((module) => { - -"use strict"; - -module.exports = URL; - -function URL(url) { - if (!url) return Object.create(URL.prototype); - // Can't use String.trim() since it defines whitespace differently than HTML - this.url = url.replace(/^[ \t\n\r\f]+|[ \t\n\r\f]+$/g, ""); - - // See http://tools.ietf.org/html/rfc3986#appendix-B - // and https://url.spec.whatwg.org/#parsing - var match = URL.pattern.exec(this.url); - if (match) { - if (match[2]) this.scheme = match[2]; - if (match[4]) { - // parse username/password - var userinfo = match[4].match(URL.userinfoPattern); - if (userinfo) { - this.username = userinfo[1]; - this.password = userinfo[3]; - match[4] = match[4].substring(userinfo[0].length); - } - if (match[4].match(URL.portPattern)) { - var pos = match[4].lastIndexOf(':'); - this.host = match[4].substring(0, pos); - this.port = match[4].substring(pos+1); - } - else { - this.host = match[4]; - } - } - if (match[5]) this.path = match[5]; - if (match[6]) this.query = match[7]; - if (match[8]) this.fragment = match[9]; - } -} - -URL.pattern = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/; -URL.userinfoPattern = /^([^@:]*)(:([^@]*))?@/; -URL.portPattern = /:\d+$/; -URL.authorityPattern = /^[^:\/?#]+:\/\//; -URL.hierarchyPattern = /^[^:\/?#]+:\//; - -// Return a percentEncoded version of s. -// S should be a single-character string -// XXX: needs to do utf-8 encoding? -URL.percentEncode = function percentEncode(s) { - var c = s.charCodeAt(0); - if (c < 256) return "%" + c.toString(16); - else throw Error("can't percent-encode codepoints > 255 yet"); -}; - -URL.prototype = { - constructor: URL, - - // XXX: not sure if this is the precise definition of absolute - isAbsolute: function() { return !!this.scheme; }, - isAuthorityBased: function() { - return URL.authorityPattern.test(this.url); - }, - isHierarchical: function() { - return URL.hierarchyPattern.test(this.url); - }, - - toString: function() { - var s = ""; - if (this.scheme !== undefined) s += this.scheme + ":"; - if (this.isAbsolute()) { - s += '//'; - if (this.username || this.password) { - s += this.username || ''; - if (this.password) { - s += ':' + this.password; - } - s += '@'; - } - if (this.host) { - s += this.host; - } - } - if (this.port !== undefined) s += ":" + this.port; - if (this.path !== undefined) s += this.path; - if (this.query !== undefined) s += "?" + this.query; - if (this.fragment !== undefined) s += "#" + this.fragment; - return s; - }, - - // See: http://tools.ietf.org/html/rfc3986#section-5.2 - // and https://url.spec.whatwg.org/#constructors - resolve: function(relative) { - var base = this; // The base url we're resolving against - var r = new URL(relative); // The relative reference url to resolve - var t = new URL(); // The absolute target url we will return - - if (r.scheme !== undefined) { - t.scheme = r.scheme; - t.username = r.username; - t.password = r.password; - t.host = r.host; - t.port = r.port; - t.path = remove_dot_segments(r.path); - t.query = r.query; - } - else { - t.scheme = base.scheme; - if (r.host !== undefined) { - t.username = r.username; - t.password = r.password; - t.host = r.host; - t.port = r.port; - t.path = remove_dot_segments(r.path); - t.query = r.query; - } - else { - t.username = base.username; - t.password = base.password; - t.host = base.host; - t.port = base.port; - if (!r.path) { // undefined or empty - t.path = base.path; - if (r.query !== undefined) - t.query = r.query; - else - t.query = base.query; - } - else { - if (r.path.charAt(0) === "/") { - t.path = remove_dot_segments(r.path); - } - else { - t.path = merge(base.path, r.path); - t.path = remove_dot_segments(t.path); - } - t.query = r.query; - } - } - } - t.fragment = r.fragment; - - return t.toString(); - - - function merge(basepath, refpath) { - if (base.host !== undefined && !base.path) - return "/" + refpath; - - var lastslash = basepath.lastIndexOf("/"); - if (lastslash === -1) - return refpath; - else - return basepath.substring(0, lastslash+1) + refpath; - } - - function remove_dot_segments(path) { - if (!path) return path; // For "" or undefined - - var output = ""; - while(path.length > 0) { - if (path === "." || path === "..") { - path = ""; - break; - } - - var twochars = path.substring(0,2); - var threechars = path.substring(0,3); - var fourchars = path.substring(0,4); - if (threechars === "../") { - path = path.substring(3); - } - else if (twochars === "./") { - path = path.substring(2); - } - else if (threechars === "/./") { - path = "/" + path.substring(3); - } - else if (twochars === "/." && path.length === 2) { - path = "/"; - } - else if (fourchars === "/../" || - (threechars === "/.." && path.length === 3)) { - path = "/" + path.substring(4); - - output = output.replace(/\/?[^\/]*$/, ""); - } - else { - var segment = path.match(/(\/?([^\/]*))/)[0]; - output += segment; - path = path.substring(segment.length); - } - } - - return output; - } - }, -}; - - -/***/ }), - -/***/ 65531: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var URL = __webpack_require__(85184); - -module.exports = URLUtils; - -// Allow the `x == null` pattern. This is eslint's "null: 'ignore'" option, -// but jshint doesn't support this. -/* jshint eqeqeq: false */ - -// This is an abstract superclass for Location, HTMLAnchorElement and -// other types that have the standard complement of "URL decomposition -// IDL attributes". This is now standardized as URLUtils, see: -// https://url.spec.whatwg.org/#urlutils -// Subclasses must define a getter/setter on href. -// The getter and setter methods parse and rebuild the URL on each -// invocation; there is no attempt to cache the value and be more efficient -function URLUtils() {} -URLUtils.prototype = Object.create(Object.prototype, { - - _url: { get: function() { - // XXX: this should do the "Reinitialize url" steps, and "null" should - // be a valid return value. - return new URL(this.href); - } }, - - protocol: { - get: function() { - var url = this._url; - if (url && url.scheme) return url.scheme + ":"; - else return ":"; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute()) { - v = v.replace(/:+$/, ""); - v = v.replace(/[^-+\.a-zA-Z0-9]/g, URL.percentEncode); - if (v.length > 0) { - url.scheme = v; - output = url.toString(); - } - } - this.href = output; - }, - }, - - host: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isAuthorityBased()) - return url.host + (url.port ? (":" + url.port) : ""); - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isAuthorityBased()) { - v = v.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL.percentEncode); - if (v.length > 0) { - url.host = v; - delete url.port; - output = url.toString(); - } - } - this.href = output; - }, - }, - - hostname: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isAuthorityBased()) - return url.host; - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isAuthorityBased()) { - v = v.replace(/^\/+/, ""); - v = v.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL.percentEncode); - if (v.length > 0) { - url.host = v; - output = url.toString(); - } - } - this.href = output; - }, - }, - - port: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isAuthorityBased() && url.port!==undefined) - return url.port; - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isAuthorityBased()) { - v = '' + v; - v = v.replace(/[^0-9].*$/, ""); - v = v.replace(/^0+/, ""); - if (v.length === 0) v = "0"; - if (parseInt(v, 10) <= 65535) { - url.port = v; - output = url.toString(); - } - } - this.href = output; - }, - }, - - pathname: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isHierarchical()) - return url.path; - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isHierarchical()) { - if (v.charAt(0) !== "/") - v = "/" + v; - v = v.replace(/[^-+\._~!$&'()*,;:=@\/a-zA-Z0-9]/g, URL.percentEncode); - url.path = v; - output = url.toString(); - } - this.href = output; - }, - }, - - search: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isHierarchical() && url.query!==undefined) - return "?" + url.query; - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isHierarchical()) { - if (v.charAt(0) === "?") v = v.substring(1); - v = v.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL.percentEncode); - url.query = v; - output = url.toString(); - } - this.href = output; - }, - }, - - hash: { - get: function() { - var url = this._url; - if (url == null || url.fragment == null || url.fragment === '') { - return ""; - } else { - return "#" + url.fragment; - } - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - - if (v.charAt(0) === "#") v = v.substring(1); - v = v.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL.percentEncode); - url.fragment = v; - output = url.toString(); - - this.href = output; - }, - }, - - username: { - get: function() { - var url = this._url; - return url.username || ''; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute()) { - v = v.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\:]/g, URL.percentEncode); - url.username = v; - output = url.toString(); - } - this.href = output; - }, - }, - - password: { - get: function() { - var url = this._url; - return url.password || ''; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute()) { - if (v==='') { - url.password = null; - } else { - v = v.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\]/g, URL.percentEncode); - url.password = v; - } - output = url.toString(); - } - this.href = output; - }, - }, - - origin: { get: function() { - var url = this._url; - if (url == null) { return ''; } - var originForPort = function(defaultPort) { - var origin = [url.scheme, url.host, +url.port || defaultPort]; - // XXX should be "unicode serialization" - return origin[0] + '://' + origin[1] + - (origin[2] === defaultPort ? '' : (':' + origin[2])); - }; - switch (url.scheme) { - case 'ftp': - return originForPort(21); - case 'gopher': - return originForPort(70); - case 'http': - case 'ws': - return originForPort(80); - case 'https': - case 'wss': - return originForPort(443); - default: - // this is what chrome does - return url.scheme + '://'; - } - } }, - - /* - searchParams: { - get: function() { - var url = this._url; - // XXX - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - // XXX - this.href = output; - }, - }, - */ -}); - -URLUtils._inherit = function(proto) { - // copy getters/setters from URLUtils to o. - Object.getOwnPropertyNames(URLUtils.prototype).forEach(function(p) { - if (p==='constructor' || p==='href') { return; } - var desc = Object.getOwnPropertyDescriptor(URLUtils.prototype, p); - Object.defineProperty(proto, p, desc); - }); -}; - - -/***/ }), - -/***/ 21865: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var DOMImplementation = __webpack_require__(80931); -var EventTarget = __webpack_require__(22356); -var Location = __webpack_require__(63738); -var utils = __webpack_require__(89076); - -module.exports = Window; - -function Window(document) { - this.document = document || new DOMImplementation(null).createHTMLDocument(""); - this.document._scripting_enabled = true; - this.document.defaultView = this; - this.location = new Location(this, this.document._address || 'about:blank'); -} - -Window.prototype = Object.create(EventTarget.prototype, { - console: { value: console }, - history: { value: { - back: utils.nyi, - forward: utils.nyi, - go: utils.nyi - }}, - navigator: { value: __webpack_require__(94993) }, - - // Self-referential properties - window: { get: function() { return this; }}, - self: { get: function() { return this; }}, - frames: { get: function() { return this; }}, - - // Self-referential properties for a top-level window - parent: { get: function() { return this; }}, - top: { get: function() { return this; }}, - - // We don't support any other windows for now - length: { value: 0 }, // no frames - frameElement: { value: null }, // not part of a frame - opener: { value: null }, // not opened by another window - - // The onload event handler. - // XXX: need to support a bunch of other event types, too, - // and have them interoperate with document.body. - - onload: { - get: function() { - return this._getEventHandler("load"); - }, - set: function(v) { - this._setEventHandler("load", v); - } - }, - - // XXX This is a completely broken implementation - getComputedStyle: { value: function getComputedStyle(elt) { - return elt.style; - }} - -}); - -utils.expose(__webpack_require__(23811), Window); -utils.expose(__webpack_require__(31575), Window); - - -/***/ }), - -/***/ 23811: -/***/ ((module) => { - -"use strict"; - - -// https://html.spec.whatwg.org/multipage/webappapis.html#windowtimers -var WindowTimers = { - setTimeout: setTimeout, - clearTimeout: clearTimeout, - setInterval: setInterval, - clearInterval: clearInterval -}; - -module.exports = WindowTimers; - - -/***/ }), - -/***/ 6548: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var utils = __webpack_require__(89076); - -exports.property = function(attr) { - if (Array.isArray(attr.type)) { - var valid = Object.create(null); - attr.type.forEach(function(val) { - valid[val.value || val] = val.alias || val; - }); - var missingValueDefault = attr.missing; - if (missingValueDefault===undefined) { missingValueDefault = null; } - var invalidValueDefault = attr.invalid; - if (invalidValueDefault===undefined) { invalidValueDefault = missingValueDefault; } - return { - get: function() { - var v = this._getattr(attr.name); - if (v === null) return missingValueDefault; - - v = valid[v.toLowerCase()]; - if (v !== undefined) return v; - if (invalidValueDefault !== null) return invalidValueDefault; - return v; - }, - set: function(v) { - this._setattr(attr.name, v); - } - }; - } - else if (attr.type === Boolean) { - return { - get: function() { - return this.hasAttribute(attr.name); - }, - set: function(v) { - if (v) { - this._setattr(attr.name, ''); - } - else { - this.removeAttribute(attr.name); - } - } - }; - } - else if (attr.type === Number || - attr.type === "long" || - attr.type === "unsigned long" || - attr.type === "limited unsigned long with fallback") { - return numberPropDesc(attr); - } - else if (!attr.type || attr.type === String) { - return { - get: function() { return this._getattr(attr.name) || ''; }, - set: function(v) { - if (attr.treatNullAsEmptyString && v === null) { v = ''; } - this._setattr(attr.name, v); - } - }; - } - else if (typeof attr.type === 'function') { - return attr.type(attr.name, attr); - } - throw new Error('Invalid attribute definition'); -}; - -// See http://www.whatwg.org/specs/web-apps/current-work/#reflect -// -// defval is the default value. If it is a function, then that function -// will be invoked as a method of the element to obtain the default. -// If no default is specified for a given attribute, then the default -// depends on the type of the attribute, but since this function handles -// 4 integer cases, you must specify the default value in each call -// -// min and max define a valid range for getting the attribute. -// -// setmin defines a minimum value when setting. If the value is less -// than that, then throw INDEX_SIZE_ERR. -// -// Conveniently, JavaScript's parseInt function appears to be -// compatible with HTML's 'rules for parsing integers' -function numberPropDesc(a) { - var def; - if(typeof a.default === 'function') { - def = a.default; - } - else if(typeof a.default === 'number') { - def = function() { return a.default; }; - } - else { - def = function() { utils.assert(false, typeof a.default); }; - } - var unsigned_long = (a.type === 'unsigned long'); - var signed_long = (a.type === 'long'); - var unsigned_fallback = (a.type === 'limited unsigned long with fallback'); - var min = a.min, max = a.max, setmin = a.setmin; - if (min === undefined) { - if (unsigned_long) min = 0; - if (signed_long) min = -0x80000000; - if (unsigned_fallback) min = 1; - } - if (max === undefined) { - if (unsigned_long || signed_long || unsigned_fallback) max = 0x7FFFFFFF; - } - - return { - get: function() { - var v = this._getattr(a.name); - var n = a.float ? parseFloat(v) : parseInt(v, 10); - if (v === null || !isFinite(n) || (min !== undefined && n < min) || (max !== undefined && n > max)) { - return def.call(this); - } - if (unsigned_long || signed_long || unsigned_fallback) { - if (!/^[ \t\n\f\r]*[-+]?[0-9]/.test(v)) { return def.call(this); } - n = n|0; // jshint ignore:line - } - return n; - }, - set: function(v) { - if (!a.float) { v = Math.floor(v); } - if (setmin !== undefined && v < setmin) { - utils.IndexSizeError(a.name + ' set to ' + v); - } - if (unsigned_long) { - v = (v < 0 || v > 0x7FFFFFFF) ? def.call(this) : - (v|0); // jshint ignore:line - } else if (unsigned_fallback) { - v = (v < 1 || v > 0x7FFFFFFF) ? def.call(this) : - (v|0); // jshint ignore:line - } else if (signed_long) { - v = (v < -0x80000000 || v > 0x7FFFFFFF) ? def.call(this) : - (v|0); // jshint ignore:line - } - this._setattr(a.name, String(v)); - } - }; -} - -// This is a utility function for setting up change handler functions -// for attributes like 'id' that require special handling when they change. -exports.registerChangeHandler = function(c, name, handler) { - var p = c.prototype; - - // If p does not already have its own _attributeChangeHandlers - // then create one for it, inheriting from the inherited - // _attributeChangeHandlers. At the top (for the Element class) the - // _attributeChangeHandlers object will be created with a null prototype. - if (!Object.prototype.hasOwnProperty.call(p, '_attributeChangeHandlers')) { - p._attributeChangeHandlers = - Object.create(p._attributeChangeHandlers || null); - } - - p._attributeChangeHandlers[name] = handler; -}; - - -/***/ }), - -/***/ 66139: -/***/ ((__unused_webpack_module, exports) => { - -/* - * This file defines Domino behaviour that can be externally configured. - * To change these settings, set the relevant global property *before* - * you call `require("domino")`. - */ - -exports.h = !globalThis.__domino_frozen__; - - -/***/ }), - -/***/ 5244: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var attributes = __webpack_require__(6548); -var isApiWritable = (__webpack_require__(66139)/* .isApiWritable */ .h); - -module.exports = function(spec, defaultConstructor, tagList, tagNameToImpl) { - var c = spec.ctor; - if (c) { - var props = spec.props || {}; - - if (spec.attributes) { - for (var n in spec.attributes) { - var attr = spec.attributes[n]; - if (typeof attr !== 'object' || Array.isArray(attr)) attr = {type: attr}; - if (!attr.name) attr.name = n.toLowerCase(); - props[n] = attributes.property(attr); - } - } - - props.constructor = { value : c, writable: isApiWritable }; - c.prototype = Object.create((spec.superclass || defaultConstructor).prototype, props); - if (spec.events) { - addEventHandlers(c, spec.events); - } - tagList[spec.name] = c; - } - else { - c = defaultConstructor; - } - - (spec.tags || spec.tag && [spec.tag] || []).forEach(function(tag) { - tagNameToImpl[tag] = c; - }); - - return c; -}; - -function EventHandlerBuilder(body, document, form, element) { - this.body = body; - this.document = document; - this.form = form; - this.element = element; -} - -EventHandlerBuilder.prototype.build = function () { - return () => {}; -}; - -function EventHandlerChangeHandler(elt, name, oldval, newval) { - var doc = elt.ownerDocument || Object.create(null); - var form = elt.form || Object.create(null); - elt[name] = new EventHandlerBuilder(newval, doc, form, elt).build(); -} - -function addEventHandlers(c, eventHandlerTypes) { - var p = c.prototype; - eventHandlerTypes.forEach(function(type) { - // Define the event handler registration IDL attribute for this type - Object.defineProperty(p, "on" + type, { - get: function() { - return this._getEventHandler(type); - }, - set: function(v) { - this._setEventHandler(type, v); - }, - }); - - // Define special behavior for the content attribute as well - attributes.registerChangeHandler(c, "on" + type, EventHandlerChangeHandler); - }); -} - - -/***/ }), - -/***/ 18196: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = { - Event: __webpack_require__(13441), - UIEvent: __webpack_require__(64259), - MouseEvent: __webpack_require__(21440), - CustomEvent: __webpack_require__(22112) -}; - - -/***/ }), - -/***/ 96324: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var Node = __webpack_require__(97537); -var Element = __webpack_require__(77301); -var CSSStyleDeclaration = __webpack_require__(53141); -var utils = __webpack_require__(89076); -var URLUtils = __webpack_require__(65531); -var defineElement = __webpack_require__(5244); - -var htmlElements = exports.elements = {}; -var htmlNameToImpl = Object.create(null); - -exports.createElement = function(doc, localName, prefix) { - var impl = htmlNameToImpl[localName] || HTMLUnknownElement; - return new impl(doc, localName, prefix); -}; - -function define(spec) { - return defineElement(spec, HTMLElement, htmlElements, htmlNameToImpl); -} - -function URL(attr) { - return { - get: function() { - var v = this._getattr(attr); - if (v === null) { return ''; } - var url = this.doc._resolve(v); - return (url === null) ? v : url; - }, - set: function(value) { - this._setattr(attr, value); - } - }; -} - -function CORS(attr) { - return { - get: function() { - var v = this._getattr(attr); - if (v === null) { return null; } - if (v.toLowerCase() === 'use-credentials') { return 'use-credentials'; } - return 'anonymous'; - }, - set: function(value) { - if (value===null || value===undefined) { - this.removeAttribute(attr); - } else { - this._setattr(attr, value); - } - } - }; -} - -const REFERRER = { - type: ["", "no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url"], - missing: '', -}; - - -// XXX: the default value for tabIndex should be 0 if the element is -// focusable and -1 if it is not. But the full definition of focusable -// is actually hard to compute, so for now, I'll follow Firefox and -// just base the default value on the type of the element. -var focusableElements = { - "A":true, "LINK":true, "BUTTON":true, "INPUT":true, - "SELECT":true, "TEXTAREA":true, "COMMAND":true -}; - -var HTMLFormElement = function(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - this._form = null; // Prevent later deoptimization -}; - -var HTMLElement = exports.HTMLElement = define({ - superclass: Element, - name: 'HTMLElement', - ctor: function HTMLElement(doc, localName, prefix) { - Element.call(this, doc, localName, utils.NAMESPACE.HTML, prefix); - }, - props: { - dangerouslySetInnerHTML: { - set: function (v) { - this._innerHTML = v; - }, - }, - innerHTML: { - get: function() { - return this.serialize(); - }, - set: function(v) { - var parser = this.ownerDocument.implementation.mozHTMLParser( - this.ownerDocument._address, - this); - parser.parse(v===null ? '' : String(v), true); - - // Remove any existing children of this node - var target = (this instanceof htmlNameToImpl.template) ? - this.content : this; - while(target.hasChildNodes()) - target.removeChild(target.firstChild); - - // Now copy newly parsed children to this node - target.appendChild(parser._asDocumentFragment()); - } - }, - style: { get: function() { - if (!this._style) - this._style = new CSSStyleDeclaration(this); - return this._style; - }, set: function(v) { - if (v===null||v===undefined) { v = ''; } - this._setattr('style', String(v)); - }}, - - // These can't really be implemented server-side in a reasonable way. - blur: { value: function() {}}, - focus: { value: function() {}}, - forceSpellCheck: { value: function() {}}, - - click: { value: function() { - if (this._click_in_progress) return; - this._click_in_progress = true; - try { - if (this._pre_click_activation_steps) - this._pre_click_activation_steps(); - - var event = this.ownerDocument.createEvent("MouseEvent"); - event.initMouseEvent("click", true, true, - this.ownerDocument.defaultView, 1, - 0, 0, 0, 0, - // These 4 should be initialized with - // the actually current keyboard state - // somehow... - false, false, false, false, - 0, null - ); - - // Dispatch this as an untrusted event since it is synthetic - var success = this.dispatchEvent(event); - - if (success) { - if (this._post_click_activation_steps) - this._post_click_activation_steps(event); - } - else { - if (this._cancelled_activation_steps) - this._cancelled_activation_steps(); - } - } - finally { - this._click_in_progress = false; - } - }}, - submit: { value: utils.nyi }, - }, - attributes: { - title: String, - lang: String, - dir: {type: ["ltr", "rtl", "auto"], missing: ''}, - draggable: {type: ["true", "false"], treatNullAsEmptyString: true }, - spellcheck: {type: ["true", "false"], missing: ''}, - enterKeyHint: {type: ["enter", "done", "go", "next", "previous", "search", "send"], missing: ''}, - autoCapitalize: {type: ["off", "on", "none", "sentences", "words", "characters"], missing: '' }, - autoFocus: Boolean, - accessKey: String, - nonce: String, - hidden: Boolean, - translate: {type: ["no", "yes"], missing: '' }, - tabIndex: {type: "long", default: function() { - if (this.tagName in focusableElements || - this.contentEditable) - return 0; - else - return -1; - }} - }, - events: [ - "abort", "canplay", "canplaythrough", "change", "click", "contextmenu", - "cuechange", "dblclick", "drag", "dragend", "dragenter", "dragleave", - "dragover", "dragstart", "drop", "durationchange", "emptied", "ended", - "input", "invalid", "keydown", "keypress", "keyup", "loadeddata", - "loadedmetadata", "loadstart", "mousedown", "mousemove", "mouseout", - "mouseover", "mouseup", "mousewheel", "pause", "play", "playing", - "progress", "ratechange", "readystatechange", "reset", "seeked", - "seeking", "select", "show", "stalled", "submit", "suspend", - "timeupdate", "volumechange", "waiting", - - // These last 5 event types will be overriden by HTMLBodyElement - "blur", "error", "focus", "load", "scroll" - ] -}); - - -// XXX: reflect contextmenu as contextMenu, with element type - - -// style: the spec doesn't call this a reflected attribute. -// may want to handle it manually. - -// contentEditable: enumerated, not clear if it is actually -// reflected or requires custom getter/setter. Not listed as -// "limited to known values". Raises syntax_err on bad setting, -// so I think this is custom. - -// contextmenu: content is element id, idl type is an element -// draggable: boolean, but not a reflected attribute -// dropzone: reflected SettableTokenList, experimental, so don't -// implement it right away. - -// data-* attributes: need special handling in setAttribute? -// Or maybe that isn't necessary. Can I just scan the attribute list -// when building the dataset? Liveness and caching issues? - -// microdata attributes: many are simple reflected attributes, but -// I'm not going to implement this now. - - -var HTMLUnknownElement = define({ - name: 'HTMLUnknownElement', - ctor: function HTMLUnknownElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - - -var formAssociatedProps = { - // See http://www.w3.org/TR/html5/association-of-controls-and-forms.html#form-owner - form: { get: function() { - return this._form; - }} -}; - -define({ - tag: 'a', - name: 'HTMLAnchorElement', - ctor: function HTMLAnchorElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - _post_click_activation_steps: { value: function(e) { - if (this.href) { - // Follow the link - // XXX: this is just a quick hack - // XXX: the HTML spec probably requires more than this - this.ownerDocument.defaultView.location = this.href; - } - }}, - }, - attributes: { - href: URL, - ping: String, - download: String, - target: String, - rel: String, - media: String, - hreflang: String, - type: String, - referrerPolicy: REFERRER, - // Obsolete - coords: String, - charset: String, - name: String, - rev: String, - shape: String, - } -}); -// Latest WhatWG spec says these methods come via HTMLHyperlinkElementUtils -URLUtils._inherit(htmlNameToImpl.a.prototype); - -define({ - tag: 'area', - name: 'HTMLAreaElement', - ctor: function HTMLAreaElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - alt: String, - target: String, - download: String, - rel: String, - media: String, - href: URL, - hreflang: String, - type: String, - shape: String, - coords: String, - ping: String, - // XXX: also reflect relList - referrerPolicy: REFERRER, - // Obsolete - noHref: Boolean, - } -}); -// Latest WhatWG spec says these methods come via HTMLHyperlinkElementUtils -URLUtils._inherit(htmlNameToImpl.area.prototype); - -define({ - tag: 'br', - name: 'HTMLBRElement', - ctor: function HTMLBRElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - clear: String - }, -}); - -define({ - tag: 'base', - name: 'HTMLBaseElement', - ctor: function HTMLBaseElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - "target": String - } -}); - - -define({ - tag: 'body', - name: 'HTMLBodyElement', - ctor: function HTMLBodyElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - // Certain event handler attributes on a tag actually set - // handlers for the window rather than just that element. Define - // getters and setters for those here. Note that some of these override - // properties on HTMLElement.prototype. - // XXX: If I add support for , these have to go there, too - // XXX - // When the Window object is implemented, these attribute will have - // to work with the same-named attributes on the Window. - events: [ - "afterprint", "beforeprint", "beforeunload", "blur", "error", - "focus","hashchange", "load", "message", "offline", "online", - "pagehide", "pageshow","popstate","resize","scroll","storage","unload", - ], - attributes: { - // Obsolete - text: { type: String, treatNullAsEmptyString: true }, - link: { type: String, treatNullAsEmptyString: true }, - vLink: { type: String, treatNullAsEmptyString: true }, - aLink: { type: String, treatNullAsEmptyString: true }, - bgColor: { type: String, treatNullAsEmptyString: true }, - background: String, - } -}); - -define({ - tag: 'button', - name: 'HTMLButtonElement', - ctor: function HTMLButtonElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - name: String, - value: String, - disabled: Boolean, - autofocus: Boolean, - type: { type:["submit", "reset", "button", "menu"], missing: 'submit' }, - formTarget: String, - formAction: URL, - formNoValidate: Boolean, - formMethod: { type: ["get", "post", "dialog"], invalid: 'get', missing: '' }, - formEnctype: { type: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalid: "application/x-www-form-urlencoded", missing: '' }, - } -}); - -define({ - tag: 'dl', - name: 'HTMLDListElement', - ctor: function HTMLDListElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - compact: Boolean, - } -}); - -define({ - tag: 'data', - name: 'HTMLDataElement', - ctor: function HTMLDataElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - value: String, - } -}); - -define({ - tag: 'datalist', - name: 'HTMLDataListElement', - ctor: function HTMLDataListElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'details', - name: 'HTMLDetailsElement', - ctor: function HTMLDetailsElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - "open": Boolean - } -}); - -define({ - tag: 'div', - name: 'HTMLDivElement', - ctor: function HTMLDivElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String - } -}); - -define({ - tag: 'embed', - name: 'HTMLEmbedElement', - ctor: function HTMLEmbedElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - src: URL, - type: String, - width: String, - height: String, - // Obsolete - align: String, - name: String, - } -}); - -define({ - tag: 'fieldset', - name: 'HTMLFieldSetElement', - ctor: function HTMLFieldSetElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - disabled: Boolean, - name: String - } -}); - -define({ - tag: 'form', - name: 'HTMLFormElement', - ctor: function HTMLFormElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - action: String, - autocomplete: {type:['on', 'off'], missing: 'on'}, - name: String, - acceptCharset: {name: "accept-charset"}, - target: String, - noValidate: Boolean, - method: { type: ["get", "post", "dialog"], invalid: 'get', missing: 'get' }, - // Both enctype and encoding reflect the enctype content attribute - enctype: { type: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalid: "application/x-www-form-urlencoded", missing: "application/x-www-form-urlencoded" }, - encoding: {name: 'enctype', type: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalid: "application/x-www-form-urlencoded", missing: "application/x-www-form-urlencoded" }, - } -}); - -define({ - tag: 'hr', - name: 'HTMLHRElement', - ctor: function HTMLHRElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String, - color: String, - noShade: Boolean, - size: String, - width: String, - }, -}); - -define({ - tag: 'head', - name: 'HTMLHeadElement', - ctor: function HTMLHeadElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tags: ['h1','h2','h3','h4','h5','h6'], - name: 'HTMLHeadingElement', - ctor: function HTMLHeadingElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String, - }, -}); - -define({ - tag: 'html', - name: 'HTMLHtmlElement', - ctor: function HTMLHtmlElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - xmlns: URL, - // Obsolete - version: String - } -}); - -define({ - tag: 'iframe', - name: 'HTMLIFrameElement', - ctor: function HTMLIFrameElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - src: URL, - srcdoc: String, - name: String, - width: String, - height: String, - // XXX: sandbox is a reflected settable token list - seamless: Boolean, - allow: Boolean, - allowFullscreen: Boolean, - allowUserMedia: Boolean, - allowPaymentRequest: Boolean, - referrerPolicy: REFERRER, - loading: { type:['eager','lazy'], treatNullAsEmptyString: true }, - // Obsolete - align: String, - scrolling: String, - frameBorder: String, - longDesc: URL, - marginHeight: { type: String, treatNullAsEmptyString: true }, - marginWidth: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tag: 'img', - name: 'HTMLImageElement', - ctor: function HTMLImageElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - alt: String, - src: URL, - srcset: String, - crossOrigin: CORS, - useMap: String, - isMap: Boolean, - sizes: String, - height: { type: "unsigned long", default: 0 }, - width: { type: "unsigned long", default: 0 }, - referrerPolicy: REFERRER, - loading: { type:['eager','lazy'], missing: '' }, - // Obsolete: - name: String, - lowsrc: URL, - align: String, - hspace: { type: "unsigned long", default: 0 }, - vspace: { type: "unsigned long", default: 0 }, - longDesc: URL, - border: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tag: 'input', - name: 'HTMLInputElement', - ctor: function HTMLInputElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: { - form: formAssociatedProps.form, - _post_click_activation_steps: { value: function(e) { - if (this.type === 'checkbox') { - this.checked = !this.checked; - } - else if (this.type === 'radio') { - var group = this.form.getElementsByName(this.name); - for (var i=group.length-1; i >= 0; i--) { - var el = group[i]; - el.checked = (el === this); - } - } - }}, - }, - attributes: { - name: String, - disabled: Boolean, - autofocus: Boolean, - accept: String, - alt: String, - max: String, - min: String, - pattern: String, - placeholder: String, - step: String, - dirName: String, - defaultValue: {name: 'value'}, - multiple: Boolean, - required: Boolean, - readOnly: Boolean, - checked: Boolean, - value: String, - src: URL, - defaultChecked: {name: 'checked', type: Boolean}, - size: {type: 'unsigned long', default: 20, min: 1, setmin: 1}, - width: {type: 'unsigned long', min: 0, setmin: 0, default: 0}, - height: {type: 'unsigned long', min: 0, setmin: 0, default: 0}, - minLength: {type: 'unsigned long', min: 0, setmin: 0, default: -1}, - maxLength: {type: 'unsigned long', min: 0, setmin: 0, default: -1}, - autocomplete: String, // It's complicated - type: { type: - ["text", "hidden", "search", "tel", "url", "email", "password", - "datetime", "date", "month", "week", "time", "datetime-local", - "number", "range", "color", "checkbox", "radio", "file", "submit", - "image", "reset", "button"], - missing: 'text' }, - formTarget: String, - formNoValidate: Boolean, - formMethod: { type: ["get", "post"], invalid: 'get', missing: '' }, - formEnctype: { type: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalid: "application/x-www-form-urlencoded", missing: '' }, - inputMode: { type: [ "verbatim", "latin", "latin-name", "latin-prose", "full-width-latin", "kana", "kana-name", "katakana", "numeric", "tel", "email", "url" ], missing: '' }, - // Obsolete - align: String, - useMap: String, - } -}); - -define({ - tag: 'keygen', - name: 'HTMLKeygenElement', - ctor: function HTMLKeygenElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - name: String, - disabled: Boolean, - autofocus: Boolean, - challenge: String, - keytype: { type:["rsa"], missing: '' }, - } -}); - -define({ - tag: 'li', - name: 'HTMLLIElement', - ctor: function HTMLLIElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - value: {type: "long", default: 0}, - // Obsolete - type: String, - } -}); - -define({ - tag: 'label', - name: 'HTMLLabelElement', - ctor: function HTMLLabelElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - htmlFor: {name: 'for', type: String} - } -}); - -define({ - tag: 'legend', - name: 'HTMLLegendElement', - ctor: function HTMLLegendElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String - }, -}); - -define({ - tag: 'link', - name: 'HTMLLinkElement', - ctor: function HTMLLinkElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // XXX Reflect DOMSettableTokenList sizes also DOMTokenList relList - href: URL, - rel: String, - media: String, - hreflang: String, - type: String, - crossOrigin: CORS, - nonce: String, - integrity: String, - referrerPolicy: REFERRER, - imageSizes: String, - imageSrcset: String, - // Obsolete - charset: String, - rev: String, - target: String, - } -}); - -define({ - tag: 'map', - name: 'HTMLMapElement', - ctor: function HTMLMapElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - name: String - } -}); - -define({ - tag: 'menu', - name: 'HTMLMenuElement', - ctor: function HTMLMenuElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // XXX: not quite right, default should be popup if parent element is - // popup. - type: { type: [ 'context', 'popup', 'toolbar' ], missing: 'toolbar' }, - label: String, - // Obsolete - compact: Boolean, - } -}); - -define({ - tag: 'meta', - name: 'HTMLMetaElement', - ctor: function HTMLMetaElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - name: String, - content: String, - httpEquiv: {name: 'http-equiv', type: String}, - // Obsolete - scheme: String, - } -}); - -define({ - tag: 'meter', - name: 'HTMLMeterElement', - ctor: function HTMLMeterElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps -}); - -define({ - tags: ['ins', 'del'], - name: 'HTMLModElement', - ctor: function HTMLModElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - cite: URL, - dateTime: String - } -}); - -define({ - tag: 'ol', - name: 'HTMLOListElement', - ctor: function HTMLOListElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - // Utility function (see the start attribute default value). Returns - // the number of
  • children of this element - _numitems: { get: function() { - var items = 0; - this.childNodes.forEach(function(n) { - if (n.nodeType === Node.ELEMENT_NODE && n.tagName === "LI") - items++; - }); - return items; - }} - }, - attributes: { - type: String, - reversed: Boolean, - start: { - type: "long", - default: function() { - // The default value of the start attribute is 1 unless the list is - // reversed. Then it is the # of li children - if (this.reversed) - return this._numitems; - else - return 1; - } - }, - // Obsolete - compact: Boolean, - } -}); - -define({ - tag: 'object', - name: 'HTMLObjectElement', - ctor: function HTMLObjectElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - data: URL, - type: String, - name: String, - useMap: String, - typeMustMatch: Boolean, - width: String, - height: String, - // Obsolete - align: String, - archive: String, - code: String, - declare: Boolean, - hspace: { type: "unsigned long", default: 0 }, - standby: String, - vspace: { type: "unsigned long", default: 0 }, - codeBase: URL, - codeType: String, - border: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tag: 'optgroup', - name: 'HTMLOptGroupElement', - ctor: function HTMLOptGroupElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - disabled: Boolean, - label: String - } -}); - -define({ - tag: 'option', - name: 'HTMLOptionElement', - ctor: function HTMLOptionElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - form: { get: function() { - var p = this.parentNode; - while (p && p.nodeType === Node.ELEMENT_NODE) { - if (p.localName === 'select') return p.form; - p = p.parentNode; - } - }}, - value: { - get: function() { return this._getattr('value') || this.text; }, - set: function(v) { this._setattr('value', v); }, - }, - text: { - get: function() { - // Strip and collapse whitespace - return this.textContent.replace(/[ \t\n\f\r]+/g, ' ').trim(); - }, - set: function(v) { this.textContent = v; }, - }, - // missing: index - }, - attributes: { - disabled: Boolean, - defaultSelected: {name: 'selected', type: Boolean}, - label: String, - } -}); - -define({ - tag: 'output', - name: 'HTMLOutputElement', - ctor: function HTMLOutputElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - // XXX Reflect for/htmlFor as a settable token list - name: String - } -}); - -define({ - tag: 'p', - name: 'HTMLParagraphElement', - ctor: function HTMLParagraphElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String - } -}); - -define({ - tag: 'param', - name: 'HTMLParamElement', - ctor: function HTMLParamElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - name: String, - value: String, - // Obsolete - type: String, - valueType: String, - } -}); - -define({ - tags: ['pre',/*legacy elements:*/'listing','xmp'], - name: 'HTMLPreElement', - ctor: function HTMLPreElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - width: { type: "long", default: 0 }, - } -}); - -define({ - tag: 'progress', - name: 'HTMLProgressElement', - ctor: function HTMLProgressElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - max: {type: Number, float: true, default: 1.0, min: 0} - } -}); - -define({ - tags: ['q', 'blockquote'], - name: 'HTMLQuoteElement', - ctor: function HTMLQuoteElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - cite: URL - } -}); - -define({ - tag: 'script', - name: 'HTMLScriptElement', - ctor: function HTMLScriptElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - text: { - get: function() { - var s = ""; - for(var i = 0, n = this.childNodes.length; i < n; i++) { - var child = this.childNodes[i]; - if (child.nodeType === Node.TEXT_NODE) - s += child._data; - } - return s; - }, - set: function(value) { - this.removeChildren(); - if (value !== null && value !== "") { - this.appendChild(this.ownerDocument.createTextNode(value)); - } - } - } - }, - attributes: { - src: URL, - type: String, - charset: String, - referrerPolicy: REFERRER, - defer: Boolean, - async: Boolean, - nomodule: Boolean, - crossOrigin: CORS, - nonce: String, - integrity: String, - } -}); - -define({ - tag: 'select', - name: 'HTMLSelectElement', - ctor: function HTMLSelectElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: { - form: formAssociatedProps.form, - options: { get: function() { - return this.getElementsByTagName('option'); - }} - }, - attributes: { - autocomplete: String, // It's complicated - name: String, - disabled: Boolean, - autofocus: Boolean, - multiple: Boolean, - required: Boolean, - size: {type: "unsigned long", default: 0} - } -}); - -define({ - tag: 'span', - name: 'HTMLSpanElement', - ctor: function HTMLSpanElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'style', - name: 'HTMLStyleElement', - ctor: function HTMLStyleElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - media: String, - type: String, - scoped: Boolean - } -}); - -define({ - tag: 'caption', - name: 'HTMLTableCaptionElement', - ctor: function HTMLTableCaptionElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String, - } -}); - - -define({ - name: 'HTMLTableCellElement', - ctor: function HTMLTableCellElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - colSpan: {type: "unsigned long", default: 1}, - rowSpan: {type: "unsigned long", default: 1}, - //XXX Also reflect settable token list headers - scope: { type: ['row','col','rowgroup','colgroup'], missing: '' }, - abbr: String, - // Obsolete - align: String, - axis: String, - height: String, - width: String, - ch: { name: 'char', type: String }, - chOff: { name: 'charoff', type: String }, - noWrap: Boolean, - vAlign: String, - bgColor: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tags: ['col', 'colgroup'], - name: 'HTMLTableColElement', - ctor: function HTMLTableColElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - span: {type: 'limited unsigned long with fallback', default: 1, min: 1}, - // Obsolete - align: String, - ch: { name: 'char', type: String }, - chOff: { name: 'charoff', type: String }, - vAlign: String, - width: String, - } -}); - -define({ - tag: 'table', - name: 'HTMLTableElement', - ctor: function HTMLTableElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - rows: { get: function() { - return this.getElementsByTagName('tr'); - }} - }, - attributes: { - // Obsolete - align: String, - border: String, - frame: String, - rules: String, - summary: String, - width: String, - bgColor: { type: String, treatNullAsEmptyString: true }, - cellPadding: { type: String, treatNullAsEmptyString: true }, - cellSpacing: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tag: 'template', - name: 'HTMLTemplateElement', - ctor: function HTMLTemplateElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - this._contentFragment = doc._templateDoc.createDocumentFragment(); - }, - props: { - content: { get: function() { return this._contentFragment; } }, - serialize: { value: function() { return this.content.serialize(); } } - } -}); - -define({ - tag: 'tr', - name: 'HTMLTableRowElement', - ctor: function HTMLTableRowElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - cells: { get: function() { - return this.querySelectorAll('td,th'); - }} - }, - attributes: { - // Obsolete - align: String, - ch: { name: 'char', type: String }, - chOff: { name: 'charoff', type: String }, - vAlign: String, - bgColor: { type: String, treatNullAsEmptyString: true }, - }, -}); - -define({ - tags: ['thead', 'tfoot', 'tbody'], - name: 'HTMLTableSectionElement', - ctor: function HTMLTableSectionElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - rows: { get: function() { - return this.getElementsByTagName('tr'); - }} - }, - attributes: { - // Obsolete - align: String, - ch: { name: 'char', type: String }, - chOff: { name: 'charoff', type: String }, - vAlign: String, - } -}); - -define({ - tag: 'textarea', - name: 'HTMLTextAreaElement', - ctor: function HTMLTextAreaElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: { - form: formAssociatedProps.form, - type: { get: function() { return 'textarea'; } }, - defaultValue: { - get: function() { return this.textContent; }, - set: function(v) { this.textContent = v; }, - }, - value: { - get: function() { return this.defaultValue; /* never dirty */ }, - set: function(v) { - // This isn't completely correct: according to the spec, this - // should "dirty" the API value, and result in - // `this.value !== this.defaultValue`. But for most of what - // folks want to do, this implementation should be fine: - this.defaultValue = v; - }, - }, - textLength: { get: function() { return this.value.length; } }, - }, - attributes: { - autocomplete: String, // It's complicated - name: String, - disabled: Boolean, - autofocus: Boolean, - placeholder: String, - wrap: String, - dirName: String, - required: Boolean, - readOnly: Boolean, - rows: {type: 'limited unsigned long with fallback', default: 2 }, - cols: {type: 'limited unsigned long with fallback', default: 20 }, - maxLength: {type: 'unsigned long', min: 0, setmin: 0, default: -1}, - minLength: {type: 'unsigned long', min: 0, setmin: 0, default: -1}, - inputMode: { type: [ "verbatim", "latin", "latin-name", "latin-prose", "full-width-latin", "kana", "kana-name", "katakana", "numeric", "tel", "email", "url" ], missing: '' }, - } -}); - -define({ - tag: 'time', - name: 'HTMLTimeElement', - ctor: function HTMLTimeElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - dateTime: String, - pubDate: Boolean - } -}); - -define({ - tag: 'title', - name: 'HTMLTitleElement', - ctor: function HTMLTitleElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - text: { get: function() { - return this.textContent; - }} - } -}); - -define({ - tag: 'ul', - name: 'HTMLUListElement', - ctor: function HTMLUListElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - type: String, - // Obsolete - compact: Boolean, - } -}); - -define({ - name: 'HTMLMediaElement', - ctor: function HTMLMediaElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - src: URL, - crossOrigin: CORS, - preload: { type:["metadata", "none", "auto", {value: "", alias: "auto"}], missing: 'auto' }, - loop: Boolean, - autoplay: Boolean, - mediaGroup: String, - controls: Boolean, - defaultMuted: {name: "muted", type: Boolean} - } -}); - -define({ - name: 'HTMLAudioElement', - tag: 'audio', - superclass: htmlElements.HTMLMediaElement, - ctor: function HTMLAudioElement(doc, localName, prefix) { - htmlElements.HTMLMediaElement.call(this, doc, localName, prefix); - } -}); - -define({ - name: 'HTMLVideoElement', - tag: 'video', - superclass: htmlElements.HTMLMediaElement, - ctor: function HTMLVideoElement(doc, localName, prefix) { - htmlElements.HTMLMediaElement.call(this, doc, localName, prefix); - }, - attributes: { - poster: URL, - width: {type: "unsigned long", min: 0, default: 0 }, - height: {type: "unsigned long", min: 0, default: 0 } - } -}); - -define({ - tag: 'td', - name: 'HTMLTableDataCellElement', - superclass: htmlElements.HTMLTableCellElement, - ctor: function HTMLTableDataCellElement(doc, localName, prefix) { - htmlElements.HTMLTableCellElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'th', - name: 'HTMLTableHeaderCellElement', - superclass: htmlElements.HTMLTableCellElement, - ctor: function HTMLTableHeaderCellElement(doc, localName, prefix) { - htmlElements.HTMLTableCellElement.call(this, doc, localName, prefix); - }, -}); - -define({ - tag: 'frameset', - name: 'HTMLFrameSetElement', - ctor: function HTMLFrameSetElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'frame', - name: 'HTMLFrameElement', - ctor: function HTMLFrameElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'canvas', - name: 'HTMLCanvasElement', - ctor: function HTMLCanvasElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - getContext: { value: utils.nyi }, - probablySupportsContext: { value: utils.nyi }, - setContext: { value: utils.nyi }, - transferControlToProxy: { value: utils.nyi }, - toDataURL: { value: utils.nyi }, - toBlob: { value: utils.nyi } - }, - attributes: { - width: { type: "unsigned long", default: 300}, - height: { type: "unsigned long", default: 150} - } -}); - -define({ - tag: 'dialog', - name: 'HTMLDialogElement', - ctor: function HTMLDialogElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - show: { value: utils.nyi }, - showModal: { value: utils.nyi }, - close: { value: utils.nyi } - }, - attributes: { - open: Boolean, - returnValue: String - } -}); - -define({ - tag: 'menuitem', - name: 'HTMLMenuItemElement', - ctor: function HTMLMenuItemElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - // The menuitem's label - _label: { - get: function() { - var val = this._getattr('label'); - if (val !== null && val !== '') { return val; } - val = this.textContent; - // Strip and collapse whitespace - return val.replace(/[ \t\n\f\r]+/g, ' ').trim(); - } - }, - // The menuitem label IDL attribute - label: { - get: function() { - var val = this._getattr('label'); - if (val !== null) { return val; } - return this._label; - }, - set: function(v) { - this._setattr('label', v); - }, - } - }, - attributes: { - type: { type: ["command","checkbox","radio"], missing: 'command' }, - icon: URL, - disabled: Boolean, - checked: Boolean, - radiogroup: String, - default: Boolean - } -}); - -define({ - tag: 'source', - name: 'HTMLSourceElement', - ctor: function HTMLSourceElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - srcset: String, - sizes: String, - media: String, - src: URL, - type: String, - width: String, - height: String, - } -}); - -define({ - tag: 'track', - name: 'HTMLTrackElement', - ctor: function HTMLTrackElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - src: URL, - srclang: String, - label: String, - default: Boolean, - kind: { type: ["subtitles", "captions", "descriptions", "chapters", "metadata"], missing: 'subtitles', invalid: 'metadata' }, - }, - props: { - NONE: { get: function() { return 0; } }, - LOADING: { get: function() { return 1; } }, - LOADED: { get: function() { return 2; } }, - ERROR: { get: function() { return 3; } }, - readyState: { get: utils.nyi }, - track: { get: utils.nyi } - } -}); - -define({ - // obsolete - tag: 'font', - name: 'HTMLFontElement', - ctor: function HTMLFontElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - color: { type: String, treatNullAsEmptyString: true }, - face: { type: String }, - size: { type: String }, - }, -}); - -define({ - // obsolete - tag: 'dir', - name: 'HTMLDirectoryElement', - ctor: function HTMLDirectoryElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - compact: Boolean, - }, -}); - -define({ - tags: [ - "abbr", "address", "article", "aside", "b", "bdi", "bdo", "cite", "content", "code", - "dd", "dfn", "dt", "em", "figcaption", "figure", "footer", "header", "hgroup", "i", "kbd", - "main", "mark", "nav", "noscript", "rb", "rp", "rt", "rtc", - "ruby", "s", "samp", "section", "small", "strong", "sub", "summary", "sup", "u", "var", "wbr", - // Legacy elements - "acronym", "basefont", "big", "center", "nobr", "noembed", "noframes", - "plaintext", "strike", "tt" - ] -}); - - -/***/ }), - -/***/ 31575: -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - -var utils = __webpack_require__(89076); - -exports = module.exports = { - CSSStyleDeclaration: __webpack_require__(53141), - CharacterData: __webpack_require__(90086), - Comment: __webpack_require__(17548), - DOMException: __webpack_require__(46364), - DOMImplementation: __webpack_require__(80931), - DOMTokenList: __webpack_require__(82840), - Document: __webpack_require__(35452), - DocumentFragment: __webpack_require__(17948), - DocumentType: __webpack_require__(73092), - Element: __webpack_require__(77301), - HTMLParser: __webpack_require__(91895), - NamedNodeMap: __webpack_require__(49492), - Node: __webpack_require__(97537), - NodeList: __webpack_require__(64965), - NodeFilter: __webpack_require__(383), - ProcessingInstruction: __webpack_require__(81248), - Text: __webpack_require__(58210), - Window: __webpack_require__(21865) -}; - -utils.merge(exports, __webpack_require__(18196)); -utils.merge(exports, (__webpack_require__(96324).elements)); -utils.merge(exports, (__webpack_require__(967).elements)); - - -/***/ }), - -/***/ 31993: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var DOMImplementation = __webpack_require__(80931); -var HTMLParser = __webpack_require__(91895); -var Window = __webpack_require__(21865); -var impl = __webpack_require__(31575); - -exports.createDOMImplementation = function() { - return new DOMImplementation(null); -}; - -exports.createDocument = function(html, force) { - // Previous API couldn't let you pass '' as a document, and that - // yields a slightly different document than createHTMLDocument('') - // does. The new `force` parameter lets you pass '' if you want to. - if (html || force) { - var parser = new HTMLParser(); - parser.parse(html || '', true); - return parser.document(); - } - return new DOMImplementation(null).createHTMLDocument(""); -}; - -exports.createIncrementalHTMLParser = function() { - var parser = new HTMLParser(); - /** API for incremental parser. */ - return { - /** Provide an additional chunk of text to be parsed. */ - write: function(s) { - if (s.length > 0) { - parser.parse(s, false, function() { return true; }); - } - }, - /** - * Signal that we are done providing input text, optionally - * providing one last chunk as a parameter. - */ - end: function(s) { - parser.parse(s || '', true, function() { return true; }); - }, - /** - * Performs a chunk of parsing work, returning at the end of - * the next token as soon as shouldPauseFunc() returns true. - * Returns true iff there is more work to do. - * - * For example: - * ``` - * var incrParser = domino.createIncrementalHTMLParser(); - * incrParser.end('...long html document...'); - * while (true) { - * // Pause every 10ms - * var start = Date.now(); - * var pauseIn10 = function() { return (Date.now() - start) >= 10; }; - * if (!incrParser.process(pauseIn10)) { - * break; - * } - * ...yield to other tasks, do other housekeeping, etc... - * } - * ``` - */ - process: function(shouldPauseFunc) { - return parser.parse('', false, shouldPauseFunc); - }, - /** - * Returns the result of the incremental parse. Valid after - * `this.end()` has been called and `this.process()` has returned - * false. - */ - document: function() { - return parser.document(); - }, - }; -}; - -exports.createWindow = function(html, address) { - var document = exports.createDocument(html); - if (address !== undefined) { document._address = address; } - return new impl.Window(document); -}; - -exports.impl = impl; - -/***/ }), - -/***/ 23509: -/***/ ((module, exports) => { - -"use strict"; - -/* jshint eqnull: true */ -/** - * Zest (https://github.com/chjj/zest) - * A css selector engine. - * Copyright (c) 2011-2012, Christopher Jeffrey. (MIT Licensed) - * Domino version based on Zest v0.1.3 with bugfixes applied. - */ - -/** - * Helpers - */ - -var window = Object.create(null, { - location: { get: function() { - throw new Error('window.location is not supported.'); - } } -}); - -var compareDocumentPosition = function(a, b) { - return a.compareDocumentPosition(b); -}; - -var order = function(a, b) { - /* jshint bitwise: false */ - return compareDocumentPosition(a, b) & 2 ? 1 : -1; -}; - -var next = function(el) { - while ((el = el.nextSibling) - && el.nodeType !== 1); - return el; -}; - -var prev = function(el) { - while ((el = el.previousSibling) - && el.nodeType !== 1); - return el; -}; - -var child = function(el) { - /*jshint -W084 */ - if (el = el.firstChild) { - while (el.nodeType !== 1 - && (el = el.nextSibling)); - } - return el; -}; - -var lastChild = function(el) { - /*jshint -W084 */ - if (el = el.lastChild) { - while (el.nodeType !== 1 - && (el = el.previousSibling)); - } - return el; -}; - -var parentIsElement = function(n) { - if (!n.parentNode) { return false; } - var nodeType = n.parentNode.nodeType; - // The root `html` element can be a first- or last-child, too. - return nodeType === 1 || nodeType === 9; -}; - -var unquote = function(str) { - if (!str) return str; - var ch = str[0]; - if (ch === '"' || ch === '\'') { - if (str[str.length-1] === ch) { - str = str.slice(1, -1); - } else { - // bad string. - str = str.slice(1); - } - return str.replace(rules.str_escape, function(s) { - var m = /^\\(?:([0-9A-Fa-f]+)|([\r\n\f]+))/.exec(s); - if (!m) { return s.slice(1); } - if (m[2]) { return ''; /* escaped newlines are ignored in strings. */ } - var cp = parseInt(m[1], 16); - return String.fromCodePoint ? String.fromCodePoint(cp) : - // Not all JavaScript implementations have String.fromCodePoint yet. - String.fromCharCode(cp); - }); - } else if (rules.ident.test(str)) { - return decodeid(str); - } else { - // NUMBER, PERCENTAGE, DIMENSION, etc - return str; - } -}; - -var decodeid = function(str) { - return str.replace(rules.escape, function(s) { - var m = /^\\([0-9A-Fa-f]+)/.exec(s); - if (!m) { return s[1]; } - var cp = parseInt(m[1], 16); - return String.fromCodePoint ? String.fromCodePoint(cp) : - // Not all JavaScript implementations have String.fromCodePoint yet. - String.fromCharCode(cp); - }); -}; - -var indexOf = (function() { - if (Array.prototype.indexOf) { - return Array.prototype.indexOf; - } - return function(obj, item) { - var i = this.length; - while (i--) { - if (this[i] === item) return i; - } - return -1; - }; -})(); - -var makeInside = function(start, end) { - var regex = rules.inside.source - .replace(//g, end); - - return new RegExp(regex); -}; - -var replace = function(regex, name, val) { - regex = regex.source; - regex = regex.replace(name, val.source || val); - return new RegExp(regex); -}; - -var truncateUrl = function(url, num) { - return url - .replace(/^(?:\w+:\/\/|\/+)/, '') - .replace(/(?:\/+|\/*#.*?)$/, '') - .split('/', num) - .join('/'); -}; - -/** - * Handle `nth` Selectors - */ - -var parseNth = function(param_, test) { - var param = param_.replace(/\s+/g, '') - , cap; - - if (param === 'even') { - param = '2n+0'; - } else if (param === 'odd') { - param = '2n+1'; - } else if (param.indexOf('n') === -1) { - param = '0n' + param; - } - - cap = /^([+-])?(\d+)?n([+-])?(\d+)?$/.exec(param); - - return { - group: cap[1] === '-' - ? -(cap[2] || 1) - : +(cap[2] || 1), - offset: cap[4] - ? (cap[3] === '-' ? -cap[4] : +cap[4]) - : 0 - }; -}; - -var nth = function(param_, test, last) { - var param = parseNth(param_) - , group = param.group - , offset = param.offset - , find = !last ? child : lastChild - , advance = !last ? next : prev; - - return function(el) { - if (!parentIsElement(el)) return; - - var rel = find(el.parentNode) - , pos = 0; - - while (rel) { - if (test(rel, el)) pos++; - if (rel === el) { - pos -= offset; - return group && pos - ? (pos % group) === 0 && (pos < 0 === group < 0) - : !pos; - } - rel = advance(rel); - } - }; -}; - -/** - * Simple Selectors - */ - -var selectors = { - '*': (function() { - if (false/*function() { - var el = document.createElement('div'); - el.appendChild(document.createComment('')); - return !!el.getElementsByTagName('*')[0]; - }()*/) {} - return function() { - return true; - }; - })(), - 'type': function(type) { - type = type.toLowerCase(); - return function(el) { - return el.nodeName.toLowerCase() === type; - }; - }, - 'attr': function(key, op, val, i) { - op = operators[op]; - return function(el) { - var attr; - switch (key) { - case 'for': - attr = el.htmlFor; - break; - case 'class': - // className is '' when non-existent - // getAttribute('class') is null - attr = el.className; - if (attr === '' && el.getAttribute('class') == null) { - attr = null; - } - break; - case 'href': - case 'src': - attr = el.getAttribute(key, 2); - break; - case 'title': - // getAttribute('title') can be '' when non-existent sometimes? - attr = el.getAttribute('title') || null; - break; - // careful with attributes with special getter functions - case 'id': - case 'lang': - case 'dir': - case 'accessKey': - case 'hidden': - case 'tabIndex': - case 'style': - if (el.getAttribute) { - attr = el.getAttribute(key); - break; - } - /* falls through */ - default: - if (el.hasAttribute && !el.hasAttribute(key)) { - break; - } - attr = el[key] != null - ? el[key] - : el.getAttribute && el.getAttribute(key); - break; - } - if (attr == null) return; - attr = attr + ''; - if (i) { - attr = attr.toLowerCase(); - val = val.toLowerCase(); - } - return op(attr, val); - }; - }, - ':first-child': function(el) { - return !prev(el) && parentIsElement(el); - }, - ':last-child': function(el) { - return !next(el) && parentIsElement(el); - }, - ':only-child': function(el) { - return !prev(el) && !next(el) && parentIsElement(el); - }, - ':nth-child': function(param, last) { - return nth(param, function() { - return true; - }, last); - }, - ':nth-last-child': function(param) { - return selectors[':nth-child'](param, true); - }, - ':root': function(el) { - return el.ownerDocument.documentElement === el; - }, - ':empty': function(el) { - return !el.firstChild; - }, - ':not': function(sel) { - var test = compileGroup(sel); - return function(el) { - return !test(el); - }; - }, - ':first-of-type': function(el) { - if (!parentIsElement(el)) return; - var type = el.nodeName; - /*jshint -W084 */ - while (el = prev(el)) { - if (el.nodeName === type) return; - } - return true; - }, - ':last-of-type': function(el) { - if (!parentIsElement(el)) return; - var type = el.nodeName; - /*jshint -W084 */ - while (el = next(el)) { - if (el.nodeName === type) return; - } - return true; - }, - ':only-of-type': function(el) { - return selectors[':first-of-type'](el) - && selectors[':last-of-type'](el); - }, - ':nth-of-type': function(param, last) { - return nth(param, function(rel, el) { - return rel.nodeName === el.nodeName; - }, last); - }, - ':nth-last-of-type': function(param) { - return selectors[':nth-of-type'](param, true); - }, - ':checked': function(el) { - return !!(el.checked || el.selected); - }, - ':indeterminate': function(el) { - return !selectors[':checked'](el); - }, - ':enabled': function(el) { - return !el.disabled && el.type !== 'hidden'; - }, - ':disabled': function(el) { - return !!el.disabled; - }, - ':target': function(el) { - return el.id === window.location.hash.substring(1); - }, - ':focus': function(el) { - return el === el.ownerDocument.activeElement; - }, - ':is': function(sel) { - return compileGroup(sel); - }, - // :matches is an older name for :is; see - // https://github.com/w3c/csswg-drafts/issues/3258 - ':matches': function(sel) { - return selectors[':is'](sel); - }, - ':nth-match': function(param, last) { - var args = param.split(/\s*,\s*/) - , arg = args.shift() - , test = compileGroup(args.join(',')); - - return nth(arg, test, last); - }, - ':nth-last-match': function(param) { - return selectors[':nth-match'](param, true); - }, - ':links-here': function(el) { - return el + '' === window.location + ''; - }, - ':lang': function(param) { - return function(el) { - while (el) { - if (el.lang) return el.lang.indexOf(param) === 0; - el = el.parentNode; - } - }; - }, - ':dir': function(param) { - return function(el) { - while (el) { - if (el.dir) return el.dir === param; - el = el.parentNode; - } - }; - }, - ':scope': function(el, con) { - var context = con || el.ownerDocument; - if (context.nodeType === 9) { - return el === context.documentElement; - } - return el === context; - }, - ':any-link': function(el) { - return typeof el.href === 'string'; - }, - ':local-link': function(el) { - if (el.nodeName) { - return el.href && el.host === window.location.host; - } - var param = +el + 1; - return function(el) { - if (!el.href) return; - - var url = window.location + '' - , href = el + ''; - - return truncateUrl(url, param) === truncateUrl(href, param); - }; - }, - ':default': function(el) { - return !!el.defaultSelected; - }, - ':valid': function(el) { - return el.willValidate || (el.validity && el.validity.valid); - }, - ':invalid': function(el) { - return !selectors[':valid'](el); - }, - ':in-range': function(el) { - return el.value > el.min && el.value <= el.max; - }, - ':out-of-range': function(el) { - return !selectors[':in-range'](el); - }, - ':required': function(el) { - return !!el.required; - }, - ':optional': function(el) { - return !el.required; - }, - ':read-only': function(el) { - if (el.readOnly) return true; - - var attr = el.getAttribute('contenteditable') - , prop = el.contentEditable - , name = el.nodeName.toLowerCase(); - - name = name !== 'input' && name !== 'textarea'; - - return (name || el.disabled) && attr == null && prop !== 'true'; - }, - ':read-write': function(el) { - return !selectors[':read-only'](el); - }, - ':hover': function() { - throw new Error(':hover is not supported.'); - }, - ':active': function() { - throw new Error(':active is not supported.'); - }, - ':link': function() { - throw new Error(':link is not supported.'); - }, - ':visited': function() { - throw new Error(':visited is not supported.'); - }, - ':column': function() { - throw new Error(':column is not supported.'); - }, - ':nth-column': function() { - throw new Error(':nth-column is not supported.'); - }, - ':nth-last-column': function() { - throw new Error(':nth-last-column is not supported.'); - }, - ':current': function() { - throw new Error(':current is not supported.'); - }, - ':past': function() { - throw new Error(':past is not supported.'); - }, - ':future': function() { - throw new Error(':future is not supported.'); - }, - // Non-standard, for compatibility purposes. - ':contains': function(param) { - return function(el) { - var text = el.innerText || el.textContent || el.value || ''; - return text.indexOf(param) !== -1; - }; - }, - ':has': function(param) { - return function(el) { - return find(param, el).length > 0; - }; - } - // Potentially add more pseudo selectors for - // compatibility with sizzle and most other - // selector engines (?). -}; - -/** - * Attribute Operators - */ - -var operators = { - '-': function() { - return true; - }, - '=': function(attr, val) { - return attr === val; - }, - '*=': function(attr, val) { - return attr.indexOf(val) !== -1; - }, - '~=': function(attr, val) { - var i - , s - , f - , l; - - for (s = 0; true; s = i + 1) { - i = attr.indexOf(val, s); - if (i === -1) return false; - f = attr[i - 1]; - l = attr[i + val.length]; - if ((!f || f === ' ') && (!l || l === ' ')) return true; - } - }, - '|=': function(attr, val) { - var i = attr.indexOf(val) - , l; - - if (i !== 0) return; - l = attr[i + val.length]; - - return l === '-' || !l; - }, - '^=': function(attr, val) { - return attr.indexOf(val) === 0; - }, - '$=': function(attr, val) { - var i = attr.lastIndexOf(val); - return i !== -1 && i + val.length === attr.length; - }, - // non-standard - '!=': function(attr, val) { - return attr !== val; - } -}; - -/** - * Combinator Logic - */ - -var combinators = { - ' ': function(test) { - return function(el) { - /*jshint -W084 */ - while (el = el.parentNode) { - if (test(el)) return el; - } - }; - }, - '>': function(test) { - return function(el) { - /*jshint -W084 */ - if (el = el.parentNode) { - return test(el) && el; - } - }; - }, - '+': function(test) { - return function(el) { - /*jshint -W084 */ - if (el = prev(el)) { - return test(el) && el; - } - }; - }, - '~': function(test) { - return function(el) { - /*jshint -W084 */ - while (el = prev(el)) { - if (test(el)) return el; - } - }; - }, - 'noop': function(test) { - return function(el) { - return test(el) && el; - }; - }, - 'ref': function(test, name) { - var node; - - function ref(el) { - var doc = el.ownerDocument - , nodes = doc.getElementsByTagName('*') - , i = nodes.length; - - while (i--) { - node = nodes[i]; - if (ref.test(el)) { - node = null; - return true; - } - } - - node = null; - } - - ref.combinator = function(el) { - if (!node || !node.getAttribute) return; - - var attr = node.getAttribute(name) || ''; - if (attr[0] === '#') attr = attr.substring(1); - - if (attr === el.id && test(node)) { - return node; - } - }; - - return ref; - } -}; - -/** - * Grammar - */ - -var rules = { - escape: /\\(?:[^0-9A-Fa-f\r\n]|[0-9A-Fa-f]{1,6}[\r\n\t ]?)/g, - str_escape: /(escape)|\\(\n|\r\n?|\f)/g, - nonascii: /[\u00A0-\uFFFF]/, - cssid: /(?:(?!-?[0-9])(?:escape|nonascii|[-_a-zA-Z0-9])+)/, - qname: /^ *(cssid|\*)/, - simple: /^(?:([.#]cssid)|pseudo|attr)/, - ref: /^ *\/(cssid)\/ */, - combinator: /^(?: +([^ \w*.#\\]) +|( )+|([^ \w*.#\\]))(?! *$)/, - attr: /^\[(cssid)(?:([^\w]?=)(inside))?\]/, - pseudo: /^(:cssid)(?:\((inside)\))?/, - inside: /(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|<[^"'>]*>|\\["'>]|[^"'>])*/, - ident: /^(cssid)$/ -}; - -rules.cssid = replace(rules.cssid, 'nonascii', rules.nonascii); -rules.cssid = replace(rules.cssid, 'escape', rules.escape); -rules.qname = replace(rules.qname, 'cssid', rules.cssid); -rules.simple = replace(rules.simple, 'cssid', rules.cssid); -rules.ref = replace(rules.ref, 'cssid', rules.cssid); -rules.attr = replace(rules.attr, 'cssid', rules.cssid); -rules.pseudo = replace(rules.pseudo, 'cssid', rules.cssid); -rules.inside = replace(rules.inside, '[^"\'>]*', rules.inside); -rules.attr = replace(rules.attr, 'inside', makeInside('\\[', '\\]')); -rules.pseudo = replace(rules.pseudo, 'inside', makeInside('\\(', '\\)')); -rules.simple = replace(rules.simple, 'pseudo', rules.pseudo); -rules.simple = replace(rules.simple, 'attr', rules.attr); -rules.ident = replace(rules.ident, 'cssid', rules.cssid); -rules.str_escape = replace(rules.str_escape, 'escape', rules.escape); - -/** - * Compiling - */ - -var compile = function(sel_) { - var sel = sel_.replace(/^\s+|\s+$/g, '') - , test - , filter = [] - , buff = [] - , subject - , qname - , cap - , op - , ref; - - /*jshint -W084 */ - while (sel) { - if (cap = rules.qname.exec(sel)) { - sel = sel.substring(cap[0].length); - qname = decodeid(cap[1]); - buff.push(tok(qname, true)); - } else if (cap = rules.simple.exec(sel)) { - sel = sel.substring(cap[0].length); - qname = '*'; - buff.push(tok(qname, true)); - buff.push(tok(cap)); - } else { - throw new SyntaxError('Invalid selector.'); - } - - while (cap = rules.simple.exec(sel)) { - sel = sel.substring(cap[0].length); - buff.push(tok(cap)); - } - - if (sel[0] === '!') { - sel = sel.substring(1); - subject = makeSubject(); - subject.qname = qname; - buff.push(subject.simple); - } - - if (cap = rules.ref.exec(sel)) { - sel = sel.substring(cap[0].length); - ref = combinators.ref(makeSimple(buff), decodeid(cap[1])); - filter.push(ref.combinator); - buff = []; - continue; - } - - if (cap = rules.combinator.exec(sel)) { - sel = sel.substring(cap[0].length); - op = cap[1] || cap[2] || cap[3]; - if (op === ',') { - filter.push(combinators.noop(makeSimple(buff))); - break; - } - } else { - op = 'noop'; - } - - if (!combinators[op]) { throw new SyntaxError('Bad combinator.'); } - filter.push(combinators[op](makeSimple(buff))); - buff = []; - } - - test = makeTest(filter); - test.qname = qname; - test.sel = sel; - - if (subject) { - subject.lname = test.qname; - - subject.test = test; - subject.qname = subject.qname; - subject.sel = test.sel; - test = subject; - } - - if (ref) { - ref.test = test; - ref.qname = test.qname; - ref.sel = test.sel; - test = ref; - } - - return test; -}; - -var tok = function(cap, qname) { - // qname - if (qname) { - return cap === '*' - ? selectors['*'] - : selectors.type(cap); - } - - // class/id - if (cap[1]) { - return cap[1][0] === '.' - // XXX unescape here? or in attr? - ? selectors.attr('class', '~=', decodeid(cap[1].substring(1)), false) - : selectors.attr('id', '=', decodeid(cap[1].substring(1)), false); - } - - // pseudo-name - // inside-pseudo - if (cap[2]) { - return cap[3] - ? selectors[decodeid(cap[2])](unquote(cap[3])) - : selectors[decodeid(cap[2])]; - } - - // attr name - // attr op - // attr value - if (cap[4]) { - var value = cap[6]; - var i = /["'\s]\s*I$/i.test(value); - if (i) { - value = value.replace(/\s*I$/i, ''); - } - return selectors.attr(decodeid(cap[4]), cap[5] || '-', unquote(value), i); - } - - throw new SyntaxError('Unknown Selector.'); -}; - -var makeSimple = function(func) { - var l = func.length - , i; - - // Potentially make sure - // `el` is truthy. - if (l < 2) return func[0]; - - return function(el) { - if (!el) return; - for (i = 0; i < l; i++) { - if (!func[i](el)) return; - } - return true; - }; -}; - -var makeTest = function(func) { - if (func.length < 2) { - return function(el) { - return !!func[0](el); - }; - } - return function(el) { - var i = func.length; - while (i--) { - if (!(el = func[i](el))) return; - } - return true; - }; -}; - -var makeSubject = function() { - var target; - - function subject(el) { - var node = el.ownerDocument - , scope = node.getElementsByTagName(subject.lname) - , i = scope.length; - - while (i--) { - if (subject.test(scope[i]) && target === el) { - target = null; - return true; - } - } - - target = null; - } - - subject.simple = function(el) { - target = el; - return true; - }; - - return subject; -}; - -var compileGroup = function(sel) { - var test = compile(sel) - , tests = [ test ]; - - while (test.sel) { - test = compile(test.sel); - tests.push(test); - } - - if (tests.length < 2) return test; - - return function(el) { - var l = tests.length - , i = 0; - - for (; i < l; i++) { - if (tests[i](el)) return true; - } - }; -}; - -/** - * Selection - */ - -var find = function(sel, node) { - var results = [] - , test = compile(sel) - , scope = node.getElementsByTagName(test.qname) - , i = 0 - , el; - - /*jshint -W084 */ - while (el = scope[i++]) { - if (test(el)) results.push(el); - } - - if (test.sel) { - while (test.sel) { - test = compile(test.sel); - scope = node.getElementsByTagName(test.qname); - i = 0; - /*jshint -W084 */ - while (el = scope[i++]) { - if (test(el) && indexOf.call(results, el) === -1) { - results.push(el); - } - } - } - results.sort(order); - } - - return results; -}; - -/** - * Expose - */ - -module.exports = exports = function(sel, context) { - /* when context isn't a DocumentFragment and the selector is simple: */ - var id, r; - if (context.nodeType !== 11 && sel.indexOf(' ') === -1) { - if (sel[0] === '#' && context.rooted && /^#[A-Z_][-A-Z0-9_]*$/i.test(sel)) { - if (context.doc._hasMultipleElementsWithId) { - id = sel.substring(1); - if (!context.doc._hasMultipleElementsWithId(id)) { - r = context.doc.getElementById(id); - return r ? [r] : []; - } - } - } - if (sel[0] === '.' && /^\.\w+$/.test(sel)) { - return context.getElementsByClassName(sel.substring(1)); - } - if (/^\w+$/.test(sel)) { - return context.getElementsByTagName(sel); - } - } - /* do things the hard/slow way */ - return find(sel, context); -}; - -exports.selectors = selectors; -exports.operators = operators; -exports.combinators = combinators; - -exports.matches = function(el, sel) { - var test = { sel: sel }; - do { - test = compile(test.sel); - if (test(el)) { return true; } - } while (test.sel); - return false; -}; - - -/***/ }), - -/***/ 72636: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -// The below is a compiled copy of https://github.com/angular/angular/blob/92e41e9cb417223d9888a4c23b4c0e73188f87d0/packages/compiler/src/render3/view/style_parser.ts - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hyphenate = exports.parse = void 0; -/** - * Parses string representation of a style and converts it into object literal. - * - * @param value string representation of style as used in the `style` attribute in HTML. - * Example: `color: red; height: auto`. - * @returns An array of style property name and value pairs, e.g. `['color', 'red', 'height', - * 'auto']` - */ -function parse(value) { - // we use a string array here instead of a string map - // because a string-map is not guaranteed to retain the - // order of the entries whereas a string array can be - // constructed in a [key, value, key, value] format. - const styles = []; - let i = 0; - let parenDepth = 0; - let quote = 0; /* Char.QuoteNone */ - let valueStart = 0; - let propStart = 0; - let currentProp = null; - while (i < value.length) { - const token = value.charCodeAt(i++); - switch (token) { - case 40 /* Char.OpenParen */: - parenDepth++; - break; - case 41 /* Char.CloseParen */: - parenDepth--; - break; - case 39 /* Char.QuoteSingle */: - // valueStart needs to be there since prop values don't - // have quotes in CSS - if (quote === 0 /* Char.QuoteNone */) { - quote = 39 /* Char.QuoteSingle */; - } else if ( - quote === 39 /* Char.QuoteSingle */ && - value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */ - ) { - quote = 0 /* Char.QuoteNone */; - } - break; - case 34 /* Char.QuoteDouble */: - // same logic as above - if (quote === 0 /* Char.QuoteNone */) { - quote = 34 /* Char.QuoteDouble */; - } else if ( - quote === 34 /* Char.QuoteDouble */ && - value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */ - ) { - quote = 0 /* Char.QuoteNone */; - } - break; - case 58 /* Char.Colon */: - if ( - !currentProp && - parenDepth === 0 && - quote === 0 /* Char.QuoteNone */ - ) { - currentProp = hyphenate(value.substring(propStart, i - 1).trim()); - valueStart = i; - } - break; - case 59 /* Char.Semicolon */: - if ( - currentProp && - valueStart > 0 && - parenDepth === 0 && - quote === 0 /* Char.QuoteNone */ - ) { - const styleVal = value.substring(valueStart, i - 1).trim(); - styles.push(currentProp, styleVal); - propStart = i; - valueStart = 0; - currentProp = null; - } - break; - } - } - if (currentProp && valueStart) { - const styleVal = value.slice(valueStart).trim(); - styles.push(currentProp, styleVal); - } - return styles; -} -exports.parse = parse; -function hyphenate(value) { - return value - .replace(/[a-z][A-Z]/g, (v) => { - return v.charAt(0) + "-" + v.charAt(1); - }) - .toLowerCase(); -} -exports.hyphenate = hyphenate; - - -/***/ }), - -/***/ 967: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var Element = __webpack_require__(77301); -var defineElement = __webpack_require__(5244); -var utils = __webpack_require__(89076); -var CSSStyleDeclaration = __webpack_require__(53141); - -var svgElements = exports.elements = {}; -var svgNameToImpl = Object.create(null); - -exports.createElement = function(doc, localName, prefix) { - var impl = svgNameToImpl[localName] || SVGElement; - return new impl(doc, localName, prefix); -}; - -function define(spec) { - return defineElement(spec, SVGElement, svgElements, svgNameToImpl); -} - -var SVGElement = define({ - superclass: Element, - name: 'SVGElement', - ctor: function SVGElement(doc, localName, prefix) { - Element.call(this, doc, localName, utils.NAMESPACE.SVG, prefix); - }, - props: { - style: { get: function() { - if (!this._style) - this._style = new CSSStyleDeclaration(this); - return this._style; - }} - } -}); - -define({ - name: 'SVGSVGElement', - ctor: function SVGSVGElement(doc, localName, prefix) { - SVGElement.call(this, doc, localName, prefix); - }, - tag: 'svg', - props: { - createSVGRect: { value: function () { - return exports.createElement(this.ownerDocument, 'rect', null); - } } - } -}); - -define({ - tags: [ - 'a', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor', 'animateMotion', 'animateTransform', - 'circle', 'clipPath', 'color-profile', 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix', - 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', - 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', - 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence', 'filter', - 'font', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignObject', 'g', - 'glyph', 'glyphRef', 'hkern', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'missing-glyph', - 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'script', 'set', 'stop', 'style', - 'switch', 'symbol', 'text', 'textPath', 'title', 'tref', 'tspan', 'use', 'view', 'vkern' - ] -}); - - -/***/ }), - -/***/ 89076: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var DOMException = __webpack_require__(46364); -var ERR = DOMException; -var isApiWritable = (__webpack_require__(66139)/* .isApiWritable */ .h); - -exports.NAMESPACE = { - HTML: 'http://www.w3.org/1999/xhtml', - XML: 'http://www.w3.org/XML/1998/namespace', - XMLNS: 'http://www.w3.org/2000/xmlns/', - MATHML: 'http://www.w3.org/1998/Math/MathML', - SVG: 'http://www.w3.org/2000/svg', - XLINK: 'http://www.w3.org/1999/xlink' -}; - -// -// Shortcut functions for throwing errors of various types. -// -exports.IndexSizeError = function() { throw new DOMException(ERR.INDEX_SIZE_ERR); }; -exports.HierarchyRequestError = function() { throw new DOMException(ERR.HIERARCHY_REQUEST_ERR); }; -exports.WrongDocumentError = function() { throw new DOMException(ERR.WRONG_DOCUMENT_ERR); }; -exports.InvalidCharacterError = function() { throw new DOMException(ERR.INVALID_CHARACTER_ERR); }; -exports.NoModificationAllowedError = function() { throw new DOMException(ERR.NO_MODIFICATION_ALLOWED_ERR); }; -exports.NotFoundError = function() { throw new DOMException(ERR.NOT_FOUND_ERR); }; -exports.NotSupportedError = function() { throw new DOMException(ERR.NOT_SUPPORTED_ERR); }; -exports.InvalidStateError = function() { throw new DOMException(ERR.INVALID_STATE_ERR); }; -exports.SyntaxError = function() { throw new DOMException(ERR.SYNTAX_ERR); }; -exports.InvalidModificationError = function() { throw new DOMException(ERR.INVALID_MODIFICATION_ERR); }; -exports.NamespaceError = function() { throw new DOMException(ERR.NAMESPACE_ERR); }; -exports.InvalidAccessError = function() { throw new DOMException(ERR.INVALID_ACCESS_ERR); }; -exports.TypeMismatchError = function() { throw new DOMException(ERR.TYPE_MISMATCH_ERR); }; -exports.SecurityError = function() { throw new DOMException(ERR.SECURITY_ERR); }; -exports.NetworkError = function() { throw new DOMException(ERR.NETWORK_ERR); }; -exports.AbortError = function() { throw new DOMException(ERR.ABORT_ERR); }; -exports.UrlMismatchError = function() { throw new DOMException(ERR.URL_MISMATCH_ERR); }; -exports.QuotaExceededError = function() { throw new DOMException(ERR.QUOTA_EXCEEDED_ERR); }; -exports.TimeoutError = function() { throw new DOMException(ERR.TIMEOUT_ERR); }; -exports.InvalidNodeTypeError = function() { throw new DOMException(ERR.INVALID_NODE_TYPE_ERR); }; -exports.DataCloneError = function() { throw new DOMException(ERR.DATA_CLONE_ERR); }; - -exports.nyi = function() { - throw new Error("NotYetImplemented"); -}; - -exports.shouldOverride = function() { - throw new Error("Abstract function; should be overriding in subclass."); -}; - -exports.assert = function(expr, msg) { - if (!expr) { - throw new Error("Assertion failed: " + (msg || "") + "\n" + new Error().stack); - } -}; - -exports.expose = function(src, c) { - for (var n in src) { - Object.defineProperty(c.prototype, n, { value: src[n], writable: isApiWritable }); - } -}; - -exports.merge = function(a, b) { - for (var n in b) { - a[n] = b[n]; - } -}; - -// Compare two nodes based on their document order. This function is intended -// to be passed to sort(). Assumes that the array being sorted does not -// contain duplicates. And that all nodes are connected and comparable. -// Clever code by ppk via jeresig. -exports.documentOrder = function(n,m) { - /* jshint bitwise: false */ - return 3 - (n.compareDocumentPosition(m) & 6); -}; - -exports.toASCIILowerCase = function(s) { - return s.replace(/[A-Z]+/g, function(c) { - return c.toLowerCase(); - }); -}; - -exports.toASCIIUpperCase = function(s) { - return s.replace(/[a-z]+/g, function(c) { - return c.toUpperCase(); - }); -}; - - -/***/ }), - -/***/ 66798: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -// This grammar is from the XML and XML Namespace specs. It specifies whether -// a string (such as an element or attribute name) is a valid Name or QName. -// -// Name ::= NameStartChar (NameChar)* -// NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | -// [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | -// [#x370-#x37D] | [#x37F-#x1FFF] | -// [#x200C-#x200D] | [#x2070-#x218F] | -// [#x2C00-#x2FEF] | [#x3001-#xD7FF] | -// [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | -// [#x10000-#xEFFFF] -// -// NameChar ::= NameStartChar | "-" | "." | [0-9] | -// #xB7 | [#x0300-#x036F] | [#x203F-#x2040] -// -// QName ::= PrefixedName| UnprefixedName -// PrefixedName ::= Prefix ':' LocalPart -// UnprefixedName ::= LocalPart -// Prefix ::= NCName -// LocalPart ::= NCName -// NCName ::= Name - (Char* ':' Char*) -// # An XML Name, minus the ":" -// - -exports.isValidName = isValidName; -exports.isValidQName = isValidQName; - -// Most names will be ASCII only. Try matching against simple regexps first -var simplename = /^[_:A-Za-z][-.:\w]+$/; -var simpleqname = /^([_A-Za-z][-.\w]+|[_A-Za-z][-.\w]+:[_A-Za-z][-.\w]+)$/; - -// If the regular expressions above fail, try more complex ones that work -// for any identifiers using codepoints from the Unicode BMP -var ncnamestartchars = "_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02ff\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD"; -var ncnamechars = "-._A-Za-z0-9\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02ff\u0300-\u037D\u037F-\u1FFF\u200C\u200D\u203f\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD"; - -var ncname = "[" + ncnamestartchars + "][" + ncnamechars + "]*"; -var namestartchars = ncnamestartchars + ":"; -var namechars = ncnamechars + ":"; -var name = new RegExp("^[" + namestartchars + "]" + "[" + namechars + "]*$"); -var qname = new RegExp("^(" + ncname + "|" + ncname + ":" + ncname + ")$"); - -// XML says that these characters are also legal: -// [#x10000-#xEFFFF]. So if the patterns above fail, and the -// target string includes surrogates, then try the following -// patterns that allow surrogates and then run an extra validation -// step to make sure that the surrogates are in valid pairs and in -// the right range. Note that since the characters \uf0000 to \u1f0000 -// are not allowed, it means that the high surrogate can only go up to -// \uDB7f instead of \uDBFF. -var hassurrogates = /[\uD800-\uDB7F\uDC00-\uDFFF]/; -var surrogatechars = /[\uD800-\uDB7F\uDC00-\uDFFF]/g; -var surrogatepairs = /[\uD800-\uDB7F][\uDC00-\uDFFF]/g; - -// Modify the variables above to allow surrogates -ncnamestartchars += "\uD800-\uDB7F\uDC00-\uDFFF"; -ncnamechars += "\uD800-\uDB7F\uDC00-\uDFFF"; -ncname = "[" + ncnamestartchars + "][" + ncnamechars + "]*"; -namestartchars = ncnamestartchars + ":"; -namechars = ncnamechars + ":"; - -// Build another set of regexps that include surrogates -var surrogatename = new RegExp("^[" + namestartchars + "]" + "[" + namechars + "]*$"); -var surrogateqname = new RegExp("^(" + ncname + "|" + ncname + ":" + ncname + ")$"); - -function isValidName(s) { - if (simplename.test(s)) return true; // Plain ASCII - if (name.test(s)) return true; // Unicode BMP - - // Maybe the tests above failed because s includes surrogate pairs - // Most likely, though, they failed for some more basic syntax problem - if (!hassurrogates.test(s)) return false; - - // Is the string a valid name if we allow surrogates? - if (!surrogatename.test(s)) return false; - - // Finally, are the surrogates all correctly paired up? - var chars = s.match(surrogatechars), pairs = s.match(surrogatepairs); - return pairs !== null && 2*pairs.length === chars.length; -} - -function isValidQName(s) { - if (simpleqname.test(s)) return true; // Plain ASCII - if (qname.test(s)) return true; // Unicode BMP - - if (!hassurrogates.test(s)) return false; - if (!surrogateqname.test(s)) return false; - var chars = s.match(surrogatechars), pairs = s.match(surrogatepairs); - return pairs !== null && 2*pairs.length === chars.length; -} - - /***/ }), /***/ 43295: @@ -21419,234 +4289,6 @@ function range(a, b, str) { } -/***/ }), - -/***/ 79272: -/***/ ((module, exports, __webpack_require__) => { - -/** - * Module dependencies. - */ - -var fs = __webpack_require__(79896), - path = __webpack_require__(16928), - fileURLToPath = __webpack_require__(25241), - join = path.join, - dirname = path.dirname, - exists = - (fs.accessSync && - function(path) { - try { - fs.accessSync(path); - } catch (e) { - return false; - } - return true; - }) || - fs.existsSync || - path.existsSync, - defaults = { - arrow: process.env.NODE_BINDINGS_ARROW || ' → ', - compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled', - platform: process.platform, - arch: process.arch, - nodePreGyp: - 'node-v' + - process.versions.modules + - '-' + - process.platform + - '-' + - process.arch, - version: process.versions.node, - bindings: 'bindings.node', - try: [ - // node-gyp's linked version in the "build" dir - ['module_root', 'build', 'bindings'], - // node-waf and gyp_addon (a.k.a node-gyp) - ['module_root', 'build', 'Debug', 'bindings'], - ['module_root', 'build', 'Release', 'bindings'], - // Debug files, for development (legacy behavior, remove for node v0.9) - ['module_root', 'out', 'Debug', 'bindings'], - ['module_root', 'Debug', 'bindings'], - // Release files, but manually compiled (legacy behavior, remove for node v0.9) - ['module_root', 'out', 'Release', 'bindings'], - ['module_root', 'Release', 'bindings'], - // Legacy from node-waf, node <= 0.4.x - ['module_root', 'build', 'default', 'bindings'], - // Production "Release" buildtype binary (meh...) - ['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'], - // node-qbs builds - ['module_root', 'addon-build', 'release', 'install-root', 'bindings'], - ['module_root', 'addon-build', 'debug', 'install-root', 'bindings'], - ['module_root', 'addon-build', 'default', 'install-root', 'bindings'], - // node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch} - ['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings'] - ] - }; - -/** - * The main `bindings()` function loads the compiled bindings for a given module. - * It uses V8's Error API to determine the parent filename that this function is - * being invoked from, which is then used to find the root directory. - */ - -function bindings(opts) { - // Argument surgery - if (typeof opts == 'string') { - opts = { bindings: opts }; - } else if (!opts) { - opts = {}; - } - - // maps `defaults` onto `opts` object - Object.keys(defaults).map(function(i) { - if (!(i in opts)) opts[i] = defaults[i]; - }); - - // Get the module root - if (!opts.module_root) { - opts.module_root = exports.getRoot(exports.getFileName()); - } - - // Ensure the given bindings name ends with .node - if (path.extname(opts.bindings) != '.node') { - opts.bindings += '.node'; - } - - // https://github.com/webpack/webpack/issues/4175#issuecomment-342931035 - var requireFunc = - true - ? require - : 0; - - var tries = [], - i = 0, - l = opts.try.length, - n, - b, - err; - - for (; i < l; i++) { - n = join.apply( - null, - opts.try[i].map(function(p) { - return opts[p] || p; - }) - ); - tries.push(n); - try { - b = opts.path ? requireFunc.resolve(n) : requireFunc(n); - if (!opts.path) { - b.path = n; - } - return b; - } catch (e) { - if (e.code !== 'MODULE_NOT_FOUND' && - e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' && - !/not find/i.test(e.message)) { - throw e; - } - } - } - - err = new Error( - 'Could not locate the bindings file. Tried:\n' + - tries - .map(function(a) { - return opts.arrow + a; - }) - .join('\n') - ); - err.tries = tries; - throw err; -} -module.exports = exports = bindings; - -/** - * Gets the filename of the JavaScript file that invokes this function. - * Used to help find the root directory of a module. - * Optionally accepts an filename argument to skip when searching for the invoking filename - */ - -exports.getFileName = function getFileName(calling_file) { - var origPST = Error.prepareStackTrace, - origSTL = Error.stackTraceLimit, - dummy = {}, - fileName; - - Error.stackTraceLimit = 10; - - Error.prepareStackTrace = function(e, st) { - for (var i = 0, l = st.length; i < l; i++) { - fileName = st[i].getFileName(); - if (fileName !== __filename) { - if (calling_file) { - if (fileName !== calling_file) { - return; - } - } else { - return; - } - } - } - }; - - // run the 'prepareStackTrace' function above - Error.captureStackTrace(dummy); - dummy.stack; - - // cleanup - Error.prepareStackTrace = origPST; - Error.stackTraceLimit = origSTL; - - // handle filename that starts with "file://" - var fileSchema = 'file://'; - if (fileName.indexOf(fileSchema) === 0) { - fileName = fileURLToPath(fileName); - } - - return fileName; -}; - -/** - * Gets the root directory of a module, given an arbitrary filename - * somewhere in the module tree. The "root directory" is the directory - * containing the `package.json` file. - * - * In: /home/nate/node-native-module/lib/index.js - * Out: /home/nate/node-native-module - */ - -exports.getRoot = function getRoot(file) { - var dir = dirname(file), - prev; - while (true) { - if (dir === '.') { - // Avoids an infinite loop in rare cases, like the REPL - dir = process.cwd(); - } - if ( - exists(join(dir, 'package.json')) || - exists(join(dir, 'node_modules')) - ) { - // Found the 'package.json' file or 'node_modules' dir; we're done - return dir; - } - if (prev === dir) { - // Got to the top - throw new Error( - 'Could not find module root given file: "' + - file + - '". Do you have a `package.json` file? ' - ); - } - // Try the parent dir next - prev = dir; - dir = join(dir, '..'); - } -}; - - /***/ }), /***/ 96586: @@ -28961,79 +11603,6 @@ var fecha = { //# sourceMappingURL=fecha.js.map -/***/ }), - -/***/ 25241: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - - -/** - * Module dependencies. - */ - -var sep = (__webpack_require__(16928).sep) || '/'; - -/** - * Module exports. - */ - -module.exports = fileUriToPath; - -/** - * File URI to Path function. - * - * @param {String} uri - * @return {String} path - * @api public - */ - -function fileUriToPath (uri) { - if ('string' != typeof uri || - uri.length <= 7 || - 'file://' != uri.substring(0, 7)) { - throw new TypeError('must pass in a file:// URI to convert to a file path'); - } - - var rest = decodeURI(uri.substring(7)); - var firstSlash = rest.indexOf('/'); - var host = rest.substring(0, firstSlash); - var path = rest.substring(firstSlash + 1); - - // 2. Scheme Definition - // As a special case, can be the string "localhost" or the empty - // string; this is interpreted as "the machine from which the URL is - // being interpreted". - if ('localhost' == host) host = ''; - - if (host) { - host = sep + sep + host; - } - - // 3.2 Drives, drive letters, mount points, file system root - // Drive letters are mapped into the top of a file URI in various ways, - // depending on the implementation; some applications substitute - // vertical bar ("|") for the colon after the drive letter, yielding - // "file:///c|/tmp/test.txt". In some cases, the colon is left - // unchanged, as in "file:///c:/tmp/test.txt". In other cases, the - // colon is simply omitted, as in "file:///c/tmp/test.txt". - path = path.replace(/^(.+)\|/, '$1:'); - - // for Windows, we need to invert the path separators from what a URI uses - if (sep == '\\') { - path = path.replace(/\//g, '\\'); - } - - if (/^.+\:/.test(path)) { - // has Windows drive at beginning of path - } else { - // unix path… - path = sep + path; - } - - return host + path; -} - - /***/ }), /***/ 67027: @@ -29084,6 +11653,2157 @@ module.exports = function name(fn) { }; +/***/ }), + +/***/ 95270: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) + +const BUF_LENGTH = 64 * 1024 +const _buff = __webpack_require__(34549)(BUF_LENGTH) + +function copyFileSync (srcFile, destFile, options) { + const overwrite = options.overwrite + const errorOnExist = options.errorOnExist + const preserveTimestamps = options.preserveTimestamps + + if (fs.existsSync(destFile)) { + if (overwrite) { + fs.unlinkSync(destFile) + } else if (errorOnExist) { + throw new Error(`${destFile} already exists`) + } else return + } + + const fdr = fs.openSync(srcFile, 'r') + const stat = fs.fstatSync(fdr) + const fdw = fs.openSync(destFile, 'w', stat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + if (preserveTimestamps) { + fs.futimesSync(fdw, stat.atime, stat.mtime) + } + + fs.closeSync(fdr) + fs.closeSync(fdw) +} + +module.exports = copyFileSync + + +/***/ }), + +/***/ 86793: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const copyFileSync = __webpack_require__(95270) +const mkdir = __webpack_require__(60327) + +function copySync (src, dest, options) { + if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + + options = options || {} + options.recursive = !!options.recursive + + // default to true for now + options.clobber = 'clobber' in options ? !!options.clobber : true + // overwrite falls back to clobber + options.overwrite = 'overwrite' in options ? !!options.overwrite : options.clobber + options.dereference = 'dereference' in options ? !!options.dereference : false + options.preserveTimestamps = 'preserveTimestamps' in options ? !!options.preserveTimestamps : false + + options.filter = options.filter || function () { return true } + + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + const stats = (options.recursive && !options.dereference) ? fs.lstatSync(src) : fs.statSync(src) + const destFolder = path.dirname(dest) + const destFolderExists = fs.existsSync(destFolder) + let performCopy = false + + if (options.filter instanceof RegExp) { + console.warn('Warning: fs-extra: Passing a RegExp filter is deprecated, use a function') + performCopy = options.filter.test(src) + } else if (typeof options.filter === 'function') performCopy = options.filter(src, dest) + + if (stats.isFile() && performCopy) { + if (!destFolderExists) mkdir.mkdirsSync(destFolder) + copyFileSync(src, dest, { + overwrite: options.overwrite, + errorOnExist: options.errorOnExist, + preserveTimestamps: options.preserveTimestamps + }) + } else if (stats.isDirectory() && performCopy) { + if (!fs.existsSync(dest)) mkdir.mkdirsSync(dest) + const contents = fs.readdirSync(src) + contents.forEach(content => { + const opts = options + opts.recursive = true + copySync(path.join(src, content), path.join(dest, content), opts) + }) + } else if (options.recursive && stats.isSymbolicLink() && performCopy) { + const srcPath = fs.readlinkSync(src) + fs.symlinkSync(srcPath, dest) + } +} + +module.exports = copySync + + +/***/ }), + +/***/ 88510: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = { + copySync: __webpack_require__(86793) +} + + +/***/ }), + +/***/ 20881: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const ncp = __webpack_require__(57967) +const mkdir = __webpack_require__(60327) +const pathExists = (__webpack_require__(49767).pathExists) + +function copy (src, dest, options, callback) { + if (typeof options === 'function' && !callback) { + callback = options + options = {} + } else if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + callback = callback || function () {} + options = options || {} + + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + // don't allow src and dest to be the same + const basePath = process.cwd() + const currentPath = path.resolve(basePath, src) + const targetPath = path.resolve(basePath, dest) + if (currentPath === targetPath) return callback(new Error('Source and destination must not be the same.')) + + fs.lstat(src, (err, stats) => { + if (err) return callback(err) + + let dir = null + if (stats.isDirectory()) { + const parts = dest.split(path.sep) + parts.pop() + dir = parts.join(path.sep) + } else { + dir = path.dirname(dest) + } + + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return ncp(src, dest, options, callback) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + ncp(src, dest, options, callback) + }) + }) + }) +} + +module.exports = copy + + +/***/ }), + +/***/ 33430: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +module.exports = { + copy: u(__webpack_require__(20881)) +} + + +/***/ }), + +/***/ 57967: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +// imported from ncp (this is temporary, will rewrite) + +var fs = __webpack_require__(71174) +var path = __webpack_require__(16928) +var utimes = __webpack_require__(90348) + +function ncp (source, dest, options, callback) { + if (!callback) { + callback = options + options = {} + } + + var basePath = process.cwd() + var currentPath = path.resolve(basePath, source) + var targetPath = path.resolve(basePath, dest) + + var filter = options.filter + var transform = options.transform + var overwrite = options.overwrite + // If overwrite is undefined, use clobber, otherwise default to true: + if (overwrite === undefined) overwrite = options.clobber + if (overwrite === undefined) overwrite = true + var errorOnExist = options.errorOnExist + var dereference = options.dereference + var preserveTimestamps = options.preserveTimestamps === true + + var started = 0 + var finished = 0 + var running = 0 + + var errored = false + + startCopy(currentPath) + + function startCopy (source) { + started++ + if (filter) { + if (filter instanceof RegExp) { + console.warn('Warning: fs-extra: Passing a RegExp filter is deprecated, use a function') + if (!filter.test(source)) { + return doneOne(true) + } + } else if (typeof filter === 'function') { + if (!filter(source, dest)) { + return doneOne(true) + } + } + } + return getStats(source) + } + + function getStats (source) { + var stat = dereference ? fs.stat : fs.lstat + running++ + stat(source, function (err, stats) { + if (err) return onError(err) + + // We need to get the mode from the stats object and preserve it. + var item = { + name: source, + mode: stats.mode, + mtime: stats.mtime, // modified time + atime: stats.atime, // access time + stats: stats // temporary + } + + if (stats.isDirectory()) { + return onDir(item) + } else if (stats.isFile() || stats.isCharacterDevice() || stats.isBlockDevice()) { + return onFile(item) + } else if (stats.isSymbolicLink()) { + // Symlinks don't really need to know about the mode. + return onLink(source) + } + }) + } + + function onFile (file) { + var target = file.name.replace(currentPath, targetPath.replace('$', '$$$$')) // escapes '$' with '$$' + isWritable(target, function (writable) { + if (writable) { + copyFile(file, target) + } else { + if (overwrite) { + rmFile(target, function () { + copyFile(file, target) + }) + } else if (errorOnExist) { + onError(new Error(target + ' already exists')) + } else { + doneOne() + } + } + }) + } + + function copyFile (file, target) { + var readStream = fs.createReadStream(file.name) + var writeStream = fs.createWriteStream(target, { mode: file.mode }) + + readStream.on('error', onError) + writeStream.on('error', onError) + + if (transform) { + transform(readStream, writeStream, file) + } else { + writeStream.on('open', function () { + readStream.pipe(writeStream) + }) + } + + writeStream.once('close', function () { + fs.chmod(target, file.mode, function (err) { + if (err) return onError(err) + if (preserveTimestamps) { + utimes.utimesMillis(target, file.atime, file.mtime, function (err) { + if (err) return onError(err) + return doneOne() + }) + } else { + doneOne() + } + }) + }) + } + + function rmFile (file, done) { + fs.unlink(file, function (err) { + if (err) return onError(err) + return done() + }) + } + + function onDir (dir) { + var target = dir.name.replace(currentPath, targetPath.replace('$', '$$$$')) // escapes '$' with '$$' + isWritable(target, function (writable) { + if (writable) { + return mkDir(dir, target) + } + copyDir(dir.name) + }) + } + + function mkDir (dir, target) { + fs.mkdir(target, dir.mode, function (err) { + if (err) return onError(err) + // despite setting mode in fs.mkdir, doesn't seem to work + // so we set it here. + fs.chmod(target, dir.mode, function (err) { + if (err) return onError(err) + copyDir(dir.name) + }) + }) + } + + function copyDir (dir) { + fs.readdir(dir, function (err, items) { + if (err) return onError(err) + items.forEach(function (item) { + startCopy(path.join(dir, item)) + }) + return doneOne() + }) + } + + function onLink (link) { + var target = link.replace(currentPath, targetPath) + fs.readlink(link, function (err, resolvedPath) { + if (err) return onError(err) + checkLink(resolvedPath, target) + }) + } + + function checkLink (resolvedPath, target) { + if (dereference) { + resolvedPath = path.resolve(basePath, resolvedPath) + } + isWritable(target, function (writable) { + if (writable) { + return makeLink(resolvedPath, target) + } + fs.readlink(target, function (err, targetDest) { + if (err) return onError(err) + + if (dereference) { + targetDest = path.resolve(basePath, targetDest) + } + if (targetDest === resolvedPath) { + return doneOne() + } + return rmFile(target, function () { + makeLink(resolvedPath, target) + }) + }) + }) + } + + function makeLink (linkPath, target) { + fs.symlink(linkPath, target, function (err) { + if (err) return onError(err) + return doneOne() + }) + } + + function isWritable (path, done) { + fs.lstat(path, function (err) { + if (err) { + if (err.code === 'ENOENT') return done(true) + return done(false) + } + return done(false) + }) + } + + function onError (err) { + // ensure callback is defined & called only once: + if (!errored && callback !== undefined) { + errored = true + return callback(err) + } + } + + function doneOne (skipped) { + if (!skipped) running-- + finished++ + if ((started === finished) && (running === 0)) { + if (callback !== undefined) { + return callback(null) + } + } + } +} + +module.exports = ncp + + +/***/ }), + +/***/ 53760: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const fs = __webpack_require__(79896) +const path = __webpack_require__(16928) +const mkdir = __webpack_require__(60327) +const remove = __webpack_require__(16195) + +const emptyDir = u(function emptyDir (dir, callback) { + callback = callback || function () {} + fs.readdir(dir, (err, items) => { + if (err) return mkdir.mkdirs(dir, callback) + + items = items.map(item => path.join(dir, item)) + + deleteItem() + + function deleteItem () { + const item = items.pop() + if (!item) return callback() + remove.remove(item, err => { + if (err) return callback(err) + deleteItem() + }) + } + }) +}) + +function emptyDirSync (dir) { + let items + try { + items = fs.readdirSync(dir) + } catch (err) { + return mkdir.mkdirsSync(dir) + } + + items.forEach(item => { + item = path.join(dir, item) + remove.removeSync(item) + }) +} + +module.exports = { + emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir, + emptydir: emptyDir +} + + +/***/ }), + +/***/ 23771: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const path = __webpack_require__(16928) +const fs = __webpack_require__(71174) +const mkdir = __webpack_require__(60327) +const pathExists = (__webpack_require__(49767).pathExists) + +function createFile (file, callback) { + function makeFile () { + fs.writeFile(file, '', err => { + if (err) return callback(err) + callback() + }) + } + + fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err + if (!err && stats.isFile()) return callback() + const dir = path.dirname(file) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeFile() + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeFile() + }) + }) + }) +} + +function createFileSync (file) { + let stats + try { + stats = fs.statSync(file) + } catch (e) {} + if (stats && stats.isFile()) return + + const dir = path.dirname(file) + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + fs.writeFileSync(file, '') +} + +module.exports = { + createFile: u(createFile), + createFileSync +} + + +/***/ }), + +/***/ 29081: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const file = __webpack_require__(23771) +const link = __webpack_require__(44181) +const symlink = __webpack_require__(98950) + +module.exports = { + // file + createFile: file.createFile, + createFileSync: file.createFileSync, + ensureFile: file.createFile, + ensureFileSync: file.createFileSync, + // link + createLink: link.createLink, + createLinkSync: link.createLinkSync, + ensureLink: link.createLink, + ensureLinkSync: link.createLinkSync, + // symlink + createSymlink: symlink.createSymlink, + createSymlinkSync: symlink.createSymlinkSync, + ensureSymlink: symlink.createSymlink, + ensureSymlinkSync: symlink.createSymlinkSync +} + + +/***/ }), + +/***/ 44181: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const path = __webpack_require__(16928) +const fs = __webpack_require__(71174) +const mkdir = __webpack_require__(60327) +const pathExists = (__webpack_require__(49767).pathExists) + +function createLink (srcpath, dstpath, callback) { + function makeLink (srcpath, dstpath) { + fs.link(srcpath, dstpath, err => { + if (err) return callback(err) + callback(null) + }) + } + + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureLink') + return callback(err) + } + + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeLink(srcpath, dstpath) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeLink(srcpath, dstpath) + }) + }) + }) + }) +} + +function createLinkSync (srcpath, dstpath, callback) { + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + try { + fs.lstatSync(srcpath) + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink') + throw err + } + + const dir = path.dirname(dstpath) + const dirExists = fs.existsSync(dir) + if (dirExists) return fs.linkSync(srcpath, dstpath) + mkdir.mkdirsSync(dir) + + return fs.linkSync(srcpath, dstpath) +} + +module.exports = { + createLink: u(createLink), + createLinkSync +} + + +/***/ }), + +/***/ 57979: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const path = __webpack_require__(16928) +const fs = __webpack_require__(71174) +const pathExists = (__webpack_require__(49767).pathExists) + +/** + * Function that returns two types of paths, one relative to symlink, and one + * relative to the current working directory. Checks if path is absolute or + * relative. If the path is relative, this function checks if the path is + * relative to symlink or relative to current working directory. This is an + * initiative to find a smarter `srcpath` to supply when building symlinks. + * This allows you to determine which path to use out of one of three possible + * types of source paths. The first is an absolute path. This is detected by + * `path.isAbsolute()`. When an absolute path is provided, it is checked to + * see if it exists. If it does it's used, if not an error is returned + * (callback)/ thrown (sync). The other two options for `srcpath` are a + * relative url. By default Node's `fs.symlink` works by creating a symlink + * using `dstpath` and expects the `srcpath` to be relative to the newly + * created symlink. If you provide a `srcpath` that does not exist on the file + * system it results in a broken symlink. To minimize this, the function + * checks to see if the 'relative to symlink' source file exists, and if it + * does it will use it. If it does not, it checks if there's a file that + * exists that is relative to the current working directory, if does its used. + * This preserves the expectations of the original fs.symlink spec and adds + * the ability to pass in `relative to current working direcotry` paths. + */ + +function symlinkPaths (srcpath, dstpath, callback) { + if (path.isAbsolute(srcpath)) { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': srcpath + }) + }) + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + return pathExists(relativeToDst, (err, exists) => { + if (err) return callback(err) + if (exists) { + return callback(null, { + 'toCwd': relativeToDst, + 'toDst': srcpath + }) + } else { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + }) + }) + } + }) + } +} + +function symlinkPathsSync (srcpath, dstpath) { + let exists + if (path.isAbsolute(srcpath)) { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('absolute srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': srcpath + } + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + exists = fs.existsSync(relativeToDst) + if (exists) { + return { + 'toCwd': relativeToDst, + 'toDst': srcpath + } + } else { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('relative srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + } + } + } +} + +module.exports = { + symlinkPaths, + symlinkPathsSync +} + + +/***/ }), + +/***/ 44127: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) + +function symlinkType (srcpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + if (type) return callback(null, type) + fs.lstat(srcpath, (err, stats) => { + if (err) return callback(null, 'file') + type = (stats && stats.isDirectory()) ? 'dir' : 'file' + callback(null, type) + }) +} + +function symlinkTypeSync (srcpath, type) { + let stats + + if (type) return type + try { + stats = fs.lstatSync(srcpath) + } catch (e) { + return 'file' + } + return (stats && stats.isDirectory()) ? 'dir' : 'file' +} + +module.exports = { + symlinkType, + symlinkTypeSync +} + + +/***/ }), + +/***/ 98950: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const path = __webpack_require__(16928) +const fs = __webpack_require__(71174) +const _mkdirs = __webpack_require__(60327) +const mkdirs = _mkdirs.mkdirs +const mkdirsSync = _mkdirs.mkdirsSync + +const _symlinkPaths = __webpack_require__(57979) +const symlinkPaths = _symlinkPaths.symlinkPaths +const symlinkPathsSync = _symlinkPaths.symlinkPathsSync + +const _symlinkType = __webpack_require__(44127) +const symlinkType = _symlinkType.symlinkType +const symlinkTypeSync = _symlinkType.symlinkTypeSync + +const pathExists = (__webpack_require__(49767).pathExists) + +function createSymlink (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + symlinkPaths(srcpath, dstpath, (err, relative) => { + if (err) return callback(err) + srcpath = relative.toDst + symlinkType(relative.toCwd, type, (err, type) => { + if (err) return callback(err) + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) + mkdirs(dir, err => { + if (err) return callback(err) + fs.symlink(srcpath, dstpath, type, callback) + }) + }) + }) + }) + }) +} + +function createSymlinkSync (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + const relative = symlinkPathsSync(srcpath, dstpath) + srcpath = relative.toDst + type = symlinkTypeSync(relative.toCwd, type) + const dir = path.dirname(dstpath) + const exists = fs.existsSync(dir) + if (exists) return fs.symlinkSync(srcpath, dstpath, type) + mkdirsSync(dir) + return fs.symlinkSync(srcpath, dstpath, type) +} + +module.exports = { + createSymlink: u(createSymlink), + createSymlinkSync +} + + +/***/ }), + +/***/ 46596: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +// This is adapted from https://github.com/normalize/mz +// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const fs = __webpack_require__(71174) + +const api = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'close', + 'copyFile', + 'fchmod', + 'fchown', + 'fdatasync', + 'fstat', + 'fsync', + 'ftruncate', + 'futimes', + 'lchown', + 'link', + 'lstat', + 'mkdir', + 'mkdtemp', + 'open', + 'readFile', + 'readdir', + 'readlink', + 'realpath', + 'rename', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'writeFile' +].filter(key => { + // Some commands are not available on some systems. Ex: + // fs.copyFile was added in Node.js v8.5.0 + // fs.mkdtemp was added in Node.js v5.10.0 + // fs.lchown is not available on at least some Linux + return typeof fs[key] === 'function' +}) + +// Export all keys: +Object.keys(fs).forEach(key => { + exports[key] = fs[key] +}) + +// Universalify async methods: +api.forEach(method => { + exports[method] = u(fs[method]) +}) + +// We differ from mz/fs in that we still ship the old, broken, fs.exists() +// since we are a drop-in replacement for the native module +exports.exists = function (filename, callback) { + if (typeof callback === 'function') { + return fs.exists(filename, callback) + } + return new Promise(resolve => { + return fs.exists(filename, resolve) + }) +} + +// fs.read() & fs.write need special treatment due to multiple callback args + +exports.read = function (fd, buffer, offset, length, position, callback) { + if (typeof callback === 'function') { + return fs.read(fd, buffer, offset, length, position, callback) + } + return new Promise((resolve, reject) => { + fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { + if (err) return reject(err) + resolve({ bytesRead, buffer }) + }) + }) +} + +// Function signature can be +// fs.write(fd, buffer[, offset[, length[, position]]], callback) +// OR +// fs.write(fd, string[, position[, encoding]], callback) +// so we need to handle both cases +exports.write = function (fd, buffer, a, b, c, callback) { + if (typeof arguments[arguments.length - 1] === 'function') { + return fs.write(fd, buffer, a, b, c, callback) + } + + // Check for old, depricated fs.write(fd, string[, position[, encoding]], callback) + if (typeof buffer === 'string') { + return new Promise((resolve, reject) => { + fs.write(fd, buffer, a, b, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) + } + + return new Promise((resolve, reject) => { + fs.write(fd, buffer, a, b, c, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) +} + + +/***/ }), + +/***/ 56922: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const assign = __webpack_require__(3762) + +const fs = {} + +// Export graceful-fs: +assign(fs, __webpack_require__(46596)) +// Export extra methods: +assign(fs, __webpack_require__(33430)) +assign(fs, __webpack_require__(88510)) +assign(fs, __webpack_require__(60327)) +assign(fs, __webpack_require__(16195)) +assign(fs, __webpack_require__(5793)) +assign(fs, __webpack_require__(68126)) +assign(fs, __webpack_require__(2566)) +assign(fs, __webpack_require__(53760)) +assign(fs, __webpack_require__(29081)) +assign(fs, __webpack_require__(79858)) +assign(fs, __webpack_require__(49767)) + +module.exports = fs + + +/***/ }), + +/***/ 5793: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const jsonFile = __webpack_require__(71461) + +jsonFile.outputJson = u(__webpack_require__(58147)) +jsonFile.outputJsonSync = __webpack_require__(36275) +// aliases +jsonFile.outputJSON = jsonFile.outputJson +jsonFile.outputJSONSync = jsonFile.outputJsonSync +jsonFile.writeJSON = jsonFile.writeJson +jsonFile.writeJSONSync = jsonFile.writeJsonSync +jsonFile.readJSON = jsonFile.readJson +jsonFile.readJSONSync = jsonFile.readJsonSync + +module.exports = jsonFile + + +/***/ }), + +/***/ 71461: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const jsonFile = __webpack_require__(82162) + +module.exports = { + // jsonfile exports + readJson: u(jsonFile.readFile), + readJsonSync: jsonFile.readFileSync, + writeJson: u(jsonFile.writeFile), + writeJsonSync: jsonFile.writeFileSync +} + + +/***/ }), + +/***/ 36275: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const mkdir = __webpack_require__(60327) +const jsonFile = __webpack_require__(71461) + +function outputJsonSync (file, data, options) { + const dir = path.dirname(file) + + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + jsonFile.writeJsonSync(file, data, options) +} + +module.exports = outputJsonSync + + +/***/ }), + +/***/ 58147: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const path = __webpack_require__(16928) +const mkdir = __webpack_require__(60327) +const pathExists = (__webpack_require__(49767).pathExists) +const jsonFile = __webpack_require__(71461) + +function outputJson (file, data, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const dir = path.dirname(file) + + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return jsonFile.writeJson(file, data, options, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + jsonFile.writeJson(file, data, options, callback) + }) + }) +} + +module.exports = outputJson + + +/***/ }), + +/***/ 60327: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const mkdirs = u(__webpack_require__(42987)) +const mkdirsSync = __webpack_require__(56891) + +module.exports = { + mkdirs: mkdirs, + mkdirsSync: mkdirsSync, + // alias + mkdirp: mkdirs, + mkdirpSync: mkdirsSync, + ensureDir: mkdirs, + ensureDirSync: mkdirsSync +} + + +/***/ }), + +/***/ 56891: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const invalidWin32Path = (__webpack_require__(54752).invalidWin32Path) + +const o777 = parseInt('0777', 8) + +function mkdirsSync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + throw errInval + } + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + p = path.resolve(p) + + try { + xfs.mkdirSync(p, mode) + made = made || p + } catch (err0) { + switch (err0.code) { + case 'ENOENT': + if (path.dirname(p) === p) throw err0 + made = mkdirsSync(path.dirname(p), opts, made) + mkdirsSync(p, opts, made) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + let stat + try { + stat = xfs.statSync(p) + } catch (err1) { + throw err0 + } + if (!stat.isDirectory()) throw err0 + break + } + } + + return made +} + +module.exports = mkdirsSync + + +/***/ }), + +/***/ 42987: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const invalidWin32Path = (__webpack_require__(54752).invalidWin32Path) + +const o777 = parseInt('0777', 8) + +function mkdirs (p, opts, callback, made) { + if (typeof opts === 'function') { + callback = opts + opts = {} + } else if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + return callback(errInval) + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + callback = callback || function () {} + p = path.resolve(p) + + xfs.mkdir(p, mode, er => { + if (!er) { + made = made || p + return callback(null, made) + } + switch (er.code) { + case 'ENOENT': + if (path.dirname(p) === p) return callback(er) + mkdirs(path.dirname(p), opts, (er, made) => { + if (er) callback(er, made) + else mkdirs(p, opts, callback, made) + }) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, (er2, stat) => { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) callback(er, made) + else callback(null, made) + }) + break + } + }) +} + +module.exports = mkdirs + + +/***/ }), + +/***/ 54752: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const path = __webpack_require__(16928) + +// get drive on windows +function getRootPath (p) { + p = path.normalize(path.resolve(p)).split(path.sep) + if (p.length > 0) return p[0] + return null +} + +// http://stackoverflow.com/a/62888/10333 contains more accurate +// TODO: expand to include the rest +const INVALID_PATH_CHARS = /[<>:"|?*]/ + +function invalidWin32Path (p) { + const rp = getRootPath(p) + p = p.replace(rp, '') + return INVALID_PATH_CHARS.test(p) +} + +module.exports = { + getRootPath, + invalidWin32Path +} + + +/***/ }), + +/***/ 2566: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const copySync = (__webpack_require__(88510).copySync) +const removeSync = (__webpack_require__(16195).removeSync) +const mkdirpSync = (__webpack_require__(60327).mkdirsSync) +const buffer = __webpack_require__(34549) + +function moveSync (src, dest, options) { + options = options || {} + const overwrite = options.overwrite || options.clobber || false + + src = path.resolve(src) + dest = path.resolve(dest) + + if (src === dest) return fs.accessSync(src) + + if (isSrcSubdir(src, dest)) throw new Error(`Cannot move '${src}' into itself '${dest}'.`) + + mkdirpSync(path.dirname(dest)) + tryRenameSync() + + function tryRenameSync () { + if (overwrite) { + try { + return fs.renameSync(src, dest) + } catch (err) { + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST' || err.code === 'EPERM') { + removeSync(dest) + options.overwrite = false // just overwriteed it, no need to do it again + return moveSync(src, dest, options) + } + + if (err.code !== 'EXDEV') throw err + return moveSyncAcrossDevice(src, dest, overwrite) + } + } else { + try { + fs.linkSync(src, dest) + return fs.unlinkSync(src) + } catch (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + return moveSyncAcrossDevice(src, dest, overwrite) + } + throw err + } + } + } +} + +function moveSyncAcrossDevice (src, dest, overwrite) { + const stat = fs.statSync(src) + + if (stat.isDirectory()) { + return moveDirSyncAcrossDevice(src, dest, overwrite) + } else { + return moveFileSyncAcrossDevice(src, dest, overwrite) + } +} + +function moveFileSyncAcrossDevice (src, dest, overwrite) { + const BUF_LENGTH = 64 * 1024 + const _buff = buffer(BUF_LENGTH) + + const flags = overwrite ? 'w' : 'wx' + + const fdr = fs.openSync(src, 'r') + const stat = fs.fstatSync(fdr) + const fdw = fs.openSync(dest, flags, stat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + fs.closeSync(fdr) + fs.closeSync(fdw) + return fs.unlinkSync(src) +} + +function moveDirSyncAcrossDevice (src, dest, overwrite) { + const options = { + overwrite: false + } + + if (overwrite) { + removeSync(dest) + tryCopySync() + } else { + tryCopySync() + } + + function tryCopySync () { + copySync(src, dest, options) + return removeSync(src) + } +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest) { + try { + return fs.statSync(src).isDirectory() && + src !== dest && + dest.indexOf(src) > -1 && + dest.split(path.dirname(src) + path.sep)[1].split(path.sep)[0] === path.basename(src) + } catch (e) { + return false + } +} + +module.exports = { + moveSync +} + + +/***/ }), + +/***/ 68126: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +// most of this code was written by Andrew Kelley +// licensed under the BSD license: see +// https://github.com/andrewrk/node-mv/blob/master/package.json + +// this needs a cleanup + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const fs = __webpack_require__(71174) +const ncp = __webpack_require__(57967) +const path = __webpack_require__(16928) +const remove = (__webpack_require__(16195).remove) +const mkdirp = (__webpack_require__(60327).mkdirs) + +function move (src, dest, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const overwrite = options.overwrite || options.clobber || false + + isSrcSubdir(src, dest, (err, itIs) => { + if (err) return callback(err) + if (itIs) return callback(new Error(`Cannot move '${src}' to a subdirectory of itself, '${dest}'.`)) + mkdirp(path.dirname(dest), err => { + if (err) return callback(err) + doRename() + }) + }) + + function doRename () { + if (path.resolve(src) === path.resolve(dest)) { + fs.access(src, callback) + } else if (overwrite) { + fs.rename(src, dest, err => { + if (!err) return callback() + + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST') { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false // just overwriteed it, no need to do it again + move(src, dest, options, callback) + }) + return + } + + // weird Windows shit + if (err.code === 'EPERM') { + setTimeout(() => { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false + move(src, dest, options, callback) + }) + }, 200) + return + } + + if (err.code !== 'EXDEV') return callback(err) + moveAcrossDevice(src, dest, overwrite, callback) + }) + } else { + fs.link(src, dest, err => { + if (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + return moveAcrossDevice(src, dest, overwrite, callback) + } + return callback(err) + } + return fs.unlink(src, callback) + }) + } + } +} + +function moveAcrossDevice (src, dest, overwrite, callback) { + fs.stat(src, (err, stat) => { + if (err) return callback(err) + + if (stat.isDirectory()) { + moveDirAcrossDevice(src, dest, overwrite, callback) + } else { + moveFileAcrossDevice(src, dest, overwrite, callback) + } + }) +} + +function moveFileAcrossDevice (src, dest, overwrite, callback) { + const flags = overwrite ? 'w' : 'wx' + const ins = fs.createReadStream(src) + const outs = fs.createWriteStream(dest, { flags }) + + ins.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + + // may want to create a directory but `out` line above + // creates an empty file for us: See #108 + // don't care about error here + fs.unlink(dest, () => { + // note: `err` here is from the input stream errror + if (err.code === 'EISDIR' || err.code === 'EPERM') { + moveDirAcrossDevice(src, dest, overwrite, callback) + } else { + callback(err) + } + }) + }) + + outs.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + callback(err) + }) + + outs.once('close', onClose) + ins.pipe(outs) + + function onClose () { + fs.unlink(src, callback) + } +} + +function moveDirAcrossDevice (src, dest, overwrite, callback) { + const options = { + overwrite: false + } + + if (overwrite) { + remove(dest, err => { + if (err) return callback(err) + startNcp() + }) + } else { + startNcp() + } + + function startNcp () { + ncp(src, dest, options, err => { + if (err) return callback(err) + remove(src, callback) + }) + } +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest, cb) { + fs.stat(src, (err, st) => { + if (err) return cb(err) + if (st.isDirectory()) { + const baseDir = dest.split(path.dirname(src) + path.sep)[1] + if (baseDir) { + const destBasename = baseDir.split(path.sep)[0] + if (destBasename) return cb(null, src !== dest && dest.indexOf(src) > -1 && destBasename === path.basename(src)) + return cb(null, false) + } + return cb(null, false) + } + return cb(null, false) + }) +} + +module.exports = { + move: u(move) +} + + +/***/ }), + +/***/ 79858: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const mkdir = __webpack_require__(60327) +const pathExists = (__webpack_require__(49767).pathExists) + +function outputFile (file, data, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = 'utf8' + } + + const dir = path.dirname(file) + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return fs.writeFile(file, data, encoding, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + + fs.writeFile(file, data, encoding, callback) + }) + }) +} + +function outputFileSync (file, data, encoding) { + const dir = path.dirname(file) + if (fs.existsSync(dir)) { + return fs.writeFileSync.apply(fs, arguments) + } + mkdir.mkdirsSync(dir) + fs.writeFileSync.apply(fs, arguments) +} + +module.exports = { + outputFile: u(outputFile), + outputFileSync +} + + +/***/ }), + +/***/ 49767: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + +const u = (__webpack_require__(55399)/* .fromPromise */ .z) +const fs = __webpack_require__(46596) + +function pathExists (path) { + return fs.access(path).then(() => true).catch(() => false) +} + +module.exports = { + pathExists: u(pathExists), + pathExistsSync: fs.existsSync +} + + +/***/ }), + +/***/ 16195: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const rimraf = __webpack_require__(54322) + +module.exports = { + remove: u(rimraf), + removeSync: rimraf.sync +} + + +/***/ }), + +/***/ 54322: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const assert = __webpack_require__(42613) + +const isWindows = (process.platform === 'win32') + +function defaults (options) { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 +} + +function rimraf (p, options, cb) { + let busyTries = 0 + + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + rimraf_(p, options, function CB (er) { + if (er) { + if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && + busyTries < options.maxBusyTries) { + busyTries++ + let time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), time) + } + + // already gone + if (er.code === 'ENOENT') er = null + } + + cb(er) + }) +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === 'ENOENT') { + return cb(null) + } + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === 'EPERM' && isWindows) { + return fixWinEPERM(p, options, er, cb) + } + + if (st && st.isDirectory()) { + return rmdir(p, options, er, cb) + } + + options.unlink(p, er => { + if (er) { + if (er.code === 'ENOENT') { + return cb(null) + } + if (er.code === 'EPERM') { + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + } + if (er.code === 'EISDIR') { + return rmdir(p, options, er, cb) + } + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) { + assert(er instanceof Error) + } + + options.chmod(p, 0o666, er2 => { + if (er2) { + cb(er2.code === 'ENOENT' ? null : er) + } else { + options.stat(p, (er3, stats) => { + if (er3) { + cb(er3.code === 'ENOENT' ? null : er) + } else if (stats.isDirectory()) { + rmdir(p, options, er, cb) + } else { + options.unlink(p, cb) + } + }) + } + }) +} + +function fixWinEPERMSync (p, options, er) { + let stats + + assert(p) + assert(options) + if (er) { + assert(er instanceof Error) + } + + try { + options.chmodSync(p, 0o666) + } catch (er2) { + if (er2.code === 'ENOENT') { + return + } else { + throw er + } + } + + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === 'ENOENT') { + return + } else { + throw er + } + } + + if (stats.isDirectory()) { + rmdirSync(p, options, er) + } else { + options.unlinkSync(p) + } +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { + rmkids(p, options, cb) + } else if (er && er.code === 'ENOTDIR') { + cb(originalEr) + } else { + cb(er) + } + }) +} + +function rmkids (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, (er, files) => { + if (er) return cb(er) + + let n = files.length + let errState + + if (n === 0) return options.rmdir(p, cb) + + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) { + return + } + if (er) return cb(errState = er) + if (--n === 0) { + options.rmdir(p, cb) + } + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + let st + + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === 'ENOENT') { + return + } + + // Windows can EPERM on stat. Life is suffering. + if (er.code === 'EPERM' && isWindows) { + fixWinEPERMSync(p, options, er) + } + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) { + rmdirSync(p, options, null) + } else { + options.unlinkSync(p) + } + } catch (er) { + if (er.code === 'ENOENT') { + return + } else if (er.code === 'EPERM') { + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + } else if (er.code !== 'EISDIR') { + throw er + } + rmdirSync(p, options, er) + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === 'ENOTDIR') { + throw originalEr + } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { + rmkidsSync(p, options) + } else if (er.code !== 'ENOENT') { + throw er + } + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) + + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + const retries = isWindows ? 100 : 1 + let i = 0 + do { + let threw = true + try { + const ret = options.rmdirSync(p, options) + threw = false + return ret + } finally { + if (++i < retries && threw) continue // eslint-disable-line + } + } while (true) +} + +module.exports = rimraf +rimraf.sync = rimrafSync + + +/***/ }), + +/***/ 3762: +/***/ ((module) => { + +"use strict"; + + +// simple mutable assign +function assign () { + const args = [].slice.call(arguments).filter(i => i) + const dest = args.shift() + args.forEach(src => { + Object.keys(src).forEach(key => { + dest[key] = src[key] + }) + }) + + return dest +} + +module.exports = assign + + +/***/ }), + +/***/ 34549: +/***/ ((module) => { + +/* eslint-disable node/no-deprecated-api */ +module.exports = function (size) { + if (typeof Buffer.allocUnsafe === 'function') { + try { + return Buffer.allocUnsafe(size) + } catch (e) { + return new Buffer(size) + } + } + return new Buffer(size) +} + + +/***/ }), + +/***/ 90348: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const os = __webpack_require__(70857) +const path = __webpack_require__(16928) + +// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not +function hasMillisResSync () { + let tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141') + const fd = fs.openSync(tmpfile, 'r+') + fs.futimesSync(fd, d, d) + fs.closeSync(fd) + return fs.statSync(tmpfile).mtime > 1435410243000 +} + +function hasMillisRes (callback) { + let tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', err => { + if (err) return callback(err) + fs.open(tmpfile, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, d, d, err => { + if (err) return callback(err) + fs.close(fd, err => { + if (err) return callback(err) + fs.stat(tmpfile, (err, stats) => { + if (err) return callback(err) + callback(null, stats.mtime > 1435410243000) + }) + }) + }) + }) + }) +} + +function timeRemoveMillis (timestamp) { + if (typeof timestamp === 'number') { + return Math.floor(timestamp / 1000) * 1000 + } else if (timestamp instanceof Date) { + return new Date(Math.floor(timestamp.getTime() / 1000) * 1000) + } else { + throw new Error('fs-extra: timeRemoveMillis() unknown parameter type') + } +} + +function utimesMillis (path, atime, mtime, callback) { + // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) + fs.open(path, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, atime, mtime, futimesErr => { + fs.close(fd, closeErr => { + if (callback) callback(futimesErr || closeErr) + }) + }) + }) +} + +module.exports = { + hasMillisRes, + hasMillisResSync, + timeRemoveMillis, + utimesMillis +} + + /***/ }), /***/ 63423: @@ -29294,6 +14014,979 @@ function expand(str, isTop) { +/***/ }), + +/***/ 77398: +/***/ ((module) => { + +"use strict"; + + +module.exports = clone + +var getPrototypeOf = Object.getPrototypeOf || function (obj) { + return obj.__proto__ +} + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: getPrototypeOf(obj) } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} + + +/***/ }), + +/***/ 71174: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var fs = __webpack_require__(79896) +var polyfills = __webpack_require__(19023) +var legacy = __webpack_require__(76244) +var clone = __webpack_require__(77398) + +var util = __webpack_require__(39023) + +/* istanbul ignore next - node 0.x polyfill */ +var gracefulQueue +var previousSymbol + +/* istanbul ignore else - node 0.x polyfill */ +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue') + // This is used in testing by future versions + previousSymbol = Symbol.for('graceful-fs.previous') +} else { + gracefulQueue = '___graceful-fs.queue' + previousSymbol = '___graceful-fs.previous' +} + +function noop () {} + +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +// Once time initialization +if (!fs[gracefulQueue]) { + // This queue can be shared by multiple loaded instances + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) + + // Patch fs.close/closeSync to shared queue version, because we need + // to retry() whenever a close happens *anywhere* in the program. + // This is essential when multiple graceful-fs instances are + // in play at the same time. + fs.close = (function (fs$close) { + function close (fd, cb) { + return fs$close.call(fs, fd, function (err) { + // This function uses the graceful-fs shared queue + if (!err) { + resetQueue() + } + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) + } + + Object.defineProperty(close, previousSymbol, { + value: fs$close + }) + return close + })(fs.close) + + fs.closeSync = (function (fs$closeSync) { + function closeSync (fd) { + // This function uses the graceful-fs shared queue + fs$closeSync.apply(fs, arguments) + resetQueue() + } + + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }) + return closeSync + })(fs.closeSync) + + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(fs[gracefulQueue]) + __webpack_require__(42613).equal(fs[gracefulQueue].length, 0) + }) + } +} + +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} + +module.exports = patch(clone(fs)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { + module.exports = patch(fs) + fs.__patched = true; +} + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb, startTime) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb, startTime) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb, startTime) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$copyFile = fs.copyFile + if (fs$copyFile) + fs.copyFile = copyFile + function copyFile (src, dest, flags, cb) { + if (typeof flags === 'function') { + cb = flags + flags = 0 + } + return go$copyFile(src, dest, flags, cb) + + function go$copyFile (src, dest, flags, cb, startTime) { + return fs$copyFile(src, dest, flags, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + var noReaddirOptionVersions = /^v[0-5]\./ + function readdir (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + var go$readdir = noReaddirOptionVersions.test(process.version) + ? function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, fs$readdirCallback( + path, options, cb, startTime + )) + } + : function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, options, fs$readdirCallback( + path, options, cb, startTime + )) + } + + return go$readdir(path, options, cb) + + function fs$readdirCallback (path, options, cb, startTime) { + return function (err, files) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([ + go$readdir, + [path, options, cb], + err, + startTime || Date.now(), + Date.now() + ]) + else { + if (files && files.sort) + files.sort() + + if (typeof cb === 'function') + cb.call(this, err, files) + } + } + } + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + } + + var fs$WriteStream = fs.WriteStream + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + } + + Object.defineProperty(fs, 'ReadStream', { + get: function () { + return ReadStream + }, + set: function (val) { + ReadStream = val + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(fs, 'WriteStream', { + get: function () { + return WriteStream + }, + set: function (val) { + WriteStream = val + }, + enumerable: true, + configurable: true + }) + + // legacy names + var FileReadStream = ReadStream + Object.defineProperty(fs, 'FileReadStream', { + get: function () { + return FileReadStream + }, + set: function (val) { + FileReadStream = val + }, + enumerable: true, + configurable: true + }) + var FileWriteStream = WriteStream + Object.defineProperty(fs, 'FileWriteStream', { + get: function () { + return FileWriteStream + }, + set: function (val) { + FileWriteStream = val + }, + enumerable: true, + configurable: true + }) + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new fs.ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new fs.WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb, startTime) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + fs[gracefulQueue].push(elem) + retry() +} + +// keep track of the timeout between retry() calls +var retryTimer + +// reset the startTime and lastTime to now +// this resets the start of the 60 second overall timeout as well as the +// delay between attempts so that we'll retry these jobs sooner +function resetQueue () { + var now = Date.now() + for (var i = 0; i < fs[gracefulQueue].length; ++i) { + // entries that are only a length of 2 are from an older version, don't + // bother modifying those since they'll be retried anyway. + if (fs[gracefulQueue][i].length > 2) { + fs[gracefulQueue][i][3] = now // startTime + fs[gracefulQueue][i][4] = now // lastTime + } + } + // call retry to make sure we're actively processing the queue + retry() +} + +function retry () { + // clear the timer and remove it to help prevent unintended concurrency + clearTimeout(retryTimer) + retryTimer = undefined + + if (fs[gracefulQueue].length === 0) + return + + var elem = fs[gracefulQueue].shift() + var fn = elem[0] + var args = elem[1] + // these items may be unset if they were added by an older graceful-fs + var err = elem[2] + var startTime = elem[3] + var lastTime = elem[4] + + // if we don't have a startTime we have no way of knowing if we've waited + // long enough, so go ahead and retry this item now + if (startTime === undefined) { + debug('RETRY', fn.name, args) + fn.apply(null, args) + } else if (Date.now() - startTime >= 60000) { + // it's been more than 60 seconds total, bail now + debug('TIMEOUT', fn.name, args) + var cb = args.pop() + if (typeof cb === 'function') + cb.call(null, err) + } else { + // the amount of time between the last attempt and right now + var sinceAttempt = Date.now() - lastTime + // the amount of time between when we first tried, and when we last tried + // rounded up to at least 1 + var sinceStart = Math.max(lastTime - startTime, 1) + // backoff. wait longer than the total time we've been retrying, but only + // up to a maximum of 100ms + var desiredDelay = Math.min(sinceStart * 1.2, 100) + // it's been long enough since the last retry, do it again + if (sinceAttempt >= desiredDelay) { + debug('RETRY', fn.name, args) + fn.apply(null, args.concat([startTime])) + } else { + // if we can't do this job yet, push it to the end of the queue + // and let the next iteration check again + fs[gracefulQueue].push(elem) + } + } + + // schedule our next run if one isn't already scheduled + if (retryTimer === undefined) { + retryTimer = setTimeout(retry, 0) + } +} + + +/***/ }), + +/***/ 76244: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Stream = (__webpack_require__(2203).Stream) + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} + + +/***/ }), + +/***/ 19023: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var constants = __webpack_require__(49140) + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +// This check is needed until node.js 12 is required +if (typeof process.chdir === 'function') { + var chdir = process.chdir + process.chdir = function (d) { + cwd = null + chdir.call(process, d) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (fs.chmod && !fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (fs.chown && !fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = typeof fs.rename !== 'function' ? fs.rename + : (function (fs$rename) { + function rename (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) + return rename + })(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = typeof fs.read !== 'function' ? fs.read + : (function (fs$read) { + function read (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + + // This ensures `util.promisify` works as it does for native `fs.read`. + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) + return read + })(fs.read) + + fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync + : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) + + function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + } + + function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else if (fs.futimes) { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } + } + + function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + + function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + function callback (er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + if (cb) cb.apply(this, arguments) + } + return options ? orig.call(fs, target, options, callback) + : orig.call(fs, target, callback) + } + } + + function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options) { + var stats = options ? orig.call(fs, target, options) + : orig.call(fs, target) + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + return stats; + } + } + + // ENOSYS means that the fs doesn't support the op. Just ignore + // that, because it doesn't matter. + // + // if there's no getuid, or if getuid() is something other + // than 0, and the error is EINVAL or EPERM, then just ignore + // it. + // + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // + // When running as root, or if other types of errors are + // encountered, then it's strict. + function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false + } +} + + /***/ }), /***/ 53972: @@ -29438,6 +15131,656 @@ isStream.transform = stream => module.exports = isStream; +/***/ }), + +/***/ 82162: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _fs +try { + _fs = __webpack_require__(71174) +} catch (_) { + _fs = __webpack_require__(79896) +} + +function readFile (file, options, callback) { + if (callback == null) { + callback = options + options = {} + } + + if (typeof options === 'string') { + options = {encoding: options} + } + + options = options || {} + var fs = options.fs || _fs + + var shouldThrow = true + if ('throws' in options) { + shouldThrow = options.throws + } + + fs.readFile(file, options, function (err, data) { + if (err) return callback(err) + + data = stripBom(data) + + var obj + try { + obj = JSON.parse(data, options ? options.reviver : null) + } catch (err2) { + if (shouldThrow) { + err2.message = file + ': ' + err2.message + return callback(err2) + } else { + return callback(null, null) + } + } + + callback(null, obj) + }) +} + +function readFileSync (file, options) { + options = options || {} + if (typeof options === 'string') { + options = {encoding: options} + } + + var fs = options.fs || _fs + + var shouldThrow = true + if ('throws' in options) { + shouldThrow = options.throws + } + + try { + var content = fs.readFileSync(file, options) + content = stripBom(content) + return JSON.parse(content, options.reviver) + } catch (err) { + if (shouldThrow) { + err.message = file + ': ' + err.message + throw err + } else { + return null + } + } +} + +function stringify (obj, options) { + var spaces + var EOL = '\n' + if (typeof options === 'object' && options !== null) { + if (options.spaces) { + spaces = options.spaces + } + if (options.EOL) { + EOL = options.EOL + } + } + + var str = JSON.stringify(obj, options ? options.replacer : null, spaces) + + return str.replace(/\n/g, EOL) + EOL +} + +function writeFile (file, obj, options, callback) { + if (callback == null) { + callback = options + options = {} + } + options = options || {} + var fs = options.fs || _fs + + var str = '' + try { + str = stringify(obj, options) + } catch (err) { + // Need to return whether a callback was passed or not + if (callback) callback(err, null) + return + } + + fs.writeFile(file, str, options, callback) +} + +function writeFileSync (file, obj, options) { + options = options || {} + var fs = options.fs || _fs + + var str = stringify(obj, options) + // not sure if fs.writeFileSync returns anything, but just in case + return fs.writeFileSync(file, str, options) +} + +function stripBom (content) { + // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified + if (Buffer.isBuffer(content)) content = content.toString('utf8') + content = content.replace(/^\uFEFF/, '') + return content +} + +var jsonfile = { + readFile: readFile, + readFileSync: readFileSync, + writeFile: writeFile, + writeFileSync: writeFileSync +} + +module.exports = jsonfile + + +/***/ }), + +/***/ 58538: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +var __webpack_unused_export__; + +__webpack_unused_export__ = ({ value: true }); +__webpack_unused_export__ = exports.Sk = exports.Ur = void 0; +__webpack_unused_export__ = makeField; +const tslib_1 = __webpack_require__(94914); +const os = tslib_1.__importStar(__webpack_require__(70857)); +const fs = tslib_1.__importStar(__webpack_require__(56922)); +const events_1 = tslib_1.__importDefault(__webpack_require__(24434)); +const serialize_1 = __webpack_require__(77283); +exports.Ur = { + deserialize: serialize_1.defaultDeserialize, + dialect: 'redis', + expiredCheckDelay: 24 * 3600 * 1000, // ms + filename: `${os.tmpdir()}/keyv-file/default.json`, + serialize: serialize_1.defaultSerialize, + writeDelay: 100, // ms + checkFileLock: false, +}; +function isNumber(val) { + return typeof val === 'number'; +} +class KeyvFile extends events_1.default { + constructor(options) { + super(); + this.ttlSupport = true; + this.opts = Object.assign({}, exports.Ur, options); + if (this.opts.checkFileLock) { + this.acquireFileLock(); + } + try { + const data = this.opts.deserialize(fs.readFileSync(this.opts.filename, 'utf8')); + if (!Array.isArray(data.cache)) { + const _cache = data.cache; + data.cache = []; + for (const key in _cache) { + if (_cache.hasOwnProperty(key)) { + data.cache.push([key, _cache[key]]); + } + } + } + this._cache = new Map(data.cache); + this._lastExpire = data.lastExpire; + } + catch (e) { + this._cache = new Map(); + this._lastExpire = Date.now(); + } + } + get _lockFile() { + return this.opts.filename + '.lock'; + } + acquireFileLock() { + try { + let fd = fs.openSync(this._lockFile, 'wx'); + fs.closeSync(fd); + process.on('SIGINT', () => { + this.releaseFileLock(); + process.exit(0); + }); + process.on('exit', () => { + this.releaseFileLock(); + }); + } + catch (error) { + console.error(`[keyv-file] There is another process using this file`); + throw error; + } + } + releaseFileLock() { + try { + fs.unlinkSync(this._lockFile); + } + catch (_a) { + //pass + } + } + get(key) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + return Promise.resolve(this.getSync(key)); + }); + } + getSync(key) { + try { + const data = this._cache.get(key); + if (!data) { + return undefined; + } + else if (this.isExpired(data)) { + this.delete(key); + return undefined; + } + else { + return data.value; + } + } + catch (error) { + // do nothing; + } + } + getMany(keys) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + const results = yield Promise.all(keys.map((key) => tslib_1.__awaiter(this, void 0, void 0, function* () { + const value = yield this.get(key); + return value; + }))); + return results; + }); + } + set(key, value, ttl) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + if (ttl === 0) { + ttl = undefined; + } + this._cache.set(key, { + expire: isNumber(ttl) ? Date.now() + ttl : undefined, + value: value, + }); + return this.save(); + }); + } + delete(key) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + const ret = this._cache.delete(key); + yield this.save(); + return ret; + }); + } + deleteMany(keys) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + const deletePromises = keys.map((key) => this.delete(key)); + const results = yield Promise.all(deletePromises); + return results.every((result) => result); + }); + } + clear() { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + this._cache = new Map(); + this._lastExpire = Date.now(); + return this.save(); + }); + } + has(key) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + const value = yield this.get(key); + return value !== undefined; + }); + } + isExpired(data) { + return isNumber(data.expire) && data.expire <= Date.now(); + } + clearExpire() { + const now = Date.now(); + if (now - this._lastExpire <= this.opts.expiredCheckDelay) { + return; + } + for (const key of this._cache.keys()) { + const data = this._cache.get(key); + if (this.isExpired(data)) { + this._cache.delete(key); + } + } + this._lastExpire = now; + } + saveToDisk() { + const cache = []; + for (const [key, val] of this._cache) { + cache.push([key, val]); + } + const data = this.opts.serialize({ + cache, + lastExpire: this._lastExpire, + }); + return new Promise((resolve, reject) => { + fs.outputFile(this.opts.filename, data, (err) => { + if (err) { + reject(err); + } + else { + resolve(); + } + }); + }); + } + save() { + this.clearExpire(); + if (this._savePromise) { + return this._savePromise; + } + this._savePromise = new Promise((resolve, reject) => { + setTimeout(() => { + this.saveToDisk() + .then(resolve, reject) + .finally(() => { + this._savePromise = void 0; + }); + }, this.opts.writeDelay); + }); + return this._savePromise; + } + disconnect() { + return Promise.resolve(); + } + iterator(namespace) { + return tslib_1.__asyncGenerator(this, arguments, function* iterator_1() { + for (const [key, data] of this._cache.entries()) { + if (key === undefined) { + continue; + } + // Filter by namespace if provided + if (!namespace || key.includes(namespace)) { + yield yield tslib_1.__await([key, data.value]); + } + } + }); + } +} +exports.Sk = KeyvFile; +__webpack_unused_export__ = KeyvFile; +class Field { + constructor(kv, key, defaults) { + this.kv = kv; + this.key = key; + this.defaults = defaults; + } + get() { + return tslib_1.__awaiter(this, arguments, void 0, function* (def = this.defaults) { + var _a; + return (_a = (yield this.kv.get(this.key))) !== null && _a !== void 0 ? _a : def; + }); + } + getSync(def = this.defaults) { + var _a; + if ('getSync' in this.kv) { + return (_a = this.kv.getSync(this.key)) !== null && _a !== void 0 ? _a : def; + } + throw new Error('kv does not support getSync'); + } + set(val, ttl) { + return this.kv.set(this.key, val, ttl); + } + delete() { + return this.kv.delete(this.key); + } +} +__webpack_unused_export__ = Field; +function makeField(kv, key, defaults) { + return new Field(kv, key, defaults); +} + + +/***/ }), + +/***/ 94914: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ __assign: () => (/* binding */ __assign), +/* harmony export */ __asyncDelegator: () => (/* binding */ __asyncDelegator), +/* harmony export */ __asyncGenerator: () => (/* binding */ __asyncGenerator), +/* harmony export */ __asyncValues: () => (/* binding */ __asyncValues), +/* harmony export */ __await: () => (/* binding */ __await), +/* harmony export */ __awaiter: () => (/* binding */ __awaiter), +/* harmony export */ __classPrivateFieldGet: () => (/* binding */ __classPrivateFieldGet), +/* harmony export */ __classPrivateFieldSet: () => (/* binding */ __classPrivateFieldSet), +/* harmony export */ __createBinding: () => (/* binding */ __createBinding), +/* harmony export */ __decorate: () => (/* binding */ __decorate), +/* harmony export */ __exportStar: () => (/* binding */ __exportStar), +/* harmony export */ __extends: () => (/* binding */ __extends), +/* harmony export */ __generator: () => (/* binding */ __generator), +/* harmony export */ __importDefault: () => (/* binding */ __importDefault), +/* harmony export */ __importStar: () => (/* binding */ __importStar), +/* harmony export */ __makeTemplateObject: () => (/* binding */ __makeTemplateObject), +/* harmony export */ __metadata: () => (/* binding */ __metadata), +/* harmony export */ __param: () => (/* binding */ __param), +/* harmony export */ __read: () => (/* binding */ __read), +/* harmony export */ __rest: () => (/* binding */ __rest), +/* harmony export */ __spread: () => (/* binding */ __spread), +/* harmony export */ __spreadArrays: () => (/* binding */ __spreadArrays), +/* harmony export */ __values: () => (/* binding */ __values) +/* harmony export */ }); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +function __createBinding(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +} + +function __exportStar(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], 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(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), 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; +}; + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +} + +function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +} + + /***/ }), /***/ 61747: @@ -37415,273 +23758,6 @@ const removeCirculars = (obj, branch = new Map(), path = "root") => { }; -/***/ }), - -/***/ 67322: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports = __webpack_require__(79272)('node_sqlite3.node'); - - -/***/ }), - -/***/ 45430: -/***/ ((module, exports, __webpack_require__) => { - -const path = __webpack_require__(16928); -const sqlite3 = __webpack_require__(67322); -const EventEmitter = (__webpack_require__(24434).EventEmitter); -module.exports = exports = sqlite3; - -function normalizeMethod (fn) { - return function (sql) { - let errBack; - const args = Array.prototype.slice.call(arguments, 1); - - if (typeof args[args.length - 1] === 'function') { - const callback = args[args.length - 1]; - errBack = function(err) { - if (err) { - callback(err); - } - }; - } - const statement = new Statement(this, sql, errBack); - return fn.call(this, statement, args); - }; -} - -function inherits(target, source) { - for (const k in source.prototype) - target.prototype[k] = source.prototype[k]; -} - -sqlite3.cached = { - Database: function(file, a, b) { - if (file === '' || file === ':memory:') { - // Don't cache special databases. - return new Database(file, a, b); - } - - let db; - file = path.resolve(file); - - if (!sqlite3.cached.objects[file]) { - db = sqlite3.cached.objects[file] = new Database(file, a, b); - } - else { - // Make sure the callback is called. - db = sqlite3.cached.objects[file]; - const callback = (typeof a === 'number') ? b : a; - if (typeof callback === 'function') { - function cb() { callback.call(db, null); } - if (db.open) process.nextTick(cb); - else db.once('open', cb); - } - } - - return db; - }, - objects: {} -}; - - -const Database = sqlite3.Database; -const Statement = sqlite3.Statement; -const Backup = sqlite3.Backup; - -inherits(Database, EventEmitter); -inherits(Statement, EventEmitter); -inherits(Backup, EventEmitter); - -// Database#prepare(sql, [bind1, bind2, ...], [callback]) -Database.prototype.prepare = normalizeMethod(function(statement, params) { - return params.length - ? statement.bind.apply(statement, params) - : statement; -}); - -// Database#run(sql, [bind1, bind2, ...], [callback]) -Database.prototype.run = normalizeMethod(function(statement, params) { - statement.run.apply(statement, params).finalize(); - return this; -}); - -// Database#get(sql, [bind1, bind2, ...], [callback]) -Database.prototype.get = normalizeMethod(function(statement, params) { - statement.get.apply(statement, params).finalize(); - return this; -}); - -// Database#all(sql, [bind1, bind2, ...], [callback]) -Database.prototype.all = normalizeMethod(function(statement, params) { - statement.all.apply(statement, params).finalize(); - return this; -}); - -// Database#each(sql, [bind1, bind2, ...], [callback], [complete]) -Database.prototype.each = normalizeMethod(function(statement, params) { - statement.each.apply(statement, params).finalize(); - return this; -}); - -Database.prototype.map = normalizeMethod(function(statement, params) { - statement.map.apply(statement, params).finalize(); - return this; -}); - -// Database#backup(filename, [callback]) -// Database#backup(filename, destName, sourceName, filenameIsDest, [callback]) -Database.prototype.backup = function() { - let backup; - if (arguments.length <= 2) { - // By default, we write the main database out to the main database of the named file. - // This is the most likely use of the backup api. - backup = new Backup(this, arguments[0], 'main', 'main', true, arguments[1]); - } else { - // Otherwise, give the user full control over the sqlite3_backup_init arguments. - backup = new Backup(this, arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]); - } - // Per the sqlite docs, exclude the following errors as non-fatal by default. - backup.retryErrors = [sqlite3.BUSY, sqlite3.LOCKED]; - return backup; -}; - -Statement.prototype.map = function() { - const params = Array.prototype.slice.call(arguments); - const callback = params.pop(); - params.push(function(err, rows) { - if (err) return callback(err); - const result = {}; - if (rows.length) { - const keys = Object.keys(rows[0]); - const key = keys[0]; - if (keys.length > 2) { - // Value is an object - for (let i = 0; i < rows.length; i++) { - result[rows[i][key]] = rows[i]; - } - } else { - const value = keys[1]; - // Value is a plain value - for (let i = 0; i < rows.length; i++) { - result[rows[i][key]] = rows[i][value]; - } - } - } - callback(err, result); - }); - return this.all.apply(this, params); -}; - -let isVerbose = false; - -const supportedEvents = [ 'trace', 'profile', 'change' ]; - -Database.prototype.addListener = Database.prototype.on = function(type) { - const val = EventEmitter.prototype.addListener.apply(this, arguments); - if (supportedEvents.indexOf(type) >= 0) { - this.configure(type, true); - } - return val; -}; - -Database.prototype.removeListener = function(type) { - const val = EventEmitter.prototype.removeListener.apply(this, arguments); - if (supportedEvents.indexOf(type) >= 0 && !this._events[type]) { - this.configure(type, false); - } - return val; -}; - -Database.prototype.removeAllListeners = function(type) { - const val = EventEmitter.prototype.removeAllListeners.apply(this, arguments); - if (supportedEvents.indexOf(type) >= 0) { - this.configure(type, false); - } - return val; -}; - -// Save the stack trace over EIO callbacks. -sqlite3.verbose = function() { - if (!isVerbose) { - const trace = __webpack_require__(60738); - [ - 'prepare', - 'get', - 'run', - 'all', - 'each', - 'map', - 'close', - 'exec' - ].forEach(function (name) { - trace.extendTrace(Database.prototype, name); - }); - [ - 'bind', - 'get', - 'run', - 'all', - 'each', - 'map', - 'reset', - 'finalize', - ].forEach(function (name) { - trace.extendTrace(Statement.prototype, name); - }); - isVerbose = true; - } - - return sqlite3; -}; - - -/***/ }), - -/***/ 60738: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -// Inspired by https://github.com/tlrobinson/long-stack-traces -const util = __webpack_require__(39023); - -function extendTrace(object, property, pos) { - const old = object[property]; - object[property] = function() { - const error = new Error(); - const name = object.constructor.name + '#' + property + '(' + - Array.prototype.slice.call(arguments).map(function(el) { - return util.inspect(el, false, 0); - }).join(', ') + ')'; - - if (typeof pos === 'undefined') pos = -1; - if (pos < 0) pos += arguments.length; - const cb = arguments[pos]; - if (typeof arguments[pos] === 'function') { - arguments[pos] = function replacement() { - const err = arguments[0]; - if (err && err.stack && !err.__augmented) { - err.stack = filter(err).join('\n'); - err.stack += '\n--> in ' + name; - err.stack += '\n' + filter(error).slice(1).join('\n'); - err.__augmented = true; - } - return cb.apply(this, arguments); - }; - } - return old.apply(this, arguments); - }; -} -exports.extendTrace = extendTrace; - - -function filter(error) { - return error.stack.split('\n').filter(function(line) { - return line.indexOf(__filename) < 0; - }); -} - - /***/ }), /***/ 91370: @@ -38980,6 +25056,39 @@ Object.defineProperty(exports, "configs", ({ })); +/***/ }), + +/***/ 55399: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +exports.S = function (fn) { + return Object.defineProperty(function () { + if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments) + else { + return new Promise((resolve, reject) => { + arguments[arguments.length] = (err, res) => { + if (err) return reject(err) + resolve(res) + } + arguments.length++ + fn.apply(this, arguments) + }) + } + }, 'name', { value: fn.name }) +} + +exports.z = function (fn) { + return Object.defineProperty(function () { + const cb = arguments[arguments.length - 1] + if (typeof cb !== 'function') return fn.apply(this, arguments) + else fn.apply(this, arguments).then(r => cb(null, r), cb) + }, 'name', { value: fn.name }) +} + + /***/ }), /***/ 32926: @@ -135808,6 +121917,14 @@ module.exports = require("child_process"); /***/ }), +/***/ 49140: +/***/ ((module) => { + +"use strict"; +module.exports = require("constants"); + +/***/ }), + /***/ 76982: /***/ ((module) => { @@ -136006,6 +122123,90 @@ module.exports = require("worker_threads"); "use strict"; module.exports = require("zlib"); +/***/ }), + +/***/ 77283: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + defaultDeserialize: () => defaultDeserialize, + defaultSerialize: () => defaultSerialize +}); +module.exports = __toCommonJS(index_exports); +var import_node_buffer = __webpack_require__(20181); +var defaultSerialize = (data) => { + if (data === void 0 || data === null) { + return "null"; + } + if (typeof data === "string") { + return JSON.stringify(data.startsWith(":") ? ":" + data : data); + } + if (import_node_buffer.Buffer.isBuffer(data)) { + return JSON.stringify(":base64:" + data.toString("base64")); + } + if (data?.toJSON) { + data = data.toJSON(); + } + if (typeof data === "object") { + let s = ""; + const array = Array.isArray(data); + s = array ? "[" : "{"; + let first = true; + for (const k in data) { + const ignore = typeof data[k] === "function" || !array && data[k] === void 0; + if (!Object.hasOwn(data, k) || ignore) { + continue; + } + if (!first) { + s += ","; + } + first = false; + if (array) { + s += defaultSerialize(data[k]); + } else if (data[k] !== void 0) { + s += defaultSerialize(k) + ":" + defaultSerialize(data[k]); + } + } + s += array ? "]" : "}"; + return s; + } + return JSON.stringify(data); +}; +var defaultDeserialize = (data) => JSON.parse(data, (_, value) => { + if (typeof value === "string") { + if (value.startsWith(":base64:")) { + return import_node_buffer.Buffer.from(value.slice(8), "base64"); + } + return value.startsWith(":") ? value.slice(1) : value; + } + return value; +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (0); + + /***/ }), /***/ 47892: @@ -166150,11 +152351,10 @@ const createClient = (options) => { // EXPORTS __webpack_require__.d(__webpack_exports__, { - X4: () => (/* binding */ default_sort), eF: () => (/* binding */ run) }); -// UNUSED EXPORTS: complete_messages, complete_options, complete_params, execute_request, processRun +// UNUSED EXPORTS: complete_messages, complete_options, complete_params, default_sort, execute_request, processRun // EXTERNAL MODULE: external "node:path" var external_node_path_ = __webpack_require__(76760); @@ -168483,8 +154683,8 @@ const load = async (options) => { return profile.variables; }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZmlsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9wcm9maWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxJQUFJLE1BQU0sV0FBVyxDQUFBO0FBRWpDLE9BQU8sRUFBRSxNQUFNLEVBQUUsT0FBTyxFQUFFLE1BQU0sbUJBQW1CLENBQUE7QUFDbkQsT0FBTyxFQUFFLElBQUksSUFBSSxNQUFNLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQTtBQUNwRCxPQUFPLEVBQVksS0FBSyxFQUFFLE1BQU0sbUJBQW1CLENBQUE7QUFJbkQsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGdCQUFnQixDQUFBO0FBRXpDLE1BQU0sUUFBUSxHQUFHLENBQUMsV0FBbUIsRUFBRSxFQU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UEifQ== -// EXTERNAL MODULE: ./dist-in/tools.js + 88 modules -var tools = __webpack_require__(49315); +// EXTERNAL MODULE: ./dist-in/tools.js + 84 modules +var tools = __webpack_require__(3043); ;// ./dist-in/utils/content.js const content = (result) => { return result?.choices?.[0]?.message?.content || ""; @@ -169473,8 +155673,21 @@ var E_OPENAI_MODEL; ;// ./dist-in/models/cache/openrouter-models.js var E_OPENROUTER_MODEL; (function (E_OPENROUTER_MODEL) { + E_OPENROUTER_MODEL["MODEL_QWEN_QWEN3_NEXT_80B_A3B_THINKING"] = "qwen/qwen3-next-80b-a3b-thinking"; + E_OPENROUTER_MODEL["MODEL_QWEN_QWEN3_NEXT_80B_A3B_INSTRUCT"] = "qwen/qwen3-next-80b-a3b-instruct"; + E_OPENROUTER_MODEL["MODEL_MEITUAN_LONGCAT_FLASH_CHAT"] = "meituan/longcat-flash-chat"; + E_OPENROUTER_MODEL["MODEL_QWEN_QWEN_PLUS_2025_07_28"] = "qwen/qwen-plus-2025-07-28"; + E_OPENROUTER_MODEL["MODEL_QWEN_QWEN_PLUS_2025_07_28_THINKING"] = "qwen/qwen-plus-2025-07-28:thinking"; + E_OPENROUTER_MODEL["MODEL_NVIDIA_NEMOTRON_NANO_9B_V2_FREE"] = "nvidia/nemotron-nano-9b-v2:free"; + E_OPENROUTER_MODEL["MODEL_NVIDIA_NEMOTRON_NANO_9B_V2"] = "nvidia/nemotron-nano-9b-v2"; + E_OPENROUTER_MODEL["MODEL_OPENROUTER_SONOMA_DUSK_ALPHA"] = "openrouter/sonoma-dusk-alpha"; + E_OPENROUTER_MODEL["MODEL_OPENROUTER_SONOMA_SKY_ALPHA"] = "openrouter/sonoma-sky-alpha"; + E_OPENROUTER_MODEL["MODEL_QWEN_QWEN3_MAX"] = "qwen/qwen3-max"; + E_OPENROUTER_MODEL["MODEL_MOONSHOTAI_KIMI_K2_0905"] = "moonshotai/kimi-k2-0905"; + E_OPENROUTER_MODEL["MODEL_BYTEDANCE_SEED_OSS_36B_INSTRUCT"] = "bytedance/seed-oss-36b-instruct"; E_OPENROUTER_MODEL["MODEL_DEEPCOGITO_COGITO_V2_PREVIEW_LLAMA_109B_MOE"] = "deepcogito/cogito-v2-preview-llama-109b-moe"; E_OPENROUTER_MODEL["MODEL_DEEPCOGITO_COGITO_V2_PREVIEW_DEEPSEEK_671B"] = "deepcogito/cogito-v2-preview-deepseek-671b"; + E_OPENROUTER_MODEL["MODEL_STEPFUN_AI_STEP3"] = "stepfun-ai/step3"; E_OPENROUTER_MODEL["MODEL_QWEN_QWEN3_30B_A3B_THINKING_2507"] = "qwen/qwen3-30b-a3b-thinking-2507"; E_OPENROUTER_MODEL["MODEL_X_AI_GROK_CODE_FAST_1"] = "x-ai/grok-code-fast-1"; E_OPENROUTER_MODEL["MODEL_NOUSRESEARCH_HERMES_4_70B"] = "nousresearch/hermes-4-70b"; @@ -169602,14 +155815,13 @@ var E_OPENROUTER_MODEL; E_OPENROUTER_MODEL["MODEL_MOONSHOTAI_KIMI_VL_A3B_THINKING"] = "moonshotai/kimi-vl-a3b-thinking"; E_OPENROUTER_MODEL["MODEL_X_AI_GROK_3_MINI_BETA"] = "x-ai/grok-3-mini-beta"; E_OPENROUTER_MODEL["MODEL_X_AI_GROK_3_BETA"] = "x-ai/grok-3-beta"; - E_OPENROUTER_MODEL["MODEL_NVIDIA_LLAMA_3_3_NEMOTRON_SUPER_49B_V1"] = "nvidia/llama-3.3-nemotron-super-49b-v1"; E_OPENROUTER_MODEL["MODEL_NVIDIA_LLAMA_3_1_NEMOTRON_ULTRA_253B_V1_FREE"] = "nvidia/llama-3.1-nemotron-ultra-253b-v1:free"; E_OPENROUTER_MODEL["MODEL_NVIDIA_LLAMA_3_1_NEMOTRON_ULTRA_253B_V1"] = "nvidia/llama-3.1-nemotron-ultra-253b-v1"; E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_4_MAVERICK_FREE"] = "meta-llama/llama-4-maverick:free"; E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_4_MAVERICK"] = "meta-llama/llama-4-maverick"; E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_4_SCOUT_FREE"] = "meta-llama/llama-4-scout:free"; E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_4_SCOUT"] = "meta-llama/llama-4-scout"; - E_OPENROUTER_MODEL["MODEL_GOOGLE_GEMINI_2_5_PRO_EXP_03_25"] = "google/gemini-2.5-pro-exp-03-25"; + E_OPENROUTER_MODEL["MODEL_ALLENAI_MOLMO_7B_D"] = "allenai/molmo-7b-d"; E_OPENROUTER_MODEL["MODEL_QWEN_QWEN2_5_VL_32B_INSTRUCT_FREE"] = "qwen/qwen2.5-vl-32b-instruct:free"; E_OPENROUTER_MODEL["MODEL_QWEN_QWEN2_5_VL_32B_INSTRUCT"] = "qwen/qwen2.5-vl-32b-instruct"; E_OPENROUTER_MODEL["MODEL_DEEPSEEK_DEEPSEEK_CHAT_V3_0324_FREE"] = "deepseek/deepseek-chat-v3-0324:free"; @@ -169617,6 +155829,7 @@ var E_OPENROUTER_MODEL; E_OPENROUTER_MODEL["MODEL_OPENAI_O1_PRO"] = "openai/o1-pro"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_SMALL_3_1_24B_INSTRUCT_FREE"] = "mistralai/mistral-small-3.1-24b-instruct:free"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_SMALL_3_1_24B_INSTRUCT"] = "mistralai/mistral-small-3.1-24b-instruct"; + E_OPENROUTER_MODEL["MODEL_ALLENAI_OLMO_2_0325_32B_INSTRUCT"] = "allenai/olmo-2-0325-32b-instruct"; E_OPENROUTER_MODEL["MODEL_GOOGLE_GEMMA_3_4B_IT_FREE"] = "google/gemma-3-4b-it:free"; E_OPENROUTER_MODEL["MODEL_GOOGLE_GEMMA_3_4B_IT"] = "google/gemma-3-4b-it"; E_OPENROUTER_MODEL["MODEL_GOOGLE_GEMMA_3_12B_IT_FREE"] = "google/gemma-3-12b-it:free"; @@ -169693,38 +155906,36 @@ var E_OPENROUTER_MODEL; E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_LARGE_2411"] = "mistralai/mistral-large-2411"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_LARGE_2407"] = "mistralai/mistral-large-2407"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_PIXTRAL_LARGE_2411"] = "mistralai/pixtral-large-2411"; - E_OPENROUTER_MODEL["MODEL_X_AI_GROK_VISION_BETA"] = "x-ai/grok-vision-beta"; - E_OPENROUTER_MODEL["MODEL_INFERMATIC_MN_INFEROR_12B"] = "infermatic/mn-inferor-12b"; E_OPENROUTER_MODEL["MODEL_QWEN_QWEN_2_5_CODER_32B_INSTRUCT_FREE"] = "qwen/qwen-2.5-coder-32b-instruct:free"; E_OPENROUTER_MODEL["MODEL_QWEN_QWEN_2_5_CODER_32B_INSTRUCT"] = "qwen/qwen-2.5-coder-32b-instruct"; E_OPENROUTER_MODEL["MODEL_RAIFLE_SORCERERLM_8X22B"] = "raifle/sorcererlm-8x22b"; E_OPENROUTER_MODEL["MODEL_THEDRUMMER_UNSLOPNEMO_12B"] = "thedrummer/unslopnemo-12b"; - E_OPENROUTER_MODEL["MODEL_ANTHROPIC_CLAUDE_3_5_HAIKU_20241022"] = "anthropic/claude-3.5-haiku-20241022"; E_OPENROUTER_MODEL["MODEL_ANTHROPIC_CLAUDE_3_5_HAIKU"] = "anthropic/claude-3.5-haiku"; + E_OPENROUTER_MODEL["MODEL_ANTHROPIC_CLAUDE_3_5_HAIKU_20241022"] = "anthropic/claude-3.5-haiku-20241022"; E_OPENROUTER_MODEL["MODEL_ANTHRACITE_ORG_MAGNUM_V4_72B"] = "anthracite-org/magnum-v4-72b"; E_OPENROUTER_MODEL["MODEL_ANTHROPIC_CLAUDE_3_5_SONNET"] = "anthropic/claude-3.5-sonnet"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_MINISTRAL_3B"] = "mistralai/ministral-3b"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_MINISTRAL_8B"] = "mistralai/ministral-8b"; E_OPENROUTER_MODEL["MODEL_QWEN_QWEN_2_5_7B_INSTRUCT"] = "qwen/qwen-2.5-7b-instruct"; E_OPENROUTER_MODEL["MODEL_NVIDIA_LLAMA_3_1_NEMOTRON_70B_INSTRUCT"] = "nvidia/llama-3.1-nemotron-70b-instruct"; - E_OPENROUTER_MODEL["MODEL_INFLECTION_INFLECTION_3_PRODUCTIVITY"] = "inflection/inflection-3-productivity"; E_OPENROUTER_MODEL["MODEL_INFLECTION_INFLECTION_3_PI"] = "inflection/inflection-3-pi"; + E_OPENROUTER_MODEL["MODEL_INFLECTION_INFLECTION_3_PRODUCTIVITY"] = "inflection/inflection-3-productivity"; E_OPENROUTER_MODEL["MODEL_GOOGLE_GEMINI_FLASH_1_5_8B"] = "google/gemini-flash-1.5-8b"; - E_OPENROUTER_MODEL["MODEL_ANTHRACITE_ORG_MAGNUM_V2_72B"] = "anthracite-org/magnum-v2-72b"; E_OPENROUTER_MODEL["MODEL_THEDRUMMER_ROCINANTE_12B"] = "thedrummer/rocinante-12b"; - E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_3_2_11B_VISION_INSTRUCT"] = "meta-llama/llama-3.2-11b-vision-instruct"; + E_OPENROUTER_MODEL["MODEL_ANTHRACITE_ORG_MAGNUM_V2_72B"] = "anthracite-org/magnum-v2-72b"; E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_3_2_90B_VISION_INSTRUCT"] = "meta-llama/llama-3.2-90b-vision-instruct"; E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_3_2_1B_INSTRUCT"] = "meta-llama/llama-3.2-1b-instruct"; E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_3_2_3B_INSTRUCT_FREE"] = "meta-llama/llama-3.2-3b-instruct:free"; E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_3_2_3B_INSTRUCT"] = "meta-llama/llama-3.2-3b-instruct"; + E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_3_2_11B_VISION_INSTRUCT"] = "meta-llama/llama-3.2-11b-vision-instruct"; E_OPENROUTER_MODEL["MODEL_QWEN_QWEN_2_5_72B_INSTRUCT_FREE"] = "qwen/qwen-2.5-72b-instruct:free"; E_OPENROUTER_MODEL["MODEL_QWEN_QWEN_2_5_72B_INSTRUCT"] = "qwen/qwen-2.5-72b-instruct"; E_OPENROUTER_MODEL["MODEL_NEVERSLEEP_LLAMA_3_1_LUMIMAID_8B"] = "neversleep/llama-3.1-lumimaid-8b"; - E_OPENROUTER_MODEL["MODEL_OPENAI_O1_MINI_2024_09_12"] = "openai/o1-mini-2024-09-12"; E_OPENROUTER_MODEL["MODEL_OPENAI_O1_MINI"] = "openai/o1-mini"; + E_OPENROUTER_MODEL["MODEL_OPENAI_O1_MINI_2024_09_12"] = "openai/o1-mini-2024-09-12"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_PIXTRAL_12B"] = "mistralai/pixtral-12b"; - E_OPENROUTER_MODEL["MODEL_COHERE_COMMAND_R_08_2024"] = "cohere/command-r-08-2024"; E_OPENROUTER_MODEL["MODEL_COHERE_COMMAND_R_PLUS_08_2024"] = "cohere/command-r-plus-08-2024"; + E_OPENROUTER_MODEL["MODEL_COHERE_COMMAND_R_08_2024"] = "cohere/command-r-08-2024"; E_OPENROUTER_MODEL["MODEL_SAO10K_L3_1_EURYALE_70B"] = "sao10k/l3.1-euryale-70b"; E_OPENROUTER_MODEL["MODEL_QWEN_QWEN_2_5_VL_7B_INSTRUCT"] = "qwen/qwen-2.5-vl-7b-instruct"; E_OPENROUTER_MODEL["MODEL_MICROSOFT_PHI_3_5_MINI_128K_INSTRUCT"] = "microsoft/phi-3.5-mini-128k-instruct"; @@ -169734,9 +155945,9 @@ var E_OPENROUTER_MODEL; E_OPENROUTER_MODEL["MODEL_SAO10K_L3_LUNARIS_8B"] = "sao10k/l3-lunaris-8b"; E_OPENROUTER_MODEL["MODEL_OPENAI_GPT_4O_2024_08_06"] = "openai/gpt-4o-2024-08-06"; E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_3_1_405B"] = "meta-llama/llama-3.1-405b"; + E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_3_1_8B_INSTRUCT"] = "meta-llama/llama-3.1-8b-instruct"; E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_3_1_405B_INSTRUCT_FREE"] = "meta-llama/llama-3.1-405b-instruct:free"; E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_3_1_405B_INSTRUCT"] = "meta-llama/llama-3.1-405b-instruct"; - E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_3_1_8B_INSTRUCT"] = "meta-llama/llama-3.1-8b-instruct"; E_OPENROUTER_MODEL["MODEL_META_LLAMA_LLAMA_3_1_70B_INSTRUCT"] = "meta-llama/llama-3.1-70b-instruct"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_NEMO_FREE"] = "mistralai/mistral-nemo:free"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_NEMO"] = "mistralai/mistral-nemo"; @@ -169749,9 +155960,9 @@ var E_OPENROUTER_MODEL; E_OPENROUTER_MODEL["MODEL_SAO10K_L3_EURYALE_70B"] = "sao10k/l3-euryale-70b"; E_OPENROUTER_MODEL["MODEL_COGNITIVECOMPUTATIONS_DOLPHIN_MIXTRAL_8X22B"] = "cognitivecomputations/dolphin-mixtral-8x22b"; E_OPENROUTER_MODEL["MODEL_NOUSRESEARCH_HERMES_2_PRO_LLAMA_3_8B"] = "nousresearch/hermes-2-pro-llama-3-8b"; + E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_7B_INSTRUCT_V0_3"] = "mistralai/mistral-7b-instruct-v0.3"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_7B_INSTRUCT_FREE"] = "mistralai/mistral-7b-instruct:free"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_7B_INSTRUCT"] = "mistralai/mistral-7b-instruct"; - E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_7B_INSTRUCT_V0_3"] = "mistralai/mistral-7b-instruct-v0.3"; E_OPENROUTER_MODEL["MODEL_MICROSOFT_PHI_3_MINI_128K_INSTRUCT"] = "microsoft/phi-3-mini-128k-instruct"; E_OPENROUTER_MODEL["MODEL_MICROSOFT_PHI_3_MEDIUM_128K_INSTRUCT"] = "microsoft/phi-3-medium-128k-instruct"; E_OPENROUTER_MODEL["MODEL_NEVERSLEEP_LLAMA_3_LUMIMAID_70B"] = "neversleep/llama-3-lumimaid-70b"; @@ -169769,36 +155980,38 @@ var E_OPENROUTER_MODEL; E_OPENROUTER_MODEL["MODEL_COHERE_COMMAND_R_PLUS"] = "cohere/command-r-plus"; E_OPENROUTER_MODEL["MODEL_COHERE_COMMAND_R_PLUS_04_2024"] = "cohere/command-r-plus-04-2024"; E_OPENROUTER_MODEL["MODEL_SOPHOSYMPATHEIA_MIDNIGHT_ROSE_70B"] = "sophosympatheia/midnight-rose-70b"; - E_OPENROUTER_MODEL["MODEL_COHERE_COMMAND_R"] = "cohere/command-r"; E_OPENROUTER_MODEL["MODEL_COHERE_COMMAND"] = "cohere/command"; + E_OPENROUTER_MODEL["MODEL_COHERE_COMMAND_R"] = "cohere/command-r"; E_OPENROUTER_MODEL["MODEL_ANTHROPIC_CLAUDE_3_HAIKU"] = "anthropic/claude-3-haiku"; E_OPENROUTER_MODEL["MODEL_ANTHROPIC_CLAUDE_3_OPUS"] = "anthropic/claude-3-opus"; E_OPENROUTER_MODEL["MODEL_COHERE_COMMAND_R_03_2024"] = "cohere/command-r-03-2024"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_LARGE"] = "mistralai/mistral-large"; E_OPENROUTER_MODEL["MODEL_OPENAI_GPT_4_TURBO_PREVIEW"] = "openai/gpt-4-turbo-preview"; E_OPENROUTER_MODEL["MODEL_OPENAI_GPT_3_5_TURBO_0613"] = "openai/gpt-3.5-turbo-0613"; - E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_SMALL"] = "mistralai/mistral-small"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_TINY"] = "mistralai/mistral-tiny"; + E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_SMALL"] = "mistralai/mistral-small"; E_OPENROUTER_MODEL["MODEL_MISTRALAI_MIXTRAL_8X7B_INSTRUCT"] = "mistralai/mixtral-8x7b-instruct"; E_OPENROUTER_MODEL["MODEL_NEVERSLEEP_NOROMAID_20B"] = "neversleep/noromaid-20b"; E_OPENROUTER_MODEL["MODEL_ALPINDALE_GOLIATH_120B"] = "alpindale/goliath-120b"; E_OPENROUTER_MODEL["MODEL_OPENROUTER_AUTO"] = "openrouter/auto"; E_OPENROUTER_MODEL["MODEL_OPENAI_GPT_4_1106_PREVIEW"] = "openai/gpt-4-1106-preview"; - E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_7B_INSTRUCT_V0_1"] = "mistralai/mistral-7b-instruct-v0.1"; E_OPENROUTER_MODEL["MODEL_OPENAI_GPT_3_5_TURBO_INSTRUCT"] = "openai/gpt-3.5-turbo-instruct"; - E_OPENROUTER_MODEL["MODEL_PYGMALIONAI_MYTHALION_13B"] = "pygmalionai/mythalion-13b"; + E_OPENROUTER_MODEL["MODEL_MISTRALAI_MISTRAL_7B_INSTRUCT_V0_1"] = "mistralai/mistral-7b-instruct-v0.1"; E_OPENROUTER_MODEL["MODEL_OPENAI_GPT_3_5_TURBO_16K"] = "openai/gpt-3.5-turbo-16k"; E_OPENROUTER_MODEL["MODEL_MANCER_WEAVER"] = "mancer/weaver"; E_OPENROUTER_MODEL["MODEL_UNDI95_REMM_SLERP_L2_13B"] = "undi95/remm-slerp-l2-13b"; E_OPENROUTER_MODEL["MODEL_GRYPHE_MYTHOMAX_L2_13B"] = "gryphe/mythomax-l2-13b"; - E_OPENROUTER_MODEL["MODEL_OPENAI_GPT_4_0314"] = "openai/gpt-4-0314"; E_OPENROUTER_MODEL["MODEL_OPENAI_GPT_3_5_TURBO"] = "openai/gpt-3.5-turbo"; + E_OPENROUTER_MODEL["MODEL_OPENAI_GPT_4_0314"] = "openai/gpt-4-0314"; E_OPENROUTER_MODEL["MODEL_OPENAI_GPT_4"] = "openai/gpt-4"; })(E_OPENROUTER_MODEL || (E_OPENROUTER_MODEL = {})); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3BlbnJvdXRlci1tb2RlbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbW9kZWxzL2NhY2hlL29wZW5yb3V0ZXItbW9kZWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBTixJQUFZLGtCQWtVWDtBQWxVRCxXQUFZLGtCQUFrQjtJQUM1Qix1SEFBaUcsQ0FBQTtJQUNqRyxxSEFBK0YsQ0FBQTtJQUMvRixpR0FBMkUsQ0FBQTtJQUMzRSwyRUFBcUQsQ0FBQTtJQUNyRCxtRkFBNkQsQ0FBQTtJQUM3RCxxRkFBK0QsQ0FBQTtJQUMvRCwyR0FBcUYsQ0FBQTtJQUNyRixpR0FBMkUsQ0FBQTtJQUMzRSx1RkFBaUUsQ0FBQTtJQUNqRSx1RkFBaUUsQ0FBQTtJQUNqRSx1RkFBaUUsQ0FBQTtJQUNqRSx5RkFBbUUsQ0FBQTtJQUNuRSwrRUFBeUQsQ0FBQTtJQUN6RCxxRkFBK0QsQ0FBQTtJQUMvRCwyREFBcUMsQ0FBQTtJQUNyQyx1RUFBaUQsQ0FBQTtJQUNqRCx5RUFBbUQsQ0FBQTtJQUNuRCxtRUFBNkMsQ0FBQTtJQUM3Qyx5REFBbUMsQ0FBQTtJQUNuQyxtRUFBNkMsQ0FBQTtJQUM3QyxtRUFBNkMsQ0FBQTtJQUM3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JQUM3RSw2REFBdUMsQ0FBQTtJQUN2QyxpRUFBMkMsQ0FBQTtJQUMzQyxpRkFBMkQsQ0FBQTtJQUMzRCwrRUFBeUQsQ0FBQTtJQUN6RCxpRkFBMkQsQ0FBQTtJQUMzRCwrRUFBeUQsQ0FBQTtJQUN6RCxxRkFBK0QsQ0FBQTtJQUMvRCxtRkFBNkQsQ0FBQTtJQUM3RCw2RUFBdUQsQ0FBQTtJQUN2RCwrRUFBeUQsQ0FBQTtJQUN6RCwrRkFBeUUsQ0FBQTtJQUN6RSwrRUFBeUQsQ0FBQTtJQUN6RCw2RUFBdUQsQ0FBQTtJQUN2RCwrREFBeUMsQ0FBQTtJQUN6QyxtRkFBNkQsQ0FBQTtJQUM3RCwyRkFBcUUsQ0FBQTtJQUNyRSxxR0FBK0UsQ0FBQTtJQUMvRSxpRkFBMkQsQ0FBQTtJQUMzRCwyREFBcUMsQ0FBQTtJQUNyQyxpRkFBMkQsQ0FBQTtJQUMzRCw2RUFBdUQsQ0FBQTtJQUN2RCx5RUFBbUQsQ0FBQTtJQUNuRCxtRUFBNkMsQ0FBQTtJQUM3Qyx5REFBbUMsQ0FBQTtBQUNyQyxDQUFDLEVBNVVXLGtCQUFrQixLQUFsQixrQkFBa0IsUUE0VTdCIn0= ;// ./dist-in/models/cache/openrouter-models-free.js var E_OPENROUTER_MODEL_FREE; (function (E_OPENROUTER_MODEL_FREE) { + E_OPENROUTER_MODEL_FREE["MODEL_FREE_NVIDIA_NEMOTRON_NANO_9B_V2_FREE"] = "nvidia/nemotron-nano-9b-v2:free"; + E_OPENROUTER_MODEL_FREE["MODEL_FREE_OPENROUTER_SONOMA_DUSK_ALPHA"] = "openrouter/sonoma-dusk-alpha"; + E_OPENROUTER_MODEL_FREE["MODEL_FREE_OPENROUTER_SONOMA_SKY_ALPHA"] = "openrouter/sonoma-sky-alpha"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_DEEPSEEK_DEEPSEEK_CHAT_V3_1_FREE"] = "deepseek/deepseek-chat-v3.1:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_OPENAI_GPT_OSS_120B_FREE"] = "openai/gpt-oss-120b:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_OPENAI_GPT_OSS_20B_FREE"] = "openai/gpt-oss-20b:free"; @@ -169830,7 +156043,6 @@ var E_OPENROUTER_MODEL_FREE; E_OPENROUTER_MODEL_FREE["MODEL_FREE_NVIDIA_LLAMA_3_1_NEMOTRON_ULTRA_253B_V1_FREE"] = "nvidia/llama-3.1-nemotron-ultra-253b-v1:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_META_LLAMA_LLAMA_4_MAVERICK_FREE"] = "meta-llama/llama-4-maverick:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_META_LLAMA_LLAMA_4_SCOUT_FREE"] = "meta-llama/llama-4-scout:free"; - E_OPENROUTER_MODEL_FREE["MODEL_FREE_GOOGLE_GEMINI_2_5_PRO_EXP_03_25"] = "google/gemini-2.5-pro-exp-03-25"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_QWEN_QWEN2_5_VL_32B_INSTRUCT_FREE"] = "qwen/qwen2.5-vl-32b-instruct:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_DEEPSEEK_DEEPSEEK_CHAT_V3_0324_FREE"] = "deepseek/deepseek-chat-v3-0324:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_MISTRALAI_MISTRAL_SMALL_3_1_24B_INSTRUCT_FREE"] = "mistralai/mistral-small-3.1-24b-instruct:free"; @@ -169857,7 +156069,7 @@ var E_OPENROUTER_MODEL_FREE; E_OPENROUTER_MODEL_FREE["MODEL_FREE_GOOGLE_GEMMA_2_9B_IT_FREE"] = "google/gemma-2-9b-it:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_MISTRALAI_MISTRAL_7B_INSTRUCT_FREE"] = "mistralai/mistral-7b-instruct:free"; })(E_OPENROUTER_MODEL_FREE || (E_OPENROUTER_MODEL_FREE = {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GLENBQUE7SUFDMUYscUhBQTBGLENBQUE7SUFDMUYseUdBQThFLENBQUE7SUFDOUUseUhBQThGLENBQUE7SUFDOUYsaUdBQXNFLENBQUE7SUFDdEUsNkZBQWtFLENBQUE7SUFDbEUsK0dBQW9GLENBQUE7QUFDdEYsQ0FBQyxFQTVEVyx1QkFBdUIsS0FBdkIsdUJBQXVCLFFBNERsQyJ9 ;// ./dist-in/index.js @@ -170239,7 +156451,7 @@ function listModelsAsStrings(models) { /***/ }), -/***/ 49315: +/***/ 3043: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -188070,1055 +174282,6 @@ const search_tools = (target, options) => { ]; }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VhcmNoLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi90b29scy9zZWFyY2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLDJCQUEyQixDQUFBO0FBQ25ELE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQTtBQUNsRCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZ0JBQWdCLENBQUE7QUFHM0MsTUFBTSxDQUFDLE1BQU0sS0FBSyxHQUFHLENBQUMsTUFBYyxFQUFFLE9BQWtCLEVBQWMsRUFBRTtJQUNwRSxNQUFNLE1BQU0sR0FBRyxVQUFVLENBQUMsUUFBUSxFQUFFLE9BQU8sQ0FBQyxDQUFBO0lBQzVDLE9BQU87UUFDSDtZQUNJLElBQUksRUFBRSxVQUFVO1lBQ2hCLFFBQVEsRUFBRTtnQkFDTixJQUFJLEVBQUUsUUFBUTtnQkFDZCxXQUFXLEVBQUUscUNBQXFDO2dCQUNsRCxVQUFVLEVBQUU7b0JBQ1IsSUFBSSxFQUFFLFFBQVE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sSUFBSSxDQUFDLE9BQU87d0JBQ3JCLEdBQUcsSUFBSTtxQkFDVixDQUFDLENBQUMsSUFBSSxFQUFFLENBQUE7b0JBQ1QsT0FBTyxJQUFJLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQyxDQUFBO2dCQUNsQyxDQUFDO2dCQUNELEtBQUssRUFBRSxJQUFJLENBQUMsS0FBSzthQUNwQjtTQUN5QjtLQUNqQyxDQUFBO0FBQ0wsQ0FBQyxDQUFDIn0= -;// external "require('puppeteer')" -const external_require_puppeteer_namespaceObject = require('puppeteer'); -;// ../ai-tools/node_modules/turndown/lib/turndown.es.js -function extend (destination) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (source.hasOwnProperty(key)) destination[key] = source[key]; - } - } - return destination -} - -function repeat (character, count) { - return Array(count + 1).join(character) -} - -function trimLeadingNewlines (string) { - return string.replace(/^\n*/, '') -} - -function trimTrailingNewlines (string) { - // avoid match-at-end regexp bottleneck, see #370 - var indexEnd = string.length; - while (indexEnd > 0 && string[indexEnd - 1] === '\n') indexEnd--; - return string.substring(0, indexEnd) -} - -var blockElements = [ - 'ADDRESS', 'ARTICLE', 'ASIDE', 'AUDIO', 'BLOCKQUOTE', 'BODY', 'CANVAS', - 'CENTER', 'DD', 'DIR', 'DIV', 'DL', 'DT', 'FIELDSET', 'FIGCAPTION', 'FIGURE', - 'FOOTER', 'FORM', 'FRAMESET', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HEADER', - 'HGROUP', 'HR', 'HTML', 'ISINDEX', 'LI', 'MAIN', 'MENU', 'NAV', 'NOFRAMES', - 'NOSCRIPT', 'OL', 'OUTPUT', 'P', 'PRE', 'SECTION', 'TABLE', 'TBODY', 'TD', - 'TFOOT', 'TH', 'THEAD', 'TR', 'UL' -]; - -function isBlock (node) { - return is(node, blockElements) -} - -var voidElements = [ - 'AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', - 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR' -]; - -function isVoid (node) { - return is(node, voidElements) -} - -function hasVoid (node) { - return has(node, voidElements) -} - -var meaningfulWhenBlankElements = [ - 'A', 'TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TH', 'TD', 'IFRAME', 'SCRIPT', - 'AUDIO', 'VIDEO' -]; - -function isMeaningfulWhenBlank (node) { - return is(node, meaningfulWhenBlankElements) -} - -function hasMeaningfulWhenBlank (node) { - return has(node, meaningfulWhenBlankElements) -} - -function is (node, tagNames) { - return tagNames.indexOf(node.nodeName) >= 0 -} - -function has (node, tagNames) { - return ( - node.getElementsByTagName && - tagNames.some(function (tagName) { - return node.getElementsByTagName(tagName).length - }) - ) -} - -var rules = {}; - -rules.paragraph = { - filter: 'p', - - replacement: function (content) { - return '\n\n' + content + '\n\n' - } -}; - -rules.lineBreak = { - filter: 'br', - - replacement: function (content, node, options) { - return options.br + '\n' - } -}; - -rules.heading = { - filter: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'], - - replacement: function (content, node, options) { - var hLevel = Number(node.nodeName.charAt(1)); - - if (options.headingStyle === 'setext' && hLevel < 3) { - var underline = repeat((hLevel === 1 ? '=' : '-'), content.length); - return ( - '\n\n' + content + '\n' + underline + '\n\n' - ) - } else { - return '\n\n' + repeat('#', hLevel) + ' ' + content + '\n\n' - } - } -}; - -rules.blockquote = { - filter: 'blockquote', - - replacement: function (content) { - content = content.replace(/^\n+|\n+$/g, ''); - content = content.replace(/^/gm, '> '); - return '\n\n' + content + '\n\n' - } -}; - -rules.list = { - filter: ['ul', 'ol'], - - replacement: function (content, node) { - var parent = node.parentNode; - if (parent.nodeName === 'LI' && parent.lastElementChild === node) { - return '\n' + content - } else { - return '\n\n' + content + '\n\n' - } - } -}; - -rules.listItem = { - filter: 'li', - - replacement: function (content, node, options) { - content = content - .replace(/^\n+/, '') // remove leading newlines - .replace(/\n+$/, '\n') // replace trailing newlines with just a single one - .replace(/\n/gm, '\n '); // indent - var prefix = options.bulletListMarker + ' '; - var parent = node.parentNode; - if (parent.nodeName === 'OL') { - var start = parent.getAttribute('start'); - var index = Array.prototype.indexOf.call(parent.children, node); - prefix = (start ? Number(start) + index : index + 1) + '. '; - } - return ( - prefix + content + (node.nextSibling && !/\n$/.test(content) ? '\n' : '') - ) - } -}; - -rules.indentedCodeBlock = { - filter: function (node, options) { - return ( - options.codeBlockStyle === 'indented' && - node.nodeName === 'PRE' && - node.firstChild && - node.firstChild.nodeName === 'CODE' - ) - }, - - replacement: function (content, node, options) { - return ( - '\n\n ' + - node.firstChild.textContent.replace(/\n/g, '\n ') + - '\n\n' - ) - } -}; - -rules.fencedCodeBlock = { - filter: function (node, options) { - return ( - options.codeBlockStyle === 'fenced' && - node.nodeName === 'PRE' && - node.firstChild && - node.firstChild.nodeName === 'CODE' - ) - }, - - replacement: function (content, node, options) { - var className = node.firstChild.getAttribute('class') || ''; - var language = (className.match(/language-(\S+)/) || [null, ''])[1]; - var code = node.firstChild.textContent; - - var fenceChar = options.fence.charAt(0); - var fenceSize = 3; - var fenceInCodeRegex = new RegExp('^' + fenceChar + '{3,}', 'gm'); - - var match; - while ((match = fenceInCodeRegex.exec(code))) { - if (match[0].length >= fenceSize) { - fenceSize = match[0].length + 1; - } - } - - var fence = repeat(fenceChar, fenceSize); - - return ( - '\n\n' + fence + language + '\n' + - code.replace(/\n$/, '') + - '\n' + fence + '\n\n' - ) - } -}; - -rules.horizontalRule = { - filter: 'hr', - - replacement: function (content, node, options) { - return '\n\n' + options.hr + '\n\n' - } -}; - -rules.inlineLink = { - filter: function (node, options) { - return ( - options.linkStyle === 'inlined' && - node.nodeName === 'A' && - node.getAttribute('href') - ) - }, - - replacement: function (content, node) { - var href = node.getAttribute('href'); - if (href) href = href.replace(/([()])/g, '\\$1'); - var title = cleanAttribute(node.getAttribute('title')); - if (title) title = ' "' + title.replace(/"/g, '\\"') + '"'; - return '[' + content + '](' + href + title + ')' - } -}; - -rules.referenceLink = { - filter: function (node, options) { - return ( - options.linkStyle === 'referenced' && - node.nodeName === 'A' && - node.getAttribute('href') - ) - }, - - replacement: function (content, node, options) { - var href = node.getAttribute('href'); - var title = cleanAttribute(node.getAttribute('title')); - if (title) title = ' "' + title + '"'; - var replacement; - var reference; - - switch (options.linkReferenceStyle) { - case 'collapsed': - replacement = '[' + content + '][]'; - reference = '[' + content + ']: ' + href + title; - break - case 'shortcut': - replacement = '[' + content + ']'; - reference = '[' + content + ']: ' + href + title; - break - default: - var id = this.references.length + 1; - replacement = '[' + content + '][' + id + ']'; - reference = '[' + id + ']: ' + href + title; - } - - this.references.push(reference); - return replacement - }, - - references: [], - - append: function (options) { - var references = ''; - if (this.references.length) { - references = '\n\n' + this.references.join('\n') + '\n\n'; - this.references = []; // Reset references - } - return references - } -}; - -rules.emphasis = { - filter: ['em', 'i'], - - replacement: function (content, node, options) { - if (!content.trim()) return '' - return options.emDelimiter + content + options.emDelimiter - } -}; - -rules.strong = { - filter: ['strong', 'b'], - - replacement: function (content, node, options) { - if (!content.trim()) return '' - return options.strongDelimiter + content + options.strongDelimiter - } -}; - -rules.code = { - filter: function (node) { - var hasSiblings = node.previousSibling || node.nextSibling; - var isCodeBlock = node.parentNode.nodeName === 'PRE' && !hasSiblings; - - return node.nodeName === 'CODE' && !isCodeBlock - }, - - replacement: function (content) { - if (!content) return '' - content = content.replace(/\r?\n|\r/g, ' '); - - var extraSpace = /^`|^ .*?[^ ].* $|`$/.test(content) ? ' ' : ''; - var delimiter = '`'; - var matches = content.match(/`+/gm) || []; - while (matches.indexOf(delimiter) !== -1) delimiter = delimiter + '`'; - - return delimiter + extraSpace + content + extraSpace + delimiter - } -}; - -rules.image = { - filter: 'img', - - replacement: function (content, node) { - var alt = cleanAttribute(node.getAttribute('alt')); - var src = node.getAttribute('src') || ''; - var title = cleanAttribute(node.getAttribute('title')); - var titlePart = title ? ' "' + title + '"' : ''; - return src ? '![' + alt + ']' + '(' + src + titlePart + ')' : '' - } -}; - -function cleanAttribute (attribute) { - return attribute ? attribute.replace(/(\n+\s*)+/g, '\n') : '' -} - -/** - * Manages a collection of rules used to convert HTML to Markdown - */ - -function Rules (options) { - this.options = options; - this._keep = []; - this._remove = []; - - this.blankRule = { - replacement: options.blankReplacement - }; - - this.keepReplacement = options.keepReplacement; - - this.defaultRule = { - replacement: options.defaultReplacement - }; - - this.array = []; - for (var key in options.rules) this.array.push(options.rules[key]); -} - -Rules.prototype = { - add: function (key, rule) { - this.array.unshift(rule); - }, - - keep: function (filter) { - this._keep.unshift({ - filter: filter, - replacement: this.keepReplacement - }); - }, - - remove: function (filter) { - this._remove.unshift({ - filter: filter, - replacement: function () { - return '' - } - }); - }, - - forNode: function (node) { - if (node.isBlank) return this.blankRule - var rule; - - if ((rule = findRule(this.array, node, this.options))) return rule - if ((rule = findRule(this._keep, node, this.options))) return rule - if ((rule = findRule(this._remove, node, this.options))) return rule - - return this.defaultRule - }, - - forEach: function (fn) { - for (var i = 0; i < this.array.length; i++) fn(this.array[i], i); - } -}; - -function findRule (rules, node, options) { - for (var i = 0; i < rules.length; i++) { - var rule = rules[i]; - if (filterValue(rule, node, options)) return rule - } - return void 0 -} - -function filterValue (rule, node, options) { - var filter = rule.filter; - if (typeof filter === 'string') { - if (filter === node.nodeName.toLowerCase()) return true - } else if (Array.isArray(filter)) { - if (filter.indexOf(node.nodeName.toLowerCase()) > -1) return true - } else if (typeof filter === 'function') { - if (filter.call(rule, node, options)) return true - } else { - throw new TypeError('`filter` needs to be a string, array, or function') - } -} - -/** - * The collapseWhitespace function is adapted from collapse-whitespace - * by Luc Thevenard. - * - * The MIT License (MIT) - * - * Copyright (c) 2014 Luc Thevenard - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * collapseWhitespace(options) removes extraneous whitespace from an the given element. - * - * @param {Object} options - */ -function collapseWhitespace (options) { - var element = options.element; - var isBlock = options.isBlock; - var isVoid = options.isVoid; - var isPre = options.isPre || function (node) { - return node.nodeName === 'PRE' - }; - - if (!element.firstChild || isPre(element)) return - - var prevText = null; - var keepLeadingWs = false; - - var prev = null; - var node = turndown_es_next(prev, element, isPre); - - while (node !== element) { - if (node.nodeType === 3 || node.nodeType === 4) { // Node.TEXT_NODE or Node.CDATA_SECTION_NODE - var text = node.data.replace(/[ \r\n\t]+/g, ' '); - - if ((!prevText || / $/.test(prevText.data)) && - !keepLeadingWs && text[0] === ' ') { - text = text.substr(1); - } - - // `text` might be empty at this point. - if (!text) { - node = turndown_es_remove(node); - continue - } - - node.data = text; - - prevText = node; - } else if (node.nodeType === 1) { // Node.ELEMENT_NODE - if (isBlock(node) || node.nodeName === 'BR') { - if (prevText) { - prevText.data = prevText.data.replace(/ $/, ''); - } - - prevText = null; - keepLeadingWs = false; - } else if (isVoid(node) || isPre(node)) { - // Avoid trimming space around non-block, non-BR void elements and inline PRE. - prevText = null; - keepLeadingWs = true; - } else if (prevText) { - // Drop protection if set previously. - keepLeadingWs = false; - } - } else { - node = turndown_es_remove(node); - continue - } - - var nextNode = turndown_es_next(prev, node, isPre); - prev = node; - node = nextNode; - } - - if (prevText) { - prevText.data = prevText.data.replace(/ $/, ''); - if (!prevText.data) { - turndown_es_remove(prevText); - } - } -} - -/** - * remove(node) removes the given node from the DOM and returns the - * next node in the sequence. - * - * @param {Node} node - * @return {Node} node - */ -function turndown_es_remove (node) { - var next = node.nextSibling || node.parentNode; - - node.parentNode.removeChild(node); - - return next -} - -/** - * next(prev, current, isPre) returns the next node in the sequence, given the - * current and previous nodes. - * - * @param {Node} prev - * @param {Node} current - * @param {Function} isPre - * @return {Node} - */ -function turndown_es_next (prev, current, isPre) { - if ((prev && prev.parentNode === current) || isPre(current)) { - return current.nextSibling || current.parentNode - } - - return current.firstChild || current.nextSibling || current.parentNode -} - -/* - * Set up window for Node.js - */ - -var root = (typeof window !== 'undefined' ? window : {}); - -/* - * Parsing HTML strings - */ - -function canParseHTMLNatively () { - var Parser = root.DOMParser; - var canParse = false; - - // Adapted from https://gist.github.com/1129031 - // Firefox/Opera/IE throw errors on unsupported types - try { - // WebKit returns null on unsupported types - if (new Parser().parseFromString('', 'text/html')) { - canParse = true; - } - } catch (e) {} - - return canParse -} - -function createHTMLParser () { - var Parser = function () {}; - - { - var domino = __webpack_require__(31993); - Parser.prototype.parseFromString = function (string) { - return domino.createDocument(string) - }; - } - return Parser -} - -var HTMLParser = canParseHTMLNatively() ? root.DOMParser : createHTMLParser(); - -function RootNode (input, options) { - var root; - if (typeof input === 'string') { - var doc = htmlParser().parseFromString( - // DOM parsers arrange elements in the and . - // Wrapping in a custom element ensures elements are reliably arranged in - // a single element. - '' + input + '', - 'text/html' - ); - root = doc.getElementById('turndown-root'); - } else { - root = input.cloneNode(true); - } - collapseWhitespace({ - element: root, - isBlock: isBlock, - isVoid: isVoid, - isPre: options.preformattedCode ? isPreOrCode : null - }); - - return root -} - -var _htmlParser; -function htmlParser () { - _htmlParser = _htmlParser || new HTMLParser(); - return _htmlParser -} - -function isPreOrCode (node) { - return node.nodeName === 'PRE' || node.nodeName === 'CODE' -} - -function Node (node, options) { - node.isBlock = isBlock(node); - node.isCode = node.nodeName === 'CODE' || node.parentNode.isCode; - node.isBlank = isBlank(node); - node.flankingWhitespace = flankingWhitespace(node, options); - return node -} - -function isBlank (node) { - return ( - !isVoid(node) && - !isMeaningfulWhenBlank(node) && - /^\s*$/i.test(node.textContent) && - !hasVoid(node) && - !hasMeaningfulWhenBlank(node) - ) -} - -function flankingWhitespace (node, options) { - if (node.isBlock || (options.preformattedCode && node.isCode)) { - return { leading: '', trailing: '' } - } - - var edges = edgeWhitespace(node.textContent); - - // abandon leading ASCII WS if left-flanked by ASCII WS - if (edges.leadingAscii && isFlankedByWhitespace('left', node, options)) { - edges.leading = edges.leadingNonAscii; - } - - // abandon trailing ASCII WS if right-flanked by ASCII WS - if (edges.trailingAscii && isFlankedByWhitespace('right', node, options)) { - edges.trailing = edges.trailingNonAscii; - } - - return { leading: edges.leading, trailing: edges.trailing } -} - -function edgeWhitespace (string) { - var m = string.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/); - return { - leading: m[1], // whole string for whitespace-only strings - leadingAscii: m[2], - leadingNonAscii: m[3], - trailing: m[4], // empty for whitespace-only strings - trailingNonAscii: m[5], - trailingAscii: m[6] - } -} - -function isFlankedByWhitespace (side, node, options) { - var sibling; - var regExp; - var isFlanked; - - if (side === 'left') { - sibling = node.previousSibling; - regExp = / $/; - } else { - sibling = node.nextSibling; - regExp = /^ /; - } - - if (sibling) { - if (sibling.nodeType === 3) { - isFlanked = regExp.test(sibling.nodeValue); - } else if (options.preformattedCode && sibling.nodeName === 'CODE') { - isFlanked = false; - } else if (sibling.nodeType === 1 && !isBlock(sibling)) { - isFlanked = regExp.test(sibling.textContent); - } - } - return isFlanked -} - -var reduce = Array.prototype.reduce; -var escapes = [ - [/\\/g, '\\\\'], - [/\*/g, '\\*'], - [/^-/g, '\\-'], - [/^\+ /g, '\\+ '], - [/^(=+)/g, '\\$1'], - [/^(#{1,6}) /g, '\\$1 '], - [/`/g, '\\`'], - [/^~~~/g, '\\~~~'], - [/\[/g, '\\['], - [/\]/g, '\\]'], - [/^>/g, '\\>'], - [/_/g, '\\_'], - [/^(\d+)\. /g, '$1\\. '] -]; - -function TurndownService (options) { - if (!(this instanceof TurndownService)) return new TurndownService(options) - - var defaults = { - rules: rules, - headingStyle: 'setext', - hr: '* * *', - bulletListMarker: '*', - codeBlockStyle: 'indented', - fence: '```', - emDelimiter: '_', - strongDelimiter: '**', - linkStyle: 'inlined', - linkReferenceStyle: 'full', - br: ' ', - preformattedCode: false, - blankReplacement: function (content, node) { - return node.isBlock ? '\n\n' : '' - }, - keepReplacement: function (content, node) { - return node.isBlock ? '\n\n' + node.outerHTML + '\n\n' : node.outerHTML - }, - defaultReplacement: function (content, node) { - return node.isBlock ? '\n\n' + content + '\n\n' : content - } - }; - this.options = extend({}, defaults, options); - this.rules = new Rules(this.options); -} - -TurndownService.prototype = { - /** - * The entry point for converting a string or DOM node to Markdown - * @public - * @param {String|HTMLElement} input The string or DOM node to convert - * @returns A Markdown representation of the input - * @type String - */ - - turndown: function (input) { - if (!canConvert(input)) { - throw new TypeError( - input + ' is not a string, or an element/document/fragment node.' - ) - } - - if (input === '') return '' - - var output = turndown_es_process.call(this, new RootNode(input, this.options)); - return postProcess.call(this, output) - }, - - /** - * Add one or more plugins - * @public - * @param {Function|Array} plugin The plugin or array of plugins to add - * @returns The Turndown instance for chaining - * @type Object - */ - - use: function (plugin) { - if (Array.isArray(plugin)) { - for (var i = 0; i < plugin.length; i++) this.use(plugin[i]); - } else if (typeof plugin === 'function') { - plugin(this); - } else { - throw new TypeError('plugin must be a Function or an Array of Functions') - } - return this - }, - - /** - * Adds a rule - * @public - * @param {String} key The unique key of the rule - * @param {Object} rule The rule - * @returns The Turndown instance for chaining - * @type Object - */ - - addRule: function (key, rule) { - this.rules.add(key, rule); - return this - }, - - /** - * Keep a node (as HTML) that matches the filter - * @public - * @param {String|Array|Function} filter The unique key of the rule - * @returns The Turndown instance for chaining - * @type Object - */ - - keep: function (filter) { - this.rules.keep(filter); - return this - }, - - /** - * Remove a node that matches the filter - * @public - * @param {String|Array|Function} filter The unique key of the rule - * @returns The Turndown instance for chaining - * @type Object - */ - - remove: function (filter) { - this.rules.remove(filter); - return this - }, - - /** - * Escapes Markdown syntax - * @public - * @param {String} string The string to escape - * @returns A string with Markdown syntax escaped - * @type String - */ - - escape: function (string) { - return escapes.reduce(function (accumulator, escape) { - return accumulator.replace(escape[0], escape[1]) - }, string) - } -}; - -/** - * Reduces a DOM node down to its Markdown string equivalent - * @private - * @param {HTMLElement} parentNode The node to convert - * @returns A Markdown representation of the node - * @type String - */ - -function turndown_es_process (parentNode) { - var self = this; - return reduce.call(parentNode.childNodes, function (output, node) { - node = new Node(node, self.options); - - var replacement = ''; - if (node.nodeType === 3) { - replacement = node.isCode ? node.nodeValue : self.escape(node.nodeValue); - } else if (node.nodeType === 1) { - replacement = replacementForNode.call(self, node); - } - - return join(output, replacement) - }, '') -} - -/** - * Appends strings as each rule requires and trims the output - * @private - * @param {String} output The conversion output - * @returns A trimmed version of the ouput - * @type String - */ - -function postProcess (output) { - var self = this; - this.rules.forEach(function (rule) { - if (typeof rule.append === 'function') { - output = join(output, rule.append(self.options)); - } - }); - - return output.replace(/^[\t\r\n]+/, '').replace(/[\t\r\n\s]+$/, '') -} - -/** - * Converts an element node to its Markdown equivalent - * @private - * @param {HTMLElement} node The node to convert - * @returns A Markdown representation of the node - * @type String - */ - -function replacementForNode (node) { - var rule = this.rules.forNode(node); - var content = turndown_es_process.call(this, node); - var whitespace = node.flankingWhitespace; - if (whitespace.leading || whitespace.trailing) content = content.trim(); - return ( - whitespace.leading + - rule.replacement(content, node, this.options) + - whitespace.trailing - ) -} - -/** - * Joins replacement to the current output with appropriate number of new lines - * @private - * @param {String} output The current conversion output - * @param {String} replacement The string to append to the output - * @returns Joined output - * @type String - */ - -function join (output, replacement) { - var s1 = trimTrailingNewlines(output); - var s2 = trimLeadingNewlines(replacement); - var nls = Math.max(output.length - s1.length, replacement.length - s2.length); - var separator = '\n\n'.substring(0, nls); - - return s1 + separator + s2 -} - -/** - * Determines whether an input can be converted - * @private - * @param {String|HTMLElement} input Describe this parameter - * @returns Describe what it returns - * @type String|Object|Array|Boolean|Number - */ - -function canConvert (input) { - return ( - input != null && ( - typeof input === 'string' || - (input.nodeType && ( - input.nodeType === 1 || input.nodeType === 9 || input.nodeType === 11 - )) - ) - ) -} - -/* harmony default export */ const turndown_es = (TurndownService); - -;// ../ai-tools/dist/lib/tools/web.js - - - -const turndown = new turndown_es(); -const web_tools = (target, options) => { - const logger = (0,ai_tools_dist/* toolLogger */.bw)('web', options); - return [ - { - type: 'function', - function: { - name: 'browse_page', - description: 'Browse a webpage and return its content as markdown, all links, images and pages main image', - parameters: { - type: 'object', - properties: { - url: { - type: 'string', - description: 'URL of the webpage to browse' - } - }, - required: ['url'] - }, - function: async (params) => { - try { - logger.debug(`Tool::BrowsePage Browsing ${params.url}`); - const browser = await external_require_puppeteer_namespaceObject.launch({ - headless: true, - args: ['--no-sandbox', '--disable-setuid-sandbox'] - }); - try { - const page = await browser.newPage(); - logger.debug(`Tool::Web::BrowsePage Opening page ${params.url}`); - await page.goto(params.url, { - waitUntil: 'networkidle2' - }); - const pageData = await page.evaluate((selector) => { - const elementsToRemove = document.querySelectorAll('script, style, link, meta, noscript, iframe, [style*="display:none"],[style*="display: none"], .hidden'); - elementsToRemove.forEach(el => el.remove()); - const links = Array.from(document.querySelectorAll('a')) - .map(a => ({ - text: a.textContent?.trim() || '', - href: a.href - })) - .filter(link => link.href && link.href.startsWith('http')) - .slice(0, 20); - const images = Array.from(document.querySelectorAll('img')) - .map(img => ({ - src: img.src, - alt: img.alt || '', - width: img.width, - height: img.height - })) - .filter(img => img.src && img.src.startsWith('http')) - .slice(0, 20); - const mainImage = document.querySelector('meta[property="og:image"]')?.getAttribute('content') || - document.querySelector('meta[name="og:image"]')?.getAttribute('content'); - let content; - const body = document.body; - content = body ? body.innerHTML : ''; - return { - content, - links, - images, - ogImage: mainImage - }; - }, null); - const markdown = turndown.turndown(pageData.content); - await browser.close(); - const ret = { - success: true, - markdown: markdown, - links: pageData.links, - images: pageData.images, - mainImage: pageData.ogImage, - url: params.url - }; - return ret; - } - catch (error) { - logger.debug('Error browsing page:', error.message, error); - await browser.close(); - throw error; - } - } - catch (error) { - logger.debug('Error browsing page:', error.message); - return { - success: false, - error: error.message, - url: params.url - }; - } - }, - parse: JSON.parse - } - } - ]; -}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2ViLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi90b29scy93ZWIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0EsT0FBTyxTQUFTLE1BQU0sV0FBVyxDQUFBO0FBQ2pDLE9BQU8sZUFBZSxNQUFNLFVBQVUsQ0FBQTtBQUV0QyxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZ0JBQWdCLENBQUE7QUFHM0MsTUFBTSxRQUFRLEdBQUcsSUFBSSxlQUFlLEVBQUUsQ0FBQTtBQUV0QyxNQUFNLENBQUMsTUFBTSxLQUFLLEdBQUcsQ0FBQyxNQUFjLEVBQUUsT0FBa0IsRUFBYyxFQUFFO0lBQ3BFLE1BQU0sTUFBTSxHQUFHLFVBQVUsQ0FBQyxLQUFLLEVBQUUsT0FBTyxDQUFDLENBQUE7SUFDekMsT0FBTztRQUNIO1lBQ0ksSUFBSSxFQUFFLFVBQVU7WUFDaEIsUUFBUSxFQUFFO2dCQUNOLElBQUksRUFBRSxhQUFhO2dCQUNuQixXQUFXLEVBQUUsNkZBQTZGO2dCQUMxRyxVQUFVLEVBQUU7b0JBQ1IsSUFBSSxFQUFFLFFBQVE7b0JBQ2QsVUFBVSxFQUFFO3dCQUNSLEdBQUcsRUFBRTs0QkFDRCxJQUFJLEVBQUUsUUFBUTs0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BQyxPQUFPLEVBQUUsS0FBSyxDQUFDLENBQUM7NEJBQzNELE1BQU0sT0FBTyxDQUFDLEtBQUssRUFBRSxDQUFBOzRCQUNyQixNQUFNLEtBQUssQ0FBQTt5QkFDZDtxQkFDSjtvQkFBQyxPQUFPLEtBQVUsRUFBRTt3QkFDakIsTUFBTSxDQUFDLEtBQUssQ0FBQyxzQkFBc0IsRUFBRSxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7d0JBQ3BELE9BQU87NEJBQ0gsT0FBTyxFQUFFLEtBQUs7NEJBQ2QsS0FBSyxFQUFFLEtBQUssQ0FBQyxPQUFPOzRCQUNwQixHQUFHLEVBQUUsTUFBTSxDQUFDLEdBQUc7eUJBQ2xCLENBQUM7cUJBQ0w7Z0JBQ0wsQ0FBQztnQkFDRCxLQUFLLEVBQUUsSUFBSSxDQUFDLEtBQUs7YUFDcEI7U0FDeUI7S0FDakMsQ0FBQTtBQUNMLENBQUMsQ0FBQSJ9 // EXTERNAL MODULE: external "buffer" var external_buffer_ = __webpack_require__(20181); ;// ../ai-tools/node_modules/@keyv/serialize/dist/index.js @@ -189379,7 +174542,7 @@ var iterableAdapters = [ "valkey", "etcd" ]; -var dist_Keyv = class extends event_manager_default { +var Keyv = class extends event_manager_default { opts; iterator; hooks = new hooks_manager_default(); @@ -190048,151 +175211,22 @@ var dist_Keyv = class extends event_manager_default { return void 0; } }; -var index_default = dist_Keyv; - - -// EXTERNAL MODULE: external "events" -var external_events_ = __webpack_require__(24434); -// EXTERNAL MODULE: ../ai-tools/node_modules/sqlite3/lib/sqlite3.js -var sqlite3 = __webpack_require__(45430); -;// ../ai-tools/node_modules/@keyv/sqlite/dist/index.js -// src/index.ts - - - - -var dist_toString = (input) => String(input).search(/^[a-zA-Z]+$/) < 0 ? "_" + input : input; -var KeyvSqlite = class extends external_events_ { - ttlSupport; - opts; - namespace; - close; - query; - constructor(keyvOptions) { - super(); - this.ttlSupport = false; - let options = { - dialect: "sqlite", - uri: "sqlite://:memory:" - }; - if (typeof keyvOptions === "string") { - options.uri = keyvOptions; - } else { - options = { - ...options, - ...keyvOptions - }; - } - options.db = options.uri.replace(/^sqlite:\/\//, ""); - options.connect = async () => new Promise((resolve, reject) => { - const database = new sqlite3.Database(options.db, (error) => { - if (error) { - reject(error); - } else { - if (options.busyTimeout) { - database.configure("busyTimeout", options.busyTimeout); - } - resolve(database); - } - }); - }).then((database) => ({ query: (0,external_util_.promisify)(database.all).bind(database), close: (0,external_util_.promisify)(database.close).bind(database) })); - this.opts = { - table: "keyv", - keySize: 255, - ...options - }; - this.opts.table = dist_toString(this.opts.table); - const createTable = `CREATE TABLE IF NOT EXISTS ${this.opts.table}(key VARCHAR(${Number(this.opts.keySize)}) PRIMARY KEY, value TEXT )`; - const connected = this.opts.connect().then(async (database) => database.query(createTable).then(() => database)).catch((error) => this.emit("error", error)); - this.query = async (sqlString, ...parameter) => connected.then(async (database) => database.query(sqlString, ...parameter)); - this.close = async () => connected.then((database) => database.close()); - } - async get(key) { - const select = `SELECT * FROM ${this.opts.table} WHERE key = ?`; - const rows = await this.query(select, key); - const row = rows[0]; - if (row === void 0) { - return void 0; - } - return row.value; - } - async getMany(keys) { - const select = `SELECT * FROM ${this.opts.table} WHERE key IN (SELECT value FROM json_each(?))`; - const rows = await this.query(select, JSON.stringify(keys)); - return keys.map((key) => { - const row = rows.find((row2) => row2.key === key); - return row ? row.value : void 0; - }); - } - async set(key, value) { - const upsert = `INSERT INTO ${this.opts.table} (key, value) - VALUES(?, ?) - ON CONFLICT(key) - DO UPDATE SET value=excluded.value;`; - return this.query(upsert, key, value); - } - async delete(key) { - const select = `SELECT * FROM ${this.opts.table} WHERE key = ?`; - const del = `DELETE FROM ${this.opts.table} WHERE key = ?`; - const rows = await this.query(select, key); - const row = rows[0]; - if (row === void 0) { - return false; - } - await this.query(del, key); - return true; - } - async deleteMany(keys) { - const del = `DELETE FROM ${this.opts.table} WHERE key IN (SELECT value FROM json_each(?))`; - const results = await this.getMany(keys); - if (results.every((x) => x === void 0)) { - return false; - } - await this.query(del, JSON.stringify(keys)); - return true; - } - async clear() { - const del = `DELETE FROM ${this.opts.table} WHERE key LIKE ?`; - await this.query(del, this.namespace ? `${this.namespace}:%` : "%"); - } - async *iterator(namespace) { - const limit = Number.parseInt(this.opts.iterationLimit, 10) || 10; - async function* iterate(offset, options, query) { - const select = `SELECT * FROM ${options.table} WHERE key LIKE ? LIMIT ? OFFSET ?`; - const iterator = await query(select, [`${namespace ? namespace + ":" : ""}%`, limit, offset]); - const entries = [...iterator]; - if (entries.length === 0) { - return; - } - for (const entry of entries) { - offset += 1; - yield [entry.key, entry.value]; - } - yield* iterate(offset, options, query); - } - yield* iterate(0, this.opts, this.query); - } - async has(key) { - const exists = `SELECT EXISTS ( SELECT * FROM ${this.opts.table} WHERE key = ? )`; - const result = await this.query(exists, key); - return Object.values(result[0])[0] === 1; - } - async disconnect() { - await this.close(); - } -}; -var createKeyv = (keyvOptions) => new Keyv({ store: new KeyvSqlite(keyvOptions) }); -var dist_index_default = KeyvSqlite; +var index_default = Keyv; +// EXTERNAL MODULE: ../ai-tools/node_modules/keyv-file/lib/index.js +var keyv_file_lib = __webpack_require__(58538); ;// ../ai-tools/dist/lib/tools/keyv.js const store = (storePath, ns = 'ns-unknown', opts = {}) => { - const keyvSqlite = new dist_index_default(external_path_.resolve((0,dist/* resolve */.hd)(storePath))); - return new index_default({ store: keyvSqlite, ttl: 5000, namespace: ns, ...opts }); + const keyvFile = new keyv_file_lib/* KeyvFile */.Sk({ + filename: external_path_.resolve((0,dist/* resolve */.hd)(storePath)), + writeDelay: 100, // ms + }); + return new index_default({ store: keyvFile, namespace: ns, ...opts }); }; const get = async (key, storePath, ns = 'ns-unknown', opts = {}) => { const keyv = store(storePath, ns, opts); @@ -190202,11 +175236,7 @@ const set = async (key, value, storePath, ns = 'ns-unknown', opts = {}) => { const keyv = store(storePath, ns, opts); return await keyv.set(key, value); }; -const list = async (key, value, storePath, ns = 'ns-unknown', opts = {})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QUFDLENBQUE7SUFDdkMsT0FBTyxNQUFNLElBQUksQ0FBQyxHQUFHLENBQUMsR0FBRyxFQUFFLEtBQUssQ0FBQyxDQUFBO0FBQ3JDLENBQUMsQ0FBQSJ9 ;// ../ai-tools/dist/lib/tools/memory.js @@ -190214,7 +175244,7 @@ const list = async (key, value, storePath, ns = 'ns-unknown', opts = {}) => { // Helper function to get storage path const getStoragePath = (options) => { // For now, use default path. Later this can be configured via options - return external_path_.join(process.cwd(), 'memory.sqlite'); + return external_path_.join(process.cwd(), 'memory.json'); }; // Default collection name when none provided const DEFAULT_COLLECTION = 'no-collection'; @@ -190561,7 +175591,7 @@ Returns: { } ]; }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVtb3J5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi90b29scy9tZW1vcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLElBQUksTUFBTSxNQUFNLENBQUE7QUFJNUIsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGdCQUFnQixDQUFBO0FBRzNDLE9BQU8sRUFBRSxLQUFLLEVBQUUsR0FBRyxFQUFFLEdBQUcsRUFBRSxNQUFNLFdBQVcsQ0FBQTtBQUUzQyxzQ0FBc0M7QUFDdEMsTUFBTSxjQUFjLEdBQUcsQ0FBQyxPQUFrQixFQUFVLEVBQUU7SUFDbEQsc0VBQXNFO0lBQ3RFLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLEVBQUUsZUFBZSxDQUFDLENBQUM7QUFDckQsQ0FBQyxDQUFDO0FBRUYsNkNBQTZDO0FBQzdDLE1BQU0sa0JBQWtCLEdBQUcsZUFBZSxDQUFDO0FBZTNDLG1EQUFtRDtBQUNuRCxNQUFNLHNCQUFzQixHQUFHLENBQUMsS0FBYSxFQ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'./web.js' - -//import { tools as emailTools } from './email' +// import { tools as emailTools } from './email' const tools_tools = { fs: tools, npm: npm_tools, @@ -190581,11 +175611,11 @@ const tools_tools = { interact: interact_tools, user: user_tools, search: search_tools, - web: web_tools, - memory: memory_tools, + // web: webTools, + memory: memory_tools // email: emailTools }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL3Rvb2xzL3Rvb2xzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLElBQUksT0FBTyxFQUFFLE1BQU0sU0FBUyxDQUFBO0FBQzFDLE9BQU8sRUFBRSxLQUFLLElBQUksUUFBUSxFQUFFLE1BQU0sVUFBVSxDQUFBO0FBQzVDLE9BQU8sRUFBRSxLQUFLLElBQUksUUFBUSxFQUFFLE1BQU0sVUFBVSxDQUFBO0FBQzVDLE9BQU8sRUFBRSxLQUFLLElBQUksYUFBYSxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ3RELE9BQU8sRUFBRSxLQUFLLElBQUksYUFBYSxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ3RELE9BQU8sRUFBRSxLQUFLLElBQUksU0FBUyxFQUFFLE1BQU0sV0FBVyxDQUFBO0FBQzlDLE9BQU8sRUFBRSxLQUFLLElBQUksTUFBTSxFQUFFLE1BQU0sYUFBYSxDQUFBO0FBQzdDLE9BQU8sRUFBRSxLQUFLLElBQUksUUFBUSxFQUFFLE1BQU0sVUFBVSxDQUFBO0FBQzVDLE9BQU8sRUFBRSxLQUFLLElBQUksV0FBVyxFQUFFLE1BQU0sYUFBYSxDQUFBO0FBQ2xELCtDQUErQztBQUUvQyxNQUFNLENBQUMsTUFBTSxLQUFLLEdBQUc7SUFDakIsRUFBRSxFQUFFLE9BQU87SUFDWCxHQUFHLEVBQUUsUUFBUT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xPQUFPO0lBQ1gsR0FBRyxFQUFFLFFBQVE7SUFDYixHQUFHLEVBQUUsUUFBUTtJQUNiLFFBQVEsRUFBRSxhQUFhO0lBQ3ZCLFFBQVEsRUFBRSxhQUFhO0lBQ3ZCLElBQUksRUFBRSxTQUFTO0lBQ2YsTUFBTSxFQUFFLE1BQU07SUFDZCxpQkFBaUI7SUFDakIsTUFBTSxFQUFFLFdBQVc7SUFDbkIsb0JBQW9CO0NBQ3ZCLENBQUEifQ== // EXTERNAL MODULE: ./dist-in/index.js + 3 modules var dist_in = __webpack_require__(88022); ;// ../core/dist/aspects_simple.js @@ -190962,7 +175992,7 @@ const variables = (options) => { /* harmony import */ var json_schema_to_zod__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(47571); /* harmony import */ var _filters_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(98152); /* harmony import */ var _models_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(45000); -/* harmony import */ var _tools_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(49315); +/* harmony import */ var _tools_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(3043); /* harmony import */ var _models_openrouter_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(2761); /* harmony import */ var _models_openai_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(53382); @@ -230226,8 +215256,293 @@ const main_fetch = async () => { //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmV0Y2guanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29tbWFuZHMvZmV0Y2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxJQUFJLE1BQU0sV0FBVyxDQUFBO0FBQzVCLE9BQU8sRUFBRSxJQUFJLElBQUksS0FBSyxFQUFFLE1BQU0sb0JBQW9CLENBQUE7QUFDbEQsT0FBTyxFQUFFLE1BQU0s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DTCxFQUFFLEVBQUUsS0FBSyxDQUFDLEVBQUU7WUFDWixJQUFJLEVBQUUsS0FBSyxDQUFDLElBQUk7WUFDaEIsT0FBTyxFQUFFLEtBQUssQ0FBQyxPQUFPO1lBQ3RCLE9BQU8sRUFBRSxLQUFLLENBQUMsT0FBTztZQUN0QixPQUFPLEVBQUUsS0FBSyxDQUFDLE9BQU87U0FDdkIsQ0FBQTtJQUNILENBQUMsQ0FBQyxDQUFBO0lBQ0YsTUFBTSxvQkFBb0IsR0FBRyxJQUFJLENBQUMsT0FBTyxDQUFDLFdBQVcsRUFBRSxFQUFFLGlCQUFpQixDQUFDLENBQUE7SUFDM0UsS0FBSyxDQUFDLG9CQUFvQixFQUFFLGdCQUFnQixDQUFDLENBQUE7SUFDN0MsTUFBTSxDQUFDLElBQUksQ0FBQyxXQUFXLGdCQUFnQixDQUFDLE1BQU0sMEJBQTBCLG9CQUFvQixFQUFFLENBQUMsQ0FBQTtBQUNqRyxDQUFDLENBQUEifQ== // EXTERNAL MODULE: ./dist-in/commands/run.js + 21 modules var main_run = __webpack_require__(98177); +// EXTERNAL MODULE: external "node:fs" +var main_external_node_fs_ = __webpack_require__(73024); // EXTERNAL MODULE: ../core/dist/primitives.js var main_primitives = __webpack_require__(78275); +;// ./node_modules/p-map/index.js +async function main_pMap( + iterable, + mapper, + { + concurrency = Number.POSITIVE_INFINITY, + stopOnError = true, + signal, + } = {}, +) { + return new Promise((resolve_, reject_) => { + if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) { + throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`); + } + + if (typeof mapper !== 'function') { + throw new TypeError('Mapper function is required'); + } + + if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) { + throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`); + } + + const result = []; + const errors = []; + const skippedIndexesMap = new Map(); + let isRejected = false; + let isResolved = false; + let isIterableDone = false; + let resolvingCount = 0; + let currentIndex = 0; + const iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator](); + + const signalListener = () => { + reject(signal.reason); + }; + + const cleanup = () => { + signal?.removeEventListener('abort', signalListener); + }; + + const resolve = value => { + resolve_(value); + cleanup(); + }; + + const reject = reason => { + isRejected = true; + isResolved = true; + reject_(reason); + cleanup(); + }; + + if (signal) { + if (signal.aborted) { + reject(signal.reason); + } + + signal.addEventListener('abort', signalListener, {once: true}); + } + + const next = async () => { + if (isResolved) { + return; + } + + const nextItem = await iterator.next(); + + const index = currentIndex; + currentIndex++; + + // Note: `iterator.next()` can be called many times in parallel. + // This can cause multiple calls to this `next()` function to + // receive a `nextItem` with `done === true`. + // The shutdown logic that rejects/resolves must be protected + // so it runs only one time as the `skippedIndex` logic is + // non-idempotent. + if (nextItem.done) { + isIterableDone = true; + + if (resolvingCount === 0 && !isResolved) { + if (!stopOnError && errors.length > 0) { + reject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message + return; + } + + isResolved = true; + + if (skippedIndexesMap.size === 0) { + resolve(result); + return; + } + + const pureResult = []; + + // Support multiple `pMapSkip`'s. + for (const [index, value] of result.entries()) { + if (skippedIndexesMap.get(index) === main_pMapSkip) { + continue; + } + + pureResult.push(value); + } + + resolve(pureResult); + } + + return; + } + + resolvingCount++; + + // Intentionally detached + (async () => { + try { + const element = await nextItem.value; + + if (isResolved) { + return; + } + + const value = await mapper(element, index); + + // Use Map to stage the index of the element. + if (value === main_pMapSkip) { + skippedIndexesMap.set(index, value); + } + + result[index] = value; + + resolvingCount--; + await next(); + } catch (error) { + if (stopOnError) { + reject(error); + } else { + errors.push(error); + resolvingCount--; + + // In that case we can't really continue regardless of `stopOnError` state + // since an iterable is likely to continue throwing after it throws once. + // If we continue calling `next()` indefinitely we will likely end up + // in an infinite loop of failed iteration. + try { + await next(); + } catch (error) { + reject(error); + } + } + } + })(); + }; + + // Create the concurrent runners in a detached (non-awaited) + // promise. We need this so we can await the `next()` calls + // to stop creating runners before hitting the concurrency limit + // if the iterable has already been marked as done. + // NOTE: We *must* do this for async iterators otherwise we'll spin up + // infinite `next()` calls by default and never start the event loop. + (async () => { + for (let index = 0; index < concurrency; index++) { + try { + // eslint-disable-next-line no-await-in-loop + await next(); + } catch (error) { + reject(error); + break; + } + + if (isIterableDone || isRejected) { + break; + } + } + })(); + }); +} + +function main_pMapIterable( + iterable, + mapper, + { + concurrency = Number.POSITIVE_INFINITY, + backpressure = concurrency, + } = {}, +) { + if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) { + throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`); + } + + if (typeof mapper !== 'function') { + throw new TypeError('Mapper function is required'); + } + + if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) { + throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`); + } + + if (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) { + throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${concurrency}) and up or \`Infinity\`, got \`${backpressure}\` (${typeof backpressure})`); + } + + return { + async * [Symbol.asyncIterator]() { + const iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator](); + + const promises = []; + let runningMappersCount = 0; + let isDone = false; + let index = 0; + + function trySpawn() { + if (isDone || !(runningMappersCount < concurrency && promises.length < backpressure)) { + return; + } + + const promise = (async () => { + const {done, value} = await iterator.next(); + + if (done) { + return {done: true}; + } + + runningMappersCount++; + + // Spawn if still below concurrency and backpressure limit + trySpawn(); + + try { + const returnValue = await mapper(await value, index++); + + runningMappersCount--; + + if (returnValue === main_pMapSkip) { + const index = promises.indexOf(promise); + + if (index > 0) { + promises.splice(index, 1); + } + } + + // Spawn if still below backpressure limit and just dropped below concurrency limit + trySpawn(); + + return {done: false, value: returnValue}; + } catch (error) { + isDone = true; + return {error}; + } + })(); + + promises.push(promise); + } + + trySpawn(); + + while (promises.length > 0) { + const {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop + + promises.shift(); + + if (error) { + throw error; + } + + if (done) { + return; + } + + // Spawn if just dropped below backpressure limit and below the concurrency limit + trySpawn(); + + if (value === main_pMapSkip) { + continue; + } + + yield value; + } + }, + }; +} + +const main_pMapSkip = Symbol('skip'); + // EXTERNAL MODULE: ./node_modules/glob/dist/esm/index.js + 15 modules var main_glob_dist_esm = __webpack_require__(59795); // EXTERNAL MODULE: ./node_modules/openai/index.mjs + 92 modules @@ -230239,7 +215554,6 @@ var main_dist_in_client = __webpack_require__(48215); - const main_createBuffer = (path) => { try { const buffer = main_external_fs_.readFileSync(path); @@ -230254,21 +215568,21 @@ const main_transcribe = async (options) => { const client = (0,main_dist_in_client/* createClient */.U)(options); if (!client) { options.logger.error('Failed to create client'); - return; + return ''; } if (!options.include || options.include.length === 0) { options.logger.error('No source file provided via --include'); - return; + return ''; } const sourceFile = options.include[0]; if (!(0,main_exists/* sync */.OH)(sourceFile)) { options.logger.error('Source file does not exist', sourceFile); - return; + return ''; } const file = await (0,main_node_modules_openai/* toFile */.eZ)(main_createBuffer(sourceFile), 'audio.mp3', { type: 'audio/mpeg' }); if (!file) { options.logger.error('Error converting source to file'); - return; + return ''; } const completion = await client.audio.transcriptions.create({ model: 'whisper-1', @@ -230277,19 +215591,12 @@ const main_transcribe = async (options) => { }); if (!completion) { options.logger.error('OpenAI response is empty'); - return; + return ''; } const text_content = completion.text || ''; - if (options.dst) { - (0,main_write/* sync */.OH)(options.dst, text_content); - } - else { - process.stdout.write(text_content); - } - // options.logger.debug('OpenAI Transcribe response:', completion) - return completion; + return text_content; }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJza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FDO0lBQ3pGLElBQUksQ0FBQyxJQUFJLEVBQUUsQ0FBQztRQUNSLE9BQU8sQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLGlDQUFpQyxDQUFDLENBQUE7UUFDdkQsT0FBTyxFQUFFLENBQUM7SUFDZCxDQUFDO0lBRUQsTUFBTSxVQUFVLEdBQVEsTUFBTSxNQUFNLENBQUMsS0FBSyxDQUFDLGNBQWMsQ0FBQyxNQUFNLENBQUM7UUFDN0QsS0FBSyxFQUFFLFdBQVc7UUFDbEIsSUFBSSxFQUFFLElBQUk7UUFDVixlQUFlLEVBQUcsT0FBZSxDQUFDLGVBQWUsSUFBSSxjQUFjO0tBQ3RFLENBQUMsQ0FBQTtJQUVGLElBQUksQ0FBQyxVQUFVLEVBQUUsQ0FBQztRQUNkLE9BQU8sQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLDBCQUEwQixDQUFDLENBQUE7UUFDaEQsT0FBTyxFQUFFLENBQUM7SUFDZCxDQUFDO0lBRUQsTUFBTSxZQUFZLEdBQUcsVUFBVSxDQUFDLElBQUksSUFBSSxFQUFFLENBQUE7SUFDMUMsT0FBTyxZQUFZLENBQUE7QUFDdkIsQ0FBQyxDQUFBIn0= // EXTERNAL MODULE: ./dist-in/glob.js var main_glob = __webpack_require__(89325); // EXTERNAL MODULE: ./dist-in/variables.js @@ -230306,6 +215613,24 @@ var main_variables = __webpack_require__(78618); + +const main_default_sort = (files) => { + const getSortableParts = (filename) => { + const baseName = main_external_node_path_.parse(filename).name; + const match = baseName.match(/^(\d+)_?(.*)$/); // Match leading numbers + const numPart = match ? parseInt(match[1], 10) : NaN; + const textPart = match ? match[2] : baseName; // Extract text part + return { numPart, textPart }; + }; + return files.sort((a, b) => { + const { numPart: aNum, textPart: aText } = getSortableParts(a); + const { numPart: bNum, textPart: bText } = getSortableParts(b); + if (!isNaN(aNum) && !isNaN(bNum)) { + return aNum - bNum || aText.localeCompare(bText, undefined, { numeric: true, sensitivity: 'base' }); + } + return aText.localeCompare(bText, undefined, { numeric: true, sensitivity: 'base' }); + }); +}; const main_TranscribeOptionsSchema = () => { return (0,main_zod_schema/* OptionsSchema */.IO)().pick({ include: true, @@ -230379,7 +215704,7 @@ const main_transcribeCommand = async (opts) => { const info = (0,main_dist/* pathInfoEx */.j4)((0,main_dist/* forward_slash */.Yf)(main_external_node_path_.resolve((0,main_dist/* resolve */.hd)(includePath))), false, { absolute: true, }); - files.push(...(0,main_run/* default_sort */.X4)(info.FILES)); + files.push(...info.FILES); } else if ((0,main_exists/* sync */.OH)(includePath)) { files.push(includePath); @@ -230389,8 +215714,9 @@ const main_transcribeCommand = async (opts) => { opts.logger.warn(`No files found for --include patterns: ${opts.include.join(', ')}`); return; } + files = main_default_sort(files); opts.logger.info(`Found ${files.length} files to transcribe.`); - for (const file of files) { + const mapper = async (file) => { const fileInfo = main_external_node_path_.parse(file); const CWD = process.cwd(); const current_variables = { @@ -230407,18 +215733,35 @@ const main_transcribeCommand = async (opts) => { include: [file], variables: current_variables }; - if (!itemOpts.dst) { - itemOpts.dst = '${SRC_DIR}/${SRC_NAME}.md'; - } - itemOpts.dst = main_external_node_path_.resolve((0,main_dist/* resolve */.hd)(itemOpts.dst, itemOpts.alt, itemOpts.variables)); opts.logger.info(`Transcribing ${file}...`); - if (itemOpts.dst) { - opts.logger.info(`Output will be saved to ${itemOpts.dst}`); + const transcribedText = await main_transcribe(itemOpts); + return { transcribedText, itemOpts }; + }; + const results = await main_pMap(files, mapper, { concurrency: 1 }); + let resolvedDstPath; + if (opts.dst) { + resolvedDstPath = main_external_node_path_.resolve((0,main_dist/* resolve */.hd)(opts.dst, opts.alt, opts.variables)); + if (main_external_node_fs_.existsSync(resolvedDstPath)) { + main_external_node_fs_.unlinkSync(resolvedDstPath); + } + const allText = results.map(r => r.transcribedText).filter(Boolean).join('\n\n'); + if (allText) { + main_external_node_fs_.writeFileSync(resolvedDstPath, allText + '\n'); + opts.logger.info(`Wrote all transcriptions to ${resolvedDstPath}`); + } + } + else { + for (const { transcribedText, itemOpts } of results) { + if (transcribedText) { + const defaultDstTemplate = '${SRC_DIR}/${SRC_NAME}.md'; + const defaultDstPath = main_external_node_path_.resolve((0,main_dist/* resolve */.hd)(defaultDstTemplate, itemOpts.alt, itemOpts.variables)); + main_external_node_fs_.writeFileSync(defaultDstPath, transcribedText); + opts.logger.info(`Output will be saved to ${defaultDstPath}`); + } } - await main_transcribe(itemOpts); } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNjcmliZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tYW5kcy90cmFuc2NyaWJlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxJQUFJLE1BQU0sV0FBVyxDQUFBO0FBQ2pDLE9BQU8sRUFBRSxRQUFRLEVBQUUsT0FBTyxFQUFFLE1BQU0sMkJBQTJCLENBQUE7QUFDN0QsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLE1BQU0sQ0FBQTtBQUMvQixPQUFPLEVBQUUsSUFBSSxJQUFJLE1BQU0sRUFBRSxNQUFNLHFCQUFxQixDQUFBO0FBQ3BELE9BQU8sRUFBRSxhQUFhLEVBQUUsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLG1CQUFtQixDQUFBO0FBR3RFLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQTtBQUNoRCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sc0JBQXNCLENBQUE7QUFDakQsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLFlBQVksQ0FBQTtBQUNyQyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sVUFBVSxDQUFBO0FBQ3ZDLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxhQUFhLENBQUE7QUFDdkMsT0FBTyxF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QUFPLEVBQUUsQ0FBQztZQUNWLEVBQUUsQ0FBQyxhQUFhLENBQUMsZUFBZSxFQUFFLE9BQU8sR0FBRyxJQUFJLENBQUMsQ0FBQztZQUNsRCxJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQywrQkFBK0IsZUFBZSxFQUFFLENBQUMsQ0FBQztRQUN2RSxDQUFDO0lBQ0wsQ0FBQztTQUFNLENBQUM7UUFDSixLQUFLLE1BQU0sRUFBRSxlQUFlLEVBQUUsUUFBUSxFQUFFLElBQUksT0FBTyxFQUFFLENBQUM7WUFDbEQsSUFBSSxlQUFlLEVBQUUsQ0FBQztnQkFDbEIsTUFBTSxrQkFBa0IsR0FBRywyQkFBMkIsQ0FBQztnQkFDdkQsTUFBTSxjQUFjLEdBQUcsSUFBSSxDQUFDLE9BQU8sQ0FBQyxPQUFPLENBQUMsa0JBQWtCLEVBQUUsUUFBUSxDQUFDLEdBQUcsRUFBRSxRQUFRLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQztnQkFDbkcsRUFBRSxDQUFDLGFBQWEsQ0FBQyxjQUFjLEVBQUUsZUFBZSxDQUFDLENBQUM7Z0JBQ2xELElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLDJCQUEyQixjQUFjLEVBQUUsQ0FBQyxDQUFDO1lBQ2xFLENBQUM7UUFDTCxDQUFDO0lBQ0wsQ0FBQztBQUNMLENBQUMsQ0FBQSJ9 ;// ./dist-in/main.js //#!/usr/bin/env node diff --git a/packages/kbot/dist/main_node.js b/packages/kbot/dist/main_node.js index cd79be95..f7de8d1a 100644 --- a/packages/kbot/dist/main_node.js +++ b/packages/kbot/dist/main_node.js @@ -1266,17136 +1266,6 @@ exports.ud = deferred; __webpack_unused_export__ = deferred; //# sourceMappingURL=index.js.map -/***/ }), - -/***/ 53141: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -const { parse } = __webpack_require__(72636); - -module.exports = function (elt) { - const style = new CSSStyleDeclaration(elt) - const handler = { - get: function(target, property) { - return property in target ? target[property] : target.getPropertyValue(dasherizeProperty(property)); - }, - has: function(target, key) { - return true; - }, - set: function(target, property, value) { - if (property in target) { - target[property] = value; - } else { - target.setProperty(dasherizeProperty(property), value ?? undefined); - } - - return true; - } - }; - - return new Proxy(style, handler); -}; - -function dasherizeProperty(property) { - return property.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); -} - - -function CSSStyleDeclaration(elt) { - this._element = elt; -} - -const IMPORTANT_BANG = '!important'; - -// Utility function for parsing style declarations -// Pass in a string like "margin-left: 5px; border-style: solid" -// and this function returns an object like -// {"margin-left":"5px", "border-style":"solid"} -function parseStyles(value) { - const result = { - property: {}, - priority: {}, - } - - if (!value) { - return result; - } - - const styleValues = parse(value); - if (styleValues.length < 2) { - return result; - } - - for (let i = 0; i < styleValues.length; i += 2) { - const name = styleValues[i]; - let value = styleValues[i+1]; - - if (value.endsWith(IMPORTANT_BANG)) { - result.priority[name] = 'important'; - value = value.slice(0, -IMPORTANT_BANG.length).trim(); - } - - result.property[name] = value; - } - - return result; -} - -var NO_CHANGE = {}; // Private marker object - -CSSStyleDeclaration.prototype = Object.create(Object.prototype, { - - // Return the parsed form of the element's style attribute. - // If the element's style attribute has never been parsed - // or if it has changed since the last parse, then reparse it - // Note that the styles don't get parsed until they're actually needed - _parsed: { get: function() { - if (!this._parsedStyles || this.cssText !== this._lastParsedText) { - var text = this.cssText; - this._parsedStyles = parseStyles(text); - this._lastParsedText = text; - delete this._names; - } - return this._parsedStyles; - }}, - - // Call this method any time the parsed representation of the - // style changes. It converts the style properties to a string and - // sets cssText and the element's style attribute - _serialize: { value: function() { - var styles = this._parsed; - var s = ""; - - for(var name in styles.property) { - if (s) s += " "; - s += name + ": " + styles.property[name]; - if (styles.priority[name]) { - s += " !" + styles.priority[name]; - } - s += ";"; - } - - this.cssText = s; // also sets the style attribute - this._lastParsedText = s; // so we don't reparse - delete this._names; - }}, - - cssText: { - get: function() { - // XXX: this is a CSSStyleDeclaration for an element. - // A different impl might be necessary for a set of styles - // associated returned by getComputedStyle(), e.g. - return this._element.getAttribute("style"); - }, - set: function(value) { - // XXX: I should parse and serialize the value to - // normalize it and remove errors. FF and chrome do that. - this._element.setAttribute("style", value); - } - }, - - length: { get: function() { - if (!this._names) - this._names = Object.getOwnPropertyNames(this._parsed.property); - return this._names.length; - }}, - - item: { value: function(n) { - if (!this._names) - this._names = Object.getOwnPropertyNames(this._parsed.property); - return this._names[n]; - }}, - - getPropertyValue: { value: function(property) { - property = property.toLowerCase(); - return this._parsed.property[property] || ""; - }}, - - getPropertyPriority: { value: function(property) { - property = property.toLowerCase(); - return this._parsed.priority[property] || ""; - }}, - - setProperty: { value: function(property, value, priority) { - property = property.toLowerCase(); - if (value === null || value === undefined) { - value = ""; - } - if (priority === null || priority === undefined) { - priority = ""; - } - - // String coercion - if (value !== NO_CHANGE) { - value = "" + value; - } - - value = value.trim(); - if (value === "") { - this.removeProperty(property); - return; - } - - if (priority !== "" && priority !== NO_CHANGE && - !/^important$/i.test(priority)) { - return; - } - - var styles = this._parsed; - if (value === NO_CHANGE) { - if (!styles.property[property]) { - return; // Not a valid property name. - } - if (priority !== "") { - styles.priority[property] = "important"; - } else { - delete styles.priority[property]; - } - } else { - // We don't just accept the property value. Instead - // we parse it to ensure that it is something valid. - // If it contains a semicolon it is invalid - if (value.indexOf(";") !== -1) return; - - var newprops = parseStyles(property + ":" + value); - if (Object.getOwnPropertyNames(newprops.property).length === 0) { - return; // no valid property found - } - if (Object.getOwnPropertyNames(newprops.priority).length !== 0) { - return; // if the value included '!important' it wasn't valid. - } - - // XXX handle shorthand properties - - for (var p in newprops.property) { - styles.property[p] = newprops.property[p]; - if (priority === NO_CHANGE) { - continue; - } else if (priority !== "") { - styles.priority[p] = "important"; - } else if (styles.priority[p]) { - delete styles.priority[p]; - } - } - } - - // Serialize and update cssText and element.style! - this._serialize(); - }}, - - setPropertyValue: { value: function(property, value) { - return this.setProperty(property, value, NO_CHANGE); - }}, - - setPropertyPriority: { value: function(property, priority) { - return this.setProperty(property, NO_CHANGE, priority); - }}, - - removeProperty: { value: function(property) { - property = property.toLowerCase(); - var styles = this._parsed; - if (property in styles.property) { - delete styles.property[property]; - delete styles.priority[property]; - - // Serialize and update cssText and element.style! - this._serialize(); - } - }}, -}); - - -/***/ }), - -/***/ 90086: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; -/* jshint bitwise: false */ - -module.exports = CharacterData; - -var Leaf = __webpack_require__(8161); -var utils = __webpack_require__(89076); -var ChildNode = __webpack_require__(52091); -var NonDocumentTypeChildNode = __webpack_require__(32001); - -function CharacterData() { - Leaf.call(this); -} - -CharacterData.prototype = Object.create(Leaf.prototype, { - // DOMString substringData(unsigned long offset, - // unsigned long count); - // The substringData(offset, count) method must run these steps: - // - // If offset is greater than the context object's - // length, throw an INDEX_SIZE_ERR exception and - // terminate these steps. - // - // If offset+count is greater than the context - // object's length, return a DOMString whose value is - // the UTF-16 code units from the offsetth UTF-16 code - // unit to the end of data. - // - // Return a DOMString whose value is the UTF-16 code - // units from the offsetth UTF-16 code unit to the - // offset+countth UTF-16 code unit in data. - substringData: { value: function substringData(offset, count) { - if (arguments.length < 2) { throw new TypeError("Not enough arguments"); } - // Convert arguments to WebIDL "unsigned long" - offset = offset >>> 0; - count = count >>> 0; - if (offset > this.data.length || offset < 0 || count < 0) { - utils.IndexSizeError(); - } - return this.data.substring(offset, offset+count); - }}, - - // void appendData(DOMString data); - // The appendData(data) method must append data to the context - // object's data. - appendData: { value: function appendData(data) { - if (arguments.length < 1) { throw new TypeError("Not enough arguments"); } - this.data += String(data); - }}, - - // void insertData(unsigned long offset, DOMString data); - // The insertData(offset, data) method must run these steps: - // - // If offset is greater than the context object's - // length, throw an INDEX_SIZE_ERR exception and - // terminate these steps. - // - // Insert data into the context object's data after - // offset UTF-16 code units. - // - insertData: { value: function insertData(offset, data) { - return this.replaceData(offset, 0, data); - }}, - - - // void deleteData(unsigned long offset, unsigned long count); - // The deleteData(offset, count) method must run these steps: - // - // If offset is greater than the context object's - // length, throw an INDEX_SIZE_ERR exception and - // terminate these steps. - // - // If offset+count is greater than the context - // object's length var count be length-offset. - // - // Starting from offset UTF-16 code units remove count - // UTF-16 code units from the context object's data. - deleteData: { value: function deleteData(offset, count) { - return this.replaceData(offset, count, ''); - }}, - - - // void replaceData(unsigned long offset, unsigned long count, - // DOMString data); - // - // The replaceData(offset, count, data) method must act as - // if the deleteData() method is invoked with offset and - // count as arguments followed by the insertData() method - // with offset and data as arguments and re-throw any - // exceptions these methods might have thrown. - replaceData: { value: function replaceData(offset, count, data) { - var curtext = this.data, len = curtext.length; - // Convert arguments to correct WebIDL type - offset = offset >>> 0; - count = count >>> 0; - data = String(data); - - if (offset > len || offset < 0) utils.IndexSizeError(); - - if (offset+count > len) - count = len - offset; - - var prefix = curtext.substring(0, offset), - suffix = curtext.substring(offset+count); - - this.data = prefix + data + suffix; - }}, - - // Utility method that Node.isEqualNode() calls to test Text and - // Comment nodes for equality. It is okay to put it here, since - // Node will have already verified that nodeType is equal - isEqual: { value: function isEqual(n) { - return this._data === n._data; - }}, - - length: { get: function() { return this.data.length; }} - -}); - -Object.defineProperties(CharacterData.prototype, ChildNode); -Object.defineProperties(CharacterData.prototype, NonDocumentTypeChildNode); - - -/***/ }), - -/***/ 52091: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var Node = __webpack_require__(97537); -var LinkedList = __webpack_require__(41360); - -var createDocumentFragmentFromArguments = function(document, args) { - var docFrag = document.createDocumentFragment(); - - for (var i=0; i { - -"use strict"; - -module.exports = Comment; - -var Node = __webpack_require__(97537); -var CharacterData = __webpack_require__(90086); - -function Comment(doc, data) { - CharacterData.call(this); - this.nodeType = Node.COMMENT_NODE; - this.ownerDocument = doc; - this._data = data; -} - -var nodeValue = { - get: function() { return this._data; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } else { v = String(v); } - this._data = v; - if (this.rooted) - this.ownerDocument.mutateValue(this); - } -}; - -Comment.prototype = Object.create(CharacterData.prototype, { - nodeName: { value: '#comment' }, - nodeValue: nodeValue, - textContent: nodeValue, - innerText: nodeValue, - data: { - get: nodeValue.get, - set: function(v) { - nodeValue.set.call(this, v===null ? '' : String(v)); - }, - }, - - // Utility methods - clone: { value: function clone() { - return new Comment(this.ownerDocument, this._data); - }}, -}); - - -/***/ }), - -/***/ 38554: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = ContainerNode; - -var Node = __webpack_require__(97537); -var NodeList = __webpack_require__(64965); - -// This class defines common functionality for node subtypes that -// can have children - -function ContainerNode() { - Node.call(this); - this._firstChild = this._childNodes = null; -} - -// Primary representation is a circular linked list of siblings -ContainerNode.prototype = Object.create(Node.prototype, { - - hasChildNodes: { value: function() { - if (this._childNodes) { - return this._childNodes.length > 0; - } - return this._firstChild !== null; - }}, - - childNodes: { get: function() { - this._ensureChildNodes(); - return this._childNodes; - }}, - - firstChild: { get: function() { - if (this._childNodes) { - return this._childNodes.length === 0 ? null : this._childNodes[0]; - } - return this._firstChild; - }}, - - lastChild: { get: function() { - var kids = this._childNodes, first; - if (kids) { - return kids.length === 0 ? null: kids[kids.length-1]; - } - first = this._firstChild; - if (first === null) { return null; } - return first._previousSibling; // circular linked list - }}, - - _ensureChildNodes: { value: function() { - if (this._childNodes) { return; } - var first = this._firstChild, - kid = first, - childNodes = this._childNodes = new NodeList(); - if (first) do { - childNodes.push(kid); - kid = kid._nextSibling; - } while (kid !== first); // circular linked list - this._firstChild = null; // free memory - }}, - - // Remove all of this node's children. This is a minor - // optimization that only calls modify() once. - removeChildren: { value: function removeChildren() { - var root = this.rooted ? this.ownerDocument : null, - next = this.firstChild, - kid; - while (next !== null) { - kid = next; - next = kid.nextSibling; - - if (root) root.mutateRemove(kid); - kid.parentNode = null; - } - if (this._childNodes) { - this._childNodes.length = 0; - } else { - this._firstChild = null; - } - this.modify(); // Update last modified type once only - }}, - -}); - - -/***/ }), - -/***/ 22112: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = CustomEvent; - -var Event = __webpack_require__(13441); - -function CustomEvent(type, dictionary) { - // Just use the superclass constructor to initialize - Event.call(this, type, dictionary); -} -CustomEvent.prototype = Object.create(Event.prototype, { - constructor: { value: CustomEvent } -}); - - -/***/ }), - -/***/ 46364: -/***/ ((module) => { - -"use strict"; - -module.exports = DOMException; - -var INDEX_SIZE_ERR = 1; -var HIERARCHY_REQUEST_ERR = 3; -var WRONG_DOCUMENT_ERR = 4; -var INVALID_CHARACTER_ERR = 5; -var NO_MODIFICATION_ALLOWED_ERR = 7; -var NOT_FOUND_ERR = 8; -var NOT_SUPPORTED_ERR = 9; -var INVALID_STATE_ERR = 11; -var SYNTAX_ERR = 12; -var INVALID_MODIFICATION_ERR = 13; -var NAMESPACE_ERR = 14; -var INVALID_ACCESS_ERR = 15; -var TYPE_MISMATCH_ERR = 17; -var SECURITY_ERR = 18; -var NETWORK_ERR = 19; -var ABORT_ERR = 20; -var URL_MISMATCH_ERR = 21; -var QUOTA_EXCEEDED_ERR = 22; -var TIMEOUT_ERR = 23; -var INVALID_NODE_TYPE_ERR = 24; -var DATA_CLONE_ERR = 25; - -// Code to name -var names = [ - null, // No error with code 0 - 'INDEX_SIZE_ERR', - null, // historical - 'HIERARCHY_REQUEST_ERR', - 'WRONG_DOCUMENT_ERR', - 'INVALID_CHARACTER_ERR', - null, // historical - 'NO_MODIFICATION_ALLOWED_ERR', - 'NOT_FOUND_ERR', - 'NOT_SUPPORTED_ERR', - 'INUSE_ATTRIBUTE_ERR', // historical - 'INVALID_STATE_ERR', - 'SYNTAX_ERR', - 'INVALID_MODIFICATION_ERR', - 'NAMESPACE_ERR', - 'INVALID_ACCESS_ERR', - null, // historical - 'TYPE_MISMATCH_ERR', - 'SECURITY_ERR', - 'NETWORK_ERR', - 'ABORT_ERR', - 'URL_MISMATCH_ERR', - 'QUOTA_EXCEEDED_ERR', - 'TIMEOUT_ERR', - 'INVALID_NODE_TYPE_ERR', - 'DATA_CLONE_ERR', -]; - -// Code to message -// These strings are from the 13 May 2011 Editor's Draft of DOM Core. -// http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html -// Copyright © 2011 W3C® (MIT, ERCIM, Keio), All Rights Reserved. -// Used under the terms of the W3C Document License: -// http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231 -var messages = [ - null, // No error with code 0 - 'INDEX_SIZE_ERR (1): the index is not in the allowed range', - null, - 'HIERARCHY_REQUEST_ERR (3): the operation would yield an incorrect nodes model', - 'WRONG_DOCUMENT_ERR (4): the object is in the wrong Document, a call to importNode is required', - 'INVALID_CHARACTER_ERR (5): the string contains invalid characters', - null, - 'NO_MODIFICATION_ALLOWED_ERR (7): the object can not be modified', - 'NOT_FOUND_ERR (8): the object can not be found here', - 'NOT_SUPPORTED_ERR (9): this operation is not supported', - 'INUSE_ATTRIBUTE_ERR (10): setAttributeNode called on owned Attribute', - 'INVALID_STATE_ERR (11): the object is in an invalid state', - 'SYNTAX_ERR (12): the string did not match the expected pattern', - 'INVALID_MODIFICATION_ERR (13): the object can not be modified in this way', - 'NAMESPACE_ERR (14): the operation is not allowed by Namespaces in XML', - 'INVALID_ACCESS_ERR (15): the object does not support the operation or argument', - null, - 'TYPE_MISMATCH_ERR (17): the type of the object does not match the expected type', - 'SECURITY_ERR (18): the operation is insecure', - 'NETWORK_ERR (19): a network error occurred', - 'ABORT_ERR (20): the user aborted an operation', - 'URL_MISMATCH_ERR (21): the given URL does not match another URL', - 'QUOTA_EXCEEDED_ERR (22): the quota has been exceeded', - 'TIMEOUT_ERR (23): a timeout occurred', - 'INVALID_NODE_TYPE_ERR (24): the supplied node is invalid or has an invalid ancestor for this operation', - 'DATA_CLONE_ERR (25): the object can not be cloned.' -]; - -// Name to code -var constants = { - INDEX_SIZE_ERR: INDEX_SIZE_ERR, - DOMSTRING_SIZE_ERR: 2, // historical - HIERARCHY_REQUEST_ERR: HIERARCHY_REQUEST_ERR, - WRONG_DOCUMENT_ERR: WRONG_DOCUMENT_ERR, - INVALID_CHARACTER_ERR: INVALID_CHARACTER_ERR, - NO_DATA_ALLOWED_ERR: 6, // historical - NO_MODIFICATION_ALLOWED_ERR: NO_MODIFICATION_ALLOWED_ERR, - NOT_FOUND_ERR: NOT_FOUND_ERR, - NOT_SUPPORTED_ERR: NOT_SUPPORTED_ERR, - INUSE_ATTRIBUTE_ERR: 10, // historical - INVALID_STATE_ERR: INVALID_STATE_ERR, - SYNTAX_ERR: SYNTAX_ERR, - INVALID_MODIFICATION_ERR: INVALID_MODIFICATION_ERR, - NAMESPACE_ERR: NAMESPACE_ERR, - INVALID_ACCESS_ERR: INVALID_ACCESS_ERR, - VALIDATION_ERR: 16, // historical - TYPE_MISMATCH_ERR: TYPE_MISMATCH_ERR, - SECURITY_ERR: SECURITY_ERR, - NETWORK_ERR: NETWORK_ERR, - ABORT_ERR: ABORT_ERR, - URL_MISMATCH_ERR: URL_MISMATCH_ERR, - QUOTA_EXCEEDED_ERR: QUOTA_EXCEEDED_ERR, - TIMEOUT_ERR: TIMEOUT_ERR, - INVALID_NODE_TYPE_ERR: INVALID_NODE_TYPE_ERR, - DATA_CLONE_ERR: DATA_CLONE_ERR -}; - -function DOMException(code) { - Error.call(this); - Error.captureStackTrace(this, this.constructor); - this.code = code; - this.message = messages[code]; - this.name = names[code]; -} -DOMException.prototype.__proto__ = Error.prototype; - -// Initialize the constants on DOMException and DOMException.prototype -for(var c in constants) { - var v = { value: constants[c] }; - Object.defineProperty(DOMException, c, v); - Object.defineProperty(DOMException.prototype, c, v); -} - - -/***/ }), - -/***/ 80931: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = DOMImplementation; - -var Document = __webpack_require__(35452); -var DocumentType = __webpack_require__(73092); -var HTMLParser = __webpack_require__(91895); -var utils = __webpack_require__(89076); -var xml = __webpack_require__(66798); - -// Each document must have its own instance of the domimplementation object -function DOMImplementation(contextObject) { - this.contextObject = contextObject; -} - - -// Feature/version pairs that DOMImplementation.hasFeature() returns -// true for. It returns false for anything else. -var supportedFeatures = { - 'xml': { '': true, '1.0': true, '2.0': true }, // DOM Core - 'core': { '': true, '2.0': true }, // DOM Core - 'html': { '': true, '1.0': true, '2.0': true} , // HTML - 'xhtml': { '': true, '1.0': true, '2.0': true} , // HTML -}; - -DOMImplementation.prototype = { - hasFeature: function hasFeature(feature, version) { - var f = supportedFeatures[(feature || '').toLowerCase()]; - return (f && f[version || '']) || false; - }, - - createDocumentType: function createDocumentType(qualifiedName, publicId, systemId) { - if (!xml.isValidQName(qualifiedName)) utils.InvalidCharacterError(); - - return new DocumentType(this.contextObject, qualifiedName, publicId, systemId); - }, - - createDocument: function createDocument(namespace, qualifiedName, doctype) { - // - // Note that the current DOMCore spec makes it impossible to - // create an HTML document with this function, even if the - // namespace and doctype are propertly set. See this thread: - // http://lists.w3.org/Archives/Public/www-dom/2011AprJun/0132.html - // - var d = new Document(false, null); - var e; - - if (qualifiedName) - e = d.createElementNS(namespace, qualifiedName); - else - e = null; - - if (doctype) { - d.appendChild(doctype); - } - - if (e) d.appendChild(e); - if (namespace === utils.NAMESPACE.HTML) { - d._contentType = 'application/xhtml+xml'; - } else if (namespace === utils.NAMESPACE.SVG) { - d._contentType = 'image/svg+xml'; - } else { - d._contentType = 'application/xml'; - } - - return d; - }, - - createHTMLDocument: function createHTMLDocument(titleText) { - var d = new Document(true, null); - d.appendChild(new DocumentType(d, 'html')); - var html = d.createElement('html'); - d.appendChild(html); - var head = d.createElement('head'); - html.appendChild(head); - if (titleText !== undefined) { - var title = d.createElement('title'); - head.appendChild(title); - title.appendChild(d.createTextNode(titleText)); - } - html.appendChild(d.createElement('body')); - d.modclock = 1; // Start tracking modifications - return d; - }, - - mozSetOutputMutationHandler: function(doc, handler) { - doc.mutationHandler = handler; - }, - - mozGetInputMutationHandler: function(doc) { - utils.nyi(); - }, - - mozHTMLParser: HTMLParser, -}; - - -/***/ }), - -/***/ 82840: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -// DOMTokenList implementation based on https://github.com/Raynos/DOM-shim -var utils = __webpack_require__(89076); - -module.exports = DOMTokenList; - -function DOMTokenList(getter, setter) { - this._getString = getter; - this._setString = setter; - this._length = 0; - this._lastStringValue = ''; - this._update(); -} - -Object.defineProperties(DOMTokenList.prototype, { - length: { get: function() { return this._length; } }, - item: { value: function(index) { - var list = getList(this); - if (index < 0 || index >= list.length) { - return null; - } - return list[index]; - }}, - - contains: { value: function(token) { - token = String(token); // no error checking for contains() - var list = getList(this); - return list.indexOf(token) > -1; - }}, - - add: { value: function() { - var list = getList(this); - for (var i = 0, len = arguments.length; i < len; i++) { - var token = handleErrors(arguments[i]); - if (list.indexOf(token) < 0) { - list.push(token); - } - } - // Note: as per spec, if handleErrors() throws any errors, we never - // make it here and none of the changes take effect. - // Also per spec: we run the "update steps" even if no change was - // made (ie, if the token already existed) - this._update(list); - }}, - - remove: { value: function() { - var list = getList(this); - for (var i = 0, len = arguments.length; i < len; i++) { - var token = handleErrors(arguments[i]); - var index = list.indexOf(token); - if (index > -1) { - list.splice(index, 1); - } - } - // Note: as per spec, if handleErrors() throws any errors, we never - // make it here and none of the changes take effect. - // Also per spec: we run the "update steps" even if no change was - // made (ie, if the token wasn't previously present) - this._update(list); - }}, - - toggle: { value: function toggle(token, force) { - token = handleErrors(token); - if (this.contains(token)) { - if (force === undefined || force === false) { - this.remove(token); - return false; - } - return true; - } else { - if (force === undefined || force === true) { - this.add(token); - return true; - } - return false; - } - }}, - - replace: { value: function replace(token, newToken) { - // weird corner case of spec: if `token` contains whitespace, but - // `newToken` is the empty string, we must throw SyntaxError not - // InvalidCharacterError (sigh) - if (String(newToken)==='') { utils.SyntaxError(); } - token = handleErrors(token); - newToken = handleErrors(newToken); - var list = getList(this); - var idx = list.indexOf(token); - if (idx < 0) { - // Note that, per spec, we do not run the update steps on this path. - return false; - } - var idx2 = list.indexOf(newToken); - if (idx2 < 0) { - list[idx] = newToken; - } else { - // "replace the first instance of either `token` or `newToken` with - // `newToken` and remove all other instances" - if (idx < idx2) { - list[idx] = newToken; - list.splice(idx2, 1); - } else { - // idx2 is already `newToken` - list.splice(idx, 1); - } - } - this._update(list); - return true; - }}, - - toString: { value: function() { - return this._getString(); - }}, - - value: { - get: function() { - return this._getString(); - }, - set: function(v) { - this._setString(v); - this._update(); - } - }, - - // Called when the setter is called from outside this interface. - _update: { value: function(list) { - if (list) { - fixIndex(this, list); - this._setString(list.join(" ").trim()); - } else { - fixIndex(this, getList(this)); - } - this._lastStringValue = this._getString(); - } }, -}); - -function fixIndex(clist, list) { - var oldLength = clist._length; - var i; - clist._length = list.length; - for (i = 0; i < list.length; i++) { - clist[i] = list[i]; - } - // Clear/free old entries. - for (; i < oldLength; i++) { - clist[i] = undefined; - } -} - -function handleErrors(token) { - token = String(token); - if (token === "") { - utils.SyntaxError(); - } - if (/[ \t\r\n\f]/.test(token)) { - utils.InvalidCharacterError(); - } - return token; -} - -function toArray(clist) { - var length = clist._length; - var arr = Array(length); - for (var i = 0; i < length; i++) { - arr[i] = clist[i]; - } - return arr; -} - -function getList(clist) { - var strProp = clist._getString(); - if (strProp === clist._lastStringValue) { - return toArray(clist); - } - var str = strProp.replace(/(^[ \t\r\n\f]+)|([ \t\r\n\f]+$)/g, ''); - if (str === "") { - return []; - } else { - var seen = Object.create(null); - return str.split(/[ \t\r\n\f]+/g).filter(function(n) { - var key = '$' + n; - if (seen[key]) { return false; } - seen[key] = true; - return true; - }); - } -} - - -/***/ }), - -/***/ 35452: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = Document; - -var Node = __webpack_require__(97537); -var NodeList = __webpack_require__(64965); -var ContainerNode = __webpack_require__(38554); -var Element = __webpack_require__(77301); -var Text = __webpack_require__(58210); -var Comment = __webpack_require__(17548); -var Event = __webpack_require__(13441); -var DocumentFragment = __webpack_require__(17948); -var ProcessingInstruction = __webpack_require__(81248); -var DOMImplementation = __webpack_require__(80931); -var TreeWalker = __webpack_require__(44507); -var NodeIterator = __webpack_require__(30419); -var NodeFilter = __webpack_require__(383); -var URL = __webpack_require__(85184); -var select = __webpack_require__(23509); -var events = __webpack_require__(18196); -var xml = __webpack_require__(66798); -var html = __webpack_require__(96324); -var svg = __webpack_require__(967); -var utils = __webpack_require__(89076); -var MUTATE = __webpack_require__(40993); -var NAMESPACE = utils.NAMESPACE; -var isApiWritable = (__webpack_require__(66139)/* .isApiWritable */ .h); - -function Document(isHTML, address) { - ContainerNode.call(this); - this.nodeType = Node.DOCUMENT_NODE; - this.isHTML = isHTML; - this._address = address || 'about:blank'; - this.readyState = 'loading'; - this.implementation = new DOMImplementation(this); - - // DOMCore says that documents are always associated with themselves - this.ownerDocument = null; // ... but W3C tests expect null - this._contentType = isHTML ? 'text/html' : 'application/xml'; - - // These will be initialized by our custom versions of - // appendChild and insertBefore that override the inherited - // Node methods. - // XXX: override those methods! - this.doctype = null; - this.documentElement = null; - - // "Associated inert template document" - this._templateDocCache = null; - // List of active NodeIterators, see NodeIterator#_preremove() - this._nodeIterators = null; - - // Documents are always rooted, by definition - this._nid = 1; - this._nextnid = 2; // For numbering children of the document - this._nodes = [null, this]; // nid to node map - - // This maintains the mapping from element ids to element nodes. - // We may need to update this mapping every time a node is rooted - // or uprooted, and any time an attribute is added, removed or changed - // on a rooted element. - this.byId = Object.create(null); - - // This property holds a monotonically increasing value akin to - // a timestamp used to record the last modification time of nodes - // and their subtrees. See the lastModTime attribute and modify() - // method of the Node class. And see FilteredElementList for an example - // of the use of lastModTime - this.modclock = 0; -} - -// Map from lowercase event category names (used as arguments to -// createEvent()) to the property name in the impl object of the -// event constructor. -var supportedEvents = { - event: 'Event', - customevent: 'CustomEvent', - uievent: 'UIEvent', - mouseevent: 'MouseEvent' -}; - -// Certain arguments to document.createEvent() must be treated specially -var replacementEvent = { - events: 'event', - htmlevents: 'event', - mouseevents: 'mouseevent', - mutationevents: 'mutationevent', - uievents: 'uievent' -}; - -var mirrorAttr = function(f, name, defaultValue) { - return { - get: function() { - var o = f.call(this); - if (o) { return o[name]; } - return defaultValue; - }, - set: function(value) { - var o = f.call(this); - if (o) { o[name] = value; } - }, - }; -}; - -/** @spec https://dom.spec.whatwg.org/#validate-and-extract */ -function validateAndExtract(namespace, qualifiedName) { - var prefix, localName, pos; - if (namespace==='') { namespace = null; } - // See https://github.com/whatwg/dom/issues/671 - // and https://github.com/whatwg/dom/issues/319 - if (!xml.isValidQName(qualifiedName)) { - utils.InvalidCharacterError(); - } - prefix = null; - localName = qualifiedName; - - pos = qualifiedName.indexOf(':'); - if (pos >= 0) { - prefix = qualifiedName.substring(0, pos); - localName = qualifiedName.substring(pos+1); - } - if (prefix !== null && namespace === null) { - utils.NamespaceError(); - } - if (prefix === 'xml' && namespace !== NAMESPACE.XML) { - utils.NamespaceError(); - } - if ((prefix === 'xmlns' || qualifiedName === 'xmlns') && - namespace !== NAMESPACE.XMLNS) { - utils.NamespaceError(); - } - if (namespace === NAMESPACE.XMLNS && !(prefix==='xmlns' || qualifiedName==='xmlns')) { - utils.NamespaceError(); - } - return { namespace: namespace, prefix: prefix, localName: localName }; -} - -Document.prototype = Object.create(ContainerNode.prototype, { - // This method allows dom.js to communicate with a renderer - // that displays the document in some way - // XXX: I should probably move this to the window object - _setMutationHandler: { value: function(handler) { - this.mutationHandler = handler; - }}, - - // This method allows dom.js to receive event notifications - // from the renderer. - // XXX: I should probably move this to the window object - _dispatchRendererEvent: { value: function(targetNid, type, details) { - var target = this._nodes[targetNid]; - if (!target) return; - target._dispatchEvent(new Event(type, details), true); - }}, - - nodeName: { value: '#document'}, - nodeValue: { - get: function() { - return null; - }, - set: function() {} - }, - - // XXX: DOMCore may remove documentURI, so it is NYI for now - documentURI: { get: function() { return this._address; }, set: utils.nyi }, - compatMode: { get: function() { - // The _quirks property is set by the HTML parser - return this._quirks ? 'BackCompat' : 'CSS1Compat'; - }}, - - createTextNode: { value: function(data) { - return new Text(this, String(data)); - }}, - createComment: { value: function(data) { - return new Comment(this, data); - }}, - createDocumentFragment: { value: function() { - return new DocumentFragment(this); - }}, - createProcessingInstruction: { value: function(target, data) { - if (!xml.isValidName(target) || data.indexOf('?>') !== -1) - utils.InvalidCharacterError(); - return new ProcessingInstruction(this, target, data); - }}, - - createAttribute: { value: function(localName) { - localName = String(localName); - if (!xml.isValidName(localName)) utils.InvalidCharacterError(); - if (this.isHTML) { - localName = utils.toASCIILowerCase(localName); - } - return new Element._Attr(null, localName, null, null, ''); - }}, - createAttributeNS: { value: function(namespace, qualifiedName) { - // Convert parameter types according to WebIDL - namespace = - (namespace === null || namespace === undefined || namespace === '') ? null : - String(namespace); - qualifiedName = String(qualifiedName); - var ve = validateAndExtract(namespace, qualifiedName); - return new Element._Attr(null, ve.localName, ve.prefix, ve.namespace, ''); - }}, - - createElement: { value: function(localName) { - localName = String(localName); - if (!xml.isValidName(localName)) utils.InvalidCharacterError(); - // Per spec, namespace should be HTML namespace if "context object is - // an HTML document or context object's content type is - // "application/xhtml+xml", and null otherwise. - if (this.isHTML) { - if (/[A-Z]/.test(localName)) - localName = utils.toASCIILowerCase(localName); - return html.createElement(this, localName, null); - } else if (this.contentType === 'application/xhtml+xml') { - return html.createElement(this, localName, null); - } else { - return new Element(this, localName, null, null); - } - }, writable: isApiWritable }, - - createElementNS: { value: function(namespace, qualifiedName) { - // Convert parameter types according to WebIDL - namespace = - (namespace === null || namespace === undefined || namespace === '') ? null : - String(namespace); - qualifiedName = String(qualifiedName); - var ve = validateAndExtract(namespace, qualifiedName); - return this._createElementNS(ve.localName, ve.namespace, ve.prefix); - }, writable: isApiWritable }, - - // This is used directly by HTML parser, which allows it to create - // elements with localNames containing ':' and non-default namespaces - _createElementNS: { value: function(localName, namespace, prefix) { - if (namespace === NAMESPACE.HTML) { - return html.createElement(this, localName, prefix); - } - else if (namespace === NAMESPACE.SVG) { - return svg.createElement(this, localName, prefix); - } - - return new Element(this, localName, namespace, prefix); - }}, - - createEvent: { value: function createEvent(interfaceName) { - interfaceName = interfaceName.toLowerCase(); - var name = replacementEvent[interfaceName] || interfaceName; - var constructor = events[supportedEvents[name]]; - - if (constructor) { - var e = new constructor(); - e._initialized = false; - return e; - } - else { - utils.NotSupportedError(); - } - }}, - - // See: http://www.w3.org/TR/dom/#dom-document-createtreewalker - createTreeWalker: {value: function (root, whatToShow, filter) { - if (!root) { throw new TypeError("root argument is required"); } - if (!(root instanceof Node)) { throw new TypeError("root not a node"); } - whatToShow = whatToShow === undefined ? NodeFilter.SHOW_ALL : (+whatToShow); - filter = filter === undefined ? null : filter; - - return new TreeWalker(root, whatToShow, filter); - }}, - - // See: http://www.w3.org/TR/dom/#dom-document-createnodeiterator - createNodeIterator: {value: function (root, whatToShow, filter) { - if (!root) { throw new TypeError("root argument is required"); } - if (!(root instanceof Node)) { throw new TypeError("root not a node"); } - whatToShow = whatToShow === undefined ? NodeFilter.SHOW_ALL : (+whatToShow); - filter = filter === undefined ? null : filter; - - return new NodeIterator(root, whatToShow, filter); - }}, - - _attachNodeIterator: { value: function(ni) { - // XXX ideally this should be a weak reference from Document to NodeIterator - if (!this._nodeIterators) { this._nodeIterators = []; } - this._nodeIterators.push(ni); - }}, - - _detachNodeIterator: { value: function(ni) { - // ni should always be in list of node iterators - var idx = this._nodeIterators.indexOf(ni); - this._nodeIterators.splice(idx, 1); - }}, - - _preremoveNodeIterators: { value: function(toBeRemoved) { - if (this._nodeIterators) { - this._nodeIterators.forEach(function(ni) { ni._preremove(toBeRemoved); }); - } - }}, - - // Maintain the documentElement and - // doctype properties of the document. Each of the following - // methods chains to the Node implementation of the method - // to do the actual inserting, removal or replacement. - - _updateDocTypeElement: { value: function _updateDocTypeElement() { - this.doctype = this.documentElement = null; - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === Node.DOCUMENT_TYPE_NODE) - this.doctype = kid; - else if (kid.nodeType === Node.ELEMENT_NODE) - this.documentElement = kid; - } - }}, - - insertBefore: { value: function insertBefore(child, refChild) { - Node.prototype.insertBefore.call(this, child, refChild); - this._updateDocTypeElement(); - return child; - }}, - - replaceChild: { value: function replaceChild(node, child) { - Node.prototype.replaceChild.call(this, node, child); - this._updateDocTypeElement(); - return child; - }}, - - removeChild: { value: function removeChild(child) { - Node.prototype.removeChild.call(this, child); - this._updateDocTypeElement(); - return child; - }}, - - getElementById: { value: function(id) { - var n = this.byId[id]; - if (!n) return null; - if (n instanceof MultiId) { // there was more than one element with this id - return n.getFirst(); - } - return n; - }}, - - _hasMultipleElementsWithId: { value: function(id) { - // Used internally by querySelectorAll optimization - return (this.byId[id] instanceof MultiId); - }}, - - // Just copy this method from the Element prototype - getElementsByName: { value: Element.prototype.getElementsByName }, - getElementsByTagName: { value: Element.prototype.getElementsByTagName }, - getElementsByTagNameNS: { value: Element.prototype.getElementsByTagNameNS }, - getElementsByClassName: { value: Element.prototype.getElementsByClassName }, - - adoptNode: { value: function adoptNode(node) { - if (node.nodeType === Node.DOCUMENT_NODE) utils.NotSupportedError(); - if (node.nodeType === Node.ATTRIBUTE_NODE) { return node; } - - if (node.parentNode) node.parentNode.removeChild(node); - - if (node.ownerDocument !== this) - recursivelySetOwner(node, this); - - return node; - }}, - - importNode: { value: function importNode(node, deep) { - return this.adoptNode(node.cloneNode(deep)); - }, writable: isApiWritable }, - - // The following attributes and methods are from the HTML spec - origin: { get: function origin() { return null; } }, - characterSet: { get: function characterSet() { return "UTF-8"; } }, - contentType: { get: function contentType() { return this._contentType; } }, - URL: { get: function URL() { return this._address; } }, - domain: { get: utils.nyi, set: utils.nyi }, - referrer: { get: utils.nyi }, - cookie: { get: utils.nyi, set: utils.nyi }, - lastModified: { get: utils.nyi }, - location: { - get: function() { - return this.defaultView ? this.defaultView.location : null; // gh #75 - }, - set: utils.nyi - }, - _titleElement: { - get: function() { - // The title element of a document is the first title element in the - // document in tree order, if there is one, or null otherwise. - return this.getElementsByTagName('title').item(0) || null; - } - }, - title: { - get: function() { - var elt = this._titleElement; - // The child text content of the title element, or '' if null. - var value = elt ? elt.textContent : ''; - // Strip and collapse whitespace in value - return value.replace(/[ \t\n\r\f]+/g, ' ').replace(/(^ )|( $)/g, ''); - }, - set: function(value) { - var elt = this._titleElement; - var head = this.head; - if (!elt && !head) { return; /* according to spec */ } - if (!elt) { - elt = this.createElement('title'); - head.appendChild(elt); - } - elt.textContent = value; - } - }, - dir: mirrorAttr(function() { - var htmlElement = this.documentElement; - if (htmlElement && htmlElement.tagName === 'HTML') { return htmlElement; } - }, 'dir', ''), - fgColor: mirrorAttr(function() { return this.body; }, 'text', ''), - linkColor: mirrorAttr(function() { return this.body; }, 'link', ''), - vlinkColor: mirrorAttr(function() { return this.body; }, 'vLink', ''), - alinkColor: mirrorAttr(function() { return this.body; }, 'aLink', ''), - bgColor: mirrorAttr(function() { return this.body; }, 'bgColor', ''), - - // Historical aliases of Document#characterSet - charset: { get: function() { return this.characterSet; } }, - inputEncoding: { get: function() { return this.characterSet; } }, - - scrollingElement: { - get: function() { - return this._quirks ? this.body : this.documentElement; - } - }, - - // Return the first child of the document element. - // XXX For now, setting this attribute is not implemented. - body: { - get: function() { - return namedHTMLChild(this.documentElement, 'body'); - }, - set: utils.nyi - }, - // Return the first child of the document element. - head: { get: function() { - return namedHTMLChild(this.documentElement, 'head'); - }}, - images: { get: utils.nyi }, - embeds: { get: utils.nyi }, - plugins: { get: utils.nyi }, - links: { get: utils.nyi }, - forms: { get: utils.nyi }, - scripts: { get: utils.nyi }, - applets: { get: function() { return []; } }, - activeElement: { get: function() { return null; } }, - innerHTML: { - get: function() { return this.serialize(); }, - set: utils.nyi - }, - outerHTML: { - get: function() { return this.serialize(); }, - set: utils.nyi - }, - - write: { value: function(args) { - if (!this.isHTML) utils.InvalidStateError(); - - // XXX: still have to implement the ignore part - if (!this._parser /* && this._ignore_destructive_writes > 0 */ ) - return; - - if (!this._parser) { - // XXX call document.open, etc. - } - - var s = arguments.join(''); - - // If the Document object's reload override flag is set, then - // append the string consisting of the concatenation of all the - // arguments to the method to the Document's reload override - // buffer. - // XXX: don't know what this is about. Still have to do it - - // If there is no pending parsing-blocking script, have the - // tokenizer process the characters that were inserted, one at a - // time, processing resulting tokens as they are emitted, and - // stopping when the tokenizer reaches the insertion point or when - // the processing of the tokenizer is aborted by the tree - // construction stage (this can happen if a script end tag token is - // emitted by the tokenizer). - - // XXX: still have to do the above. Sounds as if we don't - // always call parse() here. If we're blocked, then we just - // insert the text into the stream but don't parse it reentrantly... - - // Invoke the parser reentrantly - this._parser.parse(s); - }}, - - writeln: { value: function writeln(args) { - this.write(Array.prototype.join.call(arguments, '') + '\n'); - }}, - - open: { value: function() { - this.documentElement = null; - }}, - - close: { value: function() { - this.readyState = 'interactive'; - this._dispatchEvent(new Event('readystatechange'), true); - this._dispatchEvent(new Event('DOMContentLoaded'), true); - this.readyState = 'complete'; - this._dispatchEvent(new Event('readystatechange'), true); - if (this.defaultView) { - this.defaultView._dispatchEvent(new Event('load'), true); - } - }}, - - // Utility methods - clone: { value: function clone() { - var d = new Document(this.isHTML, this._address); - d._quirks = this._quirks; - d._contentType = this._contentType; - return d; - }}, - - // We need to adopt the nodes if we do a deep clone - cloneNode: { value: function cloneNode(deep) { - var clone = Node.prototype.cloneNode.call(this, false); - if (deep) { - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - clone._appendChild(clone.importNode(kid, true)); - } - } - clone._updateDocTypeElement(); - return clone; - }}, - - isEqual: { value: function isEqual(n) { - // Any two documents are shallowly equal. - // Node.isEqualNode will also test the children - return true; - }}, - - // Implementation-specific function. Called when a text, comment, - // or pi value changes. - mutateValue: { value: function(node) { - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.VALUE, - target: node, - data: node.data - }); - } - }}, - - // Invoked when an attribute's value changes. Attr holds the new - // value. oldval is the old value. Attribute mutations can also - // involve changes to the prefix (and therefore the qualified name) - mutateAttr: { value: function(attr, oldval) { - // Manage id->element mapping for getElementsById() - // XXX: this special case id handling should not go here, - // but in the attribute declaration for the id attribute - /* - if (attr.localName === 'id' && attr.namespaceURI === null) { - if (oldval) delId(oldval, attr.ownerElement); - addId(attr.value, attr.ownerElement); - } - */ - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.ATTR, - target: attr.ownerElement, - attr: attr - }); - } - }}, - - // Used by removeAttribute and removeAttributeNS for attributes. - mutateRemoveAttr: { value: function(attr) { -/* -* This is now handled in Attributes.js - // Manage id to element mapping - if (attr.localName === 'id' && attr.namespaceURI === null) { - this.delId(attr.value, attr.ownerElement); - } -*/ - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.REMOVE_ATTR, - target: attr.ownerElement, - attr: attr - }); - } - }}, - - // Called by Node.removeChild, etc. to remove a rooted element from - // the tree. Only needs to generate a single mutation event when a - // node is removed, but must recursively mark all descendants as not - // rooted. - mutateRemove: { value: function(node) { - // Send a single mutation event - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.REMOVE, - target: node.parentNode, - node: node - }); - } - - // Mark this and all descendants as not rooted - recursivelyUproot(node); - }}, - - // Called when a new element becomes rooted. It must recursively - // generate mutation events for each of the children, and mark them all - // as rooted. - mutateInsert: { value: function(node) { - // Mark node and its descendants as rooted - recursivelyRoot(node); - - // Send a single mutation event - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.INSERT, - target: node.parentNode, - node: node - }); - } - }}, - - // Called when a rooted element is moved within the document - mutateMove: { value: function(node) { - if (this.mutationHandler) { - this.mutationHandler({ - type: MUTATE.MOVE, - target: node - }); - } - }}, - - - // Add a mapping from id to n for n.ownerDocument - addId: { value: function addId(id, n) { - var val = this.byId[id]; - if (!val) { - this.byId[id] = n; - } - else { - // TODO: Add a way to opt-out console warnings - //console.warn('Duplicate element id ' + id); - if (!(val instanceof MultiId)) { - val = new MultiId(val); - this.byId[id] = val; - } - val.add(n); - } - }}, - - // Delete the mapping from id to n for n.ownerDocument - delId: { value: function delId(id, n) { - var val = this.byId[id]; - utils.assert(val); - - if (val instanceof MultiId) { - val.del(n); - if (val.length === 1) { // convert back to a single node - this.byId[id] = val.downgrade(); - } - } - else { - this.byId[id] = undefined; - } - }}, - - _resolve: { value: function(href) { - //XXX: Cache the URL - return new URL(this._documentBaseURL).resolve(href); - }}, - - _documentBaseURL: { get: function() { - // XXX: This is not implemented correctly yet - var url = this._address; - if (url === 'about:blank') url = '/'; - - var base = this.querySelector('base[href]'); - if (base) { - return new URL(url).resolve(base.getAttribute('href')); - } - return url; - - // The document base URL of a Document object is the - // absolute URL obtained by running these substeps: - - // Let fallback base url be the document's address. - - // If fallback base url is about:blank, and the - // Document's browsing context has a creator browsing - // context, then let fallback base url be the document - // base URL of the creator Document instead. - - // If the Document is an iframe srcdoc document, then - // let fallback base url be the document base URL of - // the Document's browsing context's browsing context - // container's Document instead. - - // If there is no base element that has an href - // attribute, then the document base URL is fallback - // base url; abort these steps. Otherwise, let url be - // the value of the href attribute of the first such - // element. - - // Resolve url relative to fallback base url (thus, - // the base href attribute isn't affected by xml:base - // attributes). - - // The document base URL is the result of the previous - // step if it was successful; otherwise it is fallback - // base url. - }}, - - _templateDoc: { get: function() { - if (!this._templateDocCache) { - // "associated inert template document" - var newDoc = new Document(this.isHTML, this._address); - this._templateDocCache = newDoc._templateDocCache = newDoc; - } - return this._templateDocCache; - }}, - - querySelector: { value: function(selector) { - return select(selector, this)[0]; - }}, - - querySelectorAll: { value: function(selector) { - var nodes = select(selector, this); - return nodes.item ? nodes : new NodeList(nodes); - }} - -}); - - -var eventHandlerTypes = [ - 'abort', 'canplay', 'canplaythrough', 'change', 'click', 'contextmenu', - 'cuechange', 'dblclick', 'drag', 'dragend', 'dragenter', 'dragleave', - 'dragover', 'dragstart', 'drop', 'durationchange', 'emptied', 'ended', - 'input', 'invalid', 'keydown', 'keypress', 'keyup', 'loadeddata', - 'loadedmetadata', 'loadstart', 'mousedown', 'mousemove', 'mouseout', - 'mouseover', 'mouseup', 'mousewheel', 'pause', 'play', 'playing', - 'progress', 'ratechange', 'readystatechange', 'reset', 'seeked', - 'seeking', 'select', 'show', 'stalled', 'submit', 'suspend', - 'timeupdate', 'volumechange', 'waiting', - - 'blur', 'error', 'focus', 'load', 'scroll' -]; - -// Add event handler idl attribute getters and setters to Document -eventHandlerTypes.forEach(function(type) { - // Define the event handler registration IDL attribute for this type - Object.defineProperty(Document.prototype, 'on' + type, { - get: function() { - return this._getEventHandler(type); - }, - set: function(v) { - this._setEventHandler(type, v); - } - }); -}); - -function namedHTMLChild(parent, name) { - if (parent && parent.isHTML) { - for (var kid = parent.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === Node.ELEMENT_NODE && - kid.localName === name && - kid.namespaceURI === NAMESPACE.HTML) { - return kid; - } - } - } - return null; -} - -function root(n) { - n._nid = n.ownerDocument._nextnid++; - n.ownerDocument._nodes[n._nid] = n; - // Manage id to element mapping - if (n.nodeType === Node.ELEMENT_NODE) { - var id = n.getAttribute('id'); - if (id) n.ownerDocument.addId(id, n); - - // Script elements need to know when they're inserted - // into the document - if (n._roothook) n._roothook(); - } -} - -function uproot(n) { - // Manage id to element mapping - if (n.nodeType === Node.ELEMENT_NODE) { - var id = n.getAttribute('id'); - if (id) n.ownerDocument.delId(id, n); - } - n.ownerDocument._nodes[n._nid] = undefined; - n._nid = undefined; -} - -function recursivelyRoot(node) { - root(node); - // XXX: - // accessing childNodes on a leaf node creates a new array the - // first time, so be careful to write this loop so that it - // doesn't do that. node is polymorphic, so maybe this is hard to - // optimize? Try switching on nodeType? -/* - if (node.hasChildNodes()) { - var kids = node.childNodes; - for(var i = 0, n = kids.length; i < n; i++) - recursivelyRoot(kids[i]); - } -*/ - if (node.nodeType === Node.ELEMENT_NODE) { - for (var kid = node.firstChild; kid !== null; kid = kid.nextSibling) - recursivelyRoot(kid); - } -} - -function recursivelyUproot(node) { - uproot(node); - for (var kid = node.firstChild; kid !== null; kid = kid.nextSibling) - recursivelyUproot(kid); -} - -function recursivelySetOwner(node, owner) { - node.ownerDocument = owner; - node._lastModTime = undefined; // mod times are document-based - if (Object.prototype.hasOwnProperty.call(node, '_tagName')) { - node._tagName = undefined; // Element subclasses might need to change case - } - for (var kid = node.firstChild; kid !== null; kid = kid.nextSibling) - recursivelySetOwner(kid, owner); -} - -// A class for storing multiple nodes with the same ID -function MultiId(node) { - this.nodes = Object.create(null); - this.nodes[node._nid] = node; - this.length = 1; - this.firstNode = undefined; -} - -// Add a node to the list, with O(1) time -MultiId.prototype.add = function(node) { - if (!this.nodes[node._nid]) { - this.nodes[node._nid] = node; - this.length++; - this.firstNode = undefined; - } -}; - -// Remove a node from the list, with O(1) time -MultiId.prototype.del = function(node) { - if (this.nodes[node._nid]) { - delete this.nodes[node._nid]; - this.length--; - this.firstNode = undefined; - } -}; - -// Get the first node from the list, in the document order -// Takes O(N) time in the size of the list, with a cache that is invalidated -// when the list is modified. -MultiId.prototype.getFirst = function() { - /* jshint bitwise: false */ - if (!this.firstNode) { - var nid; - for (nid in this.nodes) { - if (this.firstNode === undefined || - this.firstNode.compareDocumentPosition(this.nodes[nid]) & Node.DOCUMENT_POSITION_PRECEDING) { - this.firstNode = this.nodes[nid]; - } - } - } - return this.firstNode; -}; - -// If there is only one node left, return it. Otherwise return "this". -MultiId.prototype.downgrade = function() { - if (this.length === 1) { - var nid; - for (nid in this.nodes) { - return this.nodes[nid]; - } - } - return this; -}; - - -/***/ }), - -/***/ 17948: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = DocumentFragment; - -var Node = __webpack_require__(97537); -var NodeList = __webpack_require__(64965); -var ContainerNode = __webpack_require__(38554); -var Element = __webpack_require__(77301); -var select = __webpack_require__(23509); -var utils = __webpack_require__(89076); - -function DocumentFragment(doc) { - ContainerNode.call(this); - this.nodeType = Node.DOCUMENT_FRAGMENT_NODE; - this.ownerDocument = doc; -} - -DocumentFragment.prototype = Object.create(ContainerNode.prototype, { - nodeName: { value: '#document-fragment' }, - nodeValue: { - get: function() { - return null; - }, - set: function() {} - }, - // Copy the text content getter/setter from Element - textContent: Object.getOwnPropertyDescriptor(Element.prototype, 'textContent'), - - // Copy the text content getter/setter from Element - innerText: Object.getOwnPropertyDescriptor(Element.prototype, 'innerText'), - - querySelector: { value: function(selector) { - // implement in terms of querySelectorAll - var nodes = this.querySelectorAll(selector); - return nodes.length ? nodes[0] : null; - }}, - querySelectorAll: { value: function(selector) { - // create a context - var context = Object.create(this); - // add some methods to the context for zest implementation, without - // adding them to the public DocumentFragment API - context.isHTML = true; // in HTML namespace (case-insensitive match) - context.getElementsByTagName = Element.prototype.getElementsByTagName; - context.nextElement = - Object.getOwnPropertyDescriptor(Element.prototype, 'firstElementChild'). - get; - // invoke zest - var nodes = select(selector, context); - return nodes.item ? nodes : new NodeList(nodes); - }}, - - // Utility methods - clone: { value: function clone() { - return new DocumentFragment(this.ownerDocument); - }}, - isEqual: { value: function isEqual(n) { - // Any two document fragments are shallowly equal. - // Node.isEqualNode() will test their children for equality - return true; - }}, - - // Non-standard, but useful (github issue #73) - innerHTML: { - get: function() { return this.serialize(); }, - set: utils.nyi - }, - outerHTML: { - get: function() { return this.serialize(); }, - set: utils.nyi - }, - -}); - - -/***/ }), - -/***/ 73092: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = DocumentType; - -var Node = __webpack_require__(97537); -var Leaf = __webpack_require__(8161); -var ChildNode = __webpack_require__(52091); - -function DocumentType(ownerDocument, name, publicId, systemId) { - Leaf.call(this); - this.nodeType = Node.DOCUMENT_TYPE_NODE; - this.ownerDocument = ownerDocument || null; - this.name = name; - this.publicId = publicId || ""; - this.systemId = systemId || ""; -} - -DocumentType.prototype = Object.create(Leaf.prototype, { - nodeName: { get: function() { return this.name; }}, - nodeValue: { - get: function() { return null; }, - set: function() {} - }, - - // Utility methods - clone: { value: function clone() { - return new DocumentType(this.ownerDocument, this.name, this.publicId, this.systemId); - }}, - - isEqual: { value: function isEqual(n) { - return this.name === n.name && - this.publicId === n.publicId && - this.systemId === n.systemId; - }} -}); - -Object.defineProperties(DocumentType.prototype, ChildNode); - - -/***/ }), - -/***/ 77301: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = Element; - -var xml = __webpack_require__(66798); -var utils = __webpack_require__(89076); -var NAMESPACE = utils.NAMESPACE; -var attributes = __webpack_require__(6548); -var Node = __webpack_require__(97537); -var NodeList = __webpack_require__(64965); -var NodeUtils = __webpack_require__(41608); -var FilteredElementList = __webpack_require__(61676); -var DOMException = __webpack_require__(46364); -var DOMTokenList = __webpack_require__(82840); -var select = __webpack_require__(23509); -var ContainerNode = __webpack_require__(38554); -var ChildNode = __webpack_require__(52091); -var NonDocumentTypeChildNode = __webpack_require__(32001); -var NamedNodeMap = __webpack_require__(49492); - -var uppercaseCache = Object.create(null); - -function Element(doc, localName, namespaceURI, prefix) { - ContainerNode.call(this); - this.nodeType = Node.ELEMENT_NODE; - this.ownerDocument = doc; - this.localName = localName; - this.namespaceURI = namespaceURI; - this.prefix = prefix; - this._tagName = undefined; - - // These properties maintain the set of attributes - this._attrsByQName = Object.create(null); // The qname->Attr map - this._attrsByLName = Object.create(null); // The ns|lname->Attr map - this._attrKeys = []; // attr index -> ns|lname -} - -function recursiveGetText(node, a) { - if (node.nodeType === Node.TEXT_NODE) { - a.push(node._data); - } - else { - for(var i = 0, n = node.childNodes.length; i < n; i++) - recursiveGetText(node.childNodes[i], a); - } -} - -Element.prototype = Object.create(ContainerNode.prototype, { - isHTML: { get: function isHTML() { - return this.namespaceURI === NAMESPACE.HTML && this.ownerDocument.isHTML; - }}, - tagName: { get: function tagName() { - if (this._tagName === undefined) { - var tn; - if (this.prefix === null) { - tn = this.localName; - } else { - tn = this.prefix + ':' + this.localName; - } - if (this.isHTML) { - var up = uppercaseCache[tn]; - if (!up) { - // Converting to uppercase can be slow, so cache the conversion. - uppercaseCache[tn] = up = utils.toASCIIUpperCase(tn); - } - tn = up; - } - this._tagName = tn; - } - return this._tagName; - }}, - nodeName: { get: function() { return this.tagName; }}, - nodeValue: { - get: function() { - return null; - }, - set: function() {} - }, - textContent: { - get: function() { - var strings = []; - recursiveGetText(this, strings); - return strings.join(''); - }, - set: function(newtext) { - this.removeChildren(); - if (newtext !== null && newtext !== undefined && newtext !== '') { - this._appendChild(this.ownerDocument.createTextNode(newtext)); - } - } - }, - innerText: { - get: function() { - var strings = []; - recursiveGetText(this, strings); - // Strip and collapse whitespace - // This doesn't 100% match the browser behavior, - // but should cover most of the cases. This is also similar to - // how Angular's renderer used to work: the `textContent` and `innerText` - // were almost equivalent from the renderer perspective. - // See: https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent#differences_from_innertext - return strings.join('').replace(/[ \t\n\f\r]+/g, ' ').trim(); - }, - set: function(newtext) { - this.removeChildren(); - if (newtext !== null && newtext !== undefined && newtext !== '') { - this._appendChild(this.ownerDocument.createTextNode(newtext)); - } - } - }, - innerHTML: { - get: function() { - return this.serialize(); - }, - set: utils.nyi - }, - outerHTML: { - get: function() { - // "the attribute must return the result of running the HTML fragment - // serialization algorithm on a fictional node whose only child is - // the context object" - // - // The serialization logic is intentionally implemented in a separate - // `NodeUtils` helper instead of the more obvious choice of a private - // `_serializeOne()` method on the `Node.prototype` in order to avoid - // the megamorphic `this._serializeOne` property access, which reduces - // performance unnecessarily. If you need specialized behavior for a - // certain subclass, you'll need to implement that in `NodeUtils`. - // See https://github.com/fgnass/domino/pull/142 for more information. - return NodeUtils.serializeOne(this, { nodeType: 0 }); - }, - set: function(v) { - var document = this.ownerDocument; - var parent = this.parentNode; - if (parent === null) { return; } - if (parent.nodeType === Node.DOCUMENT_NODE) { - utils.NoModificationAllowedError(); - } - if (parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { - parent = parent.ownerDocument.createElement("body"); - } - var parser = document.implementation.mozHTMLParser( - document._address, - parent - ); - parser.parse(v===null?'':String(v), true); - this.replaceWith(parser._asDocumentFragment()); - }, - }, - - _insertAdjacent: { value: function _insertAdjacent(position, node) { - var first = false; - switch(position) { - case 'beforebegin': - first = true; - /* falls through */ - case 'afterend': - var parent = this.parentNode; - if (parent === null) { return null; } - return parent.insertBefore(node, first ? this : this.nextSibling); - case 'afterbegin': - first = true; - /* falls through */ - case 'beforeend': - return this.insertBefore(node, first ? this.firstChild : null); - default: - return utils.SyntaxError(); - } - }}, - - insertAdjacentElement: { value: function insertAdjacentElement(position, element) { - if (element.nodeType !== Node.ELEMENT_NODE) { - throw new TypeError('not an element'); - } - position = utils.toASCIILowerCase(String(position)); - return this._insertAdjacent(position, element); - }}, - - insertAdjacentText: { value: function insertAdjacentText(position, data) { - var textNode = this.ownerDocument.createTextNode(data); - position = utils.toASCIILowerCase(String(position)); - this._insertAdjacent(position, textNode); - // "This method returns nothing because it existed before we had a chance - // to design it." - }}, - - insertAdjacentHTML: { value: function insertAdjacentHTML(position, text) { - position = utils.toASCIILowerCase(String(position)); - text = String(text); - var context; - switch(position) { - case 'beforebegin': - case 'afterend': - context = this.parentNode; - if (context === null || context.nodeType === Node.DOCUMENT_NODE) { - utils.NoModificationAllowedError(); - } - break; - case 'afterbegin': - case 'beforeend': - context = this; - break; - default: - utils.SyntaxError(); - } - if ( (!(context instanceof Element)) || ( - context.ownerDocument.isHTML && - context.localName === 'html' && - context.namespaceURI === NAMESPACE.HTML - ) ) { - context = context.ownerDocument.createElementNS(NAMESPACE.HTML, 'body'); - } - var parser = this.ownerDocument.implementation.mozHTMLParser( - this.ownerDocument._address, context - ); - parser.parse(text, true); - this._insertAdjacent(position, parser._asDocumentFragment()); - }}, - - children: { get: function() { - if (!this._children) { - this._children = new ChildrenCollection(this); - } - return this._children; - }}, - - attributes: { get: function() { - if (!this._attributes) { - this._attributes = new AttributesArray(this); - } - return this._attributes; - }}, - - - firstElementChild: { get: function() { - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === Node.ELEMENT_NODE) return kid; - } - return null; - }}, - - lastElementChild: { get: function() { - for (var kid = this.lastChild; kid !== null; kid = kid.previousSibling) { - if (kid.nodeType === Node.ELEMENT_NODE) return kid; - } - return null; - }}, - - childElementCount: { get: function() { - return this.children.length; - }}, - - - // Return the next element, in source order, after this one or - // null if there are no more. If root element is specified, - // then don't traverse beyond its subtree. - // - // This is not a DOM method, but is convenient for - // lazy traversals of the tree. - nextElement: { value: function(root) { - if (!root) root = this.ownerDocument.documentElement; - var next = this.firstElementChild; - if (!next) { - // don't use sibling if we're at root - if (this===root) return null; - next = this.nextElementSibling; - } - if (next) return next; - - // If we can't go down or across, then we have to go up - // and across to the parent sibling or another ancestor's - // sibling. Be careful, though: if we reach the root - // element, or if we reach the documentElement, then - // the traversal ends. - for(var parent = this.parentElement; - parent && parent !== root; - parent = parent.parentElement) { - - next = parent.nextElementSibling; - if (next) return next; - } - - return null; - }}, - - // XXX: - // Tests are currently failing for this function. - // Awaiting resolution of: - // http://lists.w3.org/Archives/Public/www-dom/2011JulSep/0016.html - getElementsByTagName: { value: function getElementsByTagName(lname) { - var filter; - if (!lname) return new NodeList(); - if (lname === '*') - filter = function() { return true; }; - else if (this.isHTML) - filter = htmlLocalNameElementFilter(lname); - else - filter = localNameElementFilter(lname); - - return new FilteredElementList(this, filter); - }}, - - getElementsByTagNameNS: { value: function getElementsByTagNameNS(ns, lname){ - var filter; - if (ns === '*' && lname === '*') - filter = function() { return true; }; - else if (ns === '*') - filter = localNameElementFilter(lname); - else if (lname === '*') - filter = namespaceElementFilter(ns); - else - filter = namespaceLocalNameElementFilter(ns, lname); - - return new FilteredElementList(this, filter); - }}, - - getElementsByClassName: { value: function getElementsByClassName(names){ - names = String(names).trim(); - if (names === '') { - var result = new NodeList(); // Empty node list - return result; - } - names = names.split(/[ \t\r\n\f]+/); // Split on ASCII whitespace - return new FilteredElementList(this, classNamesElementFilter(names)); - }}, - - getElementsByName: { value: function getElementsByName(name) { - return new FilteredElementList(this, elementNameFilter(String(name))); - }}, - - // Utility methods used by the public API methods above - clone: { value: function clone() { - var e; - - // XXX: - // Modify this to use the constructor directly or - // avoid error checking in some other way. In case we try - // to clone an invalid node that the parser inserted. - // - if (this.namespaceURI !== NAMESPACE.HTML || this.prefix || !this.ownerDocument.isHTML) { - e = this.ownerDocument.createElementNS( - this.namespaceURI, (this.prefix !== null) ? - (this.prefix + ':' + this.localName) : this.localName - ); - } else { - e = this.ownerDocument.createElement(this.localName); - } - - for(var i = 0, n = this._attrKeys.length; i < n; i++) { - var lname = this._attrKeys[i]; - var a = this._attrsByLName[lname]; - var b = a.cloneNode(); - b._setOwnerElement(e); - e._attrsByLName[lname] = b; - e._addQName(b); - } - e._attrKeys = this._attrKeys.concat(); - - return e; - }}, - - isEqual: { value: function isEqual(that) { - if (this.localName !== that.localName || - this.namespaceURI !== that.namespaceURI || - this.prefix !== that.prefix || - this._numattrs !== that._numattrs) - return false; - - // Compare the sets of attributes, ignoring order - // and ignoring attribute prefixes. - for(var i = 0, n = this._numattrs; i < n; i++) { - var a = this._attr(i); - if (!that.hasAttributeNS(a.namespaceURI, a.localName)) - return false; - if (that.getAttributeNS(a.namespaceURI,a.localName) !== a.value) - return false; - } - - return true; - }}, - - // This is the 'locate a namespace prefix' algorithm from the - // DOM specification. It is used by Node.lookupPrefix() - // (Be sure to compare DOM3 and DOM4 versions of spec.) - _lookupNamespacePrefix: { value: function _lookupNamespacePrefix(ns, originalElement) { - if ( - this.namespaceURI && - this.namespaceURI === ns && - this.prefix !== null && - originalElement.lookupNamespaceURI(this.prefix) === ns - ) { - return this.prefix; - } - - for(var i = 0, n = this._numattrs; i < n; i++) { - var a = this._attr(i); - if ( - a.prefix === 'xmlns' && - a.value === ns && - originalElement.lookupNamespaceURI(a.localName) === ns - ) { - return a.localName; - } - } - - var parent = this.parentElement; - return parent ? parent._lookupNamespacePrefix(ns, originalElement) : null; - }}, - - // This is the 'locate a namespace' algorithm for Element nodes - // from the DOM Core spec. It is used by Node#lookupNamespaceURI() - lookupNamespaceURI: { value: function lookupNamespaceURI(prefix) { - if (prefix === '' || prefix === undefined) { prefix = null; } - if (this.namespaceURI !== null && this.prefix === prefix) - return this.namespaceURI; - - for(var i = 0, n = this._numattrs; i < n; i++) { - var a = this._attr(i); - if (a.namespaceURI === NAMESPACE.XMLNS) { - if ( - (a.prefix === 'xmlns' && a.localName === prefix) || - (prefix === null && a.prefix === null && a.localName === 'xmlns') - ) { - return a.value || null; - } - } - } - - var parent = this.parentElement; - return parent ? parent.lookupNamespaceURI(prefix) : null; - }}, - - // - // Attribute handling methods and utilities - // - - /* - * Attributes in the DOM are tricky: - * - * - there are the 8 basic get/set/has/removeAttribute{NS} methods - * - * - but many HTML attributes are also 'reflected' through IDL - * attributes which means that they can be queried and set through - * regular properties of the element. There is just one attribute - * value, but two ways to get and set it. - * - * - Different HTML element types have different sets of reflected - attributes. - * - * - attributes can also be queried and set through the .attributes - * property of an element. This property behaves like an array of - * Attr objects. The value property of each Attr is writeable, so - * this is a third way to read and write attributes. - * - * - for efficiency, we really want to store attributes in some kind - * of name->attr map. But the attributes[] array is an array, not a - * map, which is kind of unnatural. - * - * - When using namespaces and prefixes, and mixing the NS methods - * with the non-NS methods, it is apparently actually possible for - * an attributes[] array to have more than one attribute with the - * same qualified name. And certain methods must operate on only - * the first attribute with such a name. So for these methods, an - * inefficient array-like data structure would be easier to - * implement. - * - * - The attributes[] array is live, not a snapshot, so changes to the - * attributes must be immediately visible through existing arrays. - * - * - When attributes are queried and set through IDL properties - * (instead of the get/setAttributes() method or the attributes[] - * array) they may be subject to type conversions, URL - * normalization, etc., so some extra processing is required in that - * case. - * - * - But access through IDL properties is probably the most common - * case, so we'd like that to be as fast as possible. - * - * - We can't just store attribute values in their parsed idl form, - * because setAttribute() has to return whatever string is passed to - * getAttribute even if it is not a legal, parseable value. So - * attribute values must be stored in unparsed string form. - * - * - We need to be able to send change notifications or mutation - * events of some sort to the renderer whenever an attribute value - * changes, regardless of the way in which it changes. - * - * - Some attributes, such as id and class affect other parts of the - * DOM API, like getElementById and getElementsByClassName and so - * for efficiency, we need to specially track changes to these - * special attributes. - * - * - Some attributes like class have different names (className) when - * reflected. - * - * - Attributes whose names begin with the string 'data-' are treated - specially. - * - * - Reflected attributes that have a boolean type in IDL have special - * behavior: setting them to false (in IDL) is the same as removing - * them with removeAttribute() - * - * - numeric attributes (like HTMLElement.tabIndex) can have default - * values that must be returned by the idl getter even if the - * content attribute does not exist. (The default tabIndex value - * actually varies based on the type of the element, so that is a - * tricky one). - * - * See - * http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#reflect - * for rules on how attributes are reflected. - * - */ - - getAttribute: { value: function getAttribute(qname) { - var attr = this.getAttributeNode(qname); - return attr ? attr.value : null; - }}, - - getAttributeNS: { value: function getAttributeNS(ns, lname) { - var attr = this.getAttributeNodeNS(ns, lname); - return attr ? attr.value : null; - }}, - - getAttributeNode: { value: function getAttributeNode(qname) { - qname = String(qname); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - var attr = this._attrsByQName[qname]; - if (!attr) return null; - - if (Array.isArray(attr)) // If there is more than one - attr = attr[0]; // use the first - - return attr; - }}, - - getAttributeNodeNS: { value: function getAttributeNodeNS(ns, lname) { - ns = (ns === undefined || ns === null) ? '' : String(ns); - lname = String(lname); - var attr = this._attrsByLName[ns + '|' + lname]; - return attr ? attr : null; - }}, - - hasAttribute: { value: function hasAttribute(qname) { - qname = String(qname); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - return this._attrsByQName[qname] !== undefined; - }}, - - hasAttributeNS: { value: function hasAttributeNS(ns, lname) { - ns = (ns === undefined || ns === null) ? '' : String(ns); - lname = String(lname); - var key = ns + '|' + lname; - return this._attrsByLName[key] !== undefined; - }}, - - hasAttributes: { value: function hasAttributes() { - return this._numattrs > 0; - }}, - - toggleAttribute: { value: function toggleAttribute(qname, force) { - qname = String(qname); - if (!xml.isValidName(qname)) utils.InvalidCharacterError(); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - var a = this._attrsByQName[qname]; - if (a === undefined) { - if (force === undefined || force === true) { - this._setAttribute(qname, ''); - return true; - } - return false; - } else { - if (force === undefined || force === false) { - this.removeAttribute(qname); - return false; - } - return true; - } - }}, - - // Set the attribute without error checking. The parser uses this. - _setAttribute: { value: function _setAttribute(qname, value) { - // XXX: the spec says that this next search should be done - // on the local name, but I think that is an error. - // email pending on www-dom about it. - var attr = this._attrsByQName[qname]; - var isnew; - if (!attr) { - attr = this._newattr(qname); - isnew = true; - } - else { - if (Array.isArray(attr)) attr = attr[0]; - } - - // Now set the attribute value on the new or existing Attr object. - // The Attr.value setter method handles mutation events, etc. - attr.value = value; - if (this._attributes) this._attributes[qname] = attr; - if (isnew && this._newattrhook) this._newattrhook(qname, value); - }}, - - // Check for errors, and then set the attribute - setAttribute: { value: function setAttribute(qname, value) { - qname = String(qname); - if (!xml.isValidName(qname)) utils.InvalidCharacterError(); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - this._setAttribute(qname, String(value)); - }}, - - - // The version with no error checking used by the parser - _setAttributeNS: { value: function _setAttributeNS(ns, qname, value) { - var pos = qname.indexOf(':'), prefix, lname; - if (pos < 0) { - prefix = null; - lname = qname; - } - else { - prefix = qname.substring(0, pos); - lname = qname.substring(pos+1); - } - - if (ns === '' || ns === undefined) ns = null; - var key = (ns === null ? '' : ns) + '|' + lname; - - var attr = this._attrsByLName[key]; - var isnew; - if (!attr) { - attr = new Attr(this, lname, prefix, ns); - isnew = true; - this._attrsByLName[key] = attr; - if (this._attributes) { - this._attributes[this._attrKeys.length] = attr; - } - this._attrKeys.push(key); - - // We also have to make the attr searchable by qname. - // But we have to be careful because there may already - // be an attr with this qname. - this._addQName(attr); - } - else if (false /* changed in DOM 4 */) {} - attr.value = value; // Automatically sends mutation event - if (isnew && this._newattrhook) this._newattrhook(qname, value); - }}, - - // Do error checking then call _setAttributeNS - setAttributeNS: { value: function setAttributeNS(ns, qname, value) { - // Convert parameter types according to WebIDL - ns = (ns === null || ns === undefined || ns === '') ? null : String(ns); - qname = String(qname); - if (!xml.isValidQName(qname)) utils.InvalidCharacterError(); - - var pos = qname.indexOf(':'); - var prefix = (pos < 0) ? null : qname.substring(0, pos); - - if ((prefix !== null && ns === null) || - (prefix === 'xml' && ns !== NAMESPACE.XML) || - ((qname === 'xmlns' || prefix === 'xmlns') && - (ns !== NAMESPACE.XMLNS)) || - (ns === NAMESPACE.XMLNS && - !(qname === 'xmlns' || prefix === 'xmlns'))) - utils.NamespaceError(); - - this._setAttributeNS(ns, qname, String(value)); - }}, - - setAttributeNode: { value: function setAttributeNode(attr) { - if (attr.ownerElement !== null && attr.ownerElement !== this) { - throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR); - } - var result = null; - var oldAttrs = this._attrsByQName[attr.name]; - if (oldAttrs) { - if (!Array.isArray(oldAttrs)) { oldAttrs = [ oldAttrs ]; } - if (oldAttrs.some(function(a) { return a===attr; })) { - return attr; - } else if (attr.ownerElement !== null) { - throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR); - } - oldAttrs.forEach(function(a) { this.removeAttributeNode(a); }, this); - result = oldAttrs[0]; - } - this.setAttributeNodeNS(attr); - return result; - }}, - - setAttributeNodeNS: { value: function setAttributeNodeNS(attr) { - if (attr.ownerElement !== null) { - throw new DOMException(DOMException.INUSE_ATTRIBUTE_ERR); - } - var ns = attr.namespaceURI; - var key = (ns === null ? '' : ns) + '|' + attr.localName; - var oldAttr = this._attrsByLName[key]; - if (oldAttr) { this.removeAttributeNode(oldAttr); } - attr._setOwnerElement(this); - this._attrsByLName[key] = attr; - if (this._attributes) { - this._attributes[this._attrKeys.length] = attr; - } - this._attrKeys.push(key); - this._addQName(attr); - if (this._newattrhook) this._newattrhook(attr.name, attr.value); - return oldAttr || null; - }}, - - removeAttribute: { value: function removeAttribute(qname) { - qname = String(qname); - if (/[A-Z]/.test(qname) && this.isHTML) - qname = utils.toASCIILowerCase(qname); - - var attr = this._attrsByQName[qname]; - if (!attr) return; - - // If there is more than one match for this qname - // so don't delete the qname mapping, just remove the first - // element from it. - if (Array.isArray(attr)) { - if (attr.length > 2) { - attr = attr.shift(); // remove it from the array - } - else { - this._attrsByQName[qname] = attr[1]; - attr = attr[0]; - } - } - else { - // only a single match, so remove the qname mapping - this._attrsByQName[qname] = undefined; - } - - var ns = attr.namespaceURI; - // Now attr is the removed attribute. Figure out its - // ns+lname key and remove it from the other mapping as well. - var key = (ns === null ? '' : ns) + '|' + attr.localName; - this._attrsByLName[key] = undefined; - - var i = this._attrKeys.indexOf(key); - if (this._attributes) { - Array.prototype.splice.call(this._attributes, i, 1); - this._attributes[qname] = undefined; - } - this._attrKeys.splice(i, 1); - - // Onchange handler for the attribute - var onchange = attr.onchange; - attr._setOwnerElement(null); - if (onchange) { - onchange.call(attr, this, attr.localName, attr.value, null); - } - // Mutation event - if (this.rooted) this.ownerDocument.mutateRemoveAttr(attr); - }}, - - removeAttributeNS: { value: function removeAttributeNS(ns, lname) { - ns = (ns === undefined || ns === null) ? '' : String(ns); - lname = String(lname); - var key = ns + '|' + lname; - var attr = this._attrsByLName[key]; - if (!attr) return; - - this._attrsByLName[key] = undefined; - - var i = this._attrKeys.indexOf(key); - if (this._attributes) { - Array.prototype.splice.call(this._attributes, i, 1); - } - this._attrKeys.splice(i, 1); - - // Now find the same Attr object in the qname mapping and remove it - // But be careful because there may be more than one match. - this._removeQName(attr); - - // Onchange handler for the attribute - var onchange = attr.onchange; - attr._setOwnerElement(null); - if (onchange) { - onchange.call(attr, this, attr.localName, attr.value, null); - } - // Mutation event - if (this.rooted) this.ownerDocument.mutateRemoveAttr(attr); - }}, - - removeAttributeNode: { value: function removeAttributeNode(attr) { - var ns = attr.namespaceURI; - var key = (ns === null ? '' : ns) + '|' + attr.localName; - if (this._attrsByLName[key] !== attr) { - utils.NotFoundError(); - } - this.removeAttributeNS(ns, attr.localName); - return attr; - }}, - - getAttributeNames: { value: function getAttributeNames() { - var elt = this; - return this._attrKeys.map(function(key) { - return elt._attrsByLName[key].name; - }); - }}, - - // This 'raw' version of getAttribute is used by the getter functions - // of reflected attributes. It skips some error checking and - // namespace steps - _getattr: { value: function _getattr(qname) { - // Assume that qname is already lowercased, so don't do it here. - // Also don't check whether attr is an array: a qname with no - // prefix will never have two matching Attr objects (because - // setAttributeNS doesn't allow a non-null namespace with a - // null prefix. - var attr = this._attrsByQName[qname]; - return attr ? attr.value : null; - }}, - - // The raw version of setAttribute for reflected idl attributes. - _setattr: { value: function _setattr(qname, value) { - var attr = this._attrsByQName[qname]; - var isnew; - if (!attr) { - attr = this._newattr(qname); - isnew = true; - } - attr.value = String(value); - if (this._attributes) this._attributes[qname] = attr; - if (isnew && this._newattrhook) this._newattrhook(qname, value); - }}, - - // Create a new Attr object, insert it, and return it. - // Used by setAttribute() and by set() - _newattr: { value: function _newattr(qname) { - var attr = new Attr(this, qname, null, null); - var key = '|' + qname; - this._attrsByQName[qname] = attr; - this._attrsByLName[key] = attr; - if (this._attributes) { - this._attributes[this._attrKeys.length] = attr; - } - this._attrKeys.push(key); - return attr; - }}, - - // Add a qname->Attr mapping to the _attrsByQName object, taking into - // account that there may be more than one attr object with the - // same qname - _addQName: { value: function(attr) { - var qname = attr.name; - var existing = this._attrsByQName[qname]; - if (!existing) { - this._attrsByQName[qname] = attr; - } - else if (Array.isArray(existing)) { - existing.push(attr); - } - else { - this._attrsByQName[qname] = [existing, attr]; - } - if (this._attributes) this._attributes[qname] = attr; - }}, - - // Remove a qname->Attr mapping to the _attrsByQName object, taking into - // account that there may be more than one attr object with the - // same qname - _removeQName: { value: function(attr) { - var qname = attr.name; - var target = this._attrsByQName[qname]; - - if (Array.isArray(target)) { - var idx = target.indexOf(attr); - utils.assert(idx !== -1); // It must be here somewhere - if (target.length === 2) { - this._attrsByQName[qname] = target[1-idx]; - if (this._attributes) { - this._attributes[qname] = this._attrsByQName[qname]; - } - } else { - target.splice(idx, 1); - if (this._attributes && this._attributes[qname] === attr) { - this._attributes[qname] = target[0]; - } - } - } - else { - utils.assert(target === attr); // If only one, it must match - this._attrsByQName[qname] = undefined; - if (this._attributes) { - this._attributes[qname] = undefined; - } - } - }}, - - // Return the number of attributes - _numattrs: { get: function() { return this._attrKeys.length; }}, - // Return the nth Attr object - _attr: { value: function(n) { - return this._attrsByLName[this._attrKeys[n]]; - }}, - - // Define getters and setters for an 'id' property that reflects - // the content attribute 'id'. - id: attributes.property({name: 'id'}), - - // Define getters and setters for a 'className' property that reflects - // the content attribute 'class'. - className: attributes.property({name: 'class'}), - - classList: { get: function() { - var self = this; - if (this._classList) { - return this._classList; - } - var dtlist = new DOMTokenList( - function() { - return self.className || ""; - }, - function(v) { - self.className = v; - } - ); - this._classList = dtlist; - return dtlist; - }, set: function(v) { this.className = v; }}, - - matches: { value: function(selector) { - return select.matches(this, selector); - }}, - - closest: { value: function(selector) { - var el = this; - do { - if (el.matches && el.matches(selector)) { return el; } - el = el.parentElement || el.parentNode; - } while (el !== null && el.nodeType === Node.ELEMENT_NODE); - return null; - }}, - - querySelector: { value: function(selector) { - return select(selector, this)[0]; - }}, - - querySelectorAll: { value: function(selector) { - var nodes = select(selector, this); - return nodes.item ? nodes : new NodeList(nodes); - }} - -}); - -Object.defineProperties(Element.prototype, ChildNode); -Object.defineProperties(Element.prototype, NonDocumentTypeChildNode); - -// Register special handling for the id attribute -attributes.registerChangeHandler(Element, 'id', - function(element, lname, oldval, newval) { - if (element.rooted) { - if (oldval) { - element.ownerDocument.delId(oldval, element); - } - if (newval) { - element.ownerDocument.addId(newval, element); - } - } - } -); -attributes.registerChangeHandler(Element, 'class', - function(element, lname, oldval, newval) { - if (element._classList) { element._classList._update(); } - } -); - -// The Attr class represents a single attribute. The values in -// _attrsByQName and _attrsByLName are instances of this class. -function Attr(elt, lname, prefix, namespace, value) { - // localName and namespace are constant for any attr object. - // But value may change. And so can prefix, and so, therefore can name. - this.localName = lname; - this.prefix = (prefix===null || prefix==='') ? null : ('' + prefix); - this.namespaceURI = (namespace===null || namespace==='') ? null : ('' + namespace); - this.data = value; - // Set ownerElement last to ensure it is hooked up to onchange handler - this._setOwnerElement(elt); -} - -// In DOM 3 Attr was supposed to extend Node; in DOM 4 that was abandoned. -Attr.prototype = Object.create(Object.prototype, { - ownerElement: { - get: function() { return this._ownerElement; }, - }, - _setOwnerElement: { value: function _setOwnerElement(elt) { - this._ownerElement = elt; - if (this.prefix === null && this.namespaceURI === null && elt) { - this.onchange = elt._attributeChangeHandlers[this.localName]; - } else { - this.onchange = null; - } - }}, - - name: { get: function() { - return this.prefix ? this.prefix + ':' + this.localName : this.localName; - }}, - - specified: { get: function() { - // Deprecated - return true; - }}, - - value: { - get: function() { - return this.data; - }, - set: function(value) { - var oldval = this.data; - value = (value === undefined) ? '' : value + ''; - if (value === oldval) return; - - this.data = value; - - // Run the onchange hook for the attribute - // if there is one. - if (this.ownerElement) { - if (this.onchange) - this.onchange(this.ownerElement,this.localName, oldval, value); - - // Generate a mutation event if the element is rooted - if (this.ownerElement.rooted) - this.ownerElement.ownerDocument.mutateAttr(this, oldval); - } - }, - }, - - cloneNode: { value: function cloneNode(deep) { - // Both this method and Document#createAttribute*() create unowned Attrs - return new Attr( - null, this.localName, this.prefix, this.namespaceURI, this.data - ); - }}, - - // Legacy aliases (see gh#70 and https://dom.spec.whatwg.org/#interface-attr) - nodeType: { get: function() { return Node.ATTRIBUTE_NODE; } }, - nodeName: { get: function() { return this.name; } }, - nodeValue: { - get: function() { return this.value; }, - set: function(v) { this.value = v; }, - }, - textContent: { - get: function() { return this.value; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } - this.value = v; - }, - }, - innerText: { - get: function() { return this.value; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } - this.value = v; - }, - }, -}); -// Sneakily export this class for use by Document.createAttribute() -Element._Attr = Attr; - -// The attributes property of an Element will be an instance of this class. -// This class is really just a dummy, though. It only defines a length -// property and an item() method. The AttrArrayProxy that -// defines the public API just uses the Element object itself. -function AttributesArray(elt) { - NamedNodeMap.call(this, elt); - for (var name in elt._attrsByQName) { - this[name] = elt._attrsByQName[name]; - } - for (var i = 0; i < elt._attrKeys.length; i++) { - this[i] = elt._attrsByLName[elt._attrKeys[i]]; - } -} -AttributesArray.prototype = Object.create(NamedNodeMap.prototype, { - length: { get: function() { - return this.element._attrKeys.length; - }, set: function() { /* ignore */ } }, - item: { value: function(n) { - /* jshint bitwise: false */ - n = n >>> 0; - if (n >= this.length) { return null; } - return this.element._attrsByLName[this.element._attrKeys[n]]; - /* jshint bitwise: true */ - } }, -}); - -// We can't make direct array access work (without Proxies, node >=6) -// but we can make `Array.from(node.attributes)` and for-of loops work. -if (globalThis.Symbol?.iterator) { - AttributesArray.prototype[globalThis.Symbol.iterator] = function() { - var i=0, n=this.length, self=this; - return { - next: function() { - if (ielement map. - // It is not part of the HTMLCollection API, but we need it in - // src/HTMLCollectionProxy - namedItems: { get: function() { - this.updateCache(); - return this.childrenByName; - } }, - - updateCache: { value: function updateCache() { - var namedElts = /^(a|applet|area|embed|form|frame|frameset|iframe|img|object)$/; - if (this.lastModTime !== this.element.lastModTime) { - this.lastModTime = this.element.lastModTime; - - var n = this.childrenByNumber && this.childrenByNumber.length || 0; - for(var i = 0; i < n; i++) { - this[i] = undefined; - } - - this.childrenByNumber = []; - this.childrenByName = Object.create(null); - - for (var c = this.element.firstChild; c !== null; c = c.nextSibling) { - if (c.nodeType === Node.ELEMENT_NODE) { - - this[this.childrenByNumber.length] = c; - this.childrenByNumber.push(c); - - // XXX Are there any requirements about the namespace - // of the id property? - var id = c.getAttribute('id'); - - // If there is an id that is not already in use... - if (id && !this.childrenByName[id]) - this.childrenByName[id] = c; - - // For certain HTML elements we check the name attribute - var name = c.getAttribute('name'); - if (name && - this.element.namespaceURI === NAMESPACE.HTML && - namedElts.test(this.element.localName) && - !this.childrenByName[name]) - this.childrenByName[id] = c; - } - } - } - } }, -}); - -// These functions return predicates for filtering elements. -// They're used by the Document and Element classes for methods like -// getElementsByTagName and getElementsByClassName - -function localNameElementFilter(lname) { - return function(e) { return e.localName === lname; }; -} - -function htmlLocalNameElementFilter(lname) { - var lclname = utils.toASCIILowerCase(lname); - if (lclname === lname) - return localNameElementFilter(lname); - - return function(e) { - return e.isHTML ? e.localName === lclname : e.localName === lname; - }; -} - -function namespaceElementFilter(ns) { - return function(e) { return e.namespaceURI === ns; }; -} - -function namespaceLocalNameElementFilter(ns, lname) { - return function(e) { - return e.namespaceURI === ns && e.localName === lname; - }; -} - -function classNamesElementFilter(names) { - return function(e) { - return names.every(function(n) { return e.classList.contains(n); }); - }; -} - -function elementNameFilter(name) { - return function(e) { - // All the *HTML elements* in the document with the given name attribute - if (e.namespaceURI !== NAMESPACE.HTML) { return false; } - return e.getAttribute('name') === name; - }; -} - - -/***/ }), - -/***/ 13441: -/***/ ((module) => { - -"use strict"; - -module.exports = Event; - -Event.CAPTURING_PHASE = 1; -Event.AT_TARGET = 2; -Event.BUBBLING_PHASE = 3; - -function Event(type, dictionary) { - // Initialize basic event properties - this.type = ''; - this.target = null; - this.currentTarget = null; - this.eventPhase = Event.AT_TARGET; - this.bubbles = false; - this.cancelable = false; - this.isTrusted = false; - this.defaultPrevented = false; - this.timeStamp = Date.now(); - - // Initialize internal flags - // XXX: Would it be better to inherit these defaults from the prototype? - this._propagationStopped = false; - this._immediatePropagationStopped = false; - this._initialized = true; - this._dispatching = false; - - // Now initialize based on the constructor arguments (if any) - if (type) this.type = type; - if (dictionary) { - for(var p in dictionary) { - this[p] = dictionary[p]; - } - } -} - -Event.prototype = Object.create(Object.prototype, { - constructor: { value: Event }, - stopPropagation: { value: function stopPropagation() { - this._propagationStopped = true; - }}, - - stopImmediatePropagation: { value: function stopImmediatePropagation() { - this._propagationStopped = true; - this._immediatePropagationStopped = true; - }}, - - preventDefault: { value: function preventDefault() { - if (this.cancelable) this.defaultPrevented = true; - }}, - - initEvent: { value: function initEvent(type, bubbles, cancelable) { - this._initialized = true; - if (this._dispatching) return; - - this._propagationStopped = false; - this._immediatePropagationStopped = false; - this.defaultPrevented = false; - this.isTrusted = false; - - this.target = null; - this.type = type; - this.bubbles = bubbles; - this.cancelable = cancelable; - }}, - -}); - - -/***/ }), - -/***/ 22356: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var Event = __webpack_require__(13441); -var MouseEvent = __webpack_require__(21440); -var utils = __webpack_require__(89076); - -module.exports = EventTarget; - -function EventTarget() {} - -EventTarget.prototype = { - // XXX - // See WebIDL §4.8 for details on object event handlers - // and how they should behave. We actually have to accept - // any object to addEventListener... Can't type check it. - // on registration. - - // XXX: - // Capturing event listeners are sort of rare. I think I can optimize - // them so that dispatchEvent can skip the capturing phase (or much of - // it). Each time a capturing listener is added, increment a flag on - // the target node and each of its ancestors. Decrement when removed. - // And update the counter when nodes are added and removed from the - // tree as well. Then, in dispatch event, the capturing phase can - // abort if it sees any node with a zero count. - addEventListener: function addEventListener(type, listener, capture) { - if (!listener) return; - if (capture === undefined) capture = false; - if (!this._listeners) this._listeners = Object.create(null); - if (!this._listeners[type]) this._listeners[type] = []; - var list = this._listeners[type]; - - // If this listener has already been registered, just return - for(var i = 0, n = list.length; i < n; i++) { - var l = list[i]; - if (l.listener === listener && l.capture === capture) - return; - } - - // Add an object to the list of listeners - var obj = { listener: listener, capture: capture }; - if (typeof listener === 'function') obj.f = listener; - list.push(obj); - }, - - removeEventListener: function removeEventListener(type, - listener, - capture) { - if (capture === undefined) capture = false; - if (this._listeners) { - var list = this._listeners[type]; - if (list) { - // Find the listener in the list and remove it - for(var i = 0, n = list.length; i < n; i++) { - var l = list[i]; - if (l.listener === listener && l.capture === capture) { - if (list.length === 1) { - this._listeners[type] = undefined; - } - else { - list.splice(i, 1); - } - return; - } - } - } - } - }, - - // This is the public API for dispatching untrusted public events. - // See _dispatchEvent for the implementation - dispatchEvent: function dispatchEvent(event) { - // Dispatch an untrusted event - return this._dispatchEvent(event, false); - }, - - // - // See DOMCore §4.4 - // XXX: I'll probably need another version of this method for - // internal use, one that does not set isTrusted to false. - // XXX: see Document._dispatchEvent: perhaps that and this could - // call a common internal function with different settings of - // a trusted boolean argument - // - // XXX: - // The spec has changed in how to deal with handlers registered - // on idl or content attributes rather than with addEventListener. - // Used to say that they always ran first. That's how webkit does it - // Spec now says that they run in a position determined by - // when they were first set. FF does it that way. See: - // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-handlers - // - _dispatchEvent: function _dispatchEvent(event, trusted) { - if (typeof trusted !== 'boolean') trusted = false; - function invoke(target, event) { - var type = event.type, phase = event.eventPhase; - event.currentTarget = target; - - // If there was an individual handler defined, invoke it first - // XXX: see comment above: this shouldn't always be first. - if (phase !== Event.CAPTURING_PHASE && - target._handlers && target._handlers[type]) - { - var handler = target._handlers[type]; - var rv; - if (typeof handler === 'function') { - rv=handler.call(event.currentTarget, event); - } - else { - var f = handler.handleEvent; - if (typeof f !== 'function') - throw new TypeError('handleEvent property of ' + - 'event handler object is' + - 'not a function.'); - rv=f.call(handler, event); - } - - switch(event.type) { - case 'mouseover': - if (rv === true) // Historical baggage - event.preventDefault(); - break; - case 'beforeunload': - // XXX: eventually we need a special case here - /* falls through */ - default: - if (rv === false) - event.preventDefault(); - break; - } - } - - // Now invoke list list of listeners for this target and type - var list = target._listeners && target._listeners[type]; - if (!list) return; - list = list.slice(); - for(var i = 0, n = list.length; i < n; i++) { - if (event._immediatePropagationStopped) return; - var l = list[i]; - if ((phase === Event.CAPTURING_PHASE && !l.capture) || - (phase === Event.BUBBLING_PHASE && l.capture)) - continue; - if (l.f) { - l.f.call(event.currentTarget, event); - } - else { - var fn = l.listener.handleEvent; - if (typeof fn !== 'function') - throw new TypeError('handleEvent property of event listener object is not a function.'); - fn.call(l.listener, event); - } - } - } - - if (!event._initialized || event._dispatching) utils.InvalidStateError(); - event.isTrusted = trusted; - - // Begin dispatching the event now - event._dispatching = true; - event.target = this; - - // Build the list of targets for the capturing and bubbling phases - // XXX: we'll eventually have to add Window to this list. - var ancestors = []; - for(var n = this.parentNode; n; n = n.parentNode) - ancestors.push(n); - - // Capturing phase - event.eventPhase = Event.CAPTURING_PHASE; - for(var i = ancestors.length-1; i >= 0; i--) { - invoke(ancestors[i], event); - if (event._propagationStopped) break; - } - - // At target phase - if (!event._propagationStopped) { - event.eventPhase = Event.AT_TARGET; - invoke(this, event); - } - - // Bubbling phase - if (event.bubbles && !event._propagationStopped) { - event.eventPhase = Event.BUBBLING_PHASE; - for(var ii = 0, nn = ancestors.length; ii < nn; ii++) { - invoke(ancestors[ii], event); - if (event._propagationStopped) break; - } - } - - event._dispatching = false; - event.eventPhase = Event.AT_TARGET; - event.currentTarget = null; - - // Deal with mouse events and figure out when - // a click has happened - if (trusted && !event.defaultPrevented && event instanceof MouseEvent) { - switch(event.type) { - case 'mousedown': - this._armed = { - x: event.clientX, - y: event.clientY, - t: event.timeStamp - }; - break; - case 'mouseout': - case 'mouseover': - this._armed = null; - break; - case 'mouseup': - if (this._isClick(event)) this._doClick(event); - this._armed = null; - break; - } - } - - - - return !event.defaultPrevented; - }, - - // Determine whether a click occurred - // XXX We don't support double clicks for now - _isClick: function(event) { - return (this._armed !== null && - event.type === 'mouseup' && - event.isTrusted && - event.button === 0 && - event.timeStamp - this._armed.t < 1000 && - Math.abs(event.clientX - this._armed.x) < 10 && - Math.abs(event.clientY - this._armed.Y) < 10); - }, - - // Clicks are handled like this: - // http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#interactive-content-0 - // - // Note that this method is similar to the HTMLElement.click() method - // The event argument must be the trusted mouseup event - _doClick: function(event) { - if (this._click_in_progress) return; - this._click_in_progress = true; - - // Find the nearest enclosing element that is activatable - // An element is activatable if it has a - // _post_click_activation_steps hook - var activated = this; - while(activated && !activated._post_click_activation_steps) - activated = activated.parentNode; - - if (activated && activated._pre_click_activation_steps) { - activated._pre_click_activation_steps(); - } - - var click = this.ownerDocument.createEvent('MouseEvent'); - click.initMouseEvent('click', true, true, - this.ownerDocument.defaultView, 1, - event.screenX, event.screenY, - event.clientX, event.clientY, - event.ctrlKey, event.altKey, - event.shiftKey, event.metaKey, - event.button, null); - - var result = this._dispatchEvent(click, true); - - if (activated) { - if (result) { - // This is where hyperlinks get followed, for example. - if (activated._post_click_activation_steps) - activated._post_click_activation_steps(click); - } - else { - if (activated._cancelled_activation_steps) - activated._cancelled_activation_steps(); - } - } - }, - - // - // An event handler is like an event listener, but it registered - // by setting an IDL or content attribute like onload or onclick. - // There can only be one of these at a time for any event type. - // This is an internal method for the attribute accessors and - // content attribute handlers that need to register events handlers. - // The type argument is the same as in addEventListener(). - // The handler argument is the same as listeners in addEventListener: - // it can be a function or an object. Pass null to remove any existing - // handler. Handlers are always invoked before any listeners of - // the same type. They are not invoked during the capturing phase - // of event dispatch. - // - _setEventHandler: function _setEventHandler(type, handler) { - if (!this._handlers) this._handlers = Object.create(null); - this._handlers[type] = handler; - }, - - _getEventHandler: function _getEventHandler(type) { - return (this._handlers && this._handlers[type]) || null; - } - -}; - - -/***/ }), - -/***/ 61676: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = FilteredElementList; - -var Node = __webpack_require__(97537); - -// -// This file defines node list implementation that lazily traverses -// the document tree (or a subtree rooted at any element) and includes -// only those elements for which a specified filter function returns true. -// It is used to implement the -// {Document,Element}.getElementsBy{TagName,ClassName}{,NS} methods. -// -// XXX this should inherit from NodeList - -function FilteredElementList(root, filter) { - this.root = root; - this.filter = filter; - this.lastModTime = root.lastModTime; - this.done = false; - this.cache = []; - this.traverse(); -} - -FilteredElementList.prototype = Object.create(Object.prototype, { - length: { get: function() { - this.checkcache(); - if (!this.done) this.traverse(); - return this.cache.length; - } }, - - item: { value: function(n) { - this.checkcache(); - if (!this.done && n >= this.cache.length) { - // This can lead to O(N^2) behavior if we stop when we get to n - // and the caller is iterating through the items in order; so - // be sure to do the full traverse here. - this.traverse(/*n*/); - } - return this.cache[n]; - } }, - - checkcache: { value: function() { - if (this.lastModTime !== this.root.lastModTime) { - // subtree has changed, so invalidate cache - for (var i = this.cache.length-1; i>=0; i--) { - this[i] = undefined; - } - this.cache.length = 0; - this.done = false; - this.lastModTime = this.root.lastModTime; - } - } }, - - // If n is specified, then traverse the tree until we've found the nth - // item (or until we've found all items). If n is not specified, - // traverse until we've found all items. - traverse: { value: function(n) { - // increment n so we can compare to length, and so it is never falsy - if (n !== undefined) n++; - - var elt; - while ((elt = this.next()) !== null) { - this[this.cache.length] = elt; //XXX Use proxy instead - this.cache.push(elt); - if (n && this.cache.length === n) return; - } - - // no next element, so we've found everything - this.done = true; - } }, - - // Return the next element under root that matches filter - next: { value: function() { - var start = (this.cache.length === 0) ? this.root // Start at the root or at - : this.cache[this.cache.length-1]; // the last element we found - - var elt; - if (start.nodeType === Node.DOCUMENT_NODE) - elt = start.documentElement; - else - elt = start.nextElement(this.root); - - while(elt) { - if (this.filter(elt)) { - return elt; - } - - elt = elt.nextElement(this.root); - } - return null; - } }, -}); - - -/***/ }), - -/***/ 91895: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = HTMLParser; - -var Document = __webpack_require__(35452); -var DocumentType = __webpack_require__(73092); -var Node = __webpack_require__(97537); -var NAMESPACE = (__webpack_require__(89076).NAMESPACE); -var html = __webpack_require__(96324); -var impl = html.elements; - -var pushAll = Function.prototype.apply.bind(Array.prototype.push); - -/* - * This file contains an implementation of the HTML parsing algorithm. - * The algorithm and the implementation are complex because HTML - * explicitly defines how the parser should behave for all possible - * valid and invalid inputs. - * - * Usage: - * - * The file defines a single HTMLParser() function, which dom.js exposes - * publicly as document.implementation.mozHTMLParser(). This is a - * factory function, not a constructor. - * - * When you call document.implementation.mozHTMLParser(), it returns - * an object that has parse() and document() methods. To parse HTML text, - * pass the text (in one or more chunks) to the parse() method. When - * you've passed all the text (on the last chunk, or afterward) pass - * true as the second argument to parse() to tell the parser that there - * is no more coming. Call document() to get the document object that - * the parser is parsing into. You can call this at any time, before - * or after calling parse(). - * - * The first argument to mozHTMLParser is the absolute URL of the document. - * - * The second argument is optional and is for internal use only. Pass an - * element as the fragmentContext to do innerHTML parsing for the - * element. To do innerHTML parsing on a document, pass null. Otherwise, - * omit the 2nd argument. See HTMLElement.innerHTML for an example. Note - * that if you pass a context element, the end() method will return an - * unwrapped document instead of a wrapped one. - * - * Implementation details: - * - * This is a long file of almost 7000 lines. It is structured as one - * big function nested within another big function. The outer - * function defines a bunch of constant data, utility functions - * that use that data, and a couple of classes used by the parser. - * The outer function also defines and returns the - * inner function. This inner function is the HTMLParser factory - * function that implements the parser and holds all the parser state - * as local variables. The HTMLParser function is quite big because - * it defines many nested functions that use those local variables. - * - * There are three tightly coupled parser stages: a scanner, a - * tokenizer and a tree builder. In a (possibly misguided) attempt at - * efficiency, the stages are not implemented as separate classes: - * everything shares state and is (mostly) implemented in imperative - * (rather than OO) style. - * - * The stages of the parser work like this: When the client code calls - * the parser's parse() method, the specified string is passed to - * scanChars(). The scanner loops through that string and passes characters - * (sometimes one at a time, sometimes in chunks) to the tokenizer stage. - * The tokenizer groups the characters into tokens: tags, endtags, runs - * of text, comments, doctype declarations, and the end-of-file (EOF) - * token. These tokens are then passed to the tree building stage via - * the insertToken() function. The tree building stage builds up the - * document tree. - * - * The tokenizer stage is a finite state machine. Each state is - * implemented as a function with a name that ends in "_state". The - * initial state is data_state(). The current tokenizer state is stored - * in the variable 'tokenizer'. Most state functions expect a single - * integer argument which represents a single UTF-16 codepoint. Some - * states want more characters and set a lookahead property on - * themselves. The scanChars() function in the scanner checks for this - * lookahead property. If it doesn't exist, then scanChars() just passes - * the next input character to the current tokenizer state function. - * Otherwise, scanChars() looks ahead (a given # of characters, or for a - * matching string, or for a matching regexp) and passes a string of - * characters to the current tokenizer state function. - * - * As a shortcut, certain states of the tokenizer use regular expressions - * to look ahead in the scanner's input buffer for runs of text, simple - * tags and attributes. For well-formed input, these shortcuts skip a - * lot of state transitions and speed things up a bit. - * - * When a tokenizer state function has consumed a complete token, it - * emits that token, by calling insertToken(), or by calling a utility - * function that itself calls insertToken(). These tokens are passed to - * the tree building stage, which is also a state machine. Like the - * tokenizer, the tree building states are implemented as functions, and - * these functions have names that end with _mode (because the HTML spec - * refers to them as insertion modes). The current insertion mode is held - * by the 'parser' variable. Each insertion mode function takes up to 4 - * arguments. The first is a token type, represented by the constants - * TAG, ENDTAG, TEXT, COMMENT, DOCTYPE and EOF. The second argument is - * the value of the token: the text or comment data, or tagname or - * doctype. For tags, the 3rd argument is an array of attributes. For - * DOCTYPES it is the optional public id. For tags, the 4th argument is - * true if the tag is self-closing. For doctypes, the 4th argument is the - * optional system id. - * - * Search for "***" to find the major sub-divisions in the code. - */ - - -/*** - * Data prolog. Lots of constants declared here, including some - * very large objects. They're used throughout the code that follows - */ -// Token types for the tree builder. -var EOF = -1; -var TEXT = 1; -var TAG = 2; -var ENDTAG = 3; -var COMMENT = 4; -var DOCTYPE = 5; - -// A re-usable empty array -var NOATTRS = []; - -// These DTD public ids put the browser in quirks mode -var quirkyPublicIds = /^HTML$|^-\/\/W3O\/\/DTD W3 HTML Strict 3\.0\/\/EN\/\/$|^-\/W3C\/DTD HTML 4\.0 Transitional\/EN$|^\+\/\/Silmaril\/\/dtd html Pro v0r11 19970101\/\/|^-\/\/AdvaSoft Ltd\/\/DTD HTML 3\.0 asWedit \+ extensions\/\/|^-\/\/AS\/\/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\/\/|^-\/\/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\/\/|^-\/\/SQ\/\/DTD HTML 2\.0 HoTMetaL \+ extensions\/\/|^-\/\/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\/\//i; - -var quirkySystemId = "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"; - -var conditionallyQuirkyPublicIds = /^-\/\/W3C\/\/DTD HTML 4\.01 Frameset\/\/|^-\/\/W3C\/\/DTD HTML 4\.01 Transitional\/\//i; - -// These DTD public ids put the browser in limited quirks mode -var limitedQuirkyPublicIds = /^-\/\/W3C\/\/DTD XHTML 1\.0 Frameset\/\/|^-\/\/W3C\/\/DTD XHTML 1\.0 Transitional\/\//i; - - -// Element sets below. See the isA() function for a way to test -// whether an element is a member of a set -var specialSet = Object.create(null); -specialSet[NAMESPACE.HTML] = { - __proto__: null, - "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, - // Note that "xmp" was removed from the "special" set in the latest - // spec, apparently by accident; see - // https://github.com/whatwg/html/pull/1919 - "ul":true, "wbr":true, "xmp":true -}; -specialSet[NAMESPACE.SVG] = { - __proto__: null, - "foreignObject": true, "desc": true, "title": true -}; -specialSet[NAMESPACE.MATHML] = { - __proto__: null, - "mi":true, "mo":true, "mn":true, "ms":true, - "mtext":true, "annotation-xml":true -}; - -// The set of address, div, and p HTML tags -var addressdivpSet = Object.create(null); -addressdivpSet[NAMESPACE.HTML] = { - __proto__: null, - "address":true, "div":true, "p":true -}; - -var dddtSet = Object.create(null); -dddtSet[NAMESPACE.HTML] = { - __proto__: null, - "dd":true, "dt":true -}; - -var tablesectionrowSet = Object.create(null); -tablesectionrowSet[NAMESPACE.HTML] = { - __proto__: null, - "table":true, "thead":true, "tbody":true, "tfoot":true, "tr":true -}; - -var impliedEndTagsSet = Object.create(null); -impliedEndTagsSet[NAMESPACE.HTML] = { - __proto__: null, - "dd": true, "dt": true, "li": true, "menuitem": true, "optgroup": true, - "option": true, "p": true, "rb": true, "rp": true, "rt": true, "rtc": true -}; - -var thoroughImpliedEndTagsSet = Object.create(null); -thoroughImpliedEndTagsSet[NAMESPACE.HTML] = { - __proto__: null, - "caption": true, "colgroup": true, "dd": true, "dt": true, "li": true, - "optgroup": true, "option": true, "p": true, "rb": true, "rp": true, - "rt": true, "rtc": true, "tbody": true, "td": true, "tfoot": true, - "th": true, "thead": true, "tr": true -}; - -var tableContextSet = Object.create(null); -tableContextSet[NAMESPACE.HTML] = { - __proto__: null, - "table": true, "template": true, "html": true -}; - -var tableBodyContextSet = Object.create(null); -tableBodyContextSet[NAMESPACE.HTML] = { - __proto__: null, - "tbody": true, "tfoot": true, "thead": true, "template": true, "html": true -}; - -var tableRowContextSet = Object.create(null); -tableRowContextSet[NAMESPACE.HTML] = { - __proto__: null, - "tr": true, "template": true, "html": true -}; - -// See http://www.w3.org/TR/html5/forms.html#form-associated-element -var formassociatedSet = Object.create(null); -formassociatedSet[NAMESPACE.HTML] = { - __proto__: null, - "button": true, "fieldset": true, "input": true, "keygen": true, - "object": true, "output": true, "select": true, "textarea": true, - "img": true -}; - -var inScopeSet = Object.create(null); -inScopeSet[NAMESPACE.HTML]= { - __proto__: null, - "applet":true, "caption":true, "html":true, "table":true, - "td":true, "th":true, "marquee":true, "object":true, - "template":true -}; -inScopeSet[NAMESPACE.MATHML] = { - __proto__: null, - "mi":true, "mo":true, "mn":true, "ms":true, - "mtext":true, "annotation-xml":true -}; -inScopeSet[NAMESPACE.SVG] = { - __proto__: null, - "foreignObject":true, "desc":true, "title":true -}; - -var inListItemScopeSet = Object.create(inScopeSet); -inListItemScopeSet[NAMESPACE.HTML] = - Object.create(inScopeSet[NAMESPACE.HTML]); -inListItemScopeSet[NAMESPACE.HTML].ol = true; -inListItemScopeSet[NAMESPACE.HTML].ul = true; - -var inButtonScopeSet = Object.create(inScopeSet); -inButtonScopeSet[NAMESPACE.HTML] = - Object.create(inScopeSet[NAMESPACE.HTML]); -inButtonScopeSet[NAMESPACE.HTML].button = true; - -var inTableScopeSet = Object.create(null); -inTableScopeSet[NAMESPACE.HTML] = { - __proto__: null, - "html":true, "table":true, "template":true -}; - -// The set of elements for select scope is the everything *except* these -var invertedSelectScopeSet = Object.create(null); -invertedSelectScopeSet[NAMESPACE.HTML] = { - __proto__: null, - "optgroup":true, "option":true -}; - -var mathmlTextIntegrationPointSet = Object.create(null); -mathmlTextIntegrationPointSet[NAMESPACE.MATHML] = { - __proto__: null, - mi: true, - mo: true, - mn: true, - ms: true, - mtext: true -}; - -var htmlIntegrationPointSet = Object.create(null); -htmlIntegrationPointSet[NAMESPACE.SVG] = { - __proto__: null, - foreignObject: true, - desc: true, - title: true -}; - -var foreignAttributes = { - __proto__: null, - "xlink:actuate": NAMESPACE.XLINK, "xlink:arcrole": NAMESPACE.XLINK, - "xlink:href": NAMESPACE.XLINK, "xlink:role": NAMESPACE.XLINK, - "xlink:show": NAMESPACE.XLINK, "xlink:title": NAMESPACE.XLINK, - "xlink:type": NAMESPACE.XLINK, "xml:base": NAMESPACE.XML, - "xml:lang": NAMESPACE.XML, "xml:space": NAMESPACE.XML, - "xmlns": NAMESPACE.XMLNS, "xmlns:xlink": NAMESPACE.XMLNS -}; - - -// Lowercase to mixed case mapping for SVG attributes and tagnames -var svgAttrAdjustments = { - __proto__: null, - 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 svgTagNameAdjustments = { - __proto__: null, - 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" -}; - - -// Data for parsing numeric and named character references -// These next 3 objects are direct translations of tables -// in the HTML spec into JavaScript object format -var numericCharRefReplacements = { - __proto__: null, - 0x00:0xFFFD, 0x80:0x20AC, 0x82:0x201A, 0x83:0x0192, 0x84:0x201E, - 0x85:0x2026, 0x86:0x2020, 0x87:0x2021, 0x88:0x02C6, 0x89:0x2030, - 0x8A:0x0160, 0x8B:0x2039, 0x8C:0x0152, 0x8E:0x017D, 0x91:0x2018, - 0x92:0x2019, 0x93:0x201C, 0x94:0x201D, 0x95:0x2022, 0x96:0x2013, - 0x97:0x2014, 0x98:0x02DC, 0x99:0x2122, 0x9A:0x0161, 0x9B:0x203A, - 0x9C:0x0153, 0x9E:0x017E, 0x9F:0x0178 -}; - -/* - * This table is generated with test/tools/update-entities.js - */ -var namedCharRefs = { - __proto__: null, - "AElig":0xc6, "AElig;":0xc6, - "AMP":0x26, "AMP;":0x26, - "Aacute":0xc1, "Aacute;":0xc1, - "Abreve;":0x102, "Acirc":0xc2, - "Acirc;":0xc2, "Acy;":0x410, - "Afr;":[0xd835,0xdd04], "Agrave":0xc0, - "Agrave;":0xc0, "Alpha;":0x391, - "Amacr;":0x100, "And;":0x2a53, - "Aogon;":0x104, "Aopf;":[0xd835,0xdd38], - "ApplyFunction;":0x2061, "Aring":0xc5, - "Aring;":0xc5, "Ascr;":[0xd835,0xdc9c], - "Assign;":0x2254, "Atilde":0xc3, - "Atilde;":0xc3, "Auml":0xc4, - "Auml;":0xc4, "Backslash;":0x2216, - "Barv;":0x2ae7, "Barwed;":0x2306, - "Bcy;":0x411, "Because;":0x2235, - "Bernoullis;":0x212c, "Beta;":0x392, - "Bfr;":[0xd835,0xdd05], "Bopf;":[0xd835,0xdd39], - "Breve;":0x2d8, "Bscr;":0x212c, - "Bumpeq;":0x224e, "CHcy;":0x427, - "COPY":0xa9, "COPY;":0xa9, - "Cacute;":0x106, "Cap;":0x22d2, - "CapitalDifferentialD;":0x2145, "Cayleys;":0x212d, - "Ccaron;":0x10c, "Ccedil":0xc7, - "Ccedil;":0xc7, "Ccirc;":0x108, - "Cconint;":0x2230, "Cdot;":0x10a, - "Cedilla;":0xb8, "CenterDot;":0xb7, - "Cfr;":0x212d, "Chi;":0x3a7, - "CircleDot;":0x2299, "CircleMinus;":0x2296, - "CirclePlus;":0x2295, "CircleTimes;":0x2297, - "ClockwiseContourIntegral;":0x2232, "CloseCurlyDoubleQuote;":0x201d, - "CloseCurlyQuote;":0x2019, "Colon;":0x2237, - "Colone;":0x2a74, "Congruent;":0x2261, - "Conint;":0x222f, "ContourIntegral;":0x222e, - "Copf;":0x2102, "Coproduct;":0x2210, - "CounterClockwiseContourIntegral;":0x2233, "Cross;":0x2a2f, - "Cscr;":[0xd835,0xdc9e], "Cup;":0x22d3, - "CupCap;":0x224d, "DD;":0x2145, - "DDotrahd;":0x2911, "DJcy;":0x402, - "DScy;":0x405, "DZcy;":0x40f, - "Dagger;":0x2021, "Darr;":0x21a1, - "Dashv;":0x2ae4, "Dcaron;":0x10e, - "Dcy;":0x414, "Del;":0x2207, - "Delta;":0x394, "Dfr;":[0xd835,0xdd07], - "DiacriticalAcute;":0xb4, "DiacriticalDot;":0x2d9, - "DiacriticalDoubleAcute;":0x2dd, "DiacriticalGrave;":0x60, - "DiacriticalTilde;":0x2dc, "Diamond;":0x22c4, - "DifferentialD;":0x2146, "Dopf;":[0xd835,0xdd3b], - "Dot;":0xa8, "DotDot;":0x20dc, - "DotEqual;":0x2250, "DoubleContourIntegral;":0x222f, - "DoubleDot;":0xa8, "DoubleDownArrow;":0x21d3, - "DoubleLeftArrow;":0x21d0, "DoubleLeftRightArrow;":0x21d4, - "DoubleLeftTee;":0x2ae4, "DoubleLongLeftArrow;":0x27f8, - "DoubleLongLeftRightArrow;":0x27fa, "DoubleLongRightArrow;":0x27f9, - "DoubleRightArrow;":0x21d2, "DoubleRightTee;":0x22a8, - "DoubleUpArrow;":0x21d1, "DoubleUpDownArrow;":0x21d5, - "DoubleVerticalBar;":0x2225, "DownArrow;":0x2193, - "DownArrowBar;":0x2913, "DownArrowUpArrow;":0x21f5, - "DownBreve;":0x311, "DownLeftRightVector;":0x2950, - "DownLeftTeeVector;":0x295e, "DownLeftVector;":0x21bd, - "DownLeftVectorBar;":0x2956, "DownRightTeeVector;":0x295f, - "DownRightVector;":0x21c1, "DownRightVectorBar;":0x2957, - "DownTee;":0x22a4, "DownTeeArrow;":0x21a7, - "Downarrow;":0x21d3, "Dscr;":[0xd835,0xdc9f], - "Dstrok;":0x110, "ENG;":0x14a, - "ETH":0xd0, "ETH;":0xd0, - "Eacute":0xc9, "Eacute;":0xc9, - "Ecaron;":0x11a, "Ecirc":0xca, - "Ecirc;":0xca, "Ecy;":0x42d, - "Edot;":0x116, "Efr;":[0xd835,0xdd08], - "Egrave":0xc8, "Egrave;":0xc8, - "Element;":0x2208, "Emacr;":0x112, - "EmptySmallSquare;":0x25fb, "EmptyVerySmallSquare;":0x25ab, - "Eogon;":0x118, "Eopf;":[0xd835,0xdd3c], - "Epsilon;":0x395, "Equal;":0x2a75, - "EqualTilde;":0x2242, "Equilibrium;":0x21cc, - "Escr;":0x2130, "Esim;":0x2a73, - "Eta;":0x397, "Euml":0xcb, - "Euml;":0xcb, "Exists;":0x2203, - "ExponentialE;":0x2147, "Fcy;":0x424, - "Ffr;":[0xd835,0xdd09], "FilledSmallSquare;":0x25fc, - "FilledVerySmallSquare;":0x25aa, "Fopf;":[0xd835,0xdd3d], - "ForAll;":0x2200, "Fouriertrf;":0x2131, - "Fscr;":0x2131, "GJcy;":0x403, - "GT":0x3e, "GT;":0x3e, - "Gamma;":0x393, "Gammad;":0x3dc, - "Gbreve;":0x11e, "Gcedil;":0x122, - "Gcirc;":0x11c, "Gcy;":0x413, - "Gdot;":0x120, "Gfr;":[0xd835,0xdd0a], - "Gg;":0x22d9, "Gopf;":[0xd835,0xdd3e], - "GreaterEqual;":0x2265, "GreaterEqualLess;":0x22db, - "GreaterFullEqual;":0x2267, "GreaterGreater;":0x2aa2, - "GreaterLess;":0x2277, "GreaterSlantEqual;":0x2a7e, - "GreaterTilde;":0x2273, "Gscr;":[0xd835,0xdca2], - "Gt;":0x226b, "HARDcy;":0x42a, - "Hacek;":0x2c7, "Hat;":0x5e, - "Hcirc;":0x124, "Hfr;":0x210c, - "HilbertSpace;":0x210b, "Hopf;":0x210d, - "HorizontalLine;":0x2500, "Hscr;":0x210b, - "Hstrok;":0x126, "HumpDownHump;":0x224e, - "HumpEqual;":0x224f, "IEcy;":0x415, - "IJlig;":0x132, "IOcy;":0x401, - "Iacute":0xcd, "Iacute;":0xcd, - "Icirc":0xce, "Icirc;":0xce, - "Icy;":0x418, "Idot;":0x130, - "Ifr;":0x2111, "Igrave":0xcc, - "Igrave;":0xcc, "Im;":0x2111, - "Imacr;":0x12a, "ImaginaryI;":0x2148, - "Implies;":0x21d2, "Int;":0x222c, - "Integral;":0x222b, "Intersection;":0x22c2, - "InvisibleComma;":0x2063, "InvisibleTimes;":0x2062, - "Iogon;":0x12e, "Iopf;":[0xd835,0xdd40], - "Iota;":0x399, "Iscr;":0x2110, - "Itilde;":0x128, "Iukcy;":0x406, - "Iuml":0xcf, "Iuml;":0xcf, - "Jcirc;":0x134, "Jcy;":0x419, - "Jfr;":[0xd835,0xdd0d], "Jopf;":[0xd835,0xdd41], - "Jscr;":[0xd835,0xdca5], "Jsercy;":0x408, - "Jukcy;":0x404, "KHcy;":0x425, - "KJcy;":0x40c, "Kappa;":0x39a, - "Kcedil;":0x136, "Kcy;":0x41a, - "Kfr;":[0xd835,0xdd0e], "Kopf;":[0xd835,0xdd42], - "Kscr;":[0xd835,0xdca6], "LJcy;":0x409, - "LT":0x3c, "LT;":0x3c, - "Lacute;":0x139, "Lambda;":0x39b, - "Lang;":0x27ea, "Laplacetrf;":0x2112, - "Larr;":0x219e, "Lcaron;":0x13d, - "Lcedil;":0x13b, "Lcy;":0x41b, - "LeftAngleBracket;":0x27e8, "LeftArrow;":0x2190, - "LeftArrowBar;":0x21e4, "LeftArrowRightArrow;":0x21c6, - "LeftCeiling;":0x2308, "LeftDoubleBracket;":0x27e6, - "LeftDownTeeVector;":0x2961, "LeftDownVector;":0x21c3, - "LeftDownVectorBar;":0x2959, "LeftFloor;":0x230a, - "LeftRightArrow;":0x2194, "LeftRightVector;":0x294e, - "LeftTee;":0x22a3, "LeftTeeArrow;":0x21a4, - "LeftTeeVector;":0x295a, "LeftTriangle;":0x22b2, - "LeftTriangleBar;":0x29cf, "LeftTriangleEqual;":0x22b4, - "LeftUpDownVector;":0x2951, "LeftUpTeeVector;":0x2960, - "LeftUpVector;":0x21bf, "LeftUpVectorBar;":0x2958, - "LeftVector;":0x21bc, "LeftVectorBar;":0x2952, - "Leftarrow;":0x21d0, "Leftrightarrow;":0x21d4, - "LessEqualGreater;":0x22da, "LessFullEqual;":0x2266, - "LessGreater;":0x2276, "LessLess;":0x2aa1, - "LessSlantEqual;":0x2a7d, "LessTilde;":0x2272, - "Lfr;":[0xd835,0xdd0f], "Ll;":0x22d8, - "Lleftarrow;":0x21da, "Lmidot;":0x13f, - "LongLeftArrow;":0x27f5, "LongLeftRightArrow;":0x27f7, - "LongRightArrow;":0x27f6, "Longleftarrow;":0x27f8, - "Longleftrightarrow;":0x27fa, "Longrightarrow;":0x27f9, - "Lopf;":[0xd835,0xdd43], "LowerLeftArrow;":0x2199, - "LowerRightArrow;":0x2198, "Lscr;":0x2112, - "Lsh;":0x21b0, "Lstrok;":0x141, - "Lt;":0x226a, "Map;":0x2905, - "Mcy;":0x41c, "MediumSpace;":0x205f, - "Mellintrf;":0x2133, "Mfr;":[0xd835,0xdd10], - "MinusPlus;":0x2213, "Mopf;":[0xd835,0xdd44], - "Mscr;":0x2133, "Mu;":0x39c, - "NJcy;":0x40a, "Nacute;":0x143, - "Ncaron;":0x147, "Ncedil;":0x145, - "Ncy;":0x41d, "NegativeMediumSpace;":0x200b, - "NegativeThickSpace;":0x200b, "NegativeThinSpace;":0x200b, - "NegativeVeryThinSpace;":0x200b, "NestedGreaterGreater;":0x226b, - "NestedLessLess;":0x226a, "NewLine;":0xa, - "Nfr;":[0xd835,0xdd11], "NoBreak;":0x2060, - "NonBreakingSpace;":0xa0, "Nopf;":0x2115, - "Not;":0x2aec, "NotCongruent;":0x2262, - "NotCupCap;":0x226d, "NotDoubleVerticalBar;":0x2226, - "NotElement;":0x2209, "NotEqual;":0x2260, - "NotEqualTilde;":[0x2242,0x338], "NotExists;":0x2204, - "NotGreater;":0x226f, "NotGreaterEqual;":0x2271, - "NotGreaterFullEqual;":[0x2267,0x338], "NotGreaterGreater;":[0x226b,0x338], - "NotGreaterLess;":0x2279, "NotGreaterSlantEqual;":[0x2a7e,0x338], - "NotGreaterTilde;":0x2275, "NotHumpDownHump;":[0x224e,0x338], - "NotHumpEqual;":[0x224f,0x338], "NotLeftTriangle;":0x22ea, - "NotLeftTriangleBar;":[0x29cf,0x338], "NotLeftTriangleEqual;":0x22ec, - "NotLess;":0x226e, "NotLessEqual;":0x2270, - "NotLessGreater;":0x2278, "NotLessLess;":[0x226a,0x338], - "NotLessSlantEqual;":[0x2a7d,0x338], "NotLessTilde;":0x2274, - "NotNestedGreaterGreater;":[0x2aa2,0x338], "NotNestedLessLess;":[0x2aa1,0x338], - "NotPrecedes;":0x2280, "NotPrecedesEqual;":[0x2aaf,0x338], - "NotPrecedesSlantEqual;":0x22e0, "NotReverseElement;":0x220c, - "NotRightTriangle;":0x22eb, "NotRightTriangleBar;":[0x29d0,0x338], - "NotRightTriangleEqual;":0x22ed, "NotSquareSubset;":[0x228f,0x338], - "NotSquareSubsetEqual;":0x22e2, "NotSquareSuperset;":[0x2290,0x338], - "NotSquareSupersetEqual;":0x22e3, "NotSubset;":[0x2282,0x20d2], - "NotSubsetEqual;":0x2288, "NotSucceeds;":0x2281, - "NotSucceedsEqual;":[0x2ab0,0x338], "NotSucceedsSlantEqual;":0x22e1, - "NotSucceedsTilde;":[0x227f,0x338], "NotSuperset;":[0x2283,0x20d2], - "NotSupersetEqual;":0x2289, "NotTilde;":0x2241, - "NotTildeEqual;":0x2244, "NotTildeFullEqual;":0x2247, - "NotTildeTilde;":0x2249, "NotVerticalBar;":0x2224, - "Nscr;":[0xd835,0xdca9], "Ntilde":0xd1, - "Ntilde;":0xd1, "Nu;":0x39d, - "OElig;":0x152, "Oacute":0xd3, - "Oacute;":0xd3, "Ocirc":0xd4, - "Ocirc;":0xd4, "Ocy;":0x41e, - "Odblac;":0x150, "Ofr;":[0xd835,0xdd12], - "Ograve":0xd2, "Ograve;":0xd2, - "Omacr;":0x14c, "Omega;":0x3a9, - "Omicron;":0x39f, "Oopf;":[0xd835,0xdd46], - "OpenCurlyDoubleQuote;":0x201c, "OpenCurlyQuote;":0x2018, - "Or;":0x2a54, "Oscr;":[0xd835,0xdcaa], - "Oslash":0xd8, "Oslash;":0xd8, - "Otilde":0xd5, "Otilde;":0xd5, - "Otimes;":0x2a37, "Ouml":0xd6, - "Ouml;":0xd6, "OverBar;":0x203e, - "OverBrace;":0x23de, "OverBracket;":0x23b4, - "OverParenthesis;":0x23dc, "PartialD;":0x2202, - "Pcy;":0x41f, "Pfr;":[0xd835,0xdd13], - "Phi;":0x3a6, "Pi;":0x3a0, - "PlusMinus;":0xb1, "Poincareplane;":0x210c, - "Popf;":0x2119, "Pr;":0x2abb, - "Precedes;":0x227a, "PrecedesEqual;":0x2aaf, - "PrecedesSlantEqual;":0x227c, "PrecedesTilde;":0x227e, - "Prime;":0x2033, "Product;":0x220f, - "Proportion;":0x2237, "Proportional;":0x221d, - "Pscr;":[0xd835,0xdcab], "Psi;":0x3a8, - "QUOT":0x22, "QUOT;":0x22, - "Qfr;":[0xd835,0xdd14], "Qopf;":0x211a, - "Qscr;":[0xd835,0xdcac], "RBarr;":0x2910, - "REG":0xae, "REG;":0xae, - "Racute;":0x154, "Rang;":0x27eb, - "Rarr;":0x21a0, "Rarrtl;":0x2916, - "Rcaron;":0x158, "Rcedil;":0x156, - "Rcy;":0x420, "Re;":0x211c, - "ReverseElement;":0x220b, "ReverseEquilibrium;":0x21cb, - "ReverseUpEquilibrium;":0x296f, "Rfr;":0x211c, - "Rho;":0x3a1, "RightAngleBracket;":0x27e9, - "RightArrow;":0x2192, "RightArrowBar;":0x21e5, - "RightArrowLeftArrow;":0x21c4, "RightCeiling;":0x2309, - "RightDoubleBracket;":0x27e7, "RightDownTeeVector;":0x295d, - "RightDownVector;":0x21c2, "RightDownVectorBar;":0x2955, - "RightFloor;":0x230b, "RightTee;":0x22a2, - "RightTeeArrow;":0x21a6, "RightTeeVector;":0x295b, - "RightTriangle;":0x22b3, "RightTriangleBar;":0x29d0, - "RightTriangleEqual;":0x22b5, "RightUpDownVector;":0x294f, - "RightUpTeeVector;":0x295c, "RightUpVector;":0x21be, - "RightUpVectorBar;":0x2954, "RightVector;":0x21c0, - "RightVectorBar;":0x2953, "Rightarrow;":0x21d2, - "Ropf;":0x211d, "RoundImplies;":0x2970, - "Rrightarrow;":0x21db, "Rscr;":0x211b, - "Rsh;":0x21b1, "RuleDelayed;":0x29f4, - "SHCHcy;":0x429, "SHcy;":0x428, - "SOFTcy;":0x42c, "Sacute;":0x15a, - "Sc;":0x2abc, "Scaron;":0x160, - "Scedil;":0x15e, "Scirc;":0x15c, - "Scy;":0x421, "Sfr;":[0xd835,0xdd16], - "ShortDownArrow;":0x2193, "ShortLeftArrow;":0x2190, - "ShortRightArrow;":0x2192, "ShortUpArrow;":0x2191, - "Sigma;":0x3a3, "SmallCircle;":0x2218, - "Sopf;":[0xd835,0xdd4a], "Sqrt;":0x221a, - "Square;":0x25a1, "SquareIntersection;":0x2293, - "SquareSubset;":0x228f, "SquareSubsetEqual;":0x2291, - "SquareSuperset;":0x2290, "SquareSupersetEqual;":0x2292, - "SquareUnion;":0x2294, "Sscr;":[0xd835,0xdcae], - "Star;":0x22c6, "Sub;":0x22d0, - "Subset;":0x22d0, "SubsetEqual;":0x2286, - "Succeeds;":0x227b, "SucceedsEqual;":0x2ab0, - "SucceedsSlantEqual;":0x227d, "SucceedsTilde;":0x227f, - "SuchThat;":0x220b, "Sum;":0x2211, - "Sup;":0x22d1, "Superset;":0x2283, - "SupersetEqual;":0x2287, "Supset;":0x22d1, - "THORN":0xde, "THORN;":0xde, - "TRADE;":0x2122, "TSHcy;":0x40b, - "TScy;":0x426, "Tab;":0x9, - "Tau;":0x3a4, "Tcaron;":0x164, - "Tcedil;":0x162, "Tcy;":0x422, - "Tfr;":[0xd835,0xdd17], "Therefore;":0x2234, - "Theta;":0x398, "ThickSpace;":[0x205f,0x200a], - "ThinSpace;":0x2009, "Tilde;":0x223c, - "TildeEqual;":0x2243, "TildeFullEqual;":0x2245, - "TildeTilde;":0x2248, "Topf;":[0xd835,0xdd4b], - "TripleDot;":0x20db, "Tscr;":[0xd835,0xdcaf], - "Tstrok;":0x166, "Uacute":0xda, - "Uacute;":0xda, "Uarr;":0x219f, - "Uarrocir;":0x2949, "Ubrcy;":0x40e, - "Ubreve;":0x16c, "Ucirc":0xdb, - "Ucirc;":0xdb, "Ucy;":0x423, - "Udblac;":0x170, "Ufr;":[0xd835,0xdd18], - "Ugrave":0xd9, "Ugrave;":0xd9, - "Umacr;":0x16a, "UnderBar;":0x5f, - "UnderBrace;":0x23df, "UnderBracket;":0x23b5, - "UnderParenthesis;":0x23dd, "Union;":0x22c3, - "UnionPlus;":0x228e, "Uogon;":0x172, - "Uopf;":[0xd835,0xdd4c], "UpArrow;":0x2191, - "UpArrowBar;":0x2912, "UpArrowDownArrow;":0x21c5, - "UpDownArrow;":0x2195, "UpEquilibrium;":0x296e, - "UpTee;":0x22a5, "UpTeeArrow;":0x21a5, - "Uparrow;":0x21d1, "Updownarrow;":0x21d5, - "UpperLeftArrow;":0x2196, "UpperRightArrow;":0x2197, - "Upsi;":0x3d2, "Upsilon;":0x3a5, - "Uring;":0x16e, "Uscr;":[0xd835,0xdcb0], - "Utilde;":0x168, "Uuml":0xdc, - "Uuml;":0xdc, "VDash;":0x22ab, - "Vbar;":0x2aeb, "Vcy;":0x412, - "Vdash;":0x22a9, "Vdashl;":0x2ae6, - "Vee;":0x22c1, "Verbar;":0x2016, - "Vert;":0x2016, "VerticalBar;":0x2223, - "VerticalLine;":0x7c, "VerticalSeparator;":0x2758, - "VerticalTilde;":0x2240, "VeryThinSpace;":0x200a, - "Vfr;":[0xd835,0xdd19], "Vopf;":[0xd835,0xdd4d], - "Vscr;":[0xd835,0xdcb1], "Vvdash;":0x22aa, - "Wcirc;":0x174, "Wedge;":0x22c0, - "Wfr;":[0xd835,0xdd1a], "Wopf;":[0xd835,0xdd4e], - "Wscr;":[0xd835,0xdcb2], "Xfr;":[0xd835,0xdd1b], - "Xi;":0x39e, "Xopf;":[0xd835,0xdd4f], - "Xscr;":[0xd835,0xdcb3], "YAcy;":0x42f, - "YIcy;":0x407, "YUcy;":0x42e, - "Yacute":0xdd, "Yacute;":0xdd, - "Ycirc;":0x176, "Ycy;":0x42b, - "Yfr;":[0xd835,0xdd1c], "Yopf;":[0xd835,0xdd50], - "Yscr;":[0xd835,0xdcb4], "Yuml;":0x178, - "ZHcy;":0x416, "Zacute;":0x179, - "Zcaron;":0x17d, "Zcy;":0x417, - "Zdot;":0x17b, "ZeroWidthSpace;":0x200b, - "Zeta;":0x396, "Zfr;":0x2128, - "Zopf;":0x2124, "Zscr;":[0xd835,0xdcb5], - "aacute":0xe1, "aacute;":0xe1, - "abreve;":0x103, "ac;":0x223e, - "acE;":[0x223e,0x333], "acd;":0x223f, - "acirc":0xe2, "acirc;":0xe2, - "acute":0xb4, "acute;":0xb4, - "acy;":0x430, "aelig":0xe6, - "aelig;":0xe6, "af;":0x2061, - "afr;":[0xd835,0xdd1e], "agrave":0xe0, - "agrave;":0xe0, "alefsym;":0x2135, - "aleph;":0x2135, "alpha;":0x3b1, - "amacr;":0x101, "amalg;":0x2a3f, - "amp":0x26, "amp;":0x26, - "and;":0x2227, "andand;":0x2a55, - "andd;":0x2a5c, "andslope;":0x2a58, - "andv;":0x2a5a, "ang;":0x2220, - "ange;":0x29a4, "angle;":0x2220, - "angmsd;":0x2221, "angmsdaa;":0x29a8, - "angmsdab;":0x29a9, "angmsdac;":0x29aa, - "angmsdad;":0x29ab, "angmsdae;":0x29ac, - "angmsdaf;":0x29ad, "angmsdag;":0x29ae, - "angmsdah;":0x29af, "angrt;":0x221f, - "angrtvb;":0x22be, "angrtvbd;":0x299d, - "angsph;":0x2222, "angst;":0xc5, - "angzarr;":0x237c, "aogon;":0x105, - "aopf;":[0xd835,0xdd52], "ap;":0x2248, - "apE;":0x2a70, "apacir;":0x2a6f, - "ape;":0x224a, "apid;":0x224b, - "apos;":0x27, "approx;":0x2248, - "approxeq;":0x224a, "aring":0xe5, - "aring;":0xe5, "ascr;":[0xd835,0xdcb6], - "ast;":0x2a, "asymp;":0x2248, - "asympeq;":0x224d, "atilde":0xe3, - "atilde;":0xe3, "auml":0xe4, - "auml;":0xe4, "awconint;":0x2233, - "awint;":0x2a11, "bNot;":0x2aed, - "backcong;":0x224c, "backepsilon;":0x3f6, - "backprime;":0x2035, "backsim;":0x223d, - "backsimeq;":0x22cd, "barvee;":0x22bd, - "barwed;":0x2305, "barwedge;":0x2305, - "bbrk;":0x23b5, "bbrktbrk;":0x23b6, - "bcong;":0x224c, "bcy;":0x431, - "bdquo;":0x201e, "becaus;":0x2235, - "because;":0x2235, "bemptyv;":0x29b0, - "bepsi;":0x3f6, "bernou;":0x212c, - "beta;":0x3b2, "beth;":0x2136, - "between;":0x226c, "bfr;":[0xd835,0xdd1f], - "bigcap;":0x22c2, "bigcirc;":0x25ef, - "bigcup;":0x22c3, "bigodot;":0x2a00, - "bigoplus;":0x2a01, "bigotimes;":0x2a02, - "bigsqcup;":0x2a06, "bigstar;":0x2605, - "bigtriangledown;":0x25bd, "bigtriangleup;":0x25b3, - "biguplus;":0x2a04, "bigvee;":0x22c1, - "bigwedge;":0x22c0, "bkarow;":0x290d, - "blacklozenge;":0x29eb, "blacksquare;":0x25aa, - "blacktriangle;":0x25b4, "blacktriangledown;":0x25be, - "blacktriangleleft;":0x25c2, "blacktriangleright;":0x25b8, - "blank;":0x2423, "blk12;":0x2592, - "blk14;":0x2591, "blk34;":0x2593, - "block;":0x2588, "bne;":[0x3d,0x20e5], - "bnequiv;":[0x2261,0x20e5], "bnot;":0x2310, - "bopf;":[0xd835,0xdd53], "bot;":0x22a5, - "bottom;":0x22a5, "bowtie;":0x22c8, - "boxDL;":0x2557, "boxDR;":0x2554, - "boxDl;":0x2556, "boxDr;":0x2553, - "boxH;":0x2550, "boxHD;":0x2566, - "boxHU;":0x2569, "boxHd;":0x2564, - "boxHu;":0x2567, "boxUL;":0x255d, - "boxUR;":0x255a, "boxUl;":0x255c, - "boxUr;":0x2559, "boxV;":0x2551, - "boxVH;":0x256c, "boxVL;":0x2563, - "boxVR;":0x2560, "boxVh;":0x256b, - "boxVl;":0x2562, "boxVr;":0x255f, - "boxbox;":0x29c9, "boxdL;":0x2555, - "boxdR;":0x2552, "boxdl;":0x2510, - "boxdr;":0x250c, "boxh;":0x2500, - "boxhD;":0x2565, "boxhU;":0x2568, - "boxhd;":0x252c, "boxhu;":0x2534, - "boxminus;":0x229f, "boxplus;":0x229e, - "boxtimes;":0x22a0, "boxuL;":0x255b, - "boxuR;":0x2558, "boxul;":0x2518, - "boxur;":0x2514, "boxv;":0x2502, - "boxvH;":0x256a, "boxvL;":0x2561, - "boxvR;":0x255e, "boxvh;":0x253c, - "boxvl;":0x2524, "boxvr;":0x251c, - "bprime;":0x2035, "breve;":0x2d8, - "brvbar":0xa6, "brvbar;":0xa6, - "bscr;":[0xd835,0xdcb7], "bsemi;":0x204f, - "bsim;":0x223d, "bsime;":0x22cd, - "bsol;":0x5c, "bsolb;":0x29c5, - "bsolhsub;":0x27c8, "bull;":0x2022, - "bullet;":0x2022, "bump;":0x224e, - "bumpE;":0x2aae, "bumpe;":0x224f, - "bumpeq;":0x224f, "cacute;":0x107, - "cap;":0x2229, "capand;":0x2a44, - "capbrcup;":0x2a49, "capcap;":0x2a4b, - "capcup;":0x2a47, "capdot;":0x2a40, - "caps;":[0x2229,0xfe00], "caret;":0x2041, - "caron;":0x2c7, "ccaps;":0x2a4d, - "ccaron;":0x10d, "ccedil":0xe7, - "ccedil;":0xe7, "ccirc;":0x109, - "ccups;":0x2a4c, "ccupssm;":0x2a50, - "cdot;":0x10b, "cedil":0xb8, - "cedil;":0xb8, "cemptyv;":0x29b2, - "cent":0xa2, "cent;":0xa2, - "centerdot;":0xb7, "cfr;":[0xd835,0xdd20], - "chcy;":0x447, "check;":0x2713, - "checkmark;":0x2713, "chi;":0x3c7, - "cir;":0x25cb, "cirE;":0x29c3, - "circ;":0x2c6, "circeq;":0x2257, - "circlearrowleft;":0x21ba, "circlearrowright;":0x21bb, - "circledR;":0xae, "circledS;":0x24c8, - "circledast;":0x229b, "circledcirc;":0x229a, - "circleddash;":0x229d, "cire;":0x2257, - "cirfnint;":0x2a10, "cirmid;":0x2aef, - "cirscir;":0x29c2, "clubs;":0x2663, - "clubsuit;":0x2663, "colon;":0x3a, - "colone;":0x2254, "coloneq;":0x2254, - "comma;":0x2c, "commat;":0x40, - "comp;":0x2201, "compfn;":0x2218, - "complement;":0x2201, "complexes;":0x2102, - "cong;":0x2245, "congdot;":0x2a6d, - "conint;":0x222e, "copf;":[0xd835,0xdd54], - "coprod;":0x2210, "copy":0xa9, - "copy;":0xa9, "copysr;":0x2117, - "crarr;":0x21b5, "cross;":0x2717, - "cscr;":[0xd835,0xdcb8], "csub;":0x2acf, - "csube;":0x2ad1, "csup;":0x2ad0, - "csupe;":0x2ad2, "ctdot;":0x22ef, - "cudarrl;":0x2938, "cudarrr;":0x2935, - "cuepr;":0x22de, "cuesc;":0x22df, - "cularr;":0x21b6, "cularrp;":0x293d, - "cup;":0x222a, "cupbrcap;":0x2a48, - "cupcap;":0x2a46, "cupcup;":0x2a4a, - "cupdot;":0x228d, "cupor;":0x2a45, - "cups;":[0x222a,0xfe00], "curarr;":0x21b7, - "curarrm;":0x293c, "curlyeqprec;":0x22de, - "curlyeqsucc;":0x22df, "curlyvee;":0x22ce, - "curlywedge;":0x22cf, "curren":0xa4, - "curren;":0xa4, "curvearrowleft;":0x21b6, - "curvearrowright;":0x21b7, "cuvee;":0x22ce, - "cuwed;":0x22cf, "cwconint;":0x2232, - "cwint;":0x2231, "cylcty;":0x232d, - "dArr;":0x21d3, "dHar;":0x2965, - "dagger;":0x2020, "daleth;":0x2138, - "darr;":0x2193, "dash;":0x2010, - "dashv;":0x22a3, "dbkarow;":0x290f, - "dblac;":0x2dd, "dcaron;":0x10f, - "dcy;":0x434, "dd;":0x2146, - "ddagger;":0x2021, "ddarr;":0x21ca, - "ddotseq;":0x2a77, "deg":0xb0, - "deg;":0xb0, "delta;":0x3b4, - "demptyv;":0x29b1, "dfisht;":0x297f, - "dfr;":[0xd835,0xdd21], "dharl;":0x21c3, - "dharr;":0x21c2, "diam;":0x22c4, - "diamond;":0x22c4, "diamondsuit;":0x2666, - "diams;":0x2666, "die;":0xa8, - "digamma;":0x3dd, "disin;":0x22f2, - "div;":0xf7, "divide":0xf7, - "divide;":0xf7, "divideontimes;":0x22c7, - "divonx;":0x22c7, "djcy;":0x452, - "dlcorn;":0x231e, "dlcrop;":0x230d, - "dollar;":0x24, "dopf;":[0xd835,0xdd55], - "dot;":0x2d9, "doteq;":0x2250, - "doteqdot;":0x2251, "dotminus;":0x2238, - "dotplus;":0x2214, "dotsquare;":0x22a1, - "doublebarwedge;":0x2306, "downarrow;":0x2193, - "downdownarrows;":0x21ca, "downharpoonleft;":0x21c3, - "downharpoonright;":0x21c2, "drbkarow;":0x2910, - "drcorn;":0x231f, "drcrop;":0x230c, - "dscr;":[0xd835,0xdcb9], "dscy;":0x455, - "dsol;":0x29f6, "dstrok;":0x111, - "dtdot;":0x22f1, "dtri;":0x25bf, - "dtrif;":0x25be, "duarr;":0x21f5, - "duhar;":0x296f, "dwangle;":0x29a6, - "dzcy;":0x45f, "dzigrarr;":0x27ff, - "eDDot;":0x2a77, "eDot;":0x2251, - "eacute":0xe9, "eacute;":0xe9, - "easter;":0x2a6e, "ecaron;":0x11b, - "ecir;":0x2256, "ecirc":0xea, - "ecirc;":0xea, "ecolon;":0x2255, - "ecy;":0x44d, "edot;":0x117, - "ee;":0x2147, "efDot;":0x2252, - "efr;":[0xd835,0xdd22], "eg;":0x2a9a, - "egrave":0xe8, "egrave;":0xe8, - "egs;":0x2a96, "egsdot;":0x2a98, - "el;":0x2a99, "elinters;":0x23e7, - "ell;":0x2113, "els;":0x2a95, - "elsdot;":0x2a97, "emacr;":0x113, - "empty;":0x2205, "emptyset;":0x2205, - "emptyv;":0x2205, "emsp13;":0x2004, - "emsp14;":0x2005, "emsp;":0x2003, - "eng;":0x14b, "ensp;":0x2002, - "eogon;":0x119, "eopf;":[0xd835,0xdd56], - "epar;":0x22d5, "eparsl;":0x29e3, - "eplus;":0x2a71, "epsi;":0x3b5, - "epsilon;":0x3b5, "epsiv;":0x3f5, - "eqcirc;":0x2256, "eqcolon;":0x2255, - "eqsim;":0x2242, "eqslantgtr;":0x2a96, - "eqslantless;":0x2a95, "equals;":0x3d, - "equest;":0x225f, "equiv;":0x2261, - "equivDD;":0x2a78, "eqvparsl;":0x29e5, - "erDot;":0x2253, "erarr;":0x2971, - "escr;":0x212f, "esdot;":0x2250, - "esim;":0x2242, "eta;":0x3b7, - "eth":0xf0, "eth;":0xf0, - "euml":0xeb, "euml;":0xeb, - "euro;":0x20ac, "excl;":0x21, - "exist;":0x2203, "expectation;":0x2130, - "exponentiale;":0x2147, "fallingdotseq;":0x2252, - "fcy;":0x444, "female;":0x2640, - "ffilig;":0xfb03, "fflig;":0xfb00, - "ffllig;":0xfb04, "ffr;":[0xd835,0xdd23], - "filig;":0xfb01, "fjlig;":[0x66,0x6a], - "flat;":0x266d, "fllig;":0xfb02, - "fltns;":0x25b1, "fnof;":0x192, - "fopf;":[0xd835,0xdd57], "forall;":0x2200, - "fork;":0x22d4, "forkv;":0x2ad9, - "fpartint;":0x2a0d, "frac12":0xbd, - "frac12;":0xbd, "frac13;":0x2153, - "frac14":0xbc, "frac14;":0xbc, - "frac15;":0x2155, "frac16;":0x2159, - "frac18;":0x215b, "frac23;":0x2154, - "frac25;":0x2156, "frac34":0xbe, - "frac34;":0xbe, "frac35;":0x2157, - "frac38;":0x215c, "frac45;":0x2158, - "frac56;":0x215a, "frac58;":0x215d, - "frac78;":0x215e, "frasl;":0x2044, - "frown;":0x2322, "fscr;":[0xd835,0xdcbb], - "gE;":0x2267, "gEl;":0x2a8c, - "gacute;":0x1f5, "gamma;":0x3b3, - "gammad;":0x3dd, "gap;":0x2a86, - "gbreve;":0x11f, "gcirc;":0x11d, - "gcy;":0x433, "gdot;":0x121, - "ge;":0x2265, "gel;":0x22db, - "geq;":0x2265, "geqq;":0x2267, - "geqslant;":0x2a7e, "ges;":0x2a7e, - "gescc;":0x2aa9, "gesdot;":0x2a80, - "gesdoto;":0x2a82, "gesdotol;":0x2a84, - "gesl;":[0x22db,0xfe00], "gesles;":0x2a94, - "gfr;":[0xd835,0xdd24], "gg;":0x226b, - "ggg;":0x22d9, "gimel;":0x2137, - "gjcy;":0x453, "gl;":0x2277, - "glE;":0x2a92, "gla;":0x2aa5, - "glj;":0x2aa4, "gnE;":0x2269, - "gnap;":0x2a8a, "gnapprox;":0x2a8a, - "gne;":0x2a88, "gneq;":0x2a88, - "gneqq;":0x2269, "gnsim;":0x22e7, - "gopf;":[0xd835,0xdd58], "grave;":0x60, - "gscr;":0x210a, "gsim;":0x2273, - "gsime;":0x2a8e, "gsiml;":0x2a90, - "gt":0x3e, "gt;":0x3e, - "gtcc;":0x2aa7, "gtcir;":0x2a7a, - "gtdot;":0x22d7, "gtlPar;":0x2995, - "gtquest;":0x2a7c, "gtrapprox;":0x2a86, - "gtrarr;":0x2978, "gtrdot;":0x22d7, - "gtreqless;":0x22db, "gtreqqless;":0x2a8c, - "gtrless;":0x2277, "gtrsim;":0x2273, - "gvertneqq;":[0x2269,0xfe00], "gvnE;":[0x2269,0xfe00], - "hArr;":0x21d4, "hairsp;":0x200a, - "half;":0xbd, "hamilt;":0x210b, - "hardcy;":0x44a, "harr;":0x2194, - "harrcir;":0x2948, "harrw;":0x21ad, - "hbar;":0x210f, "hcirc;":0x125, - "hearts;":0x2665, "heartsuit;":0x2665, - "hellip;":0x2026, "hercon;":0x22b9, - "hfr;":[0xd835,0xdd25], "hksearow;":0x2925, - "hkswarow;":0x2926, "hoarr;":0x21ff, - "homtht;":0x223b, "hookleftarrow;":0x21a9, - "hookrightarrow;":0x21aa, "hopf;":[0xd835,0xdd59], - "horbar;":0x2015, "hscr;":[0xd835,0xdcbd], - "hslash;":0x210f, "hstrok;":0x127, - "hybull;":0x2043, "hyphen;":0x2010, - "iacute":0xed, "iacute;":0xed, - "ic;":0x2063, "icirc":0xee, - "icirc;":0xee, "icy;":0x438, - "iecy;":0x435, "iexcl":0xa1, - "iexcl;":0xa1, "iff;":0x21d4, - "ifr;":[0xd835,0xdd26], "igrave":0xec, - "igrave;":0xec, "ii;":0x2148, - "iiiint;":0x2a0c, "iiint;":0x222d, - "iinfin;":0x29dc, "iiota;":0x2129, - "ijlig;":0x133, "imacr;":0x12b, - "image;":0x2111, "imagline;":0x2110, - "imagpart;":0x2111, "imath;":0x131, - "imof;":0x22b7, "imped;":0x1b5, - "in;":0x2208, "incare;":0x2105, - "infin;":0x221e, "infintie;":0x29dd, - "inodot;":0x131, "int;":0x222b, - "intcal;":0x22ba, "integers;":0x2124, - "intercal;":0x22ba, "intlarhk;":0x2a17, - "intprod;":0x2a3c, "iocy;":0x451, - "iogon;":0x12f, "iopf;":[0xd835,0xdd5a], - "iota;":0x3b9, "iprod;":0x2a3c, - "iquest":0xbf, "iquest;":0xbf, - "iscr;":[0xd835,0xdcbe], "isin;":0x2208, - "isinE;":0x22f9, "isindot;":0x22f5, - "isins;":0x22f4, "isinsv;":0x22f3, - "isinv;":0x2208, "it;":0x2062, - "itilde;":0x129, "iukcy;":0x456, - "iuml":0xef, "iuml;":0xef, - "jcirc;":0x135, "jcy;":0x439, - "jfr;":[0xd835,0xdd27], "jmath;":0x237, - "jopf;":[0xd835,0xdd5b], "jscr;":[0xd835,0xdcbf], - "jsercy;":0x458, "jukcy;":0x454, - "kappa;":0x3ba, "kappav;":0x3f0, - "kcedil;":0x137, "kcy;":0x43a, - "kfr;":[0xd835,0xdd28], "kgreen;":0x138, - "khcy;":0x445, "kjcy;":0x45c, - "kopf;":[0xd835,0xdd5c], "kscr;":[0xd835,0xdcc0], - "lAarr;":0x21da, "lArr;":0x21d0, - "lAtail;":0x291b, "lBarr;":0x290e, - "lE;":0x2266, "lEg;":0x2a8b, - "lHar;":0x2962, "lacute;":0x13a, - "laemptyv;":0x29b4, "lagran;":0x2112, - "lambda;":0x3bb, "lang;":0x27e8, - "langd;":0x2991, "langle;":0x27e8, - "lap;":0x2a85, "laquo":0xab, - "laquo;":0xab, "larr;":0x2190, - "larrb;":0x21e4, "larrbfs;":0x291f, - "larrfs;":0x291d, "larrhk;":0x21a9, - "larrlp;":0x21ab, "larrpl;":0x2939, - "larrsim;":0x2973, "larrtl;":0x21a2, - "lat;":0x2aab, "latail;":0x2919, - "late;":0x2aad, "lates;":[0x2aad,0xfe00], - "lbarr;":0x290c, "lbbrk;":0x2772, - "lbrace;":0x7b, "lbrack;":0x5b, - "lbrke;":0x298b, "lbrksld;":0x298f, - "lbrkslu;":0x298d, "lcaron;":0x13e, - "lcedil;":0x13c, "lceil;":0x2308, - "lcub;":0x7b, "lcy;":0x43b, - "ldca;":0x2936, "ldquo;":0x201c, - "ldquor;":0x201e, "ldrdhar;":0x2967, - "ldrushar;":0x294b, "ldsh;":0x21b2, - "le;":0x2264, "leftarrow;":0x2190, - "leftarrowtail;":0x21a2, "leftharpoondown;":0x21bd, - "leftharpoonup;":0x21bc, "leftleftarrows;":0x21c7, - "leftrightarrow;":0x2194, "leftrightarrows;":0x21c6, - "leftrightharpoons;":0x21cb, "leftrightsquigarrow;":0x21ad, - "leftthreetimes;":0x22cb, "leg;":0x22da, - "leq;":0x2264, "leqq;":0x2266, - "leqslant;":0x2a7d, "les;":0x2a7d, - "lescc;":0x2aa8, "lesdot;":0x2a7f, - "lesdoto;":0x2a81, "lesdotor;":0x2a83, - "lesg;":[0x22da,0xfe00], "lesges;":0x2a93, - "lessapprox;":0x2a85, "lessdot;":0x22d6, - "lesseqgtr;":0x22da, "lesseqqgtr;":0x2a8b, - "lessgtr;":0x2276, "lesssim;":0x2272, - "lfisht;":0x297c, "lfloor;":0x230a, - "lfr;":[0xd835,0xdd29], "lg;":0x2276, - "lgE;":0x2a91, "lhard;":0x21bd, - "lharu;":0x21bc, "lharul;":0x296a, - "lhblk;":0x2584, "ljcy;":0x459, - "ll;":0x226a, "llarr;":0x21c7, - "llcorner;":0x231e, "llhard;":0x296b, - "lltri;":0x25fa, "lmidot;":0x140, - "lmoust;":0x23b0, "lmoustache;":0x23b0, - "lnE;":0x2268, "lnap;":0x2a89, - "lnapprox;":0x2a89, "lne;":0x2a87, - "lneq;":0x2a87, "lneqq;":0x2268, - "lnsim;":0x22e6, "loang;":0x27ec, - "loarr;":0x21fd, "lobrk;":0x27e6, - "longleftarrow;":0x27f5, "longleftrightarrow;":0x27f7, - "longmapsto;":0x27fc, "longrightarrow;":0x27f6, - "looparrowleft;":0x21ab, "looparrowright;":0x21ac, - "lopar;":0x2985, "lopf;":[0xd835,0xdd5d], - "loplus;":0x2a2d, "lotimes;":0x2a34, - "lowast;":0x2217, "lowbar;":0x5f, - "loz;":0x25ca, "lozenge;":0x25ca, - "lozf;":0x29eb, "lpar;":0x28, - "lparlt;":0x2993, "lrarr;":0x21c6, - "lrcorner;":0x231f, "lrhar;":0x21cb, - "lrhard;":0x296d, "lrm;":0x200e, - "lrtri;":0x22bf, "lsaquo;":0x2039, - "lscr;":[0xd835,0xdcc1], "lsh;":0x21b0, - "lsim;":0x2272, "lsime;":0x2a8d, - "lsimg;":0x2a8f, "lsqb;":0x5b, - "lsquo;":0x2018, "lsquor;":0x201a, - "lstrok;":0x142, "lt":0x3c, - "lt;":0x3c, "ltcc;":0x2aa6, - "ltcir;":0x2a79, "ltdot;":0x22d6, - "lthree;":0x22cb, "ltimes;":0x22c9, - "ltlarr;":0x2976, "ltquest;":0x2a7b, - "ltrPar;":0x2996, "ltri;":0x25c3, - "ltrie;":0x22b4, "ltrif;":0x25c2, - "lurdshar;":0x294a, "luruhar;":0x2966, - "lvertneqq;":[0x2268,0xfe00], "lvnE;":[0x2268,0xfe00], - "mDDot;":0x223a, "macr":0xaf, - "macr;":0xaf, "male;":0x2642, - "malt;":0x2720, "maltese;":0x2720, - "map;":0x21a6, "mapsto;":0x21a6, - "mapstodown;":0x21a7, "mapstoleft;":0x21a4, - "mapstoup;":0x21a5, "marker;":0x25ae, - "mcomma;":0x2a29, "mcy;":0x43c, - "mdash;":0x2014, "measuredangle;":0x2221, - "mfr;":[0xd835,0xdd2a], "mho;":0x2127, - "micro":0xb5, "micro;":0xb5, - "mid;":0x2223, "midast;":0x2a, - "midcir;":0x2af0, "middot":0xb7, - "middot;":0xb7, "minus;":0x2212, - "minusb;":0x229f, "minusd;":0x2238, - "minusdu;":0x2a2a, "mlcp;":0x2adb, - "mldr;":0x2026, "mnplus;":0x2213, - "models;":0x22a7, "mopf;":[0xd835,0xdd5e], - "mp;":0x2213, "mscr;":[0xd835,0xdcc2], - "mstpos;":0x223e, "mu;":0x3bc, - "multimap;":0x22b8, "mumap;":0x22b8, - "nGg;":[0x22d9,0x338], "nGt;":[0x226b,0x20d2], - "nGtv;":[0x226b,0x338], "nLeftarrow;":0x21cd, - "nLeftrightarrow;":0x21ce, "nLl;":[0x22d8,0x338], - "nLt;":[0x226a,0x20d2], "nLtv;":[0x226a,0x338], - "nRightarrow;":0x21cf, "nVDash;":0x22af, - "nVdash;":0x22ae, "nabla;":0x2207, - "nacute;":0x144, "nang;":[0x2220,0x20d2], - "nap;":0x2249, "napE;":[0x2a70,0x338], - "napid;":[0x224b,0x338], "napos;":0x149, - "napprox;":0x2249, "natur;":0x266e, - "natural;":0x266e, "naturals;":0x2115, - "nbsp":0xa0, "nbsp;":0xa0, - "nbump;":[0x224e,0x338], "nbumpe;":[0x224f,0x338], - "ncap;":0x2a43, "ncaron;":0x148, - "ncedil;":0x146, "ncong;":0x2247, - "ncongdot;":[0x2a6d,0x338], "ncup;":0x2a42, - "ncy;":0x43d, "ndash;":0x2013, - "ne;":0x2260, "neArr;":0x21d7, - "nearhk;":0x2924, "nearr;":0x2197, - "nearrow;":0x2197, "nedot;":[0x2250,0x338], - "nequiv;":0x2262, "nesear;":0x2928, - "nesim;":[0x2242,0x338], "nexist;":0x2204, - "nexists;":0x2204, "nfr;":[0xd835,0xdd2b], - "ngE;":[0x2267,0x338], "nge;":0x2271, - "ngeq;":0x2271, "ngeqq;":[0x2267,0x338], - "ngeqslant;":[0x2a7e,0x338], "nges;":[0x2a7e,0x338], - "ngsim;":0x2275, "ngt;":0x226f, - "ngtr;":0x226f, "nhArr;":0x21ce, - "nharr;":0x21ae, "nhpar;":0x2af2, - "ni;":0x220b, "nis;":0x22fc, - "nisd;":0x22fa, "niv;":0x220b, - "njcy;":0x45a, "nlArr;":0x21cd, - "nlE;":[0x2266,0x338], "nlarr;":0x219a, - "nldr;":0x2025, "nle;":0x2270, - "nleftarrow;":0x219a, "nleftrightarrow;":0x21ae, - "nleq;":0x2270, "nleqq;":[0x2266,0x338], - "nleqslant;":[0x2a7d,0x338], "nles;":[0x2a7d,0x338], - "nless;":0x226e, "nlsim;":0x2274, - "nlt;":0x226e, "nltri;":0x22ea, - "nltrie;":0x22ec, "nmid;":0x2224, - "nopf;":[0xd835,0xdd5f], "not":0xac, - "not;":0xac, "notin;":0x2209, - "notinE;":[0x22f9,0x338], "notindot;":[0x22f5,0x338], - "notinva;":0x2209, "notinvb;":0x22f7, - "notinvc;":0x22f6, "notni;":0x220c, - "notniva;":0x220c, "notnivb;":0x22fe, - "notnivc;":0x22fd, "npar;":0x2226, - "nparallel;":0x2226, "nparsl;":[0x2afd,0x20e5], - "npart;":[0x2202,0x338], "npolint;":0x2a14, - "npr;":0x2280, "nprcue;":0x22e0, - "npre;":[0x2aaf,0x338], "nprec;":0x2280, - "npreceq;":[0x2aaf,0x338], "nrArr;":0x21cf, - "nrarr;":0x219b, "nrarrc;":[0x2933,0x338], - "nrarrw;":[0x219d,0x338], "nrightarrow;":0x219b, - "nrtri;":0x22eb, "nrtrie;":0x22ed, - "nsc;":0x2281, "nsccue;":0x22e1, - "nsce;":[0x2ab0,0x338], "nscr;":[0xd835,0xdcc3], - "nshortmid;":0x2224, "nshortparallel;":0x2226, - "nsim;":0x2241, "nsime;":0x2244, - "nsimeq;":0x2244, "nsmid;":0x2224, - "nspar;":0x2226, "nsqsube;":0x22e2, - "nsqsupe;":0x22e3, "nsub;":0x2284, - "nsubE;":[0x2ac5,0x338], "nsube;":0x2288, - "nsubset;":[0x2282,0x20d2], "nsubseteq;":0x2288, - "nsubseteqq;":[0x2ac5,0x338], "nsucc;":0x2281, - "nsucceq;":[0x2ab0,0x338], "nsup;":0x2285, - "nsupE;":[0x2ac6,0x338], "nsupe;":0x2289, - "nsupset;":[0x2283,0x20d2], "nsupseteq;":0x2289, - "nsupseteqq;":[0x2ac6,0x338], "ntgl;":0x2279, - "ntilde":0xf1, "ntilde;":0xf1, - "ntlg;":0x2278, "ntriangleleft;":0x22ea, - "ntrianglelefteq;":0x22ec, "ntriangleright;":0x22eb, - "ntrianglerighteq;":0x22ed, "nu;":0x3bd, - "num;":0x23, "numero;":0x2116, - "numsp;":0x2007, "nvDash;":0x22ad, - "nvHarr;":0x2904, "nvap;":[0x224d,0x20d2], - "nvdash;":0x22ac, "nvge;":[0x2265,0x20d2], - "nvgt;":[0x3e,0x20d2], "nvinfin;":0x29de, - "nvlArr;":0x2902, "nvle;":[0x2264,0x20d2], - "nvlt;":[0x3c,0x20d2], "nvltrie;":[0x22b4,0x20d2], - "nvrArr;":0x2903, "nvrtrie;":[0x22b5,0x20d2], - "nvsim;":[0x223c,0x20d2], "nwArr;":0x21d6, - "nwarhk;":0x2923, "nwarr;":0x2196, - "nwarrow;":0x2196, "nwnear;":0x2927, - "oS;":0x24c8, "oacute":0xf3, - "oacute;":0xf3, "oast;":0x229b, - "ocir;":0x229a, "ocirc":0xf4, - "ocirc;":0xf4, "ocy;":0x43e, - "odash;":0x229d, "odblac;":0x151, - "odiv;":0x2a38, "odot;":0x2299, - "odsold;":0x29bc, "oelig;":0x153, - "ofcir;":0x29bf, "ofr;":[0xd835,0xdd2c], - "ogon;":0x2db, "ograve":0xf2, - "ograve;":0xf2, "ogt;":0x29c1, - "ohbar;":0x29b5, "ohm;":0x3a9, - "oint;":0x222e, "olarr;":0x21ba, - "olcir;":0x29be, "olcross;":0x29bb, - "oline;":0x203e, "olt;":0x29c0, - "omacr;":0x14d, "omega;":0x3c9, - "omicron;":0x3bf, "omid;":0x29b6, - "ominus;":0x2296, "oopf;":[0xd835,0xdd60], - "opar;":0x29b7, "operp;":0x29b9, - "oplus;":0x2295, "or;":0x2228, - "orarr;":0x21bb, "ord;":0x2a5d, - "order;":0x2134, "orderof;":0x2134, - "ordf":0xaa, "ordf;":0xaa, - "ordm":0xba, "ordm;":0xba, - "origof;":0x22b6, "oror;":0x2a56, - "orslope;":0x2a57, "orv;":0x2a5b, - "oscr;":0x2134, "oslash":0xf8, - "oslash;":0xf8, "osol;":0x2298, - "otilde":0xf5, "otilde;":0xf5, - "otimes;":0x2297, "otimesas;":0x2a36, - "ouml":0xf6, "ouml;":0xf6, - "ovbar;":0x233d, "par;":0x2225, - "para":0xb6, "para;":0xb6, - "parallel;":0x2225, "parsim;":0x2af3, - "parsl;":0x2afd, "part;":0x2202, - "pcy;":0x43f, "percnt;":0x25, - "period;":0x2e, "permil;":0x2030, - "perp;":0x22a5, "pertenk;":0x2031, - "pfr;":[0xd835,0xdd2d], "phi;":0x3c6, - "phiv;":0x3d5, "phmmat;":0x2133, - "phone;":0x260e, "pi;":0x3c0, - "pitchfork;":0x22d4, "piv;":0x3d6, - "planck;":0x210f, "planckh;":0x210e, - "plankv;":0x210f, "plus;":0x2b, - "plusacir;":0x2a23, "plusb;":0x229e, - "pluscir;":0x2a22, "plusdo;":0x2214, - "plusdu;":0x2a25, "pluse;":0x2a72, - "plusmn":0xb1, "plusmn;":0xb1, - "plussim;":0x2a26, "plustwo;":0x2a27, - "pm;":0xb1, "pointint;":0x2a15, - "popf;":[0xd835,0xdd61], "pound":0xa3, - "pound;":0xa3, "pr;":0x227a, - "prE;":0x2ab3, "prap;":0x2ab7, - "prcue;":0x227c, "pre;":0x2aaf, - "prec;":0x227a, "precapprox;":0x2ab7, - "preccurlyeq;":0x227c, "preceq;":0x2aaf, - "precnapprox;":0x2ab9, "precneqq;":0x2ab5, - "precnsim;":0x22e8, "precsim;":0x227e, - "prime;":0x2032, "primes;":0x2119, - "prnE;":0x2ab5, "prnap;":0x2ab9, - "prnsim;":0x22e8, "prod;":0x220f, - "profalar;":0x232e, "profline;":0x2312, - "profsurf;":0x2313, "prop;":0x221d, - "propto;":0x221d, "prsim;":0x227e, - "prurel;":0x22b0, "pscr;":[0xd835,0xdcc5], - "psi;":0x3c8, "puncsp;":0x2008, - "qfr;":[0xd835,0xdd2e], "qint;":0x2a0c, - "qopf;":[0xd835,0xdd62], "qprime;":0x2057, - "qscr;":[0xd835,0xdcc6], "quaternions;":0x210d, - "quatint;":0x2a16, "quest;":0x3f, - "questeq;":0x225f, "quot":0x22, - "quot;":0x22, "rAarr;":0x21db, - "rArr;":0x21d2, "rAtail;":0x291c, - "rBarr;":0x290f, "rHar;":0x2964, - "race;":[0x223d,0x331], "racute;":0x155, - "radic;":0x221a, "raemptyv;":0x29b3, - "rang;":0x27e9, "rangd;":0x2992, - "range;":0x29a5, "rangle;":0x27e9, - "raquo":0xbb, "raquo;":0xbb, - "rarr;":0x2192, "rarrap;":0x2975, - "rarrb;":0x21e5, "rarrbfs;":0x2920, - "rarrc;":0x2933, "rarrfs;":0x291e, - "rarrhk;":0x21aa, "rarrlp;":0x21ac, - "rarrpl;":0x2945, "rarrsim;":0x2974, - "rarrtl;":0x21a3, "rarrw;":0x219d, - "ratail;":0x291a, "ratio;":0x2236, - "rationals;":0x211a, "rbarr;":0x290d, - "rbbrk;":0x2773, "rbrace;":0x7d, - "rbrack;":0x5d, "rbrke;":0x298c, - "rbrksld;":0x298e, "rbrkslu;":0x2990, - "rcaron;":0x159, "rcedil;":0x157, - "rceil;":0x2309, "rcub;":0x7d, - "rcy;":0x440, "rdca;":0x2937, - "rdldhar;":0x2969, "rdquo;":0x201d, - "rdquor;":0x201d, "rdsh;":0x21b3, - "real;":0x211c, "realine;":0x211b, - "realpart;":0x211c, "reals;":0x211d, - "rect;":0x25ad, "reg":0xae, - "reg;":0xae, "rfisht;":0x297d, - "rfloor;":0x230b, "rfr;":[0xd835,0xdd2f], - "rhard;":0x21c1, "rharu;":0x21c0, - "rharul;":0x296c, "rho;":0x3c1, - "rhov;":0x3f1, "rightarrow;":0x2192, - "rightarrowtail;":0x21a3, "rightharpoondown;":0x21c1, - "rightharpoonup;":0x21c0, "rightleftarrows;":0x21c4, - "rightleftharpoons;":0x21cc, "rightrightarrows;":0x21c9, - "rightsquigarrow;":0x219d, "rightthreetimes;":0x22cc, - "ring;":0x2da, "risingdotseq;":0x2253, - "rlarr;":0x21c4, "rlhar;":0x21cc, - "rlm;":0x200f, "rmoust;":0x23b1, - "rmoustache;":0x23b1, "rnmid;":0x2aee, - "roang;":0x27ed, "roarr;":0x21fe, - "robrk;":0x27e7, "ropar;":0x2986, - "ropf;":[0xd835,0xdd63], "roplus;":0x2a2e, - "rotimes;":0x2a35, "rpar;":0x29, - "rpargt;":0x2994, "rppolint;":0x2a12, - "rrarr;":0x21c9, "rsaquo;":0x203a, - "rscr;":[0xd835,0xdcc7], "rsh;":0x21b1, - "rsqb;":0x5d, "rsquo;":0x2019, - "rsquor;":0x2019, "rthree;":0x22cc, - "rtimes;":0x22ca, "rtri;":0x25b9, - "rtrie;":0x22b5, "rtrif;":0x25b8, - "rtriltri;":0x29ce, "ruluhar;":0x2968, - "rx;":0x211e, "sacute;":0x15b, - "sbquo;":0x201a, "sc;":0x227b, - "scE;":0x2ab4, "scap;":0x2ab8, - "scaron;":0x161, "sccue;":0x227d, - "sce;":0x2ab0, "scedil;":0x15f, - "scirc;":0x15d, "scnE;":0x2ab6, - "scnap;":0x2aba, "scnsim;":0x22e9, - "scpolint;":0x2a13, "scsim;":0x227f, - "scy;":0x441, "sdot;":0x22c5, - "sdotb;":0x22a1, "sdote;":0x2a66, - "seArr;":0x21d8, "searhk;":0x2925, - "searr;":0x2198, "searrow;":0x2198, - "sect":0xa7, "sect;":0xa7, - "semi;":0x3b, "seswar;":0x2929, - "setminus;":0x2216, "setmn;":0x2216, - "sext;":0x2736, "sfr;":[0xd835,0xdd30], - "sfrown;":0x2322, "sharp;":0x266f, - "shchcy;":0x449, "shcy;":0x448, - "shortmid;":0x2223, "shortparallel;":0x2225, - "shy":0xad, "shy;":0xad, - "sigma;":0x3c3, "sigmaf;":0x3c2, - "sigmav;":0x3c2, "sim;":0x223c, - "simdot;":0x2a6a, "sime;":0x2243, - "simeq;":0x2243, "simg;":0x2a9e, - "simgE;":0x2aa0, "siml;":0x2a9d, - "simlE;":0x2a9f, "simne;":0x2246, - "simplus;":0x2a24, "simrarr;":0x2972, - "slarr;":0x2190, "smallsetminus;":0x2216, - "smashp;":0x2a33, "smeparsl;":0x29e4, - "smid;":0x2223, "smile;":0x2323, - "smt;":0x2aaa, "smte;":0x2aac, - "smtes;":[0x2aac,0xfe00], "softcy;":0x44c, - "sol;":0x2f, "solb;":0x29c4, - "solbar;":0x233f, "sopf;":[0xd835,0xdd64], - "spades;":0x2660, "spadesuit;":0x2660, - "spar;":0x2225, "sqcap;":0x2293, - "sqcaps;":[0x2293,0xfe00], "sqcup;":0x2294, - "sqcups;":[0x2294,0xfe00], "sqsub;":0x228f, - "sqsube;":0x2291, "sqsubset;":0x228f, - "sqsubseteq;":0x2291, "sqsup;":0x2290, - "sqsupe;":0x2292, "sqsupset;":0x2290, - "sqsupseteq;":0x2292, "squ;":0x25a1, - "square;":0x25a1, "squarf;":0x25aa, - "squf;":0x25aa, "srarr;":0x2192, - "sscr;":[0xd835,0xdcc8], "ssetmn;":0x2216, - "ssmile;":0x2323, "sstarf;":0x22c6, - "star;":0x2606, "starf;":0x2605, - "straightepsilon;":0x3f5, "straightphi;":0x3d5, - "strns;":0xaf, "sub;":0x2282, - "subE;":0x2ac5, "subdot;":0x2abd, - "sube;":0x2286, "subedot;":0x2ac3, - "submult;":0x2ac1, "subnE;":0x2acb, - "subne;":0x228a, "subplus;":0x2abf, - "subrarr;":0x2979, "subset;":0x2282, - "subseteq;":0x2286, "subseteqq;":0x2ac5, - "subsetneq;":0x228a, "subsetneqq;":0x2acb, - "subsim;":0x2ac7, "subsub;":0x2ad5, - "subsup;":0x2ad3, "succ;":0x227b, - "succapprox;":0x2ab8, "succcurlyeq;":0x227d, - "succeq;":0x2ab0, "succnapprox;":0x2aba, - "succneqq;":0x2ab6, "succnsim;":0x22e9, - "succsim;":0x227f, "sum;":0x2211, - "sung;":0x266a, "sup1":0xb9, - "sup1;":0xb9, "sup2":0xb2, - "sup2;":0xb2, "sup3":0xb3, - "sup3;":0xb3, "sup;":0x2283, - "supE;":0x2ac6, "supdot;":0x2abe, - "supdsub;":0x2ad8, "supe;":0x2287, - "supedot;":0x2ac4, "suphsol;":0x27c9, - "suphsub;":0x2ad7, "suplarr;":0x297b, - "supmult;":0x2ac2, "supnE;":0x2acc, - "supne;":0x228b, "supplus;":0x2ac0, - "supset;":0x2283, "supseteq;":0x2287, - "supseteqq;":0x2ac6, "supsetneq;":0x228b, - "supsetneqq;":0x2acc, "supsim;":0x2ac8, - "supsub;":0x2ad4, "supsup;":0x2ad6, - "swArr;":0x21d9, "swarhk;":0x2926, - "swarr;":0x2199, "swarrow;":0x2199, - "swnwar;":0x292a, "szlig":0xdf, - "szlig;":0xdf, "target;":0x2316, - "tau;":0x3c4, "tbrk;":0x23b4, - "tcaron;":0x165, "tcedil;":0x163, - "tcy;":0x442, "tdot;":0x20db, - "telrec;":0x2315, "tfr;":[0xd835,0xdd31], - "there4;":0x2234, "therefore;":0x2234, - "theta;":0x3b8, "thetasym;":0x3d1, - "thetav;":0x3d1, "thickapprox;":0x2248, - "thicksim;":0x223c, "thinsp;":0x2009, - "thkap;":0x2248, "thksim;":0x223c, - "thorn":0xfe, "thorn;":0xfe, - "tilde;":0x2dc, "times":0xd7, - "times;":0xd7, "timesb;":0x22a0, - "timesbar;":0x2a31, "timesd;":0x2a30, - "tint;":0x222d, "toea;":0x2928, - "top;":0x22a4, "topbot;":0x2336, - "topcir;":0x2af1, "topf;":[0xd835,0xdd65], - "topfork;":0x2ada, "tosa;":0x2929, - "tprime;":0x2034, "trade;":0x2122, - "triangle;":0x25b5, "triangledown;":0x25bf, - "triangleleft;":0x25c3, "trianglelefteq;":0x22b4, - "triangleq;":0x225c, "triangleright;":0x25b9, - "trianglerighteq;":0x22b5, "tridot;":0x25ec, - "trie;":0x225c, "triminus;":0x2a3a, - "triplus;":0x2a39, "trisb;":0x29cd, - "tritime;":0x2a3b, "trpezium;":0x23e2, - "tscr;":[0xd835,0xdcc9], "tscy;":0x446, - "tshcy;":0x45b, "tstrok;":0x167, - "twixt;":0x226c, "twoheadleftarrow;":0x219e, - "twoheadrightarrow;":0x21a0, "uArr;":0x21d1, - "uHar;":0x2963, "uacute":0xfa, - "uacute;":0xfa, "uarr;":0x2191, - "ubrcy;":0x45e, "ubreve;":0x16d, - "ucirc":0xfb, "ucirc;":0xfb, - "ucy;":0x443, "udarr;":0x21c5, - "udblac;":0x171, "udhar;":0x296e, - "ufisht;":0x297e, "ufr;":[0xd835,0xdd32], - "ugrave":0xf9, "ugrave;":0xf9, - "uharl;":0x21bf, "uharr;":0x21be, - "uhblk;":0x2580, "ulcorn;":0x231c, - "ulcorner;":0x231c, "ulcrop;":0x230f, - "ultri;":0x25f8, "umacr;":0x16b, - "uml":0xa8, "uml;":0xa8, - "uogon;":0x173, "uopf;":[0xd835,0xdd66], - "uparrow;":0x2191, "updownarrow;":0x2195, - "upharpoonleft;":0x21bf, "upharpoonright;":0x21be, - "uplus;":0x228e, "upsi;":0x3c5, - "upsih;":0x3d2, "upsilon;":0x3c5, - "upuparrows;":0x21c8, "urcorn;":0x231d, - "urcorner;":0x231d, "urcrop;":0x230e, - "uring;":0x16f, "urtri;":0x25f9, - "uscr;":[0xd835,0xdcca], "utdot;":0x22f0, - "utilde;":0x169, "utri;":0x25b5, - "utrif;":0x25b4, "uuarr;":0x21c8, - "uuml":0xfc, "uuml;":0xfc, - "uwangle;":0x29a7, "vArr;":0x21d5, - "vBar;":0x2ae8, "vBarv;":0x2ae9, - "vDash;":0x22a8, "vangrt;":0x299c, - "varepsilon;":0x3f5, "varkappa;":0x3f0, - "varnothing;":0x2205, "varphi;":0x3d5, - "varpi;":0x3d6, "varpropto;":0x221d, - "varr;":0x2195, "varrho;":0x3f1, - "varsigma;":0x3c2, "varsubsetneq;":[0x228a,0xfe00], - "varsubsetneqq;":[0x2acb,0xfe00], "varsupsetneq;":[0x228b,0xfe00], - "varsupsetneqq;":[0x2acc,0xfe00], "vartheta;":0x3d1, - "vartriangleleft;":0x22b2, "vartriangleright;":0x22b3, - "vcy;":0x432, "vdash;":0x22a2, - "vee;":0x2228, "veebar;":0x22bb, - "veeeq;":0x225a, "vellip;":0x22ee, - "verbar;":0x7c, "vert;":0x7c, - "vfr;":[0xd835,0xdd33], "vltri;":0x22b2, - "vnsub;":[0x2282,0x20d2], "vnsup;":[0x2283,0x20d2], - "vopf;":[0xd835,0xdd67], "vprop;":0x221d, - "vrtri;":0x22b3, "vscr;":[0xd835,0xdccb], - "vsubnE;":[0x2acb,0xfe00], "vsubne;":[0x228a,0xfe00], - "vsupnE;":[0x2acc,0xfe00], "vsupne;":[0x228b,0xfe00], - "vzigzag;":0x299a, "wcirc;":0x175, - "wedbar;":0x2a5f, "wedge;":0x2227, - "wedgeq;":0x2259, "weierp;":0x2118, - "wfr;":[0xd835,0xdd34], "wopf;":[0xd835,0xdd68], - "wp;":0x2118, "wr;":0x2240, - "wreath;":0x2240, "wscr;":[0xd835,0xdccc], - "xcap;":0x22c2, "xcirc;":0x25ef, - "xcup;":0x22c3, "xdtri;":0x25bd, - "xfr;":[0xd835,0xdd35], "xhArr;":0x27fa, - "xharr;":0x27f7, "xi;":0x3be, - "xlArr;":0x27f8, "xlarr;":0x27f5, - "xmap;":0x27fc, "xnis;":0x22fb, - "xodot;":0x2a00, "xopf;":[0xd835,0xdd69], - "xoplus;":0x2a01, "xotime;":0x2a02, - "xrArr;":0x27f9, "xrarr;":0x27f6, - "xscr;":[0xd835,0xdccd], "xsqcup;":0x2a06, - "xuplus;":0x2a04, "xutri;":0x25b3, - "xvee;":0x22c1, "xwedge;":0x22c0, - "yacute":0xfd, "yacute;":0xfd, - "yacy;":0x44f, "ycirc;":0x177, - "ycy;":0x44b, "yen":0xa5, - "yen;":0xa5, "yfr;":[0xd835,0xdd36], - "yicy;":0x457, "yopf;":[0xd835,0xdd6a], - "yscr;":[0xd835,0xdcce], "yucy;":0x44e, - "yuml":0xff, "yuml;":0xff, - "zacute;":0x17a, "zcaron;":0x17e, - "zcy;":0x437, "zdot;":0x17c, - "zeetrf;":0x2128, "zeta;":0x3b6, - "zfr;":[0xd835,0xdd37], "zhcy;":0x436, - "zigrarr;":0x21dd, "zopf;":[0xd835,0xdd6b], - "zscr;":[0xd835,0xdccf], "zwj;":0x200d, - "zwnj;":0x200c, -}; -/* - * This regexp is generated with test/tools/update-entities.js - * It will always match at least one character -- but note that there - * are no entities whose names are a single character long. - */ -var NAMEDCHARREF = /(A(?:Elig;?|MP;?|acute;?|breve;|c(?:irc;?|y;)|fr;|grave;?|lpha;|macr;|nd;|o(?:gon;|pf;)|pplyFunction;|ring;?|s(?:cr;|sign;)|tilde;?|uml;?)|B(?:a(?:ckslash;|r(?:v;|wed;))|cy;|e(?:cause;|rnoullis;|ta;)|fr;|opf;|reve;|scr;|umpeq;)|C(?:Hcy;|OPY;?|a(?:cute;|p(?:;|italDifferentialD;)|yleys;)|c(?:aron;|edil;?|irc;|onint;)|dot;|e(?:dilla;|nterDot;)|fr;|hi;|ircle(?:Dot;|Minus;|Plus;|Times;)|lo(?:ckwiseContourIntegral;|seCurly(?:DoubleQuote;|Quote;))|o(?:lon(?:;|e;)|n(?:gruent;|int;|tourIntegral;)|p(?:f;|roduct;)|unterClockwiseContourIntegral;)|ross;|scr;|up(?:;|Cap;))|D(?:D(?:;|otrahd;)|Jcy;|Scy;|Zcy;|a(?:gger;|rr;|shv;)|c(?:aron;|y;)|el(?:;|ta;)|fr;|i(?:a(?:critical(?:Acute;|Do(?:t;|ubleAcute;)|Grave;|Tilde;)|mond;)|fferentialD;)|o(?:pf;|t(?:;|Dot;|Equal;)|uble(?:ContourIntegral;|Do(?:t;|wnArrow;)|L(?:eft(?:Arrow;|RightArrow;|Tee;)|ong(?:Left(?:Arrow;|RightArrow;)|RightArrow;))|Right(?:Arrow;|Tee;)|Up(?:Arrow;|DownArrow;)|VerticalBar;)|wn(?:Arrow(?:;|Bar;|UpArrow;)|Breve;|Left(?:RightVector;|TeeVector;|Vector(?:;|Bar;))|Right(?:TeeVector;|Vector(?:;|Bar;))|Tee(?:;|Arrow;)|arrow;))|s(?:cr;|trok;))|E(?:NG;|TH;?|acute;?|c(?:aron;|irc;?|y;)|dot;|fr;|grave;?|lement;|m(?:acr;|pty(?:SmallSquare;|VerySmallSquare;))|o(?:gon;|pf;)|psilon;|qu(?:al(?:;|Tilde;)|ilibrium;)|s(?:cr;|im;)|ta;|uml;?|x(?:ists;|ponentialE;))|F(?:cy;|fr;|illed(?:SmallSquare;|VerySmallSquare;)|o(?:pf;|rAll;|uriertrf;)|scr;)|G(?:Jcy;|T;?|amma(?:;|d;)|breve;|c(?:edil;|irc;|y;)|dot;|fr;|g;|opf;|reater(?:Equal(?:;|Less;)|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;)|scr;|t;)|H(?:ARDcy;|a(?:cek;|t;)|circ;|fr;|ilbertSpace;|o(?:pf;|rizontalLine;)|s(?:cr;|trok;)|ump(?:DownHump;|Equal;))|I(?:Ecy;|Jlig;|Ocy;|acute;?|c(?:irc;?|y;)|dot;|fr;|grave;?|m(?:;|a(?:cr;|ginaryI;)|plies;)|n(?:t(?:;|e(?:gral;|rsection;))|visible(?:Comma;|Times;))|o(?:gon;|pf;|ta;)|scr;|tilde;|u(?:kcy;|ml;?))|J(?:c(?:irc;|y;)|fr;|opf;|s(?:cr;|ercy;)|ukcy;)|K(?:Hcy;|Jcy;|appa;|c(?:edil;|y;)|fr;|opf;|scr;)|L(?:Jcy;|T;?|a(?:cute;|mbda;|ng;|placetrf;|rr;)|c(?:aron;|edil;|y;)|e(?:ft(?:A(?:ngleBracket;|rrow(?:;|Bar;|RightArrow;))|Ceiling;|Do(?:ubleBracket;|wn(?:TeeVector;|Vector(?:;|Bar;)))|Floor;|Right(?:Arrow;|Vector;)|T(?:ee(?:;|Arrow;|Vector;)|riangle(?:;|Bar;|Equal;))|Up(?:DownVector;|TeeVector;|Vector(?:;|Bar;))|Vector(?:;|Bar;)|arrow;|rightarrow;)|ss(?:EqualGreater;|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;))|fr;|l(?:;|eftarrow;)|midot;|o(?:ng(?:Left(?:Arrow;|RightArrow;)|RightArrow;|left(?:arrow;|rightarrow;)|rightarrow;)|pf;|wer(?:LeftArrow;|RightArrow;))|s(?:cr;|h;|trok;)|t;)|M(?:ap;|cy;|e(?:diumSpace;|llintrf;)|fr;|inusPlus;|opf;|scr;|u;)|N(?:Jcy;|acute;|c(?:aron;|edil;|y;)|e(?:gative(?:MediumSpace;|Thi(?:ckSpace;|nSpace;)|VeryThinSpace;)|sted(?:GreaterGreater;|LessLess;)|wLine;)|fr;|o(?:Break;|nBreakingSpace;|pf;|t(?:;|C(?:ongruent;|upCap;)|DoubleVerticalBar;|E(?:lement;|qual(?:;|Tilde;)|xists;)|Greater(?:;|Equal;|FullEqual;|Greater;|Less;|SlantEqual;|Tilde;)|Hump(?:DownHump;|Equal;)|Le(?:ftTriangle(?:;|Bar;|Equal;)|ss(?:;|Equal;|Greater;|Less;|SlantEqual;|Tilde;))|Nested(?:GreaterGreater;|LessLess;)|Precedes(?:;|Equal;|SlantEqual;)|R(?:everseElement;|ightTriangle(?:;|Bar;|Equal;))|S(?:quareSu(?:bset(?:;|Equal;)|perset(?:;|Equal;))|u(?:bset(?:;|Equal;)|cceeds(?:;|Equal;|SlantEqual;|Tilde;)|perset(?:;|Equal;)))|Tilde(?:;|Equal;|FullEqual;|Tilde;)|VerticalBar;))|scr;|tilde;?|u;)|O(?:Elig;|acute;?|c(?:irc;?|y;)|dblac;|fr;|grave;?|m(?:acr;|ega;|icron;)|opf;|penCurly(?:DoubleQuote;|Quote;)|r;|s(?:cr;|lash;?)|ti(?:lde;?|mes;)|uml;?|ver(?:B(?:ar;|rac(?:e;|ket;))|Parenthesis;))|P(?:artialD;|cy;|fr;|hi;|i;|lusMinus;|o(?:incareplane;|pf;)|r(?:;|ecedes(?:;|Equal;|SlantEqual;|Tilde;)|ime;|o(?:duct;|portion(?:;|al;)))|s(?:cr;|i;))|Q(?:UOT;?|fr;|opf;|scr;)|R(?:Barr;|EG;?|a(?:cute;|ng;|rr(?:;|tl;))|c(?:aron;|edil;|y;)|e(?:;|verse(?:E(?:lement;|quilibrium;)|UpEquilibrium;))|fr;|ho;|ight(?:A(?:ngleBracket;|rrow(?:;|Bar;|LeftArrow;))|Ceiling;|Do(?:ubleBracket;|wn(?:TeeVector;|Vector(?:;|Bar;)))|Floor;|T(?:ee(?:;|Arrow;|Vector;)|riangle(?:;|Bar;|Equal;))|Up(?:DownVector;|TeeVector;|Vector(?:;|Bar;))|Vector(?:;|Bar;)|arrow;)|o(?:pf;|undImplies;)|rightarrow;|s(?:cr;|h;)|uleDelayed;)|S(?:H(?:CHcy;|cy;)|OFTcy;|acute;|c(?:;|aron;|edil;|irc;|y;)|fr;|hort(?:DownArrow;|LeftArrow;|RightArrow;|UpArrow;)|igma;|mallCircle;|opf;|q(?:rt;|uare(?:;|Intersection;|Su(?:bset(?:;|Equal;)|perset(?:;|Equal;))|Union;))|scr;|tar;|u(?:b(?:;|set(?:;|Equal;))|c(?:ceeds(?:;|Equal;|SlantEqual;|Tilde;)|hThat;)|m;|p(?:;|erset(?:;|Equal;)|set;)))|T(?:HORN;?|RADE;|S(?:Hcy;|cy;)|a(?:b;|u;)|c(?:aron;|edil;|y;)|fr;|h(?:e(?:refore;|ta;)|i(?:ckSpace;|nSpace;))|ilde(?:;|Equal;|FullEqual;|Tilde;)|opf;|ripleDot;|s(?:cr;|trok;))|U(?:a(?:cute;?|rr(?:;|ocir;))|br(?:cy;|eve;)|c(?:irc;?|y;)|dblac;|fr;|grave;?|macr;|n(?:der(?:B(?:ar;|rac(?:e;|ket;))|Parenthesis;)|ion(?:;|Plus;))|o(?:gon;|pf;)|p(?:Arrow(?:;|Bar;|DownArrow;)|DownArrow;|Equilibrium;|Tee(?:;|Arrow;)|arrow;|downarrow;|per(?:LeftArrow;|RightArrow;)|si(?:;|lon;))|ring;|scr;|tilde;|uml;?)|V(?:Dash;|bar;|cy;|dash(?:;|l;)|e(?:e;|r(?:bar;|t(?:;|ical(?:Bar;|Line;|Separator;|Tilde;))|yThinSpace;))|fr;|opf;|scr;|vdash;)|W(?:circ;|edge;|fr;|opf;|scr;)|X(?:fr;|i;|opf;|scr;)|Y(?:Acy;|Icy;|Ucy;|acute;?|c(?:irc;|y;)|fr;|opf;|scr;|uml;)|Z(?:Hcy;|acute;|c(?:aron;|y;)|dot;|e(?:roWidthSpace;|ta;)|fr;|opf;|scr;)|a(?:acute;?|breve;|c(?:;|E;|d;|irc;?|ute;?|y;)|elig;?|f(?:;|r;)|grave;?|l(?:e(?:fsym;|ph;)|pha;)|m(?:a(?:cr;|lg;)|p;?)|n(?:d(?:;|and;|d;|slope;|v;)|g(?:;|e;|le;|msd(?:;|a(?:a;|b;|c;|d;|e;|f;|g;|h;))|rt(?:;|vb(?:;|d;))|s(?:ph;|t;)|zarr;))|o(?:gon;|pf;)|p(?:;|E;|acir;|e;|id;|os;|prox(?:;|eq;))|ring;?|s(?:cr;|t;|ymp(?:;|eq;))|tilde;?|uml;?|w(?:conint;|int;))|b(?:Not;|a(?:ck(?:cong;|epsilon;|prime;|sim(?:;|eq;))|r(?:vee;|wed(?:;|ge;)))|brk(?:;|tbrk;)|c(?:ong;|y;)|dquo;|e(?:caus(?:;|e;)|mptyv;|psi;|rnou;|t(?:a;|h;|ween;))|fr;|ig(?:c(?:ap;|irc;|up;)|o(?:dot;|plus;|times;)|s(?:qcup;|tar;)|triangle(?:down;|up;)|uplus;|vee;|wedge;)|karow;|l(?:a(?:ck(?:lozenge;|square;|triangle(?:;|down;|left;|right;))|nk;)|k(?:1(?:2;|4;)|34;)|ock;)|n(?:e(?:;|quiv;)|ot;)|o(?:pf;|t(?:;|tom;)|wtie;|x(?:D(?:L;|R;|l;|r;)|H(?:;|D;|U;|d;|u;)|U(?:L;|R;|l;|r;)|V(?:;|H;|L;|R;|h;|l;|r;)|box;|d(?:L;|R;|l;|r;)|h(?:;|D;|U;|d;|u;)|minus;|plus;|times;|u(?:L;|R;|l;|r;)|v(?:;|H;|L;|R;|h;|l;|r;)))|prime;|r(?:eve;|vbar;?)|s(?:cr;|emi;|im(?:;|e;)|ol(?:;|b;|hsub;))|u(?:ll(?:;|et;)|mp(?:;|E;|e(?:;|q;))))|c(?:a(?:cute;|p(?:;|and;|brcup;|c(?:ap;|up;)|dot;|s;)|r(?:et;|on;))|c(?:a(?:ps;|ron;)|edil;?|irc;|ups(?:;|sm;))|dot;|e(?:dil;?|mptyv;|nt(?:;|erdot;|))|fr;|h(?:cy;|eck(?:;|mark;)|i;)|ir(?:;|E;|c(?:;|eq;|le(?:arrow(?:left;|right;)|d(?:R;|S;|ast;|circ;|dash;)))|e;|fnint;|mid;|scir;)|lubs(?:;|uit;)|o(?:lon(?:;|e(?:;|q;))|m(?:ma(?:;|t;)|p(?:;|fn;|le(?:ment;|xes;)))|n(?:g(?:;|dot;)|int;)|p(?:f;|rod;|y(?:;|sr;|)))|r(?:arr;|oss;)|s(?:cr;|u(?:b(?:;|e;)|p(?:;|e;)))|tdot;|u(?:darr(?:l;|r;)|e(?:pr;|sc;)|larr(?:;|p;)|p(?:;|brcap;|c(?:ap;|up;)|dot;|or;|s;)|r(?:arr(?:;|m;)|ly(?:eq(?:prec;|succ;)|vee;|wedge;)|ren;?|vearrow(?:left;|right;))|vee;|wed;)|w(?:conint;|int;)|ylcty;)|d(?:Arr;|Har;|a(?:gger;|leth;|rr;|sh(?:;|v;))|b(?:karow;|lac;)|c(?:aron;|y;)|d(?:;|a(?:gger;|rr;)|otseq;)|e(?:g;?|lta;|mptyv;)|f(?:isht;|r;)|har(?:l;|r;)|i(?:am(?:;|ond(?:;|suit;)|s;)|e;|gamma;|sin;|v(?:;|ide(?:;|ontimes;|)|onx;))|jcy;|lc(?:orn;|rop;)|o(?:llar;|pf;|t(?:;|eq(?:;|dot;)|minus;|plus;|square;)|ublebarwedge;|wn(?:arrow;|downarrows;|harpoon(?:left;|right;)))|r(?:bkarow;|c(?:orn;|rop;))|s(?:c(?:r;|y;)|ol;|trok;)|t(?:dot;|ri(?:;|f;))|u(?:arr;|har;)|wangle;|z(?:cy;|igrarr;))|e(?:D(?:Dot;|ot;)|a(?:cute;?|ster;)|c(?:aron;|ir(?:;|c;?)|olon;|y;)|dot;|e;|f(?:Dot;|r;)|g(?:;|rave;?|s(?:;|dot;))|l(?:;|inters;|l;|s(?:;|dot;))|m(?:acr;|pty(?:;|set;|v;)|sp(?:1(?:3;|4;)|;))|n(?:g;|sp;)|o(?:gon;|pf;)|p(?:ar(?:;|sl;)|lus;|si(?:;|lon;|v;))|q(?:c(?:irc;|olon;)|s(?:im;|lant(?:gtr;|less;))|u(?:als;|est;|iv(?:;|DD;))|vparsl;)|r(?:Dot;|arr;)|s(?:cr;|dot;|im;)|t(?:a;|h;?)|u(?:ml;?|ro;)|x(?:cl;|ist;|p(?:ectation;|onentiale;)))|f(?:allingdotseq;|cy;|emale;|f(?:ilig;|l(?:ig;|lig;)|r;)|ilig;|jlig;|l(?:at;|lig;|tns;)|nof;|o(?:pf;|r(?:all;|k(?:;|v;)))|partint;|r(?:a(?:c(?:1(?:2;?|3;|4;?|5;|6;|8;)|2(?:3;|5;)|3(?:4;?|5;|8;)|45;|5(?:6;|8;)|78;)|sl;)|own;)|scr;)|g(?:E(?:;|l;)|a(?:cute;|mma(?:;|d;)|p;)|breve;|c(?:irc;|y;)|dot;|e(?:;|l;|q(?:;|q;|slant;)|s(?:;|cc;|dot(?:;|o(?:;|l;))|l(?:;|es;)))|fr;|g(?:;|g;)|imel;|jcy;|l(?:;|E;|a;|j;)|n(?:E;|ap(?:;|prox;)|e(?:;|q(?:;|q;))|sim;)|opf;|rave;|s(?:cr;|im(?:;|e;|l;))|t(?:;|c(?:c;|ir;)|dot;|lPar;|quest;|r(?:a(?:pprox;|rr;)|dot;|eq(?:less;|qless;)|less;|sim;)|)|v(?:ertneqq;|nE;))|h(?:Arr;|a(?:irsp;|lf;|milt;|r(?:dcy;|r(?:;|cir;|w;)))|bar;|circ;|e(?:arts(?:;|uit;)|llip;|rcon;)|fr;|ks(?:earow;|warow;)|o(?:arr;|mtht;|ok(?:leftarrow;|rightarrow;)|pf;|rbar;)|s(?:cr;|lash;|trok;)|y(?:bull;|phen;))|i(?:acute;?|c(?:;|irc;?|y;)|e(?:cy;|xcl;?)|f(?:f;|r;)|grave;?|i(?:;|i(?:int;|nt;)|nfin;|ota;)|jlig;|m(?:a(?:cr;|g(?:e;|line;|part;)|th;)|of;|ped;)|n(?:;|care;|fin(?:;|tie;)|odot;|t(?:;|cal;|e(?:gers;|rcal;)|larhk;|prod;))|o(?:cy;|gon;|pf;|ta;)|prod;|quest;?|s(?:cr;|in(?:;|E;|dot;|s(?:;|v;)|v;))|t(?:;|ilde;)|u(?:kcy;|ml;?))|j(?:c(?:irc;|y;)|fr;|math;|opf;|s(?:cr;|ercy;)|ukcy;)|k(?:appa(?:;|v;)|c(?:edil;|y;)|fr;|green;|hcy;|jcy;|opf;|scr;)|l(?:A(?:arr;|rr;|tail;)|Barr;|E(?:;|g;)|Har;|a(?:cute;|emptyv;|gran;|mbda;|ng(?:;|d;|le;)|p;|quo;?|rr(?:;|b(?:;|fs;)|fs;|hk;|lp;|pl;|sim;|tl;)|t(?:;|ail;|e(?:;|s;)))|b(?:arr;|brk;|r(?:ac(?:e;|k;)|k(?:e;|sl(?:d;|u;))))|c(?:aron;|e(?:dil;|il;)|ub;|y;)|d(?:ca;|quo(?:;|r;)|r(?:dhar;|ushar;)|sh;)|e(?:;|ft(?:arrow(?:;|tail;)|harpoon(?:down;|up;)|leftarrows;|right(?:arrow(?:;|s;)|harpoons;|squigarrow;)|threetimes;)|g;|q(?:;|q;|slant;)|s(?:;|cc;|dot(?:;|o(?:;|r;))|g(?:;|es;)|s(?:approx;|dot;|eq(?:gtr;|qgtr;)|gtr;|sim;)))|f(?:isht;|loor;|r;)|g(?:;|E;)|h(?:ar(?:d;|u(?:;|l;))|blk;)|jcy;|l(?:;|arr;|corner;|hard;|tri;)|m(?:idot;|oust(?:;|ache;))|n(?:E;|ap(?:;|prox;)|e(?:;|q(?:;|q;))|sim;)|o(?:a(?:ng;|rr;)|brk;|ng(?:left(?:arrow;|rightarrow;)|mapsto;|rightarrow;)|oparrow(?:left;|right;)|p(?:ar;|f;|lus;)|times;|w(?:ast;|bar;)|z(?:;|enge;|f;))|par(?:;|lt;)|r(?:arr;|corner;|har(?:;|d;)|m;|tri;)|s(?:aquo;|cr;|h;|im(?:;|e;|g;)|q(?:b;|uo(?:;|r;))|trok;)|t(?:;|c(?:c;|ir;)|dot;|hree;|imes;|larr;|quest;|r(?:Par;|i(?:;|e;|f;))|)|ur(?:dshar;|uhar;)|v(?:ertneqq;|nE;))|m(?:DDot;|a(?:cr;?|l(?:e;|t(?:;|ese;))|p(?:;|sto(?:;|down;|left;|up;))|rker;)|c(?:omma;|y;)|dash;|easuredangle;|fr;|ho;|i(?:cro;?|d(?:;|ast;|cir;|dot;?)|nus(?:;|b;|d(?:;|u;)))|l(?:cp;|dr;)|nplus;|o(?:dels;|pf;)|p;|s(?:cr;|tpos;)|u(?:;|ltimap;|map;))|n(?:G(?:g;|t(?:;|v;))|L(?:eft(?:arrow;|rightarrow;)|l;|t(?:;|v;))|Rightarrow;|V(?:Dash;|dash;)|a(?:bla;|cute;|ng;|p(?:;|E;|id;|os;|prox;)|tur(?:;|al(?:;|s;)))|b(?:sp;?|ump(?:;|e;))|c(?:a(?:p;|ron;)|edil;|ong(?:;|dot;)|up;|y;)|dash;|e(?:;|Arr;|ar(?:hk;|r(?:;|ow;))|dot;|quiv;|s(?:ear;|im;)|xist(?:;|s;))|fr;|g(?:E;|e(?:;|q(?:;|q;|slant;)|s;)|sim;|t(?:;|r;))|h(?:Arr;|arr;|par;)|i(?:;|s(?:;|d;)|v;)|jcy;|l(?:Arr;|E;|arr;|dr;|e(?:;|ft(?:arrow;|rightarrow;)|q(?:;|q;|slant;)|s(?:;|s;))|sim;|t(?:;|ri(?:;|e;)))|mid;|o(?:pf;|t(?:;|in(?:;|E;|dot;|v(?:a;|b;|c;))|ni(?:;|v(?:a;|b;|c;))|))|p(?:ar(?:;|allel;|sl;|t;)|olint;|r(?:;|cue;|e(?:;|c(?:;|eq;))))|r(?:Arr;|arr(?:;|c;|w;)|ightarrow;|tri(?:;|e;))|s(?:c(?:;|cue;|e;|r;)|hort(?:mid;|parallel;)|im(?:;|e(?:;|q;))|mid;|par;|qsu(?:be;|pe;)|u(?:b(?:;|E;|e;|set(?:;|eq(?:;|q;)))|cc(?:;|eq;)|p(?:;|E;|e;|set(?:;|eq(?:;|q;)))))|t(?:gl;|ilde;?|lg;|riangle(?:left(?:;|eq;)|right(?:;|eq;)))|u(?:;|m(?:;|ero;|sp;))|v(?:Dash;|Harr;|ap;|dash;|g(?:e;|t;)|infin;|l(?:Arr;|e;|t(?:;|rie;))|r(?:Arr;|trie;)|sim;)|w(?:Arr;|ar(?:hk;|r(?:;|ow;))|near;))|o(?:S;|a(?:cute;?|st;)|c(?:ir(?:;|c;?)|y;)|d(?:ash;|blac;|iv;|ot;|sold;)|elig;|f(?:cir;|r;)|g(?:on;|rave;?|t;)|h(?:bar;|m;)|int;|l(?:arr;|c(?:ir;|ross;)|ine;|t;)|m(?:acr;|ega;|i(?:cron;|d;|nus;))|opf;|p(?:ar;|erp;|lus;)|r(?:;|arr;|d(?:;|er(?:;|of;)|f;?|m;?)|igof;|or;|slope;|v;)|s(?:cr;|lash;?|ol;)|ti(?:lde;?|mes(?:;|as;))|uml;?|vbar;)|p(?:ar(?:;|a(?:;|llel;|)|s(?:im;|l;)|t;)|cy;|er(?:cnt;|iod;|mil;|p;|tenk;)|fr;|h(?:i(?:;|v;)|mmat;|one;)|i(?:;|tchfork;|v;)|l(?:an(?:ck(?:;|h;)|kv;)|us(?:;|acir;|b;|cir;|d(?:o;|u;)|e;|mn;?|sim;|two;))|m;|o(?:intint;|pf;|und;?)|r(?:;|E;|ap;|cue;|e(?:;|c(?:;|approx;|curlyeq;|eq;|n(?:approx;|eqq;|sim;)|sim;))|ime(?:;|s;)|n(?:E;|ap;|sim;)|o(?:d;|f(?:alar;|line;|surf;)|p(?:;|to;))|sim;|urel;)|s(?:cr;|i;)|uncsp;)|q(?:fr;|int;|opf;|prime;|scr;|u(?:at(?:ernions;|int;)|est(?:;|eq;)|ot;?))|r(?:A(?:arr;|rr;|tail;)|Barr;|Har;|a(?:c(?:e;|ute;)|dic;|emptyv;|ng(?:;|d;|e;|le;)|quo;?|rr(?:;|ap;|b(?:;|fs;)|c;|fs;|hk;|lp;|pl;|sim;|tl;|w;)|t(?:ail;|io(?:;|nals;)))|b(?:arr;|brk;|r(?:ac(?:e;|k;)|k(?:e;|sl(?:d;|u;))))|c(?:aron;|e(?:dil;|il;)|ub;|y;)|d(?:ca;|ldhar;|quo(?:;|r;)|sh;)|e(?:al(?:;|ine;|part;|s;)|ct;|g;?)|f(?:isht;|loor;|r;)|h(?:ar(?:d;|u(?:;|l;))|o(?:;|v;))|i(?:ght(?:arrow(?:;|tail;)|harpoon(?:down;|up;)|left(?:arrows;|harpoons;)|rightarrows;|squigarrow;|threetimes;)|ng;|singdotseq;)|l(?:arr;|har;|m;)|moust(?:;|ache;)|nmid;|o(?:a(?:ng;|rr;)|brk;|p(?:ar;|f;|lus;)|times;)|p(?:ar(?:;|gt;)|polint;)|rarr;|s(?:aquo;|cr;|h;|q(?:b;|uo(?:;|r;)))|t(?:hree;|imes;|ri(?:;|e;|f;|ltri;))|uluhar;|x;)|s(?:acute;|bquo;|c(?:;|E;|a(?:p;|ron;)|cue;|e(?:;|dil;)|irc;|n(?:E;|ap;|sim;)|polint;|sim;|y;)|dot(?:;|b;|e;)|e(?:Arr;|ar(?:hk;|r(?:;|ow;))|ct;?|mi;|swar;|tm(?:inus;|n;)|xt;)|fr(?:;|own;)|h(?:arp;|c(?:hcy;|y;)|ort(?:mid;|parallel;)|y;?)|i(?:gma(?:;|f;|v;)|m(?:;|dot;|e(?:;|q;)|g(?:;|E;)|l(?:;|E;)|ne;|plus;|rarr;))|larr;|m(?:a(?:llsetminus;|shp;)|eparsl;|i(?:d;|le;)|t(?:;|e(?:;|s;)))|o(?:ftcy;|l(?:;|b(?:;|ar;))|pf;)|pa(?:des(?:;|uit;)|r;)|q(?:c(?:ap(?:;|s;)|up(?:;|s;))|su(?:b(?:;|e;|set(?:;|eq;))|p(?:;|e;|set(?:;|eq;)))|u(?:;|ar(?:e;|f;)|f;))|rarr;|s(?:cr;|etmn;|mile;|tarf;)|t(?:ar(?:;|f;)|r(?:aight(?:epsilon;|phi;)|ns;))|u(?:b(?:;|E;|dot;|e(?:;|dot;)|mult;|n(?:E;|e;)|plus;|rarr;|s(?:et(?:;|eq(?:;|q;)|neq(?:;|q;))|im;|u(?:b;|p;)))|cc(?:;|approx;|curlyeq;|eq;|n(?:approx;|eqq;|sim;)|sim;)|m;|ng;|p(?:1;?|2;?|3;?|;|E;|d(?:ot;|sub;)|e(?:;|dot;)|hs(?:ol;|ub;)|larr;|mult;|n(?:E;|e;)|plus;|s(?:et(?:;|eq(?:;|q;)|neq(?:;|q;))|im;|u(?:b;|p;))))|w(?:Arr;|ar(?:hk;|r(?:;|ow;))|nwar;)|zlig;?)|t(?:a(?:rget;|u;)|brk;|c(?:aron;|edil;|y;)|dot;|elrec;|fr;|h(?:e(?:re(?:4;|fore;)|ta(?:;|sym;|v;))|i(?:ck(?:approx;|sim;)|nsp;)|k(?:ap;|sim;)|orn;?)|i(?:lde;|mes(?:;|b(?:;|ar;)|d;|)|nt;)|o(?:ea;|p(?:;|bot;|cir;|f(?:;|ork;))|sa;)|prime;|r(?:ade;|i(?:angle(?:;|down;|left(?:;|eq;)|q;|right(?:;|eq;))|dot;|e;|minus;|plus;|sb;|time;)|pezium;)|s(?:c(?:r;|y;)|hcy;|trok;)|w(?:ixt;|ohead(?:leftarrow;|rightarrow;)))|u(?:Arr;|Har;|a(?:cute;?|rr;)|br(?:cy;|eve;)|c(?:irc;?|y;)|d(?:arr;|blac;|har;)|f(?:isht;|r;)|grave;?|h(?:ar(?:l;|r;)|blk;)|l(?:c(?:orn(?:;|er;)|rop;)|tri;)|m(?:acr;|l;?)|o(?:gon;|pf;)|p(?:arrow;|downarrow;|harpoon(?:left;|right;)|lus;|si(?:;|h;|lon;)|uparrows;)|r(?:c(?:orn(?:;|er;)|rop;)|ing;|tri;)|scr;|t(?:dot;|ilde;|ri(?:;|f;))|u(?:arr;|ml;?)|wangle;)|v(?:Arr;|Bar(?:;|v;)|Dash;|a(?:ngrt;|r(?:epsilon;|kappa;|nothing;|p(?:hi;|i;|ropto;)|r(?:;|ho;)|s(?:igma;|u(?:bsetneq(?:;|q;)|psetneq(?:;|q;)))|t(?:heta;|riangle(?:left;|right;))))|cy;|dash;|e(?:e(?:;|bar;|eq;)|llip;|r(?:bar;|t;))|fr;|ltri;|nsu(?:b;|p;)|opf;|prop;|rtri;|s(?:cr;|u(?:bn(?:E;|e;)|pn(?:E;|e;)))|zigzag;)|w(?:circ;|e(?:d(?:bar;|ge(?:;|q;))|ierp;)|fr;|opf;|p;|r(?:;|eath;)|scr;)|x(?:c(?:ap;|irc;|up;)|dtri;|fr;|h(?:Arr;|arr;)|i;|l(?:Arr;|arr;)|map;|nis;|o(?:dot;|p(?:f;|lus;)|time;)|r(?:Arr;|arr;)|s(?:cr;|qcup;)|u(?:plus;|tri;)|vee;|wedge;)|y(?:ac(?:ute;?|y;)|c(?:irc;|y;)|en;?|fr;|icy;|opf;|scr;|u(?:cy;|ml;?))|z(?:acute;|c(?:aron;|y;)|dot;|e(?:etrf;|ta;)|fr;|hcy;|igrarr;|opf;|scr;|w(?:j;|nj;)))|[\s\S]/g; - -var NAMEDCHARREF_MAXLEN = 32; - -// Regular expression constants used by the tokenizer and parser - -// Note that \r is included in all of these regexps because it will need -// to be converted to LF by the scanChars() function. -var DBLQUOTEATTRVAL = /[^\r"&\u0000]+/g; -var SINGLEQUOTEATTRVAL = /[^\r'&\u0000]+/g; -var UNQUOTEDATTRVAL = /[^\r\t\n\f &>\u0000]+/g; -var TAGNAME = /[^\r\t\n\f \/>A-Z\u0000]+/g; -var ATTRNAME = /[^\r\t\n\f \/=>A-Z\u0000]+/g; - -var CDATATEXT = /[^\]\r\u0000\uffff]*/g; -var DATATEXT = /[^&<\r\u0000\uffff]*/g; -var RAWTEXT = /[^<\r\u0000\uffff]*/g; -var PLAINTEXT = /[^\r\u0000\uffff]*/g; -// Since we don't have the 'sticky tag', add '|.' to the end of SIMPLETAG -// and SIMPLEATTR so that we are guaranteed to always match. This prevents -// us from scanning past the lastIndex set. (Note that the desired matches -// are always greater than 1 char long, so longest-match will ensure that . -// is not matched unless the desired match fails.) -var SIMPLETAG = /(?:(\/)?([a-z]+)>)|[\s\S]/g; -var SIMPLEATTR = /(?:([-a-z]+)[ \t\n\f]*=[ \t\n\f]*('[^'&\r\u0000]*'|"[^"&\r\u0000]*"|[^\t\n\r\f "&'\u0000>][^&> \t\n\r\f\u0000]*[ \t\n\f]))|[\s\S]/g; - -var NONWS = /[^\x09\x0A\x0C\x0D\x20]/; -var ALLNONWS = /[^\x09\x0A\x0C\x0D\x20]/g; // like above, with g flag -var NONWSNONNUL = /[^\x00\x09\x0A\x0C\x0D\x20]/; // don't allow NUL either -var LEADINGWS = /^[\x09\x0A\x0C\x0D\x20]+/; -var NULCHARS = /\x00/g; - -/*** - * These are utility functions that don't use any of the parser's - * internal state. - */ -function buf2str(buf) { - var CHUNKSIZE=16384; - if (buf.length < CHUNKSIZE) { - return String.fromCharCode.apply(String, buf); - } - // special case for large strings, to avoid busting the stack. - var result = ''; - for (var i = 0; i < buf.length; i += CHUNKSIZE) { - result += String.fromCharCode.apply(String, buf.slice(i, i+CHUNKSIZE)); - } - return result; -} - -function str2buf(s) { - var result = []; - for (var i=0; i 0; i--) { - var e = this.elements[i]; - if (isA(e, tag)) break; - } - this.elements.length = i; - this.top = this.elements[i-1]; -}; - -// Pop elements off the stack up to and including the first -// element that is an instance of the specified type -HTMLParser.ElementStack.prototype.popElementType = function(type) { - for(var i = this.elements.length-1; i > 0; i--) { - if (this.elements[i] instanceof type) break; - } - this.elements.length = i; - this.top = this.elements[i-1]; -}; - -// Pop elements off the stack up to and including the element e. -// Note that this is very different from removeElement() -// This requires that e is on the stack. -HTMLParser.ElementStack.prototype.popElement = function(e) { - for(var i = this.elements.length-1; i > 0; i--) { - if (this.elements[i] === e) break; - } - this.elements.length = i; - this.top = this.elements[i-1]; -}; - -// Remove a specific element from the stack. -// Do nothing if the element is not on the stack -HTMLParser.ElementStack.prototype.removeElement = function(e) { - if (this.top === e) this.pop(); - else { - var idx = this.elements.lastIndexOf(e); - if (idx !== -1) - this.elements.splice(idx, 1); - } -}; - -HTMLParser.ElementStack.prototype.clearToContext = function(set) { - // Note that we don't loop to 0. Never pop the elt off. - for(var i = this.elements.length-1; i > 0; i--) { - if (isA(this.elements[i], set)) break; - } - this.elements.length = i+1; - this.top = this.elements[i]; -}; - -HTMLParser.ElementStack.prototype.contains = function(tag) { - return this.inSpecificScope(tag, Object.create(null)); -}; - -HTMLParser.ElementStack.prototype.inSpecificScope = function(tag, set) { - for(var i = this.elements.length-1; i >= 0; i--) { - var elt = this.elements[i]; - if (isA(elt, tag)) return true; - if (isA(elt, set)) return false; - } - return false; -}; - -// Like the above, but for a specific element, not a tagname -HTMLParser.ElementStack.prototype.elementInSpecificScope = function(target, set) { - for(var i = this.elements.length-1; i >= 0; i--) { - var elt = this.elements[i]; - if (elt === target) return true; - if (isA(elt, set)) return false; - } - return false; -}; - -// Like the above, but for an element interface, not a tagname -HTMLParser.ElementStack.prototype.elementTypeInSpecificScope = function(target, set) { - for(var i = this.elements.length-1; i >= 0; i--) { - var elt = this.elements[i]; - if (elt instanceof target) return true; - if (isA(elt, set)) return false; - } - return false; -}; - -HTMLParser.ElementStack.prototype.inScope = function(tag) { - return this.inSpecificScope(tag, inScopeSet); -}; - -HTMLParser.ElementStack.prototype.elementInScope = function(e) { - return this.elementInSpecificScope(e, inScopeSet); -}; - -HTMLParser.ElementStack.prototype.elementTypeInScope = function(type) { - return this.elementTypeInSpecificScope(type, inScopeSet); -}; - -HTMLParser.ElementStack.prototype.inButtonScope = function(tag) { - return this.inSpecificScope(tag, inButtonScopeSet); -}; - -HTMLParser.ElementStack.prototype.inListItemScope = function(tag) { - return this.inSpecificScope(tag, inListItemScopeSet); -}; - -HTMLParser.ElementStack.prototype.inTableScope = function(tag) { - return this.inSpecificScope(tag, inTableScopeSet); -}; - -HTMLParser.ElementStack.prototype.inSelectScope = function(tag) { - // Can't implement this one with inSpecificScope, since it involves - // a set defined by inverting another set. So implement manually. - for(var i = this.elements.length-1; i >= 0; i--) { - var elt = this.elements[i]; - if (elt.namespaceURI !== NAMESPACE.HTML) return false; - var localname = elt.localName; - if (localname === tag) return true; - if (localname !== "optgroup" && localname !== "option") - return false; - } - return false; -}; - -HTMLParser.ElementStack.prototype.generateImpliedEndTags = function(butnot, thorough) { - var endTagSet = thorough ? thoroughImpliedEndTagsSet : impliedEndTagsSet; - for(var i = this.elements.length-1; i >= 0; i--) { - var e = this.elements[i]; - if (butnot && isA(e, butnot)) break; - if (!isA(this.elements[i], endTagSet)) break; - } - - this.elements.length = i+1; - this.top = this.elements[i]; -}; - -/*** - * The ActiveFormattingElements class - */ -HTMLParser.ActiveFormattingElements = function AFE() { - this.list = []; // elements - this.attrs = []; // attribute tokens for cloning -}; - -HTMLParser.ActiveFormattingElements.prototype.MARKER = { localName: "|" }; - -/* -// For debugging -HTMLParser.ActiveFormattingElements.prototype.toString = function() { - return "AFE: " + - this.list.map(function(e) { return e.localName; }).join("-"); -} -*/ - -HTMLParser.ActiveFormattingElements.prototype.insertMarker = function() { - this.list.push(this.MARKER); - this.attrs.push(this.MARKER); -}; - -HTMLParser.ActiveFormattingElements.prototype.push = function(elt, attrs) { - // Scan backwards: if there are already 3 copies of this element - // before we encounter a marker, then drop the last one - var count = 0; - for(var i = this.list.length-1; i >= 0; i--) { - if (this.list[i] === this.MARKER) break; - // equal() is defined below - if (equal(elt, this.list[i], this.attrs[i])) { - count++; - if (count === 3) { - this.list.splice(i, 1); - this.attrs.splice(i, 1); - break; - } - } - } - - - // Now push the element onto the list - this.list.push(elt); - - // Copy the attributes and push those on, too - var attrcopy = []; - for(var ii = 0; ii < attrs.length; ii++) { - attrcopy[ii] = attrs[ii]; - } - - this.attrs.push(attrcopy); - - // This function defines equality of two elements for the purposes - // of the AFE list. Note that it compares the new elements - // attributes to the saved array of attributes associated with - // the old element because a script could have changed the - // old element's set of attributes - function equal(newelt, oldelt, oldattrs) { - if (newelt.localName !== oldelt.localName) return false; - if (newelt._numattrs !== oldattrs.length) return false; - for(var i = 0, n = oldattrs.length; i < n; i++) { - var oldname = oldattrs[i][0]; - var oldval = oldattrs[i][1]; - if (!newelt.hasAttribute(oldname)) return false; - if (newelt.getAttribute(oldname) !== oldval) return false; - } - return true; - } -}; - -HTMLParser.ActiveFormattingElements.prototype.clearToMarker = function() { - for(var i = this.list.length-1; i >= 0; i--) { - if (this.list[i] === this.MARKER) break; - } - if (i < 0) i = 0; - this.list.length = i; - this.attrs.length = i; -}; - -// Find and return the last element with the specified tag between the -// end of the list and the last marker on the list. -// Used when parsing in_body_mode() -HTMLParser.ActiveFormattingElements.prototype.findElementByTag = function(tag) { - for(var i = this.list.length-1; i >= 0; i--) { - var elt = this.list[i]; - if (elt === this.MARKER) break; - if (elt.localName === tag) return elt; - } - return null; -}; - -HTMLParser.ActiveFormattingElements.prototype.indexOf = function(e) { - return this.list.lastIndexOf(e); -}; - -// Find the element e in the list and remove it -// Used when parsing in_body() -HTMLParser.ActiveFormattingElements.prototype.remove = function(e) { - var idx = this.list.lastIndexOf(e); - if (idx !== -1) { - this.list.splice(idx, 1); - this.attrs.splice(idx, 1); - } -}; - -// Find element a in the list and replace it with element b -// XXX: Do I need to handle attributes here? -HTMLParser.ActiveFormattingElements.prototype.replace = function(a, b, attrs) { - var idx = this.list.lastIndexOf(a); - if (idx !== -1) { - this.list[idx] = b; - this.attrs[idx] = attrs; - } -}; - -// Find a in the list and insert b after it -// This is only used for insert a bookmark object, so the -// attrs array doesn't really matter -HTMLParser.ActiveFormattingElements.prototype.insertAfter = function(a,b) { - var idx = this.list.lastIndexOf(a); - if (idx !== -1) { - this.list.splice(idx, 0, b); - this.attrs.splice(idx, 0, b); - } -}; - - - - -/*** - * This is the parser factory function. It is the return value of - * the outer closure that it is defined within. Most of the parser - * implementation details are inside this function. - */ -function HTMLParser(address, fragmentContext, options) { - /*** - * These are the parser's state variables - */ - // Scanner state - var chars = null; - var numchars = 0; // Length of chars - var nextchar = 0; // Index of next char - var input_complete = false; // Becomes true when end() called. - var scanner_skip_newline = false; // If previous char was CR - var reentrant_invocations = 0; - var saved_scanner_state = []; - var leftovers = ""; - var first_batch = true; - var paused = 0; // Becomes non-zero while loading scripts - - - // Tokenizer state - var tokenizer = data_state; // Current tokenizer state - var return_state; - var character_reference_code; - var tagnamebuf = ""; - var lasttagname = ""; // holds the target end tag for text states - var tempbuf = []; - var attrnamebuf = ""; - var attrvaluebuf = ""; - var commentbuf = []; - var doctypenamebuf = []; - var doctypepublicbuf = []; - var doctypesystembuf = []; - var attributes = []; - var is_end_tag = false; - - // Tree builder state - var parser = initial_mode; // Current insertion mode - var originalInsertionMode = null; // A saved insertion mode - var templateInsertionModes = []; // Stack of template insertion modes. - var stack = new HTMLParser.ElementStack(); // Stack of open elements - var afe = new HTMLParser.ActiveFormattingElements(); // mis-nested tags - var fragment = (fragmentContext!==undefined); // For innerHTML, etc. - var head_element_pointer = null; - var form_element_pointer = null; - var scripting_enabled = true; - if (fragmentContext) { - scripting_enabled = fragmentContext.ownerDocument._scripting_enabled; - } - if (options && options.scripting_enabled === false) - scripting_enabled = false; - var frameset_ok = true; - var force_quirks = false; - var pending_table_text; - var text_integration_mode; // XXX a spec bug workaround? - - // A single run of characters, buffered up to be sent to - // the parser as a single string. - var textrun = []; - var textIncludesNUL = false; - var ignore_linefeed = false; - - /*** - * This is the parser object that will be the return value of this - * factory function, which is some 5000 lines below. - * Note that the variable "parser" is the current state of the - * parser's state machine. This variable "htmlparser" is the - * return value and defines the public API of the parser - */ - var htmlparser = { - document: function() { - return doc; - }, - - // Convenience function for internal use. Can only be called once, - // as it removes the nodes from `doc` to add them to fragment. - _asDocumentFragment: function() { - var frag = doc.createDocumentFragment(); - var root = doc.firstChild; - while(root.hasChildNodes()) { - frag.appendChild(root.firstChild); - } - return frag; - }, - - // Internal function used from HTMLScriptElement to pause the - // parser while a script is being loaded from the network - pause: function() { - // print("pausing parser"); - paused++; - }, - - // Called when a script finishes loading - resume: function() { - // print("resuming parser"); - paused--; - // XXX: added this to force a resumption. - // Is this the right thing to do? - this.parse(""); - }, - - // Parse the HTML text s. - // The second argument should be true if there is no more - // text to be parsed, and should be false or omitted otherwise. - // The second argument must not be set for recursive invocations - // from document.write() - parse: function(s, end, shouldPauseFunc) { - var moreToDo; - - // If we're paused, remember the text to parse, but - // don't parse it now. - // (Don't invoke shouldPauseFunc because we haven't handled 'end' yet.) - if (paused > 0) { - leftovers += s; - return true; // more to do - } - - - if (reentrant_invocations === 0) { - // A normal, top-level invocation - if (leftovers) { - s = leftovers + s; - leftovers = ""; - } - - // Add a special marker character to the end of - // the buffer. If the scanner is at the end of - // the buffer and input_complete is set, then this - // character will transform into an EOF token. - // Having an actual character that represents EOF - // in the character buffer makes lookahead regexp - // matching work more easily, and this is - // important for character references. - if (end) { - s += "\uFFFF"; - input_complete = true; // Makes scanChars() send EOF - } - - chars = s; - numchars = s.length; - nextchar = 0; - - if (first_batch) { - // We skip a leading Byte Order Mark (\uFEFF) - // on first batch of text we're given - first_batch = false; - if (chars.charCodeAt(0) === 0xFEFF) nextchar = 1; - } - - reentrant_invocations++; - moreToDo = scanChars(shouldPauseFunc); - leftovers = chars.substring(nextchar, numchars); - reentrant_invocations--; - } - else { - // This is the re-entrant case, which we have to - // handle a little differently. - reentrant_invocations++; - - // Save current scanner state - saved_scanner_state.push(chars, numchars, nextchar); - - // Set new scanner state - chars = s; - numchars = s.length; - nextchar = 0; - - // Now scan as many of these new chars as we can - scanChars(); - moreToDo = false; - - leftovers = chars.substring(nextchar, numchars); - - // restore old scanner state - nextchar = saved_scanner_state.pop(); - numchars = saved_scanner_state.pop(); - chars = saved_scanner_state.pop(); - - // If there were leftover chars from this invocation - // insert them into the pending invocation's buffer - // and trim already processed chars at the same time - if (leftovers) { - chars = leftovers + chars.substring(nextchar); - numchars = chars.length; - nextchar = 0; - leftovers = ""; - } - - // Decrement the counter - reentrant_invocations--; - } - return moreToDo; - } - }; - - - // This is the document we'll be building up - var doc = new Document(true, address); - - // The document needs to know about the parser, for document.write(). - // This _parser property will be deleted when we're done parsing. - doc._parser = htmlparser; - - // XXX I think that any document we use this parser on should support - // scripts. But I may need to configure that through a parser parameter - // Only documents with windows ("browsing contexts" to be precise) - // allow scripting. - doc._scripting_enabled = scripting_enabled; - - - /*** - * The actual code of the HTMLParser() factory function begins here. - */ - - if (fragmentContext) { // for innerHTML parsing - if (fragmentContext.ownerDocument._quirks) - doc._quirks = true; - if (fragmentContext.ownerDocument._limitedQuirks) - doc._limitedQuirks = true; - - // Set the initial tokenizer state - if (fragmentContext.namespaceURI === NAMESPACE.HTML) { - switch(fragmentContext.localName) { - case "title": - case "textarea": - tokenizer = rcdata_state; - break; - case "style": - case "xmp": - case "iframe": - case "noembed": - case "noframes": - case "script": - case "plaintext": - tokenizer = plaintext_state; - break; - } - } - - var root = doc.createElement("html"); - doc._appendChild(root); - stack.push(root); - if (fragmentContext instanceof impl.HTMLTemplateElement) { - templateInsertionModes.push(in_template_mode); - } - resetInsertionMode(); - - for(var e = fragmentContext; e !== null; e = e.parentElement) { - if (e instanceof impl.HTMLFormElement) { - form_element_pointer = e; - break; - } - } - } - - /*** - * Scanner functions - */ - // Loop through the characters in chars, and pass them one at a time - // to the tokenizer FSM. Return when no more characters can be processed - // (This may leave 1 or more characters in the buffer: like a CR - // waiting to see if the next char is LF, or for states that require - // lookahead...) - function scanChars(shouldPauseFunc) { - var codepoint, s, pattern, eof; - - while(nextchar < numchars) { - - // If we just tokenized a tag, then the paused flag - // may have been set to tell us to stop tokenizing while - // the script is loading - if (paused > 0 || (shouldPauseFunc && shouldPauseFunc())) { - return true; - } - - - switch(typeof tokenizer.lookahead) { - case 'undefined': - codepoint = chars.charCodeAt(nextchar++); - if (scanner_skip_newline) { - scanner_skip_newline = false; - if (codepoint === 0x000A) { - nextchar++; - continue; - } - } - switch(codepoint) { - case 0x000D: - // CR always turns into LF, but if the next character - // is LF, then that second LF is skipped. - if (nextchar < numchars) { - if (chars.charCodeAt(nextchar) === 0x000A) - nextchar++; - } - else { - // We don't know the next char right now, so we - // can't check if it is a LF. So set a flag - scanner_skip_newline = true; - } - - // In either case, emit a LF - tokenizer(0x000A); - - break; - case 0xFFFF: - if (input_complete && nextchar === numchars) { - tokenizer(EOF); // codepoint will be 0xFFFF here - break; - } - /* falls through */ - default: - tokenizer(codepoint); - break; - } - break; - - case 'number': - codepoint = chars.charCodeAt(nextchar); - - // The only tokenizer states that require fixed lookahead - // only consume alphanum characters, so we don't have - // to worry about CR and LF in this case - - // tokenizer wants n chars of lookahead - var n = tokenizer.lookahead; - var needsString = true; - if (n < 0) { - needsString = false; - n = -n; - } - - if (n < numchars - nextchar) { - // If we can look ahead that far - s = needsString ? chars.substring(nextchar, nextchar+n) : null; - eof = false; - } - else { // if we don't have that many characters - if (input_complete) { // If no more are coming - // Just return what we have - s = needsString ? chars.substring(nextchar, numchars) : null; - eof = true; - if (codepoint === 0xFFFF && nextchar === numchars-1) - codepoint = EOF; - } - else { - // Return now and wait for more chars later - return true; - } - } - tokenizer(codepoint, s, eof); - break; - case 'string': - codepoint = chars.charCodeAt(nextchar); - - // tokenizer wants characters up to a matching string - pattern = tokenizer.lookahead; - var pos = chars.indexOf(pattern, nextchar); - if (pos !== -1) { - s = chars.substring(nextchar, pos + pattern.length); - eof = false; - } - else { // No match - // If more characters coming, wait for them - if (!input_complete) return true; - - // Otherwise, we've got to return what we've got - s = chars.substring(nextchar, numchars); - if (codepoint === 0xFFFF && nextchar === numchars-1) - codepoint = EOF; - eof = true; - } - - // The tokenizer states that require this kind of - // lookahead have to be careful to handle CR characters - // correctly - tokenizer(codepoint, s, eof); - break; - } - } - return false; // no more characters to scan! - } - - - /*** - * Tokenizer utility functions - */ - function addAttribute(name,value) { - // Make sure there isn't already an attribute with this name - // If there is, ignore this one. - for(var i = 0; i < attributes.length; i++) { - if (attributes[i][0] === name) return; - } - - if (value !== undefined) { - attributes.push([name, value]); - } - else { - attributes.push([name]); - } - } - - // Shortcut for simple attributes - function handleSimpleAttribute() { - SIMPLEATTR.lastIndex = nextchar-1; - var matched = SIMPLEATTR.exec(chars); - if (!matched) throw new Error("should never happen"); - var name = matched[1]; - if (!name) return false; - var value = matched[2]; - var len = value.length; - switch(value[0]) { - case '"': - case "'": - value = value.substring(1, len-1); - nextchar += (matched[0].length-1); - tokenizer = after_attribute_value_quoted_state; - break; - default: - tokenizer = before_attribute_name_state; - nextchar += (matched[0].length-1); - value = value.substring(0, len-1); - break; - } - - // Make sure there isn't already an attribute with this name - // If there is, ignore this one. - for(var i = 0; i < attributes.length; i++) { - if (attributes[i][0] === name) return true; - } - - attributes.push([name, value]); - return true; - } - - function beginTagName() { - is_end_tag = false; - tagnamebuf = ""; - attributes.length = 0; - } - function beginEndTagName() { - is_end_tag = true; - tagnamebuf = ""; - attributes.length = 0; - } - - function beginTempBuf() { tempbuf.length = 0; } - function beginAttrName() { attrnamebuf = ""; } - function beginAttrValue() { attrvaluebuf = ""; } - function beginComment() { commentbuf.length = 0; } - function beginDoctype() { - doctypenamebuf.length = 0; - doctypepublicbuf = null; - doctypesystembuf = null; - } - function beginDoctypePublicId() { doctypepublicbuf = []; } - function beginDoctypeSystemId() { doctypesystembuf = []; } - function forcequirks() { force_quirks = true; } - function cdataAllowed() { - return stack.top && - stack.top.namespaceURI !== "http://www.w3.org/1999/xhtml"; - } - - // Return true if the codepoints in the specified buffer match the - // characters of lasttagname - function appropriateEndTag(buf) { - return lasttagname === buf; - } - - function flushText() { - if (textrun.length > 0) { - var s = buf2str(textrun); - textrun.length = 0; - - if (ignore_linefeed) { - ignore_linefeed = false; - if (s[0] === "\n") s = s.substring(1); - if (s.length === 0) return; - } - - insertToken(TEXT, s); - textIncludesNUL = false; - } - ignore_linefeed = false; - } - - // Consume chars matched by the pattern and return them as a string. Starts - // matching at the current position, so users should drop the current char - // otherwise. - function getMatchingChars(pattern) { - pattern.lastIndex = nextchar - 1; - var match = pattern.exec(chars); - if (match && match.index === nextchar - 1) { - match = match[0]; - nextchar += match.length - 1; - /* Careful! Make sure we haven't matched the EOF character! */ - if (input_complete && nextchar === numchars) { - // Oops, backup one. - match = match.slice(0, -1); - nextchar--; - } - return match; - } else { - throw new Error("should never happen"); - } - } - - // emit a string of chars that match a regexp - // Returns false if no chars matched. - function emitCharsWhile(pattern) { - pattern.lastIndex = nextchar-1; - var match = pattern.exec(chars)[0]; - if (!match) return false; - emitCharString(match); - nextchar += match.length - 1; - return true; - } - - // This is used by CDATA sections - function emitCharString(s) { - if (textrun.length > 0) flushText(); - - if (ignore_linefeed) { - ignore_linefeed = false; - if (s[0] === "\n") s = s.substring(1); - if (s.length === 0) return; - } - - insertToken(TEXT, s); - } - - function emitTag() { - if (is_end_tag) insertToken(ENDTAG, tagnamebuf); - else { - // Remember the last open tag we emitted - var tagname = tagnamebuf; - tagnamebuf = ""; - lasttagname = tagname; - insertToken(TAG, tagname, attributes); - } - } - - - // A shortcut: look ahead and if this is a open or close tag - // in lowercase with no spaces and no attributes, just emit it now. - function emitSimpleTag() { - if (nextchar === numchars) { return false; /* not even 1 char left */ } - SIMPLETAG.lastIndex = nextchar; - var matched = SIMPLETAG.exec(chars); - if (!matched) throw new Error("should never happen"); - var tagname = matched[2]; - if (!tagname) return false; - var endtag = matched[1]; - if (endtag) { - nextchar += (tagname.length+2); - insertToken(ENDTAG, tagname); - } - else { - nextchar += (tagname.length+1); - lasttagname = tagname; - insertToken(TAG, tagname, NOATTRS); - } - return true; - } - - function emitSelfClosingTag() { - if (is_end_tag) insertToken(ENDTAG, tagnamebuf, null, true); - else { - insertToken(TAG, tagnamebuf, attributes, true); - } - } - - function emitDoctype() { - insertToken(DOCTYPE, - buf2str(doctypenamebuf), - doctypepublicbuf ? buf2str(doctypepublicbuf) : undefined, - doctypesystembuf ? buf2str(doctypesystembuf) : undefined); - } - - function emitEOF() { - flushText(); - parser(EOF); // EOF never goes to insertForeignContent() - doc.modclock = 1; // Start tracking modifications - } - - // Insert a token, either using the current parser insertion mode - // (for HTML stuff) or using the insertForeignToken() method. - var insertToken = htmlparser.insertToken = function insertToken(t, value, arg3, arg4) { - flushText(); - var current = stack.top; - - if (!current || current.namespaceURI === NAMESPACE.HTML) { - // This is the common case - parser(t, value, arg3, arg4); - } - else { - // Otherwise we may need to insert this token as foreign content - if (t !== TAG && t !== TEXT) { - insertForeignToken(t, value, arg3, arg4); - } - else { - // But in some cases we treat it as regular content - if ((isMathmlTextIntegrationPoint(current) && - (t === TEXT || - (t === TAG && - value !== "mglyph" && value !== "malignmark"))) || - (t === TAG && - value === "svg" && - current.namespaceURI === NAMESPACE.MATHML && - current.localName === "annotation-xml") || - isHTMLIntegrationPoint(current)) { - - // XXX: the text_integration_mode stuff is an - // attempted bug workaround of mine - text_integration_mode = true; - parser(t, value, arg3, arg4); - text_integration_mode = false; - } - // Otherwise it is foreign content - else { - insertForeignToken(t, value, arg3, arg4); - } - } - } - }; - - - /*** - * Tree building utility functions - */ - function insertComment(data) { - var parent = stack.top; - if (foster_parent_mode && isA(parent, tablesectionrowSet)) { - fosterParent(function(doc) { return doc.createComment(data); }); - } else { - // "If the adjusted insertion location is inside a template element, - // let it instead be inside the template element's template contents" - if (parent instanceof impl.HTMLTemplateElement) { - parent = parent.content; - } - parent._appendChild(parent.ownerDocument.createComment(data)); - } - } - - function insertText(s) { - var parent = stack.top; - if (foster_parent_mode && isA(parent, tablesectionrowSet)) { - fosterParent(function(doc) { return doc.createTextNode(s); }); - } else { - // "If the adjusted insertion location is inside a template element, - // let it instead be inside the template element's template contents" - if (parent instanceof impl.HTMLTemplateElement) { - parent = parent.content; - } - // "If there is a Text node immediately before the adjusted insertion - // location, then append data to that Text node's data." - var lastChild = parent.lastChild; - if (lastChild && lastChild.nodeType === Node.TEXT_NODE) { - lastChild.appendData(s); - } else { - parent._appendChild(parent.ownerDocument.createTextNode(s)); - } - } - } - - function createHTMLElt(doc, name, attrs) { - // Create the element this way, rather than with - // doc.createElement because createElement() does error - // checking on the element name that we need to avoid here. - var elt = html.createElement(doc, name, null); - - if (attrs) { - for(var i = 0, n = attrs.length; i < n; i++) { - // Use the _ version to avoid testing the validity - // of the attribute name - elt._setAttribute(attrs[i][0], attrs[i][1]); - } - } - // XXX - // If the element is a resettable form element, - // run its reset algorithm now - // XXX - // handle case where form-element-pointer is not null - return elt; - } - - // The in_table insertion mode turns on this flag, and that makes - // insertHTMLElement use the foster parenting algorithm for elements - // tags inside a table - var foster_parent_mode = false; - - function insertHTMLElement(name, attrs) { - var elt = insertElement(function(doc) { - return createHTMLElt(doc, name, attrs); - }); - - // XXX - // If this is a form element, set its form attribute property here - if (isA(elt, formassociatedSet)) { - elt._form = form_element_pointer; - } - - return elt; - } - - // Insert the element into the open element or foster parent it - function insertElement(eltFunc) { - var elt; - if (foster_parent_mode && isA(stack.top, tablesectionrowSet)) { - elt = fosterParent(eltFunc); - } - else if (stack.top instanceof impl.HTMLTemplateElement) { - // "If the adjusted insertion location is inside a template element, - // let it instead be inside the template element's template contents" - elt = eltFunc(stack.top.content.ownerDocument); - stack.top.content._appendChild(elt); - } else { - elt = eltFunc(stack.top.ownerDocument); - stack.top._appendChild(elt); - } - - stack.push(elt); - return elt; - } - - function insertForeignElement(name, attrs, ns) { - return insertElement(function(doc) { - // We need to prevent createElementNS from trying to parse `name` as a - // `qname`, so use an internal Document#_createElementNS() interface. - var elt = doc._createElementNS(name, ns, null); - if (attrs) { - for(var i = 0, n = attrs.length; i < n; i++) { - var attr = attrs[i]; - if (attr.length === 2) - elt._setAttribute(attr[0], attr[1]); - else { - elt._setAttributeNS(attr[2], attr[0], attr[1]); - } - } - } - return elt; - }); - } - - function lastElementOfType(type) { - for(var i = stack.elements.length-1; i >= 0; i--) { - if (stack.elements[i] instanceof type) { - return i; - } - } - return -1; - } - - function fosterParent(eltFunc) { - var parent, before, lastTable = -1, lastTemplate = -1, elt; - - lastTable = lastElementOfType(impl.HTMLTableElement); - lastTemplate = lastElementOfType(impl.HTMLTemplateElement); - - if (lastTemplate >= 0 && (lastTable < 0 || lastTemplate > lastTable)) { - parent = stack.elements[lastTemplate]; - } else if (lastTable >= 0) { - parent = stack.elements[lastTable].parentNode; - if (parent) { - before = stack.elements[lastTable]; - } else { - parent = stack.elements[lastTable - 1]; - } - } - if (!parent) parent = stack.elements[0]; // the `html` element. - - // "If the adjusted insertion location is inside a template element, - // let it instead be inside the template element's template contents" - if (parent instanceof impl.HTMLTemplateElement) { - parent = parent.content; - } - // Create element in the appropriate document. - elt = eltFunc(parent.ownerDocument); - - if (elt.nodeType === Node.TEXT_NODE) { - var prev; - if (before) prev = before.previousSibling; - else prev = parent.lastChild; - if (prev && prev.nodeType === Node.TEXT_NODE) { - prev.appendData(elt.data); - return elt; - } - } - if (before) - parent.insertBefore(elt, before); - else - parent._appendChild(elt); - return elt; - } - - - function resetInsertionMode() { - var last = false; - for(var i = stack.elements.length-1; i >= 0; i--) { - var node = stack.elements[i]; - if (i === 0) { - last = true; - if (fragment) { - node = fragmentContext; - } - } - if (node.namespaceURI === NAMESPACE.HTML) { - var tag = node.localName; - switch(tag) { - case "select": - for(var j = i; j > 0; ) { - var ancestor = stack.elements[--j]; - if (ancestor instanceof impl.HTMLTemplateElement) { - break; - } else if (ancestor instanceof impl.HTMLTableElement) { - parser = in_select_in_table_mode; - return; - } - } - parser = in_select_mode; - return; - case "tr": - parser = in_row_mode; - return; - case "tbody": - case "tfoot": - case "thead": - parser = in_table_body_mode; - return; - case "caption": - parser = in_caption_mode; - return; - case "colgroup": - parser = in_column_group_mode; - return; - case "table": - parser = in_table_mode; - return; - case "template": - parser = templateInsertionModes[templateInsertionModes.length-1]; - return; - case "body": - parser = in_body_mode; - return; - case "frameset": - parser = in_frameset_mode; - return; - case "html": - if (head_element_pointer === null) { - parser = before_head_mode; - } else { - parser = after_head_mode; - } - return; - default: - if (!last) { - if (tag === "head") { - parser = in_head_mode; - return; - } - if (tag === "td" || tag === "th") { - parser = in_cell_mode; - return; - } - } - } - } - if (last) { - parser = in_body_mode; - return; - } - } - } - - - function parseRawText(name, attrs) { - insertHTMLElement(name, attrs); - tokenizer = rawtext_state; - originalInsertionMode = parser; - parser = text_mode; - } - - function parseRCDATA(name, attrs) { - insertHTMLElement(name, attrs); - tokenizer = rcdata_state; - originalInsertionMode = parser; - parser = text_mode; - } - - // Make a copy of element i on the list of active formatting - // elements, using its original attributes, not current - // attributes (which may have been modified by a script) - function afeclone(doc, i) { - return { - elt: createHTMLElt(doc, afe.list[i].localName, afe.attrs[i]), - attrs: afe.attrs[i], - }; - } - - - function afereconstruct() { - if (afe.list.length === 0) return; - var entry = afe.list[afe.list.length-1]; - // If the last is a marker , do nothing - if (entry === afe.MARKER) return; - // Or if it is an open element, do nothing - if (stack.elements.lastIndexOf(entry) !== -1) return; - - // Loop backward through the list until we find a marker or an - // open element, and then move forward one from there. - for(var i = afe.list.length-2; i >= 0; i--) { - entry = afe.list[i]; - if (entry === afe.MARKER) break; - if (stack.elements.lastIndexOf(entry) !== -1) break; - } - - // Now loop forward, starting from the element after the current - // one, recreating formatting elements and pushing them back onto - // the list of open elements - for(i = i+1; i < afe.list.length; i++) { - var newelt = insertElement(function(doc) { return afeclone(doc, i).elt; }); - afe.list[i] = newelt; - } - } - - // Used by the adoptionAgency() function - var BOOKMARK = {localName:"BM"}; - - function adoptionAgency(tag) { - // If the current node is an HTML element whose tag name is subject, - // and the current node is not in the list of active formatting - // elements, then pop the current node off the stack of open - // elements and abort these steps. - if (isA(stack.top, tag) && afe.indexOf(stack.top) === -1) { - stack.pop(); - return true; // no more handling required - } - - // Let outer loop counter be zero. - var outer = 0; - - // Outer loop: If outer loop counter is greater than or - // equal to eight, then abort these steps. - while(outer < 8) { - // Increment outer loop counter by one. - outer++; - - // Let the formatting element be the last element in the list - // of active formatting elements that: is between the end of - // the list and the last scope marker in the list, if any, or - // the start of the list otherwise, and has the same tag name - // as the token. - var fmtelt = afe.findElementByTag(tag); - - // If there is no such node, then abort these steps and instead - // act as described in the "any other end tag" entry below. - if (!fmtelt) { - return false; // false means handle by the default case - } - - // Otherwise, if there is such a node, but that node is not in - // the stack of open elements, then this is a parse error; - // remove the element from the list, and abort these steps. - var index = stack.elements.lastIndexOf(fmtelt); - if (index === -1) { - afe.remove(fmtelt); - return true; // true means no more handling required - } - - // Otherwise, if there is such a node, and that node is also in - // the stack of open elements, but the element is not in scope, - // then this is a parse error; ignore the token, and abort - // these steps. - if (!stack.elementInScope(fmtelt)) { - return true; - } - - // Let the furthest block be the topmost node in the stack of - // open elements that is lower in the stack than the formatting - // element, and is an element in the special category. There - // might not be one. - var furthestblock = null, furthestblockindex; - for(var i = index+1; i < stack.elements.length; i++) { - if (isA(stack.elements[i], specialSet)) { - furthestblock = stack.elements[i]; - furthestblockindex = i; - break; - } - } - - // If there is no furthest block, then the UA must skip the - // subsequent steps and instead just pop all the nodes from the - // bottom of the stack of open elements, from the current node - // up to and including the formatting element, and remove the - // formatting element from the list of active formatting - // elements. - if (!furthestblock) { - stack.popElement(fmtelt); - afe.remove(fmtelt); - return true; - } - else { - // Let the common ancestor be the element immediately above - // the formatting element in the stack of open elements. - var ancestor = stack.elements[index-1]; - - // Let a bookmark note the position of the formatting - // element in the list of active formatting elements - // relative to the elements on either side of it in the - // list. - afe.insertAfter(fmtelt, BOOKMARK); - - // Let node and last node be the furthest block. - var node = furthestblock; - var lastnode = furthestblock; - var nodeindex = furthestblockindex; - var nodeafeindex; - - // Let inner loop counter be zero. - var inner = 0; - - while (true) { - - // Increment inner loop counter by one. - inner++; - - // Let node be the element immediately above node in - // the stack of open elements, or if node is no longer - // in the stack of open elements (e.g. because it got - // removed by this algorithm), the element that was - // immediately above node in the stack of open elements - // before node was removed. - node = stack.elements[--nodeindex]; - - // If node is the formatting element, then go - // to the next step in the overall algorithm. - if (node === fmtelt) break; - - // If the inner loop counter is greater than three and node - // is in the list of active formatting elements, then remove - // node from the list of active formatting elements. - nodeafeindex = afe.indexOf(node); - if (inner > 3 && nodeafeindex !== -1) { - afe.remove(node); - nodeafeindex = -1; - } - - // If node is not in the list of active formatting - // elements, then remove node from the stack of open - // elements and then go back to the step labeled inner - // loop. - if (nodeafeindex === -1) { - stack.removeElement(node); - continue; - } - - // Create an element for the token for which the - // element node was created with common ancestor as - // the intended parent, replace the entry for node - // in the list of active formatting elements with an - // entry for the new element, replace the entry for - // node in the stack of open elements with an entry for - // the new element, and let node be the new element. - var newelt = afeclone(ancestor.ownerDocument, nodeafeindex); - afe.replace(node, newelt.elt, newelt.attrs); - stack.elements[nodeindex] = newelt.elt; - node = newelt.elt; - - // If last node is the furthest block, then move the - // aforementioned bookmark to be immediately after the - // new node in the list of active formatting elements. - if (lastnode === furthestblock) { - afe.remove(BOOKMARK); - afe.insertAfter(newelt.elt, BOOKMARK); - } - - // Insert last node into node, first removing it from - // its previous parent node if any. - node._appendChild(lastnode); - - // Let last node be node. - lastnode = node; - } - - // If the common ancestor node is a table, tbody, tfoot, - // thead, or tr element, then, foster parent whatever last - // node ended up being in the previous step, first removing - // it from its previous parent node if any. - if (foster_parent_mode && isA(ancestor, tablesectionrowSet)) { - fosterParent(function() { return lastnode; }); - } - // Otherwise, append whatever last node ended up being in - // the previous step to the common ancestor node, first - // removing it from its previous parent node if any. - else if (ancestor instanceof impl.HTMLTemplateElement) { - ancestor.content._appendChild(lastnode); - } else { - ancestor._appendChild(lastnode); - } - - // Create an element for the token for which the - // formatting element was created, with furthest block - // as the intended parent. - var newelt2 = afeclone(furthestblock.ownerDocument, afe.indexOf(fmtelt)); - - // Take all of the child nodes of the furthest block and - // append them to the element created in the last step. - while(furthestblock.hasChildNodes()) { - newelt2.elt._appendChild(furthestblock.firstChild); - } - - // Append that new element to the furthest block. - furthestblock._appendChild(newelt2.elt); - - // Remove the formatting element from the list of active - // formatting elements, and insert the new element into the - // list of active formatting elements at the position of - // the aforementioned bookmark. - afe.remove(fmtelt); - afe.replace(BOOKMARK, newelt2.elt, newelt2.attrs); - - // Remove the formatting element from the stack of open - // elements, and insert the new element into the stack of - // open elements immediately below the position of the - // furthest block in that stack. - stack.removeElement(fmtelt); - var pos = stack.elements.lastIndexOf(furthestblock); - stack.elements.splice(pos+1, 0, newelt2.elt); - } - } - - return true; - } - - // We do this when we get /script in in_text_mode - function handleScriptEnd() { - // XXX: - // This is just a stub implementation right now and doesn't run scripts. - // Getting this method right involves the event loop, URL resolution - // script fetching etc. For now I just want to be able to parse - // documents and test the parser. - - //var script = stack.top; - stack.pop(); - parser = originalInsertionMode; - //script._prepare(); - return; - - // XXX: here is what this method is supposed to do - - // Provide a stable state. - - // Let script be the current node (which will be a script - // element). - - // Pop the current node off the stack of open elements. - - // Switch the insertion mode to the original insertion mode. - - // Let the old insertion point have the same value as the current - // insertion point. Let the insertion point be just before the - // next input character. - - // Increment the parser's script nesting level by one. - - // Prepare the script. This might cause some script to execute, - // which might cause new characters to be inserted into the - // tokenizer, and might cause the tokenizer to output more tokens, - // resulting in a reentrant invocation of the parser. - - // Decrement the parser's script nesting level by one. If the - // parser's script nesting level is zero, then set the parser - // pause flag to false. - - // Let the insertion point have the value of the old insertion - // point. (In other words, restore the insertion point to its - // previous value. This value might be the "undefined" value.) - - // At this stage, if there is a pending parsing-blocking script, - // then: - - // If the script nesting level is not zero: - - // Set the parser pause flag to true, and abort the processing - // of any nested invocations of the tokenizer, yielding - // control back to the caller. (Tokenization will resume when - // the caller returns to the "outer" tree construction stage.) - - // The tree construction stage of this particular parser is - // being called reentrantly, say from a call to - // document.write(). - - // Otherwise: - - // Run these steps: - - // Let the script be the pending parsing-blocking - // script. There is no longer a pending - // parsing-blocking script. - - // Block the tokenizer for this instance of the HTML - // parser, such that the event loop will not run tasks - // that invoke the tokenizer. - - // If the parser's Document has a style sheet that is - // blocking scripts or the script's "ready to be - // parser-executed" flag is not set: spin the event - // loop until the parser's Document has no style sheet - // that is blocking scripts and the script's "ready to - // be parser-executed" flag is set. - - // Unblock the tokenizer for this instance of the HTML - // parser, such that tasks that invoke the tokenizer - // can again be run. - - // Let the insertion point be just before the next - // input character. - - // Increment the parser's script nesting level by one - // (it should be zero before this step, so this sets - // it to one). - - // Execute the script. - - // Decrement the parser's script nesting level by - // one. If the parser's script nesting level is zero - // (which it always should be at this point), then set - // the parser pause flag to false. - - // Let the insertion point be undefined again. - - // If there is once again a pending parsing-blocking - // script, then repeat these steps from step 1. - - - } - - function stopParsing() { - // XXX This is just a temporary implementation to get the parser working. - // A full implementation involves scripts and events and the event loop. - - // Remove the link from document to parser. - // This is instead of "set the insertion point to undefined". - // It means that document.write() can't write into the doc anymore. - delete doc._parser; - - stack.elements.length = 0; // pop everything off - - // If there is a window object associated with the document - // then trigger an load event on it - if (doc.defaultView) { - doc.defaultView.dispatchEvent(new impl.Event("load",{})); - } - - } - - /**** - * Tokenizer states - */ - - /** - * This file was partially mechanically generated from - * http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html - * - * After mechanical conversion, it was further converted from - * prose to JS by hand, but the intent is that it is a very - * faithful rendering of the HTML tokenization spec in - * JavaScript. - * - * It is not a goal of this tokenizer to detect or report - * parse errors. - * - * XXX The tokenizer is supposed to work with straight UTF32 - * codepoints. But I don't think it has any dependencies on - * any character outside of the BMP so I think it is safe to - * pass it UTF16 characters. I don't think it will ever change - * state in the middle of a surrogate pair. - */ - - /* - * Each state is represented by a function. For most states, the - * scanner simply passes the next character (as an integer - * codepoint) to the current state function and automatically - * consumes the character. If the state function can't process - * the character it can call pushback() to push it back to the - * scanner. - * - * Some states require lookahead, though. If a state function has - * a lookahead property, then it is invoked differently. In this - * case, the scanner invokes the function with 3 arguments: 1) the - * next codepoint 2) a string of lookahead text 3) a boolean that - * is true if the lookahead goes all the way to the EOF. (XXX - * actually maybe this third is not necessary... the lookahead - * could just include \uFFFF?) - * - * If the lookahead property of a state function is an integer, it - * specifies the number of characters required. If it is a string, - * then the scanner will scan for that string and return all - * characters up to and including that sequence, or up to EOF. If - * the lookahead property is a regexp, then the scanner will match - * the regexp at the current point and return the matching string. - * - * States that require lookahead are responsible for explicitly - * consuming the characters they process. They do this by - * incrementing nextchar by the number of processed characters. - */ - function reconsume(c, new_state) { - tokenizer = new_state; - nextchar--; // pushback - } - - function data_state(c) { - switch(c) { - case 0x0026: // AMPERSAND - return_state = data_state; - tokenizer = character_reference_state; - break; - case 0x003C: // LESS-THAN SIGN - if (emitSimpleTag()) // Shortcut for

    ,

    , etc. - break; - tokenizer = tag_open_state; - break; - case 0x0000: // NULL - // Usually null characters emitted by the tokenizer will be - // ignored by the tree builder, but sometimes they'll be - // converted to \uFFFD. I don't want to have the search every - // string emitted to replace NULs, so I'll set a flag - // if I've emitted a NUL. - textrun.push(c); - textIncludesNUL = true; - break; - case -1: // EOF - emitEOF(); - break; - default: - // Instead of just pushing a single character and then - // coming back to the very same place, lookahead and - // emit everything we can at once. - /*jshint -W030 */ - emitCharsWhile(DATATEXT) || textrun.push(c); - break; - } - } - - function rcdata_state(c) { - // Save the open tag so we can find a matching close tag - switch(c) { - case 0x0026: // AMPERSAND - return_state = rcdata_state; - tokenizer = character_reference_state; - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = rcdata_less_than_sign_state; - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - textIncludesNUL = true; - break; - case -1: // EOF - emitEOF(); - break; - default: - textrun.push(c); - break; - } - } - - function rawtext_state(c) { - switch(c) { - case 0x003C: // LESS-THAN SIGN - tokenizer = rawtext_less_than_sign_state; - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - /*jshint -W030 */ - emitCharsWhile(RAWTEXT) || textrun.push(c); - break; - } - } - - function script_data_state(c) { - switch(c) { - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_less_than_sign_state; - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - /*jshint -W030 */ - emitCharsWhile(RAWTEXT) || textrun.push(c); - break; - } - } - - function plaintext_state(c) { - switch(c) { - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - /*jshint -W030 */ - emitCharsWhile(PLAINTEXT) || textrun.push(c); - break; - } - } - - function tag_open_state(c) { - switch(c) { - case 0x0021: // EXCLAMATION MARK - tokenizer = markup_declaration_open_state; - break; - case 0x002F: // SOLIDUS - tokenizer = end_tag_open_state; - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginTagName(); - reconsume(c, tag_name_state); - break; - case 0x003F: // QUESTION MARK - reconsume(c, bogus_comment_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, data_state); - break; - } - } - - function end_tag_open_state(c) { - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, tag_name_state); - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - break; - case -1: // EOF - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - emitEOF(); - break; - default: - reconsume(c, bogus_comment_state); - break; - } - } - - function tag_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_attribute_name_state; - break; - case 0x002F: // SOLIDUS - tokenizer = self_closing_start_tag_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitTag(); - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tagnamebuf += String.fromCharCode(c + 0x0020); - break; - case 0x0000: // NULL - tagnamebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - emitEOF(); - break; - default: - tagnamebuf += getMatchingChars(TAGNAME); - break; - } - } - - function rcdata_less_than_sign_state(c) { - /* identical to the RAWTEXT less-than sign state, except s/RAWTEXT/RCDATA/g */ - if (c === 0x002F) { // SOLIDUS - beginTempBuf(); - tokenizer = rcdata_end_tag_open_state; - } - else { - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, rcdata_state); - } - } - - function rcdata_end_tag_open_state(c) { - /* identical to the RAWTEXT (and Script data) end tag open state, except s/RAWTEXT/RCDATA/g */ - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, rcdata_end_tag_name_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - reconsume(c, rcdata_state); - break; - } - } - - function rcdata_end_tag_name_state(c) { - /* identical to the RAWTEXT (and Script data) end tag name state, except s/RAWTEXT/RCDATA/g */ - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - if (appropriateEndTag(tagnamebuf)) { - tokenizer = before_attribute_name_state; - return; - } - break; - case 0x002F: // SOLIDUS - if (appropriateEndTag(tagnamebuf)) { - tokenizer = self_closing_start_tag_state; - return; - } - break; - case 0x003E: // GREATER-THAN SIGN - if (appropriateEndTag(tagnamebuf)) { - tokenizer = data_state; - emitTag(); - return; - } - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - - tagnamebuf += String.fromCharCode(c + 0x0020); - tempbuf.push(c); - return; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - - tagnamebuf += String.fromCharCode(c); - tempbuf.push(c); - return; - default: - break; - } - - // If we don't return in one of the cases above, then this was not - // an appropriately matching close tag, so back out by emitting all - // the characters as text - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - pushAll(textrun, tempbuf); - reconsume(c, rcdata_state); - } - - function rawtext_less_than_sign_state(c) { - /* identical to the RCDATA less-than sign state, except s/RCDATA/RAWTEXT/g - */ - if (c === 0x002F) { // SOLIDUS - beginTempBuf(); - tokenizer = rawtext_end_tag_open_state; - } - else { - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, rawtext_state); - } - } - - function rawtext_end_tag_open_state(c) { - /* identical to the RCDATA (and Script data) end tag open state, except s/RCDATA/RAWTEXT/g */ - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, rawtext_end_tag_name_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - reconsume(c, rawtext_state); - break; - } - } - - function rawtext_end_tag_name_state(c) { - /* identical to the RCDATA (and Script data) end tag name state, except s/RCDATA/RAWTEXT/g */ - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - if (appropriateEndTag(tagnamebuf)) { - tokenizer = before_attribute_name_state; - return; - } - break; - case 0x002F: // SOLIDUS - if (appropriateEndTag(tagnamebuf)) { - tokenizer = self_closing_start_tag_state; - return; - } - break; - case 0x003E: // GREATER-THAN SIGN - if (appropriateEndTag(tagnamebuf)) { - tokenizer = data_state; - emitTag(); - return; - } - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tagnamebuf += String.fromCharCode(c + 0x0020); - tempbuf.push(c); - return; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - tagnamebuf += String.fromCharCode(c); - tempbuf.push(c); - return; - default: - break; - } - - // If we don't return in one of the cases above, then this was not - // an appropriately matching close tag, so back out by emitting all - // the characters as text - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - pushAll(textrun,tempbuf); - reconsume(c, rawtext_state); - } - - function script_data_less_than_sign_state(c) { - switch(c) { - case 0x002F: // SOLIDUS - beginTempBuf(); - tokenizer = script_data_end_tag_open_state; - break; - case 0x0021: // EXCLAMATION MARK - tokenizer = script_data_escape_start_state; - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x0021); // EXCLAMATION MARK - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, script_data_state); - break; - } - } - - function script_data_end_tag_open_state(c) { - /* identical to the RCDATA (and RAWTEXT) end tag open state, except s/RCDATA/Script data/g */ - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, script_data_end_tag_name_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - reconsume(c, script_data_state); - break; - } - } - - function script_data_end_tag_name_state(c) { - /* identical to the RCDATA (and RAWTEXT) end tag name state, except s/RCDATA/Script data/g */ - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - if (appropriateEndTag(tagnamebuf)) { - tokenizer = before_attribute_name_state; - return; - } - break; - case 0x002F: // SOLIDUS - if (appropriateEndTag(tagnamebuf)) { - tokenizer = self_closing_start_tag_state; - return; - } - break; - case 0x003E: // GREATER-THAN SIGN - if (appropriateEndTag(tagnamebuf)) { - tokenizer = data_state; - emitTag(); - return; - } - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - - tagnamebuf += String.fromCharCode(c + 0x0020); - tempbuf.push(c); - return; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - - tagnamebuf += String.fromCharCode(c); - tempbuf.push(c); - return; - default: - break; - } - - // If we don't return in one of the cases above, then this was not - // an appropriately matching close tag, so back out by emitting all - // the characters as text - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - pushAll(textrun,tempbuf); - reconsume(c, script_data_state); - } - - function script_data_escape_start_state(c) { - if (c === 0x002D) { // HYPHEN-MINUS - tokenizer = script_data_escape_start_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - } - else { - reconsume(c, script_data_state); - } - } - - function script_data_escape_start_dash_state(c) { - if (c === 0x002D) { // HYPHEN-MINUS - tokenizer = script_data_escaped_dash_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - } - else { - reconsume(c, script_data_state); - } - } - - function script_data_escaped_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = script_data_escaped_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_escaped_less_than_sign_state; - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - textrun.push(c); - break; - } - } - - function script_data_escaped_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = script_data_escaped_dash_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_escaped_less_than_sign_state; - break; - case 0x0000: // NULL - tokenizer = script_data_escaped_state; - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - tokenizer = script_data_escaped_state; - textrun.push(c); - break; - } - } - - function script_data_escaped_dash_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_escaped_less_than_sign_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = script_data_state; - textrun.push(0x003E); // GREATER-THAN SIGN - break; - case 0x0000: // NULL - tokenizer = script_data_escaped_state; - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - tokenizer = script_data_escaped_state; - textrun.push(c); - break; - } - } - - function script_data_escaped_less_than_sign_state(c) { - switch(c) { - case 0x002F: // SOLIDUS - beginTempBuf(); - tokenizer = script_data_escaped_end_tag_open_state; - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginTempBuf(); - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, script_data_double_escape_start_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - reconsume(c, script_data_escaped_state); - break; - } - } - - function script_data_escaped_end_tag_open_state(c) { - switch(c) { - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - beginEndTagName(); - reconsume(c, script_data_escaped_end_tag_name_state); - break; - default: - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - reconsume(c, script_data_escaped_state); - break; - } - } - - function script_data_escaped_end_tag_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - if (appropriateEndTag(tagnamebuf)) { - tokenizer = before_attribute_name_state; - return; - } - break; - case 0x002F: // SOLIDUS - if (appropriateEndTag(tagnamebuf)) { - tokenizer = self_closing_start_tag_state; - return; - } - break; - case 0x003E: // GREATER-THAN SIGN - if (appropriateEndTag(tagnamebuf)) { - tokenizer = data_state; - emitTag(); - return; - } - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tagnamebuf += String.fromCharCode(c + 0x0020); - tempbuf.push(c); - return; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - tagnamebuf += String.fromCharCode(c); - tempbuf.push(c); - return; - default: - break; - } - - // We get here in the default case, and if the closing tagname - // is not an appropriate tagname. - textrun.push(0x003C); // LESS-THAN SIGN - textrun.push(0x002F); // SOLIDUS - pushAll(textrun,tempbuf); - reconsume(c, script_data_escaped_state); - } - - function script_data_double_escape_start_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - case 0x002F: // SOLIDUS - case 0x003E: // GREATER-THAN SIGN - if (buf2str(tempbuf) === "script") { - tokenizer = script_data_double_escaped_state; - } - else { - tokenizer = script_data_escaped_state; - } - textrun.push(c); - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tempbuf.push(c + 0x0020); - textrun.push(c); - break; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - tempbuf.push(c); - textrun.push(c); - break; - default: - reconsume(c, script_data_escaped_state); - break; - } - } - - function script_data_double_escaped_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = script_data_double_escaped_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_double_escaped_less_than_sign_state; - textrun.push(0x003C); // LESS-THAN SIGN - break; - case 0x0000: // NULL - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - textrun.push(c); - break; - } - } - - function script_data_double_escaped_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = script_data_double_escaped_dash_dash_state; - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_double_escaped_less_than_sign_state; - textrun.push(0x003C); // LESS-THAN SIGN - break; - case 0x0000: // NULL - tokenizer = script_data_double_escaped_state; - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - tokenizer = script_data_double_escaped_state; - textrun.push(c); - break; - } - } - - function script_data_double_escaped_dash_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - textrun.push(0x002D); // HYPHEN-MINUS - break; - case 0x003C: // LESS-THAN SIGN - tokenizer = script_data_double_escaped_less_than_sign_state; - textrun.push(0x003C); // LESS-THAN SIGN - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = script_data_state; - textrun.push(0x003E); // GREATER-THAN SIGN - break; - case 0x0000: // NULL - tokenizer = script_data_double_escaped_state; - textrun.push(0xFFFD); // REPLACEMENT CHARACTER - break; - case -1: // EOF - emitEOF(); - break; - default: - tokenizer = script_data_double_escaped_state; - textrun.push(c); - break; - } - } - - function script_data_double_escaped_less_than_sign_state(c) { - if (c === 0x002F) { // SOLIDUS - beginTempBuf(); - tokenizer = script_data_double_escape_end_state; - textrun.push(0x002F); // SOLIDUS - } - else { - reconsume(c, script_data_double_escaped_state); - } - } - - function script_data_double_escape_end_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - case 0x002F: // SOLIDUS - case 0x003E: // GREATER-THAN SIGN - if (buf2str(tempbuf) === "script") { - tokenizer = script_data_escaped_state; - } - else { - tokenizer = script_data_double_escaped_state; - } - textrun.push(c); - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - tempbuf.push(c + 0x0020); - textrun.push(c); - break; - case 0x0061: // [a-z] - case 0x0062:case 0x0063:case 0x0064:case 0x0065:case 0x0066: - case 0x0067:case 0x0068:case 0x0069:case 0x006A:case 0x006B: - case 0x006C:case 0x006D:case 0x006E:case 0x006F:case 0x0070: - case 0x0071:case 0x0072:case 0x0073:case 0x0074:case 0x0075: - case 0x0076:case 0x0077:case 0x0078:case 0x0079:case 0x007A: - tempbuf.push(c); - textrun.push(c); - break; - default: - reconsume(c, script_data_double_escaped_state); - break; - } - } - - function before_attribute_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - // For SOLIDUS, GREATER-THAN SIGN, and EOF, spec says "reconsume in - // the after attribute name state", but in our implementation that - // state always has an active attribute in attrnamebuf. Just clone - // the rules here, without the addAttribute business. - case 0x002F: // SOLIDUS - tokenizer = self_closing_start_tag_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitTag(); - break; - case -1: // EOF - emitEOF(); - break; - case 0x003D: // EQUALS SIGN - beginAttrName(); - attrnamebuf += String.fromCharCode(c); - tokenizer = attribute_name_state; - break; - default: - if (handleSimpleAttribute()) break; - beginAttrName(); - reconsume(c, attribute_name_state); - break; - } - } - - // beginAttrName() must have been called before this point - // There is an active attribute in attrnamebuf (but not attrvaluebuf) - function attribute_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - case 0x002F: // SOLIDUS - case 0x003E: // GREATER-THAN SIGN - case -1: // EOF - reconsume(c, after_attribute_name_state); - break; - case 0x003D: // EQUALS SIGN - tokenizer = before_attribute_value_state; - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - attrnamebuf += String.fromCharCode(c + 0x0020); - break; - case 0x0000: // NULL - attrnamebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x0022: // QUOTATION MARK - case 0x0027: // APOSTROPHE - case 0x003C: // LESS-THAN SIGN - /* falls through */ - default: - attrnamebuf += getMatchingChars(ATTRNAME); - break; - } - } - - // There is an active attribute in attrnamebuf, but not yet in attrvaluebuf. - function after_attribute_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x002F: // SOLIDUS - // Keep in sync with before_attribute_name_state. - addAttribute(attrnamebuf); - tokenizer = self_closing_start_tag_state; - break; - case 0x003D: // EQUALS SIGN - tokenizer = before_attribute_value_state; - break; - case 0x003E: // GREATER-THAN SIGN - // Keep in sync with before_attribute_name_state. - tokenizer = data_state; - addAttribute(attrnamebuf); - emitTag(); - break; - case -1: // EOF - // Keep in sync with before_attribute_name_state. - addAttribute(attrnamebuf); - emitEOF(); - break; - default: - addAttribute(attrnamebuf); - beginAttrName(); - reconsume(c, attribute_name_state); - break; - } - } - - function before_attribute_value_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x0022: // QUOTATION MARK - beginAttrValue(); - tokenizer = attribute_value_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginAttrValue(); - tokenizer = attribute_value_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - /* falls through */ - default: - beginAttrValue(); - reconsume(c, attribute_value_unquoted_state); - break; - } - } - - function attribute_value_double_quoted_state(c) { - switch(c) { - case 0x0022: // QUOTATION MARK - addAttribute(attrnamebuf, attrvaluebuf); - tokenizer = after_attribute_value_quoted_state; - break; - case 0x0026: // AMPERSAND - return_state = attribute_value_double_quoted_state; - tokenizer = character_reference_state; - break; - case 0x0000: // NULL - attrvaluebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - emitEOF(); - break; - case 0x000A: // LF - // this could be a converted \r, so don't use getMatchingChars - attrvaluebuf += String.fromCharCode(c); - break; - default: - attrvaluebuf += getMatchingChars(DBLQUOTEATTRVAL); - break; - } - } - - function attribute_value_single_quoted_state(c) { - switch(c) { - case 0x0027: // APOSTROPHE - addAttribute(attrnamebuf, attrvaluebuf); - tokenizer = after_attribute_value_quoted_state; - break; - case 0x0026: // AMPERSAND - return_state = attribute_value_single_quoted_state; - tokenizer = character_reference_state; - break; - case 0x0000: // NULL - attrvaluebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - emitEOF(); - break; - case 0x000A: // LF - // this could be a converted \r, so don't use getMatchingChars - attrvaluebuf += String.fromCharCode(c); - break; - default: - attrvaluebuf += getMatchingChars(SINGLEQUOTEATTRVAL); - break; - } - } - - function attribute_value_unquoted_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - addAttribute(attrnamebuf, attrvaluebuf); - tokenizer = before_attribute_name_state; - break; - case 0x0026: // AMPERSAND - return_state = attribute_value_unquoted_state; - tokenizer = character_reference_state; - break; - case 0x003E: // GREATER-THAN SIGN - addAttribute(attrnamebuf, attrvaluebuf); - tokenizer = data_state; - emitTag(); - break; - case 0x0000: // NULL - attrvaluebuf += String.fromCharCode(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - nextchar--; // pushback - tokenizer = data_state; - break; - case 0x0022: // QUOTATION MARK - case 0x0027: // APOSTROPHE - case 0x003C: // LESS-THAN SIGN - case 0x003D: // EQUALS SIGN - case 0x0060: // GRAVE ACCENT - /* falls through */ - default: - attrvaluebuf += getMatchingChars(UNQUOTEDATTRVAL); - break; - } - } - - function after_attribute_value_quoted_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_attribute_name_state; - break; - case 0x002F: // SOLIDUS - tokenizer = self_closing_start_tag_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitTag(); - break; - case -1: // EOF - emitEOF(); - break; - default: - reconsume(c, before_attribute_name_state); - break; - } - } - - function self_closing_start_tag_state(c) { - switch(c) { - case 0x003E: // GREATER-THAN SIGN - // Set the self-closing flag of the current tag token. - tokenizer = data_state; - emitSelfClosingTag(true); - break; - case -1: // EOF - emitEOF(); - break; - default: - reconsume(c, before_attribute_name_state); - break; - } - } - - function bogus_comment_state(c, lookahead, eof) { - var len = lookahead.length; - - if (eof) { - nextchar += len-1; // don't consume the eof - } - else { - nextchar += len; - } - - var comment = lookahead.substring(0, len-1); - - comment = comment.replace(/\u0000/g,"\uFFFD"); - comment = comment.replace(/\u000D\u000A/g,"\u000A"); - comment = comment.replace(/\u000D/g,"\u000A"); - - insertToken(COMMENT, comment); - tokenizer = data_state; - } - bogus_comment_state.lookahead = ">"; - - function markup_declaration_open_state(c, lookahead, eof) { - if (lookahead[0] === "-" && lookahead[1] === "-") { - nextchar += 2; - beginComment(); - tokenizer = comment_start_state; - return; - } - - if (lookahead.toUpperCase() === "DOCTYPE") { - nextchar += 7; - tokenizer = doctype_state; - } - else if (lookahead === "[CDATA[" && cdataAllowed()) { - nextchar += 7; - tokenizer = cdata_section_state; - } - else { - tokenizer = bogus_comment_state; - } - } - markup_declaration_open_state.lookahead = 7; - - function comment_start_state(c) { - beginComment(); - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_start_dash_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - insertToken(COMMENT, buf2str(commentbuf)); - break; /* see comment in comment end state */ - default: - reconsume(c, comment_state); - break; - } - } - - function comment_start_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_end_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - insertToken(COMMENT, buf2str(commentbuf)); - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* see comment in comment end state */ - default: - commentbuf.push(0x002D /* HYPHEN-MINUS */); - reconsume(c, comment_state); - break; - } - } - - function comment_state(c) { - switch(c) { - case 0x003C: // LESS-THAN SIGN - commentbuf.push(c); - tokenizer = comment_less_than_sign_state; - break; - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_end_dash_state; - break; - case 0x0000: // NULL - commentbuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* see comment in comment end state */ - default: - commentbuf.push(c); - break; - } - } - - function comment_less_than_sign_state(c) { - switch(c) { - case 0x0021: // EXCLAMATION MARK - commentbuf.push(c); - tokenizer = comment_less_than_sign_bang_state; - break; - case 0x003C: // LESS-THAN SIGN - commentbuf.push(c); - break; - default: - reconsume(c, comment_state); - break; - } - } - - function comment_less_than_sign_bang_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_less_than_sign_bang_dash_state; - break; - default: - reconsume(c, comment_state); - break; - } - } - - function comment_less_than_sign_bang_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_less_than_sign_bang_dash_dash_state; - break; - default: - reconsume(c, comment_end_dash_state); - break; - } - } - - function comment_less_than_sign_bang_dash_dash_state(c) { - switch(c) { - case 0x003E: // GREATER-THAN SIGN - case -1: // EOF - reconsume(c, comment_end_state); - break; - default: - // parse error - reconsume(c, comment_end_state); - break; - } - } - - function comment_end_dash_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - tokenizer = comment_end_state; - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* see comment in comment end state */ - default: - commentbuf.push(0x002D /* HYPHEN-MINUS */); - reconsume(c, comment_state); - break; - } - } - - function comment_end_state(c) { - switch(c) { - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - insertToken(COMMENT, buf2str(commentbuf)); - break; - case 0x0021: // EXCLAMATION MARK - tokenizer = comment_end_bang_state; - break; - case 0x002D: // HYPHEN-MINUS - commentbuf.push(0x002D); - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* For security reasons: otherwise, hostile user could put a script in a comment e.g. in a blog comment and then DOS the server so that the end tag isn't read, and then the commented script tag would be treated as live code */ - default: - commentbuf.push(0x002D); - commentbuf.push(0x002D); - reconsume(c, comment_state); - break; - } - } - - function comment_end_bang_state(c) { - switch(c) { - case 0x002D: // HYPHEN-MINUS - commentbuf.push(0x002D); - commentbuf.push(0x002D); - commentbuf.push(0x0021); - tokenizer = comment_end_dash_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - insertToken(COMMENT, buf2str(commentbuf)); - break; - case -1: // EOF - insertToken(COMMENT, buf2str(commentbuf)); - emitEOF(); - break; /* see comment in comment end state */ - default: - commentbuf.push(0x002D); - commentbuf.push(0x002D); - commentbuf.push(0x0021); - reconsume(c, comment_state); - break; - } - } - - function doctype_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_doctype_name_state; - break; - case -1: // EOF - beginDoctype(); - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - reconsume(c, before_doctype_name_state); - break; - } - } - - function before_doctype_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - beginDoctype(); - doctypenamebuf.push(c + 0x0020); - tokenizer = doctype_name_state; - break; - case 0x0000: // NULL - beginDoctype(); - doctypenamebuf.push(0xFFFD); - tokenizer = doctype_name_state; - break; - case 0x003E: // GREATER-THAN SIGN - beginDoctype(); - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - beginDoctype(); - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - beginDoctype(); - doctypenamebuf.push(c); - tokenizer = doctype_name_state; - break; - } - } - - function doctype_name_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = after_doctype_name_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case 0x0041: // [A-Z] - case 0x0042:case 0x0043:case 0x0044:case 0x0045:case 0x0046: - case 0x0047:case 0x0048:case 0x0049:case 0x004A:case 0x004B: - case 0x004C:case 0x004D:case 0x004E:case 0x004F:case 0x0050: - case 0x0051:case 0x0052:case 0x0053:case 0x0054:case 0x0055: - case 0x0056:case 0x0057:case 0x0058:case 0x0059:case 0x005A: - doctypenamebuf.push(c + 0x0020); - break; - case 0x0000: // NULL - doctypenamebuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypenamebuf.push(c); - break; - } - } - - function after_doctype_name_state(c, lookahead, eof) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - nextchar += 1; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - nextchar += 1; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - lookahead = lookahead.toUpperCase(); - if (lookahead === "PUBLIC") { - nextchar += 6; - tokenizer = after_doctype_public_keyword_state; - } - else if (lookahead === "SYSTEM") { - nextchar += 6; - tokenizer = after_doctype_system_keyword_state; - } - else { - forcequirks(); - tokenizer = bogus_doctype_state; - } - break; - } - } - after_doctype_name_state.lookahead = 6; - - function after_doctype_public_keyword_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_doctype_public_identifier_state; - break; - case 0x0022: // QUOTATION MARK - beginDoctypePublicId(); - tokenizer = doctype_public_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypePublicId(); - tokenizer = doctype_public_identifier_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function before_doctype_public_identifier_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x0022: // QUOTATION MARK - beginDoctypePublicId(); - tokenizer = doctype_public_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypePublicId(); - tokenizer = doctype_public_identifier_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function doctype_public_identifier_double_quoted_state(c) { - switch(c) { - case 0x0022: // QUOTATION MARK - tokenizer = after_doctype_public_identifier_state; - break; - case 0x0000: // NULL - doctypepublicbuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypepublicbuf.push(c); - break; - } - } - - function doctype_public_identifier_single_quoted_state(c) { - switch(c) { - case 0x0027: // APOSTROPHE - tokenizer = after_doctype_public_identifier_state; - break; - case 0x0000: // NULL - doctypepublicbuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypepublicbuf.push(c); - break; - } - } - - function after_doctype_public_identifier_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = between_doctype_public_and_system_identifiers_state; - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case 0x0022: // QUOTATION MARK - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_single_quoted_state; - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function between_doctype_public_and_system_identifiers_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE Ignore the character. - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case 0x0022: // QUOTATION MARK - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_single_quoted_state; - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function after_doctype_system_keyword_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - tokenizer = before_doctype_system_identifier_state; - break; - case 0x0022: // QUOTATION MARK - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function before_doctype_system_identifier_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE Ignore the character. - break; - case 0x0022: // QUOTATION MARK - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_double_quoted_state; - break; - case 0x0027: // APOSTROPHE - beginDoctypeSystemId(); - tokenizer = doctype_system_identifier_single_quoted_state; - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - forcequirks(); - tokenizer = bogus_doctype_state; - break; - } - } - - function doctype_system_identifier_double_quoted_state(c) { - switch(c) { - case 0x0022: // QUOTATION MARK - tokenizer = after_doctype_system_identifier_state; - break; - case 0x0000: // NULL - doctypesystembuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypesystembuf.push(c); - break; - } - } - - function doctype_system_identifier_single_quoted_state(c) { - switch(c) { - case 0x0027: // APOSTROPHE - tokenizer = after_doctype_system_identifier_state; - break; - case 0x0000: // NULL - doctypesystembuf.push(0xFFFD /* REPLACEMENT CHARACTER */); - break; - case 0x003E: // GREATER-THAN SIGN - forcequirks(); - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - doctypesystembuf.push(c); - break; - } - } - - function after_doctype_system_identifier_state(c) { - switch(c) { - case 0x0009: // CHARACTER TABULATION (tab) - case 0x000A: // LINE FEED (LF) - case 0x000C: // FORM FEED (FF) - case 0x0020: // SPACE - /* Ignore the character. */ - break; - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - forcequirks(); - emitDoctype(); - emitEOF(); - break; - default: - tokenizer = bogus_doctype_state; - /* This does *not* set the DOCTYPE token's force-quirks flag. */ - break; - } - } - - function bogus_doctype_state(c) { - switch(c) { - case 0x003E: // GREATER-THAN SIGN - tokenizer = data_state; - emitDoctype(); - break; - case -1: // EOF - emitDoctype(); - emitEOF(); - break; - default: - /* Ignore the character. */ - break; - } - } - - function cdata_section_state(c) { - switch(c) { - case 0x005D: // RIGHT SQUARE BRACKET - tokenizer = cdata_section_bracket_state; - break; - case -1: // EOF - emitEOF(); - break; - case 0x0000: // NULL - textIncludesNUL = true; - /* fall through */ - default: - // Instead of just pushing a single character and then - // coming back to the very same place, lookahead and - // emit everything we can at once. - /*jshint -W030 */ - emitCharsWhile(CDATATEXT) || textrun.push(c); - break; - } - } - - function cdata_section_bracket_state(c) { - switch(c) { - case 0x005D: // RIGHT SQUARE BRACKET - tokenizer = cdata_section_end_state; - break; - default: - textrun.push(0x005D); - reconsume(c, cdata_section_state); - break; - } - } - - function cdata_section_end_state(c) { - switch(c) { - case 0x005D: // RIGHT SQUARE BRACKET - textrun.push(0x005D); - break; - case 0x003E: // GREATER-THAN SIGN - flushText(); - tokenizer = data_state; - break; - default: - textrun.push(0x005D); - textrun.push(0x005D); - reconsume(c, cdata_section_state); - break; - } - } - - function character_reference_state(c) { - beginTempBuf(); - tempbuf.push(0x0026); - switch(c) { - case 0x0009: // TAB - case 0x000A: // LINE FEED - case 0x000C: // FORM FEED - case 0x0020: // SPACE - case 0x003C: // LESS-THAN SIGN - case 0x0026: // AMPERSAND - case -1: // EOF - reconsume(c, character_reference_end_state); - break; - case 0x0023: // NUMBER SIGN - tempbuf.push(c); - tokenizer = numeric_character_reference_state; - break; - default: - reconsume(c, named_character_reference_state); - break; - } - } - - function named_character_reference_state(c) { - NAMEDCHARREF.lastIndex = nextchar; // w/ lookahead no char has been consumed - var matched = NAMEDCHARREF.exec(chars); - if (!matched) throw new Error("should never happen"); - var name = matched[1]; - if (!name) { - // If no match can be made, switch to the character reference end state - tokenizer = character_reference_end_state; - return; - } - - // Consume the matched characters and append them to temporary buffer - nextchar += name.length; - pushAll(tempbuf, str2buf(name)); - - switch(return_state) { - case attribute_value_double_quoted_state: - case attribute_value_single_quoted_state: - case attribute_value_unquoted_state: - // If the character reference was consumed as part of an attribute... - if (name[name.length-1] !== ';') { // ...and the last char is not ; - if (/[=A-Za-z0-9]/.test(chars[nextchar])) { - tokenizer = character_reference_end_state; - return; - } - } - break; - default: - break; - } - - beginTempBuf(); - var rv = namedCharRefs[name]; - if (typeof rv === 'number') { - tempbuf.push(rv); - } else { - pushAll(tempbuf, rv); - } - tokenizer = character_reference_end_state; - } - // We might need to pause tokenization until we have enough characters - // in the buffer for longest possible character reference. - named_character_reference_state.lookahead = -NAMEDCHARREF_MAXLEN; - - function numeric_character_reference_state(c) { - character_reference_code = 0; - switch(c) { - case 0x0078: // x - case 0x0058: // X - tempbuf.push(c); - tokenizer = hexadecimal_character_reference_start_state; - break; - default: - reconsume(c, decimal_character_reference_start_state); - break; - } - } - - function hexadecimal_character_reference_start_state(c) { - switch(c) { - case 0x0030: case 0x0031: case 0x0032: case 0x0033: case 0x0034: - case 0x0035: case 0x0036: case 0x0037: case 0x0038: case 0x0039: // [0-9] - case 0x0041: case 0x0042: case 0x0043: case 0x0044: case 0x0045: - case 0x0046: // [A-F] - case 0x0061: case 0x0062: case 0x0063: case 0x0064: case 0x0065: - case 0x0066: // [a-f] - reconsume(c, hexadecimal_character_reference_state); - break; - default: - reconsume(c, character_reference_end_state); - break; - } - } - - function decimal_character_reference_start_state(c) { - switch(c) { - case 0x0030: case 0x0031: case 0x0032: case 0x0033: case 0x0034: - case 0x0035: case 0x0036: case 0x0037: case 0x0038: case 0x0039: // [0-9] - reconsume(c, decimal_character_reference_state); - break; - default: - reconsume(c, character_reference_end_state); - break; - } - } - - function hexadecimal_character_reference_state(c) { - switch(c) { - case 0x0041: case 0x0042: case 0x0043: case 0x0044: case 0x0045: - case 0x0046: // [A-F] - character_reference_code *= 16; - character_reference_code += (c - 0x0037); - break; - case 0x0061: case 0x0062: case 0x0063: case 0x0064: case 0x0065: - case 0x0066: // [a-f] - character_reference_code *= 16; - character_reference_code += (c - 0x0057); - break; - case 0x0030: case 0x0031: case 0x0032: case 0x0033: case 0x0034: - case 0x0035: case 0x0036: case 0x0037: case 0x0038: case 0x0039: // [0-9] - character_reference_code *= 16; - character_reference_code += (c - 0x0030); - break; - case 0x003B: // SEMICOLON - tokenizer = numeric_character_reference_end_state; - break; - default: - reconsume(c, numeric_character_reference_end_state); - break; - } - } - - function decimal_character_reference_state(c) { - switch(c) { - case 0x0030: case 0x0031: case 0x0032: case 0x0033: case 0x0034: - case 0x0035: case 0x0036: case 0x0037: case 0x0038: case 0x0039: // [0-9] - character_reference_code *= 10; - character_reference_code += (c - 0x0030); - break; - case 0x003B: // SEMICOLON - tokenizer = numeric_character_reference_end_state; - break; - default: - reconsume(c, numeric_character_reference_end_state); - break; - } - } - - function numeric_character_reference_end_state(c) { - if (character_reference_code in numericCharRefReplacements) { - character_reference_code = numericCharRefReplacements[character_reference_code]; - } else if (character_reference_code > 0x10FFFF || (character_reference_code >= 0xD800 && character_reference_code < 0xE000)) { - character_reference_code = 0xFFFD; - } - - beginTempBuf(); - if (character_reference_code <= 0xFFFF) { - tempbuf.push(character_reference_code); - } else { - character_reference_code = character_reference_code - 0x10000; - /* jshint bitwise: false */ - tempbuf.push(0xD800 + (character_reference_code >> 10)); - tempbuf.push(0xDC00 + (character_reference_code & 0x03FF)); - } - reconsume(c, character_reference_end_state); - } - - function character_reference_end_state(c) { - switch(return_state) { - case attribute_value_double_quoted_state: - case attribute_value_single_quoted_state: - case attribute_value_unquoted_state: - // append each character to the current attribute's value - attrvaluebuf += buf2str(tempbuf); - break; - default: - pushAll(textrun, tempbuf); - break; - } - reconsume(c, return_state); - } - - /*** - * The tree builder insertion modes - */ - - // 11.2.5.4.1 The "initial" insertion mode - function initial_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - value = value.replace(LEADINGWS, ""); // Ignore spaces - if (value.length === 0) return; // Are we done? - break; // Handle anything non-space text below - case 4: // COMMENT - doc._appendChild(doc.createComment(value)); - return; - case 5: // DOCTYPE - var name = value; - var publicid = arg3; - var systemid = arg4; - // Use the constructor directly instead of - // implementation.createDocumentType because the create - // function throws errors on invalid characters, and - // we don't want the parser to throw them. - doc.appendChild(new DocumentType(doc, name, publicid, systemid)); - - // Note that there is no public API for setting quirks mode We can - // do this here because we have access to implementation details - if (force_quirks || - name.toLowerCase() !== "html" || - quirkyPublicIds.test(publicid) || - (systemid && systemid.toLowerCase() === quirkySystemId) || - (systemid === undefined && - conditionallyQuirkyPublicIds.test(publicid))) - doc._quirks = true; - else if (limitedQuirkyPublicIds.test(publicid) || - (systemid !== undefined && - conditionallyQuirkyPublicIds.test(publicid))) - doc._limitedQuirks = true; - parser = before_html_mode; - return; - } - - // tags or non-whitespace text - doc._quirks = true; - parser = before_html_mode; - parser(t,value,arg3,arg4); - } - - // 11.2.5.4.2 The "before html" insertion mode - function before_html_mode(t,value,arg3,arg4) { - var elt; - switch(t) { - case 1: // TEXT - value = value.replace(LEADINGWS, ""); // Ignore spaces - if (value.length === 0) return; // Are we done? - break; // Handle anything non-space text below - case 5: // DOCTYPE - /* ignore the token */ - return; - case 4: // COMMENT - doc._appendChild(doc.createComment(value)); - return; - case 2: // TAG - if (value === "html") { - elt = createHTMLElt(doc, value, arg3); - stack.push(elt); - doc.appendChild(elt); - // XXX: handle application cache here - parser = before_head_mode; - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "html": - case "head": - case "body": - case "br": - break; // fall through on these - default: - return; // ignore most end tags - } - } - - // Anything that didn't get handled above is handled like this: - elt = createHTMLElt(doc, "html", null); - stack.push(elt); - doc.appendChild(elt); - // XXX: handle application cache here - parser = before_head_mode; - parser(t,value,arg3,arg4); - } - - // 11.2.5.4.3 The "before head" insertion mode - function before_head_mode(t,value,arg3,arg4) { - switch(t) { - case 1: // TEXT - value = value.replace(LEADINGWS, ""); // Ignore spaces - if (value.length === 0) return; // Are we done? - break; // Handle anything non-space text below - case 5: // DOCTYPE - /* ignore the token */ - return; - case 4: // COMMENT - insertComment(value); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t,value,arg3,arg4); - return; - case "head": - var elt = insertHTMLElement(value, arg3); - head_element_pointer = elt; - parser = in_head_mode; - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "html": - case "head": - case "body": - case "br": - break; - default: - return; // ignore most end tags - } - } - - // If not handled explicitly above - before_head_mode(TAG, "head", null); // create a head tag - parser(t, value, arg3, arg4); // then try again with this token - } - - function in_head_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - var ws = value.match(LEADINGWS); - if (ws) { - insertText(ws[0]); - value = value.substring(ws[0].length); - } - if (value.length === 0) return; - break; // Handle non-whitespace below - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "meta": - // XXX: - // May need to change the encoding based on this tag - /* falls through */ - case "base": - case "basefont": - case "bgsound": - case "link": - insertHTMLElement(value, arg3); - stack.pop(); - return; - case "title": - parseRCDATA(value, arg3); - return; - case "noscript": - if (!scripting_enabled) { - insertHTMLElement(value, arg3); - parser = in_head_noscript_mode; - return; - } - // Otherwise, if scripting is enabled... - /* falls through */ - case "noframes": - case "style": - parseRawText(value,arg3); - return; - case "script": - insertElement(function(doc) { - var elt = createHTMLElt(doc, value, arg3); - elt._parser_inserted = true; - elt._force_async = false; - if (fragment) elt._already_started = true; - flushText(); - return elt; - }); - tokenizer = script_data_state; - originalInsertionMode = parser; - parser = text_mode; - return; - case "template": - insertHTMLElement(value, arg3); - afe.insertMarker(); - frameset_ok = false; - parser = in_template_mode; - templateInsertionModes.push(parser); - return; - case "head": - return; // ignore it - } - break; - case 3: // ENDTAG - switch(value) { - case "head": - stack.pop(); - parser = after_head_mode; - return; - case "body": - case "html": - case "br": - break; // handle these at the bottom of the function - case "template": - if (!stack.contains("template")) { - return; - } - stack.generateImpliedEndTags(null, "thorough"); - stack.popTag("template"); - afe.clearToMarker(); - templateInsertionModes.pop(); - resetInsertionMode(); - return; - default: - // ignore any other end tag - return; - } - break; - } - - // If not handled above - in_head_mode(ENDTAG, "head", null); // synthetic - parser(t, value, arg3, arg4); // Then redo this one - } - - // 13.2.5.4.5 The "in head noscript" insertion mode - function in_head_noscript_mode(t, value, arg3, arg4) { - switch(t) { - case 5: // DOCTYPE - return; - case 4: // COMMENT - in_head_mode(t, value); - return; - case 1: // TEXT - var ws = value.match(LEADINGWS); - if (ws) { - in_head_mode(t, ws[0]); - value = value.substring(ws[0].length); - } - if (value.length === 0) return; // no more text - break; // Handle non-whitespace below - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "basefont": - case "bgsound": - case "link": - case "meta": - case "noframes": - case "style": - in_head_mode(t, value, arg3); - return; - case "head": - case "noscript": - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "noscript": - stack.pop(); - parser = in_head_mode; - return; - case "br": - break; // goes to the outer default - default: - return; // ignore other end tags - } - break; - } - - // If not handled above - in_head_noscript_mode(ENDTAG, "noscript", null); - parser(t, value, arg3, arg4); - } - - function after_head_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - var ws = value.match(LEADINGWS); - if (ws) { - insertText(ws[0]); - value = value.substring(ws[0].length); - } - if (value.length === 0) return; - break; // Handle non-whitespace below - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "body": - insertHTMLElement(value, arg3); - frameset_ok = false; - parser = in_body_mode; - return; - case "frameset": - insertHTMLElement(value, arg3); - parser = in_frameset_mode; - return; - case "base": - case "basefont": - case "bgsound": - case "link": - case "meta": - case "noframes": - case "script": - case "style": - case "template": - case "title": - stack.push(head_element_pointer); - in_head_mode(TAG, value, arg3); - stack.removeElement(head_element_pointer); - return; - case "head": - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "template": - return in_head_mode(t, value, arg3, arg4); - case "body": - case "html": - case "br": - break; - default: - return; // ignore any other end tag - } - break; - } - - after_head_mode(TAG, "body", null); - frameset_ok = true; - parser(t, value, arg3, arg4); - } - - // 13.2.5.4.7 The "in body" insertion mode - function in_body_mode(t,value,arg3,arg4) { - var body, i, node, elt; - switch(t) { - case 1: // TEXT - if (textIncludesNUL) { - value = value.replace(NULCHARS, ""); - if (value.length === 0) return; - } - // If any non-space characters - if (frameset_ok && NONWS.test(value)) - frameset_ok = false; - afereconstruct(); - insertText(value); - return; - case 5: // DOCTYPE - return; - case 4: // COMMENT - insertComment(value); - return; - case -1: // EOF - if (templateInsertionModes.length) { - return in_template_mode(t); - } - stopParsing(); - return; - case 2: // TAG - switch(value) { - case "html": - if (stack.contains("template")) { - return; - } - transferAttributes(arg3, stack.elements[0]); - return; - case "base": - case "basefont": - case "bgsound": - case "link": - case "meta": - case "noframes": - case "script": - case "style": - case "template": - case "title": - in_head_mode(TAG, value, arg3); - return; - case "body": - body = stack.elements[1]; - if (!body || !(body instanceof impl.HTMLBodyElement) || - stack.contains("template")) - return; - frameset_ok = false; - transferAttributes(arg3, body); - return; - case "frameset": - if (!frameset_ok) return; - body = stack.elements[1]; - if (!body || !(body instanceof impl.HTMLBodyElement)) - return; - if (body.parentNode) body.parentNode.removeChild(body); - while(!(stack.top instanceof impl.HTMLHtmlElement)) - stack.pop(); - insertHTMLElement(value, arg3); - parser = in_frameset_mode; - return; - - case "address": - case "article": - case "aside": - case "blockquote": - case "center": - case "details": - case "dialog": - case "dir": - case "div": - case "dl": - case "fieldset": - case "figcaption": - case "figure": - case "footer": - case "header": - case "hgroup": - case "main": - case "nav": - case "ol": - case "p": - case "section": - case "summary": - case "ul": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - return; - - case "menu": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - if (isA(stack.top, 'menuitem')) { - stack.pop(); - } - insertHTMLElement(value, arg3); - return; - - case "h1": - case "h2": - case "h3": - case "h4": - case "h5": - case "h6": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - if (stack.top instanceof impl.HTMLHeadingElement) - stack.pop(); - insertHTMLElement(value, arg3); - return; - - case "pre": - case "listing": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - ignore_linefeed = true; - frameset_ok = false; - return; - - case "form": - if (form_element_pointer && !stack.contains("template")) return; - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - elt = insertHTMLElement(value, arg3); - if (!stack.contains("template")) - form_element_pointer = elt; - return; - - case "li": - frameset_ok = false; - for(i = stack.elements.length-1; i >= 0; i--) { - node = stack.elements[i]; - if (node instanceof impl.HTMLLIElement) { - in_body_mode(ENDTAG, "li"); - break; - } - if (isA(node, specialSet) && !isA(node, addressdivpSet)) - break; - } - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - return; - - case "dd": - case "dt": - frameset_ok = false; - for(i = stack.elements.length-1; i >= 0; i--) { - node = stack.elements[i]; - if (isA(node, dddtSet)) { - in_body_mode(ENDTAG, node.localName); - break; - } - if (isA(node, specialSet) && !isA(node, addressdivpSet)) - break; - } - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - return; - - case "plaintext": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - insertHTMLElement(value, arg3); - tokenizer = plaintext_state; - return; - - case "button": - if (stack.inScope("button")) { - in_body_mode(ENDTAG, "button"); - parser(t, value, arg3, arg4); - } - else { - afereconstruct(); - insertHTMLElement(value, arg3); - frameset_ok = false; - } - return; - - case "a": - var activeElement = afe.findElementByTag("a"); - if (activeElement) { - in_body_mode(ENDTAG, value); - afe.remove(activeElement); - stack.removeElement(activeElement); - } - /* falls through */ - case "b": - case "big": - case "code": - case "em": - case "font": - case "i": - case "s": - case "small": - case "strike": - case "strong": - case "tt": - case "u": - afereconstruct(); - afe.push(insertHTMLElement(value,arg3), arg3); - return; - - case "nobr": - afereconstruct(); - - if (stack.inScope(value)) { - in_body_mode(ENDTAG, value); - afereconstruct(); - } - afe.push(insertHTMLElement(value,arg3), arg3); - return; - - case "applet": - case "marquee": - case "object": - afereconstruct(); - insertHTMLElement(value,arg3); - afe.insertMarker(); - frameset_ok = false; - return; - - case "table": - if (!doc._quirks && stack.inButtonScope("p")) { - in_body_mode(ENDTAG, "p"); - } - insertHTMLElement(value,arg3); - frameset_ok = false; - parser = in_table_mode; - return; - - case "area": - case "br": - case "embed": - case "img": - case "keygen": - case "wbr": - afereconstruct(); - insertHTMLElement(value,arg3); - stack.pop(); - frameset_ok = false; - return; - - case "input": - afereconstruct(); - elt = insertHTMLElement(value,arg3); - stack.pop(); - var type = elt.getAttribute("type"); - if (!type || type.toLowerCase() !== "hidden") - frameset_ok = false; - return; - - case "param": - case "source": - case "track": - insertHTMLElement(value,arg3); - stack.pop(); - return; - - case "hr": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - if (isA(stack.top, 'menuitem')) { - stack.pop(); - } - insertHTMLElement(value,arg3); - stack.pop(); - frameset_ok = false; - return; - - case "image": - in_body_mode(TAG, "img", arg3, arg4); - return; - - case "textarea": - insertHTMLElement(value,arg3); - ignore_linefeed = true; - frameset_ok = false; - tokenizer = rcdata_state; - originalInsertionMode = parser; - parser = text_mode; - return; - - case "xmp": - if (stack.inButtonScope("p")) in_body_mode(ENDTAG, "p"); - afereconstruct(); - frameset_ok = false; - parseRawText(value, arg3); - return; - - case "iframe": - frameset_ok = false; - parseRawText(value, arg3); - return; - - case "noembed": - parseRawText(value,arg3); - return; - - case "select": - afereconstruct(); - insertHTMLElement(value,arg3); - frameset_ok = false; - if (parser === in_table_mode || - parser === in_caption_mode || - parser === in_table_body_mode || - parser === in_row_mode || - parser === in_cell_mode) - parser = in_select_in_table_mode; - else - parser = in_select_mode; - return; - - case "optgroup": - case "option": - if (stack.top instanceof impl.HTMLOptionElement) { - in_body_mode(ENDTAG, "option"); - } - afereconstruct(); - insertHTMLElement(value,arg3); - return; - - case "menuitem": - if (isA(stack.top, 'menuitem')) { - stack.pop(); - } - afereconstruct(); - insertHTMLElement(value, arg3); - return; - - case "rb": - case "rtc": - if (stack.inScope("ruby")) { - stack.generateImpliedEndTags(); - } - insertHTMLElement(value,arg3); - return; - - case "rp": - case "rt": - if (stack.inScope("ruby")) { - stack.generateImpliedEndTags("rtc"); - } - insertHTMLElement(value,arg3); - return; - - case "math": - afereconstruct(); - adjustMathMLAttributes(arg3); - adjustForeignAttributes(arg3); - insertForeignElement(value, arg3, NAMESPACE.MATHML); - if (arg4) // self-closing flag - stack.pop(); - return; - - case "svg": - afereconstruct(); - adjustSVGAttributes(arg3); - adjustForeignAttributes(arg3); - insertForeignElement(value, arg3, NAMESPACE.SVG); - if (arg4) // self-closing flag - stack.pop(); - return; - - case "caption": - case "col": - case "colgroup": - case "frame": - case "head": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - // Ignore table tags if we're not in_table mode - return; - } - - // Handle any other start tag here - // (and also noscript tags when scripting is disabled) - afereconstruct(); - insertHTMLElement(value,arg3); - return; - - case 3: // ENDTAG - switch(value) { - case "template": - in_head_mode(ENDTAG, value, arg3); - return; - case "body": - if (!stack.inScope("body")) return; - parser = after_body_mode; - return; - case "html": - if (!stack.inScope("body")) return; - parser = after_body_mode; - parser(t, value, arg3); - return; - - case "address": - case "article": - case "aside": - case "blockquote": - case "button": - case "center": - case "details": - case "dialog": - case "dir": - case "div": - case "dl": - case "fieldset": - case "figcaption": - case "figure": - case "footer": - case "header": - case "hgroup": - case "listing": - case "main": - case "menu": - case "nav": - case "ol": - case "pre": - case "section": - case "summary": - case "ul": - // Ignore if there is not a matching open tag - if (!stack.inScope(value)) return; - stack.generateImpliedEndTags(); - stack.popTag(value); - return; - - case "form": - if (!stack.contains("template")) { - var openform = form_element_pointer; - form_element_pointer = null; - if (!openform || !stack.elementInScope(openform)) return; - stack.generateImpliedEndTags(); - stack.removeElement(openform); - } else { - if (!stack.inScope("form")) return; - stack.generateImpliedEndTags(); - stack.popTag("form"); - } - return; - - case "p": - if (!stack.inButtonScope(value)) { - in_body_mode(TAG, value, null); - parser(t, value, arg3, arg4); - } - else { - stack.generateImpliedEndTags(value); - stack.popTag(value); - } - return; - - case "li": - if (!stack.inListItemScope(value)) return; - stack.generateImpliedEndTags(value); - stack.popTag(value); - return; - - case "dd": - case "dt": - if (!stack.inScope(value)) return; - stack.generateImpliedEndTags(value); - stack.popTag(value); - return; - - case "h1": - case "h2": - case "h3": - case "h4": - case "h5": - case "h6": - if (!stack.elementTypeInScope(impl.HTMLHeadingElement)) return; - stack.generateImpliedEndTags(); - stack.popElementType(impl.HTMLHeadingElement); - return; - - case "sarcasm": - // Take a deep breath, and then: - break; - - case "a": - case "b": - case "big": - case "code": - case "em": - case "font": - case "i": - case "nobr": - case "s": - case "small": - case "strike": - case "strong": - case "tt": - case "u": - var result = adoptionAgency(value); - if (result) return; // If we did something we're done - break; // Go to the "any other end tag" case - - case "applet": - case "marquee": - case "object": - if (!stack.inScope(value)) return; - stack.generateImpliedEndTags(); - stack.popTag(value); - afe.clearToMarker(); - return; - - case "br": - in_body_mode(TAG, value, null); // Turn
    into
    - return; - } - - // Any other end tag goes here - for(i = stack.elements.length-1; i >= 0; i--) { - node = stack.elements[i]; - if (isA(node, value)) { - stack.generateImpliedEndTags(value); - stack.popElement(node); - break; - } - else if (isA(node, specialSet)) { - return; - } - } - - return; - } - } - - function text_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - insertText(value); - return; - case -1: // EOF - if (stack.top instanceof impl.HTMLScriptElement) - stack.top._already_started = true; - stack.pop(); - parser = originalInsertionMode; - parser(t); - return; - case 3: // ENDTAG - if (value === "script") { - handleScriptEnd(); - } - else { - stack.pop(); - parser = originalInsertionMode; - } - return; - default: - // We should never get any other token types - return; - } - } - - function in_table_mode(t, value, arg3, arg4) { - function getTypeAttr(attrs) { - for(var i = 0, n = attrs.length; i < n; i++) { - if (attrs[i][0] === "type") - return attrs[i][1].toLowerCase(); - } - return null; - } - - switch(t) { - case 1: // TEXT - // XXX the text_integration_mode stuff is - // just a hack I made up - if (text_integration_mode) { - in_body_mode(t, value, arg3, arg4); - return; - } - else if (isA(stack.top, tablesectionrowSet)) { - pending_table_text = []; - originalInsertionMode = parser; - parser = in_table_text_mode; - parser(t, value, arg3, arg4); - return; - } - break; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case 2: // TAG - switch(value) { - case "caption": - stack.clearToContext(tableContextSet); - afe.insertMarker(); - insertHTMLElement(value,arg3); - parser = in_caption_mode; - return; - case "colgroup": - stack.clearToContext(tableContextSet); - insertHTMLElement(value,arg3); - parser = in_column_group_mode; - return; - case "col": - in_table_mode(TAG, "colgroup", null); - parser(t, value, arg3, arg4); - return; - case "tbody": - case "tfoot": - case "thead": - stack.clearToContext(tableContextSet); - insertHTMLElement(value,arg3); - parser = in_table_body_mode; - return; - case "td": - case "th": - case "tr": - in_table_mode(TAG, "tbody", null); - parser(t, value, arg3, arg4); - return; - - case "table": - if (!stack.inTableScope(value)) { - return; // Ignore the token - } - in_table_mode(ENDTAG, value); - parser(t, value, arg3, arg4); - return; - - case "style": - case "script": - case "template": - in_head_mode(t, value, arg3, arg4); - return; - - case "input": - var type = getTypeAttr(arg3); - if (type !== "hidden") break; // to the anything else case - insertHTMLElement(value,arg3); - stack.pop(); - return; - - case "form": - if (form_element_pointer || stack.contains("template")) return; - form_element_pointer = insertHTMLElement(value, arg3); - stack.popElement(form_element_pointer); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "table": - if (!stack.inTableScope(value)) return; - stack.popTag(value); - resetInsertionMode(); - return; - case "body": - case "caption": - case "col": - case "colgroup": - case "html": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - return; - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - - break; - case -1: // EOF - in_body_mode(t, value, arg3, arg4); - return; - } - - // This is the anything else case - foster_parent_mode = true; - in_body_mode(t, value, arg3, arg4); - foster_parent_mode = false; - } - - function in_table_text_mode(t, value, arg3, arg4) { - if (t === TEXT) { - if (textIncludesNUL) { - value = value.replace(NULCHARS, ""); - if (value.length === 0) return; - } - pending_table_text.push(value); - } - else { - var s = pending_table_text.join(""); - pending_table_text.length = 0; - if (NONWS.test(s)) { // If any non-whitespace characters - // This must be the same code as the "anything else" - // case of the in_table mode above. - foster_parent_mode = true; - in_body_mode(TEXT, s); - foster_parent_mode = false; - } - else { - insertText(s); - } - parser = originalInsertionMode; - parser(t, value, arg3, arg4); - } - } - - - function in_caption_mode(t, value, arg3, arg4) { - function end_caption() { - if (!stack.inTableScope("caption")) return false; - stack.generateImpliedEndTags(); - stack.popTag("caption"); - afe.clearToMarker(); - parser = in_table_mode; - return true; - } - - switch(t) { - case 2: // TAG - switch(value) { - case "caption": - case "col": - case "colgroup": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - if (end_caption()) parser(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "caption": - end_caption(); - return; - case "table": - if (end_caption()) parser(t, value, arg3, arg4); - return; - case "body": - case "col": - case "colgroup": - case "html": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - return; - } - break; - } - - // The Anything Else case - in_body_mode(t, value, arg3, arg4); - } - - function in_column_group_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - var ws = value.match(LEADINGWS); - if (ws) { - insertText(ws[0]); - value = value.substring(ws[0].length); - } - if (value.length === 0) return; - break; // Handle non-whitespace below - - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "col": - insertHTMLElement(value, arg3); - stack.pop(); - return; - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "colgroup": - if (!isA(stack.top, 'colgroup')) { - return; // Ignore the token. - } - stack.pop(); - parser = in_table_mode; - return; - case "col": - return; - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case -1: // EOF - in_body_mode(t, value, arg3, arg4); - return; - } - - // Anything else - if (!isA(stack.top, 'colgroup')) { - return; // Ignore the token. - } - in_column_group_mode(ENDTAG, "colgroup"); - parser(t, value, arg3, arg4); - } - - function in_table_body_mode(t, value, arg3, arg4) { - function endsect() { - if (!stack.inTableScope("tbody") && - !stack.inTableScope("thead") && - !stack.inTableScope("tfoot")) - return; - stack.clearToContext(tableBodyContextSet); - in_table_body_mode(ENDTAG, stack.top.localName, null); - parser(t, value, arg3, arg4); - } - - switch(t) { - case 2: // TAG - switch(value) { - case "tr": - stack.clearToContext(tableBodyContextSet); - insertHTMLElement(value, arg3); - parser = in_row_mode; - return; - case "th": - case "td": - in_table_body_mode(TAG, "tr", null); - parser(t, value, arg3, arg4); - return; - case "caption": - case "col": - case "colgroup": - case "tbody": - case "tfoot": - case "thead": - endsect(); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "table": - endsect(); - return; - case "tbody": - case "tfoot": - case "thead": - if (stack.inTableScope(value)) { - stack.clearToContext(tableBodyContextSet); - stack.pop(); - parser = in_table_mode; - } - return; - case "body": - case "caption": - case "col": - case "colgroup": - case "html": - case "td": - case "th": - case "tr": - return; - } - break; - } - - // Anything else: - in_table_mode(t, value, arg3, arg4); - } - - function in_row_mode(t, value, arg3, arg4) { - function endrow() { - if (!stack.inTableScope("tr")) return false; - stack.clearToContext(tableRowContextSet); - stack.pop(); - parser = in_table_body_mode; - return true; - } - - switch(t) { - case 2: // TAG - switch(value) { - case "th": - case "td": - stack.clearToContext(tableRowContextSet); - insertHTMLElement(value, arg3); - parser = in_cell_mode; - afe.insertMarker(); - return; - case "caption": - case "col": - case "colgroup": - case "tbody": - case "tfoot": - case "thead": - case "tr": - if (endrow()) parser(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "tr": - endrow(); - return; - case "table": - if (endrow()) parser(t, value, arg3, arg4); - return; - case "tbody": - case "tfoot": - case "thead": - if (stack.inTableScope(value)) { - if (endrow()) parser(t, value, arg3, arg4); - } - return; - case "body": - case "caption": - case "col": - case "colgroup": - case "html": - case "td": - case "th": - return; - } - break; - } - - // anything else - in_table_mode(t, value, arg3, arg4); - } - - function in_cell_mode(t, value, arg3, arg4) { - switch(t) { - case 2: // TAG - switch(value) { - case "caption": - case "col": - case "colgroup": - case "tbody": - case "td": - case "tfoot": - case "th": - case "thead": - case "tr": - if (stack.inTableScope("td")) { - in_cell_mode(ENDTAG, "td"); - parser(t, value, arg3, arg4); - } - else if (stack.inTableScope("th")) { - in_cell_mode(ENDTAG, "th"); - parser(t, value, arg3, arg4); - } - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "td": - case "th": - if (!stack.inTableScope(value)) return; - stack.generateImpliedEndTags(); - stack.popTag(value); - afe.clearToMarker(); - parser = in_row_mode; - return; - - case "body": - case "caption": - case "col": - case "colgroup": - case "html": - return; - - case "table": - case "tbody": - case "tfoot": - case "thead": - case "tr": - if (!stack.inTableScope(value)) return; - in_cell_mode(ENDTAG, stack.inTableScope("td") ? "td" : "th"); - parser(t, value, arg3, arg4); - return; - } - break; - } - - // anything else - in_body_mode(t, value, arg3, arg4); - } - - function in_select_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - if (textIncludesNUL) { - value = value.replace(NULCHARS, ""); - if (value.length === 0) return; - } - insertText(value); - return; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case -1: // EOF - in_body_mode(t, value, arg3, arg4); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "option": - if (stack.top instanceof impl.HTMLOptionElement) - in_select_mode(ENDTAG, value); - insertHTMLElement(value, arg3); - return; - case "optgroup": - if (stack.top instanceof impl.HTMLOptionElement) - in_select_mode(ENDTAG, "option"); - if (stack.top instanceof impl.HTMLOptGroupElement) - in_select_mode(ENDTAG, value); - insertHTMLElement(value, arg3); - return; - case "select": - in_select_mode(ENDTAG, value); // treat it as a close tag - return; - - case "input": - case "keygen": - case "textarea": - if (!stack.inSelectScope("select")) return; - in_select_mode(ENDTAG, "select"); - parser(t, value, arg3, arg4); - return; - - case "script": - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - switch(value) { - case "optgroup": - if (stack.top instanceof impl.HTMLOptionElement && - stack.elements[stack.elements.length-2] instanceof - impl.HTMLOptGroupElement) { - in_select_mode(ENDTAG, "option"); - } - if (stack.top instanceof impl.HTMLOptGroupElement) - stack.pop(); - - return; - - case "option": - if (stack.top instanceof impl.HTMLOptionElement) - stack.pop(); - return; - - case "select": - if (!stack.inSelectScope(value)) return; - stack.popTag(value); - resetInsertionMode(); - return; - - case "template": - in_head_mode(t, value, arg3, arg4); - return; - } - - break; - } - - // anything else: just ignore the token - } - - function in_select_in_table_mode(t, value, arg3, arg4) { - switch(value) { - case "caption": - case "table": - case "tbody": - case "tfoot": - case "thead": - case "tr": - case "td": - case "th": - switch(t) { - case 2: // TAG - in_select_in_table_mode(ENDTAG, "select"); - parser(t, value, arg3, arg4); - return; - case 3: // ENDTAG - if (stack.inTableScope(value)) { - in_select_in_table_mode(ENDTAG, "select"); - parser(t, value, arg3, arg4); - } - return; - } - } - - // anything else - in_select_mode(t, value, arg3, arg4); - } - - function in_template_mode(t, value, arg3, arg4) { - function switchModeAndReprocess(mode) { - parser = mode; - templateInsertionModes[templateInsertionModes.length-1] = parser; - parser(t, value, arg3, arg4); - } - switch(t) { - case 1: // TEXT - case 4: // COMMENT - case 5: // DOCTYPE - in_body_mode(t, value, arg3, arg4); - return; - case -1: // EOF - if (!stack.contains("template")) { - stopParsing(); - } else { - stack.popTag("template"); - afe.clearToMarker(); - templateInsertionModes.pop(); - resetInsertionMode(); - parser(t, value, arg3, arg4); - } - return; - case 2: // TAG - switch(value) { - case "base": - case "basefont": - case "bgsound": - case "link": - case "meta": - case "noframes": - case "script": - case "style": - case "template": - case "title": - in_head_mode(t, value, arg3, arg4); - return; - case "caption": - case "colgroup": - case "tbody": - case "tfoot": - case "thead": - switchModeAndReprocess(in_table_mode); - return; - case "col": - switchModeAndReprocess(in_column_group_mode); - return; - case "tr": - switchModeAndReprocess(in_table_body_mode); - return; - case "td": - case "th": - switchModeAndReprocess(in_row_mode); - return; - } - switchModeAndReprocess(in_body_mode); - return; - case 3: // ENDTAG - switch(value) { - case "template": - in_head_mode(t, value, arg3, arg4); - return; - default: - return; - } - } - } - - function after_body_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // If any non-space chars, handle below - if (NONWS.test(value)) break; - in_body_mode(t, value); - return; - case 4: // COMMENT - // Append it to the element - stack.elements[0]._appendChild(doc.createComment(value)); - return; - case 5: // DOCTYPE - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - if (value === "html") { - in_body_mode(t, value, arg3, arg4); - return; - } - break; // for any other tags - case 3: // ENDTAG - if (value === "html") { - if (fragment) return; - parser = after_after_body_mode; - return; - } - break; // for any other tags - } - - // anything else - parser = in_body_mode; - parser(t, value, arg3, arg4); - } - - function in_frameset_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // Ignore any non-space characters - value = value.replace(ALLNONWS, ""); - if (value.length > 0) insertText(value); - return; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "frameset": - insertHTMLElement(value, arg3); - return; - case "frame": - insertHTMLElement(value, arg3); - stack.pop(); - return; - case "noframes": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - if (value === "frameset") { - if (fragment && stack.top instanceof impl.HTMLHtmlElement) - return; - stack.pop(); - if (!fragment && - !(stack.top instanceof impl.HTMLFrameSetElement)) - parser = after_frameset_mode; - return; - } - break; - } - - // ignore anything else - } - - function after_frameset_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // Ignore any non-space characters - value = value.replace(ALLNONWS, ""); - if (value.length > 0) insertText(value); - return; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "noframes": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - case 3: // ENDTAG - if (value === "html") { - parser = after_after_frameset_mode; - return; - } - break; - } - - // ignore anything else - } - - function after_after_body_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // If any non-space chars, handle below - if (NONWS.test(value)) break; - in_body_mode(t, value, arg3, arg4); - return; - case 4: // COMMENT - doc._appendChild(doc.createComment(value)); - return; - case 5: // DOCTYPE - in_body_mode(t, value, arg3, arg4); - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - if (value === "html") { - in_body_mode(t, value, arg3, arg4); - return; - } - break; - } - - // anything else - parser = in_body_mode; - parser(t, value, arg3, arg4); - } - - function after_after_frameset_mode(t, value, arg3, arg4) { - switch(t) { - case 1: // TEXT - // Ignore any non-space characters - value = value.replace(ALLNONWS, ""); - if (value.length > 0) - in_body_mode(t, value, arg3, arg4); - return; - case 4: // COMMENT - doc._appendChild(doc.createComment(value)); - return; - case 5: // DOCTYPE - in_body_mode(t, value, arg3, arg4); - return; - case -1: // EOF - stopParsing(); - return; - case 2: // TAG - switch(value) { - case "html": - in_body_mode(t, value, arg3, arg4); - return; - case "noframes": - in_head_mode(t, value, arg3, arg4); - return; - } - break; - } - - // ignore anything else - } - - - // 13.2.5.5 The rules for parsing tokens in foreign content - // - // This is like one of the insertion modes above, but is - // invoked somewhat differently when the current token is not HTML. - // See the insertToken() function. - function insertForeignToken(t, value, arg3, arg4) { - // A tag is an HTML font tag if it has a color, font, or size - // attribute. Otherwise we assume it is foreign content - function isHTMLFont(attrs) { - for(var i = 0, n = attrs.length; i < n; i++) { - switch(attrs[i][0]) { - case "color": - case "face": - case "size": - return true; - } - } - return false; - } - - var current; - - switch(t) { - case 1: // TEXT - // If any non-space, non-nul characters - if (frameset_ok && NONWSNONNUL.test(value)) - frameset_ok = false; - if (textIncludesNUL) { - value = value.replace(NULCHARS, "\uFFFD"); - } - insertText(value); - return; - case 4: // COMMENT - insertComment(value); - return; - case 5: // DOCTYPE - // ignore it - return; - case 2: // TAG - switch(value) { - case "font": - if (!isHTMLFont(arg3)) break; - /* falls through */ - case "b": - case "big": - case "blockquote": - case "body": - case "br": - case "center": - case "code": - case "dd": - case "div": - case "dl": - case "dt": - case "em": - case "embed": - case "h1": - case "h2": - case "h3": - case "h4": - case "h5": - case "h6": - case "head": - case "hr": - case "i": - case "img": - case "li": - case "listing": - case "menu": - case "meta": - case "nobr": - case "ol": - case "p": - case "pre": - case "ruby": - case "s": - case "small": - case "span": - case "strong": - case "strike": - case "sub": - case "sup": - case "table": - case "tt": - case "u": - case "ul": - case "var": - if (fragment) { - break; - } - do { - stack.pop(); - current = stack.top; - } while(current.namespaceURI !== NAMESPACE.HTML && - !isMathmlTextIntegrationPoint(current) && - !isHTMLIntegrationPoint(current)); - - insertToken(t, value, arg3, arg4); // reprocess - return; - } - - // Any other start tag case goes here - current = (stack.elements.length===1 && fragment) ? fragmentContext : - stack.top; - if (current.namespaceURI === NAMESPACE.MATHML) { - adjustMathMLAttributes(arg3); - } - else if (current.namespaceURI === NAMESPACE.SVG) { - value = adjustSVGTagName(value); - adjustSVGAttributes(arg3); - } - adjustForeignAttributes(arg3); - - insertForeignElement(value, arg3, current.namespaceURI); - if (arg4) { // the self-closing flag - if (value === 'script' && current.namespaceURI === NAMESPACE.SVG) { - // XXX deal with SVG scripts here - } - stack.pop(); - } - return; - - case 3: // ENDTAG - current = stack.top; - if (value === "script" && - current.namespaceURI === NAMESPACE.SVG && - current.localName === "script") { - - stack.pop(); - - // XXX - // Deal with SVG scripts here - } - else { - // The any other end tag case - var i = stack.elements.length-1; - var node = stack.elements[i]; - for(;;) { - if (node.localName.toLowerCase() === value) { - stack.popElement(node); - break; - } - node = stack.elements[--i]; - // If non-html, keep looping - if (node.namespaceURI !== NAMESPACE.HTML) - continue; - // Otherwise process the end tag as html - parser(t, value, arg3, arg4); - break; - } - } - return; - } - } - - /*** - * Finally, this is the end of the HTMLParser() factory function. - * It returns the htmlparser object with the append() and end() methods. - */ - - // Sneak another method into the htmlparser object to allow us to run - // tokenizer tests. This can be commented out in production code. - // This is a hook for testing the tokenizer. It has to be here - // because the tokenizer details are all hidden away within the closure. - // It should return an array of tokens generated while parsing the - // input string. - htmlparser.testTokenizer = function(input, initialState, lastStartTag, charbychar) { - var tokens = []; - - switch(initialState) { - case "PCDATA state": - tokenizer = data_state; - break; - case "RCDATA state": - tokenizer = rcdata_state; - break; - case "RAWTEXT state": - tokenizer = rawtext_state; - break; - case "PLAINTEXT state": - tokenizer = plaintext_state; - break; - } - - if (lastStartTag) { - lasttagname = lastStartTag; - } - - insertToken = function(t, value, arg3, arg4) { - flushText(); - switch(t) { - case 1: // TEXT - if (tokens.length > 0 && - tokens[tokens.length-1][0] === "Character") { - tokens[tokens.length-1][1] += value; - } - else tokens.push(["Character", value]); - break; - case 4: // COMMENT - tokens.push(["Comment", value]); - break; - case 5: // DOCTYPE - tokens.push(["DOCTYPE", value, - arg3 === undefined ? null : arg3, - arg4 === undefined ? null : arg4, - !force_quirks]); - break; - case 2: // TAG - var attrs = Object.create(null); - for(var i = 0; i < arg3.length; i++) { - // XXX: does attribute order matter? - var a = arg3[i]; - if (a.length === 1) { - attrs[a[0]] = ""; - } - else { - attrs[a[0]] = a[1]; - } - } - var token = ["StartTag", value, attrs]; - if (arg4) token.push(true); - tokens.push(token); - break; - case 3: // ENDTAG - tokens.push(["EndTag", value]); - break; - case -1: // EOF - break; - } - }; - - if (!charbychar) { - this.parse(input, true); - } - else { - for(var i = 0; i < input.length; i++) { - this.parse(input[i]); - } - this.parse("", true); - } - return tokens; - }; - - // Return the parser object from the HTMLParser() factory function - return htmlparser; -} - - -/***/ }), - -/***/ 8161: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = Leaf; - -var Node = __webpack_require__(97537); -var NodeList = __webpack_require__(64965); -var utils = __webpack_require__(89076); -var HierarchyRequestError = utils.HierarchyRequestError; -var NotFoundError = utils.NotFoundError; - -// This class defines common functionality for node subtypes that -// can never have children -function Leaf() { - Node.call(this); -} - -Leaf.prototype = Object.create(Node.prototype, { - hasChildNodes: { value: function() { return false; }}, - firstChild: { value: null }, - lastChild: { value: null }, - insertBefore: { value: function(node, child) { - if (!node.nodeType) throw new TypeError('not a node'); - HierarchyRequestError(); - }}, - replaceChild: { value: function(node, child) { - if (!node.nodeType) throw new TypeError('not a node'); - HierarchyRequestError(); - }}, - removeChild: { value: function(node) { - if (!node.nodeType) throw new TypeError('not a node'); - NotFoundError(); - }}, - removeChildren: { value: function() { /* no op */ }}, - childNodes: { get: function() { - if (!this._childNodes) this._childNodes = new NodeList(); - return this._childNodes; - }} -}); - - -/***/ }), - -/***/ 41360: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var utils = __webpack_require__(89076); - -var LinkedList = module.exports = { - // basic validity tests on a circular linked list a - valid: function(a) { - utils.assert(a, "list falsy"); - utils.assert(a._previousSibling, "previous falsy"); - utils.assert(a._nextSibling, "next falsy"); - // xxx check that list is actually circular - return true; - }, - // insert a before b - insertBefore: function(a, b) { - utils.assert(LinkedList.valid(a) && LinkedList.valid(b)); - var a_first = a, a_last = a._previousSibling; - var b_first = b, b_last = b._previousSibling; - a_first._previousSibling = b_last; - a_last._nextSibling = b_first; - b_last._nextSibling = a_first; - b_first._previousSibling = a_last; - utils.assert(LinkedList.valid(a) && LinkedList.valid(b)); - }, - // replace a single node a with a list b (which could be null) - replace: function(a, b) { - utils.assert(LinkedList.valid(a) && (b===null || LinkedList.valid(b))); - if (b!==null) { - LinkedList.insertBefore(b, a); - } - LinkedList.remove(a); - utils.assert(LinkedList.valid(a) && (b===null || LinkedList.valid(b))); - }, - // remove single node a from its list - remove: function(a) { - utils.assert(LinkedList.valid(a)); - var prev = a._previousSibling; - if (prev === a) { return; } - var next = a._nextSibling; - prev._nextSibling = next; - next._previousSibling = prev; - a._previousSibling = a._nextSibling = a; - utils.assert(LinkedList.valid(a)); - } -}; - - -/***/ }), - -/***/ 63738: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var URL = __webpack_require__(85184); -var URLUtils = __webpack_require__(65531); - -module.exports = Location; - -function Location(window, href) { - this._window = window; - this._href = href; -} - -Location.prototype = Object.create(URLUtils.prototype, { - constructor: { value: Location }, - - // Special behavior when href is set - href: { - get: function() { return this._href; }, - set: function(v) { this.assign(v); } - }, - - assign: { value: function(url) { - // Resolve the new url against the current one - // XXX: - // This is not actually correct. It should be resolved against - // the URL of the document of the script. For now, though, I only - // support a single window and there is only one base url. - // So this is good enough for now. - var current = new URL(this._href); - var newurl = current.resolve(url); - - // Save the new url - this._href = newurl; - - // Start loading the new document! - // XXX - // This is just something hacked together. - // The real algorithm is: http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#navigate - }}, - - replace: { value: function(url) { - // XXX - // Since we aren't tracking history yet, replace is the same as assign - this.assign(url); - }}, - - reload: { value: function() { - // XXX: - // Actually, the spec is a lot more complicated than this - this.assign(this.href); - }}, - - toString: { value: function() { - return this.href; - }} - -}); - - -/***/ }), - -/***/ 21440: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var UIEvent = __webpack_require__(64259); - -module.exports = MouseEvent; - -function MouseEvent() { - // Just use the superclass constructor to initialize - UIEvent.call(this); - - this.screenX = this.screenY = this.clientX = this.clientY = 0; - this.ctrlKey = this.altKey = this.shiftKey = this.metaKey = false; - this.button = 0; - this.buttons = 1; - this.relatedTarget = null; -} -MouseEvent.prototype = Object.create(UIEvent.prototype, { - constructor: { value: MouseEvent }, - initMouseEvent: { value: function(type, bubbles, cancelable, - view, detail, - screenX, screenY, clientX, clientY, - ctrlKey, altKey, shiftKey, metaKey, - button, relatedTarget) { - - this.initEvent(type, bubbles, cancelable, view, detail); - this.screenX = screenX; - this.screenY = screenY; - this.clientX = clientX; - this.clientY = clientY; - this.ctrlKey = ctrlKey; - this.altKey = altKey; - this.shiftKey = shiftKey; - this.metaKey = metaKey; - this.button = button; - switch(button) { - case 0: this.buttons = 1; break; - case 1: this.buttons = 4; break; - case 2: this.buttons = 2; break; - default: this.buttons = 0; break; - } - this.relatedTarget = relatedTarget; - }}, - - getModifierState: { value: function(key) { - switch(key) { - case "Alt": return this.altKey; - case "Control": return this.ctrlKey; - case "Shift": return this.shiftKey; - case "Meta": return this.metaKey; - default: return false; - } - }} -}); - - -/***/ }), - -/***/ 40993: -/***/ ((module) => { - -"use strict"; - -module.exports = { - VALUE: 1, // The value of a Text, Comment or PI node changed - ATTR: 2, // A new attribute was added or an attribute value and/or prefix changed - REMOVE_ATTR: 3, // An attribute was removed - REMOVE: 4, // A node was removed - MOVE: 5, // A node was moved - INSERT: 6 // A node (or a subtree of nodes) was inserted -}; - -/***/ }), - -/***/ 49492: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = NamedNodeMap; - -var utils = __webpack_require__(89076); - -/* This is a hacky implementation of NamedNodeMap, intended primarily to - * satisfy clients (like dompurify and the web-platform-tests) which check - * to ensure that Node#attributes instanceof NamedNodeMap. */ - -function NamedNodeMap(element) { - this.element = element; -} -Object.defineProperties(NamedNodeMap.prototype, { - length: { get: utils.shouldOverride }, - item: { value: utils.shouldOverride }, - - getNamedItem: { value: function getNamedItem(qualifiedName) { - return this.element.getAttributeNode(qualifiedName); - } }, - getNamedItemNS: { value: function getNamedItemNS(namespace, localName) { - return this.element.getAttributeNodeNS(namespace, localName); - } }, - setNamedItem: { value: utils.nyi }, - setNamedItemNS: { value: utils.nyi }, - removeNamedItem: { value: function removeNamedItem(qualifiedName) { - var attr = this.element.getAttributeNode(qualifiedName); - if (attr) { - this.element.removeAttribute(qualifiedName); - return attr; - } - utils.NotFoundError(); - } }, - removeNamedItemNS: { value: function removeNamedItemNS(ns, lname) { - var attr = this.element.getAttributeNodeNS(ns, lname); - if (attr) { - this.element.removeAttributeNS(ns, lname); - return attr; - } - utils.NotFoundError(); - } }, -}); - - -/***/ }), - -/***/ 94993: -/***/ ((module) => { - -"use strict"; - - -// https://html.spec.whatwg.org/multipage/webappapis.html#navigatorid -var NavigatorID = Object.create(null, { - appCodeName: { value: "Mozilla" }, - appName: { value: "Netscape" }, - appVersion: { value: "4.0" }, - platform: { value: "" }, - product: { value: "Gecko" }, - productSub: { value: "20100101" }, - userAgent: { value: "" }, - vendor: { value: "" }, - vendorSub: { value: "" }, - taintEnabled: { value: function() { return false; } } -}); - -module.exports = NavigatorID; - - -/***/ }), - -/***/ 97537: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = Node; - -var EventTarget = __webpack_require__(22356); -var LinkedList = __webpack_require__(41360); -var NodeUtils = __webpack_require__(41608); -var utils = __webpack_require__(89076); - -// All nodes have a nodeType and an ownerDocument. -// Once inserted, they also have a parentNode. -// This is an abstract class; all nodes in a document are instances -// of a subtype, so all the properties are defined by more specific -// constructors. -function Node() { - EventTarget.call(this); - this.parentNode = null; - this._nextSibling = this._previousSibling = this; - this._index = undefined; -} - -var ELEMENT_NODE = Node.ELEMENT_NODE = 1; -var ATTRIBUTE_NODE = Node.ATTRIBUTE_NODE = 2; -var TEXT_NODE = Node.TEXT_NODE = 3; -var CDATA_SECTION_NODE = Node.CDATA_SECTION_NODE = 4; -var ENTITY_REFERENCE_NODE = Node.ENTITY_REFERENCE_NODE = 5; -var ENTITY_NODE = Node.ENTITY_NODE = 6; -var PROCESSING_INSTRUCTION_NODE = Node.PROCESSING_INSTRUCTION_NODE = 7; -var COMMENT_NODE = Node.COMMENT_NODE = 8; -var DOCUMENT_NODE = Node.DOCUMENT_NODE = 9; -var DOCUMENT_TYPE_NODE = Node.DOCUMENT_TYPE_NODE = 10; -var DOCUMENT_FRAGMENT_NODE = Node.DOCUMENT_FRAGMENT_NODE = 11; -var NOTATION_NODE = Node.NOTATION_NODE = 12; - -var DOCUMENT_POSITION_DISCONNECTED = Node.DOCUMENT_POSITION_DISCONNECTED = 0x01; -var DOCUMENT_POSITION_PRECEDING = Node.DOCUMENT_POSITION_PRECEDING = 0x02; -var DOCUMENT_POSITION_FOLLOWING = Node.DOCUMENT_POSITION_FOLLOWING = 0x04; -var DOCUMENT_POSITION_CONTAINS = Node.DOCUMENT_POSITION_CONTAINS = 0x08; -var DOCUMENT_POSITION_CONTAINED_BY = Node.DOCUMENT_POSITION_CONTAINED_BY = 0x10; -var DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; - -Node.prototype = Object.create(EventTarget.prototype, { - - // Node that are not inserted into the tree inherit a null parent - - // XXX: the baseURI attribute is defined by dom core, but - // a correct implementation of it requires HTML features, so - // we'll come back to this later. - baseURI: { get: utils.nyi }, - - parentElement: { get: function() { - return (this.parentNode && this.parentNode.nodeType===ELEMENT_NODE) ? this.parentNode : null; - }}, - - hasChildNodes: { value: utils.shouldOverride }, - - firstChild: { get: utils.shouldOverride }, - - lastChild: { get: utils.shouldOverride }, - - isConnected: { - get: function () { - let node = this; - while (node != null) { - if (node.nodeType === Node.DOCUMENT_NODE) { - return true; - } - - node = node.parentNode; - if (node != null && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { - node = node.host; - } - } - return false; - }, - }, - - previousSibling: { get: function() { - var parent = this.parentNode; - if (!parent) return null; - if (this === parent.firstChild) return null; - return this._previousSibling; - }}, - - nextSibling: { get: function() { - var parent = this.parentNode, next = this._nextSibling; - if (!parent) return null; - if (next === parent.firstChild) return null; - return next; - }}, - - textContent: { - // Should override for DocumentFragment/Element/Attr/Text/PI/Comment - get: function() { return null; }, - set: function(v) { /* do nothing */ }, - }, - - innerText: { - // Should override for DocumentFragment/Element/Attr/Text/PI/Comment - get: function() { return null; }, - set: function(v) { /* do nothing */ }, - }, - - _countChildrenOfType: { value: function(type) { - var sum = 0; - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === type) sum++; - } - return sum; - }}, - - _ensureInsertValid: { value: function _ensureInsertValid(node, child, isPreinsert) { - var parent = this, i, kid; - if (!node.nodeType) throw new TypeError('not a node'); - // 1. If parent is not a Document, DocumentFragment, or Element - // node, throw a HierarchyRequestError. - switch (parent.nodeType) { - case DOCUMENT_NODE: - case DOCUMENT_FRAGMENT_NODE: - case ELEMENT_NODE: - break; - default: utils.HierarchyRequestError(); - } - // 2. If node is a host-including inclusive ancestor of parent, - // throw a HierarchyRequestError. - if (node.isAncestor(parent)) utils.HierarchyRequestError(); - // 3. If child is not null and its parent is not parent, then - // throw a NotFoundError. (replaceChild omits the 'child is not null' - // and throws a TypeError here if child is null.) - if (child !== null || !isPreinsert) { - if (child.parentNode !== parent) utils.NotFoundError(); - } - // 4. If node is not a DocumentFragment, DocumentType, Element, - // Text, ProcessingInstruction, or Comment node, throw a - // HierarchyRequestError. - switch (node.nodeType) { - case DOCUMENT_FRAGMENT_NODE: - case DOCUMENT_TYPE_NODE: - case ELEMENT_NODE: - case TEXT_NODE: - case PROCESSING_INSTRUCTION_NODE: - case COMMENT_NODE: - break; - default: utils.HierarchyRequestError(); - } - // 5. If either node is a Text node and parent is a document, or - // node is a doctype and parent is not a document, throw a - // HierarchyRequestError. - // 6. If parent is a document, and any of the statements below, switched - // on node, are true, throw a HierarchyRequestError. - if (parent.nodeType === DOCUMENT_NODE) { - switch (node.nodeType) { - case TEXT_NODE: - utils.HierarchyRequestError(); - break; - case DOCUMENT_FRAGMENT_NODE: - // 6a1. If node has more than one element child or has a Text - // node child. - if (node._countChildrenOfType(TEXT_NODE) > 0) - utils.HierarchyRequestError(); - switch (node._countChildrenOfType(ELEMENT_NODE)) { - case 0: - break; - case 1: - // 6a2. Otherwise, if node has one element child and either - // parent has an element child, child is a doctype, or child - // is not null and a doctype is following child. [preinsert] - // 6a2. Otherwise, if node has one element child and either - // parent has an element child that is not child or a - // doctype is following child. [replaceWith] - if (child !== null /* always true here for replaceWith */) { - if (isPreinsert && child.nodeType === DOCUMENT_TYPE_NODE) - utils.HierarchyRequestError(); - for (kid = child.nextSibling; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === DOCUMENT_TYPE_NODE) - utils.HierarchyRequestError(); - } - } - i = parent._countChildrenOfType(ELEMENT_NODE); - if (isPreinsert) { - // "parent has an element child" - if (i > 0) - utils.HierarchyRequestError(); - } else { - // "parent has an element child that is not child" - if (i > 1 || (i === 1 && child.nodeType !== ELEMENT_NODE)) - utils.HierarchyRequestError(); - } - break; - default: // 6a1, continued. (more than one Element child) - utils.HierarchyRequestError(); - } - break; - case ELEMENT_NODE: - // 6b. parent has an element child, child is a doctype, or - // child is not null and a doctype is following child. [preinsert] - // 6b. parent has an element child that is not child or a - // doctype is following child. [replaceWith] - if (child !== null /* always true here for replaceWith */) { - if (isPreinsert && child.nodeType === DOCUMENT_TYPE_NODE) - utils.HierarchyRequestError(); - for (kid = child.nextSibling; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === DOCUMENT_TYPE_NODE) - utils.HierarchyRequestError(); - } - } - i = parent._countChildrenOfType(ELEMENT_NODE); - if (isPreinsert) { - // "parent has an element child" - if (i > 0) - utils.HierarchyRequestError(); - } else { - // "parent has an element child that is not child" - if (i > 1 || (i === 1 && child.nodeType !== ELEMENT_NODE)) - utils.HierarchyRequestError(); - } - break; - case DOCUMENT_TYPE_NODE: - // 6c. parent has a doctype child, child is non-null and an - // element is preceding child, or child is null and parent has - // an element child. [preinsert] - // 6c. parent has a doctype child that is not child, or an - // element is preceding child. [replaceWith] - if (child === null) { - if (parent._countChildrenOfType(ELEMENT_NODE)) - utils.HierarchyRequestError(); - } else { - // child is always non-null for [replaceWith] case - for (kid = parent.firstChild; kid !== null; kid = kid.nextSibling) { - if (kid === child) break; - if (kid.nodeType === ELEMENT_NODE) - utils.HierarchyRequestError(); - } - } - i = parent._countChildrenOfType(DOCUMENT_TYPE_NODE); - if (isPreinsert) { - // "parent has an doctype child" - if (i > 0) - utils.HierarchyRequestError(); - } else { - // "parent has an doctype child that is not child" - if (i > 1 || (i === 1 && child.nodeType !== DOCUMENT_TYPE_NODE)) - utils.HierarchyRequestError(); - } - break; - } - } else { - // 5, continued: (parent is not a document) - if (node.nodeType === DOCUMENT_TYPE_NODE) utils.HierarchyRequestError(); - } - }}, - - insertBefore: { value: function insertBefore(node, child) { - var parent = this; - // 1. Ensure pre-insertion validity - parent._ensureInsertValid(node, child, true); - // 2. Let reference child be child. - var refChild = child; - // 3. If reference child is node, set it to node's next sibling - if (refChild === node) { refChild = node.nextSibling; } - // 4. Adopt node into parent's node document. - parent.doc.adoptNode(node); - // 5. Insert node into parent before reference child. - node._insertOrReplace(parent, refChild, false); - // 6. Return node - return node; - }}, - - - appendChild: { value: function(child) { - // This invokes _appendChild after doing validity checks. - return this.insertBefore(child, null); - }}, - - _appendChild: { value: function(child) { - child._insertOrReplace(this, null, false); - }}, - - removeChild: { value: function removeChild(child) { - var parent = this; - if (!child.nodeType) throw new TypeError('not a node'); - if (child.parentNode !== parent) utils.NotFoundError(); - child.remove(); - return child; - }}, - - // To replace a `child` with `node` within a `parent` (this) - replaceChild: { value: function replaceChild(node, child) { - var parent = this; - // Ensure validity (slight differences from pre-insertion check) - parent._ensureInsertValid(node, child, false); - // Adopt node into parent's node document. - if (node.doc !== parent.doc) { - // XXX adoptNode has side-effect of removing node from its parent - // and generating a mutation event, thus causing the _insertOrReplace - // to generate two deletes and an insert instead of a 'move' - // event. It looks like the new MutationObserver stuff avoids - // this problem, but for now let's only adopt (ie, remove `node` - // from its parent) here if we need to. - parent.doc.adoptNode(node); - } - // Do the replace. - node._insertOrReplace(parent, child, true); - return child; - }}, - - // See: http://ejohn.org/blog/comparing-document-position/ - contains: { value: function contains(node) { - if (node === null) { return false; } - if (this === node) { return true; /* inclusive descendant */ } - /* jshint bitwise: false */ - return (this.compareDocumentPosition(node) & - DOCUMENT_POSITION_CONTAINED_BY) !== 0; - }}, - - compareDocumentPosition: { value: function compareDocumentPosition(that){ - // Basic algorithm for finding the relative position of two nodes. - // Make a list the ancestors of each node, starting with the - // document element and proceeding down to the nodes themselves. - // Then, loop through the lists, looking for the first element - // that differs. The order of those two elements give the - // order of their descendant nodes. Or, if one list is a prefix - // of the other one, then that node contains the other. - - if (this === that) return 0; - - // If they're not owned by the same document or if one is rooted - // and one is not, then they're disconnected. - if (this.doc !== that.doc || - this.rooted !== that.rooted) - return (DOCUMENT_POSITION_DISCONNECTED + - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC); - - // Get arrays of ancestors for this and that - var these = [], those = []; - for(var n = this; n !== null; n = n.parentNode) these.push(n); - for(n = that; n !== null; n = n.parentNode) those.push(n); - these.reverse(); // So we start with the outermost - those.reverse(); - - if (these[0] !== those[0]) // No common ancestor - return (DOCUMENT_POSITION_DISCONNECTED + - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC); - - n = Math.min(these.length, those.length); - for(var i = 1; i < n; i++) { - if (these[i] !== those[i]) { - // We found two different ancestors, so compare - // their positions - if (these[i].index < those[i].index) - return DOCUMENT_POSITION_FOLLOWING; - else - return DOCUMENT_POSITION_PRECEDING; - } - } - - // If we get to here, then one of the nodes (the one with the - // shorter list of ancestors) contains the other one. - if (these.length < those.length) - return (DOCUMENT_POSITION_FOLLOWING + - DOCUMENT_POSITION_CONTAINED_BY); - else - return (DOCUMENT_POSITION_PRECEDING + - DOCUMENT_POSITION_CONTAINS); - }}, - - isSameNode: {value : function isSameNode(node) { - return this === node; - }}, - - - // This method implements the generic parts of node equality testing - // and defers to the (non-recursive) type-specific isEqual() method - // defined by subclasses - isEqualNode: { value: function isEqualNode(node) { - if (!node) return false; - if (node.nodeType !== this.nodeType) return false; - - // Check type-specific properties for equality - if (!this.isEqual(node)) return false; - - // Now check children for number and equality - for (var c1 = this.firstChild, c2 = node.firstChild; - c1 && c2; - c1 = c1.nextSibling, c2 = c2.nextSibling) { - if (!c1.isEqualNode(c2)) return false; - } - return c1 === null && c2 === null; - }}, - - // This method delegates shallow cloning to a clone() method - // that each concrete subclass must implement - cloneNode: { value: function(deep) { - // Clone this node - var clone = this.clone(); - - // Handle the recursive case if necessary - if (deep) { - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - clone._appendChild(kid.cloneNode(true)); - } - } - - return clone; - }}, - - lookupPrefix: { value: function lookupPrefix(ns) { - var e; - if (ns === '' || ns === null || ns === undefined) return null; - switch(this.nodeType) { - case ELEMENT_NODE: - return this._lookupNamespacePrefix(ns, this); - case DOCUMENT_NODE: - e = this.documentElement; - return e ? e.lookupPrefix(ns) : null; - case ENTITY_NODE: - case NOTATION_NODE: - case DOCUMENT_FRAGMENT_NODE: - case DOCUMENT_TYPE_NODE: - return null; - case ATTRIBUTE_NODE: - e = this.ownerElement; - return e ? e.lookupPrefix(ns) : null; - default: - e = this.parentElement; - return e ? e.lookupPrefix(ns) : null; - } - }}, - - - lookupNamespaceURI: {value: function lookupNamespaceURI(prefix) { - if (prefix === '' || prefix === undefined) { prefix = null; } - var e; - switch(this.nodeType) { - case ELEMENT_NODE: - return utils.shouldOverride(); - case DOCUMENT_NODE: - e = this.documentElement; - return e ? e.lookupNamespaceURI(prefix) : null; - case ENTITY_NODE: - case NOTATION_NODE: - case DOCUMENT_TYPE_NODE: - case DOCUMENT_FRAGMENT_NODE: - return null; - case ATTRIBUTE_NODE: - e = this.ownerElement; - return e ? e.lookupNamespaceURI(prefix) : null; - default: - e = this.parentElement; - return e ? e.lookupNamespaceURI(prefix) : null; - } - }}, - - isDefaultNamespace: { value: function isDefaultNamespace(ns) { - if (ns === '' || ns === undefined) { ns = null; } - var defaultNamespace = this.lookupNamespaceURI(null); - return (defaultNamespace === ns); - }}, - - // Utility methods for nodes. Not part of the DOM - - // Return the index of this node in its parent. - // Throw if no parent, or if this node is not a child of its parent - index: { get: function() { - var parent = this.parentNode; - if (this === parent.firstChild) return 0; // fast case - var kids = parent.childNodes; - if (this._index === undefined || kids[this._index] !== this) { - // Ensure that we don't have an O(N^2) blowup if none of the - // kids have defined indices yet and we're traversing via - // nextSibling or previousSibling - for (var i=0; i 2 ? spliceArgs[2] : null); - } else if (len > 2 && n !== null) { - LinkedList.insertBefore(spliceArgs[2], n); - } - if (parent._childNodes) { - spliceArgs[0] = (before === null) ? - parent._childNodes.length : before._index; - parent._childNodes.splice.apply(parent._childNodes, spliceArgs); - for (i=2; i 2) { - parent._firstChild = spliceArgs[2]; - } else if (isReplace) { - parent._firstChild = null; - } - } - // Remove all nodes from the document fragment - if (child._childNodes) { - child._childNodes.length = 0; - } else { - child._firstChild = null; - } - // Call the mutation handlers - // Use spliceArgs since the original array has been destroyed. The - // liveness guarantee requires us to clone the array so that - // references to the childNodes of the DocumentFragment will be empty - // when the insertion handlers are called. - if (parent.rooted) { - parent.modify(); - for (i = 2; i < len; i++) { - parent.doc.mutateInsert(spliceArgs[i]); - } - } - } else { - if (before === child) { return; } - if (bothRooted) { - // Remove the child from its current position in the tree - // without calling remove(), since we don't want to uproot it. - child._remove(); - } else if (child.parentNode) { - child.remove(); - } - - // Insert it as a child of its new parent - child.parentNode = parent; - if (isReplace) { - LinkedList.replace(n, child); - if (parent._childNodes) { - child._index = before_index; - parent._childNodes[before_index] = child; - } else if (parent._firstChild === before) { - parent._firstChild = child; - } - } else { - if (n !== null) { - LinkedList.insertBefore(child, n); - } - if (parent._childNodes) { - child._index = before_index; - parent._childNodes.splice(before_index, 0, child); - } else if (parent._firstChild === before) { - parent._firstChild = child; - } - } - if (bothRooted) { - parent.modify(); - // Generate a move mutation event - parent.doc.mutateMove(child); - } else if (parent.rooted) { - parent.modify(); - parent.doc.mutateInsert(child); - } - } - }}, - - - // Return the lastModTime value for this node. (For use as a - // cache invalidation mechanism. If the node does not already - // have one, initialize it from the owner document's modclock - // property. (Note that modclock does not return the actual - // time; it is simply a counter incremented on each document - // modification) - lastModTime: { get: function() { - if (!this._lastModTime) { - this._lastModTime = this.doc.modclock; - } - return this._lastModTime; - }}, - - // Increment the owner document's modclock and use the new - // value to update the lastModTime value for this node and - // all of its ancestors. Nodes that have never had their - // lastModTime value queried do not need to have a - // lastModTime property set on them since there is no - // previously queried value to ever compare the new value - // against, so only update nodes that already have a - // _lastModTime property. - modify: { value: function() { - if (this.doc.modclock) { // Skip while doc.modclock == 0 - var time = ++this.doc.modclock; - for(var n = this; n; n = n.parentElement) { - if (n._lastModTime) { - n._lastModTime = time; - } - } - } - }}, - - // This attribute is not part of the DOM but is quite helpful. - // It returns the document with which a node is associated. Usually - // this is the ownerDocument. But ownerDocument is null for the - // document object itself, so this is a handy way to get the document - // regardless of the node type - doc: { get: function() { - return this.ownerDocument || this; - }}, - - - // If the node has a nid (node id), then it is rooted in a document - rooted: { get: function() { - return !!this._nid; - }}, - - normalize: { value: function() { - var next; - for (var child=this.firstChild; child !== null; child=next) { - next = child.nextSibling; - - if (child.normalize) { - child.normalize(); - } - - if (child.nodeType !== Node.TEXT_NODE) { - continue; - } - - if (child.nodeValue === "") { - this.removeChild(child); - continue; - } - - var prevChild = child.previousSibling; - if (prevChild === null) { - continue; - } else if (prevChild.nodeType === Node.TEXT_NODE) { - // merge this with previous and remove the child - prevChild.appendData(child.nodeValue); - this.removeChild(child); - } - } - }}, - - // Convert the children of a node to an HTML string. - // This is used by the innerHTML getter - // The serialization spec is at: - // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#serializing-html-fragments - // - // The serialization logic is intentionally implemented in a separate - // `NodeUtils` helper instead of the more obvious choice of a private - // `_serializeOne()` method on the `Node.prototype` in order to avoid - // the megamorphic `this._serializeOne` property access, which reduces - // performance unnecessarily. If you need specialized behavior for a - // certain subclass, you'll need to implement that in `NodeUtils`. - // See https://github.com/fgnass/domino/pull/142 for more information. - serialize: { value: function() { - if (this._innerHTML) { - return this._innerHTML; - } - var s = ''; - for (var kid = this.firstChild; kid !== null; kid = kid.nextSibling) { - s += NodeUtils.serializeOne(kid, this); - } - return s; - }}, - - // Non-standard, but often useful for debugging. - outerHTML: { - get: function() { - return NodeUtils.serializeOne(this, { nodeType: 0 }); - }, - set: utils.nyi, - }, - - // mirror node type properties in the prototype, so they are present - // in instances of Node (and subclasses) - ELEMENT_NODE: { value: ELEMENT_NODE }, - ATTRIBUTE_NODE: { value: ATTRIBUTE_NODE }, - TEXT_NODE: { value: TEXT_NODE }, - CDATA_SECTION_NODE: { value: CDATA_SECTION_NODE }, - ENTITY_REFERENCE_NODE: { value: ENTITY_REFERENCE_NODE }, - ENTITY_NODE: { value: ENTITY_NODE }, - PROCESSING_INSTRUCTION_NODE: { value: PROCESSING_INSTRUCTION_NODE }, - COMMENT_NODE: { value: COMMENT_NODE }, - DOCUMENT_NODE: { value: DOCUMENT_NODE }, - DOCUMENT_TYPE_NODE: { value: DOCUMENT_TYPE_NODE }, - DOCUMENT_FRAGMENT_NODE: { value: DOCUMENT_FRAGMENT_NODE }, - NOTATION_NODE: { value: NOTATION_NODE }, - - DOCUMENT_POSITION_DISCONNECTED: { value: DOCUMENT_POSITION_DISCONNECTED }, - DOCUMENT_POSITION_PRECEDING: { value: DOCUMENT_POSITION_PRECEDING }, - DOCUMENT_POSITION_FOLLOWING: { value: DOCUMENT_POSITION_FOLLOWING }, - DOCUMENT_POSITION_CONTAINS: { value: DOCUMENT_POSITION_CONTAINS }, - DOCUMENT_POSITION_CONTAINED_BY: { value: DOCUMENT_POSITION_CONTAINED_BY }, - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: { value: DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC }, -}); - - -/***/ }), - -/***/ 383: -/***/ ((module) => { - -"use strict"; - -var NodeFilter = { - // Constants for acceptNode() - FILTER_ACCEPT: 1, - FILTER_REJECT: 2, - FILTER_SKIP: 3, - - // Constants for whatToShow - SHOW_ALL: 0xFFFFFFFF, - SHOW_ELEMENT: 0x1, - SHOW_ATTRIBUTE: 0x2, // historical - SHOW_TEXT: 0x4, - SHOW_CDATA_SECTION: 0x8, // historical - SHOW_ENTITY_REFERENCE: 0x10, // historical - SHOW_ENTITY: 0x20, // historical - SHOW_PROCESSING_INSTRUCTION: 0x40, - SHOW_COMMENT: 0x80, - SHOW_DOCUMENT: 0x100, - SHOW_DOCUMENT_TYPE: 0x200, - SHOW_DOCUMENT_FRAGMENT: 0x400, - SHOW_NOTATION: 0x800 // historical -}; - -module.exports = (NodeFilter.constructor = NodeFilter.prototype = NodeFilter); - - -/***/ }), - -/***/ 30419: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = NodeIterator; - -var NodeFilter = __webpack_require__(383); -var NodeTraversal = __webpack_require__(72059); -var utils = __webpack_require__(89076); - -/* Private methods and helpers */ - -/** - * @based on WebKit's NodeIterator::moveToNext and NodeIterator::moveToPrevious - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeIterator.cpp?rev=186279#L51 - */ -function move(node, stayWithin, directionIsNext) { - if (directionIsNext) { - return NodeTraversal.next(node, stayWithin); - } else { - if (node === stayWithin) { - return null; - } - return NodeTraversal.previous(node, null); - } -} - -function isInclusiveAncestor(node, possibleChild) { - for ( ; possibleChild; possibleChild = possibleChild.parentNode) { - if (node === possibleChild) { return true; } - } - return false; -} - -/** - * @spec http://www.w3.org/TR/dom/#concept-nodeiterator-traverse - * @method - * @access private - * @param {NodeIterator} ni - * @param {string} direction One of 'next' or 'previous'. - * @return {Node|null} - */ -function traverse(ni, directionIsNext) { - var node, beforeNode; - node = ni._referenceNode; - beforeNode = ni._pointerBeforeReferenceNode; - while (true) { - if (beforeNode === directionIsNext) { - beforeNode = !beforeNode; - } else { - node = move(node, ni._root, directionIsNext); - if (node === null) { - return null; - } - } - var result = ni._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - break; - } - } - ni._referenceNode = node; - ni._pointerBeforeReferenceNode = beforeNode; - return node; -} - -/* Public API */ - -/** - * Implemented version: http://www.w3.org/TR/2015/WD-dom-20150618/#nodeiterator - * Latest version: http://www.w3.org/TR/dom/#nodeiterator - * - * @constructor - * @param {Node} root - * @param {number} whatToShow [optional] - * @param {Function|NodeFilter} filter [optional] - * @throws Error - */ -function NodeIterator(root, whatToShow, filter) { - if (!root || !root.nodeType) { - utils.NotSupportedError(); - } - - // Read-only properties - this._root = root; - this._referenceNode = root; - this._pointerBeforeReferenceNode = true; - this._whatToShow = Number(whatToShow) || 0; - this._filter = filter || null; - this._active = false; - // Record active node iterators in the document, in order to perform - // "node iterator pre-removal steps". - root.doc._attachNodeIterator(this); -} - -Object.defineProperties(NodeIterator.prototype, { - root: { get: function root() { - return this._root; - } }, - referenceNode: { get: function referenceNode() { - return this._referenceNode; - } }, - pointerBeforeReferenceNode: { get: function pointerBeforeReferenceNode() { - return this._pointerBeforeReferenceNode; - } }, - whatToShow: { get: function whatToShow() { - return this._whatToShow; - } }, - filter: { get: function filter() { - return this._filter; - } }, - - /** - * @method - * @param {Node} node - * @return {Number} Constant NodeFilter.FILTER_ACCEPT, - * NodeFilter.FILTER_REJECT or NodeFilter.FILTER_SKIP. - */ - _internalFilter: { value: function _internalFilter(node) { - /* jshint bitwise: false */ - var result, filter; - if (this._active) { - utils.InvalidStateError(); - } - - // Maps nodeType to whatToShow - if (!(((1 << (node.nodeType - 1)) & this._whatToShow))) { - return NodeFilter.FILTER_SKIP; - } - - filter = this._filter; - if (filter === null) { - result = NodeFilter.FILTER_ACCEPT; - } else { - this._active = true; - try { - if (typeof filter === 'function') { - result = filter(node); - } else { - result = filter.acceptNode(node); - } - } finally { - this._active = false; - } - } - - // Note that coercing to a number means that - // `true` becomes `1` (which is NodeFilter.FILTER_ACCEPT) - // `false` becomes `0` (neither accept, reject, or skip) - return (+result); - } }, - - /** - * @spec https://dom.spec.whatwg.org/#nodeiterator-pre-removing-steps - * @method - * @return void - */ - _preremove: { value: function _preremove(toBeRemovedNode) { - if (isInclusiveAncestor(toBeRemovedNode, this._root)) { return; } - if (!isInclusiveAncestor(toBeRemovedNode, this._referenceNode)) { return; } - if (this._pointerBeforeReferenceNode) { - var next = toBeRemovedNode; - while (next.lastChild) { - next = next.lastChild; - } - next = NodeTraversal.next(next, this.root); - if (next) { - this._referenceNode = next; - return; - } - this._pointerBeforeReferenceNode = false; - // fall through - } - if (toBeRemovedNode.previousSibling === null) { - this._referenceNode = toBeRemovedNode.parentNode; - } else { - this._referenceNode = toBeRemovedNode.previousSibling; - var lastChild; - for (lastChild = this._referenceNode.lastChild; - lastChild; - lastChild = this._referenceNode.lastChild) { - this._referenceNode = lastChild; - } - } - } }, - - /** - * @spec http://www.w3.org/TR/dom/#dom-nodeiterator-nextnode - * @method - * @return {Node|null} - */ - nextNode: { value: function nextNode() { - return traverse(this, true); - } }, - - /** - * @spec http://www.w3.org/TR/dom/#dom-nodeiterator-previousnode - * @method - * @return {Node|null} - */ - previousNode: { value: function previousNode() { - return traverse(this, false); - } }, - - /** - * @spec http://www.w3.org/TR/dom/#dom-nodeiterator-detach - * @method - * @return void - */ - detach: { value: function detach() { - /* "The detach() method must do nothing. - * Its functionality (disabling a NodeIterator object) was removed, - * but the method itself is preserved for compatibility. - */ - } }, - - /** For compatibility with web-platform-tests. */ - toString: { value: function toString() { - return "[object NodeIterator]"; - } }, -}); - - -/***/ }), - -/***/ 52516: -/***/ ((module) => { - -"use strict"; - - -// No support for subclassing array, return an actual Array object. -function item(i) { - /* jshint validthis: true */ - return this[i] || null; -} - -function NodeList(a) { - if (!a) a = []; - a.item = item; - return a; -} - -module.exports = NodeList; - - -/***/ }), - -/***/ 77101: -/***/ ((module) => { - -"use strict"; -/* jshint esversion: 6 */ - - -module.exports = class NodeList extends Array { - constructor(a) { - super((a && a.length) || 0); - if (a) { - for (var idx in a) { this[idx] = a[idx]; } - } - } - item(i) { return this[i] || null; } -}; - - -/***/ }), - -/***/ 64965: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var NodeList; - -try { - // Attempt to use ES6-style Array subclass if possible. - NodeList = __webpack_require__(77101); -} catch (e) { - // No support for subclassing array, return an actual Array object. - NodeList = __webpack_require__(52516); -} - -module.exports = NodeList; - - -/***/ }), - -/***/ 72059: -/***/ ((module) => { - -"use strict"; - -/* exported NodeTraversal */ -var NodeTraversal = module.exports = { - nextSkippingChildren: nextSkippingChildren, - nextAncestorSibling: nextAncestorSibling, - next: next, - previous: previous, - deepLastChild: deepLastChild -}; - -/** - * @based on WebKit's NodeTraversal::nextSkippingChildren - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.h?rev=179143#L109 - */ -function nextSkippingChildren(node, stayWithin) { - if (node === stayWithin) { - return null; - } - if (node.nextSibling !== null) { - return node.nextSibling; - } - return nextAncestorSibling(node, stayWithin); -} - -/** - * @based on WebKit's NodeTraversal::nextAncestorSibling - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.cpp?rev=179143#L93 - */ -function nextAncestorSibling(node, stayWithin) { - for (node = node.parentNode; node !== null; node = node.parentNode) { - if (node === stayWithin) { - return null; - } - if (node.nextSibling !== null) { - return node.nextSibling; - } - } - return null; -} - -/** - * @based on WebKit's NodeTraversal::next - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.h?rev=179143#L99 - */ -function next(node, stayWithin) { - var n; - n = node.firstChild; - if (n !== null) { - return n; - } - if (node === stayWithin) { - return null; - } - n = node.nextSibling; - if (n !== null) { - return n; - } - return nextAncestorSibling(node, stayWithin); -} - -/** - * @based on WebKit's NodeTraversal::deepLastChild - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.cpp?rev=179143#L116 - */ -function deepLastChild(node) { - while (node.lastChild) { - node = node.lastChild; - } - return node; -} - -/** - * @based on WebKit's NodeTraversal::previous - * https://trac.webkit.org/browser/trunk/Source/WebCore/dom/NodeTraversal.h?rev=179143#L121 - */ -function previous(node, stayWithin) { - var p; - p = node.previousSibling; - if (p !== null) { - return deepLastChild(p); - } - p = node.parentNode; - if (p === stayWithin) { - return null; - } - return p; -} - - -/***/ }), - -/***/ 41608: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = { - // NOTE: The `serializeOne()` function used to live on the `Node.prototype` - // as a private method `Node#_serializeOne(child)`, however that requires - // a megamorphic property access `this._serializeOne` just to get to the - // method, and this is being done on lots of different `Node` subclasses, - // which puts a lot of pressure on V8's megamorphic stub cache. So by - // moving the helper off of the `Node.prototype` and into a separate - // function in this helper module, we get a monomorphic property access - // `NodeUtils.serializeOne` to get to the function and reduce pressure - // on the megamorphic stub cache. - // See https://github.com/fgnass/domino/pull/142 for more information. - serializeOne: serializeOne, - - // Export util functions so that we can run extra test for them. - // Note: we prefix function names with `ɵ`, similar to what we do - // with internal functions in Angular packages. - ɵescapeMatchingClosingTag: escapeMatchingClosingTag, - ɵescapeClosingCommentTag: escapeClosingCommentTag, - ɵescapeProcessingInstructionContent: escapeProcessingInstructionContent -}; - -var utils = __webpack_require__(89076); -var NAMESPACE = utils.NAMESPACE; - -var hasRawContent = { - STYLE: true, - SCRIPT: true, - XMP: true, - IFRAME: true, - NOEMBED: true, - NOFRAMES: true, - PLAINTEXT: true -}; - -var emptyElements = { - area: true, - base: true, - basefont: true, - bgsound: true, - br: true, - col: true, - embed: true, - frame: true, - hr: true, - img: true, - input: true, - keygen: true, - link: true, - meta: true, - param: true, - source: true, - track: true, - wbr: true -}; - -var extraNewLine = { - /* Removed in https://github.com/whatwg/html/issues/944 - pre: true, - textarea: true, - listing: true - */ -}; - -const ESCAPE_REGEXP = /[&<>\u00A0]/g; -const ESCAPE_ATTR_REGEXP = /[&"<>\u00A0]/g; - -function escape(s) { - if (!ESCAPE_REGEXP.test(s)) { - // nothing to do, fast path - return s; - } - - return s.replace(ESCAPE_REGEXP, (c) => { - switch (c) { - case "&": - return "&"; - case "<": - return "<"; - case ">": - return ">"; - case "\u00A0": - return " "; - } - }); -} - -function escapeAttr(s) { - if (!ESCAPE_ATTR_REGEXP.test(s)) { - // nothing to do, fast path - return s; - } - - return s.replace(ESCAPE_ATTR_REGEXP, (c) => { - switch (c) { - case "<": - return "<"; - case ">": - return ">"; - case "&": - return "&"; - case '"': - return """; - case "\u00A0": - return " "; - } - }); -} - -function attrname(a) { - var ns = a.namespaceURI; - if (!ns) - return a.localName; - if (ns === NAMESPACE.XML) - return 'xml:' + a.localName; - if (ns === NAMESPACE.XLINK) - return 'xlink:' + a.localName; - - if (ns === NAMESPACE.XMLNS) { - if (a.localName === 'xmlns') return 'xmlns'; - else return 'xmlns:' + a.localName; - } - return a.name; -} - -/** - * Escapes matching closing tag in a raw text. - * - * For example, given `)`, - * the parent tag would by "style" and the raw text is - * "". If we come across a matching closing tag - * (in out case ``) - replace `<` with `<` to avoid unexpected - * and unsafe behavior after de-serialization. - */ -function escapeMatchingClosingTag(rawText, parentTag) { - const parentClosingTag = '/; - -/** - * Escapes closing comment tag in a comment content. - * - * For example, given `#comment('-->')`, the content of a comment would be - * updated to `-->` to avoid unexpected and unsafe behavior after - * de-serialization. - */ -function escapeClosingCommentTag(rawContent) { - if (!CLOSING_COMMENT_REGEXP.test(rawContent)) { - return rawContent; // fast path - } - return rawContent.replace(/(--\!?)>/g, '$1>'); -} - -/** - * Escapes processing instruction content by replacing `>` with `>`. - */ -function escapeProcessingInstructionContent(rawContent) { - return rawContent.includes('>') - ? rawContent.replaceAll('>', '>') - : rawContent; -} - -function serializeOne(kid, parent) { - var s = ''; - switch(kid.nodeType) { - case 1: //ELEMENT_NODE - var ns = kid.namespaceURI; - var html = ns === NAMESPACE.HTML; - var tagname = (html || ns === NAMESPACE.SVG || ns === NAMESPACE.MATHML) ? kid.localName : kid.tagName; - - s += '<' + tagname; - - for(var j = 0, k = kid._numattrs; j < k; j++) { - var a = kid._attr(j); - s += ' ' + attrname(a); - if (a.value !== undefined) s += '="' + escapeAttr(a.value) + '"'; - } - s += '>'; - - if (!(html && emptyElements[tagname])) { - var ss = kid.serialize(); - // If an element can have raw content, this content may - // potentially require escaping to avoid XSS. - if (hasRawContent[tagname.toUpperCase()]) { - ss = escapeMatchingClosingTag(ss, tagname); - } - if (html && extraNewLine[tagname] && ss.charAt(0)==='\n') s += '\n'; - // Serialize children and add end tag for all others - s += ss; - s += ''; - } - break; - case 3: //TEXT_NODE - case 4: //CDATA_SECTION_NODE - var parenttag; - if (parent.nodeType === 1 /*ELEMENT_NODE*/ && - parent.namespaceURI === NAMESPACE.HTML) - parenttag = parent.tagName; - else - parenttag = ''; - - if (hasRawContent[parenttag] || - (parenttag==='NOSCRIPT' && parent.ownerDocument._scripting_enabled)) { - s += kid.data; - } else { - s += escape(kid.data); - } - break; - case 8: //COMMENT_NODE - s += ''; - break; - case 7: //PROCESSING_INSTRUCTION_NODE - const content = escapeProcessingInstructionContent(kid.data); - s += ''; - break; - case 10: //DOCUMENT_TYPE_NODE - s += ''; - break; - default: - utils.InvalidStateError(); - } - return s; -} - - -/***/ }), - -/***/ 32001: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var Node = __webpack_require__(97537); - -var NonDocumentTypeChildNode = { - - nextElementSibling: { get: function() { - if (this.parentNode) { - for (var kid = this.nextSibling; kid !== null; kid = kid.nextSibling) { - if (kid.nodeType === Node.ELEMENT_NODE) return kid; - } - } - return null; - }}, - - previousElementSibling: { get: function() { - if (this.parentNode) { - for (var kid = this.previousSibling; kid !== null; kid = kid.previousSibling) { - if (kid.nodeType === Node.ELEMENT_NODE) return kid; - } - } - return null; - }} - -}; - -module.exports = NonDocumentTypeChildNode; - - -/***/ }), - -/***/ 81248: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = ProcessingInstruction; - -var Node = __webpack_require__(97537); -var CharacterData = __webpack_require__(90086); - -function ProcessingInstruction(doc, target, data) { - CharacterData.call(this); - this.nodeType = Node.PROCESSING_INSTRUCTION_NODE; - this.ownerDocument = doc; - this.target = target; - this._data = data; -} - -var nodeValue = { - get: function() { return this._data; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } else { v = String(v); } - this._data = v; - if (this.rooted) this.ownerDocument.mutateValue(this); - } -}; - -ProcessingInstruction.prototype = Object.create(CharacterData.prototype, { - nodeName: { get: function() { return this.target; }}, - nodeValue: nodeValue, - textContent: nodeValue, - innerText: nodeValue, - data: { - get: nodeValue.get, - set: function(v) { - nodeValue.set.call(this, v===null ? '' : String(v)); - }, - }, - - // Utility methods - clone: { value: function clone() { - return new ProcessingInstruction(this.ownerDocument, this.target, this._data); - }}, - isEqual: { value: function isEqual(n) { - return this.target === n.target && this._data === n._data; - }} - -}); - - -/***/ }), - -/***/ 58210: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = Text; - -var utils = __webpack_require__(89076); -var Node = __webpack_require__(97537); -var CharacterData = __webpack_require__(90086); - -function Text(doc, data) { - CharacterData.call(this); - this.nodeType = Node.TEXT_NODE; - this.ownerDocument = doc; - this._data = data; - this._index = undefined; -} - -var nodeValue = { - get: function() { return this._data; }, - set: function(v) { - if (v === null || v === undefined) { v = ''; } else { v = String(v); } - if (v === this._data) return; - this._data = v; - if (this.rooted) - this.ownerDocument.mutateValue(this); - if (this.parentNode && - this.parentNode._textchangehook) - this.parentNode._textchangehook(this); - } -}; - -Text.prototype = Object.create(CharacterData.prototype, { - nodeName: { value: "#text" }, - // These three attributes are all the same. - // The data attribute has a [TreatNullAs=EmptyString] but we'll - // implement that at the interface level - nodeValue: nodeValue, - textContent: nodeValue, - innerText: nodeValue, - data: { - get: nodeValue.get, - set: function(v) { - nodeValue.set.call(this, v===null ? '' : String(v)); - }, - }, - - splitText: { value: function splitText(offset) { - if (offset > this._data.length || offset < 0) utils.IndexSizeError(); - - var newdata = this._data.substring(offset), - newnode = this.ownerDocument.createTextNode(newdata); - this.data = this.data.substring(0, offset); - - var parent = this.parentNode; - if (parent !== null) - parent.insertBefore(newnode, this.nextSibling); - - return newnode; - }}, - - wholeText: { get: function wholeText() { - var result = this.textContent; - for (var next = this.nextSibling; next; next = next.nextSibling) { - if (next.nodeType !== Node.TEXT_NODE) { break; } - result += next.textContent; - } - return result; - }}, - // Obsolete, removed from spec. - replaceWholeText: { value: utils.nyi }, - - // Utility methods - clone: { value: function clone() { - return new Text(this.ownerDocument, this._data); - }}, - -}); - - -/***/ }), - -/***/ 44507: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = TreeWalker; - -var Node = __webpack_require__(97537); -var NodeFilter = __webpack_require__(383); -var NodeTraversal = __webpack_require__(72059); -var utils = __webpack_require__(89076); - -var mapChild = { - first: 'firstChild', - last: 'lastChild', - next: 'firstChild', - previous: 'lastChild' -}; - -var mapSibling = { - first: 'nextSibling', - last: 'previousSibling', - next: 'nextSibling', - previous: 'previousSibling' -}; - -/* Private methods and helpers */ - -/** - * @spec https://dom.spec.whatwg.org/#concept-traverse-children - * @method - * @access private - * @param {TreeWalker} tw - * @param {string} type One of 'first' or 'last'. - * @return {Node|null} - */ -function traverseChildren(tw, type) { - var child, node, parent, result, sibling; - node = tw._currentNode[mapChild[type]]; - while (node !== null) { - result = tw._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - tw._currentNode = node; - return node; - } - if (result === NodeFilter.FILTER_SKIP) { - child = node[mapChild[type]]; - if (child !== null) { - node = child; - continue; - } - } - while (node !== null) { - sibling = node[mapSibling[type]]; - if (sibling !== null) { - node = sibling; - break; - } - parent = node.parentNode; - if (parent === null || parent === tw.root || parent === tw._currentNode) { - return null; - } else { - node = parent; - } - } - } - return null; -} - -/** - * @spec https://dom.spec.whatwg.org/#concept-traverse-siblings - * @method - * @access private - * @param {TreeWalker} tw - * @param {TreeWalker} type One of 'next' or 'previous'. - * @return {Node|nul} - */ -function traverseSiblings(tw, type) { - var node, result, sibling; - node = tw._currentNode; - if (node === tw.root) { - return null; - } - while (true) { - sibling = node[mapSibling[type]]; - while (sibling !== null) { - node = sibling; - result = tw._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - tw._currentNode = node; - return node; - } - sibling = node[mapChild[type]]; - if (result === NodeFilter.FILTER_REJECT || sibling === null) { - sibling = node[mapSibling[type]]; - } - } - node = node.parentNode; - if (node === null || node === tw.root) { - return null; - } - if (tw._internalFilter(node) === NodeFilter.FILTER_ACCEPT) { - return null; - } - } -} - - -/* Public API */ - -/** - * Latest version: https://dom.spec.whatwg.org/#treewalker - * - * @constructor - * @param {Node} root - * @param {number} whatToShow [optional] - * @param {Function|NodeFilter} filter [optional] - * @throws Error - */ -function TreeWalker(root, whatToShow, filter) { - if (!root || !root.nodeType) { - utils.NotSupportedError(); - } - - // Read-only properties - this._root = root; - this._whatToShow = Number(whatToShow) || 0; - this._filter = filter || null; - this._active = false; - // Read-write property - this._currentNode = root; -} - -Object.defineProperties(TreeWalker.prototype, { - root: { get: function() { return this._root; } }, - whatToShow: { get: function() { return this._whatToShow; } }, - filter: { get: function() { return this._filter; } }, - - currentNode: { - get: function currentNode() { - return this._currentNode; - }, - set: function setCurrentNode(v) { - if (!(v instanceof Node)) { - throw new TypeError("Not a Node"); // `null` is also not a node - } - this._currentNode = v; - }, - }, - - /** - * @method - * @param {Node} node - * @return {Number} Constant NodeFilter.FILTER_ACCEPT, - * NodeFilter.FILTER_REJECT or NodeFilter.FILTER_SKIP. - */ - _internalFilter: { value: function _internalFilter(node) { - /* jshint bitwise: false */ - var result, filter; - if (this._active) { - utils.InvalidStateError(); - } - - // Maps nodeType to whatToShow - if (!(((1 << (node.nodeType - 1)) & this._whatToShow))) { - return NodeFilter.FILTER_SKIP; - } - - filter = this._filter; - if (filter === null) { - result = NodeFilter.FILTER_ACCEPT; - } else { - this._active = true; - try { - if (typeof filter === 'function') { - result = filter(node); - } else { - result = filter.acceptNode(node); - } - } finally { - this._active = false; - } - } - - // Note that coercing to a number means that - // `true` becomes `1` (which is NodeFilter.FILTER_ACCEPT) - // `false` becomes `0` (neither accept, reject, or skip) - return (+result); - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-parentnode - * @based on WebKit's TreeWalker::parentNode - * https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/TreeWalker.cpp?rev=220453#L50 - * @method - * @return {Node|null} - */ - parentNode: { value: function parentNode() { - var node = this._currentNode; - while (node !== this.root) { - node = node.parentNode; - if (node === null) { - return null; - } - if (this._internalFilter(node) === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } - } - return null; - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-firstchild - * @method - * @return {Node|null} - */ - firstChild: { value: function firstChild() { - return traverseChildren(this, 'first'); - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-lastchild - * @method - * @return {Node|null} - */ - lastChild: { value: function lastChild() { - return traverseChildren(this, 'last'); - }}, - - /** - * @spec http://www.w3.org/TR/dom/#dom-treewalker-previoussibling - * @method - * @return {Node|null} - */ - previousSibling: { value: function previousSibling() { - return traverseSiblings(this, 'previous'); - }}, - - /** - * @spec http://www.w3.org/TR/dom/#dom-treewalker-nextsibling - * @method - * @return {Node|null} - */ - nextSibling: { value: function nextSibling() { - return traverseSiblings(this, 'next'); - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-previousnode - * @based on WebKit's TreeWalker::previousNode - * https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/TreeWalker.cpp?rev=220453#L181 - * @method - * @return {Node|null} - */ - previousNode: { value: function previousNode() { - var node, result, previousSibling, lastChild; - node = this._currentNode; - while (node !== this._root) { - for (previousSibling = node.previousSibling; - previousSibling; - previousSibling = node.previousSibling) { - node = previousSibling; - result = this._internalFilter(node); - if (result === NodeFilter.FILTER_REJECT) { - continue; - } - for (lastChild = node.lastChild; - lastChild; - lastChild = node.lastChild) { - node = lastChild; - result = this._internalFilter(node); - if (result === NodeFilter.FILTER_REJECT) { - break; - } - } - if (result === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } - } - if (node === this.root || node.parentNode === null) { - return null; - } - node = node.parentNode; - if (this._internalFilter(node) === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } - } - return null; - }}, - - /** - * @spec https://dom.spec.whatwg.org/#dom-treewalker-nextnode - * @based on WebKit's TreeWalker::nextNode - * https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/dom/TreeWalker.cpp?rev=220453#L228 - * @method - * @return {Node|null} - */ - nextNode: { value: function nextNode() { - var node, result, firstChild, nextSibling; - node = this._currentNode; - result = NodeFilter.FILTER_ACCEPT; - - CHILDREN: - while (true) { - for (firstChild = node.firstChild; - firstChild; - firstChild = node.firstChild) { - node = firstChild; - result = this._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } else if (result === NodeFilter.FILTER_REJECT) { - break; - } - } - for (nextSibling = NodeTraversal.nextSkippingChildren(node, this.root); - nextSibling; - nextSibling = NodeTraversal.nextSkippingChildren(node, this.root)) { - node = nextSibling; - result = this._internalFilter(node); - if (result === NodeFilter.FILTER_ACCEPT) { - this._currentNode = node; - return node; - } else if (result === NodeFilter.FILTER_SKIP) { - continue CHILDREN; - } - } - return null; - } - }}, - - /** For compatibility with web-platform-tests. */ - toString: { value: function toString() { - return "[object TreeWalker]"; - }}, -}); - - -/***/ }), - -/***/ 64259: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var Event = __webpack_require__(13441); - -module.exports = UIEvent; - -function UIEvent() { - // Just use the superclass constructor to initialize - Event.call(this); - this.view = null; // FF uses the current window - this.detail = 0; -} -UIEvent.prototype = Object.create(Event.prototype, { - constructor: { value: UIEvent }, - initUIEvent: { value: function(type, bubbles, cancelable, view, detail) { - this.initEvent(type, bubbles, cancelable); - this.view = view; - this.detail = detail; - }} -}); - - -/***/ }), - -/***/ 85184: -/***/ ((module) => { - -"use strict"; - -module.exports = URL; - -function URL(url) { - if (!url) return Object.create(URL.prototype); - // Can't use String.trim() since it defines whitespace differently than HTML - this.url = url.replace(/^[ \t\n\r\f]+|[ \t\n\r\f]+$/g, ""); - - // See http://tools.ietf.org/html/rfc3986#appendix-B - // and https://url.spec.whatwg.org/#parsing - var match = URL.pattern.exec(this.url); - if (match) { - if (match[2]) this.scheme = match[2]; - if (match[4]) { - // parse username/password - var userinfo = match[4].match(URL.userinfoPattern); - if (userinfo) { - this.username = userinfo[1]; - this.password = userinfo[3]; - match[4] = match[4].substring(userinfo[0].length); - } - if (match[4].match(URL.portPattern)) { - var pos = match[4].lastIndexOf(':'); - this.host = match[4].substring(0, pos); - this.port = match[4].substring(pos+1); - } - else { - this.host = match[4]; - } - } - if (match[5]) this.path = match[5]; - if (match[6]) this.query = match[7]; - if (match[8]) this.fragment = match[9]; - } -} - -URL.pattern = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/; -URL.userinfoPattern = /^([^@:]*)(:([^@]*))?@/; -URL.portPattern = /:\d+$/; -URL.authorityPattern = /^[^:\/?#]+:\/\//; -URL.hierarchyPattern = /^[^:\/?#]+:\//; - -// Return a percentEncoded version of s. -// S should be a single-character string -// XXX: needs to do utf-8 encoding? -URL.percentEncode = function percentEncode(s) { - var c = s.charCodeAt(0); - if (c < 256) return "%" + c.toString(16); - else throw Error("can't percent-encode codepoints > 255 yet"); -}; - -URL.prototype = { - constructor: URL, - - // XXX: not sure if this is the precise definition of absolute - isAbsolute: function() { return !!this.scheme; }, - isAuthorityBased: function() { - return URL.authorityPattern.test(this.url); - }, - isHierarchical: function() { - return URL.hierarchyPattern.test(this.url); - }, - - toString: function() { - var s = ""; - if (this.scheme !== undefined) s += this.scheme + ":"; - if (this.isAbsolute()) { - s += '//'; - if (this.username || this.password) { - s += this.username || ''; - if (this.password) { - s += ':' + this.password; - } - s += '@'; - } - if (this.host) { - s += this.host; - } - } - if (this.port !== undefined) s += ":" + this.port; - if (this.path !== undefined) s += this.path; - if (this.query !== undefined) s += "?" + this.query; - if (this.fragment !== undefined) s += "#" + this.fragment; - return s; - }, - - // See: http://tools.ietf.org/html/rfc3986#section-5.2 - // and https://url.spec.whatwg.org/#constructors - resolve: function(relative) { - var base = this; // The base url we're resolving against - var r = new URL(relative); // The relative reference url to resolve - var t = new URL(); // The absolute target url we will return - - if (r.scheme !== undefined) { - t.scheme = r.scheme; - t.username = r.username; - t.password = r.password; - t.host = r.host; - t.port = r.port; - t.path = remove_dot_segments(r.path); - t.query = r.query; - } - else { - t.scheme = base.scheme; - if (r.host !== undefined) { - t.username = r.username; - t.password = r.password; - t.host = r.host; - t.port = r.port; - t.path = remove_dot_segments(r.path); - t.query = r.query; - } - else { - t.username = base.username; - t.password = base.password; - t.host = base.host; - t.port = base.port; - if (!r.path) { // undefined or empty - t.path = base.path; - if (r.query !== undefined) - t.query = r.query; - else - t.query = base.query; - } - else { - if (r.path.charAt(0) === "/") { - t.path = remove_dot_segments(r.path); - } - else { - t.path = merge(base.path, r.path); - t.path = remove_dot_segments(t.path); - } - t.query = r.query; - } - } - } - t.fragment = r.fragment; - - return t.toString(); - - - function merge(basepath, refpath) { - if (base.host !== undefined && !base.path) - return "/" + refpath; - - var lastslash = basepath.lastIndexOf("/"); - if (lastslash === -1) - return refpath; - else - return basepath.substring(0, lastslash+1) + refpath; - } - - function remove_dot_segments(path) { - if (!path) return path; // For "" or undefined - - var output = ""; - while(path.length > 0) { - if (path === "." || path === "..") { - path = ""; - break; - } - - var twochars = path.substring(0,2); - var threechars = path.substring(0,3); - var fourchars = path.substring(0,4); - if (threechars === "../") { - path = path.substring(3); - } - else if (twochars === "./") { - path = path.substring(2); - } - else if (threechars === "/./") { - path = "/" + path.substring(3); - } - else if (twochars === "/." && path.length === 2) { - path = "/"; - } - else if (fourchars === "/../" || - (threechars === "/.." && path.length === 3)) { - path = "/" + path.substring(4); - - output = output.replace(/\/?[^\/]*$/, ""); - } - else { - var segment = path.match(/(\/?([^\/]*))/)[0]; - output += segment; - path = path.substring(segment.length); - } - } - - return output; - } - }, -}; - - -/***/ }), - -/***/ 65531: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var URL = __webpack_require__(85184); - -module.exports = URLUtils; - -// Allow the `x == null` pattern. This is eslint's "null: 'ignore'" option, -// but jshint doesn't support this. -/* jshint eqeqeq: false */ - -// This is an abstract superclass for Location, HTMLAnchorElement and -// other types that have the standard complement of "URL decomposition -// IDL attributes". This is now standardized as URLUtils, see: -// https://url.spec.whatwg.org/#urlutils -// Subclasses must define a getter/setter on href. -// The getter and setter methods parse and rebuild the URL on each -// invocation; there is no attempt to cache the value and be more efficient -function URLUtils() {} -URLUtils.prototype = Object.create(Object.prototype, { - - _url: { get: function() { - // XXX: this should do the "Reinitialize url" steps, and "null" should - // be a valid return value. - return new URL(this.href); - } }, - - protocol: { - get: function() { - var url = this._url; - if (url && url.scheme) return url.scheme + ":"; - else return ":"; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute()) { - v = v.replace(/:+$/, ""); - v = v.replace(/[^-+\.a-zA-Z0-9]/g, URL.percentEncode); - if (v.length > 0) { - url.scheme = v; - output = url.toString(); - } - } - this.href = output; - }, - }, - - host: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isAuthorityBased()) - return url.host + (url.port ? (":" + url.port) : ""); - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isAuthorityBased()) { - v = v.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL.percentEncode); - if (v.length > 0) { - url.host = v; - delete url.port; - output = url.toString(); - } - } - this.href = output; - }, - }, - - hostname: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isAuthorityBased()) - return url.host; - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isAuthorityBased()) { - v = v.replace(/^\/+/, ""); - v = v.replace(/[^-+\._~!$&'()*,;:=a-zA-Z0-9]/g, URL.percentEncode); - if (v.length > 0) { - url.host = v; - output = url.toString(); - } - } - this.href = output; - }, - }, - - port: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isAuthorityBased() && url.port!==undefined) - return url.port; - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isAuthorityBased()) { - v = '' + v; - v = v.replace(/[^0-9].*$/, ""); - v = v.replace(/^0+/, ""); - if (v.length === 0) v = "0"; - if (parseInt(v, 10) <= 65535) { - url.port = v; - output = url.toString(); - } - } - this.href = output; - }, - }, - - pathname: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isHierarchical()) - return url.path; - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isHierarchical()) { - if (v.charAt(0) !== "/") - v = "/" + v; - v = v.replace(/[^-+\._~!$&'()*,;:=@\/a-zA-Z0-9]/g, URL.percentEncode); - url.path = v; - output = url.toString(); - } - this.href = output; - }, - }, - - search: { - get: function() { - var url = this._url; - if (url.isAbsolute() && url.isHierarchical() && url.query!==undefined) - return "?" + url.query; - else - return ""; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute() && url.isHierarchical()) { - if (v.charAt(0) === "?") v = v.substring(1); - v = v.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL.percentEncode); - url.query = v; - output = url.toString(); - } - this.href = output; - }, - }, - - hash: { - get: function() { - var url = this._url; - if (url == null || url.fragment == null || url.fragment === '') { - return ""; - } else { - return "#" + url.fragment; - } - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - - if (v.charAt(0) === "#") v = v.substring(1); - v = v.replace(/[^-+\._~!$&'()*,;:=@\/?a-zA-Z0-9]/g, URL.percentEncode); - url.fragment = v; - output = url.toString(); - - this.href = output; - }, - }, - - username: { - get: function() { - var url = this._url; - return url.username || ''; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute()) { - v = v.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\:]/g, URL.percentEncode); - url.username = v; - output = url.toString(); - } - this.href = output; - }, - }, - - password: { - get: function() { - var url = this._url; - return url.password || ''; - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - if (url.isAbsolute()) { - if (v==='') { - url.password = null; - } else { - v = v.replace(/[\x00-\x1F\x7F-\uFFFF "#<>?`\/@\\]/g, URL.percentEncode); - url.password = v; - } - output = url.toString(); - } - this.href = output; - }, - }, - - origin: { get: function() { - var url = this._url; - if (url == null) { return ''; } - var originForPort = function(defaultPort) { - var origin = [url.scheme, url.host, +url.port || defaultPort]; - // XXX should be "unicode serialization" - return origin[0] + '://' + origin[1] + - (origin[2] === defaultPort ? '' : (':' + origin[2])); - }; - switch (url.scheme) { - case 'ftp': - return originForPort(21); - case 'gopher': - return originForPort(70); - case 'http': - case 'ws': - return originForPort(80); - case 'https': - case 'wss': - return originForPort(443); - default: - // this is what chrome does - return url.scheme + '://'; - } - } }, - - /* - searchParams: { - get: function() { - var url = this._url; - // XXX - }, - set: function(v) { - var output = this.href; - var url = new URL(output); - // XXX - this.href = output; - }, - }, - */ -}); - -URLUtils._inherit = function(proto) { - // copy getters/setters from URLUtils to o. - Object.getOwnPropertyNames(URLUtils.prototype).forEach(function(p) { - if (p==='constructor' || p==='href') { return; } - var desc = Object.getOwnPropertyDescriptor(URLUtils.prototype, p); - Object.defineProperty(proto, p, desc); - }); -}; - - -/***/ }), - -/***/ 21865: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -var DOMImplementation = __webpack_require__(80931); -var EventTarget = __webpack_require__(22356); -var Location = __webpack_require__(63738); -var utils = __webpack_require__(89076); - -module.exports = Window; - -function Window(document) { - this.document = document || new DOMImplementation(null).createHTMLDocument(""); - this.document._scripting_enabled = true; - this.document.defaultView = this; - this.location = new Location(this, this.document._address || 'about:blank'); -} - -Window.prototype = Object.create(EventTarget.prototype, { - console: { value: console }, - history: { value: { - back: utils.nyi, - forward: utils.nyi, - go: utils.nyi - }}, - navigator: { value: __webpack_require__(94993) }, - - // Self-referential properties - window: { get: function() { return this; }}, - self: { get: function() { return this; }}, - frames: { get: function() { return this; }}, - - // Self-referential properties for a top-level window - parent: { get: function() { return this; }}, - top: { get: function() { return this; }}, - - // We don't support any other windows for now - length: { value: 0 }, // no frames - frameElement: { value: null }, // not part of a frame - opener: { value: null }, // not opened by another window - - // The onload event handler. - // XXX: need to support a bunch of other event types, too, - // and have them interoperate with document.body. - - onload: { - get: function() { - return this._getEventHandler("load"); - }, - set: function(v) { - this._setEventHandler("load", v); - } - }, - - // XXX This is a completely broken implementation - getComputedStyle: { value: function getComputedStyle(elt) { - return elt.style; - }} - -}); - -utils.expose(__webpack_require__(23811), Window); -utils.expose(__webpack_require__(31575), Window); - - -/***/ }), - -/***/ 23811: -/***/ ((module) => { - -"use strict"; - - -// https://html.spec.whatwg.org/multipage/webappapis.html#windowtimers -var WindowTimers = { - setTimeout: setTimeout, - clearTimeout: clearTimeout, - setInterval: setInterval, - clearInterval: clearInterval -}; - -module.exports = WindowTimers; - - -/***/ }), - -/***/ 6548: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var utils = __webpack_require__(89076); - -exports.property = function(attr) { - if (Array.isArray(attr.type)) { - var valid = Object.create(null); - attr.type.forEach(function(val) { - valid[val.value || val] = val.alias || val; - }); - var missingValueDefault = attr.missing; - if (missingValueDefault===undefined) { missingValueDefault = null; } - var invalidValueDefault = attr.invalid; - if (invalidValueDefault===undefined) { invalidValueDefault = missingValueDefault; } - return { - get: function() { - var v = this._getattr(attr.name); - if (v === null) return missingValueDefault; - - v = valid[v.toLowerCase()]; - if (v !== undefined) return v; - if (invalidValueDefault !== null) return invalidValueDefault; - return v; - }, - set: function(v) { - this._setattr(attr.name, v); - } - }; - } - else if (attr.type === Boolean) { - return { - get: function() { - return this.hasAttribute(attr.name); - }, - set: function(v) { - if (v) { - this._setattr(attr.name, ''); - } - else { - this.removeAttribute(attr.name); - } - } - }; - } - else if (attr.type === Number || - attr.type === "long" || - attr.type === "unsigned long" || - attr.type === "limited unsigned long with fallback") { - return numberPropDesc(attr); - } - else if (!attr.type || attr.type === String) { - return { - get: function() { return this._getattr(attr.name) || ''; }, - set: function(v) { - if (attr.treatNullAsEmptyString && v === null) { v = ''; } - this._setattr(attr.name, v); - } - }; - } - else if (typeof attr.type === 'function') { - return attr.type(attr.name, attr); - } - throw new Error('Invalid attribute definition'); -}; - -// See http://www.whatwg.org/specs/web-apps/current-work/#reflect -// -// defval is the default value. If it is a function, then that function -// will be invoked as a method of the element to obtain the default. -// If no default is specified for a given attribute, then the default -// depends on the type of the attribute, but since this function handles -// 4 integer cases, you must specify the default value in each call -// -// min and max define a valid range for getting the attribute. -// -// setmin defines a minimum value when setting. If the value is less -// than that, then throw INDEX_SIZE_ERR. -// -// Conveniently, JavaScript's parseInt function appears to be -// compatible with HTML's 'rules for parsing integers' -function numberPropDesc(a) { - var def; - if(typeof a.default === 'function') { - def = a.default; - } - else if(typeof a.default === 'number') { - def = function() { return a.default; }; - } - else { - def = function() { utils.assert(false, typeof a.default); }; - } - var unsigned_long = (a.type === 'unsigned long'); - var signed_long = (a.type === 'long'); - var unsigned_fallback = (a.type === 'limited unsigned long with fallback'); - var min = a.min, max = a.max, setmin = a.setmin; - if (min === undefined) { - if (unsigned_long) min = 0; - if (signed_long) min = -0x80000000; - if (unsigned_fallback) min = 1; - } - if (max === undefined) { - if (unsigned_long || signed_long || unsigned_fallback) max = 0x7FFFFFFF; - } - - return { - get: function() { - var v = this._getattr(a.name); - var n = a.float ? parseFloat(v) : parseInt(v, 10); - if (v === null || !isFinite(n) || (min !== undefined && n < min) || (max !== undefined && n > max)) { - return def.call(this); - } - if (unsigned_long || signed_long || unsigned_fallback) { - if (!/^[ \t\n\f\r]*[-+]?[0-9]/.test(v)) { return def.call(this); } - n = n|0; // jshint ignore:line - } - return n; - }, - set: function(v) { - if (!a.float) { v = Math.floor(v); } - if (setmin !== undefined && v < setmin) { - utils.IndexSizeError(a.name + ' set to ' + v); - } - if (unsigned_long) { - v = (v < 0 || v > 0x7FFFFFFF) ? def.call(this) : - (v|0); // jshint ignore:line - } else if (unsigned_fallback) { - v = (v < 1 || v > 0x7FFFFFFF) ? def.call(this) : - (v|0); // jshint ignore:line - } else if (signed_long) { - v = (v < -0x80000000 || v > 0x7FFFFFFF) ? def.call(this) : - (v|0); // jshint ignore:line - } - this._setattr(a.name, String(v)); - } - }; -} - -// This is a utility function for setting up change handler functions -// for attributes like 'id' that require special handling when they change. -exports.registerChangeHandler = function(c, name, handler) { - var p = c.prototype; - - // If p does not already have its own _attributeChangeHandlers - // then create one for it, inheriting from the inherited - // _attributeChangeHandlers. At the top (for the Element class) the - // _attributeChangeHandlers object will be created with a null prototype. - if (!Object.prototype.hasOwnProperty.call(p, '_attributeChangeHandlers')) { - p._attributeChangeHandlers = - Object.create(p._attributeChangeHandlers || null); - } - - p._attributeChangeHandlers[name] = handler; -}; - - -/***/ }), - -/***/ 66139: -/***/ ((__unused_webpack_module, exports) => { - -/* - * This file defines Domino behaviour that can be externally configured. - * To change these settings, set the relevant global property *before* - * you call `require("domino")`. - */ - -exports.h = !globalThis.__domino_frozen__; - - -/***/ }), - -/***/ 5244: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var attributes = __webpack_require__(6548); -var isApiWritable = (__webpack_require__(66139)/* .isApiWritable */ .h); - -module.exports = function(spec, defaultConstructor, tagList, tagNameToImpl) { - var c = spec.ctor; - if (c) { - var props = spec.props || {}; - - if (spec.attributes) { - for (var n in spec.attributes) { - var attr = spec.attributes[n]; - if (typeof attr !== 'object' || Array.isArray(attr)) attr = {type: attr}; - if (!attr.name) attr.name = n.toLowerCase(); - props[n] = attributes.property(attr); - } - } - - props.constructor = { value : c, writable: isApiWritable }; - c.prototype = Object.create((spec.superclass || defaultConstructor).prototype, props); - if (spec.events) { - addEventHandlers(c, spec.events); - } - tagList[spec.name] = c; - } - else { - c = defaultConstructor; - } - - (spec.tags || spec.tag && [spec.tag] || []).forEach(function(tag) { - tagNameToImpl[tag] = c; - }); - - return c; -}; - -function EventHandlerBuilder(body, document, form, element) { - this.body = body; - this.document = document; - this.form = form; - this.element = element; -} - -EventHandlerBuilder.prototype.build = function () { - return () => {}; -}; - -function EventHandlerChangeHandler(elt, name, oldval, newval) { - var doc = elt.ownerDocument || Object.create(null); - var form = elt.form || Object.create(null); - elt[name] = new EventHandlerBuilder(newval, doc, form, elt).build(); -} - -function addEventHandlers(c, eventHandlerTypes) { - var p = c.prototype; - eventHandlerTypes.forEach(function(type) { - // Define the event handler registration IDL attribute for this type - Object.defineProperty(p, "on" + type, { - get: function() { - return this._getEventHandler(type); - }, - set: function(v) { - this._setEventHandler(type, v); - }, - }); - - // Define special behavior for the content attribute as well - attributes.registerChangeHandler(c, "on" + type, EventHandlerChangeHandler); - }); -} - - -/***/ }), - -/***/ 18196: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - -module.exports = { - Event: __webpack_require__(13441), - UIEvent: __webpack_require__(64259), - MouseEvent: __webpack_require__(21440), - CustomEvent: __webpack_require__(22112) -}; - - -/***/ }), - -/***/ 96324: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var Node = __webpack_require__(97537); -var Element = __webpack_require__(77301); -var CSSStyleDeclaration = __webpack_require__(53141); -var utils = __webpack_require__(89076); -var URLUtils = __webpack_require__(65531); -var defineElement = __webpack_require__(5244); - -var htmlElements = exports.elements = {}; -var htmlNameToImpl = Object.create(null); - -exports.createElement = function(doc, localName, prefix) { - var impl = htmlNameToImpl[localName] || HTMLUnknownElement; - return new impl(doc, localName, prefix); -}; - -function define(spec) { - return defineElement(spec, HTMLElement, htmlElements, htmlNameToImpl); -} - -function URL(attr) { - return { - get: function() { - var v = this._getattr(attr); - if (v === null) { return ''; } - var url = this.doc._resolve(v); - return (url === null) ? v : url; - }, - set: function(value) { - this._setattr(attr, value); - } - }; -} - -function CORS(attr) { - return { - get: function() { - var v = this._getattr(attr); - if (v === null) { return null; } - if (v.toLowerCase() === 'use-credentials') { return 'use-credentials'; } - return 'anonymous'; - }, - set: function(value) { - if (value===null || value===undefined) { - this.removeAttribute(attr); - } else { - this._setattr(attr, value); - } - } - }; -} - -const REFERRER = { - type: ["", "no-referrer", "no-referrer-when-downgrade", "same-origin", "origin", "strict-origin", "origin-when-cross-origin", "strict-origin-when-cross-origin", "unsafe-url"], - missing: '', -}; - - -// XXX: the default value for tabIndex should be 0 if the element is -// focusable and -1 if it is not. But the full definition of focusable -// is actually hard to compute, so for now, I'll follow Firefox and -// just base the default value on the type of the element. -var focusableElements = { - "A":true, "LINK":true, "BUTTON":true, "INPUT":true, - "SELECT":true, "TEXTAREA":true, "COMMAND":true -}; - -var HTMLFormElement = function(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - this._form = null; // Prevent later deoptimization -}; - -var HTMLElement = exports.HTMLElement = define({ - superclass: Element, - name: 'HTMLElement', - ctor: function HTMLElement(doc, localName, prefix) { - Element.call(this, doc, localName, utils.NAMESPACE.HTML, prefix); - }, - props: { - dangerouslySetInnerHTML: { - set: function (v) { - this._innerHTML = v; - }, - }, - innerHTML: { - get: function() { - return this.serialize(); - }, - set: function(v) { - var parser = this.ownerDocument.implementation.mozHTMLParser( - this.ownerDocument._address, - this); - parser.parse(v===null ? '' : String(v), true); - - // Remove any existing children of this node - var target = (this instanceof htmlNameToImpl.template) ? - this.content : this; - while(target.hasChildNodes()) - target.removeChild(target.firstChild); - - // Now copy newly parsed children to this node - target.appendChild(parser._asDocumentFragment()); - } - }, - style: { get: function() { - if (!this._style) - this._style = new CSSStyleDeclaration(this); - return this._style; - }, set: function(v) { - if (v===null||v===undefined) { v = ''; } - this._setattr('style', String(v)); - }}, - - // These can't really be implemented server-side in a reasonable way. - blur: { value: function() {}}, - focus: { value: function() {}}, - forceSpellCheck: { value: function() {}}, - - click: { value: function() { - if (this._click_in_progress) return; - this._click_in_progress = true; - try { - if (this._pre_click_activation_steps) - this._pre_click_activation_steps(); - - var event = this.ownerDocument.createEvent("MouseEvent"); - event.initMouseEvent("click", true, true, - this.ownerDocument.defaultView, 1, - 0, 0, 0, 0, - // These 4 should be initialized with - // the actually current keyboard state - // somehow... - false, false, false, false, - 0, null - ); - - // Dispatch this as an untrusted event since it is synthetic - var success = this.dispatchEvent(event); - - if (success) { - if (this._post_click_activation_steps) - this._post_click_activation_steps(event); - } - else { - if (this._cancelled_activation_steps) - this._cancelled_activation_steps(); - } - } - finally { - this._click_in_progress = false; - } - }}, - submit: { value: utils.nyi }, - }, - attributes: { - title: String, - lang: String, - dir: {type: ["ltr", "rtl", "auto"], missing: ''}, - draggable: {type: ["true", "false"], treatNullAsEmptyString: true }, - spellcheck: {type: ["true", "false"], missing: ''}, - enterKeyHint: {type: ["enter", "done", "go", "next", "previous", "search", "send"], missing: ''}, - autoCapitalize: {type: ["off", "on", "none", "sentences", "words", "characters"], missing: '' }, - autoFocus: Boolean, - accessKey: String, - nonce: String, - hidden: Boolean, - translate: {type: ["no", "yes"], missing: '' }, - tabIndex: {type: "long", default: function() { - if (this.tagName in focusableElements || - this.contentEditable) - return 0; - else - return -1; - }} - }, - events: [ - "abort", "canplay", "canplaythrough", "change", "click", "contextmenu", - "cuechange", "dblclick", "drag", "dragend", "dragenter", "dragleave", - "dragover", "dragstart", "drop", "durationchange", "emptied", "ended", - "input", "invalid", "keydown", "keypress", "keyup", "loadeddata", - "loadedmetadata", "loadstart", "mousedown", "mousemove", "mouseout", - "mouseover", "mouseup", "mousewheel", "pause", "play", "playing", - "progress", "ratechange", "readystatechange", "reset", "seeked", - "seeking", "select", "show", "stalled", "submit", "suspend", - "timeupdate", "volumechange", "waiting", - - // These last 5 event types will be overriden by HTMLBodyElement - "blur", "error", "focus", "load", "scroll" - ] -}); - - -// XXX: reflect contextmenu as contextMenu, with element type - - -// style: the spec doesn't call this a reflected attribute. -// may want to handle it manually. - -// contentEditable: enumerated, not clear if it is actually -// reflected or requires custom getter/setter. Not listed as -// "limited to known values". Raises syntax_err on bad setting, -// so I think this is custom. - -// contextmenu: content is element id, idl type is an element -// draggable: boolean, but not a reflected attribute -// dropzone: reflected SettableTokenList, experimental, so don't -// implement it right away. - -// data-* attributes: need special handling in setAttribute? -// Or maybe that isn't necessary. Can I just scan the attribute list -// when building the dataset? Liveness and caching issues? - -// microdata attributes: many are simple reflected attributes, but -// I'm not going to implement this now. - - -var HTMLUnknownElement = define({ - name: 'HTMLUnknownElement', - ctor: function HTMLUnknownElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - - -var formAssociatedProps = { - // See http://www.w3.org/TR/html5/association-of-controls-and-forms.html#form-owner - form: { get: function() { - return this._form; - }} -}; - -define({ - tag: 'a', - name: 'HTMLAnchorElement', - ctor: function HTMLAnchorElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - _post_click_activation_steps: { value: function(e) { - if (this.href) { - // Follow the link - // XXX: this is just a quick hack - // XXX: the HTML spec probably requires more than this - this.ownerDocument.defaultView.location = this.href; - } - }}, - }, - attributes: { - href: URL, - ping: String, - download: String, - target: String, - rel: String, - media: String, - hreflang: String, - type: String, - referrerPolicy: REFERRER, - // Obsolete - coords: String, - charset: String, - name: String, - rev: String, - shape: String, - } -}); -// Latest WhatWG spec says these methods come via HTMLHyperlinkElementUtils -URLUtils._inherit(htmlNameToImpl.a.prototype); - -define({ - tag: 'area', - name: 'HTMLAreaElement', - ctor: function HTMLAreaElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - alt: String, - target: String, - download: String, - rel: String, - media: String, - href: URL, - hreflang: String, - type: String, - shape: String, - coords: String, - ping: String, - // XXX: also reflect relList - referrerPolicy: REFERRER, - // Obsolete - noHref: Boolean, - } -}); -// Latest WhatWG spec says these methods come via HTMLHyperlinkElementUtils -URLUtils._inherit(htmlNameToImpl.area.prototype); - -define({ - tag: 'br', - name: 'HTMLBRElement', - ctor: function HTMLBRElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - clear: String - }, -}); - -define({ - tag: 'base', - name: 'HTMLBaseElement', - ctor: function HTMLBaseElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - "target": String - } -}); - - -define({ - tag: 'body', - name: 'HTMLBodyElement', - ctor: function HTMLBodyElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - // Certain event handler attributes on a tag actually set - // handlers for the window rather than just that element. Define - // getters and setters for those here. Note that some of these override - // properties on HTMLElement.prototype. - // XXX: If I add support for , these have to go there, too - // XXX - // When the Window object is implemented, these attribute will have - // to work with the same-named attributes on the Window. - events: [ - "afterprint", "beforeprint", "beforeunload", "blur", "error", - "focus","hashchange", "load", "message", "offline", "online", - "pagehide", "pageshow","popstate","resize","scroll","storage","unload", - ], - attributes: { - // Obsolete - text: { type: String, treatNullAsEmptyString: true }, - link: { type: String, treatNullAsEmptyString: true }, - vLink: { type: String, treatNullAsEmptyString: true }, - aLink: { type: String, treatNullAsEmptyString: true }, - bgColor: { type: String, treatNullAsEmptyString: true }, - background: String, - } -}); - -define({ - tag: 'button', - name: 'HTMLButtonElement', - ctor: function HTMLButtonElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - name: String, - value: String, - disabled: Boolean, - autofocus: Boolean, - type: { type:["submit", "reset", "button", "menu"], missing: 'submit' }, - formTarget: String, - formAction: URL, - formNoValidate: Boolean, - formMethod: { type: ["get", "post", "dialog"], invalid: 'get', missing: '' }, - formEnctype: { type: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalid: "application/x-www-form-urlencoded", missing: '' }, - } -}); - -define({ - tag: 'dl', - name: 'HTMLDListElement', - ctor: function HTMLDListElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - compact: Boolean, - } -}); - -define({ - tag: 'data', - name: 'HTMLDataElement', - ctor: function HTMLDataElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - value: String, - } -}); - -define({ - tag: 'datalist', - name: 'HTMLDataListElement', - ctor: function HTMLDataListElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'details', - name: 'HTMLDetailsElement', - ctor: function HTMLDetailsElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - "open": Boolean - } -}); - -define({ - tag: 'div', - name: 'HTMLDivElement', - ctor: function HTMLDivElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String - } -}); - -define({ - tag: 'embed', - name: 'HTMLEmbedElement', - ctor: function HTMLEmbedElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - src: URL, - type: String, - width: String, - height: String, - // Obsolete - align: String, - name: String, - } -}); - -define({ - tag: 'fieldset', - name: 'HTMLFieldSetElement', - ctor: function HTMLFieldSetElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - disabled: Boolean, - name: String - } -}); - -define({ - tag: 'form', - name: 'HTMLFormElement', - ctor: function HTMLFormElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - action: String, - autocomplete: {type:['on', 'off'], missing: 'on'}, - name: String, - acceptCharset: {name: "accept-charset"}, - target: String, - noValidate: Boolean, - method: { type: ["get", "post", "dialog"], invalid: 'get', missing: 'get' }, - // Both enctype and encoding reflect the enctype content attribute - enctype: { type: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalid: "application/x-www-form-urlencoded", missing: "application/x-www-form-urlencoded" }, - encoding: {name: 'enctype', type: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalid: "application/x-www-form-urlencoded", missing: "application/x-www-form-urlencoded" }, - } -}); - -define({ - tag: 'hr', - name: 'HTMLHRElement', - ctor: function HTMLHRElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String, - color: String, - noShade: Boolean, - size: String, - width: String, - }, -}); - -define({ - tag: 'head', - name: 'HTMLHeadElement', - ctor: function HTMLHeadElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tags: ['h1','h2','h3','h4','h5','h6'], - name: 'HTMLHeadingElement', - ctor: function HTMLHeadingElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String, - }, -}); - -define({ - tag: 'html', - name: 'HTMLHtmlElement', - ctor: function HTMLHtmlElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - xmlns: URL, - // Obsolete - version: String - } -}); - -define({ - tag: 'iframe', - name: 'HTMLIFrameElement', - ctor: function HTMLIFrameElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - src: URL, - srcdoc: String, - name: String, - width: String, - height: String, - // XXX: sandbox is a reflected settable token list - seamless: Boolean, - allow: Boolean, - allowFullscreen: Boolean, - allowUserMedia: Boolean, - allowPaymentRequest: Boolean, - referrerPolicy: REFERRER, - loading: { type:['eager','lazy'], treatNullAsEmptyString: true }, - // Obsolete - align: String, - scrolling: String, - frameBorder: String, - longDesc: URL, - marginHeight: { type: String, treatNullAsEmptyString: true }, - marginWidth: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tag: 'img', - name: 'HTMLImageElement', - ctor: function HTMLImageElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - alt: String, - src: URL, - srcset: String, - crossOrigin: CORS, - useMap: String, - isMap: Boolean, - sizes: String, - height: { type: "unsigned long", default: 0 }, - width: { type: "unsigned long", default: 0 }, - referrerPolicy: REFERRER, - loading: { type:['eager','lazy'], missing: '' }, - // Obsolete: - name: String, - lowsrc: URL, - align: String, - hspace: { type: "unsigned long", default: 0 }, - vspace: { type: "unsigned long", default: 0 }, - longDesc: URL, - border: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tag: 'input', - name: 'HTMLInputElement', - ctor: function HTMLInputElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: { - form: formAssociatedProps.form, - _post_click_activation_steps: { value: function(e) { - if (this.type === 'checkbox') { - this.checked = !this.checked; - } - else if (this.type === 'radio') { - var group = this.form.getElementsByName(this.name); - for (var i=group.length-1; i >= 0; i--) { - var el = group[i]; - el.checked = (el === this); - } - } - }}, - }, - attributes: { - name: String, - disabled: Boolean, - autofocus: Boolean, - accept: String, - alt: String, - max: String, - min: String, - pattern: String, - placeholder: String, - step: String, - dirName: String, - defaultValue: {name: 'value'}, - multiple: Boolean, - required: Boolean, - readOnly: Boolean, - checked: Boolean, - value: String, - src: URL, - defaultChecked: {name: 'checked', type: Boolean}, - size: {type: 'unsigned long', default: 20, min: 1, setmin: 1}, - width: {type: 'unsigned long', min: 0, setmin: 0, default: 0}, - height: {type: 'unsigned long', min: 0, setmin: 0, default: 0}, - minLength: {type: 'unsigned long', min: 0, setmin: 0, default: -1}, - maxLength: {type: 'unsigned long', min: 0, setmin: 0, default: -1}, - autocomplete: String, // It's complicated - type: { type: - ["text", "hidden", "search", "tel", "url", "email", "password", - "datetime", "date", "month", "week", "time", "datetime-local", - "number", "range", "color", "checkbox", "radio", "file", "submit", - "image", "reset", "button"], - missing: 'text' }, - formTarget: String, - formNoValidate: Boolean, - formMethod: { type: ["get", "post"], invalid: 'get', missing: '' }, - formEnctype: { type: ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], invalid: "application/x-www-form-urlencoded", missing: '' }, - inputMode: { type: [ "verbatim", "latin", "latin-name", "latin-prose", "full-width-latin", "kana", "kana-name", "katakana", "numeric", "tel", "email", "url" ], missing: '' }, - // Obsolete - align: String, - useMap: String, - } -}); - -define({ - tag: 'keygen', - name: 'HTMLKeygenElement', - ctor: function HTMLKeygenElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - name: String, - disabled: Boolean, - autofocus: Boolean, - challenge: String, - keytype: { type:["rsa"], missing: '' }, - } -}); - -define({ - tag: 'li', - name: 'HTMLLIElement', - ctor: function HTMLLIElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - value: {type: "long", default: 0}, - // Obsolete - type: String, - } -}); - -define({ - tag: 'label', - name: 'HTMLLabelElement', - ctor: function HTMLLabelElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - htmlFor: {name: 'for', type: String} - } -}); - -define({ - tag: 'legend', - name: 'HTMLLegendElement', - ctor: function HTMLLegendElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String - }, -}); - -define({ - tag: 'link', - name: 'HTMLLinkElement', - ctor: function HTMLLinkElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // XXX Reflect DOMSettableTokenList sizes also DOMTokenList relList - href: URL, - rel: String, - media: String, - hreflang: String, - type: String, - crossOrigin: CORS, - nonce: String, - integrity: String, - referrerPolicy: REFERRER, - imageSizes: String, - imageSrcset: String, - // Obsolete - charset: String, - rev: String, - target: String, - } -}); - -define({ - tag: 'map', - name: 'HTMLMapElement', - ctor: function HTMLMapElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - name: String - } -}); - -define({ - tag: 'menu', - name: 'HTMLMenuElement', - ctor: function HTMLMenuElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // XXX: not quite right, default should be popup if parent element is - // popup. - type: { type: [ 'context', 'popup', 'toolbar' ], missing: 'toolbar' }, - label: String, - // Obsolete - compact: Boolean, - } -}); - -define({ - tag: 'meta', - name: 'HTMLMetaElement', - ctor: function HTMLMetaElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - name: String, - content: String, - httpEquiv: {name: 'http-equiv', type: String}, - // Obsolete - scheme: String, - } -}); - -define({ - tag: 'meter', - name: 'HTMLMeterElement', - ctor: function HTMLMeterElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps -}); - -define({ - tags: ['ins', 'del'], - name: 'HTMLModElement', - ctor: function HTMLModElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - cite: URL, - dateTime: String - } -}); - -define({ - tag: 'ol', - name: 'HTMLOListElement', - ctor: function HTMLOListElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - // Utility function (see the start attribute default value). Returns - // the number of
  • children of this element - _numitems: { get: function() { - var items = 0; - this.childNodes.forEach(function(n) { - if (n.nodeType === Node.ELEMENT_NODE && n.tagName === "LI") - items++; - }); - return items; - }} - }, - attributes: { - type: String, - reversed: Boolean, - start: { - type: "long", - default: function() { - // The default value of the start attribute is 1 unless the list is - // reversed. Then it is the # of li children - if (this.reversed) - return this._numitems; - else - return 1; - } - }, - // Obsolete - compact: Boolean, - } -}); - -define({ - tag: 'object', - name: 'HTMLObjectElement', - ctor: function HTMLObjectElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - data: URL, - type: String, - name: String, - useMap: String, - typeMustMatch: Boolean, - width: String, - height: String, - // Obsolete - align: String, - archive: String, - code: String, - declare: Boolean, - hspace: { type: "unsigned long", default: 0 }, - standby: String, - vspace: { type: "unsigned long", default: 0 }, - codeBase: URL, - codeType: String, - border: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tag: 'optgroup', - name: 'HTMLOptGroupElement', - ctor: function HTMLOptGroupElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - disabled: Boolean, - label: String - } -}); - -define({ - tag: 'option', - name: 'HTMLOptionElement', - ctor: function HTMLOptionElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - form: { get: function() { - var p = this.parentNode; - while (p && p.nodeType === Node.ELEMENT_NODE) { - if (p.localName === 'select') return p.form; - p = p.parentNode; - } - }}, - value: { - get: function() { return this._getattr('value') || this.text; }, - set: function(v) { this._setattr('value', v); }, - }, - text: { - get: function() { - // Strip and collapse whitespace - return this.textContent.replace(/[ \t\n\f\r]+/g, ' ').trim(); - }, - set: function(v) { this.textContent = v; }, - }, - // missing: index - }, - attributes: { - disabled: Boolean, - defaultSelected: {name: 'selected', type: Boolean}, - label: String, - } -}); - -define({ - tag: 'output', - name: 'HTMLOutputElement', - ctor: function HTMLOutputElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - // XXX Reflect for/htmlFor as a settable token list - name: String - } -}); - -define({ - tag: 'p', - name: 'HTMLParagraphElement', - ctor: function HTMLParagraphElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String - } -}); - -define({ - tag: 'param', - name: 'HTMLParamElement', - ctor: function HTMLParamElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - name: String, - value: String, - // Obsolete - type: String, - valueType: String, - } -}); - -define({ - tags: ['pre',/*legacy elements:*/'listing','xmp'], - name: 'HTMLPreElement', - ctor: function HTMLPreElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - width: { type: "long", default: 0 }, - } -}); - -define({ - tag: 'progress', - name: 'HTMLProgressElement', - ctor: function HTMLProgressElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: formAssociatedProps, - attributes: { - max: {type: Number, float: true, default: 1.0, min: 0} - } -}); - -define({ - tags: ['q', 'blockquote'], - name: 'HTMLQuoteElement', - ctor: function HTMLQuoteElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - cite: URL - } -}); - -define({ - tag: 'script', - name: 'HTMLScriptElement', - ctor: function HTMLScriptElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - text: { - get: function() { - var s = ""; - for(var i = 0, n = this.childNodes.length; i < n; i++) { - var child = this.childNodes[i]; - if (child.nodeType === Node.TEXT_NODE) - s += child._data; - } - return s; - }, - set: function(value) { - this.removeChildren(); - if (value !== null && value !== "") { - this.appendChild(this.ownerDocument.createTextNode(value)); - } - } - } - }, - attributes: { - src: URL, - type: String, - charset: String, - referrerPolicy: REFERRER, - defer: Boolean, - async: Boolean, - nomodule: Boolean, - crossOrigin: CORS, - nonce: String, - integrity: String, - } -}); - -define({ - tag: 'select', - name: 'HTMLSelectElement', - ctor: function HTMLSelectElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: { - form: formAssociatedProps.form, - options: { get: function() { - return this.getElementsByTagName('option'); - }} - }, - attributes: { - autocomplete: String, // It's complicated - name: String, - disabled: Boolean, - autofocus: Boolean, - multiple: Boolean, - required: Boolean, - size: {type: "unsigned long", default: 0} - } -}); - -define({ - tag: 'span', - name: 'HTMLSpanElement', - ctor: function HTMLSpanElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'style', - name: 'HTMLStyleElement', - ctor: function HTMLStyleElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - media: String, - type: String, - scoped: Boolean - } -}); - -define({ - tag: 'caption', - name: 'HTMLTableCaptionElement', - ctor: function HTMLTableCaptionElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - // Obsolete - align: String, - } -}); - - -define({ - name: 'HTMLTableCellElement', - ctor: function HTMLTableCellElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - colSpan: {type: "unsigned long", default: 1}, - rowSpan: {type: "unsigned long", default: 1}, - //XXX Also reflect settable token list headers - scope: { type: ['row','col','rowgroup','colgroup'], missing: '' }, - abbr: String, - // Obsolete - align: String, - axis: String, - height: String, - width: String, - ch: { name: 'char', type: String }, - chOff: { name: 'charoff', type: String }, - noWrap: Boolean, - vAlign: String, - bgColor: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tags: ['col', 'colgroup'], - name: 'HTMLTableColElement', - ctor: function HTMLTableColElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - span: {type: 'limited unsigned long with fallback', default: 1, min: 1}, - // Obsolete - align: String, - ch: { name: 'char', type: String }, - chOff: { name: 'charoff', type: String }, - vAlign: String, - width: String, - } -}); - -define({ - tag: 'table', - name: 'HTMLTableElement', - ctor: function HTMLTableElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - rows: { get: function() { - return this.getElementsByTagName('tr'); - }} - }, - attributes: { - // Obsolete - align: String, - border: String, - frame: String, - rules: String, - summary: String, - width: String, - bgColor: { type: String, treatNullAsEmptyString: true }, - cellPadding: { type: String, treatNullAsEmptyString: true }, - cellSpacing: { type: String, treatNullAsEmptyString: true }, - } -}); - -define({ - tag: 'template', - name: 'HTMLTemplateElement', - ctor: function HTMLTemplateElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - this._contentFragment = doc._templateDoc.createDocumentFragment(); - }, - props: { - content: { get: function() { return this._contentFragment; } }, - serialize: { value: function() { return this.content.serialize(); } } - } -}); - -define({ - tag: 'tr', - name: 'HTMLTableRowElement', - ctor: function HTMLTableRowElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - cells: { get: function() { - return this.querySelectorAll('td,th'); - }} - }, - attributes: { - // Obsolete - align: String, - ch: { name: 'char', type: String }, - chOff: { name: 'charoff', type: String }, - vAlign: String, - bgColor: { type: String, treatNullAsEmptyString: true }, - }, -}); - -define({ - tags: ['thead', 'tfoot', 'tbody'], - name: 'HTMLTableSectionElement', - ctor: function HTMLTableSectionElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - rows: { get: function() { - return this.getElementsByTagName('tr'); - }} - }, - attributes: { - // Obsolete - align: String, - ch: { name: 'char', type: String }, - chOff: { name: 'charoff', type: String }, - vAlign: String, - } -}); - -define({ - tag: 'textarea', - name: 'HTMLTextAreaElement', - ctor: function HTMLTextAreaElement(doc, localName, prefix) { - HTMLFormElement.call(this, doc, localName, prefix); - }, - props: { - form: formAssociatedProps.form, - type: { get: function() { return 'textarea'; } }, - defaultValue: { - get: function() { return this.textContent; }, - set: function(v) { this.textContent = v; }, - }, - value: { - get: function() { return this.defaultValue; /* never dirty */ }, - set: function(v) { - // This isn't completely correct: according to the spec, this - // should "dirty" the API value, and result in - // `this.value !== this.defaultValue`. But for most of what - // folks want to do, this implementation should be fine: - this.defaultValue = v; - }, - }, - textLength: { get: function() { return this.value.length; } }, - }, - attributes: { - autocomplete: String, // It's complicated - name: String, - disabled: Boolean, - autofocus: Boolean, - placeholder: String, - wrap: String, - dirName: String, - required: Boolean, - readOnly: Boolean, - rows: {type: 'limited unsigned long with fallback', default: 2 }, - cols: {type: 'limited unsigned long with fallback', default: 20 }, - maxLength: {type: 'unsigned long', min: 0, setmin: 0, default: -1}, - minLength: {type: 'unsigned long', min: 0, setmin: 0, default: -1}, - inputMode: { type: [ "verbatim", "latin", "latin-name", "latin-prose", "full-width-latin", "kana", "kana-name", "katakana", "numeric", "tel", "email", "url" ], missing: '' }, - } -}); - -define({ - tag: 'time', - name: 'HTMLTimeElement', - ctor: function HTMLTimeElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - dateTime: String, - pubDate: Boolean - } -}); - -define({ - tag: 'title', - name: 'HTMLTitleElement', - ctor: function HTMLTitleElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - text: { get: function() { - return this.textContent; - }} - } -}); - -define({ - tag: 'ul', - name: 'HTMLUListElement', - ctor: function HTMLUListElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - type: String, - // Obsolete - compact: Boolean, - } -}); - -define({ - name: 'HTMLMediaElement', - ctor: function HTMLMediaElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - src: URL, - crossOrigin: CORS, - preload: { type:["metadata", "none", "auto", {value: "", alias: "auto"}], missing: 'auto' }, - loop: Boolean, - autoplay: Boolean, - mediaGroup: String, - controls: Boolean, - defaultMuted: {name: "muted", type: Boolean} - } -}); - -define({ - name: 'HTMLAudioElement', - tag: 'audio', - superclass: htmlElements.HTMLMediaElement, - ctor: function HTMLAudioElement(doc, localName, prefix) { - htmlElements.HTMLMediaElement.call(this, doc, localName, prefix); - } -}); - -define({ - name: 'HTMLVideoElement', - tag: 'video', - superclass: htmlElements.HTMLMediaElement, - ctor: function HTMLVideoElement(doc, localName, prefix) { - htmlElements.HTMLMediaElement.call(this, doc, localName, prefix); - }, - attributes: { - poster: URL, - width: {type: "unsigned long", min: 0, default: 0 }, - height: {type: "unsigned long", min: 0, default: 0 } - } -}); - -define({ - tag: 'td', - name: 'HTMLTableDataCellElement', - superclass: htmlElements.HTMLTableCellElement, - ctor: function HTMLTableDataCellElement(doc, localName, prefix) { - htmlElements.HTMLTableCellElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'th', - name: 'HTMLTableHeaderCellElement', - superclass: htmlElements.HTMLTableCellElement, - ctor: function HTMLTableHeaderCellElement(doc, localName, prefix) { - htmlElements.HTMLTableCellElement.call(this, doc, localName, prefix); - }, -}); - -define({ - tag: 'frameset', - name: 'HTMLFrameSetElement', - ctor: function HTMLFrameSetElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'frame', - name: 'HTMLFrameElement', - ctor: function HTMLFrameElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - } -}); - -define({ - tag: 'canvas', - name: 'HTMLCanvasElement', - ctor: function HTMLCanvasElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - getContext: { value: utils.nyi }, - probablySupportsContext: { value: utils.nyi }, - setContext: { value: utils.nyi }, - transferControlToProxy: { value: utils.nyi }, - toDataURL: { value: utils.nyi }, - toBlob: { value: utils.nyi } - }, - attributes: { - width: { type: "unsigned long", default: 300}, - height: { type: "unsigned long", default: 150} - } -}); - -define({ - tag: 'dialog', - name: 'HTMLDialogElement', - ctor: function HTMLDialogElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - show: { value: utils.nyi }, - showModal: { value: utils.nyi }, - close: { value: utils.nyi } - }, - attributes: { - open: Boolean, - returnValue: String - } -}); - -define({ - tag: 'menuitem', - name: 'HTMLMenuItemElement', - ctor: function HTMLMenuItemElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - props: { - // The menuitem's label - _label: { - get: function() { - var val = this._getattr('label'); - if (val !== null && val !== '') { return val; } - val = this.textContent; - // Strip and collapse whitespace - return val.replace(/[ \t\n\f\r]+/g, ' ').trim(); - } - }, - // The menuitem label IDL attribute - label: { - get: function() { - var val = this._getattr('label'); - if (val !== null) { return val; } - return this._label; - }, - set: function(v) { - this._setattr('label', v); - }, - } - }, - attributes: { - type: { type: ["command","checkbox","radio"], missing: 'command' }, - icon: URL, - disabled: Boolean, - checked: Boolean, - radiogroup: String, - default: Boolean - } -}); - -define({ - tag: 'source', - name: 'HTMLSourceElement', - ctor: function HTMLSourceElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - srcset: String, - sizes: String, - media: String, - src: URL, - type: String, - width: String, - height: String, - } -}); - -define({ - tag: 'track', - name: 'HTMLTrackElement', - ctor: function HTMLTrackElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - src: URL, - srclang: String, - label: String, - default: Boolean, - kind: { type: ["subtitles", "captions", "descriptions", "chapters", "metadata"], missing: 'subtitles', invalid: 'metadata' }, - }, - props: { - NONE: { get: function() { return 0; } }, - LOADING: { get: function() { return 1; } }, - LOADED: { get: function() { return 2; } }, - ERROR: { get: function() { return 3; } }, - readyState: { get: utils.nyi }, - track: { get: utils.nyi } - } -}); - -define({ - // obsolete - tag: 'font', - name: 'HTMLFontElement', - ctor: function HTMLFontElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - color: { type: String, treatNullAsEmptyString: true }, - face: { type: String }, - size: { type: String }, - }, -}); - -define({ - // obsolete - tag: 'dir', - name: 'HTMLDirectoryElement', - ctor: function HTMLDirectoryElement(doc, localName, prefix) { - HTMLElement.call(this, doc, localName, prefix); - }, - attributes: { - compact: Boolean, - }, -}); - -define({ - tags: [ - "abbr", "address", "article", "aside", "b", "bdi", "bdo", "cite", "content", "code", - "dd", "dfn", "dt", "em", "figcaption", "figure", "footer", "header", "hgroup", "i", "kbd", - "main", "mark", "nav", "noscript", "rb", "rp", "rt", "rtc", - "ruby", "s", "samp", "section", "small", "strong", "sub", "summary", "sup", "u", "var", "wbr", - // Legacy elements - "acronym", "basefont", "big", "center", "nobr", "noembed", "noframes", - "plaintext", "strike", "tt" - ] -}); - - -/***/ }), - -/***/ 31575: -/***/ ((module, exports, __webpack_require__) => { - -"use strict"; - -var utils = __webpack_require__(89076); - -exports = module.exports = { - CSSStyleDeclaration: __webpack_require__(53141), - CharacterData: __webpack_require__(90086), - Comment: __webpack_require__(17548), - DOMException: __webpack_require__(46364), - DOMImplementation: __webpack_require__(80931), - DOMTokenList: __webpack_require__(82840), - Document: __webpack_require__(35452), - DocumentFragment: __webpack_require__(17948), - DocumentType: __webpack_require__(73092), - Element: __webpack_require__(77301), - HTMLParser: __webpack_require__(91895), - NamedNodeMap: __webpack_require__(49492), - Node: __webpack_require__(97537), - NodeList: __webpack_require__(64965), - NodeFilter: __webpack_require__(383), - ProcessingInstruction: __webpack_require__(81248), - Text: __webpack_require__(58210), - Window: __webpack_require__(21865) -}; - -utils.merge(exports, __webpack_require__(18196)); -utils.merge(exports, (__webpack_require__(96324).elements)); -utils.merge(exports, (__webpack_require__(967).elements)); - - -/***/ }), - -/***/ 31993: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var DOMImplementation = __webpack_require__(80931); -var HTMLParser = __webpack_require__(91895); -var Window = __webpack_require__(21865); -var impl = __webpack_require__(31575); - -exports.createDOMImplementation = function() { - return new DOMImplementation(null); -}; - -exports.createDocument = function(html, force) { - // Previous API couldn't let you pass '' as a document, and that - // yields a slightly different document than createHTMLDocument('') - // does. The new `force` parameter lets you pass '' if you want to. - if (html || force) { - var parser = new HTMLParser(); - parser.parse(html || '', true); - return parser.document(); - } - return new DOMImplementation(null).createHTMLDocument(""); -}; - -exports.createIncrementalHTMLParser = function() { - var parser = new HTMLParser(); - /** API for incremental parser. */ - return { - /** Provide an additional chunk of text to be parsed. */ - write: function(s) { - if (s.length > 0) { - parser.parse(s, false, function() { return true; }); - } - }, - /** - * Signal that we are done providing input text, optionally - * providing one last chunk as a parameter. - */ - end: function(s) { - parser.parse(s || '', true, function() { return true; }); - }, - /** - * Performs a chunk of parsing work, returning at the end of - * the next token as soon as shouldPauseFunc() returns true. - * Returns true iff there is more work to do. - * - * For example: - * ``` - * var incrParser = domino.createIncrementalHTMLParser(); - * incrParser.end('...long html document...'); - * while (true) { - * // Pause every 10ms - * var start = Date.now(); - * var pauseIn10 = function() { return (Date.now() - start) >= 10; }; - * if (!incrParser.process(pauseIn10)) { - * break; - * } - * ...yield to other tasks, do other housekeeping, etc... - * } - * ``` - */ - process: function(shouldPauseFunc) { - return parser.parse('', false, shouldPauseFunc); - }, - /** - * Returns the result of the incremental parse. Valid after - * `this.end()` has been called and `this.process()` has returned - * false. - */ - document: function() { - return parser.document(); - }, - }; -}; - -exports.createWindow = function(html, address) { - var document = exports.createDocument(html); - if (address !== undefined) { document._address = address; } - return new impl.Window(document); -}; - -exports.impl = impl; - -/***/ }), - -/***/ 23509: -/***/ ((module, exports) => { - -"use strict"; - -/* jshint eqnull: true */ -/** - * Zest (https://github.com/chjj/zest) - * A css selector engine. - * Copyright (c) 2011-2012, Christopher Jeffrey. (MIT Licensed) - * Domino version based on Zest v0.1.3 with bugfixes applied. - */ - -/** - * Helpers - */ - -var window = Object.create(null, { - location: { get: function() { - throw new Error('window.location is not supported.'); - } } -}); - -var compareDocumentPosition = function(a, b) { - return a.compareDocumentPosition(b); -}; - -var order = function(a, b) { - /* jshint bitwise: false */ - return compareDocumentPosition(a, b) & 2 ? 1 : -1; -}; - -var next = function(el) { - while ((el = el.nextSibling) - && el.nodeType !== 1); - return el; -}; - -var prev = function(el) { - while ((el = el.previousSibling) - && el.nodeType !== 1); - return el; -}; - -var child = function(el) { - /*jshint -W084 */ - if (el = el.firstChild) { - while (el.nodeType !== 1 - && (el = el.nextSibling)); - } - return el; -}; - -var lastChild = function(el) { - /*jshint -W084 */ - if (el = el.lastChild) { - while (el.nodeType !== 1 - && (el = el.previousSibling)); - } - return el; -}; - -var parentIsElement = function(n) { - if (!n.parentNode) { return false; } - var nodeType = n.parentNode.nodeType; - // The root `html` element can be a first- or last-child, too. - return nodeType === 1 || nodeType === 9; -}; - -var unquote = function(str) { - if (!str) return str; - var ch = str[0]; - if (ch === '"' || ch === '\'') { - if (str[str.length-1] === ch) { - str = str.slice(1, -1); - } else { - // bad string. - str = str.slice(1); - } - return str.replace(rules.str_escape, function(s) { - var m = /^\\(?:([0-9A-Fa-f]+)|([\r\n\f]+))/.exec(s); - if (!m) { return s.slice(1); } - if (m[2]) { return ''; /* escaped newlines are ignored in strings. */ } - var cp = parseInt(m[1], 16); - return String.fromCodePoint ? String.fromCodePoint(cp) : - // Not all JavaScript implementations have String.fromCodePoint yet. - String.fromCharCode(cp); - }); - } else if (rules.ident.test(str)) { - return decodeid(str); - } else { - // NUMBER, PERCENTAGE, DIMENSION, etc - return str; - } -}; - -var decodeid = function(str) { - return str.replace(rules.escape, function(s) { - var m = /^\\([0-9A-Fa-f]+)/.exec(s); - if (!m) { return s[1]; } - var cp = parseInt(m[1], 16); - return String.fromCodePoint ? String.fromCodePoint(cp) : - // Not all JavaScript implementations have String.fromCodePoint yet. - String.fromCharCode(cp); - }); -}; - -var indexOf = (function() { - if (Array.prototype.indexOf) { - return Array.prototype.indexOf; - } - return function(obj, item) { - var i = this.length; - while (i--) { - if (this[i] === item) return i; - } - return -1; - }; -})(); - -var makeInside = function(start, end) { - var regex = rules.inside.source - .replace(//g, end); - - return new RegExp(regex); -}; - -var replace = function(regex, name, val) { - regex = regex.source; - regex = regex.replace(name, val.source || val); - return new RegExp(regex); -}; - -var truncateUrl = function(url, num) { - return url - .replace(/^(?:\w+:\/\/|\/+)/, '') - .replace(/(?:\/+|\/*#.*?)$/, '') - .split('/', num) - .join('/'); -}; - -/** - * Handle `nth` Selectors - */ - -var parseNth = function(param_, test) { - var param = param_.replace(/\s+/g, '') - , cap; - - if (param === 'even') { - param = '2n+0'; - } else if (param === 'odd') { - param = '2n+1'; - } else if (param.indexOf('n') === -1) { - param = '0n' + param; - } - - cap = /^([+-])?(\d+)?n([+-])?(\d+)?$/.exec(param); - - return { - group: cap[1] === '-' - ? -(cap[2] || 1) - : +(cap[2] || 1), - offset: cap[4] - ? (cap[3] === '-' ? -cap[4] : +cap[4]) - : 0 - }; -}; - -var nth = function(param_, test, last) { - var param = parseNth(param_) - , group = param.group - , offset = param.offset - , find = !last ? child : lastChild - , advance = !last ? next : prev; - - return function(el) { - if (!parentIsElement(el)) return; - - var rel = find(el.parentNode) - , pos = 0; - - while (rel) { - if (test(rel, el)) pos++; - if (rel === el) { - pos -= offset; - return group && pos - ? (pos % group) === 0 && (pos < 0 === group < 0) - : !pos; - } - rel = advance(rel); - } - }; -}; - -/** - * Simple Selectors - */ - -var selectors = { - '*': (function() { - if (false/*function() { - var el = document.createElement('div'); - el.appendChild(document.createComment('')); - return !!el.getElementsByTagName('*')[0]; - }()*/) {} - return function() { - return true; - }; - })(), - 'type': function(type) { - type = type.toLowerCase(); - return function(el) { - return el.nodeName.toLowerCase() === type; - }; - }, - 'attr': function(key, op, val, i) { - op = operators[op]; - return function(el) { - var attr; - switch (key) { - case 'for': - attr = el.htmlFor; - break; - case 'class': - // className is '' when non-existent - // getAttribute('class') is null - attr = el.className; - if (attr === '' && el.getAttribute('class') == null) { - attr = null; - } - break; - case 'href': - case 'src': - attr = el.getAttribute(key, 2); - break; - case 'title': - // getAttribute('title') can be '' when non-existent sometimes? - attr = el.getAttribute('title') || null; - break; - // careful with attributes with special getter functions - case 'id': - case 'lang': - case 'dir': - case 'accessKey': - case 'hidden': - case 'tabIndex': - case 'style': - if (el.getAttribute) { - attr = el.getAttribute(key); - break; - } - /* falls through */ - default: - if (el.hasAttribute && !el.hasAttribute(key)) { - break; - } - attr = el[key] != null - ? el[key] - : el.getAttribute && el.getAttribute(key); - break; - } - if (attr == null) return; - attr = attr + ''; - if (i) { - attr = attr.toLowerCase(); - val = val.toLowerCase(); - } - return op(attr, val); - }; - }, - ':first-child': function(el) { - return !prev(el) && parentIsElement(el); - }, - ':last-child': function(el) { - return !next(el) && parentIsElement(el); - }, - ':only-child': function(el) { - return !prev(el) && !next(el) && parentIsElement(el); - }, - ':nth-child': function(param, last) { - return nth(param, function() { - return true; - }, last); - }, - ':nth-last-child': function(param) { - return selectors[':nth-child'](param, true); - }, - ':root': function(el) { - return el.ownerDocument.documentElement === el; - }, - ':empty': function(el) { - return !el.firstChild; - }, - ':not': function(sel) { - var test = compileGroup(sel); - return function(el) { - return !test(el); - }; - }, - ':first-of-type': function(el) { - if (!parentIsElement(el)) return; - var type = el.nodeName; - /*jshint -W084 */ - while (el = prev(el)) { - if (el.nodeName === type) return; - } - return true; - }, - ':last-of-type': function(el) { - if (!parentIsElement(el)) return; - var type = el.nodeName; - /*jshint -W084 */ - while (el = next(el)) { - if (el.nodeName === type) return; - } - return true; - }, - ':only-of-type': function(el) { - return selectors[':first-of-type'](el) - && selectors[':last-of-type'](el); - }, - ':nth-of-type': function(param, last) { - return nth(param, function(rel, el) { - return rel.nodeName === el.nodeName; - }, last); - }, - ':nth-last-of-type': function(param) { - return selectors[':nth-of-type'](param, true); - }, - ':checked': function(el) { - return !!(el.checked || el.selected); - }, - ':indeterminate': function(el) { - return !selectors[':checked'](el); - }, - ':enabled': function(el) { - return !el.disabled && el.type !== 'hidden'; - }, - ':disabled': function(el) { - return !!el.disabled; - }, - ':target': function(el) { - return el.id === window.location.hash.substring(1); - }, - ':focus': function(el) { - return el === el.ownerDocument.activeElement; - }, - ':is': function(sel) { - return compileGroup(sel); - }, - // :matches is an older name for :is; see - // https://github.com/w3c/csswg-drafts/issues/3258 - ':matches': function(sel) { - return selectors[':is'](sel); - }, - ':nth-match': function(param, last) { - var args = param.split(/\s*,\s*/) - , arg = args.shift() - , test = compileGroup(args.join(',')); - - return nth(arg, test, last); - }, - ':nth-last-match': function(param) { - return selectors[':nth-match'](param, true); - }, - ':links-here': function(el) { - return el + '' === window.location + ''; - }, - ':lang': function(param) { - return function(el) { - while (el) { - if (el.lang) return el.lang.indexOf(param) === 0; - el = el.parentNode; - } - }; - }, - ':dir': function(param) { - return function(el) { - while (el) { - if (el.dir) return el.dir === param; - el = el.parentNode; - } - }; - }, - ':scope': function(el, con) { - var context = con || el.ownerDocument; - if (context.nodeType === 9) { - return el === context.documentElement; - } - return el === context; - }, - ':any-link': function(el) { - return typeof el.href === 'string'; - }, - ':local-link': function(el) { - if (el.nodeName) { - return el.href && el.host === window.location.host; - } - var param = +el + 1; - return function(el) { - if (!el.href) return; - - var url = window.location + '' - , href = el + ''; - - return truncateUrl(url, param) === truncateUrl(href, param); - }; - }, - ':default': function(el) { - return !!el.defaultSelected; - }, - ':valid': function(el) { - return el.willValidate || (el.validity && el.validity.valid); - }, - ':invalid': function(el) { - return !selectors[':valid'](el); - }, - ':in-range': function(el) { - return el.value > el.min && el.value <= el.max; - }, - ':out-of-range': function(el) { - return !selectors[':in-range'](el); - }, - ':required': function(el) { - return !!el.required; - }, - ':optional': function(el) { - return !el.required; - }, - ':read-only': function(el) { - if (el.readOnly) return true; - - var attr = el.getAttribute('contenteditable') - , prop = el.contentEditable - , name = el.nodeName.toLowerCase(); - - name = name !== 'input' && name !== 'textarea'; - - return (name || el.disabled) && attr == null && prop !== 'true'; - }, - ':read-write': function(el) { - return !selectors[':read-only'](el); - }, - ':hover': function() { - throw new Error(':hover is not supported.'); - }, - ':active': function() { - throw new Error(':active is not supported.'); - }, - ':link': function() { - throw new Error(':link is not supported.'); - }, - ':visited': function() { - throw new Error(':visited is not supported.'); - }, - ':column': function() { - throw new Error(':column is not supported.'); - }, - ':nth-column': function() { - throw new Error(':nth-column is not supported.'); - }, - ':nth-last-column': function() { - throw new Error(':nth-last-column is not supported.'); - }, - ':current': function() { - throw new Error(':current is not supported.'); - }, - ':past': function() { - throw new Error(':past is not supported.'); - }, - ':future': function() { - throw new Error(':future is not supported.'); - }, - // Non-standard, for compatibility purposes. - ':contains': function(param) { - return function(el) { - var text = el.innerText || el.textContent || el.value || ''; - return text.indexOf(param) !== -1; - }; - }, - ':has': function(param) { - return function(el) { - return find(param, el).length > 0; - }; - } - // Potentially add more pseudo selectors for - // compatibility with sizzle and most other - // selector engines (?). -}; - -/** - * Attribute Operators - */ - -var operators = { - '-': function() { - return true; - }, - '=': function(attr, val) { - return attr === val; - }, - '*=': function(attr, val) { - return attr.indexOf(val) !== -1; - }, - '~=': function(attr, val) { - var i - , s - , f - , l; - - for (s = 0; true; s = i + 1) { - i = attr.indexOf(val, s); - if (i === -1) return false; - f = attr[i - 1]; - l = attr[i + val.length]; - if ((!f || f === ' ') && (!l || l === ' ')) return true; - } - }, - '|=': function(attr, val) { - var i = attr.indexOf(val) - , l; - - if (i !== 0) return; - l = attr[i + val.length]; - - return l === '-' || !l; - }, - '^=': function(attr, val) { - return attr.indexOf(val) === 0; - }, - '$=': function(attr, val) { - var i = attr.lastIndexOf(val); - return i !== -1 && i + val.length === attr.length; - }, - // non-standard - '!=': function(attr, val) { - return attr !== val; - } -}; - -/** - * Combinator Logic - */ - -var combinators = { - ' ': function(test) { - return function(el) { - /*jshint -W084 */ - while (el = el.parentNode) { - if (test(el)) return el; - } - }; - }, - '>': function(test) { - return function(el) { - /*jshint -W084 */ - if (el = el.parentNode) { - return test(el) && el; - } - }; - }, - '+': function(test) { - return function(el) { - /*jshint -W084 */ - if (el = prev(el)) { - return test(el) && el; - } - }; - }, - '~': function(test) { - return function(el) { - /*jshint -W084 */ - while (el = prev(el)) { - if (test(el)) return el; - } - }; - }, - 'noop': function(test) { - return function(el) { - return test(el) && el; - }; - }, - 'ref': function(test, name) { - var node; - - function ref(el) { - var doc = el.ownerDocument - , nodes = doc.getElementsByTagName('*') - , i = nodes.length; - - while (i--) { - node = nodes[i]; - if (ref.test(el)) { - node = null; - return true; - } - } - - node = null; - } - - ref.combinator = function(el) { - if (!node || !node.getAttribute) return; - - var attr = node.getAttribute(name) || ''; - if (attr[0] === '#') attr = attr.substring(1); - - if (attr === el.id && test(node)) { - return node; - } - }; - - return ref; - } -}; - -/** - * Grammar - */ - -var rules = { - escape: /\\(?:[^0-9A-Fa-f\r\n]|[0-9A-Fa-f]{1,6}[\r\n\t ]?)/g, - str_escape: /(escape)|\\(\n|\r\n?|\f)/g, - nonascii: /[\u00A0-\uFFFF]/, - cssid: /(?:(?!-?[0-9])(?:escape|nonascii|[-_a-zA-Z0-9])+)/, - qname: /^ *(cssid|\*)/, - simple: /^(?:([.#]cssid)|pseudo|attr)/, - ref: /^ *\/(cssid)\/ */, - combinator: /^(?: +([^ \w*.#\\]) +|( )+|([^ \w*.#\\]))(?! *$)/, - attr: /^\[(cssid)(?:([^\w]?=)(inside))?\]/, - pseudo: /^(:cssid)(?:\((inside)\))?/, - inside: /(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|<[^"'>]*>|\\["'>]|[^"'>])*/, - ident: /^(cssid)$/ -}; - -rules.cssid = replace(rules.cssid, 'nonascii', rules.nonascii); -rules.cssid = replace(rules.cssid, 'escape', rules.escape); -rules.qname = replace(rules.qname, 'cssid', rules.cssid); -rules.simple = replace(rules.simple, 'cssid', rules.cssid); -rules.ref = replace(rules.ref, 'cssid', rules.cssid); -rules.attr = replace(rules.attr, 'cssid', rules.cssid); -rules.pseudo = replace(rules.pseudo, 'cssid', rules.cssid); -rules.inside = replace(rules.inside, '[^"\'>]*', rules.inside); -rules.attr = replace(rules.attr, 'inside', makeInside('\\[', '\\]')); -rules.pseudo = replace(rules.pseudo, 'inside', makeInside('\\(', '\\)')); -rules.simple = replace(rules.simple, 'pseudo', rules.pseudo); -rules.simple = replace(rules.simple, 'attr', rules.attr); -rules.ident = replace(rules.ident, 'cssid', rules.cssid); -rules.str_escape = replace(rules.str_escape, 'escape', rules.escape); - -/** - * Compiling - */ - -var compile = function(sel_) { - var sel = sel_.replace(/^\s+|\s+$/g, '') - , test - , filter = [] - , buff = [] - , subject - , qname - , cap - , op - , ref; - - /*jshint -W084 */ - while (sel) { - if (cap = rules.qname.exec(sel)) { - sel = sel.substring(cap[0].length); - qname = decodeid(cap[1]); - buff.push(tok(qname, true)); - } else if (cap = rules.simple.exec(sel)) { - sel = sel.substring(cap[0].length); - qname = '*'; - buff.push(tok(qname, true)); - buff.push(tok(cap)); - } else { - throw new SyntaxError('Invalid selector.'); - } - - while (cap = rules.simple.exec(sel)) { - sel = sel.substring(cap[0].length); - buff.push(tok(cap)); - } - - if (sel[0] === '!') { - sel = sel.substring(1); - subject = makeSubject(); - subject.qname = qname; - buff.push(subject.simple); - } - - if (cap = rules.ref.exec(sel)) { - sel = sel.substring(cap[0].length); - ref = combinators.ref(makeSimple(buff), decodeid(cap[1])); - filter.push(ref.combinator); - buff = []; - continue; - } - - if (cap = rules.combinator.exec(sel)) { - sel = sel.substring(cap[0].length); - op = cap[1] || cap[2] || cap[3]; - if (op === ',') { - filter.push(combinators.noop(makeSimple(buff))); - break; - } - } else { - op = 'noop'; - } - - if (!combinators[op]) { throw new SyntaxError('Bad combinator.'); } - filter.push(combinators[op](makeSimple(buff))); - buff = []; - } - - test = makeTest(filter); - test.qname = qname; - test.sel = sel; - - if (subject) { - subject.lname = test.qname; - - subject.test = test; - subject.qname = subject.qname; - subject.sel = test.sel; - test = subject; - } - - if (ref) { - ref.test = test; - ref.qname = test.qname; - ref.sel = test.sel; - test = ref; - } - - return test; -}; - -var tok = function(cap, qname) { - // qname - if (qname) { - return cap === '*' - ? selectors['*'] - : selectors.type(cap); - } - - // class/id - if (cap[1]) { - return cap[1][0] === '.' - // XXX unescape here? or in attr? - ? selectors.attr('class', '~=', decodeid(cap[1].substring(1)), false) - : selectors.attr('id', '=', decodeid(cap[1].substring(1)), false); - } - - // pseudo-name - // inside-pseudo - if (cap[2]) { - return cap[3] - ? selectors[decodeid(cap[2])](unquote(cap[3])) - : selectors[decodeid(cap[2])]; - } - - // attr name - // attr op - // attr value - if (cap[4]) { - var value = cap[6]; - var i = /["'\s]\s*I$/i.test(value); - if (i) { - value = value.replace(/\s*I$/i, ''); - } - return selectors.attr(decodeid(cap[4]), cap[5] || '-', unquote(value), i); - } - - throw new SyntaxError('Unknown Selector.'); -}; - -var makeSimple = function(func) { - var l = func.length - , i; - - // Potentially make sure - // `el` is truthy. - if (l < 2) return func[0]; - - return function(el) { - if (!el) return; - for (i = 0; i < l; i++) { - if (!func[i](el)) return; - } - return true; - }; -}; - -var makeTest = function(func) { - if (func.length < 2) { - return function(el) { - return !!func[0](el); - }; - } - return function(el) { - var i = func.length; - while (i--) { - if (!(el = func[i](el))) return; - } - return true; - }; -}; - -var makeSubject = function() { - var target; - - function subject(el) { - var node = el.ownerDocument - , scope = node.getElementsByTagName(subject.lname) - , i = scope.length; - - while (i--) { - if (subject.test(scope[i]) && target === el) { - target = null; - return true; - } - } - - target = null; - } - - subject.simple = function(el) { - target = el; - return true; - }; - - return subject; -}; - -var compileGroup = function(sel) { - var test = compile(sel) - , tests = [ test ]; - - while (test.sel) { - test = compile(test.sel); - tests.push(test); - } - - if (tests.length < 2) return test; - - return function(el) { - var l = tests.length - , i = 0; - - for (; i < l; i++) { - if (tests[i](el)) return true; - } - }; -}; - -/** - * Selection - */ - -var find = function(sel, node) { - var results = [] - , test = compile(sel) - , scope = node.getElementsByTagName(test.qname) - , i = 0 - , el; - - /*jshint -W084 */ - while (el = scope[i++]) { - if (test(el)) results.push(el); - } - - if (test.sel) { - while (test.sel) { - test = compile(test.sel); - scope = node.getElementsByTagName(test.qname); - i = 0; - /*jshint -W084 */ - while (el = scope[i++]) { - if (test(el) && indexOf.call(results, el) === -1) { - results.push(el); - } - } - } - results.sort(order); - } - - return results; -}; - -/** - * Expose - */ - -module.exports = exports = function(sel, context) { - /* when context isn't a DocumentFragment and the selector is simple: */ - var id, r; - if (context.nodeType !== 11 && sel.indexOf(' ') === -1) { - if (sel[0] === '#' && context.rooted && /^#[A-Z_][-A-Z0-9_]*$/i.test(sel)) { - if (context.doc._hasMultipleElementsWithId) { - id = sel.substring(1); - if (!context.doc._hasMultipleElementsWithId(id)) { - r = context.doc.getElementById(id); - return r ? [r] : []; - } - } - } - if (sel[0] === '.' && /^\.\w+$/.test(sel)) { - return context.getElementsByClassName(sel.substring(1)); - } - if (/^\w+$/.test(sel)) { - return context.getElementsByTagName(sel); - } - } - /* do things the hard/slow way */ - return find(sel, context); -}; - -exports.selectors = selectors; -exports.operators = operators; -exports.combinators = combinators; - -exports.matches = function(el, sel) { - var test = { sel: sel }; - do { - test = compile(test.sel); - if (test(el)) { return true; } - } while (test.sel); - return false; -}; - - -/***/ }), - -/***/ 72636: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -// The below is a compiled copy of https://github.com/angular/angular/blob/92e41e9cb417223d9888a4c23b4c0e73188f87d0/packages/compiler/src/render3/view/style_parser.ts - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hyphenate = exports.parse = void 0; -/** - * Parses string representation of a style and converts it into object literal. - * - * @param value string representation of style as used in the `style` attribute in HTML. - * Example: `color: red; height: auto`. - * @returns An array of style property name and value pairs, e.g. `['color', 'red', 'height', - * 'auto']` - */ -function parse(value) { - // we use a string array here instead of a string map - // because a string-map is not guaranteed to retain the - // order of the entries whereas a string array can be - // constructed in a [key, value, key, value] format. - const styles = []; - let i = 0; - let parenDepth = 0; - let quote = 0; /* Char.QuoteNone */ - let valueStart = 0; - let propStart = 0; - let currentProp = null; - while (i < value.length) { - const token = value.charCodeAt(i++); - switch (token) { - case 40 /* Char.OpenParen */: - parenDepth++; - break; - case 41 /* Char.CloseParen */: - parenDepth--; - break; - case 39 /* Char.QuoteSingle */: - // valueStart needs to be there since prop values don't - // have quotes in CSS - if (quote === 0 /* Char.QuoteNone */) { - quote = 39 /* Char.QuoteSingle */; - } else if ( - quote === 39 /* Char.QuoteSingle */ && - value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */ - ) { - quote = 0 /* Char.QuoteNone */; - } - break; - case 34 /* Char.QuoteDouble */: - // same logic as above - if (quote === 0 /* Char.QuoteNone */) { - quote = 34 /* Char.QuoteDouble */; - } else if ( - quote === 34 /* Char.QuoteDouble */ && - value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */ - ) { - quote = 0 /* Char.QuoteNone */; - } - break; - case 58 /* Char.Colon */: - if ( - !currentProp && - parenDepth === 0 && - quote === 0 /* Char.QuoteNone */ - ) { - currentProp = hyphenate(value.substring(propStart, i - 1).trim()); - valueStart = i; - } - break; - case 59 /* Char.Semicolon */: - if ( - currentProp && - valueStart > 0 && - parenDepth === 0 && - quote === 0 /* Char.QuoteNone */ - ) { - const styleVal = value.substring(valueStart, i - 1).trim(); - styles.push(currentProp, styleVal); - propStart = i; - valueStart = 0; - currentProp = null; - } - break; - } - } - if (currentProp && valueStart) { - const styleVal = value.slice(valueStart).trim(); - styles.push(currentProp, styleVal); - } - return styles; -} -exports.parse = parse; -function hyphenate(value) { - return value - .replace(/[a-z][A-Z]/g, (v) => { - return v.charAt(0) + "-" + v.charAt(1); - }) - .toLowerCase(); -} -exports.hyphenate = hyphenate; - - -/***/ }), - -/***/ 967: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var Element = __webpack_require__(77301); -var defineElement = __webpack_require__(5244); -var utils = __webpack_require__(89076); -var CSSStyleDeclaration = __webpack_require__(53141); - -var svgElements = exports.elements = {}; -var svgNameToImpl = Object.create(null); - -exports.createElement = function(doc, localName, prefix) { - var impl = svgNameToImpl[localName] || SVGElement; - return new impl(doc, localName, prefix); -}; - -function define(spec) { - return defineElement(spec, SVGElement, svgElements, svgNameToImpl); -} - -var SVGElement = define({ - superclass: Element, - name: 'SVGElement', - ctor: function SVGElement(doc, localName, prefix) { - Element.call(this, doc, localName, utils.NAMESPACE.SVG, prefix); - }, - props: { - style: { get: function() { - if (!this._style) - this._style = new CSSStyleDeclaration(this); - return this._style; - }} - } -}); - -define({ - name: 'SVGSVGElement', - ctor: function SVGSVGElement(doc, localName, prefix) { - SVGElement.call(this, doc, localName, prefix); - }, - tag: 'svg', - props: { - createSVGRect: { value: function () { - return exports.createElement(this.ownerDocument, 'rect', null); - } } - } -}); - -define({ - tags: [ - 'a', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor', 'animateMotion', 'animateTransform', - 'circle', 'clipPath', 'color-profile', 'cursor', 'defs', 'desc', 'ellipse', 'feBlend', 'feColorMatrix', - 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', - 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', - 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence', 'filter', - 'font', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignObject', 'g', - 'glyph', 'glyphRef', 'hkern', 'image', 'line', 'linearGradient', 'marker', 'mask', 'metadata', 'missing-glyph', - 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'script', 'set', 'stop', 'style', - 'switch', 'symbol', 'text', 'textPath', 'title', 'tref', 'tspan', 'use', 'view', 'vkern' - ] -}); - - -/***/ }), - -/***/ 89076: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -var DOMException = __webpack_require__(46364); -var ERR = DOMException; -var isApiWritable = (__webpack_require__(66139)/* .isApiWritable */ .h); - -exports.NAMESPACE = { - HTML: 'http://www.w3.org/1999/xhtml', - XML: 'http://www.w3.org/XML/1998/namespace', - XMLNS: 'http://www.w3.org/2000/xmlns/', - MATHML: 'http://www.w3.org/1998/Math/MathML', - SVG: 'http://www.w3.org/2000/svg', - XLINK: 'http://www.w3.org/1999/xlink' -}; - -// -// Shortcut functions for throwing errors of various types. -// -exports.IndexSizeError = function() { throw new DOMException(ERR.INDEX_SIZE_ERR); }; -exports.HierarchyRequestError = function() { throw new DOMException(ERR.HIERARCHY_REQUEST_ERR); }; -exports.WrongDocumentError = function() { throw new DOMException(ERR.WRONG_DOCUMENT_ERR); }; -exports.InvalidCharacterError = function() { throw new DOMException(ERR.INVALID_CHARACTER_ERR); }; -exports.NoModificationAllowedError = function() { throw new DOMException(ERR.NO_MODIFICATION_ALLOWED_ERR); }; -exports.NotFoundError = function() { throw new DOMException(ERR.NOT_FOUND_ERR); }; -exports.NotSupportedError = function() { throw new DOMException(ERR.NOT_SUPPORTED_ERR); }; -exports.InvalidStateError = function() { throw new DOMException(ERR.INVALID_STATE_ERR); }; -exports.SyntaxError = function() { throw new DOMException(ERR.SYNTAX_ERR); }; -exports.InvalidModificationError = function() { throw new DOMException(ERR.INVALID_MODIFICATION_ERR); }; -exports.NamespaceError = function() { throw new DOMException(ERR.NAMESPACE_ERR); }; -exports.InvalidAccessError = function() { throw new DOMException(ERR.INVALID_ACCESS_ERR); }; -exports.TypeMismatchError = function() { throw new DOMException(ERR.TYPE_MISMATCH_ERR); }; -exports.SecurityError = function() { throw new DOMException(ERR.SECURITY_ERR); }; -exports.NetworkError = function() { throw new DOMException(ERR.NETWORK_ERR); }; -exports.AbortError = function() { throw new DOMException(ERR.ABORT_ERR); }; -exports.UrlMismatchError = function() { throw new DOMException(ERR.URL_MISMATCH_ERR); }; -exports.QuotaExceededError = function() { throw new DOMException(ERR.QUOTA_EXCEEDED_ERR); }; -exports.TimeoutError = function() { throw new DOMException(ERR.TIMEOUT_ERR); }; -exports.InvalidNodeTypeError = function() { throw new DOMException(ERR.INVALID_NODE_TYPE_ERR); }; -exports.DataCloneError = function() { throw new DOMException(ERR.DATA_CLONE_ERR); }; - -exports.nyi = function() { - throw new Error("NotYetImplemented"); -}; - -exports.shouldOverride = function() { - throw new Error("Abstract function; should be overriding in subclass."); -}; - -exports.assert = function(expr, msg) { - if (!expr) { - throw new Error("Assertion failed: " + (msg || "") + "\n" + new Error().stack); - } -}; - -exports.expose = function(src, c) { - for (var n in src) { - Object.defineProperty(c.prototype, n, { value: src[n], writable: isApiWritable }); - } -}; - -exports.merge = function(a, b) { - for (var n in b) { - a[n] = b[n]; - } -}; - -// Compare two nodes based on their document order. This function is intended -// to be passed to sort(). Assumes that the array being sorted does not -// contain duplicates. And that all nodes are connected and comparable. -// Clever code by ppk via jeresig. -exports.documentOrder = function(n,m) { - /* jshint bitwise: false */ - return 3 - (n.compareDocumentPosition(m) & 6); -}; - -exports.toASCIILowerCase = function(s) { - return s.replace(/[A-Z]+/g, function(c) { - return c.toLowerCase(); - }); -}; - -exports.toASCIIUpperCase = function(s) { - return s.replace(/[a-z]+/g, function(c) { - return c.toUpperCase(); - }); -}; - - -/***/ }), - -/***/ 66798: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -// This grammar is from the XML and XML Namespace specs. It specifies whether -// a string (such as an element or attribute name) is a valid Name or QName. -// -// Name ::= NameStartChar (NameChar)* -// NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | -// [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | -// [#x370-#x37D] | [#x37F-#x1FFF] | -// [#x200C-#x200D] | [#x2070-#x218F] | -// [#x2C00-#x2FEF] | [#x3001-#xD7FF] | -// [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | -// [#x10000-#xEFFFF] -// -// NameChar ::= NameStartChar | "-" | "." | [0-9] | -// #xB7 | [#x0300-#x036F] | [#x203F-#x2040] -// -// QName ::= PrefixedName| UnprefixedName -// PrefixedName ::= Prefix ':' LocalPart -// UnprefixedName ::= LocalPart -// Prefix ::= NCName -// LocalPart ::= NCName -// NCName ::= Name - (Char* ':' Char*) -// # An XML Name, minus the ":" -// - -exports.isValidName = isValidName; -exports.isValidQName = isValidQName; - -// Most names will be ASCII only. Try matching against simple regexps first -var simplename = /^[_:A-Za-z][-.:\w]+$/; -var simpleqname = /^([_A-Za-z][-.\w]+|[_A-Za-z][-.\w]+:[_A-Za-z][-.\w]+)$/; - -// If the regular expressions above fail, try more complex ones that work -// for any identifiers using codepoints from the Unicode BMP -var ncnamestartchars = "_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02ff\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD"; -var ncnamechars = "-._A-Za-z0-9\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02ff\u0300-\u037D\u037F-\u1FFF\u200C\u200D\u203f\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD"; - -var ncname = "[" + ncnamestartchars + "][" + ncnamechars + "]*"; -var namestartchars = ncnamestartchars + ":"; -var namechars = ncnamechars + ":"; -var name = new RegExp("^[" + namestartchars + "]" + "[" + namechars + "]*$"); -var qname = new RegExp("^(" + ncname + "|" + ncname + ":" + ncname + ")$"); - -// XML says that these characters are also legal: -// [#x10000-#xEFFFF]. So if the patterns above fail, and the -// target string includes surrogates, then try the following -// patterns that allow surrogates and then run an extra validation -// step to make sure that the surrogates are in valid pairs and in -// the right range. Note that since the characters \uf0000 to \u1f0000 -// are not allowed, it means that the high surrogate can only go up to -// \uDB7f instead of \uDBFF. -var hassurrogates = /[\uD800-\uDB7F\uDC00-\uDFFF]/; -var surrogatechars = /[\uD800-\uDB7F\uDC00-\uDFFF]/g; -var surrogatepairs = /[\uD800-\uDB7F][\uDC00-\uDFFF]/g; - -// Modify the variables above to allow surrogates -ncnamestartchars += "\uD800-\uDB7F\uDC00-\uDFFF"; -ncnamechars += "\uD800-\uDB7F\uDC00-\uDFFF"; -ncname = "[" + ncnamestartchars + "][" + ncnamechars + "]*"; -namestartchars = ncnamestartchars + ":"; -namechars = ncnamechars + ":"; - -// Build another set of regexps that include surrogates -var surrogatename = new RegExp("^[" + namestartchars + "]" + "[" + namechars + "]*$"); -var surrogateqname = new RegExp("^(" + ncname + "|" + ncname + ":" + ncname + ")$"); - -function isValidName(s) { - if (simplename.test(s)) return true; // Plain ASCII - if (name.test(s)) return true; // Unicode BMP - - // Maybe the tests above failed because s includes surrogate pairs - // Most likely, though, they failed for some more basic syntax problem - if (!hassurrogates.test(s)) return false; - - // Is the string a valid name if we allow surrogates? - if (!surrogatename.test(s)) return false; - - // Finally, are the surrogates all correctly paired up? - var chars = s.match(surrogatechars), pairs = s.match(surrogatepairs); - return pairs !== null && 2*pairs.length === chars.length; -} - -function isValidQName(s) { - if (simpleqname.test(s)) return true; // Plain ASCII - if (qname.test(s)) return true; // Unicode BMP - - if (!hassurrogates.test(s)) return false; - if (!surrogateqname.test(s)) return false; - var chars = s.match(surrogatechars), pairs = s.match(surrogatepairs); - return pairs !== null && 2*pairs.length === chars.length; -} - - /***/ }), /***/ 43295: @@ -21419,234 +4289,6 @@ function range(a, b, str) { } -/***/ }), - -/***/ 79272: -/***/ ((module, exports, __webpack_require__) => { - -/** - * Module dependencies. - */ - -var fs = __webpack_require__(79896), - path = __webpack_require__(16928), - fileURLToPath = __webpack_require__(25241), - join = path.join, - dirname = path.dirname, - exists = - (fs.accessSync && - function(path) { - try { - fs.accessSync(path); - } catch (e) { - return false; - } - return true; - }) || - fs.existsSync || - path.existsSync, - defaults = { - arrow: process.env.NODE_BINDINGS_ARROW || ' → ', - compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled', - platform: process.platform, - arch: process.arch, - nodePreGyp: - 'node-v' + - process.versions.modules + - '-' + - process.platform + - '-' + - process.arch, - version: process.versions.node, - bindings: 'bindings.node', - try: [ - // node-gyp's linked version in the "build" dir - ['module_root', 'build', 'bindings'], - // node-waf and gyp_addon (a.k.a node-gyp) - ['module_root', 'build', 'Debug', 'bindings'], - ['module_root', 'build', 'Release', 'bindings'], - // Debug files, for development (legacy behavior, remove for node v0.9) - ['module_root', 'out', 'Debug', 'bindings'], - ['module_root', 'Debug', 'bindings'], - // Release files, but manually compiled (legacy behavior, remove for node v0.9) - ['module_root', 'out', 'Release', 'bindings'], - ['module_root', 'Release', 'bindings'], - // Legacy from node-waf, node <= 0.4.x - ['module_root', 'build', 'default', 'bindings'], - // Production "Release" buildtype binary (meh...) - ['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'], - // node-qbs builds - ['module_root', 'addon-build', 'release', 'install-root', 'bindings'], - ['module_root', 'addon-build', 'debug', 'install-root', 'bindings'], - ['module_root', 'addon-build', 'default', 'install-root', 'bindings'], - // node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch} - ['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings'] - ] - }; - -/** - * The main `bindings()` function loads the compiled bindings for a given module. - * It uses V8's Error API to determine the parent filename that this function is - * being invoked from, which is then used to find the root directory. - */ - -function bindings(opts) { - // Argument surgery - if (typeof opts == 'string') { - opts = { bindings: opts }; - } else if (!opts) { - opts = {}; - } - - // maps `defaults` onto `opts` object - Object.keys(defaults).map(function(i) { - if (!(i in opts)) opts[i] = defaults[i]; - }); - - // Get the module root - if (!opts.module_root) { - opts.module_root = exports.getRoot(exports.getFileName()); - } - - // Ensure the given bindings name ends with .node - if (path.extname(opts.bindings) != '.node') { - opts.bindings += '.node'; - } - - // https://github.com/webpack/webpack/issues/4175#issuecomment-342931035 - var requireFunc = - true - ? require - : 0; - - var tries = [], - i = 0, - l = opts.try.length, - n, - b, - err; - - for (; i < l; i++) { - n = join.apply( - null, - opts.try[i].map(function(p) { - return opts[p] || p; - }) - ); - tries.push(n); - try { - b = opts.path ? requireFunc.resolve(n) : requireFunc(n); - if (!opts.path) { - b.path = n; - } - return b; - } catch (e) { - if (e.code !== 'MODULE_NOT_FOUND' && - e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' && - !/not find/i.test(e.message)) { - throw e; - } - } - } - - err = new Error( - 'Could not locate the bindings file. Tried:\n' + - tries - .map(function(a) { - return opts.arrow + a; - }) - .join('\n') - ); - err.tries = tries; - throw err; -} -module.exports = exports = bindings; - -/** - * Gets the filename of the JavaScript file that invokes this function. - * Used to help find the root directory of a module. - * Optionally accepts an filename argument to skip when searching for the invoking filename - */ - -exports.getFileName = function getFileName(calling_file) { - var origPST = Error.prepareStackTrace, - origSTL = Error.stackTraceLimit, - dummy = {}, - fileName; - - Error.stackTraceLimit = 10; - - Error.prepareStackTrace = function(e, st) { - for (var i = 0, l = st.length; i < l; i++) { - fileName = st[i].getFileName(); - if (fileName !== __filename) { - if (calling_file) { - if (fileName !== calling_file) { - return; - } - } else { - return; - } - } - } - }; - - // run the 'prepareStackTrace' function above - Error.captureStackTrace(dummy); - dummy.stack; - - // cleanup - Error.prepareStackTrace = origPST; - Error.stackTraceLimit = origSTL; - - // handle filename that starts with "file://" - var fileSchema = 'file://'; - if (fileName.indexOf(fileSchema) === 0) { - fileName = fileURLToPath(fileName); - } - - return fileName; -}; - -/** - * Gets the root directory of a module, given an arbitrary filename - * somewhere in the module tree. The "root directory" is the directory - * containing the `package.json` file. - * - * In: /home/nate/node-native-module/lib/index.js - * Out: /home/nate/node-native-module - */ - -exports.getRoot = function getRoot(file) { - var dir = dirname(file), - prev; - while (true) { - if (dir === '.') { - // Avoids an infinite loop in rare cases, like the REPL - dir = process.cwd(); - } - if ( - exists(join(dir, 'package.json')) || - exists(join(dir, 'node_modules')) - ) { - // Found the 'package.json' file or 'node_modules' dir; we're done - return dir; - } - if (prev === dir) { - // Got to the top - throw new Error( - 'Could not find module root given file: "' + - file + - '". Do you have a `package.json` file? ' - ); - } - // Try the parent dir next - prev = dir; - dir = join(dir, '..'); - } -}; - - /***/ }), /***/ 96586: @@ -28961,79 +11603,6 @@ var fecha = { //# sourceMappingURL=fecha.js.map -/***/ }), - -/***/ 25241: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - - -/** - * Module dependencies. - */ - -var sep = (__webpack_require__(16928).sep) || '/'; - -/** - * Module exports. - */ - -module.exports = fileUriToPath; - -/** - * File URI to Path function. - * - * @param {String} uri - * @return {String} path - * @api public - */ - -function fileUriToPath (uri) { - if ('string' != typeof uri || - uri.length <= 7 || - 'file://' != uri.substring(0, 7)) { - throw new TypeError('must pass in a file:// URI to convert to a file path'); - } - - var rest = decodeURI(uri.substring(7)); - var firstSlash = rest.indexOf('/'); - var host = rest.substring(0, firstSlash); - var path = rest.substring(firstSlash + 1); - - // 2. Scheme Definition - // As a special case, can be the string "localhost" or the empty - // string; this is interpreted as "the machine from which the URL is - // being interpreted". - if ('localhost' == host) host = ''; - - if (host) { - host = sep + sep + host; - } - - // 3.2 Drives, drive letters, mount points, file system root - // Drive letters are mapped into the top of a file URI in various ways, - // depending on the implementation; some applications substitute - // vertical bar ("|") for the colon after the drive letter, yielding - // "file:///c|/tmp/test.txt". In some cases, the colon is left - // unchanged, as in "file:///c:/tmp/test.txt". In other cases, the - // colon is simply omitted, as in "file:///c/tmp/test.txt". - path = path.replace(/^(.+)\|/, '$1:'); - - // for Windows, we need to invert the path separators from what a URI uses - if (sep == '\\') { - path = path.replace(/\//g, '\\'); - } - - if (/^.+\:/.test(path)) { - // has Windows drive at beginning of path - } else { - // unix path… - path = sep + path; - } - - return host + path; -} - - /***/ }), /***/ 67027: @@ -29084,6 +11653,2157 @@ module.exports = function name(fn) { }; +/***/ }), + +/***/ 95270: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) + +const BUF_LENGTH = 64 * 1024 +const _buff = __webpack_require__(34549)(BUF_LENGTH) + +function copyFileSync (srcFile, destFile, options) { + const overwrite = options.overwrite + const errorOnExist = options.errorOnExist + const preserveTimestamps = options.preserveTimestamps + + if (fs.existsSync(destFile)) { + if (overwrite) { + fs.unlinkSync(destFile) + } else if (errorOnExist) { + throw new Error(`${destFile} already exists`) + } else return + } + + const fdr = fs.openSync(srcFile, 'r') + const stat = fs.fstatSync(fdr) + const fdw = fs.openSync(destFile, 'w', stat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + if (preserveTimestamps) { + fs.futimesSync(fdw, stat.atime, stat.mtime) + } + + fs.closeSync(fdr) + fs.closeSync(fdw) +} + +module.exports = copyFileSync + + +/***/ }), + +/***/ 86793: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const copyFileSync = __webpack_require__(95270) +const mkdir = __webpack_require__(60327) + +function copySync (src, dest, options) { + if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + + options = options || {} + options.recursive = !!options.recursive + + // default to true for now + options.clobber = 'clobber' in options ? !!options.clobber : true + // overwrite falls back to clobber + options.overwrite = 'overwrite' in options ? !!options.overwrite : options.clobber + options.dereference = 'dereference' in options ? !!options.dereference : false + options.preserveTimestamps = 'preserveTimestamps' in options ? !!options.preserveTimestamps : false + + options.filter = options.filter || function () { return true } + + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + const stats = (options.recursive && !options.dereference) ? fs.lstatSync(src) : fs.statSync(src) + const destFolder = path.dirname(dest) + const destFolderExists = fs.existsSync(destFolder) + let performCopy = false + + if (options.filter instanceof RegExp) { + console.warn('Warning: fs-extra: Passing a RegExp filter is deprecated, use a function') + performCopy = options.filter.test(src) + } else if (typeof options.filter === 'function') performCopy = options.filter(src, dest) + + if (stats.isFile() && performCopy) { + if (!destFolderExists) mkdir.mkdirsSync(destFolder) + copyFileSync(src, dest, { + overwrite: options.overwrite, + errorOnExist: options.errorOnExist, + preserveTimestamps: options.preserveTimestamps + }) + } else if (stats.isDirectory() && performCopy) { + if (!fs.existsSync(dest)) mkdir.mkdirsSync(dest) + const contents = fs.readdirSync(src) + contents.forEach(content => { + const opts = options + opts.recursive = true + copySync(path.join(src, content), path.join(dest, content), opts) + }) + } else if (options.recursive && stats.isSymbolicLink() && performCopy) { + const srcPath = fs.readlinkSync(src) + fs.symlinkSync(srcPath, dest) + } +} + +module.exports = copySync + + +/***/ }), + +/***/ 88510: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +module.exports = { + copySync: __webpack_require__(86793) +} + + +/***/ }), + +/***/ 20881: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const ncp = __webpack_require__(57967) +const mkdir = __webpack_require__(60327) +const pathExists = (__webpack_require__(49767).pathExists) + +function copy (src, dest, options, callback) { + if (typeof options === 'function' && !callback) { + callback = options + options = {} + } else if (typeof options === 'function' || options instanceof RegExp) { + options = {filter: options} + } + callback = callback || function () {} + options = options || {} + + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n + see https://github.com/jprichardson/node-fs-extra/issues/269`) + } + + // don't allow src and dest to be the same + const basePath = process.cwd() + const currentPath = path.resolve(basePath, src) + const targetPath = path.resolve(basePath, dest) + if (currentPath === targetPath) return callback(new Error('Source and destination must not be the same.')) + + fs.lstat(src, (err, stats) => { + if (err) return callback(err) + + let dir = null + if (stats.isDirectory()) { + const parts = dest.split(path.sep) + parts.pop() + dir = parts.join(path.sep) + } else { + dir = path.dirname(dest) + } + + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return ncp(src, dest, options, callback) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + ncp(src, dest, options, callback) + }) + }) + }) +} + +module.exports = copy + + +/***/ }), + +/***/ 33430: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +module.exports = { + copy: u(__webpack_require__(20881)) +} + + +/***/ }), + +/***/ 57967: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +// imported from ncp (this is temporary, will rewrite) + +var fs = __webpack_require__(71174) +var path = __webpack_require__(16928) +var utimes = __webpack_require__(90348) + +function ncp (source, dest, options, callback) { + if (!callback) { + callback = options + options = {} + } + + var basePath = process.cwd() + var currentPath = path.resolve(basePath, source) + var targetPath = path.resolve(basePath, dest) + + var filter = options.filter + var transform = options.transform + var overwrite = options.overwrite + // If overwrite is undefined, use clobber, otherwise default to true: + if (overwrite === undefined) overwrite = options.clobber + if (overwrite === undefined) overwrite = true + var errorOnExist = options.errorOnExist + var dereference = options.dereference + var preserveTimestamps = options.preserveTimestamps === true + + var started = 0 + var finished = 0 + var running = 0 + + var errored = false + + startCopy(currentPath) + + function startCopy (source) { + started++ + if (filter) { + if (filter instanceof RegExp) { + console.warn('Warning: fs-extra: Passing a RegExp filter is deprecated, use a function') + if (!filter.test(source)) { + return doneOne(true) + } + } else if (typeof filter === 'function') { + if (!filter(source, dest)) { + return doneOne(true) + } + } + } + return getStats(source) + } + + function getStats (source) { + var stat = dereference ? fs.stat : fs.lstat + running++ + stat(source, function (err, stats) { + if (err) return onError(err) + + // We need to get the mode from the stats object and preserve it. + var item = { + name: source, + mode: stats.mode, + mtime: stats.mtime, // modified time + atime: stats.atime, // access time + stats: stats // temporary + } + + if (stats.isDirectory()) { + return onDir(item) + } else if (stats.isFile() || stats.isCharacterDevice() || stats.isBlockDevice()) { + return onFile(item) + } else if (stats.isSymbolicLink()) { + // Symlinks don't really need to know about the mode. + return onLink(source) + } + }) + } + + function onFile (file) { + var target = file.name.replace(currentPath, targetPath.replace('$', '$$$$')) // escapes '$' with '$$' + isWritable(target, function (writable) { + if (writable) { + copyFile(file, target) + } else { + if (overwrite) { + rmFile(target, function () { + copyFile(file, target) + }) + } else if (errorOnExist) { + onError(new Error(target + ' already exists')) + } else { + doneOne() + } + } + }) + } + + function copyFile (file, target) { + var readStream = fs.createReadStream(file.name) + var writeStream = fs.createWriteStream(target, { mode: file.mode }) + + readStream.on('error', onError) + writeStream.on('error', onError) + + if (transform) { + transform(readStream, writeStream, file) + } else { + writeStream.on('open', function () { + readStream.pipe(writeStream) + }) + } + + writeStream.once('close', function () { + fs.chmod(target, file.mode, function (err) { + if (err) return onError(err) + if (preserveTimestamps) { + utimes.utimesMillis(target, file.atime, file.mtime, function (err) { + if (err) return onError(err) + return doneOne() + }) + } else { + doneOne() + } + }) + }) + } + + function rmFile (file, done) { + fs.unlink(file, function (err) { + if (err) return onError(err) + return done() + }) + } + + function onDir (dir) { + var target = dir.name.replace(currentPath, targetPath.replace('$', '$$$$')) // escapes '$' with '$$' + isWritable(target, function (writable) { + if (writable) { + return mkDir(dir, target) + } + copyDir(dir.name) + }) + } + + function mkDir (dir, target) { + fs.mkdir(target, dir.mode, function (err) { + if (err) return onError(err) + // despite setting mode in fs.mkdir, doesn't seem to work + // so we set it here. + fs.chmod(target, dir.mode, function (err) { + if (err) return onError(err) + copyDir(dir.name) + }) + }) + } + + function copyDir (dir) { + fs.readdir(dir, function (err, items) { + if (err) return onError(err) + items.forEach(function (item) { + startCopy(path.join(dir, item)) + }) + return doneOne() + }) + } + + function onLink (link) { + var target = link.replace(currentPath, targetPath) + fs.readlink(link, function (err, resolvedPath) { + if (err) return onError(err) + checkLink(resolvedPath, target) + }) + } + + function checkLink (resolvedPath, target) { + if (dereference) { + resolvedPath = path.resolve(basePath, resolvedPath) + } + isWritable(target, function (writable) { + if (writable) { + return makeLink(resolvedPath, target) + } + fs.readlink(target, function (err, targetDest) { + if (err) return onError(err) + + if (dereference) { + targetDest = path.resolve(basePath, targetDest) + } + if (targetDest === resolvedPath) { + return doneOne() + } + return rmFile(target, function () { + makeLink(resolvedPath, target) + }) + }) + }) + } + + function makeLink (linkPath, target) { + fs.symlink(linkPath, target, function (err) { + if (err) return onError(err) + return doneOne() + }) + } + + function isWritable (path, done) { + fs.lstat(path, function (err) { + if (err) { + if (err.code === 'ENOENT') return done(true) + return done(false) + } + return done(false) + }) + } + + function onError (err) { + // ensure callback is defined & called only once: + if (!errored && callback !== undefined) { + errored = true + return callback(err) + } + } + + function doneOne (skipped) { + if (!skipped) running-- + finished++ + if ((started === finished) && (running === 0)) { + if (callback !== undefined) { + return callback(null) + } + } + } +} + +module.exports = ncp + + +/***/ }), + +/***/ 53760: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const fs = __webpack_require__(79896) +const path = __webpack_require__(16928) +const mkdir = __webpack_require__(60327) +const remove = __webpack_require__(16195) + +const emptyDir = u(function emptyDir (dir, callback) { + callback = callback || function () {} + fs.readdir(dir, (err, items) => { + if (err) return mkdir.mkdirs(dir, callback) + + items = items.map(item => path.join(dir, item)) + + deleteItem() + + function deleteItem () { + const item = items.pop() + if (!item) return callback() + remove.remove(item, err => { + if (err) return callback(err) + deleteItem() + }) + } + }) +}) + +function emptyDirSync (dir) { + let items + try { + items = fs.readdirSync(dir) + } catch (err) { + return mkdir.mkdirsSync(dir) + } + + items.forEach(item => { + item = path.join(dir, item) + remove.removeSync(item) + }) +} + +module.exports = { + emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir, + emptydir: emptyDir +} + + +/***/ }), + +/***/ 23771: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const path = __webpack_require__(16928) +const fs = __webpack_require__(71174) +const mkdir = __webpack_require__(60327) +const pathExists = (__webpack_require__(49767).pathExists) + +function createFile (file, callback) { + function makeFile () { + fs.writeFile(file, '', err => { + if (err) return callback(err) + callback() + }) + } + + fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err + if (!err && stats.isFile()) return callback() + const dir = path.dirname(file) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeFile() + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeFile() + }) + }) + }) +} + +function createFileSync (file) { + let stats + try { + stats = fs.statSync(file) + } catch (e) {} + if (stats && stats.isFile()) return + + const dir = path.dirname(file) + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + fs.writeFileSync(file, '') +} + +module.exports = { + createFile: u(createFile), + createFileSync +} + + +/***/ }), + +/***/ 29081: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const file = __webpack_require__(23771) +const link = __webpack_require__(44181) +const symlink = __webpack_require__(98950) + +module.exports = { + // file + createFile: file.createFile, + createFileSync: file.createFileSync, + ensureFile: file.createFile, + ensureFileSync: file.createFileSync, + // link + createLink: link.createLink, + createLinkSync: link.createLinkSync, + ensureLink: link.createLink, + ensureLinkSync: link.createLinkSync, + // symlink + createSymlink: symlink.createSymlink, + createSymlinkSync: symlink.createSymlinkSync, + ensureSymlink: symlink.createSymlink, + ensureSymlinkSync: symlink.createSymlinkSync +} + + +/***/ }), + +/***/ 44181: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const path = __webpack_require__(16928) +const fs = __webpack_require__(71174) +const mkdir = __webpack_require__(60327) +const pathExists = (__webpack_require__(49767).pathExists) + +function createLink (srcpath, dstpath, callback) { + function makeLink (srcpath, dstpath) { + fs.link(srcpath, dstpath, err => { + if (err) return callback(err) + callback(null) + }) + } + + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureLink') + return callback(err) + } + + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return makeLink(srcpath, dstpath) + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + makeLink(srcpath, dstpath) + }) + }) + }) + }) +} + +function createLinkSync (srcpath, dstpath, callback) { + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + try { + fs.lstatSync(srcpath) + } catch (err) { + err.message = err.message.replace('lstat', 'ensureLink') + throw err + } + + const dir = path.dirname(dstpath) + const dirExists = fs.existsSync(dir) + if (dirExists) return fs.linkSync(srcpath, dstpath) + mkdir.mkdirsSync(dir) + + return fs.linkSync(srcpath, dstpath) +} + +module.exports = { + createLink: u(createLink), + createLinkSync +} + + +/***/ }), + +/***/ 57979: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const path = __webpack_require__(16928) +const fs = __webpack_require__(71174) +const pathExists = (__webpack_require__(49767).pathExists) + +/** + * Function that returns two types of paths, one relative to symlink, and one + * relative to the current working directory. Checks if path is absolute or + * relative. If the path is relative, this function checks if the path is + * relative to symlink or relative to current working directory. This is an + * initiative to find a smarter `srcpath` to supply when building symlinks. + * This allows you to determine which path to use out of one of three possible + * types of source paths. The first is an absolute path. This is detected by + * `path.isAbsolute()`. When an absolute path is provided, it is checked to + * see if it exists. If it does it's used, if not an error is returned + * (callback)/ thrown (sync). The other two options for `srcpath` are a + * relative url. By default Node's `fs.symlink` works by creating a symlink + * using `dstpath` and expects the `srcpath` to be relative to the newly + * created symlink. If you provide a `srcpath` that does not exist on the file + * system it results in a broken symlink. To minimize this, the function + * checks to see if the 'relative to symlink' source file exists, and if it + * does it will use it. If it does not, it checks if there's a file that + * exists that is relative to the current working directory, if does its used. + * This preserves the expectations of the original fs.symlink spec and adds + * the ability to pass in `relative to current working direcotry` paths. + */ + +function symlinkPaths (srcpath, dstpath, callback) { + if (path.isAbsolute(srcpath)) { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': srcpath + }) + }) + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + return pathExists(relativeToDst, (err, exists) => { + if (err) return callback(err) + if (exists) { + return callback(null, { + 'toCwd': relativeToDst, + 'toDst': srcpath + }) + } else { + return fs.lstat(srcpath, (err, stat) => { + if (err) { + err.message = err.message.replace('lstat', 'ensureSymlink') + return callback(err) + } + return callback(null, { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + }) + }) + } + }) + } +} + +function symlinkPathsSync (srcpath, dstpath) { + let exists + if (path.isAbsolute(srcpath)) { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('absolute srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': srcpath + } + } else { + const dstdir = path.dirname(dstpath) + const relativeToDst = path.join(dstdir, srcpath) + exists = fs.existsSync(relativeToDst) + if (exists) { + return { + 'toCwd': relativeToDst, + 'toDst': srcpath + } + } else { + exists = fs.existsSync(srcpath) + if (!exists) throw new Error('relative srcpath does not exist') + return { + 'toCwd': srcpath, + 'toDst': path.relative(dstdir, srcpath) + } + } + } +} + +module.exports = { + symlinkPaths, + symlinkPathsSync +} + + +/***/ }), + +/***/ 44127: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) + +function symlinkType (srcpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + if (type) return callback(null, type) + fs.lstat(srcpath, (err, stats) => { + if (err) return callback(null, 'file') + type = (stats && stats.isDirectory()) ? 'dir' : 'file' + callback(null, type) + }) +} + +function symlinkTypeSync (srcpath, type) { + let stats + + if (type) return type + try { + stats = fs.lstatSync(srcpath) + } catch (e) { + return 'file' + } + return (stats && stats.isDirectory()) ? 'dir' : 'file' +} + +module.exports = { + symlinkType, + symlinkTypeSync +} + + +/***/ }), + +/***/ 98950: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const path = __webpack_require__(16928) +const fs = __webpack_require__(71174) +const _mkdirs = __webpack_require__(60327) +const mkdirs = _mkdirs.mkdirs +const mkdirsSync = _mkdirs.mkdirsSync + +const _symlinkPaths = __webpack_require__(57979) +const symlinkPaths = _symlinkPaths.symlinkPaths +const symlinkPathsSync = _symlinkPaths.symlinkPathsSync + +const _symlinkType = __webpack_require__(44127) +const symlinkType = _symlinkType.symlinkType +const symlinkTypeSync = _symlinkType.symlinkTypeSync + +const pathExists = (__webpack_require__(49767).pathExists) + +function createSymlink (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + pathExists(dstpath, (err, destinationExists) => { + if (err) return callback(err) + if (destinationExists) return callback(null) + symlinkPaths(srcpath, dstpath, (err, relative) => { + if (err) return callback(err) + srcpath = relative.toDst + symlinkType(relative.toCwd, type, (err, type) => { + if (err) return callback(err) + const dir = path.dirname(dstpath) + pathExists(dir, (err, dirExists) => { + if (err) return callback(err) + if (dirExists) return fs.symlink(srcpath, dstpath, type, callback) + mkdirs(dir, err => { + if (err) return callback(err) + fs.symlink(srcpath, dstpath, type, callback) + }) + }) + }) + }) + }) +} + +function createSymlinkSync (srcpath, dstpath, type, callback) { + callback = (typeof type === 'function') ? type : callback + type = (typeof type === 'function') ? false : type + + const destinationExists = fs.existsSync(dstpath) + if (destinationExists) return undefined + + const relative = symlinkPathsSync(srcpath, dstpath) + srcpath = relative.toDst + type = symlinkTypeSync(relative.toCwd, type) + const dir = path.dirname(dstpath) + const exists = fs.existsSync(dir) + if (exists) return fs.symlinkSync(srcpath, dstpath, type) + mkdirsSync(dir) + return fs.symlinkSync(srcpath, dstpath, type) +} + +module.exports = { + createSymlink: u(createSymlink), + createSymlinkSync +} + + +/***/ }), + +/***/ 46596: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +// This is adapted from https://github.com/normalize/mz +// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const fs = __webpack_require__(71174) + +const api = [ + 'access', + 'appendFile', + 'chmod', + 'chown', + 'close', + 'copyFile', + 'fchmod', + 'fchown', + 'fdatasync', + 'fstat', + 'fsync', + 'ftruncate', + 'futimes', + 'lchown', + 'link', + 'lstat', + 'mkdir', + 'mkdtemp', + 'open', + 'readFile', + 'readdir', + 'readlink', + 'realpath', + 'rename', + 'rmdir', + 'stat', + 'symlink', + 'truncate', + 'unlink', + 'utimes', + 'writeFile' +].filter(key => { + // Some commands are not available on some systems. Ex: + // fs.copyFile was added in Node.js v8.5.0 + // fs.mkdtemp was added in Node.js v5.10.0 + // fs.lchown is not available on at least some Linux + return typeof fs[key] === 'function' +}) + +// Export all keys: +Object.keys(fs).forEach(key => { + exports[key] = fs[key] +}) + +// Universalify async methods: +api.forEach(method => { + exports[method] = u(fs[method]) +}) + +// We differ from mz/fs in that we still ship the old, broken, fs.exists() +// since we are a drop-in replacement for the native module +exports.exists = function (filename, callback) { + if (typeof callback === 'function') { + return fs.exists(filename, callback) + } + return new Promise(resolve => { + return fs.exists(filename, resolve) + }) +} + +// fs.read() & fs.write need special treatment due to multiple callback args + +exports.read = function (fd, buffer, offset, length, position, callback) { + if (typeof callback === 'function') { + return fs.read(fd, buffer, offset, length, position, callback) + } + return new Promise((resolve, reject) => { + fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => { + if (err) return reject(err) + resolve({ bytesRead, buffer }) + }) + }) +} + +// Function signature can be +// fs.write(fd, buffer[, offset[, length[, position]]], callback) +// OR +// fs.write(fd, string[, position[, encoding]], callback) +// so we need to handle both cases +exports.write = function (fd, buffer, a, b, c, callback) { + if (typeof arguments[arguments.length - 1] === 'function') { + return fs.write(fd, buffer, a, b, c, callback) + } + + // Check for old, depricated fs.write(fd, string[, position[, encoding]], callback) + if (typeof buffer === 'string') { + return new Promise((resolve, reject) => { + fs.write(fd, buffer, a, b, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) + } + + return new Promise((resolve, reject) => { + fs.write(fd, buffer, a, b, c, (err, bytesWritten, buffer) => { + if (err) return reject(err) + resolve({ bytesWritten, buffer }) + }) + }) +} + + +/***/ }), + +/***/ 56922: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const assign = __webpack_require__(3762) + +const fs = {} + +// Export graceful-fs: +assign(fs, __webpack_require__(46596)) +// Export extra methods: +assign(fs, __webpack_require__(33430)) +assign(fs, __webpack_require__(88510)) +assign(fs, __webpack_require__(60327)) +assign(fs, __webpack_require__(16195)) +assign(fs, __webpack_require__(5793)) +assign(fs, __webpack_require__(68126)) +assign(fs, __webpack_require__(2566)) +assign(fs, __webpack_require__(53760)) +assign(fs, __webpack_require__(29081)) +assign(fs, __webpack_require__(79858)) +assign(fs, __webpack_require__(49767)) + +module.exports = fs + + +/***/ }), + +/***/ 5793: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const jsonFile = __webpack_require__(71461) + +jsonFile.outputJson = u(__webpack_require__(58147)) +jsonFile.outputJsonSync = __webpack_require__(36275) +// aliases +jsonFile.outputJSON = jsonFile.outputJson +jsonFile.outputJSONSync = jsonFile.outputJsonSync +jsonFile.writeJSON = jsonFile.writeJson +jsonFile.writeJSONSync = jsonFile.writeJsonSync +jsonFile.readJSON = jsonFile.readJson +jsonFile.readJSONSync = jsonFile.readJsonSync + +module.exports = jsonFile + + +/***/ }), + +/***/ 71461: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const jsonFile = __webpack_require__(82162) + +module.exports = { + // jsonfile exports + readJson: u(jsonFile.readFile), + readJsonSync: jsonFile.readFileSync, + writeJson: u(jsonFile.writeFile), + writeJsonSync: jsonFile.writeFileSync +} + + +/***/ }), + +/***/ 36275: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const mkdir = __webpack_require__(60327) +const jsonFile = __webpack_require__(71461) + +function outputJsonSync (file, data, options) { + const dir = path.dirname(file) + + if (!fs.existsSync(dir)) { + mkdir.mkdirsSync(dir) + } + + jsonFile.writeJsonSync(file, data, options) +} + +module.exports = outputJsonSync + + +/***/ }), + +/***/ 58147: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const path = __webpack_require__(16928) +const mkdir = __webpack_require__(60327) +const pathExists = (__webpack_require__(49767).pathExists) +const jsonFile = __webpack_require__(71461) + +function outputJson (file, data, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const dir = path.dirname(file) + + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return jsonFile.writeJson(file, data, options, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + jsonFile.writeJson(file, data, options, callback) + }) + }) +} + +module.exports = outputJson + + +/***/ }), + +/***/ 60327: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const mkdirs = u(__webpack_require__(42987)) +const mkdirsSync = __webpack_require__(56891) + +module.exports = { + mkdirs: mkdirs, + mkdirsSync: mkdirsSync, + // alias + mkdirp: mkdirs, + mkdirpSync: mkdirsSync, + ensureDir: mkdirs, + ensureDirSync: mkdirsSync +} + + +/***/ }), + +/***/ 56891: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const invalidWin32Path = (__webpack_require__(54752).invalidWin32Path) + +const o777 = parseInt('0777', 8) + +function mkdirsSync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + throw errInval + } + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + p = path.resolve(p) + + try { + xfs.mkdirSync(p, mode) + made = made || p + } catch (err0) { + switch (err0.code) { + case 'ENOENT': + if (path.dirname(p) === p) throw err0 + made = mkdirsSync(path.dirname(p), opts, made) + mkdirsSync(p, opts, made) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + let stat + try { + stat = xfs.statSync(p) + } catch (err1) { + throw err0 + } + if (!stat.isDirectory()) throw err0 + break + } + } + + return made +} + +module.exports = mkdirsSync + + +/***/ }), + +/***/ 42987: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const invalidWin32Path = (__webpack_require__(54752).invalidWin32Path) + +const o777 = parseInt('0777', 8) + +function mkdirs (p, opts, callback, made) { + if (typeof opts === 'function') { + callback = opts + opts = {} + } else if (!opts || typeof opts !== 'object') { + opts = { mode: opts } + } + + if (process.platform === 'win32' && invalidWin32Path(p)) { + const errInval = new Error(p + ' contains invalid WIN32 path characters.') + errInval.code = 'EINVAL' + return callback(errInval) + } + + let mode = opts.mode + const xfs = opts.fs || fs + + if (mode === undefined) { + mode = o777 & (~process.umask()) + } + if (!made) made = null + + callback = callback || function () {} + p = path.resolve(p) + + xfs.mkdir(p, mode, er => { + if (!er) { + made = made || p + return callback(null, made) + } + switch (er.code) { + case 'ENOENT': + if (path.dirname(p) === p) return callback(er) + mkdirs(path.dirname(p), opts, (er, made) => { + if (er) callback(er, made) + else mkdirs(p, opts, callback, made) + }) + break + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, (er2, stat) => { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) callback(er, made) + else callback(null, made) + }) + break + } + }) +} + +module.exports = mkdirs + + +/***/ }), + +/***/ 54752: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const path = __webpack_require__(16928) + +// get drive on windows +function getRootPath (p) { + p = path.normalize(path.resolve(p)).split(path.sep) + if (p.length > 0) return p[0] + return null +} + +// http://stackoverflow.com/a/62888/10333 contains more accurate +// TODO: expand to include the rest +const INVALID_PATH_CHARS = /[<>:"|?*]/ + +function invalidWin32Path (p) { + const rp = getRootPath(p) + p = p.replace(rp, '') + return INVALID_PATH_CHARS.test(p) +} + +module.exports = { + getRootPath, + invalidWin32Path +} + + +/***/ }), + +/***/ 2566: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const copySync = (__webpack_require__(88510).copySync) +const removeSync = (__webpack_require__(16195).removeSync) +const mkdirpSync = (__webpack_require__(60327).mkdirsSync) +const buffer = __webpack_require__(34549) + +function moveSync (src, dest, options) { + options = options || {} + const overwrite = options.overwrite || options.clobber || false + + src = path.resolve(src) + dest = path.resolve(dest) + + if (src === dest) return fs.accessSync(src) + + if (isSrcSubdir(src, dest)) throw new Error(`Cannot move '${src}' into itself '${dest}'.`) + + mkdirpSync(path.dirname(dest)) + tryRenameSync() + + function tryRenameSync () { + if (overwrite) { + try { + return fs.renameSync(src, dest) + } catch (err) { + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST' || err.code === 'EPERM') { + removeSync(dest) + options.overwrite = false // just overwriteed it, no need to do it again + return moveSync(src, dest, options) + } + + if (err.code !== 'EXDEV') throw err + return moveSyncAcrossDevice(src, dest, overwrite) + } + } else { + try { + fs.linkSync(src, dest) + return fs.unlinkSync(src) + } catch (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + return moveSyncAcrossDevice(src, dest, overwrite) + } + throw err + } + } + } +} + +function moveSyncAcrossDevice (src, dest, overwrite) { + const stat = fs.statSync(src) + + if (stat.isDirectory()) { + return moveDirSyncAcrossDevice(src, dest, overwrite) + } else { + return moveFileSyncAcrossDevice(src, dest, overwrite) + } +} + +function moveFileSyncAcrossDevice (src, dest, overwrite) { + const BUF_LENGTH = 64 * 1024 + const _buff = buffer(BUF_LENGTH) + + const flags = overwrite ? 'w' : 'wx' + + const fdr = fs.openSync(src, 'r') + const stat = fs.fstatSync(fdr) + const fdw = fs.openSync(dest, flags, stat.mode) + let bytesRead = 1 + let pos = 0 + + while (bytesRead > 0) { + bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos) + fs.writeSync(fdw, _buff, 0, bytesRead) + pos += bytesRead + } + + fs.closeSync(fdr) + fs.closeSync(fdw) + return fs.unlinkSync(src) +} + +function moveDirSyncAcrossDevice (src, dest, overwrite) { + const options = { + overwrite: false + } + + if (overwrite) { + removeSync(dest) + tryCopySync() + } else { + tryCopySync() + } + + function tryCopySync () { + copySync(src, dest, options) + return removeSync(src) + } +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest) { + try { + return fs.statSync(src).isDirectory() && + src !== dest && + dest.indexOf(src) > -1 && + dest.split(path.dirname(src) + path.sep)[1].split(path.sep)[0] === path.basename(src) + } catch (e) { + return false + } +} + +module.exports = { + moveSync +} + + +/***/ }), + +/***/ 68126: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +// most of this code was written by Andrew Kelley +// licensed under the BSD license: see +// https://github.com/andrewrk/node-mv/blob/master/package.json + +// this needs a cleanup + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const fs = __webpack_require__(71174) +const ncp = __webpack_require__(57967) +const path = __webpack_require__(16928) +const remove = (__webpack_require__(16195).remove) +const mkdirp = (__webpack_require__(60327).mkdirs) + +function move (src, dest, options, callback) { + if (typeof options === 'function') { + callback = options + options = {} + } + + const overwrite = options.overwrite || options.clobber || false + + isSrcSubdir(src, dest, (err, itIs) => { + if (err) return callback(err) + if (itIs) return callback(new Error(`Cannot move '${src}' to a subdirectory of itself, '${dest}'.`)) + mkdirp(path.dirname(dest), err => { + if (err) return callback(err) + doRename() + }) + }) + + function doRename () { + if (path.resolve(src) === path.resolve(dest)) { + fs.access(src, callback) + } else if (overwrite) { + fs.rename(src, dest, err => { + if (!err) return callback() + + if (err.code === 'ENOTEMPTY' || err.code === 'EEXIST') { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false // just overwriteed it, no need to do it again + move(src, dest, options, callback) + }) + return + } + + // weird Windows shit + if (err.code === 'EPERM') { + setTimeout(() => { + remove(dest, err => { + if (err) return callback(err) + options.overwrite = false + move(src, dest, options, callback) + }) + }, 200) + return + } + + if (err.code !== 'EXDEV') return callback(err) + moveAcrossDevice(src, dest, overwrite, callback) + }) + } else { + fs.link(src, dest, err => { + if (err) { + if (err.code === 'EXDEV' || err.code === 'EISDIR' || err.code === 'EPERM' || err.code === 'ENOTSUP') { + return moveAcrossDevice(src, dest, overwrite, callback) + } + return callback(err) + } + return fs.unlink(src, callback) + }) + } + } +} + +function moveAcrossDevice (src, dest, overwrite, callback) { + fs.stat(src, (err, stat) => { + if (err) return callback(err) + + if (stat.isDirectory()) { + moveDirAcrossDevice(src, dest, overwrite, callback) + } else { + moveFileAcrossDevice(src, dest, overwrite, callback) + } + }) +} + +function moveFileAcrossDevice (src, dest, overwrite, callback) { + const flags = overwrite ? 'w' : 'wx' + const ins = fs.createReadStream(src) + const outs = fs.createWriteStream(dest, { flags }) + + ins.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + + // may want to create a directory but `out` line above + // creates an empty file for us: See #108 + // don't care about error here + fs.unlink(dest, () => { + // note: `err` here is from the input stream errror + if (err.code === 'EISDIR' || err.code === 'EPERM') { + moveDirAcrossDevice(src, dest, overwrite, callback) + } else { + callback(err) + } + }) + }) + + outs.on('error', err => { + ins.destroy() + outs.destroy() + outs.removeListener('close', onClose) + callback(err) + }) + + outs.once('close', onClose) + ins.pipe(outs) + + function onClose () { + fs.unlink(src, callback) + } +} + +function moveDirAcrossDevice (src, dest, overwrite, callback) { + const options = { + overwrite: false + } + + if (overwrite) { + remove(dest, err => { + if (err) return callback(err) + startNcp() + }) + } else { + startNcp() + } + + function startNcp () { + ncp(src, dest, options, err => { + if (err) return callback(err) + remove(src, callback) + }) + } +} + +// return true if dest is a subdir of src, otherwise false. +// extract dest base dir and check if that is the same as src basename +function isSrcSubdir (src, dest, cb) { + fs.stat(src, (err, st) => { + if (err) return cb(err) + if (st.isDirectory()) { + const baseDir = dest.split(path.dirname(src) + path.sep)[1] + if (baseDir) { + const destBasename = baseDir.split(path.sep)[0] + if (destBasename) return cb(null, src !== dest && dest.indexOf(src) > -1 && destBasename === path.basename(src)) + return cb(null, false) + } + return cb(null, false) + } + return cb(null, false) + }) +} + +module.exports = { + move: u(move) +} + + +/***/ }), + +/***/ 79858: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const mkdir = __webpack_require__(60327) +const pathExists = (__webpack_require__(49767).pathExists) + +function outputFile (file, data, encoding, callback) { + if (typeof encoding === 'function') { + callback = encoding + encoding = 'utf8' + } + + const dir = path.dirname(file) + pathExists(dir, (err, itDoes) => { + if (err) return callback(err) + if (itDoes) return fs.writeFile(file, data, encoding, callback) + + mkdir.mkdirs(dir, err => { + if (err) return callback(err) + + fs.writeFile(file, data, encoding, callback) + }) + }) +} + +function outputFileSync (file, data, encoding) { + const dir = path.dirname(file) + if (fs.existsSync(dir)) { + return fs.writeFileSync.apply(fs, arguments) + } + mkdir.mkdirsSync(dir) + fs.writeFileSync.apply(fs, arguments) +} + +module.exports = { + outputFile: u(outputFile), + outputFileSync +} + + +/***/ }), + +/***/ 49767: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + +const u = (__webpack_require__(55399)/* .fromPromise */ .z) +const fs = __webpack_require__(46596) + +function pathExists (path) { + return fs.access(path).then(() => true).catch(() => false) +} + +module.exports = { + pathExists: u(pathExists), + pathExistsSync: fs.existsSync +} + + +/***/ }), + +/***/ 16195: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const u = (__webpack_require__(55399)/* .fromCallback */ .S) +const rimraf = __webpack_require__(54322) + +module.exports = { + remove: u(rimraf), + removeSync: rimraf.sync +} + + +/***/ }), + +/***/ 54322: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const path = __webpack_require__(16928) +const assert = __webpack_require__(42613) + +const isWindows = (process.platform === 'win32') + +function defaults (options) { + const methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(m => { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 +} + +function rimraf (p, options, cb) { + let busyTries = 0 + + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + rimraf_(p, options, function CB (er) { + if (er) { + if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') && + busyTries < options.maxBusyTries) { + busyTries++ + let time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(() => rimraf_(p, options, CB), time) + } + + // already gone + if (er.code === 'ENOENT') er = null + } + + cb(er) + }) +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, (er, st) => { + if (er && er.code === 'ENOENT') { + return cb(null) + } + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === 'EPERM' && isWindows) { + return fixWinEPERM(p, options, er, cb) + } + + if (st && st.isDirectory()) { + return rmdir(p, options, er, cb) + } + + options.unlink(p, er => { + if (er) { + if (er.code === 'ENOENT') { + return cb(null) + } + if (er.code === 'EPERM') { + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + } + if (er.code === 'EISDIR') { + return rmdir(p, options, er, cb) + } + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) { + assert(er instanceof Error) + } + + options.chmod(p, 0o666, er2 => { + if (er2) { + cb(er2.code === 'ENOENT' ? null : er) + } else { + options.stat(p, (er3, stats) => { + if (er3) { + cb(er3.code === 'ENOENT' ? null : er) + } else if (stats.isDirectory()) { + rmdir(p, options, er, cb) + } else { + options.unlink(p, cb) + } + }) + } + }) +} + +function fixWinEPERMSync (p, options, er) { + let stats + + assert(p) + assert(options) + if (er) { + assert(er instanceof Error) + } + + try { + options.chmodSync(p, 0o666) + } catch (er2) { + if (er2.code === 'ENOENT') { + return + } else { + throw er + } + } + + try { + stats = options.statSync(p) + } catch (er3) { + if (er3.code === 'ENOENT') { + return + } else { + throw er + } + } + + if (stats.isDirectory()) { + rmdirSync(p, options, er) + } else { + options.unlinkSync(p) + } +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, er => { + if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) { + rmkids(p, options, cb) + } else if (er && er.code === 'ENOTDIR') { + cb(originalEr) + } else { + cb(er) + } + }) +} + +function rmkids (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, (er, files) => { + if (er) return cb(er) + + let n = files.length + let errState + + if (n === 0) return options.rmdir(p, cb) + + files.forEach(f => { + rimraf(path.join(p, f), options, er => { + if (errState) { + return + } + if (er) return cb(errState = er) + if (--n === 0) { + options.rmdir(p, cb) + } + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + let st + + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + try { + st = options.lstatSync(p) + } catch (er) { + if (er.code === 'ENOENT') { + return + } + + // Windows can EPERM on stat. Life is suffering. + if (er.code === 'EPERM' && isWindows) { + fixWinEPERMSync(p, options, er) + } + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) { + rmdirSync(p, options, null) + } else { + options.unlinkSync(p) + } + } catch (er) { + if (er.code === 'ENOENT') { + return + } else if (er.code === 'EPERM') { + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + } else if (er.code !== 'EISDIR') { + throw er + } + rmdirSync(p, options, er) + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) { + assert(originalEr instanceof Error) + } + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === 'ENOTDIR') { + throw originalEr + } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') { + rmkidsSync(p, options) + } else if (er.code !== 'ENOENT') { + throw er + } + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options)) + + // We only end up here once we got ENOTEMPTY at least once, and + // at this point, we are guaranteed to have removed all the kids. + // So, we know that it won't be ENOENT or ENOTDIR or anything else. + // try really hard to delete stuff on windows, because it has a + // PROFOUNDLY annoying habit of not closing handles promptly when + // files are deleted, resulting in spurious ENOTEMPTY errors. + const retries = isWindows ? 100 : 1 + let i = 0 + do { + let threw = true + try { + const ret = options.rmdirSync(p, options) + threw = false + return ret + } finally { + if (++i < retries && threw) continue // eslint-disable-line + } + } while (true) +} + +module.exports = rimraf +rimraf.sync = rimrafSync + + +/***/ }), + +/***/ 3762: +/***/ ((module) => { + +"use strict"; + + +// simple mutable assign +function assign () { + const args = [].slice.call(arguments).filter(i => i) + const dest = args.shift() + args.forEach(src => { + Object.keys(src).forEach(key => { + dest[key] = src[key] + }) + }) + + return dest +} + +module.exports = assign + + +/***/ }), + +/***/ 34549: +/***/ ((module) => { + +/* eslint-disable node/no-deprecated-api */ +module.exports = function (size) { + if (typeof Buffer.allocUnsafe === 'function') { + try { + return Buffer.allocUnsafe(size) + } catch (e) { + return new Buffer(size) + } + } + return new Buffer(size) +} + + +/***/ }), + +/***/ 90348: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + + +const fs = __webpack_require__(71174) +const os = __webpack_require__(70857) +const path = __webpack_require__(16928) + +// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not +function hasMillisResSync () { + let tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141') + const fd = fs.openSync(tmpfile, 'r+') + fs.futimesSync(fd, d, d) + fs.closeSync(fd) + return fs.statSync(tmpfile).mtime > 1435410243000 +} + +function hasMillisRes (callback) { + let tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2)) + tmpfile = path.join(os.tmpdir(), tmpfile) + + // 550 millis past UNIX epoch + const d = new Date(1435410243862) + fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', err => { + if (err) return callback(err) + fs.open(tmpfile, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, d, d, err => { + if (err) return callback(err) + fs.close(fd, err => { + if (err) return callback(err) + fs.stat(tmpfile, (err, stats) => { + if (err) return callback(err) + callback(null, stats.mtime > 1435410243000) + }) + }) + }) + }) + }) +} + +function timeRemoveMillis (timestamp) { + if (typeof timestamp === 'number') { + return Math.floor(timestamp / 1000) * 1000 + } else if (timestamp instanceof Date) { + return new Date(Math.floor(timestamp.getTime() / 1000) * 1000) + } else { + throw new Error('fs-extra: timeRemoveMillis() unknown parameter type') + } +} + +function utimesMillis (path, atime, mtime, callback) { + // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback) + fs.open(path, 'r+', (err, fd) => { + if (err) return callback(err) + fs.futimes(fd, atime, mtime, futimesErr => { + fs.close(fd, closeErr => { + if (callback) callback(futimesErr || closeErr) + }) + }) + }) +} + +module.exports = { + hasMillisRes, + hasMillisResSync, + timeRemoveMillis, + utimesMillis +} + + /***/ }), /***/ 63423: @@ -29294,6 +14014,979 @@ function expand(str, isTop) { +/***/ }), + +/***/ 77398: +/***/ ((module) => { + +"use strict"; + + +module.exports = clone + +var getPrototypeOf = Object.getPrototypeOf || function (obj) { + return obj.__proto__ +} + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: getPrototypeOf(obj) } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} + + +/***/ }), + +/***/ 71174: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var fs = __webpack_require__(79896) +var polyfills = __webpack_require__(19023) +var legacy = __webpack_require__(76244) +var clone = __webpack_require__(77398) + +var util = __webpack_require__(39023) + +/* istanbul ignore next - node 0.x polyfill */ +var gracefulQueue +var previousSymbol + +/* istanbul ignore else - node 0.x polyfill */ +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue') + // This is used in testing by future versions + previousSymbol = Symbol.for('graceful-fs.previous') +} else { + gracefulQueue = '___graceful-fs.queue' + previousSymbol = '___graceful-fs.previous' +} + +function noop () {} + +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +// Once time initialization +if (!fs[gracefulQueue]) { + // This queue can be shared by multiple loaded instances + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) + + // Patch fs.close/closeSync to shared queue version, because we need + // to retry() whenever a close happens *anywhere* in the program. + // This is essential when multiple graceful-fs instances are + // in play at the same time. + fs.close = (function (fs$close) { + function close (fd, cb) { + return fs$close.call(fs, fd, function (err) { + // This function uses the graceful-fs shared queue + if (!err) { + resetQueue() + } + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) + } + + Object.defineProperty(close, previousSymbol, { + value: fs$close + }) + return close + })(fs.close) + + fs.closeSync = (function (fs$closeSync) { + function closeSync (fd) { + // This function uses the graceful-fs shared queue + fs$closeSync.apply(fs, arguments) + resetQueue() + } + + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }) + return closeSync + })(fs.closeSync) + + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(fs[gracefulQueue]) + __webpack_require__(42613).equal(fs[gracefulQueue].length, 0) + }) + } +} + +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} + +module.exports = patch(clone(fs)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { + module.exports = patch(fs) + fs.__patched = true; +} + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb, startTime) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb, startTime) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb, startTime) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$copyFile = fs.copyFile + if (fs$copyFile) + fs.copyFile = copyFile + function copyFile (src, dest, flags, cb) { + if (typeof flags === 'function') { + cb = flags + flags = 0 + } + return go$copyFile(src, dest, flags, cb) + + function go$copyFile (src, dest, flags, cb, startTime) { + return fs$copyFile(src, dest, flags, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + var noReaddirOptionVersions = /^v[0-5]\./ + function readdir (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + var go$readdir = noReaddirOptionVersions.test(process.version) + ? function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, fs$readdirCallback( + path, options, cb, startTime + )) + } + : function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, options, fs$readdirCallback( + path, options, cb, startTime + )) + } + + return go$readdir(path, options, cb) + + function fs$readdirCallback (path, options, cb, startTime) { + return function (err, files) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([ + go$readdir, + [path, options, cb], + err, + startTime || Date.now(), + Date.now() + ]) + else { + if (files && files.sort) + files.sort() + + if (typeof cb === 'function') + cb.call(this, err, files) + } + } + } + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + } + + var fs$WriteStream = fs.WriteStream + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + } + + Object.defineProperty(fs, 'ReadStream', { + get: function () { + return ReadStream + }, + set: function (val) { + ReadStream = val + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(fs, 'WriteStream', { + get: function () { + return WriteStream + }, + set: function (val) { + WriteStream = val + }, + enumerable: true, + configurable: true + }) + + // legacy names + var FileReadStream = ReadStream + Object.defineProperty(fs, 'FileReadStream', { + get: function () { + return FileReadStream + }, + set: function (val) { + FileReadStream = val + }, + enumerable: true, + configurable: true + }) + var FileWriteStream = WriteStream + Object.defineProperty(fs, 'FileWriteStream', { + get: function () { + return FileWriteStream + }, + set: function (val) { + FileWriteStream = val + }, + enumerable: true, + configurable: true + }) + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new fs.ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new fs.WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb, startTime) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + fs[gracefulQueue].push(elem) + retry() +} + +// keep track of the timeout between retry() calls +var retryTimer + +// reset the startTime and lastTime to now +// this resets the start of the 60 second overall timeout as well as the +// delay between attempts so that we'll retry these jobs sooner +function resetQueue () { + var now = Date.now() + for (var i = 0; i < fs[gracefulQueue].length; ++i) { + // entries that are only a length of 2 are from an older version, don't + // bother modifying those since they'll be retried anyway. + if (fs[gracefulQueue][i].length > 2) { + fs[gracefulQueue][i][3] = now // startTime + fs[gracefulQueue][i][4] = now // lastTime + } + } + // call retry to make sure we're actively processing the queue + retry() +} + +function retry () { + // clear the timer and remove it to help prevent unintended concurrency + clearTimeout(retryTimer) + retryTimer = undefined + + if (fs[gracefulQueue].length === 0) + return + + var elem = fs[gracefulQueue].shift() + var fn = elem[0] + var args = elem[1] + // these items may be unset if they were added by an older graceful-fs + var err = elem[2] + var startTime = elem[3] + var lastTime = elem[4] + + // if we don't have a startTime we have no way of knowing if we've waited + // long enough, so go ahead and retry this item now + if (startTime === undefined) { + debug('RETRY', fn.name, args) + fn.apply(null, args) + } else if (Date.now() - startTime >= 60000) { + // it's been more than 60 seconds total, bail now + debug('TIMEOUT', fn.name, args) + var cb = args.pop() + if (typeof cb === 'function') + cb.call(null, err) + } else { + // the amount of time between the last attempt and right now + var sinceAttempt = Date.now() - lastTime + // the amount of time between when we first tried, and when we last tried + // rounded up to at least 1 + var sinceStart = Math.max(lastTime - startTime, 1) + // backoff. wait longer than the total time we've been retrying, but only + // up to a maximum of 100ms + var desiredDelay = Math.min(sinceStart * 1.2, 100) + // it's been long enough since the last retry, do it again + if (sinceAttempt >= desiredDelay) { + debug('RETRY', fn.name, args) + fn.apply(null, args.concat([startTime])) + } else { + // if we can't do this job yet, push it to the end of the queue + // and let the next iteration check again + fs[gracefulQueue].push(elem) + } + } + + // schedule our next run if one isn't already scheduled + if (retryTimer === undefined) { + retryTimer = setTimeout(retry, 0) + } +} + + +/***/ }), + +/***/ 76244: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Stream = (__webpack_require__(2203).Stream) + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} + + +/***/ }), + +/***/ 19023: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var constants = __webpack_require__(49140) + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +// This check is needed until node.js 12 is required +if (typeof process.chdir === 'function') { + var chdir = process.chdir + process.chdir = function (d) { + cwd = null + chdir.call(process, d) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (fs.chmod && !fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (fs.chown && !fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = typeof fs.rename !== 'function' ? fs.rename + : (function (fs$rename) { + function rename (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) + return rename + })(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = typeof fs.read !== 'function' ? fs.read + : (function (fs$read) { + function read (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + + // This ensures `util.promisify` works as it does for native `fs.read`. + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) + return read + })(fs.read) + + fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync + : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) + + function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + } + + function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else if (fs.futimes) { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } + } + + function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + + function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + function callback (er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + if (cb) cb.apply(this, arguments) + } + return options ? orig.call(fs, target, options, callback) + : orig.call(fs, target, callback) + } + } + + function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options) { + var stats = options ? orig.call(fs, target, options) + : orig.call(fs, target) + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + return stats; + } + } + + // ENOSYS means that the fs doesn't support the op. Just ignore + // that, because it doesn't matter. + // + // if there's no getuid, or if getuid() is something other + // than 0, and the error is EINVAL or EPERM, then just ignore + // it. + // + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // + // When running as root, or if other types of errors are + // encountered, then it's strict. + function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false + } +} + + /***/ }), /***/ 53972: @@ -29438,6 +15131,656 @@ isStream.transform = stream => module.exports = isStream; +/***/ }), + +/***/ 82162: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var _fs +try { + _fs = __webpack_require__(71174) +} catch (_) { + _fs = __webpack_require__(79896) +} + +function readFile (file, options, callback) { + if (callback == null) { + callback = options + options = {} + } + + if (typeof options === 'string') { + options = {encoding: options} + } + + options = options || {} + var fs = options.fs || _fs + + var shouldThrow = true + if ('throws' in options) { + shouldThrow = options.throws + } + + fs.readFile(file, options, function (err, data) { + if (err) return callback(err) + + data = stripBom(data) + + var obj + try { + obj = JSON.parse(data, options ? options.reviver : null) + } catch (err2) { + if (shouldThrow) { + err2.message = file + ': ' + err2.message + return callback(err2) + } else { + return callback(null, null) + } + } + + callback(null, obj) + }) +} + +function readFileSync (file, options) { + options = options || {} + if (typeof options === 'string') { + options = {encoding: options} + } + + var fs = options.fs || _fs + + var shouldThrow = true + if ('throws' in options) { + shouldThrow = options.throws + } + + try { + var content = fs.readFileSync(file, options) + content = stripBom(content) + return JSON.parse(content, options.reviver) + } catch (err) { + if (shouldThrow) { + err.message = file + ': ' + err.message + throw err + } else { + return null + } + } +} + +function stringify (obj, options) { + var spaces + var EOL = '\n' + if (typeof options === 'object' && options !== null) { + if (options.spaces) { + spaces = options.spaces + } + if (options.EOL) { + EOL = options.EOL + } + } + + var str = JSON.stringify(obj, options ? options.replacer : null, spaces) + + return str.replace(/\n/g, EOL) + EOL +} + +function writeFile (file, obj, options, callback) { + if (callback == null) { + callback = options + options = {} + } + options = options || {} + var fs = options.fs || _fs + + var str = '' + try { + str = stringify(obj, options) + } catch (err) { + // Need to return whether a callback was passed or not + if (callback) callback(err, null) + return + } + + fs.writeFile(file, str, options, callback) +} + +function writeFileSync (file, obj, options) { + options = options || {} + var fs = options.fs || _fs + + var str = stringify(obj, options) + // not sure if fs.writeFileSync returns anything, but just in case + return fs.writeFileSync(file, str, options) +} + +function stripBom (content) { + // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified + if (Buffer.isBuffer(content)) content = content.toString('utf8') + content = content.replace(/^\uFEFF/, '') + return content +} + +var jsonfile = { + readFile: readFile, + readFileSync: readFileSync, + writeFile: writeFile, + writeFileSync: writeFileSync +} + +module.exports = jsonfile + + +/***/ }), + +/***/ 58538: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +var __webpack_unused_export__; + +__webpack_unused_export__ = ({ value: true }); +__webpack_unused_export__ = exports.Sk = exports.Ur = void 0; +__webpack_unused_export__ = makeField; +const tslib_1 = __webpack_require__(94914); +const os = tslib_1.__importStar(__webpack_require__(70857)); +const fs = tslib_1.__importStar(__webpack_require__(56922)); +const events_1 = tslib_1.__importDefault(__webpack_require__(24434)); +const serialize_1 = __webpack_require__(77283); +exports.Ur = { + deserialize: serialize_1.defaultDeserialize, + dialect: 'redis', + expiredCheckDelay: 24 * 3600 * 1000, // ms + filename: `${os.tmpdir()}/keyv-file/default.json`, + serialize: serialize_1.defaultSerialize, + writeDelay: 100, // ms + checkFileLock: false, +}; +function isNumber(val) { + return typeof val === 'number'; +} +class KeyvFile extends events_1.default { + constructor(options) { + super(); + this.ttlSupport = true; + this.opts = Object.assign({}, exports.Ur, options); + if (this.opts.checkFileLock) { + this.acquireFileLock(); + } + try { + const data = this.opts.deserialize(fs.readFileSync(this.opts.filename, 'utf8')); + if (!Array.isArray(data.cache)) { + const _cache = data.cache; + data.cache = []; + for (const key in _cache) { + if (_cache.hasOwnProperty(key)) { + data.cache.push([key, _cache[key]]); + } + } + } + this._cache = new Map(data.cache); + this._lastExpire = data.lastExpire; + } + catch (e) { + this._cache = new Map(); + this._lastExpire = Date.now(); + } + } + get _lockFile() { + return this.opts.filename + '.lock'; + } + acquireFileLock() { + try { + let fd = fs.openSync(this._lockFile, 'wx'); + fs.closeSync(fd); + process.on('SIGINT', () => { + this.releaseFileLock(); + process.exit(0); + }); + process.on('exit', () => { + this.releaseFileLock(); + }); + } + catch (error) { + console.error(`[keyv-file] There is another process using this file`); + throw error; + } + } + releaseFileLock() { + try { + fs.unlinkSync(this._lockFile); + } + catch (_a) { + //pass + } + } + get(key) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + return Promise.resolve(this.getSync(key)); + }); + } + getSync(key) { + try { + const data = this._cache.get(key); + if (!data) { + return undefined; + } + else if (this.isExpired(data)) { + this.delete(key); + return undefined; + } + else { + return data.value; + } + } + catch (error) { + // do nothing; + } + } + getMany(keys) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + const results = yield Promise.all(keys.map((key) => tslib_1.__awaiter(this, void 0, void 0, function* () { + const value = yield this.get(key); + return value; + }))); + return results; + }); + } + set(key, value, ttl) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + if (ttl === 0) { + ttl = undefined; + } + this._cache.set(key, { + expire: isNumber(ttl) ? Date.now() + ttl : undefined, + value: value, + }); + return this.save(); + }); + } + delete(key) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + const ret = this._cache.delete(key); + yield this.save(); + return ret; + }); + } + deleteMany(keys) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + const deletePromises = keys.map((key) => this.delete(key)); + const results = yield Promise.all(deletePromises); + return results.every((result) => result); + }); + } + clear() { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + this._cache = new Map(); + this._lastExpire = Date.now(); + return this.save(); + }); + } + has(key) { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + const value = yield this.get(key); + return value !== undefined; + }); + } + isExpired(data) { + return isNumber(data.expire) && data.expire <= Date.now(); + } + clearExpire() { + const now = Date.now(); + if (now - this._lastExpire <= this.opts.expiredCheckDelay) { + return; + } + for (const key of this._cache.keys()) { + const data = this._cache.get(key); + if (this.isExpired(data)) { + this._cache.delete(key); + } + } + this._lastExpire = now; + } + saveToDisk() { + const cache = []; + for (const [key, val] of this._cache) { + cache.push([key, val]); + } + const data = this.opts.serialize({ + cache, + lastExpire: this._lastExpire, + }); + return new Promise((resolve, reject) => { + fs.outputFile(this.opts.filename, data, (err) => { + if (err) { + reject(err); + } + else { + resolve(); + } + }); + }); + } + save() { + this.clearExpire(); + if (this._savePromise) { + return this._savePromise; + } + this._savePromise = new Promise((resolve, reject) => { + setTimeout(() => { + this.saveToDisk() + .then(resolve, reject) + .finally(() => { + this._savePromise = void 0; + }); + }, this.opts.writeDelay); + }); + return this._savePromise; + } + disconnect() { + return Promise.resolve(); + } + iterator(namespace) { + return tslib_1.__asyncGenerator(this, arguments, function* iterator_1() { + for (const [key, data] of this._cache.entries()) { + if (key === undefined) { + continue; + } + // Filter by namespace if provided + if (!namespace || key.includes(namespace)) { + yield yield tslib_1.__await([key, data.value]); + } + } + }); + } +} +exports.Sk = KeyvFile; +__webpack_unused_export__ = KeyvFile; +class Field { + constructor(kv, key, defaults) { + this.kv = kv; + this.key = key; + this.defaults = defaults; + } + get() { + return tslib_1.__awaiter(this, arguments, void 0, function* (def = this.defaults) { + var _a; + return (_a = (yield this.kv.get(this.key))) !== null && _a !== void 0 ? _a : def; + }); + } + getSync(def = this.defaults) { + var _a; + if ('getSync' in this.kv) { + return (_a = this.kv.getSync(this.key)) !== null && _a !== void 0 ? _a : def; + } + throw new Error('kv does not support getSync'); + } + set(val, ttl) { + return this.kv.set(this.key, val, ttl); + } + delete() { + return this.kv.delete(this.key); + } +} +__webpack_unused_export__ = Field; +function makeField(kv, key, defaults) { + return new Field(kv, key, defaults); +} + + +/***/ }), + +/***/ 94914: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ __assign: () => (/* binding */ __assign), +/* harmony export */ __asyncDelegator: () => (/* binding */ __asyncDelegator), +/* harmony export */ __asyncGenerator: () => (/* binding */ __asyncGenerator), +/* harmony export */ __asyncValues: () => (/* binding */ __asyncValues), +/* harmony export */ __await: () => (/* binding */ __await), +/* harmony export */ __awaiter: () => (/* binding */ __awaiter), +/* harmony export */ __classPrivateFieldGet: () => (/* binding */ __classPrivateFieldGet), +/* harmony export */ __classPrivateFieldSet: () => (/* binding */ __classPrivateFieldSet), +/* harmony export */ __createBinding: () => (/* binding */ __createBinding), +/* harmony export */ __decorate: () => (/* binding */ __decorate), +/* harmony export */ __exportStar: () => (/* binding */ __exportStar), +/* harmony export */ __extends: () => (/* binding */ __extends), +/* harmony export */ __generator: () => (/* binding */ __generator), +/* harmony export */ __importDefault: () => (/* binding */ __importDefault), +/* harmony export */ __importStar: () => (/* binding */ __importStar), +/* harmony export */ __makeTemplateObject: () => (/* binding */ __makeTemplateObject), +/* harmony export */ __metadata: () => (/* binding */ __metadata), +/* harmony export */ __param: () => (/* binding */ __param), +/* harmony export */ __read: () => (/* binding */ __read), +/* harmony export */ __rest: () => (/* binding */ __rest), +/* harmony export */ __spread: () => (/* binding */ __spread), +/* harmony export */ __spreadArrays: () => (/* binding */ __spreadArrays), +/* harmony export */ __values: () => (/* binding */ __values) +/* harmony export */ }); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +function __createBinding(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +} + +function __exportStar(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], 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(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), 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; +}; + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +} + +function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +} + + /***/ }), /***/ 61747: @@ -37415,273 +23758,6 @@ const removeCirculars = (obj, branch = new Map(), path = "root") => { }; -/***/ }), - -/***/ 67322: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports = __webpack_require__(79272)('node_sqlite3.node'); - - -/***/ }), - -/***/ 45430: -/***/ ((module, exports, __webpack_require__) => { - -const path = __webpack_require__(16928); -const sqlite3 = __webpack_require__(67322); -const EventEmitter = (__webpack_require__(24434).EventEmitter); -module.exports = exports = sqlite3; - -function normalizeMethod (fn) { - return function (sql) { - let errBack; - const args = Array.prototype.slice.call(arguments, 1); - - if (typeof args[args.length - 1] === 'function') { - const callback = args[args.length - 1]; - errBack = function(err) { - if (err) { - callback(err); - } - }; - } - const statement = new Statement(this, sql, errBack); - return fn.call(this, statement, args); - }; -} - -function inherits(target, source) { - for (const k in source.prototype) - target.prototype[k] = source.prototype[k]; -} - -sqlite3.cached = { - Database: function(file, a, b) { - if (file === '' || file === ':memory:') { - // Don't cache special databases. - return new Database(file, a, b); - } - - let db; - file = path.resolve(file); - - if (!sqlite3.cached.objects[file]) { - db = sqlite3.cached.objects[file] = new Database(file, a, b); - } - else { - // Make sure the callback is called. - db = sqlite3.cached.objects[file]; - const callback = (typeof a === 'number') ? b : a; - if (typeof callback === 'function') { - function cb() { callback.call(db, null); } - if (db.open) process.nextTick(cb); - else db.once('open', cb); - } - } - - return db; - }, - objects: {} -}; - - -const Database = sqlite3.Database; -const Statement = sqlite3.Statement; -const Backup = sqlite3.Backup; - -inherits(Database, EventEmitter); -inherits(Statement, EventEmitter); -inherits(Backup, EventEmitter); - -// Database#prepare(sql, [bind1, bind2, ...], [callback]) -Database.prototype.prepare = normalizeMethod(function(statement, params) { - return params.length - ? statement.bind.apply(statement, params) - : statement; -}); - -// Database#run(sql, [bind1, bind2, ...], [callback]) -Database.prototype.run = normalizeMethod(function(statement, params) { - statement.run.apply(statement, params).finalize(); - return this; -}); - -// Database#get(sql, [bind1, bind2, ...], [callback]) -Database.prototype.get = normalizeMethod(function(statement, params) { - statement.get.apply(statement, params).finalize(); - return this; -}); - -// Database#all(sql, [bind1, bind2, ...], [callback]) -Database.prototype.all = normalizeMethod(function(statement, params) { - statement.all.apply(statement, params).finalize(); - return this; -}); - -// Database#each(sql, [bind1, bind2, ...], [callback], [complete]) -Database.prototype.each = normalizeMethod(function(statement, params) { - statement.each.apply(statement, params).finalize(); - return this; -}); - -Database.prototype.map = normalizeMethod(function(statement, params) { - statement.map.apply(statement, params).finalize(); - return this; -}); - -// Database#backup(filename, [callback]) -// Database#backup(filename, destName, sourceName, filenameIsDest, [callback]) -Database.prototype.backup = function() { - let backup; - if (arguments.length <= 2) { - // By default, we write the main database out to the main database of the named file. - // This is the most likely use of the backup api. - backup = new Backup(this, arguments[0], 'main', 'main', true, arguments[1]); - } else { - // Otherwise, give the user full control over the sqlite3_backup_init arguments. - backup = new Backup(this, arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]); - } - // Per the sqlite docs, exclude the following errors as non-fatal by default. - backup.retryErrors = [sqlite3.BUSY, sqlite3.LOCKED]; - return backup; -}; - -Statement.prototype.map = function() { - const params = Array.prototype.slice.call(arguments); - const callback = params.pop(); - params.push(function(err, rows) { - if (err) return callback(err); - const result = {}; - if (rows.length) { - const keys = Object.keys(rows[0]); - const key = keys[0]; - if (keys.length > 2) { - // Value is an object - for (let i = 0; i < rows.length; i++) { - result[rows[i][key]] = rows[i]; - } - } else { - const value = keys[1]; - // Value is a plain value - for (let i = 0; i < rows.length; i++) { - result[rows[i][key]] = rows[i][value]; - } - } - } - callback(err, result); - }); - return this.all.apply(this, params); -}; - -let isVerbose = false; - -const supportedEvents = [ 'trace', 'profile', 'change' ]; - -Database.prototype.addListener = Database.prototype.on = function(type) { - const val = EventEmitter.prototype.addListener.apply(this, arguments); - if (supportedEvents.indexOf(type) >= 0) { - this.configure(type, true); - } - return val; -}; - -Database.prototype.removeListener = function(type) { - const val = EventEmitter.prototype.removeListener.apply(this, arguments); - if (supportedEvents.indexOf(type) >= 0 && !this._events[type]) { - this.configure(type, false); - } - return val; -}; - -Database.prototype.removeAllListeners = function(type) { - const val = EventEmitter.prototype.removeAllListeners.apply(this, arguments); - if (supportedEvents.indexOf(type) >= 0) { - this.configure(type, false); - } - return val; -}; - -// Save the stack trace over EIO callbacks. -sqlite3.verbose = function() { - if (!isVerbose) { - const trace = __webpack_require__(60738); - [ - 'prepare', - 'get', - 'run', - 'all', - 'each', - 'map', - 'close', - 'exec' - ].forEach(function (name) { - trace.extendTrace(Database.prototype, name); - }); - [ - 'bind', - 'get', - 'run', - 'all', - 'each', - 'map', - 'reset', - 'finalize', - ].forEach(function (name) { - trace.extendTrace(Statement.prototype, name); - }); - isVerbose = true; - } - - return sqlite3; -}; - - -/***/ }), - -/***/ 60738: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -// Inspired by https://github.com/tlrobinson/long-stack-traces -const util = __webpack_require__(39023); - -function extendTrace(object, property, pos) { - const old = object[property]; - object[property] = function() { - const error = new Error(); - const name = object.constructor.name + '#' + property + '(' + - Array.prototype.slice.call(arguments).map(function(el) { - return util.inspect(el, false, 0); - }).join(', ') + ')'; - - if (typeof pos === 'undefined') pos = -1; - if (pos < 0) pos += arguments.length; - const cb = arguments[pos]; - if (typeof arguments[pos] === 'function') { - arguments[pos] = function replacement() { - const err = arguments[0]; - if (err && err.stack && !err.__augmented) { - err.stack = filter(err).join('\n'); - err.stack += '\n--> in ' + name; - err.stack += '\n' + filter(error).slice(1).join('\n'); - err.__augmented = true; - } - return cb.apply(this, arguments); - }; - } - return old.apply(this, arguments); - }; -} -exports.extendTrace = extendTrace; - - -function filter(error) { - return error.stack.split('\n').filter(function(line) { - return line.indexOf(__filename) < 0; - }); -} - - /***/ }), /***/ 91370: @@ -38980,6 +25056,39 @@ Object.defineProperty(exports, "configs", ({ })); +/***/ }), + +/***/ 55399: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +exports.S = function (fn) { + return Object.defineProperty(function () { + if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments) + else { + return new Promise((resolve, reject) => { + arguments[arguments.length] = (err, res) => { + if (err) return reject(err) + resolve(res) + } + arguments.length++ + fn.apply(this, arguments) + }) + } + }, 'name', { value: fn.name }) +} + +exports.z = function (fn) { + return Object.defineProperty(function () { + const cb = arguments[arguments.length - 1] + if (typeof cb !== 'function') return fn.apply(this, arguments) + else fn.apply(this, arguments).then(r => cb(null, r), cb) + }, 'name', { value: fn.name }) +} + + /***/ }), /***/ 32926: @@ -135808,6 +121917,14 @@ module.exports = require("child_process"); /***/ }), +/***/ 49140: +/***/ ((module) => { + +"use strict"; +module.exports = require("constants"); + +/***/ }), + /***/ 76982: /***/ ((module) => { @@ -136006,6 +122123,90 @@ module.exports = require("worker_threads"); "use strict"; module.exports = require("zlib"); +/***/ }), + +/***/ 77283: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +"use strict"; + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + defaultDeserialize: () => defaultDeserialize, + defaultSerialize: () => defaultSerialize +}); +module.exports = __toCommonJS(index_exports); +var import_node_buffer = __webpack_require__(20181); +var defaultSerialize = (data) => { + if (data === void 0 || data === null) { + return "null"; + } + if (typeof data === "string") { + return JSON.stringify(data.startsWith(":") ? ":" + data : data); + } + if (import_node_buffer.Buffer.isBuffer(data)) { + return JSON.stringify(":base64:" + data.toString("base64")); + } + if (data?.toJSON) { + data = data.toJSON(); + } + if (typeof data === "object") { + let s = ""; + const array = Array.isArray(data); + s = array ? "[" : "{"; + let first = true; + for (const k in data) { + const ignore = typeof data[k] === "function" || !array && data[k] === void 0; + if (!Object.hasOwn(data, k) || ignore) { + continue; + } + if (!first) { + s += ","; + } + first = false; + if (array) { + s += defaultSerialize(data[k]); + } else if (data[k] !== void 0) { + s += defaultSerialize(k) + ":" + defaultSerialize(data[k]); + } + } + s += array ? "]" : "}"; + return s; + } + return JSON.stringify(data); +}; +var defaultDeserialize = (data) => JSON.parse(data, (_, value) => { + if (typeof value === "string") { + if (value.startsWith(":base64:")) { + return import_node_buffer.Buffer.from(value.slice(8), "base64"); + } + return value.startsWith(":") ? value.slice(1) : value; + } + return value; +}); +// Annotate the CommonJS export names for ESM import in node: +0 && (0); + + /***/ }), /***/ 47892: @@ -166150,11 +152351,10 @@ const createClient = (options) => { // EXPORTS __webpack_require__.d(__webpack_exports__, { - X4: () => (/* binding */ default_sort), eF: () => (/* binding */ run) }); -// UNUSED EXPORTS: complete_messages, complete_options, complete_params, execute_request, processRun +// UNUSED EXPORTS: complete_messages, complete_options, complete_params, default_sort, execute_request, processRun // EXTERNAL MODULE: external "node:path" var external_node_path_ = __webpack_require__(76760); @@ -168483,8 +154683,8 @@ const load = async (options) => { return profile.variables; }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZmlsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3N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UFjLENBQUMsQ0FBQyxDQUFBO0lBQ2hHLElBQUcsQ0FBQyxXQUFXLElBQUksQ0FBQyxNQUFNLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsV0FBVyxDQUFDLEVBQUMsQ0FBQztRQUM3RCxPQUFPLE9BQU8sQ0FBQyxTQUFTLENBQUE7SUFDNUIsQ0FBQztJQUNELE9BQU8sR0FBRyxLQUFLLENBQUMsV0FBVyxFQUFFLE9BQU8sRUFBRSxFQUFFLEdBQUcsRUFBRSxPQUFPLENBQUMsR0FBRyxJQUFJLFNBQVMsRUFBRSxDQUFDLElBQUksT0FBTyxDQUFBO0lBQ25GLE9BQU8sT0FBTyxDQUFDLFNBQVMsQ0FBQTtBQUM1QixDQUFDLENBQUEifQ== -// EXTERNAL MODULE: ./dist-in/tools.js + 88 modules -var tools = __webpack_require__(49315); +// EXTERNAL MODULE: ./dist-in/tools.js + 84 modules +var tools = __webpack_require__(3043); ;// ./dist-in/utils/content.js const content = (result) => { return result?.choices?.[0]?.message?.content || ""; @@ -169809,6 +156009,9 @@ var E_OPENROUTER_MODEL; ;// ./dist-in/models/cache/openrouter-models-free.js var E_OPENROUTER_MODEL_FREE; (function (E_OPENROUTER_MODEL_FREE) { + E_OPENROUTER_MODEL_FREE["MODEL_FREE_NVIDIA_NEMOTRON_NANO_9B_V2_FREE"] = "nvidia/nemotron-nano-9b-v2:free"; + E_OPENROUTER_MODEL_FREE["MODEL_FREE_OPENROUTER_SONOMA_DUSK_ALPHA"] = "openrouter/sonoma-dusk-alpha"; + E_OPENROUTER_MODEL_FREE["MODEL_FREE_OPENROUTER_SONOMA_SKY_ALPHA"] = "openrouter/sonoma-sky-alpha"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_DEEPSEEK_DEEPSEEK_CHAT_V3_1_FREE"] = "deepseek/deepseek-chat-v3.1:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_OPENAI_GPT_OSS_120B_FREE"] = "openai/gpt-oss-120b:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_OPENAI_GPT_OSS_20B_FREE"] = "openai/gpt-oss-20b:free"; @@ -169840,7 +156043,6 @@ var E_OPENROUTER_MODEL_FREE; E_OPENROUTER_MODEL_FREE["MODEL_FREE_NVIDIA_LLAMA_3_1_NEMOTRON_ULTRA_253B_V1_FREE"] = "nvidia/llama-3.1-nemotron-ultra-253b-v1:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_META_LLAMA_LLAMA_4_MAVERICK_FREE"] = "meta-llama/llama-4-maverick:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_META_LLAMA_LLAMA_4_SCOUT_FREE"] = "meta-llama/llama-4-scout:free"; - E_OPENROUTER_MODEL_FREE["MODEL_FREE_GOOGLE_GEMINI_2_5_PRO_EXP_03_25"] = "google/gemini-2.5-pro-exp-03-25"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_QWEN_QWEN2_5_VL_32B_INSTRUCT_FREE"] = "qwen/qwen2.5-vl-32b-instruct:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_DEEPSEEK_DEEPSEEK_CHAT_V3_0324_FREE"] = "deepseek/deepseek-chat-v3-0324:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_MISTRALAI_MISTRAL_SMALL_3_1_24B_INSTRUCT_FREE"] = "mistralai/mistral-small-3.1-24b-instruct:free"; @@ -169867,7 +156069,7 @@ var E_OPENROUTER_MODEL_FREE; E_OPENROUTER_MODEL_FREE["MODEL_FREE_GOOGLE_GEMMA_2_9B_IT_FREE"] = "google/gemma-2-9b-it:free"; E_OPENROUTER_MODEL_FREE["MODEL_FREE_MISTRALAI_MISTRAL_7B_INSTRUCT_FREE"] = "mistralai/mistral-7b-instruct:free"; })(E_OPENROUTER_MODEL_FREE || (E_OPENROUTER_MODEL_FREE = {})); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3BlbnJvdXRlci1tb2RlbHMtZnJl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YsaUdBQXNFLENBQUE7SUFDdEUsNkZBQWtFLENBQUE7SUFDbEUsK0dBQW9GLENBQUE7QUFDdEYsQ0FBQyxFQTVEVyx1QkFBdUIsS0FBdkIsdUJBQXVCLFFBNERsQyJ9 ;// ./dist-in/index.js @@ -170249,7 +156451,7 @@ function listModelsAsStrings(models) { /***/ }), -/***/ 49315: +/***/ 3043: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; @@ -188080,1055 +174282,6 @@ const search_tools = (target, options) => { ]; }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VhcmNoLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi90b29scy9zZWFyY2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLDJCQUEyQixDQUFBO0FBQ25ELE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQTtBQUNsRCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZ0JBQWdCLENBQUE7QUFHM0MsTUFBTSxDQUFDLE1BQU0sS0FBSyxHQUFHLENBQUMsTUFBYyxFQUFFLE9BQWtCLEVBQWMsRUFBRTtJQUNwRSxNQUFNLE1BQU0sR0FBRyxVQUFVLENBQUMsUUFBUSxFQUFFLE9BQU8sQ0FBQyxDQUFBO0lBQzVDLE9BQU87UUFDSDtZQUNJLElBQUksRUFBRSxVQUFVO1lBQ2hCLFFBQVEsRUFBRTtnQkFDTixJQUFJLEVBQUUsUUFBUTtnQkFDZCxXQUFXLEVBQUUscUNBQXFDO2dCQUNsRCxVQUFVLEVBQUU7b0JBQ1IsSUFBSSxFQUFFLFFBQVE7b0JBQ2QsVUFBVSxFQUFFO3dCQUNSLEtBQUssRUFBRSxFQUFFLElBQUksRUFBRSxRQUFRLEVBQUU7cUJ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QUE7b0JBQ1QsT0FBTyxJQUFJLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQyxDQUFBO2dCQUNsQyxDQUFDO2dCQUNELEtBQUssRUFBRSxJQUFJLENBQUMsS0FBSzthQUNwQjtTQUN5QjtLQUNqQyxDQUFBO0FBQ0wsQ0FBQyxDQUFDIn0= -;// external "require('puppeteer')" -const external_require_puppeteer_namespaceObject = require('puppeteer'); -;// ../ai-tools/node_modules/turndown/lib/turndown.es.js -function extend (destination) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) { - if (source.hasOwnProperty(key)) destination[key] = source[key]; - } - } - return destination -} - -function repeat (character, count) { - return Array(count + 1).join(character) -} - -function trimLeadingNewlines (string) { - return string.replace(/^\n*/, '') -} - -function trimTrailingNewlines (string) { - // avoid match-at-end regexp bottleneck, see #370 - var indexEnd = string.length; - while (indexEnd > 0 && string[indexEnd - 1] === '\n') indexEnd--; - return string.substring(0, indexEnd) -} - -var blockElements = [ - 'ADDRESS', 'ARTICLE', 'ASIDE', 'AUDIO', 'BLOCKQUOTE', 'BODY', 'CANVAS', - 'CENTER', 'DD', 'DIR', 'DIV', 'DL', 'DT', 'FIELDSET', 'FIGCAPTION', 'FIGURE', - 'FOOTER', 'FORM', 'FRAMESET', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HEADER', - 'HGROUP', 'HR', 'HTML', 'ISINDEX', 'LI', 'MAIN', 'MENU', 'NAV', 'NOFRAMES', - 'NOSCRIPT', 'OL', 'OUTPUT', 'P', 'PRE', 'SECTION', 'TABLE', 'TBODY', 'TD', - 'TFOOT', 'TH', 'THEAD', 'TR', 'UL' -]; - -function isBlock (node) { - return is(node, blockElements) -} - -var voidElements = [ - 'AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', - 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR' -]; - -function isVoid (node) { - return is(node, voidElements) -} - -function hasVoid (node) { - return has(node, voidElements) -} - -var meaningfulWhenBlankElements = [ - 'A', 'TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TH', 'TD', 'IFRAME', 'SCRIPT', - 'AUDIO', 'VIDEO' -]; - -function isMeaningfulWhenBlank (node) { - return is(node, meaningfulWhenBlankElements) -} - -function hasMeaningfulWhenBlank (node) { - return has(node, meaningfulWhenBlankElements) -} - -function is (node, tagNames) { - return tagNames.indexOf(node.nodeName) >= 0 -} - -function has (node, tagNames) { - return ( - node.getElementsByTagName && - tagNames.some(function (tagName) { - return node.getElementsByTagName(tagName).length - }) - ) -} - -var rules = {}; - -rules.paragraph = { - filter: 'p', - - replacement: function (content) { - return '\n\n' + content + '\n\n' - } -}; - -rules.lineBreak = { - filter: 'br', - - replacement: function (content, node, options) { - return options.br + '\n' - } -}; - -rules.heading = { - filter: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'], - - replacement: function (content, node, options) { - var hLevel = Number(node.nodeName.charAt(1)); - - if (options.headingStyle === 'setext' && hLevel < 3) { - var underline = repeat((hLevel === 1 ? '=' : '-'), content.length); - return ( - '\n\n' + content + '\n' + underline + '\n\n' - ) - } else { - return '\n\n' + repeat('#', hLevel) + ' ' + content + '\n\n' - } - } -}; - -rules.blockquote = { - filter: 'blockquote', - - replacement: function (content) { - content = content.replace(/^\n+|\n+$/g, ''); - content = content.replace(/^/gm, '> '); - return '\n\n' + content + '\n\n' - } -}; - -rules.list = { - filter: ['ul', 'ol'], - - replacement: function (content, node) { - var parent = node.parentNode; - if (parent.nodeName === 'LI' && parent.lastElementChild === node) { - return '\n' + content - } else { - return '\n\n' + content + '\n\n' - } - } -}; - -rules.listItem = { - filter: 'li', - - replacement: function (content, node, options) { - content = content - .replace(/^\n+/, '') // remove leading newlines - .replace(/\n+$/, '\n') // replace trailing newlines with just a single one - .replace(/\n/gm, '\n '); // indent - var prefix = options.bulletListMarker + ' '; - var parent = node.parentNode; - if (parent.nodeName === 'OL') { - var start = parent.getAttribute('start'); - var index = Array.prototype.indexOf.call(parent.children, node); - prefix = (start ? Number(start) + index : index + 1) + '. '; - } - return ( - prefix + content + (node.nextSibling && !/\n$/.test(content) ? '\n' : '') - ) - } -}; - -rules.indentedCodeBlock = { - filter: function (node, options) { - return ( - options.codeBlockStyle === 'indented' && - node.nodeName === 'PRE' && - node.firstChild && - node.firstChild.nodeName === 'CODE' - ) - }, - - replacement: function (content, node, options) { - return ( - '\n\n ' + - node.firstChild.textContent.replace(/\n/g, '\n ') + - '\n\n' - ) - } -}; - -rules.fencedCodeBlock = { - filter: function (node, options) { - return ( - options.codeBlockStyle === 'fenced' && - node.nodeName === 'PRE' && - node.firstChild && - node.firstChild.nodeName === 'CODE' - ) - }, - - replacement: function (content, node, options) { - var className = node.firstChild.getAttribute('class') || ''; - var language = (className.match(/language-(\S+)/) || [null, ''])[1]; - var code = node.firstChild.textContent; - - var fenceChar = options.fence.charAt(0); - var fenceSize = 3; - var fenceInCodeRegex = new RegExp('^' + fenceChar + '{3,}', 'gm'); - - var match; - while ((match = fenceInCodeRegex.exec(code))) { - if (match[0].length >= fenceSize) { - fenceSize = match[0].length + 1; - } - } - - var fence = repeat(fenceChar, fenceSize); - - return ( - '\n\n' + fence + language + '\n' + - code.replace(/\n$/, '') + - '\n' + fence + '\n\n' - ) - } -}; - -rules.horizontalRule = { - filter: 'hr', - - replacement: function (content, node, options) { - return '\n\n' + options.hr + '\n\n' - } -}; - -rules.inlineLink = { - filter: function (node, options) { - return ( - options.linkStyle === 'inlined' && - node.nodeName === 'A' && - node.getAttribute('href') - ) - }, - - replacement: function (content, node) { - var href = node.getAttribute('href'); - if (href) href = href.replace(/([()])/g, '\\$1'); - var title = cleanAttribute(node.getAttribute('title')); - if (title) title = ' "' + title.replace(/"/g, '\\"') + '"'; - return '[' + content + '](' + href + title + ')' - } -}; - -rules.referenceLink = { - filter: function (node, options) { - return ( - options.linkStyle === 'referenced' && - node.nodeName === 'A' && - node.getAttribute('href') - ) - }, - - replacement: function (content, node, options) { - var href = node.getAttribute('href'); - var title = cleanAttribute(node.getAttribute('title')); - if (title) title = ' "' + title + '"'; - var replacement; - var reference; - - switch (options.linkReferenceStyle) { - case 'collapsed': - replacement = '[' + content + '][]'; - reference = '[' + content + ']: ' + href + title; - break - case 'shortcut': - replacement = '[' + content + ']'; - reference = '[' + content + ']: ' + href + title; - break - default: - var id = this.references.length + 1; - replacement = '[' + content + '][' + id + ']'; - reference = '[' + id + ']: ' + href + title; - } - - this.references.push(reference); - return replacement - }, - - references: [], - - append: function (options) { - var references = ''; - if (this.references.length) { - references = '\n\n' + this.references.join('\n') + '\n\n'; - this.references = []; // Reset references - } - return references - } -}; - -rules.emphasis = { - filter: ['em', 'i'], - - replacement: function (content, node, options) { - if (!content.trim()) return '' - return options.emDelimiter + content + options.emDelimiter - } -}; - -rules.strong = { - filter: ['strong', 'b'], - - replacement: function (content, node, options) { - if (!content.trim()) return '' - return options.strongDelimiter + content + options.strongDelimiter - } -}; - -rules.code = { - filter: function (node) { - var hasSiblings = node.previousSibling || node.nextSibling; - var isCodeBlock = node.parentNode.nodeName === 'PRE' && !hasSiblings; - - return node.nodeName === 'CODE' && !isCodeBlock - }, - - replacement: function (content) { - if (!content) return '' - content = content.replace(/\r?\n|\r/g, ' '); - - var extraSpace = /^`|^ .*?[^ ].* $|`$/.test(content) ? ' ' : ''; - var delimiter = '`'; - var matches = content.match(/`+/gm) || []; - while (matches.indexOf(delimiter) !== -1) delimiter = delimiter + '`'; - - return delimiter + extraSpace + content + extraSpace + delimiter - } -}; - -rules.image = { - filter: 'img', - - replacement: function (content, node) { - var alt = cleanAttribute(node.getAttribute('alt')); - var src = node.getAttribute('src') || ''; - var title = cleanAttribute(node.getAttribute('title')); - var titlePart = title ? ' "' + title + '"' : ''; - return src ? '![' + alt + ']' + '(' + src + titlePart + ')' : '' - } -}; - -function cleanAttribute (attribute) { - return attribute ? attribute.replace(/(\n+\s*)+/g, '\n') : '' -} - -/** - * Manages a collection of rules used to convert HTML to Markdown - */ - -function Rules (options) { - this.options = options; - this._keep = []; - this._remove = []; - - this.blankRule = { - replacement: options.blankReplacement - }; - - this.keepReplacement = options.keepReplacement; - - this.defaultRule = { - replacement: options.defaultReplacement - }; - - this.array = []; - for (var key in options.rules) this.array.push(options.rules[key]); -} - -Rules.prototype = { - add: function (key, rule) { - this.array.unshift(rule); - }, - - keep: function (filter) { - this._keep.unshift({ - filter: filter, - replacement: this.keepReplacement - }); - }, - - remove: function (filter) { - this._remove.unshift({ - filter: filter, - replacement: function () { - return '' - } - }); - }, - - forNode: function (node) { - if (node.isBlank) return this.blankRule - var rule; - - if ((rule = findRule(this.array, node, this.options))) return rule - if ((rule = findRule(this._keep, node, this.options))) return rule - if ((rule = findRule(this._remove, node, this.options))) return rule - - return this.defaultRule - }, - - forEach: function (fn) { - for (var i = 0; i < this.array.length; i++) fn(this.array[i], i); - } -}; - -function findRule (rules, node, options) { - for (var i = 0; i < rules.length; i++) { - var rule = rules[i]; - if (filterValue(rule, node, options)) return rule - } - return void 0 -} - -function filterValue (rule, node, options) { - var filter = rule.filter; - if (typeof filter === 'string') { - if (filter === node.nodeName.toLowerCase()) return true - } else if (Array.isArray(filter)) { - if (filter.indexOf(node.nodeName.toLowerCase()) > -1) return true - } else if (typeof filter === 'function') { - if (filter.call(rule, node, options)) return true - } else { - throw new TypeError('`filter` needs to be a string, array, or function') - } -} - -/** - * The collapseWhitespace function is adapted from collapse-whitespace - * by Luc Thevenard. - * - * The MIT License (MIT) - * - * Copyright (c) 2014 Luc Thevenard - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -/** - * collapseWhitespace(options) removes extraneous whitespace from an the given element. - * - * @param {Object} options - */ -function collapseWhitespace (options) { - var element = options.element; - var isBlock = options.isBlock; - var isVoid = options.isVoid; - var isPre = options.isPre || function (node) { - return node.nodeName === 'PRE' - }; - - if (!element.firstChild || isPre(element)) return - - var prevText = null; - var keepLeadingWs = false; - - var prev = null; - var node = turndown_es_next(prev, element, isPre); - - while (node !== element) { - if (node.nodeType === 3 || node.nodeType === 4) { // Node.TEXT_NODE or Node.CDATA_SECTION_NODE - var text = node.data.replace(/[ \r\n\t]+/g, ' '); - - if ((!prevText || / $/.test(prevText.data)) && - !keepLeadingWs && text[0] === ' ') { - text = text.substr(1); - } - - // `text` might be empty at this point. - if (!text) { - node = turndown_es_remove(node); - continue - } - - node.data = text; - - prevText = node; - } else if (node.nodeType === 1) { // Node.ELEMENT_NODE - if (isBlock(node) || node.nodeName === 'BR') { - if (prevText) { - prevText.data = prevText.data.replace(/ $/, ''); - } - - prevText = null; - keepLeadingWs = false; - } else if (isVoid(node) || isPre(node)) { - // Avoid trimming space around non-block, non-BR void elements and inline PRE. - prevText = null; - keepLeadingWs = true; - } else if (prevText) { - // Drop protection if set previously. - keepLeadingWs = false; - } - } else { - node = turndown_es_remove(node); - continue - } - - var nextNode = turndown_es_next(prev, node, isPre); - prev = node; - node = nextNode; - } - - if (prevText) { - prevText.data = prevText.data.replace(/ $/, ''); - if (!prevText.data) { - turndown_es_remove(prevText); - } - } -} - -/** - * remove(node) removes the given node from the DOM and returns the - * next node in the sequence. - * - * @param {Node} node - * @return {Node} node - */ -function turndown_es_remove (node) { - var next = node.nextSibling || node.parentNode; - - node.parentNode.removeChild(node); - - return next -} - -/** - * next(prev, current, isPre) returns the next node in the sequence, given the - * current and previous nodes. - * - * @param {Node} prev - * @param {Node} current - * @param {Function} isPre - * @return {Node} - */ -function turndown_es_next (prev, current, isPre) { - if ((prev && prev.parentNode === current) || isPre(current)) { - return current.nextSibling || current.parentNode - } - - return current.firstChild || current.nextSibling || current.parentNode -} - -/* - * Set up window for Node.js - */ - -var root = (typeof window !== 'undefined' ? window : {}); - -/* - * Parsing HTML strings - */ - -function canParseHTMLNatively () { - var Parser = root.DOMParser; - var canParse = false; - - // Adapted from https://gist.github.com/1129031 - // Firefox/Opera/IE throw errors on unsupported types - try { - // WebKit returns null on unsupported types - if (new Parser().parseFromString('', 'text/html')) { - canParse = true; - } - } catch (e) {} - - return canParse -} - -function createHTMLParser () { - var Parser = function () {}; - - { - var domino = __webpack_require__(31993); - Parser.prototype.parseFromString = function (string) { - return domino.createDocument(string) - }; - } - return Parser -} - -var HTMLParser = canParseHTMLNatively() ? root.DOMParser : createHTMLParser(); - -function RootNode (input, options) { - var root; - if (typeof input === 'string') { - var doc = htmlParser().parseFromString( - // DOM parsers arrange elements in the and . - // Wrapping in a custom element ensures elements are reliably arranged in - // a single element. - '' + input + '', - 'text/html' - ); - root = doc.getElementById('turndown-root'); - } else { - root = input.cloneNode(true); - } - collapseWhitespace({ - element: root, - isBlock: isBlock, - isVoid: isVoid, - isPre: options.preformattedCode ? isPreOrCode : null - }); - - return root -} - -var _htmlParser; -function htmlParser () { - _htmlParser = _htmlParser || new HTMLParser(); - return _htmlParser -} - -function isPreOrCode (node) { - return node.nodeName === 'PRE' || node.nodeName === 'CODE' -} - -function Node (node, options) { - node.isBlock = isBlock(node); - node.isCode = node.nodeName === 'CODE' || node.parentNode.isCode; - node.isBlank = isBlank(node); - node.flankingWhitespace = flankingWhitespace(node, options); - return node -} - -function isBlank (node) { - return ( - !isVoid(node) && - !isMeaningfulWhenBlank(node) && - /^\s*$/i.test(node.textContent) && - !hasVoid(node) && - !hasMeaningfulWhenBlank(node) - ) -} - -function flankingWhitespace (node, options) { - if (node.isBlock || (options.preformattedCode && node.isCode)) { - return { leading: '', trailing: '' } - } - - var edges = edgeWhitespace(node.textContent); - - // abandon leading ASCII WS if left-flanked by ASCII WS - if (edges.leadingAscii && isFlankedByWhitespace('left', node, options)) { - edges.leading = edges.leadingNonAscii; - } - - // abandon trailing ASCII WS if right-flanked by ASCII WS - if (edges.trailingAscii && isFlankedByWhitespace('right', node, options)) { - edges.trailing = edges.trailingNonAscii; - } - - return { leading: edges.leading, trailing: edges.trailing } -} - -function edgeWhitespace (string) { - var m = string.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/); - return { - leading: m[1], // whole string for whitespace-only strings - leadingAscii: m[2], - leadingNonAscii: m[3], - trailing: m[4], // empty for whitespace-only strings - trailingNonAscii: m[5], - trailingAscii: m[6] - } -} - -function isFlankedByWhitespace (side, node, options) { - var sibling; - var regExp; - var isFlanked; - - if (side === 'left') { - sibling = node.previousSibling; - regExp = / $/; - } else { - sibling = node.nextSibling; - regExp = /^ /; - } - - if (sibling) { - if (sibling.nodeType === 3) { - isFlanked = regExp.test(sibling.nodeValue); - } else if (options.preformattedCode && sibling.nodeName === 'CODE') { - isFlanked = false; - } else if (sibling.nodeType === 1 && !isBlock(sibling)) { - isFlanked = regExp.test(sibling.textContent); - } - } - return isFlanked -} - -var reduce = Array.prototype.reduce; -var escapes = [ - [/\\/g, '\\\\'], - [/\*/g, '\\*'], - [/^-/g, '\\-'], - [/^\+ /g, '\\+ '], - [/^(=+)/g, '\\$1'], - [/^(#{1,6}) /g, '\\$1 '], - [/`/g, '\\`'], - [/^~~~/g, '\\~~~'], - [/\[/g, '\\['], - [/\]/g, '\\]'], - [/^>/g, '\\>'], - [/_/g, '\\_'], - [/^(\d+)\. /g, '$1\\. '] -]; - -function TurndownService (options) { - if (!(this instanceof TurndownService)) return new TurndownService(options) - - var defaults = { - rules: rules, - headingStyle: 'setext', - hr: '* * *', - bulletListMarker: '*', - codeBlockStyle: 'indented', - fence: '```', - emDelimiter: '_', - strongDelimiter: '**', - linkStyle: 'inlined', - linkReferenceStyle: 'full', - br: ' ', - preformattedCode: false, - blankReplacement: function (content, node) { - return node.isBlock ? '\n\n' : '' - }, - keepReplacement: function (content, node) { - return node.isBlock ? '\n\n' + node.outerHTML + '\n\n' : node.outerHTML - }, - defaultReplacement: function (content, node) { - return node.isBlock ? '\n\n' + content + '\n\n' : content - } - }; - this.options = extend({}, defaults, options); - this.rules = new Rules(this.options); -} - -TurndownService.prototype = { - /** - * The entry point for converting a string or DOM node to Markdown - * @public - * @param {String|HTMLElement} input The string or DOM node to convert - * @returns A Markdown representation of the input - * @type String - */ - - turndown: function (input) { - if (!canConvert(input)) { - throw new TypeError( - input + ' is not a string, or an element/document/fragment node.' - ) - } - - if (input === '') return '' - - var output = turndown_es_process.call(this, new RootNode(input, this.options)); - return postProcess.call(this, output) - }, - - /** - * Add one or more plugins - * @public - * @param {Function|Array} plugin The plugin or array of plugins to add - * @returns The Turndown instance for chaining - * @type Object - */ - - use: function (plugin) { - if (Array.isArray(plugin)) { - for (var i = 0; i < plugin.length; i++) this.use(plugin[i]); - } else if (typeof plugin === 'function') { - plugin(this); - } else { - throw new TypeError('plugin must be a Function or an Array of Functions') - } - return this - }, - - /** - * Adds a rule - * @public - * @param {String} key The unique key of the rule - * @param {Object} rule The rule - * @returns The Turndown instance for chaining - * @type Object - */ - - addRule: function (key, rule) { - this.rules.add(key, rule); - return this - }, - - /** - * Keep a node (as HTML) that matches the filter - * @public - * @param {String|Array|Function} filter The unique key of the rule - * @returns The Turndown instance for chaining - * @type Object - */ - - keep: function (filter) { - this.rules.keep(filter); - return this - }, - - /** - * Remove a node that matches the filter - * @public - * @param {String|Array|Function} filter The unique key of the rule - * @returns The Turndown instance for chaining - * @type Object - */ - - remove: function (filter) { - this.rules.remove(filter); - return this - }, - - /** - * Escapes Markdown syntax - * @public - * @param {String} string The string to escape - * @returns A string with Markdown syntax escaped - * @type String - */ - - escape: function (string) { - return escapes.reduce(function (accumulator, escape) { - return accumulator.replace(escape[0], escape[1]) - }, string) - } -}; - -/** - * Reduces a DOM node down to its Markdown string equivalent - * @private - * @param {HTMLElement} parentNode The node to convert - * @returns A Markdown representation of the node - * @type String - */ - -function turndown_es_process (parentNode) { - var self = this; - return reduce.call(parentNode.childNodes, function (output, node) { - node = new Node(node, self.options); - - var replacement = ''; - if (node.nodeType === 3) { - replacement = node.isCode ? node.nodeValue : self.escape(node.nodeValue); - } else if (node.nodeType === 1) { - replacement = replacementForNode.call(self, node); - } - - return join(output, replacement) - }, '') -} - -/** - * Appends strings as each rule requires and trims the output - * @private - * @param {String} output The conversion output - * @returns A trimmed version of the ouput - * @type String - */ - -function postProcess (output) { - var self = this; - this.rules.forEach(function (rule) { - if (typeof rule.append === 'function') { - output = join(output, rule.append(self.options)); - } - }); - - return output.replace(/^[\t\r\n]+/, '').replace(/[\t\r\n\s]+$/, '') -} - -/** - * Converts an element node to its Markdown equivalent - * @private - * @param {HTMLElement} node The node to convert - * @returns A Markdown representation of the node - * @type String - */ - -function replacementForNode (node) { - var rule = this.rules.forNode(node); - var content = turndown_es_process.call(this, node); - var whitespace = node.flankingWhitespace; - if (whitespace.leading || whitespace.trailing) content = content.trim(); - return ( - whitespace.leading + - rule.replacement(content, node, this.options) + - whitespace.trailing - ) -} - -/** - * Joins replacement to the current output with appropriate number of new lines - * @private - * @param {String} output The current conversion output - * @param {String} replacement The string to append to the output - * @returns Joined output - * @type String - */ - -function join (output, replacement) { - var s1 = trimTrailingNewlines(output); - var s2 = trimLeadingNewlines(replacement); - var nls = Math.max(output.length - s1.length, replacement.length - s2.length); - var separator = '\n\n'.substring(0, nls); - - return s1 + separator + s2 -} - -/** - * Determines whether an input can be converted - * @private - * @param {String|HTMLElement} input Describe this parameter - * @returns Describe what it returns - * @type String|Object|Array|Boolean|Number - */ - -function canConvert (input) { - return ( - input != null && ( - typeof input === 'string' || - (input.nodeType && ( - input.nodeType === 1 || input.nodeType === 9 || input.nodeType === 11 - )) - ) - ) -} - -/* harmony default export */ const turndown_es = (TurndownService); - -;// ../ai-tools/dist/lib/tools/web.js - - - -const turndown = new turndown_es(); -const web_tools = (target, options) => { - const logger = (0,ai_tools_dist/* toolLogger */.bw)('web', options); - return [ - { - type: 'function', - function: { - name: 'browse_page', - description: 'Browse a webpage and return its content as markdown, all links, images and pages main image', - parameters: { - type: 'object', - properties: { - url: { - type: 'string', - description: 'URL of the webpage to browse' - } - }, - required: ['url'] - }, - function: async (params) => { - try { - logger.debug(`Tool::BrowsePage Browsing ${params.url}`); - const browser = await external_require_puppeteer_namespaceObject.launch({ - headless: true, - args: ['--no-sandbox', '--disable-setuid-sandbox'] - }); - try { - const page = await browser.newPage(); - logger.debug(`Tool::Web::BrowsePage Opening page ${params.url}`); - await page.goto(params.url, { - waitUntil: 'networkidle2' - }); - const pageData = await page.evaluate((selector) => { - const elementsToRemove = document.querySelectorAll('script, style, link, meta, noscript, iframe, [style*="display:none"],[style*="display: none"], .hidden'); - elementsToRemove.forEach(el => el.remove()); - const links = Array.from(document.querySelectorAll('a')) - .map(a => ({ - text: a.textContent?.trim() || '', - href: a.href - })) - .filter(link => link.href && link.href.startsWith('http')) - .slice(0, 20); - const images = Array.from(document.querySelectorAll('img')) - .map(img => ({ - src: img.src, - alt: img.alt || '', - width: img.width, - height: img.height - })) - .filter(img => img.src && img.src.startsWith('http')) - .slice(0, 20); - const mainImage = document.querySelector('meta[property="og:image"]')?.getAttribute('content') || - document.querySelector('meta[name="og:image"]')?.getAttribute('content'); - let content; - const body = document.body; - content = body ? body.innerHTML : ''; - return { - content, - links, - images, - ogImage: mainImage - }; - }, null); - const markdown = turndown.turndown(pageData.content); - await browser.close(); - const ret = { - success: true, - markdown: markdown, - links: pageData.links, - images: pageData.images, - mainImage: pageData.ogImage, - url: params.url - }; - return ret; - } - catch (error) { - logger.debug('Error browsing page:', error.message, error); - await browser.close(); - throw error; - } - } - catch (error) { - logger.debug('Error browsing page:', error.message); - return { - success: false, - error: error.message, - url: params.url - }; - } - }, - parse: JSON.parse - } - } - ]; -}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2ViLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi90b29scy93ZWIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0EsT0FBTyxTQUFTLE1BQU0sV0FBVyxDQUFBO0FBQ2pDLE9BQU8sZUFBZSxNQUFNLFVBQVUsQ0FBQTtBQUV0QyxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZ0JBQWdCLENBQUE7QUFHM0MsTUFBTSxRQUFRLEdBQUcsSUFBSSxlQUFlLEVBQUUsQ0FBQTtBQUV0QyxNQUFNLENBQUMsTUFBTSxLQUFLLEdBQUcsQ0FBQyxNQUFjLEVBQUUsT0FBa0IsRUFBYyxFQUFFO0lBQ3BFLE1BQU0sTUFBTSxHQUFHLFVBQVUsQ0FBQyxLQUFLLEVBQUUsT0FBTyxDQUFDLENBQUE7SUFDekMsT0FBTztRQUNIO1lBQ0ksSUFBSSxFQUFFLFVBQVU7WUFDaEIsUUFBUSxFQUFFO2dCQUNOLElBQUksRUFBRSxhQUFhO2dCQUNuQixXQUFXLEVBQUUsNkZBQTZGO2dCQUMxRyxVQUFVLEVBQUU7b0JBQ1IsSUFBSSxFQUFFLFFBQVE7b0JBQ2QsVUFBVSxFQUFFO3dCQUNSLEdBQUcsRUFBRTs0QkFDRCxJQUFJLEVBQUUsUUFBUTs0QkFDZCxXQUFXLEVBQUUsOEJBQThCO3lCQUM5QztxQkFDSjtvQkFDRCxRQUFRLEVBQUUsQ0FBQyxLQUF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QUFBOzRCQUNyQixNQUFNLEtBQUssQ0FBQTt5QkFDZDtxQkFDSjtvQkFBQyxPQUFPLEtBQVUsRUFBRTt3QkFDakIsTUFBTSxDQUFDLEtBQUssQ0FBQyxzQkFBc0IsRUFBRSxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7d0JBQ3BELE9BQU87NEJBQ0gsT0FBTyxFQUFFLEtBQUs7NEJBQ2QsS0FBSyxFQUFFLEtBQUssQ0FBQyxPQUFPOzRCQUNwQixHQUFHLEVBQUUsTUFBTSxDQUFDLEdBQUc7eUJBQ2xCLENBQUM7cUJBQ0w7Z0JBQ0wsQ0FBQztnQkFDRCxLQUFLLEVBQUUsSUFBSSxDQUFDLEtBQUs7YUFDcEI7U0FDeUI7S0FDakMsQ0FBQTtBQUNMLENBQUMsQ0FBQSJ9 // EXTERNAL MODULE: external "buffer" var external_buffer_ = __webpack_require__(20181); ;// ../ai-tools/node_modules/@keyv/serialize/dist/index.js @@ -189389,7 +174542,7 @@ var iterableAdapters = [ "valkey", "etcd" ]; -var dist_Keyv = class extends event_manager_default { +var Keyv = class extends event_manager_default { opts; iterator; hooks = new hooks_manager_default(); @@ -190058,151 +175211,22 @@ var dist_Keyv = class extends event_manager_default { return void 0; } }; -var index_default = dist_Keyv; - - -// EXTERNAL MODULE: external "events" -var external_events_ = __webpack_require__(24434); -// EXTERNAL MODULE: ../ai-tools/node_modules/sqlite3/lib/sqlite3.js -var sqlite3 = __webpack_require__(45430); -;// ../ai-tools/node_modules/@keyv/sqlite/dist/index.js -// src/index.ts - - - - -var dist_toString = (input) => String(input).search(/^[a-zA-Z]+$/) < 0 ? "_" + input : input; -var KeyvSqlite = class extends external_events_ { - ttlSupport; - opts; - namespace; - close; - query; - constructor(keyvOptions) { - super(); - this.ttlSupport = false; - let options = { - dialect: "sqlite", - uri: "sqlite://:memory:" - }; - if (typeof keyvOptions === "string") { - options.uri = keyvOptions; - } else { - options = { - ...options, - ...keyvOptions - }; - } - options.db = options.uri.replace(/^sqlite:\/\//, ""); - options.connect = async () => new Promise((resolve, reject) => { - const database = new sqlite3.Database(options.db, (error) => { - if (error) { - reject(error); - } else { - if (options.busyTimeout) { - database.configure("busyTimeout", options.busyTimeout); - } - resolve(database); - } - }); - }).then((database) => ({ query: (0,external_util_.promisify)(database.all).bind(database), close: (0,external_util_.promisify)(database.close).bind(database) })); - this.opts = { - table: "keyv", - keySize: 255, - ...options - }; - this.opts.table = dist_toString(this.opts.table); - const createTable = `CREATE TABLE IF NOT EXISTS ${this.opts.table}(key VARCHAR(${Number(this.opts.keySize)}) PRIMARY KEY, value TEXT )`; - const connected = this.opts.connect().then(async (database) => database.query(createTable).then(() => database)).catch((error) => this.emit("error", error)); - this.query = async (sqlString, ...parameter) => connected.then(async (database) => database.query(sqlString, ...parameter)); - this.close = async () => connected.then((database) => database.close()); - } - async get(key) { - const select = `SELECT * FROM ${this.opts.table} WHERE key = ?`; - const rows = await this.query(select, key); - const row = rows[0]; - if (row === void 0) { - return void 0; - } - return row.value; - } - async getMany(keys) { - const select = `SELECT * FROM ${this.opts.table} WHERE key IN (SELECT value FROM json_each(?))`; - const rows = await this.query(select, JSON.stringify(keys)); - return keys.map((key) => { - const row = rows.find((row2) => row2.key === key); - return row ? row.value : void 0; - }); - } - async set(key, value) { - const upsert = `INSERT INTO ${this.opts.table} (key, value) - VALUES(?, ?) - ON CONFLICT(key) - DO UPDATE SET value=excluded.value;`; - return this.query(upsert, key, value); - } - async delete(key) { - const select = `SELECT * FROM ${this.opts.table} WHERE key = ?`; - const del = `DELETE FROM ${this.opts.table} WHERE key = ?`; - const rows = await this.query(select, key); - const row = rows[0]; - if (row === void 0) { - return false; - } - await this.query(del, key); - return true; - } - async deleteMany(keys) { - const del = `DELETE FROM ${this.opts.table} WHERE key IN (SELECT value FROM json_each(?))`; - const results = await this.getMany(keys); - if (results.every((x) => x === void 0)) { - return false; - } - await this.query(del, JSON.stringify(keys)); - return true; - } - async clear() { - const del = `DELETE FROM ${this.opts.table} WHERE key LIKE ?`; - await this.query(del, this.namespace ? `${this.namespace}:%` : "%"); - } - async *iterator(namespace) { - const limit = Number.parseInt(this.opts.iterationLimit, 10) || 10; - async function* iterate(offset, options, query) { - const select = `SELECT * FROM ${options.table} WHERE key LIKE ? LIMIT ? OFFSET ?`; - const iterator = await query(select, [`${namespace ? namespace + ":" : ""}%`, limit, offset]); - const entries = [...iterator]; - if (entries.length === 0) { - return; - } - for (const entry of entries) { - offset += 1; - yield [entry.key, entry.value]; - } - yield* iterate(offset, options, query); - } - yield* iterate(0, this.opts, this.query); - } - async has(key) { - const exists = `SELECT EXISTS ( SELECT * FROM ${this.opts.table} WHERE key = ? )`; - const result = await this.query(exists, key); - return Object.values(result[0])[0] === 1; - } - async disconnect() { - await this.close(); - } -}; -var createKeyv = (keyvOptions) => new Keyv({ store: new KeyvSqlite(keyvOptions) }); -var dist_index_default = KeyvSqlite; +var index_default = Keyv; +// EXTERNAL MODULE: ../ai-tools/node_modules/keyv-file/lib/index.js +var keyv_file_lib = __webpack_require__(58538); ;// ../ai-tools/dist/lib/tools/keyv.js const store = (storePath, ns = 'ns-unknown', opts = {}) => { - const keyvSqlite = new dist_index_default(external_path_.resolve((0,dist/* resolve */.hd)(storePath))); - return new index_default({ store: keyvSqlite, ttl: 5000, namespace: ns, ...opts }); + const keyvFile = new keyv_file_lib/* KeyvFile */.Sk({ + filename: external_path_.resolve((0,dist/* resolve */.hd)(storePath)), + writeDelay: 100, // ms + }); + return new index_default({ store: keyvFile, namespace: ns, ...opts }); }; const get = async (key, storePath, ns = 'ns-unknown', opts = {}) => { const keyv = store(storePath, ns, opts); @@ -190212,11 +175236,7 @@ const set = async (key, value, storePath, ns = 'ns-unknown', opts = {}) => { const keyv = store(storePath, ns, opts); return await keyv.set(key, value); }; -const list = async (key, value, storePath, ns = 'ns-unknown', opts = {}) => { - const keyv = store(storePath, ns, opts); - return await keyv.set(key, value); -}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJm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0FBQyxDQUFBO0FBQ3JDLENBQUMsQ0FBQSJ9 ;// ../ai-tools/dist/lib/tools/memory.js @@ -190224,7 +175244,7 @@ const list = async (key, value, storePath, ns = 'ns-unknown', opts = {}) => { // Helper function to get storage path const getStoragePath = (options) => { // For now, use default path. Later this can be configured via options - return external_path_.join(process.cwd(), 'memory.sqlite'); + return external_path_.join(process.cwd(), 'memory.json'); }; // Default collection name when none provided const DEFAULT_COLLECTION = 'no-collection'; @@ -190571,7 +175591,7 @@ Returns: { } ]; }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVtb3J5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi90b29scy9tZW1vcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLElBQUksTUFBTSxNQUFNLENBQUE7QUFJNUIsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGdCQUFnQixDQUFBO0FBRzNDLE9BQU8sRUFBRSxLQUFLLEVBQUUsR0FBRyxFQUFFLEdBQUcsRUFBRSxNQUFNLFdBQVcsQ0FBQTtBQUUzQyxzQ0FBc0M7QUFDdEMsTUFBTSxjQUFjLEdBQUcsQ0FBQyxPQUFrQixFQUFVLEVBQUU7SUFDbEQsc0VBQXNFO0lBQ3RFLE9BQU8sSUFBSSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLEVBQUUsZUFBZSxDQUFDLENBQUM7QUFDckQsQ0FBQyxDQUFDO0FBRUYsNkNBQTZDO0FBQzdDLE1BQU0sa0JBQWtCLEdBQUcsZUFBZSxDQUFDO0FBZTNDLG1EQUFtRDtBQUNuRCxNQUFNLHNCQUFzQixHQUFHLENBQUMsS0FBYSxFQUFFLE1BQWtCLEVBQVUsRUFBRTtJQUN6RSxRQUFRLE1BQU0sRUFBRTtRQUNaLEtBQUssTUFBTTtZQUNQ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QUM7NkJBQ0w7NEJBRUQsT0FBTztnQ0FDSCxPQUFPLEVBQUUsSUFBSTtnQ0FDYixVQUFVO2dDQUNWLElBQUk7Z0NBQ0osT0FBTztnQ0FDUCxLQUFLLEVBQUUsSUFBSSxDQUFDLE1BQU07NkJBQ3JCLENBQUM7eUJBQ0w7d0JBQUMsT0FBTyxhQUFhLEVBQUU7NEJBQ3BCLHVEQUF1RDs0QkFDdkQsTUFBTSxDQUFDLElBQUksQ0FBQyxxREFBcUQsVUFBVSxHQUFHLEVBQUUsYUFBYSxDQUFDLENBQUM7NEJBQy9GLE9BQU87Z0NBQ0gsT0FBTyxFQUFFLElBQUk7Z0NBQ2IsVUFBVTtnQ0FDVixJQUFJLEVBQUUsRUFBRTtnQ0FDUixPQUFPLEVBQUUsRUFBRTtnQ0FDWCxLQUFLLEVBQUUsQ0FBQztnQ0FDUixPQUFPLEVBQUUsd0NBQXdDOzZCQUNwRCxDQUFDO3lCQUNMO3FCQUNKO29CQUFDLE9BQU8sS0FBSyxFQUFFO3dCQUNaLE1BQU0sQ0FBQyxLQUFLLENBQUMsd0JBQXdCLEVBQUUsS0FBSyxDQUFDLENBQUM7d0JBQzlDLE9BQU87NEJBQ0gsT0FBTyxFQUFFLEtBQUs7NEJBQ2QsT0FBTyxFQUFFLEtBQUssWUFBWSxLQUFLLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLHdCQUF3Qjt5QkFDN0UsQ0FBQztxQkFDTDtnQkFDTCxDQUFDO2dCQUNELEtBQUssRUFBRSxJQUFJLENBQUMsS0FBSzthQUNwQjtTQUN5QjtLQUNqQyxDQUFBO0FBQ0wsQ0FBQyxDQUFDIn0= ;// ../ai-tools/dist/lib/tools/tools.js @@ -190580,9 +175600,9 @@ Returns: { +//import { tools as webTools } from './web.js' - -//import { tools as emailTools } from './email' +// import { tools as emailTools } from './email' const tools_tools = { fs: tools, npm: npm_tools, @@ -190591,11 +175611,11 @@ const tools_tools = { interact: interact_tools, user: user_tools, search: search_tools, - web: web_tools, - memory: memory_tools, + // web: webTools, + memory: memory_tools // email: emailTools }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL3Rvb2xzL3Rvb2xzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLElBQUksT0FBTyxFQUFFLE1BQU0sU0FBUyxDQUFBO0FBQzFDLE9BQU8sRUFBRSxLQUFLLElBQUksUUFBUSxFQUFFLE1BQU0sVUFBVSxDQUFBO0FBQzVDLE9BQU8sRUFBRSxLQUFLLElBQUksUUFBUSxFQUFFLE1BQU0sVUFBVSxDQUFBO0FBQzVDLE9BQU8sRUFBRSxLQUFLLElBQUksYUFBYSxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ3RELE9BQU8sRUFBRSxLQUFLLElBQUksYUFBYSxFQUFFLE1BQU0sZUFBZSxDQUFBO0FBQ3RELE9BQU8sRUFBRSxLQUFLLElBQUksU0FBUyxFQUFFLE1BQU0sV0FBVyxDQUFBO0FBQzlDLE9BQU8sRUFBRSxLQUFLLElBQUksTUFBTSxFQUFFLE1BQU0sYUFBYSxDQUFBO0FBQzdDLE9BQU8sRUFBRSxLQUFLLElBQUksUUFBUSxFQUFFLE1BQU0sVUFBVSxDQUFBO0FBQzVDLE9BQU8sRUFBRSxLQUFLLElBQUksV0FBVyxFQUFFLE1BQU0sYUFBYSxDQUFBO0FBQ2xELCtDQUErQztBQUUvQyxNQUFNLENBQUMsTUFBTSxLQUFLLEdBQUc7SUFDakIsRUFBRSxFQUFFLE9BQU87SUFDWCxHQUFHLEVBQUUsUUFBUTtJQUNiLEdBQUcsRUFBRSxRQUFRO0lBQ2IsUUFBUSxFQUFFLGFBQWE7SUFDdkIsUUFBUSxFQUFFLGF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RSxhQUFhO0lBQ3ZCLFFBQVEsRUFBRSxhQUFhO0lBQ3ZCLElBQUksRUFBRSxTQUFTO0lBQ2YsTUFBTSxFQUFFLE1BQU07SUFDZCxpQkFBaUI7SUFDakIsTUFBTSxFQUFFLFdBQVc7SUFDbkIsb0JBQW9CO0NBQ3ZCLENBQUEifQ== // EXTERNAL MODULE: ./dist-in/index.js + 3 modules var dist_in = __webpack_require__(88022); ;// ../core/dist/aspects_simple.js @@ -190972,7 +175992,7 @@ const variables = (options) => { /* harmony import */ var json_schema_to_zod__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(47571); /* harmony import */ var _filters_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(98152); /* harmony import */ var _models_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(45000); -/* harmony import */ var _tools_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(49315); +/* harmony import */ var _tools_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(3043); /* harmony import */ var _models_openrouter_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(2761); /* harmony import */ var _models_openai_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(53382); @@ -230236,8 +215256,293 @@ const main_fetch = async () => { //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmV0Y2guanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29tbWFuZHMvZmV0Y2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxJQUFJLE1BQU0sV0FBVyxDQUFBO0FBQzVCLE9BQU8sRUFBRSxJQUFJLElBQUksS0FBSyxFQUFFLE1BQU0sb0JBQW9CLENBQUE7QUFDbEQsT0FBTyxFQUFFLE1BQU0sRUFBRSxXQUFXLEVBQUUsTUFBTSxhQUFhLENBQUE7QUFDakQsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQ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DaEIsT0FBTyxFQUFFLEtBQUssQ0FBQyxPQUFPO1lBQ3RCLE9BQU8sRUFBRSxLQUFLLENBQUMsT0FBTztZQUN0QixPQUFPLEVBQUUsS0FBSyxDQUFDLE9BQU87U0FDdkIsQ0FBQTtJQUNILENBQUMsQ0FBQyxDQUFBO0lBQ0YsTUFBTSxvQkFBb0IsR0FBRyxJQUFJLENBQUMsT0FBTyxDQUFDLFdBQVcsRUFBRSxFQUFFLGlCQUFpQixDQUFDLENBQUE7SUFDM0UsS0FBSyxDQUFDLG9CQUFvQixFQUFFLGdCQUFnQixDQUFDLENBQUE7SUFDN0MsTUFBTSxDQUFDLElBQUksQ0FBQyxXQUFXLGdCQUFnQixDQUFDLE1BQU0sMEJBQTBCLG9CQUFvQixFQUFFLENBQUMsQ0FBQTtBQUNqRyxDQUFDLENBQUEifQ== // EXTERNAL MODULE: ./dist-in/commands/run.js + 21 modules var main_run = __webpack_require__(98177); +// EXTERNAL MODULE: external "node:fs" +var main_external_node_fs_ = __webpack_require__(73024); // EXTERNAL MODULE: ../core/dist/primitives.js var main_primitives = __webpack_require__(78275); +;// ./node_modules/p-map/index.js +async function main_pMap( + iterable, + mapper, + { + concurrency = Number.POSITIVE_INFINITY, + stopOnError = true, + signal, + } = {}, +) { + return new Promise((resolve_, reject_) => { + if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) { + throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`); + } + + if (typeof mapper !== 'function') { + throw new TypeError('Mapper function is required'); + } + + if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) { + throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`); + } + + const result = []; + const errors = []; + const skippedIndexesMap = new Map(); + let isRejected = false; + let isResolved = false; + let isIterableDone = false; + let resolvingCount = 0; + let currentIndex = 0; + const iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator](); + + const signalListener = () => { + reject(signal.reason); + }; + + const cleanup = () => { + signal?.removeEventListener('abort', signalListener); + }; + + const resolve = value => { + resolve_(value); + cleanup(); + }; + + const reject = reason => { + isRejected = true; + isResolved = true; + reject_(reason); + cleanup(); + }; + + if (signal) { + if (signal.aborted) { + reject(signal.reason); + } + + signal.addEventListener('abort', signalListener, {once: true}); + } + + const next = async () => { + if (isResolved) { + return; + } + + const nextItem = await iterator.next(); + + const index = currentIndex; + currentIndex++; + + // Note: `iterator.next()` can be called many times in parallel. + // This can cause multiple calls to this `next()` function to + // receive a `nextItem` with `done === true`. + // The shutdown logic that rejects/resolves must be protected + // so it runs only one time as the `skippedIndex` logic is + // non-idempotent. + if (nextItem.done) { + isIterableDone = true; + + if (resolvingCount === 0 && !isResolved) { + if (!stopOnError && errors.length > 0) { + reject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message + return; + } + + isResolved = true; + + if (skippedIndexesMap.size === 0) { + resolve(result); + return; + } + + const pureResult = []; + + // Support multiple `pMapSkip`'s. + for (const [index, value] of result.entries()) { + if (skippedIndexesMap.get(index) === main_pMapSkip) { + continue; + } + + pureResult.push(value); + } + + resolve(pureResult); + } + + return; + } + + resolvingCount++; + + // Intentionally detached + (async () => { + try { + const element = await nextItem.value; + + if (isResolved) { + return; + } + + const value = await mapper(element, index); + + // Use Map to stage the index of the element. + if (value === main_pMapSkip) { + skippedIndexesMap.set(index, value); + } + + result[index] = value; + + resolvingCount--; + await next(); + } catch (error) { + if (stopOnError) { + reject(error); + } else { + errors.push(error); + resolvingCount--; + + // In that case we can't really continue regardless of `stopOnError` state + // since an iterable is likely to continue throwing after it throws once. + // If we continue calling `next()` indefinitely we will likely end up + // in an infinite loop of failed iteration. + try { + await next(); + } catch (error) { + reject(error); + } + } + } + })(); + }; + + // Create the concurrent runners in a detached (non-awaited) + // promise. We need this so we can await the `next()` calls + // to stop creating runners before hitting the concurrency limit + // if the iterable has already been marked as done. + // NOTE: We *must* do this for async iterators otherwise we'll spin up + // infinite `next()` calls by default and never start the event loop. + (async () => { + for (let index = 0; index < concurrency; index++) { + try { + // eslint-disable-next-line no-await-in-loop + await next(); + } catch (error) { + reject(error); + break; + } + + if (isIterableDone || isRejected) { + break; + } + } + })(); + }); +} + +function main_pMapIterable( + iterable, + mapper, + { + concurrency = Number.POSITIVE_INFINITY, + backpressure = concurrency, + } = {}, +) { + if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) { + throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`); + } + + if (typeof mapper !== 'function') { + throw new TypeError('Mapper function is required'); + } + + if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) { + throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`); + } + + if (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) { + throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${concurrency}) and up or \`Infinity\`, got \`${backpressure}\` (${typeof backpressure})`); + } + + return { + async * [Symbol.asyncIterator]() { + const iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator](); + + const promises = []; + let runningMappersCount = 0; + let isDone = false; + let index = 0; + + function trySpawn() { + if (isDone || !(runningMappersCount < concurrency && promises.length < backpressure)) { + return; + } + + const promise = (async () => { + const {done, value} = await iterator.next(); + + if (done) { + return {done: true}; + } + + runningMappersCount++; + + // Spawn if still below concurrency and backpressure limit + trySpawn(); + + try { + const returnValue = await mapper(await value, index++); + + runningMappersCount--; + + if (returnValue === main_pMapSkip) { + const index = promises.indexOf(promise); + + if (index > 0) { + promises.splice(index, 1); + } + } + + // Spawn if still below backpressure limit and just dropped below concurrency limit + trySpawn(); + + return {done: false, value: returnValue}; + } catch (error) { + isDone = true; + return {error}; + } + })(); + + promises.push(promise); + } + + trySpawn(); + + while (promises.length > 0) { + const {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop + + promises.shift(); + + if (error) { + throw error; + } + + if (done) { + return; + } + + // Spawn if just dropped below backpressure limit and below the concurrency limit + trySpawn(); + + if (value === main_pMapSkip) { + continue; + } + + yield value; + } + }, + }; +} + +const main_pMapSkip = Symbol('skip'); + // EXTERNAL MODULE: ./node_modules/glob/dist/esm/index.js + 15 modules var main_glob_dist_esm = __webpack_require__(59795); // EXTERNAL MODULE: ./node_modules/openai/index.mjs + 92 modules @@ -230249,7 +215554,6 @@ var main_dist_in_client = __webpack_require__(48215); - const main_createBuffer = (path) => { try { const buffer = main_external_fs_.readFileSync(path); @@ -230264,21 +215568,21 @@ const main_transcribe = async (options) => { const client = (0,main_dist_in_client/* createClient */.U)(options); if (!client) { options.logger.error('Failed to create client'); - return; + return ''; } if (!options.include || options.include.length === 0) { options.logger.error('No source file provided via --include'); - return; + return ''; } const sourceFile = options.include[0]; if (!(0,main_exists/* sync */.OH)(sourceFile)) { options.logger.error('Source file does not exist', sourceFile); - return; + return ''; } const file = await (0,main_node_modules_openai/* toFile */.eZ)(main_createBuffer(sourceFile), 'audio.mp3', { type: 'audio/mpeg' }); if (!file) { options.logger.error('Error converting source to file'); - return; + return ''; } const completion = await client.audio.transcriptions.create({ model: 'whisper-1', @@ -230287,19 +215591,12 @@ const main_transcribe = async (options) => { }); if (!completion) { options.logger.error('OpenAI response is empty'); - return; + return ''; } const text_content = completion.text || ''; - if (options.dst) { - (0,main_write/* sync */.OH)(options.dst, text_content); - } - else { - process.stdout.write(text_content); - } - // options.logger.debug('OpenAI Transcribe response:', completion) - return completion; + return text_content; }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNjcmliZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4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S0FBSyxDQUFDLGlDQUFpQyxDQUFDLENBQUE7UUFDdkQsT0FBTyxFQUFFLENBQUM7SUFDZCxDQUFDO0lBRUQsTUFBTSxVQUFVLEdBQVEsTUFBTSxNQUFNLENBQUMsS0FBSyxDQUFDLGNBQWMsQ0FBQyxNQUFNLENBQUM7UUFDN0QsS0FBSyxFQUFFLFdBQVc7UUFDbEIsSUFBSSxFQUFFLElBQUk7UUFDVixlQUFlLEVBQUcsT0FBZSxDQUFDLGVBQWUsSUFBSSxjQUFjO0tBQ3RFLENBQUMsQ0FBQTtJQUVGLElBQUksQ0FBQyxVQUFVLEVBQUUsQ0FBQztRQUNkLE9BQU8sQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLDBCQUEwQixDQUFDLENBQUE7UUFDaEQsT0FBTyxFQUFFLENBQUM7SUFDZCxDQUFDO0lBRUQsTUFBTSxZQUFZLEdBQUcsVUFBVSxDQUFDLElBQUksSUFBSSxFQUFFLENBQUE7SUFDMUMsT0FBTyxZQUFZLENBQUE7QUFDdkIsQ0FBQyxDQUFBIn0= // EXTERNAL MODULE: ./dist-in/glob.js var main_glob = __webpack_require__(89325); // EXTERNAL MODULE: ./dist-in/variables.js @@ -230316,6 +215613,24 @@ var main_variables = __webpack_require__(78618); + +const main_default_sort = (files) => { + const getSortableParts = (filename) => { + const baseName = main_external_node_path_.parse(filename).name; + const match = baseName.match(/^(\d+)_?(.*)$/); // Match leading numbers + const numPart = match ? parseInt(match[1], 10) : NaN; + const textPart = match ? match[2] : baseName; // Extract text part + return { numPart, textPart }; + }; + return files.sort((a, b) => { + const { numPart: aNum, textPart: aText } = getSortableParts(a); + const { numPart: bNum, textPart: bText } = getSortableParts(b); + if (!isNaN(aNum) && !isNaN(bNum)) { + return aNum - bNum || aText.localeCompare(bText, undefined, { numeric: true, sensitivity: 'base' }); + } + return aText.localeCompare(bText, undefined, { numeric: true, sensitivity: 'base' }); + }); +}; const main_TranscribeOptionsSchema = () => { return (0,main_zod_schema/* OptionsSchema */.IO)().pick({ include: true, @@ -230389,7 +215704,7 @@ const main_transcribeCommand = async (opts) => { const info = (0,main_dist/* pathInfoEx */.j4)((0,main_dist/* forward_slash */.Yf)(main_external_node_path_.resolve((0,main_dist/* resolve */.hd)(includePath))), false, { absolute: true, }); - files.push(...(0,main_run/* default_sort */.X4)(info.FILES)); + files.push(...info.FILES); } else if ((0,main_exists/* sync */.OH)(includePath)) { files.push(includePath); @@ -230399,8 +215714,9 @@ const main_transcribeCommand = async (opts) => { opts.logger.warn(`No files found for --include patterns: ${opts.include.join(', ')}`); return; } + files = main_default_sort(files); opts.logger.info(`Found ${files.length} files to transcribe.`); - for (const file of files) { + const mapper = async (file) => { const fileInfo = main_external_node_path_.parse(file); const CWD = process.cwd(); const current_variables = { @@ -230417,18 +215733,35 @@ const main_transcribeCommand = async (opts) => { include: [file], variables: current_variables }; - if (!itemOpts.dst) { - itemOpts.dst = '${SRC_DIR}/${SRC_NAME}.md'; - } - itemOpts.dst = main_external_node_path_.resolve((0,main_dist/* resolve */.hd)(itemOpts.dst, itemOpts.alt, itemOpts.variables)); opts.logger.info(`Transcribing ${file}...`); - if (itemOpts.dst) { - opts.logger.info(`Output will be saved to ${itemOpts.dst}`); + const transcribedText = await main_transcribe(itemOpts); + return { transcribedText, itemOpts }; + }; + const results = await main_pMap(files, mapper, { concurrency: 1 }); + let resolvedDstPath; + if (opts.dst) { + resolvedDstPath = main_external_node_path_.resolve((0,main_dist/* resolve */.hd)(opts.dst, opts.alt, opts.variables)); + if (main_external_node_fs_.existsSync(resolvedDstPath)) { + main_external_node_fs_.unlinkSync(resolvedDstPath); + } + const allText = results.map(r => r.transcribedText).filter(Boolean).join('\n\n'); + if (allText) { + main_external_node_fs_.writeFileSync(resolvedDstPath, allText + '\n'); + opts.logger.info(`Wrote all transcriptions to ${resolvedDstPath}`); + } + } + else { + for (const { transcribedText, itemOpts } of results) { + if (transcribedText) { + const defaultDstTemplate = '${SRC_DIR}/${SRC_NAME}.md'; + const defaultDstPath = main_external_node_path_.resolve((0,main_dist/* resolve */.hd)(defaultDstTemplate, itemOpts.alt, itemOpts.variables)); + main_external_node_fs_.writeFileSync(defaultDstPath, transcribedText); + opts.logger.info(`Output will be saved to ${defaultDstPath}`); + } } - await main_transcribe(itemOpts); } }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNjcmliZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tYW5kcy90cmFuc2NyaWJlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxJQUFJLE1BQU0sV0FBVyxDQUFBO0FBQ2pDLE9BQU8sRUFBRSxRQUFRLEVBQUUsT0FBTyxFQUFFLE1BQU0sMkJBQTJCLENBQUE7QUFDN0QsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLE1BQU0sQ0FBQTtBQUMvQixPQUFPLEVBQUUsSUFBSSxJQUFJLE1BQU0sRUFBRSxNQUFNLHFCQUFxQixDQUFBO0FBQ3BELE9BQU8sRUFBRSxhQUFhLEVBQUUsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLG1CQUFtQixDQUFBO0FBR3RFLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQTtBQUNoRCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sc0JBQXNCLENBQUE7QUFDakQsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLFlBQVksQ0FBQTtBQUNyQyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sVUFBVSxDQUFBO0FBQ3ZDLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxhQUFhLENBQUE7QUFDdkMsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlCQUFpQixDQUFBO0FBRTNDLE1BQU0sQ0FBQyxNQUFNLHVCQUF1Qix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xJQUFJLENBQUMsQ0FBQztZQUNsRCxJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQywrQkFBK0IsZUFBZSxFQUFFLENBQUMsQ0FBQztRQUN2RSxDQUFDO0lBQ0wsQ0FBQztTQUFNLENBQUM7UUFDSixLQUFLLE1BQU0sRUFBRSxlQUFlLEVBQUUsUUFBUSxFQUFFLElBQUksT0FBTyxFQUFFLENBQUM7WUFDbEQsSUFBSSxlQUFlLEVBQUUsQ0FBQztnQkFDbEIsTUFBTSxrQkFBa0IsR0FBRywyQkFBMkIsQ0FBQztnQkFDdkQsTUFBTSxjQUFjLEdBQUcsSUFBSSxDQUFDLE9BQU8sQ0FBQyxPQUFPLENBQUMsa0JBQWtCLEVBQUUsUUFBUSxDQUFDLEdBQUcsRUFBRSxRQUFRLENBQUMsU0FBUyxDQUFDLENBQUMsQ0FBQztnQkFDbkcsRUFBRSxDQUFDLGFBQWEsQ0FBQyxjQUFjLEVBQUUsZUFBZSxDQUFDLENBQUM7Z0JBQ2xELElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLDJCQUEyQixjQUFjLEVBQUUsQ0FBQyxDQUFDO1lBQ2xFLENBQUM7UUFDTCxDQUFDO0lBQ0wsQ0FBQztBQUNMLENBQUMsQ0FBQSJ9 ;// ./dist-in/main.js //#!/usr/bin/env node diff --git a/packages/kbot/dist/package-lock.json b/packages/kbot/dist/package-lock.json index ca9c125c..3b9e6770 100644 --- a/packages/kbot/dist/package-lock.json +++ b/packages/kbot/dist/package-lock.json @@ -1,12 +1,12 @@ { "name": "@plastichub/kbot", - "version": "1.1.51", + "version": "1.1.52", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@plastichub/kbot", - "version": "1.1.51", + "version": "1.1.52", "license": "ISC", "dependencies": { "node-emoji": "^2.2.0" diff --git a/packages/kbot/dist/package.json b/packages/kbot/dist/package.json index 1bf65549..ffde51b9 100644 --- a/packages/kbot/dist/package.json +++ b/packages/kbot/dist/package.json @@ -1,6 +1,6 @@ { "name": "@plastichub/kbot", - "version": "1.1.51", + "version": "1.1.52", "main": "main_node.js", "author": "", "license": "ISC", diff --git a/packages/kbot/dist/win-64/kbot.exe b/packages/kbot/dist/win-64/kbot.exe index ff199e67..d1b27ec5 100644 Binary files a/packages/kbot/dist/win-64/kbot.exe and b/packages/kbot/dist/win-64/kbot.exe differ diff --git a/packages/kbot/schema.json b/packages/kbot/schema.json index d0b73843..aff814c2 100644 --- a/packages/kbot/schema.json +++ b/packages/kbot/schema.json @@ -119,7 +119,7 @@ }, "model": { "type": "string", - "description": "AI model to use for processing. Available models:\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m OpenRouter models:\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\nagentica-org/deepcoder-14b-preview | paid\nagentica-org/deepcoder-14b-preview:free | free\nai21/jamba-large-1.7 | paid\nai21/jamba-mini-1.7 | paid\naion-labs/aion-1.0 | paid\naion-labs/aion-1.0-mini | paid\naion-labs/aion-rp-llama-3.1-8b | paid\nalfredpros/codellama-7b-instruct-solidity | paid\namazon/nova-lite-v1 | paid\namazon/nova-micro-v1 | paid\namazon/nova-pro-v1 | paid\nanthropic/claude-3-haiku | paid\nanthropic/claude-3-opus | paid\nanthropic/claude-3.5-haiku | paid\nanthropic/claude-3.5-haiku-20241022 | paid\nanthropic/claude-3.5-sonnet | paid\nanthropic/claude-3.5-sonnet-20240620 | paid\nanthropic/claude-3.7-sonnet | paid\nanthropic/claude-3.7-sonnet:thinking | paid\nanthropic/claude-opus-4 | paid\nanthropic/claude-opus-4.1 | paid\nanthropic/claude-sonnet-4 | paid\narcee-ai/coder-large | paid\narcee-ai/maestro-reasoning | paid\narcee-ai/spotlight | paid\narcee-ai/virtuoso-large | paid\narliai/qwq-32b-arliai-rpr-v1 | paid\narliai/qwq-32b-arliai-rpr-v1:free | free\nopenrouter/auto | paid\nbaidu/ernie-4.5-21b-a3b | paid\nbaidu/ernie-4.5-300b-a47b | paid\nbaidu/ernie-4.5-vl-28b-a3b | paid\nbaidu/ernie-4.5-vl-424b-a47b | paid\nbytedance/ui-tars-1.5-7b | paid\ndeepcogito/cogito-v2-preview-llama-109b-moe | paid\ncohere/command | paid\ncohere/command-a | paid\ncohere/command-r | paid\ncohere/command-r-03-2024 | paid\ncohere/command-r-08-2024 | paid\ncohere/command-r-plus | paid\ncohere/command-r-plus-04-2024 | paid\ncohere/command-r-plus-08-2024 | paid\ncohere/command-r7b-12-2024 | paid\ndeepcogito/cogito-v2-preview-deepseek-671b | paid\ndeepseek/deepseek-prover-v2 | paid\ndeepseek/deepseek-r1-0528-qwen3-8b | paid\ndeepseek/deepseek-r1-0528-qwen3-8b:free | free\ndeepseek/deepseek-chat | paid\ndeepseek/deepseek-chat-v3-0324 | paid\ndeepseek/deepseek-chat-v3-0324:free | free\ndeepseek/deepseek-chat-v3.1 | paid\ndeepseek/deepseek-chat-v3.1:free | free\ndeepseek/deepseek-v3.1-base | paid\ndeepseek/deepseek-r1 | paid\ndeepseek/deepseek-r1:free | free\ndeepseek/deepseek-r1-0528 | paid\ndeepseek/deepseek-r1-0528:free | free\ndeepseek/deepseek-r1-distill-llama-70b | paid\ndeepseek/deepseek-r1-distill-llama-70b:free | free\ndeepseek/deepseek-r1-distill-llama-8b | paid\ndeepseek/deepseek-r1-distill-qwen-14b | paid\ndeepseek/deepseek-r1-distill-qwen-14b:free | free\ndeepseek/deepseek-r1-distill-qwen-32b | paid\ncognitivecomputations/dolphin-mixtral-8x22b | paid\ncognitivecomputations/dolphin3.0-mistral-24b | paid\ncognitivecomputations/dolphin3.0-mistral-24b:free | free\ncognitivecomputations/dolphin3.0-r1-mistral-24b | paid\ncognitivecomputations/dolphin3.0-r1-mistral-24b:free | free\neleutherai/llemma_7b | paid\nalpindale/goliath-120b | paid\ngoogle/gemini-flash-1.5 | paid\ngoogle/gemini-flash-1.5-8b | paid\ngoogle/gemini-pro-1.5 | paid\ngoogle/gemini-2.0-flash-001 | paid\ngoogle/gemini-2.0-flash-exp:free | free\ngoogle/gemini-2.0-flash-lite-001 | paid\ngoogle/gemini-2.5-flash | paid\ngoogle/gemini-2.5-flash-image-preview | paid\ngoogle/gemini-2.5-flash-lite | paid\ngoogle/gemini-2.5-flash-lite-preview-06-17 | paid\ngoogle/gemini-2.5-pro | paid\ngoogle/gemini-2.5-pro-exp-03-25 | paid\ngoogle/gemini-2.5-pro-preview-05-06 | paid\ngoogle/gemini-2.5-pro-preview | paid\ngoogle/gemma-2-27b-it | paid\ngoogle/gemma-2-9b-it | paid\ngoogle/gemma-2-9b-it:free | free\ngoogle/gemma-3-12b-it | paid\ngoogle/gemma-3-12b-it:free | free\ngoogle/gemma-3-27b-it | paid\ngoogle/gemma-3-27b-it:free | free\ngoogle/gemma-3-4b-it | paid\ngoogle/gemma-3-4b-it:free | free\ngoogle/gemma-3n-e2b-it:free | free\ngoogle/gemma-3n-e4b-it | paid\ngoogle/gemma-3n-e4b-it:free | free\ninception/mercury | paid\ninception/mercury-coder | paid\ninfermatic/mn-inferor-12b | paid\ninflection/inflection-3-pi | paid\ninflection/inflection-3-productivity | paid\nliquid/lfm-3b | paid\nliquid/lfm-7b | paid\nmeta-llama/llama-guard-3-8b | paid\nanthracite-org/magnum-v2-72b | paid\nanthracite-org/magnum-v4-72b | paid\nmancer/weaver | paid\nmeta-llama/llama-3-70b-instruct | paid\nmeta-llama/llama-3-8b-instruct | paid\nmeta-llama/llama-3.1-405b | paid\nmeta-llama/llama-3.1-405b-instruct | paid\nmeta-llama/llama-3.1-405b-instruct:free | free\nmeta-llama/llama-3.1-70b-instruct | paid\nmeta-llama/llama-3.1-8b-instruct | paid\nmeta-llama/llama-3.2-11b-vision-instruct | paid\nmeta-llama/llama-3.2-1b-instruct | paid\nmeta-llama/llama-3.2-3b-instruct | paid\nmeta-llama/llama-3.2-3b-instruct:free | free\nmeta-llama/llama-3.2-90b-vision-instruct | paid\nmeta-llama/llama-3.3-70b-instruct | paid\nmeta-llama/llama-3.3-70b-instruct:free | free\nmeta-llama/llama-3.3-8b-instruct:free | free\nmeta-llama/llama-4-maverick | paid\nmeta-llama/llama-4-maverick:free | free\nmeta-llama/llama-4-scout | paid\nmeta-llama/llama-4-scout:free | free\nmeta-llama/llama-guard-4-12b | paid\nmeta-llama/llama-guard-2-8b | paid\nmicrosoft/mai-ds-r1 | paid\nmicrosoft/mai-ds-r1:free | free\nmicrosoft/phi-4 | paid\nmicrosoft/phi-4-multimodal-instruct | paid\nmicrosoft/phi-4-reasoning-plus | paid\nmicrosoft/phi-3-medium-128k-instruct | paid\nmicrosoft/phi-3-mini-128k-instruct | paid\nmicrosoft/phi-3.5-mini-128k-instruct | paid\nsophosympatheia/midnight-rose-70b | paid\nminimax/minimax-m1 | paid\nminimax/minimax-01 | paid\nmistralai/mistral-large | paid\nmistralai/mistral-large-2407 | paid\nmistralai/mistral-large-2411 | paid\nmistralai/mistral-small | paid\nmistralai/mistral-tiny | paid\nmistralai/codestral-2501 | paid\nmistralai/codestral-2508 | paid\nmistralai/devstral-medium | paid\nmistralai/devstral-small | paid\nmistralai/devstral-small-2505 | paid\nmistralai/devstral-small-2505:free | free\nmistralai/magistral-medium-2506 | paid\nmistralai/magistral-medium-2506:thinking | paid\nmistralai/magistral-small-2506 | paid\nmistralai/ministral-3b | paid\nmistralai/ministral-8b | paid\nmistralai/mistral-7b-instruct | paid\nmistralai/mistral-7b-instruct:free | free\nmistralai/mistral-7b-instruct-v0.1 | paid\nmistralai/mistral-7b-instruct-v0.3 | paid\nmistralai/mistral-medium-3 | paid\nmistralai/mistral-medium-3.1 | paid\nmistralai/mistral-nemo | paid\nmistralai/mistral-nemo:free | free\nmistralai/mistral-small-24b-instruct-2501 | paid\nmistralai/mistral-small-24b-instruct-2501:free | free\nmistralai/mistral-small-3.1-24b-instruct | paid\nmistralai/mistral-small-3.1-24b-instruct:free | free\nmistralai/mistral-small-3.2-24b-instruct | paid\nmistralai/mistral-small-3.2-24b-instruct:free | free\nmistralai/mixtral-8x22b-instruct | paid\nmistralai/mixtral-8x7b-instruct | paid\nmistralai/pixtral-12b | paid\nmistralai/pixtral-large-2411 | paid\nmistralai/mistral-saba | paid\nmoonshotai/kimi-dev-72b | paid\nmoonshotai/kimi-dev-72b:free | free\nmoonshotai/kimi-k2 | paid\nmoonshotai/kimi-k2:free | free\nmoonshotai/kimi-vl-a3b-thinking | paid\nmoonshotai/kimi-vl-a3b-thinking:free | free\nmorph/morph-v3-fast | paid\nmorph/morph-v3-large | paid\ngryphe/mythomax-l2-13b | paid\nneversleep/llama-3-lumimaid-70b | paid\nneversleep/llama-3.1-lumimaid-8b | paid\nneversleep/noromaid-20b | paid\nnousresearch/deephermes-3-llama-3-8b-preview:free | free\nnousresearch/deephermes-3-mistral-24b-preview | paid\nnousresearch/hermes-3-llama-3.1-405b | paid\nnousresearch/hermes-3-llama-3.1-70b | paid\nnousresearch/hermes-4-405b | paid\nnousresearch/hermes-4-70b | paid\nnousresearch/hermes-2-pro-llama-3-8b | paid\nnvidia/llama-3.1-nemotron-70b-instruct | paid\nnvidia/llama-3.1-nemotron-ultra-253b-v1 | paid\nnvidia/llama-3.1-nemotron-ultra-253b-v1:free | free\nnvidia/llama-3.3-nemotron-super-49b-v1 | paid\nopenai/chatgpt-4o-latest | paid\nopenai/codex-mini | paid\nopenai/gpt-3.5-turbo | paid\nopenai/gpt-3.5-turbo-0613 | paid\nopenai/gpt-3.5-turbo-16k | paid\nopenai/gpt-3.5-turbo-instruct | paid\nopenai/gpt-4 | paid\nopenai/gpt-4-0314 | paid\nopenai/gpt-4-turbo | paid\nopenai/gpt-4-1106-preview | paid\nopenai/gpt-4-turbo-preview | paid\nopenai/gpt-4.1 | paid\nopenai/gpt-4.1-mini | paid\nopenai/gpt-4.1-nano | paid\nopenai/gpt-4o | paid\nopenai/gpt-4o-2024-05-13 | paid\nopenai/gpt-4o-2024-08-06 | paid\nopenai/gpt-4o-2024-11-20 | paid\nopenai/gpt-4o:extended | paid\nopenai/gpt-4o-audio-preview | paid\nopenai/gpt-4o-search-preview | paid\nopenai/gpt-4o-mini | paid\nopenai/gpt-4o-mini-2024-07-18 | paid\nopenai/gpt-4o-mini-search-preview | paid\nopenai/gpt-5 | paid\nopenai/gpt-5-chat | paid\nopenai/gpt-5-mini | paid\nopenai/gpt-5-nano | paid\nopenai/gpt-oss-120b | paid\nopenai/gpt-oss-120b:free | free\nopenai/gpt-oss-20b | paid\nopenai/gpt-oss-20b:free | free\nopenai/o1 | paid\nopenai/o1-mini | paid\nopenai/o1-mini-2024-09-12 | paid\nopenai/o1-pro | paid\nopenai/o3 | paid\nopenai/o3-mini | paid\nopenai/o3-mini-high | paid\nopenai/o3-pro | paid\nopenai/o4-mini | paid\nopenai/o4-mini-high | paid\nperplexity/r1-1776 | paid\nperplexity/sonar | paid\nperplexity/sonar-deep-research | paid\nperplexity/sonar-pro | paid\nperplexity/sonar-reasoning | paid\nperplexity/sonar-reasoning-pro | paid\npygmalionai/mythalion-13b | paid\nqwen/qwen-vl-max | paid\nqwen/qwen-vl-plus | paid\nqwen/qwen-max | paid\nqwen/qwen-plus | paid\nqwen/qwen-turbo | paid\nqwen/qwen2.5-vl-32b-instruct | paid\nqwen/qwen2.5-vl-32b-instruct:free | free\nqwen/qwen2.5-vl-72b-instruct | paid\nqwen/qwen2.5-vl-72b-instruct:free | free\nqwen/qwen-2.5-vl-7b-instruct | paid\nqwen/qwen3-14b | paid\nqwen/qwen3-14b:free | free\nqwen/qwen3-235b-a22b | paid\nqwen/qwen3-235b-a22b:free | free\nqwen/qwen3-235b-a22b-2507 | paid\nqwen/qwen3-235b-a22b-thinking-2507 | paid\nqwen/qwen3-30b-a3b | paid\nqwen/qwen3-30b-a3b:free | free\nqwen/qwen3-30b-a3b-instruct-2507 | paid\nqwen/qwen3-30b-a3b-thinking-2507 | paid\nqwen/qwen3-32b | paid\nqwen/qwen3-4b:free | free\nqwen/qwen3-8b | paid\nqwen/qwen3-8b:free | free\nqwen/qwen3-coder-30b-a3b-instruct | paid\nqwen/qwen3-coder | paid\nqwen/qwen3-coder:free | free\nqwen/qwq-32b | paid\nqwen/qwq-32b:free | free\nqwen/qwq-32b-preview | paid\nqwen/qwen-2.5-72b-instruct | paid\nqwen/qwen-2.5-72b-instruct:free | free\nqwen/qwen-2.5-7b-instruct | paid\nqwen/qwen-2.5-coder-32b-instruct | paid\nqwen/qwen-2.5-coder-32b-instruct:free | free\nrekaai/reka-flash-3:free | free\nundi95/remm-slerp-l2-13b | paid\nsao10k/l3-lunaris-8b | paid\nsao10k/l3-euryale-70b | paid\nsao10k/l3.1-euryale-70b | paid\nsao10k/l3.3-euryale-70b | paid\nshisa-ai/shisa-v2-llama3.3-70b | paid\nshisa-ai/shisa-v2-llama3.3-70b:free | free\nraifle/sorcererlm-8x22b | paid\nswitchpoint/router | paid\ntencent/hunyuan-a13b-instruct | paid\ntencent/hunyuan-a13b-instruct:free | free\nthedrummer/anubis-70b-v1.1 | paid\nthedrummer/anubis-pro-105b-v1 | paid\nthedrummer/rocinante-12b | paid\nthedrummer/skyfall-36b-v2 | paid\nthedrummer/unslopnemo-12b | paid\nthudm/glm-4-32b | paid\nthudm/glm-4.1v-9b-thinking | paid\nthudm/glm-z1-32b | paid\ntngtech/deepseek-r1t-chimera | paid\ntngtech/deepseek-r1t-chimera:free | free\ntngtech/deepseek-r1t2-chimera:free | free\ncognitivecomputations/dolphin-mistral-24b-venice-edition:free | free\nmicrosoft/wizardlm-2-8x22b | paid\nx-ai/grok-2-1212 | paid\nx-ai/grok-2-vision-1212 | paid\nx-ai/grok-3 | paid\nx-ai/grok-3-beta | paid\nx-ai/grok-3-mini | paid\nx-ai/grok-3-mini-beta | paid\nx-ai/grok-4 | paid\nx-ai/grok-code-fast-1 | paid\nx-ai/grok-vision-beta | paid\nz-ai/glm-4-32b | paid\nz-ai/glm-4.5 | paid\nz-ai/glm-4.5-air | paid\nz-ai/glm-4.5-air:free | free\nz-ai/glm-4.5v | paid\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m OpenAI models:\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\nbabbage-002\nchatgpt-4o-latest\ncodex-mini-latest\ndall-e-2\ndall-e-3\ndavinci-002\ngpt-3.5-turbo\ngpt-3.5-turbo-0125\ngpt-3.5-turbo-1106\ngpt-3.5-turbo-16k\ngpt-3.5-turbo-instruct\ngpt-3.5-turbo-instruct-0914\ngpt-4\ngpt-4-0125-preview\ngpt-4-0613\ngpt-4-1106-preview\ngpt-4-turbo\ngpt-4-turbo-2024-04-09\ngpt-4-turbo-preview\ngpt-4.1\ngpt-4.1-2025-04-14\ngpt-4.1-mini\ngpt-4.1-mini-2025-04-14\ngpt-4.1-nano\ngpt-4.1-nano-2025-04-14\ngpt-4o\ngpt-4o-2024-05-13\ngpt-4o-2024-08-06\ngpt-4o-2024-11-20\ngpt-4o-audio-preview\ngpt-4o-audio-preview-2024-10-01\ngpt-4o-audio-preview-2024-12-17\ngpt-4o-audio-preview-2025-06-03\ngpt-4o-mini\ngpt-4o-mini-2024-07-18\ngpt-4o-mini-audio-preview\ngpt-4o-mini-audio-preview-2024-12-17\ngpt-4o-mini-realtime-preview\ngpt-4o-mini-realtime-preview-2024-12-17\ngpt-4o-mini-search-preview\ngpt-4o-mini-search-preview-2025-03-11\ngpt-4o-mini-transcribe\ngpt-4o-mini-tts\ngpt-4o-realtime-preview\ngpt-4o-realtime-preview-2024-10-01\ngpt-4o-realtime-preview-2024-12-17\ngpt-4o-realtime-preview-2025-06-03\ngpt-4o-search-preview\ngpt-4o-search-preview-2025-03-11\ngpt-4o-transcribe\ngpt-5\ngpt-5-2025-08-07\ngpt-5-chat-latest\ngpt-5-mini\ngpt-5-mini-2025-08-07\ngpt-5-nano\ngpt-5-nano-2025-08-07\ngpt-audio\ngpt-audio-2025-08-28\ngpt-image-1\ngpt-realtime\ngpt-realtime-2025-08-28\no1\no1-2024-12-17\no1-mini\no1-mini-2024-09-12\no1-pro\no1-pro-2025-03-19\no3\no3-2025-04-16\no3-mini\no3-mini-2025-01-31\no4-mini\no4-mini-2025-04-16\no4-mini-deep-research\no4-mini-deep-research-2025-06-26\nomni-moderation-2024-09-26\nomni-moderation-latest\ntext-embedding-3-large\ntext-embedding-3-small\ntext-embedding-ada-002\ntts-1\ntts-1-1106\ntts-1-hd\ntts-1-hd-1106\nwhisper-1\n-----\n\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m Deepseek models:\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\ndeepseek-chat\ndeepseek-reasoner\n-----\n" + "description": "AI model to use for processing. Available models:\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m OpenRouter models:\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\nagentica-org/deepcoder-14b-preview | paid\nagentica-org/deepcoder-14b-preview:free | free\nai21/jamba-large-1.7 | paid\nai21/jamba-mini-1.7 | paid\naion-labs/aion-1.0 | paid\naion-labs/aion-1.0-mini | paid\naion-labs/aion-rp-llama-3.1-8b | paid\nalfredpros/codellama-7b-instruct-solidity | paid\nallenai/molmo-7b-d | paid\nallenai/olmo-2-0325-32b-instruct | paid\namazon/nova-lite-v1 | paid\namazon/nova-micro-v1 | paid\namazon/nova-pro-v1 | paid\nanthropic/claude-3-haiku | paid\nanthropic/claude-3-opus | paid\nanthropic/claude-3.5-haiku | paid\nanthropic/claude-3.5-haiku-20241022 | paid\nanthropic/claude-3.5-sonnet | paid\nanthropic/claude-3.5-sonnet-20240620 | paid\nanthropic/claude-3.7-sonnet | paid\nanthropic/claude-3.7-sonnet:thinking | paid\nanthropic/claude-opus-4 | paid\nanthropic/claude-opus-4.1 | paid\nanthropic/claude-sonnet-4 | paid\narcee-ai/coder-large | paid\narcee-ai/maestro-reasoning | paid\narcee-ai/spotlight | paid\narcee-ai/virtuoso-large | paid\narliai/qwq-32b-arliai-rpr-v1 | paid\narliai/qwq-32b-arliai-rpr-v1:free | free\nopenrouter/auto | paid\nbaidu/ernie-4.5-21b-a3b | paid\nbaidu/ernie-4.5-300b-a47b | paid\nbaidu/ernie-4.5-vl-28b-a3b | paid\nbaidu/ernie-4.5-vl-424b-a47b | paid\nbytedance/seed-oss-36b-instruct | paid\nbytedance/ui-tars-1.5-7b | paid\ndeepcogito/cogito-v2-preview-llama-109b-moe | paid\ncohere/command | paid\ncohere/command-a | paid\ncohere/command-r | paid\ncohere/command-r-03-2024 | paid\ncohere/command-r-08-2024 | paid\ncohere/command-r-plus | paid\ncohere/command-r-plus-04-2024 | paid\ncohere/command-r-plus-08-2024 | paid\ncohere/command-r7b-12-2024 | paid\ndeepcogito/cogito-v2-preview-deepseek-671b | paid\ndeepseek/deepseek-prover-v2 | paid\ndeepseek/deepseek-r1-0528-qwen3-8b | paid\ndeepseek/deepseek-r1-0528-qwen3-8b:free | free\ndeepseek/deepseek-chat | paid\ndeepseek/deepseek-chat-v3-0324 | paid\ndeepseek/deepseek-chat-v3-0324:free | free\ndeepseek/deepseek-chat-v3.1 | paid\ndeepseek/deepseek-chat-v3.1:free | free\ndeepseek/deepseek-v3.1-base | paid\ndeepseek/deepseek-r1 | paid\ndeepseek/deepseek-r1:free | free\ndeepseek/deepseek-r1-0528 | paid\ndeepseek/deepseek-r1-0528:free | free\ndeepseek/deepseek-r1-distill-llama-70b | paid\ndeepseek/deepseek-r1-distill-llama-70b:free | free\ndeepseek/deepseek-r1-distill-llama-8b | paid\ndeepseek/deepseek-r1-distill-qwen-14b | paid\ndeepseek/deepseek-r1-distill-qwen-14b:free | free\ndeepseek/deepseek-r1-distill-qwen-32b | paid\ncognitivecomputations/dolphin-mixtral-8x22b | paid\ncognitivecomputations/dolphin3.0-mistral-24b | paid\ncognitivecomputations/dolphin3.0-mistral-24b:free | free\ncognitivecomputations/dolphin3.0-r1-mistral-24b | paid\ncognitivecomputations/dolphin3.0-r1-mistral-24b:free | free\neleutherai/llemma_7b | paid\nalpindale/goliath-120b | paid\ngoogle/gemini-flash-1.5 | paid\ngoogle/gemini-flash-1.5-8b | paid\ngoogle/gemini-pro-1.5 | paid\ngoogle/gemini-2.0-flash-001 | paid\ngoogle/gemini-2.0-flash-exp:free | free\ngoogle/gemini-2.0-flash-lite-001 | paid\ngoogle/gemini-2.5-flash | paid\ngoogle/gemini-2.5-flash-image-preview | paid\ngoogle/gemini-2.5-flash-lite | paid\ngoogle/gemini-2.5-flash-lite-preview-06-17 | paid\ngoogle/gemini-2.5-pro | paid\ngoogle/gemini-2.5-pro-preview-05-06 | paid\ngoogle/gemini-2.5-pro-preview | paid\ngoogle/gemma-2-27b-it | paid\ngoogle/gemma-2-9b-it | paid\ngoogle/gemma-2-9b-it:free | free\ngoogle/gemma-3-12b-it | paid\ngoogle/gemma-3-12b-it:free | free\ngoogle/gemma-3-27b-it | paid\ngoogle/gemma-3-27b-it:free | free\ngoogle/gemma-3-4b-it | paid\ngoogle/gemma-3-4b-it:free | free\ngoogle/gemma-3n-e2b-it:free | free\ngoogle/gemma-3n-e4b-it | paid\ngoogle/gemma-3n-e4b-it:free | free\ninception/mercury | paid\ninception/mercury-coder | paid\ninflection/inflection-3-pi | paid\ninflection/inflection-3-productivity | paid\nliquid/lfm-3b | paid\nliquid/lfm-7b | paid\nmeta-llama/llama-guard-3-8b | paid\nanthracite-org/magnum-v2-72b | paid\nanthracite-org/magnum-v4-72b | paid\nmancer/weaver | paid\nmeituan/longcat-flash-chat | paid\nmeta-llama/llama-3-70b-instruct | paid\nmeta-llama/llama-3-8b-instruct | paid\nmeta-llama/llama-3.1-405b | paid\nmeta-llama/llama-3.1-405b-instruct | paid\nmeta-llama/llama-3.1-405b-instruct:free | free\nmeta-llama/llama-3.1-70b-instruct | paid\nmeta-llama/llama-3.1-8b-instruct | paid\nmeta-llama/llama-3.2-11b-vision-instruct | paid\nmeta-llama/llama-3.2-1b-instruct | paid\nmeta-llama/llama-3.2-3b-instruct | paid\nmeta-llama/llama-3.2-3b-instruct:free | free\nmeta-llama/llama-3.2-90b-vision-instruct | paid\nmeta-llama/llama-3.3-70b-instruct | paid\nmeta-llama/llama-3.3-70b-instruct:free | free\nmeta-llama/llama-3.3-8b-instruct:free | free\nmeta-llama/llama-4-maverick | paid\nmeta-llama/llama-4-maverick:free | free\nmeta-llama/llama-4-scout | paid\nmeta-llama/llama-4-scout:free | free\nmeta-llama/llama-guard-4-12b | paid\nmeta-llama/llama-guard-2-8b | paid\nmicrosoft/mai-ds-r1 | paid\nmicrosoft/mai-ds-r1:free | free\nmicrosoft/phi-4 | paid\nmicrosoft/phi-4-multimodal-instruct | paid\nmicrosoft/phi-4-reasoning-plus | paid\nmicrosoft/phi-3-medium-128k-instruct | paid\nmicrosoft/phi-3-mini-128k-instruct | paid\nmicrosoft/phi-3.5-mini-128k-instruct | paid\nsophosympatheia/midnight-rose-70b | paid\nminimax/minimax-m1 | paid\nminimax/minimax-01 | paid\nmistralai/mistral-large | paid\nmistralai/mistral-large-2407 | paid\nmistralai/mistral-large-2411 | paid\nmistralai/mistral-small | paid\nmistralai/mistral-tiny | paid\nmistralai/codestral-2501 | paid\nmistralai/codestral-2508 | paid\nmistralai/devstral-medium | paid\nmistralai/devstral-small | paid\nmistralai/devstral-small-2505 | paid\nmistralai/devstral-small-2505:free | free\nmistralai/magistral-medium-2506 | paid\nmistralai/magistral-medium-2506:thinking | paid\nmistralai/magistral-small-2506 | paid\nmistralai/ministral-3b | paid\nmistralai/ministral-8b | paid\nmistralai/mistral-7b-instruct | paid\nmistralai/mistral-7b-instruct:free | free\nmistralai/mistral-7b-instruct-v0.1 | paid\nmistralai/mistral-7b-instruct-v0.3 | paid\nmistralai/mistral-medium-3 | paid\nmistralai/mistral-medium-3.1 | paid\nmistralai/mistral-nemo | paid\nmistralai/mistral-nemo:free | free\nmistralai/mistral-small-24b-instruct-2501 | paid\nmistralai/mistral-small-24b-instruct-2501:free | free\nmistralai/mistral-small-3.1-24b-instruct | paid\nmistralai/mistral-small-3.1-24b-instruct:free | free\nmistralai/mistral-small-3.2-24b-instruct | paid\nmistralai/mistral-small-3.2-24b-instruct:free | free\nmistralai/mixtral-8x22b-instruct | paid\nmistralai/mixtral-8x7b-instruct | paid\nmistralai/pixtral-12b | paid\nmistralai/pixtral-large-2411 | paid\nmistralai/mistral-saba | paid\nmoonshotai/kimi-dev-72b | paid\nmoonshotai/kimi-dev-72b:free | free\nmoonshotai/kimi-k2 | paid\nmoonshotai/kimi-k2:free | free\nmoonshotai/kimi-k2-0905 | paid\nmoonshotai/kimi-vl-a3b-thinking | paid\nmoonshotai/kimi-vl-a3b-thinking:free | free\nmorph/morph-v3-fast | paid\nmorph/morph-v3-large | paid\ngryphe/mythomax-l2-13b | paid\nneversleep/llama-3-lumimaid-70b | paid\nneversleep/llama-3.1-lumimaid-8b | paid\nneversleep/noromaid-20b | paid\nnousresearch/deephermes-3-llama-3-8b-preview:free | free\nnousresearch/deephermes-3-mistral-24b-preview | paid\nnousresearch/hermes-3-llama-3.1-405b | paid\nnousresearch/hermes-3-llama-3.1-70b | paid\nnousresearch/hermes-4-405b | paid\nnousresearch/hermes-4-70b | paid\nnousresearch/hermes-2-pro-llama-3-8b | paid\nnvidia/llama-3.1-nemotron-70b-instruct | paid\nnvidia/llama-3.1-nemotron-ultra-253b-v1 | paid\nnvidia/llama-3.1-nemotron-ultra-253b-v1:free | free\nnvidia/nemotron-nano-9b-v2 | paid\nnvidia/nemotron-nano-9b-v2:free | free\nopenai/chatgpt-4o-latest | paid\nopenai/codex-mini | paid\nopenai/gpt-3.5-turbo | paid\nopenai/gpt-3.5-turbo-0613 | paid\nopenai/gpt-3.5-turbo-16k | paid\nopenai/gpt-3.5-turbo-instruct | paid\nopenai/gpt-4 | paid\nopenai/gpt-4-0314 | paid\nopenai/gpt-4-turbo | paid\nopenai/gpt-4-1106-preview | paid\nopenai/gpt-4-turbo-preview | paid\nopenai/gpt-4.1 | paid\nopenai/gpt-4.1-mini | paid\nopenai/gpt-4.1-nano | paid\nopenai/gpt-4o | paid\nopenai/gpt-4o-2024-05-13 | paid\nopenai/gpt-4o-2024-08-06 | paid\nopenai/gpt-4o-2024-11-20 | paid\nopenai/gpt-4o:extended | paid\nopenai/gpt-4o-audio-preview | paid\nopenai/gpt-4o-search-preview | paid\nopenai/gpt-4o-mini | paid\nopenai/gpt-4o-mini-2024-07-18 | paid\nopenai/gpt-4o-mini-search-preview | paid\nopenai/gpt-5 | paid\nopenai/gpt-5-chat | paid\nopenai/gpt-5-mini | paid\nopenai/gpt-5-nano | paid\nopenai/gpt-oss-120b | paid\nopenai/gpt-oss-120b:free | free\nopenai/gpt-oss-20b | paid\nopenai/gpt-oss-20b:free | free\nopenai/o1 | paid\nopenai/o1-mini | paid\nopenai/o1-mini-2024-09-12 | paid\nopenai/o1-pro | paid\nopenai/o3 | paid\nopenai/o3-mini | paid\nopenai/o3-mini-high | paid\nopenai/o3-pro | paid\nopenai/o4-mini | paid\nopenai/o4-mini-high | paid\nperplexity/r1-1776 | paid\nperplexity/sonar | paid\nperplexity/sonar-deep-research | paid\nperplexity/sonar-pro | paid\nperplexity/sonar-reasoning | paid\nperplexity/sonar-reasoning-pro | paid\nqwen/qwen-plus-2025-07-28 | paid\nqwen/qwen-plus-2025-07-28:thinking | paid\nqwen/qwen-vl-max | paid\nqwen/qwen-vl-plus | paid\nqwen/qwen-max | paid\nqwen/qwen-plus | paid\nqwen/qwen-turbo | paid\nqwen/qwen2.5-vl-32b-instruct | paid\nqwen/qwen2.5-vl-32b-instruct:free | free\nqwen/qwen2.5-vl-72b-instruct | paid\nqwen/qwen2.5-vl-72b-instruct:free | free\nqwen/qwen-2.5-vl-7b-instruct | paid\nqwen/qwen3-14b | paid\nqwen/qwen3-14b:free | free\nqwen/qwen3-235b-a22b | paid\nqwen/qwen3-235b-a22b:free | free\nqwen/qwen3-235b-a22b-2507 | paid\nqwen/qwen3-235b-a22b-thinking-2507 | paid\nqwen/qwen3-30b-a3b | paid\nqwen/qwen3-30b-a3b:free | free\nqwen/qwen3-30b-a3b-instruct-2507 | paid\nqwen/qwen3-30b-a3b-thinking-2507 | paid\nqwen/qwen3-32b | paid\nqwen/qwen3-4b:free | free\nqwen/qwen3-8b | paid\nqwen/qwen3-8b:free | free\nqwen/qwen3-coder-30b-a3b-instruct | paid\nqwen/qwen3-coder | paid\nqwen/qwen3-coder:free | free\nqwen/qwen3-max | paid\nqwen/qwen3-next-80b-a3b-instruct | paid\nqwen/qwen3-next-80b-a3b-thinking | paid\nqwen/qwq-32b | paid\nqwen/qwq-32b:free | free\nqwen/qwq-32b-preview | paid\nqwen/qwen-2.5-72b-instruct | paid\nqwen/qwen-2.5-72b-instruct:free | free\nqwen/qwen-2.5-7b-instruct | paid\nqwen/qwen-2.5-coder-32b-instruct | paid\nqwen/qwen-2.5-coder-32b-instruct:free | free\nrekaai/reka-flash-3:free | free\nundi95/remm-slerp-l2-13b | paid\nsao10k/l3-lunaris-8b | paid\nsao10k/l3-euryale-70b | paid\nsao10k/l3.1-euryale-70b | paid\nsao10k/l3.3-euryale-70b | paid\nshisa-ai/shisa-v2-llama3.3-70b | paid\nshisa-ai/shisa-v2-llama3.3-70b:free | free\nopenrouter/sonoma-dusk-alpha | paid\nopenrouter/sonoma-sky-alpha | paid\nraifle/sorcererlm-8x22b | paid\nstepfun-ai/step3 | paid\nswitchpoint/router | paid\ntencent/hunyuan-a13b-instruct | paid\ntencent/hunyuan-a13b-instruct:free | free\nthedrummer/anubis-70b-v1.1 | paid\nthedrummer/anubis-pro-105b-v1 | paid\nthedrummer/rocinante-12b | paid\nthedrummer/skyfall-36b-v2 | paid\nthedrummer/unslopnemo-12b | paid\nthudm/glm-4-32b | paid\nthudm/glm-4.1v-9b-thinking | paid\nthudm/glm-z1-32b | paid\ntngtech/deepseek-r1t-chimera | paid\ntngtech/deepseek-r1t-chimera:free | free\ntngtech/deepseek-r1t2-chimera:free | free\ncognitivecomputations/dolphin-mistral-24b-venice-edition:free | free\nmicrosoft/wizardlm-2-8x22b | paid\nx-ai/grok-2-1212 | paid\nx-ai/grok-2-vision-1212 | paid\nx-ai/grok-3 | paid\nx-ai/grok-3-beta | paid\nx-ai/grok-3-mini | paid\nx-ai/grok-3-mini-beta | paid\nx-ai/grok-4 | paid\nx-ai/grok-code-fast-1 | paid\nz-ai/glm-4-32b | paid\nz-ai/glm-4.5 | paid\nz-ai/glm-4.5-air | paid\nz-ai/glm-4.5-air:free | free\nz-ai/glm-4.5v | paid\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m OpenAI models:\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\nbabbage-002\nchatgpt-4o-latest\ncodex-mini-latest\ndall-e-2\ndall-e-3\ndavinci-002\ngpt-3.5-turbo\ngpt-3.5-turbo-0125\ngpt-3.5-turbo-1106\ngpt-3.5-turbo-16k\ngpt-3.5-turbo-instruct\ngpt-3.5-turbo-instruct-0914\ngpt-4\ngpt-4-0125-preview\ngpt-4-0613\ngpt-4-1106-preview\ngpt-4-turbo\ngpt-4-turbo-2024-04-09\ngpt-4-turbo-preview\ngpt-4.1\ngpt-4.1-2025-04-14\ngpt-4.1-mini\ngpt-4.1-mini-2025-04-14\ngpt-4.1-nano\ngpt-4.1-nano-2025-04-14\ngpt-4o\ngpt-4o-2024-05-13\ngpt-4o-2024-08-06\ngpt-4o-2024-11-20\ngpt-4o-audio-preview\ngpt-4o-audio-preview-2024-10-01\ngpt-4o-audio-preview-2024-12-17\ngpt-4o-audio-preview-2025-06-03\ngpt-4o-mini\ngpt-4o-mini-2024-07-18\ngpt-4o-mini-audio-preview\ngpt-4o-mini-audio-preview-2024-12-17\ngpt-4o-mini-realtime-preview\ngpt-4o-mini-realtime-preview-2024-12-17\ngpt-4o-mini-search-preview\ngpt-4o-mini-search-preview-2025-03-11\ngpt-4o-mini-transcribe\ngpt-4o-mini-tts\ngpt-4o-realtime-preview\ngpt-4o-realtime-preview-2024-10-01\ngpt-4o-realtime-preview-2024-12-17\ngpt-4o-realtime-preview-2025-06-03\ngpt-4o-search-preview\ngpt-4o-search-preview-2025-03-11\ngpt-4o-transcribe\ngpt-5\ngpt-5-2025-08-07\ngpt-5-chat-latest\ngpt-5-mini\ngpt-5-mini-2025-08-07\ngpt-5-nano\ngpt-5-nano-2025-08-07\ngpt-audio\ngpt-audio-2025-08-28\ngpt-image-1\ngpt-realtime\ngpt-realtime-2025-08-28\no1\no1-2024-12-17\no1-mini\no1-mini-2024-09-12\no1-pro\no1-pro-2025-03-19\no3\no3-2025-04-16\no3-mini\no3-mini-2025-01-31\no4-mini\no4-mini-2025-04-16\no4-mini-deep-research\no4-mini-deep-research-2025-06-26\nomni-moderation-2024-09-26\nomni-moderation-latest\ntext-embedding-3-large\ntext-embedding-3-small\ntext-embedding-ada-002\ntts-1\ntts-1-1106\ntts-1-hd\ntts-1-hd-1106\nwhisper-1\n-----\n\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m Deepseek models:\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\ndeepseek-chat\ndeepseek-reasoner\n-----\n" }, "router": { "type": "string", diff --git a/packages/kbot/schema_ui.json b/packages/kbot/schema_ui.json index 9a47d600..2b1c6e9b 100644 --- a/packages/kbot/schema_ui.json +++ b/packages/kbot/schema_ui.json @@ -79,7 +79,7 @@ "ui:title": "Api_key" }, "model": { - "ui:description": "AI model to use for processing. Available models:\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m OpenRouter models:\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\nagentica-org/deepcoder-14b-preview | paid\nagentica-org/deepcoder-14b-preview:free | free\nai21/jamba-large-1.7 | paid\nai21/jamba-mini-1.7 | paid\naion-labs/aion-1.0 | paid\naion-labs/aion-1.0-mini | paid\naion-labs/aion-rp-llama-3.1-8b | paid\nalfredpros/codellama-7b-instruct-solidity | paid\namazon/nova-lite-v1 | paid\namazon/nova-micro-v1 | paid\namazon/nova-pro-v1 | paid\nanthropic/claude-3-haiku | paid\nanthropic/claude-3-opus | paid\nanthropic/claude-3.5-haiku | paid\nanthropic/claude-3.5-haiku-20241022 | paid\nanthropic/claude-3.5-sonnet | paid\nanthropic/claude-3.5-sonnet-20240620 | paid\nanthropic/claude-3.7-sonnet | paid\nanthropic/claude-3.7-sonnet:thinking | paid\nanthropic/claude-opus-4 | paid\nanthropic/claude-opus-4.1 | paid\nanthropic/claude-sonnet-4 | paid\narcee-ai/coder-large | paid\narcee-ai/maestro-reasoning | paid\narcee-ai/spotlight | paid\narcee-ai/virtuoso-large | paid\narliai/qwq-32b-arliai-rpr-v1 | paid\narliai/qwq-32b-arliai-rpr-v1:free | free\nopenrouter/auto | paid\nbaidu/ernie-4.5-21b-a3b | paid\nbaidu/ernie-4.5-300b-a47b | paid\nbaidu/ernie-4.5-vl-28b-a3b | paid\nbaidu/ernie-4.5-vl-424b-a47b | paid\nbytedance/ui-tars-1.5-7b | paid\ndeepcogito/cogito-v2-preview-llama-109b-moe | paid\ncohere/command | paid\ncohere/command-a | paid\ncohere/command-r | paid\ncohere/command-r-03-2024 | paid\ncohere/command-r-08-2024 | paid\ncohere/command-r-plus | paid\ncohere/command-r-plus-04-2024 | paid\ncohere/command-r-plus-08-2024 | paid\ncohere/command-r7b-12-2024 | paid\ndeepcogito/cogito-v2-preview-deepseek-671b | paid\ndeepseek/deepseek-prover-v2 | paid\ndeepseek/deepseek-r1-0528-qwen3-8b | paid\ndeepseek/deepseek-r1-0528-qwen3-8b:free | free\ndeepseek/deepseek-chat | paid\ndeepseek/deepseek-chat-v3-0324 | paid\ndeepseek/deepseek-chat-v3-0324:free | free\ndeepseek/deepseek-chat-v3.1 | paid\ndeepseek/deepseek-chat-v3.1:free | free\ndeepseek/deepseek-v3.1-base | paid\ndeepseek/deepseek-r1 | paid\ndeepseek/deepseek-r1:free | free\ndeepseek/deepseek-r1-0528 | paid\ndeepseek/deepseek-r1-0528:free | free\ndeepseek/deepseek-r1-distill-llama-70b | paid\ndeepseek/deepseek-r1-distill-llama-70b:free | free\ndeepseek/deepseek-r1-distill-llama-8b | paid\ndeepseek/deepseek-r1-distill-qwen-14b | paid\ndeepseek/deepseek-r1-distill-qwen-14b:free | free\ndeepseek/deepseek-r1-distill-qwen-32b | paid\ncognitivecomputations/dolphin-mixtral-8x22b | paid\ncognitivecomputations/dolphin3.0-mistral-24b | paid\ncognitivecomputations/dolphin3.0-mistral-24b:free | free\ncognitivecomputations/dolphin3.0-r1-mistral-24b | paid\ncognitivecomputations/dolphin3.0-r1-mistral-24b:free | free\neleutherai/llemma_7b | paid\nalpindale/goliath-120b | paid\ngoogle/gemini-flash-1.5 | paid\ngoogle/gemini-flash-1.5-8b | paid\ngoogle/gemini-pro-1.5 | paid\ngoogle/gemini-2.0-flash-001 | paid\ngoogle/gemini-2.0-flash-exp:free | free\ngoogle/gemini-2.0-flash-lite-001 | paid\ngoogle/gemini-2.5-flash | paid\ngoogle/gemini-2.5-flash-image-preview | paid\ngoogle/gemini-2.5-flash-lite | paid\ngoogle/gemini-2.5-flash-lite-preview-06-17 | paid\ngoogle/gemini-2.5-pro | paid\ngoogle/gemini-2.5-pro-exp-03-25 | paid\ngoogle/gemini-2.5-pro-preview-05-06 | paid\ngoogle/gemini-2.5-pro-preview | paid\ngoogle/gemma-2-27b-it | paid\ngoogle/gemma-2-9b-it | paid\ngoogle/gemma-2-9b-it:free | free\ngoogle/gemma-3-12b-it | paid\ngoogle/gemma-3-12b-it:free | free\ngoogle/gemma-3-27b-it | paid\ngoogle/gemma-3-27b-it:free | free\ngoogle/gemma-3-4b-it | paid\ngoogle/gemma-3-4b-it:free | free\ngoogle/gemma-3n-e2b-it:free | free\ngoogle/gemma-3n-e4b-it | paid\ngoogle/gemma-3n-e4b-it:free | free\ninception/mercury | paid\ninception/mercury-coder | paid\ninfermatic/mn-inferor-12b | paid\ninflection/inflection-3-pi | paid\ninflection/inflection-3-productivity | paid\nliquid/lfm-3b | paid\nliquid/lfm-7b | paid\nmeta-llama/llama-guard-3-8b | paid\nanthracite-org/magnum-v2-72b | paid\nanthracite-org/magnum-v4-72b | paid\nmancer/weaver | paid\nmeta-llama/llama-3-70b-instruct | paid\nmeta-llama/llama-3-8b-instruct | paid\nmeta-llama/llama-3.1-405b | paid\nmeta-llama/llama-3.1-405b-instruct | paid\nmeta-llama/llama-3.1-405b-instruct:free | free\nmeta-llama/llama-3.1-70b-instruct | paid\nmeta-llama/llama-3.1-8b-instruct | paid\nmeta-llama/llama-3.2-11b-vision-instruct | paid\nmeta-llama/llama-3.2-1b-instruct | paid\nmeta-llama/llama-3.2-3b-instruct | paid\nmeta-llama/llama-3.2-3b-instruct:free | free\nmeta-llama/llama-3.2-90b-vision-instruct | paid\nmeta-llama/llama-3.3-70b-instruct | paid\nmeta-llama/llama-3.3-70b-instruct:free | free\nmeta-llama/llama-3.3-8b-instruct:free | free\nmeta-llama/llama-4-maverick | paid\nmeta-llama/llama-4-maverick:free | free\nmeta-llama/llama-4-scout | paid\nmeta-llama/llama-4-scout:free | free\nmeta-llama/llama-guard-4-12b | paid\nmeta-llama/llama-guard-2-8b | paid\nmicrosoft/mai-ds-r1 | paid\nmicrosoft/mai-ds-r1:free | free\nmicrosoft/phi-4 | paid\nmicrosoft/phi-4-multimodal-instruct | paid\nmicrosoft/phi-4-reasoning-plus | paid\nmicrosoft/phi-3-medium-128k-instruct | paid\nmicrosoft/phi-3-mini-128k-instruct | paid\nmicrosoft/phi-3.5-mini-128k-instruct | paid\nsophosympatheia/midnight-rose-70b | paid\nminimax/minimax-m1 | paid\nminimax/minimax-01 | paid\nmistralai/mistral-large | paid\nmistralai/mistral-large-2407 | paid\nmistralai/mistral-large-2411 | paid\nmistralai/mistral-small | paid\nmistralai/mistral-tiny | paid\nmistralai/codestral-2501 | paid\nmistralai/codestral-2508 | paid\nmistralai/devstral-medium | paid\nmistralai/devstral-small | paid\nmistralai/devstral-small-2505 | paid\nmistralai/devstral-small-2505:free | free\nmistralai/magistral-medium-2506 | paid\nmistralai/magistral-medium-2506:thinking | paid\nmistralai/magistral-small-2506 | paid\nmistralai/ministral-3b | paid\nmistralai/ministral-8b | paid\nmistralai/mistral-7b-instruct | paid\nmistralai/mistral-7b-instruct:free | free\nmistralai/mistral-7b-instruct-v0.1 | paid\nmistralai/mistral-7b-instruct-v0.3 | paid\nmistralai/mistral-medium-3 | paid\nmistralai/mistral-medium-3.1 | paid\nmistralai/mistral-nemo | paid\nmistralai/mistral-nemo:free | free\nmistralai/mistral-small-24b-instruct-2501 | paid\nmistralai/mistral-small-24b-instruct-2501:free | free\nmistralai/mistral-small-3.1-24b-instruct | paid\nmistralai/mistral-small-3.1-24b-instruct:free | free\nmistralai/mistral-small-3.2-24b-instruct | paid\nmistralai/mistral-small-3.2-24b-instruct:free | free\nmistralai/mixtral-8x22b-instruct | paid\nmistralai/mixtral-8x7b-instruct | paid\nmistralai/pixtral-12b | paid\nmistralai/pixtral-large-2411 | paid\nmistralai/mistral-saba | paid\nmoonshotai/kimi-dev-72b | paid\nmoonshotai/kimi-dev-72b:free | free\nmoonshotai/kimi-k2 | paid\nmoonshotai/kimi-k2:free | free\nmoonshotai/kimi-vl-a3b-thinking | paid\nmoonshotai/kimi-vl-a3b-thinking:free | free\nmorph/morph-v3-fast | paid\nmorph/morph-v3-large | paid\ngryphe/mythomax-l2-13b | paid\nneversleep/llama-3-lumimaid-70b | paid\nneversleep/llama-3.1-lumimaid-8b | paid\nneversleep/noromaid-20b | paid\nnousresearch/deephermes-3-llama-3-8b-preview:free | free\nnousresearch/deephermes-3-mistral-24b-preview | paid\nnousresearch/hermes-3-llama-3.1-405b | paid\nnousresearch/hermes-3-llama-3.1-70b | paid\nnousresearch/hermes-4-405b | paid\nnousresearch/hermes-4-70b | paid\nnousresearch/hermes-2-pro-llama-3-8b | paid\nnvidia/llama-3.1-nemotron-70b-instruct | paid\nnvidia/llama-3.1-nemotron-ultra-253b-v1 | paid\nnvidia/llama-3.1-nemotron-ultra-253b-v1:free | free\nnvidia/llama-3.3-nemotron-super-49b-v1 | paid\nopenai/chatgpt-4o-latest | paid\nopenai/codex-mini | paid\nopenai/gpt-3.5-turbo | paid\nopenai/gpt-3.5-turbo-0613 | paid\nopenai/gpt-3.5-turbo-16k | paid\nopenai/gpt-3.5-turbo-instruct | paid\nopenai/gpt-4 | paid\nopenai/gpt-4-0314 | paid\nopenai/gpt-4-turbo | paid\nopenai/gpt-4-1106-preview | paid\nopenai/gpt-4-turbo-preview | paid\nopenai/gpt-4.1 | paid\nopenai/gpt-4.1-mini | paid\nopenai/gpt-4.1-nano | paid\nopenai/gpt-4o | paid\nopenai/gpt-4o-2024-05-13 | paid\nopenai/gpt-4o-2024-08-06 | paid\nopenai/gpt-4o-2024-11-20 | paid\nopenai/gpt-4o:extended | paid\nopenai/gpt-4o-audio-preview | paid\nopenai/gpt-4o-search-preview | paid\nopenai/gpt-4o-mini | paid\nopenai/gpt-4o-mini-2024-07-18 | paid\nopenai/gpt-4o-mini-search-preview | paid\nopenai/gpt-5 | paid\nopenai/gpt-5-chat | paid\nopenai/gpt-5-mini | paid\nopenai/gpt-5-nano | paid\nopenai/gpt-oss-120b | paid\nopenai/gpt-oss-120b:free | free\nopenai/gpt-oss-20b | paid\nopenai/gpt-oss-20b:free | free\nopenai/o1 | paid\nopenai/o1-mini | paid\nopenai/o1-mini-2024-09-12 | paid\nopenai/o1-pro | paid\nopenai/o3 | paid\nopenai/o3-mini | paid\nopenai/o3-mini-high | paid\nopenai/o3-pro | paid\nopenai/o4-mini | paid\nopenai/o4-mini-high | paid\nperplexity/r1-1776 | paid\nperplexity/sonar | paid\nperplexity/sonar-deep-research | paid\nperplexity/sonar-pro | paid\nperplexity/sonar-reasoning | paid\nperplexity/sonar-reasoning-pro | paid\npygmalionai/mythalion-13b | paid\nqwen/qwen-vl-max | paid\nqwen/qwen-vl-plus | paid\nqwen/qwen-max | paid\nqwen/qwen-plus | paid\nqwen/qwen-turbo | paid\nqwen/qwen2.5-vl-32b-instruct | paid\nqwen/qwen2.5-vl-32b-instruct:free | free\nqwen/qwen2.5-vl-72b-instruct | paid\nqwen/qwen2.5-vl-72b-instruct:free | free\nqwen/qwen-2.5-vl-7b-instruct | paid\nqwen/qwen3-14b | paid\nqwen/qwen3-14b:free | free\nqwen/qwen3-235b-a22b | paid\nqwen/qwen3-235b-a22b:free | free\nqwen/qwen3-235b-a22b-2507 | paid\nqwen/qwen3-235b-a22b-thinking-2507 | paid\nqwen/qwen3-30b-a3b | paid\nqwen/qwen3-30b-a3b:free | free\nqwen/qwen3-30b-a3b-instruct-2507 | paid\nqwen/qwen3-30b-a3b-thinking-2507 | paid\nqwen/qwen3-32b | paid\nqwen/qwen3-4b:free | free\nqwen/qwen3-8b | paid\nqwen/qwen3-8b:free | free\nqwen/qwen3-coder-30b-a3b-instruct | paid\nqwen/qwen3-coder | paid\nqwen/qwen3-coder:free | free\nqwen/qwq-32b | paid\nqwen/qwq-32b:free | free\nqwen/qwq-32b-preview | paid\nqwen/qwen-2.5-72b-instruct | paid\nqwen/qwen-2.5-72b-instruct:free | free\nqwen/qwen-2.5-7b-instruct | paid\nqwen/qwen-2.5-coder-32b-instruct | paid\nqwen/qwen-2.5-coder-32b-instruct:free | free\nrekaai/reka-flash-3:free | free\nundi95/remm-slerp-l2-13b | paid\nsao10k/l3-lunaris-8b | paid\nsao10k/l3-euryale-70b | paid\nsao10k/l3.1-euryale-70b | paid\nsao10k/l3.3-euryale-70b | paid\nshisa-ai/shisa-v2-llama3.3-70b | paid\nshisa-ai/shisa-v2-llama3.3-70b:free | free\nraifle/sorcererlm-8x22b | paid\nswitchpoint/router | paid\ntencent/hunyuan-a13b-instruct | paid\ntencent/hunyuan-a13b-instruct:free | free\nthedrummer/anubis-70b-v1.1 | paid\nthedrummer/anubis-pro-105b-v1 | paid\nthedrummer/rocinante-12b | paid\nthedrummer/skyfall-36b-v2 | paid\nthedrummer/unslopnemo-12b | paid\nthudm/glm-4-32b | paid\nthudm/glm-4.1v-9b-thinking | paid\nthudm/glm-z1-32b | paid\ntngtech/deepseek-r1t-chimera | paid\ntngtech/deepseek-r1t-chimera:free | free\ntngtech/deepseek-r1t2-chimera:free | free\ncognitivecomputations/dolphin-mistral-24b-venice-edition:free | free\nmicrosoft/wizardlm-2-8x22b | paid\nx-ai/grok-2-1212 | paid\nx-ai/grok-2-vision-1212 | paid\nx-ai/grok-3 | paid\nx-ai/grok-3-beta | paid\nx-ai/grok-3-mini | paid\nx-ai/grok-3-mini-beta | paid\nx-ai/grok-4 | paid\nx-ai/grok-code-fast-1 | paid\nx-ai/grok-vision-beta | paid\nz-ai/glm-4-32b | paid\nz-ai/glm-4.5 | paid\nz-ai/glm-4.5-air | paid\nz-ai/glm-4.5-air:free | free\nz-ai/glm-4.5v | paid\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m OpenAI models:\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\nbabbage-002\nchatgpt-4o-latest\ncodex-mini-latest\ndall-e-2\ndall-e-3\ndavinci-002\ngpt-3.5-turbo\ngpt-3.5-turbo-0125\ngpt-3.5-turbo-1106\ngpt-3.5-turbo-16k\ngpt-3.5-turbo-instruct\ngpt-3.5-turbo-instruct-0914\ngpt-4\ngpt-4-0125-preview\ngpt-4-0613\ngpt-4-1106-preview\ngpt-4-turbo\ngpt-4-turbo-2024-04-09\ngpt-4-turbo-preview\ngpt-4.1\ngpt-4.1-2025-04-14\ngpt-4.1-mini\ngpt-4.1-mini-2025-04-14\ngpt-4.1-nano\ngpt-4.1-nano-2025-04-14\ngpt-4o\ngpt-4o-2024-05-13\ngpt-4o-2024-08-06\ngpt-4o-2024-11-20\ngpt-4o-audio-preview\ngpt-4o-audio-preview-2024-10-01\ngpt-4o-audio-preview-2024-12-17\ngpt-4o-audio-preview-2025-06-03\ngpt-4o-mini\ngpt-4o-mini-2024-07-18\ngpt-4o-mini-audio-preview\ngpt-4o-mini-audio-preview-2024-12-17\ngpt-4o-mini-realtime-preview\ngpt-4o-mini-realtime-preview-2024-12-17\ngpt-4o-mini-search-preview\ngpt-4o-mini-search-preview-2025-03-11\ngpt-4o-mini-transcribe\ngpt-4o-mini-tts\ngpt-4o-realtime-preview\ngpt-4o-realtime-preview-2024-10-01\ngpt-4o-realtime-preview-2024-12-17\ngpt-4o-realtime-preview-2025-06-03\ngpt-4o-search-preview\ngpt-4o-search-preview-2025-03-11\ngpt-4o-transcribe\ngpt-5\ngpt-5-2025-08-07\ngpt-5-chat-latest\ngpt-5-mini\ngpt-5-mini-2025-08-07\ngpt-5-nano\ngpt-5-nano-2025-08-07\ngpt-audio\ngpt-audio-2025-08-28\ngpt-image-1\ngpt-realtime\ngpt-realtime-2025-08-28\no1\no1-2024-12-17\no1-mini\no1-mini-2024-09-12\no1-pro\no1-pro-2025-03-19\no3\no3-2025-04-16\no3-mini\no3-mini-2025-01-31\no4-mini\no4-mini-2025-04-16\no4-mini-deep-research\no4-mini-deep-research-2025-06-26\nomni-moderation-2024-09-26\nomni-moderation-latest\ntext-embedding-3-large\ntext-embedding-3-small\ntext-embedding-ada-002\ntts-1\ntts-1-1106\ntts-1-hd\ntts-1-hd-1106\nwhisper-1\n-----\n\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m Deepseek models:\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\ndeepseek-chat\ndeepseek-reasoner\n-----\n", + "ui:description": "AI model to use for processing. Available models:\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m OpenRouter models:\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\nagentica-org/deepcoder-14b-preview | paid\nagentica-org/deepcoder-14b-preview:free | free\nai21/jamba-large-1.7 | paid\nai21/jamba-mini-1.7 | paid\naion-labs/aion-1.0 | paid\naion-labs/aion-1.0-mini | paid\naion-labs/aion-rp-llama-3.1-8b | paid\nalfredpros/codellama-7b-instruct-solidity | paid\nallenai/molmo-7b-d | paid\nallenai/olmo-2-0325-32b-instruct | paid\namazon/nova-lite-v1 | paid\namazon/nova-micro-v1 | paid\namazon/nova-pro-v1 | paid\nanthropic/claude-3-haiku | paid\nanthropic/claude-3-opus | paid\nanthropic/claude-3.5-haiku | paid\nanthropic/claude-3.5-haiku-20241022 | paid\nanthropic/claude-3.5-sonnet | paid\nanthropic/claude-3.5-sonnet-20240620 | paid\nanthropic/claude-3.7-sonnet | paid\nanthropic/claude-3.7-sonnet:thinking | paid\nanthropic/claude-opus-4 | paid\nanthropic/claude-opus-4.1 | paid\nanthropic/claude-sonnet-4 | paid\narcee-ai/coder-large | paid\narcee-ai/maestro-reasoning | paid\narcee-ai/spotlight | paid\narcee-ai/virtuoso-large | paid\narliai/qwq-32b-arliai-rpr-v1 | paid\narliai/qwq-32b-arliai-rpr-v1:free | free\nopenrouter/auto | paid\nbaidu/ernie-4.5-21b-a3b | paid\nbaidu/ernie-4.5-300b-a47b | paid\nbaidu/ernie-4.5-vl-28b-a3b | paid\nbaidu/ernie-4.5-vl-424b-a47b | paid\nbytedance/seed-oss-36b-instruct | paid\nbytedance/ui-tars-1.5-7b | paid\ndeepcogito/cogito-v2-preview-llama-109b-moe | paid\ncohere/command | paid\ncohere/command-a | paid\ncohere/command-r | paid\ncohere/command-r-03-2024 | paid\ncohere/command-r-08-2024 | paid\ncohere/command-r-plus | paid\ncohere/command-r-plus-04-2024 | paid\ncohere/command-r-plus-08-2024 | paid\ncohere/command-r7b-12-2024 | paid\ndeepcogito/cogito-v2-preview-deepseek-671b | paid\ndeepseek/deepseek-prover-v2 | paid\ndeepseek/deepseek-r1-0528-qwen3-8b | paid\ndeepseek/deepseek-r1-0528-qwen3-8b:free | free\ndeepseek/deepseek-chat | paid\ndeepseek/deepseek-chat-v3-0324 | paid\ndeepseek/deepseek-chat-v3-0324:free | free\ndeepseek/deepseek-chat-v3.1 | paid\ndeepseek/deepseek-chat-v3.1:free | free\ndeepseek/deepseek-v3.1-base | paid\ndeepseek/deepseek-r1 | paid\ndeepseek/deepseek-r1:free | free\ndeepseek/deepseek-r1-0528 | paid\ndeepseek/deepseek-r1-0528:free | free\ndeepseek/deepseek-r1-distill-llama-70b | paid\ndeepseek/deepseek-r1-distill-llama-70b:free | free\ndeepseek/deepseek-r1-distill-llama-8b | paid\ndeepseek/deepseek-r1-distill-qwen-14b | paid\ndeepseek/deepseek-r1-distill-qwen-14b:free | free\ndeepseek/deepseek-r1-distill-qwen-32b | paid\ncognitivecomputations/dolphin-mixtral-8x22b | paid\ncognitivecomputations/dolphin3.0-mistral-24b | paid\ncognitivecomputations/dolphin3.0-mistral-24b:free | free\ncognitivecomputations/dolphin3.0-r1-mistral-24b | paid\ncognitivecomputations/dolphin3.0-r1-mistral-24b:free | free\neleutherai/llemma_7b | paid\nalpindale/goliath-120b | paid\ngoogle/gemini-flash-1.5 | paid\ngoogle/gemini-flash-1.5-8b | paid\ngoogle/gemini-pro-1.5 | paid\ngoogle/gemini-2.0-flash-001 | paid\ngoogle/gemini-2.0-flash-exp:free | free\ngoogle/gemini-2.0-flash-lite-001 | paid\ngoogle/gemini-2.5-flash | paid\ngoogle/gemini-2.5-flash-image-preview | paid\ngoogle/gemini-2.5-flash-lite | paid\ngoogle/gemini-2.5-flash-lite-preview-06-17 | paid\ngoogle/gemini-2.5-pro | paid\ngoogle/gemini-2.5-pro-preview-05-06 | paid\ngoogle/gemini-2.5-pro-preview | paid\ngoogle/gemma-2-27b-it | paid\ngoogle/gemma-2-9b-it | paid\ngoogle/gemma-2-9b-it:free | free\ngoogle/gemma-3-12b-it | paid\ngoogle/gemma-3-12b-it:free | free\ngoogle/gemma-3-27b-it | paid\ngoogle/gemma-3-27b-it:free | free\ngoogle/gemma-3-4b-it | paid\ngoogle/gemma-3-4b-it:free | free\ngoogle/gemma-3n-e2b-it:free | free\ngoogle/gemma-3n-e4b-it | paid\ngoogle/gemma-3n-e4b-it:free | free\ninception/mercury | paid\ninception/mercury-coder | paid\ninflection/inflection-3-pi | paid\ninflection/inflection-3-productivity | paid\nliquid/lfm-3b | paid\nliquid/lfm-7b | paid\nmeta-llama/llama-guard-3-8b | paid\nanthracite-org/magnum-v2-72b | paid\nanthracite-org/magnum-v4-72b | paid\nmancer/weaver | paid\nmeituan/longcat-flash-chat | paid\nmeta-llama/llama-3-70b-instruct | paid\nmeta-llama/llama-3-8b-instruct | paid\nmeta-llama/llama-3.1-405b | paid\nmeta-llama/llama-3.1-405b-instruct | paid\nmeta-llama/llama-3.1-405b-instruct:free | free\nmeta-llama/llama-3.1-70b-instruct | paid\nmeta-llama/llama-3.1-8b-instruct | paid\nmeta-llama/llama-3.2-11b-vision-instruct | paid\nmeta-llama/llama-3.2-1b-instruct | paid\nmeta-llama/llama-3.2-3b-instruct | paid\nmeta-llama/llama-3.2-3b-instruct:free | free\nmeta-llama/llama-3.2-90b-vision-instruct | paid\nmeta-llama/llama-3.3-70b-instruct | paid\nmeta-llama/llama-3.3-70b-instruct:free | free\nmeta-llama/llama-3.3-8b-instruct:free | free\nmeta-llama/llama-4-maverick | paid\nmeta-llama/llama-4-maverick:free | free\nmeta-llama/llama-4-scout | paid\nmeta-llama/llama-4-scout:free | free\nmeta-llama/llama-guard-4-12b | paid\nmeta-llama/llama-guard-2-8b | paid\nmicrosoft/mai-ds-r1 | paid\nmicrosoft/mai-ds-r1:free | free\nmicrosoft/phi-4 | paid\nmicrosoft/phi-4-multimodal-instruct | paid\nmicrosoft/phi-4-reasoning-plus | paid\nmicrosoft/phi-3-medium-128k-instruct | paid\nmicrosoft/phi-3-mini-128k-instruct | paid\nmicrosoft/phi-3.5-mini-128k-instruct | paid\nsophosympatheia/midnight-rose-70b | paid\nminimax/minimax-m1 | paid\nminimax/minimax-01 | paid\nmistralai/mistral-large | paid\nmistralai/mistral-large-2407 | paid\nmistralai/mistral-large-2411 | paid\nmistralai/mistral-small | paid\nmistralai/mistral-tiny | paid\nmistralai/codestral-2501 | paid\nmistralai/codestral-2508 | paid\nmistralai/devstral-medium | paid\nmistralai/devstral-small | paid\nmistralai/devstral-small-2505 | paid\nmistralai/devstral-small-2505:free | free\nmistralai/magistral-medium-2506 | paid\nmistralai/magistral-medium-2506:thinking | paid\nmistralai/magistral-small-2506 | paid\nmistralai/ministral-3b | paid\nmistralai/ministral-8b | paid\nmistralai/mistral-7b-instruct | paid\nmistralai/mistral-7b-instruct:free | free\nmistralai/mistral-7b-instruct-v0.1 | paid\nmistralai/mistral-7b-instruct-v0.3 | paid\nmistralai/mistral-medium-3 | paid\nmistralai/mistral-medium-3.1 | paid\nmistralai/mistral-nemo | paid\nmistralai/mistral-nemo:free | free\nmistralai/mistral-small-24b-instruct-2501 | paid\nmistralai/mistral-small-24b-instruct-2501:free | free\nmistralai/mistral-small-3.1-24b-instruct | paid\nmistralai/mistral-small-3.1-24b-instruct:free | free\nmistralai/mistral-small-3.2-24b-instruct | paid\nmistralai/mistral-small-3.2-24b-instruct:free | free\nmistralai/mixtral-8x22b-instruct | paid\nmistralai/mixtral-8x7b-instruct | paid\nmistralai/pixtral-12b | paid\nmistralai/pixtral-large-2411 | paid\nmistralai/mistral-saba | paid\nmoonshotai/kimi-dev-72b | paid\nmoonshotai/kimi-dev-72b:free | free\nmoonshotai/kimi-k2 | paid\nmoonshotai/kimi-k2:free | free\nmoonshotai/kimi-k2-0905 | paid\nmoonshotai/kimi-vl-a3b-thinking | paid\nmoonshotai/kimi-vl-a3b-thinking:free | free\nmorph/morph-v3-fast | paid\nmorph/morph-v3-large | paid\ngryphe/mythomax-l2-13b | paid\nneversleep/llama-3-lumimaid-70b | paid\nneversleep/llama-3.1-lumimaid-8b | paid\nneversleep/noromaid-20b | paid\nnousresearch/deephermes-3-llama-3-8b-preview:free | free\nnousresearch/deephermes-3-mistral-24b-preview | paid\nnousresearch/hermes-3-llama-3.1-405b | paid\nnousresearch/hermes-3-llama-3.1-70b | paid\nnousresearch/hermes-4-405b | paid\nnousresearch/hermes-4-70b | paid\nnousresearch/hermes-2-pro-llama-3-8b | paid\nnvidia/llama-3.1-nemotron-70b-instruct | paid\nnvidia/llama-3.1-nemotron-ultra-253b-v1 | paid\nnvidia/llama-3.1-nemotron-ultra-253b-v1:free | free\nnvidia/nemotron-nano-9b-v2 | paid\nnvidia/nemotron-nano-9b-v2:free | free\nopenai/chatgpt-4o-latest | paid\nopenai/codex-mini | paid\nopenai/gpt-3.5-turbo | paid\nopenai/gpt-3.5-turbo-0613 | paid\nopenai/gpt-3.5-turbo-16k | paid\nopenai/gpt-3.5-turbo-instruct | paid\nopenai/gpt-4 | paid\nopenai/gpt-4-0314 | paid\nopenai/gpt-4-turbo | paid\nopenai/gpt-4-1106-preview | paid\nopenai/gpt-4-turbo-preview | paid\nopenai/gpt-4.1 | paid\nopenai/gpt-4.1-mini | paid\nopenai/gpt-4.1-nano | paid\nopenai/gpt-4o | paid\nopenai/gpt-4o-2024-05-13 | paid\nopenai/gpt-4o-2024-08-06 | paid\nopenai/gpt-4o-2024-11-20 | paid\nopenai/gpt-4o:extended | paid\nopenai/gpt-4o-audio-preview | paid\nopenai/gpt-4o-search-preview | paid\nopenai/gpt-4o-mini | paid\nopenai/gpt-4o-mini-2024-07-18 | paid\nopenai/gpt-4o-mini-search-preview | paid\nopenai/gpt-5 | paid\nopenai/gpt-5-chat | paid\nopenai/gpt-5-mini | paid\nopenai/gpt-5-nano | paid\nopenai/gpt-oss-120b | paid\nopenai/gpt-oss-120b:free | free\nopenai/gpt-oss-20b | paid\nopenai/gpt-oss-20b:free | free\nopenai/o1 | paid\nopenai/o1-mini | paid\nopenai/o1-mini-2024-09-12 | paid\nopenai/o1-pro | paid\nopenai/o3 | paid\nopenai/o3-mini | paid\nopenai/o3-mini-high | paid\nopenai/o3-pro | paid\nopenai/o4-mini | paid\nopenai/o4-mini-high | paid\nperplexity/r1-1776 | paid\nperplexity/sonar | paid\nperplexity/sonar-deep-research | paid\nperplexity/sonar-pro | paid\nperplexity/sonar-reasoning | paid\nperplexity/sonar-reasoning-pro | paid\nqwen/qwen-plus-2025-07-28 | paid\nqwen/qwen-plus-2025-07-28:thinking | paid\nqwen/qwen-vl-max | paid\nqwen/qwen-vl-plus | paid\nqwen/qwen-max | paid\nqwen/qwen-plus | paid\nqwen/qwen-turbo | paid\nqwen/qwen2.5-vl-32b-instruct | paid\nqwen/qwen2.5-vl-32b-instruct:free | free\nqwen/qwen2.5-vl-72b-instruct | paid\nqwen/qwen2.5-vl-72b-instruct:free | free\nqwen/qwen-2.5-vl-7b-instruct | paid\nqwen/qwen3-14b | paid\nqwen/qwen3-14b:free | free\nqwen/qwen3-235b-a22b | paid\nqwen/qwen3-235b-a22b:free | free\nqwen/qwen3-235b-a22b-2507 | paid\nqwen/qwen3-235b-a22b-thinking-2507 | paid\nqwen/qwen3-30b-a3b | paid\nqwen/qwen3-30b-a3b:free | free\nqwen/qwen3-30b-a3b-instruct-2507 | paid\nqwen/qwen3-30b-a3b-thinking-2507 | paid\nqwen/qwen3-32b | paid\nqwen/qwen3-4b:free | free\nqwen/qwen3-8b | paid\nqwen/qwen3-8b:free | free\nqwen/qwen3-coder-30b-a3b-instruct | paid\nqwen/qwen3-coder | paid\nqwen/qwen3-coder:free | free\nqwen/qwen3-max | paid\nqwen/qwen3-next-80b-a3b-instruct | paid\nqwen/qwen3-next-80b-a3b-thinking | paid\nqwen/qwq-32b | paid\nqwen/qwq-32b:free | free\nqwen/qwq-32b-preview | paid\nqwen/qwen-2.5-72b-instruct | paid\nqwen/qwen-2.5-72b-instruct:free | free\nqwen/qwen-2.5-7b-instruct | paid\nqwen/qwen-2.5-coder-32b-instruct | paid\nqwen/qwen-2.5-coder-32b-instruct:free | free\nrekaai/reka-flash-3:free | free\nundi95/remm-slerp-l2-13b | paid\nsao10k/l3-lunaris-8b | paid\nsao10k/l3-euryale-70b | paid\nsao10k/l3.1-euryale-70b | paid\nsao10k/l3.3-euryale-70b | paid\nshisa-ai/shisa-v2-llama3.3-70b | paid\nshisa-ai/shisa-v2-llama3.3-70b:free | free\nopenrouter/sonoma-dusk-alpha | paid\nopenrouter/sonoma-sky-alpha | paid\nraifle/sorcererlm-8x22b | paid\nstepfun-ai/step3 | paid\nswitchpoint/router | paid\ntencent/hunyuan-a13b-instruct | paid\ntencent/hunyuan-a13b-instruct:free | free\nthedrummer/anubis-70b-v1.1 | paid\nthedrummer/anubis-pro-105b-v1 | paid\nthedrummer/rocinante-12b | paid\nthedrummer/skyfall-36b-v2 | paid\nthedrummer/unslopnemo-12b | paid\nthudm/glm-4-32b | paid\nthudm/glm-4.1v-9b-thinking | paid\nthudm/glm-z1-32b | paid\ntngtech/deepseek-r1t-chimera | paid\ntngtech/deepseek-r1t-chimera:free | free\ntngtech/deepseek-r1t2-chimera:free | free\ncognitivecomputations/dolphin-mistral-24b-venice-edition:free | free\nmicrosoft/wizardlm-2-8x22b | paid\nx-ai/grok-2-1212 | paid\nx-ai/grok-2-vision-1212 | paid\nx-ai/grok-3 | paid\nx-ai/grok-3-beta | paid\nx-ai/grok-3-mini | paid\nx-ai/grok-3-mini-beta | paid\nx-ai/grok-4 | paid\nx-ai/grok-code-fast-1 | paid\nz-ai/glm-4-32b | paid\nz-ai/glm-4.5 | paid\nz-ai/glm-4.5-air | paid\nz-ai/glm-4.5-air:free | free\nz-ai/glm-4.5v | paid\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m OpenAI models:\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\nbabbage-002\nchatgpt-4o-latest\ncodex-mini-latest\ndall-e-2\ndall-e-3\ndavinci-002\ngpt-3.5-turbo\ngpt-3.5-turbo-0125\ngpt-3.5-turbo-1106\ngpt-3.5-turbo-16k\ngpt-3.5-turbo-instruct\ngpt-3.5-turbo-instruct-0914\ngpt-4\ngpt-4-0125-preview\ngpt-4-0613\ngpt-4-1106-preview\ngpt-4-turbo\ngpt-4-turbo-2024-04-09\ngpt-4-turbo-preview\ngpt-4.1\ngpt-4.1-2025-04-14\ngpt-4.1-mini\ngpt-4.1-mini-2025-04-14\ngpt-4.1-nano\ngpt-4.1-nano-2025-04-14\ngpt-4o\ngpt-4o-2024-05-13\ngpt-4o-2024-08-06\ngpt-4o-2024-11-20\ngpt-4o-audio-preview\ngpt-4o-audio-preview-2024-10-01\ngpt-4o-audio-preview-2024-12-17\ngpt-4o-audio-preview-2025-06-03\ngpt-4o-mini\ngpt-4o-mini-2024-07-18\ngpt-4o-mini-audio-preview\ngpt-4o-mini-audio-preview-2024-12-17\ngpt-4o-mini-realtime-preview\ngpt-4o-mini-realtime-preview-2024-12-17\ngpt-4o-mini-search-preview\ngpt-4o-mini-search-preview-2025-03-11\ngpt-4o-mini-transcribe\ngpt-4o-mini-tts\ngpt-4o-realtime-preview\ngpt-4o-realtime-preview-2024-10-01\ngpt-4o-realtime-preview-2024-12-17\ngpt-4o-realtime-preview-2025-06-03\ngpt-4o-search-preview\ngpt-4o-search-preview-2025-03-11\ngpt-4o-transcribe\ngpt-5\ngpt-5-2025-08-07\ngpt-5-chat-latest\ngpt-5-mini\ngpt-5-mini-2025-08-07\ngpt-5-nano\ngpt-5-nano-2025-08-07\ngpt-audio\ngpt-audio-2025-08-28\ngpt-image-1\ngpt-realtime\ngpt-realtime-2025-08-28\no1\no1-2024-12-17\no1-mini\no1-mini-2024-09-12\no1-pro\no1-pro-2025-03-19\no3\no3-2025-04-16\no3-mini\no3-mini-2025-01-31\no4-mini\no4-mini-2025-04-16\no4-mini-deep-research\no4-mini-deep-research-2025-06-26\nomni-moderation-2024-09-26\nomni-moderation-latest\ntext-embedding-3-large\ntext-embedding-3-small\ntext-embedding-ada-002\ntts-1\ntts-1-1106\ntts-1-hd\ntts-1-hd-1106\nwhisper-1\n-----\n\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m Deepseek models:\u001b[22m\u001b[39m\n\u001b[35m\u001b[1m\u001b[22m\u001b[39m\ndeepseek-chat\ndeepseek-reasoner\n-----\n", "ui:title": "Model" }, "router": { diff --git a/packages/kbot/src/zod_types.ts b/packages/kbot/src/zod_types.ts index 39441061..66d14760 100644 --- a/packages/kbot/src/zod_types.ts +++ b/packages/kbot/src/zod_types.ts @@ -39,6 +39,8 @@ export interface IKBotOptions { aion-labs/aion-1.0-mini | paid aion-labs/aion-rp-llama-3.1-8b | paid alfredpros/codellama-7b-instruct-solidity | paid + allenai/molmo-7b-d | paid + allenai/olmo-2-0325-32b-instruct | paid amazon/nova-lite-v1 | paid amazon/nova-micro-v1 | paid amazon/nova-pro-v1 | paid @@ -64,6 +66,7 @@ export interface IKBotOptions { baidu/ernie-4.5-300b-a47b | paid baidu/ernie-4.5-vl-28b-a3b | paid baidu/ernie-4.5-vl-424b-a47b | paid + bytedance/seed-oss-36b-instruct | paid bytedance/ui-tars-1.5-7b | paid deepcogito/cogito-v2-preview-llama-109b-moe | paid cohere/command | paid @@ -113,7 +116,6 @@ export interface IKBotOptions { google/gemini-2.5-flash-lite | paid google/gemini-2.5-flash-lite-preview-06-17 | paid google/gemini-2.5-pro | paid - google/gemini-2.5-pro-exp-03-25 | paid google/gemini-2.5-pro-preview-05-06 | paid google/gemini-2.5-pro-preview | paid google/gemma-2-27b-it | paid @@ -130,7 +132,6 @@ export interface IKBotOptions { google/gemma-3n-e4b-it:free | free inception/mercury | paid inception/mercury-coder | paid - infermatic/mn-inferor-12b | paid inflection/inflection-3-pi | paid inflection/inflection-3-productivity | paid liquid/lfm-3b | paid @@ -139,6 +140,7 @@ export interface IKBotOptions { anthracite-org/magnum-v2-72b | paid anthracite-org/magnum-v4-72b | paid mancer/weaver | paid + meituan/longcat-flash-chat | paid meta-llama/llama-3-70b-instruct | paid meta-llama/llama-3-8b-instruct | paid meta-llama/llama-3.1-405b | paid @@ -210,6 +212,7 @@ export interface IKBotOptions { moonshotai/kimi-dev-72b:free | free moonshotai/kimi-k2 | paid moonshotai/kimi-k2:free | free + moonshotai/kimi-k2-0905 | paid moonshotai/kimi-vl-a3b-thinking | paid moonshotai/kimi-vl-a3b-thinking:free | free morph/morph-v3-fast | paid @@ -228,7 +231,8 @@ export interface IKBotOptions { nvidia/llama-3.1-nemotron-70b-instruct | paid nvidia/llama-3.1-nemotron-ultra-253b-v1 | paid nvidia/llama-3.1-nemotron-ultra-253b-v1:free | free - nvidia/llama-3.3-nemotron-super-49b-v1 | paid + nvidia/nemotron-nano-9b-v2 | paid + nvidia/nemotron-nano-9b-v2:free | free openai/chatgpt-4o-latest | paid openai/codex-mini | paid openai/gpt-3.5-turbo | paid @@ -277,7 +281,8 @@ export interface IKBotOptions { perplexity/sonar-pro | paid perplexity/sonar-reasoning | paid perplexity/sonar-reasoning-pro | paid - pygmalionai/mythalion-13b | paid + qwen/qwen-plus-2025-07-28 | paid + qwen/qwen-plus-2025-07-28:thinking | paid qwen/qwen-vl-max | paid qwen/qwen-vl-plus | paid qwen/qwen-max | paid @@ -305,6 +310,9 @@ export interface IKBotOptions { qwen/qwen3-coder-30b-a3b-instruct | paid qwen/qwen3-coder | paid qwen/qwen3-coder:free | free + qwen/qwen3-max | paid + qwen/qwen3-next-80b-a3b-instruct | paid + qwen/qwen3-next-80b-a3b-thinking | paid qwen/qwq-32b | paid qwen/qwq-32b:free | free qwen/qwq-32b-preview | paid @@ -321,7 +329,10 @@ export interface IKBotOptions { sao10k/l3.3-euryale-70b | paid shisa-ai/shisa-v2-llama3.3-70b | paid shisa-ai/shisa-v2-llama3.3-70b:free | free + openrouter/sonoma-dusk-alpha | paid + openrouter/sonoma-sky-alpha | paid raifle/sorcererlm-8x22b | paid + stepfun-ai/step3 | paid switchpoint/router | paid tencent/hunyuan-a13b-instruct | paid tencent/hunyuan-a13b-instruct:free | free @@ -346,7 +357,6 @@ export interface IKBotOptions { x-ai/grok-3-mini-beta | paid x-ai/grok-4 | paid x-ai/grok-code-fast-1 | paid - x-ai/grok-vision-beta | paid z-ai/glm-4-32b | paid z-ai/glm-4.5 | paid z-ai/glm-4.5-air | paid diff --git a/packages/kbot/webpack.config.js b/packages/kbot/webpack.config.js index a4d891ba..22a88715 100644 --- a/packages/kbot/webpack.config.js +++ b/packages/kbot/webpack.config.js @@ -27,7 +27,7 @@ export default { }, externals: { 'typescript': 'commonjs typescript', - puppeteer: "require('puppeteer')", + // puppeteer: "require('puppeteer')", "node-emoji" : "require('node-emoji')" } }; \ No newline at end of file