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EAE7B,OADa,KAALH,EAAWC,EAAQ,EAAJA,EAAU,GACxBG,SAAS,GACpB,GACF,C","sources":["../node_modules/draft-js/lib/isElement.js","../node_modules/draft-js/lib/isEventHandled.js","../node_modules/draft-js/lib/isHTMLAnchorElement.js","../node_modules/draft-js/lib/isHTMLBRElement.js","../node_modules/draft-js/lib/isHTMLElement.js","../node_modules/draft-js/lib/isHTMLImageElement.js","../node_modules/draft-js/lib/isInstanceOfNode.js","../node_modules/draft-js/lib/isSelectionAtLeafStart.js","../node_modules/draft-js/lib/isSoftNewlineEvent.js","../node_modules/draft-js/lib/keyCommandBackspaceToStartOfLine.js","../node_modules/draft-js/lib/keyCommandBackspaceWord.js","../node_modules/draft-js/lib/keyCommandDeleteWord.js","../node_modules/draft-js/lib/keyCommandInsertNewline.js","../node_modules/draft-js/lib/keyCommandMoveSelectionToEndOfBlock.js","../node_modules/draft-js/lib/keyCommandMoveSelectionToStartOfBlock.js","../node_modules/draft-js/lib/keyCommandPlainBackspace.js","../node_modules/draft-js/lib/keyCommandPlainDelete.js","../node_modules/draft-js/lib/keyCommandTransposeCharacters.js","../node_modules/draft-js/lib/keyCommandUndo.js","../node_modules/draft-js/lib/modifyBlockForContentState.js","../node_modules/draft-js/lib/moveBlockInContentState.js","../node_modules/draft-js/lib/moveSelectionBackward.js","../node_modules/draft-js/lib/moveSelectionForward.js","../node_modules/draft-js/lib/randomizeBlockMapKeys.js","../node_modules/draft-js/lib/removeEntitiesAtEdges.js","../node_modules/draft-js/lib/removeRangeFromContentState.js","../node_modules/draft-js/lib/removeTextWithStrategy.js","../node_modules/draft-js/lib/sanitizeDraftText.js","../node_modules/draft-js/lib/setDraftEditorSelection.js","../node_modules/draft-js/lib/splitBlockInContentState.js","../node_modules/draft-js/lib/splitTextIntoTextBlocks.js","../node_modules/draft-js/lib/uuid.js"],"sourcesContent":["\"use strict\";\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\nfunction isElement(node) {\n if (!node || !node.ownerDocument) {\n return false;\n }\n\n return node.nodeType === Node.ELEMENT_NODE;\n}\n\nmodule.exports = isElement;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\n/**\n * Utility method for determining whether or not the value returned\n * from a handler indicates that it was handled.\n */\nfunction isEventHandled(value) {\n return value === 'handled' || value === true;\n}\n\nmodule.exports = isEventHandled;","\"use strict\";\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\nvar isElement = require(\"./isElement\");\n\nfunction isHTMLAnchorElement(node) {\n if (!node || !node.ownerDocument) {\n return false;\n }\n\n return isElement(node) && node.nodeName === 'A';\n}\n\nmodule.exports = isHTMLAnchorElement;","\"use strict\";\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\nvar isElement = require(\"./isElement\");\n\nfunction isHTMLBRElement(node) {\n if (!node || !node.ownerDocument) {\n return false;\n }\n\n return isElement(node) && node.nodeName === 'BR';\n}\n\nmodule.exports = isHTMLBRElement;","\"use strict\";\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\nfunction isHTMLElement(node) {\n if (!node || !node.ownerDocument) {\n return false;\n }\n\n if (!node.ownerDocument.defaultView) {\n return node instanceof HTMLElement;\n }\n\n if (node instanceof node.ownerDocument.defaultView.HTMLElement) {\n return true;\n }\n\n return false;\n}\n\nmodule.exports = isHTMLElement;","\"use strict\";\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\nvar isElement = require(\"./isElement\");\n\nfunction isHTMLImageElement(node) {\n if (!node || !node.ownerDocument) {\n return false;\n }\n\n return isElement(node) && node.nodeName === 'IMG';\n}\n\nmodule.exports = isHTMLImageElement;","\"use strict\";\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\nfunction isInstanceOfNode(target) {\n // we changed the name because of having duplicate module provider (fbjs)\n if (!target || !('ownerDocument' in target)) {\n return false;\n }\n\n if ('ownerDocument' in target) {\n var node = target;\n\n if (!node.ownerDocument.defaultView) {\n return node instanceof Node;\n }\n\n if (node instanceof node.ownerDocument.defaultView.Node) {\n return true;\n }\n }\n\n return false;\n}\n\nmodule.exports = isInstanceOfNode;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nfunction isSelectionAtLeafStart(editorState) {\n var selection = editorState.getSelection();\n var anchorKey = selection.getAnchorKey();\n var blockTree = editorState.getBlockTree(anchorKey);\n var offset = selection.getStartOffset();\n var isAtStart = false;\n blockTree.some(function (leafSet) {\n if (offset === leafSet.get('start')) {\n isAtStart = true;\n return true;\n }\n\n if (offset < leafSet.get('end')) {\n return leafSet.get('leaves').some(function (leaf) {\n var leafStart = leaf.get('start');\n\n if (offset === leafStart) {\n isAtStart = true;\n return true;\n }\n\n return false;\n });\n }\n\n return false;\n });\n return isAtStart;\n}\n\nmodule.exports = isSelectionAtLeafStart;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar Keys = require(\"fbjs/lib/Keys\");\n\nfunction isSoftNewlineEvent(e) {\n return e.which === Keys.RETURN && (e.getModifierState('Shift') || e.getModifierState('Alt') || e.getModifierState('Control'));\n}\n\nmodule.exports = isSoftNewlineEvent;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar EditorState = require(\"./EditorState\");\n\nvar expandRangeToStartOfLine = require(\"./expandRangeToStartOfLine\");\n\nvar getDraftEditorSelectionWithNodes = require(\"./getDraftEditorSelectionWithNodes\");\n\nvar moveSelectionBackward = require(\"./moveSelectionBackward\");\n\nvar removeTextWithStrategy = require(\"./removeTextWithStrategy\");\n\nfunction keyCommandBackspaceToStartOfLine(editorState, e) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n\n if (selection.isCollapsed() && selection.getAnchorOffset() === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n\n var ownerDocument = e.currentTarget.ownerDocument;\n var domSelection = ownerDocument.defaultView.getSelection(); // getRangeAt can technically throw if there's no selection, but we know\n // there is one here because text editor has focus (the cursor is a\n // selection of length 0). Therefore, we don't need to wrap this in a\n // try-catch block.\n\n var range = domSelection.getRangeAt(0);\n range = expandRangeToStartOfLine(range);\n return getDraftEditorSelectionWithNodes(strategyState, null, range.endContainer, range.endOffset, range.startContainer, range.startOffset).selectionState;\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}\n\nmodule.exports = keyCommandBackspaceToStartOfLine;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar DraftRemovableWord = require(\"./DraftRemovableWord\");\n\nvar EditorState = require(\"./EditorState\");\n\nvar moveSelectionBackward = require(\"./moveSelectionBackward\");\n\nvar removeTextWithStrategy = require(\"./removeTextWithStrategy\");\n/**\n * Delete the word that is left of the cursor, as well as any spaces or\n * punctuation after the word.\n */\n\n\nfunction keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset(); // If there are no words before the cursor, remove the preceding newline.\n\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}\n\nmodule.exports = keyCommandBackspaceWord;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar DraftRemovableWord = require(\"./DraftRemovableWord\");\n\nvar EditorState = require(\"./EditorState\");\n\nvar moveSelectionForward = require(\"./moveSelectionForward\");\n\nvar removeTextWithStrategy = require(\"./removeTextWithStrategy\");\n/**\n * Delete the word that is right of the cursor, as well as any spaces or\n * punctuation before the word.\n */\n\n\nfunction keyCommandDeleteWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(offset);\n var toRemove = DraftRemovableWord.getForward(text); // If there are no words in front of the cursor, remove the newline.\n\n return moveSelectionForward(strategyState, toRemove.length || 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}\n\nmodule.exports = keyCommandDeleteWord;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar DraftModifier = require(\"./DraftModifier\");\n\nvar EditorState = require(\"./EditorState\");\n\nfunction keyCommandInsertNewline(editorState) {\n var contentState = DraftModifier.splitBlock(editorState.getCurrentContent(), editorState.getSelection());\n return EditorState.push(editorState, contentState, 'split-block');\n}\n\nmodule.exports = keyCommandInsertNewline;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar EditorState = require(\"./EditorState\");\n/**\n * See comment for `moveSelectionToStartOfBlock`.\n */\n\n\nfunction keyCommandMoveSelectionToEndOfBlock(editorState) {\n var selection = editorState.getSelection();\n var endKey = selection.getEndKey();\n var content = editorState.getCurrentContent();\n var textLength = content.getBlockForKey(endKey).getLength();\n return EditorState.set(editorState, {\n selection: selection.merge({\n anchorKey: endKey,\n anchorOffset: textLength,\n focusKey: endKey,\n focusOffset: textLength,\n isBackward: false\n }),\n forceSelection: true\n });\n}\n\nmodule.exports = keyCommandMoveSelectionToEndOfBlock;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar EditorState = require(\"./EditorState\");\n/**\n * Collapse selection at the start of the first selected block. This is used\n * for Firefox versions that attempt to navigate forward/backward instead of\n * moving the cursor. Other browsers are able to move the cursor natively.\n */\n\n\nfunction keyCommandMoveSelectionToStartOfBlock(editorState) {\n var selection = editorState.getSelection();\n var startKey = selection.getStartKey();\n return EditorState.set(editorState, {\n selection: selection.merge({\n anchorKey: startKey,\n anchorOffset: 0,\n focusKey: startKey,\n focusOffset: 0,\n isBackward: false\n }),\n forceSelection: true\n });\n}\n\nmodule.exports = keyCommandMoveSelectionToStartOfBlock;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar EditorState = require(\"./EditorState\");\n\nvar UnicodeUtils = require(\"fbjs/lib/UnicodeUtils\");\n\nvar moveSelectionBackward = require(\"./moveSelectionBackward\");\n\nvar removeTextWithStrategy = require(\"./removeTextWithStrategy\");\n/**\n * Remove the selected range. If the cursor is collapsed, remove the preceding\n * character. This operation is Unicode-aware, so removing a single character\n * will remove a surrogate pair properly as well.\n */\n\n\nfunction keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}\n\nmodule.exports = keyCommandPlainBackspace;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar EditorState = require(\"./EditorState\");\n\nvar UnicodeUtils = require(\"fbjs/lib/UnicodeUtils\");\n\nvar moveSelectionForward = require(\"./moveSelectionForward\");\n\nvar removeTextWithStrategy = require(\"./removeTextWithStrategy\");\n/**\n * Remove the selected range. If the cursor is collapsed, remove the following\n * character. This operation is Unicode-aware, so removing a single character\n * will remove a surrogate pair properly as well.\n */\n\n\nfunction keyCommandPlainDelete(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charAhead = content.getBlockForKey(key).getText()[offset];\n return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'delete-character' : 'remove-range');\n}\n\nmodule.exports = keyCommandPlainDelete;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar DraftModifier = require(\"./DraftModifier\");\n\nvar EditorState = require(\"./EditorState\");\n\nvar getContentStateFragment = require(\"./getContentStateFragment\");\n/**\n * Transpose the characters on either side of a collapsed cursor, or\n * if the cursor is at the end of the block, transpose the last two\n * characters.\n */\n\n\nfunction keyCommandTransposeCharacters(editorState) {\n var selection = editorState.getSelection();\n\n if (!selection.isCollapsed()) {\n return editorState;\n }\n\n var offset = selection.getAnchorOffset();\n\n if (offset === 0) {\n return editorState;\n }\n\n var blockKey = selection.getAnchorKey();\n var content = editorState.getCurrentContent();\n var block = content.getBlockForKey(blockKey);\n var length = block.getLength(); // Nothing to transpose if there aren't two characters.\n\n if (length <= 1) {\n return editorState;\n }\n\n var removalRange;\n var finalSelection;\n\n if (offset === length) {\n // The cursor is at the end of the block. Swap the last two characters.\n removalRange = selection.set('anchorOffset', offset - 1);\n finalSelection = selection;\n } else {\n removalRange = selection.set('focusOffset', offset + 1);\n finalSelection = removalRange.set('anchorOffset', offset + 1);\n } // Extract the character to move as a fragment. This preserves its\n // styling and entity, if any.\n\n\n var movedFragment = getContentStateFragment(content, removalRange);\n var afterRemoval = DraftModifier.removeRange(content, removalRange, 'backward'); // After the removal, the insertion target is one character back.\n\n var selectionAfter = afterRemoval.getSelectionAfter();\n var targetOffset = selectionAfter.getAnchorOffset() - 1;\n var targetRange = selectionAfter.merge({\n anchorOffset: targetOffset,\n focusOffset: targetOffset\n });\n var afterInsert = DraftModifier.replaceWithFragment(afterRemoval, targetRange, movedFragment);\n var newEditorState = EditorState.push(editorState, afterInsert, 'insert-fragment');\n return EditorState.acceptSelection(newEditorState, finalSelection);\n}\n\nmodule.exports = keyCommandTransposeCharacters;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar EditorState = require(\"./EditorState\");\n\nfunction keyCommandUndo(e, editorState, updateFn) {\n var undoneState = EditorState.undo(editorState); // If the last change to occur was a spellcheck change, allow the undo\n // event to fall through to the browser. This allows the browser to record\n // the unwanted change, which should soon lead it to learn not to suggest\n // the correction again.\n\n if (editorState.getLastChangeType() === 'spellcheck-change') {\n var nativelyRenderedContent = undoneState.getCurrentContent();\n updateFn(EditorState.set(undoneState, {\n nativelyRenderedContent: nativelyRenderedContent\n }));\n return;\n } // Otheriwse, manage the undo behavior manually.\n\n\n e.preventDefault();\n\n if (!editorState.getNativelyRenderedContent()) {\n updateFn(undoneState);\n return;\n } // Trigger a re-render with the current content state to ensure that the\n // component tree has up-to-date props for comparison.\n\n\n updateFn(EditorState.set(editorState, {\n nativelyRenderedContent: null\n })); // Wait to ensure that the re-render has occurred before performing\n // the undo action.\n\n setTimeout(function () {\n updateFn(undoneState);\n }, 0);\n}\n\nmodule.exports = keyCommandUndo;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar Immutable = require(\"immutable\");\n\nvar Map = Immutable.Map;\n\nfunction modifyBlockForContentState(contentState, selectionState, operation) {\n var startKey = selectionState.getStartKey();\n var endKey = selectionState.getEndKey();\n var blockMap = contentState.getBlockMap();\n var newBlocks = blockMap.toSeq().skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).concat(Map([[endKey, blockMap.get(endKey)]])).map(operation);\n return contentState.merge({\n blockMap: blockMap.merge(newBlocks),\n selectionBefore: selectionState,\n selectionAfter: selectionState\n });\n}\n\nmodule.exports = modifyBlockForContentState;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar ContentBlockNode = require(\"./ContentBlockNode\");\n\nvar getNextDelimiterBlockKey = require(\"./getNextDelimiterBlockKey\");\n\nvar Immutable = require(\"immutable\");\n\nvar invariant = require(\"fbjs/lib/invariant\");\n\nvar OrderedMap = Immutable.OrderedMap,\n List = Immutable.List;\n\nvar transformBlock = function transformBlock(key, blockMap, func) {\n if (!key) {\n return;\n }\n\n var block = blockMap.get(key);\n\n if (!block) {\n return;\n }\n\n blockMap.set(key, func(block));\n};\n\nvar updateBlockMapLinks = function updateBlockMapLinks(blockMap, originalBlockToBeMoved, originalTargetBlock, insertionMode, isExperimentalTreeBlock) {\n if (!isExperimentalTreeBlock) {\n return blockMap;\n } // possible values of 'insertionMode' are: 'after', 'before'\n\n\n var isInsertedAfterTarget = insertionMode === 'after';\n var originalBlockKey = originalBlockToBeMoved.getKey();\n var originalTargetKey = originalTargetBlock.getKey();\n var originalParentKey = originalBlockToBeMoved.getParentKey();\n var originalNextSiblingKey = originalBlockToBeMoved.getNextSiblingKey();\n var originalPrevSiblingKey = originalBlockToBeMoved.getPrevSiblingKey();\n var newParentKey = originalTargetBlock.getParentKey();\n var newNextSiblingKey = isInsertedAfterTarget ? originalTargetBlock.getNextSiblingKey() : originalTargetKey;\n var newPrevSiblingKey = isInsertedAfterTarget ? originalTargetKey : originalTargetBlock.getPrevSiblingKey();\n return blockMap.withMutations(function (blocks) {\n // update old parent\n transformBlock(originalParentKey, blocks, function (block) {\n var parentChildrenList = block.getChildKeys();\n return block.merge({\n children: parentChildrenList[\"delete\"](parentChildrenList.indexOf(originalBlockKey))\n });\n }); // update old prev\n\n transformBlock(originalPrevSiblingKey, blocks, function (block) {\n return block.merge({\n nextSibling: originalNextSiblingKey\n });\n }); // update old next\n\n transformBlock(originalNextSiblingKey, blocks, function (block) {\n return block.merge({\n prevSibling: originalPrevSiblingKey\n });\n }); // update new next\n\n transformBlock(newNextSiblingKey, blocks, function (block) {\n return block.merge({\n prevSibling: originalBlockKey\n });\n }); // update new prev\n\n transformBlock(newPrevSiblingKey, blocks, function (block) {\n return block.merge({\n nextSibling: originalBlockKey\n });\n }); // update new parent\n\n transformBlock(newParentKey, blocks, function (block) {\n var newParentChildrenList = block.getChildKeys();\n var targetBlockIndex = newParentChildrenList.indexOf(originalTargetKey);\n var insertionIndex = isInsertedAfterTarget ? targetBlockIndex + 1 : targetBlockIndex !== 0 ? targetBlockIndex - 1 : 0;\n var newChildrenArray = newParentChildrenList.toArray();\n newChildrenArray.splice(insertionIndex, 0, originalBlockKey);\n return block.merge({\n children: List(newChildrenArray)\n });\n }); // update block\n\n transformBlock(originalBlockKey, blocks, function (block) {\n return block.merge({\n nextSibling: newNextSiblingKey,\n prevSibling: newPrevSiblingKey,\n parent: newParentKey\n });\n });\n });\n};\n\nvar moveBlockInContentState = function moveBlockInContentState(contentState, blockToBeMoved, targetBlock, insertionMode) {\n !(insertionMode !== 'replace') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Replacing blocks is not supported.') : invariant(false) : void 0;\n var targetKey = targetBlock.getKey();\n var blockKey = blockToBeMoved.getKey();\n !(blockKey !== targetKey) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Block cannot be moved next to itself.') : invariant(false) : void 0;\n var blockMap = contentState.getBlockMap();\n var isExperimentalTreeBlock = blockToBeMoved instanceof ContentBlockNode;\n var blocksToBeMoved = [blockToBeMoved];\n var blockMapWithoutBlocksToBeMoved = blockMap[\"delete\"](blockKey);\n\n if (isExperimentalTreeBlock) {\n blocksToBeMoved = [];\n blockMapWithoutBlocksToBeMoved = blockMap.withMutations(function (blocks) {\n var nextSiblingKey = blockToBeMoved.getNextSiblingKey();\n var nextDelimiterBlockKey = getNextDelimiterBlockKey(blockToBeMoved, blocks);\n blocks.toSeq().skipUntil(function (block) {\n return block.getKey() === blockKey;\n }).takeWhile(function (block) {\n var key = block.getKey();\n var isBlockToBeMoved = key === blockKey;\n var hasNextSiblingAndIsNotNextSibling = nextSiblingKey && key !== nextSiblingKey;\n var doesNotHaveNextSiblingAndIsNotDelimiter = !nextSiblingKey && block.getParentKey() && (!nextDelimiterBlockKey || key !== nextDelimiterBlockKey);\n return !!(isBlockToBeMoved || hasNextSiblingAndIsNotNextSibling || doesNotHaveNextSiblingAndIsNotDelimiter);\n }).forEach(function (block) {\n blocksToBeMoved.push(block);\n blocks[\"delete\"](block.getKey());\n });\n });\n }\n\n var blocksBefore = blockMapWithoutBlocksToBeMoved.toSeq().takeUntil(function (v) {\n return v === targetBlock;\n });\n var blocksAfter = blockMapWithoutBlocksToBeMoved.toSeq().skipUntil(function (v) {\n return v === targetBlock;\n }).skip(1);\n var slicedBlocks = blocksToBeMoved.map(function (block) {\n return [block.getKey(), block];\n });\n var newBlocks = OrderedMap();\n\n if (insertionMode === 'before') {\n var blockBefore = contentState.getBlockBefore(targetKey);\n !(!blockBefore || blockBefore.getKey() !== blockToBeMoved.getKey()) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Block cannot be moved next to itself.') : invariant(false) : void 0;\n newBlocks = blocksBefore.concat([].concat(slicedBlocks, [[targetKey, targetBlock]]), blocksAfter).toOrderedMap();\n } else if (insertionMode === 'after') {\n var blockAfter = contentState.getBlockAfter(targetKey);\n !(!blockAfter || blockAfter.getKey() !== blockKey) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Block cannot be moved next to itself.') : invariant(false) : void 0;\n newBlocks = blocksBefore.concat([[targetKey, targetBlock]].concat(slicedBlocks), blocksAfter).toOrderedMap();\n }\n\n return contentState.merge({\n blockMap: updateBlockMapLinks(newBlocks, blockToBeMoved, targetBlock, insertionMode, isExperimentalTreeBlock),\n selectionBefore: contentState.getSelectionAfter(),\n selectionAfter: contentState.getSelectionAfter().merge({\n anchorKey: blockKey,\n focusKey: blockKey\n })\n });\n};\n\nmodule.exports = moveBlockInContentState;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar warning = require(\"fbjs/lib/warning\");\n/**\n * Given a collapsed selection, move the focus `maxDistance` backward within\n * the selected block. If the selection will go beyond the start of the block,\n * move focus to the end of the previous block, but no further.\n *\n * This function is not Unicode-aware, so surrogate pairs will be treated\n * as having length 2.\n */\n\n\nfunction moveSelectionBackward(editorState, maxDistance) {\n var selection = editorState.getSelection(); // Should eventually make this an invariant\n\n process.env.NODE_ENV !== \"production\" ? warning(selection.isCollapsed(), 'moveSelectionBackward should only be called with a collapsed SelectionState') : void 0;\n var content = editorState.getCurrentContent();\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n var focusKey = key;\n var focusOffset = 0;\n\n if (maxDistance > offset) {\n var keyBefore = content.getKeyBefore(key);\n\n if (keyBefore == null) {\n focusKey = key;\n } else {\n focusKey = keyBefore;\n var blockBefore = content.getBlockForKey(keyBefore);\n focusOffset = blockBefore.getText().length;\n }\n } else {\n focusOffset = offset - maxDistance;\n }\n\n return selection.merge({\n focusKey: focusKey,\n focusOffset: focusOffset,\n isBackward: true\n });\n}\n\nmodule.exports = moveSelectionBackward;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar warning = require(\"fbjs/lib/warning\");\n/**\n * Given a collapsed selection, move the focus `maxDistance` forward within\n * the selected block. If the selection will go beyond the end of the block,\n * move focus to the start of the next block, but no further.\n *\n * This function is not Unicode-aware, so surrogate pairs will be treated\n * as having length 2.\n */\n\n\nfunction moveSelectionForward(editorState, maxDistance) {\n var selection = editorState.getSelection(); // Should eventually make this an invariant\n\n process.env.NODE_ENV !== \"production\" ? warning(selection.isCollapsed(), 'moveSelectionForward should only be called with a collapsed SelectionState') : void 0;\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n var content = editorState.getCurrentContent();\n var focusKey = key;\n var focusOffset;\n var block = content.getBlockForKey(key);\n\n if (maxDistance > block.getText().length - offset) {\n focusKey = content.getKeyAfter(key);\n focusOffset = 0;\n } else {\n focusOffset = offset + maxDistance;\n }\n\n return selection.merge({\n focusKey: focusKey,\n focusOffset: focusOffset\n });\n}\n\nmodule.exports = moveSelectionForward;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar ContentBlockNode = require(\"./ContentBlockNode\");\n\nvar generateRandomKey = require(\"./generateRandomKey\");\n\nvar Immutable = require(\"immutable\");\n\nvar OrderedMap = Immutable.OrderedMap;\n\nvar randomizeContentBlockNodeKeys = function randomizeContentBlockNodeKeys(blockMap) {\n var newKeysRef = {}; // we keep track of root blocks in order to update subsequent sibling links\n\n var lastRootBlock;\n return OrderedMap(blockMap.withMutations(function (blockMapState) {\n blockMapState.forEach(function (block, index) {\n var oldKey = block.getKey();\n var nextKey = block.getNextSiblingKey();\n var prevKey = block.getPrevSiblingKey();\n var childrenKeys = block.getChildKeys();\n var parentKey = block.getParentKey(); // new key that we will use to build linking\n\n var key = generateRandomKey(); // we will add it here to re-use it later\n\n newKeysRef[oldKey] = key;\n\n if (nextKey) {\n var nextBlock = blockMapState.get(nextKey);\n\n if (nextBlock) {\n blockMapState.setIn([nextKey, 'prevSibling'], key);\n } else {\n // this can happen when generating random keys for fragments\n blockMapState.setIn([oldKey, 'nextSibling'], null);\n }\n }\n\n if (prevKey) {\n var prevBlock = blockMapState.get(prevKey);\n\n if (prevBlock) {\n blockMapState.setIn([prevKey, 'nextSibling'], key);\n } else {\n // this can happen when generating random keys for fragments\n blockMapState.setIn([oldKey, 'prevSibling'], null);\n }\n }\n\n if (parentKey && blockMapState.get(parentKey)) {\n var parentBlock = blockMapState.get(parentKey);\n var parentChildrenList = parentBlock.getChildKeys();\n blockMapState.setIn([parentKey, 'children'], parentChildrenList.set(parentChildrenList.indexOf(block.getKey()), key));\n } else {\n // blocks will then be treated as root block nodes\n blockMapState.setIn([oldKey, 'parent'], null);\n\n if (lastRootBlock) {\n blockMapState.setIn([lastRootBlock.getKey(), 'nextSibling'], key);\n blockMapState.setIn([oldKey, 'prevSibling'], newKeysRef[lastRootBlock.getKey()]);\n }\n\n lastRootBlock = blockMapState.get(oldKey);\n }\n\n childrenKeys.forEach(function (childKey) {\n var childBlock = blockMapState.get(childKey);\n\n if (childBlock) {\n blockMapState.setIn([childKey, 'parent'], key);\n } else {\n blockMapState.setIn([oldKey, 'children'], block.getChildKeys().filter(function (child) {\n return child !== childKey;\n }));\n }\n });\n });\n }).toArray().map(function (block) {\n return [newKeysRef[block.getKey()], block.set('key', newKeysRef[block.getKey()])];\n }));\n};\n\nvar randomizeContentBlockKeys = function randomizeContentBlockKeys(blockMap) {\n return OrderedMap(blockMap.toArray().map(function (block) {\n var key = generateRandomKey();\n return [key, block.set('key', key)];\n }));\n};\n\nvar randomizeBlockMapKeys = function randomizeBlockMapKeys(blockMap) {\n var isTreeBasedBlockMap = blockMap.first() instanceof ContentBlockNode;\n\n if (!isTreeBasedBlockMap) {\n return randomizeContentBlockKeys(blockMap);\n }\n\n return randomizeContentBlockNodeKeys(blockMap);\n};\n\nmodule.exports = randomizeBlockMapKeys;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar CharacterMetadata = require(\"./CharacterMetadata\");\n\nvar findRangesImmutable = require(\"./findRangesImmutable\");\n\nvar invariant = require(\"fbjs/lib/invariant\");\n\nfunction removeEntitiesAtEdges(contentState, selectionState) {\n var blockMap = contentState.getBlockMap();\n var entityMap = contentState.getEntityMap();\n var updatedBlocks = {};\n var startKey = selectionState.getStartKey();\n var startOffset = selectionState.getStartOffset();\n var startBlock = blockMap.get(startKey);\n var updatedStart = removeForBlock(entityMap, startBlock, startOffset);\n\n if (updatedStart !== startBlock) {\n updatedBlocks[startKey] = updatedStart;\n }\n\n var endKey = selectionState.getEndKey();\n var endOffset = selectionState.getEndOffset();\n var endBlock = blockMap.get(endKey);\n\n if (startKey === endKey) {\n endBlock = updatedStart;\n }\n\n var updatedEnd = removeForBlock(entityMap, endBlock, endOffset);\n\n if (updatedEnd !== endBlock) {\n updatedBlocks[endKey] = updatedEnd;\n }\n\n if (!Object.keys(updatedBlocks).length) {\n return contentState.set('selectionAfter', selectionState);\n }\n\n return contentState.merge({\n blockMap: blockMap.merge(updatedBlocks),\n selectionAfter: selectionState\n });\n}\n/**\n * Given a list of characters and an offset that is in the middle of an entity,\n * returns the start and end of the entity that is overlapping the offset.\n * Note: This method requires that the offset be in an entity range.\n */\n\n\nfunction getRemovalRange(characters, entityKey, offset) {\n var removalRange; // Iterates through a list looking for ranges of matching items\n // based on the 'isEqual' callback.\n // Then instead of returning the result, call the 'found' callback\n // with each range.\n // Then filters those ranges based on the 'filter' callback\n //\n // Here we use it to find ranges of characters with the same entity key.\n\n findRangesImmutable(characters, // the list to iterate through\n function (a, b) {\n return a.getEntity() === b.getEntity();\n }, // 'isEqual' callback\n function (element) {\n return element.getEntity() === entityKey;\n }, // 'filter' callback\n function (start, end) {\n // 'found' callback\n if (start <= offset && end >= offset) {\n // this entity overlaps the offset index\n removalRange = {\n start: start,\n end: end\n };\n }\n });\n !(typeof removalRange === 'object') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Removal range must exist within character list.') : invariant(false) : void 0;\n return removalRange;\n}\n\nfunction removeForBlock(entityMap, block, offset) {\n var chars = block.getCharacterList();\n var charBefore = offset > 0 ? chars.get(offset - 1) : undefined;\n var charAfter = offset < chars.count() ? chars.get(offset) : undefined;\n var entityBeforeCursor = charBefore ? charBefore.getEntity() : undefined;\n var entityAfterCursor = charAfter ? charAfter.getEntity() : undefined;\n\n if (entityAfterCursor && entityAfterCursor === entityBeforeCursor) {\n var entity = entityMap.__get(entityAfterCursor);\n\n if (entity.getMutability() !== 'MUTABLE') {\n var _getRemovalRange = getRemovalRange(chars, entityAfterCursor, offset),\n start = _getRemovalRange.start,\n end = _getRemovalRange.end;\n\n var current;\n\n while (start < end) {\n current = chars.get(start);\n chars = chars.set(start, CharacterMetadata.applyEntity(current, null));\n start++;\n }\n\n return block.set('characterList', chars);\n }\n }\n\n return block;\n}\n\nmodule.exports = removeEntitiesAtEdges;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar ContentBlockNode = require(\"./ContentBlockNode\");\n\nvar getNextDelimiterBlockKey = require(\"./getNextDelimiterBlockKey\");\n\nvar Immutable = require(\"immutable\");\n\nvar List = Immutable.List,\n Map = Immutable.Map;\n\nvar transformBlock = function transformBlock(key, blockMap, func) {\n if (!key) {\n return;\n }\n\n var block = blockMap.get(key);\n\n if (!block) {\n return;\n }\n\n blockMap.set(key, func(block));\n};\n/**\n * Ancestors needs to be preserved when there are non selected\n * children to make sure we do not leave any orphans behind\n */\n\n\nvar getAncestorsKeys = function getAncestorsKeys(blockKey, blockMap) {\n var parents = [];\n\n if (!blockKey) {\n return parents;\n }\n\n var blockNode = blockMap.get(blockKey);\n\n while (blockNode && blockNode.getParentKey()) {\n var parentKey = blockNode.getParentKey();\n\n if (parentKey) {\n parents.push(parentKey);\n }\n\n blockNode = parentKey ? blockMap.get(parentKey) : null;\n }\n\n return parents;\n};\n/**\n * Get all next delimiter keys until we hit a root delimiter and return\n * an array of key references\n */\n\n\nvar getNextDelimitersBlockKeys = function getNextDelimitersBlockKeys(block, blockMap) {\n var nextDelimiters = [];\n\n if (!block) {\n return nextDelimiters;\n }\n\n var nextDelimiter = getNextDelimiterBlockKey(block, blockMap);\n\n while (nextDelimiter && blockMap.get(nextDelimiter)) {\n var _block = blockMap.get(nextDelimiter);\n\n nextDelimiters.push(nextDelimiter); // we do not need to keep checking all root node siblings, just the first occurance\n\n nextDelimiter = _block.getParentKey() ? getNextDelimiterBlockKey(_block, blockMap) : null;\n }\n\n return nextDelimiters;\n};\n\nvar getNextValidSibling = function getNextValidSibling(block, blockMap, originalBlockMap) {\n if (!block) {\n return null;\n } // note that we need to make sure we refer to the original block since this\n // function is called within a withMutations\n\n\n var nextValidSiblingKey = originalBlockMap.get(block.getKey()).getNextSiblingKey();\n\n while (nextValidSiblingKey && !blockMap.get(nextValidSiblingKey)) {\n nextValidSiblingKey = originalBlockMap.get(nextValidSiblingKey).getNextSiblingKey() || null;\n }\n\n return nextValidSiblingKey;\n};\n\nvar getPrevValidSibling = function getPrevValidSibling(block, blockMap, originalBlockMap) {\n if (!block) {\n return null;\n } // note that we need to make sure we refer to the original block since this\n // function is called within a withMutations\n\n\n var prevValidSiblingKey = originalBlockMap.get(block.getKey()).getPrevSiblingKey();\n\n while (prevValidSiblingKey && !blockMap.get(prevValidSiblingKey)) {\n prevValidSiblingKey = originalBlockMap.get(prevValidSiblingKey).getPrevSiblingKey() || null;\n }\n\n return prevValidSiblingKey;\n};\n\nvar updateBlockMapLinks = function updateBlockMapLinks(blockMap, startBlock, endBlock, originalBlockMap) {\n return blockMap.withMutations(function (blocks) {\n // update start block if its retained\n transformBlock(startBlock.getKey(), blocks, function (block) {\n return block.merge({\n nextSibling: getNextValidSibling(block, blocks, originalBlockMap),\n prevSibling: getPrevValidSibling(block, blocks, originalBlockMap)\n });\n }); // update endblock if its retained\n\n transformBlock(endBlock.getKey(), blocks, function (block) {\n return block.merge({\n nextSibling: getNextValidSibling(block, blocks, originalBlockMap),\n prevSibling: getPrevValidSibling(block, blocks, originalBlockMap)\n });\n }); // update start block parent ancestors\n\n getAncestorsKeys(startBlock.getKey(), originalBlockMap).forEach(function (parentKey) {\n return transformBlock(parentKey, blocks, function (block) {\n return block.merge({\n children: block.getChildKeys().filter(function (key) {\n return blocks.get(key);\n }),\n nextSibling: getNextValidSibling(block, blocks, originalBlockMap),\n prevSibling: getPrevValidSibling(block, blocks, originalBlockMap)\n });\n });\n }); // update start block next - can only happen if startBlock == endBlock\n\n transformBlock(startBlock.getNextSiblingKey(), blocks, function (block) {\n return block.merge({\n prevSibling: startBlock.getPrevSiblingKey()\n });\n }); // update start block prev\n\n transformBlock(startBlock.getPrevSiblingKey(), blocks, function (block) {\n return block.merge({\n nextSibling: getNextValidSibling(block, blocks, originalBlockMap)\n });\n }); // update end block next\n\n transformBlock(endBlock.getNextSiblingKey(), blocks, function (block) {\n return block.merge({\n prevSibling: getPrevValidSibling(block, blocks, originalBlockMap)\n });\n }); // update end block prev\n\n transformBlock(endBlock.getPrevSiblingKey(), blocks, function (block) {\n return block.merge({\n nextSibling: endBlock.getNextSiblingKey()\n });\n }); // update end block parent ancestors\n\n getAncestorsKeys(endBlock.getKey(), originalBlockMap).forEach(function (parentKey) {\n transformBlock(parentKey, blocks, function (block) {\n return block.merge({\n children: block.getChildKeys().filter(function (key) {\n return blocks.get(key);\n }),\n nextSibling: getNextValidSibling(block, blocks, originalBlockMap),\n prevSibling: getPrevValidSibling(block, blocks, originalBlockMap)\n });\n });\n }); // update next delimiters all the way to a root delimiter\n\n getNextDelimitersBlockKeys(endBlock, originalBlockMap).forEach(function (delimiterKey) {\n return transformBlock(delimiterKey, blocks, function (block) {\n return block.merge({\n nextSibling: getNextValidSibling(block, blocks, originalBlockMap),\n prevSibling: getPrevValidSibling(block, blocks, originalBlockMap)\n });\n });\n }); // if parent (startBlock) was deleted\n\n if (blockMap.get(startBlock.getKey()) == null && blockMap.get(endBlock.getKey()) != null && endBlock.getParentKey() === startBlock.getKey() && endBlock.getPrevSiblingKey() == null) {\n var prevSiblingKey = startBlock.getPrevSiblingKey(); // endBlock becomes next sibling of parent's prevSibling\n\n transformBlock(endBlock.getKey(), blocks, function (block) {\n return block.merge({\n prevSibling: prevSiblingKey\n });\n });\n transformBlock(prevSiblingKey, blocks, function (block) {\n return block.merge({\n nextSibling: endBlock.getKey()\n });\n }); // Update parent for previous parent's children, and children for that parent\n\n var prevSibling = prevSiblingKey ? blockMap.get(prevSiblingKey) : null;\n var newParentKey = prevSibling ? prevSibling.getParentKey() : null;\n startBlock.getChildKeys().forEach(function (childKey) {\n transformBlock(childKey, blocks, function (block) {\n return block.merge({\n parent: newParentKey // set to null if there is no parent\n\n });\n });\n });\n\n if (newParentKey != null) {\n var newParent = blockMap.get(newParentKey);\n transformBlock(newParentKey, blocks, function (block) {\n return block.merge({\n children: newParent.getChildKeys().concat(startBlock.getChildKeys())\n });\n });\n } // last child of deleted parent should point to next sibling\n\n\n transformBlock(startBlock.getChildKeys().find(function (key) {\n var block = blockMap.get(key);\n return block.getNextSiblingKey() === null;\n }), blocks, function (block) {\n return block.merge({\n nextSibling: startBlock.getNextSiblingKey()\n });\n });\n }\n });\n};\n\nvar removeRangeFromContentState = function removeRangeFromContentState(contentState, selectionState) {\n if (selectionState.isCollapsed()) {\n return contentState;\n }\n\n var blockMap = contentState.getBlockMap();\n var startKey = selectionState.getStartKey();\n var startOffset = selectionState.getStartOffset();\n var endKey = selectionState.getEndKey();\n var endOffset = selectionState.getEndOffset();\n var startBlock = blockMap.get(startKey);\n var endBlock = blockMap.get(endKey); // we assume that ContentBlockNode and ContentBlocks are not mixed together\n\n var isExperimentalTreeBlock = startBlock instanceof ContentBlockNode; // used to retain blocks that should not be deleted to avoid orphan children\n\n var parentAncestors = [];\n\n if (isExperimentalTreeBlock) {\n var endBlockchildrenKeys = endBlock.getChildKeys();\n var endBlockAncestors = getAncestorsKeys(endKey, blockMap); // endBlock has unselected siblings so we can not remove its ancestors parents\n\n if (endBlock.getNextSiblingKey()) {\n parentAncestors = parentAncestors.concat(endBlockAncestors);\n } // endBlock has children so can not remove this block or any of its ancestors\n\n\n if (!endBlockchildrenKeys.isEmpty()) {\n parentAncestors = parentAncestors.concat(endBlockAncestors.concat([endKey]));\n } // we need to retain all ancestors of the next delimiter block\n\n\n parentAncestors = parentAncestors.concat(getAncestorsKeys(getNextDelimiterBlockKey(endBlock, blockMap), blockMap));\n }\n\n var characterList;\n\n if (startBlock === endBlock) {\n characterList = removeFromList(startBlock.getCharacterList(), startOffset, endOffset);\n } else {\n characterList = startBlock.getCharacterList().slice(0, startOffset).concat(endBlock.getCharacterList().slice(endOffset));\n }\n\n var modifiedStart = startBlock.merge({\n text: startBlock.getText().slice(0, startOffset) + endBlock.getText().slice(endOffset),\n characterList: characterList\n }); // If cursor (collapsed) is at the start of the first child, delete parent\n // instead of child\n\n var shouldDeleteParent = isExperimentalTreeBlock && startOffset === 0 && endOffset === 0 && endBlock.getParentKey() === startKey && endBlock.getPrevSiblingKey() == null;\n var newBlocks = shouldDeleteParent ? Map([[startKey, null]]) : blockMap.toSeq().skipUntil(function (_, k) {\n return k === startKey;\n }).takeUntil(function (_, k) {\n return k === endKey;\n }).filter(function (_, k) {\n return parentAncestors.indexOf(k) === -1;\n }).concat(Map([[endKey, null]])).map(function (_, k) {\n return k === startKey ? modifiedStart : null;\n });\n var updatedBlockMap = blockMap.merge(newBlocks).filter(function (block) {\n return !!block;\n }); // Only update tree block pointers if the range is across blocks\n\n if (isExperimentalTreeBlock && startBlock !== endBlock) {\n updatedBlockMap = updateBlockMapLinks(updatedBlockMap, startBlock, endBlock, blockMap);\n }\n\n return contentState.merge({\n blockMap: updatedBlockMap,\n selectionBefore: selectionState,\n selectionAfter: selectionState.merge({\n anchorKey: startKey,\n anchorOffset: startOffset,\n focusKey: startKey,\n focusOffset: startOffset,\n isBackward: false\n })\n });\n};\n/**\n * Maintain persistence for target list when removing characters on the\n * head and tail of the character list.\n */\n\n\nvar removeFromList = function removeFromList(targetList, startOffset, endOffset) {\n if (startOffset === 0) {\n while (startOffset < endOffset) {\n targetList = targetList.shift();\n startOffset++;\n }\n } else if (endOffset === targetList.count()) {\n while (endOffset > startOffset) {\n targetList = targetList.pop();\n endOffset--;\n }\n } else {\n var head = targetList.slice(0, startOffset);\n var tail = targetList.slice(endOffset);\n targetList = head.concat(tail).toList();\n }\n\n return targetList;\n};\n\nmodule.exports = removeRangeFromContentState;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar DraftModifier = require(\"./DraftModifier\");\n\nvar gkx = require(\"./gkx\");\n\nvar experimentalTreeDataSupport = gkx('draft_tree_data_support');\n/**\n * For a collapsed selection state, remove text based on the specified strategy.\n * If the selection state is not collapsed, remove the entire selected range.\n */\n\nfunction removeTextWithStrategy(editorState, strategy, direction) {\n var selection = editorState.getSelection();\n var content = editorState.getCurrentContent();\n var target = selection;\n var anchorKey = selection.getAnchorKey();\n var focusKey = selection.getFocusKey();\n var anchorBlock = content.getBlockForKey(anchorKey);\n\n if (experimentalTreeDataSupport) {\n if (direction === 'forward') {\n if (anchorKey !== focusKey) {\n // For now we ignore forward delete across blocks,\n // if there is demand for this we will implement it.\n return content;\n }\n }\n }\n\n if (selection.isCollapsed()) {\n if (direction === 'forward') {\n if (editorState.isSelectionAtEndOfContent()) {\n return content;\n }\n\n if (experimentalTreeDataSupport) {\n var isAtEndOfBlock = selection.getAnchorOffset() === content.getBlockForKey(anchorKey).getLength();\n\n if (isAtEndOfBlock) {\n var anchorBlockSibling = content.getBlockForKey(anchorBlock.nextSibling);\n\n if (!anchorBlockSibling || anchorBlockSibling.getLength() === 0) {\n // For now we ignore forward delete at the end of a block,\n // if there is demand for this we will implement it.\n return content;\n }\n }\n }\n } else if (editorState.isSelectionAtStartOfContent()) {\n return content;\n }\n\n target = strategy(editorState);\n\n if (target === selection) {\n return content;\n }\n }\n\n return DraftModifier.removeRange(content, target, direction);\n}\n\nmodule.exports = removeTextWithStrategy;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar REGEX_BLOCK_DELIMITER = new RegExp('\\r', 'g');\n\nfunction sanitizeDraftText(input) {\n return input.replace(REGEX_BLOCK_DELIMITER, '');\n}\n\nmodule.exports = sanitizeDraftText;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar DraftEffects = require(\"./DraftEffects\");\n\nvar DraftJsDebugLogging = require(\"./DraftJsDebugLogging\");\n\nvar UserAgent = require(\"fbjs/lib/UserAgent\");\n\nvar containsNode = require(\"fbjs/lib/containsNode\");\n\nvar getActiveElement = require(\"fbjs/lib/getActiveElement\");\n\nvar getCorrectDocumentFromNode = require(\"./getCorrectDocumentFromNode\");\n\nvar invariant = require(\"fbjs/lib/invariant\");\n\nvar isElement = require(\"./isElement\");\n\nvar isIE = UserAgent.isBrowser('IE');\n\nfunction getAnonymizedDOM(node, getNodeLabels) {\n if (!node) {\n return '[empty]';\n }\n\n var anonymized = anonymizeTextWithin(node, getNodeLabels);\n\n if (anonymized.nodeType === Node.TEXT_NODE) {\n return anonymized.textContent;\n }\n\n !isElement(anonymized) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Node must be an Element if it is not a text node.') : invariant(false) : void 0;\n var castedElement = anonymized;\n return castedElement.outerHTML;\n}\n\nfunction anonymizeTextWithin(node, getNodeLabels) {\n var labels = getNodeLabels !== undefined ? getNodeLabels(node) : [];\n\n if (node.nodeType === Node.TEXT_NODE) {\n var length = node.textContent.length;\n return getCorrectDocumentFromNode(node).createTextNode('[text ' + length + (labels.length ? ' | ' + labels.join(', ') : '') + ']');\n }\n\n var clone = node.cloneNode();\n\n if (clone.nodeType === 1 && labels.length) {\n clone.setAttribute('data-labels', labels.join(', '));\n }\n\n var childNodes = node.childNodes;\n\n for (var ii = 0; ii < childNodes.length; ii++) {\n clone.appendChild(anonymizeTextWithin(childNodes[ii], getNodeLabels));\n }\n\n return clone;\n}\n\nfunction getAnonymizedEditorDOM(node, getNodeLabels) {\n // grabbing the DOM content of the Draft editor\n var currentNode = node; // this should only be used after checking with isElement\n\n var castedNode = currentNode;\n\n while (currentNode) {\n if (isElement(currentNode) && castedNode.hasAttribute('contenteditable')) {\n // found the Draft editor container\n return getAnonymizedDOM(currentNode, getNodeLabels);\n } else {\n currentNode = currentNode.parentNode;\n castedNode = currentNode;\n }\n }\n\n return 'Could not find contentEditable parent of node';\n}\n\nfunction getNodeLength(node) {\n return node.nodeValue === null ? node.childNodes.length : node.nodeValue.length;\n}\n/**\n * In modern non-IE browsers, we can support both forward and backward\n * selections.\n *\n * Note: IE10+ supports the Selection object, but it does not support\n * the `extend` method, which means that even in modern IE, it's not possible\n * to programatically create a backward selection. Thus, for all IE\n * versions, we use the old IE API to create our selections.\n */\n\n\nfunction setDraftEditorSelection(selectionState, node, blockKey, nodeStart, nodeEnd) {\n // It's possible that the editor has been removed from the DOM but\n // our selection code doesn't know it yet. Forcing selection in\n // this case may lead to errors, so just bail now.\n var documentObject = getCorrectDocumentFromNode(node);\n\n if (!containsNode(documentObject.documentElement, node)) {\n return;\n }\n\n var selection = documentObject.defaultView.getSelection();\n var anchorKey = selectionState.getAnchorKey();\n var anchorOffset = selectionState.getAnchorOffset();\n var focusKey = selectionState.getFocusKey();\n var focusOffset = selectionState.getFocusOffset();\n var isBackward = selectionState.getIsBackward(); // IE doesn't support backward selection. Swap key/offset pairs.\n\n if (!selection.extend && isBackward) {\n var tempKey = anchorKey;\n var tempOffset = anchorOffset;\n anchorKey = focusKey;\n anchorOffset = focusOffset;\n focusKey = tempKey;\n focusOffset = tempOffset;\n isBackward = false;\n }\n\n var hasAnchor = anchorKey === blockKey && nodeStart <= anchorOffset && nodeEnd >= anchorOffset;\n var hasFocus = focusKey === blockKey && nodeStart <= focusOffset && nodeEnd >= focusOffset; // If the selection is entirely bound within this node, set the selection\n // and be done.\n\n if (hasAnchor && hasFocus) {\n selection.removeAllRanges();\n addPointToSelection(selection, node, anchorOffset - nodeStart, selectionState);\n addFocusToSelection(selection, node, focusOffset - nodeStart, selectionState);\n return;\n }\n\n if (!isBackward) {\n // If the anchor is within this node, set the range start.\n if (hasAnchor) {\n selection.removeAllRanges();\n addPointToSelection(selection, node, anchorOffset - nodeStart, selectionState);\n } // If the focus is within this node, we can assume that we have\n // already set the appropriate start range on the selection, and\n // can simply extend the selection.\n\n\n if (hasFocus) {\n addFocusToSelection(selection, node, focusOffset - nodeStart, selectionState);\n }\n } else {\n // If this node has the focus, set the selection range to be a\n // collapsed range beginning here. Later, when we encounter the anchor,\n // we'll use this information to extend the selection.\n if (hasFocus) {\n selection.removeAllRanges();\n addPointToSelection(selection, node, focusOffset - nodeStart, selectionState);\n } // If this node has the anchor, we may assume that the correct\n // focus information is already stored on the selection object.\n // We keep track of it, reset the selection range, and extend it\n // back to the focus point.\n\n\n if (hasAnchor) {\n var storedFocusNode = selection.focusNode;\n var storedFocusOffset = selection.focusOffset;\n selection.removeAllRanges();\n addPointToSelection(selection, node, anchorOffset - nodeStart, selectionState);\n addFocusToSelection(selection, storedFocusNode, storedFocusOffset, selectionState);\n }\n }\n}\n/**\n * Extend selection towards focus point.\n */\n\n\nfunction addFocusToSelection(selection, node, offset, selectionState) {\n var activeElement = getActiveElement();\n var extend = selection.extend; // containsNode returns false if node is null.\n // Let's refine the type of this value out here so flow knows.\n\n if (extend && node != null && containsNode(activeElement, node)) {\n // If `extend` is called while another element has focus, an error is\n // thrown. We therefore disable `extend` if the active element is somewhere\n // other than the node we are selecting. This should only occur in Firefox,\n // since it is the only browser to support multiple selections.\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=921444.\n // logging to catch bug that is being reported in t16250795\n if (offset > getNodeLength(node)) {\n // the call to 'selection.extend' is about to throw\n DraftJsDebugLogging.logSelectionStateFailure({\n anonymizedDom: getAnonymizedEditorDOM(node),\n extraParams: JSON.stringify({\n offset: offset\n }),\n selectionState: JSON.stringify(selectionState.toJS())\n });\n } // logging to catch bug that is being reported in t18110632\n\n\n var nodeWasFocus = node === selection.focusNode;\n\n try {\n // Fixes some reports of \"InvalidStateError: Failed to execute 'extend' on\n // 'Selection': This Selection object doesn't have any Ranges.\"\n // Note: selection.extend does not exist in IE.\n if (selection.rangeCount > 0 && selection.extend) {\n selection.extend(node, offset);\n }\n } catch (e) {\n DraftJsDebugLogging.logSelectionStateFailure({\n anonymizedDom: getAnonymizedEditorDOM(node, function (n) {\n var labels = [];\n\n if (n === activeElement) {\n labels.push('active element');\n }\n\n if (n === selection.anchorNode) {\n labels.push('selection anchor node');\n }\n\n if (n === selection.focusNode) {\n labels.push('selection focus node');\n }\n\n return labels;\n }),\n extraParams: JSON.stringify({\n activeElementName: activeElement ? activeElement.nodeName : null,\n nodeIsFocus: node === selection.focusNode,\n nodeWasFocus: nodeWasFocus,\n selectionRangeCount: selection.rangeCount,\n selectionAnchorNodeName: selection.anchorNode ? selection.anchorNode.nodeName : null,\n selectionAnchorOffset: selection.anchorOffset,\n selectionFocusNodeName: selection.focusNode ? selection.focusNode.nodeName : null,\n selectionFocusOffset: selection.focusOffset,\n message: e ? '' + e : null,\n offset: offset\n }, null, 2),\n selectionState: JSON.stringify(selectionState.toJS(), null, 2)\n }); // allow the error to be thrown -\n // better than continuing in a broken state\n\n throw e;\n }\n } else {\n // IE doesn't support extend. This will mean no backward selection.\n // Extract the existing selection range and add focus to it.\n // Additionally, clone the selection range. IE11 throws an\n // InvalidStateError when attempting to access selection properties\n // after the range is detached.\n if (node && selection.rangeCount > 0) {\n var range = selection.getRangeAt(0);\n range.setEnd(node, offset);\n selection.addRange(range.cloneRange());\n }\n }\n}\n\nfunction addPointToSelection(selection, node, offset, selectionState) {\n var range = getCorrectDocumentFromNode(node).createRange(); // logging to catch bug that is being reported in t16250795\n\n if (offset > getNodeLength(node)) {\n // in this case we know that the call to 'range.setStart' is about to throw\n DraftJsDebugLogging.logSelectionStateFailure({\n anonymizedDom: getAnonymizedEditorDOM(node),\n extraParams: JSON.stringify({\n offset: offset\n }),\n selectionState: JSON.stringify(selectionState.toJS())\n });\n DraftEffects.handleExtensionCausedError();\n }\n\n range.setStart(node, offset); // IE sometimes throws Unspecified Error when trying to addRange\n\n if (isIE) {\n try {\n selection.addRange(range);\n } catch (e) {\n if (process.env.NODE_ENV !== \"production\") {\n /* eslint-disable-next-line no-console */\n console.warn('Call to selection.addRange() threw exception: ', e);\n }\n }\n } else {\n selection.addRange(range);\n }\n}\n\nmodule.exports = {\n setDraftEditorSelection: setDraftEditorSelection,\n addFocusToSelection: addFocusToSelection\n};","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar ContentBlockNode = require(\"./ContentBlockNode\");\n\nvar generateRandomKey = require(\"./generateRandomKey\");\n\nvar Immutable = require(\"immutable\");\n\nvar invariant = require(\"fbjs/lib/invariant\");\n\nvar modifyBlockForContentState = require(\"./modifyBlockForContentState\");\n\nvar List = Immutable.List,\n Map = Immutable.Map;\n\nvar transformBlock = function transformBlock(key, blockMap, func) {\n if (!key) {\n return;\n }\n\n var block = blockMap.get(key);\n\n if (!block) {\n return;\n }\n\n blockMap.set(key, func(block));\n};\n\nvar updateBlockMapLinks = function updateBlockMapLinks(blockMap, originalBlock, belowBlock) {\n return blockMap.withMutations(function (blocks) {\n var originalBlockKey = originalBlock.getKey();\n var belowBlockKey = belowBlock.getKey(); // update block parent\n\n transformBlock(originalBlock.getParentKey(), blocks, function (block) {\n var parentChildrenList = block.getChildKeys();\n var insertionIndex = parentChildrenList.indexOf(originalBlockKey) + 1;\n var newChildrenArray = parentChildrenList.toArray();\n newChildrenArray.splice(insertionIndex, 0, belowBlockKey);\n return block.merge({\n children: List(newChildrenArray)\n });\n }); // update original next block\n\n transformBlock(originalBlock.getNextSiblingKey(), blocks, function (block) {\n return block.merge({\n prevSibling: belowBlockKey\n });\n }); // update original block\n\n transformBlock(originalBlockKey, blocks, function (block) {\n return block.merge({\n nextSibling: belowBlockKey\n });\n }); // update below block\n\n transformBlock(belowBlockKey, blocks, function (block) {\n return block.merge({\n prevSibling: originalBlockKey\n });\n });\n });\n};\n\nvar splitBlockInContentState = function splitBlockInContentState(contentState, selectionState) {\n !selectionState.isCollapsed() ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Selection range must be collapsed.') : invariant(false) : void 0;\n var key = selectionState.getAnchorKey();\n var blockMap = contentState.getBlockMap();\n var blockToSplit = blockMap.get(key);\n var text = blockToSplit.getText();\n\n if (!text) {\n var blockType = blockToSplit.getType();\n\n if (blockType === 'unordered-list-item' || blockType === 'ordered-list-item') {\n return modifyBlockForContentState(contentState, selectionState, function (block) {\n return block.merge({\n type: 'unstyled',\n depth: 0\n });\n });\n }\n }\n\n var offset = selectionState.getAnchorOffset();\n var chars = blockToSplit.getCharacterList();\n var keyBelow = generateRandomKey();\n var isExperimentalTreeBlock = blockToSplit instanceof ContentBlockNode;\n var blockAbove = blockToSplit.merge({\n text: text.slice(0, offset),\n characterList: chars.slice(0, offset)\n });\n var blockBelow = blockAbove.merge({\n key: keyBelow,\n text: text.slice(offset),\n characterList: chars.slice(offset),\n data: Map()\n });\n var blocksBefore = blockMap.toSeq().takeUntil(function (v) {\n return v === blockToSplit;\n });\n var blocksAfter = blockMap.toSeq().skipUntil(function (v) {\n return v === blockToSplit;\n }).rest();\n var newBlocks = blocksBefore.concat([[key, blockAbove], [keyBelow, blockBelow]], blocksAfter).toOrderedMap();\n\n if (isExperimentalTreeBlock) {\n !blockToSplit.getChildKeys().isEmpty() ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'ContentBlockNode must not have children') : invariant(false) : void 0;\n newBlocks = updateBlockMapLinks(newBlocks, blockAbove, blockBelow);\n }\n\n return contentState.merge({\n blockMap: newBlocks,\n selectionBefore: selectionState,\n selectionAfter: selectionState.merge({\n anchorKey: keyBelow,\n anchorOffset: 0,\n focusKey: keyBelow,\n focusOffset: 0,\n isBackward: false\n })\n });\n};\n\nmodule.exports = splitBlockInContentState;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\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 * @format\n * \n * @emails oncall+draft_js\n */\n'use strict';\n\nvar NEWLINE_REGEX = /\\r\\n?|\\n/g;\n\nfunction splitTextIntoTextBlocks(text) {\n return text.split(NEWLINE_REGEX);\n}\n\nmodule.exports = splitTextIntoTextBlocks;","\"use strict\";\n\n/**\n * Copyright 2004-present Facebook. All Rights Reserved.\n *\n * @typechecks\n * \n * @format\n */\n\n/*eslint-disable no-bitwise */\n\n/**\n * Based on the rfc4122-compliant solution posted at\n * http://stackoverflow.com/questions/105034\n */\nfunction uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0;\n var v = c == 'x' ? r : r & 0x3 | 0x8;\n return v.toString(16);\n });\n}\n\nmodule.exports = uuid;"],"names":["module","exports","node","ownerDocument","nodeType","Node","ELEMENT_NODE","value","isElement","require","nodeName","defaultView","HTMLElement","target","editorState","selection","getSelection","anchorKey","getAnchorKey","blockTree","getBlockTree","offset","getStartOffset","isAtStart","some","leafSet","get","leaf","leafStart","Keys","e","which","RETURN","getModifierState","EditorState","expandRangeToStartOfLine","getDraftEditorSelectionWithNodes","moveSelectionBackward","removeTextWithStrategy","afterRemoval","strategyState","isCollapsed","getAnchorOffset","range","currentTarget","getRangeAt","endContainer","endOffset","startContainer","startOffset","selectionState","getCurrentContent","push","DraftRemovableWord","key","getStartKey","text","getBlockForKey","getText","slice","toRemove","getBackward","length","moveSelectionForward","getForward","DraftModifier","contentState","splitBlock","endKey","getEndKey","textLength","getLength","set","merge","anchorOffset","focusKey","focusOffset","isBackward","forceSelection","startKey","UnicodeUtils","content","charBehind","getUTF16Length","charAhead","getContentStateFragment","removalRange","finalSelection","blockKey","movedFragment","removeRange","selectionAfter","getSelectionAfter","targetOffset","targetRange","afterInsert","replaceWithFragment","newEditorState","acceptSelection","updateFn","undoneState","undo","getLastChangeType","preventDefault","getNativelyRenderedContent","nativelyRenderedContent","setTimeout","Map","operation","blockMap","getBlockMap","newBlocks","toSeq","skipUntil","_","k","takeUntil","concat","map","selectionBefore","ContentBlockNode","getNextDelimiterBlockKey","Immutable","invariant","OrderedMap","List","transformBlock","func","block","updateBlockMapLinks","originalBlockToBeMoved","originalTargetBlock","insertionMode","isExperimentalTreeBlock","isInsertedAfterTarget","originalBlockKey","getKey","originalTargetKey","originalParentKey","getParentKey","originalNextSiblingKey","getNextSiblingKey","originalPrevSiblingKey","getPrevSiblingKey","newParentKey","newNextSiblingKey","newPrevSiblingKey","withMutations","blocks","parentChildrenList","getChildKeys","children","indexOf","nextSibling","prevSibling","newParentChildrenList","targetBlockIndex","insertionIndex","newChildrenArray","toArray","splice","parent","blockToBeMoved","targetBlock","targetKey","blocksToBeMoved","blockMapWithoutBlocksToBeMoved","nextSiblingKey","nextDelimiterBlockKey","takeWhile","isBlockToBeMoved","hasNextSiblingAndIsNotNextSibling","doesNotHaveNextSiblingAndIsNotDelimiter","forEach","blocksBefore","v","blocksAfter","skip","slicedBlocks","blockBefore","getBlockBefore","toOrderedMap","blockAfter","getBlockAfter","maxDistance","keyBefore","getKeyBefore","getKeyAfter","generateRandomKey","first","lastRootBlock","newKeysRef","blockMapState","index","oldKey","nextKey","prevKey","childrenKeys","parentKey","setIn","childKey","filter","child","randomizeContentBlockNodeKeys","randomizeContentBlockKeys","CharacterMetadata","findRangesImmutable","removeForBlock","entityMap","chars","getCharacterList","charBefore","undefined","charAfter","count","entityBeforeCursor","getEntity","entityAfterCursor","__get","getMutability","current","_getRemovalRange","characters","entityKey","a","b","element","start","end","getRemovalRange","applyEntity","getEntityMap","updatedBlocks","startBlock","updatedStart","getEndOffset","endBlock","updatedEnd","Object","keys","getAncestorsKeys","parents","blockNode","getNextValidSibling","originalBlockMap","nextValidSiblingKey","getPrevValidSibling","prevValidSiblingKey","nextDelimiters","nextDelimiter","_block","getNextDelimitersBlockKeys","delimiterKey","prevSiblingKey","newParent","find","removeFromList","targetList","shift","pop","head","tail","toList","characterList","parentAncestors","endBlockchildrenKeys","endBlockAncestors","isEmpty","modifiedStart","updatedBlockMap","experimentalTreeDataSupport","gkx","strategy","direction","getFocusKey","anchorBlock","isSelectionAtEndOfContent","anchorBlockSibling","isSelectionAtStartOfContent","REGEX_BLOCK_DELIMITER","RegExp","input","replace","DraftEffects","DraftJsDebugLogging","UserAgent","containsNode","getActiveElement","getCorrectDocumentFromNode","isIE","isBrowser","getAnonymizedDOM","getNodeLabels","anonymized","anonymizeTextWithin","TEXT_NODE","textContent","outerHTML","labels","createTextNode","join","clone","cloneNode","setAttribute","childNodes","ii","appendChild","getAnonymizedEditorDOM","currentNode","castedNode","hasAttribute","parentNode","getNodeLength","nodeValue","addFocusToSelection","activeElement","extend","logSelectionStateFailure","anonymizedDom","extraParams","JSON","stringify","toJS","nodeWasFocus","focusNode","rangeCount","n","anchorNode","activeElementName","nodeIsFocus","selectionRangeCount","selectionAnchorNodeName","selectionAnchorOffset","selectionFocusNodeName","selectionFocusOffset","message","setEnd","addRange","cloneRange","addPointToSelection","createRange","handleExtensionCausedError","setStart","process","setDraftEditorSelection","nodeStart","nodeEnd","documentObject","documentElement","getFocusOffset","getIsBackward","tempKey","tempOffset","hasAnchor","hasFocus","removeAllRanges","storedFocusNode","storedFocusOffset","modifyBlockForContentState","blockToSplit","blockType","getType","type","depth","keyBelow","blockAbove","blockBelow","data","rest","originalBlock","belowBlock","belowBlockKey","NEWLINE_REGEX","split","c","r","Math","random","toString"],"sourceRoot":""}