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B,kBAAmBC,GACnB,aAAcI,KAEhB,GAGF,OAAex2C,EAAK,qBzOpGpB","sources":["webpack://Quill/webpack/universalModuleDefinition","webpack://Quill/./src/blots/block.ts","webpack://Quill/./src/blots/break.ts","webpack://Quill/./src/blots/container.ts","webpack://Quill/./src/blots/cursor.ts","webpack://Quill/./src/blots/embed.ts","webpack://Quill/./src/blots/inline.ts","webpack://Quill/./src/blots/text.ts","webpack://Quill/./src/blots/scroll.ts","webpack://Quill/./src/modules/history.ts","webpack://Quill/./src/modules/uploader.ts","webpack://Quill/./src/modules/input.ts","webpack://Quill/./src/modules/uiNode.ts","webpack://Quill/./src/core.ts","webpack://Quill/./src/core/emitter.ts","webpack://Quill/./src/core/instances.ts","webpack://Quill/./src/core/logger.ts","webpack://Quill/./src/core/module.ts","webpack://Quill/./src/core/editor.ts","webpack://Quill/./src/core/composition.ts","webpack://Quill/./src/core/utils/scrollRectIntoView.ts","webpack://Quill/./src/core/utils/createRegistryWithFormats.ts","webpack://Quill/./src/core/quill.ts","webpack://Quill/./src/core/selection.ts","webpack://Quill/./src/core/theme.ts","webpack://Quill/./src/formats/align.ts","webpack://Quill/./src/formats/background.ts","webpack://Quill/./src/formats/code.ts","webpack://Quill/./src/formats/color.ts","webpack://Quill/./src/formats/direction.ts","webpack://Quill/./src/formats/font.ts","webpack://Quill/./src/formats/size.ts","webpack://Quill/./src/modules/normalizeExternalHTML/normalizers/googleDocs.ts","webpack://Quill/./src/modules/normalizeExternalHTML/normalizers/msWord.ts","webpack://Quill/./src/modules/normalizeExternalHTML/index.ts","webpack://Quill/./src/modules/clipboard.ts","webpack://Quill/./src/modules/keyboard.ts","webpack://Quill/../../node_modules/eventemitter3/index.js","webpack://Quill/../../node_modules/fast-diff/diff.js","webpack://Quill/../../node_modules/lodash.clonedeep/index.js","webpack://Quill/../../node_modules/lodash.isequal/index.js","webpack://Quill/../../node_modules/quill-delta/src/AttributeMap.ts","webpack://Quill/../../node_modules/quill-delta/src/Delta.ts","webpack://Quill/../../node_modules/quill-delta/src/Op.ts","webpack://Quill/../../node_modules/quill-delta/src/OpIterator.ts","webpack://Quill/../../node_modules/lodash-es/_listCacheClear.js","webpack://Quill/../../node_modules/lodash-es/_assocIndexOf.js","webpack://Quill/../../node_modules/lodash-es/_listCacheDelete.js","webpack://Quill/../../node_modules/lodash-es/_ListCache.js","webpack://Quill/../../node_modules/lodash-es/_listCacheGet.js","webpack://Quill/../../node_modules/lodash-es/_listCacheHas.js","webpack://Quill/../../node_modules/lodash-es/_listCacheSet.js","webpack://Quill/../../node_modules/lodash-es/_Map.js","webpack://Quill/../../node_modules/lodash-es/_nativeCreate.js","webpack://Quill/../../node_modules/lodash-es/_hashGet.js","webpack://Quill/../../node_modules/lodash-es/_hashHas.js","webpack://Quill/../../node_modules/lodash-es/_Hash.js","webpack://Quill/../../node_modules/lodash-es/_hashClear.js","webpack://Quill/../../node_modules/lodash-es/_hashDelete.js","webpack://Quill/../../node_modules/lodash-es/_hashSet.js","webpack://Quill/../../node_modules/lodash-es/_getMapData.js","webpack://Quill/../../node_modules/lodash-es/_isKeyable.js","webpack://Quill/../../node_modules/lodash-es/_MapCache.js","webpack://Quill/../../node_modules/lodash-es/_mapCacheClear.js","webpack://Quill/../../node_modules/lodash-es/_mapCacheDelete.js","webpack://Quill/../../node_modules/lodash-es/_mapCacheGet.js","webpack://Quill/../../node_modules/lodash-es/_mapCacheHas.js","webpack://Quill/../../node_modules/lodash-es/_mapCacheSet.js","webpack://Quill/../../node_modules/lodash-es/_Stack.js","webpack://Quill/../../node_modules/lodash-es/_stackClear.js","webpack://Quill/../../node_modules/lodash-es/_stackDelete.js","webpack://Quill/../../node_modules/lodash-es/_stackGet.js","webpack://Quill/../../node_modules/lodash-es/_stackHas.js","webpack://Quill/../../node_modules/lodash-es/_stackSet.js","webpack://Quill/../../node_modules/lodash-es/_Symbol.js","webpack://Quill/../../node_modules/lodash-es/_Uint8Array.js","webpack://Quill/../../node_modules/lodash-es/_baseTimes.js","webpack://Quill/../../node_modules/lodash-es/_arrayLikeKeys.js","webpack://Quill/../../node_modules/lodash-es/_arrayPush.js","webpack://Quill/../../node_modules/lodash-es/_assignValue.js","webpack://Quill/../../node_modules/lodash-es/_baseAssignValue.js","webpack://Quill/../../node_modules/lodash-es/_baseGetAllKeys.js","webpack://Quill/../../node_modules/lodash-es/_getRawTag.js","webpack://Quill/../../node_modules/lodash-es/_objectToString.js","webpack://Quill/../../node_modules/lodash-es/_baseGetTag.js","webpack://Quill/../../node_modules/lodash-es/_baseUnary.js","webpack://Quill/../../node_modules/lodash-es/_cloneArrayBuffer.js","webpack://Quill/../../node_modules/lodash-es/_cloneBuffer.js","webpack://Quill/../../node_modules/lodash-es/_cloneTypedArray.js","webpack://Quill/../../node_modules/lodash-es/_copyArray.js","webpack://Quill/../../node_modules/lodash-es/_copyObject.js","webpack://Quill/../../node_modules/lodash-es/_defineProperty.js","webpack://Quill/../../node_modules/lodash-es/_freeGlobal.js","webpack://Quill/../../node_modules/lodash-es/_getAllKeys.js","webpack://Quill/../../node_modules/lodash-es/_isMasked.js","webpack://Quill/../../node_modules/lodash-es/_coreJsData.js","webpack://Quill/../../node_modules/lodash-es/_baseIsNative.js","webpack://Quill/../../node_modules/lodash-es/_getNative.js","webpack://Quill/../../node_modules/lodash-es/_getValue.js","webpack://Quill/../../node_modules/lodash-es/_getPrototype.js","webpack://Quill/../../node_modules/lodash-es/_arrayFilter.js","webpack://Quill/../../node_modules/lodash-es/_getSymbols.js","webpack://Quill/../../node_modules/lodash-es/_DataView.js","webpack://Quill/../../node_modules/lodash-es/_Promise.js","webpack://Quill/../../node_modules/lodash-es/_Set.js","webpack://Quill/../../node_modules/lodash-es/_WeakMap.js","webpack://Quill/../../node_modules/lodash-es/_getTag.js","webpack://Quill/../../node_modules/lodash-es/_baseCreate.js","webpack://Quill/../../node_modules/lodash-es/_initCloneObject.js","webpack://Quill/../../node_modules/lodash-es/_isIndex.js","webpack://Quill/../../node_modules/lodash-es/_isPrototype.js","webpack://Quill/../../node_modules/lodash-es/_nodeUtil.js","webpack://Quill/../../node_modules/lodash-es/_overArg.js","webpack://Quill/../../node_modules/lodash-es/_root.js","webpack://Quill/../../node_modules/lodash-es/_toSource.js","webpack://Quill/../../node_modules/lodash-es/_getSymbolsIn.js","webpack://Quill/../../node_modules/lodash-es/_getAllKeysIn.js","webpack://Quill/../../node_modules/lodash-es/_initCloneArray.js","webpack://Quill/../../node_modules/lodash-es/_cloneRegExp.js","webpack://Quill/../../node_modules/lodash-es/_cloneSymbol.js","webpack://Quill/../../node_modules/lodash-es/_initCloneByTag.js","webpack://Quill/../../node_modules/lodash-es/_cloneDataView.js","webpack://Quill/../../node_modules/lodash-es/isMap.js","webpack://Quill/../../node_modules/lodash-es/_baseIsMap.js","webpack://Quill/../../node_modules/lodash-es/isSet.js","webpack://Quill/../../node_modules/lodash-es/_baseIsSet.js","webpack://Quill/../../node_modules/lodash-es/_baseClone.js","webpack://Quill/../../node_modules/lodash-es/_copySymbolsIn.js","webpack://Quill/../../node_modules/lodash-es/_baseAssignIn.js","webpack://Quill/../../node_modules/lodash-es/_copySymbols.js","webpack://Quill/../../node_modules/lodash-es/_baseAssign.js","webpack://Quill/../../node_modules/lodash-es/_arrayEach.js","webpack://Quill/../../node_modules/lodash-es/cloneDeep.js","webpack://Quill/../../node_modules/lodash-es/eq.js","webpack://Quill/../../node_modules/lodash-es/_baseIsArguments.js","webpack://Quill/../../node_modules/lodash-es/isArguments.js","webpack://Quill/../../node_modules/lodash-es/isArray.js","webpack://Quill/../../node_modules/lodash-es/isArrayLike.js","webpack://Quill/../../node_modules/lodash-es/isBuffer.js","webpack://Quill/../../node_modules/lodash-es/stubFalse.js","webpack://Quill/../../node_modules/lodash-es/_SetCache.js","webpack://Quill/../../node_modules/lodash-es/_setCacheAdd.js","webpack://Quill/../../node_modules/lodash-es/_setCacheHas.js","webpack://Quill/../../node_modules/lodash-es/_arraySome.js","webpack://Quill/../../node_modules/lodash-es/_equalArrays.js","webpack://Quill/../../node_modules/lodash-es/_cacheHas.js","webpack://Quill/../../node_modules/lodash-es/_mapToArray.js","webpack://Quill/../../node_modules/lodash-es/_setToArray.js","webpack://Quill/../../node_modules/lodash-es/_equalByTag.js","webpack://Quill/../../node_modules/lodash-es/_equalObjects.js","webpack://Quill/../../node_modules/lodash-es/_baseIsEqualDeep.js","webpack://Quill/../../node_modules/lodash-es/_baseIsEqual.js","webpack://Quill/../../node_modules/lodash-es/isEqual.js","webpack://Quill/../../node_modules/lodash-es/isFunction.js","webpack://Quill/../../node_modules/lodash-es/isLength.js","webpack://Quill/../../node_modules/lodash-es/isObject.js","webpack://Quill/../../node_modules/lodash-es/isObjectLike.js","webpack://Quill/../../node_modules/lodash-es/_baseIsTypedArray.js","webpack://Quill/../../node_modules/lodash-es/isTypedArray.js","webpack://Quill/../../node_modules/lodash-es/_nativeKeys.js","webpack://Quill/../../node_modules/lodash-es/_baseKeys.js","webpack://Quill/../../node_modules/lodash-es/keys.js","webpack://Quill/../../node_modules/lodash-es/_baseKeysIn.js","webpack://Quill/../../node_modules/lodash-es/_nativeKeysIn.js","webpack://Quill/../../node_modules/lodash-es/keysIn.js","webpack://Quill/../../node_modules/lodash-es/_shortOut.js","webpack://Quill/../../node_modules/lodash-es/_createAssigner.js","webpack://Quill/../../node_modules/lodash-es/_assignMergeValue.js","webpack://Quill/../../node_modules/lodash-es/_baseFor.js","webpack://Quill/../../node_modules/lodash-es/_createBaseFor.js","webpack://Quill/../../node_modules/lodash-es/isPlainObject.js","webpack://Quill/../../node_modules/lodash-es/_safeGet.js","webpack://Quill/../../node_modules/lodash-es/_baseMergeDeep.js","webpack://Quill/../../node_modules/lodash-es/isArrayLikeObject.js","webpack://Quill/../../node_modules/lodash-es/toPlainObject.js","webpack://Quill/../../node_modules/lodash-es/_baseMerge.js","webpack://Quill/../../node_modules/lodash-es/identity.js","webpack://Quill/../../node_modules/lodash-es/_overRest.js","webpack://Quill/../../node_modules/lodash-es/_baseSetToString.js","webpack://Quill/../../node_modules/lodash-es/constant.js","webpack://Quill/../../node_modules/lodash-es/_setToString.js","webpack://Quill/../../node_modules/lodash-es/_baseRest.js","webpack://Quill/../../node_modules/lodash-es/_apply.js","webpack://Quill/../../node_modules/lodash-es/merge.js","webpack://Quill/../../node_modules/lodash-es/_isIterateeCall.js","webpack://Quill/../../node_modules/lodash-es/stubArray.js","webpack://Quill/../../node_modules/parchment/src/scope.ts","webpack://Quill/../../node_modules/parchment/src/attributor/attributor.ts","webpack://Quill/../../node_modules/parchment/src/error.ts","webpack://Quill/../../node_modules/parchment/src/registry.ts","webpack://Quill/../../node_modules/parchment/src/attributor/class.ts","webpack://Quill/../../node_modules/parchment/src/attributor/style.ts","webpack://Quill/../../node_modules/parchment/src/attributor/store.ts","webpack://Quill/../../node_modules/parchment/src/blot/abstract/shadow.ts","webpack://Quill/../../node_modules/parchment/src/blot/abstract/leaf.ts","webpack://Quill/../../node_modules/parchment/src/collection/linked-list.ts","webpack://Quill/../../node_modules/parchment/src/blot/abstract/parent.ts","webpack://Quill/../../node_modules/parchment/src/blot/inline.ts","webpack://Quill/../../node_modules/parchment/src/blot/block.ts","webpack://Quill/../../node_modules/parchment/src/blot/abstract/container.ts","webpack://Quill/../../node_modules/parchment/src/blot/embed.ts","webpack://Quill/../../node_modules/parchment/src/blot/scroll.ts","webpack://Quill/../../node_modules/parchment/src/blot/text.ts","webpack://Quill/webpack/bootstrap","webpack://Quill/webpack/runtime/compat get default export","webpack://Quill/webpack/runtime/define property getters","webpack://Quill/webpack/runtime/global","webpack://Quill/webpack/runtime/hasOwnProperty shorthand","webpack://Quill/webpack/runtime/make namespace object","webpack://Quill/webpack/runtime/node module decorator","webpack://Quill/./src/formats/indent.ts","webpack://Quill/./src/formats/blockquote.ts","webpack://Quill/./src/formats/header.ts","webpack://Quill/./src/formats/list.ts","webpack://Quill/./src/formats/bold.ts","webpack://Quill/./src/formats/link.ts","webpack://Quill/./src/formats/script.ts","webpack://Quill/./src/formats/underline.ts","webpack://Quill/./src/formats/formula.ts","webpack://Quill/./src/formats/image.ts","webpack://Quill/./src/formats/video.ts","webpack://Quill/./src/modules/syntax.ts","webpack://Quill/./src/formats/table.ts","webpack://Quill/./src/modules/table.ts","webpack://Quill/./src/modules/toolbar.ts","webpack://Quill/./src/ui/icons.ts","webpack://Quill/./src/ui/picker.ts","webpack://Quill/./src/ui/color-picker.ts","webpack://Quill/./src/ui/icon-picker.ts","webpack://Quill/./src/ui/tooltip.ts","webpack://Quill/./src/themes/base.ts","webpack://Quill/./src/themes/bubble.ts","webpack://Quill/./src/themes/snow.ts","webpack://Quill/./src/quill.ts","webpack://Quill/./src/formats/italic.ts","webpack://Quill/./src/formats/strike.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(self, function() {\nreturn ","import {\n AttributorStore,\n BlockBlot,\n EmbedBlot,\n LeafBlot,\n Scope,\n} from 'parchment';\nimport type { Blot, Parent } from 'parchment';\nimport Delta from 'quill-delta';\nimport Break from './break.js';\nimport Inline from './inline.js';\nimport TextBlot from './text.js';\n\nconst NEWLINE_LENGTH = 1;\n\nclass Block extends BlockBlot {\n cache: { delta?: Delta | null; length?: number } = {};\n\n delta(): Delta {\n if (this.cache.delta == null) {\n this.cache.delta = blockDelta(this);\n }\n return this.cache.delta;\n }\n\n deleteAt(index: number, length: number) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (length <= 0) return;\n if (this.scroll.query(name, Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(\n index,\n Math.min(length, this.length() - index - 1),\n name,\n value,\n );\n }\n this.cache = {};\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (def != null) {\n super.insertAt(index, value, def);\n this.cache = {};\n return;\n }\n if (value.length === 0) return;\n const lines = value.split('\\n');\n const text = lines.shift() as string;\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n // TODO: Fix this next time the file is edited.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let block: Blot | this = this;\n lines.reduce((lineIndex, line) => {\n // @ts-expect-error Fix me later\n block = block.split(lineIndex, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot: Blot, ref?: Blot | null) {\n const { head } = this.children;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target: Parent, ref?: Blot | null) {\n // @ts-expect-error Parchment types are wrong\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index: number) {\n return super.path(index, true);\n }\n\n removeChild(child: Blot) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index: number, force: boolean | undefined = false): Blot | null {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n const clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n }\n // @ts-expect-error Fix me later\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n const next = super.split(index, force);\n this.cache = {};\n return next;\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = Break;\nBlock.allowedChildren = [Break, Inline, EmbedBlot, TextBlot];\n\nclass BlockEmbed extends EmbedBlot {\n attributes: AttributorStore;\n domNode: HTMLElement;\n\n attach() {\n super.attach();\n this.attributes = new AttributorStore(this.domNode);\n }\n\n delta() {\n return new Delta().insert(this.value(), {\n ...this.formats(),\n ...this.attributes.values(),\n });\n }\n\n format(name: string, value: unknown) {\n const attribute = this.scroll.query(name, Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n // @ts-expect-error TODO: Scroll#query() should return Attributor when scope is attribute\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n this.format(name, value);\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (def != null) {\n super.insertAt(index, value, def);\n return;\n }\n const lines = value.split('\\n');\n const text = lines.pop();\n const blocks = lines.map((line) => {\n const block = this.scroll.create(Block.blotName);\n block.insertAt(0, line);\n return block;\n });\n const ref = this.split(index);\n blocks.forEach((block) => {\n // @ts-expect-error Fix me later\n this.parent.insertBefore(block, ref);\n });\n if (text) {\n // @ts-expect-error Fix me later\n this.parent.insertBefore(this.scroll.create('text', text), ref);\n }\n }\n}\nBlockEmbed.scope = Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\nfunction blockDelta(blot: BlockBlot, filter = true) {\n return blot\n .descendants(LeafBlot)\n .reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n }\n return delta.insert(leaf.value(), bubbleFormats(leaf, {}, filter));\n }, new Delta())\n .insert('\\n', bubbleFormats(blot));\n}\n\nfunction bubbleFormats(\n blot: Blot | null,\n formats: Record = {},\n filter = true,\n): Record {\n if (blot == null) return formats;\n if ('formats' in blot && typeof blot.formats === 'function') {\n formats = {\n ...formats,\n ...blot.formats(),\n };\n if (filter) {\n // exclude syntax highlighting from deltas and getFormat()\n delete formats['code-token'];\n }\n }\n if (\n blot.parent == null ||\n blot.parent.statics.blotName === 'scroll' ||\n blot.parent.statics.scope !== blot.statics.scope\n ) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats, filter);\n}\n\nexport { blockDelta, bubbleFormats, BlockEmbed, Block as default };\n","import { EmbedBlot } from 'parchment';\n\nclass Break extends EmbedBlot {\n static value() {\n return undefined;\n }\n\n optimize() {\n if (this.prev || this.next) {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\nexport default Break;\n","import { ContainerBlot } from 'parchment';\n\nclass Container extends ContainerBlot {}\n\nexport default Container;\n","import { EmbedBlot, Scope } from 'parchment';\nimport type { Parent, ScrollBlot } from 'parchment';\nimport type Selection from '../core/selection.js';\nimport TextBlot from './text.js';\nimport type { EmbedContextRange } from './embed.js';\n\nclass Cursor extends EmbedBlot {\n static blotName = 'cursor';\n static className = 'ql-cursor';\n static tagName = 'span';\n static CONTENTS = '\\uFEFF'; // Zero width no break space\n\n static value() {\n return undefined;\n }\n\n selection: Selection;\n textNode: Text;\n savedLength: number;\n\n constructor(scroll: ScrollBlot, domNode: HTMLElement, selection: Selection) {\n super(scroll, domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this.savedLength = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name: string, value: unknown) {\n if (this.savedLength !== 0) {\n super.format(name, value);\n return;\n }\n // TODO: Fix this next time the file is edited.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let target: Parent | this = this;\n let index = 0;\n while (target != null && target.statics.scope !== Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this.savedLength = Cursor.CONTENTS.length;\n // @ts-expect-error TODO: allow empty context in Parchment\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this.savedLength = 0;\n }\n }\n\n index(node: Node, offset: number) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this.savedLength;\n }\n\n position(): [Text, number] {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n // @ts-expect-error Fix me later\n this.parent = null;\n }\n\n restore(): EmbedContextRange | null {\n if (this.selection.composing || this.parent == null) return null;\n const range = this.selection.getNativeRange();\n // Browser may push down styles/nodes inside the cursor blot.\n // https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#push-down-values\n while (\n this.domNode.lastChild != null &&\n this.domNode.lastChild !== this.textNode\n ) {\n // @ts-expect-error Fix me later\n this.domNode.parentNode.insertBefore(\n this.domNode.lastChild,\n this.domNode,\n );\n }\n\n const prevTextBlot = this.prev instanceof TextBlot ? this.prev : null;\n const prevTextLength = prevTextBlot ? prevTextBlot.length() : 0;\n const nextTextBlot = this.next instanceof TextBlot ? this.next : null;\n // @ts-expect-error TODO: make TextBlot.text public\n const nextText = nextTextBlot ? nextTextBlot.text : '';\n const { textNode } = this;\n // take text from inside this blot and reset it\n const newText = textNode.data.split(Cursor.CONTENTS).join('');\n textNode.data = Cursor.CONTENTS;\n\n // proactively merge TextBlots around cursor so that optimization\n // doesn't lose the cursor. the reason we are here in cursor.restore\n // could be that the user clicked in prevTextBlot or nextTextBlot, or\n // the user typed something.\n let mergedTextBlot;\n if (prevTextBlot) {\n mergedTextBlot = prevTextBlot;\n if (newText || nextTextBlot) {\n prevTextBlot.insertAt(prevTextBlot.length(), newText + nextText);\n if (nextTextBlot) {\n nextTextBlot.remove();\n }\n }\n } else if (nextTextBlot) {\n mergedTextBlot = nextTextBlot;\n nextTextBlot.insertAt(0, newText);\n } else {\n const newTextNode = document.createTextNode(newText);\n mergedTextBlot = this.scroll.create(newTextNode);\n this.parent.insertBefore(mergedTextBlot, this);\n }\n\n this.remove();\n if (range) {\n // calculate selection to restore\n const remapOffset = (node: Node, offset: number) => {\n if (prevTextBlot && node === prevTextBlot.domNode) {\n return offset;\n }\n if (node === textNode) {\n return prevTextLength + offset - 1;\n }\n if (nextTextBlot && node === nextTextBlot.domNode) {\n return prevTextLength + newText.length + offset;\n }\n return null;\n };\n\n const start = remapOffset(range.start.node, range.start.offset);\n const end = remapOffset(range.end.node, range.end.offset);\n if (start !== null && end !== null) {\n return {\n startNode: mergedTextBlot.domNode,\n startOffset: start,\n endNode: mergedTextBlot.domNode,\n endOffset: end,\n };\n }\n }\n return null;\n }\n\n update(mutations: MutationRecord[], context: Record) {\n if (\n mutations.some((mutation) => {\n return (\n mutation.type === 'characterData' && mutation.target === this.textNode\n );\n })\n ) {\n const range = this.restore();\n if (range) context.range = range;\n }\n }\n\n // Avoid .ql-cursor being a descendant of ``.\n // The reason is Safari pushes down `` on text insertion.\n // That will cause DOM nodes not sync with the model.\n //\n // For example ({I} is the caret), given the markup:\n // \\uFEFF{I}\n // When typing a char \"x\", `` will be pushed down inside the `` first:\n // \\uFEFF{I}\n // And then \"x\" will be inserted after ``:\n // \\uFEFFd{I}\n optimize(context?: unknown) {\n // @ts-expect-error Fix me later\n super.optimize(context);\n\n let { parent } = this;\n while (parent) {\n if (parent.domNode.tagName === 'A') {\n this.savedLength = Cursor.CONTENTS.length;\n // @ts-expect-error TODO: make isolate generic\n parent.isolate(this.offset(parent), this.length()).unwrap();\n this.savedLength = 0;\n break;\n }\n parent = parent.parent;\n }\n }\n\n value() {\n return '';\n }\n}\n\nexport default Cursor;\n","import type { ScrollBlot } from 'parchment';\nimport { EmbedBlot } from 'parchment';\nimport TextBlot from './text.js';\n\nconst GUARD_TEXT = '\\uFEFF';\n\nexport interface EmbedContextRange {\n startNode: Node | Text;\n startOffset: number;\n endNode?: Node | Text;\n endOffset?: number;\n}\n\nclass Embed extends EmbedBlot {\n contentNode: HTMLSpanElement;\n leftGuard: Text;\n rightGuard: Text;\n\n constructor(scroll: ScrollBlot, node: Node) {\n super(scroll, node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', 'false');\n Array.from(this.domNode.childNodes).forEach((childNode) => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n\n index(node: Node, offset: number) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n\n restore(node: Text): EmbedContextRange | null {\n let range: EmbedContextRange | null = null;\n let textNode: Text;\n const text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof TextBlot) {\n const prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof TextBlot) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n // @ts-expect-error Fix me later\n this.parent.insertBefore(this.scroll.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n\n update(mutations: MutationRecord[], context: Record) {\n mutations.forEach((mutation) => {\n if (\n mutation.type === 'characterData' &&\n (mutation.target === this.leftGuard ||\n mutation.target === this.rightGuard)\n ) {\n const range = this.restore(mutation.target as Text);\n if (range) context.range = range;\n }\n });\n }\n}\n\nexport default Embed;\n","import { EmbedBlot, InlineBlot, Scope } from 'parchment';\nimport type { BlotConstructor } from 'parchment';\nimport Break from './break.js';\nimport Text from './text.js';\n\nclass Inline extends InlineBlot {\n static allowedChildren: BlotConstructor[] = [Inline, Break, EmbedBlot, Text];\n // Lower index means deeper in the DOM tree, since not found (-1) is for embeds\n static order = [\n 'cursor',\n 'inline', // Must be lower\n 'link', // Chrome wants to be lower\n 'underline',\n 'strike',\n 'italic',\n 'bold',\n 'script',\n 'code', // Must be higher\n ];\n\n static compare(self: string, other: string) {\n const selfIndex = Inline.order.indexOf(self);\n const otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n }\n if (self === other) {\n return 0;\n }\n if (self < other) {\n return -1;\n }\n return 1;\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (\n Inline.compare(this.statics.blotName, name) < 0 &&\n this.scroll.query(name, Scope.BLOT)\n ) {\n const blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n if (\n this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0\n ) {\n const parent = this.parent.isolate(this.offset(), this.length());\n // @ts-expect-error TODO: make isolate generic\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\n\nexport default Inline;\n","import { TextBlot } from 'parchment';\n\nclass Text extends TextBlot {}\n\nfunction escapeText(text: string) {\n return text.replace(/[&<>\"']/g, (s) => {\n // https://lodash.com/docs#escape\n const entityMap: Record = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n };\n return entityMap[s];\n });\n}\n\nexport { Text as default, escapeText };\n","import { ContainerBlot, LeafBlot, Scope, ScrollBlot } from 'parchment';\nimport type { Blot, Parent, EmbedBlot, ParentBlot, Registry } from 'parchment';\nimport Delta, { AttributeMap, Op } from 'quill-delta';\nimport Emitter from '../core/emitter.js';\nimport type { EmitterSource } from '../core/emitter.js';\nimport Block, { BlockEmbed, bubbleFormats } from './block.js';\nimport Break from './break.js';\nimport Container from './container.js';\n\ntype RenderBlock =\n | {\n type: 'blockEmbed';\n attributes: AttributeMap;\n key: string;\n value: unknown;\n }\n | { type: 'block'; attributes: AttributeMap; delta: Delta };\n\nfunction isLine(blot: unknown): blot is Block | BlockEmbed {\n return blot instanceof Block || blot instanceof BlockEmbed;\n}\n\ninterface UpdatableEmbed {\n updateContent(change: unknown): void;\n}\n\nfunction isUpdatable(blot: Blot): blot is Blot & UpdatableEmbed {\n return typeof (blot as unknown as any).updateContent === 'function';\n}\n\nclass Scroll extends ScrollBlot {\n static blotName = 'scroll';\n static className = 'ql-editor';\n static tagName = 'DIV';\n static defaultChild = Block;\n static allowedChildren = [Block, BlockEmbed, Container];\n\n emitter: Emitter;\n batch: false | MutationRecord[];\n\n constructor(\n registry: Registry,\n domNode: HTMLDivElement,\n { emitter }: { emitter: Emitter },\n ) {\n super(registry, domNode);\n this.emitter = emitter;\n this.batch = false;\n this.optimize();\n this.enable();\n this.domNode.addEventListener('dragstart', (e) => this.handleDragStart(e));\n }\n\n batchStart() {\n if (!Array.isArray(this.batch)) {\n this.batch = [];\n }\n }\n\n batchEnd() {\n if (!this.batch) return;\n const mutations = this.batch;\n this.batch = false;\n this.update(mutations);\n }\n\n emitMount(blot: Blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_MOUNT, blot);\n }\n\n emitUnmount(blot: Blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_UNMOUNT, blot);\n }\n\n emitEmbedUpdate(blot: Blot, change: unknown) {\n this.emitter.emit(Emitter.events.SCROLL_EMBED_UPDATE, blot, change);\n }\n\n deleteAt(index: number, length: number) {\n const [first, offset] = this.line(index);\n const [last] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof BlockEmbed || last instanceof BlockEmbed) {\n this.optimize();\n return;\n }\n const ref =\n last.children.head instanceof Break ? null : last.children.head;\n // @ts-expect-error\n first.moveChildren(last, ref);\n // @ts-expect-error\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled ? 'true' : 'false');\n }\n\n formatAt(index: number, length: number, format: string, value: unknown) {\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (index >= this.length()) {\n if (def == null || this.scroll.query(value, Scope.BLOCK) == null) {\n const blot = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n blot.insertAt(0, value.slice(0, -1), def);\n } else {\n blot.insertAt(0, value, def);\n }\n } else {\n const embed = this.scroll.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot: Blot, ref?: Blot) {\n if (blot.statics.scope === Scope.INLINE_BLOT) {\n const wrapper = this.scroll.create(\n this.statics.defaultChild.blotName,\n ) as Parent;\n wrapper.appendChild(blot);\n super.insertBefore(wrapper, ref);\n } else {\n super.insertBefore(blot, ref);\n }\n }\n\n insertContents(index: number, delta: Delta) {\n const renderBlocks = this.deltaToRenderBlocks(\n delta.concat(new Delta().insert('\\n')),\n );\n const last = renderBlocks.pop();\n if (last == null) return;\n\n this.batchStart();\n\n const first = renderBlocks.shift();\n if (first) {\n const shouldInsertNewlineChar =\n first.type === 'block' &&\n (first.delta.length() === 0 ||\n (!this.descendant(BlockEmbed, index)[0] && index < this.length()));\n const delta =\n first.type === 'block'\n ? first.delta\n : new Delta().insert({ [first.key]: first.value });\n insertInlineContents(this, index, delta);\n const newlineCharLength = first.type === 'block' ? 1 : 0;\n const lineEndIndex = index + delta.length() + newlineCharLength;\n if (shouldInsertNewlineChar) {\n this.insertAt(lineEndIndex - 1, '\\n');\n }\n\n const formats = bubbleFormats(this.line(index)[0]);\n const attributes = AttributeMap.diff(formats, first.attributes) || {};\n Object.keys(attributes).forEach((name) => {\n this.formatAt(lineEndIndex - 1, 1, name, attributes[name]);\n });\n\n index = lineEndIndex;\n }\n\n let [refBlot, refBlotOffset] = this.children.find(index);\n if (renderBlocks.length) {\n if (refBlot) {\n refBlot = refBlot.split(refBlotOffset);\n refBlotOffset = 0;\n }\n\n renderBlocks.forEach((renderBlock) => {\n if (renderBlock.type === 'block') {\n const block = this.createBlock(\n renderBlock.attributes,\n refBlot || undefined,\n );\n insertInlineContents(block, 0, renderBlock.delta);\n } else {\n const blockEmbed = this.create(\n renderBlock.key,\n renderBlock.value,\n ) as EmbedBlot;\n this.insertBefore(blockEmbed, refBlot || undefined);\n Object.keys(renderBlock.attributes).forEach((name) => {\n blockEmbed.format(name, renderBlock.attributes[name]);\n });\n }\n });\n }\n\n if (last.type === 'block' && last.delta.length()) {\n const offset = refBlot\n ? refBlot.offset(refBlot.scroll) + refBlotOffset\n : this.length();\n insertInlineContents(this, offset, last.delta);\n }\n\n this.batchEnd();\n this.optimize();\n }\n\n isEnabled() {\n return this.domNode.getAttribute('contenteditable') === 'true';\n }\n\n leaf(index: number): [LeafBlot | null, number] {\n const last = this.path(index).pop();\n if (!last) {\n return [null, -1];\n }\n\n const [blot, offset] = last;\n return blot instanceof LeafBlot ? [blot, offset] : [null, -1];\n }\n\n line(index: number): [Block | BlockEmbed | null, number] {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n // @ts-expect-error TODO: make descendant() generic\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE): (Block | BlockEmbed)[] {\n const getLines = (\n blot: ParentBlot,\n blotIndex: number,\n blotLength: number,\n ) => {\n let lines: (Block | BlockEmbed)[] = [];\n let lengthLeft = blotLength;\n blot.children.forEachAt(\n blotIndex,\n blotLength,\n (child, childIndex, childLength) => {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof ContainerBlot) {\n lines = lines.concat(getLines(child, childIndex, lengthLeft));\n }\n lengthLeft -= childLength;\n },\n );\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(context?: { [key: string]: any }): void;\n optimize(\n mutations?: MutationRecord[],\n context?: { [key: string]: any },\n ): void;\n optimize(mutations = [], context = {}) {\n if (this.batch) return;\n super.optimize(mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n\n path(index: number) {\n return super.path(index).slice(1); // Exclude self\n }\n\n remove() {\n // Never remove self\n }\n\n update(source?: EmitterSource): void;\n update(mutations?: MutationRecord[]): void;\n update(mutations?: MutationRecord[] | EmitterSource): void {\n if (this.batch) {\n if (Array.isArray(mutations)) {\n this.batch = this.batch.concat(mutations);\n }\n return;\n }\n let source: EmitterSource = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n mutations = mutations.filter(({ target }) => {\n const blot = this.find(target, true);\n return blot && !isUpdatable(blot);\n });\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n\n updateEmbedAt(index: number, key: string, change: unknown) {\n // Currently it only supports top-level embeds (BlockEmbed).\n // We can update `ParentBlot` in parchment to support inline embeds.\n const [blot] = this.descendant((b: Blot) => b instanceof BlockEmbed, index);\n if (blot && blot.statics.blotName === key && isUpdatable(blot)) {\n blot.updateContent(change);\n }\n }\n\n protected handleDragStart(event: DragEvent) {\n event.preventDefault();\n }\n\n private deltaToRenderBlocks(delta: Delta) {\n const renderBlocks: RenderBlock[] = [];\n\n let currentBlockDelta = new Delta();\n delta.forEach((op) => {\n const insert = op?.insert;\n if (!insert) return;\n if (typeof insert === 'string') {\n const splitted = insert.split('\\n');\n splitted.slice(0, -1).forEach((text) => {\n currentBlockDelta.insert(text, op.attributes);\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: op.attributes ?? {},\n });\n currentBlockDelta = new Delta();\n });\n const last = splitted[splitted.length - 1];\n if (last) {\n currentBlockDelta.insert(last, op.attributes);\n }\n } else {\n const key = Object.keys(insert)[0];\n if (!key) return;\n if (this.query(key, Scope.INLINE)) {\n currentBlockDelta.push(op);\n } else {\n if (currentBlockDelta.length()) {\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: {},\n });\n }\n currentBlockDelta = new Delta();\n renderBlocks.push({\n type: 'blockEmbed',\n key,\n value: insert[key],\n attributes: op.attributes ?? {},\n });\n }\n }\n });\n\n if (currentBlockDelta.length()) {\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: {},\n });\n }\n\n return renderBlocks;\n }\n\n private createBlock(attributes: AttributeMap, refBlot?: Blot) {\n let blotName: string | undefined;\n const formats: AttributeMap = {};\n\n Object.entries(attributes).forEach(([key, value]) => {\n const isBlockBlot = this.query(key, Scope.BLOCK & Scope.BLOT) != null;\n if (isBlockBlot) {\n blotName = key;\n } else {\n formats[key] = value;\n }\n });\n\n const block = this.create(\n blotName || this.statics.defaultChild.blotName,\n blotName ? attributes[blotName] : undefined,\n ) as ParentBlot;\n\n this.insertBefore(block, refBlot || undefined);\n\n const length = block.length();\n Object.entries(formats).forEach(([key, value]) => {\n block.formatAt(0, length, key, value);\n });\n\n return block;\n }\n}\n\nfunction insertInlineContents(\n parent: ParentBlot,\n index: number,\n inlineContents: Delta,\n) {\n inlineContents.reduce((index, op) => {\n const length = Op.length(op);\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n const text = op.insert;\n parent.insertAt(index, text);\n const [leaf] = parent.descendant(LeafBlot, index);\n const formats = bubbleFormats(leaf);\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n parent.insertAt(index, key, op.insert[key]);\n const isInlineEmbed = parent.scroll.query(key, Scope.INLINE) != null;\n if (isInlineEmbed) {\n const [leaf] = parent.descendant(LeafBlot, index);\n const formats = bubbleFormats(leaf);\n attributes = AttributeMap.diff(formats, attributes) || {};\n }\n }\n }\n Object.keys(attributes).forEach((key) => {\n parent.formatAt(index, length, key, attributes[key]);\n });\n return index + length;\n }, index);\n}\n\nexport default Scroll;\n","import { Scope } from 'parchment';\nimport type Delta from 'quill-delta';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type Scroll from '../blots/scroll.js';\nimport type { Range } from '../core/selection.js';\n\nexport interface HistoryOptions {\n userOnly: boolean;\n delay: number;\n maxStack: number;\n}\n\nexport interface StackItem {\n delta: Delta;\n range: Range | null;\n}\n\ninterface Stack {\n undo: StackItem[];\n redo: StackItem[];\n}\n\nclass History extends Module {\n static DEFAULTS: HistoryOptions;\n\n lastRecorded = 0;\n ignoreChange = false;\n stack: Stack = { undo: [], redo: [] };\n currentRange: Range | null = null;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.quill.on(\n Quill.events.EDITOR_CHANGE,\n (eventName, value, oldValue, source) => {\n if (eventName === Quill.events.SELECTION_CHANGE) {\n if (value && source !== Quill.sources.SILENT) {\n this.currentRange = value;\n }\n } else if (eventName === Quill.events.TEXT_CHANGE) {\n if (!this.ignoreChange) {\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(value, oldValue);\n } else {\n this.transform(value);\n }\n }\n\n this.currentRange = transformRange(this.currentRange, value);\n }\n },\n );\n\n this.quill.keyboard.addBinding(\n { key: 'z', shortKey: true },\n this.undo.bind(this),\n );\n this.quill.keyboard.addBinding(\n { key: ['z', 'Z'], shortKey: true, shiftKey: true },\n this.redo.bind(this),\n );\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding(\n { key: 'y', shortKey: true },\n this.redo.bind(this),\n );\n }\n\n this.quill.root.addEventListener('beforeinput', (event) => {\n if (event.inputType === 'historyUndo') {\n this.undo();\n event.preventDefault();\n } else if (event.inputType === 'historyRedo') {\n this.redo();\n event.preventDefault();\n }\n });\n }\n\n change(source: 'undo' | 'redo', dest: 'redo' | 'undo') {\n if (this.stack[source].length === 0) return;\n const item = this.stack[source].pop();\n if (!item) return;\n const base = this.quill.getContents();\n const inverseDelta = item.delta.invert(base);\n this.stack[dest].push({\n delta: inverseDelta,\n range: transformRange(item.range, inverseDelta),\n });\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(item.delta, Quill.sources.USER);\n this.ignoreChange = false;\n\n this.restoreSelection(item);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n cutoff() {\n this.lastRecorded = 0;\n }\n\n record(changeDelta: Delta, oldDelta: Delta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = changeDelta.invert(oldDelta);\n let undoRange = this.currentRange;\n const timestamp = Date.now();\n if (\n // @ts-expect-error Fix me later\n this.lastRecorded + this.options.delay > timestamp &&\n this.stack.undo.length > 0\n ) {\n const item = this.stack.undo.pop();\n if (item) {\n undoDelta = undoDelta.compose(item.delta);\n undoRange = item.range;\n }\n } else {\n this.lastRecorded = timestamp;\n }\n if (undoDelta.length() === 0) return;\n this.stack.undo.push({ delta: undoDelta, range: undoRange });\n // @ts-expect-error Fix me later\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta: Delta) {\n transformStack(this.stack.undo, delta);\n transformStack(this.stack.redo, delta);\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n\n protected restoreSelection(stackItem: StackItem) {\n if (stackItem.range) {\n this.quill.setSelection(stackItem.range, Quill.sources.USER);\n } else {\n const index = getLastChangeIndex(this.quill.scroll, stackItem.delta);\n this.quill.setSelection(index, Quill.sources.USER);\n }\n }\n}\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false,\n};\n\nfunction transformStack(stack: StackItem[], delta: Delta) {\n let remoteDelta = delta;\n for (let i = stack.length - 1; i >= 0; i -= 1) {\n const oldItem = stack[i];\n stack[i] = {\n delta: remoteDelta.transform(oldItem.delta, true),\n range: oldItem.range && transformRange(oldItem.range, remoteDelta),\n };\n remoteDelta = oldItem.delta.transform(remoteDelta);\n if (stack[i].delta.length() === 0) {\n stack.splice(i, 1);\n }\n }\n}\n\nfunction endsWithNewlineChange(scroll: Scroll, delta: Delta) {\n const lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some((attr) => {\n return scroll.query(attr, Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(scroll: Scroll, delta: Delta) {\n const deleteLength = delta.reduce((length, op) => {\n return length + (op.delete || 0);\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(scroll, delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\nfunction transformRange(range: Range | null, delta: Delta) {\n if (!range) return range;\n const start = delta.transformPosition(range.index);\n const end = delta.transformPosition(range.index + range.length);\n return { index: start, length: end - start };\n}\n\nexport { History as default, getLastChangeIndex };\n","import Delta from 'quill-delta';\nimport type Quill from '../core/quill.js';\nimport Emitter from '../core/emitter.js';\nimport Module from '../core/module.js';\nimport type { Range } from '../core/selection.js';\n\ninterface UploaderOptions {\n mimetypes: string[];\n handler: (this: { quill: Quill }, range: Range, files: File[]) => void;\n}\n\nclass Uploader extends Module {\n static DEFAULTS: UploaderOptions;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n quill.root.addEventListener('drop', (e) => {\n e.preventDefault();\n let native: ReturnType | null = null;\n if (document.caretRangeFromPoint) {\n native = document.caretRangeFromPoint(e.clientX, e.clientY);\n // @ts-expect-error\n } else if (document.caretPositionFromPoint) {\n // @ts-expect-error\n const position = document.caretPositionFromPoint(e.clientX, e.clientY);\n native = document.createRange();\n native.setStart(position.offsetNode, position.offset);\n native.setEnd(position.offsetNode, position.offset);\n }\n\n const normalized = native && quill.selection.normalizeNative(native);\n if (normalized) {\n const range = quill.selection.normalizedToRange(normalized);\n if (e.dataTransfer?.files) {\n this.upload(range, e.dataTransfer.files);\n }\n }\n });\n }\n\n upload(range: Range, files: FileList | File[]) {\n const uploads: File[] = [];\n Array.from(files).forEach((file) => {\n if (file && this.options.mimetypes?.includes(file.type)) {\n uploads.push(file);\n }\n });\n if (uploads.length > 0) {\n // @ts-expect-error Fix me later\n this.options.handler.call(this, range, uploads);\n }\n }\n}\n\nUploader.DEFAULTS = {\n mimetypes: ['image/png', 'image/jpeg'],\n handler(range: Range, files: File[]) {\n const promises = files.map((file) => {\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.onload = (e) => {\n // @ts-expect-error Fix me later\n resolve(e.target.result);\n };\n reader.readAsDataURL(file);\n });\n });\n Promise.all(promises).then((images) => {\n const update = images.reduce((delta: Delta, image) => {\n return delta.insert({ image });\n }, new Delta().retain(range.index).delete(range.length)) as Delta;\n this.quill.updateContents(update, Emitter.sources.USER);\n this.quill.setSelection(\n range.index + images.length,\n Emitter.sources.SILENT,\n );\n });\n },\n};\n\nexport default Uploader;\n","import Delta from 'quill-delta';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type { Range } from '../core/selection.js';\nimport { deleteRange } from './keyboard.js';\n\nconst INSERT_TYPES = ['insertText', 'insertReplacementText'];\n\nclass Input extends Module {\n constructor(quill: Quill, options: Record) {\n super(quill, options);\n\n quill.root.addEventListener('beforeinput', (event) => {\n this.handleBeforeInput(event);\n });\n\n // Gboard with English input on Android triggers `compositionstart` sometimes even\n // users are not going to type anything.\n if (!/Android/i.test(navigator.userAgent)) {\n quill.on(Quill.events.COMPOSITION_BEFORE_START, () => {\n this.handleCompositionStart();\n });\n }\n }\n\n private deleteRange(range: Range) {\n deleteRange({ range, quill: this.quill });\n }\n\n private replaceText(range: Range, text = '') {\n if (range.length === 0) return false;\n\n if (text) {\n // Follow the native behavior that inherits the formats of the first character\n const formats = this.quill.getFormat(range.index, 1);\n this.deleteRange(range);\n this.quill.updateContents(\n new Delta().retain(range.index).insert(text, formats),\n Quill.sources.USER,\n );\n } else {\n this.deleteRange(range);\n }\n\n this.quill.setSelection(range.index + text.length, 0, Quill.sources.SILENT);\n return true;\n }\n\n private handleBeforeInput(event: InputEvent) {\n if (\n this.quill.composition.isComposing ||\n event.defaultPrevented ||\n !INSERT_TYPES.includes(event.inputType)\n ) {\n return;\n }\n\n const staticRange = event.getTargetRanges\n ? event.getTargetRanges()[0]\n : null;\n if (!staticRange || staticRange.collapsed === true) {\n return;\n }\n\n const text = getPlainTextFromInputEvent(event);\n if (text == null) {\n return;\n }\n const normalized = this.quill.selection.normalizeNative(staticRange);\n const range = normalized\n ? this.quill.selection.normalizedToRange(normalized)\n : null;\n if (range && this.replaceText(range, text)) {\n event.preventDefault();\n }\n }\n\n private handleCompositionStart() {\n const range = this.quill.getSelection();\n if (range) {\n this.replaceText(range);\n }\n }\n}\n\nfunction getPlainTextFromInputEvent(event: InputEvent) {\n // When `inputType` is \"insertText\":\n // - `event.data` should be string (Safari uses `event.dataTransfer`).\n // - `event.dataTransfer` should be null.\n // When `inputType` is \"insertReplacementText\":\n // - `event.data` should be null.\n // - `event.dataTransfer` should contain \"text/plain\" data.\n\n if (typeof event.data === 'string') {\n return event.data;\n }\n if (event.dataTransfer?.types.includes('text/plain')) {\n return event.dataTransfer.getData('text/plain');\n }\n return null;\n}\n\nexport default Input;\n","import { ParentBlot } from 'parchment';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\n\nconst isMac = /Mac/i.test(navigator.platform);\n\n// Export for testing\nexport const TTL_FOR_VALID_SELECTION_CHANGE = 100;\n\n// A loose check to determine if the shortcut can move the caret before a UI node:\n// [CARET]
[CONTENT]
\nconst canMoveCaretBeforeUINode = (event: KeyboardEvent) => {\n if (\n event.key === 'ArrowLeft' ||\n event.key === 'ArrowRight' || // RTL scripts or moving from the end of the previous line\n event.key === 'ArrowUp' ||\n event.key === 'ArrowDown' ||\n event.key === 'Home'\n ) {\n return true;\n }\n\n if (isMac && event.key === 'a' && event.ctrlKey === true) {\n return true;\n }\n\n return false;\n};\n\nclass UINode extends Module {\n isListening = false;\n selectionChangeDeadline = 0;\n\n constructor(quill: Quill, options: Record) {\n super(quill, options);\n\n this.handleArrowKeys();\n this.handleNavigationShortcuts();\n }\n\n private handleArrowKeys() {\n this.quill.keyboard.addBinding({\n key: ['ArrowLeft', 'ArrowRight'],\n offset: 0,\n shiftKey: null,\n handler(range, { line, event }) {\n if (!(line instanceof ParentBlot) || !line.uiNode) {\n return true;\n }\n\n const isRTL = getComputedStyle(line.domNode)['direction'] === 'rtl';\n if (\n (isRTL && event.key !== 'ArrowRight') ||\n (!isRTL && event.key !== 'ArrowLeft')\n ) {\n return true;\n }\n\n this.quill.setSelection(\n range.index - 1,\n range.length + (event.shiftKey ? 1 : 0),\n Quill.sources.USER,\n );\n return false;\n },\n });\n }\n\n private handleNavigationShortcuts() {\n this.quill.root.addEventListener('keydown', (event) => {\n if (!event.defaultPrevented && canMoveCaretBeforeUINode(event)) {\n this.ensureListeningToSelectionChange();\n }\n });\n }\n\n /**\n * We only listen to the `selectionchange` event when\n * there is an intention of moving the caret to the beginning using shortcuts.\n * This is primarily implemented to prevent infinite loops, as we are changing\n * the selection within the handler of a `selectionchange` event.\n */\n private ensureListeningToSelectionChange() {\n this.selectionChangeDeadline = Date.now() + TTL_FOR_VALID_SELECTION_CHANGE;\n\n if (this.isListening) return;\n this.isListening = true;\n\n const listener = () => {\n this.isListening = false;\n\n if (Date.now() <= this.selectionChangeDeadline) {\n this.handleSelectionChange();\n }\n };\n\n document.addEventListener('selectionchange', listener, {\n once: true,\n });\n }\n\n private handleSelectionChange() {\n const selection = document.getSelection();\n if (!selection) return;\n const range = selection.getRangeAt(0);\n if (range.collapsed !== true || range.startOffset !== 0) return;\n\n const line = this.quill.scroll.find(range.startContainer);\n if (!(line instanceof ParentBlot) || !line.uiNode) return;\n\n const newRange = document.createRange();\n newRange.setStartAfter(line.uiNode);\n newRange.setEndAfter(line.uiNode);\n selection.removeAllRanges();\n selection.addRange(newRange);\n }\n}\n\nexport default UINode;\n","import Quill from './core/quill.js';\n\nimport Block, { BlockEmbed } from './blots/block.js';\nimport Break from './blots/break.js';\nimport Container from './blots/container.js';\nimport Cursor from './blots/cursor.js';\nimport Embed from './blots/embed.js';\nimport Inline from './blots/inline.js';\nimport Scroll from './blots/scroll.js';\nimport TextBlot from './blots/text.js';\n\nimport Clipboard from './modules/clipboard.js';\nimport History from './modules/history.js';\nimport Keyboard from './modules/keyboard.js';\nimport Uploader from './modules/uploader.js';\nimport Delta, { Op, OpIterator, AttributeMap } from 'quill-delta';\nimport Input from './modules/input.js';\nimport UINode from './modules/uiNode.js';\n\nexport { Delta, Op, OpIterator, AttributeMap };\n\nQuill.register({\n 'blots/block': Block,\n 'blots/block/embed': BlockEmbed,\n 'blots/break': Break,\n 'blots/container': Container,\n 'blots/cursor': Cursor,\n 'blots/embed': Embed,\n 'blots/inline': Inline,\n 'blots/scroll': Scroll,\n 'blots/text': TextBlot,\n\n 'modules/clipboard': Clipboard,\n 'modules/history': History,\n 'modules/keyboard': Keyboard,\n 'modules/uploader': Uploader,\n 'modules/input': Input,\n 'modules/uiNode': UINode,\n});\n\nexport default Quill;\n","import { EventEmitter } from 'eventemitter3';\nimport instances from './instances.js';\nimport logger from './logger.js';\n\nconst debug = logger('quill:events');\nconst EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach((eventName) => {\n document.addEventListener(eventName, (...args) => {\n Array.from(document.querySelectorAll('.ql-container')).forEach((node) => {\n const quill = instances.get(node);\n if (quill && quill.emitter) {\n quill.emitter.handleDOM(...args);\n }\n });\n });\n});\n\nclass Emitter extends EventEmitter {\n static events = {\n EDITOR_CHANGE: 'editor-change',\n SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n SCROLL_BLOT_MOUNT: 'scroll-blot-mount',\n SCROLL_BLOT_UNMOUNT: 'scroll-blot-unmount',\n SCROLL_OPTIMIZE: 'scroll-optimize',\n SCROLL_UPDATE: 'scroll-update',\n SCROLL_EMBED_UPDATE: 'scroll-embed-update',\n SELECTION_CHANGE: 'selection-change',\n TEXT_CHANGE: 'text-change',\n COMPOSITION_BEFORE_START: 'composition-before-start',\n COMPOSITION_START: 'composition-start',\n COMPOSITION_BEFORE_END: 'composition-before-end',\n COMPOSITION_END: 'composition-end',\n } as const;\n\n static sources = {\n API: 'api',\n SILENT: 'silent',\n USER: 'user',\n } as const;\n\n protected domListeners: Record;\n\n constructor() {\n super();\n this.domListeners = {};\n this.on('error', debug.error);\n }\n\n emit(...args: unknown[]): boolean {\n debug.log.call(debug, ...args);\n // @ts-expect-error\n return super.emit(...args);\n }\n\n handleDOM(event: Event, ...args: unknown[]) {\n (this.domListeners[event.type] || []).forEach(({ node, handler }) => {\n if (event.target === node || node.contains(event.target as Node)) {\n handler(event, ...args);\n }\n });\n }\n\n listenDOM(eventName: string, node: Node, handler: EventListener) {\n if (!this.domListeners[eventName]) {\n this.domListeners[eventName] = [];\n }\n this.domListeners[eventName].push({ node, handler });\n }\n}\n\nexport type EmitterSource =\n (typeof Emitter.sources)[keyof typeof Emitter.sources];\n\nexport default Emitter;\n","import type Quill from '../core.js';\n\nexport default new WeakMap();\n","const levels = ['error', 'warn', 'log', 'info'] as const;\nexport type DebugLevel = (typeof levels)[number];\nlet level: DebugLevel | false = 'warn';\n\nfunction debug(method: DebugLevel, ...args: unknown[]) {\n if (level) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method](...args); // eslint-disable-line no-console\n }\n }\n}\n\nfunction namespace(\n ns: string,\n): Record void> {\n return levels.reduce(\n (logger, method) => {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n },\n {} as Record void>,\n );\n}\n\nnamespace.level = (newLevel: DebugLevel | false) => {\n level = newLevel;\n};\ndebug.level = namespace.level;\n\nexport default namespace;\n","import type Quill from './quill.js';\n\nabstract class Module {\n static DEFAULTS = {};\n\n constructor(\n protected quill: Quill,\n protected options: Partial = {},\n ) {}\n}\n\nexport default Module;\n","import { cloneDeep, isEqual, merge } from 'lodash-es';\nimport { LeafBlot, EmbedBlot, Scope, ParentBlot } from 'parchment';\nimport type { Blot } from 'parchment';\nimport Delta, { AttributeMap, Op } from 'quill-delta';\nimport Block, { BlockEmbed, bubbleFormats } from '../blots/block.js';\nimport Break from '../blots/break.js';\nimport CursorBlot from '../blots/cursor.js';\nimport type Scroll from '../blots/scroll.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport { Range } from './selection.js';\n\nconst ASCII = /^[ -~]*$/;\n\ntype SelectionInfo = {\n newRange: Range;\n oldRange: Range;\n};\n\nclass Editor {\n scroll: Scroll;\n delta: Delta;\n\n constructor(scroll: Scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta: Delta): Delta {\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n const normalizedDelta = normalizeDelta(delta);\n const deleteDelta = new Delta();\n const normalizedOps = splitOpLines(normalizedDelta.ops.slice());\n normalizedOps.reduce((index, op) => {\n const length = Op.length(op);\n let attributes = op.attributes || {};\n let isImplicitNewlinePrepended = false;\n let isImplicitNewlineAppended = false;\n if (op.insert != null) {\n deleteDelta.retain(length);\n if (typeof op.insert === 'string') {\n const text = op.insert;\n isImplicitNewlineAppended =\n !text.endsWith('\\n') &&\n (scrollLength <= index ||\n !!this.scroll.descendant(BlockEmbed, index)[0]);\n this.scroll.insertAt(index, text);\n const [line, offset] = this.scroll.line(index);\n let formats = merge({}, bubbleFormats(line));\n if (line instanceof Block) {\n const [leaf] = line.descendant(LeafBlot, offset);\n if (leaf) {\n formats = merge(formats, bubbleFormats(leaf));\n }\n }\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n const isInlineEmbed = this.scroll.query(key, Scope.INLINE) != null;\n if (isInlineEmbed) {\n if (\n scrollLength <= index ||\n !!this.scroll.descendant(BlockEmbed, index)[0]\n ) {\n isImplicitNewlineAppended = true;\n }\n } else if (index > 0) {\n const [leaf, offset] = this.scroll.descendant(LeafBlot, index - 1);\n if (leaf instanceof TextBlot) {\n const text = leaf.value();\n if (text[offset] !== '\\n') {\n isImplicitNewlinePrepended = true;\n }\n } else if (\n leaf instanceof EmbedBlot &&\n leaf.statics.scope === Scope.INLINE_BLOT\n ) {\n isImplicitNewlinePrepended = true;\n }\n }\n this.scroll.insertAt(index, key, op.insert[key]);\n\n if (isInlineEmbed) {\n const [leaf] = this.scroll.descendant(LeafBlot, index);\n if (leaf) {\n const formats = merge({}, bubbleFormats(leaf));\n attributes = AttributeMap.diff(formats, attributes) || {};\n }\n }\n }\n scrollLength += length;\n } else {\n deleteDelta.push(op);\n\n if (op.retain !== null && typeof op.retain === 'object') {\n const key = Object.keys(op.retain)[0];\n if (key == null) return index;\n this.scroll.updateEmbedAt(index, key, op.retain[key]);\n }\n }\n Object.keys(attributes).forEach((name) => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n const prependedLength = isImplicitNewlinePrepended ? 1 : 0;\n const addedLength = isImplicitNewlineAppended ? 1 : 0;\n scrollLength += prependedLength + addedLength;\n deleteDelta.retain(prependedLength);\n deleteDelta.delete(addedLength);\n return index + length + prependedLength + addedLength;\n }, 0);\n deleteDelta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + Op.length(op);\n }, 0);\n this.scroll.batchEnd();\n this.scroll.optimize();\n return this.update(normalizedDelta);\n }\n\n deleteText(index: number, length: number): Delta {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(\n index: number,\n length: number,\n formats: Record = {},\n ): Delta {\n this.scroll.update();\n Object.keys(formats).forEach((format) => {\n this.scroll.lines(index, Math.max(length, 1)).forEach((line) => {\n line.format(format, formats[format]);\n });\n });\n this.scroll.optimize();\n const delta = new Delta().retain(index).retain(length, cloneDeep(formats));\n return this.update(delta);\n }\n\n formatText(\n index: number,\n length: number,\n formats: Record = {},\n ): Delta {\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n const delta = new Delta().retain(index).retain(length, cloneDeep(formats));\n return this.update(delta);\n }\n\n getContents(index: number, length: number): Delta {\n return this.delta.slice(index, index + length);\n }\n\n getDelta(): Delta {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index: number, length = 0): Record {\n let lines: (Block | BlockEmbed)[] = [];\n let leaves: LeafBlot[] = [];\n if (length === 0) {\n this.scroll.path(index).forEach((path) => {\n const [blot] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof LeafBlot) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(LeafBlot, index, length);\n }\n const [lineFormats, leafFormats] = [lines, leaves].map((blots) => {\n const blot = blots.shift();\n if (blot == null) return {};\n let formats = bubbleFormats(blot);\n while (Object.keys(formats).length > 0) {\n const blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return { ...lineFormats, ...leafFormats };\n }\n\n getHTML(index: number, length: number): string {\n const [line, lineOffset] = this.scroll.line(index);\n if (line) {\n const lineLength = line.length();\n const isWithinLine = line.length() >= lineOffset + length;\n if (isWithinLine && !(lineOffset === 0 && length === lineLength)) {\n return convertHTML(line, lineOffset, length, true);\n }\n return convertHTML(this.scroll, index, length, true);\n }\n return '';\n }\n\n getText(index: number, length: number): string {\n return this.getContents(index, length)\n .filter((op) => typeof op.insert === 'string')\n .map((op) => op.insert)\n .join('');\n }\n\n insertContents(index: number, contents: Delta): Delta {\n const normalizedDelta = normalizeDelta(contents);\n const change = new Delta().retain(index).concat(normalizedDelta);\n this.scroll.insertContents(index, normalizedDelta);\n return this.update(change);\n }\n\n insertEmbed(index: number, embed: string, value: unknown): Delta {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(\n index: number,\n text: string,\n formats: Record = {},\n ): Delta {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(\n new Delta().retain(index).insert(text, cloneDeep(formats)),\n );\n }\n\n isBlank(): boolean {\n if (this.scroll.children.length === 0) return true;\n if (this.scroll.children.length > 1) return false;\n const blot = this.scroll.children.head;\n if (blot?.statics.blotName !== Block.blotName) return false;\n const block = blot as Block;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n removeFormat(index: number, length: number): Delta {\n const text = this.getText(index, length);\n const [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0;\n let suffix = new Delta();\n if (line != null) {\n suffixLength = line.length() - offset;\n suffix = line\n .delta()\n .slice(offset, offset + suffixLength - 1)\n .insert('\\n');\n }\n const contents = this.getContents(index, length + suffixLength);\n const diff = contents.diff(new Delta().insert(text).concat(suffix));\n const delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(\n change: Delta | null,\n mutations: MutationRecord[] = [],\n selectionInfo: SelectionInfo | undefined = undefined,\n ): Delta {\n const oldDelta = this.delta;\n if (\n mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n // @ts-expect-error Fix me later\n mutations[0].target.data.match(ASCII) &&\n this.scroll.find(mutations[0].target)\n ) {\n // Optimization for character changes\n const textBlot = this.scroll.find(mutations[0].target) as Blot;\n const formats = bubbleFormats(textBlot);\n const index = textBlot.offset(this.scroll);\n // @ts-expect-error Fix me later\n const oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n const oldText = new Delta().insert(oldValue);\n // @ts-expect-error\n const newText = new Delta().insert(textBlot.value());\n const relativeSelectionInfo = selectionInfo && {\n oldRange: shiftRange(selectionInfo.oldRange, -index),\n newRange: shiftRange(selectionInfo.newRange, -index),\n };\n const diffDelta = new Delta()\n .retain(index)\n .concat(oldText.diff(newText, relativeSelectionInfo));\n change = diffDelta.reduce((delta, op) => {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n }\n return delta.push(op);\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !isEqual(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, selectionInfo);\n }\n }\n return change;\n }\n}\n\ninterface ListItem {\n child: Blot;\n offset: number;\n length: number;\n indent: number;\n type: string;\n}\nfunction convertListHTML(\n items: ListItem[],\n lastIndent: number,\n types: string[],\n): string {\n if (items.length === 0) {\n const [endTag] = getListType(types.pop());\n if (lastIndent <= 0) {\n return ``;\n }\n return `${convertListHTML([], lastIndent - 1, types)}`;\n }\n const [{ child, offset, length, indent, type }, ...rest] = items;\n const [tag, attribute] = getListType(type);\n if (indent > lastIndent) {\n types.push(type);\n if (indent === lastIndent + 1) {\n return `<${tag}>${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n return `<${tag}>
  • ${convertListHTML(items, lastIndent + 1, types)}`;\n }\n const previousType = types[types.length - 1];\n if (indent === lastIndent && type === previousType) {\n return `
  • ${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n const [endTag] = getListType(types.pop());\n return `${convertListHTML(items, lastIndent - 1, types)}`;\n}\n\nfunction convertHTML(\n blot: Blot,\n index: number,\n length: number,\n isRoot = false,\n): string {\n if ('html' in blot && typeof blot.html === 'function') {\n return blot.html(index, length);\n }\n if (blot instanceof TextBlot) {\n return escapeText(blot.value().slice(index, index + length));\n }\n if (blot instanceof ParentBlot) {\n // TODO fix API\n if (blot.statics.blotName === 'list-container') {\n const items: any[] = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n const formats =\n 'formats' in child && typeof child.formats === 'function'\n ? child.formats()\n : {};\n items.push({\n child,\n offset,\n length: childLength,\n indent: formats.indent || 0,\n type: formats.list,\n });\n });\n return convertListHTML(items, -1, []);\n }\n const parts: string[] = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n parts.push(convertHTML(child, offset, childLength));\n });\n if (isRoot || blot.statics.blotName === 'list') {\n return parts.join('');\n }\n const { outerHTML, innerHTML } = blot.domNode as Element;\n const [start, end] = outerHTML.split(`>${innerHTML}<`);\n // TODO cleanup\n if (start === '${parts.join('')}<${end}`;\n }\n return `${start}>${parts.join('')}<${end}`;\n }\n return blot.domNode instanceof Element ? blot.domNode.outerHTML : '';\n}\n\nfunction combineFormats(\n formats: Record,\n combined: Record,\n): Record {\n return Object.keys(combined).reduce(\n (merged, name) => {\n if (formats[name] == null) return merged;\n const combinedValue = combined[name];\n if (combinedValue === formats[name]) {\n merged[name] = combinedValue;\n } else if (Array.isArray(combinedValue)) {\n if (combinedValue.indexOf(formats[name]) < 0) {\n merged[name] = combinedValue.concat([formats[name]]);\n } else {\n // If style already exists, don't add to an array, but don't lose other styles\n merged[name] = combinedValue;\n }\n } else {\n merged[name] = [combinedValue, formats[name]];\n }\n return merged;\n },\n {} as Record,\n );\n}\n\nfunction getListType(type: string | undefined) {\n const tag = type === 'ordered' ? 'ol' : 'ul';\n switch (type) {\n case 'checked':\n return [tag, ' data-list=\"checked\"'];\n case 'unchecked':\n return [tag, ' data-list=\"unchecked\"'];\n default:\n return [tag, ''];\n }\n}\n\nfunction normalizeDelta(delta: Delta) {\n return delta.reduce((normalizedDelta, op) => {\n if (typeof op.insert === 'string') {\n const text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return normalizedDelta.insert(text, op.attributes);\n }\n return normalizedDelta.push(op);\n }, new Delta());\n}\n\nfunction shiftRange({ index, length }: Range, amount: number) {\n return new Range(index + amount, length);\n}\n\nfunction splitOpLines(ops: Op[]) {\n const split: Op[] = [];\n ops.forEach((op) => {\n if (typeof op.insert === 'string') {\n const lines = op.insert.split('\\n');\n lines.forEach((line, index) => {\n if (index) split.push({ insert: '\\n', attributes: op.attributes });\n if (line) split.push({ insert: line, attributes: op.attributes });\n });\n } else {\n split.push(op);\n }\n });\n\n return split;\n}\n\nexport default Editor;\n","import Embed from '../blots/embed.js';\nimport type Scroll from '../blots/scroll.js';\nimport Emitter from './emitter.js';\n\nclass Composition {\n isComposing = false;\n\n constructor(\n private scroll: Scroll,\n private emitter: Emitter,\n ) {\n this.setupListeners();\n }\n\n private setupListeners() {\n this.scroll.domNode.addEventListener('compositionstart', (event) => {\n if (!this.isComposing) {\n this.handleCompositionStart(event);\n }\n });\n\n this.scroll.domNode.addEventListener('compositionend', (event) => {\n if (this.isComposing) {\n // Webkit makes DOM changes after compositionend, so we use microtask to\n // ensure the order.\n // https://bugs.webkit.org/show_bug.cgi?id=31902\n queueMicrotask(() => {\n this.handleCompositionEnd(event);\n });\n }\n });\n }\n\n private handleCompositionStart(event: CompositionEvent) {\n const blot =\n event.target instanceof Node\n ? this.scroll.find(event.target, true)\n : null;\n\n if (blot && !(blot instanceof Embed)) {\n this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_START, event);\n this.scroll.batchStart();\n this.emitter.emit(Emitter.events.COMPOSITION_START, event);\n this.isComposing = true;\n }\n }\n\n private handleCompositionEnd(event: CompositionEvent) {\n this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_END, event);\n this.scroll.batchEnd();\n this.emitter.emit(Emitter.events.COMPOSITION_END, event);\n this.isComposing = false;\n }\n}\n\nexport default Composition;\n","export type Rect = {\n top: number;\n right: number;\n bottom: number;\n left: number;\n};\n\nconst getParentElement = (element: Node): Element | null =>\n element.parentElement || (element.getRootNode() as ShadowRoot).host || null;\n\nconst getElementRect = (element: Element): Rect => {\n const rect = element.getBoundingClientRect();\n const scaleX =\n ('offsetWidth' in element &&\n Math.abs(rect.width) / (element as HTMLElement).offsetWidth) ||\n 1;\n const scaleY =\n ('offsetHeight' in element &&\n Math.abs(rect.height) / (element as HTMLElement).offsetHeight) ||\n 1;\n return {\n top: rect.top,\n right: rect.left + element.clientWidth * scaleX,\n bottom: rect.top + element.clientHeight * scaleY,\n left: rect.left,\n };\n};\n\nconst paddingValueToInt = (value: string) => {\n const number = parseInt(value, 10);\n return Number.isNaN(number) ? 0 : number;\n};\n\n// Follow the steps described in https://www.w3.org/TR/cssom-view-1/#element-scrolling-members,\n// assuming that the scroll option is set to 'nearest'.\nconst getScrollDistance = (\n targetStart: number,\n targetEnd: number,\n scrollStart: number,\n scrollEnd: number,\n scrollPaddingStart: number,\n scrollPaddingEnd: number,\n) => {\n if (targetStart < scrollStart && targetEnd > scrollEnd) {\n return 0;\n }\n\n if (targetStart < scrollStart) {\n return -(scrollStart - targetStart + scrollPaddingStart);\n }\n\n if (targetEnd > scrollEnd) {\n return targetEnd - targetStart > scrollEnd - scrollStart\n ? targetStart + scrollPaddingStart - scrollStart\n : targetEnd - scrollEnd + scrollPaddingEnd;\n }\n return 0;\n};\n\nconst scrollRectIntoView = (root: HTMLElement, targetRect: Rect) => {\n const document = root.ownerDocument;\n\n let rect = targetRect;\n\n let current: Element | null = root;\n while (current) {\n const isDocumentBody: boolean = current === document.body;\n const bounding = isDocumentBody\n ? {\n top: 0,\n right:\n window.visualViewport?.width ??\n document.documentElement.clientWidth,\n bottom:\n window.visualViewport?.height ??\n document.documentElement.clientHeight,\n left: 0,\n }\n : getElementRect(current);\n\n const style = getComputedStyle(current);\n const scrollDistanceX = getScrollDistance(\n rect.left,\n rect.right,\n bounding.left,\n bounding.right,\n paddingValueToInt(style.scrollPaddingLeft),\n paddingValueToInt(style.scrollPaddingRight),\n );\n const scrollDistanceY = getScrollDistance(\n rect.top,\n rect.bottom,\n bounding.top,\n bounding.bottom,\n paddingValueToInt(style.scrollPaddingTop),\n paddingValueToInt(style.scrollPaddingBottom),\n );\n if (scrollDistanceX || scrollDistanceY) {\n if (isDocumentBody) {\n document.defaultView?.scrollBy(scrollDistanceX, scrollDistanceY);\n } else {\n const { scrollLeft, scrollTop } = current;\n if (scrollDistanceY) {\n current.scrollTop += scrollDistanceY;\n }\n if (scrollDistanceX) {\n current.scrollLeft += scrollDistanceX;\n }\n const scrolledLeft = current.scrollLeft - scrollLeft;\n const scrolledTop = current.scrollTop - scrollTop;\n rect = {\n left: rect.left - scrolledLeft,\n top: rect.top - scrolledTop,\n right: rect.right - scrolledLeft,\n bottom: rect.bottom - scrolledTop,\n };\n }\n }\n\n current =\n isDocumentBody || style.position === 'fixed'\n ? null\n : getParentElement(current);\n }\n};\n\nexport default scrollRectIntoView;\n","import { Registry } from 'parchment';\n\nconst MAX_REGISTER_ITERATIONS = 100;\nconst CORE_FORMATS = ['block', 'break', 'cursor', 'inline', 'scroll', 'text'];\n\nconst createRegistryWithFormats = (\n formats: string[],\n sourceRegistry: Registry,\n debug: { error: (errorMessage: string) => void },\n) => {\n const registry = new Registry();\n CORE_FORMATS.forEach((name) => {\n const coreBlot = sourceRegistry.query(name);\n if (coreBlot) registry.register(coreBlot);\n });\n\n formats.forEach((name) => {\n let format = sourceRegistry.query(name);\n if (!format) {\n debug.error(\n `Cannot register \"${name}\" specified in \"formats\" config. Are you sure it was registered?`,\n );\n }\n let iterations = 0;\n while (format) {\n registry.register(format);\n format = 'blotName' in format ? format.requiredContainer ?? null : null;\n\n iterations += 1;\n if (iterations > MAX_REGISTER_ITERATIONS) {\n debug.error(\n `Cycle detected in registering blot requiredContainer: \"${name}\"`,\n );\n break;\n }\n }\n });\n\n return registry;\n};\n\nexport default createRegistryWithFormats;\n","import { merge } from 'lodash-es';\nimport * as Parchment from 'parchment';\nimport type { Op } from 'quill-delta';\nimport Delta from 'quill-delta';\nimport type { BlockEmbed } from '../blots/block.js';\nimport type Block from '../blots/block.js';\nimport type Scroll from '../blots/scroll.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type Uploader from '../modules/uploader.js';\nimport Editor from './editor.js';\nimport Emitter from './emitter.js';\nimport type { EmitterSource } from './emitter.js';\nimport instances from './instances.js';\nimport logger from './logger.js';\nimport type { DebugLevel } from './logger.js';\nimport Module from './module.js';\nimport Selection, { Range } from './selection.js';\nimport type { Bounds } from './selection.js';\nimport Composition from './composition.js';\nimport Theme from './theme.js';\nimport type { ThemeConstructor } from './theme.js';\nimport scrollRectIntoView from './utils/scrollRectIntoView.js';\nimport type { Rect } from './utils/scrollRectIntoView.js';\nimport createRegistryWithFormats from './utils/createRegistryWithFormats.js';\n\nconst debug = logger('quill');\n\nconst globalRegistry = new Parchment.Registry();\nParchment.ParentBlot.uiClass = 'ql-ui';\n\ninterface Options {\n theme?: string;\n debug?: DebugLevel | boolean;\n registry?: Parchment.Registry;\n readOnly?: boolean;\n placeholder?: string;\n bounds?: HTMLElement | string | null;\n modules?: Record;\n formats?: string[] | null;\n}\n\ninterface ExpandedOptions extends Omit {\n theme: ThemeConstructor;\n registry: Parchment.Registry;\n container: HTMLElement;\n modules: Record;\n bounds?: HTMLElement | null;\n readOnly: boolean;\n}\n\nclass Quill {\n static DEFAULTS = {\n bounds: null,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true,\n },\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n theme: 'default',\n } as const satisfies Partial;\n static events = Emitter.events;\n static sources = Emitter.sources;\n static version = typeof QUILL_VERSION === 'undefined' ? 'dev' : QUILL_VERSION;\n\n static imports: Record = {\n delta: Delta,\n parchment: Parchment,\n 'core/module': Module,\n 'core/theme': Theme,\n };\n\n static debug(limit: DebugLevel | boolean) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static find(node: Node, bubble = false) {\n return instances.get(node) || globalRegistry.find(node, bubble);\n }\n\n static import(name: 'core/module'): typeof Module;\n static import(name: `themes/${string}`): typeof Theme;\n static import(name: 'parchment'): typeof Parchment;\n static import(name: 'delta'): typeof Delta;\n static import(name: string): unknown;\n static import(name: string) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(\n path:\n | string\n | Parchment.BlotConstructor\n | Parchment.Attributor\n | Record,\n target?: Parchment.BlotConstructor | Parchment.Attributor | boolean,\n overwrite = false,\n ) {\n if (typeof path !== 'string') {\n const name = 'attrName' in path ? path.attrName : path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n // @ts-expect-error\n this.register(`formats/${name}`, path, target);\n } else {\n Object.keys(path).forEach((key) => {\n // @ts-expect-error\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if (\n (path.startsWith('blots/') || path.startsWith('formats/')) &&\n target &&\n typeof target !== 'boolean' &&\n // @ts-expect-error\n target.blotName !== 'abstract'\n ) {\n globalRegistry.register(target);\n }\n // @ts-expect-error\n if (typeof target.register === 'function') {\n // @ts-expect-error\n target.register(globalRegistry);\n }\n }\n }\n\n container: HTMLElement;\n root: HTMLDivElement;\n scroll: Scroll;\n emitter: Emitter;\n allowReadOnlyEdits: boolean;\n editor: Editor;\n composition: Composition;\n selection: Selection;\n\n theme: Theme;\n keyboard: Keyboard;\n clipboard: Clipboard;\n history: History;\n uploader: Uploader;\n\n options: ExpandedOptions;\n\n constructor(container: HTMLElement | string, options: Options = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n debug.error('Invalid Quill container', container);\n return;\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n instances.set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.emitter = new Emitter();\n const scrollBlotName = Parchment.ScrollBlot.blotName;\n const ScrollBlot = this.options.registry.query(scrollBlotName);\n if (!ScrollBlot || !('blotName' in ScrollBlot)) {\n throw new Error(\n `Cannot initialize Quill without \"${scrollBlotName}\" blot`,\n );\n }\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter,\n }) as Scroll;\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.composition = new Composition(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.addModule('input');\n this.theme.addModule('uiNode');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo =\n oldRange && newRange ? { oldRange, newRange } : undefined;\n modify.call(\n this,\n () => this.editor.update(null, mutations, selectionInfo),\n source,\n );\n });\n this.emitter.on(Emitter.events.SCROLL_EMBED_UPDATE, (blot, delta) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo =\n oldRange && newRange ? { oldRange, newRange } : undefined;\n modify.call(\n this,\n () => {\n const change = new Delta()\n .retain(blot.offset(this))\n .retain({ [blot.statics.blotName]: delta });\n return this.editor.update(change, [], selectionInfo);\n },\n Quill.sources.USER,\n );\n });\n if (html) {\n const contents = this.clipboard.convert({\n html: `${html}


    `,\n text: '\\n',\n });\n this.setContents(contents);\n }\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n this.allowReadOnlyEdits = false;\n }\n\n addContainer(container: string, refNode?: Node | null): HTMLDivElement;\n addContainer(container: HTMLElement, refNode?: Node | null): HTMLElement;\n addContainer(\n container: string | HTMLElement,\n refNode: Node | null = null,\n ): HTMLDivElement | HTMLElement {\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(range: Range, source?: EmitterSource): Delta;\n deleteText(index: number, length: number, source?: EmitterSource): Delta;\n deleteText(\n index: number | Range,\n length?: number | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n // @ts-expect-error\n [index, length, , source] = overload(index, length, source);\n return modify.call(\n this,\n () => {\n return this.editor.deleteText(index, length);\n },\n source,\n index,\n -1 * length,\n );\n }\n\n disable() {\n this.enable(false);\n }\n\n editReadOnly(modifier: () => T): T {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus(options: { preventScroll?: boolean } = {}) {\n this.selection.focus();\n if (!options.preventScroll) {\n this.scrollSelectionIntoView();\n }\n }\n\n format(\n name: string,\n value: unknown,\n source: EmitterSource = Emitter.sources.API,\n ) {\n return modify.call(\n this,\n () => {\n const range = this.getSelection(true);\n let change = new Delta();\n if (range == null) return change;\n if (this.scroll.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value,\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value,\n });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n },\n source,\n );\n }\n\n formatLine(\n index: number,\n length: number,\n formats: Record,\n source?: EmitterSource,\n ): Delta;\n formatLine(\n index: number,\n length: number,\n name: string,\n value?: unknown,\n source?: EmitterSource,\n ): Delta;\n formatLine(\n index: number,\n length: number,\n name: string | Record,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n index,\n length,\n // @ts-expect-error\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatLine(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n formatText(\n range: { index: number; length: number },\n name: string,\n value: unknown,\n source?: EmitterSource,\n ): Delta;\n formatText(\n index: number,\n length: number,\n name: string,\n value: unknown,\n source: EmitterSource,\n ): Delta;\n formatText(\n index: number | { index: number; length: number },\n length: number | string,\n name: string | unknown,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n // @ts-expect-error\n index,\n length,\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatText(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n getBounds(index: number | Range, length = 0): Bounds | null {\n let bounds: Bounds | null = null;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n if (!bounds) return null;\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width,\n };\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index?: number, length?: number): { [format: string]: unknown };\n getFormat(range?: { index: number; length: number }): {\n [format: string]: unknown;\n };\n getFormat(\n index: { index: number; length: number } | number = this.getSelection(true),\n length = 0,\n ): { [format: string]: unknown } {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n return this.editor.getFormat(index.index, index.length);\n }\n\n getIndex(blot: Parchment.Blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index: number) {\n return this.scroll.leaf(index);\n }\n\n getLine(index: number) {\n return this.scroll.line(index);\n }\n\n getLines(range: { index: number; length: number }): (Block | BlockEmbed)[];\n getLines(index?: number, length?: number): (Block | BlockEmbed)[];\n getLines(\n index: { index: number; length: number } | number = 0,\n length = Number.MAX_VALUE,\n ): (Block | BlockEmbed)[] {\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n return this.scroll.lines(index, length);\n }\n\n getModule(name: string) {\n return this.theme.modules[name];\n }\n\n getSelection(focus: true): Range;\n getSelection(focus?: boolean): Range | null;\n getSelection(focus = false): Range | null {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getSemanticHTML(range: { index: number; length: number }): string;\n getSemanticHTML(index?: number, length?: number): string;\n getSemanticHTML(\n index: { index: number; length: number } | number = 0,\n length?: number,\n ) {\n if (typeof index === 'number') {\n length = length ?? this.getLength() - index;\n }\n // @ts-expect-error\n [index, length] = overload(index, length);\n return this.editor.getHTML(index, length);\n }\n\n getText(range?: { index: number; length: number }): string;\n getText(index?: number, length?: number): string;\n getText(\n index: { index: number; length: number } | number = 0,\n length?: number,\n ): string {\n if (typeof index === 'number') {\n length = length ?? this.getLength() - index;\n }\n // @ts-expect-error\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(\n index: number,\n embed: string,\n value: unknown,\n source: EmitterSource = Quill.sources.API,\n ) {\n return modify.call(\n this,\n () => {\n return this.editor.insertEmbed(index, embed, value);\n },\n source,\n index,\n );\n }\n\n insertText(index: number, text: string, source: EmitterSource): Delta;\n insertText(\n index: number,\n text: string,\n formats: Record,\n source: EmitterSource,\n ): Delta;\n insertText(\n index: number,\n text: string,\n name: string,\n value: unknown,\n source: EmitterSource,\n ): Delta;\n insertText(\n index: number,\n text: string,\n name: string | Record | EmitterSource,\n value?: unknown,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n // @ts-expect-error\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(\n this,\n () => {\n return this.editor.insertText(index, text, formats);\n },\n source,\n index,\n text.length,\n );\n }\n\n isEnabled() {\n return this.scroll.isEnabled();\n }\n\n off(...args: Parameters<(typeof Emitter)['prototype']['off']>) {\n return this.emitter.off(...args);\n }\n\n on(\n event: (typeof Emitter)['events']['TEXT_CHANGE'],\n handler: (delta: Delta, oldContent: Delta, source: EmitterSource) => void,\n ): Emitter;\n on(\n event: (typeof Emitter)['events']['SELECTION_CHANGE'],\n handler: (range: Range, oldRange: Range, source: EmitterSource) => void,\n ): Emitter;\n on(\n event: (typeof Emitter)['events']['EDITOR_CHANGE'],\n handler: (\n ...args:\n | [\n (typeof Emitter)['events']['TEXT_CHANGE'],\n Delta,\n Delta,\n EmitterSource,\n ]\n | [\n (typeof Emitter)['events']['SELECTION_CHANGE'],\n Range,\n Range,\n EmitterSource,\n ]\n ) => void,\n ): Emitter;\n on(event: string, ...args: unknown[]): Emitter;\n on(...args: Parameters<(typeof Emitter)['prototype']['on']>): Emitter {\n return this.emitter.on(...args);\n }\n\n once(...args: Parameters<(typeof Emitter)['prototype']['once']>) {\n return this.emitter.once(...args);\n }\n\n removeFormat(...args: Parameters) {\n const [index, length, , source] = overload(...args);\n return modify.call(\n this,\n () => {\n return this.editor.removeFormat(index, length);\n },\n source,\n index,\n );\n }\n\n scrollRectIntoView(rect: Rect) {\n scrollRectIntoView(this.root, rect);\n }\n\n /**\n * @deprecated Use Quill#scrollSelectionIntoView() instead.\n */\n scrollIntoView() {\n console.warn(\n 'Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead.',\n );\n this.scrollSelectionIntoView();\n }\n\n /**\n * Scroll the current selection into the visible area.\n * If the selection is already visible, no scrolling will occur.\n */\n scrollSelectionIntoView() {\n const range = this.selection.lastRange;\n const bounds = range && this.selection.getBounds(range.index, range.length);\n if (bounds) {\n this.scrollRectIntoView(bounds);\n }\n }\n\n setContents(\n delta: Delta | Op[],\n source: EmitterSource = Emitter.sources.API,\n ) {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n const length = this.getLength();\n // Quill will set empty editor to \\n\n const delete1 = this.editor.deleteText(0, length);\n const applied = this.editor.insertContents(0, delta);\n // Remove extra \\n from empty editor initialization\n const delete2 = this.editor.deleteText(this.getLength() - 1, 1);\n return delete1.compose(applied).compose(delete2);\n },\n source,\n );\n }\n setSelection(range: Range | null, source?: EmitterSource): void;\n setSelection(index: number, source?: EmitterSource): void;\n setSelection(index: number, length?: number, source?: EmitterSource): void;\n setSelection(index: number, source?: EmitterSource): void;\n setSelection(\n index: Range | null | number,\n length?: EmitterSource | number,\n source?: EmitterSource,\n ): void {\n if (index == null) {\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/22609\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n // @ts-expect-error\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(Math.max(0, index), length), source);\n if (source !== Emitter.sources.SILENT) {\n this.scrollSelectionIntoView();\n }\n }\n }\n\n setText(text: string, source: EmitterSource = Emitter.sources.API) {\n const delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source: EmitterSource = Emitter.sources.USER) {\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n // TODO this is usually undefined\n return change;\n }\n\n updateContents(\n delta: Delta | Op[],\n source: EmitterSource = Emitter.sources.API,\n ) {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta);\n },\n source,\n true,\n );\n }\n}\n\nfunction resolveSelector(selector: string | HTMLElement | null | undefined) {\n return typeof selector === 'string'\n ? document.querySelector(selector)\n : selector;\n}\n\nfunction expandModuleConfig(config: Record | undefined) {\n return Object.entries(config ?? {}).reduce(\n (expanded, [key, value]) => ({\n ...expanded,\n [key]: value === true ? {} : value,\n }),\n {},\n );\n}\n\nfunction expandConfig(\n containerOrSelector: HTMLElement | string,\n options: Options,\n): ExpandedOptions {\n const container = resolveSelector(containerOrSelector);\n if (!container) {\n throw new Error('Invalid Quill container');\n }\n\n const shouldUseDefaultTheme =\n !options.theme || options.theme === Quill.DEFAULTS.theme;\n const theme = shouldUseDefaultTheme\n ? Theme\n : Quill.import(`themes/${options.theme}`);\n if (!theme) {\n throw new Error(`Invalid theme ${options.theme}. Did you register it?`);\n }\n\n const { modules: quillModuleDefaults, ...quillDefaults } = Quill.DEFAULTS;\n const { modules: themeModuleDefaults, ...themeDefaults } = theme.DEFAULTS;\n\n const modules: ExpandedOptions['modules'] = merge(\n {},\n expandModuleConfig(quillModuleDefaults),\n expandModuleConfig(themeModuleDefaults),\n expandModuleConfig(options.modules),\n );\n // Special case toolbar shorthand\n if (\n modules != null &&\n modules.toolbar &&\n modules.toolbar.constructor !== Object\n ) {\n modules.toolbar = {\n container: modules.toolbar,\n };\n }\n\n const config = { ...quillDefaults, ...themeDefaults, ...options };\n\n let registry = options.registry;\n if (registry) {\n if (options.formats) {\n debug.warn('Ignoring \"formats\" option because \"registry\" is specified');\n }\n } else {\n registry = options.formats\n ? createRegistryWithFormats(options.formats, config.registry, debug)\n : config.registry;\n }\n\n return {\n ...config,\n registry,\n container,\n theme,\n modules: Object.entries(modules).reduce(\n (modulesWithDefaults, [name, value]) => {\n if (!value) return modulesWithDefaults;\n\n const moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(\n `Cannot load ${name} module. Are you sure you registered it?`,\n );\n return modulesWithDefaults;\n }\n return {\n ...modulesWithDefaults,\n // @ts-expect-error\n [name]: merge({}, moduleClass.DEFAULTS || {}, value),\n };\n },\n {},\n ),\n bounds: resolveSelector(config.bounds),\n };\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(\n modifier: () => Delta,\n source: EmitterSource,\n index: number | boolean,\n shift: number | null,\n) {\n if (\n !this.isEnabled() &&\n source === Emitter.sources.USER &&\n !this.allowReadOnlyEdits\n ) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n // @ts-expect-error index should always be number\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n const args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\ntype NormalizedIndexLength = [\n number,\n number,\n Record,\n EmitterSource,\n];\nfunction overload(index: number, source?: EmitterSource): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n format: string,\n value: unknown,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n format: Record,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(range: Range, source?: EmitterSource): NormalizedIndexLength;\nfunction overload(\n range: Range,\n format: string,\n value: unknown,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n range: Range,\n format: Record,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: Range | number,\n length?: number | string | Record | EmitterSource,\n name?: string | unknown | Record | EmitterSource,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n): NormalizedIndexLength {\n let formats: Record = {};\n // @ts-expect-error\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n // @ts-expect-error\n source = value;\n value = name;\n name = length;\n // @ts-expect-error\n length = index.length; // eslint-disable-line prefer-destructuring\n // @ts-expect-error\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n // @ts-expect-error\n length = index.length; // eslint-disable-line prefer-destructuring\n // @ts-expect-error\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n // @ts-expect-error\n source = value;\n value = name;\n name = length;\n length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n // @ts-expect-error Fix me later\n formats = name;\n // @ts-expect-error\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n // @ts-expect-error\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n // @ts-expect-error\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range: Range, change: Delta, source?: EmitterSource): Range;\nfunction shiftRange(\n range: Range,\n index: number,\n length?: number,\n source?: EmitterSource,\n): Range;\nfunction shiftRange(\n range: Range,\n index: number | Delta,\n lengthOrSource?: number | EmitterSource,\n source?: EmitterSource,\n) {\n const length = typeof lengthOrSource === 'number' ? lengthOrSource : 0;\n if (range == null) return null;\n let start;\n let end;\n // @ts-expect-error -- TODO: add a better type guard around `index`\n if (index && typeof index.transformPosition === 'function') {\n [start, end] = [range.index, range.index + range.length].map((pos) =>\n // @ts-expect-error -- TODO: add a better type guard around `index`\n index.transformPosition(pos, source !== Emitter.sources.USER),\n );\n } else {\n [start, end] = [range.index, range.index + range.length].map((pos) => {\n // @ts-expect-error -- TODO: add a better type guard around `index`\n if (pos < index || (pos === index && source === Emitter.sources.USER))\n return pos;\n if (length >= 0) {\n return pos + length;\n }\n // @ts-expect-error -- TODO: add a better type guard around `index`\n return Math.max(index, pos + length);\n });\n }\n return new Range(start, end - start);\n}\n\nexport { globalRegistry, expandConfig, overload, Quill as default };\n","import { LeafBlot, Scope } from 'parchment';\nimport { cloneDeep, isEqual } from 'lodash-es';\nimport Emitter from './emitter.js';\nimport type { EmitterSource } from './emitter.js';\nimport logger from './logger.js';\nimport type Cursor from '../blots/cursor.js';\nimport type Scroll from '../blots/scroll.js';\n\nconst debug = logger('quill:selection');\n\ntype NativeRange = AbstractRange;\n\ninterface NormalizedRange {\n start: {\n node: NativeRange['startContainer'];\n offset: NativeRange['startOffset'];\n };\n end: { node: NativeRange['endContainer']; offset: NativeRange['endOffset'] };\n native: NativeRange;\n}\n\nexport interface Bounds {\n bottom: number;\n height: number;\n left: number;\n right: number;\n top: number;\n width: number;\n}\n\nclass Range {\n constructor(\n public index: number,\n public length = 0,\n ) {}\n}\n\nclass Selection {\n scroll: Scroll;\n emitter: Emitter;\n composing: boolean;\n mouseDown: boolean;\n\n root: HTMLElement;\n cursor: Cursor;\n savedRange: Range;\n lastRange: Range | null;\n lastNative: NormalizedRange | null;\n\n constructor(scroll: Scroll, emitter: Emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n // @ts-expect-error\n this.cursor = this.scroll.create('cursor', this);\n // savedRange is last non-null range\n this.savedRange = new Range(0, 0);\n this.lastRange = this.savedRange;\n this.lastNative = null;\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, () => {\n if (!this.mouseDown && !this.composing) {\n setTimeout(this.update.bind(this, Emitter.sources.USER), 1);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, () => {\n if (!this.hasFocus()) return;\n const native = this.getNativeRange();\n if (native == null) return;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n this.emitter.once(\n Emitter.events.SCROLL_UPDATE,\n (source, mutations: MutationRecord[]) => {\n try {\n if (\n this.root.contains(native.start.node) &&\n this.root.contains(native.end.node)\n ) {\n this.setNativeRange(\n native.start.node,\n native.start.offset,\n native.end.node,\n native.end.offset,\n );\n }\n const triggeredByTyping = mutations.some(\n (mutation) =>\n mutation.type === 'characterData' ||\n mutation.type === 'childList' ||\n (mutation.type === 'attributes' &&\n mutation.target === this.root),\n );\n this.update(triggeredByTyping ? Emitter.sources.SILENT : source);\n } catch (ignored) {\n // ignore\n }\n },\n );\n });\n this.emitter.on(Emitter.events.SCROLL_OPTIMIZE, (mutations, context) => {\n if (context.range) {\n const { startNode, startOffset, endNode, endOffset } = context.range;\n this.setNativeRange(startNode, startOffset, endNode, endOffset);\n this.update(Emitter.sources.SILENT);\n }\n });\n this.update(Emitter.sources.SILENT);\n }\n\n handleComposition() {\n this.emitter.on(Emitter.events.COMPOSITION_BEFORE_START, () => {\n this.composing = true;\n });\n this.emitter.on(Emitter.events.COMPOSITION_END, () => {\n this.composing = false;\n if (this.cursor.parent) {\n const range = this.cursor.restore();\n if (!range) return;\n setTimeout(() => {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }, 1);\n }\n });\n }\n\n handleDragging() {\n this.emitter.listenDOM('mousedown', document.body, () => {\n this.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, () => {\n this.mouseDown = false;\n this.update(Emitter.sources.USER);\n });\n }\n\n focus() {\n if (this.hasFocus()) return;\n this.root.focus({ preventScroll: true });\n this.setRange(this.savedRange);\n }\n\n format(format: string, value: unknown) {\n this.scroll.update();\n const nativeRange = this.getNativeRange();\n if (\n nativeRange == null ||\n !nativeRange.native.collapsed ||\n this.scroll.query(format, Scope.BLOCK)\n )\n return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n const blot = this.scroll.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof LeafBlot) {\n const after = blot.split(nativeRange.start.offset);\n // @ts-expect-error Fix me later\n blot.parent.insertBefore(this.cursor, after);\n } else {\n // @ts-expect-error TODO: nativeRange.start.node doesn't seem to match function signature\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index: number, length = 0) {\n const scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let node: Node;\n let [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n if (length > 0 && offset === leaf.length()) {\n const [next] = this.scroll.leaf(index + 1);\n if (next) {\n const [line] = this.scroll.line(index);\n const [nextLine] = this.scroll.line(index + 1);\n if (line === nextLine) {\n leaf = next;\n offset = 0;\n }\n }\n }\n [node, offset] = leaf.position(offset, true);\n const range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n }\n let side: 'left' | 'right' = 'left';\n let rect: DOMRect;\n if (node instanceof Text) {\n // Return null if the text node is empty because it is\n // not able to get a useful client rect:\n // https://github.com/w3c/csswg-drafts/issues/2514.\n // Empty text nodes are most likely caused by TextBlot#optimize()\n // not getting called when editor content changes.\n if (!node.data.length) {\n return null;\n }\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n if (!(leaf.domNode instanceof Element)) return null;\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0,\n };\n }\n\n getNativeRange(): NormalizedRange | null {\n const selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n const nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n const range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange(): [Range, NormalizedRange] | [null, null] {\n const root = this.scroll.domNode;\n if ('isConnected' in root && !root.isConnected) {\n // document.getSelection() forces layout on Blink, so we trend to\n // not calling it.\n return [null, null];\n }\n const normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n const range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n\n hasFocus(): boolean {\n return (\n document.activeElement === this.root ||\n (document.activeElement != null &&\n contains(this.root, document.activeElement))\n );\n }\n\n normalizedToRange(range: NormalizedRange) {\n const positions: [Node, number][] = [\n [range.start.node, range.start.offset],\n ];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n const indexes = positions.map((position) => {\n const [node, offset] = position;\n const blot = this.scroll.find(node, true);\n // @ts-expect-error Fix me later\n const index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n }\n if (blot instanceof LeafBlot) {\n return index + blot.index(node, offset);\n }\n // @ts-expect-error Fix me later\n return index + blot.length();\n });\n const end = Math.min(Math.max(...indexes), this.scroll.length() - 1);\n const start = Math.min(end, ...indexes);\n return new Range(start, end - start);\n }\n\n normalizeNative(nativeRange: NativeRange) {\n if (\n !contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))\n ) {\n return null;\n }\n const range = {\n start: {\n node: nativeRange.startContainer,\n offset: nativeRange.startOffset,\n },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange,\n };\n [range.start, range.end].forEach((position) => {\n let { node, offset } = position;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n // @ts-expect-error Fix me later\n node = node.lastChild;\n if (node instanceof Text) {\n offset = node.data.length;\n } else if (node.childNodes.length > 0) {\n // Container case\n offset = node.childNodes.length;\n } else {\n // Embed case\n offset = node.childNodes.length + 1;\n }\n } else {\n break;\n }\n }\n position.node = node;\n position.offset = offset;\n });\n return range;\n }\n\n rangeToNative(range: Range): [Node | null, number, Node | null, number] {\n const scrollLength = this.scroll.length();\n\n const getPosition = (\n index: number,\n inclusive: boolean,\n ): [Node | null, number] => {\n index = Math.min(scrollLength - 1, index);\n const [leaf, leafOffset] = this.scroll.leaf(index);\n return leaf ? leaf.position(leafOffset, inclusive) : [null, -1];\n };\n return [\n ...getPosition(range.index, false),\n ...getPosition(range.index + range.length, true),\n ];\n }\n\n setNativeRange(\n startNode: Node | null,\n startOffset?: number,\n endNode = startNode,\n endOffset = startOffset,\n force = false,\n ) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (\n startNode != null &&\n (this.root.parentNode == null ||\n startNode.parentNode == null ||\n // @ts-expect-error Fix me later\n endNode.parentNode == null)\n ) {\n return;\n }\n const selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus({ preventScroll: true });\n const { native } = this.getNativeRange() || {};\n if (\n native == null ||\n force ||\n startNode !== native.startContainer ||\n startOffset !== native.startOffset ||\n endNode !== native.endContainer ||\n endOffset !== native.endOffset\n ) {\n if (startNode instanceof Element && startNode.tagName === 'BR') {\n // @ts-expect-error Fix me later\n startOffset = Array.from(startNode.parentNode.childNodes).indexOf(\n startNode,\n );\n startNode = startNode.parentNode;\n }\n if (endNode instanceof Element && endNode.tagName === 'BR') {\n // @ts-expect-error Fix me later\n endOffset = Array.from(endNode.parentNode.childNodes).indexOf(\n endNode,\n );\n endNode = endNode.parentNode;\n }\n const range = document.createRange();\n // @ts-expect-error Fix me later\n range.setStart(startNode, startOffset);\n // @ts-expect-error Fix me later\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n }\n }\n\n setRange(range: Range | null, force: boolean, source?: EmitterSource): void;\n setRange(range: Range | null, source?: EmitterSource): void;\n setRange(\n range: Range | null,\n force: boolean | EmitterSource = false,\n source: EmitterSource = Emitter.sources.API,\n ): void {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n const args = this.rangeToNative(range);\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source: EmitterSource = Emitter.sources.USER) {\n const oldRange = this.lastRange;\n const [lastRange, nativeRange] = this.getRange();\n this.lastRange = lastRange;\n this.lastNative = nativeRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!isEqual(oldRange, this.lastRange)) {\n if (\n !this.composing &&\n nativeRange != null &&\n nativeRange.native.collapsed &&\n nativeRange.start.node !== this.cursor.textNode\n ) {\n const range = this.cursor.restore();\n if (range) {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }\n }\n const args = [\n Emitter.events.SELECTION_CHANGE,\n cloneDeep(this.lastRange),\n cloneDeep(oldRange),\n source,\n ];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\nfunction contains(parent: Node, descendant: Node) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode; // eslint-disable-line @typescript-eslint/no-unused-expressions\n } catch (e) {\n return false;\n }\n return parent.contains(descendant);\n}\n\nexport { Range, Selection as default };\n","import type Quill from '../core.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type { ToolbarProps } from '../modules/toolbar.js';\nimport type Uploader from '../modules/uploader.js';\n\nexport interface ThemeOptions {\n modules: Record & {\n toolbar?: null | ToolbarProps;\n };\n}\n\nclass Theme {\n static DEFAULTS: ThemeOptions = {\n modules: {},\n };\n\n static themes = {\n default: Theme,\n };\n\n modules: ThemeOptions['modules'] = {};\n\n constructor(\n protected quill: Quill,\n protected options: ThemeOptions,\n ) {}\n\n init() {\n Object.keys(this.options.modules).forEach((name) => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name: 'clipboard'): Clipboard;\n addModule(name: 'keyboard'): Keyboard;\n addModule(name: 'uploader'): Uploader;\n addModule(name: 'history'): History;\n addModule(name: string): unknown;\n addModule(name: string) {\n // @ts-expect-error\n const ModuleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new ModuleClass(\n this.quill,\n this.options.modules[name] || {},\n );\n return this.modules[name];\n }\n}\n\nexport interface ThemeConstructor {\n new (quill: Quill, options: unknown): Theme;\n DEFAULTS: ThemeOptions;\n}\n\nexport default Theme;\n","import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['right', 'center', 'justify'],\n};\n\nconst AlignAttribute = new Attributor('align', 'align', config);\nconst AlignClass = new ClassAttributor('align', 'ql-align', config);\nconst AlignStyle = new StyleAttributor('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n","import { ClassAttributor, Scope } from 'parchment';\nimport { ColorAttributor } from './color.js';\n\nconst BackgroundClass = new ClassAttributor('background', 'ql-bg', {\n scope: Scope.INLINE,\n});\nconst BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Scope.INLINE,\n});\n\nexport { BackgroundClass, BackgroundStyle };\n","import Block from '../blots/block.js';\nimport Break from '../blots/break.js';\nimport Cursor from '../blots/cursor.js';\nimport Inline from '../blots/inline.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport Container from '../blots/container.js';\nimport Quill from '../core/quill.js';\n\nclass CodeBlockContainer extends Container {\n static create(value: string) {\n const domNode = super.create(value) as Element;\n domNode.setAttribute('spellcheck', 'false');\n return domNode;\n }\n\n code(index: number, length: number) {\n return (\n this.children\n // @ts-expect-error\n .map((child) => (child.length() <= 1 ? '' : child.domNode.innerText))\n .join('\\n')\n .slice(index, index + length)\n );\n }\n\n html(index: number, length: number) {\n // `\\n`s are needed in order to support empty lines at the beginning and the end.\n // https://html.spec.whatwg.org/multipage/syntax.html#element-restrictions\n return `
    \\n${escapeText(this.code(index, length))}\\n
    `;\n }\n}\n\nclass CodeBlock extends Block {\n static TAB = ' ';\n\n static register() {\n Quill.register(CodeBlockContainer);\n }\n}\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\nCodeBlock.blotName = 'code-block';\nCodeBlock.className = 'ql-code-block';\nCodeBlock.tagName = 'DIV';\nCodeBlockContainer.blotName = 'code-block-container';\nCodeBlockContainer.className = 'ql-code-block-container';\nCodeBlockContainer.tagName = 'DIV';\n\nCodeBlockContainer.allowedChildren = [CodeBlock];\n\nCodeBlock.allowedChildren = [TextBlot, Break, Cursor];\nCodeBlock.requiredContainer = CodeBlockContainer;\n\nexport { Code, CodeBlockContainer, CodeBlock as default };\n","import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nclass ColorAttributor extends StyleAttributor {\n value(domNode: HTMLElement) {\n let value = super.value(domNode) as string;\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n const hex = value\n .split(',')\n .map((component) => `00${parseInt(component, 10).toString(16)}`.slice(-2))\n .join('');\n return `#${hex}`;\n }\n}\n\nconst ColorClass = new ClassAttributor('color', 'ql-color', {\n scope: Scope.INLINE,\n});\nconst ColorStyle = new ColorAttributor('color', 'color', {\n scope: Scope.INLINE,\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n","import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['rtl'],\n};\n\nconst DirectionAttribute = new Attributor('direction', 'dir', config);\nconst DirectionClass = new ClassAttributor('direction', 'ql-direction', config);\nconst DirectionStyle = new StyleAttributor('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n","import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.INLINE,\n whitelist: ['serif', 'monospace'],\n};\n\nconst FontClass = new ClassAttributor('font', 'ql-font', config);\n\nclass FontStyleAttributor extends StyleAttributor {\n value(node: HTMLElement) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nconst FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n","import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst SizeClass = new ClassAttributor('size', 'ql-size', {\n scope: Scope.INLINE,\n whitelist: ['small', 'large', 'huge'],\n});\nconst SizeStyle = new StyleAttributor('size', 'font-size', {\n scope: Scope.INLINE,\n whitelist: ['10px', '18px', '32px'],\n});\n\nexport { SizeClass, SizeStyle };\n","const normalWeightRegexp = /font-weight:\\s*normal/;\nconst blockTagNames = ['P', 'OL', 'UL'];\n\nconst isBlockElement = (element: Element | null) => {\n return element && blockTagNames.includes(element.tagName);\n};\n\nconst normalizeEmptyLines = (doc: Document) => {\n Array.from(doc.querySelectorAll('br'))\n .filter(\n (br) =>\n isBlockElement(br.previousElementSibling) &&\n isBlockElement(br.nextElementSibling),\n )\n .forEach((br) => {\n br.parentNode?.removeChild(br);\n });\n};\n\nconst normalizeFontWeight = (doc: Document) => {\n Array.from(doc.querySelectorAll('b[style*=\"font-weight\"]'))\n .filter((node) => node.getAttribute('style')?.match(normalWeightRegexp))\n .forEach((node) => {\n const fragment = doc.createDocumentFragment();\n fragment.append(...node.childNodes);\n node.parentNode?.replaceChild(fragment, node);\n });\n};\n\nexport default function normalize(doc: Document) {\n if (doc.querySelector('[id^=\"docs-internal-guid-\"]')) {\n normalizeFontWeight(doc);\n normalizeEmptyLines(doc);\n }\n}\n","const ignoreRegexp = /\\bmso-list:[^;]*ignore/i;\nconst idRegexp = /\\bmso-list:[^;]*\\bl(\\d+)/i;\nconst indentRegexp = /\\bmso-list:[^;]*\\blevel(\\d+)/i;\n\nconst parseListItem = (element: Element, html: string) => {\n const style = element.getAttribute('style');\n const idMatch = style?.match(idRegexp);\n if (!idMatch) {\n return null;\n }\n const id = Number(idMatch[1]);\n\n const indentMatch = style?.match(indentRegexp);\n const indent = indentMatch ? Number(indentMatch[1]) : 1;\n\n const typeRegexp = new RegExp(\n `@list l${id}:level${indent}\\\\s*\\\\{[^\\\\}]*mso-level-number-format:\\\\s*([\\\\w-]+)`,\n 'i',\n );\n const typeMatch = html.match(typeRegexp);\n const type = typeMatch && typeMatch[1] === 'bullet' ? 'bullet' : 'ordered';\n\n return { id, indent, type, element };\n};\n\n// list items are represented as `p` tags with styles like `mso-list: l0 level1` where:\n// 1. \"0\" in \"l0\" means the list item id;\n// 2. \"1\" in \"level1\" means the indent level, starting from 1.\nconst normalizeListItem = (doc: Document) => {\n const msoList = Array.from(doc.querySelectorAll('[style*=mso-list]'));\n const ignored: Element[] = [];\n const others: Element[] = [];\n msoList.forEach((node) => {\n const shouldIgnore = (node.getAttribute('style') || '').match(ignoreRegexp);\n if (shouldIgnore) {\n ignored.push(node);\n } else {\n others.push(node);\n }\n });\n\n // Each list item contains a marker wrapped with \"mso-list: Ignore\".\n ignored.forEach((node) => node.parentNode?.removeChild(node));\n\n // The list stype is not defined inline with the tag, instead, it's in the\n // style tag so we need to pass the html as a string.\n const html = doc.documentElement.innerHTML;\n const listItems = others\n .map((element) => parseListItem(element, html))\n .filter((parsed) => parsed);\n\n while (listItems.length) {\n const childListItems = [];\n\n let current = listItems.shift();\n // Group continuous items into the same group (aka \"ul\")\n while (current) {\n childListItems.push(current);\n current =\n listItems.length &&\n listItems[0]?.element === current.element.nextElementSibling &&\n // Different id means the next item doesn't belong to this group.\n listItems[0].id === current.id\n ? listItems.shift()\n : null;\n }\n\n const ul = document.createElement('ul');\n childListItems.forEach((listItem) => {\n const li = document.createElement('li');\n li.setAttribute('data-list', listItem.type);\n if (listItem.indent > 1) {\n li.setAttribute('class', `ql-indent-${listItem.indent - 1}`);\n }\n li.innerHTML = listItem.element.innerHTML;\n ul.appendChild(li);\n });\n\n const element = childListItems[0]?.element;\n const { parentNode } = element ?? {};\n if (element) {\n parentNode?.replaceChild(ul, element);\n }\n childListItems.slice(1).forEach(({ element: e }) => {\n parentNode?.removeChild(e);\n });\n }\n};\n\nexport default function normalize(doc: Document) {\n if (\n doc.documentElement.getAttribute('xmlns:w') ===\n 'urn:schemas-microsoft-com:office:word'\n ) {\n normalizeListItem(doc);\n }\n}\n","import googleDocs from './normalizers/googleDocs.js';\nimport msWord from './normalizers/msWord.js';\n\nconst NORMALIZERS = [msWord, googleDocs];\n\nconst normalizeExternalHTML = (doc: Document) => {\n if (doc.documentElement) {\n NORMALIZERS.forEach((normalize) => {\n normalize(doc);\n });\n }\n};\n\nexport default normalizeExternalHTML;\n","import type { ScrollBlot } from 'parchment';\nimport {\n Attributor,\n BlockBlot,\n ClassAttributor,\n EmbedBlot,\n Scope,\n StyleAttributor,\n} from 'parchment';\nimport Delta from 'quill-delta';\nimport { BlockEmbed } from '../blots/block.js';\nimport type { EmitterSource } from '../core/emitter.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type { Range } from '../core/selection.js';\nimport { AlignAttribute, AlignStyle } from '../formats/align.js';\nimport { BackgroundStyle } from '../formats/background.js';\nimport CodeBlock from '../formats/code.js';\nimport { ColorStyle } from '../formats/color.js';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction.js';\nimport { FontStyle } from '../formats/font.js';\nimport { SizeStyle } from '../formats/size.js';\nimport { deleteRange } from './keyboard.js';\nimport normalizeExternalHTML from './normalizeExternalHTML/index.js';\n\nconst debug = logger('quill:clipboard');\n\ntype Selector = string | Node['TEXT_NODE'] | Node['ELEMENT_NODE'];\ntype Matcher = (node: Node, delta: Delta, scroll: ScrollBlot) => Delta;\n\nconst CLIPBOARD_CONFIG: [Selector, Matcher][] = [\n [Node.TEXT_NODE, matchText],\n [Node.TEXT_NODE, matchNewline],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['li', matchIndent],\n ['ol, ul', matchList],\n ['pre', matchCodeBlock],\n ['tr', matchTable],\n ['b', createMatchAlias('bold')],\n ['i', createMatchAlias('italic')],\n ['strike', createMatchAlias('strike')],\n ['style', matchIgnore],\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [AlignAttribute, DirectionAttribute].reduce(\n (memo: Record, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n },\n {},\n);\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle,\n].reduce((memo: Record, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\ninterface ClipboardOptions {\n matchers: [Selector, Matcher][];\n}\n\nclass Clipboard extends Module {\n static DEFAULTS: ClipboardOptions;\n\n matchers: [Selector, Matcher][];\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.quill.root.addEventListener('copy', (e) =>\n this.onCaptureCopy(e, false),\n );\n this.quill.root.addEventListener('cut', (e) => this.onCaptureCopy(e, true));\n this.quill.root.addEventListener('paste', this.onCapturePaste.bind(this));\n this.matchers = [];\n // @ts-expect-error Fix me later\n CLIPBOARD_CONFIG.concat(this.options.matchers).forEach(\n ([selector, matcher]) => {\n this.addMatcher(selector, matcher);\n },\n );\n }\n\n addMatcher(selector: Selector, matcher: Matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert(\n { html, text }: { html?: string; text?: string },\n formats: Record = {},\n ) {\n if (formats[CodeBlock.blotName]) {\n return new Delta().insert(text || '', {\n [CodeBlock.blotName]: formats[CodeBlock.blotName],\n });\n }\n if (!html) {\n return new Delta().insert(text || '', formats);\n }\n const delta = this.convertHTML(html);\n // Remove trailing newline\n if (\n deltaEndsWith(delta, '\\n') &&\n (delta.ops[delta.ops.length - 1].attributes == null || formats.table)\n ) {\n return delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n return delta;\n }\n\n protected normalizeHTML(doc: Document) {\n normalizeExternalHTML(doc);\n }\n\n protected convertHTML(html: string) {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n this.normalizeHTML(doc);\n const container = doc.body;\n const nodeMatches = new WeakMap();\n const [elementMatchers, textMatchers] = this.prepareMatching(\n container,\n nodeMatches,\n );\n return traverse(\n this.quill.scroll,\n container,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n }\n\n dangerouslyPasteHTML(html: string, source?: EmitterSource): void;\n dangerouslyPasteHTML(\n index: number,\n html: string,\n source?: EmitterSource,\n ): void;\n dangerouslyPasteHTML(\n index: number | string,\n html?: string,\n source: EmitterSource = Quill.sources.API,\n ) {\n if (typeof index === 'string') {\n const delta = this.convert({ html: index, text: '' });\n // @ts-expect-error\n this.quill.setContents(delta, html);\n this.quill.setSelection(0, Quill.sources.SILENT);\n } else {\n const paste = this.convert({ html, text: '' });\n this.quill.updateContents(\n new Delta().retain(index).concat(paste),\n source,\n );\n this.quill.setSelection(index + paste.length(), Quill.sources.SILENT);\n }\n }\n\n onCaptureCopy(e: ClipboardEvent, isCut = false) {\n if (e.defaultPrevented) return;\n e.preventDefault();\n const [range] = this.quill.selection.getRange();\n if (range == null) return;\n const { html, text } = this.onCopy(range, isCut);\n e.clipboardData?.setData('text/plain', text);\n e.clipboardData?.setData('text/html', html);\n if (isCut) {\n deleteRange({ range, quill: this.quill });\n }\n }\n\n onCapturePaste(e: ClipboardEvent) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n e.preventDefault();\n const range = this.quill.getSelection(true);\n if (range == null) return;\n const html = e.clipboardData?.getData('text/html');\n const text = e.clipboardData?.getData('text/plain');\n const files = Array.from(e.clipboardData?.files || []);\n if (!html && files.length > 0) {\n this.quill.uploader.upload(range, files);\n return;\n }\n if (html && files.length > 0) {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n if (\n doc.body.childElementCount === 1 &&\n doc.body.firstElementChild?.tagName === 'IMG'\n ) {\n this.quill.uploader.upload(range, files);\n return;\n }\n }\n this.onPaste(range, { html, text });\n }\n\n onCopy(range: Range, isCut: boolean): { html: string; text: string };\n onCopy(range: Range) {\n const text = this.quill.getText(range);\n const html = this.quill.getSemanticHTML(range);\n return { html, text };\n }\n\n onPaste(range: Range, { text, html }: { text?: string; html?: string }) {\n const formats = this.quill.getFormat(range.index);\n const pastedDelta = this.convert({ text, html }, formats);\n debug.log('onPaste', pastedDelta, { text, html });\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .concat(pastedDelta);\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(\n delta.length() - range.length,\n Quill.sources.SILENT,\n );\n this.quill.scrollSelectionIntoView();\n }\n\n prepareMatching(container: Element, nodeMatches: WeakMap) {\n const elementMatchers: Matcher[] = [];\n const textMatchers: Matcher[] = [];\n this.matchers.forEach((pair) => {\n const [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n Array.from(container.querySelectorAll(selector)).forEach((node) => {\n if (nodeMatches.has(node)) {\n const matches = nodeMatches.get(node);\n matches?.push(matcher);\n } else {\n nodeMatches.set(node, [matcher]);\n }\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n}\nClipboard.DEFAULTS = {\n matchers: [],\n};\n\nfunction applyFormat(\n delta: Delta,\n format: string,\n value: unknown,\n scroll: ScrollBlot,\n): Delta {\n if (!scroll.query(format)) {\n return delta;\n }\n\n return delta.reduce((newDelta, op) => {\n if (op.attributes && op.attributes[format]) {\n return newDelta.push(op);\n }\n const formats = value ? { [format]: value } : {};\n // @ts-expect-error Fix me later\n return newDelta.insert(op.insert, { ...formats, ...op.attributes });\n }, new Delta());\n}\n\nfunction deltaEndsWith(delta: Delta, text: string) {\n let endText = '';\n for (\n let i = delta.ops.length - 1;\n i >= 0 && endText.length < text.length;\n --i // eslint-disable-line no-plusplus\n ) {\n const op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1 * text.length) === text;\n}\n\nfunction isLine(node: Node, scroll: ScrollBlot) {\n if (!(node instanceof Element)) return false;\n const match = scroll.query(node);\n // @ts-expect-error\n if (match && match.prototype instanceof EmbedBlot) return false;\n\n return [\n 'address',\n 'article',\n 'blockquote',\n 'canvas',\n 'dd',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'iframe',\n 'li',\n 'main',\n 'nav',\n 'ol',\n 'output',\n 'p',\n 'pre',\n 'section',\n 'table',\n 'td',\n 'tr',\n 'ul',\n 'video',\n ].includes(node.tagName.toLowerCase());\n}\n\nfunction isBetweenInlineElements(node: HTMLElement, scroll: ScrollBlot) {\n return (\n node.previousElementSibling &&\n node.nextElementSibling &&\n !isLine(node.previousElementSibling, scroll) &&\n !isLine(node.nextElementSibling, scroll)\n );\n}\n\nconst preNodes = new WeakMap();\nfunction isPre(node: Node | null) {\n if (node == null) return false;\n if (!preNodes.has(node)) {\n // @ts-expect-error\n if (node.tagName === 'PRE') {\n preNodes.set(node, true);\n } else {\n preNodes.set(node, isPre(node.parentNode));\n }\n }\n return preNodes.get(node);\n}\n\nfunction traverse(\n scroll: ScrollBlot,\n node: ChildNode,\n elementMatchers: Matcher[],\n textMatchers: Matcher[],\n nodeMatches: WeakMap,\n): Delta {\n // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce((delta: Delta, matcher) => {\n return matcher(node, delta, scroll);\n }, new Delta());\n }\n if (node.nodeType === node.ELEMENT_NODE) {\n return Array.from(node.childNodes || []).reduce((delta, childNode) => {\n let childrenDelta = traverse(\n scroll,\n childNode,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce((reducedDelta, matcher) => {\n return matcher(childNode as HTMLElement, reducedDelta, scroll);\n }, childrenDelta);\n childrenDelta = (nodeMatches.get(childNode) || []).reduce(\n (reducedDelta, matcher) => {\n return matcher(childNode, reducedDelta, scroll);\n },\n childrenDelta,\n );\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n }\n return new Delta();\n}\n\nfunction createMatchAlias(format: string) {\n return (_node: Element, delta: Delta, scroll: ScrollBlot) => {\n return applyFormat(delta, format, true, scroll);\n };\n}\n\nfunction matchAttributor(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n const attributes = Attributor.keys(node);\n const classes = ClassAttributor.keys(node);\n const styles = StyleAttributor.keys(node);\n const formats: Record = {};\n attributes\n .concat(classes)\n .concat(styles)\n .forEach((name) => {\n let attr = scroll.query(name, Scope.ATTRIBUTE) as Attributor;\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n\n return Object.entries(formats).reduce(\n (newDelta, [name, value]) => applyFormat(newDelta, name, value, scroll),\n delta,\n );\n}\n\nfunction matchBlot(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query(node);\n if (match == null) return delta;\n // @ts-expect-error\n if (match.prototype instanceof EmbedBlot) {\n const embed = {};\n // @ts-expect-error\n const value = match.value(node);\n if (value != null) {\n // @ts-expect-error\n embed[match.blotName] = value;\n // @ts-expect-error\n return new Delta().insert(embed, match.formats(node, scroll));\n }\n } else {\n // @ts-expect-error\n if (match.prototype instanceof BlockBlot && !deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n if (\n 'blotName' in match &&\n 'formats' in match &&\n typeof match.formats === 'function'\n ) {\n return applyFormat(\n delta,\n match.blotName,\n match.formats(node, scroll),\n scroll,\n );\n }\n }\n return delta;\n}\n\nfunction matchBreak(node: Node, delta: Delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchCodeBlock(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query('code-block');\n const language =\n match && 'formats' in match && typeof match.formats === 'function'\n ? match.formats(node, scroll)\n : true;\n return applyFormat(delta, 'code-block', language, scroll);\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchIndent(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query(node);\n if (\n match == null ||\n // @ts-expect-error\n match.blotName !== 'list' ||\n !deltaEndsWith(delta, '\\n')\n ) {\n return delta;\n }\n let indent = -1;\n let parent = node.parentNode;\n while (parent != null) {\n // @ts-expect-error\n if (['OL', 'UL'].includes(parent.tagName)) {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.reduce((composed, op) => {\n if (op.attributes && typeof op.attributes.indent === 'number') {\n return composed.push(op);\n }\n // @ts-expect-error Fix me later\n return composed.insert(op.insert, { indent, ...(op.attributes || {}) });\n }, new Delta());\n}\n\nfunction matchList(node: Node, delta: Delta, scroll: ScrollBlot) {\n // @ts-expect-error\n const list = node.tagName === 'OL' ? 'ordered' : 'bullet';\n return applyFormat(delta, 'list', list, scroll);\n}\n\nfunction matchNewline(node: Node, delta: Delta, scroll: ScrollBlot) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (\n isLine(node, scroll) &&\n (node.childNodes.length > 0 || node instanceof HTMLParagraphElement)\n ) {\n return delta.insert('\\n');\n }\n if (delta.length() > 0 && node.nextSibling) {\n let nextSibling: Node | null = node.nextSibling;\n while (nextSibling != null) {\n if (isLine(nextSibling, scroll)) {\n return delta.insert('\\n');\n }\n const match = scroll.query(nextSibling);\n // @ts-expect-error\n if (match && match.prototype instanceof BlockEmbed) {\n return delta.insert('\\n');\n }\n nextSibling = nextSibling.firstChild;\n }\n }\n }\n return delta;\n}\n\nfunction matchStyles(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n const formats: Record = {};\n const style: Partial = node.style || {};\n if (style.fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.textDecoration === 'underline') {\n formats.underline = true;\n }\n if (style.textDecoration === 'line-through') {\n formats.strike = true;\n }\n if (\n style.fontWeight?.startsWith('bold') ||\n // @ts-expect-error Fix me later\n parseInt(style.fontWeight, 10) >= 700\n ) {\n formats.bold = true;\n }\n delta = Object.entries(formats).reduce(\n (newDelta, [name, value]) => applyFormat(newDelta, name, value, scroll),\n delta,\n );\n // @ts-expect-error\n if (parseFloat(style.textIndent || 0) > 0) {\n // Could be 0.5in\n return new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchTable(\n node: HTMLTableRowElement,\n delta: Delta,\n scroll: ScrollBlot,\n) {\n const table =\n node.parentElement?.tagName === 'TABLE'\n ? node.parentElement\n : node.parentElement?.parentElement;\n if (table != null) {\n const rows = Array.from(table.querySelectorAll('tr'));\n const row = rows.indexOf(node) + 1;\n return applyFormat(delta, 'table', row, scroll);\n }\n return delta;\n}\n\nfunction matchText(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n // @ts-expect-error\n let text = node.data;\n // Word represents empty line with  \n if (node.parentElement?.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (!isPre(node)) {\n if (\n text.trim().length === 0 &&\n text.includes('\\n') &&\n !isBetweenInlineElements(node, scroll)\n ) {\n return delta;\n }\n const replacer = (collapse: unknown, match: string) => {\n const replaced = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return replaced.length < 1 && collapse ? ' ' : replaced;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if (\n (node.previousSibling == null &&\n node.parentElement != null &&\n isLine(node.parentElement, scroll)) ||\n (node.previousSibling instanceof Element &&\n isLine(node.previousSibling, scroll))\n ) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if (\n (node.nextSibling == null &&\n node.parentElement != null &&\n isLine(node.parentElement, scroll)) ||\n (node.nextSibling instanceof Element && isLine(node.nextSibling, scroll))\n ) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\nexport {\n Clipboard as default,\n matchAttributor,\n matchBlot,\n matchNewline,\n matchText,\n traverse,\n};\n","import { cloneDeep, isEqual } from 'lodash-es';\nimport Delta, { AttributeMap } from 'quill-delta';\nimport { EmbedBlot, Scope, TextBlot } from 'parchment';\nimport type { Blot, BlockBlot } from 'parchment';\nimport Quill from '../core/quill.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport type { BlockEmbed } from '../blots/block.js';\nimport type { Range } from '../core/selection.js';\n\nconst debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\nexport interface Context {\n collapsed: boolean;\n empty: boolean;\n offset: number;\n prefix: string;\n suffix: string;\n format: Record;\n event: KeyboardEvent;\n line: BlockEmbed | BlockBlot;\n}\n\ninterface BindingObject\n extends Partial> {\n key: number | string | string[];\n shortKey?: boolean | null;\n shiftKey?: boolean | null;\n altKey?: boolean | null;\n metaKey?: boolean | null;\n ctrlKey?: boolean | null;\n prefix?: RegExp;\n suffix?: RegExp;\n format?: Record | string[];\n handler?: (\n this: { quill: Quill },\n range: Range,\n curContext: Context,\n // eslint-disable-next-line no-use-before-define\n binding: NormalizedBinding,\n ) => boolean | void;\n}\n\ntype Binding = BindingObject | string | number;\n\ninterface NormalizedBinding extends Omit {\n key: string | number;\n}\n\ninterface KeyboardOptions {\n bindings: Record;\n}\n\ninterface KeyboardOptions {\n bindings: Record;\n}\n\nclass Keyboard extends Module {\n static DEFAULTS: KeyboardOptions;\n\n static match(evt: KeyboardEvent, binding: BindingObject) {\n if (\n (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'] as const).some((key) => {\n return !!binding[key] !== evt[key] && binding[key] !== null;\n })\n ) {\n return false;\n }\n return binding.key === evt.key || binding.key === evt.which;\n }\n\n bindings: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.bindings = {};\n // @ts-expect-error Fix me later\n Object.keys(this.options.bindings).forEach((name) => {\n // @ts-expect-error Fix me later\n if (this.options.bindings[name]) {\n // @ts-expect-error Fix me later\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: 'Enter', shiftKey: null }, this.handleEnter);\n this.addBinding(\n { key: 'Enter', metaKey: null, ctrlKey: null, altKey: null },\n () => {},\n );\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true },\n this.handleDelete,\n );\n } else {\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true, prefix: /^.?$/ },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true, suffix: /^.?$/ },\n this.handleDelete,\n );\n }\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n {\n key: 'Backspace',\n altKey: null,\n ctrlKey: null,\n metaKey: null,\n shiftKey: null,\n },\n { collapsed: true, offset: 0 },\n this.handleBackspace,\n );\n this.listen();\n }\n\n addBinding(\n keyBinding: Binding,\n context:\n | Required\n | Partial> = {},\n handler:\n | Required\n | Partial> = {},\n ) {\n const binding = normalize(keyBinding);\n if (binding == null) {\n debug.warn('Attempted to add invalid keyboard binding', binding);\n return;\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler };\n }\n const keys = Array.isArray(binding.key) ? binding.key : [binding.key];\n keys.forEach((key) => {\n const singleBinding = {\n ...binding,\n key,\n ...context,\n ...handler,\n };\n this.bindings[singleBinding.key] = this.bindings[singleBinding.key] || [];\n this.bindings[singleBinding.key].push(singleBinding);\n });\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', (evt) => {\n if (evt.defaultPrevented || evt.isComposing) return;\n const bindings = (this.bindings[evt.key] || []).concat(\n this.bindings[evt.which] || [],\n );\n const matches = bindings.filter((binding) =>\n Keyboard.match(evt, binding),\n );\n if (matches.length === 0) return;\n // @ts-expect-error\n const blot = Quill.find(evt.target, true);\n if (blot && blot.scroll !== this.quill.scroll) return;\n const range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n const [line, offset] = this.quill.getLine(range.index);\n const [leafStart, offsetStart] = this.quill.getLeaf(range.index);\n const [leafEnd, offsetEnd] =\n range.length === 0\n ? [leafStart, offsetStart]\n : this.quill.getLeaf(range.index + range.length);\n const prefixText =\n leafStart instanceof TextBlot\n ? leafStart.value().slice(0, offsetStart)\n : '';\n const suffixText =\n leafEnd instanceof TextBlot ? leafEnd.value().slice(offsetEnd) : '';\n const curContext = {\n collapsed: range.length === 0,\n // @ts-expect-error Fix me later\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n line,\n offset,\n prefix: prefixText,\n suffix: suffixText,\n event: evt,\n };\n const prevented = matches.some((binding) => {\n if (\n binding.collapsed != null &&\n binding.collapsed !== curContext.collapsed\n ) {\n return false;\n }\n if (binding.empty != null && binding.empty !== curContext.empty) {\n return false;\n }\n if (binding.offset != null && binding.offset !== curContext.offset) {\n return false;\n }\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every((name) => curContext.format[name] == null)) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (\n !Object.keys(binding.format).every((name) => {\n // @ts-expect-error Fix me later\n if (binding.format[name] === true)\n return curContext.format[name] != null;\n // @ts-expect-error Fix me later\n if (binding.format[name] === false)\n return curContext.format[name] == null;\n // @ts-expect-error Fix me later\n return isEqual(binding.format[name], curContext.format[name]);\n })\n ) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) {\n return false;\n }\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) {\n return false;\n }\n // @ts-expect-error Fix me later\n return binding.handler.call(this, range, curContext, binding) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n\n handleBackspace(range: Range, context: Context) {\n // Check for astral symbols\n const length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix)\n ? 2\n : 1;\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index - length).delete(length);\n if (context.offset === 0) {\n // Always deleting newline here, length always 1\n const [prev] = this.quill.getLine(range.index - 1);\n if (prev) {\n const isPrevLineEmpty =\n prev.statics.blotName === 'block' && prev.length() <= 1;\n if (!isPrevLineEmpty) {\n // @ts-expect-error Fix me later\n const curFormats = line.formats();\n const prevFormats = this.quill.getFormat(range.index - 1, 1);\n formats = AttributeMap.diff(curFormats, prevFormats) || {};\n if (Object.keys(formats).length > 0) {\n // line.length() - 1 targets \\n in line, another -1 for newline being deleted\n const formatDelta = new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index + line.length() - 2)\n .retain(1, formats);\n delta = delta.compose(formatDelta);\n }\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDelete(range: Range, context: Context) {\n // Check for astral symbols\n const length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix)\n ? 2\n : 1;\n if (range.index >= this.quill.getLength() - length) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index).delete(length);\n // @ts-expect-error Fix me later\n if (context.offset >= line.length() - 1) {\n const [next] = this.quill.getLine(range.index + 1);\n if (next) {\n // @ts-expect-error Fix me later\n const curFormats = line.formats();\n const nextFormats = this.quill.getFormat(range.index, 1);\n formats = AttributeMap.diff(curFormats, nextFormats) || {};\n if (Object.keys(formats).length > 0) {\n delta = delta.retain(next.length() - 1).retain(1, formats);\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDeleteRange(range: Range) {\n deleteRange({ range, quill: this.quill });\n this.quill.focus();\n }\n\n handleEnter(range: Range, context: Context) {\n const lineFormats = Object.keys(context.format).reduce(\n (formats: Record, format) => {\n if (\n this.quill.scroll.query(format, Scope.BLOCK) &&\n !Array.isArray(context.format[format])\n ) {\n formats[format] = context.format[format];\n }\n return formats;\n },\n {},\n );\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\n', lineFormats);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.focus();\n }\n}\n\nconst defaultOptions: KeyboardOptions = {\n bindings: {\n bold: makeFormatHandler('bold'),\n italic: makeFormatHandler('italic'),\n underline: makeFormatHandler('underline'),\n indent: {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: 'Tab',\n format: ['blockquote', 'indent', 'list'],\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n return false;\n },\n },\n outdent: {\n key: 'Tab',\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n return false;\n },\n },\n 'outdent backspace': {\n key: 'Backspace',\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n },\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: 'Tab',\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n },\n },\n tab: {\n key: 'Tab',\n handler(range, context) {\n if (context.format.table) return true;\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\t');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n return false;\n },\n },\n 'blockquote empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['blockquote'],\n empty: true,\n handler() {\n this.quill.format('blockquote', false, Quill.sources.USER);\n },\n },\n 'list empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['list'],\n empty: true,\n handler(range, context) {\n const formats: Record = { list: false };\n if (context.format.indent) {\n formats.indent = false;\n }\n this.quill.formatLine(\n range.index,\n range.length,\n formats,\n Quill.sources.USER,\n );\n },\n },\n 'checklist enter': {\n key: 'Enter',\n collapsed: true,\n format: { list: 'checked' },\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n const formats = {\n // @ts-expect-error Fix me later\n ...line.formats(),\n list: 'checked',\n };\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', formats)\n // @ts-expect-error Fix me later\n .retain(line.length() - offset - 1)\n .retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollSelectionIntoView();\n },\n },\n 'header enter': {\n key: 'Enter',\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler(range, context) {\n const [line, offset] = this.quill.getLine(range.index);\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', context.format)\n // @ts-expect-error Fix me later\n .retain(line.length() - offset - 1)\n .retain(1, { header: null });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollSelectionIntoView();\n },\n },\n 'table backspace': {\n key: 'Backspace',\n format: ['table'],\n collapsed: true,\n offset: 0,\n handler() {},\n },\n 'table delete': {\n key: 'Delete',\n format: ['table'],\n collapsed: true,\n suffix: /^$/,\n handler() {},\n },\n 'table enter': {\n key: 'Enter',\n shiftKey: null,\n format: ['table'],\n handler(range) {\n const module = this.quill.getModule('table');\n if (module) {\n // @ts-expect-error\n const [table, row, cell, offset] = module.getTable(range);\n const shift = tableSide(table, row, cell, offset);\n if (shift == null) return;\n let index = table.offset();\n if (shift < 0) {\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(\n range.index + 1,\n range.length,\n Quill.sources.SILENT,\n );\n } else if (shift > 0) {\n index += table.length();\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(index, Quill.sources.USER);\n }\n }\n },\n },\n 'table tab': {\n key: 'Tab',\n shiftKey: null,\n format: ['table'],\n handler(range, context) {\n const { event, line: cell } = context;\n const offset = cell.offset(this.quill.scroll);\n if (event.shiftKey) {\n this.quill.setSelection(offset - 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(offset + cell.length(), Quill.sources.USER);\n }\n },\n },\n 'list autofill': {\n key: ' ',\n shiftKey: null,\n collapsed: true,\n format: {\n 'code-block': false,\n blockquote: false,\n table: false,\n },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler(range, context) {\n if (this.quill.scroll.query('list') == null) return true;\n const { length } = context.prefix;\n const [line, offset] = this.quill.getLine(range.index);\n if (offset > length) return true;\n let value;\n switch (context.prefix.trim()) {\n case '[]':\n case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-':\n case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', Quill.sources.USER);\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index - offset)\n .delete(length + 1)\n // @ts-expect-error Fix me later\n .retain(line.length() - 2 - offset)\n .retain(1, { list: value });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n return false;\n },\n },\n 'code exit': {\n key: 'Enter',\n collapsed: true,\n format: ['code-block'],\n prefix: /^$/,\n suffix: /^\\s*$/,\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n let numLines = 2;\n let cur = line;\n while (\n cur != null &&\n cur.length() <= 1 &&\n cur.formats()['code-block']\n ) {\n // @ts-expect-error\n cur = cur.prev;\n numLines -= 1;\n // Requisite prev lines are empty\n if (numLines <= 0) {\n const delta = new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index + line.length() - offset - 2)\n .retain(1, { 'code-block': null })\n .delete(1);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index - 1, Quill.sources.SILENT);\n return false;\n }\n }\n return true;\n },\n },\n 'embed left': makeEmbedArrowHandler('ArrowLeft', false),\n 'embed left shift': makeEmbedArrowHandler('ArrowLeft', true),\n 'embed right': makeEmbedArrowHandler('ArrowRight', false),\n 'embed right shift': makeEmbedArrowHandler('ArrowRight', true),\n 'table down': makeTableArrowHandler(false),\n 'table up': makeTableArrowHandler(true),\n },\n};\n\nKeyboard.DEFAULTS = defaultOptions;\n\nfunction makeCodeBlockHandler(indent: boolean): BindingObject {\n return {\n key: 'Tab',\n shiftKey: !indent,\n format: { 'code-block': true },\n handler(range, { event }) {\n const CodeBlock = this.quill.scroll.query('code-block');\n // @ts-expect-error\n const { TAB } = CodeBlock;\n if (range.length === 0 && !event.shiftKey) {\n this.quill.insertText(range.index, TAB, Quill.sources.USER);\n this.quill.setSelection(range.index + TAB.length, Quill.sources.SILENT);\n return;\n }\n\n const lines =\n range.length === 0\n ? this.quill.getLines(range.index, 1)\n : this.quill.getLines(range);\n let { index, length } = range;\n lines.forEach((line, i) => {\n if (indent) {\n line.insertAt(0, TAB);\n if (i === 0) {\n index += TAB.length;\n } else {\n length += TAB.length;\n }\n // @ts-expect-error Fix me later\n } else if (line.domNode.textContent.startsWith(TAB)) {\n line.deleteAt(0, TAB.length);\n if (i === 0) {\n index -= TAB.length;\n } else {\n length -= TAB.length;\n }\n }\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n },\n };\n}\n\nfunction makeEmbedArrowHandler(\n key: string,\n shiftKey: boolean | null,\n): BindingObject {\n const where = key === 'ArrowLeft' ? 'prefix' : 'suffix';\n return {\n key,\n shiftKey,\n altKey: null,\n [where]: /^$/,\n handler(range) {\n let { index } = range;\n if (key === 'ArrowRight') {\n index += range.length + 1;\n }\n const [leaf] = this.quill.getLeaf(index);\n if (!(leaf instanceof EmbedBlot)) return true;\n if (key === 'ArrowLeft') {\n if (shiftKey) {\n this.quill.setSelection(\n range.index - 1,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(range.index - 1, Quill.sources.USER);\n }\n } else if (shiftKey) {\n this.quill.setSelection(\n range.index,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n range.index + range.length + 1,\n Quill.sources.USER,\n );\n }\n return false;\n },\n };\n}\n\nfunction makeFormatHandler(format: string): BindingObject {\n return {\n key: format[0],\n shortKey: true,\n handler(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n },\n };\n}\n\nfunction makeTableArrowHandler(up: boolean): BindingObject {\n return {\n key: up ? 'ArrowUp' : 'ArrowDown',\n collapsed: true,\n format: ['table'],\n handler(range, context) {\n // TODO move to table module\n const key = up ? 'prev' : 'next';\n const cell = context.line;\n const targetRow = cell.parent[key];\n if (targetRow != null) {\n if (targetRow.statics.blotName === 'table-row') {\n // @ts-expect-error\n let targetCell = targetRow.children.head;\n let cur = cell;\n while (cur.prev != null) {\n // @ts-expect-error\n cur = cur.prev;\n targetCell = targetCell.next;\n }\n const index =\n targetCell.offset(this.quill.scroll) +\n Math.min(context.offset, targetCell.length() - 1);\n this.quill.setSelection(index, 0, Quill.sources.USER);\n }\n } else {\n // @ts-expect-error\n const targetLine = cell.table()[key];\n if (targetLine != null) {\n if (up) {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll) + targetLine.length() - 1,\n 0,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll),\n 0,\n Quill.sources.USER,\n );\n }\n }\n }\n return false;\n },\n };\n}\n\nfunction normalize(binding: Binding): BindingObject | null {\n if (typeof binding === 'string' || typeof binding === 'number') {\n binding = { key: binding };\n } else if (typeof binding === 'object') {\n binding = cloneDeep(binding);\n } else {\n return null;\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\n// TODO: Move into quill.ts or editor.ts\nfunction deleteRange({ quill, range }: { quill: Quill; range: Range }) {\n const lines = quill.getLines(range);\n let formats = {};\n if (lines.length > 1) {\n const firstFormats = lines[0].formats();\n const lastFormats = lines[lines.length - 1].formats();\n formats = AttributeMap.diff(lastFormats, firstFormats) || {};\n }\n quill.deleteText(range, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n quill.formatLine(range.index, 1, formats, Quill.sources.USER);\n }\n quill.setSelection(range.index, Quill.sources.SILENT);\n}\n\nfunction tableSide(_table: unknown, row: Blot, cell: Blot, offset: number) {\n if (row.prev == null && row.next == null) {\n if (cell.prev == null && cell.next == null) {\n return offset === 0 ? -1 : 1;\n }\n return cell.prev == null ? -1 : 1;\n }\n if (row.prev == null) {\n return -1;\n }\n if (row.next == null) {\n return 1;\n }\n return null;\n}\n\nexport { Keyboard as default, SHORTKEY, normalize, deleteRange };\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @param {boolean} [cleanup] Apply semantic cleanup before returning.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, cleanup, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n if (cleanup) {\n diff_cleanupSemantic(diffs);\n }\n return diffs;\n}\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)],\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [\n [DIFF_DELETE, text1],\n [DIFF_INSERT, text2],\n ];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n}\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = delta % 2 !== 0;\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length &&\n y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length &&\n y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ===\n text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [\n [DIFF_DELETE, text1],\n [DIFF_INSERT, text2],\n ];\n}\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n}\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n}\n\n/**\n * Determine if the suffix of one string is the prefix of another.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of the first\n * string and the start of the second string.\n * @private\n */\nfunction diff_commonOverlap_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n // Eliminate the null case.\n if (text1_length == 0 || text2_length == 0) {\n return 0;\n }\n // Truncate the longer string.\n if (text1_length > text2_length) {\n text1 = text1.substring(text1_length - text2_length);\n } else if (text1_length < text2_length) {\n text2 = text2.substring(0, text1_length);\n }\n var text_length = Math.min(text1_length, text2_length);\n // Quick check for the worst case.\n if (text1 == text2) {\n return text_length;\n }\n\n // Start by looking for a single character match\n // and increase length until no match is found.\n // Performance analysis: http://neil.fraser.name/news/2010/11/04/\n var best = 0;\n var length = 1;\n while (true) {\n var pattern = text1.substring(text_length - length);\n var found = text2.indexOf(pattern);\n if (found == -1) {\n return best;\n }\n length += found;\n if (\n found == 0 ||\n text1.substring(text_length - length) == text2.substring(0, length)\n ) {\n best = length;\n length++;\n }\n }\n}\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n}\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = \"\";\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i),\n shorttext.substring(j)\n );\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i),\n shorttext.substring(0, j)\n );\n if (best_common.length < suffixLength + prefixLength) {\n best_common =\n shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a,\n best_longtext_b,\n best_shorttext_a,\n best_shorttext_b,\n best_common,\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(\n longtext,\n shorttext,\n Math.ceil(longtext.length / 4)\n );\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(\n longtext,\n shorttext,\n Math.ceil(longtext.length / 2)\n );\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n}\n\n/**\n * Reduce the number of edits by eliminating semantically trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\nfunction diff_cleanupSemantic(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastequality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Number of characters that changed prior to the equality.\n var length_insertions1 = 0;\n var length_deletions1 = 0;\n // Number of characters that changed after the equality.\n var length_insertions2 = 0;\n var length_deletions2 = 0;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) {\n // Equality found.\n equalities[equalitiesLength++] = pointer;\n length_insertions1 = length_insertions2;\n length_deletions1 = length_deletions2;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = diffs[pointer][1];\n } else {\n // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_INSERT) {\n length_insertions2 += diffs[pointer][1].length;\n } else {\n length_deletions2 += diffs[pointer][1].length;\n }\n // Eliminate an equality that is smaller or equal to the edits on both\n // sides of it.\n if (\n lastequality &&\n lastequality.length <=\n Math.max(length_insertions1, length_deletions1) &&\n lastequality.length <= Math.max(length_insertions2, length_deletions2)\n ) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0, [\n DIFF_DELETE,\n lastequality,\n ]);\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n // Throw away the equality we just deleted.\n equalitiesLength--;\n // Throw away the previous equality (it needs to be reevaluated).\n equalitiesLength--;\n pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;\n length_insertions1 = 0; // Reset the counters.\n length_deletions1 = 0;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = null;\n changes = true;\n }\n }\n pointer++;\n }\n\n // Normalize the diff.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n diff_cleanupSemanticLossless(diffs);\n\n // Find any overlaps between deletions and insertions.\n // e.g: abcxxxxxxdef\n // -> abcxxxdef\n // e.g: xxxabcdefxxx\n // -> defxxxabc\n // Only extract an overlap if it is as big as the edit ahead or behind it.\n pointer = 1;\n while (pointer < diffs.length) {\n if (\n diffs[pointer - 1][0] == DIFF_DELETE &&\n diffs[pointer][0] == DIFF_INSERT\n ) {\n var deletion = diffs[pointer - 1][1];\n var insertion = diffs[pointer][1];\n var overlap_length1 = diff_commonOverlap_(deletion, insertion);\n var overlap_length2 = diff_commonOverlap_(insertion, deletion);\n if (overlap_length1 >= overlap_length2) {\n if (\n overlap_length1 >= deletion.length / 2 ||\n overlap_length1 >= insertion.length / 2\n ) {\n // Overlap found. Insert an equality and trim the surrounding edits.\n diffs.splice(pointer, 0, [\n DIFF_EQUAL,\n insertion.substring(0, overlap_length1),\n ]);\n diffs[pointer - 1][1] = deletion.substring(\n 0,\n deletion.length - overlap_length1\n );\n diffs[pointer + 1][1] = insertion.substring(overlap_length1);\n pointer++;\n }\n } else {\n if (\n overlap_length2 >= deletion.length / 2 ||\n overlap_length2 >= insertion.length / 2\n ) {\n // Reverse overlap found.\n // Insert an equality and swap and trim the surrounding edits.\n diffs.splice(pointer, 0, [\n DIFF_EQUAL,\n deletion.substring(0, overlap_length2),\n ]);\n diffs[pointer - 1][0] = DIFF_INSERT;\n diffs[pointer - 1][1] = insertion.substring(\n 0,\n insertion.length - overlap_length2\n );\n diffs[pointer + 1][0] = DIFF_DELETE;\n diffs[pointer + 1][1] = deletion.substring(overlap_length2);\n pointer++;\n }\n }\n pointer++;\n }\n pointer++;\n }\n}\n\nvar nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;\nvar whitespaceRegex_ = /\\s/;\nvar linebreakRegex_ = /[\\r\\n]/;\nvar blanklineEndRegex_ = /\\n\\r?\\n$/;\nvar blanklineStartRegex_ = /^\\r?\\n\\r?\\n/;\n\n/**\n * Look for single edits surrounded on both sides by equalities\n * which can be shifted sideways to align the edit to a word boundary.\n * e.g: The cat came. -> The cat came.\n * @param {!Array.} diffs Array of diff tuples.\n */\nfunction diff_cleanupSemanticLossless(diffs) {\n /**\n * Given two strings, compute a score representing whether the internal\n * boundary falls on logical boundaries.\n * Scores range from 6 (best) to 0 (worst).\n * Closure, but does not reference any external variables.\n * @param {string} one First string.\n * @param {string} two Second string.\n * @return {number} The score.\n * @private\n */\n function diff_cleanupSemanticScore_(one, two) {\n if (!one || !two) {\n // Edges are the best.\n return 6;\n }\n\n // Each port of this function behaves slightly differently due to\n // subtle differences in each language's definition of things like\n // 'whitespace'. Since this function's purpose is largely cosmetic,\n // the choice has been made to use each language's native features\n // rather than force total conformity.\n var char1 = one.charAt(one.length - 1);\n var char2 = two.charAt(0);\n var nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_);\n var nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_);\n var whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_);\n var whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_);\n var lineBreak1 = whitespace1 && char1.match(linebreakRegex_);\n var lineBreak2 = whitespace2 && char2.match(linebreakRegex_);\n var blankLine1 = lineBreak1 && one.match(blanklineEndRegex_);\n var blankLine2 = lineBreak2 && two.match(blanklineStartRegex_);\n\n if (blankLine1 || blankLine2) {\n // Five points for blank lines.\n return 5;\n } else if (lineBreak1 || lineBreak2) {\n // Four points for line breaks.\n return 4;\n } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {\n // Three points for end of sentences.\n return 3;\n } else if (whitespace1 || whitespace2) {\n // Two points for whitespace.\n return 2;\n } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {\n // One point for non-alphanumeric.\n return 1;\n }\n return 0;\n }\n\n var pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (\n diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL\n ) {\n // This is a single edit surrounded by equalities.\n var equality1 = diffs[pointer - 1][1];\n var edit = diffs[pointer][1];\n var equality2 = diffs[pointer + 1][1];\n\n // First, shift the edit as far left as possible.\n var commonOffset = diff_commonSuffix(equality1, edit);\n if (commonOffset) {\n var commonString = edit.substring(edit.length - commonOffset);\n equality1 = equality1.substring(0, equality1.length - commonOffset);\n edit = commonString + edit.substring(0, edit.length - commonOffset);\n equality2 = commonString + equality2;\n }\n\n // Second, step character by character right, looking for the best fit.\n var bestEquality1 = equality1;\n var bestEdit = edit;\n var bestEquality2 = equality2;\n var bestScore =\n diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n while (edit.charAt(0) === equality2.charAt(0)) {\n equality1 += edit.charAt(0);\n edit = edit.substring(1) + equality2.charAt(0);\n equality2 = equality2.substring(1);\n var score =\n diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n // The >= encourages trailing rather than leading whitespace on edits.\n if (score >= bestScore) {\n bestScore = score;\n bestEquality1 = equality1;\n bestEdit = edit;\n bestEquality2 = equality2;\n }\n }\n\n if (diffs[pointer - 1][1] != bestEquality1) {\n // We have an improvement, save it back to the diff.\n if (bestEquality1) {\n diffs[pointer - 1][1] = bestEquality1;\n } else {\n diffs.splice(pointer - 1, 1);\n pointer--;\n }\n diffs[pointer][1] = bestEdit;\n if (bestEquality2) {\n diffs[pointer + 1][1] = bestEquality2;\n } else {\n diffs.splice(pointer + 1, 1);\n pointer--;\n }\n }\n }\n pointer++;\n }\n}\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, \"\"]); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = \"\";\n var text_insert = \"\";\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (\n previous_equality >= 0 &&\n ends_with_pair_start(diffs[previous_equality][1])\n ) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(\n 0,\n -1\n );\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(\n 0,\n commonlength\n );\n } else {\n diffs.splice(0, 0, [\n DIFF_EQUAL,\n text_insert.substring(0, commonlength),\n ]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) +\n diffs[pointer][1];\n text_insert = text_insert.substring(\n 0,\n text_insert.length - commonlength\n );\n text_delete = text_delete.substring(\n 0,\n text_delete.length - commonlength\n );\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(\n pointer - n,\n n,\n [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]\n );\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = \"\";\n text_insert = \"\";\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === \"\") {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (\n diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL\n ) {\n // This is a single edit surrounded by equalities.\n if (\n diffs[pointer][1].substring(\n diffs[pointer][1].length - diffs[pointer - 1][1].length\n ) === diffs[pointer - 1][1]\n ) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] =\n diffs[pointer - 1][1] +\n diffs[pointer][1].substring(\n 0,\n diffs[pointer][1].length - diffs[pointer - 1][1].length\n );\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (\n diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]\n ) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n}\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xd800 && charCode <= 0xdbff;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xdc00 && charCode <= 0xdfff;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after],\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange =\n typeof cursor_pos === \"number\"\n ? { index: cursor_pos, length: 0 }\n : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === \"number\" ? null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos, cleanup) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, cleanup, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, true, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = cloneDeep;\n","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n","import cloneDeep = require('lodash.clonedeep');\nimport isEqual = require('lodash.isequal');\n\ninterface AttributeMap {\n [key: string]: unknown;\n}\n\nnamespace AttributeMap {\n export function compose(\n a: AttributeMap = {},\n b: AttributeMap = {},\n keepNull = false,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n let attributes = cloneDeep(b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce((copy, key) => {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (const key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function diff(\n a: AttributeMap = {},\n b: AttributeMap = {},\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n const attributes = Object.keys(a)\n .concat(Object.keys(b))\n .reduce((attrs, key) => {\n if (!isEqual(a[key], b[key])) {\n attrs[key] = b[key] === undefined ? null : b[key];\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function invert(\n attr: AttributeMap = {},\n base: AttributeMap = {},\n ): AttributeMap {\n attr = attr || {};\n const baseInverted = Object.keys(base).reduce((memo, key) => {\n if (base[key] !== attr[key] && attr[key] !== undefined) {\n memo[key] = base[key];\n }\n return memo;\n }, {});\n return Object.keys(attr).reduce((memo, key) => {\n if (attr[key] !== base[key] && base[key] === undefined) {\n memo[key] = null;\n }\n return memo;\n }, baseInverted);\n }\n\n export function transform(\n a: AttributeMap | undefined,\n b: AttributeMap | undefined,\n priority = false,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n return b;\n }\n if (typeof b !== 'object') {\n return undefined;\n }\n if (!priority) {\n return b; // b simply overwrites us without priority\n }\n const attributes = Object.keys(b).reduce((attrs, key) => {\n if (a[key] === undefined) {\n attrs[key] = b[key]; // null is a valid value\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n}\n\nexport default AttributeMap;\n","import * as diff from 'fast-diff';\nimport cloneDeep = require('lodash.clonedeep');\nimport isEqual = require('lodash.isequal');\nimport AttributeMap from './AttributeMap';\nimport Op from './Op';\nimport OpIterator from './OpIterator';\n\nconst NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\ninterface EmbedHandler {\n compose(a: T, b: T, keepNull: boolean): T;\n invert(a: T, b: T): T;\n transform(a: T, b: T, priority: boolean): T;\n}\n\nconst getEmbedTypeAndData = (\n a: Op['insert'] | Op['retain'],\n b: Op['insert'],\n): [string, unknown, unknown] => {\n if (typeof a !== 'object' || a === null) {\n throw new Error(`cannot retain a ${typeof a}`);\n }\n if (typeof b !== 'object' || b === null) {\n throw new Error(`cannot retain a ${typeof b}`);\n }\n const embedType = Object.keys(a)[0];\n if (!embedType || embedType !== Object.keys(b)[0]) {\n throw new Error(\n `embed types not matched: ${embedType} != ${Object.keys(b)[0]}`,\n );\n }\n return [embedType, a[embedType], b[embedType]];\n};\n\nclass Delta {\n static Op = Op;\n static OpIterator = OpIterator;\n static AttributeMap = AttributeMap;\n private static handlers: { [embedType: string]: EmbedHandler } = {};\n\n static registerEmbed(embedType: string, handler: EmbedHandler): void {\n this.handlers[embedType] = handler;\n }\n\n static unregisterEmbed(embedType: string): void {\n delete this.handlers[embedType];\n }\n\n private static getHandler(embedType: string): EmbedHandler {\n const handler = this.handlers[embedType];\n if (!handler) {\n throw new Error(`no handlers for embed type \"${embedType}\"`);\n }\n return handler;\n }\n\n ops: Op[];\n constructor(ops?: Op[] | { ops: Op[] }) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n }\n\n insert(\n arg: string | Record,\n attributes?: AttributeMap | null,\n ): this {\n const newOp: Op = {};\n if (typeof arg === 'string' && arg.length === 0) {\n return this;\n }\n newOp.insert = arg;\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n delete(length: number): this {\n if (length <= 0) {\n return this;\n }\n return this.push({ delete: length });\n }\n\n retain(\n length: number | Record,\n attributes?: AttributeMap | null,\n ): this {\n if (typeof length === 'number' && length <= 0) {\n return this;\n }\n const newOp: Op = { retain: length };\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n push(newOp: Op): this {\n let index = this.ops.length;\n let lastOp = this.ops[index - 1];\n newOp = cloneDeep(newOp);\n if (typeof lastOp === 'object') {\n if (\n typeof newOp.delete === 'number' &&\n typeof lastOp.delete === 'number'\n ) {\n this.ops[index - 1] = { delete: lastOp.delete + newOp.delete };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp.delete === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (isEqual(newOp.attributes, lastOp.attributes)) {\n if (\n typeof newOp.insert === 'string' &&\n typeof lastOp.insert === 'string'\n ) {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n } else if (\n typeof newOp.retain === 'number' &&\n typeof lastOp.retain === 'number'\n ) {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n }\n\n chop(): this {\n const lastOp = this.ops[this.ops.length - 1];\n if (lastOp && typeof lastOp.retain === 'number' && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n }\n\n filter(predicate: (op: Op, index: number) => boolean): Op[] {\n return this.ops.filter(predicate);\n }\n\n forEach(predicate: (op: Op, index: number) => void): void {\n this.ops.forEach(predicate);\n }\n\n map(predicate: (op: Op, index: number) => T): T[] {\n return this.ops.map(predicate);\n }\n\n partition(predicate: (op: Op) => boolean): [Op[], Op[]] {\n const passed: Op[] = [];\n const failed: Op[] = [];\n this.forEach((op) => {\n const target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n }\n\n reduce(\n predicate: (accum: T, curr: Op, index: number) => T,\n initialValue: T,\n ): T {\n return this.ops.reduce(predicate, initialValue);\n }\n\n changeLength(): number {\n return this.reduce((length, elem) => {\n if (elem.insert) {\n return length + Op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n }\n\n length(): number {\n return this.reduce((length, elem) => {\n return length + Op.length(elem);\n }, 0);\n }\n\n slice(start = 0, end = Infinity): Delta {\n const ops = [];\n const iter = new OpIterator(this.ops);\n let index = 0;\n while (index < end && iter.hasNext()) {\n let nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += Op.length(nextOp);\n }\n return new Delta(ops);\n }\n\n compose(other: Delta): Delta {\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n const ops = [];\n const firstOther = otherIter.peek();\n if (\n firstOther != null &&\n typeof firstOther.retain === 'number' &&\n firstOther.attributes == null\n ) {\n let firstLeft = firstOther.retain;\n while (\n thisIter.peekType() === 'insert' &&\n thisIter.peekLength() <= firstLeft\n ) {\n firstLeft -= thisIter.peekLength();\n ops.push(thisIter.next());\n }\n if (firstOther.retain - firstLeft > 0) {\n otherIter.next(firstOther.retain - firstLeft);\n }\n }\n const delta = new Delta(ops);\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (otherOp.retain) {\n const newOp: Op = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain =\n typeof otherOp.retain === 'number' ? length : otherOp.retain;\n } else {\n if (typeof otherOp.retain === 'number') {\n if (thisOp.retain == null) {\n newOp.insert = thisOp.insert;\n } else {\n newOp.retain = thisOp.retain;\n }\n } else {\n const action = thisOp.retain == null ? 'insert' : 'retain';\n const [embedType, thisData, otherData] = getEmbedTypeAndData(\n thisOp[action],\n otherOp.retain,\n );\n const handler = Delta.getHandler(embedType);\n newOp[action] = {\n [embedType]: handler.compose(\n thisData,\n otherData,\n action === 'retain',\n ),\n };\n }\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n const attributes = AttributeMap.compose(\n thisOp.attributes,\n otherOp.attributes,\n typeof thisOp.retain === 'number',\n );\n if (attributes) {\n newOp.attributes = attributes;\n }\n delta.push(newOp);\n\n // Optimization if rest of other is just retain\n if (\n !otherIter.hasNext() &&\n isEqual(delta.ops[delta.ops.length - 1], newOp)\n ) {\n const rest = new Delta(thisIter.rest());\n return delta.concat(rest).chop();\n }\n\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (\n typeof otherOp.delete === 'number' &&\n (typeof thisOp.retain === 'number' ||\n (typeof thisOp.retain === 'object' && thisOp.retain !== null))\n ) {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n }\n\n concat(other: Delta): Delta {\n const delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n }\n\n diff(other: Delta, cursor?: number | diff.CursorInfo): Delta {\n if (this.ops === other.ops) {\n return new Delta();\n }\n const strings = [this, other].map((delta) => {\n return delta\n .map((op) => {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n const prep = delta === other ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n })\n .join('');\n });\n const retDelta = new Delta();\n const diffResult = diff(strings[0], strings[1], cursor, true);\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n diffResult.forEach((component: diff.Diff) => {\n let length = component[1].length;\n while (length > 0) {\n let opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n retDelta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n retDelta.delete(opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(\n thisIter.peekLength(),\n otherIter.peekLength(),\n length,\n );\n const thisOp = thisIter.next(opLength);\n const otherOp = otherIter.next(opLength);\n if (isEqual(thisOp.insert, otherOp.insert)) {\n retDelta.retain(\n opLength,\n AttributeMap.diff(thisOp.attributes, otherOp.attributes),\n );\n } else {\n retDelta.push(otherOp).delete(opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return retDelta.chop();\n }\n\n eachLine(\n predicate: (\n line: Delta,\n attributes: AttributeMap,\n index: number,\n ) => boolean | void,\n newline = '\\n',\n ): void {\n const iter = new OpIterator(this.ops);\n let line = new Delta();\n let i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') {\n return;\n }\n const thisOp = iter.peek();\n const start = Op.length(thisOp) - iter.peekLength();\n const index =\n typeof thisOp.insert === 'string'\n ? thisOp.insert.indexOf(newline, start) - start\n : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n }\n\n invert(base: Delta): Delta {\n const inverted = new Delta();\n this.reduce((baseIndex, op) => {\n if (op.insert) {\n inverted.delete(Op.length(op));\n } else if (typeof op.retain === 'number' && op.attributes == null) {\n inverted.retain(op.retain);\n return baseIndex + op.retain;\n } else if (op.delete || typeof op.retain === 'number') {\n const length = (op.delete || op.retain) as number;\n const slice = base.slice(baseIndex, baseIndex + length);\n slice.forEach((baseOp) => {\n if (op.delete) {\n inverted.push(baseOp);\n } else if (op.retain && op.attributes) {\n inverted.retain(\n Op.length(baseOp),\n AttributeMap.invert(op.attributes, baseOp.attributes),\n );\n }\n });\n return baseIndex + length;\n } else if (typeof op.retain === 'object' && op.retain !== null) {\n const slice = base.slice(baseIndex, baseIndex + 1);\n const baseOp = new OpIterator(slice.ops).next();\n const [embedType, opData, baseOpData] = getEmbedTypeAndData(\n op.retain,\n baseOp.insert,\n );\n const handler = Delta.getHandler(embedType);\n inverted.retain(\n { [embedType]: handler.invert(opData, baseOpData) },\n AttributeMap.invert(op.attributes, baseOp.attributes),\n );\n return baseIndex + 1;\n }\n return baseIndex;\n }, 0);\n return inverted.chop();\n }\n\n transform(index: number, priority?: boolean): number;\n transform(other: Delta, priority?: boolean): Delta;\n transform(arg: number | Delta, priority = false): typeof arg {\n priority = !!priority;\n if (typeof arg === 'number') {\n return this.transformPosition(arg, priority);\n }\n const other: Delta = arg;\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n const delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (\n thisIter.peekType() === 'insert' &&\n (priority || otherIter.peekType() !== 'insert')\n ) {\n delta.retain(Op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (thisOp.delete) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp.delete) {\n delta.push(otherOp);\n } else {\n const thisData = thisOp.retain;\n const otherData = otherOp.retain;\n let transformedData: Op['retain'] =\n typeof otherData === 'object' && otherData !== null\n ? otherData\n : length;\n if (\n typeof thisData === 'object' &&\n thisData !== null &&\n typeof otherData === 'object' &&\n otherData !== null\n ) {\n const embedType = Object.keys(thisData)[0];\n if (embedType === Object.keys(otherData)[0]) {\n const handler = Delta.getHandler(embedType);\n if (handler) {\n transformedData = {\n [embedType]: handler.transform(\n thisData[embedType],\n otherData[embedType],\n priority,\n ),\n };\n }\n }\n }\n\n // We retain either their retain or insert\n delta.retain(\n transformedData,\n AttributeMap.transform(\n thisOp.attributes,\n otherOp.attributes,\n priority,\n ),\n );\n }\n }\n }\n return delta.chop();\n }\n\n transformPosition(index: number, priority = false): number {\n priority = !!priority;\n const thisIter = new OpIterator(this.ops);\n let offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n const length = thisIter.peekLength();\n const nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n }\n}\n\nexport default Delta;\n\nexport { Op, OpIterator, AttributeMap };\n\nif (typeof module === 'object') {\n module.exports = Delta;\n module.exports.default = Delta;\n}\n","import AttributeMap from './AttributeMap';\n\ninterface Op {\n // only one property out of {insert, delete, retain} will be present\n insert?: string | Record;\n delete?: number;\n retain?: number | Record;\n\n attributes?: AttributeMap;\n}\n\nnamespace Op {\n export function length(op: Op): number {\n if (typeof op.delete === 'number') {\n return op.delete;\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else if (typeof op.retain === 'object' && op.retain !== null) {\n return 1;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n}\n\nexport default Op;\n","import Op from './Op';\n\nexport default class Iterator {\n ops: Op[];\n index: number;\n offset: number;\n\n constructor(ops: Op[]) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n }\n\n hasNext(): boolean {\n return this.peekLength() < Infinity;\n }\n\n next(length?: number): Op {\n if (!length) {\n length = Infinity;\n }\n const nextOp = this.ops[this.index];\n if (nextOp) {\n const offset = this.offset;\n const opLength = Op.length(nextOp);\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp.delete === 'number') {\n return { delete: length };\n } else {\n const retOp: Op = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (\n typeof nextOp.retain === 'object' &&\n nextOp.retain !== null\n ) {\n // offset should === 0, length should === 1\n retOp.retain = nextOp.retain;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n }\n\n peek(): Op {\n return this.ops[this.index];\n }\n\n peekLength(): number {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return Op.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n }\n\n peekType(): string {\n const op = this.ops[this.index];\n if (op) {\n if (typeof op.delete === 'number') {\n return 'delete';\n } else if (\n typeof op.retain === 'number' ||\n (typeof op.retain === 'object' && op.retain !== null)\n ) {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n }\n\n rest(): Op[] {\n if (!this.hasNext()) {\n return [];\n } else if (this.offset === 0) {\n return this.ops.slice(this.index);\n } else {\n const offset = this.offset;\n const index = this.index;\n const next = this.next();\n const rest = this.ops.slice(this.index);\n this.offset = offset;\n this.index = index;\n return [next].concat(rest);\n }\n }\n}\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n","import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n","import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n","import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n","import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n","import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n","import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n","import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n","import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n","import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n","import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n","import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n","import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n","import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n","import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n","import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n","import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n","import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n","import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n","import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n","import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n","import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n","import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n","enum Scope {\n TYPE = (1 << 2) - 1, // 0011 Lower two bits\n LEVEL = ((1 << 2) - 1) << 2, // 1100 Higher two bits\n\n ATTRIBUTE = (1 << 0) | LEVEL, // 1101\n BLOT = (1 << 1) | LEVEL, // 1110\n INLINE = (1 << 2) | TYPE, // 0111\n BLOCK = (1 << 3) | TYPE, // 1011\n\n BLOCK_BLOT = BLOCK & BLOT, // 1010\n INLINE_BLOT = INLINE & BLOT, // 0110\n BLOCK_ATTRIBUTE = BLOCK & ATTRIBUTE, // 1001\n INLINE_ATTRIBUTE = INLINE & ATTRIBUTE, // 0101\n\n ANY = TYPE | LEVEL,\n}\n\nexport default Scope;\n","import Scope from '../scope.js';\n\nexport interface AttributorOptions {\n scope?: Scope;\n whitelist?: string[];\n}\n\nexport default class Attributor {\n public static keys(node: HTMLElement): string[] {\n return Array.from(node.attributes).map((item: Attr) => item.name);\n }\n\n public scope: Scope;\n public whitelist: string[] | undefined;\n\n constructor(\n public readonly attrName: string,\n public readonly keyName: string,\n options: AttributorOptions = {},\n ) {\n const attributeBit = Scope.TYPE & Scope.ATTRIBUTE;\n this.scope =\n options.scope != null\n ? // Ignore type bits, force attribute bit\n (options.scope & Scope.LEVEL) | attributeBit\n : Scope.ATTRIBUTE;\n if (options.whitelist != null) {\n this.whitelist = options.whitelist;\n }\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n node.setAttribute(this.keyName, value);\n return true;\n }\n\n public canAdd(_node: HTMLElement, value: any): boolean {\n if (this.whitelist == null) {\n return true;\n }\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n } else {\n return this.whitelist.indexOf(value) > -1;\n }\n }\n\n public remove(node: HTMLElement): void {\n node.removeAttribute(this.keyName);\n }\n\n public value(node: HTMLElement): any {\n const value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n }\n}\n","export default class ParchmentError extends Error {\n public message: string;\n public name: string;\n public stack!: string;\n\n constructor(message: string) {\n message = '[Parchment] ' + message;\n super(message);\n this.message = message;\n this.name = this.constructor.name;\n }\n}\n","import Attributor from './attributor/attributor.js';\nimport {\n type Blot,\n type BlotConstructor,\n type Root,\n} from './blot/abstract/blot.js';\nimport ParchmentError from './error.js';\nimport Scope from './scope.js';\n\nexport type RegistryDefinition = Attributor | BlotConstructor;\n\nexport interface RegistryInterface {\n create(scroll: Root, input: Node | string | Scope, value?: any): Blot;\n query(query: string | Node | Scope, scope: Scope): RegistryDefinition | null;\n register(...definitions: any[]): any;\n}\n\nexport default class Registry implements RegistryInterface {\n public static blots = new WeakMap();\n\n public static find(node?: Node | null, bubble = false): Blot | null {\n if (node == null) {\n return null;\n }\n if (this.blots.has(node)) {\n return this.blots.get(node) || null;\n }\n if (bubble) {\n let parentNode: Node | null = null;\n try {\n parentNode = node.parentNode;\n } catch (err) {\n // Probably hit a permission denied error.\n // A known case is in Firefox, event targets can be anonymous DIVs\n // inside an input element.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n return null;\n }\n return this.find(parentNode, bubble);\n }\n return null;\n }\n\n private attributes: { [key: string]: Attributor } = {};\n private classes: { [key: string]: BlotConstructor } = {};\n private tags: { [key: string]: BlotConstructor } = {};\n private types: { [key: string]: RegistryDefinition } = {};\n\n public create(scroll: Root, input: Node | string | Scope, value?: any): Blot {\n const match = this.query(input);\n if (match == null) {\n throw new ParchmentError(`Unable to create ${input} blot`);\n }\n const blotClass = match as BlotConstructor;\n const node =\n // @ts-expect-error Fix me later\n input instanceof Node || input.nodeType === Node.TEXT_NODE\n ? input\n : blotClass.create(value);\n\n const blot = new blotClass(scroll, node as Node, value);\n Registry.blots.set(blot.domNode, blot);\n return blot;\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n return Registry.find(node, bubble);\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n let match;\n if (typeof query === 'string') {\n match = this.types[query] || this.attributes[query];\n // @ts-expect-error Fix me later\n } else if (query instanceof Text || query.nodeType === Node.TEXT_NODE) {\n match = this.types.text;\n } else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = this.types.block;\n } else if (query & Scope.LEVEL & Scope.INLINE) {\n match = this.types.inline;\n }\n } else if (query instanceof Element) {\n const names = (query.getAttribute('class') || '').split(/\\s+/);\n names.some((name) => {\n match = this.classes[name];\n if (match) {\n return true;\n }\n return false;\n });\n match = match || this.tags[query.tagName];\n }\n if (match == null) {\n return null;\n }\n if (\n 'scope' in match &&\n scope & Scope.LEVEL & match.scope &&\n scope & Scope.TYPE & match.scope\n ) {\n return match;\n }\n return null;\n }\n\n public register(...definitions: RegistryDefinition[]): RegistryDefinition[] {\n return definitions.map((definition) => {\n const isBlot = 'blotName' in definition;\n const isAttr = 'attrName' in definition;\n if (!isBlot && !isAttr) {\n throw new ParchmentError('Invalid definition');\n } else if (isBlot && definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n const key = isBlot\n ? definition.blotName\n : isAttr\n ? definition.attrName\n : (undefined as never); // already handled by above checks\n this.types[key] = definition;\n\n if (isAttr) {\n if (typeof definition.keyName === 'string') {\n this.attributes[definition.keyName] = definition;\n }\n } else if (isBlot) {\n if (definition.className) {\n this.classes[definition.className] = definition;\n }\n if (definition.tagName) {\n if (Array.isArray(definition.tagName)) {\n definition.tagName = definition.tagName.map((tagName: string) => {\n return tagName.toUpperCase();\n });\n } else {\n definition.tagName = definition.tagName.toUpperCase();\n }\n const tagNames = Array.isArray(definition.tagName)\n ? definition.tagName\n : [definition.tagName];\n tagNames.forEach((tag: string) => {\n if (this.tags[tag] == null || definition.className == null) {\n this.tags[tag] = definition;\n }\n });\n }\n }\n return definition;\n });\n }\n}\n","import Attributor from './attributor.js';\n\nfunction match(node: HTMLElement, prefix: string): string[] {\n const className = node.getAttribute('class') || '';\n return className\n .split(/\\s+/)\n .filter((name) => name.indexOf(`${prefix}-`) === 0);\n}\n\nclass ClassAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('class') || '')\n .split(/\\s+/)\n .map((name) => name.split('-').slice(0, -1).join('-'));\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n this.remove(node);\n node.classList.add(`${this.keyName}-${value}`);\n return true;\n }\n\n public remove(node: HTMLElement): void {\n const matches = match(node, this.keyName);\n matches.forEach((name) => {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n }\n\n public value(node: HTMLElement): any {\n const result = match(node, this.keyName)[0] || '';\n const value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default ClassAttributor;\n","import Attributor from './attributor.js';\n\nfunction camelize(name: string): string {\n const parts = name.split('-');\n const rest = parts\n .slice(1)\n .map((part: string) => part[0].toUpperCase() + part.slice(1))\n .join('');\n return parts[0] + rest;\n}\n\nclass StyleAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('style') || '').split(';').map((value) => {\n const arr = value.split(':');\n return arr[0].trim();\n });\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = value;\n return true;\n }\n\n public remove(node: HTMLElement): void {\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n }\n\n public value(node: HTMLElement): any {\n // @ts-expect-error Fix me later\n const value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default StyleAttributor;\n","import type { Formattable } from '../blot/abstract/blot.js';\nimport Registry from '../registry.js';\nimport Scope from '../scope.js';\nimport Attributor from './attributor.js';\nimport ClassAttributor from './class.js';\nimport StyleAttributor from './style.js';\n\nclass AttributorStore {\n private attributes: { [key: string]: Attributor } = {};\n private domNode: HTMLElement;\n\n constructor(domNode: HTMLElement) {\n this.domNode = domNode;\n this.build();\n }\n\n public attribute(attribute: Attributor, value: any): void {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n } else {\n delete this.attributes[attribute.attrName];\n }\n }\n } else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n }\n\n public build(): void {\n this.attributes = {};\n const blot = Registry.find(this.domNode);\n if (blot == null) {\n return;\n }\n const attributes = Attributor.keys(this.domNode);\n const classes = ClassAttributor.keys(this.domNode);\n const styles = StyleAttributor.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach((name) => {\n const attr = blot.scroll.query(name, Scope.ATTRIBUTE);\n if (attr instanceof Attributor) {\n this.attributes[attr.attrName] = attr;\n }\n });\n }\n\n public copy(target: Formattable): void {\n Object.keys(this.attributes).forEach((key) => {\n const value = this.attributes[key].value(this.domNode);\n target.format(key, value);\n });\n }\n\n public move(target: Formattable): void {\n this.copy(target);\n Object.keys(this.attributes).forEach((key) => {\n this.attributes[key].remove(this.domNode);\n });\n this.attributes = {};\n }\n\n public values(): { [key: string]: any } {\n return Object.keys(this.attributes).reduce(\n (attributes: { [key: string]: any }, name: string) => {\n attributes[name] = this.attributes[name].value(this.domNode);\n return attributes;\n },\n {},\n );\n }\n}\n\nexport default AttributorStore;\n","import ParchmentError from '../../error.js';\nimport Registry from '../../registry.js';\nimport Scope from '../../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './blot.js';\n\nclass ShadowBlot implements Blot {\n public static blotName = 'abstract';\n public static className: string;\n public static requiredContainer: BlotConstructor;\n public static scope: Scope;\n public static tagName: string | string[];\n\n public static create(rawValue?: unknown): Node {\n if (this.tagName == null) {\n throw new ParchmentError('Blot definition missing tagName');\n }\n let node: HTMLElement;\n let value: string | number | undefined;\n if (Array.isArray(this.tagName)) {\n if (typeof rawValue === 'string') {\n value = rawValue.toUpperCase();\n if (parseInt(value, 10).toString() === value) {\n value = parseInt(value, 10);\n }\n } else if (typeof rawValue === 'number') {\n value = rawValue;\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n } else if (value && this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n } else {\n node = document.createElement(this.tagName[0]);\n }\n } else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n }\n\n public prev: Blot | null;\n public next: Blot | null;\n // @ts-expect-error Fix me later\n public parent: Parent;\n\n // Hack for accessing inherited static methods\n get statics(): any {\n return this.constructor;\n }\n constructor(\n public scroll: Root,\n public domNode: Node,\n ) {\n Registry.blots.set(domNode, this);\n this.prev = null;\n this.next = null;\n }\n\n public attach(): void {\n // Nothing to do\n }\n\n public clone(): Blot {\n const domNode = this.domNode.cloneNode(false);\n return this.scroll.create(domNode);\n }\n\n public detach(): void {\n if (this.parent != null) {\n this.parent.removeChild(this);\n }\n Registry.blots.delete(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n const blot = this.isolate(index, length);\n blot.remove();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n const blot = this.isolate(index, length);\n if (this.scroll.query(name, Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n } else if (this.scroll.query(name, Scope.ATTRIBUTE) != null) {\n const parent = this.scroll.create(this.statics.scope) as Parent &\n Formattable;\n blot.wrap(parent);\n parent.format(name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n const ref = this.split(index);\n this.parent.insertBefore(blot, ref || undefined);\n }\n\n public isolate(index: number, length: number): Blot {\n const target = this.split(index);\n if (target == null) {\n throw new Error('Attempt to isolate at end');\n }\n target.split(length);\n return target;\n }\n\n public length(): number {\n return 1;\n }\n\n public offset(root: Blot = this.parent): number {\n if (this.parent == null || this === root) {\n return 0;\n }\n return this.parent.children.offset(this) + this.parent.offset(root);\n }\n\n public optimize(_context?: { [key: string]: any }): void {\n if (\n this.statics.requiredContainer &&\n !(this.parent instanceof this.statics.requiredContainer)\n ) {\n this.wrap(this.statics.requiredContainer.blotName);\n }\n }\n\n public remove(): void {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(replacement, this.next || undefined);\n this.remove();\n }\n return replacement;\n }\n\n public split(index: number, _force?: boolean): Blot | null {\n return index === 0 ? this : this.next;\n }\n\n public update(\n _mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n // Nothing to do by default\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper =\n typeof name === 'string'\n ? (this.scroll.create(name, value) as Parent)\n : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next || undefined);\n }\n if (typeof wrapper.appendChild !== 'function') {\n throw new ParchmentError(`Cannot wrap ${name}`);\n }\n wrapper.appendChild(this);\n return wrapper;\n }\n}\n\nexport default ShadowBlot;\n","import Scope from '../../scope.js';\nimport type { Leaf } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nclass LeafBlot extends ShadowBlot implements Leaf {\n public static scope = Scope.INLINE_BLOT;\n\n /**\n * Returns the value represented by domNode if it is this Blot's type\n * No checking that domNode can represent this Blot type is required so\n * applications needing it should check externally before calling.\n */\n public static value(_domNode: Node): any {\n return true;\n }\n\n /**\n * Given location represented by node and offset from DOM Selection Range,\n * return index to that location.\n */\n public index(node: Node, offset: number): number {\n if (\n this.domNode === node ||\n this.domNode.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return Math.min(offset, 1);\n }\n return -1;\n }\n\n /**\n * Given index to location within blot, return node and offset representing\n * that location, consumable by DOM Selection Range\n */\n public position(index: number, _inclusive?: boolean): [Node, number] {\n const childNodes: Node[] = Array.from(this.parent.domNode.childNodes);\n let offset = childNodes.indexOf(this.domNode);\n if (index > 0) {\n offset += 1;\n }\n return [this.parent.domNode, offset];\n }\n\n /**\n * Return value represented by this blot\n * Should not change without interaction from API or\n * user change detectable by update()\n */\n public value(): any {\n return {\n [this.statics.blotName]: this.statics.value(this.domNode) || true,\n };\n }\n}\n\nexport default LeafBlot;\n","import type LinkedNode from './linked-node.js';\n\nclass LinkedList {\n public head: T | null;\n public tail: T | null;\n public length: number;\n\n constructor() {\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n public append(...nodes: T[]): void {\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n const rest = nodes.slice(1);\n this.append(...rest);\n }\n }\n\n public at(index: number): T | null {\n const next = this.iterator();\n let cur = next();\n while (cur && index > 0) {\n index -= 1;\n cur = next();\n }\n return cur;\n }\n\n public contains(node: T): boolean {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n if (cur === node) {\n return true;\n }\n cur = next();\n }\n return false;\n }\n\n public indexOf(node: T): number {\n const next = this.iterator();\n let cur = next();\n let index = 0;\n while (cur) {\n if (cur === node) {\n return index;\n }\n index += 1;\n cur = next();\n }\n return -1;\n }\n\n public insertBefore(node: T | null, refNode: T | null): void {\n if (node == null) {\n return;\n }\n this.remove(node);\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n } else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n } else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n }\n\n public offset(target: T): number {\n let index = 0;\n let cur = this.head;\n while (cur != null) {\n if (cur === target) {\n return index;\n }\n index += cur.length();\n cur = cur.next as T;\n }\n return -1;\n }\n\n public remove(node: T): void {\n if (!this.contains(node)) {\n return;\n }\n if (node.prev != null) {\n node.prev.next = node.next;\n }\n if (node.next != null) {\n node.next.prev = node.prev;\n }\n if (node === this.head) {\n this.head = node.next as T;\n }\n if (node === this.tail) {\n this.tail = node.prev as T;\n }\n this.length -= 1;\n }\n\n public iterator(curNode: T | null = this.head): () => T | null {\n // TODO use yield when we can\n return (): T | null => {\n const ret = curNode;\n if (curNode != null) {\n curNode = curNode.next as T;\n }\n return ret;\n };\n }\n\n public find(index: number, inclusive = false): [T | null, number] {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n const length = cur.length();\n if (\n index < length ||\n (inclusive &&\n index === length &&\n (cur.next == null || cur.next.length() !== 0))\n ) {\n return [cur, index];\n }\n index -= length;\n cur = next();\n }\n return [null, 0];\n }\n\n public forEach(callback: (cur: T) => void): void {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n callback(cur);\n cur = next();\n }\n }\n\n public forEachAt(\n index: number,\n length: number,\n callback: (cur: T, offset: number, length: number) => void,\n ): void {\n if (length <= 0) {\n return;\n }\n const [startNode, offset] = this.find(index);\n let curIndex = index - offset;\n const next = this.iterator(startNode);\n let cur = next();\n while (cur && curIndex < index + length) {\n const curLength = cur.length();\n if (index > curIndex) {\n callback(\n cur,\n index - curIndex,\n Math.min(length, curIndex + curLength - index),\n );\n } else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n cur = next();\n }\n }\n\n public map(callback: (cur: T) => any): any[] {\n return this.reduce((memo: T[], cur: T) => {\n memo.push(callback(cur));\n return memo;\n }, []);\n }\n\n public reduce(callback: (memo: M, cur: T) => M, memo: M): M {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n memo = callback(memo, cur);\n cur = next();\n }\n return memo;\n }\n}\n\nexport default LinkedList;\n","import LinkedList from '../../collection/linked-list.js';\nimport ParchmentError from '../../error.js';\nimport Scope from '../../scope.js';\nimport type { Blot, BlotConstructor, Parent, Root } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nfunction makeAttachedBlot(node: Node, scroll: Root): Blot {\n const found = scroll.find(node);\n if (found) return found;\n try {\n return scroll.create(node);\n } catch (e) {\n const blot = scroll.create(Scope.INLINE);\n Array.from(node.childNodes).forEach((child: Node) => {\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n return blot;\n }\n}\n\nclass ParentBlot extends ShadowBlot implements Parent {\n /**\n * Whitelist array of Blots that can be direct children.\n */\n public static allowedChildren?: BlotConstructor[];\n\n /**\n * Default child blot to be inserted if this blot becomes empty.\n */\n public static defaultChild?: BlotConstructor;\n public static uiClass = '';\n\n public children!: LinkedList;\n public domNode!: HTMLElement;\n public uiNode: HTMLElement | null = null;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.build();\n }\n\n public appendChild(other: Blot): void {\n this.insertBefore(other);\n }\n\n public attach(): void {\n super.attach();\n this.children.forEach((child) => {\n child.attach();\n });\n }\n\n public attachUI(node: HTMLElement): void {\n if (this.uiNode != null) {\n this.uiNode.remove();\n }\n this.uiNode = node;\n if (ParentBlot.uiClass) {\n this.uiNode.classList.add(ParentBlot.uiClass);\n }\n this.uiNode.setAttribute('contenteditable', 'false');\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n\n /**\n * Called during construction, should fill its own children LinkedList.\n */\n public build(): void {\n this.children = new LinkedList();\n // Need to be reversed for if DOM nodes already in order\n Array.from(this.domNode.childNodes)\n .filter((node: Node) => node !== this.uiNode)\n .reverse()\n .forEach((node: Node) => {\n try {\n const child = makeAttachedBlot(node, this.scroll);\n this.insertBefore(child, this.children.head || undefined);\n } catch (err) {\n if (err instanceof ParchmentError) {\n return;\n } else {\n throw err;\n }\n }\n });\n }\n\n public deleteAt(index: number, length: number): void {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.deleteAt(offset, childLength);\n });\n }\n\n public descendant(\n criteria: new (...args: any[]) => T,\n index: number,\n ): [T | null, number];\n public descendant(\n criteria: (blot: Blot) => boolean,\n index: number,\n ): [Blot | null, number];\n public descendant(criteria: any, index = 0): [Blot | null, number] {\n const [child, offset] = this.children.find(index);\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n return [child as any, offset];\n } else if (child instanceof ParentBlot) {\n return child.descendant(criteria, offset);\n } else {\n return [null, -1];\n }\n }\n\n public descendants(\n criteria: new (...args: any[]) => T,\n index?: number,\n length?: number,\n ): T[];\n public descendants(\n criteria: (blot: Blot) => boolean,\n index?: number,\n length?: number,\n ): Blot[];\n public descendants(\n criteria: any,\n index = 0,\n length: number = Number.MAX_VALUE,\n ): Blot[] {\n let descendants: Blot[] = [];\n let lengthLeft = length;\n this.children.forEachAt(\n index,\n length,\n (child: Blot, childIndex: number, childLength: number) => {\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n descendants.push(child);\n }\n if (child instanceof ParentBlot) {\n descendants = descendants.concat(\n child.descendants(criteria, childIndex, lengthLeft),\n );\n }\n lengthLeft -= childLength;\n },\n );\n return descendants;\n }\n\n public detach(): void {\n this.children.forEach((child) => {\n child.detach();\n });\n super.detach();\n }\n\n public enforceAllowedChildren(): void {\n let done = false;\n this.children.forEach((child: Blot) => {\n if (done) {\n return;\n }\n const allowed = this.statics.allowedChildren.some(\n (def: BlotConstructor) => child instanceof def,\n );\n if (allowed) {\n return;\n }\n if (child.statics.scope === Scope.BLOCK_BLOT) {\n if (child.next != null) {\n this.splitAfter(child);\n }\n if (child.prev != null) {\n this.splitAfter(child.prev);\n }\n child.parent.unwrap();\n done = true;\n } else if (child instanceof ParentBlot) {\n child.unwrap();\n } else {\n child.remove();\n }\n });\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.formatAt(offset, childLength, name, value);\n });\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const [child, offset] = this.children.find(index);\n if (child) {\n child.insertAt(offset, value, def);\n } else {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n this.appendChild(blot);\n }\n }\n\n public insertBefore(childBlot: Blot, refBlot?: Blot | null): void {\n if (childBlot.parent != null) {\n childBlot.parent.children.remove(childBlot);\n }\n let refDomNode: Node | null = null;\n this.children.insertBefore(childBlot, refBlot || null);\n childBlot.parent = this;\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (\n this.domNode.parentNode !== childBlot.domNode ||\n this.domNode.nextSibling !== refDomNode\n ) {\n this.domNode.insertBefore(childBlot.domNode, refDomNode);\n }\n childBlot.attach();\n }\n\n public length(): number {\n return this.children.reduce((memo, child) => {\n return memo + child.length();\n }, 0);\n }\n\n public moveChildren(targetParent: Parent, refNode?: Blot): void {\n this.children.forEach((child) => {\n targetParent.insertBefore(child, refNode);\n });\n }\n\n public optimize(context?: { [key: string]: any }): void {\n super.optimize(context);\n this.enforceAllowedChildren();\n if (this.uiNode != null && this.uiNode !== this.domNode.firstChild) {\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n const child = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(child);\n // TODO double check if necessary\n // child.optimize(context);\n } else {\n this.remove();\n }\n }\n }\n\n public path(index: number, inclusive = false): [Blot, number][] {\n const [child, offset] = this.children.find(index, inclusive);\n const position: [Blot, number][] = [[this, index]];\n if (child instanceof ParentBlot) {\n return position.concat(child.path(offset, inclusive));\n } else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n }\n\n public removeChild(child: Blot): void {\n this.children.remove(child);\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (replacement instanceof ParentBlot) {\n this.moveChildren(replacement);\n }\n return super.replaceWith(replacement);\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.clone() as ParentBlot;\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n this.children.forEachAt(index, this.length(), (child, offset, _length) => {\n const split = child.split(offset, force);\n if (split != null) {\n after.appendChild(split);\n }\n });\n return after;\n }\n\n public splitAfter(child: Blot): Parent {\n const after = this.clone() as ParentBlot;\n while (child.next != null) {\n after.appendChild(child.next);\n }\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n return after;\n }\n\n public unwrap(): void {\n if (this.parent) {\n this.moveChildren(this.parent, this.next || undefined);\n }\n this.remove();\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n const addedNodes: Node[] = [];\n const removedNodes: Node[] = [];\n mutations.forEach((mutation) => {\n if (mutation.target === this.domNode && mutation.type === 'childList') {\n addedNodes.push(...mutation.addedNodes);\n removedNodes.push(...mutation.removedNodes);\n }\n });\n removedNodes.forEach((node: Node) => {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (\n node.parentNode != null &&\n // @ts-expect-error Fix me later\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return;\n }\n const blot = this.scroll.find(node);\n if (blot == null) {\n return;\n }\n if (\n blot.domNode.parentNode == null ||\n blot.domNode.parentNode === this.domNode\n ) {\n blot.detach();\n }\n });\n addedNodes\n .filter((node) => {\n return node.parentNode === this.domNode && node !== this.uiNode;\n })\n .sort((a, b) => {\n if (a === b) {\n return 0;\n }\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach((node) => {\n let refBlot: Blot | null = null;\n if (node.nextSibling != null) {\n refBlot = this.scroll.find(node.nextSibling);\n }\n const blot = makeAttachedBlot(node, this.scroll);\n if (blot.next !== refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(this);\n }\n this.insertBefore(blot, refBlot || undefined);\n }\n });\n this.enforceAllowedChildren();\n }\n}\n\nexport default ParentBlot;\n","import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\n\n// Shallow object comparison\nfunction isEqual(\n obj1: Record,\n obj2: Record,\n): boolean {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n for (const prop in obj1) {\n if (obj1[prop] !== obj2[prop]) {\n return false;\n }\n }\n return true;\n}\n\nclass InlineBlot extends ParentBlot implements Formattable {\n public static allowedChildren: BlotConstructor[] = [InlineBlot, LeafBlot];\n public static blotName = 'inline';\n public static scope = Scope.INLINE_BLOT;\n public static tagName: string | string[] = 'SPAN';\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(InlineBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n if (name === this.statics.blotName && !value) {\n this.children.forEach((child) => {\n if (!(child instanceof InlineBlot)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n this.attributes.copy(child as InlineBlot);\n });\n this.unwrap();\n } else {\n const format = this.scroll.query(name, Scope.INLINE);\n if (format == null) {\n return;\n }\n if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (\n this.formats()[name] != null ||\n this.scroll.query(name, Scope.ATTRIBUTE)\n ) {\n const blot = this.isolate(index, length) as InlineBlot;\n blot.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n const formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n const next = this.next;\n if (\n next instanceof InlineBlot &&\n next.prev === this &&\n isEqual(formats, next.formats())\n ) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as InlineBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper = super.wrap(name, value);\n if (wrapper instanceof InlineBlot) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n }\n}\n\nexport default InlineBlot;\n","import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\nimport InlineBlot from './inline.js';\n\nclass BlockBlot extends ParentBlot implements Formattable {\n public static blotName = 'block';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[] = 'P';\n public static allowedChildren: BlotConstructor[] = [\n InlineBlot,\n BlockBlot,\n LeafBlot,\n ];\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(BlockBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n const format = this.scroll.query(name, Scope.BLOCK);\n if (format == null) {\n return;\n } else if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (this.scroll.query(name, Scope.BLOCK) != null) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null || this.scroll.query(value, Scope.INLINE) != null) {\n // Insert text or inline\n super.insertAt(index, value, def);\n } else {\n const after = this.split(index);\n if (after != null) {\n const blot = this.scroll.create(value, def);\n after.parent.insertBefore(blot, after);\n } else {\n throw new Error('Attempt to insertAt after block boundaries');\n }\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as BlockBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n}\n\nexport default BlockBlot;\n","import Scope from '../../scope.js';\nimport BlockBlot from '../block.js';\nimport ParentBlot from './parent.js';\n\nclass ContainerBlot extends ParentBlot {\n public static blotName = 'container';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[];\n\n public prev!: BlockBlot | ContainerBlot | null;\n public next!: BlockBlot | ContainerBlot | null;\n\n public checkMerge(): boolean {\n return (\n this.next !== null && this.next.statics.blotName === this.statics.blotName\n );\n }\n\n public deleteAt(index: number, length: number): void {\n super.deleteAt(index, length);\n this.enforceAllowedChildren();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n super.formatAt(index, length, name, value);\n this.enforceAllowedChildren();\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n super.insertAt(index, value, def);\n this.enforceAllowedChildren();\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n if (this.children.length > 0 && this.next != null && this.checkMerge()) {\n this.next.moveChildren(this);\n this.next.remove();\n }\n }\n}\n\nexport default ContainerBlot;\n","import type { Formattable, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass EmbedBlot extends LeafBlot implements Formattable {\n public static formats(_domNode: HTMLElement, _scroll: Root): any {\n return undefined;\n }\n\n public format(name: string, value: any): void {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n super.formatAt(0, this.length(), name, value);\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n return this.statics.formats(this.domNode, this.scroll);\n }\n}\n\nexport default EmbedBlot;\n","import Registry, { type RegistryDefinition } from '../registry.js';\nimport Scope from '../scope.js';\nimport type { Blot, BlotConstructor, Root } from './abstract/blot.js';\nimport ContainerBlot from './abstract/container.js';\nimport ParentBlot from './abstract/parent.js';\nimport BlockBlot from './block.js';\n\nconst OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\n\nconst MAX_OPTIMIZE_ITERATIONS = 100;\n\nclass ScrollBlot extends ParentBlot implements Root {\n public static blotName = 'scroll';\n public static defaultChild = BlockBlot;\n public static allowedChildren: BlotConstructor[] = [BlockBlot, ContainerBlot];\n public static scope = Scope.BLOCK_BLOT;\n public static tagName = 'DIV';\n\n public observer: MutationObserver;\n\n constructor(\n public registry: Registry,\n node: HTMLDivElement,\n ) {\n // @ts-expect-error scroll is the root with no parent\n super(null, node);\n this.scroll = this;\n this.build();\n this.observer = new MutationObserver((mutations: MutationRecord[]) => {\n this.update(mutations);\n });\n this.observer.observe(this.domNode, OBSERVER_CONFIG);\n this.attach();\n }\n\n public create(input: Node | string | Scope, value?: any): Blot {\n return this.registry.create(this, input, value);\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n const blot = this.registry.find(node, bubble);\n if (!blot) {\n return null;\n }\n if (blot.scroll === this) {\n return blot;\n }\n return bubble ? this.find(blot.scroll.domNode.parentNode, true) : null;\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n return this.registry.query(query, scope);\n }\n\n public register(...definitions: RegistryDefinition[]) {\n return this.registry.register(...definitions);\n }\n\n public build(): void {\n if (this.scroll == null) {\n return;\n }\n super.build();\n }\n\n public detach(): void {\n super.detach();\n this.observer.disconnect();\n }\n\n public deleteAt(index: number, length: number): void {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach((child) => {\n child.remove();\n });\n } else {\n super.deleteAt(index, length);\n }\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.update();\n super.formatAt(index, length, name, value);\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n this.update();\n super.insertAt(index, value, def);\n }\n\n public optimize(context?: { [key: string]: any }): void;\n public optimize(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void;\n public optimize(mutations: any = [], context: any = {}): void {\n super.optimize(context);\n const mutationsMap = context.mutationsMap || new WeakMap();\n // We must modify mutations directly, cannot make copy and then modify\n let records = Array.from(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n const mark = (blot: Blot | null, markParent = true): void => {\n if (blot == null || blot === this) {\n return;\n }\n if (blot.domNode.parentNode == null) {\n return;\n }\n if (!mutationsMap.has(blot.domNode)) {\n mutationsMap.set(blot.domNode, []);\n }\n if (markParent) {\n mark(blot.parent);\n }\n };\n const optimize = (blot: Blot): void => {\n // Post-order traversal\n if (!mutationsMap.has(blot.domNode)) {\n return;\n }\n if (blot instanceof ParentBlot) {\n blot.children.forEach(optimize);\n }\n mutationsMap.delete(blot.domNode);\n blot.optimize(context);\n };\n let remaining = mutations;\n for (let i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return;\n }\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(this.find(mutation.previousSibling, false));\n Array.from(mutation.addedNodes).forEach((node: Node) => {\n const child = this.find(node, false);\n mark(child, false);\n if (child instanceof ParentBlot) {\n child.children.forEach((grandChild: Blot) => {\n mark(grandChild, false);\n });\n }\n });\n } else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = Array.from(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n }\n }\n\n public update(\n mutations?: MutationRecord[],\n context: { [key: string]: any } = {},\n ): void {\n mutations = mutations || this.observer.takeRecords();\n const mutationsMap = new WeakMap();\n mutations\n .map((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return null;\n }\n if (mutationsMap.has(blot.domNode)) {\n mutationsMap.get(blot.domNode).push(mutation);\n return null;\n } else {\n mutationsMap.set(blot.domNode, [mutation]);\n return blot;\n }\n })\n .forEach((blot: Blot | null) => {\n if (blot != null && blot !== this && mutationsMap.has(blot.domNode)) {\n blot.update(mutationsMap.get(blot.domNode) || [], context);\n }\n });\n context.mutationsMap = mutationsMap;\n if (mutationsMap.has(this.domNode)) {\n super.update(mutationsMap.get(this.domNode), context);\n }\n this.optimize(mutations, context);\n }\n}\n\nexport default ScrollBlot;\n","import Scope from '../scope.js';\nimport type { Blot, Leaf, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass TextBlot extends LeafBlot implements Leaf {\n public static readonly blotName = 'text';\n public static scope = Scope.INLINE_BLOT;\n\n public static create(value: string): Text {\n return document.createTextNode(value);\n }\n\n public static value(domNode: Text): string {\n return domNode.data;\n }\n\n public domNode!: Text;\n protected text: string;\n\n constructor(scroll: Root, node: Node) {\n super(scroll, node);\n this.text = this.statics.value(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n this.domNode.data = this.text =\n this.text.slice(0, index) + this.text.slice(index + length);\n }\n\n public index(node: Node, offset: number): number {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n } else {\n super.insertAt(index, value, def);\n }\n }\n\n public length(): number {\n return this.text.length;\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n } else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), (this.next as TextBlot).value());\n this.next.remove();\n }\n }\n\n public position(index: number, _inclusive = false): [Node, number] {\n return [this.domNode, index];\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.scroll.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next || undefined);\n this.text = this.statics.value(this.domNode);\n return after;\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n if (\n mutations.some((mutation) => {\n return (\n mutation.type === 'characterData' && mutation.target === this.domNode\n );\n })\n ) {\n this.text = this.statics.value(this.domNode);\n }\n }\n\n public value(): string {\n return this.text;\n }\n}\n\nexport default TextBlot;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","import { ClassAttributor, Scope } from 'parchment';\n\nclass IndentAttributor extends ClassAttributor {\n add(node: HTMLElement, value: string | number) {\n let normalizedValue = 0;\n if (value === '+1' || value === '-1') {\n const indent = this.value(node) || 0;\n normalizedValue = value === '+1' ? indent + 1 : indent - 1;\n } else if (typeof value === 'number') {\n normalizedValue = value;\n }\n if (normalizedValue === 0) {\n this.remove(node);\n return true;\n }\n return super.add(node, normalizedValue.toString());\n }\n\n canAdd(node: HTMLElement, value: string) {\n return super.canAdd(node, value) || super.canAdd(node, parseInt(value, 10));\n }\n\n value(node: HTMLElement) {\n return parseInt(super.value(node), 10) || undefined; // Don't return NaN\n }\n}\n\nconst IndentClass = new IndentAttributor('indent', 'ql-indent', {\n scope: Scope.BLOCK,\n // @ts-expect-error\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8],\n});\n\nexport default IndentClass;\n","import Block from '../blots/block.js';\n\nclass Blockquote extends Block {\n static blotName = 'blockquote';\n static tagName = 'blockquote';\n}\n\nexport default Blockquote;\n","import Block from '../blots/block.js';\n\nclass Header extends Block {\n static blotName = 'header';\n static tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\n static formats(domNode: Element) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\n\nexport default Header;\n","import Block from '../blots/block.js';\nimport Container from '../blots/container.js';\nimport type Scroll from '../blots/scroll.js';\nimport Quill from '../core/quill.js';\n\nclass ListContainer extends Container {}\nListContainer.blotName = 'list-container';\nListContainer.tagName = 'OL';\n\nclass ListItem extends Block {\n static create(value: string) {\n const node = super.create() as HTMLElement;\n node.setAttribute('data-list', value);\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n return domNode.getAttribute('data-list') || undefined;\n }\n\n static register() {\n Quill.register(ListContainer);\n }\n\n constructor(scroll: Scroll, domNode: HTMLElement) {\n super(scroll, domNode);\n const ui = domNode.ownerDocument.createElement('span');\n const listEventHandler = (e: Event) => {\n if (!scroll.isEnabled()) return;\n const format = this.statics.formats(domNode, scroll);\n if (format === 'checked') {\n this.format('list', 'unchecked');\n e.preventDefault();\n } else if (format === 'unchecked') {\n this.format('list', 'checked');\n e.preventDefault();\n }\n };\n ui.addEventListener('mousedown', listEventHandler);\n ui.addEventListener('touchstart', listEventHandler);\n this.attachUI(ui);\n }\n\n format(name: string, value: string) {\n if (name === this.statics.blotName && value) {\n this.domNode.setAttribute('data-list', value);\n } else {\n super.format(name, value);\n }\n }\n}\nListItem.blotName = 'list';\nListItem.tagName = 'LI';\n\nListContainer.allowedChildren = [ListItem];\nListItem.requiredContainer = ListContainer;\n\nexport { ListContainer, ListItem as default };\n","import Inline from '../blots/inline.js';\n\nclass Bold extends Inline {\n static blotName = 'bold';\n static tagName = ['STRONG', 'B'];\n\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\n\nexport default Bold;\n","import Inline from '../blots/inline.js';\n\nclass Link extends Inline {\n static blotName = 'link';\n static tagName = 'A';\n static SANITIZED_URL = 'about:blank';\n static PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel', 'sms'];\n\n static create(value: string) {\n const node = super.create(value) as HTMLElement;\n node.setAttribute('href', this.sanitize(value));\n node.setAttribute('rel', 'noopener noreferrer');\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url: string) {\n return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n\n format(name: string, value: unknown) {\n if (name !== this.statics.blotName || !value) {\n super.format(name, value);\n } else {\n // @ts-expect-error\n this.domNode.setAttribute('href', this.constructor.sanitize(value));\n }\n }\n}\n\nfunction sanitize(url: string, protocols: string[]) {\n const anchor = document.createElement('a');\n anchor.href = url;\n const protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\nexport { Link as default, sanitize };\n","import Inline from '../blots/inline.js';\n\nclass Script extends Inline {\n static blotName = 'script';\n static tagName = ['SUB', 'SUP'];\n\n static create(value: 'super' | 'sub' | (string & {})) {\n if (value === 'super') {\n return document.createElement('sup');\n }\n if (value === 'sub') {\n return document.createElement('sub');\n }\n return super.create(value);\n }\n\n static formats(domNode: HTMLElement) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\n\nexport default Script;\n","import Inline from '../blots/inline.js';\n\nclass Underline extends Inline {\n static blotName = 'underline';\n static tagName = 'U';\n}\n\nexport default Underline;\n","import Embed from '../blots/embed.js';\n\nclass Formula extends Embed {\n static blotName = 'formula';\n static className = 'ql-formula';\n static tagName = 'SPAN';\n\n static create(value: string) {\n // @ts-expect-error\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n const node = super.create(value) as Element;\n if (typeof value === 'string') {\n // @ts-expect-error\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00',\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('data-value');\n }\n\n html() {\n const { formula } = this.value();\n return `${formula}`;\n }\n}\n\nexport default Formula;\n","import { EmbedBlot } from 'parchment';\nimport { sanitize } from './link.js';\n\nconst ATTRIBUTES = ['alt', 'height', 'width'];\n\nclass Image extends EmbedBlot {\n static blotName = 'image';\n static tagName = 'IMG';\n\n static create(value: string) {\n const node = super.create(value) as Element;\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n\n static formats(domNode: Element) {\n return ATTRIBUTES.reduce(\n (formats: Record, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n },\n {},\n );\n }\n\n static match(url: string) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static sanitize(url: string) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('src');\n }\n\n domNode: HTMLImageElement;\n\n format(name: string, value: string) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\n\nexport default Image;\n","import { BlockEmbed } from '../blots/block.js';\nimport Link from './link.js';\n\nconst ATTRIBUTES = ['height', 'width'];\n\nclass Video extends BlockEmbed {\n static blotName = 'video';\n static className = 'ql-video';\n static tagName = 'IFRAME';\n\n static create(value: string) {\n const node = super.create(value) as Element;\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', 'true');\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode: Element) {\n return ATTRIBUTES.reduce(\n (formats: Record, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n },\n {},\n );\n }\n\n static sanitize(url: string) {\n return Link.sanitize(url);\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('src');\n }\n\n domNode: HTMLVideoElement;\n\n format(name: string, value: string) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n\n html() {\n const { video } = this.value();\n return `
    ${video}`;\n }\n}\n\nexport default Video;\n","import Delta from 'quill-delta';\nimport { ClassAttributor, Scope } from 'parchment';\nimport type { Blot, ScrollBlot } from 'parchment';\nimport Inline from '../blots/inline.js';\nimport Quill from '../core/quill.js';\nimport Module from '../core/module.js';\nimport { blockDelta } from '../blots/block.js';\nimport BreakBlot from '../blots/break.js';\nimport CursorBlot from '../blots/cursor.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport CodeBlock, { CodeBlockContainer } from '../formats/code.js';\nimport { traverse } from './clipboard.js';\n\nconst TokenAttributor = new ClassAttributor('code-token', 'hljs', {\n scope: Scope.INLINE,\n});\nclass CodeToken extends Inline {\n static formats(node: Element, scroll: ScrollBlot) {\n while (node != null && node !== scroll.domNode) {\n if (node.classList && node.classList.contains(CodeBlock.className)) {\n // @ts-expect-error\n return super.formats(node, scroll);\n }\n // @ts-expect-error\n node = node.parentNode;\n }\n return undefined;\n }\n\n constructor(scroll: ScrollBlot, domNode: Node, value: unknown) {\n // @ts-expect-error\n super(scroll, domNode, value);\n TokenAttributor.add(this.domNode, value);\n }\n\n format(format: string, value: unknown) {\n if (format !== CodeToken.blotName) {\n super.format(format, value);\n } else if (value) {\n TokenAttributor.add(this.domNode, value);\n } else {\n TokenAttributor.remove(this.domNode);\n this.domNode.classList.remove(this.statics.className);\n }\n }\n\n optimize(...args: unknown[]) {\n // @ts-expect-error\n super.optimize(...args);\n if (!TokenAttributor.value(this.domNode)) {\n this.unwrap();\n }\n }\n}\nCodeToken.blotName = 'code-token';\nCodeToken.className = 'ql-token';\n\nclass SyntaxCodeBlock extends CodeBlock {\n static create(value: unknown) {\n const domNode = super.create(value);\n if (typeof value === 'string') {\n domNode.setAttribute('data-language', value);\n }\n return domNode;\n }\n\n static formats(domNode: Node) {\n // @ts-expect-error\n return domNode.getAttribute('data-language') || 'plain';\n }\n\n static register() {} // Syntax module will register\n\n format(name: string, value: unknown) {\n if (name === this.statics.blotName && value) {\n // @ts-expect-error\n this.domNode.setAttribute('data-language', value);\n } else {\n super.format(name, value);\n }\n }\n\n replaceWith(name: string, value: unknown) {\n this.formatAt(0, this.length(), CodeToken.blotName, false);\n return super.replaceWith(name, value);\n }\n}\n\nclass SyntaxCodeBlockContainer extends CodeBlockContainer {\n forceNext?: boolean;\n cachedText?: string | null;\n\n attach() {\n super.attach();\n this.forceNext = false;\n // @ts-expect-error\n this.scroll.emitMount(this);\n }\n\n format(name: string, value: unknown) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n this.children.forEach((child) => {\n // @ts-expect-error\n child.format(name, value);\n });\n }\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n }\n super.formatAt(index, length, name, value);\n }\n\n highlight(\n highlight: (text: string, language: string) => Delta,\n forced = false,\n ) {\n if (this.children.head == null) return;\n const nodes = Array.from(this.domNode.childNodes).filter(\n (node) => node !== this.uiNode,\n );\n const text = `${nodes.map((node) => node.textContent).join('\\n')}\\n`;\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n if (forced || this.forceNext || this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n const oldDelta = this.children.reduce((delta, child) => {\n // @ts-expect-error\n return delta.concat(blockDelta(child, false));\n }, new Delta());\n const delta = highlight(text, language);\n oldDelta.diff(delta).reduce((index, { retain, attributes }) => {\n // Should be all retains\n if (!retain) return index;\n if (attributes) {\n Object.keys(attributes).forEach((format) => {\n if (\n [SyntaxCodeBlock.blotName, CodeToken.blotName].includes(format)\n ) {\n // @ts-expect-error\n this.formatAt(index, retain, format, attributes[format]);\n }\n });\n }\n // @ts-expect-error\n return index + retain;\n }, 0);\n }\n this.cachedText = text;\n this.forceNext = false;\n }\n }\n\n html(index: number, length: number) {\n const [codeBlock] = this.children.find(index);\n const language = codeBlock\n ? SyntaxCodeBlock.formats(codeBlock.domNode)\n : 'plain';\n\n return `
    \\n${escapeText(\n      this.code(index, length),\n    )}\\n
    `;\n }\n\n optimize(context: Record) {\n super.optimize(context);\n if (\n this.parent != null &&\n this.children.head != null &&\n this.uiNode != null\n ) {\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n // @ts-expect-error\n if (language !== this.uiNode.value) {\n // @ts-expect-error\n this.uiNode.value = language;\n }\n }\n }\n}\n// @ts-expect-error\nSyntaxCodeBlockContainer.allowedChildren = [SyntaxCodeBlock];\nSyntaxCodeBlock.requiredContainer = SyntaxCodeBlockContainer;\nSyntaxCodeBlock.allowedChildren = [CodeToken, CursorBlot, TextBlot, BreakBlot];\n\ninterface SyntaxOptions {\n interval: number;\n languages: { key: string; label: string }[];\n hljs: any;\n}\n\nconst highlight = (lib: any, language: string, text: string) => {\n if (typeof lib.versionString === 'string') {\n const majorVersion = lib.versionString.split('.')[0];\n if (parseInt(majorVersion, 10) >= 11) {\n return lib.highlight(text, { language }).value;\n }\n }\n return lib.highlight(language, text).value;\n};\n\nclass Syntax extends Module {\n static DEFAULTS: SyntaxOptions & { hljs: any };\n\n static register() {\n Quill.register(CodeToken, true);\n // @ts-expect-error\n Quill.register(SyntaxCodeBlock, true);\n Quill.register(SyntaxCodeBlockContainer, true);\n }\n\n languages: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n if (this.options.hljs == null) {\n throw new Error(\n 'Syntax module requires highlight.js. Please include the library on the page before Quill.',\n );\n }\n // @ts-expect-error Fix me later\n this.languages = this.options.languages.reduce(\n (memo: Record, { key }) => {\n memo[key] = true;\n return memo;\n },\n {},\n );\n this.highlightBlot = this.highlightBlot.bind(this);\n this.initListener();\n this.initTimer();\n }\n\n initListener() {\n this.quill.on(Quill.events.SCROLL_BLOT_MOUNT, (blot: Blot) => {\n if (!(blot instanceof SyntaxCodeBlockContainer)) return;\n const select = this.quill.root.ownerDocument.createElement('select');\n // @ts-expect-error Fix me later\n this.options.languages.forEach(({ key, label }) => {\n const option = select.ownerDocument.createElement('option');\n option.textContent = label;\n option.setAttribute('value', key);\n select.appendChild(option);\n });\n select.addEventListener('change', () => {\n blot.format(SyntaxCodeBlock.blotName, select.value);\n this.quill.root.focus(); // Prevent scrolling\n this.highlight(blot, true);\n });\n if (blot.uiNode == null) {\n blot.attachUI(select);\n if (blot.children.head) {\n select.value = SyntaxCodeBlock.formats(blot.children.head.domNode);\n }\n }\n });\n }\n\n initTimer() {\n let timer: ReturnType | null = null;\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(() => {\n this.highlight();\n timer = null;\n }, this.options.interval);\n });\n }\n\n highlight(blot: SyntaxCodeBlockContainer | null = null, force = false) {\n if (this.quill.selection.composing) return;\n this.quill.update(Quill.sources.USER);\n const range = this.quill.getSelection();\n const blots =\n blot == null\n ? this.quill.scroll.descendants(SyntaxCodeBlockContainer)\n : [blot];\n blots.forEach((container) => {\n container.highlight(this.highlightBlot, force);\n });\n this.quill.update(Quill.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n }\n }\n\n highlightBlot(text: string, language = 'plain') {\n language = this.languages[language] ? language : 'plain';\n if (language === 'plain') {\n return escapeText(text)\n .split('\\n')\n .reduce((delta, line, i) => {\n if (i !== 0) {\n delta.insert('\\n', { [CodeBlock.blotName]: language });\n }\n return delta.insert(line);\n }, new Delta());\n }\n const container = this.quill.root.ownerDocument.createElement('div');\n container.classList.add(CodeBlock.className);\n container.innerHTML = highlight(this.options.hljs, language, text);\n return traverse(\n this.quill.scroll,\n container,\n [\n (node, delta) => {\n // @ts-expect-error\n const value = TokenAttributor.value(node);\n if (value) {\n return delta.compose(\n new Delta().retain(delta.length(), {\n [CodeToken.blotName]: value,\n }),\n );\n }\n return delta;\n },\n ],\n [\n (node, delta) => {\n // @ts-expect-error\n return node.data.split('\\n').reduce((memo, nodeText, i) => {\n if (i !== 0) memo.insert('\\n', { [CodeBlock.blotName]: language });\n return memo.insert(nodeText);\n }, delta);\n },\n ],\n new WeakMap(),\n );\n }\n}\nSyntax.DEFAULTS = {\n hljs: (() => {\n return window.hljs;\n })(),\n interval: 1000,\n languages: [\n { key: 'plain', label: 'Plain' },\n { key: 'bash', label: 'Bash' },\n { key: 'cpp', label: 'C++' },\n { key: 'cs', label: 'C#' },\n { key: 'css', label: 'CSS' },\n { key: 'diff', label: 'Diff' },\n { key: 'xml', label: 'HTML/XML' },\n { key: 'java', label: 'Java' },\n { key: 'javascript', label: 'JavaScript' },\n { key: 'markdown', label: 'Markdown' },\n { key: 'php', label: 'PHP' },\n { key: 'python', label: 'Python' },\n { key: 'ruby', label: 'Ruby' },\n { key: 'sql', label: 'SQL' },\n ],\n};\n\nexport { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default };\n","import type { LinkedList } from 'parchment';\nimport Block from '../blots/block.js';\nimport Container from '../blots/container.js';\n\nclass TableCell extends Block {\n static blotName = 'table';\n static tagName = 'TD';\n\n static create(value: string) {\n const node = super.create() as HTMLElement;\n if (value) {\n node.setAttribute('data-row', value);\n } else {\n node.setAttribute('data-row', tableId());\n }\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n if (domNode.hasAttribute('data-row')) {\n return domNode.getAttribute('data-row');\n }\n return undefined;\n }\n\n next: this | null;\n\n cellOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n format(name: string, value: string) {\n if (name === TableCell.blotName && value) {\n this.domNode.setAttribute('data-row', value);\n } else {\n super.format(name, value);\n }\n }\n\n row(): TableRow {\n return this.parent as TableRow;\n }\n\n rowOffset() {\n if (this.row()) {\n return this.row().rowOffset();\n }\n return -1;\n }\n\n table() {\n return this.row() && this.row().table();\n }\n}\n\nclass TableRow extends Container {\n static blotName = 'table-row';\n static tagName = 'TR';\n\n children: LinkedList;\n next: this | null;\n\n checkMerge() {\n // @ts-expect-error\n if (super.checkMerge() && this.next.children.head != null) {\n // @ts-expect-error\n const thisHead = this.children.head.formats();\n // @ts-expect-error\n const thisTail = this.children.tail.formats();\n // @ts-expect-error\n const nextHead = this.next.children.head.formats();\n // @ts-expect-error\n const nextTail = this.next.children.tail.formats();\n return (\n thisHead.table === thisTail.table &&\n thisHead.table === nextHead.table &&\n thisHead.table === nextTail.table\n );\n }\n return false;\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n this.children.forEach((child) => {\n if (child.next == null) return;\n const childFormats = child.formats();\n const nextFormats = child.next.formats();\n if (childFormats.table !== nextFormats.table) {\n const next = this.splitAfter(child);\n if (next) {\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n next.optimize();\n }\n // We might be able to merge with prev now\n if (this.prev) {\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n this.prev.optimize();\n }\n }\n });\n }\n\n rowOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n table() {\n return this.parent && this.parent.parent;\n }\n}\n\nclass TableBody extends Container {\n static blotName = 'table-body';\n static tagName = 'TBODY';\n\n children: LinkedList;\n}\n\nclass TableContainer extends Container {\n static blotName = 'table-container';\n static tagName = 'TABLE';\n\n children: LinkedList;\n\n balanceCells() {\n const rows = this.descendants(TableRow);\n const maxColumns = rows.reduce((max, row) => {\n return Math.max(row.children.length, max);\n }, 0);\n rows.forEach((row) => {\n new Array(maxColumns - row.children.length).fill(0).forEach(() => {\n let value;\n if (row.children.head != null) {\n value = TableCell.formats(row.children.head.domNode);\n }\n const blot = this.scroll.create(TableCell.blotName, value);\n row.appendChild(blot);\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n blot.optimize(); // Add break blot\n });\n });\n }\n\n cells(column: number) {\n return this.rows().map((row) => row.children.at(column));\n }\n\n deleteColumn(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n body.children.forEach((row) => {\n const cell = row.children.at(index);\n if (cell != null) {\n cell.remove();\n }\n });\n }\n\n insertColumn(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n body.children.forEach((row) => {\n const ref = row.children.at(index);\n // @ts-expect-error\n const value = TableCell.formats(row.children.head.domNode);\n const cell = this.scroll.create(TableCell.blotName, value);\n row.insertBefore(cell, ref);\n });\n }\n\n insertRow(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n const id = tableId();\n const row = this.scroll.create(TableRow.blotName) as TableRow;\n body.children.head.children.forEach(() => {\n const cell = this.scroll.create(TableCell.blotName, id);\n row.appendChild(cell);\n });\n const ref = body.children.at(index);\n body.insertBefore(row, ref);\n }\n\n rows() {\n const body = this.children.head;\n if (body == null) return [];\n return body.children.map((row) => row);\n }\n}\n\nTableContainer.allowedChildren = [TableBody];\nTableBody.requiredContainer = TableContainer;\n\nTableBody.allowedChildren = [TableRow];\nTableRow.requiredContainer = TableBody;\n\nTableRow.allowedChildren = [TableCell];\nTableCell.requiredContainer = TableRow;\n\nfunction tableId() {\n const id = Math.random().toString(36).slice(2, 6);\n return `row-${id}`;\n}\n\nexport { TableCell, TableRow, TableBody, TableContainer, tableId };\n","import Delta from 'quill-delta';\nimport Quill from '../core/quill.js';\nimport Module from '../core/module.js';\nimport {\n TableCell,\n TableRow,\n TableBody,\n TableContainer,\n tableId,\n} from '../formats/table.js';\n\nclass Table extends Module {\n static register() {\n Quill.register(TableCell);\n Quill.register(TableRow);\n Quill.register(TableBody);\n Quill.register(TableContainer);\n }\n\n constructor(...args: ConstructorParameters) {\n super(...args);\n this.listenBalanceCells();\n }\n\n balanceTables() {\n this.quill.scroll.descendants(TableContainer).forEach((table) => {\n table.balanceCells();\n });\n }\n\n deleteColumn() {\n const [table, , cell] = this.getTable();\n if (cell == null) return;\n // @ts-expect-error\n table.deleteColumn(cell.cellOffset());\n this.quill.update(Quill.sources.USER);\n }\n\n deleteRow() {\n const [, row] = this.getTable();\n if (row == null) return;\n row.remove();\n this.quill.update(Quill.sources.USER);\n }\n\n deleteTable() {\n const [table] = this.getTable();\n if (table == null) return;\n // @ts-expect-error\n const offset = table.offset();\n // @ts-expect-error\n table.remove();\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(offset, Quill.sources.SILENT);\n }\n\n getTable(\n range = this.quill.getSelection(),\n ): [null, null, null, -1] | [Table, TableRow, TableCell, number] {\n if (range == null) return [null, null, null, -1];\n const [cell, offset] = this.quill.getLine(range.index);\n if (cell == null || cell.statics.blotName !== TableCell.blotName) {\n return [null, null, null, -1];\n }\n const row = cell.parent;\n const table = row.parent.parent;\n // @ts-expect-error\n return [table, row, cell, offset];\n }\n\n insertColumn(offset: number) {\n const range = this.quill.getSelection();\n if (!range) return;\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const column = cell.cellOffset();\n table.insertColumn(column + offset);\n this.quill.update(Quill.sources.USER);\n let shift = row.rowOffset();\n if (offset === 0) {\n shift += 1;\n }\n this.quill.setSelection(\n range.index + shift,\n range.length,\n Quill.sources.SILENT,\n );\n }\n\n insertColumnLeft() {\n this.insertColumn(0);\n }\n\n insertColumnRight() {\n this.insertColumn(1);\n }\n\n insertRow(offset: number) {\n const range = this.quill.getSelection();\n if (!range) return;\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const index = row.rowOffset();\n table.insertRow(index + offset);\n this.quill.update(Quill.sources.USER);\n if (offset > 0) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n } else {\n this.quill.setSelection(\n range.index + row.children.length,\n range.length,\n Quill.sources.SILENT,\n );\n }\n }\n\n insertRowAbove() {\n this.insertRow(0);\n }\n\n insertRowBelow() {\n this.insertRow(1);\n }\n\n insertTable(rows: number, columns: number) {\n const range = this.quill.getSelection();\n if (range == null) return;\n const delta = new Array(rows).fill(0).reduce((memo) => {\n const text = new Array(columns).fill('\\n').join('');\n return memo.insert(text, { table: tableId() });\n }, new Delta().retain(range.index));\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.balanceTables();\n }\n\n listenBalanceCells() {\n this.quill.on(\n Quill.events.SCROLL_OPTIMIZE,\n (mutations: MutationRecord[]) => {\n mutations.some((mutation) => {\n if (\n ['TD', 'TR', 'TBODY', 'TABLE'].includes(\n (mutation.target as HTMLElement).tagName,\n )\n ) {\n this.quill.once(Quill.events.TEXT_CHANGE, (delta, old, source) => {\n if (source !== Quill.sources.USER) return;\n this.balanceTables();\n });\n return true;\n }\n return false;\n });\n },\n );\n }\n}\n\nexport default Table;\n","import Delta from 'quill-delta';\nimport { EmbedBlot, Scope } from 'parchment';\nimport Quill from '../core/quill.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport type { Range } from '../core/selection.js';\n\nconst debug = logger('quill:toolbar');\n\ntype Handler = (value: any) => void;\n\nexport type ToolbarConfig = Array<\n string[] | Array>\n>;\nexport interface ToolbarProps {\n container?: HTMLElement | ToolbarConfig | null;\n handlers?: Record;\n option?: number;\n module?: boolean;\n theme?: boolean;\n}\n\nclass Toolbar extends Module {\n static DEFAULTS: ToolbarProps;\n\n container?: HTMLElement | null;\n controls: [string, HTMLElement][];\n handlers: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n const container = document.createElement('div');\n container.setAttribute('role', 'toolbar');\n addControls(container, this.options.container);\n quill.container?.parentNode?.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n this.container = document.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n debug.error('Container required for toolbar', this.options);\n return;\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n if (this.options.handlers) {\n Object.keys(this.options.handlers).forEach((format) => {\n const handler = this.options.handlers?.[format];\n if (handler) {\n this.addHandler(format, handler);\n }\n });\n }\n Array.from(this.container.querySelectorAll('button, select')).forEach(\n (input) => {\n // @ts-expect-error\n this.attach(input);\n },\n );\n this.quill.on(Quill.events.EDITOR_CHANGE, () => {\n const [range] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format: string, handler: Handler) {\n this.handlers[format] = handler;\n }\n\n attach(input: HTMLElement) {\n let format = Array.from(input.classList).find((className) => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (\n this.handlers[format] == null &&\n this.quill.scroll.query(format) == null\n ) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n const eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, (e) => {\n let value;\n if (input.tagName === 'SELECT') {\n // @ts-expect-error\n if (input.selectedIndex < 0) return;\n // @ts-expect-error\n const selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n // @ts-expect-error\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n const [range] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (\n // @ts-expect-error\n this.quill.scroll.query(format).prototype instanceof EmbedBlot\n ) {\n value = prompt(`Enter ${format}`); // eslint-disable-line no-alert\n if (!value) return;\n this.quill.updateContents(\n new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index)\n // @ts-expect-error Fix me later\n .delete(range.length)\n .insert({ [format]: value }),\n Quill.sources.USER,\n );\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n this.controls.push([format, input]);\n }\n\n update(range: Range | null) {\n const formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach((pair) => {\n const [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option: HTMLOptionElement | null = null;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n // @ts-expect-error TODO fix me later\n input.value = ''; // TODO make configurable?\n // @ts-expect-error TODO fix me later\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else if (range == null) {\n input.classList.remove('ql-active');\n input.setAttribute('aria-pressed', 'false');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n const value = formats[format] as boolean | number | string | object;\n const isActive =\n value === input.getAttribute('value') ||\n (value != null && value.toString() === input.getAttribute('value')) ||\n (value == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n input.setAttribute('aria-pressed', isActive.toString());\n } else {\n const isActive = formats[format] != null;\n input.classList.toggle('ql-active', isActive);\n input.setAttribute('aria-pressed', isActive.toString());\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\nfunction addButton(container: HTMLElement, format: string, value?: string) {\n const input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add(`ql-${format}`);\n input.setAttribute('aria-pressed', 'false');\n if (value != null) {\n input.value = value;\n input.setAttribute('aria-label', `${format}: ${value}`);\n } else {\n input.setAttribute('aria-label', format);\n }\n container.appendChild(input);\n}\n\nfunction addControls(\n container: HTMLElement,\n groups:\n | (string | Record)[][]\n | (string | Record)[],\n) {\n if (!Array.isArray(groups[0])) {\n // @ts-expect-error\n groups = [groups];\n }\n groups.forEach((controls: any) => {\n const group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach((control: any) => {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n const format = Object.keys(control)[0];\n const value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(\n container: HTMLElement,\n format: string,\n values: Array,\n) {\n const input = document.createElement('select');\n input.classList.add(`ql-${format}`);\n values.forEach((value) => {\n const option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', String(value));\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean() {\n const range = this.quill.getSelection();\n if (range == null) return;\n if (range.length === 0) {\n const formats = this.quill.getFormat();\n Object.keys(formats).forEach((name) => {\n // Clean functionality in existing apps only clean inline formats\n if (this.quill.scroll.query(name, Scope.INLINE) != null) {\n this.quill.format(name, false, Quill.sources.USER);\n }\n });\n } else {\n this.quill.removeFormat(range, Quill.sources.USER);\n }\n },\n direction(value) {\n const { align } = this.quill.getFormat();\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n indent(value) {\n const range = this.quill.getSelection();\n const formats = this.quill.getFormat(range);\n const indent = parseInt(formats.indent || 0, 10);\n if (value === '+1' || value === '-1') {\n let modifier = value === '+1' ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n },\n link(value) {\n if (value === true) {\n value = prompt('Enter link URL:'); // eslint-disable-line no-alert\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n list(value) {\n const range = this.quill.getSelection();\n const formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats.list === 'checked' || formats.list === 'unchecked') {\n this.quill.format('list', false, Quill.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', Quill.sources.USER);\n }\n } else {\n this.quill.format('list', value, Quill.sources.USER);\n }\n },\n },\n};\n\nexport { Toolbar as default, addControls };\n","import alignLeftIcon from '../assets/icons/align-left.svg';\nimport alignCenterIcon from '../assets/icons/align-center.svg';\nimport alignRightIcon from '../assets/icons/align-right.svg';\nimport alignJustifyIcon from '../assets/icons/align-justify.svg';\nimport backgroundIcon from '../assets/icons/background.svg';\nimport blockquoteIcon from '../assets/icons/blockquote.svg';\nimport boldIcon from '../assets/icons/bold.svg';\nimport cleanIcon from '../assets/icons/clean.svg';\nimport codeIcon from '../assets/icons/code.svg';\nimport colorIcon from '../assets/icons/color.svg';\nimport directionLeftToRightIcon from '../assets/icons/direction-ltr.svg';\nimport directionRightToLeftIcon from '../assets/icons/direction-rtl.svg';\nimport formulaIcon from '../assets/icons/formula.svg';\nimport headerIcon from '../assets/icons/header.svg';\nimport header2Icon from '../assets/icons/header-2.svg';\nimport italicIcon from '../assets/icons/italic.svg';\nimport imageIcon from '../assets/icons/image.svg';\nimport indentIcon from '../assets/icons/indent.svg';\nimport outdentIcon from '../assets/icons/outdent.svg';\nimport linkIcon from '../assets/icons/link.svg';\nimport listBulletIcon from '../assets/icons/list-bullet.svg';\nimport listCheckIcon from '../assets/icons/list-check.svg';\nimport listOrderedIcon from '../assets/icons/list-ordered.svg';\nimport subscriptIcon from '../assets/icons/subscript.svg';\nimport superscriptIcon from '../assets/icons/superscript.svg';\nimport strikeIcon from '../assets/icons/strike.svg';\nimport tableIcon from '../assets/icons/table.svg';\nimport underlineIcon from '../assets/icons/underline.svg';\nimport videoIcon from '../assets/icons/video.svg';\n\nexport default {\n align: {\n '': alignLeftIcon,\n center: alignCenterIcon,\n right: alignRightIcon,\n justify: alignJustifyIcon,\n },\n background: backgroundIcon,\n blockquote: blockquoteIcon,\n bold: boldIcon,\n clean: cleanIcon,\n code: codeIcon,\n 'code-block': codeIcon,\n color: colorIcon,\n direction: {\n '': directionLeftToRightIcon,\n rtl: directionRightToLeftIcon,\n },\n formula: formulaIcon,\n header: {\n '1': headerIcon,\n '2': header2Icon,\n },\n italic: italicIcon,\n image: imageIcon,\n indent: {\n '+1': indentIcon,\n '-1': outdentIcon,\n },\n link: linkIcon,\n list: {\n bullet: listBulletIcon,\n check: listCheckIcon,\n ordered: listOrderedIcon,\n },\n script: {\n sub: subscriptIcon,\n super: superscriptIcon,\n },\n strike: strikeIcon,\n table: tableIcon,\n underline: underlineIcon,\n video: videoIcon,\n};\n","import DropdownIcon from '../assets/icons/dropdown.svg';\n\nlet optionsCounter = 0;\n\nfunction toggleAriaAttribute(element: HTMLElement, attribute: string) {\n element.setAttribute(\n attribute,\n `${!(element.getAttribute(attribute) === 'true')}`,\n );\n}\n\nclass Picker {\n select: HTMLSelectElement;\n container: HTMLElement;\n label: HTMLElement;\n\n constructor(select: HTMLSelectElement) {\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n // @ts-expect-error Fix me later\n this.select.parentNode.insertBefore(this.container, this.select);\n\n this.label.addEventListener('mousedown', () => {\n this.togglePicker();\n });\n this.label.addEventListener('keydown', (event) => {\n switch (event.key) {\n case 'Enter':\n this.togglePicker();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n togglePicker() {\n this.container.classList.toggle('ql-expanded');\n // Toggle aria-expanded and aria-hidden to make the picker accessible\n toggleAriaAttribute(this.label, 'aria-expanded');\n // @ts-expect-error\n toggleAriaAttribute(this.options, 'aria-hidden');\n }\n\n buildItem(option: HTMLOptionElement) {\n const item = document.createElement('span');\n // @ts-expect-error\n item.tabIndex = '0';\n item.setAttribute('role', 'button');\n item.classList.add('ql-picker-item');\n const value = option.getAttribute('value');\n if (value) {\n item.setAttribute('data-value', value);\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', () => {\n this.selectItem(item, true);\n });\n item.addEventListener('keydown', (event) => {\n switch (event.key) {\n case 'Enter':\n this.selectItem(item, true);\n event.preventDefault();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n\n return item;\n }\n\n buildLabel() {\n const label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = DropdownIcon;\n // @ts-expect-error\n label.tabIndex = '0';\n label.setAttribute('role', 'button');\n label.setAttribute('aria-expanded', 'false');\n this.container.appendChild(label);\n return label;\n }\n\n buildOptions() {\n const options = document.createElement('span');\n options.classList.add('ql-picker-options');\n\n // Don't want screen readers to read this until options are visible\n options.setAttribute('aria-hidden', 'true');\n // @ts-expect-error\n options.tabIndex = '-1';\n\n // Need a unique id for aria-controls\n options.id = `ql-picker-options-${optionsCounter}`;\n optionsCounter += 1;\n this.label.setAttribute('aria-controls', options.id);\n\n // @ts-expect-error\n this.options = options;\n\n Array.from(this.select.options).forEach((option) => {\n const item = this.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n this.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n\n buildPicker() {\n Array.from(this.select.attributes).forEach((item) => {\n this.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n\n escape() {\n // Close menu and return focus to trigger label\n this.close();\n // Need setTimeout for accessibility to ensure that the browser executes\n // focus on the next process thread and after any DOM content changes\n setTimeout(() => this.label.focus(), 1);\n }\n\n close() {\n this.container.classList.remove('ql-expanded');\n this.label.setAttribute('aria-expanded', 'false');\n // @ts-expect-error\n this.options.setAttribute('aria-hidden', 'true');\n }\n\n selectItem(item: HTMLElement | null, trigger = false) {\n const selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n // @ts-expect-error Fix me later\n this.select.selectedIndex = Array.from(item.parentNode.children).indexOf(\n item,\n );\n if (item.hasAttribute('data-value')) {\n // @ts-expect-error Fix me later\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n // @ts-expect-error Fix me later\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n this.select.dispatchEvent(new Event('change'));\n this.close();\n }\n }\n\n update() {\n let option;\n if (this.select.selectedIndex > -1) {\n const item =\n // @ts-expect-error Fix me later\n this.container.querySelector('.ql-picker-options').children[\n this.select.selectedIndex\n ];\n option = this.select.options[this.select.selectedIndex];\n // @ts-expect-error\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n const isActive =\n option != null &&\n option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n}\n\nexport default Picker;\n","import Picker from './picker.js';\n\nclass ColorPicker extends Picker {\n constructor(select: HTMLSelectElement, label: string) {\n super(select);\n this.label.innerHTML = label;\n this.container.classList.add('ql-color-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item'))\n .slice(0, 7)\n .forEach((item) => {\n item.classList.add('ql-primary');\n });\n }\n\n buildItem(option: HTMLOptionElement) {\n const item = super.buildItem(option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n\n selectItem(item: HTMLElement | null, trigger?: boolean) {\n super.selectItem(item, trigger);\n const colorLabel = this.label.querySelector('.ql-color-label');\n const value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n}\n\nexport default ColorPicker;\n","import Picker from './picker.js';\n\nclass IconPicker extends Picker {\n defaultItem: HTMLElement | null;\n\n constructor(select: HTMLSelectElement, icons: Record) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item')).forEach(\n (item) => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n },\n );\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n\n selectItem(target: HTMLElement | null, trigger?: boolean) {\n super.selectItem(target, trigger);\n const item = target || this.defaultItem;\n if (item != null) {\n if (this.label.innerHTML === item.innerHTML) return;\n this.label.innerHTML = item.innerHTML;\n }\n }\n}\n\nexport default IconPicker;\n","import type Quill from '../core.js';\nimport type { Bounds } from '../core/selection.js';\n\nconst isScrollable = (el: Element) => {\n const { overflowY } = getComputedStyle(el, null);\n return overflowY !== 'visible' && overflowY !== 'clip';\n};\n\nclass Tooltip {\n quill: Quill;\n boundsContainer: HTMLElement;\n root: HTMLDivElement;\n\n constructor(quill: Quill, boundsContainer?: HTMLElement) {\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n // @ts-expect-error\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (isScrollable(this.quill.root)) {\n this.quill.root.addEventListener('scroll', () => {\n this.root.style.marginTop = `${-1 * this.quill.root.scrollTop}px`;\n });\n }\n this.hide();\n }\n\n hide() {\n this.root.classList.add('ql-hidden');\n }\n\n position(reference: Bounds) {\n const left =\n reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n // root.scrollTop should be 0 if scrollContainer !== root\n const top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.classList.remove('ql-flip');\n const containerBounds = this.boundsContainer.getBoundingClientRect();\n const rootBounds = this.root.getBoundingClientRect();\n let shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n const height = rootBounds.bottom - rootBounds.top;\n const verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = `${top - verticalShift}px`;\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n\n show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n}\n\nexport default Tooltip;\n","import { merge } from 'lodash-es';\nimport type Quill from '../core/quill.js';\nimport Emitter from '../core/emitter.js';\nimport Theme from '../core/theme.js';\nimport type { ThemeOptions } from '../core/theme.js';\nimport ColorPicker from '../ui/color-picker.js';\nimport IconPicker from '../ui/icon-picker.js';\nimport Picker from '../ui/picker.js';\nimport Tooltip from '../ui/tooltip.js';\nimport type { Range } from '../core/selection.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type Uploader from '../modules/uploader.js';\nimport type Selection from '../core/selection.js';\n\nconst ALIGNS = [false, 'center', 'right', 'justify'];\n\nconst COLORS = [\n '#000000',\n '#e60000',\n '#ff9900',\n '#ffff00',\n '#008a00',\n '#0066cc',\n '#9933ff',\n '#ffffff',\n '#facccc',\n '#ffebcc',\n '#ffffcc',\n '#cce8cc',\n '#cce0f5',\n '#ebd6ff',\n '#bbbbbb',\n '#f06666',\n '#ffc266',\n '#ffff66',\n '#66b966',\n '#66a3e0',\n '#c285ff',\n '#888888',\n '#a10000',\n '#b26b00',\n '#b2b200',\n '#006100',\n '#0047b2',\n '#6b24b2',\n '#444444',\n '#5c0000',\n '#663d00',\n '#666600',\n '#003700',\n '#002966',\n '#3d1466',\n];\n\nconst FONTS = [false, 'serif', 'monospace'];\n\nconst HEADERS = ['1', '2', '3', false];\n\nconst SIZES = ['small', false, 'large', 'huge'];\n\nclass BaseTheme extends Theme {\n pickers: Picker[];\n tooltip?: Tooltip;\n\n constructor(quill: Quill, options: ThemeOptions) {\n super(quill, options);\n const listener = (e: MouseEvent) => {\n if (!document.body.contains(quill.root)) {\n document.body.removeEventListener('click', listener);\n return;\n }\n if (\n this.tooltip != null &&\n // @ts-expect-error\n !this.tooltip.root.contains(e.target) &&\n // @ts-expect-error\n document.activeElement !== this.tooltip.textbox &&\n !this.quill.hasFocus()\n ) {\n this.tooltip.hide();\n }\n if (this.pickers != null) {\n this.pickers.forEach((picker) => {\n // @ts-expect-error\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n }\n\n addModule(name: 'clipboard'): Clipboard;\n addModule(name: 'keyboard'): Keyboard;\n addModule(name: 'uploader'): Uploader;\n addModule(name: 'history'): History;\n addModule(name: 'selection'): Selection;\n addModule(name: string): unknown;\n addModule(name: string) {\n const module = super.addModule(name);\n if (name === 'toolbar') {\n // @ts-expect-error\n this.extendToolbar(module);\n }\n return module;\n }\n\n buildButtons(\n buttons: NodeListOf,\n icons: Record | string>,\n ) {\n Array.from(buttons).forEach((button) => {\n const className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach((name) => {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n // @ts-expect-error\n button.innerHTML = icons[name][''] + icons[name].rtl;\n } else if (typeof icons[name] === 'string') {\n // @ts-expect-error\n button.innerHTML = icons[name];\n } else {\n // @ts-expect-error\n const value = button.value || '';\n // @ts-expect-error\n if (value != null && icons[name][value]) {\n // @ts-expect-error\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n\n buildPickers(\n selects: NodeListOf,\n icons: Record>,\n ) {\n this.pickers = Array.from(selects).map((select) => {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n if (typeof icons.align === 'object') {\n return new IconPicker(select, icons.align);\n }\n }\n if (\n select.classList.contains('ql-background') ||\n select.classList.contains('ql-color')\n ) {\n const format = select.classList.contains('ql-background')\n ? 'background'\n : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(\n select,\n COLORS,\n format === 'background' ? '#ffffff' : '#000000',\n );\n }\n return new ColorPicker(select, icons[format] as string);\n }\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new Picker(select);\n });\n const update = () => {\n this.pickers.forEach((picker) => {\n picker.update();\n });\n };\n this.quill.on(Emitter.events.EDITOR_CHANGE, update);\n }\n}\nBaseTheme.DEFAULTS = merge({}, Theme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula() {\n this.quill.theme.tooltip.edit('formula');\n },\n image() {\n let fileInput = this.container.querySelector(\n 'input.ql-image[type=file]',\n );\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute(\n 'accept',\n this.quill.uploader.options.mimetypes.join(', '),\n );\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', () => {\n const range = this.quill.getSelection(true);\n this.quill.uploader.upload(range, fileInput.files);\n fileInput.value = '';\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video() {\n this.quill.theme.tooltip.edit('video');\n },\n },\n },\n },\n});\n\nclass BaseTooltip extends Tooltip {\n textbox: HTMLInputElement | null;\n linkRange?: Range;\n\n constructor(quill: Quill, boundsContainer?: HTMLElement) {\n super(quill, boundsContainer);\n this.textbox = this.root.querySelector('input[type=\"text\"]');\n this.listen();\n }\n\n listen() {\n // @ts-expect-error Fix me later\n this.textbox.addEventListener('keydown', (event) => {\n if (event.key === 'Enter') {\n this.save();\n event.preventDefault();\n } else if (event.key === 'Escape') {\n this.cancel();\n event.preventDefault();\n }\n });\n }\n\n cancel() {\n this.hide();\n this.restoreFocus();\n }\n\n edit(mode = 'link', preview: string | null = null) {\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (this.textbox == null) return;\n\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n const bounds = this.quill.getBounds(this.quill.selection.savedRange);\n if (bounds != null) {\n this.position(bounds);\n }\n this.textbox.select();\n this.textbox.setAttribute(\n 'placeholder',\n this.textbox.getAttribute(`data-${mode}`) || '',\n );\n this.root.setAttribute('data-mode', mode);\n }\n\n restoreFocus() {\n this.quill.focus({ preventScroll: true });\n }\n\n save() {\n // @ts-expect-error Fix me later\n let { value } = this.textbox;\n switch (this.root.getAttribute('data-mode')) {\n case 'link': {\n const { scrollTop } = this.quill.root;\n if (this.linkRange) {\n this.quill.formatText(\n this.linkRange,\n 'link',\n value,\n Emitter.sources.USER,\n );\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, Emitter.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video': {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula': {\n if (!value) break;\n const range = this.quill.getSelection(true);\n if (range != null) {\n const index = range.index + range.length;\n this.quill.insertEmbed(\n index,\n // @ts-expect-error Fix me later\n this.root.getAttribute('data-mode'),\n value,\n Emitter.sources.USER,\n );\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER);\n }\n this.quill.setSelection(index + 2, Emitter.sources.USER);\n }\n break;\n }\n default:\n }\n // @ts-expect-error Fix me later\n this.textbox.value = '';\n this.hide();\n }\n}\n\nfunction extractVideoUrl(url: string) {\n let match =\n url.match(\n /^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/,\n ) ||\n url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return `${match[1] || 'https'}://www.youtube.com/embed/${\n match[2]\n }?showinfo=0`;\n }\n // eslint-disable-next-line no-cond-assign\n if ((match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/))) {\n return `${match[1] || 'https'}://player.vimeo.com/video/${match[2]}/`;\n }\n return url;\n}\n\nfunction fillSelect(\n select: HTMLSelectElement,\n values: Array,\n defaultValue: unknown = false,\n) {\n values.forEach((value) => {\n const option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', String(value));\n }\n select.appendChild(option);\n });\n}\n\nexport { BaseTooltip, BaseTheme as default };\n","import { merge } from 'lodash-es';\nimport Emitter from '../core/emitter.js';\nimport BaseTheme, { BaseTooltip } from './base.js';\nimport { Range } from '../core/selection.js';\nimport type { Bounds } from '../core/selection.js';\nimport icons from '../ui/icons.js';\nimport type Quill from '../core.js';\nimport type { ThemeOptions } from '../core/theme.js';\nimport type Toolbar from '../modules/toolbar.js';\nimport type { ToolbarConfig } from '../modules/toolbar.js';\n\nconst TOOLBAR_CONFIG: ToolbarConfig = [\n ['bold', 'italic', 'link'],\n [{ header: 1 }, { header: 2 }, 'blockquote'],\n];\n\nclass BubbleTooltip extends BaseTooltip {\n static TEMPLATE = [\n '',\n '
    ',\n '',\n '',\n '
    ',\n ].join('');\n\n constructor(quill: Quill, bounds?: HTMLElement) {\n super(quill, bounds);\n this.quill.on(\n Emitter.events.EDITOR_CHANGE,\n (type, range, oldRange, source) => {\n if (type !== Emitter.events.SELECTION_CHANGE) return;\n if (\n range != null &&\n range.length > 0 &&\n source === Emitter.sources.USER\n ) {\n this.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n this.root.style.left = '0px';\n this.root.style.width = '';\n this.root.style.width = `${this.root.offsetWidth}px`;\n const lines = this.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n const bounds = this.quill.getBounds(range);\n if (bounds != null) {\n this.position(bounds);\n }\n } else {\n const lastLine = lines[lines.length - 1];\n const index = this.quill.getIndex(lastLine);\n const length = Math.min(\n lastLine.length() - 1,\n range.index + range.length - index,\n );\n const indexBounds = this.quill.getBounds(new Range(index, length));\n if (indexBounds != null) {\n this.position(indexBounds);\n }\n }\n } else if (\n document.activeElement !== this.textbox &&\n this.quill.hasFocus()\n ) {\n this.hide();\n }\n },\n );\n }\n\n listen() {\n super.listen();\n // @ts-expect-error Fix me later\n this.root.querySelector('.ql-close').addEventListener('click', () => {\n this.root.classList.remove('ql-editing');\n });\n this.quill.on(Emitter.events.SCROLL_OPTIMIZE, () => {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(() => {\n if (this.root.classList.contains('ql-hidden')) return;\n const range = this.quill.getSelection();\n if (range != null) {\n const bounds = this.quill.getBounds(range);\n if (bounds != null) {\n this.position(bounds);\n }\n }\n }, 1);\n });\n }\n\n cancel() {\n this.show();\n }\n\n position(reference: Bounds) {\n const shift = super.position(reference);\n const arrow = this.root.querySelector('.ql-tooltip-arrow');\n // @ts-expect-error\n arrow.style.marginLeft = '';\n if (shift !== 0) {\n // @ts-expect-error\n arrow.style.marginLeft = `${-1 * shift - arrow.offsetWidth / 2}px`;\n }\n return shift;\n }\n}\n\nclass BubbleTheme extends BaseTheme {\n tooltip: BubbleTooltip;\n\n constructor(quill: Quill, options: ThemeOptions) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-bubble');\n }\n\n extendToolbar(toolbar: Toolbar) {\n // @ts-expect-error\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n if (toolbar.container != null) {\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n }\n }\n}\nBubbleTheme.DEFAULTS = merge({}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value: string) {\n if (!value) {\n this.quill.format('link', false);\n } else {\n this.quill.theme.tooltip.edit();\n }\n },\n },\n },\n },\n});\n\nexport { BubbleTooltip, BubbleTheme as default };\n","import { merge } from 'lodash-es';\nimport Emitter from '../core/emitter.js';\nimport BaseTheme, { BaseTooltip } from './base.js';\nimport LinkBlot from '../formats/link.js';\nimport { Range } from '../core/selection.js';\nimport icons from '../ui/icons.js';\nimport type Quill from '../core.js';\nimport type { Context } from '../modules/keyboard.js';\nimport type Toolbar from '../modules/toolbar.js';\nimport type { ToolbarConfig } from '../modules/toolbar.js';\nimport type { ThemeOptions } from '../core/theme.js';\n\nconst TOOLBAR_CONFIG: ToolbarConfig = [\n [{ header: ['1', '2', '3', false] }],\n ['bold', 'italic', 'underline', 'link'],\n [{ list: 'ordered' }, { list: 'bullet' }],\n ['clean'],\n];\n\nclass SnowTooltip extends BaseTooltip {\n static TEMPLATE = [\n '',\n '',\n '',\n '',\n ].join('');\n\n preview = this.root.querySelector('a.ql-preview');\n\n listen() {\n super.listen();\n // @ts-expect-error Fix me later\n this.root\n .querySelector('a.ql-action')\n .addEventListener('click', (event) => {\n if (this.root.classList.contains('ql-editing')) {\n this.save();\n } else {\n // @ts-expect-error Fix me later\n this.edit('link', this.preview.textContent);\n }\n event.preventDefault();\n });\n // @ts-expect-error Fix me later\n this.root\n .querySelector('a.ql-remove')\n .addEventListener('click', (event) => {\n if (this.linkRange != null) {\n const range = this.linkRange;\n this.restoreFocus();\n this.quill.formatText(range, 'link', false, Emitter.sources.USER);\n delete this.linkRange;\n }\n event.preventDefault();\n this.hide();\n });\n this.quill.on(\n Emitter.events.SELECTION_CHANGE,\n (range, oldRange, source) => {\n if (range == null) return;\n if (range.length === 0 && source === Emitter.sources.USER) {\n const [link, offset] = this.quill.scroll.descendant(\n LinkBlot,\n range.index,\n );\n if (link != null) {\n this.linkRange = new Range(range.index - offset, link.length());\n const preview = LinkBlot.formats(link.domNode);\n // @ts-expect-error Fix me later\n this.preview.textContent = preview;\n // @ts-expect-error Fix me later\n this.preview.setAttribute('href', preview);\n this.show();\n const bounds = this.quill.getBounds(this.linkRange);\n if (bounds != null) {\n this.position(bounds);\n }\n return;\n }\n } else {\n delete this.linkRange;\n }\n this.hide();\n },\n );\n }\n\n show() {\n super.show();\n this.root.removeAttribute('data-mode');\n }\n}\n\nclass SnowTheme extends BaseTheme {\n constructor(quill: Quill, options: ThemeOptions) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-snow');\n }\n\n extendToolbar(toolbar: Toolbar) {\n if (toolbar.container != null) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n // @ts-expect-error\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding(\n { key: 'k', shortKey: true },\n (_range: Range, context: Context) => {\n toolbar.handlers.link.call(toolbar, !context.format.link);\n },\n );\n }\n }\n }\n}\nSnowTheme.DEFAULTS = merge({}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value: string) {\n if (value) {\n const range = this.quill.getSelection();\n if (range == null || range.length === 0) return;\n let preview = this.quill.getText(range);\n if (\n /^\\S+@\\S+\\.\\S+$/.test(preview) &&\n preview.indexOf('mailto:') !== 0\n ) {\n preview = `mailto:${preview}`;\n }\n const { tooltip } = this.quill.theme;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false);\n }\n },\n },\n },\n },\n});\n\nexport default SnowTheme;\n","import Quill from './core.js';\n\nimport { AlignClass, AlignStyle } from './formats/align.js';\nimport {\n DirectionAttribute,\n DirectionClass,\n DirectionStyle,\n} from './formats/direction.js';\nimport Indent from './formats/indent.js';\n\nimport Blockquote from './formats/blockquote.js';\nimport Header from './formats/header.js';\nimport List from './formats/list.js';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background.js';\nimport { ColorClass, ColorStyle } from './formats/color.js';\nimport { FontClass, FontStyle } from './formats/font.js';\nimport { SizeClass, SizeStyle } from './formats/size.js';\n\nimport Bold from './formats/bold.js';\nimport Italic from './formats/italic.js';\nimport Link from './formats/link.js';\nimport Script from './formats/script.js';\nimport Strike from './formats/strike.js';\nimport Underline from './formats/underline.js';\n\nimport Formula from './formats/formula.js';\nimport Image from './formats/image.js';\nimport Video from './formats/video.js';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code.js';\n\nimport Syntax from './modules/syntax.js';\nimport Table from './modules/table.js';\nimport Toolbar from './modules/toolbar.js';\n\nimport Icons from './ui/icons.js';\nimport Picker from './ui/picker.js';\nimport ColorPicker from './ui/color-picker.js';\nimport IconPicker from './ui/icon-picker.js';\nimport Tooltip from './ui/tooltip.js';\n\nimport BubbleTheme from './themes/bubble.js';\nimport SnowTheme from './themes/snow.js';\n\nQuill.register(\n {\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle,\n },\n true,\n);\n\nQuill.register(\n {\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/formula': Formula,\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'modules/syntax': Syntax,\n 'modules/table': Table,\n 'modules/toolbar': Toolbar,\n\n 'themes/bubble': BubbleTheme,\n 'themes/snow': SnowTheme,\n\n 'ui/icons': Icons,\n 'ui/picker': Picker,\n 'ui/icon-picker': IconPicker,\n 'ui/color-picker': ColorPicker,\n 'ui/tooltip': Tooltip,\n },\n true,\n);\n\nexport default Quill;\n","import Bold from './bold.js';\n\nclass Italic extends Bold {\n static blotName = 'italic';\n static tagName = ['EM', 'I'];\n}\n\nexport default Italic;\n","import Bold from './bold.js';\n\nclass Strike extends Bold {\n static blotName = 'strike';\n static tagName = ['S', 'STRIKE'];\n}\n\nexport default Strike;\n"],"names":["root","factory","exports","module","define","amd","self","Block","BlockBlot","cache","delta","this","blockDelta","deleteAt","index","length","super","formatAt","name","value","scroll","query","Scope","BLOCK","format","Math","min","insertAt","def","lines","split","text","shift","children","tail","block","reduce","lineIndex","line","insertBefore","blot","ref","head","Break","remove","moveChildren","target","optimize","context","path","removeChild","child","force","arguments","undefined","clone","parent","next","blotName","tagName","defaultChild","allowedChildren","Inline","EmbedBlot","TextBlot","BlockEmbed","attach","attributes","AttributorStore","domNode","Delta","insert","formats","values","attribute","BLOCK_ATTRIBUTE","pop","blocks","map","create","forEach","filter","descendants","LeafBlot","leaf","bubbleFormats","statics","scope","BLOCK_BLOT","prev","Container","ContainerBlot","Cursor","static","constructor","selection","textNode","document","createTextNode","CONTENTS","appendChild","savedLength","detach","offset","node","position","data","restore","composing","range","getNativeRange","lastChild","parentNode","prevTextBlot","prevTextLength","nextTextBlot","nextText","newText","join","mergedTextBlot","newTextNode","remapOffset","start","end","startNode","startOffset","endNode","endOffset","update","mutations","some","mutation","type","isolate","unwrap","GUARD_TEXT","Embed","contentNode","createElement","setAttribute","Array","from","childNodes","childNode","leftGuard","rightGuard","prevLength","InlineBlot","Text","compare","other","selfIndex","order","indexOf","otherIndex","BLOT","wrap","escapeText","replace","s","isLine","isUpdatable","updateContent","Scroll","ScrollBlot","registry","_ref","emitter","batch","enable","addEventListener","e","handleDragStart","batchStart","isArray","batchEnd","emitMount","emit","Emitter","events","SCROLL_BLOT_MOUNT","emitUnmount","SCROLL_BLOT_UNMOUNT","emitEmbedUpdate","change","SCROLL_EMBED_UPDATE","first","last","enabled","endsWith","slice","embed","INLINE_BLOT","wrapper","insertContents","renderBlocks","deltaToRenderBlocks","concat","shouldInsertNewlineChar","descendant","key","insertInlineContents","newlineCharLength","lineEndIndex","AttributeMap","diff","Object","keys","refBlot","refBlotOffset","find","renderBlock","createBlock","blockEmbed","isEnabled","getAttribute","Number","MAX_VALUE","getLines","blotIndex","blotLength","lengthLeft","forEachAt","childIndex","childLength","push","SCROLL_OPTIMIZE","source","sources","USER","observer","takeRecords","_ref2","SCROLL_BEFORE_UPDATE","SCROLL_UPDATE","updateEmbedAt","b","event","preventDefault","currentBlockDelta","op","splitted","INLINE","entries","_ref3","_ref4","inlineContents","Op","History","Module","lastRecorded","ignoreChange","stack","undo","redo","currentRange","quill","options","on","Quill","EDITOR_CHANGE","eventName","oldValue","SELECTION_CHANGE","SILENT","TEXT_CHANGE","userOnly","transform","record","transformRange","keyboard","addBinding","shortKey","bind","shiftKey","test","navigator","platform","inputType","dest","item","base","getContents","inverseDelta","invert","updateContents","restoreSelection","clear","cutoff","changeDelta","oldDelta","ops","undoDelta","undoRange","timestamp","Date","now","delay","compose","maxStack","transformStack","stackItem","setSelection","deleteLength","delete","changeIndex","lastOp","attr","endsWithNewlineChange","getLastChangeIndex","remoteDelta","i","oldItem","splice","transformPosition","DEFAULTS","Uploader","native","caretRangeFromPoint","clientX","clientY","caretPositionFromPoint","createRange","setStart","offsetNode","setEnd","normalized","normalizeNative","normalizedToRange","dataTransfer","files","upload","uploads","file","mimetypes","includes","handler","call","promises","Promise","resolve","reader","FileReader","onload","result","readAsDataURL","all","then","images","image","retain","INSERT_TYPES","Input","handleBeforeInput","userAgent","COMPOSITION_BEFORE_START","handleCompositionStart","deleteRange","replaceText","getFormat","composition","isComposing","defaultPrevented","staticRange","getTargetRanges","collapsed","types","getData","getPlainTextFromInputEvent","getSelection","isMac","UINode","isListening","selectionChangeDeadline","handleArrowKeys","handleNavigationShortcuts","ParentBlot","uiNode","isRTL","getComputedStyle","ctrlKey","canMoveCaretBeforeUINode","ensureListeningToSelectionChange","listener","handleSelectionChange","once","getRangeAt","startContainer","newRange","setStartAfter","setEndAfter","removeAllRanges","addRange","register","Clipboard","Keyboard","debug","logger","_len","args","_key","querySelectorAll","instances","get","handleDOM","EventEmitter","COMPOSITION_START","COMPOSITION_BEFORE_END","COMPOSITION_END","API","domListeners","error","_len2","_key2","log","_len3","_key3","contains","listenDOM","WeakMap","levels","level","method","console","namespace","ns","newLevel","ASCII","convertListHTML","items","lastIndent","endTag","getListType","indent","rest","tag","convertHTML","previousType","isRoot","html","list","parts","outerHTML","innerHTML","Element","combineFormats","combined","merged","combinedValue","normalizeDelta","normalizedDelta","shiftRange","amount","Range","getDelta","applyDelta","scrollLength","deleteDelta","splitOpLines","isImplicitNewlinePrepended","isImplicitNewlineAppended","merge","isInlineEmbed","prependedLength","addedLength","deleteText","formatLine","max","cloneDeep","formatText","leaves","lineFormats","leafFormats","blots","getHTML","lineOffset","lineLength","getText","contents","insertEmbed","insertText","isBlank","removeFormat","suffixLength","suffix","selectionInfo","match","textBlot","CursorBlot","oldText","relativeSelectionInfo","oldRange","isEqual","setupListeners","queueMicrotask","handleCompositionEnd","Node","getElementRect","element","rect","getBoundingClientRect","scaleX","abs","width","offsetWidth","scaleY","height","offsetHeight","top","right","left","clientWidth","bottom","clientHeight","paddingValueToInt","number","parseInt","isNaN","getScrollDistance","targetStart","targetEnd","scrollStart","scrollEnd","scrollPaddingStart","scrollPaddingEnd","CORE_FORMATS","globalRegistry","Parchment","uiClass","bounds","modules","clipboard","history","uploader","placeholder","readOnly","theme","parchment","Theme","limit","bubble","import","imports","overwrite","attrName","warn","startsWith","container","containerOrSelector","resolveSelector","Error","quillModuleDefaults","quillDefaults","themeModuleDefaults","themeDefaults","expandModuleConfig","toolbar","config","createRegistryWithFormats","sourceRegistry","Registry","coreBlot","iterations","requiredContainer","modulesWithDefaults","moduleClass","expandConfig","trim","classList","add","set","addContainer","scrollBlotName","editor","Editor","Selection","Composition","addModule","init","toggle","lastRange","getRange","modify","convert","setContents","disable","allowReadOnlyEdits","refNode","className","blur","setRange","overload","editReadOnly","modifier","focus","preventScroll","scrollSelectionIntoView","getBounds","containerBounds","getLength","getIndex","getLeaf","getLine","getModule","getSemanticHTML","hasFocus","off","scrollRectIntoView","targetRect","ownerDocument","current","isDocumentBody","body","bounding","window","visualViewport","documentElement","style","scrollDistanceX","scrollPaddingLeft","scrollPaddingRight","scrollDistanceY","scrollPaddingTop","scrollPaddingBottom","defaultView","scrollBy","scrollLeft","scrollTop","scrolledLeft","scrolledTop","parentElement","getRootNode","host","scrollIntoView","delete1","applied","delete2","setText","selector","querySelector","expanded","lengthOrSource","pos","mouseDown","cursor","savedRange","lastNative","handleComposition","handleDragging","setTimeout","setNativeRange","triggeredByTyping","ignored","nativeRange","after","nextLine","side","rangeCount","info","isConnected","activeElement","positions","indexes","endContainer","rangeToNative","getPosition","inclusive","leafOffset","default","ModuleClass","whitelist","AlignAttribute","Attributor","AlignClass","ClassAttributor","AlignStyle","StyleAttributor","BackgroundClass","BackgroundStyle","ColorAttributor","CodeBlockContainer","code","innerText","CodeBlock","Code","component","toString","ColorClass","ColorStyle","DirectionAttribute","DirectionClass","DirectionStyle","FontClass","FontStyleAttributor","FontStyle","SizeClass","SizeStyle","normalWeightRegexp","blockTagNames","isBlockElement","ignoreRegexp","idRegexp","indentRegexp","NORMALIZERS","doc","msoList","others","listItems","parseListItem","idMatch","id","indentMatch","typeRegexp","RegExp","typeMatch","parsed","childListItems","nextElementSibling","ul","listItem","li","replaceChild","normalizeListItem","fragment","createDocumentFragment","append","normalizeFontWeight","br","previousElementSibling","normalizeEmptyLines","CLIPBOARD_CONFIG","TEXT_NODE","isPre","isBetweenInlineElements","replacer","collapse","replaced","previousSibling","nextSibling","matchNewline","deltaEndsWith","ELEMENT_NODE","prototype","applyFormat","classes","styles","ATTRIBUTE","ATTRIBUTE_ATTRIBUTORS","keyName","STYLE_ATTRIBUTORS","newDelta","fontStyle","italic","textDecoration","underline","strike","fontWeight","bold","_ref5","parseFloat","textIndent","composed","table","createMatchAlias","memo","onCaptureCopy","onCapturePaste","matchers","matcher","addMatcher","normalizeHTML","normalize","normalizeExternalHTML","DOMParser","parseFromString","nodeMatches","elementMatchers","textMatchers","prepareMatching","traverse","dangerouslyPasteHTML","paste","isCut","onCopy","clipboardData","setData","childElementCount","firstElementChild","onPaste","pastedDelta","pair","has","matches","endText","toLowerCase","preNodes","nodeType","childrenDelta","reducedDelta","_node","HTMLParagraphElement","firstChild","SHORTKEY","evt","binding","which","bindings","handleEnter","metaKey","altKey","handleBackspace","handleDelete","prefix","handleDeleteRange","listen","keyBinding","singleBinding","leafStart","offsetStart","leafEnd","offsetEnd","prefixText","suffixText","curContext","empty","every","curFormats","prevFormats","formatDelta","nextFormats","defaultOptions","makeFormatHandler","outdent","makeCodeBlockHandler","tab","header","row","cell","getTable","_table","tableSide","blockquote","numLines","cur","makeEmbedArrowHandler","makeTableArrowHandler","TAB","textContent","up","targetRow","targetCell","targetLine","firstFormats","lastFormats","hasOwnProperty","Events","EE","fn","addListener","TypeError","_events","_eventsCount","clearEvent","__proto__","eventNames","names","getOwnPropertySymbols","listeners","handlers","l","ee","listenerCount","a1","a2","a3","a4","a5","len","removeListener","apply","j","removeAllListeners","prefixed","DIFF_DELETE","DIFF_INSERT","DIFF_EQUAL","diff_main","text1","text2","cursor_pos","cleanup","_fix_unicode","editdiff","oldLength","newLength","oldCursor","oldBefore","oldAfter","maybeNewCursor","newCursor","newBefore","newAfter","prefixLength","oldPrefix","newPrefix","make_edit_splice","oldSuffix","newSuffix","find_cursor_edit_diff","commonlength","diff_commonPrefix","commonprefix","substring","diff_commonSuffix","commonsuffix","diffs","longtext","shorttext","hm","diff_halfMatchI_","best_longtext_a","best_longtext_b","best_shorttext_a","best_shorttext_b","seed","floor","best_common","text1_a","text1_b","text2_a","text2_b","hm1","ceil","hm2","diff_halfMatch_","mid_common","diffs_a","diffs_b","text1_length","text2_length","max_d","v_offset","v_length","v1","v2","x","front","k1start","k1end","k2start","k2end","d","k1","k1_offset","y1","x1","charAt","k2_offset","x2","diff_bisectSplit_","k2","y2","diff_bisect_","diff_compute_","unshift","diff_cleanupMerge","changes","equalities","equalitiesLength","lastequality","pointer","length_insertions1","length_deletions1","length_insertions2","length_deletions2","diff_cleanupSemanticScore_","one","two","char1","char2","nonAlphaNumeric1","nonAlphaNumericRegex_","nonAlphaNumeric2","whitespace1","whitespaceRegex_","whitespace2","lineBreak1","linebreakRegex_","lineBreak2","blankLine1","blanklineEndRegex_","blankLine2","blanklineStartRegex_","equality1","edit","equality2","commonOffset","commonString","bestEquality1","bestEdit","bestEquality2","bestScore","score","diff_cleanupSemanticLossless","deletion","insertion","overlap_length1","diff_commonOverlap_","overlap_length2","diff_cleanupSemantic","y","text1a","text2a","text1b","text2b","diffsb","pointermin","pointermax","pointermid","pointerstart","is_surrogate_pair_start","charCodeAt","text_length","best","pattern","found","pointerend","is_surrogate_pair_end","fix_unicode","count_delete","count_insert","text_delete","text_insert","previous_equality","ends_with_pair_start","stray","k","starts_with_pair_end","n","charCode","str","before","oldMiddle","newMiddle","tuples","ret","remove_empty_tuples","INSERT","DELETE","EQUAL","HASH_UNDEFINED","MAX_SAFE_INTEGER","argsTag","boolTag","dateTag","funcTag","genTag","mapTag","numberTag","objectTag","promiseTag","regexpTag","setTag","stringTag","symbolTag","weakMapTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","reFlags","reIsHostCtor","reIsUint","cloneableTags","freeGlobal","g","freeSelf","Function","freeExports","freeModule","moduleExports","addMapEntry","addSetEntry","arrayReduce","array","iteratee","accumulator","initAccum","isHostObject","mapToArray","size","overArg","func","arg","setToArray","uid","arrayProto","funcProto","objectProto","coreJsData","maskSrcKey","exec","IE_PROTO","funcToString","objectToString","reIsNative","Buffer","Symbol","Uint8Array","getPrototype","getPrototypeOf","objectCreate","propertyIsEnumerable","nativeGetSymbols","nativeIsBuffer","isBuffer","nativeKeys","DataView","getNative","Map","Set","nativeCreate","dataViewCtorString","toSource","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","symbolValueOf","valueOf","Hash","entry","ListCache","MapCache","Stack","__data__","assignValue","object","objValue","eq","assocIndexOf","baseClone","isDeep","isFull","customizer","isObject","isArr","input","initCloneArray","copyArray","getTag","isFunc","buffer","copy","cloneBuffer","isPrototype","proto","initCloneObject","copyObject","getSymbols","copySymbols","baseAssign","cloneFunc","symbol","Ctor","cloneArrayBuffer","dataView","byteOffset","byteLength","cloneDataView","typedArray","cloneTypedArray","cloneMap","regexp","lastIndex","cloneRegExp","cloneSet","initCloneByTag","stacked","props","keysFunc","symbolsFunc","arrayPush","baseGetAllKeys","getAllKeys","arrayEach","subValue","arrayBuffer","newValue","getMapData","getValue","isFunction","baseIsNative","pairs","LARGE_ARRAY_SIZE","isIndex","ArrayBuffer","ctorString","isArrayLike","isLength","inherited","isObjectLike","isArrayLikeObject","isArguments","baseTimes","String","skipIndexes","arrayLikeKeys","baseKeys","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","arrayTag","asyncTag","errorTag","nullTag","proxyTag","undefinedTag","typedArrayTags","freeProcess","process","nodeUtil","nodeIsTypedArray","isTypedArray","arraySome","predicate","nativeObjectToString","symToStringTag","toStringTag","SetCache","baseGetTag","isOwn","unmasked","getRawTag","baseIsArguments","baseIsEqual","bitmask","equalFunc","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","message","isPartial","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","objProps","objLength","skipCtor","othValue","compared","objCtor","othCtor","equalObjects","baseIsEqualDeep","arrLength","othLength","seen","arrValue","othIndex","isMasked","resIndex","arrayFilter","baseUnary","isArg","isBuff","isType","a","keepNull","attrs","baseInverted","priority","OpIterator","NULL_CHARACTER","fromCharCode","getEmbedTypeAndData","embedType","registerEmbed","unregisterEmbed","getHandler","newOp","chop","partition","passed","failed","initialValue","changeLength","elem","Infinity","iter","hasNext","nextOp","thisIter","otherIter","firstOther","peek","firstLeft","peekType","peekLength","thisOp","otherOp","action","thisData","otherData","strings","retDelta","diffResult","opLength","eachLine","newline","inverted","baseIndex","baseOp","opData","baseOpData","transformedData","nextType","retOp","substr","allocUnsafe","isNew","defineProperty","global","stubArray","require","keysIn","nodeIsMap","isMap","nodeIsSet","isSet","isFlat","arrStacked","othStacked","objStacked","isProto","count","lastCalled","assigner","iterable","objectCtorString","srcIndex","mergeFunc","srcValue","isCommon","isTyped","baseMerge","nativeMax","string","nativeNow","stamp","remaining","otherArgs","thisArg","guard","TYPE","LEVEL","INLINE_ATTRIBUTE","ANY","attributeBit","canAdd","removeAttribute","ParchmentError","_Registry","tags","blotClass","inline","definitions","definition","isBlot","isAttr","toUpperCase","camelize","part","build","move","_ShadowBlot","rawValue","cloneNode","_context","replaceWith","replacement","_force","_mutations","ShadowBlot","_LeafBlot","_domNode","compareDocumentPosition","DOCUMENT_POSITION_CONTAINED_BY","_inclusive","LinkedList","nodes","at","iterator","curNode","callback","curIndex","curLength","makeAttachedBlot","_ParentBlot","attachUI","reverse","err","criteria","enforceAllowedChildren","done","splitAfter","childBlot","refDomNode","targetParent","_length","addedNodes","removedNodes","sort","DOCUMENT_POSITION_FOLLOWING","_InlineBlot","obj1","obj2","prop","_BlockBlot","_ContainerBlot","checkMerge","_scroll","OBSERVER_CONFIG","characterData","characterDataOldValue","childList","subtree","_ScrollBlot","MutationObserver","observe","disconnect","mutationsMap","records","mark","markParent","grandChild","_TextBlot","splitText","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","loaded","__webpack_modules__","getter","__esModule","o","enumerable","globalThis","obj","r","nmd","paths","IndentAttributor","normalizedValue","Blockquote","Header","ListContainer","ListItem","ui","listEventHandler","Bold","Link","sanitize","url","PROTOCOL_WHITELIST","SANITIZED_URL","protocols","anchor","href","protocol","Script","Underline","Formula","katex","render","throwOnError","errorColor","formula","ATTRIBUTES","Image","hasAttribute","Video","video","TokenAttributor","CodeToken","SyntaxCodeBlock","SyntaxCodeBlockContainer","forceNext","highlight","forced","language","cachedText","codeBlock","BreakBlot","Syntax","hljs","languages","highlightBlot","initListener","initTimer","select","label","option","timer","clearTimeout","interval","lib","versionString","majorVersion","nodeText","TableCell","tableId","cellOffset","rowOffset","TableRow","thisHead","thisTail","nextHead","nextTail","childFormats","TableBody","TableContainer","balanceCells","rows","maxColumns","fill","cells","column","deleteColumn","insertColumn","insertRow","random","Table","listenBalanceCells","balanceTables","deleteRow","deleteTable","insertColumnLeft","insertColumnRight","insertRowAbove","insertRowBelow","insertTable","columns","old","Toolbar","groups","controls","group","control","addButton","addSelect","addControls","HTMLElement","addHandler","selectedIndex","selected","prompt","isActive","clean","direction","align","link","center","justify","background","codeIcon","color","rtl","bullet","check","ordered","script","sub","optionsCounter","toggleAriaAttribute","buildPicker","display","togglePicker","escape","buildItem","tabIndex","selectItem","buildLabel","buildOptions","close","trigger","dispatchEvent","Event","Picker","backgroundColor","colorLabel","stroke","icons","defaultItem","boundsContainer","TEMPLATE","el","overflowY","isScrollable","marginTop","hide","reference","rootBounds","verticalShift","show","ALIGNS","COLORS","FONTS","HEADERS","SIZES","BaseTheme","tooltip","textbox","pickers","picker","removeEventListener","extendToolbar","buildButtons","buttons","button","buildPickers","selects","fillSelect","IconPicker","ColorPicker","fileInput","click","BaseTooltip","Tooltip","save","cancel","restoreFocus","mode","preview","linkRange","extractVideoUrl","defaultValue","TOOLBAR_CONFIG","BubbleTooltip","lastLine","indexBounds","arrow","marginLeft","BubbleTheme","SnowTooltip","LinkBlot","SnowTheme","_range","Indent","List","InlineCode","Icons"],"sourceRoot":""}