@20minutes/draft-convert 3.0.0 → 3.0.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.
Files changed (42) hide show
  1. package/README.md +29 -0
  2. package/dist/draft-convert.js +440 -0
  3. package/dist/draft-convert.min.js +1 -0
  4. package/esm/blockEntities.js +67 -0
  5. package/esm/blockInlineStyles.js +98 -0
  6. package/esm/convertFromHTML.js +537 -0
  7. package/esm/convertToHTML.js +107 -0
  8. package/esm/default/defaultBlockHTML.js +33 -0
  9. package/esm/default/defaultInlineHTML.js +18 -0
  10. package/esm/encodeBlock.js +44 -0
  11. package/esm/index.js +4 -0
  12. package/esm/util/accumulateFunction.js +9 -0
  13. package/esm/util/blockTypeObjectFunction.js +9 -0
  14. package/esm/util/getBlockTags.js +27 -0
  15. package/esm/util/getElementHTML.js +36 -0
  16. package/esm/util/getElementTagLength.js +20 -0
  17. package/esm/util/getNestedBlockTags.js +29 -0
  18. package/esm/util/parseHTML.js +18 -0
  19. package/esm/util/rangeSort.js +6 -0
  20. package/esm/util/splitReactElement.js +18 -0
  21. package/esm/util/styleObjectFunction.js +8 -0
  22. package/esm/util/updateMutation.js +48 -0
  23. package/lib/blockEntities.js +74 -0
  24. package/lib/blockInlineStyles.js +105 -0
  25. package/lib/convertFromHTML.js +544 -0
  26. package/lib/convertToHTML.js +114 -0
  27. package/lib/default/defaultBlockHTML.js +39 -0
  28. package/lib/default/defaultInlineHTML.js +25 -0
  29. package/lib/encodeBlock.js +51 -0
  30. package/lib/index.js +27 -0
  31. package/lib/util/accumulateFunction.js +15 -0
  32. package/lib/util/blockTypeObjectFunction.js +15 -0
  33. package/lib/util/getBlockTags.js +34 -0
  34. package/lib/util/getElementHTML.js +43 -0
  35. package/lib/util/getElementTagLength.js +27 -0
  36. package/lib/util/getNestedBlockTags.js +36 -0
  37. package/lib/util/parseHTML.js +24 -0
  38. package/lib/util/rangeSort.js +12 -0
  39. package/lib/util/splitReactElement.js +24 -0
  40. package/lib/util/styleObjectFunction.js +14 -0
  41. package/lib/util/updateMutation.js +55 -0
  42. package/package.json +18 -18
