html-react-parser 0.8.0 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,296 +1,1661 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("react"));
4
- else if(typeof define === 'function' && define.amd)
5
- define(["react"], factory);
6
- else if(typeof exports === 'object')
7
- exports["HTMLReactParser"] = factory(require("react"));
8
- else
9
- root["HTMLReactParser"] = factory(root["React"]);
10
- })(window, function(__WEBPACK_EXTERNAL_MODULE_react__) {
11
- return /******/ (function(modules) { // webpackBootstrap
12
- /******/ // The module cache
13
- /******/ var installedModules = {};
14
- /******/
15
- /******/ // The require function
16
- /******/ function __webpack_require__(moduleId) {
17
- /******/
18
- /******/ // Check if module is in cache
19
- /******/ if(installedModules[moduleId]) {
20
- /******/ return installedModules[moduleId].exports;
21
- /******/ }
22
- /******/ // Create a new module (and put it into the cache)
23
- /******/ var module = installedModules[moduleId] = {
24
- /******/ i: moduleId,
25
- /******/ l: false,
26
- /******/ exports: {}
27
- /******/ };
28
- /******/
29
- /******/ // Execute the module function
30
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
- /******/
32
- /******/ // Flag the module as loaded
33
- /******/ module.l = true;
34
- /******/
35
- /******/ // Return the exports of the module
36
- /******/ return module.exports;
37
- /******/ }
38
- /******/
39
- /******/
40
- /******/ // expose the modules object (__webpack_modules__)
41
- /******/ __webpack_require__.m = modules;
42
- /******/
43
- /******/ // expose the module cache
44
- /******/ __webpack_require__.c = installedModules;
45
- /******/
46
- /******/ // define getter function for harmony exports
47
- /******/ __webpack_require__.d = function(exports, name, getter) {
48
- /******/ if(!__webpack_require__.o(exports, name)) {
49
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50
- /******/ }
51
- /******/ };
52
- /******/
53
- /******/ // define __esModule on exports
54
- /******/ __webpack_require__.r = function(exports) {
55
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57
- /******/ }
58
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
59
- /******/ };
60
- /******/
61
- /******/ // create a fake namespace object
62
- /******/ // mode & 1: value is a module id, require it
63
- /******/ // mode & 2: merge all properties of value into the ns
64
- /******/ // mode & 4: return value when already ns object
65
- /******/ // mode & 8|1: behave like require
66
- /******/ __webpack_require__.t = function(value, mode) {
67
- /******/ if(mode & 1) value = __webpack_require__(value);
68
- /******/ if(mode & 8) return value;
69
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70
- /******/ var ns = Object.create(null);
71
- /******/ __webpack_require__.r(ns);
72
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74
- /******/ return ns;
75
- /******/ };
76
- /******/
77
- /******/ // getDefaultExport function for compatibility with non-harmony modules
78
- /******/ __webpack_require__.n = function(module) {
79
- /******/ var getter = module && module.__esModule ?
80
- /******/ function getDefault() { return module['default']; } :
81
- /******/ function getModuleExports() { return module; };
82
- /******/ __webpack_require__.d(getter, 'a', getter);
83
- /******/ return getter;
84
- /******/ };
85
- /******/
86
- /******/ // Object.prototype.hasOwnProperty.call
87
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88
- /******/
89
- /******/ // __webpack_public_path__
90
- /******/ __webpack_require__.p = "";
91
- /******/
92
- /******/
93
- /******/ // Load entry module and return exports
94
- /******/ return __webpack_require__(__webpack_require__.s = "./index.js");
95
- /******/ })
96
- /************************************************************************/
97
- /******/ ({
98
-
99
- /***/ "./index.js":
100
- /*!******************!*\
101
- !*** ./index.js ***!
102
- \******************/
103
- /*! no static exports found */
104
- /***/ (function(module, exports, __webpack_require__) {
105
-
106
- eval("var domToReact = __webpack_require__(/*! ./lib/dom-to-react */ \"./lib/dom-to-react.js\");\nvar htmlToDOM = __webpack_require__(/*! html-dom-parser */ \"./node_modules/html-dom-parser/lib/html-to-dom-client.js\");\n\n// decode HTML entities by default for `htmlparser2`\nvar domParserOptions = { decodeEntities: true, lowerCaseAttributeNames: false };\n\n/**\n * Convert HTML string to React elements.\n *\n * @param {String} html - The HTML string.\n * @param {Object} [options] - The additional options.\n * @param {Function} [options.replace] - The replace method.\n * @return {ReactElement|Array}\n */\nfunction HTMLReactParser(html, options) {\n if (typeof html !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n return domToReact(htmlToDOM(html, domParserOptions), options);\n}\n\n/**\n * Export HTML to React parser.\n */\nmodule.exports = HTMLReactParser;\n\nmodule.exports.domToReact = domToReact;\nmodule.exports.htmlToDOM = htmlToDOM;\n\n\n//# sourceURL=webpack://HTMLReactParser/./index.js?");
107
-
108
- /***/ }),
109
-
110
- /***/ "./lib/attributes-to-props.js":
111
- /*!************************************!*\
112
- !*** ./lib/attributes-to-props.js ***!
113
- \************************************/
114
- /*! no static exports found */
115
- /***/ (function(module, exports, __webpack_require__) {
116
-
117
- eval("var DOMProperty = __webpack_require__(/*! react-dom-core/lib/DOMProperty */ \"./node_modules/react-dom-core/lib/DOMProperty.js\");\nvar propertyConfig = __webpack_require__(/*! ./property-config */ \"./lib/property-config.js\");\nvar styleToObject = __webpack_require__(/*! style-to-object */ \"./node_modules/style-to-object/index.js\");\nvar utilities = __webpack_require__(/*! ./utilities */ \"./lib/utilities.js\");\n\nvar config = propertyConfig.config;\nvar isCustomAttribute = propertyConfig.HTMLDOMPropertyConfig.isCustomAttribute;\nDOMProperty.injection.injectDOMPropertyConfig(\n propertyConfig.HTMLDOMPropertyConfig\n);\n\n/**\n * Makes attributes compatible with React props.\n *\n * @param {Object} [attributes={}] - The attributes.\n * @return {Object} - The props.\n */\nfunction attributesToProps(attributes) {\n attributes = attributes || {};\n var props = {};\n var propertyName;\n var propertyValue;\n var reactProperty;\n\n for (propertyName in attributes) {\n propertyValue = attributes[propertyName];\n\n // custom attributes (`data-` and `aria-`)\n if (isCustomAttribute(propertyName)) {\n props[propertyName] = propertyValue;\n continue;\n }\n\n // make HTML DOM attribute/property consistent with React attribute/property\n reactProperty = config.html[propertyName.toLowerCase()];\n if (reactProperty) {\n if (\n Object.prototype.hasOwnProperty.call(\n DOMProperty.properties,\n reactProperty\n ) &&\n DOMProperty.properties[reactProperty].hasBooleanValue\n ) {\n props[reactProperty] = true;\n } else {\n props[reactProperty] = propertyValue;\n }\n continue;\n }\n\n // make SVG DOM attribute/property consistent with React attribute/property\n reactProperty = config.svg[propertyName];\n if (reactProperty) {\n props[reactProperty] = propertyValue;\n } else if (utilities.PRESERVE_CUSTOM_ATTRIBUTES) {\n props[propertyName] = propertyValue;\n }\n }\n\n // convert inline style to object\n if (attributes.style != null) {\n props.style = cssToJs(attributes.style);\n }\n return props;\n}\n\n/**\n * Converts CSS style string to JS style object.\n *\n * @param {String} style - The CSS style.\n * @return {Object} - The JS style object.\n */\nfunction cssToJs(style) {\n if (typeof style !== 'string') {\n throw new TypeError('First argument must be a string.');\n }\n var styleObj = {};\n\n styleToObject(style, function(propName, propValue) {\n // Check if it's not a comment node\n if (propName && propValue) {\n styleObj[utilities.camelCase(propName)] = propValue;\n }\n });\n return styleObj;\n}\n\nmodule.exports = attributesToProps;\n\n\n//# sourceURL=webpack://HTMLReactParser/./lib/attributes-to-props.js?");
118
-
119
- /***/ }),
120
-
121
- /***/ "./lib/dom-to-react.js":
122
- /*!*****************************!*\
123
- !*** ./lib/dom-to-react.js ***!
124
- \*****************************/
125
- /*! no static exports found */
126
- /***/ (function(module, exports, __webpack_require__) {
127
-
128
- eval("var React = __webpack_require__(/*! react */ \"react\");\nvar attributesToProps = __webpack_require__(/*! ./attributes-to-props */ \"./lib/attributes-to-props.js\");\nvar utilities = __webpack_require__(/*! ./utilities */ \"./lib/utilities.js\");\n\nvar cloneElement = React.cloneElement;\nvar createElement = React.createElement;\nvar isValidElement = React.isValidElement;\n\n/**\n * Converts DOM nodes to React elements.\n *\n * @param {Array} nodes - The DOM nodes.\n * @param {Object} [options] - The additional options.\n * @param {Function} [options.replace] - The replace method.\n * @return {ReactElement|Array}\n */\nfunction domToReact(nodes, options) {\n options = options || {};\n var result = [];\n var node;\n var hasReplace = typeof options.replace === 'function';\n var replaceElement;\n var props;\n var children;\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n node = nodes[i];\n\n // replace with custom React element (if present)\n if (hasReplace) {\n replaceElement = options.replace(node);\n\n if (isValidElement(replaceElement)) {\n // specify a \"key\" prop if element has siblings\n // https://fb.me/react-warning-keys\n if (len > 1) {\n replaceElement = cloneElement(replaceElement, {\n key: replaceElement.key || i\n });\n }\n result.push(replaceElement);\n continue;\n }\n }\n\n if (node.type === 'text') {\n result.push(node.data);\n continue;\n }\n\n props = node.attribs;\n if (!shouldPassAttributesUnaltered(node)) {\n // update values\n props = attributesToProps(node.attribs);\n }\n\n children = null;\n\n // node type for <style> is \"style\"\n // skip node type \"script\" as react-dom does not render the contents\n if (node.type === 'style') {\n // prevent text in <style> from being escaped\n // https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml\n if (node.children[0]) {\n props.dangerouslySetInnerHTML = {\n __html: node.children[0].data\n };\n }\n } else if (node.type === 'tag') {\n // setting textarea value in children is an antipattern in React\n // https://reactjs.org/docs/forms.html#the-textarea-tag\n if (node.name === 'textarea' && node.children[0]) {\n props.defaultValue = node.children[0].data;\n\n // continue recursion of creating React elements (if applicable)\n } else if (node.children && node.children.length) {\n children = domToReact(node.children, options);\n }\n\n // skip all other cases (e.g., comment)\n } else {\n continue;\n }\n\n // specify a \"key\" prop if element has siblings\n // https://fb.me/react-warning-keys\n if (len > 1) {\n props.key = i;\n }\n\n result.push(createElement(node.name, props, children));\n }\n\n return result.length === 1 ? result[0] : result;\n}\n\nfunction shouldPassAttributesUnaltered(node) {\n return (\n utilities.PRESERVE_CUSTOM_ATTRIBUTES &&\n node.type === 'tag' &&\n utilities.isCustomComponent(node.name, node.attribs)\n );\n}\n\nmodule.exports = domToReact;\n\n\n//# sourceURL=webpack://HTMLReactParser/./lib/dom-to-react.js?");
129
-
130
- /***/ }),
131
-
132
- /***/ "./lib/property-config.js":
133
- /*!********************************!*\
134
- !*** ./lib/property-config.js ***!
135
- \********************************/
136
- /*! no static exports found */
137
- /***/ (function(module, exports, __webpack_require__) {
138
-
139
- eval("var HTMLDOMPropertyConfig = __webpack_require__(/*! react-dom-core/lib/HTMLDOMPropertyConfig */ \"./node_modules/react-dom-core/lib/HTMLDOMPropertyConfig.js\");\nvar SVGDOMPropertyConfig = __webpack_require__(/*! react-dom-core/lib/SVGDOMPropertyConfig */ \"./node_modules/react-dom-core/lib/SVGDOMPropertyConfig.js\");\nvar utilities = __webpack_require__(/*! ./utilities */ \"./lib/utilities.js\");\n\nvar config = {\n html: {},\n svg: {}\n};\n\nvar propertyName;\n\n/**\n * HTML DOM property config.\n *\n * https://github.com/facebook/react/blob/15-stable/src/renderers/dom/shared/HTMLDOMPropertyConfig.js\n */\n\n// first map out the HTML attribute names\n// e.g., { className: 'class' } => { 'class': 'className' }\nconfig.html = utilities.invertObject(HTMLDOMPropertyConfig.DOMAttributeNames);\n\n// then map out the rest of the HTML properties\n// e.g., { readOnly: 0 } => { readonly: 'readOnly' }\nfor (propertyName in HTMLDOMPropertyConfig.Properties) {\n // lowercase to make matching property names easier\n config.html[propertyName.toLowerCase()] = propertyName;\n}\n\n/**\n * SVG DOM property config.\n *\n * https://github.com/facebook/react/blob/15-stable/src/renderers/dom/shared/SVGDOMPropertyConfig.js\n */\n\n// first map out the SVG attribute names\n// e.g., { fontSize: 'font-size' } => { 'font-size': 'fontSize' }\nconfig.svg = utilities.invertObject(SVGDOMPropertyConfig.DOMAttributeNames);\n\n// then map out the rest of the SVG properties\n// e.g., { fillRule: 0 } => { fillRule: 'fillRule' }\nfor (propertyName in SVGDOMPropertyConfig.Properties) {\n // do not lowercase as some svg properties are camel cased\n config.html[propertyName] = propertyName;\n}\n\nmodule.exports = {\n config: config,\n HTMLDOMPropertyConfig: HTMLDOMPropertyConfig,\n SVGDOMPropertyConfig: SVGDOMPropertyConfig\n};\n\n\n//# sourceURL=webpack://HTMLReactParser/./lib/property-config.js?");
140
-
141
- /***/ }),
142
-
143
- /***/ "./lib/utilities.js":
144
- /*!**************************!*\
145
- !*** ./lib/utilities.js ***!
146
- \**************************/
147
- /*! no static exports found */
148
- /***/ (function(module, exports, __webpack_require__) {
149
-
150
- eval("var React = __webpack_require__(/*! react */ \"react\");\nvar hyphenPatternRegex = /-([a-z])/g;\nvar CUSTOM_PROPERTY_OR_NO_HYPHEN_REGEX = /^--[a-zA-Z0-9-]+$|^[^-]+$/;\n\n/**\n * Converts a string to camelCase.\n *\n * @param {String} string - The string.\n * @return {String}\n */\nfunction camelCase(string) {\n if (typeof string !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n // custom property or no hyphen found\n if (CUSTOM_PROPERTY_OR_NO_HYPHEN_REGEX.test(string)) {\n return string;\n }\n\n // convert to camelCase\n return string\n .toLowerCase()\n .replace(hyphenPatternRegex, function(_, character) {\n return character.toUpperCase();\n });\n}\n\n/**\n * Swap key with value in an object.\n *\n * @param {Object} obj - The object.\n * @param {Function} [override] - The override method.\n * @return {Object} - The inverted object.\n */\nfunction invertObject(obj, override) {\n if (!obj || typeof obj !== 'object') {\n throw new TypeError('First argument must be an object');\n }\n\n var key;\n var value;\n var isOverridePresent = typeof override === 'function';\n var overrides = {};\n var result = {};\n\n for (key in obj) {\n value = obj[key];\n\n if (isOverridePresent) {\n overrides = override(key, value);\n if (overrides && overrides.length === 2) {\n result[overrides[0]] = overrides[1];\n continue;\n }\n }\n\n if (typeof value === 'string') {\n result[value] = key;\n }\n }\n\n return result;\n}\n\n/**\n * Check if a given tag is a custom component.\n *\n * @see {@link https://github.com/facebook/react/blob/v16.6.3/packages/react-dom/src/shared/isCustomComponent.js}\n *\n * @param {string} tagName - The name of the html tag.\n * @param {Object} props - The props being passed to the element.\n * @return {boolean}\n */\nfunction isCustomComponent(tagName, props) {\n if (tagName.indexOf('-') === -1) {\n return props && typeof props.is === 'string';\n }\n\n switch (tagName) {\n // These are reserved SVG and MathML elements.\n // We don't mind this whitelist too much because we expect it to never grow.\n // The alternative is to track the namespace in a few places which is convoluted.\n // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts\n case 'annotation-xml':\n case 'color-profile':\n case 'font-face':\n case 'font-face-src':\n case 'font-face-uri':\n case 'font-face-format':\n case 'font-face-name':\n case 'missing-glyph':\n return false;\n default:\n return true;\n }\n}\n\n/**\n * @constant {Boolean}\n * @see {@link https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html}\n */\nvar PRESERVE_CUSTOM_ATTRIBUTES = React.version.split('.')[0] >= 16;\n\nmodule.exports = {\n PRESERVE_CUSTOM_ATTRIBUTES: PRESERVE_CUSTOM_ATTRIBUTES,\n camelCase: camelCase,\n invertObject: invertObject,\n isCustomComponent: isCustomComponent\n};\n\n\n//# sourceURL=webpack://HTMLReactParser/./lib/utilities.js?");
151
-
152
- /***/ }),
153
-
154
- /***/ "./node_modules/fbjs/lib/invariant.js":
155
- /*!********************************************!*\
156
- !*** ./node_modules/fbjs/lib/invariant.js ***!
157
- \********************************************/
158
- /*! no static exports found */
159
- /***/ (function(module, exports, __webpack_require__) {
160
-
161
- "use strict";
162
- eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\nvar validateFormat = true ? function (format) {} : undefined;\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments to provide\n * information about what broke and what you were expecting.\n *\n * The invariant message will be stripped in production, but the invariant will\n * remain to ensure logic does not differ in production.\n */\n\nfunction invariant(condition, format) {\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n validateFormat(format);\n\n if (!condition) {\n var error;\n\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return String(args[argIndex++]);\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // Skip invariant's own stack frame.\n\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n//# sourceURL=webpack://HTMLReactParser/./node_modules/fbjs/lib/invariant.js?");
163
-
164
- /***/ }),
165
-
166
- /***/ "./node_modules/html-dom-parser/lib/constants.js":
167
- /*!*******************************************************!*\
168
- !*** ./node_modules/html-dom-parser/lib/constants.js ***!
169
- \*******************************************************/
170
- /*! no static exports found */
171
- /***/ (function(module, exports, __webpack_require__) {
172
-
173
- "use strict";
174
- eval("\n\n/**\n * SVG elements, unlike HTML elements, are case-sensitive.\n *\n * @see {@link https://developer.mozilla.org/docs/Web/SVG/Element#SVG_elements_A_to_Z}\n */\nvar CASE_SENSITIVE_TAG_NAMES = [\n 'animateMotion',\n 'animateTransform',\n 'clipPath',\n 'feBlend',\n 'feColorMatrix',\n 'feComponentTransfer',\n 'feComposite',\n 'feConvolveMatrix',\n 'feDiffuseLighting',\n 'feDisplacementMap',\n 'feDropShadow',\n 'feFlood',\n 'feFuncA',\n 'feFuncB',\n 'feFuncG',\n 'feFuncR',\n 'feGaussainBlur',\n 'feImage',\n 'feMerge',\n 'feMergeNode',\n 'feMorphology',\n 'feOffset',\n 'fePointLight',\n 'feSpecularLighting',\n 'feSpotLight',\n 'feTile',\n 'feTurbulence',\n 'foreignObject',\n 'linearGradient',\n 'radialGradient',\n 'textPath'\n];\n\nmodule.exports = {\n CASE_SENSITIVE_TAG_NAMES: CASE_SENSITIVE_TAG_NAMES\n};\n\n\n//# sourceURL=webpack://HTMLReactParser/./node_modules/html-dom-parser/lib/constants.js?");
175
-
176
- /***/ }),
177
-
178
- /***/ "./node_modules/html-dom-parser/lib/domparser.js":
179
- /*!*******************************************************!*\
180
- !*** ./node_modules/html-dom-parser/lib/domparser.js ***!
181
- \*******************************************************/
182
- /*! no static exports found */
183
- /***/ (function(module, exports, __webpack_require__) {
184
-
185
- "use strict";
186
- eval("\n\n/**\n * Module dependencies.\n */\nvar utilities = __webpack_require__(/*! ./utilities */ \"./node_modules/html-dom-parser/lib/utilities.js\");\nvar detectIE = utilities.isIE;\n\n/**\n * Constants.\n */\nvar HTML_TAG_NAME = 'html';\nvar BODY_TAG_NAME = 'body';\nvar HEAD_TAG_NAME = 'head';\nvar FIRST_TAG_REGEX = /<([a-zA-Z]+[0-9]?)/; // e.g., <h1>\nvar HEAD_REGEX = /<\\/head>/i;\nvar BODY_REGEX = /<\\/body>/i;\n// http://www.w3.org/TR/html/syntax.html#void-elements\nvar VOID_ELEMENTS_REGEX = /<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\\/?>/gi;\n\n// browser support\nvar isIE = detectIE();\nvar isIE9 = detectIE(9);\n\n/**\n * DOMParser (performance: slow).\n *\n * https://developer.mozilla.org/docs/Web/API/DOMParser#Parsing_an_SVG_or_HTML_document\n */\nvar parseFromString;\nif (typeof window.DOMParser === 'function') {\n var domParser = new window.DOMParser();\n // IE9 does not support 'text/html' MIME type\n // https://msdn.microsoft.com/en-us/library/ff975278(v=vs.85).aspx\n var MIME_TYPE = isIE9 ? 'text/xml' : 'text/html';\n\n /**\n * Creates an HTML document using `DOMParser.parseFromString`.\n *\n * @param {String} html - The HTML string.\n * @param {String} [tagName] - The element to render the HTML (with 'body' as fallback).\n * @return {HTMLDocument}\n */\n parseFromString = function domStringParser(html, tagName) {\n if (tagName) {\n html = ['<', tagName, '>', html, '</', tagName, '>'].join('');\n }\n // because IE9 only supports MIME type 'text/xml', void elements need to be self-closed\n if (isIE9) {\n html = html.replace(VOID_ELEMENTS_REGEX, '<$1$2$3/>');\n }\n return domParser.parseFromString(html, MIME_TYPE);\n };\n}\n\n/**\n * DOMImplementation (performance: fair).\n *\n * https://developer.mozilla.org/docs/Web/API/DOMImplementation/createHTMLDocument\n */\nvar parseFromDocument;\nif (typeof document.implementation === 'object') {\n // title parameter is required in IE\n // https://msdn.microsoft.com/en-us/library/ff975457(v=vs.85).aspx\n var doc = document.implementation.createHTMLDocument(isIE ? 'HTML_DOM_PARSER_TITLE' : undefined);\n\n /**\n * Use HTML document created by `document.implementation.createHTMLDocument`.\n *\n * @param {String} html - The HTML string.\n * @param {String} [tagName] - The element to render the HTML (with 'body' as fallback).\n * @return {HTMLDocument}\n */\n parseFromDocument = function createHTMLDocument(html, tagName) {\n if (tagName) {\n doc.documentElement.getElementsByTagName(tagName)[0].innerHTML = html;\n return doc;\n }\n\n try {\n doc.documentElement.innerHTML = html;\n return doc;\n // fallback when certain elements in `documentElement` are read-only (IE9)\n } catch (err) {\n if (parseFromString) return parseFromString(html);\n }\n };\n}\n\n/**\n * Template (performance: fast).\n *\n * https://developer.mozilla.org/docs/Web/HTML/Element/template\n */\nvar parseFromTemplate;\nvar template = document.createElement('template');\nif (template.content) {\n\n /**\n * Uses a template element (content fragment) to parse HTML.\n *\n * @param {String} html - The HTML string.\n * @return {NodeList}\n */\n parseFromTemplate = function templateParser(html) {\n template.innerHTML = html;\n return template.content.childNodes;\n };\n}\n\n/** Fallback document parser. */\nvar parseWithFallback = parseFromDocument || parseFromString;\n\n/**\n * Parses HTML string to DOM nodes.\n *\n * @param {String} html - The HTML string.\n * @param {String} [tagName] - The tag name.\n * @return {NodeList|Array}\n */\nmodule.exports = function domparser(html) {\n // try to match first tag\n var tagName;\n var match = html.match(FIRST_TAG_REGEX);\n if (match && match[1]) {\n tagName = match[1].toLowerCase();\n }\n\n var doc;\n var element;\n var elements;\n\n switch (tagName) {\n case HTML_TAG_NAME:\n if (parseFromString) {\n doc = parseFromString(html);\n\n // the created document may come with filler head/body elements,\n // so ake sure to remove them if they don't actually exist\n if (!HEAD_REGEX.test(html)) {\n element = doc.getElementsByTagName(HEAD_TAG_NAME)[0];\n if (element) element.parentNode.removeChild(element);\n }\n if (!BODY_REGEX.test(html)) {\n element = doc.getElementsByTagName(BODY_TAG_NAME)[0];\n if (element) element.parentNode.removeChild(element);\n }\n\n return doc.getElementsByTagName(HTML_TAG_NAME);\n }\n break;\n\n case HEAD_TAG_NAME:\n if (parseWithFallback) {\n elements = parseWithFallback(html).getElementsByTagName(HEAD_TAG_NAME);\n\n // account for possibility of sibling\n if (BODY_REGEX.test(html)) {\n return elements[0].parentNode.childNodes;\n }\n return elements;\n }\n break;\n\n case BODY_TAG_NAME:\n if (parseWithFallback) {\n elements = parseWithFallback(html).getElementsByTagName(BODY_TAG_NAME);\n\n // account for possibility of sibling (return both body and head)\n if (HEAD_REGEX.test(html)) {\n return elements[0].parentNode.childNodes;\n }\n return elements;\n }\n break;\n\n // low-level tag or text\n default:\n if (parseFromTemplate) return parseFromTemplate(html);\n if (parseWithFallback) {\n return parseWithFallback(html, BODY_TAG_NAME).getElementsByTagName(BODY_TAG_NAME)[0].childNodes;\n }\n break;\n }\n\n return [];\n};\n\n\n//# sourceURL=webpack://HTMLReactParser/./node_modules/html-dom-parser/lib/domparser.js?");
187
-
188
- /***/ }),
189
-
190
- /***/ "./node_modules/html-dom-parser/lib/html-to-dom-client.js":
191
- /*!****************************************************************!*\
192
- !*** ./node_modules/html-dom-parser/lib/html-to-dom-client.js ***!
193
- \****************************************************************/
194
- /*! no static exports found */
195
- /***/ (function(module, exports, __webpack_require__) {
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :
3
+ typeof define === 'function' && define.amd ? define(['react'], factory) :
4
+ (global = global || self, global.HTMLReactParser = factory(global.React));
5
+ }(this, function (react) { 'use strict';
196
6
 
197
- "use strict";
198
- eval("\n\n/**\n * Module dependencies.\n */\nvar domparser = __webpack_require__(/*! ./domparser */ \"./node_modules/html-dom-parser/lib/domparser.js\");\nvar utilities = __webpack_require__(/*! ./utilities */ \"./node_modules/html-dom-parser/lib/utilities.js\");\nvar formatDOM = utilities.formatDOM;\nvar isIE9 = utilities.isIE(9);\n\n/**\n * Constants.\n */\nvar DIRECTIVE_REGEX = /<(![a-zA-Z\\s]+)>/; // e.g., <!doctype html>\n\n/**\n * Parses HTML and reformats DOM nodes output.\n *\n * @param {String} html - The HTML string.\n * @return {Array} - The formatted DOM nodes.\n */\nmodule.exports = function parseDOM(html) {\n if (typeof html !== 'string') {\n throw new TypeError('First argument must be a string.');\n }\n if (!html) return [];\n\n // match directive\n var match = html.match(DIRECTIVE_REGEX);\n var directive;\n if (match && match[1]) {\n directive = match[1];\n\n // remove directive in IE9 because DOMParser uses\n // MIME type 'text/xml' instead of 'text/html'\n if (isIE9) {\n html = html.replace(match[0], '');\n }\n }\n\n return formatDOM(domparser(html), null, directive);\n};\n\n\n//# sourceURL=webpack://HTMLReactParser/./node_modules/html-dom-parser/lib/html-to-dom-client.js?");
7
+ react = react && react.hasOwnProperty('default') ? react['default'] : react;
199
8
 
200
- /***/ }),
9
+ var HTMLDOMPropertyConfig = {
10
+ Properties: {
11
+ autoFocus: 4,
12
+ accept: 0,
13
+ acceptCharset: 0,
14
+ accessKey: 0,
15
+ action: 0,
16
+ allowFullScreen: 4,
17
+ allowTransparency: 0,
18
+ alt: 0,
19
+ as: 0,
20
+ async: 4,
21
+ autoComplete: 0,
22
+ autoPlay: 4,
23
+ capture: 4,
24
+ cellPadding: 0,
25
+ cellSpacing: 0,
26
+ charSet: 0,
27
+ challenge: 0,
28
+ checked: 5,
29
+ cite: 0,
30
+ classID: 0,
31
+ className: 0,
32
+ cols: 24,
33
+ colSpan: 0,
34
+ content: 0,
35
+ contentEditable: 0,
36
+ contextMenu: 0,
37
+ controls: 4,
38
+ controlsList: 0,
39
+ coords: 0,
40
+ crossOrigin: 0,
41
+ data: 0,
42
+ dateTime: 0,
43
+ default: 4,
44
+ defer: 4,
45
+ dir: 0,
46
+ disabled: 4,
47
+ download: 32,
48
+ draggable: 0,
49
+ encType: 0,
50
+ form: 0,
51
+ formAction: 0,
52
+ formEncType: 0,
53
+ formMethod: 0,
54
+ formNoValidate: 4,
55
+ formTarget: 0,
56
+ frameBorder: 0,
57
+ headers: 0,
58
+ height: 0,
59
+ hidden: 4,
60
+ high: 0,
61
+ href: 0,
62
+ hrefLang: 0,
63
+ htmlFor: 0,
64
+ httpEquiv: 0,
65
+ icon: 0,
66
+ id: 0,
67
+ inputMode: 0,
68
+ integrity: 0,
69
+ is: 0,
70
+ keyParams: 0,
71
+ keyType: 0,
72
+ kind: 0,
73
+ label: 0,
74
+ lang: 0,
75
+ list: 0,
76
+ loop: 4,
77
+ low: 0,
78
+ manifest: 0,
79
+ marginHeight: 0,
80
+ marginWidth: 0,
81
+ max: 0,
82
+ maxLength: 0,
83
+ media: 0,
84
+ mediaGroup: 0,
85
+ method: 0,
86
+ min: 0,
87
+ minLength: 0,
88
+ multiple: 5,
89
+ muted: 5,
90
+ name: 0,
91
+ nonce: 0,
92
+ noValidate: 4,
93
+ open: 4,
94
+ optimum: 0,
95
+ pattern: 0,
96
+ placeholder: 0,
97
+ playsInline: 4,
98
+ poster: 0,
99
+ preload: 0,
100
+ profile: 0,
101
+ radioGroup: 0,
102
+ readOnly: 4,
103
+ referrerPolicy: 0,
104
+ rel: 0,
105
+ required: 4,
106
+ reversed: 4,
107
+ role: 0,
108
+ rows: 24,
109
+ rowSpan: 8,
110
+ sandbox: 0,
111
+ scope: 0,
112
+ scoped: 4,
113
+ scrolling: 0,
114
+ seamless: 4,
115
+ selected: 5,
116
+ shape: 0,
117
+ size: 24,
118
+ sizes: 0,
119
+ span: 24,
120
+ spellCheck: 0,
121
+ src: 0,
122
+ srcDoc: 0,
123
+ srcLang: 0,
124
+ srcSet: 0,
125
+ start: 8,
126
+ step: 0,
127
+ style: 0,
128
+ summary: 0,
129
+ tabIndex: 0,
130
+ target: 0,
131
+ title: 0,
132
+ type: 0,
133
+ useMap: 0,
134
+ value: 0,
135
+ width: 0,
136
+ wmode: 0,
137
+ wrap: 0,
138
+ about: 0,
139
+ datatype: 0,
140
+ inlist: 0,
141
+ prefix: 0,
142
+ property: 0,
143
+ resource: 0,
144
+ typeof: 0,
145
+ vocab: 0,
146
+ autoCapitalize: 0,
147
+ autoCorrect: 0,
148
+ autoSave: 0,
149
+ color: 0,
150
+ itemProp: 0,
151
+ itemScope: 4,
152
+ itemType: 0,
153
+ itemID: 0,
154
+ itemRef: 0,
155
+ results: 0,
156
+ security: 0,
157
+ unselectable: 0
158
+ },
159
+ DOMAttributeNames: {
160
+ acceptCharset: 'accept-charset',
161
+ className: 'class',
162
+ htmlFor: 'for',
163
+ httpEquiv: 'http-equiv'
164
+ }
165
+ };
201
166
 
202
- /***/ "./node_modules/html-dom-parser/lib/utilities.js":
203
- /*!*******************************************************!*\
204
- !*** ./node_modules/html-dom-parser/lib/utilities.js ***!
205
- \*******************************************************/
206
- /*! no static exports found */
207
- /***/ (function(module, exports, __webpack_require__) {
167
+ var SVGDOMPropertyConfig = {
168
+ Properties: {
169
+ accentHeight: 0,
170
+ accumulate: 0,
171
+ additive: 0,
172
+ alignmentBaseline: 0,
173
+ allowReorder: 0,
174
+ alphabetic: 0,
175
+ amplitude: 0,
176
+ arabicForm: 0,
177
+ ascent: 0,
178
+ attributeName: 0,
179
+ attributeType: 0,
180
+ autoReverse: 0,
181
+ azimuth: 0,
182
+ baseFrequency: 0,
183
+ baseProfile: 0,
184
+ baselineShift: 0,
185
+ bbox: 0,
186
+ begin: 0,
187
+ bias: 0,
188
+ by: 0,
189
+ calcMode: 0,
190
+ capHeight: 0,
191
+ clip: 0,
192
+ clipPath: 0,
193
+ clipRule: 0,
194
+ clipPathUnits: 0,
195
+ colorInterpolation: 0,
196
+ colorInterpolationFilters: 0,
197
+ colorProfile: 0,
198
+ colorRendering: 0,
199
+ contentScriptType: 0,
200
+ contentStyleType: 0,
201
+ cursor: 0,
202
+ cx: 0,
203
+ cy: 0,
204
+ d: 0,
205
+ decelerate: 0,
206
+ descent: 0,
207
+ diffuseConstant: 0,
208
+ direction: 0,
209
+ display: 0,
210
+ divisor: 0,
211
+ dominantBaseline: 0,
212
+ dur: 0,
213
+ dx: 0,
214
+ dy: 0,
215
+ edgeMode: 0,
216
+ elevation: 0,
217
+ enableBackground: 0,
218
+ end: 0,
219
+ exponent: 0,
220
+ externalResourcesRequired: 0,
221
+ fill: 0,
222
+ fillOpacity: 0,
223
+ fillRule: 0,
224
+ filter: 0,
225
+ filterRes: 0,
226
+ filterUnits: 0,
227
+ floodColor: 0,
228
+ floodOpacity: 0,
229
+ focusable: 0,
230
+ fontFamily: 0,
231
+ fontSize: 0,
232
+ fontSizeAdjust: 0,
233
+ fontStretch: 0,
234
+ fontStyle: 0,
235
+ fontVariant: 0,
236
+ fontWeight: 0,
237
+ format: 0,
238
+ from: 0,
239
+ fx: 0,
240
+ fy: 0,
241
+ g1: 0,
242
+ g2: 0,
243
+ glyphName: 0,
244
+ glyphOrientationHorizontal: 0,
245
+ glyphOrientationVertical: 0,
246
+ glyphRef: 0,
247
+ gradientTransform: 0,
248
+ gradientUnits: 0,
249
+ hanging: 0,
250
+ horizAdvX: 0,
251
+ horizOriginX: 0,
252
+ ideographic: 0,
253
+ imageRendering: 0,
254
+ in: 0,
255
+ in2: 0,
256
+ intercept: 0,
257
+ k: 0,
258
+ k1: 0,
259
+ k2: 0,
260
+ k3: 0,
261
+ k4: 0,
262
+ kernelMatrix: 0,
263
+ kernelUnitLength: 0,
264
+ kerning: 0,
265
+ keyPoints: 0,
266
+ keySplines: 0,
267
+ keyTimes: 0,
268
+ lengthAdjust: 0,
269
+ letterSpacing: 0,
270
+ lightingColor: 0,
271
+ limitingConeAngle: 0,
272
+ local: 0,
273
+ markerEnd: 0,
274
+ markerMid: 0,
275
+ markerStart: 0,
276
+ markerHeight: 0,
277
+ markerUnits: 0,
278
+ markerWidth: 0,
279
+ mask: 0,
280
+ maskContentUnits: 0,
281
+ maskUnits: 0,
282
+ mathematical: 0,
283
+ mode: 0,
284
+ numOctaves: 0,
285
+ offset: 0,
286
+ opacity: 0,
287
+ operator: 0,
288
+ order: 0,
289
+ orient: 0,
290
+ orientation: 0,
291
+ origin: 0,
292
+ overflow: 0,
293
+ overlinePosition: 0,
294
+ overlineThickness: 0,
295
+ paintOrder: 0,
296
+ panose1: 0,
297
+ pathLength: 0,
298
+ patternContentUnits: 0,
299
+ patternTransform: 0,
300
+ patternUnits: 0,
301
+ pointerEvents: 0,
302
+ points: 0,
303
+ pointsAtX: 0,
304
+ pointsAtY: 0,
305
+ pointsAtZ: 0,
306
+ preserveAlpha: 0,
307
+ preserveAspectRatio: 0,
308
+ primitiveUnits: 0,
309
+ r: 0,
310
+ radius: 0,
311
+ refX: 0,
312
+ refY: 0,
313
+ renderingIntent: 0,
314
+ repeatCount: 0,
315
+ repeatDur: 0,
316
+ requiredExtensions: 0,
317
+ requiredFeatures: 0,
318
+ restart: 0,
319
+ result: 0,
320
+ rotate: 0,
321
+ rx: 0,
322
+ ry: 0,
323
+ scale: 0,
324
+ seed: 0,
325
+ shapeRendering: 0,
326
+ slope: 0,
327
+ spacing: 0,
328
+ specularConstant: 0,
329
+ specularExponent: 0,
330
+ speed: 0,
331
+ spreadMethod: 0,
332
+ startOffset: 0,
333
+ stdDeviation: 0,
334
+ stemh: 0,
335
+ stemv: 0,
336
+ stitchTiles: 0,
337
+ stopColor: 0,
338
+ stopOpacity: 0,
339
+ strikethroughPosition: 0,
340
+ strikethroughThickness: 0,
341
+ string: 0,
342
+ stroke: 0,
343
+ strokeDasharray: 0,
344
+ strokeDashoffset: 0,
345
+ strokeLinecap: 0,
346
+ strokeLinejoin: 0,
347
+ strokeMiterlimit: 0,
348
+ strokeOpacity: 0,
349
+ strokeWidth: 0,
350
+ surfaceScale: 0,
351
+ systemLanguage: 0,
352
+ tableValues: 0,
353
+ targetX: 0,
354
+ targetY: 0,
355
+ textAnchor: 0,
356
+ textDecoration: 0,
357
+ textRendering: 0,
358
+ textLength: 0,
359
+ to: 0,
360
+ transform: 0,
361
+ u1: 0,
362
+ u2: 0,
363
+ underlinePosition: 0,
364
+ underlineThickness: 0,
365
+ unicode: 0,
366
+ unicodeBidi: 0,
367
+ unicodeRange: 0,
368
+ unitsPerEm: 0,
369
+ vAlphabetic: 0,
370
+ vHanging: 0,
371
+ vIdeographic: 0,
372
+ vMathematical: 0,
373
+ values: 0,
374
+ vectorEffect: 0,
375
+ version: 0,
376
+ vertAdvY: 0,
377
+ vertOriginX: 0,
378
+ vertOriginY: 0,
379
+ viewBox: 0,
380
+ viewTarget: 0,
381
+ visibility: 0,
382
+ widths: 0,
383
+ wordSpacing: 0,
384
+ writingMode: 0,
385
+ x: 0,
386
+ xHeight: 0,
387
+ x1: 0,
388
+ x2: 0,
389
+ xChannelSelector: 0,
390
+ xlinkActuate: 0,
391
+ xlinkArcrole: 0,
392
+ xlinkHref: 0,
393
+ xlinkRole: 0,
394
+ xlinkShow: 0,
395
+ xlinkTitle: 0,
396
+ xlinkType: 0,
397
+ xmlBase: 0,
398
+ xmlns: 0,
399
+ xmlnsXlink: 0,
400
+ xmlLang: 0,
401
+ xmlSpace: 0,
402
+ y: 0,
403
+ y1: 0,
404
+ y2: 0,
405
+ yChannelSelector: 0,
406
+ z: 0,
407
+ zoomAndPan: 0
408
+ },
409
+ DOMAttributeNames: {
410
+ accentHeight: 'accent-height',
411
+ alignmentBaseline: 'alignment-baseline',
412
+ arabicForm: 'arabic-form',
413
+ baselineShift: 'baseline-shift',
414
+ capHeight: 'cap-height',
415
+ clipPath: 'clip-path',
416
+ clipRule: 'clip-rule',
417
+ colorInterpolation: 'color-interpolation',
418
+ colorInterpolationFilters: 'color-interpolation-filters',
419
+ colorProfile: 'color-profile',
420
+ colorRendering: 'color-rendering',
421
+ dominantBaseline: 'dominant-baseline',
422
+ enableBackground: 'enable-background',
423
+ fillOpacity: 'fill-opacity',
424
+ fillRule: 'fill-rule',
425
+ floodColor: 'flood-color',
426
+ floodOpacity: 'flood-opacity',
427
+ fontFamily: 'font-family',
428
+ fontSize: 'font-size',
429
+ fontSizeAdjust: 'font-size-adjust',
430
+ fontStretch: 'font-stretch',
431
+ fontStyle: 'font-style',
432
+ fontVariant: 'font-variant',
433
+ fontWeight: 'font-weight',
434
+ glyphName: 'glyph-name',
435
+ glyphOrientationHorizontal: 'glyph-orientation-horizontal',
436
+ glyphOrientationVertical: 'glyph-orientation-vertical',
437
+ horizAdvX: 'horiz-adv-x',
438
+ horizOriginX: 'horiz-origin-x',
439
+ imageRendering: 'image-rendering',
440
+ letterSpacing: 'letter-spacing',
441
+ lightingColor: 'lighting-color',
442
+ markerEnd: 'marker-end',
443
+ markerMid: 'marker-mid',
444
+ markerStart: 'marker-start',
445
+ overlinePosition: 'overline-position',
446
+ overlineThickness: 'overline-thickness',
447
+ paintOrder: 'paint-order',
448
+ panose1: 'panose-1',
449
+ pointerEvents: 'pointer-events',
450
+ renderingIntent: 'rendering-intent',
451
+ shapeRendering: 'shape-rendering',
452
+ stopColor: 'stop-color',
453
+ stopOpacity: 'stop-opacity',
454
+ strikethroughPosition: 'strikethrough-position',
455
+ strikethroughThickness: 'strikethrough-thickness',
456
+ strokeDasharray: 'stroke-dasharray',
457
+ strokeDashoffset: 'stroke-dashoffset',
458
+ strokeLinecap: 'stroke-linecap',
459
+ strokeLinejoin: 'stroke-linejoin',
460
+ strokeMiterlimit: 'stroke-miterlimit',
461
+ strokeOpacity: 'stroke-opacity',
462
+ strokeWidth: 'stroke-width',
463
+ textAnchor: 'text-anchor',
464
+ textDecoration: 'text-decoration',
465
+ textRendering: 'text-rendering',
466
+ underlinePosition: 'underline-position',
467
+ underlineThickness: 'underline-thickness',
468
+ unicodeBidi: 'unicode-bidi',
469
+ unicodeRange: 'unicode-range',
470
+ unitsPerEm: 'units-per-em',
471
+ vAlphabetic: 'v-alphabetic',
472
+ vHanging: 'v-hanging',
473
+ vIdeographic: 'v-ideographic',
474
+ vMathematical: 'v-mathematical',
475
+ vectorEffect: 'vector-effect',
476
+ vertAdvY: 'vert-adv-y',
477
+ vertOriginX: 'vert-origin-x',
478
+ vertOriginY: 'vert-origin-y',
479
+ wordSpacing: 'word-spacing',
480
+ writingMode: 'writing-mode',
481
+ xHeight: 'x-height',
482
+ xlinkActuate: 'xlink:actuate',
483
+ xlinkArcrole: 'xlink:arcrole',
484
+ xlinkHref: 'xlink:href',
485
+ xlinkRole: 'xlink:role',
486
+ xlinkShow: 'xlink:show',
487
+ xlinkTitle: 'xlink:title',
488
+ xlinkType: 'xlink:type',
489
+ xmlBase: 'xml:base',
490
+ xmlnsXlink: 'xmlns:xlink',
491
+ xmlLang: 'xml:lang',
492
+ xmlSpace: 'xml:space'
493
+ }
494
+ };
208
495
 
209
- "use strict";
210
- eval("\n\nvar CASE_SENSITIVE_TAG_NAMES = __webpack_require__(/*! ./constants */ \"./node_modules/html-dom-parser/lib/constants.js\").CASE_SENSITIVE_TAG_NAMES;\n\nvar caseSensitiveTagNamesMap = {};\nvar tagName;\nfor (var i = 0, len = CASE_SENSITIVE_TAG_NAMES.length; i < len; i++) {\n tagName = CASE_SENSITIVE_TAG_NAMES[i];\n caseSensitiveTagNamesMap[tagName.toLowerCase()] = tagName;\n}\n\n/**\n * Gets case-sensitive tag name.\n *\n * @param {String} tagName - The lowercase tag name.\n * @return {String|undefined}\n */\nfunction getCaseSensitiveTagName(tagName) {\n return caseSensitiveTagNamesMap[tagName];\n}\n\n/**\n * Formats DOM attributes to a hash map.\n *\n * @param {NamedNodeMap} attributes - The list of attributes.\n * @return {Object} - A map of attribute name to value.\n */\nfunction formatAttributes(attributes) {\n var result = {};\n var attribute;\n // `NamedNodeMap` is array-like\n for (var i = 0, len = attributes.length; i < len; i++) {\n attribute = attributes[i];\n result[attribute.name] = attribute.value;\n }\n return result;\n}\n\n/**\n * Corrects the tag name if it is case-sensitive (SVG).\n * Otherwise, returns the lowercase tag name (HTML).\n *\n * @param {String} tagName - The lowercase tag name.\n * @return {String} - The formatted tag name.\n */\nfunction formatTagName(tagName) {\n tagName = tagName.toLowerCase();\n var caseSensitiveTagName = getCaseSensitiveTagName(tagName);\n if (caseSensitiveTagName) {\n return caseSensitiveTagName;\n }\n return tagName;\n}\n\n/**\n * Formats the browser DOM nodes to mimic the output of `htmlparser2.parseDOM()`.\n *\n * @param {NodeList} nodes - The DOM nodes.\n * @param {Object} [parentObj] - The formatted parent node.\n * @param {String} [directive] - The directive.\n * @return {Object[]} - The formatted DOM object.\n */\nfunction formatDOM(nodes, parentObj, directive) {\n parentObj = parentObj || null;\n\n var result = [];\n var node;\n var prevNode;\n var nodeObj;\n\n // `NodeList` is array-like\n for (var i = 0, len = nodes.length; i < len; i++) {\n node = nodes[i];\n // reset\n nodeObj = {\n next: null,\n prev: result[i - 1] || null,\n parent: parentObj\n };\n\n // set the next node for the previous node (if applicable)\n prevNode = result[i - 1];\n if (prevNode) {\n prevNode.next = nodeObj;\n }\n\n // set the node name if it's not \"#text\" or \"#comment\"\n // e.g., \"div\"\n if (node.nodeName[0] !== '#') {\n nodeObj.name = formatTagName(node.nodeName);\n // also, nodes of type \"tag\" have \"attribs\"\n nodeObj.attribs = {}; // default\n if (node.attributes && node.attributes.length) {\n nodeObj.attribs = formatAttributes(node.attributes);\n }\n }\n\n // set the node type\n // e.g., \"tag\"\n switch (node.nodeType) {\n // 1 = element\n case 1:\n if (nodeObj.name === 'script' || nodeObj.name === 'style') {\n nodeObj.type = nodeObj.name;\n } else {\n nodeObj.type = 'tag';\n }\n // recursively format the children\n nodeObj.children = formatDOM(node.childNodes, nodeObj);\n break;\n // 2 = attribute\n // 3 = text\n case 3:\n nodeObj.type = 'text';\n nodeObj.data = node.nodeValue;\n break;\n // 8 = comment\n case 8:\n nodeObj.type = 'comment';\n nodeObj.data = node.nodeValue;\n break;\n default:\n break;\n }\n\n result.push(nodeObj);\n }\n\n if (directive) {\n result.unshift({\n name: directive.substring(0, directive.indexOf(' ')).toLowerCase(),\n data: directive,\n type: 'directive',\n next: result[0] ? result[0] : null,\n prev: null,\n parent: parentObj\n });\n\n if (result[1]) {\n result[1].prev = result[0];\n }\n }\n\n return result;\n}\n\n/**\n * Detects IE with or without version.\n *\n * @param {Number} [version] - The IE version to detect.\n * @return {Boolean} - Whether IE or the version has been detected.\n */\nfunction isIE(version) {\n if (version) {\n return document.documentMode === version;\n }\n return /(MSIE |Trident\\/|Edge\\/)/.test(navigator.userAgent);\n}\n\n/**\n * Export utilities.\n */\nmodule.exports = {\n formatAttributes: formatAttributes,\n formatDOM: formatDOM,\n isIE: isIE\n};\n\n\n//# sourceURL=webpack://HTMLReactParser/./node_modules/html-dom-parser/lib/utilities.js?");
496
+ var injection = {
497
+ MUST_USE_PROPERTY: 1,
498
+ HAS_BOOLEAN_VALUE: 4,
499
+ HAS_NUMERIC_VALUE: 8,
500
+ HAS_POSITIVE_NUMERIC_VALUE: 24,
501
+ HAS_OVERLOADED_BOOLEAN_VALUE: 32
502
+ };
211
503
 
212
- /***/ }),
504
+ var MUST_USE_PROPERTY = injection.MUST_USE_PROPERTY;
505
+ var HAS_BOOLEAN_VALUE = injection.HAS_BOOLEAN_VALUE;
506
+ var HAS_NUMERIC_VALUE = injection.HAS_NUMERIC_VALUE;
507
+ var HAS_POSITIVE_NUMERIC_VALUE = injection.HAS_POSITIVE_NUMERIC_VALUE;
508
+ var HAS_OVERLOADED_BOOLEAN_VALUE = injection.HAS_OVERLOADED_BOOLEAN_VALUE;
213
509
 
214
- /***/ "./node_modules/inline-style-parser/index.js":
215
- /*!***************************************************!*\
216
- !*** ./node_modules/inline-style-parser/index.js ***!
217
- \***************************************************/
218
- /*! no static exports found */
219
- /***/ (function(module, exports) {
510
+ /**
511
+ * @see https://github.com/facebook/react/blob/15-stable/src/renderers/dom/shared/DOMProperty.js#L14-L16
512
+ *
513
+ * @param {Number} value
514
+ * @param {Number} bitmask
515
+ * @return {Boolean}
516
+ */
517
+ function checkMask(value, bitmask) {
518
+ return (value & bitmask) === bitmask;
519
+ }
220
520
 
221
- eval("// http://www.w3.org/TR/CSS21/grammar.html\n// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027\nvar COMMENT_REGEX = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\n\nvar NEWLINE_REGEX = /\\n/g;\nvar WHITESPACE_REGEX = /^\\s*/;\n\n// declaration\nvar PROPERTY_REGEX = /^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/;\nvar COLON_REGEX = /^:\\s*/;\nvar VALUE_REGEX = /^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};])+)/;\nvar SEMICOLON_REGEX = /^[;\\s]*/;\n\n// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\nvar TRIM_REGEX = /^\\s+|\\s+$/g;\n\n// strings\nvar NEWLINE = '\\n';\nvar FORWARD_SLASH = '/';\nvar ASTERISK = '*';\nvar EMPTY_STRING = '';\n\n// types\nvar TYPE_COMMENT = 'comment';\nvar TYPE_DECLARATION = 'declaration';\n\n/**\n * @param {String} style\n * @param {Object} [options]\n * @return {Object[]}\n * @throws {TypeError}\n * @throws {Error}\n */\nmodule.exports = function(style, options) {\n if (typeof style !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n if (!style) return [];\n\n options = options || {};\n\n /**\n * Positional.\n */\n var lineno = 1;\n var column = 1;\n\n /**\n * Update lineno and column based on `str`.\n *\n * @param {String} str\n */\n function updatePosition(str) {\n var lines = str.match(NEWLINE_REGEX);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf(NEWLINE);\n column = ~i ? str.length - i : column + str.length;\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @return {Function}\n */\n function position() {\n var start = { line: lineno, column: column };\n return function(node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }\n\n /**\n * Store position information for a node.\n *\n * @constructor\n * @property {Object} start\n * @property {Object} end\n * @property {undefined|String} source\n */\n function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }\n\n /**\n * Non-enumerable source string.\n */\n Position.prototype.content = style;\n\n var errorsList = [];\n\n /**\n * Error `msg`.\n *\n * @param {String} msg\n * @throws {Error}\n */\n function error(msg) {\n var err = new Error(\n options.source + ':' + lineno + ':' + column + ': ' + msg\n );\n err.reason = msg;\n err.filename = options.source;\n err.line = lineno;\n err.column = column;\n err.source = style;\n\n if (options.silent) {\n errorsList.push(err);\n } else {\n throw err;\n }\n }\n\n /**\n * Match `re` and return captures.\n *\n * @param {RegExp} re\n * @return {undefined|Array}\n */\n function match(re) {\n var m = re.exec(style);\n if (!m) return;\n var str = m[0];\n updatePosition(str);\n style = style.slice(str.length);\n return m;\n }\n\n /**\n * Parse whitespace.\n */\n function whitespace() {\n match(WHITESPACE_REGEX);\n }\n\n /**\n * Parse comments.\n *\n * @param {Object[]} [rules]\n * @return {Object[]}\n */\n function comments(rules) {\n var c;\n rules = rules || [];\n while ((c = comment())) {\n if (c !== false) {\n rules.push(c);\n }\n }\n return rules;\n }\n\n /**\n * Parse comment.\n *\n * @return {Object}\n * @throws {Error}\n */\n function comment() {\n var pos = position();\n if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;\n\n var i = 2;\n while (\n EMPTY_STRING != style.charAt(i) &&\n (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))\n ) {\n ++i;\n }\n i += 2;\n\n if (EMPTY_STRING === style.charAt(i - 1)) {\n return error('End of comment missing');\n }\n\n var str = style.slice(2, i - 2);\n column += 2;\n updatePosition(str);\n style = style.slice(i);\n column += 2;\n\n return pos({\n type: TYPE_COMMENT,\n comment: str\n });\n }\n\n /**\n * Parse declaration.\n *\n * @return {Object}\n * @throws {Error}\n */\n function declaration() {\n var pos = position();\n\n // prop\n var prop = match(PROPERTY_REGEX);\n if (!prop) return;\n comment();\n\n // :\n if (!match(COLON_REGEX)) return error(\"property missing ':'\");\n\n // val\n var val = match(VALUE_REGEX);\n\n var ret = pos({\n type: TYPE_DECLARATION,\n property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),\n value: val\n ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))\n : EMPTY_STRING\n });\n\n // ;\n match(SEMICOLON_REGEX);\n\n return ret;\n }\n\n /**\n * Parse declarations.\n *\n * @return {Object[]}\n */\n function declarations() {\n var decls = [];\n\n comments(decls);\n\n // declarations\n var decl;\n while ((decl = declaration())) {\n if (decl !== false) {\n decls.push(decl);\n comments(decls);\n }\n }\n\n return decls;\n }\n\n whitespace();\n return declarations();\n};\n\n/**\n * Trim `str`.\n *\n * @param {String} str\n * @return {String}\n */\nfunction trim(str) {\n return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;\n}\n\n\n//# sourceURL=webpack://HTMLReactParser/./node_modules/inline-style-parser/index.js?");
521
+ /**
522
+ * @see https://github.com/facebook/react/blob/15-stable/src/renderers/dom/shared/DOMProperty.js#L57
523
+ *
524
+ * @param {Object} domPropertyConfig - HTMLDOMPropertyConfig or SVGDOMPropertyConfig
525
+ * @param {Object} config - The object to be mutated
526
+ * @param {Boolean} isSVG - Whether the injected config is HTML or SVG (it assumes the default is HTML)
527
+ */
528
+ function injectDOMPropertyConfig(domPropertyConfig, config, isSVG) {
529
+ var Properties = domPropertyConfig.Properties;
530
+ var DOMAttributeNames = domPropertyConfig.DOMAttributeNames;
531
+ var attributeName;
532
+ var propertyName;
533
+ var propConfig;
222
534
 
223
- /***/ }),
535
+ for (propertyName in Properties) {
536
+ attributeName =
537
+ DOMAttributeNames[propertyName] ||
538
+ (isSVG ? propertyName : propertyName.toLowerCase());
539
+ propConfig = Properties[propertyName];
224
540
 
225
- /***/ "./node_modules/react-dom-core/lib/DOMProperty.js":
226
- /*!********************************************************!*\
227
- !*** ./node_modules/react-dom-core/lib/DOMProperty.js ***!
228
- \********************************************************/
229
- /*! no static exports found */
230
- /***/ (function(module, exports, __webpack_require__) {
541
+ config[attributeName] = {
542
+ attributeName: attributeName,
543
+ propertyName: propertyName,
544
+ mustUseProperty: checkMask(propConfig, MUST_USE_PROPERTY),
545
+ hasBooleanValue: checkMask(propConfig, HAS_BOOLEAN_VALUE),
546
+ hasNumericValue: checkMask(propConfig, HAS_NUMERIC_VALUE),
547
+ hasPositiveNumericValue: checkMask(
548
+ propConfig,
549
+ HAS_POSITIVE_NUMERIC_VALUE
550
+ ),
551
+ hasOverloadedBooleanValue: checkMask(
552
+ propConfig,
553
+ HAS_OVERLOADED_BOOLEAN_VALUE
554
+ )
555
+ };
556
+ }
557
+ }
231
558
 
232
- "use strict";
233
- eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\nvar _prodInvariant = __webpack_require__(/*! ./reactProdInvariant */ \"./node_modules/react-dom-core/lib/reactProdInvariant.js\");\n\nvar invariant = __webpack_require__(/*! fbjs/lib/invariant */ \"./node_modules/fbjs/lib/invariant.js\");\n\nfunction checkMask(value, bitmask) {\n return (value & bitmask) === bitmask;\n}\n\nvar DOMPropertyInjection = {\n /**\n * Mapping from normalized, camelcased property names to a configuration that\n * specifies how the associated DOM property should be accessed or rendered.\n */\n MUST_USE_PROPERTY: 0x1,\n HAS_BOOLEAN_VALUE: 0x4,\n HAS_NUMERIC_VALUE: 0x8,\n HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8,\n HAS_OVERLOADED_BOOLEAN_VALUE: 0x20,\n\n /**\n * Inject some specialized knowledge about the DOM. This takes a config object\n * with the following properties:\n *\n * isCustomAttribute: function that given an attribute name will return true\n * if it can be inserted into the DOM verbatim. Useful for data-* or aria-*\n * attributes where it's impossible to enumerate all of the possible\n * attribute names,\n *\n * Properties: object mapping DOM property name to one of the\n * DOMPropertyInjection constants or null. If your attribute isn't in here,\n * it won't get written to the DOM.\n *\n * DOMAttributeNames: object mapping React attribute name to the DOM\n * attribute name. Attribute names not specified use the **lowercase**\n * normalized name.\n *\n * DOMAttributeNamespaces: object mapping React attribute name to the DOM\n * attribute namespace URL. (Attribute names not specified use no namespace.)\n *\n * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties.\n * Property names not specified use the normalized name.\n *\n * DOMMutationMethods: Properties that require special mutation methods. If\n * `value` is undefined, the mutation method should unset the property.\n *\n * @param {object} domPropertyConfig the config as described above.\n */\n injectDOMPropertyConfig: function (domPropertyConfig) {\n var Injection = DOMPropertyInjection;\n var Properties = domPropertyConfig.Properties || {};\n var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {};\n var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {};\n var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {};\n var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {};\n\n if (domPropertyConfig.isCustomAttribute) {\n DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);\n }\n\n for (var propName in Properties) {\n !!DOMProperty.properties.hasOwnProperty(propName) ? true ? invariant(false, 'injectDOMPropertyConfig(...): You\\'re trying to inject DOM property \\'%s\\' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.', propName) : undefined : void 0;\n\n var lowerCased = propName.toLowerCase();\n var propConfig = Properties[propName];\n\n var propertyInfo = {\n attributeName: lowerCased,\n attributeNamespace: null,\n propertyName: propName,\n mutationMethod: null,\n\n mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY),\n hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE),\n hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE),\n hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE),\n hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE)\n };\n !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? true ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s', propName) : undefined : void 0;\n\n if (true) {\n DOMProperty.getPossibleStandardName[lowerCased] = propName;\n }\n\n if (DOMAttributeNames.hasOwnProperty(propName)) {\n var attributeName = DOMAttributeNames[propName];\n propertyInfo.attributeName = attributeName;\n if (true) {\n DOMProperty.getPossibleStandardName[attributeName] = propName;\n }\n }\n\n if (DOMAttributeNamespaces.hasOwnProperty(propName)) {\n propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName];\n }\n\n if (DOMPropertyNames.hasOwnProperty(propName)) {\n propertyInfo.propertyName = DOMPropertyNames[propName];\n }\n\n if (DOMMutationMethods.hasOwnProperty(propName)) {\n propertyInfo.mutationMethod = DOMMutationMethods[propName];\n }\n\n DOMProperty.properties[propName] = propertyInfo;\n }\n }\n};\n\n/* eslint-disable max-len */\nvar ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD';\n/* eslint-enable max-len */\n\n/**\n * DOMProperty exports lookup objects that can be used like functions:\n *\n * > DOMProperty.isValid['id']\n * true\n * > DOMProperty.isValid['foobar']\n * undefined\n *\n * Although this may be confusing, it performs better in general.\n *\n * @see http://jsperf.com/key-exists\n * @see http://jsperf.com/key-missing\n */\nvar DOMProperty = {\n ID_ATTRIBUTE_NAME: 'data-reactid',\n ROOT_ATTRIBUTE_NAME: 'data-reactroot',\n\n ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR,\n ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040',\n\n /**\n * Map from property \"standard name\" to an object with info about how to set\n * the property in the DOM. Each object contains:\n *\n * attributeName:\n * Used when rendering markup or with `*Attribute()`.\n * attributeNamespace\n * propertyName:\n * Used on DOM node instances. (This includes properties that mutate due to\n * external factors.)\n * mutationMethod:\n * If non-null, used instead of the property or `setAttribute()` after\n * initial render.\n * mustUseProperty:\n * Whether the property must be accessed and mutated as an object property.\n * hasBooleanValue:\n * Whether the property should be removed when set to a falsey value.\n * hasNumericValue:\n * Whether the property must be numeric or parse as a numeric and should be\n * removed when set to a falsey value.\n * hasPositiveNumericValue:\n * Whether the property must be positive numeric or parse as a positive\n * numeric and should be removed when set to a falsey value.\n * hasOverloadedBooleanValue:\n * Whether the property can be used as a flag as well as with a value.\n * Removed when strictly equal to false; present without a value when\n * strictly equal to true; present with a value otherwise.\n */\n properties: {},\n\n /**\n * Mapping from lowercase property names to the properly cased version, used\n * to warn in the case of missing properties. Available only in __DEV__.\n *\n * autofocus is predefined, because adding it to the property whitelist\n * causes unintended side effects.\n *\n * @type {Object}\n */\n getPossibleStandardName: true ? { autofocus: 'autoFocus' } : undefined,\n\n /**\n * All of the isCustomAttribute() functions that have been injected.\n */\n _isCustomAttributeFunctions: [],\n\n /**\n * Checks whether a property name is a custom attribute.\n * @method\n */\n isCustomAttribute: function (attributeName) {\n for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) {\n var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i];\n if (isCustomAttributeFn(attributeName)) {\n return true;\n }\n }\n return false;\n },\n\n injection: DOMPropertyInjection\n};\n\nmodule.exports = DOMProperty;\n\n//# sourceURL=webpack://HTMLReactParser/./node_modules/react-dom-core/lib/DOMProperty.js?");
559
+ /**
560
+ * HTML properties config.
561
+ *
562
+ * @type {Object}
563
+ */
564
+ var html = {};
565
+ injectDOMPropertyConfig(HTMLDOMPropertyConfig, html);
234
566
 
235
- /***/ }),
567
+ /**
568
+ * SVG properties config.
569
+ *
570
+ * @type {Object}
571
+ */
572
+ var svg = {};
573
+ injectDOMPropertyConfig(SVGDOMPropertyConfig, svg, true);
236
574
 
237
- /***/ "./node_modules/react-dom-core/lib/HTMLDOMPropertyConfig.js":
238
- /*!******************************************************************!*\
239
- !*** ./node_modules/react-dom-core/lib/HTMLDOMPropertyConfig.js ***!
240
- \******************************************************************/
241
- /*! no static exports found */
242
- /***/ (function(module, exports, __webpack_require__) {
575
+ /**
576
+ * HTML and SVG properties config.
577
+ *
578
+ * @type {Object}
579
+ */
580
+ var properties = {};
581
+ injectDOMPropertyConfig(HTMLDOMPropertyConfig, properties);
582
+ injectDOMPropertyConfig(SVGDOMPropertyConfig, properties, true);
243
583
 
244
- "use strict";
245
- eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\nvar DOMProperty = __webpack_require__(/*! ./DOMProperty */ \"./node_modules/react-dom-core/lib/DOMProperty.js\");\n\nvar MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY;\nvar HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE;\nvar HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE;\nvar HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE;\nvar HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE;\n\nvar HTMLDOMPropertyConfig = {\n isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')),\n Properties: {\n /**\n * Standard Properties\n */\n accept: 0,\n acceptCharset: 0,\n accessKey: 0,\n action: 0,\n allowFullScreen: HAS_BOOLEAN_VALUE,\n allowTransparency: 0,\n alt: 0,\n // specifies target context for links with `preload` type\n as: 0,\n async: HAS_BOOLEAN_VALUE,\n autoComplete: 0,\n // autoFocus is polyfilled/normalized by AutoFocusUtils\n // autoFocus: HAS_BOOLEAN_VALUE,\n autoPlay: HAS_BOOLEAN_VALUE,\n capture: HAS_BOOLEAN_VALUE,\n cellPadding: 0,\n cellSpacing: 0,\n charSet: 0,\n challenge: 0,\n checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n cite: 0,\n classID: 0,\n className: 0,\n cols: HAS_POSITIVE_NUMERIC_VALUE,\n colSpan: 0,\n content: 0,\n contentEditable: 0,\n contextMenu: 0,\n controls: HAS_BOOLEAN_VALUE,\n controlsList: 0,\n coords: 0,\n crossOrigin: 0,\n data: 0, // For `<object />` acts as `src`.\n dateTime: 0,\n 'default': HAS_BOOLEAN_VALUE,\n defer: HAS_BOOLEAN_VALUE,\n dir: 0,\n disabled: HAS_BOOLEAN_VALUE,\n download: HAS_OVERLOADED_BOOLEAN_VALUE,\n draggable: 0,\n encType: 0,\n form: 0,\n formAction: 0,\n formEncType: 0,\n formMethod: 0,\n formNoValidate: HAS_BOOLEAN_VALUE,\n formTarget: 0,\n frameBorder: 0,\n headers: 0,\n height: 0,\n hidden: HAS_BOOLEAN_VALUE,\n high: 0,\n href: 0,\n hrefLang: 0,\n htmlFor: 0,\n httpEquiv: 0,\n icon: 0,\n id: 0,\n inputMode: 0,\n integrity: 0,\n is: 0,\n keyParams: 0,\n keyType: 0,\n kind: 0,\n label: 0,\n lang: 0,\n list: 0,\n loop: HAS_BOOLEAN_VALUE,\n low: 0,\n manifest: 0,\n marginHeight: 0,\n marginWidth: 0,\n max: 0,\n maxLength: 0,\n media: 0,\n mediaGroup: 0,\n method: 0,\n min: 0,\n minLength: 0,\n // Caution; `option.selected` is not updated if `select.multiple` is\n // disabled with `removeAttribute`.\n multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n name: 0,\n nonce: 0,\n noValidate: HAS_BOOLEAN_VALUE,\n open: HAS_BOOLEAN_VALUE,\n optimum: 0,\n pattern: 0,\n placeholder: 0,\n playsInline: HAS_BOOLEAN_VALUE,\n poster: 0,\n preload: 0,\n profile: 0,\n radioGroup: 0,\n readOnly: HAS_BOOLEAN_VALUE,\n referrerPolicy: 0,\n rel: 0,\n required: HAS_BOOLEAN_VALUE,\n reversed: HAS_BOOLEAN_VALUE,\n role: 0,\n rows: HAS_POSITIVE_NUMERIC_VALUE,\n rowSpan: HAS_NUMERIC_VALUE,\n sandbox: 0,\n scope: 0,\n scoped: HAS_BOOLEAN_VALUE,\n scrolling: 0,\n seamless: HAS_BOOLEAN_VALUE,\n selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,\n shape: 0,\n size: HAS_POSITIVE_NUMERIC_VALUE,\n sizes: 0,\n span: HAS_POSITIVE_NUMERIC_VALUE,\n spellCheck: 0,\n src: 0,\n srcDoc: 0,\n srcLang: 0,\n srcSet: 0,\n start: HAS_NUMERIC_VALUE,\n step: 0,\n style: 0,\n summary: 0,\n tabIndex: 0,\n target: 0,\n title: 0,\n // Setting .type throws on non-<input> tags\n type: 0,\n useMap: 0,\n value: 0,\n width: 0,\n wmode: 0,\n wrap: 0,\n\n /**\n * RDFa Properties\n */\n about: 0,\n datatype: 0,\n inlist: 0,\n prefix: 0,\n // property is also supported for OpenGraph in meta tags.\n property: 0,\n resource: 0,\n 'typeof': 0,\n vocab: 0,\n\n /**\n * Non-standard Properties\n */\n // autoCapitalize and autoCorrect are supported in Mobile Safari for\n // keyboard hints.\n autoCapitalize: 0,\n autoCorrect: 0,\n // autoSave allows WebKit/Blink to persist values of input fields on page reloads\n autoSave: 0,\n // color is for Safari mask-icon link\n color: 0,\n // itemProp, itemScope, itemType are for\n // Microdata support. See http://schema.org/docs/gs.html\n itemProp: 0,\n itemScope: HAS_BOOLEAN_VALUE,\n itemType: 0,\n // itemID and itemRef are for Microdata support as well but\n // only specified in the WHATWG spec document. See\n // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api\n itemID: 0,\n itemRef: 0,\n // results show looking glass icon and recent searches on input\n // search fields in WebKit/Blink\n results: 0,\n // IE-only attribute that specifies security restrictions on an iframe\n // as an alternative to the sandbox attribute on IE<10\n security: 0,\n // IE-only attribute that controls focus behavior\n unselectable: 0\n },\n DOMAttributeNames: {\n acceptCharset: 'accept-charset',\n className: 'class',\n htmlFor: 'for',\n httpEquiv: 'http-equiv'\n },\n DOMPropertyNames: {},\n DOMMutationMethods: {\n value: function (node, value) {\n if (value == null) {\n return node.removeAttribute('value');\n }\n\n // Number inputs get special treatment due to some edge cases in\n // Chrome. Let everything else assign the value attribute as normal.\n // https://github.com/facebook/react/issues/7253#issuecomment-236074326\n if (node.type !== 'number' || node.hasAttribute('value') === false) {\n node.setAttribute('value', '' + value);\n } else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) {\n // Don't assign an attribute if validation reports bad\n // input. Chrome will clear the value. Additionally, don't\n // operate on inputs that have focus, otherwise Chrome might\n // strip off trailing decimal places and cause the user's\n // cursor position to jump to the beginning of the input.\n //\n // In ReactDOMInput, we have an onBlur event that will trigger\n // this function again when focus is lost.\n node.setAttribute('value', '' + value);\n }\n }\n }\n};\n\nmodule.exports = HTMLDOMPropertyConfig;\n\n//# sourceURL=webpack://HTMLReactParser/./node_modules/react-dom-core/lib/HTMLDOMPropertyConfig.js?");
584
+ var ATTRIBUTE_NAME_START_CHAR =
585
+ ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
586
+ var ATTRIBUTE_NAME_CHAR =
587
+ ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
246
588
 
247
- /***/ }),
589
+ var reactProperty = {
590
+ html: html,
591
+ svg: svg,
592
+ properties: properties,
248
593
 
249
- /***/ "./node_modules/react-dom-core/lib/SVGDOMPropertyConfig.js":
250
- /*!*****************************************************************!*\
251
- !*** ./node_modules/react-dom-core/lib/SVGDOMPropertyConfig.js ***!
252
- \*****************************************************************/
253
- /*! no static exports found */
254
- /***/ (function(module, exports, __webpack_require__) {
594
+ /**
595
+ * Checks whether a property name is a custom attribute.
596
+ *
597
+ * @see https://github.com/facebook/react/blob/15-stable/src/renderers/dom/shared/HTMLDOMPropertyConfig.js#L23-L25
598
+ *
599
+ * @param {String}
600
+ * @return {Boolean}
601
+ */
602
+ isCustomAttribute: RegExp.prototype.test.bind(
603
+ new RegExp('^(data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$')
604
+ )
605
+ };
255
606
 
256
- "use strict";
257
- eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n\nvar NS = {\n xlink: 'http://www.w3.org/1999/xlink',\n xml: 'http://www.w3.org/XML/1998/namespace'\n};\n\n// We use attributes for everything SVG so let's avoid some duplication and run\n// code instead.\n// The following are all specified in the HTML config already so we exclude here.\n// - class (as className)\n// - color\n// - height\n// - id\n// - lang\n// - max\n// - media\n// - method\n// - min\n// - name\n// - style\n// - target\n// - type\n// - width\nvar ATTRS = {\n accentHeight: 'accent-height',\n accumulate: 0,\n additive: 0,\n alignmentBaseline: 'alignment-baseline',\n allowReorder: 'allowReorder',\n alphabetic: 0,\n amplitude: 0,\n arabicForm: 'arabic-form',\n ascent: 0,\n attributeName: 'attributeName',\n attributeType: 'attributeType',\n autoReverse: 'autoReverse',\n azimuth: 0,\n baseFrequency: 'baseFrequency',\n baseProfile: 'baseProfile',\n baselineShift: 'baseline-shift',\n bbox: 0,\n begin: 0,\n bias: 0,\n by: 0,\n calcMode: 'calcMode',\n capHeight: 'cap-height',\n clip: 0,\n clipPath: 'clip-path',\n clipRule: 'clip-rule',\n clipPathUnits: 'clipPathUnits',\n colorInterpolation: 'color-interpolation',\n colorInterpolationFilters: 'color-interpolation-filters',\n colorProfile: 'color-profile',\n colorRendering: 'color-rendering',\n contentScriptType: 'contentScriptType',\n contentStyleType: 'contentStyleType',\n cursor: 0,\n cx: 0,\n cy: 0,\n d: 0,\n decelerate: 0,\n descent: 0,\n diffuseConstant: 'diffuseConstant',\n direction: 0,\n display: 0,\n divisor: 0,\n dominantBaseline: 'dominant-baseline',\n dur: 0,\n dx: 0,\n dy: 0,\n edgeMode: 'edgeMode',\n elevation: 0,\n enableBackground: 'enable-background',\n end: 0,\n exponent: 0,\n externalResourcesRequired: 'externalResourcesRequired',\n fill: 0,\n fillOpacity: 'fill-opacity',\n fillRule: 'fill-rule',\n filter: 0,\n filterRes: 'filterRes',\n filterUnits: 'filterUnits',\n floodColor: 'flood-color',\n floodOpacity: 'flood-opacity',\n focusable: 0,\n fontFamily: 'font-family',\n fontSize: 'font-size',\n fontSizeAdjust: 'font-size-adjust',\n fontStretch: 'font-stretch',\n fontStyle: 'font-style',\n fontVariant: 'font-variant',\n fontWeight: 'font-weight',\n format: 0,\n from: 0,\n fx: 0,\n fy: 0,\n g1: 0,\n g2: 0,\n glyphName: 'glyph-name',\n glyphOrientationHorizontal: 'glyph-orientation-horizontal',\n glyphOrientationVertical: 'glyph-orientation-vertical',\n glyphRef: 'glyphRef',\n gradientTransform: 'gradientTransform',\n gradientUnits: 'gradientUnits',\n hanging: 0,\n horizAdvX: 'horiz-adv-x',\n horizOriginX: 'horiz-origin-x',\n ideographic: 0,\n imageRendering: 'image-rendering',\n 'in': 0,\n in2: 0,\n intercept: 0,\n k: 0,\n k1: 0,\n k2: 0,\n k3: 0,\n k4: 0,\n kernelMatrix: 'kernelMatrix',\n kernelUnitLength: 'kernelUnitLength',\n kerning: 0,\n keyPoints: 'keyPoints',\n keySplines: 'keySplines',\n keyTimes: 'keyTimes',\n lengthAdjust: 'lengthAdjust',\n letterSpacing: 'letter-spacing',\n lightingColor: 'lighting-color',\n limitingConeAngle: 'limitingConeAngle',\n local: 0,\n markerEnd: 'marker-end',\n markerMid: 'marker-mid',\n markerStart: 'marker-start',\n markerHeight: 'markerHeight',\n markerUnits: 'markerUnits',\n markerWidth: 'markerWidth',\n mask: 0,\n maskContentUnits: 'maskContentUnits',\n maskUnits: 'maskUnits',\n mathematical: 0,\n mode: 0,\n numOctaves: 'numOctaves',\n offset: 0,\n opacity: 0,\n operator: 0,\n order: 0,\n orient: 0,\n orientation: 0,\n origin: 0,\n overflow: 0,\n overlinePosition: 'overline-position',\n overlineThickness: 'overline-thickness',\n paintOrder: 'paint-order',\n panose1: 'panose-1',\n pathLength: 'pathLength',\n patternContentUnits: 'patternContentUnits',\n patternTransform: 'patternTransform',\n patternUnits: 'patternUnits',\n pointerEvents: 'pointer-events',\n points: 0,\n pointsAtX: 'pointsAtX',\n pointsAtY: 'pointsAtY',\n pointsAtZ: 'pointsAtZ',\n preserveAlpha: 'preserveAlpha',\n preserveAspectRatio: 'preserveAspectRatio',\n primitiveUnits: 'primitiveUnits',\n r: 0,\n radius: 0,\n refX: 'refX',\n refY: 'refY',\n renderingIntent: 'rendering-intent',\n repeatCount: 'repeatCount',\n repeatDur: 'repeatDur',\n requiredExtensions: 'requiredExtensions',\n requiredFeatures: 'requiredFeatures',\n restart: 0,\n result: 0,\n rotate: 0,\n rx: 0,\n ry: 0,\n scale: 0,\n seed: 0,\n shapeRendering: 'shape-rendering',\n slope: 0,\n spacing: 0,\n specularConstant: 'specularConstant',\n specularExponent: 'specularExponent',\n speed: 0,\n spreadMethod: 'spreadMethod',\n startOffset: 'startOffset',\n stdDeviation: 'stdDeviation',\n stemh: 0,\n stemv: 0,\n stitchTiles: 'stitchTiles',\n stopColor: 'stop-color',\n stopOpacity: 'stop-opacity',\n strikethroughPosition: 'strikethrough-position',\n strikethroughThickness: 'strikethrough-thickness',\n string: 0,\n stroke: 0,\n strokeDasharray: 'stroke-dasharray',\n strokeDashoffset: 'stroke-dashoffset',\n strokeLinecap: 'stroke-linecap',\n strokeLinejoin: 'stroke-linejoin',\n strokeMiterlimit: 'stroke-miterlimit',\n strokeOpacity: 'stroke-opacity',\n strokeWidth: 'stroke-width',\n surfaceScale: 'surfaceScale',\n systemLanguage: 'systemLanguage',\n tableValues: 'tableValues',\n targetX: 'targetX',\n targetY: 'targetY',\n textAnchor: 'text-anchor',\n textDecoration: 'text-decoration',\n textRendering: 'text-rendering',\n textLength: 'textLength',\n to: 0,\n transform: 0,\n u1: 0,\n u2: 0,\n underlinePosition: 'underline-position',\n underlineThickness: 'underline-thickness',\n unicode: 0,\n unicodeBidi: 'unicode-bidi',\n unicodeRange: 'unicode-range',\n unitsPerEm: 'units-per-em',\n vAlphabetic: 'v-alphabetic',\n vHanging: 'v-hanging',\n vIdeographic: 'v-ideographic',\n vMathematical: 'v-mathematical',\n values: 0,\n vectorEffect: 'vector-effect',\n version: 0,\n vertAdvY: 'vert-adv-y',\n vertOriginX: 'vert-origin-x',\n vertOriginY: 'vert-origin-y',\n viewBox: 'viewBox',\n viewTarget: 'viewTarget',\n visibility: 0,\n widths: 0,\n wordSpacing: 'word-spacing',\n writingMode: 'writing-mode',\n x: 0,\n xHeight: 'x-height',\n x1: 0,\n x2: 0,\n xChannelSelector: 'xChannelSelector',\n xlinkActuate: 'xlink:actuate',\n xlinkArcrole: 'xlink:arcrole',\n xlinkHref: 'xlink:href',\n xlinkRole: 'xlink:role',\n xlinkShow: 'xlink:show',\n xlinkTitle: 'xlink:title',\n xlinkType: 'xlink:type',\n xmlBase: 'xml:base',\n xmlns: 0,\n xmlnsXlink: 'xmlns:xlink',\n xmlLang: 'xml:lang',\n xmlSpace: 'xml:space',\n y: 0,\n y1: 0,\n y2: 0,\n yChannelSelector: 'yChannelSelector',\n z: 0,\n zoomAndPan: 'zoomAndPan'\n};\n\nvar SVGDOMPropertyConfig = {\n Properties: {},\n DOMAttributeNamespaces: {\n xlinkActuate: NS.xlink,\n xlinkArcrole: NS.xlink,\n xlinkHref: NS.xlink,\n xlinkRole: NS.xlink,\n xlinkShow: NS.xlink,\n xlinkTitle: NS.xlink,\n xlinkType: NS.xlink,\n xmlBase: NS.xml,\n xmlLang: NS.xml,\n xmlSpace: NS.xml\n },\n DOMAttributeNames: {}\n};\n\nObject.keys(ATTRS).forEach(function (key) {\n SVGDOMPropertyConfig.Properties[key] = 0;\n if (ATTRS[key]) {\n SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key];\n }\n});\n\nmodule.exports = SVGDOMPropertyConfig;\n\n//# sourceURL=webpack://HTMLReactParser/./node_modules/react-dom-core/lib/SVGDOMPropertyConfig.js?");
607
+ // http://www.w3.org/TR/CSS21/grammar.html
608
+ // https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
609
+ var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
258
610
 
259
- /***/ }),
611
+ var NEWLINE_REGEX = /\n/g;
612
+ var WHITESPACE_REGEX = /^\s*/;
260
613
 
261
- /***/ "./node_modules/react-dom-core/lib/reactProdInvariant.js":
262
- /*!***************************************************************!*\
263
- !*** ./node_modules/react-dom-core/lib/reactProdInvariant.js ***!
264
- \***************************************************************/
265
- /*! no static exports found */
266
- /***/ (function(module, exports, __webpack_require__) {
614
+ // declaration
615
+ var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/;
616
+ var COLON_REGEX = /^:\s*/;
617
+ var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/;
618
+ var SEMICOLON_REGEX = /^[;\s]*/;
267
619
 
268
- "use strict";
269
- eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\n\n/**\n * WARNING: DO NOT manually require this module.\n * This is a replacement for `invariant(...)` used by the error code system\n * and will _only_ be required by the corresponding babel pass.\n * It always throws.\n */\n\nfunction reactProdInvariant(code) {\n var argCount = arguments.length - 1;\n\n var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;\n\n for (var argIdx = 0; argIdx < argCount; argIdx++) {\n message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);\n }\n\n message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';\n\n var error = new Error(message);\n error.name = 'Invariant Violation';\n error.framesToPop = 1; // we don't care about reactProdInvariant's own frame\n\n throw error;\n}\n\nmodule.exports = reactProdInvariant;\n\n//# sourceURL=webpack://HTMLReactParser/./node_modules/react-dom-core/lib/reactProdInvariant.js?");
620
+ // https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
621
+ var TRIM_REGEX = /^\s+|\s+$/g;
270
622
 
271
- /***/ }),
623
+ // strings
624
+ var NEWLINE = '\n';
625
+ var FORWARD_SLASH = '/';
626
+ var ASTERISK = '*';
627
+ var EMPTY_STRING = '';
272
628
 
273
- /***/ "./node_modules/style-to-object/index.js":
274
- /*!***********************************************!*\
275
- !*** ./node_modules/style-to-object/index.js ***!
276
- \***********************************************/
277
- /*! no static exports found */
278
- /***/ (function(module, exports, __webpack_require__) {
629
+ // types
630
+ var TYPE_COMMENT = 'comment';
631
+ var TYPE_DECLARATION = 'declaration';
279
632
 
280
- eval("var parse = __webpack_require__(/*! inline-style-parser */ \"./node_modules/inline-style-parser/index.js\");\n\n/**\n * Parses inline style to object.\n *\n * @example\n * // returns { 'line-height': '42' }\n * StyleToObject('line-height: 42;');\n *\n * @param {String} style - The inline style.\n * @param {Function} [iterator] - The iterator function.\n * @return {null|Object}\n */\nfunction StyleToObject(style, iterator) {\n var output = null;\n if (!style || typeof style !== 'string') {\n return output;\n }\n\n var declaration;\n var declarations = parse(style);\n var hasIterator = typeof iterator === 'function';\n var property;\n var value;\n\n for (var i = 0, len = declarations.length; i < len; i++) {\n declaration = declarations[i];\n property = declaration.property;\n value = declaration.value;\n\n if (hasIterator) {\n iterator(property, value, declaration);\n } else if (value) {\n output || (output = {});\n output[property] = value;\n }\n }\n\n return output;\n}\n\nmodule.exports = StyleToObject;\n\n\n//# sourceURL=webpack://HTMLReactParser/./node_modules/style-to-object/index.js?");
633
+ /**
634
+ * @param {String} style
635
+ * @param {Object} [options]
636
+ * @return {Object[]}
637
+ * @throws {TypeError}
638
+ * @throws {Error}
639
+ */
640
+ var inlineStyleParser = function(style, options) {
641
+ if (typeof style !== 'string') {
642
+ throw new TypeError('First argument must be a string');
643
+ }
281
644
 
282
- /***/ }),
645
+ if (!style) return [];
283
646
 
284
- /***/ "react":
285
- /*!**************************************************************************************!*\
286
- !*** external {"amd":"react","commonjs":"react","commonjs2":"react","root":"React"} ***!
287
- \**************************************************************************************/
288
- /*! no static exports found */
289
- /***/ (function(module, exports) {
647
+ options = options || {};
290
648
 
291
- eval("module.exports = __WEBPACK_EXTERNAL_MODULE_react__;\n\n//# sourceURL=webpack://HTMLReactParser/external_%7B%22amd%22:%22react%22,%22commonjs%22:%22react%22,%22commonjs2%22:%22react%22,%22root%22:%22React%22%7D?");
649
+ /**
650
+ * Positional.
651
+ */
652
+ var lineno = 1;
653
+ var column = 1;
292
654
 
293
- /***/ })
655
+ /**
656
+ * Update lineno and column based on `str`.
657
+ *
658
+ * @param {String} str
659
+ */
660
+ function updatePosition(str) {
661
+ var lines = str.match(NEWLINE_REGEX);
662
+ if (lines) lineno += lines.length;
663
+ var i = str.lastIndexOf(NEWLINE);
664
+ column = ~i ? str.length - i : column + str.length;
665
+ }
294
666
 
295
- /******/ });
296
- });
667
+ /**
668
+ * Mark position and patch `node.position`.
669
+ *
670
+ * @return {Function}
671
+ */
672
+ function position() {
673
+ var start = { line: lineno, column: column };
674
+ return function(node) {
675
+ node.position = new Position(start);
676
+ whitespace();
677
+ return node;
678
+ };
679
+ }
680
+
681
+ /**
682
+ * Store position information for a node.
683
+ *
684
+ * @constructor
685
+ * @property {Object} start
686
+ * @property {Object} end
687
+ * @property {undefined|String} source
688
+ */
689
+ function Position(start) {
690
+ this.start = start;
691
+ this.end = { line: lineno, column: column };
692
+ this.source = options.source;
693
+ }
694
+
695
+ /**
696
+ * Non-enumerable source string.
697
+ */
698
+ Position.prototype.content = style;
699
+
700
+ /**
701
+ * Error `msg`.
702
+ *
703
+ * @param {String} msg
704
+ * @throws {Error}
705
+ */
706
+ function error(msg) {
707
+ var err = new Error(
708
+ options.source + ':' + lineno + ':' + column + ': ' + msg
709
+ );
710
+ err.reason = msg;
711
+ err.filename = options.source;
712
+ err.line = lineno;
713
+ err.column = column;
714
+ err.source = style;
715
+
716
+ if (options.silent) ; else {
717
+ throw err;
718
+ }
719
+ }
720
+
721
+ /**
722
+ * Match `re` and return captures.
723
+ *
724
+ * @param {RegExp} re
725
+ * @return {undefined|Array}
726
+ */
727
+ function match(re) {
728
+ var m = re.exec(style);
729
+ if (!m) return;
730
+ var str = m[0];
731
+ updatePosition(str);
732
+ style = style.slice(str.length);
733
+ return m;
734
+ }
735
+
736
+ /**
737
+ * Parse whitespace.
738
+ */
739
+ function whitespace() {
740
+ match(WHITESPACE_REGEX);
741
+ }
742
+
743
+ /**
744
+ * Parse comments.
745
+ *
746
+ * @param {Object[]} [rules]
747
+ * @return {Object[]}
748
+ */
749
+ function comments(rules) {
750
+ var c;
751
+ rules = rules || [];
752
+ while ((c = comment())) {
753
+ if (c !== false) {
754
+ rules.push(c);
755
+ }
756
+ }
757
+ return rules;
758
+ }
759
+
760
+ /**
761
+ * Parse comment.
762
+ *
763
+ * @return {Object}
764
+ * @throws {Error}
765
+ */
766
+ function comment() {
767
+ var pos = position();
768
+ if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;
769
+
770
+ var i = 2;
771
+ while (
772
+ EMPTY_STRING != style.charAt(i) &&
773
+ (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))
774
+ ) {
775
+ ++i;
776
+ }
777
+ i += 2;
778
+
779
+ if (EMPTY_STRING === style.charAt(i - 1)) {
780
+ return error('End of comment missing');
781
+ }
782
+
783
+ var str = style.slice(2, i - 2);
784
+ column += 2;
785
+ updatePosition(str);
786
+ style = style.slice(i);
787
+ column += 2;
788
+
789
+ return pos({
790
+ type: TYPE_COMMENT,
791
+ comment: str
792
+ });
793
+ }
794
+
795
+ /**
796
+ * Parse declaration.
797
+ *
798
+ * @return {Object}
799
+ * @throws {Error}
800
+ */
801
+ function declaration() {
802
+ var pos = position();
803
+
804
+ // prop
805
+ var prop = match(PROPERTY_REGEX);
806
+ if (!prop) return;
807
+ comment();
808
+
809
+ // :
810
+ if (!match(COLON_REGEX)) return error("property missing ':'");
811
+
812
+ // val
813
+ var val = match(VALUE_REGEX);
814
+
815
+ var ret = pos({
816
+ type: TYPE_DECLARATION,
817
+ property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),
818
+ value: val
819
+ ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))
820
+ : EMPTY_STRING
821
+ });
822
+
823
+ // ;
824
+ match(SEMICOLON_REGEX);
825
+
826
+ return ret;
827
+ }
828
+
829
+ /**
830
+ * Parse declarations.
831
+ *
832
+ * @return {Object[]}
833
+ */
834
+ function declarations() {
835
+ var decls = [];
836
+
837
+ comments(decls);
838
+
839
+ // declarations
840
+ var decl;
841
+ while ((decl = declaration())) {
842
+ if (decl !== false) {
843
+ decls.push(decl);
844
+ comments(decls);
845
+ }
846
+ }
847
+
848
+ return decls;
849
+ }
850
+
851
+ whitespace();
852
+ return declarations();
853
+ };
854
+
855
+ /**
856
+ * Trim `str`.
857
+ *
858
+ * @param {String} str
859
+ * @return {String}
860
+ */
861
+ function trim(str) {
862
+ return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;
863
+ }
864
+
865
+ /**
866
+ * Parses inline style to object.
867
+ *
868
+ * @example
869
+ * // returns { 'line-height': '42' }
870
+ * StyleToObject('line-height: 42;');
871
+ *
872
+ * @param {String} style - The inline style.
873
+ * @param {Function} [iterator] - The iterator function.
874
+ * @return {null|Object}
875
+ */
876
+ function StyleToObject(style, iterator) {
877
+ var output = null;
878
+ if (!style || typeof style !== 'string') {
879
+ return output;
880
+ }
881
+
882
+ var declaration;
883
+ var declarations = inlineStyleParser(style);
884
+ var hasIterator = typeof iterator === 'function';
885
+ var property;
886
+ var value;
887
+
888
+ for (var i = 0, len = declarations.length; i < len; i++) {
889
+ declaration = declarations[i];
890
+ property = declaration.property;
891
+ value = declaration.value;
892
+
893
+ if (hasIterator) {
894
+ iterator(property, value, declaration);
895
+ } else if (value) {
896
+ output || (output = {});
897
+ output[property] = value;
898
+ }
899
+ }
900
+
901
+ return output;
902
+ }
903
+
904
+ var styleToObject = StyleToObject;
905
+
906
+ var hyphenPatternRegex = /-([a-z])/g;
907
+ var CUSTOM_PROPERTY_OR_NO_HYPHEN_REGEX = /^--[a-zA-Z0-9-]+$|^[^-]+$/;
908
+
909
+ /**
910
+ * Converts a string to camelCase.
911
+ *
912
+ * @param {String} string - The string.
913
+ * @return {String}
914
+ */
915
+ function camelCase(string) {
916
+ if (typeof string !== 'string') {
917
+ throw new TypeError('First argument must be a string');
918
+ }
919
+
920
+ // custom property or no hyphen found
921
+ if (CUSTOM_PROPERTY_OR_NO_HYPHEN_REGEX.test(string)) {
922
+ return string;
923
+ }
924
+
925
+ // convert to camelCase
926
+ return string
927
+ .toLowerCase()
928
+ .replace(hyphenPatternRegex, function(_, character) {
929
+ return character.toUpperCase();
930
+ });
931
+ }
932
+
933
+ /**
934
+ * Swap key with value in an object.
935
+ *
936
+ * @param {Object} obj - The object.
937
+ * @param {Function} [override] - The override method.
938
+ * @return {Object} - The inverted object.
939
+ */
940
+ function invertObject(obj, override) {
941
+ if (!obj || typeof obj !== 'object') {
942
+ throw new TypeError('First argument must be an object');
943
+ }
944
+
945
+ var key;
946
+ var value;
947
+ var isOverridePresent = typeof override === 'function';
948
+ var overrides = {};
949
+ var result = {};
950
+
951
+ for (key in obj) {
952
+ value = obj[key];
953
+
954
+ if (isOverridePresent) {
955
+ overrides = override(key, value);
956
+ if (overrides && overrides.length === 2) {
957
+ result[overrides[0]] = overrides[1];
958
+ continue;
959
+ }
960
+ }
961
+
962
+ if (typeof value === 'string') {
963
+ result[value] = key;
964
+ }
965
+ }
966
+
967
+ return result;
968
+ }
969
+
970
+ /**
971
+ * Check if a given tag is a custom component.
972
+ *
973
+ * @see {@link https://github.com/facebook/react/blob/v16.6.3/packages/react-dom/src/shared/isCustomComponent.js}
974
+ *
975
+ * @param {string} tagName - The name of the html tag.
976
+ * @param {Object} props - The props being passed to the element.
977
+ * @return {boolean}
978
+ */
979
+ function isCustomComponent(tagName, props) {
980
+ if (tagName.indexOf('-') === -1) {
981
+ return props && typeof props.is === 'string';
982
+ }
983
+
984
+ switch (tagName) {
985
+ // These are reserved SVG and MathML elements.
986
+ // We don't mind this whitelist too much because we expect it to never grow.
987
+ // The alternative is to track the namespace in a few places which is convoluted.
988
+ // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
989
+ case 'annotation-xml':
990
+ case 'color-profile':
991
+ case 'font-face':
992
+ case 'font-face-src':
993
+ case 'font-face-uri':
994
+ case 'font-face-format':
995
+ case 'font-face-name':
996
+ case 'missing-glyph':
997
+ return false;
998
+ default:
999
+ return true;
1000
+ }
1001
+ }
1002
+
1003
+ /**
1004
+ * @constant {Boolean}
1005
+ * @see {@link https://reactjs.org/blog/2017/09/08/dom-attributes-in-react-16.html}
1006
+ */
1007
+ var PRESERVE_CUSTOM_ATTRIBUTES = react.version.split('.')[0] >= 16;
1008
+
1009
+ var utilities = {
1010
+ PRESERVE_CUSTOM_ATTRIBUTES: PRESERVE_CUSTOM_ATTRIBUTES,
1011
+ camelCase: camelCase,
1012
+ invertObject: invertObject,
1013
+ isCustomComponent: isCustomComponent
1014
+ };
1015
+
1016
+ var camelCase$1 = utilities.camelCase;
1017
+
1018
+ var htmlProperties = reactProperty.html;
1019
+ var svgProperties = reactProperty.svg;
1020
+ var isCustomAttribute = reactProperty.isCustomAttribute;
1021
+
1022
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1023
+
1024
+ /**
1025
+ * Converts HTML/SVG DOM attributes to React props.
1026
+ *
1027
+ * @param {Object} [attributes={}] - The HTML/SVG DOM attributes.
1028
+ * @return {Object} - The React props.
1029
+ */
1030
+ function attributesToProps(attributes) {
1031
+ attributes = attributes || {};
1032
+
1033
+ var attributeName;
1034
+ var attributeNameLowerCased;
1035
+ var attributeValue;
1036
+ var property;
1037
+ var props = {};
1038
+
1039
+ for (attributeName in attributes) {
1040
+ attributeValue = attributes[attributeName];
1041
+
1042
+ // ARIA (aria-*) or custom data (data-*) attribute
1043
+ if (isCustomAttribute(attributeName)) {
1044
+ props[attributeName] = attributeValue;
1045
+ continue;
1046
+ }
1047
+
1048
+ // convert HTML attribute to React prop
1049
+ attributeNameLowerCased = attributeName.toLowerCase();
1050
+ if (hasOwnProperty.call(htmlProperties, attributeNameLowerCased)) {
1051
+ property = htmlProperties[attributeNameLowerCased];
1052
+ props[property.propertyName] =
1053
+ property.hasBooleanValue ||
1054
+ (property.hasOverloadedBooleanValue && !attributeValue)
1055
+ ? true
1056
+ : attributeValue;
1057
+ continue;
1058
+ }
1059
+
1060
+ // convert SVG attribute to React prop
1061
+ if (hasOwnProperty.call(svgProperties, attributeName)) {
1062
+ property = svgProperties[attributeName];
1063
+ props[property.propertyName] = attributeValue;
1064
+ continue;
1065
+ }
1066
+
1067
+ // preserve custom attribute if React >=16
1068
+ if (utilities.PRESERVE_CUSTOM_ATTRIBUTES) {
1069
+ props[attributeName] = attributeValue;
1070
+ }
1071
+ }
1072
+
1073
+ // convert inline style to object
1074
+ if (attributes.style != null) {
1075
+ props.style = cssToJs(attributes.style);
1076
+ }
1077
+
1078
+ return props;
1079
+ }
1080
+
1081
+ /**
1082
+ * Converts CSS style string to JS style object.
1083
+ *
1084
+ * @param {String} style - The CSS style.
1085
+ * @return {Object} - The JS style object.
1086
+ */
1087
+ function cssToJs(style) {
1088
+ if (typeof style !== 'string') {
1089
+ throw new TypeError('First argument must be a string.');
1090
+ }
1091
+
1092
+ var styleObj = {};
1093
+
1094
+ styleToObject(style, function(property, value) {
1095
+ // skip if it's a comment node
1096
+ if (property && value) {
1097
+ styleObj[camelCase$1(property)] = value;
1098
+ }
1099
+ });
1100
+
1101
+ return styleObj;
1102
+ }
1103
+
1104
+ var attributesToProps_1 = attributesToProps;
1105
+
1106
+ var cloneElement = react.cloneElement;
1107
+ var createElement = react.createElement;
1108
+ var isValidElement = react.isValidElement;
1109
+
1110
+ /**
1111
+ * Converts DOM nodes to React elements.
1112
+ *
1113
+ * @param {Array} nodes - The DOM nodes.
1114
+ * @param {Object} [options] - The additional options.
1115
+ * @param {Function} [options.replace] - The replace method.
1116
+ * @return {ReactElement|Array}
1117
+ */
1118
+ function domToReact(nodes, options) {
1119
+ options = options || {};
1120
+ var result = [];
1121
+ var node;
1122
+ var hasReplace = typeof options.replace === 'function';
1123
+ var replaceElement;
1124
+ var props;
1125
+ var children;
1126
+
1127
+ for (var i = 0, len = nodes.length; i < len; i++) {
1128
+ node = nodes[i];
1129
+
1130
+ // replace with custom React element (if present)
1131
+ if (hasReplace) {
1132
+ replaceElement = options.replace(node);
1133
+
1134
+ if (isValidElement(replaceElement)) {
1135
+ // specify a "key" prop if element has siblings
1136
+ // https://fb.me/react-warning-keys
1137
+ if (len > 1) {
1138
+ replaceElement = cloneElement(replaceElement, {
1139
+ key: replaceElement.key || i
1140
+ });
1141
+ }
1142
+ result.push(replaceElement);
1143
+ continue;
1144
+ }
1145
+ }
1146
+
1147
+ if (node.type === 'text') {
1148
+ result.push(node.data);
1149
+ continue;
1150
+ }
1151
+
1152
+ props = node.attribs;
1153
+ if (!shouldPassAttributesUnaltered(node)) {
1154
+ // update values
1155
+ props = attributesToProps_1(node.attribs);
1156
+ }
1157
+
1158
+ children = null;
1159
+
1160
+ // node type for <script> is "script"
1161
+ // node type for <style> is "style"
1162
+ if (node.type === 'script' || node.type === 'style') {
1163
+ // prevent text in <script> or <style> from being escaped
1164
+ // https://facebook.github.io/react/tips/dangerously-set-inner-html.html
1165
+ if (node.children[0]) {
1166
+ props.dangerouslySetInnerHTML = {
1167
+ __html: node.children[0].data
1168
+ };
1169
+ }
1170
+ } else if (node.type === 'tag') {
1171
+ // setting textarea value in children is an antipattern in React
1172
+ // https://reactjs.org/docs/forms.html#the-textarea-tag
1173
+ if (node.name === 'textarea' && node.children[0]) {
1174
+ props.defaultValue = node.children[0].data;
1175
+
1176
+ // continue recursion of creating React elements (if applicable)
1177
+ } else if (node.children && node.children.length) {
1178
+ children = domToReact(node.children, options);
1179
+ }
1180
+
1181
+ // skip all other cases (e.g., comment)
1182
+ } else {
1183
+ continue;
1184
+ }
1185
+
1186
+ // specify a "key" prop if element has siblings
1187
+ // https://fb.me/react-warning-keys
1188
+ if (len > 1) {
1189
+ props.key = i;
1190
+ }
1191
+
1192
+ result.push(createElement(node.name, props, children));
1193
+ }
1194
+
1195
+ return result.length === 1 ? result[0] : result;
1196
+ }
1197
+
1198
+ function shouldPassAttributesUnaltered(node) {
1199
+ return (
1200
+ utilities.PRESERVE_CUSTOM_ATTRIBUTES &&
1201
+ node.type === 'tag' &&
1202
+ utilities.isCustomComponent(node.name, node.attribs)
1203
+ );
1204
+ }
1205
+
1206
+ var domToReact_1 = domToReact;
1207
+
1208
+ /**
1209
+ * SVG elements are case-sensitive.
1210
+ *
1211
+ * @see {@link https://developer.mozilla.org/docs/Web/SVG/Element#SVG_elements_A_to_Z}
1212
+ */
1213
+ var CASE_SENSITIVE_TAG_NAMES = [
1214
+ 'animateMotion',
1215
+ 'animateTransform',
1216
+ 'clipPath',
1217
+ 'feBlend',
1218
+ 'feColorMatrix',
1219
+ 'feComponentTransfer',
1220
+ 'feComposite',
1221
+ 'feConvolveMatrix',
1222
+ 'feDiffuseLighting',
1223
+ 'feDisplacementMap',
1224
+ 'feDropShadow',
1225
+ 'feFlood',
1226
+ 'feFuncA',
1227
+ 'feFuncB',
1228
+ 'feFuncG',
1229
+ 'feFuncR',
1230
+ 'feGaussainBlur',
1231
+ 'feImage',
1232
+ 'feMerge',
1233
+ 'feMergeNode',
1234
+ 'feMorphology',
1235
+ 'feOffset',
1236
+ 'fePointLight',
1237
+ 'feSpecularLighting',
1238
+ 'feSpotLight',
1239
+ 'feTile',
1240
+ 'feTurbulence',
1241
+ 'foreignObject',
1242
+ 'linearGradient',
1243
+ 'radialGradient',
1244
+ 'textPath'
1245
+ ];
1246
+
1247
+ var constants = {
1248
+ CASE_SENSITIVE_TAG_NAMES: CASE_SENSITIVE_TAG_NAMES
1249
+ };
1250
+
1251
+ var CASE_SENSITIVE_TAG_NAMES$1 = constants.CASE_SENSITIVE_TAG_NAMES;
1252
+
1253
+ var caseSensitiveTagNamesMap = {};
1254
+ var tagName;
1255
+ for (var i = 0, len = CASE_SENSITIVE_TAG_NAMES$1.length; i < len; i++) {
1256
+ tagName = CASE_SENSITIVE_TAG_NAMES$1[i];
1257
+ caseSensitiveTagNamesMap[tagName.toLowerCase()] = tagName;
1258
+ }
1259
+
1260
+ /**
1261
+ * Gets case-sensitive tag name.
1262
+ *
1263
+ * @param {String} tagName - The lowercase tag name.
1264
+ * @return {String|undefined}
1265
+ */
1266
+ function getCaseSensitiveTagName(tagName) {
1267
+ return caseSensitiveTagNamesMap[tagName];
1268
+ }
1269
+
1270
+ /**
1271
+ * Formats DOM attributes to a hash map.
1272
+ *
1273
+ * @param {NamedNodeMap} attributes - The list of attributes.
1274
+ * @return {Object} - A map of attribute name to value.
1275
+ */
1276
+ function formatAttributes(attributes) {
1277
+ var result = {};
1278
+ var attribute;
1279
+ // `NamedNodeMap` is array-like
1280
+ for (var i = 0, len = attributes.length; i < len; i++) {
1281
+ attribute = attributes[i];
1282
+ result[attribute.name] = attribute.value;
1283
+ }
1284
+ return result;
1285
+ }
1286
+
1287
+ /**
1288
+ * Corrects the tag name if it is case-sensitive (SVG).
1289
+ * Otherwise, returns the lowercase tag name (HTML).
1290
+ *
1291
+ * @param {String} tagName - The lowercase tag name.
1292
+ * @return {String} - The formatted tag name.
1293
+ */
1294
+ function formatTagName(tagName) {
1295
+ tagName = tagName.toLowerCase();
1296
+ var caseSensitiveTagName = getCaseSensitiveTagName(tagName);
1297
+ if (caseSensitiveTagName) {
1298
+ return caseSensitiveTagName;
1299
+ }
1300
+ return tagName;
1301
+ }
1302
+
1303
+ /**
1304
+ * Formats the browser DOM nodes to mimic the output of `htmlparser2.parseDOM()`.
1305
+ *
1306
+ * @param {NodeList} nodes - The DOM nodes.
1307
+ * @param {Object} [parentObj] - The formatted parent node.
1308
+ * @param {String} [directive] - The directive.
1309
+ * @return {Object[]} - The formatted DOM object.
1310
+ */
1311
+ function formatDOM(nodes, parentObj, directive) {
1312
+ parentObj = parentObj || null;
1313
+
1314
+ var result = [];
1315
+ var node;
1316
+ var prevNode;
1317
+ var nodeObj;
1318
+
1319
+ // `NodeList` is array-like
1320
+ for (var i = 0, len = nodes.length; i < len; i++) {
1321
+ node = nodes[i];
1322
+ // reset
1323
+ nodeObj = {
1324
+ next: null,
1325
+ prev: result[i - 1] || null,
1326
+ parent: parentObj
1327
+ };
1328
+
1329
+ // set the next node for the previous node (if applicable)
1330
+ prevNode = result[i - 1];
1331
+ if (prevNode) {
1332
+ prevNode.next = nodeObj;
1333
+ }
1334
+
1335
+ // set the node name if it's not "#text" or "#comment"
1336
+ // e.g., "div"
1337
+ if (node.nodeName[0] !== '#') {
1338
+ nodeObj.name = formatTagName(node.nodeName);
1339
+ // also, nodes of type "tag" have "attribs"
1340
+ nodeObj.attribs = {}; // default
1341
+ if (node.attributes && node.attributes.length) {
1342
+ nodeObj.attribs = formatAttributes(node.attributes);
1343
+ }
1344
+ }
1345
+
1346
+ // set the node type
1347
+ // e.g., "tag"
1348
+ switch (node.nodeType) {
1349
+ // 1 = element
1350
+ case 1:
1351
+ if (nodeObj.name === 'script' || nodeObj.name === 'style') {
1352
+ nodeObj.type = nodeObj.name;
1353
+ } else {
1354
+ nodeObj.type = 'tag';
1355
+ }
1356
+ // recursively format the children
1357
+ nodeObj.children = formatDOM(node.childNodes, nodeObj);
1358
+ break;
1359
+ // 2 = attribute
1360
+ // 3 = text
1361
+ case 3:
1362
+ nodeObj.type = 'text';
1363
+ nodeObj.data = node.nodeValue;
1364
+ break;
1365
+ // 8 = comment
1366
+ case 8:
1367
+ nodeObj.type = 'comment';
1368
+ nodeObj.data = node.nodeValue;
1369
+ break;
1370
+ }
1371
+
1372
+ result.push(nodeObj);
1373
+ }
1374
+
1375
+ if (directive) {
1376
+ result.unshift({
1377
+ name: directive.substring(0, directive.indexOf(' ')).toLowerCase(),
1378
+ data: directive,
1379
+ type: 'directive',
1380
+ next: result[0] ? result[0] : null,
1381
+ prev: null,
1382
+ parent: parentObj
1383
+ });
1384
+
1385
+ if (result[1]) {
1386
+ result[1].prev = result[0];
1387
+ }
1388
+ }
1389
+
1390
+ return result;
1391
+ }
1392
+
1393
+ /**
1394
+ * Detects IE with or without version.
1395
+ *
1396
+ * @param {Number} [version] - The IE version to detect.
1397
+ * @return {Boolean} - Whether IE or the version has been detected.
1398
+ */
1399
+ function isIE(version) {
1400
+ if (version) {
1401
+ return document.documentMode === version;
1402
+ }
1403
+ return /(MSIE |Trident\/|Edge\/)/.test(navigator.userAgent);
1404
+ }
1405
+
1406
+ var utilities$1 = {
1407
+ formatAttributes: formatAttributes,
1408
+ formatDOM: formatDOM,
1409
+ isIE: isIE
1410
+ };
1411
+
1412
+ // constants
1413
+ var HTML = 'html';
1414
+ var HEAD = 'head';
1415
+ var BODY = 'body';
1416
+ var FIRST_TAG_REGEX = /<([a-zA-Z]+[0-9]?)/; // e.g., <h1>
1417
+ var HEAD_TAG_REGEX = /<head.*>/i;
1418
+ var BODY_TAG_REGEX = /<body.*>/i;
1419
+ // http://www.w3.org/TR/html/syntax.html#void-elements
1420
+ var VOID_ELEMENTS_REGEX = /<(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)(.*?)\/?>/gi;
1421
+
1422
+ // detect IE browser
1423
+ var isIE9 = utilities$1.isIE(9);
1424
+ var isIE$1 = isIE9 || utilities$1.isIE();
1425
+
1426
+ /**
1427
+ * DOMParser (performance: slow).
1428
+ *
1429
+ * @see https://developer.mozilla.org/docs/Web/API/DOMParser#Parsing_an_SVG_or_HTML_document
1430
+ */
1431
+ var parseFromString;
1432
+
1433
+ if (typeof window.DOMParser === 'function') {
1434
+ var domParser = new window.DOMParser();
1435
+
1436
+ // IE9 does not support 'text/html' MIME type
1437
+ // https://msdn.microsoft.com/en-us/library/ff975278(v=vs.85).aspx
1438
+ var mimeType = isIE9 ? 'text/xml' : 'text/html';
1439
+
1440
+ /**
1441
+ * Creates an HTML document using `DOMParser.parseFromString`.
1442
+ *
1443
+ * @param {string} html - The HTML string.
1444
+ * @param {string} [tagName] - The element to render the HTML (with 'body' as fallback).
1445
+ * @return {HTMLDocument}
1446
+ */
1447
+ parseFromString = function domStringParser(html, tagName) {
1448
+ if (tagName) {
1449
+ html = '<' + tagName + '>' + html + '</' + tagName + '>';
1450
+ }
1451
+
1452
+ // because IE9 only supports MIME type 'text/xml', void elements need to be self-closed
1453
+ if (isIE9) {
1454
+ html = html.replace(VOID_ELEMENTS_REGEX, '<$1$2$3/>');
1455
+ }
1456
+
1457
+ return domParser.parseFromString(html, mimeType);
1458
+ };
1459
+ }
1460
+
1461
+ /**
1462
+ * DOMImplementation (performance: fair).
1463
+ *
1464
+ * @see https://developer.mozilla.org/docs/Web/API/DOMImplementation/createHTMLDocument
1465
+ */
1466
+ var parseFromDocument;
1467
+
1468
+ if (typeof document.implementation === 'object') {
1469
+ // title parameter is required in IE
1470
+ // https://msdn.microsoft.com/en-us/library/ff975457(v=vs.85).aspx
1471
+ var doc = document.implementation.createHTMLDocument(
1472
+ isIE$1 ? 'HTML_DOM_PARSER_TITLE' : undefined
1473
+ );
1474
+
1475
+ /**
1476
+ * Use HTML document created by `document.implementation.createHTMLDocument`.
1477
+ *
1478
+ * @param {string} html - The HTML string.
1479
+ * @param {string} [tagName] - The element to render the HTML (with 'body' as fallback).
1480
+ * @return {HTMLDocument}
1481
+ */
1482
+ parseFromDocument = function createHTMLDocument(html, tagName) {
1483
+ if (tagName) {
1484
+ doc.documentElement.getElementsByTagName(tagName)[0].innerHTML = html;
1485
+ return doc;
1486
+ }
1487
+
1488
+ try {
1489
+ doc.documentElement.innerHTML = html;
1490
+ return doc;
1491
+ // fallback when certain elements in `documentElement` are read-only (IE9)
1492
+ } catch (err) {
1493
+ if (parseFromString) {
1494
+ return parseFromString(html);
1495
+ }
1496
+ }
1497
+ };
1498
+ }
1499
+
1500
+ /**
1501
+ * Template (performance: fast).
1502
+ *
1503
+ * @see https://developer.mozilla.org/docs/Web/HTML/Element/template
1504
+ */
1505
+ var parseFromTemplate;
1506
+ var template = document.createElement('template');
1507
+
1508
+ if (template.content) {
1509
+ /**
1510
+ * Uses a template element (content fragment) to parse HTML.
1511
+ *
1512
+ * @param {string} html - The HTML string.
1513
+ * @return {NodeList}
1514
+ */
1515
+ parseFromTemplate = function templateParser(html) {
1516
+ template.innerHTML = html;
1517
+ return template.content.childNodes;
1518
+ };
1519
+ }
1520
+
1521
+ // fallback document parser
1522
+ var parseWithFallback = parseFromDocument || parseFromString;
1523
+
1524
+ /**
1525
+ * Parses HTML string to DOM nodes.
1526
+ *
1527
+ * @param {string} html - The HTML string.
1528
+ * @return {NodeList|Array}
1529
+ */
1530
+ function domparser(html) {
1531
+ var firstTagName;
1532
+ var match = html.match(FIRST_TAG_REGEX);
1533
+
1534
+ if (match && match[1]) {
1535
+ firstTagName = match[1].toLowerCase();
1536
+ }
1537
+
1538
+ var doc;
1539
+ var element;
1540
+ var elements;
1541
+
1542
+ switch (firstTagName) {
1543
+ case HTML:
1544
+ if (parseFromString) {
1545
+ doc = parseFromString(html);
1546
+
1547
+ // the created document may come with filler head/body elements,
1548
+ // so make sure to remove them if they don't actually exist
1549
+ if (!HEAD_TAG_REGEX.test(html)) {
1550
+ element = doc.getElementsByTagName(HEAD)[0];
1551
+ if (element) {
1552
+ element.parentNode.removeChild(element);
1553
+ }
1554
+ }
1555
+
1556
+ if (!BODY_TAG_REGEX.test(html)) {
1557
+ element = doc.getElementsByTagName(BODY)[0];
1558
+ if (element) {
1559
+ element.parentNode.removeChild(element);
1560
+ }
1561
+ }
1562
+
1563
+ return doc.getElementsByTagName(HTML);
1564
+ }
1565
+ break;
1566
+
1567
+ case HEAD:
1568
+ case BODY:
1569
+ if (parseWithFallback) {
1570
+ elements = parseWithFallback(html).getElementsByTagName(firstTagName);
1571
+
1572
+ // account for possibility of sibling
1573
+ if (BODY_TAG_REGEX.test(html) && HEAD_TAG_REGEX.test(html)) {
1574
+ return elements[0].parentNode.childNodes;
1575
+ }
1576
+
1577
+ return elements;
1578
+ }
1579
+ break;
1580
+
1581
+ // low-level tag or text
1582
+ default:
1583
+ if (parseFromTemplate) {
1584
+ return parseFromTemplate(html);
1585
+ }
1586
+
1587
+ if (parseWithFallback) {
1588
+ return parseWithFallback(html, BODY).getElementsByTagName(BODY)[0]
1589
+ .childNodes;
1590
+ }
1591
+
1592
+ break;
1593
+ }
1594
+
1595
+ return [];
1596
+ }
1597
+
1598
+ var domparser_1 = domparser;
1599
+
1600
+ var formatDOM$1 = utilities$1.formatDOM;
1601
+ var isIE9$1 = utilities$1.isIE(9);
1602
+
1603
+ var DIRECTIVE_REGEX = /<(![a-zA-Z\s]+)>/; // e.g., <!doctype html>
1604
+
1605
+ /**
1606
+ * Parses HTML and reformats DOM nodes output.
1607
+ *
1608
+ * @param {String} html - The HTML string.
1609
+ * @return {Array} - The formatted DOM nodes.
1610
+ */
1611
+ function parseDOM(html) {
1612
+ if (typeof html !== 'string') {
1613
+ throw new TypeError('First argument must be a string');
1614
+ }
1615
+
1616
+ if (!html) {
1617
+ return [];
1618
+ }
1619
+
1620
+ // match directive
1621
+ var match = html.match(DIRECTIVE_REGEX);
1622
+ var directive;
1623
+
1624
+ if (match && match[1]) {
1625
+ directive = match[1];
1626
+
1627
+ // remove directive in IE9 because DOMParser uses
1628
+ // MIME type 'text/xml' instead of 'text/html'
1629
+ if (isIE9$1) {
1630
+ html = html.replace(match[0], '');
1631
+ }
1632
+ }
1633
+
1634
+ return formatDOM$1(domparser_1(html), null, directive);
1635
+ }
1636
+
1637
+ var htmlToDomClient = parseDOM;
1638
+
1639
+ /**
1640
+ * Converts HTML string to React elements.
1641
+ *
1642
+ * @param {String} html - The HTML string to parse to React.
1643
+ * @param {Object} [options] - The parser options.
1644
+ * @param {Function} [options.replace] - The replace method.
1645
+ * @return {ReactElement|Array|String} - When parsed with HTML string, returns React elements; otherwise, returns string or empty array.
1646
+ */
1647
+ function HTMLReactParser(html, options) {
1648
+ if (typeof html !== 'string') {
1649
+ throw new TypeError('First argument must be a string');
1650
+ }
1651
+ return domToReact_1(htmlToDomClient(html), options);
1652
+ }
1653
+
1654
+ HTMLReactParser.domToReact = domToReact_1;
1655
+ HTMLReactParser.htmlToDOM = htmlToDomClient;
1656
+
1657
+ var htmlReactParser = HTMLReactParser;
1658
+
1659
+ return htmlReactParser;
1660
+
1661
+ }));