@@ -0,0 +1,440 @@
1
+ /*
2
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
3
+ * This devtool is neither made for production nor for readable output files.
4
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
5
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
6
+ * or disable the default devtool with "devtool: false".
7
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
8
+ */
9
+ (function webpackUniversalModuleDefinition(root, factory) {
10
+ if(typeof exports === 'object' && typeof module === 'object')
11
+ module.exports = factory(require("React"), require("ReactDOMServer"), require("Draft"), require("Immutable"));
12
+ else if(typeof define === 'function' && define.amd)
13
+ define(["React", "ReactDOMServer", "Draft", "Immutable"], factory);
14
+ else if(typeof exports === 'object')
15
+ exports["DraftConvert"] = factory(require("React"), require("ReactDOMServer"), require("Draft"), require("Immutable"));
16
+ else
17
+ root["DraftConvert"] = factory(root["React"], root["ReactDOMServer"], root["Draft"], root["Immutable"]);
18
+ })(self, (__WEBPACK_EXTERNAL_MODULE_react__, __WEBPACK_EXTERNAL_MODULE_react_dom_server__, __WEBPACK_EXTERNAL_MODULE_draft_js__, __WEBPACK_EXTERNAL_MODULE_immutable__) => {
19
+ return /******/ (() => { // webpackBootstrap
20
+ /******/ "use strict";
21
+ /******/ var __webpack_modules__ = ({
22
+
23
+ /***/ "./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":
24
+ /*!*********************************************************************!*\
25
+ !*** ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js ***!
26
+ \*********************************************************************/
27
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
28
+
29
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _arrayLikeToArray)\n/* harmony export */ });\nfunction _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\n\n\n//# sourceURL=webpack://DraftConvert/./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js?");
30
+
31
+ /***/ }),
32
+
33
+ /***/ "./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js":
34
+ /*!**********************************************************************!*\
35
+ !*** ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js ***!
36
+ \**********************************************************************/
37
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
38
+
39
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _arrayWithoutHoles)\n/* harmony export */ });\n/* harmony import */ var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayLikeToArray.js */ \"./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js\");\n\nfunction _arrayWithoutHoles(r) {\n if (Array.isArray(r)) return (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(r);\n}\n\n\n//# sourceURL=webpack://DraftConvert/./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js?");
40
+
41
+ /***/ }),
42
+
43
+ /***/ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js":
44
+ /*!*******************************************************************!*\
45
+ !*** ./node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
46
+ \*******************************************************************/
47
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
48
+
49
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _defineProperty)\n/* harmony export */ });\n/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ \"./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js\");\n\nfunction _defineProperty(e, r, t) {\n return (r = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\n\n\n//# sourceURL=webpack://DraftConvert/./node_modules/@babel/runtime/helpers/esm/defineProperty.js?");
50
+
51
+ /***/ }),
52
+
53
+ /***/ "./node_modules/@babel/runtime/helpers/esm/iterableToArray.js":
54
+ /*!********************************************************************!*\
55
+ !*** ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js ***!
56
+ \********************************************************************/
57
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
58
+
59
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _iterableToArray)\n/* harmony export */ });\nfunction _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\n\n\n//# sourceURL=webpack://DraftConvert/./node_modules/@babel/runtime/helpers/esm/iterableToArray.js?");
60
+
61
+ /***/ }),
62
+
63
+ /***/ "./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js":
64
+ /*!**********************************************************************!*\
65
+ !*** ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js ***!
66
+ \**********************************************************************/
67
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
68
+
69
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _nonIterableSpread)\n/* harmony export */ });\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\n\n//# sourceURL=webpack://DraftConvert/./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js?");
70
+
71
+ /***/ }),
72
+
73
+ /***/ "./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js":
74
+ /*!**********************************************************************!*\
75
+ !*** ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js ***!
76
+ \**********************************************************************/
77
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
78
+
79
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _toConsumableArray)\n/* harmony export */ });\n/* harmony import */ var _arrayWithoutHoles_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithoutHoles.js */ \"./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js\");\n/* harmony import */ var _iterableToArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArray.js */ \"./node_modules/@babel/runtime/helpers/esm/iterableToArray.js\");\n/* harmony import */ var _unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unsupportedIterableToArray.js */ \"./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js\");\n/* harmony import */ var _nonIterableSpread_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./nonIterableSpread.js */ \"./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js\");\n\n\n\n\nfunction _toConsumableArray(r) {\n return (0,_arrayWithoutHoles_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(r) || (0,_iterableToArray_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(r) || (0,_unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(r) || (0,_nonIterableSpread_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])();\n}\n\n\n//# sourceURL=webpack://DraftConvert/./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js?");
80
+
81
+ /***/ }),
82
+
83
+ /***/ "./node_modules/@babel/runtime/helpers/esm/toPrimitive.js":
84
+ /*!****************************************************************!*\
85
+ !*** ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
86
+ \****************************************************************/
87
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
88
+
89
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ toPrimitive)\n/* harmony export */ });\n/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ \"./node_modules/@babel/runtime/helpers/esm/typeof.js\");\n\nfunction toPrimitive(t, r) {\n if (\"object\" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\n\n\n//# sourceURL=webpack://DraftConvert/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js?");
90
+
91
+ /***/ }),
92
+
93
+ /***/ "./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":
94
+ /*!******************************************************************!*\
95
+ !*** ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***!
96
+ \******************************************************************/
97
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
98
+
99
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ toPropertyKey)\n/* harmony export */ });\n/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ \"./node_modules/@babel/runtime/helpers/esm/typeof.js\");\n/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ \"./node_modules/@babel/runtime/helpers/esm/toPrimitive.js\");\n\n\nfunction toPropertyKey(t) {\n var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(t, \"string\");\n return \"symbol\" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(i) ? i : i + \"\";\n}\n\n\n//# sourceURL=webpack://DraftConvert/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js?");
100
+
101
+ /***/ }),
102
+
103
+ /***/ "./node_modules/@babel/runtime/helpers/esm/typeof.js":
104
+ /*!***********************************************************!*\
105
+ !*** ./node_modules/@babel/runtime/helpers/esm/typeof.js ***!
106
+ \***********************************************************/
107
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
108
+
109
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _typeof)\n/* harmony export */ });\nfunction _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\n\n\n//# sourceURL=webpack://DraftConvert/./node_modules/@babel/runtime/helpers/esm/typeof.js?");
110
+
111
+ /***/ }),
112
+
113
+ /***/ "./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":
114
+ /*!*******************************************************************************!*\
115
+ !*** ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js ***!
116
+ \*******************************************************************************/
117
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
118
+
119
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _unsupportedIterableToArray)\n/* harmony export */ });\n/* harmony import */ var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayLikeToArray.js */ \"./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js\");\n\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(r, a) : void 0;\n }\n}\n\n\n//# sourceURL=webpack://DraftConvert/./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js?");
120
+
121
+ /***/ }),
122
+
123
+ /***/ "./node_modules/invariant/browser.js":
124
+ /*!*******************************************!*\
125
+ !*** ./node_modules/invariant/browser.js ***!
126
+ \*******************************************/
127
+ /***/ ((module) => {
128
+
129
+ 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 * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (true) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n\n\n//# sourceURL=webpack://DraftConvert/./node_modules/invariant/browser.js?");
130
+
131
+ /***/ }),
132
+
133
+ /***/ "./src/blockEntities.js":
134
+ /*!******************************!*\
135
+ !*** ./src/blockEntities.js ***!
136
+ \******************************/
137
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
138
+
139
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\");\n/* harmony import */ var _util_updateMutation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/updateMutation */ \"./src/util/updateMutation.js\");\n/* harmony import */ var _util_rangeSort__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/rangeSort */ \"./src/util/rangeSort.js\");\n/* harmony import */ var _util_getElementHTML__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/getElementHTML */ \"./src/util/getElementHTML.js\");\n/* harmony import */ var _util_getElementTagLength__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/getElementTagLength */ \"./src/util/getElementTagLength.js\");\n\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n\n\n\n\nvar converter = function converter() {\n var entity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var originalText = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return originalText;\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (block, entityMap) {\n var entityConverter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : converter;\n var resultText = (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(block.text);\n var getEntityHTML = entityConverter;\n if (entityConverter.__isMiddleware) {\n getEntityHTML = entityConverter(converter);\n }\n if (Object.prototype.hasOwnProperty.call(block, 'entityRanges') && block.entityRanges.length > 0) {\n var entities = block.entityRanges.sort(_util_rangeSort__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n var styles = block.inlineStyleRanges;\n var _loop = function _loop(index) {\n var entityRange = entities[index];\n var entity = entityMap[entityRange.key];\n var originalText = resultText.slice(entityRange.offset, entityRange.offset + entityRange.length).join('');\n var entityHTML = getEntityHTML(entity, originalText);\n var elementHTML = (0,_util_getElementHTML__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(entityHTML, originalText);\n var converted;\n if (!!elementHTML || elementHTML === '') {\n converted = (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(elementHTML);\n } else {\n converted = originalText;\n }\n var prefixLength = (0,_util_getElementTagLength__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(entityHTML, 'start');\n var suffixLength = (0,_util_getElementTagLength__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(entityHTML, 'end');\n var updateLaterMutation = function updateLaterMutation(mutation, mutationIndex) {\n if (mutationIndex > index || Object.prototype.hasOwnProperty.call(mutation, 'style')) {\n return (0,_util_updateMutation__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(mutation, entityRange.offset, entityRange.length, converted.length, prefixLength, suffixLength);\n }\n return mutation;\n };\n var updateLaterMutations = function updateLaterMutations(mutationList) {\n return mutationList.reduce(function (acc, mutation, mutationIndex) {\n var updatedMutation = updateLaterMutation(mutation, mutationIndex);\n if (Array.isArray(updatedMutation)) {\n return acc.concat(updatedMutation);\n }\n return acc.concat([updatedMutation]);\n }, []);\n };\n entities = updateLaterMutations(entities);\n styles = updateLaterMutations(styles);\n resultText = [].concat((0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(resultText.slice(0, entityRange.offset)), (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(converted), (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(resultText.slice(entityRange.offset + entityRange.length)));\n };\n for (var index = 0; index < entities.length; index += 1) {\n _loop(index);\n }\n return _objectSpread(_objectSpread({}, block), {}, {\n text: resultText.join(''),\n inlineStyleRanges: styles,\n entityRanges: entities\n });\n }\n return block;\n});\n\n//# sourceURL=webpack://DraftConvert/./src/blockEntities.js?");
140
+
141
+ /***/ }),
142
+
143
+ /***/ "./src/blockInlineStyles.js":
144
+ /*!**********************************!*\
145
+ !*** ./src/blockInlineStyles.js ***!
146
+ \**********************************/
147
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
148
+
149
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\");\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _util_styleObjectFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/styleObjectFunction */ \"./src/util/styleObjectFunction.js\");\n/* harmony import */ var _util_accumulateFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/accumulateFunction */ \"./src/util/accumulateFunction.js\");\n/* harmony import */ var _util_getElementHTML__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/getElementHTML */ \"./src/util/getElementHTML.js\");\n/* harmony import */ var _util_rangeSort__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/rangeSort */ \"./src/util/rangeSort.js\");\n/* harmony import */ var _default_defaultInlineHTML__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./default/defaultInlineHTML */ \"./src/default/defaultInlineHTML.js\");\n\n\n\n\n\n\n\nvar subtractStyles = function subtractStyles(original, toRemove) {\n return original.filter(function (el) {\n return !toRemove.some(function (elToRemove) {\n return elToRemove.style === el.style;\n });\n });\n};\nvar popEndingStyles = function popEndingStyles(styleStack, endingStyles) {\n return endingStyles.reduceRight(function (stack, style) {\n var styleToRemove = stack[stack.length - 1];\n invariant__WEBPACK_IMPORTED_MODULE_1___default()(styleToRemove.style === style.style, \"Style \".concat(styleToRemove.style, \" to be removed doesn't match expected \").concat(style.style));\n return stack.slice(0, -1);\n }, styleStack);\n};\nvar characterStyles = function characterStyles(offset, ranges) {\n return ranges.filter(function (range) {\n return offset >= range.offset && offset < range.offset + range.length;\n });\n};\nvar rangeIsSubset = function rangeIsSubset(firstRange, secondRange) {\n // returns true if the second range is a subset of the first\n var secondStartWithinFirst = firstRange.offset <= secondRange.offset;\n var secondEndWithinFirst = firstRange.offset + firstRange.length >= secondRange.offset + secondRange.length;\n return secondStartWithinFirst && secondEndWithinFirst;\n};\nvar latestStyleLast = function latestStyleLast(s1, s2) {\n // make sure longer-lasting styles are added first\n var s2endIndex = s2.offset + s2.length;\n var s1endIndex = s1.offset + s1.length;\n return s2endIndex - s1endIndex;\n};\nvar getStylesToReset = function getStylesToReset(remainingStyles, newStyles) {\n var i = 0;\n while (i < remainingStyles.length) {\n if (newStyles.every(rangeIsSubset.bind(null, remainingStyles[i]))) {\n i += 1;\n } else {\n return remainingStyles.slice(i);\n }\n }\n return [];\n};\nvar appendStartMarkup = function appendStartMarkup(inlineHTML, string, styleRange) {\n return string + (0,_util_getElementHTML__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(inlineHTML(styleRange.style)).start;\n};\nvar prependEndMarkup = function prependEndMarkup(inlineHTML, string, styleRange) {\n return (0,_util_getElementHTML__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(inlineHTML(styleRange.style)).end + string;\n};\nvar defaultCustomInlineHTML = function defaultCustomInlineHTML(next) {\n return function (style) {\n return next(style);\n };\n};\ndefaultCustomInlineHTML.__isMiddleware = true;\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (rawBlock) {\n var customInlineHTML = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultCustomInlineHTML;\n invariant__WEBPACK_IMPORTED_MODULE_1___default()(rawBlock !== null && rawBlock !== undefined, 'Expected raw block to be non-null');\n var inlineHTML;\n if (customInlineHTML.__isMiddleware === true) {\n inlineHTML = customInlineHTML(_default_defaultInlineHTML__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\n } else {\n inlineHTML = (0,_util_accumulateFunction__WEBPACK_IMPORTED_MODULE_3__[\"default\"])((0,_util_styleObjectFunction__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(customInlineHTML), (0,_util_styleObjectFunction__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_default_defaultInlineHTML__WEBPACK_IMPORTED_MODULE_6__[\"default\"]));\n }\n var result = '';\n var styleStack = [];\n var sortedRanges = rawBlock.inlineStyleRanges.sort(_util_rangeSort__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n var originalTextArray = (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(rawBlock.text);\n for (var i = 0; i < originalTextArray.length; i += 1) {\n var styles = characterStyles(i, sortedRanges);\n var endingStyles = subtractStyles(styleStack, styles);\n var newStyles = subtractStyles(styles, styleStack);\n var remainingStyles = subtractStyles(styleStack, endingStyles);\n\n // reset styles: look for any already existing styles that will need to\n // end before styles that are being added on this character. to solve this\n // close out those current tags and all nested children,\n // then open new ones nested within the new styles.\n var resetStyles = getStylesToReset(remainingStyles, newStyles);\n var openingStyles = resetStyles.concat(newStyles).sort(latestStyleLast);\n var openingStyleTags = openingStyles.reduce(appendStartMarkup.bind(null, inlineHTML), '');\n var endingStyleTags = endingStyles.concat(resetStyles).reduce(prependEndMarkup.bind(null, inlineHTML), '');\n result += endingStyleTags + openingStyleTags + originalTextArray[i];\n styleStack = popEndingStyles(styleStack, resetStyles.concat(endingStyles));\n styleStack = styleStack.concat(openingStyles);\n invariant__WEBPACK_IMPORTED_MODULE_1___default()(styleStack.length === styles.length, \"Character \".concat(i, \": \").concat(styleStack.length - styles.length, \" styles left on stack that should no longer be there\"));\n }\n result = styleStack.reduceRight(function (res, openStyle) {\n return res + (0,_util_getElementHTML__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(inlineHTML(openStyle.style)).end;\n }, result);\n return result;\n});\n\n//# sourceURL=webpack://DraftConvert/./src/blockInlineStyles.js?");
150
+
151
+ /***/ }),
152
+
153
+ /***/ "./src/convertFromHTML.js":
154
+ /*!********************************!*\
155
+ !*** ./src/convertFromHTML.js ***!
156
+ \********************************/
157
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
158
+
159
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! immutable */ \"immutable\");\n/* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(immutable__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var draft_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! draft-js */ \"draft-js\");\n/* harmony import */ var draft_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(draft_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _util_parseHTML__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/parseHTML */ \"./src/util/parseHTML.js\");\n/* harmony import */ var _util_rangeSort__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/rangeSort */ \"./src/util/rangeSort.js\");\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the /src directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n\n\n\n\nvar SPACE = ' ';\n\n// Arbitrary max indent\nvar MAX_DEPTH = 4;\n\n// used for replacing characters in HTML\nvar REGEX_CR = /\\r/g;\nvar REGEX_LF = /\\n/g;\nvar REGEX_NBSP = /&nbsp;/g;\nvar REGEX_BLOCK_DELIMITER = /\\r/g;\n\n// Block tag flow is different because LIs do not have\n// a deterministic style ;_;\nvar blockTags = ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li', 'blockquote', 'pre'];\nvar inlineTags = {\n b: 'BOLD',\n code: 'CODE',\n del: 'STRIKETHROUGH',\n em: 'ITALIC',\n i: 'ITALIC',\n s: 'STRIKETHROUGH',\n strike: 'STRIKETHROUGH',\n strong: 'BOLD',\n u: 'UNDERLINE'\n};\nvar handleMiddleware = function handleMiddleware(maybeMiddleware, base) {\n if (maybeMiddleware && maybeMiddleware.__isMiddleware === true) {\n return maybeMiddleware(base);\n }\n return maybeMiddleware;\n};\nvar defaultHTMLToBlock = function defaultHTMLToBlock(nodeName, node, lastList) {\n return undefined;\n};\nvar defaultHTMLToStyle = function defaultHTMLToStyle(nodeName, node, currentStyle) {\n return currentStyle;\n};\nvar defaultHTMLToEntity = function defaultHTMLToEntity(nodeName, node) {\n return undefined;\n};\nvar defaultTextToEntity = function defaultTextToEntity(text) {\n return [];\n};\nvar nullthrows = function nullthrows(x) {\n if (x != null) {\n return x;\n }\n throw new Error('Got unexpected null or undefined');\n};\nvar sanitizeDraftText = function sanitizeDraftText(input) {\n return input.replace(REGEX_BLOCK_DELIMITER, '');\n};\nfunction getEmptyChunk() {\n return {\n text: '',\n inlines: [],\n entities: [],\n blocks: []\n };\n}\nfunction getWhitespaceChunk(inEntity) {\n var entities = new Array(1);\n if (inEntity) {\n entities[0] = inEntity;\n }\n return {\n text: SPACE,\n inlines: [(0,immutable__WEBPACK_IMPORTED_MODULE_0__.OrderedSet)()],\n entities: entities,\n blocks: []\n };\n}\nfunction getSoftNewlineChunk(block, depth) {\n var flat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : (0,immutable__WEBPACK_IMPORTED_MODULE_0__.Map)();\n if (flat === true) {\n return {\n text: '\\r',\n inlines: [(0,immutable__WEBPACK_IMPORTED_MODULE_0__.OrderedSet)()],\n entities: new Array(1),\n blocks: [{\n type: block,\n data: data,\n depth: Math.max(0, Math.min(MAX_DEPTH, depth))\n }],\n isNewline: true\n };\n }\n return {\n text: '\\n',\n inlines: [(0,immutable__WEBPACK_IMPORTED_MODULE_0__.OrderedSet)()],\n entities: new Array(1),\n blocks: []\n };\n}\nfunction getBlockDividerChunk(block, depth) {\n var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (0,immutable__WEBPACK_IMPORTED_MODULE_0__.Map)();\n return {\n text: '\\r',\n inlines: [(0,immutable__WEBPACK_IMPORTED_MODULE_0__.OrderedSet)()],\n entities: new Array(1),\n blocks: [{\n type: block,\n data: data,\n depth: Math.max(0, Math.min(MAX_DEPTH, depth))\n }]\n };\n}\nfunction getBlockTypeForTag(tag, lastList) {\n switch (tag) {\n case 'h1':\n return 'header-one';\n case 'h2':\n return 'header-two';\n case 'h3':\n return 'header-three';\n case 'h4':\n return 'header-four';\n case 'h5':\n return 'header-five';\n case 'h6':\n return 'header-six';\n case 'li':\n if (lastList === 'ol') {\n return 'ordered-list-item';\n }\n return 'unordered-list-item';\n case 'blockquote':\n return 'blockquote';\n case 'pre':\n return 'code-block';\n case 'div':\n case 'p':\n return 'unstyled';\n default:\n return null;\n }\n}\nfunction baseCheckBlockType(nodeName, node, lastList) {\n return getBlockTypeForTag(nodeName, lastList);\n}\nfunction processInlineTag(tag, node, currentStyle) {\n var styleToCheck = inlineTags[tag];\n if (styleToCheck) {\n currentStyle = currentStyle.add(styleToCheck).toOrderedSet();\n } else if (node instanceof HTMLElement) {\n var htmlElement = node;\n currentStyle = currentStyle.withMutations(function (style) {\n if (htmlElement.style.fontWeight === 'bold') {\n style.add('BOLD');\n }\n if (htmlElement.style.fontStyle === 'italic') {\n style.add('ITALIC');\n }\n if (htmlElement.style.textDecoration === 'underline') {\n style.add('UNDERLINE');\n }\n if (htmlElement.style.textDecoration === 'line-through') {\n style.add('STRIKETHROUGH');\n }\n }).toOrderedSet();\n }\n return currentStyle;\n}\nfunction baseProcessInlineTag(tag, node) {\n var inlineStyles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (0,immutable__WEBPACK_IMPORTED_MODULE_0__.OrderedSet)();\n return processInlineTag(tag, node, inlineStyles);\n}\nfunction joinChunks(A, B) {\n var flat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n // Sometimes two blocks will touch in the DOM and we need to strip the\n // extra delimiter to preserve niceness.\n var firstInB = B.text.slice(0, 1);\n var lastInA = A.text.slice(-1);\n var adjacentDividers = lastInA === '\\r' && firstInB === '\\r';\n var isJoiningBlocks = A.text !== '\\r' && B.text !== '\\r'; // when joining two full blocks like this we want to pop one divider\n var addingNewlineToEmptyBlock = A.text === '\\r' && !A.isNewline && B.isNewline; // when joining a newline to an empty block we want to remove the newline\n\n if (adjacentDividers && (isJoiningBlocks || addingNewlineToEmptyBlock)) {\n A.text = A.text.slice(0, -1);\n A.inlines.pop();\n A.entities.pop();\n A.blocks.pop();\n }\n\n // Kill whitespace after blocks if flat mode is on\n if (A.text.slice(-1) === '\\r' && flat === true) {\n if (B.text === SPACE || B.text === '\\n') {\n return A;\n }\n if (firstInB === SPACE || firstInB === '\\n') {\n B.text = B.text.slice(1);\n B.inlines.shift();\n B.entities.shift();\n }\n }\n var isNewline = A.text.length === 0 && B.isNewline;\n return {\n text: A.text + B.text,\n inlines: A.inlines.concat(B.inlines),\n entities: A.entities.concat(B.entities),\n blocks: A.blocks.concat(B.blocks),\n isNewline: isNewline\n };\n}\n\n/*\n * Check to see if we have anything like <p> <blockquote> <h1>... to create\n * block tags from. If we do, we can use those and ignore <div> tags. If we\n * don't, we can treat <div> tags as meaningful (unstyled) blocks.\n */\nfunction containsSemanticBlockMarkup(html) {\n return blockTags.some(function (tag) {\n return html.indexOf(\"<\".concat(tag)) !== -1;\n });\n}\nfunction genFragment(node, inlineStyle, lastList, inBlock, fragmentBlockTags, depth, processCustomInlineStyles, checkEntityNode, checkEntityText, checkBlockType, createEntity, getEntity, mergeEntityData, replaceEntityData, options, inEntity) {\n var nodeName = node.nodeName.toLowerCase();\n var newBlock = false;\n var nextBlockType = 'unstyled';\n\n // Base Case\n if (nodeName === '#text') {\n var text = node.textContent;\n if (text.trim() === '' && inBlock === null) {\n return getEmptyChunk();\n }\n if (text.trim() === '' && inBlock !== 'code-block') {\n return getWhitespaceChunk(inEntity);\n }\n if (inBlock !== 'code-block') {\n // Can't use empty string because MSWord\n text = text.replace(REGEX_LF, SPACE);\n }\n var entities = Array(text.length).fill(inEntity);\n var offsetChange = 0;\n var textEntities = checkEntityText(text, createEntity, getEntity, mergeEntityData, replaceEntityData).sort(_util_rangeSort__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n textEntities.forEach(function (_ref) {\n var entity = _ref.entity,\n offset = _ref.offset,\n length = _ref.length,\n result = _ref.result;\n var adjustedOffset = offset + offsetChange;\n if (result === null || result === undefined) {\n result = text.substr(adjustedOffset, length);\n }\n var textArray = text.split('');\n textArray.splice.bind(textArray, adjustedOffset, length).apply(textArray, result.split(''));\n text = textArray.join('');\n entities.splice.bind(entities, adjustedOffset, length).apply(entities, Array(result.length).fill(entity));\n offsetChange += result.length - length;\n });\n return {\n text: text,\n inlines: Array(text.length).fill(inlineStyle),\n entities: entities,\n blocks: []\n };\n }\n\n // BR tags\n if (nodeName === 'br') {\n var _blockType = inBlock;\n if (_blockType === null) {\n // BR tag is at top level, treat it as an unstyled block\n return getSoftNewlineChunk('unstyled', depth, true);\n }\n return getSoftNewlineChunk(_blockType || 'unstyled', depth, options.flat);\n }\n var chunk = getEmptyChunk();\n var newChunk = null;\n\n // Inline tags\n inlineStyle = processInlineTag(nodeName, node, inlineStyle);\n inlineStyle = processCustomInlineStyles(nodeName, node, inlineStyle);\n\n // Handle lists\n if (nodeName === 'ul' || nodeName === 'ol') {\n if (lastList) {\n depth += 1;\n }\n lastList = nodeName;\n inBlock = null;\n }\n\n // Block Tags\n var blockInfo = checkBlockType(nodeName, node, lastList, inBlock);\n var blockType;\n var blockDataMap;\n if (blockInfo === false) {\n return getEmptyChunk();\n }\n blockInfo = blockInfo || {};\n if (typeof blockInfo === 'string') {\n blockType = blockInfo;\n blockDataMap = (0,immutable__WEBPACK_IMPORTED_MODULE_0__.Map)();\n } else {\n blockType = typeof blockInfo === 'string' ? blockInfo : blockInfo.type;\n blockDataMap = blockInfo.data ? (0,immutable__WEBPACK_IMPORTED_MODULE_0__.Map)(blockInfo.data) : (0,immutable__WEBPACK_IMPORTED_MODULE_0__.Map)();\n }\n if (!inBlock && (fragmentBlockTags.indexOf(nodeName) !== -1 || blockType)) {\n chunk = getBlockDividerChunk(blockType || getBlockTypeForTag(nodeName, lastList), depth, blockDataMap);\n inBlock = blockType || getBlockTypeForTag(nodeName, lastList);\n newBlock = true;\n } else if (lastList && (inBlock === 'ordered-list-item' || inBlock === 'unordered-list-item') && nodeName === 'li') {\n var listItemBlockType = getBlockTypeForTag(nodeName, lastList);\n chunk = getBlockDividerChunk(listItemBlockType, depth);\n inBlock = listItemBlockType;\n newBlock = true;\n nextBlockType = lastList === 'ul' ? 'unordered-list-item' : 'ordered-list-item';\n } else if (inBlock && inBlock !== 'atomic' && blockType === 'atomic') {\n inBlock = blockType;\n newBlock = true;\n chunk = getSoftNewlineChunk(blockType, depth, true,\n // atomic blocks within non-atomic blocks must always be split out\n blockDataMap);\n }\n\n // Recurse through children\n var child = node.firstChild;\n\n // hack to allow conversion of atomic blocks from HTML (e.g. <figure><img\n // src=\"...\" /></figure>). since metadata must be stored on an entity text\n // must exist for the entity to apply to. the way chunks are joined strips\n // whitespace at the end so it cannot be a space character.\n\n if (child == null && inEntity && (blockType === 'atomic' || inBlock === 'atomic')) {\n child = document.createTextNode('a');\n }\n if (child != null) {\n nodeName = child.nodeName.toLowerCase();\n }\n var entityId = null;\n while (child) {\n entityId = checkEntityNode(nodeName, child, createEntity, getEntity, mergeEntityData, replaceEntityData);\n newChunk = genFragment(child, inlineStyle, lastList, inBlock, fragmentBlockTags, depth, processCustomInlineStyles, checkEntityNode, checkEntityText, checkBlockType, createEntity, getEntity, mergeEntityData, replaceEntityData, options, entityId || inEntity);\n chunk = joinChunks(chunk, newChunk, options.flat);\n var sibling = child.nextSibling;\n\n // Put in a newline to break up blocks inside blocks\n if (sibling && fragmentBlockTags.indexOf(nodeName) >= 0 && inBlock) {\n var newBlockInfo = checkBlockType(nodeName, child, lastList, inBlock);\n var newBlockType = void 0;\n var newBlockData = void 0;\n if (newBlockInfo !== false) {\n newBlockInfo = newBlockInfo || {};\n if (typeof newBlockInfo === 'string') {\n newBlockType = newBlockInfo;\n newBlockData = (0,immutable__WEBPACK_IMPORTED_MODULE_0__.Map)();\n } else {\n newBlockType = newBlockInfo.type || getBlockTypeForTag(nodeName, lastList);\n newBlockData = newBlockInfo.data ? (0,immutable__WEBPACK_IMPORTED_MODULE_0__.Map)(newBlockInfo.data) : (0,immutable__WEBPACK_IMPORTED_MODULE_0__.Map)();\n }\n chunk = joinChunks(chunk, getSoftNewlineChunk(newBlockType, depth, options.flat, newBlockData), options.flat);\n }\n }\n if (sibling) {\n nodeName = sibling.nodeName.toLowerCase();\n }\n child = sibling;\n }\n if (newBlock) {\n chunk = joinChunks(chunk, getBlockDividerChunk(nextBlockType, depth, (0,immutable__WEBPACK_IMPORTED_MODULE_0__.Map)()), options.flat);\n }\n return chunk;\n}\nfunction getChunkForHTML(html, processCustomInlineStyles, checkEntityNode, checkEntityText, checkBlockType, createEntity, getEntity, mergeEntityData, replaceEntityData, options, DOMBuilder) {\n html = html.trim().replace(REGEX_CR, '').replace(REGEX_NBSP, SPACE);\n var safeBody = DOMBuilder(html);\n if (!safeBody) {\n return null;\n }\n\n // Sometimes we aren't dealing with content that contains nice semantic\n // tags. In this case, use divs to separate everything out into paragraphs\n // and hope for the best.\n var workingBlocks = containsSemanticBlockMarkup(html) ? blockTags.concat(['div']) : ['div'];\n\n // Start with -1 block depth to offset the fact that we are passing in a fake\n // UL block to sta rt with.\n var chunk = genFragment(safeBody, (0,immutable__WEBPACK_IMPORTED_MODULE_0__.OrderedSet)(), 'ul', null, workingBlocks, -1, processCustomInlineStyles, checkEntityNode, checkEntityText, checkBlockType, createEntity, getEntity, mergeEntityData, replaceEntityData, options);\n\n // join with previous block to prevent weirdness on paste\n if (chunk.text.indexOf('\\r') === 0) {\n chunk = {\n text: chunk.text.slice(1),\n inlines: chunk.inlines.slice(1),\n entities: chunk.entities.slice(1),\n blocks: chunk.blocks\n };\n }\n\n // Kill block delimiter at the end\n if (chunk.text.slice(-1) === '\\r') {\n chunk.text = chunk.text.slice(0, -1);\n chunk.inlines = chunk.inlines.slice(0, -1);\n chunk.entities = chunk.entities.slice(0, -1);\n chunk.blocks.pop();\n }\n\n // If we saw no block tags, put an unstyled one in\n if (chunk.blocks.length === 0) {\n chunk.blocks.push({\n type: 'unstyled',\n data: (0,immutable__WEBPACK_IMPORTED_MODULE_0__.Map)(),\n depth: 0\n });\n }\n\n // Sometimes we start with text that isn't in a block, which is then\n // followed by blocks. Need to fix up the blocks to add in\n // an unstyled block for this content\n if (chunk.text.split('\\r').length === chunk.blocks.length + 1) {\n chunk.blocks.unshift({\n type: 'unstyled',\n data: (0,immutable__WEBPACK_IMPORTED_MODULE_0__.Map)(),\n depth: 0\n });\n }\n return chunk;\n}\nfunction convertFromHTMLtoContentBlocks(html, processCustomInlineStyles, checkEntityNode, checkEntityText, checkBlockType, createEntity, getEntity, mergeEntityData, replaceEntityData, options, DOMBuilder, generateKey) {\n // Be ABSOLUTELY SURE that the dom builder you pass hare won't execute\n // arbitrary code in whatever environment you're running this in. For an\n // example of how we try to do this in-browser, see getSafeBodyFromHTML.\n\n var chunk = getChunkForHTML(html, processCustomInlineStyles, checkEntityNode, checkEntityText, checkBlockType, createEntity, getEntity, mergeEntityData, replaceEntityData, options, DOMBuilder, generateKey);\n if (chunk == null) {\n return [];\n }\n var start = 0;\n return chunk.text.split('\\r').map(function (textBlock, blockIndex) {\n // Make absolutely certain that our text is acceptable.\n textBlock = sanitizeDraftText(textBlock);\n var end = start + textBlock.length;\n var inlines = nullthrows(chunk).inlines.slice(start, end);\n var entities = nullthrows(chunk).entities.slice(start, end);\n var characterList = (0,immutable__WEBPACK_IMPORTED_MODULE_0__.List)(inlines.map(function (style, entityIndex) {\n var data = {\n style: style,\n entity: null\n };\n if (entities[entityIndex]) {\n data.entity = entities[entityIndex];\n }\n return draft_js__WEBPACK_IMPORTED_MODULE_1__.CharacterMetadata.create(data);\n }));\n start = end + 1;\n return new draft_js__WEBPACK_IMPORTED_MODULE_1__.ContentBlock({\n key: generateKey(),\n type: nullthrows(chunk).blocks[blockIndex].type,\n data: nullthrows(chunk).blocks[blockIndex].data,\n depth: nullthrows(chunk).blocks[blockIndex].depth,\n text: textBlock,\n characterList: characterList\n });\n });\n}\nvar convertFromHTML = function convertFromHTML(_ref2) {\n var _ref2$htmlToStyle = _ref2.htmlToStyle,\n htmlToStyle = _ref2$htmlToStyle === void 0 ? defaultHTMLToStyle : _ref2$htmlToStyle,\n _ref2$htmlToEntity = _ref2.htmlToEntity,\n htmlToEntity = _ref2$htmlToEntity === void 0 ? defaultHTMLToEntity : _ref2$htmlToEntity,\n _ref2$textToEntity = _ref2.textToEntity,\n textToEntity = _ref2$textToEntity === void 0 ? defaultTextToEntity : _ref2$textToEntity,\n _ref2$htmlToBlock = _ref2.htmlToBlock,\n htmlToBlock = _ref2$htmlToBlock === void 0 ? defaultHTMLToBlock : _ref2$htmlToBlock;\n return function (html) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n flat: false\n };\n var DOMBuilder = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _util_parseHTML__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\n var generateKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : draft_js__WEBPACK_IMPORTED_MODULE_1__.genKey;\n var contentState = draft_js__WEBPACK_IMPORTED_MODULE_1__.ContentState.createFromText('');\n var createEntityWithContentState = function createEntityWithContentState() {\n if (contentState.createEntity) {\n var _contentState;\n contentState = (_contentState = contentState).createEntity.apply(_contentState, arguments);\n return contentState.getLastCreatedEntityKey();\n }\n return draft_js__WEBPACK_IMPORTED_MODULE_1__.Entity.create.apply(draft_js__WEBPACK_IMPORTED_MODULE_1__.Entity, arguments);\n };\n var getEntityWithContentState = function getEntityWithContentState() {\n if (contentState.getEntity) {\n var _contentState2;\n return (_contentState2 = contentState).getEntity.apply(_contentState2, arguments);\n }\n return draft_js__WEBPACK_IMPORTED_MODULE_1__.Entity.get.apply(draft_js__WEBPACK_IMPORTED_MODULE_1__.Entity, arguments);\n };\n var mergeEntityDataWithContentState = function mergeEntityDataWithContentState() {\n if (contentState.mergeEntityData) {\n var _contentState3;\n contentState = (_contentState3 = contentState).mergeEntityData.apply(_contentState3, arguments);\n return;\n }\n draft_js__WEBPACK_IMPORTED_MODULE_1__.Entity.mergeData.apply(draft_js__WEBPACK_IMPORTED_MODULE_1__.Entity, arguments);\n };\n var replaceEntityDataWithContentState = function replaceEntityDataWithContentState() {\n if (contentState.replaceEntityData) {\n var _contentState4;\n contentState = (_contentState4 = contentState).replaceEntityData.apply(_contentState4, arguments);\n return;\n }\n draft_js__WEBPACK_IMPORTED_MODULE_1__.Entity.replaceData.apply(draft_js__WEBPACK_IMPORTED_MODULE_1__.Entity, arguments);\n };\n var contentBlocks = convertFromHTMLtoContentBlocks(html, handleMiddleware(htmlToStyle, baseProcessInlineTag), handleMiddleware(htmlToEntity, defaultHTMLToEntity), handleMiddleware(textToEntity, defaultTextToEntity), handleMiddleware(htmlToBlock, baseCheckBlockType), createEntityWithContentState, getEntityWithContentState, mergeEntityDataWithContentState, replaceEntityDataWithContentState, options, DOMBuilder, generateKey);\n var blockMap = draft_js__WEBPACK_IMPORTED_MODULE_1__.BlockMapBuilder.createFromArray(contentBlocks);\n var firstBlockKey = contentBlocks[0].getKey();\n return contentState.merge({\n blockMap: blockMap,\n selectionBefore: draft_js__WEBPACK_IMPORTED_MODULE_1__.SelectionState.createEmpty(firstBlockKey),\n selectionAfter: draft_js__WEBPACK_IMPORTED_MODULE_1__.SelectionState.createEmpty(firstBlockKey)\n });\n };\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function () {\n if (arguments.length >= 1 && typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {\n return convertFromHTML({}).apply(void 0, arguments);\n }\n return convertFromHTML.apply(void 0, arguments);\n});\n\n//# sourceURL=webpack://DraftConvert/./src/convertFromHTML.js?");
160
+
161
+ /***/ }),
162
+
163
+ /***/ "./src/convertToHTML.js":
164
+ /*!******************************!*\
165
+ !*** ./src/convertToHTML.js ***!
166
+ \******************************/
167
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
168
+
169
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom_server__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom/server */ \"react-dom/server\");\n/* harmony import */ var react_dom_server__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom_server__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var draft_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! draft-js */ \"draft-js\");\n/* harmony import */ var draft_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(draft_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _encodeBlock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./encodeBlock */ \"./src/encodeBlock.js\");\n/* harmony import */ var _blockEntities__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./blockEntities */ \"./src/blockEntities.js\");\n/* harmony import */ var _blockInlineStyles__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./blockInlineStyles */ \"./src/blockInlineStyles.js\");\n/* harmony import */ var _util_accumulateFunction__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/accumulateFunction */ \"./src/util/accumulateFunction.js\");\n/* harmony import */ var _util_blockTypeObjectFunction__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./util/blockTypeObjectFunction */ \"./src/util/blockTypeObjectFunction.js\");\n/* harmony import */ var _util_getBlockTags__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./util/getBlockTags */ \"./src/util/getBlockTags.js\");\n/* harmony import */ var _util_getNestedBlockTags__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./util/getNestedBlockTags */ \"./src/util/getNestedBlockTags.js\");\n/* harmony import */ var _default_defaultBlockHTML__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./default/defaultBlockHTML */ \"./src/default/defaultBlockHTML.js\");\n\n\n\n\n\n\n\n\n\n\n\n\nvar defaultEntityToHTML = function defaultEntityToHTML(entity, originalText) {\n return originalText;\n};\nvar defaultValidateHTML = function defaultValidateHTML(html) {\n return true;\n};\nvar convertToHTML = function convertToHTML(_ref) {\n var _ref$styleToHTML = _ref.styleToHTML,\n styleToHTML = _ref$styleToHTML === void 0 ? {} : _ref$styleToHTML,\n _ref$blockToHTML = _ref.blockToHTML,\n blockToHTML = _ref$blockToHTML === void 0 ? {} : _ref$blockToHTML,\n _ref$entityToHTML = _ref.entityToHTML,\n entityToHTML = _ref$entityToHTML === void 0 ? defaultEntityToHTML : _ref$entityToHTML,\n _ref$validateHTML = _ref.validateHTML,\n validateHTML = _ref$validateHTML === void 0 ? defaultValidateHTML : _ref$validateHTML;\n return function (contentState) {\n invariant__WEBPACK_IMPORTED_MODULE_0___default()(contentState !== null && contentState !== undefined, 'Expected contentState to be non-null');\n var getBlockHTML;\n if (blockToHTML.__isMiddleware === true) {\n getBlockHTML = blockToHTML((0,_util_blockTypeObjectFunction__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_default_defaultBlockHTML__WEBPACK_IMPORTED_MODULE_11__[\"default\"]));\n } else {\n getBlockHTML = (0,_util_accumulateFunction__WEBPACK_IMPORTED_MODULE_7__[\"default\"])((0,_util_blockTypeObjectFunction__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(blockToHTML), (0,_util_blockTypeObjectFunction__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_default_defaultBlockHTML__WEBPACK_IMPORTED_MODULE_11__[\"default\"]));\n }\n var rawState = (0,draft_js__WEBPACK_IMPORTED_MODULE_3__.convertToRaw)(contentState);\n var listStack = [];\n var result = rawState.blocks.map(function (block) {\n var type = block.type,\n depth = block.depth;\n var closeNestTags = '';\n var openNestTags = '';\n var blockHTMLResult = getBlockHTML(block);\n if (!blockHTMLResult) {\n throw new Error(\"convertToHTML: missing HTML definition for block with type \".concat(block.type));\n }\n if (!blockHTMLResult.nest) {\n // this block can't be nested, so reset all nesting if necessary\n closeNestTags = listStack.reduceRight(function (string, nestedBlock) {\n return string + (0,_util_getNestedBlockTags__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(getBlockHTML(nestedBlock), depth).nestEnd;\n }, '');\n listStack = [];\n } else {\n while (depth + 1 !== listStack.length || type !== listStack[depth].type) {\n if (depth + 1 === listStack.length) {\n // depth is right but doesn't match type\n var blockToClose = listStack[depth];\n closeNestTags += (0,_util_getNestedBlockTags__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(getBlockHTML(blockToClose), depth).nestEnd;\n openNestTags += (0,_util_getNestedBlockTags__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(getBlockHTML(block), depth).nestStart;\n listStack[depth] = block;\n } else if (depth + 1 < listStack.length) {\n var _blockToClose = listStack[listStack.length - 1];\n closeNestTags += (0,_util_getNestedBlockTags__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(getBlockHTML(_blockToClose), depth).nestEnd;\n listStack = listStack.slice(0, -1);\n } else {\n openNestTags += (0,_util_getNestedBlockTags__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(getBlockHTML(block), depth).nestStart;\n listStack.push(block);\n }\n }\n }\n var innerHTML = (0,_blockInlineStyles__WEBPACK_IMPORTED_MODULE_6__[\"default\"])((0,_blockEntities__WEBPACK_IMPORTED_MODULE_5__[\"default\"])((0,_encodeBlock__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(block), rawState.entityMap, entityToHTML), styleToHTML);\n var blockHTML = (0,_util_getBlockTags__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(getBlockHTML(block));\n var html;\n if (typeof blockHTML === 'string') {\n html = blockHTML;\n } else {\n html = blockHTML.start + innerHTML + blockHTML.end;\n }\n if (innerHTML.length === 0 && Object.prototype.hasOwnProperty.call(blockHTML, 'empty')) {\n if (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().isValidElement(blockHTML.empty)) {\n html = react_dom_server__WEBPACK_IMPORTED_MODULE_2___default().renderToStaticMarkup(blockHTML.empty);\n } else {\n html = blockHTML.empty;\n }\n }\n var finalHtml = closeNestTags + openNestTags + html;\n if (!validateHTML(finalHtml)) {\n return '';\n }\n return finalHtml;\n }).join('');\n result = listStack.reduce(function (res, nestBlock) {\n return res + (0,_util_getNestedBlockTags__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(getBlockHTML(nestBlock), nestBlock.depth).nestEnd;\n }, result);\n return result;\n };\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (args.length === 1 && Object.prototype.hasOwnProperty.call(args[0], '_map') && args[0].getBlockMap != null) {\n // skip higher-order function and use defaults\n return convertToHTML({}).apply(void 0, args);\n }\n return convertToHTML.apply(void 0, args);\n});\n\n//# sourceURL=webpack://DraftConvert/./src/convertToHTML.js?");
170
+
171
+ /***/ }),
172
+
173
+ /***/ "./src/default/defaultBlockHTML.js":
174
+ /*!*****************************************!*\
175
+ !*** ./src/default/defaultBlockHTML.js ***!
176
+ \*****************************************/
177
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
178
+
179
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\n\n// based on Draft.js' custom list depth styling\nvar ORDERED_LIST_TYPES = ['1', 'a', 'i'];\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n unstyled: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"p\", null),\n paragraph: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"p\", null),\n 'header-one': /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h1\", null),\n 'header-two': /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", null),\n 'header-two-unordered': /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", null),\n 'header-two-ordered': /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h2\", null),\n 'header-three': /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h3\", null),\n 'header-four': /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h4\", null),\n 'header-five': /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h5\", null),\n 'header-six': /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"h6\", null),\n 'code-block': /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"pre\", null),\n blockquote: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"blockquote\", null),\n 'unordered-list-item': {\n element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"li\", null),\n nest: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"ul\", null)\n },\n 'ordered-list-item': {\n element: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"li\", null),\n nest: function nest(depth) {\n var type = ORDERED_LIST_TYPES[depth % 3];\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"ol\", {\n type: type\n });\n }\n },\n media: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"figure\", null),\n atomic: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"figure\", null)\n});\n\n//# sourceURL=webpack://DraftConvert/./src/default/defaultBlockHTML.js?");
180
+
181
+ /***/ }),
182
+
183
+ /***/ "./src/default/defaultInlineHTML.js":
184
+ /*!******************************************!*\
185
+ !*** ./src/default/defaultInlineHTML.js ***!
186
+ \******************************************/
187
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
188
+
189
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ defaultInlineHTML)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction defaultInlineHTML(style) {\n switch (style) {\n case 'BOLD':\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"strong\", null);\n case 'ITALIC':\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"em\", null);\n case 'UNDERLINE':\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"u\", null);\n case 'CODE':\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"code\", null);\n default:\n return {\n start: '',\n end: ''\n };\n }\n}\n\n//# sourceURL=webpack://DraftConvert/./src/default/defaultInlineHTML.js?");
190
+
191
+ /***/ }),
192
+
193
+ /***/ "./src/encodeBlock.js":
194
+ /*!****************************!*\
195
+ !*** ./src/encodeBlock.js ***!
196
+ \****************************/
197
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
198
+
199
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\");\n/* harmony import */ var _util_updateMutation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/updateMutation */ \"./src/util/updateMutation.js\");\n/* harmony import */ var _util_rangeSort__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/rangeSort */ \"./src/util/rangeSort.js\");\n\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n\n\nvar ENTITY_MAP = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#x27;',\n '`': '&#x60;',\n '\\n': '<br/>'\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (block) {\n var blockText = (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(block.text);\n var entities = block.entityRanges.sort(_util_rangeSort__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n var styles = block.inlineStyleRanges.sort(_util_rangeSort__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n var resultText = '';\n var _loop = function _loop() {\n var _char = blockText[index];\n if (ENTITY_MAP[_char] !== undefined) {\n var encoded = ENTITY_MAP[_char];\n var resultIndex = (0,_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(resultText).length;\n resultText += encoded;\n var updateForChar = function updateForChar(mutation) {\n return (0,_util_updateMutation__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(mutation, resultIndex, _char.length, encoded.length, 0, 0);\n };\n entities = entities.map(updateForChar);\n styles = styles.map(updateForChar);\n } else {\n resultText += _char;\n }\n };\n for (var index = 0; index < blockText.length; index += 1) {\n _loop();\n }\n return _objectSpread(_objectSpread({}, block), {}, {\n text: resultText,\n inlineStyleRanges: styles,\n entityRanges: entities\n });\n});\n\n//# sourceURL=webpack://DraftConvert/./src/encodeBlock.js?");
200
+
201
+ /***/ }),
202
+
203
+ /***/ "./src/index.js":
204
+ /*!**********************!*\
205
+ !*** ./src/index.js ***!
206
+ \**********************/
207
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
208
+
209
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ convertFromHTML: () => (/* reexport safe */ _convertFromHTML__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */ convertToHTML: () => (/* reexport safe */ _convertToHTML__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ parseHTML: () => (/* reexport safe */ _util_parseHTML__WEBPACK_IMPORTED_MODULE_2__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _convertToHTML__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./convertToHTML */ \"./src/convertToHTML.js\");\n/* harmony import */ var _convertFromHTML__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./convertFromHTML */ \"./src/convertFromHTML.js\");\n/* harmony import */ var _util_parseHTML__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/parseHTML */ \"./src/util/parseHTML.js\");\n\n\n\n\n\n//# sourceURL=webpack://DraftConvert/./src/index.js?");
210
+
211
+ /***/ }),
212
+
213
+ /***/ "./src/util/accumulateFunction.js":
214
+ /*!****************************************!*\
215
+ !*** ./src/util/accumulateFunction.js ***!
216
+ \****************************************/
217
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
218
+
219
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (newFn, rest) {\n return function () {\n var newResult = newFn.apply(void 0, arguments);\n if (newResult !== undefined && newResult !== null) {\n return newResult;\n }\n return rest.apply(void 0, arguments);\n };\n});\n\n//# sourceURL=webpack://DraftConvert/./src/util/accumulateFunction.js?");
220
+
221
+ /***/ }),
222
+
223
+ /***/ "./src/util/blockTypeObjectFunction.js":
224
+ /*!*********************************************!*\
225
+ !*** ./src/util/blockTypeObjectFunction.js ***!
226
+ \*********************************************/
227
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
228
+
229
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (typeObject) {\n return function (block) {\n if (typeof typeObject === 'function') {\n // handle case where typeObject is already a function\n return typeObject(block);\n }\n return typeObject[block.type];\n };\n});\n\n//# sourceURL=webpack://DraftConvert/./src/util/blockTypeObjectFunction.js?");
230
+
231
+ /***/ }),
232
+
233
+ /***/ "./src/util/getBlockTags.js":
234
+ /*!**********************************!*\
235
+ !*** ./src/util/getBlockTags.js ***!
236
+ \**********************************/
237
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
238
+
239
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ getBlockTags)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react_dom_server__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-dom/server */ \"react-dom/server\");\n/* harmony import */ var react_dom_server__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_dom_server__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _splitReactElement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./splitReactElement */ \"./src/util/splitReactElement.js\");\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n\n\n\n\nfunction hasChildren(element) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().isValidElement(element) && react__WEBPACK_IMPORTED_MODULE_2___default().Children.count(element.props.children) > 0;\n}\nfunction getBlockTags(blockHTML) {\n invariant__WEBPACK_IMPORTED_MODULE_1___default()(blockHTML !== null && blockHTML !== undefined, 'Expected block HTML value to be non-null');\n if (typeof blockHTML === 'string') {\n return blockHTML;\n }\n if (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().isValidElement(blockHTML)) {\n if (hasChildren(blockHTML)) {\n return react_dom_server__WEBPACK_IMPORTED_MODULE_3___default().renderToStaticMarkup(blockHTML);\n }\n return (0,_splitReactElement__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(blockHTML);\n }\n if (Object.prototype.hasOwnProperty.call(blockHTML, 'element') && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().isValidElement(blockHTML.element)) {\n return _objectSpread(_objectSpread({}, blockHTML), (0,_splitReactElement__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(blockHTML.element));\n }\n invariant__WEBPACK_IMPORTED_MODULE_1___default()(Object.prototype.hasOwnProperty.call(blockHTML, 'start') && Object.prototype.hasOwnProperty.call(blockHTML, 'end'), 'convertToHTML: received block information without either a ReactElement or an object with start/end tags');\n return blockHTML;\n}\n\n//# sourceURL=webpack://DraftConvert/./src/util/getBlockTags.js?");
240
+
241
+ /***/ }),
242
+
243
+ /***/ "./src/util/getElementHTML.js":
244
+ /*!************************************!*\
245
+ !*** ./src/util/getElementHTML.js ***!
246
+ \************************************/
247
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
248
+
249
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ getElementHTML)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"./node_modules/@babel/runtime/helpers/esm/typeof.js\");\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react_dom_server__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-dom/server */ \"react-dom/server\");\n/* harmony import */ var react_dom_server__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_dom_server__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _splitReactElement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./splitReactElement */ \"./src/util/splitReactElement.js\");\n\n\n\n\n\nfunction hasChildren(element) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().isValidElement(element) && react__WEBPACK_IMPORTED_MODULE_2___default().Children.count(element.props.children) > 0;\n}\nfunction getElementHTML(element) {\n var text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n if (element === undefined || element === null) {\n return element;\n }\n if (typeof element === 'string') {\n return element;\n }\n if (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().isValidElement(element)) {\n if (hasChildren(element)) {\n return react_dom_server__WEBPACK_IMPORTED_MODULE_3___default().renderToStaticMarkup(element);\n }\n var tags = (0,_splitReactElement__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(element);\n if (text !== null && (0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(tags) === 'object') {\n var start = tags.start,\n end = tags.end;\n return start + text + end;\n }\n return tags;\n }\n invariant__WEBPACK_IMPORTED_MODULE_1___default()(Object.prototype.hasOwnProperty.call(element, 'start') && Object.prototype.hasOwnProperty.call(element, 'end'), 'convertToHTML: received conversion data without either an HTML string, ReactElement or an object with start/end tags');\n if (text !== null) {\n var _start = element.start,\n _end = element.end;\n return _start + text + _end;\n }\n return element;\n}\n\n//# sourceURL=webpack://DraftConvert/./src/util/getElementHTML.js?");
250
+
251
+ /***/ }),
252
+
253
+ /***/ "./src/util/getElementTagLength.js":
254
+ /*!*****************************************!*\
255
+ !*** ./src/util/getElementTagLength.js ***!
256
+ \*****************************************/
257
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
258
+
259
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"./node_modules/@babel/runtime/helpers/esm/typeof.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _splitReactElement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./splitReactElement */ \"./src/util/splitReactElement.js\");\n\n\n\nvar _getElementTagLength = function getElementTagLength(element) {\n var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'start';\n if (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().isValidElement(element)) {\n var splitElement = (0,_splitReactElement__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(element);\n if (typeof splitElement === 'string') {\n return 0;\n }\n var length = splitElement[type].length;\n var child = react__WEBPACK_IMPORTED_MODULE_1___default().Children.toArray(element.props.children)[0];\n return length + (child && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().isValidElement(child) ? _getElementTagLength(child, type) : 0);\n }\n if ((0,_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(element) === 'object') {\n return element[type] ? element[type].length : 0;\n }\n return 0;\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_getElementTagLength);\n\n//# sourceURL=webpack://DraftConvert/./src/util/getElementTagLength.js?");
260
+
261
+ /***/ }),
262
+
263
+ /***/ "./src/util/getNestedBlockTags.js":
264
+ /*!****************************************!*\
265
+ !*** ./src/util/getNestedBlockTags.js ***!
266
+ \****************************************/
267
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
268
+
269
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ getNestedBlockTags)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _splitReactElement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./splitReactElement */ \"./src/util/splitReactElement.js\");\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n\n\n\nfunction getNestedBlockTags(blockHTML, depth) {\n invariant__WEBPACK_IMPORTED_MODULE_1___default()(blockHTML !== null && blockHTML !== undefined, 'Expected block HTML value to be non-null');\n if (typeof blockHTML.nest === 'function') {\n var _splitReactElement = (0,_splitReactElement__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(blockHTML.nest(depth)),\n start = _splitReactElement.start,\n end = _splitReactElement.end;\n return _objectSpread(_objectSpread({}, blockHTML), {}, {\n nestStart: start,\n nestEnd: end\n });\n }\n if (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().isValidElement(blockHTML.nest)) {\n var _splitReactElement2 = (0,_splitReactElement__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(blockHTML.nest),\n _start = _splitReactElement2.start,\n _end = _splitReactElement2.end;\n return _objectSpread(_objectSpread({}, blockHTML), {}, {\n nestStart: _start,\n nestEnd: _end\n });\n }\n invariant__WEBPACK_IMPORTED_MODULE_1___default()(Object.prototype.hasOwnProperty.call(blockHTML, 'nestStart') && Object.prototype.hasOwnProperty.call(blockHTML, 'nestEnd'), 'convertToHTML: received block information without either a ReactElement or an object with start/end tags');\n return blockHTML;\n}\n\n//# sourceURL=webpack://DraftConvert/./src/util/getNestedBlockTags.js?");
270
+
271
+ /***/ }),
272
+
273
+ /***/ "./src/util/parseHTML.js":
274
+ /*!*******************************!*\
275
+ !*** ./src/util/parseHTML.js ***!
276
+ \*******************************/
277
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
278
+
279
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ parseHTML)\n/* harmony export */ });\nvar fallback = function fallback(html) {\n var doc = document.implementation.createHTMLDocument('');\n doc.documentElement.innerHTML = html;\n return doc;\n};\nfunction parseHTML(html) {\n var doc;\n if (typeof DOMParser !== 'undefined') {\n var parser = new DOMParser();\n doc = parser.parseFromString(html, 'text/html');\n if (doc === null || doc.body === null) {\n doc = fallback(html);\n }\n } else {\n doc = fallback(html);\n }\n return doc.body;\n}\n\n//# sourceURL=webpack://DraftConvert/./src/util/parseHTML.js?");
280
+
281
+ /***/ }),
282
+
283
+ /***/ "./src/util/rangeSort.js":
284
+ /*!*******************************!*\
285
+ !*** ./src/util/rangeSort.js ***!
286
+ \*******************************/
287
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
288
+
289
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (r1, r2) {\n if (r1.offset === r2.offset) {\n return r2.length - r1.length;\n }\n return r1.offset - r2.offset;\n});\n\n//# sourceURL=webpack://DraftConvert/./src/util/rangeSort.js?");
290
+
291
+ /***/ }),
292
+
293
+ /***/ "./src/util/splitReactElement.js":
294
+ /*!***************************************!*\
295
+ !*** ./src/util/splitReactElement.js ***!
296
+ \***************************************/
297
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
298
+
299
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ splitReactElement)\n/* harmony export */ });\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ \"./node_modules/invariant/browser.js\");\n/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom_server__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom/server */ \"react-dom/server\");\n/* harmony import */ var react_dom_server__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom_server__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\n\n// see http://w3c.github.io/html/syntax.html#writing-html-documents-elements\nvar VOID_TAGS = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'];\nfunction splitReactElement(element) {\n if (VOID_TAGS.indexOf(element.type) !== -1) {\n return react_dom_server__WEBPACK_IMPORTED_MODULE_2___default().renderToStaticMarkup(element);\n }\n var tags = react_dom_server__WEBPACK_IMPORTED_MODULE_2___default().renderToStaticMarkup(/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().cloneElement(element, {}, '\\r')).split('\\r');\n invariant__WEBPACK_IMPORTED_MODULE_0___default()(tags.length > 1, \"convertToHTML: Element of type \".concat(element.type, \" must render children\"));\n invariant__WEBPACK_IMPORTED_MODULE_0___default()(tags.length < 3, \"convertToHTML: Element of type \".concat(element.type, \" cannot use carriage return character\"));\n return {\n start: tags[0],\n end: tags[1]\n };\n}\n\n//# sourceURL=webpack://DraftConvert/./src/util/splitReactElement.js?");
300
+
301
+ /***/ }),
302
+
303
+ /***/ "./src/util/styleObjectFunction.js":
304
+ /*!*****************************************!*\
305
+ !*** ./src/util/styleObjectFunction.js ***!
306
+ \*****************************************/
307
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
308
+
309
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function (object) {\n return function (style) {\n if (typeof object === 'function') {\n return object(style);\n }\n return object[style];\n };\n});\n\n//# sourceURL=webpack://DraftConvert/./src/util/styleObjectFunction.js?");
310
+
311
+ /***/ }),
312
+
313
+ /***/ "./src/util/updateMutation.js":
314
+ /*!************************************!*\
315
+ !*** ./src/util/updateMutation.js ***!
316
+ \************************************/
317
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
318
+
319
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ updateMutation)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction updateMutation(mutation, originalOffset, originalLength, newLength, prefixLength, suffixLength) {\n // three cases we can reasonably adjust - disjoint mutations that\n // happen later on where the offset will need to be changed,\n // mutations that completely contain the new one where we can adjust\n // the length, and mutations that occur partially within the new one.\n var lengthDiff = newLength - originalLength;\n var mutationAfterChange = originalOffset + originalLength <= mutation.offset;\n if (mutationAfterChange) {\n return _objectSpread(_objectSpread({}, mutation), {}, {\n offset: mutation.offset + lengthDiff\n });\n }\n var mutationContainsChange = originalOffset >= mutation.offset && originalOffset + originalLength <= mutation.offset + mutation.length;\n if (mutationContainsChange) {\n return _objectSpread(_objectSpread({}, mutation), {}, {\n length: mutation.length + lengthDiff\n });\n }\n var mutationWithinPrefixChange = mutation.offset >= originalOffset && mutation.offset + mutation.length <= originalOffset + originalLength && prefixLength > 0;\n if (mutationWithinPrefixChange) {\n return _objectSpread(_objectSpread({}, mutation), {}, {\n offset: mutation.offset + prefixLength\n });\n }\n var mutationContainsPrefix = mutation.offset < originalOffset && mutation.offset + mutation.length <= originalOffset + originalLength && mutation.offset + mutation.length > originalOffset && prefixLength > 0;\n if (mutationContainsPrefix) {\n return [_objectSpread(_objectSpread({}, mutation), {}, {\n length: originalOffset - mutation.offset\n }), _objectSpread(_objectSpread({}, mutation), {}, {\n offset: originalOffset + prefixLength,\n length: mutation.offset - originalOffset + mutation.length\n })];\n }\n var mutationContainsSuffix = mutation.offset >= originalOffset && mutation.offset + mutation.length > originalOffset + originalLength && originalOffset + originalLength > mutation.offset && suffixLength > 0;\n if (mutationContainsSuffix) {\n return [_objectSpread(_objectSpread({}, mutation), {}, {\n offset: mutation.offset + prefixLength,\n length: originalOffset + originalLength - mutation.offset\n }), _objectSpread(_objectSpread({}, mutation), {}, {\n offset: originalOffset + originalLength + prefixLength + suffixLength,\n length: mutation.offset + mutation.length - (originalOffset + originalLength)\n })];\n }\n return mutation;\n}\n\n//# sourceURL=webpack://DraftConvert/./src/util/updateMutation.js?");
320
+
321
+ /***/ }),
322
+
323
+ /***/ "draft-js":
324
+ /*!************************!*\
325
+ !*** external "Draft" ***!
326
+ \************************/
327
+ /***/ ((module) => {
328
+
329
+ module.exports = __WEBPACK_EXTERNAL_MODULE_draft_js__;
330
+
331
+ /***/ }),
332
+
333
+ /***/ "immutable":
334
+ /*!****************************!*\
335
+ !*** external "Immutable" ***!
336
+ \****************************/
337
+ /***/ ((module) => {
338
+
339
+ module.exports = __WEBPACK_EXTERNAL_MODULE_immutable__;
340
+
341
+ /***/ }),
342
+
343
+ /***/ "react":
344
+ /*!************************!*\
345
+ !*** external "React" ***!
346
+ \************************/
347
+ /***/ ((module) => {
348
+
349
+ module.exports = __WEBPACK_EXTERNAL_MODULE_react__;
350
+
351
+ /***/ }),
352
+
353
+ /***/ "react-dom/server":
354
+ /*!*********************************!*\
355
+ !*** external "ReactDOMServer" ***!
356
+ \*********************************/
357
+ /***/ ((module) => {
358
+
359
+ module.exports = __WEBPACK_EXTERNAL_MODULE_react_dom_server__;
360
+
361
+ /***/ })
362
+
363
+ /******/ });
364
+ /************************************************************************/
365
+ /******/ // The module cache
366
+ /******/ var __webpack_module_cache__ = {};
367
+ /******/
368
+ /******/ // The require function
369
+ /******/ function __webpack_require__(moduleId) {
370
+ /******/ // Check if module is in cache
371
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
372
+ /******/ if (cachedModule !== undefined) {
373
+ /******/ return cachedModule.exports;
374
+ /******/ }
375
+ /******/ // Create a new module (and put it into the cache)
376
+ /******/ var module = __webpack_module_cache__[moduleId] = {
377
+ /******/ // no module.id needed
378
+ /******/ // no module.loaded needed
379
+ /******/ exports: {}
380
+ /******/ };
381
+ /******/
382
+ /******/ // Execute the module function
383
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
384
+ /******/
385
+ /******/ // Return the exports of the module
386
+ /******/ return module.exports;
387
+ /******/ }
388
+ /******/
389
+ /************************************************************************/
390
+ /******/ /* webpack/runtime/compat get default export */
391
+ /******/ (() => {
392
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
393
+ /******/ __webpack_require__.n = (module) => {
394
+ /******/ var getter = module && module.__esModule ?
395
+ /******/ () => (module['default']) :
396
+ /******/ () => (module);
397
+ /******/ __webpack_require__.d(getter, { a: getter });
398
+ /******/ return getter;
399
+ /******/ };
400
+ /******/ })();
401
+ /******/
402
+ /******/ /* webpack/runtime/define property getters */
403
+ /******/ (() => {
404
+ /******/ // define getter functions for harmony exports
405
+ /******/ __webpack_require__.d = (exports, definition) => {
406
+ /******/ for(var key in definition) {
407
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
408
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
409
+ /******/ }
410
+ /******/ }
411
+ /******/ };
412
+ /******/ })();
413
+ /******/
414
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
415
+ /******/ (() => {
416
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
417
+ /******/ })();
418
+ /******/
419
+ /******/ /* webpack/runtime/make namespace object */
420
+ /******/ (() => {
421
+ /******/ // define __esModule on exports
422
+ /******/ __webpack_require__.r = (exports) => {
423
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
424
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
425
+ /******/ }
426
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
427
+ /******/ };
428
+ /******/ })();
429
+ /******/
430
+ /************************************************************************/
431
+ /******/
432
+ /******/ // startup
433
+ /******/ // Load entry module and return exports
434
+ /******/ // This entry module can't be inlined because the eval devtool is used.
435
+ /******/ var __webpack_exports__ = __webpack_require__("./src/index.js");
436
+ /******/
437
+ /******/ return __webpack_exports__;
438
+ /******/ })()
439
+ ;
440
+ });