react-input-emoji 5.6.5 → 5.6.6

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/utils/emoji-utils.js","../src/utils/input-event-utils.js","../src/hooks/use-sanitize.js","../src/hooks/use-expose.js","../src/hooks/use-emit.js","../src/text-input.js","../src/components/emoji-picker-button.js","../node_modules/@emoji-mart/react/dist/module.js","../src/components/emoji-picker.js","../src/components/emoji-picker-container.js","../src/components/emoji-picker-wrapper.js","../src/utils/mention-utils.js","../src/hooks/use-mention.js","../src/components/mention-user-list.js","../src/components/mention-wrapper.js","../src/utils/observer.js","../src/hooks/use-event-listeners.js","../src/hooks/user-pollute.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/* eslint-disable valid-jsdoc */\n// @ts-check\n\nexport const TRANSPARENT_GIF =\n \"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\";\n\nexport const EMOJI_STYLE = \"\";\n\n/**\n * Replace all text with emoji with an image html tag\n * @param {string} text\n * @return {string}\n */\nexport function replaceAllTextEmojis(text) {\n let allEmojis = getAllEmojisFromText(text);\n\n if (allEmojis) {\n allEmojis = [...new Set(allEmojis)]; // remove duplicates\n\n allEmojis.forEach(emoji => {\n text = replaceAll(text, emoji, getInputEmojiHTML('', emoji));\n });\n }\n\n return text;\n}\n\n/**\n * Replace all occurrencies in a string\n * @param {string} str\n * @param {string} find\n * @param {string} replace\n * @return {string}\n */\nfunction replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, \"g\"), replace);\n}\n\n/**\n * Get all emojis from the text\n * @param {string} text\n * @return {string[]}\n */\nfunction getAllEmojisFromText(text) {\n return text.match(\n /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g\n );\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param { import(\"../types/types\").EmojiMartItem } emoji\n * @return {string}\n */\nexport function getImageEmoji(emoji) {\n /** @type {HTMLElement | null} */\n const emojiPickerEl = document.querySelector('em-emoji-picker')\n\n if (!emojiPickerEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n /** @type {HTMLSpanElement | null=} */\n const emojiSpanEl = emojiPickerEl?.shadowRoot?.querySelector(`[title=\"${emoji.name}\"] > span > span`)\n\n if (!emojiSpanEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n const style = replaceAll(emojiSpanEl.style.cssText, '\"', \"'\");\n\n return getInputEmojiHTML(style, emoji.native);\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {string} style\n * @param {string} emoji\n * @returns\n */\nfunction getInputEmojiHTML(style, emoji) {\n return `<img style=\"${style}; display: inline-block\" data-emoji=\"${emoji}\" src=\"${TRANSPARENT_GIF}\" />`;\n}\n\n/**\n * \n * @param {string} emoji \n * @returns \n */\nfunction getInputEmojiNativeHTML(emoji) {\n return `<span class=\"width: 18px; height: 18px; display: inline-block; margin: 0 1px;\">${emoji}</span>`;\n}\n\n/**\n *\n * @param {string} html\n * @return {string}\n */\nexport function replaceAllTextEmojiToString(html) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach(image => {\n container.innerHTML = container.innerHTML.replace(\n image.outerHTML,\n image.dataset.emoji\n );\n });\n\n return container.innerHTML;\n}\n","// @ts-check\n\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString\n} from \"./emoji-utils\";\n\n/**\n * Handle copy of current selected text\n * @param {React.ClipboardEvent} event\n */\nexport function handleCopy(event) {\n const selectedText = window.getSelection();\n\n if (selectedText === null) {\n return\n }\n\n let container = document.createElement(\"div\");\n\n for (let i = 0, len = selectedText.rangeCount; i < len; ++i) {\n container.appendChild(selectedText.getRangeAt(i).cloneContents());\n }\n\n container = replaceEmojiToString(container);\n\n event.clipboardData.setData(\"text\", container.innerText);\n event.preventDefault();\n}\n\n/**\n *\n * @param {string} html\n */\nexport function handlePasteHtmlAtCaret(html) {\n let sel;\n let range;\n if (window.getSelection) {\n // IE9 and non-IE\n sel = window.getSelection();\n\n if (sel === null) return\n\n if (sel.getRangeAt && sel.rangeCount) {\n range = sel.getRangeAt(0);\n range.deleteContents();\n\n // Range.createContextualFragment() would be useful here but is\n // non-standard and not supported in all browsers (IE9, for one)\n const el = document.createElement(\"div\");\n el.innerHTML = html;\n const frag = document.createDocumentFragment();\n let node;\n let lastNode;\n while ((node = el.firstChild)) {\n lastNode = frag.appendChild(node);\n }\n range.insertNode(frag);\n\n // Preserve the selection\n if (lastNode) {\n range = range.cloneRange();\n range.setStartAfter(lastNode);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n }\n }\n}\n\n/**\n * Replace emoji img to its string value\n * @param {HTMLDivElement} container\n * @return {HTMLDivElement}\n */\nfunction replaceEmojiToString(container) {\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach(image => {\n image.outerHTML = image.dataset.emoji;\n });\n\n return container;\n}\n\n/**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\nexport function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = replaceAllTextEmojis(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n}\n\n/**\n * @typedef {object} HandleKeyDownOptions\n * @property {HTMLDivElement} placeholderEl\n * @property {number} maxLength\n * @property {HTMLDivElement} inputEl\n * @property {React.MutableRefObject<string>} cleanedTextRef\n * @property {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @property {boolean} cleanOnEnter\n * @property {function(): void} emitChange\n * @property {(function(string): void)=} onEnter\n * @property {(function(KeyboardEvent): void)=} onKeyDown\n * @property {(function(string): void)} updateHTML\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @typedef {Object} HandleSelectEmojiProps\n * @property {import(\"../types/types\").EmojiMartItem} emoji\n * @property {React.MutableRefObject<import('../text-input').Ref>} textInputRef\n * @property {boolean} keepOpened\n * @property {() => void} toggleShowPicker\n * @property {number=} maxLength\n */\n\n/**\n *\n * @param {HandleSelectEmojiProps} props\n */\nexport function handleSelectEmoji({\n emoji,\n textInputRef,\n keepOpened,\n toggleShowPicker,\n maxLength\n}) {\n if (\n typeof maxLength !== \"undefined\" &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n textInputRef.current.appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n toggleShowPicker();\n }\n}\n\n/**\n *\n * @param {{text: string, html: string}} props\n * @return {number}\n */\nexport function totalCharacters({ text, html }) {\n const textCount = text.length;\n const emojisCount = (html.match(/<img/g) || []).length;\n\n return textCount + emojisCount;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * Handle keyup event\n * @param {() => void} emitChange\n * @param {(event: KeyboardEvent) => void} onKeyDownMention\n * @param {React.MutableRefObject<string>} cleanedTextRef\n * @param {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @return {(event: KeyboardEvent) => void}\n */\nexport function handleKeyup(\n emitChange,\n onKeyDownMention,\n cleanedTextRef,\n textInputRef\n) {\n return event => {\n const text = replaceAllTextEmojiToString(textInputRef.current.innerHTML);\n cleanedTextRef.current = text;\n emitChange();\n onKeyDownMention(event);\n };\n}\n\n/**\n * Handle focus event\n * @param {function(FocusEvent): void} onFocus\n * @return {function(FocusEvent): void}\n */\nexport function handleFocus(onFocus) {\n return event => {\n onFocus(event);\n };\n}\n\n/**\n * Set caret to the end of text value\n * @param {React.MutableRefObject<HTMLDivElement| null>} input\n */\nexport function moveCaretToEnd(input) {\n let range\n let selection\n if(document.createRange && input.current) {\n range = document.createRange()\n range.selectNodeContents(input.current)\n range.collapse(false)\n selection = window.getSelection()\n if(selection) {\n selection.removeAllRanges()\n selection.addRange(range)\n }\n }\n}\n/**\n * \n * @param {HTMLDivElement} inputDiv \n * @return {string}\n */\nexport function removeHtmlExceptBr(inputDiv) {\n const temp = inputDiv.innerHTML.replace(/<br\\s*\\/?>/gi, '[BR]'); // temporarily replace <br> with placeholder\n const stripped = temp.replace(/<[^>]+>/g, ''); // strip all html tags\n const final = stripped.replace(/\\[BR\\]/gi, '</br>'); // replace placeholders with <br>\n return final;\n}","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\nimport { removeHtmlExceptBr } from \"../utils/input-event-utils\";\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @param {boolean} shouldReturn\n */\nexport function useSanitize(shouldReturn) {\n /** @type {React.MutableRefObject<SanitizeFn[]>} */\n const sanitizeFnsRef = useRef([]);\n\n const sanitizedTextRef = useRef(\"\");\n\n /** @type {(fn: SanitizeFn) => void} */\n const addSanitizeFn = useCallback(fn => {\n sanitizeFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const sanitize = useCallback(html => {\n let result = sanitizeFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, html);\n\n result = replaceAllHtmlToString(result, shouldReturn);\n\n sanitizedTextRef.current = result;\n\n return result;\n }, []);\n\n return { addSanitizeFn, sanitize, sanitizedTextRef };\n}\n\n/**\n *\n * @param {string} html\n * @param {boolean} shouldReturn\n * @return {string}\n */\nexport function replaceAllHtmlToString(html, shouldReturn) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n let text\n if(shouldReturn) {\n text = removeHtmlExceptBr(container)\n } else {\n text = container.innerText || \"\";\n }\n\n // remove all ↵ for safari\n text = text.replace(/\\n/gi, \"\");\n\n return text;\n}\n","// @ts-check\n\nimport { useImperativeHandle } from \"react\";\nimport { useSanitize } from \"./use-sanitize\";\n\n/**\n * @typedef {Object} Props\n * @property {React.Ref<any>} ref\n * @property {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @property {(value: string) => void} setValue\n * @property {() => void} emitChange\n */\n\n/**\n *\n * @param {Props} props\n */\nexport function useExpose({ ref, textInputRef, setValue, emitChange }) {\n const { sanitize, sanitizedTextRef } = useSanitize(false);\n\n useImperativeHandle(ref, () => ({\n get value() {\n return sanitizedTextRef.current;\n },\n set value(value) {\n setValue(value);\n },\n focus: () => {\n if (textInputRef.current === null) return\n textInputRef.current.focus();\n },\n blur: () => {\n if (textInputRef.current !== null) {\n sanitize(textInputRef.current.html);\n\n }\n\n emitChange();\n }\n }));\n}\n","// @ts-check\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * useEmit\n * @param {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @param {(size: {width: number, height: number}) => void} onResize\n * @param {(text: string) => void} onChange\n */\nexport function useEmit(textInputRef, onResize, onChange) {\n /** @type {React.MutableRefObject<{width: number; height: number} | null>} */\n const currentSizeRef = useRef(null);\n const onChangeFn = useRef(onChange);\n\n const checkAndEmitResize = useCallback(() => {\n if (textInputRef.current !== null) {\n const currentSize = currentSizeRef.current;\n\n const nextSize = textInputRef.current.size;\n\n if (\n (!currentSize ||\n currentSize.width !== nextSize.width ||\n currentSize.height !== nextSize.height) &&\n typeof onResize === \"function\"\n ) {\n onResize(nextSize);\n }\n\n currentSizeRef.current = nextSize;\n }\n }, [onResize, textInputRef]);\n\n const emitChange = useCallback((sanitizedText) => {\n if (typeof onChangeFn.current === \"function\") {\n onChangeFn.current(sanitizedText);\n }\n\n if (typeof onResize === \"function\") {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, onResize]);\n\n useEffect(() => {\n if (textInputRef.current) {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, textInputRef]);\n\n return emitChange;\n}\n","// @ts-check\n// vendors\nimport React, { useImperativeHandle, forwardRef, useRef } from \"react\";\nimport { handlePasteHtmlAtCaret, moveCaretToEnd } from \"./utils/input-event-utils\";\nimport { replaceAllTextEmojiToString } from \"./utils/emoji-utils\";\n\n/**\n * @typedef {Object} Props\n * @property {(event: React.KeyboardEvent) => void} onKeyDown\n * @property {(event: React.KeyboardEvent) => void} onKeyUp\n * @property {() => void} onFocus\n * @property {() => void} onBlur\n * @property {(sanitizedText: string) => void=} onChange\n * @property {(event: React.KeyboardEvent) => void} onArrowUp\n * @property {(event: React.KeyboardEvent) => void} onArrowDown\n * @property {(event: React.KeyboardEvent) => void} onEnter\n * @property {boolean} shouldReturn\n * @property {(event: React.ClipboardEvent) => void} onCopy\n * @property {(event: React.ClipboardEvent) => void} onPaste\n * @property {string} placeholder\n * @property {React.CSSProperties} style\n * @property {number} tabIndex\n * @property {string} className\n * @property {(html: string) => void} onChange\n */\n\n/**\n * @typedef {{\n * appendContent: (html: string) => void;\n * html: string;\n * text: string;\n * size: { width: number; height: number;};\n * focus: () => void;\n * }} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst TextInput = (\n { placeholder, style, tabIndex, className, onChange, ...props },\n ref\n) => {\n useImperativeHandle(ref, () => ({\n appendContent: html => {\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n handlePasteHtmlAtCaret(html);\n\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n if (textInputRef.current && placeholderRef.current && replaceAllTextEmojiToString(textInputRef.current.innerHTML) === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else if (placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n\n if (textInputRef.current && typeof onChange === 'function') {\n onChange(textInputRef.current.innerHTML);\n }\n },\n set html(value) {\n if (textInputRef.current) {\n textInputRef.current.innerHTML = value;\n }\n \n if (placeholderRef.current) {\n const text = replaceAllTextEmojiToString(value)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n },\n get html() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerHTML;\n },\n get text() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerText;\n },\n get size() {\n if (!textInputRef.current) {\n return {\n width: 0,\n height: 0\n }\n }\n\n return {\n width: textInputRef.current.offsetWidth,\n height: textInputRef.current.offsetHeight\n };\n },\n focus() {\n if (!textInputRef.current) return\n\n textInputRef.current.focus();\n }\n }));\n\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const placeholderRef = useRef(null);\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const textInputRef = useRef(null);\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) {\n if (event.key === \"Enter\" && (event.shiftKey === true || event.ctrlKey === true) && props.shouldReturn) {\n event.preventDefault();\n if(textInputRef.current) {\n textInputRef.current.innerHTML = `${textInputRef.current.innerHTML}</br></br>`\n moveCaretToEnd(textInputRef)\n return;\n }\n } \n if (event.key === \"Enter\") {\n props.onEnter(event);\n } else if (event.key === \"ArrowUp\") {\n props.onArrowUp(event);\n } else if (event.key === \"ArrowDown\") {\n props.onArrowDown(event);\n } else {\n if (event.key.length === 1 && placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n props.onKeyDown(event);\n }\n\n /** */\n function handleClick() {\n props.onFocus();\n }\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyUp(event) {\n props.onKeyUp(event);\n\n const input = textInputRef.current;\n\n if (placeholderRef.current && input) {\n const text = replaceAllTextEmojiToString(input.innerHTML)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n }\n\n return (\n <div className=\"react-input-emoji--container\" style={style}>\n <div className=\"react-input-emoji--wrapper\" onClick={handleClick}>\n <div ref={placeholderRef} className=\"react-input-emoji--placeholder\">\n {placeholder}\n </div>\n <div\n ref={textInputRef}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n tabIndex={tabIndex}\n contentEditable\n className={`react-input-emoji--input${className ? ` ${className}` : \"\"\n }`}\n onBlur={props.onBlur}\n onCopy={props.onCopy}\n onPaste={props.onPaste}\n data-testid=\"react-input-emoji--input\"\n />\n </div>\n </div>\n );\n};\n\nconst TextInputWithRef = forwardRef(TextInput);\n\nexport default TextInputWithRef;\n","// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {(event: React.MouseEvent) => void} toggleShowPicker\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerButton({ showPicker, toggleShowPicker, buttonElement, buttonRef }) {\n \n const localButtonRef = useRef(null);\n const [showCustomButtonContent, setShowCustomButtonContent] = useState(false);\n\n useEffect(() => {\n if ((buttonRef?.current?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonRef.current.childNodes[0]);\n setShowCustomButtonContent(true);\n } else if ((buttonElement?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonElement?.childNodes[0]);\n setShowCustomButtonContent(true);\n }\n }, [buttonElement?.childNodes]);\n\n return (\n <button\n ref={localButtonRef}\n type=\"button\"\n className={`react-input-emoji--button${\n showPicker ? \" react-input-emoji--button__show\" : \"\"\n }`}\n onClick={toggleShowPicker}\n >\n {!showCustomButtonContent && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n className=\"react-input-emoji--button--icon\"\n >\n {/* eslint-disable-next-line max-len */}\n <path d=\"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10\" />\n {/* eslint-disable-next-line max-len */}\n <path d=\"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0\" />\n </svg>\n )}\n </button>\n );\n}\n\nexport default EmojiPickerButton;\n","import $dvPge$react, {useRef as $dvPge$useRef, useEffect as $dvPge$useEffect} from \"react\";\nimport {Picker as $dvPge$Picker} from \"emoji-mart\";\n\n\n\nfunction $e5534fc185f7111e$export$2e2bcd8739ae039(props) {\n const ref = (0, $dvPge$useRef)(null);\n const instance = (0, $dvPge$useRef)(null);\n if (instance.current) instance.current.update(props);\n (0, $dvPge$useEffect)(()=>{\n instance.current = new (0, $dvPge$Picker)({\n ...props,\n ref: ref\n });\n return ()=>{\n instance.current = null;\n };\n }, []);\n return /*#__PURE__*/ (0, $dvPge$react).createElement(\"div\", {\n ref: ref\n });\n}\n\n\nexport {$e5534fc185f7111e$export$2e2bcd8739ae039 as default};\n//# sourceMappingURL=module.js.map\n","// vendors\nimport React, { memo, useMemo } from \"react\";\nimport Picker from \"@emoji-mart/react\";\n\n/**\n * @typedef {object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {function(import(\"../types/types\").EmojiMartItem): void} onSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Component\n * @param {Props} props\n */\nfunction EmojiPicker(props) {\n const { theme, onSelectEmoji, disableRecent, customEmojis, language } = props;\n\n /** @type {string[]} */\n const categories = useMemo(() => {\n /** @type {string[]} */\n let categoryies = [];\n\n if (!disableRecent) {\n categoryies.push(\"frequent\");\n }\n\n categoryies = [\n ...categoryies,\n \"people\",\n \"nature\",\n \"foods\",\n \"activity\",\n \"places\",\n \"objects\",\n \"symbols\",\n \"flags\"\n ];\n\n return categoryies;\n }, [disableRecent]);\n\n const i18n = useMemo(() => {\n if (!language) {\n return undefined\n }\n\n return require(`@emoji-mart/data/i18n/${language ?? 'en'}.json`)\n }, [language])\n\n return (\n <Picker\n data={undefined}\n theme={theme}\n previewPosition=\"none\"\n onEmojiSelect={onSelectEmoji}\n custom={customEmojis}\n categories={categories}\n set=\"apple\"\n i18n={i18n}\n />\n );\n}\n\n\nexport default memo(EmojiPicker);\n","import React from \"react\";\nimport EmojiPicker from \"./emoji-picker\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {(emoji: import(\"../types/types\").EmojiMartItem) => void} handleSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {('above' | 'below')=} position\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerContainer({\n showPicker,\n theme,\n handleSelectEmoji,\n disableRecent,\n customEmojis,\n position,\n language\n}) {\n return (\n <div className=\"react-emoji-picker--container\">\n {showPicker && (\n <div\n className=\"react-emoji-picker--wrapper\"\n onClick={evt => evt.stopPropagation()}\n style={position === 'below' ? {top: '40px'} : {}}\n >\n <div className=\"react-emoji-picker\">\n <EmojiPicker\n theme={theme}\n onSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n language={language}\n />\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport default EmojiPickerContainer;\n","// @ts-check\n// vendors\nimport React, { useEffect, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString\n} from \"../utils/emoji-utils\";\n\nimport EmojiPickerButton from \"./emoji-picker-button\";\nimport EmojiPickerContainer from \"./emoji-picker-container\";\n\nconst EMOJI_PICKER_CONTAINER_HEIGHT = 435;\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {boolean} keepOpened\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n * @property {(fn: PolluteFn) => void} addPolluteFn\n * @property {(html: string) => void} appendContent\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n * @property {import('../types/types').Languages=} language\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst EmojiPickerWrapper = props => {\n const {\n theme,\n keepOpened,\n disableRecent,\n customEmojis,\n addSanitizeFn,\n addPolluteFn,\n appendContent,\n buttonElement,\n buttonRef,\n language\n } = props;\n\n const [showPicker, setShowPicker] = useState(false);\n /** @type {[HTMLDivElement | undefined, React.Dispatch<React.SetStateAction<HTMLDivElement | undefined>>]} */\n const [customButton, setCustomButton] = useState();\n /** @type {['above' | 'below' | undefined, React.Dispatch<React.SetStateAction<'above' | 'below' | undefined>>]} */\n const [emojiPickerPosition, setEmojiPickerPosition] = useState()\n\n useEffect(() => {\n addSanitizeFn(replaceAllTextEmojiToString);\n }, [addSanitizeFn]);\n\n useEffect(() => {\n addPolluteFn(replaceAllTextEmojis);\n }, [addPolluteFn]);\n\n useEffect(() => {\n /**\n *\n * @param {MouseEvent} event\n */\n function checkClickOutside(event) {\n /** @type {HTMLElement} */\n // @ts-ignore\n const element = event.target;\n\n if (\n element.classList.contains(\"react-input-emoji--button\") ||\n element.classList.contains(\"react-input-emoji--button--icon\")\n ) {\n return;\n }\n\n setShowPicker(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n /**\n *\n * @param {React.MouseEvent} event\n */\n function toggleShowPicker(event) {\n event.stopPropagation();\n event.preventDefault();\n\n setEmojiPickerPosition(calcTopPosition(event))\n\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n\n /**\n * \n * @param {React.MouseEvent} event\n * @return {'above' | 'below'}\n */\n function calcTopPosition(event) {\n const btn = event.currentTarget\n const btnRect = btn.getBoundingClientRect();\n\n const popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT;\n\n // Decide to display above or below based on available space\n if (btnRect.top >= popoverHeight) {\n // Display above\n return 'above'\n } else {\n // Display below\n return 'below'\n }\n }\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {import(\"../types/types\").EmojiMartItem} emoji\n */\n function handleSelectEmoji(emoji) {\n appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n }\n\n useEffect(() => {\n if (buttonRef?.current?.style) {\n buttonRef.current.style.position = \"relative\";\n setCustomButton(buttonRef.current);\n } else if (buttonElement?.style) {\n buttonElement.style.position = \"relative\";\n setCustomButton(buttonElement);\n }\n }, [buttonRef, buttonElement]);\n\n return customButton ? (\n (ReactDOM.createPortal(\n <>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n buttonElement={customButton}\n buttonRef={buttonRef}\n />\n </>,\n customButton\n ))\n ) : (\n (<>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n />\n </>)\n );\n};\n\nexport default EmojiPickerWrapper;\n","// @ts-check\n\n/**\n *\n * @return {string | null}\n */\nexport function getTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return null;\n\n const text = range.text.substring(range.begin, range.end);\n\n return text || null;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function deleteTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return;\n\n // @ts-ignore\n range.element.deleteData(range.begin, range.end - range.begin);\n}\n\n/**\n *\n * @return {{begin: number, end: number, text: string, element: Node} | null}\n */\nfunction getRangeFromAtToCaret() {\n const elementWithFocus = getElementWithFocus();\n\n if (!elementWithFocus) {\n return null;\n }\n\n const { element, caretOffset } = elementWithFocus;\n const text = element.textContent;\n const lastAt = text.lastIndexOf(\"@\");\n\n if (\n lastAt === -1 ||\n lastAt >= caretOffset ||\n (lastAt !== 0 && text[lastAt - 1] !== \" \")\n ) {\n return null;\n }\n\n return { begin: lastAt, end: caretOffset, text, element };\n}\n\n/**\n *\n * @return {{element: Node, caretOffset: number}}\n */\nexport function getElementWithFocus() {\n const element = getSelectionStart();\n\n if (element === null) {\n return null;\n }\n\n let caretOffset = 0;\n if (typeof window.getSelection != \"undefined\") {\n const range = window.getSelection().getRangeAt(0);\n const preCaretRange = range.cloneRange();\n preCaretRange.selectNodeContents(element);\n preCaretRange.setEnd(range.endContainer, range.endOffset);\n caretOffset = preCaretRange.toString().length;\n } else if (\n // @ts-ignore\n typeof document.selection != \"undefined\" &&\n // @ts-ignore\n document.selection.type != \"Control\"\n ) {\n // @ts-ignore\n const textRange = document.selection.createRange();\n // @ts-ignore\n const preCaretTextRange = document.body.createTextRange();\n preCaretTextRange.moveToElementText(element);\n preCaretTextRange.setEndPoint(\"EndToEnd\", textRange);\n caretOffset = preCaretTextRange.text.length;\n }\n\n return { element, caretOffset };\n}\n\n/**\n *\n * @return {Node | null}\n */\nfunction getSelectionStart() {\n const node = document.getSelection().anchorNode;\n return node?.nodeType == 3 ? node : null;\n}\n","// @ts-check\nimport { useCallback, useState } from \"react\";\nimport {\n deleteTextFromAtToCaret,\n getElementWithFocus,\n getTextFromAtToCaret\n} from \"../utils/mention-utils\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {(text: string) => Promise<MentionUser[]>=} searchMention\n * @returns {{mentionSearchText: string | null, mentionUsers: MentionUser[], onKeyUp: (event: React.KeyboardEvent) => void, onFocus: () => void, onSelectUser: () => void, loading: boolean}}\n */\nexport function useMention(searchMention) {\n const [loading, setLoading] = useState(false);\n\n /** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */\n const [mentionUsers, setMentionUsers] = useState([]);\n\n /** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */\n const [mentionSearchText, setMentionSearchText] = useState(null);\n\n const onSelectUser = useCallback(() => {\n deleteTextFromAtToCaret();\n setMentionUsers([]);\n }, []);\n\n /** */\n const checkMentionText = useCallback(async () => {\n const metionText = getTextFromAtToCaret();\n\n setMentionSearchText(metionText);\n\n if (metionText === null) {\n setMentionUsers([]);\n } else {\n setLoading(true);\n const users = await searchMention(metionText);\n setLoading(false);\n setMentionUsers(users);\n }\n }, [searchMention]);\n\n /** @type {(event: React.KeyboardEvent) => void} */\n const onKeyUp = useCallback(\n async event => {\n if (typeof searchMention !== \"function\") return;\n\n if (\n event.key === \"Backspace\" &&\n getElementWithFocus()?.element.parentElement.hasAttribute(\n \"data-mention-id\"\n )\n ) {\n const elementWithFocus = getElementWithFocus();\n elementWithFocus.element.parentElement.remove();\n } else if (\n ![\"ArrowUp\", \"ArrowDown\", \"Esc\", \"Escape\"].includes(event.key)\n ) {\n checkMentionText();\n }\n },\n [checkMentionText, searchMention]\n );\n\n const onFocus = useCallback(() => {\n checkMentionText();\n }, [checkMentionText]);\n\n return {\n mentionSearchText,\n mentionUsers,\n onKeyUp,\n onFocus,\n onSelectUser,\n loading\n };\n}\n","// @ts-check\n// vendors\nimport React, {\n useImperativeHandle,\n useState,\n forwardRef,\n useMemo,\n useEffect\n} from \"react\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {Object} Props\n * @property {MentionUser[]} users\n * @property {string | null} mentionSearchText\n * @property {(user: MentionUser) => void} onSelect\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n */\n\n/**\n * @typedef {{prevUser: () => void; nextUser: () => void;}} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst MentionUserList = (\n { users, mentionSearchText, onSelect, addEventListener },\n ref\n) => {\n const [selectedUser, setSelectedUser] = useState(0);\n\n useImperativeHandle(ref, () => ({\n prevUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === 0) {\n return 0;\n }\n\n return currentSelectedUser - 1;\n });\n },\n nextUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === users.length - 1) {\n return users.length - 1;\n }\n\n return currentSelectedUser + 1;\n });\n }\n }));\n\n useEffect(() => {\n setSelectedUser(0);\n }, [users]);\n\n /**\n *\n * @param {string} selectedText\n * @param {string} rest\n * @return {string}\n */\n function getMentionSelectedNameEl(selectedText, rest) {\n return `<span class=\"react-input-emoji--mention--item--name__selected\" data-testid=\"metion-selected-word\">${selectedText}</span>${rest}`;\n }\n\n /** @type {(MentionUser & {nameHtml: string})[]} */\n const usersFiltered = useMemo(() => {\n const searchText = mentionSearchText\n ? mentionSearchText.substring(1).toLocaleLowerCase()\n : \"\";\n return users.map(user => {\n let nameHtml = user.name;\n\n if (mentionSearchText && mentionSearchText.length > 1) {\n if (user.name.toLowerCase().startsWith(searchText)) {\n nameHtml = getMentionSelectedNameEl(\n user.name.substring(0, searchText.length),\n user.name.substring(searchText.length)\n );\n } else {\n const names = user.name.split(\" \");\n\n nameHtml = names\n .map(name => {\n if (name.toLocaleLowerCase().startsWith(searchText)) {\n return getMentionSelectedNameEl(\n name.substring(0, searchText.length),\n name.substring(searchText.length)\n );\n }\n return name;\n })\n .join(\" \");\n }\n }\n\n return {\n ...user,\n nameHtml\n };\n });\n }, [mentionSearchText, users]);\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {MentionUser} user\n * @returns {(event: React.MouseEvent) => void} event\n */\n function handleClick(user) {\n return event => {\n event.stopPropagation();\n event.preventDefault();\n\n onSelect(user);\n };\n }\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"enter\", event => {\n event.stopPropagation();\n event.preventDefault();\n onSelect(usersFiltered[selectedUser]);\n });\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onSelect, selectedUser, usersFiltered]);\n\n return (\n <ul\n className=\"react-input-emoji--mention--list\"\n data-testid=\"mention-user-list\"\n >\n {usersFiltered.map((user, index) => (\n <li key={user.id}>\n <button\n type=\"button\"\n onClick={handleClick(user)}\n className={`react-input-emoji--mention--item${\n selectedUser === index\n ? \" react-input-emoji--mention--item__selected\"\n : \"\"\n }`}\n onMouseOver={() => setSelectedUser(index)}\n >\n <img\n className=\"react-input-emoji--mention--item--img\"\n src={user.image}\n />\n <div\n className=\"react-input-emoji--mention--item--name\"\n dangerouslySetInnerHTML={{ __html: user.nameHtml }}\n />\n </button>\n </li>\n ))}\n </ul>\n );\n};\n\nconst MentionUserListWithRef = forwardRef(MentionUserList);\n\nexport default MentionUserListWithRef;\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n// hooks\nimport { useMention } from \"../hooks/use-mention\";\n\n// components\nimport MentionUserList from \"./mention-user-list\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n * @property {(html: string) => void} appendContent\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst MentionWrapper = ({\n searchMention,\n addEventListener,\n appendContent,\n addSanitizeFn\n}) => {\n /** @type {React.MutableRefObject<import('./mention-user-list').Ref | null>} */\n const metionUserListRef = useRef(null);\n const [showUserList, setShowUserList] = useState(false);\n\n const {\n mentionSearchText,\n mentionUsers,\n loading,\n onKeyUp,\n onFocus,\n onSelectUser\n } = useMention(searchMention);\n\n useEffect(() => {\n addSanitizeFn(html => {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const mentionsEl = Array.prototype.slice.call(\n container.querySelectorAll(\".react-input-emoji--mention--text\")\n );\n\n mentionsEl.forEach(mentionEl => {\n container.innerHTML = container.innerHTML.replace(\n mentionEl.outerHTML,\n `@[${mentionEl.dataset.mentionName}](userId:${mentionEl.dataset.mentionId})`\n );\n });\n\n return container.innerHTML;\n });\n }, [addSanitizeFn]);\n\n useEffect(() => {\n setShowUserList(mentionUsers.length > 0);\n }, [mentionUsers]);\n\n useEffect(() => {\n /** */\n function checkClickOutside() {\n setShowUserList(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"keyUp\", onKeyUp);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onKeyUp]);\n\n useEffect(() => {\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) {\n switch (event.key) {\n case \"Esc\": // IE/Edge specific value\n case \"Escape\":\n setShowUserList(false);\n break;\n default:\n break;\n }\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeyDown);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener]);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"focus\", onFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onFocus]);\n\n useEffect(() => {\n if (showUserList) {\n const unsubscribeArrowUp = addEventListener(\"arrowUp\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.prevUser();\n });\n\n const unsubscribeArrowDown = addEventListener(\"arrowDown\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.nextUser();\n });\n\n return () => {\n unsubscribeArrowUp();\n unsubscribeArrowDown();\n };\n }\n }, [addEventListener, showUserList]);\n\n /**\n *\n * @param {MetionUser} user\n */\n function handleSelect(user) {\n onSelectUser();\n appendContent(\n `<span class=\"react-input-emoji--mention--text\" data-mention-id=\"${user.id}\" data-mention-name=\"${user.name}\">@${user.name}</span> `\n );\n }\n\n return (\n <>\n {loading ? (\n <div className=\"react-input-emoji--mention--container\">\n <div className=\"react-input-emoji--mention--loading\">\n <div className=\"react-input-emoji--mention--loading--spinner\">\n Loading...\n </div>\n </div>\n </div>\n ) : (\n showUserList && (\n <div\n className=\"react-input-emoji--mention--container\"\n onClick={evt => evt.stopPropagation()}\n >\n <MentionUserList\n ref={metionUserListRef}\n mentionSearchText={mentionSearchText}\n users={mentionUsers}\n onSelect={handleSelect}\n addEventListener={addEventListener}\n />\n </div>\n )\n )}\n </>\n );\n};\n\nexport default MentionWrapper;\n","// @ts-check\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @template T\n * @returns {import('../types/types').ListenerObj<T>}\n */\nexport function createObserver() {\n /** @type {import('../types/types').Listerner<T>[]} */\n let listeners = [];\n\n return {\n subscribe: listener => {\n listeners.push(listener);\n return () => {\n listeners = listeners.filter(l => l !== listener);\n };\n },\n publish: event => {\n listeners.forEach(listener => listener(event));\n },\n get currentListerners() {\n return listeners;\n }\n };\n}\n","// @ts-check\n\nimport { useCallback, useMemo } from \"react\";\nimport { createObserver } from \"../utils/observer\";\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function useEventListeners() {\n /** @type {TextInputListeners} */\n const listeners = useMemo(\n () => ({\n keyDown: createObserver(),\n keyUp: createObserver(),\n arrowUp: createObserver(),\n arrowDown: createObserver(),\n enter: createObserver(),\n focus: createObserver(),\n blur: createObserver()\n }),\n []\n );\n\n /**\n * @template {keyof TextInputListeners} T, K\n * @type {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void}\n */\n const addEventListener = useCallback(\n (event, fn) => {\n return listeners[event].subscribe(fn);\n },\n [listeners]\n );\n\n return { addEventListener, listeners };\n}\n","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function usePollute() {\n /** @type {React.MutableRefObject<PolluteFn[]>} */\n const polluteFnsRef = useRef([]);\n\n /** @type {(fn: PolluteFn) => void} */\n const addPolluteFn = useCallback(fn => {\n polluteFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const pollute = useCallback(text => {\n const result = polluteFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, text);\n\n return result;\n }, []);\n\n return { addPolluteFn, pollute };\n}\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, forwardRef, useCallback } from \"react\";\n\n// css\nimport \"./styles.css\";\n\n// utils\nimport { replaceAllTextEmojis } from \"./utils/emoji-utils\";\nimport { handleCopy, totalCharacters } from \"./utils/input-event-utils\";\n\n// hooks\nimport { useExpose } from \"./hooks/use-expose\";\nimport { useEmit } from \"./hooks/use-emit\";\n\n// components\nimport TextInput from \"./text-input\";\nimport EmojiPickerWrapper from \"./components/emoji-picker-wrapper\";\nimport MentionWrapper from \"./components/mention-wrapper\";\nimport { useEventListeners } from \"./hooks/use-event-listeners\";\nimport { useSanitize } from \"./hooks/use-sanitize\";\nimport { usePollute } from \"./hooks/user-pollute\";\n\n/**\n * @typedef {import('./types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('./types/types').ListenerObj<any>} ListenerObj\n */\n\n/**\n * @typedef {object} Props\n * @property {string} value\n * @property {(value: string) => void} onChange\n * @property {\"light\" | \"dark\" | \"auto\"=} theme\n * @property {boolean=} cleanOnEnter\n * @property {(text: string) => void=} onEnter\n * @property {string=} placeholder\n * @property {(size: {width: number, height: number}) => void=} onResize\n * @property {() => void=} onClick\n * @property {() => void=} onFocus\n * @property {() => void=} onBlur\n * @property {boolean=} shouldReturn\n * @property {number=} maxLength\n * @property {boolean=} keepOpened\n * @property {(event: KeyboardEvent) => void=} onKeyDown\n * @property {string=} inputClass\n * @property {boolean=} disableRecent\n * @property {number=} tabIndex\n * @property {number=} height\n * @property {number=} borderRadius\n * @property {string=} borderColor\n * @property {number=} fontSize\n * @property {string=} fontFamily\n * @property {{id: string; name: string; emojis: {id: string; name: string; keywords: string[], skins: {src: string}[]}}[]=} customEmojis\n * @property {import('./types/types').Languages=} language\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n */\n\n/**\n * Input Emoji Component\n * @param {Props} props\n * @param {React.Ref<any>} ref\n * @return {JSX.Element}\n */\nfunction InputEmoji(props, ref) {\n const {\n onChange,\n onEnter,\n shouldReturn,\n onResize,\n onClick,\n onFocus,\n onBlur,\n onKeyDown,\n theme,\n cleanOnEnter,\n placeholder,\n maxLength,\n keepOpened,\n inputClass,\n disableRecent,\n tabIndex,\n value,\n customEmojis,\n language,\n searchMention,\n buttonElement,\n buttonRef,\n // style\n borderRadius,\n borderColor,\n fontSize,\n fontFamily,\n } = props;\n\n /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */\n const textInputRef = useRef(null);\n\n const { addEventListener, listeners } = useEventListeners();\n\n const { addSanitizeFn, sanitize, sanitizedTextRef } = useSanitize(props.shouldReturn);\n\n const { addPolluteFn, pollute } = usePollute();\n\n const updateHTML = useCallback(\n (nextValue = \"\") => {\n if (textInputRef.current === null) return;\n\n textInputRef.current.html = replaceAllTextEmojis(nextValue);\n sanitizedTextRef.current = nextValue;\n },\n [sanitizedTextRef]\n );\n\n const setValue = useCallback(\n /**\n * \n * @param {string} value\n */\n (value) => {\n updateHTML(value);\n },\n [updateHTML]\n );\n\n const emitChange = useEmit(textInputRef, onResize, onChange);\n\n useExpose({\n ref,\n setValue,\n textInputRef,\n emitChange\n });\n\n useEffect(() => {\n if (sanitizedTextRef.current !== value) {\n setValue(value);\n }\n }, [sanitizedTextRef, setValue, value]);\n\n // useEffect(() => {\n // updateHTML();\n // }, [updateHTML]);\n\n useEffect(() => {\n /**\n * Handle keydown event\n * @param {React.KeyboardEvent} event\n * @return {boolean}\n */\n function handleKeydown(event) {\n if (\n typeof maxLength !== \"undefined\" &&\n event.key !== \"Backspace\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n event.preventDefault();\n }\n\n if (event.key === \"Enter\" && textInputRef.current) {\n event.preventDefault();\n\n const text = sanitize(textInputRef.current.html);\n\n emitChange(sanitizedTextRef.current);\n\n if (\n typeof onEnter === \"function\" &&\n listeners.enter.currentListerners.length === 0\n ) {\n onEnter(text);\n }\n\n if (cleanOnEnter && listeners.enter.currentListerners.length === 0) {\n updateHTML(\"\");\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return false;\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return true;\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeydown);\n\n return () => {\n unsubscribe();\n };\n }, [\n addEventListener,\n cleanOnEnter,\n emitChange,\n listeners.enter.currentListerners.length,\n maxLength,\n onEnter,\n onKeyDown,\n sanitize,\n sanitizedTextRef,\n updateHTML\n ]);\n\n useEffect(() => {\n /** */\n function handleFocus() {\n if (typeof onClick === \"function\") {\n onClick();\n }\n\n if (typeof onFocus === \"function\") {\n onFocus();\n }\n }\n\n const unsubscribe = addEventListener(\"focus\", handleFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onClick, onFocus]);\n\n useEffect(() => {\n /** */\n function handleBlur() {\n if (typeof onBlur === \"function\") {\n onBlur();\n }\n }\n\n const unsubscribe = addEventListener(\"blur\", handleBlur);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onBlur]);\n\n /**\n *\n * @param {string} html\n */\n function handleTextInputChange(html) {\n sanitize(html);\n\n if (value !== sanitizedTextRef.current) {\n emitChange(sanitizedTextRef.current);\n }\n }\n\n /**\n *\n * @param {string} html\n */\n function appendContent(html) {\n if (\n typeof maxLength !== \"undefined\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n if (textInputRef.current !== null) {\n textInputRef.current.appendContent(html);\n }\n }\n\n /**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\n function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = pollute(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n }\n\n return (\n <div className=\"react-emoji\">\n <MentionWrapper\n searchMention={searchMention}\n addEventListener={addEventListener}\n appendContent={appendContent}\n addSanitizeFn={addSanitizeFn}\n />\n <TextInput\n ref={textInputRef}\n onCopy={handleCopy}\n onPaste={handlePaste}\n shouldReturn={shouldReturn}\n onBlur={listeners.blur.publish}\n onFocus={listeners.focus.publish}\n onArrowUp={listeners.arrowUp.publish}\n onArrowDown={listeners.arrowDown.publish}\n onKeyUp={listeners.keyUp.publish}\n onKeyDown={listeners.keyDown.publish}\n onEnter={listeners.enter.publish}\n placeholder={placeholder}\n style={{\n borderRadius,\n borderColor,\n fontSize,\n fontFamily\n }}\n tabIndex={tabIndex}\n className={inputClass}\n onChange={handleTextInputChange}\n />\n <EmojiPickerWrapper\n theme={theme}\n keepOpened={keepOpened}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n addSanitizeFn={addSanitizeFn}\n addPolluteFn={addPolluteFn}\n appendContent={appendContent}\n buttonElement={buttonElement}\n buttonRef={buttonRef}\n language={language}\n />\n </div>\n );\n}\n\nconst InputEmojiWithRef = forwardRef(InputEmoji);\n\nInputEmojiWithRef.defaultProps = {\n theme: /** @type {const} */ (\"auto\"),\n height: 30,\n placeholder: \"Type a message\",\n borderRadius: 21,\n borderColor: \"#EAEAEA\",\n fontSize: 15,\n fontFamily: \"sans-serif\",\n tabIndex: 0,\n shouldReturn: false,\n customEmojis: [],\n language: undefined,\n};\n\nexport default InputEmojiWithRef;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","TRANSPARENT_GIF","replaceAllTextEmojis","text","allEmojis","getAllEmojisFromText","_toConsumableArray","Set","forEach","emoji","replaceAll","getInputEmojiHTML","str","find","replace","RegExp","match","getImageEmoji","_emojiPickerEl$shadow","emojiPickerEl","querySelector","getInputEmojiNativeHTML","emojiSpanEl","shadowRoot","concat","name","replaceAllTextEmojiToString","html","container","innerHTML","images","Array","prototype","slice","call","querySelectorAll","image","outerHTML","dataset","handleCopy","event","selectedText","window","getSelection","i","len","rangeCount","getRangeAt","cloneContents","replaceEmojiToString","clipboardData","setData","innerText","preventDefault","handlePasteHtmlAtCaret","sel","range","deleteContents","el","frag","createDocumentFragment","node","lastNode","insertNode","cloneRange","setStartAfter","collapse","removeAllRanges","addRange","totalCharacters","_ref2","textCount","length","emojisCount","moveCaretToEnd","input","selection","createRange","current","selectNodeContents","removeHtmlExceptBr","inputDiv","temp","stripped","final","useSanitize","shouldReturn","sanitizeFnsRef","useRef","sanitizedTextRef","addSanitizeFn","useCallback","fn","push","sanitize","result","reduce","acc","replaceAllHtmlToString","useExpose","_ref","textInputRef","setValue","emitChange","_useSanitize","useImperativeHandle","value","focus","blur","useEmit","onResize","onChange","currentSizeRef","onChangeFn","checkAndEmitResize","currentSize","nextSize","size","width","height","sanitizedText","useEffect","TextInput","placeholder","tabIndex","className","props","_objectWithoutProperties","_excluded","appendContent","placeholderRef","visibility","offsetWidth","offsetHeight","handleKeyDown","key","shiftKey","ctrlKey","onEnter","onArrowUp","onArrowDown","onKeyDown","handleClick","onFocus","handleKeyUp","onKeyUp","React","onClick","contentEditable","onBlur","onCopy","onPaste","TextInputWithRef","forwardRef","EmojiPickerButton","showPicker","toggleShowPicker","buttonElement","buttonRef","localButtonRef","_useState","useState","_useState2","_slicedToArray","showCustomButtonContent","setShowCustomButtonContent","_buttonRef$current$ch","_buttonRef$current","_buttonElement$childN","_buttonElement$childN2","childNodes","xmlns","viewBox","d","$e5534fc185f7111e$export$2e2bcd8739ae039","$dvPge$useRef","instance","update","$dvPge$useEffect","$dvPge$Picker","$dvPge$react","EmojiPicker","theme","onSelectEmoji","disableRecent","customEmojis","language","categories","useMemo","categoryies","i18n","undefined","require","Picker","data","previewPosition","onEmojiSelect","custom","set","memo","EmojiPickerContainer","handleSelectEmoji","position","evt","stopPropagation","top","EMOJI_PICKER_CONTAINER_HEIGHT","EmojiPickerWrapper","keepOpened","addPolluteFn","setShowPicker","_useState3","_useState4","customButton","setCustomButton","_useState5","_useState6","emojiPickerPosition","setEmojiPickerPosition","checkClickOutside","element","target","classList","contains","addEventListener","removeEventListener","calcTopPosition","currentShowPicker","btn","currentTarget","btnRect","getBoundingClientRect","popoverHeight","ReactDOM","createPortal","Fragment","getTextFromAtToCaret","getRangeFromAtToCaret","substring","begin","end","deleteTextFromAtToCaret","deleteData","elementWithFocus","getElementWithFocus","caretOffset","textContent","lastAt","lastIndexOf","getSelectionStart","preCaretRange","setEnd","endContainer","endOffset","toString","textRange","preCaretTextRange","body","createTextRange","moveToElementText","setEndPoint","anchorNode","nodeType","useMention","searchMention","loading","setLoading","mentionUsers","setMentionUsers","mentionSearchText","setMentionSearchText","onSelectUser","checkMentionText","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metionText","users","wrap","_callee$","_context","prev","next","sent","stop","_x","_callee2","_getElementWithFocus","_callee2$","_context2","abrupt","parentElement","hasAttribute","remove","includes","apply","arguments","MentionUserList","onSelect","selectedUser","setSelectedUser","prevUser","currentSelectedUser","nextUser","getMentionSelectedNameEl","rest","usersFiltered","searchText","toLocaleLowerCase","map","user","nameHtml","toLowerCase","startsWith","names","split","join","_objectSpread","unsubscribe","index","id","onMouseOver","src","dangerouslySetInnerHTML","__html","MentionUserListWithRef","MentionWrapper","metionUserListRef","showUserList","setShowUserList","_useMention","mentionsEl","mentionEl","mentionName","mentionId","unsubscribeArrowUp","unsubscribeArrowDown","handleSelect","createObserver","listeners","subscribe","listener","filter","l","publish","currentListerners","useEventListeners","keyDown","keyUp","arrowUp","arrowDown","enter","usePollute","polluteFnsRef","pollute","InputEmoji","cleanOnEnter","maxLength","inputClass","borderRadius","borderColor","fontSize","fontFamily","_useEventListeners","_usePollute","updateHTML","nextValue","handleKeydown","nativeEvent","handleFocus","handleBlur","handleTextInputChange","handlePaste","content","getData","execCommand","InputEmojiWithRef","defaultProps"],"mappings":";;;;;;;;;;AAAA,SAASA,WAAWA,CAACC,GAAG,EAAEC,GAAG,EAAE;EAC7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,WAAW,EAAE,gBAAgB;AAC7B6O,EAAAA,YAAY,EAAE,EAAE;AAChBC,EAAAA,WAAW,EAAE,SAAS;AACtBC,EAAAA,QAAQ,EAAE,EAAE;AACZC,EAAAA,UAAU,EAAE,YAAY;AACxB/O,EAAAA,QAAQ,EAAE,CAAC;AACXtC,EAAAA,YAAY,EAAE,KAAK;AACnBmG,EAAAA,YAAY,EAAE,EAAE;AAChBC,EAAAA,QAAQ,EAAEK,SAAAA;AACZ,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/utils/emoji-utils.js","../src/utils/input-event-utils.js","../src/hooks/use-sanitize.js","../src/hooks/use-expose.js","../src/hooks/use-emit.js","../src/text-input.js","../src/components/emoji-picker-button.js","../node_modules/@emoji-mart/react/dist/module.js","../src/components/emoji-picker.js","../src/components/emoji-picker-container.js","../src/components/emoji-picker-wrapper.js","../src/utils/mention-utils.js","../src/hooks/use-mention.js","../src/components/mention-user-list.js","../src/components/mention-wrapper.js","../src/utils/observer.js","../src/hooks/use-event-listeners.js","../src/hooks/user-pollute.js","../src/index.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","/* eslint-disable valid-jsdoc */\n// @ts-check\n\nexport const TRANSPARENT_GIF =\n \"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\";\n\nexport const EMOJI_STYLE = \"\";\n\n/**\n * Replace all text with emoji with an image html tag\n * @param {string} text\n * @return {string}\n */\nexport function replaceAllTextEmojis(text) {\n let allEmojis = getAllEmojisFromText(text);\n\n if (allEmojis) {\n allEmojis = [...new Set(allEmojis)]; // remove duplicates\n\n allEmojis.forEach(emoji => {\n text = replaceAll(text, emoji, getInputEmojiHTML('', emoji));\n });\n }\n\n return text;\n}\n\n/**\n * Replace all occurrencies in a string\n * @param {string} str\n * @param {string} find\n * @param {string} replace\n * @return {string}\n */\nfunction replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, \"g\"), replace);\n}\n\n/**\n * Get all emojis from the text\n * @param {string} text\n * @return {string[]}\n */\nfunction getAllEmojisFromText(text) {\n return text.match(\n /(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*/g\n );\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param { import(\"../types/types\").EmojiMartItem } emoji\n * @return {string}\n */\nexport function getImageEmoji(emoji) {\n /** @type {HTMLElement | null} */\n const emojiPickerEl = document.querySelector('em-emoji-picker')\n\n if (!emojiPickerEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n /** @type {HTMLSpanElement | null=} */\n const emojiSpanEl = emojiPickerEl?.shadowRoot?.querySelector(`[title=\"${emoji.name}\"] > span > span`)\n\n if (!emojiSpanEl) {\n return getInputEmojiNativeHTML(emoji.native)\n }\n\n const style = replaceAll(emojiSpanEl.style.cssText, '\"', \"'\");\n\n return getInputEmojiHTML(style, emoji.native);\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {string} style\n * @param {string} emoji\n * @returns\n */\nfunction getInputEmojiHTML(style, emoji) {\n return `<img style=\"${style}; display: inline-block\" data-emoji=\"${emoji}\" src=\"${TRANSPARENT_GIF}\" />`;\n}\n\n/**\n * \n * @param {string} emoji \n * @returns \n */\nfunction getInputEmojiNativeHTML(emoji) {\n return `<span class=\"width: 18px; height: 18px; display: inline-block; margin: 0 1px;\">${emoji}</span>`;\n}\n\n/**\n *\n * @param {string} html\n * @return {string}\n */\nexport function replaceAllTextEmojiToString(html) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach(image => {\n container.innerHTML = container.innerHTML.replace(\n image.outerHTML,\n image.dataset.emoji\n );\n });\n\n return container.innerHTML;\n}\n","// @ts-check\n\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString,\n} from \"./emoji-utils\";\n\n/**\n * Handle copy of current selected text\n * @param {React.ClipboardEvent} event\n */\nexport function handleCopy(event) {\n const selectedText = window.getSelection();\n\n if (selectedText === null) {\n return;\n }\n\n let container = document.createElement(\"div\");\n\n for (let i = 0, len = selectedText.rangeCount; i < len; ++i) {\n container.appendChild(selectedText.getRangeAt(i).cloneContents());\n }\n\n container = replaceEmojiToString(container);\n\n event.clipboardData.setData(\"text\", container.innerText);\n event.preventDefault();\n}\n\n/**\n *\n * @param {string} html\n */\nexport function handlePasteHtmlAtCaret(html) {\n let sel;\n let range;\n if (window.getSelection) {\n // IE9 and non-IE\n sel = window.getSelection();\n\n if (sel === null) return;\n\n if (sel.getRangeAt && sel.rangeCount) {\n range = sel.getRangeAt(0);\n range.deleteContents();\n\n // Range.createContextualFragment() would be useful here but is\n // non-standard and not supported in all browsers (IE9, for one)\n const el = document.createElement(\"div\");\n el.innerHTML = html;\n const frag = document.createDocumentFragment();\n let node;\n let lastNode;\n while ((node = el.firstChild)) {\n lastNode = frag.appendChild(node);\n }\n range.insertNode(frag);\n\n // Preserve the selection\n if (lastNode) {\n range = range.cloneRange();\n range.setStartAfter(lastNode);\n range.collapse(true);\n sel.removeAllRanges();\n sel.addRange(range);\n }\n }\n }\n}\n\n/**\n * Replace emoji img to its string value\n * @param {HTMLDivElement} container\n * @return {HTMLDivElement}\n */\nfunction replaceEmojiToString(container) {\n const images = Array.prototype.slice.call(container.querySelectorAll(\"img\"));\n\n images.forEach((image) => {\n image.outerHTML = image.dataset.emoji;\n });\n\n return container;\n}\n\n/**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\nexport function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = replaceAllTextEmojis(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n}\n\n/**\n * @typedef {object} HandleKeyDownOptions\n * @property {HTMLDivElement} placeholderEl\n * @property {number} maxLength\n * @property {HTMLDivElement} inputEl\n * @property {React.MutableRefObject<string>} cleanedTextRef\n * @property {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @property {boolean} cleanOnEnter\n * @property {function(): void} emitChange\n * @property {(function(string): void)=} onEnter\n * @property {(function(KeyboardEvent): void)=} onKeyDown\n * @property {(function(string): void)} updateHTML\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @typedef {Object} HandleSelectEmojiProps\n * @property {import(\"../types/types\").EmojiMartItem} emoji\n * @property {React.MutableRefObject<import('../text-input').Ref>} textInputRef\n * @property {boolean} keepOpened\n * @property {() => void} toggleShowPicker\n * @property {number=} maxLength\n */\n\n/**\n *\n * @param {HandleSelectEmojiProps} props\n */\nexport function handleSelectEmoji({\n emoji,\n textInputRef,\n keepOpened,\n toggleShowPicker,\n maxLength,\n}) {\n if (\n typeof maxLength !== \"undefined\" &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n textInputRef.current.appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n toggleShowPicker();\n }\n}\n\n/**\n *\n * @param {{text: string, html: string}} props\n * @return {number}\n */\nexport function totalCharacters({ text, html }) {\n const textCount = text.length;\n const emojisCount = (html.match(/<img/g) || []).length;\n\n return textCount + emojisCount;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * Handle keyup event\n * @param {() => void} emitChange\n * @param {(event: KeyboardEvent) => void} onKeyDownMention\n * @param {React.MutableRefObject<string>} cleanedTextRef\n * @param {React.MutableRefObject<HTMLDivElement>} textInputRef\n * @return {(event: KeyboardEvent) => void}\n */\nexport function handleKeyup(\n emitChange,\n onKeyDownMention,\n cleanedTextRef,\n textInputRef,\n) {\n return (event) => {\n const text = replaceAllTextEmojiToString(textInputRef.current.innerHTML);\n cleanedTextRef.current = text;\n emitChange();\n onKeyDownMention(event);\n };\n}\n\n/**\n * Handle focus event\n * @param {function(FocusEvent): void} onFocus\n * @return {function(FocusEvent): void}\n */\nexport function handleFocus(onFocus) {\n return (event) => {\n onFocus(event);\n };\n}\n\n/**\n * Set caret to the end of text value\n * @param {React.MutableRefObject<HTMLDivElement| null>} input\n */\nexport function moveCaretToEnd(input) {\n let range;\n let selection;\n if (document.createRange && input.current) {\n range = document.createRange();\n range.selectNodeContents(input.current);\n range.collapse(false);\n selection = window.getSelection();\n if (selection) {\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n}\n/**\n *\n * @param {HTMLDivElement} inputDiv\n * @return {string}\n */\nexport function removeHtmlExceptBr(inputDiv) {\n const temp = inputDiv.innerHTML.replace(/<br\\s*\\/?>/gi, \"[BR]\"); // temporarily replace <br> with placeholder\n const stripped = temp.replace(/<[^>]+>/g, \"\"); // strip all html tags\n const final = stripped.replace(/\\[BR\\]/gi, \"</br>\"); // replace placeholders with <br>\n return final;\n}\n\n/**\n * \n * @param {*} range \n * @returns \n */\nexport function getSelectionStart(range) {\n let node = range.startContainer;\n let offset = range.startOffset;\n\n // Handle cases where the selection start node is not a text node\n if (node.nodeType !== Node.TEXT_NODE) {\n while (node.nodeType !== Node.TEXT_NODE) {\n node = node.nextSibling;\n if (!node) break;\n }\n if (!node) {\n node = range.commonAncestorContainer;\n while (node.nodeType !== Node.TEXT_NODE) {\n node = node.firstChild;\n }\n }\n offset = 0;\n }\n\n return { node, offset };\n}\n\n/**\n * \n * @returns {Object} cursor\n */\nexport function getCursor() {\n const selection = window.getSelection();\n const range = selection.getRangeAt(0);\n const selectionStart = getSelectionStart(range);\n\n return {selection, range, selectionStart}\n}\n\n/**\n *\n */\nexport function addLineBreak() {\n const { selection, range, selectionStart } = getCursor()\n\n // If cursor is at the end of the text content, add one more line break\n if (\n selection.isCollapsed &&\n selectionStart.offset === selectionStart.node.textContent.length\n ) {\n const br = document.createElement(\"br\");\n range.insertNode(br);\n range.setStartAfter(br);\n range.setEndAfter(br);\n selection.removeAllRanges();\n selection.addRange(range);\n\n const br2 = document.createElement(\"br\");\n range.insertNode(br2);\n range.setStartAfter(br2);\n range.setEndAfter(br2);\n selection.removeAllRanges();\n selection.addRange(range);\n } else {\n const br = document.createElement(\"br\");\n range.insertNode(br);\n range.setStartAfter(br);\n range.setEndAfter(br);\n selection.removeAllRanges();\n selection.addRange(range);\n // Set cursor position right before the first letter after the line break\n if (\n selectionStart.node.nextSibling &&\n selectionStart.node.nextSibling.nodeType === Node.TEXT_NODE\n ) {\n range.setStart(selectionStart.node.nextSibling, 1);\n range.setEnd(selectionStart.node.nextSibling, 1);\n }\n selection.removeAllRanges();\n selection.addRange(range);\n }\n}\n","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\nimport { removeHtmlExceptBr } from \"../utils/input-event-utils\";\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @param {boolean} shouldReturn\n */\nexport function useSanitize(shouldReturn) {\n /** @type {React.MutableRefObject<SanitizeFn[]>} */\n const sanitizeFnsRef = useRef([]);\n\n const sanitizedTextRef = useRef(\"\");\n\n /** @type {(fn: SanitizeFn) => void} */\n const addSanitizeFn = useCallback(fn => {\n sanitizeFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const sanitize = useCallback(html => {\n let result = sanitizeFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, html);\n\n result = replaceAllHtmlToString(result, shouldReturn);\n\n sanitizedTextRef.current = result;\n\n return result;\n }, []);\n\n return { addSanitizeFn, sanitize, sanitizedTextRef };\n}\n\n/**\n *\n * @param {string} html\n * @param {boolean} shouldReturn\n * @return {string}\n */\nexport function replaceAllHtmlToString(html, shouldReturn) {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n let text\n if(shouldReturn) {\n text = removeHtmlExceptBr(container)\n } else {\n text = container.innerText || \"\";\n }\n\n // remove all ↵ for safari\n text = text.replace(/\\n/gi, \"\");\n\n return text;\n}\n","// @ts-check\n\nimport { useImperativeHandle } from \"react\";\nimport { useSanitize } from \"./use-sanitize\";\n\n/**\n * @typedef {Object} Props\n * @property {React.Ref<any>} ref\n * @property {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @property {(value: string) => void} setValue\n * @property {() => void} emitChange\n */\n\n/**\n *\n * @param {Props} props\n */\nexport function useExpose({ ref, textInputRef, setValue, emitChange }) {\n const { sanitize, sanitizedTextRef } = useSanitize(false);\n\n useImperativeHandle(ref, () => ({\n get value() {\n return sanitizedTextRef.current;\n },\n set value(value) {\n setValue(value);\n },\n focus: () => {\n if (textInputRef.current === null) return\n textInputRef.current.focus();\n },\n blur: () => {\n if (textInputRef.current !== null) {\n sanitize(textInputRef.current.html);\n\n }\n\n emitChange();\n }\n }));\n}\n","// @ts-check\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * useEmit\n * @param {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef\n * @param {(size: {width: number, height: number}) => void} onResize\n * @param {(text: string) => void} onChange\n */\nexport function useEmit(textInputRef, onResize, onChange) {\n /** @type {React.MutableRefObject<{width: number; height: number} | null>} */\n const currentSizeRef = useRef(null);\n const onChangeFn = useRef(onChange);\n\n const checkAndEmitResize = useCallback(() => {\n if (textInputRef.current !== null) {\n const currentSize = currentSizeRef.current;\n\n const nextSize = textInputRef.current.size;\n\n if (\n (!currentSize ||\n currentSize.width !== nextSize.width ||\n currentSize.height !== nextSize.height) &&\n typeof onResize === \"function\"\n ) {\n onResize(nextSize);\n }\n\n currentSizeRef.current = nextSize;\n }\n }, [onResize, textInputRef]);\n\n const emitChange = useCallback((sanitizedText) => {\n if (typeof onChangeFn.current === \"function\") {\n onChangeFn.current(sanitizedText);\n }\n\n if (typeof onResize === \"function\") {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, onResize]);\n\n useEffect(() => {\n if (textInputRef.current) {\n checkAndEmitResize();\n }\n }, [checkAndEmitResize, textInputRef]);\n\n return emitChange;\n}\n","// @ts-check\n// vendors\nimport React, { useImperativeHandle, forwardRef, useRef } from \"react\";\nimport { addLineBreak, handlePasteHtmlAtCaret } from \"./utils/input-event-utils\";\nimport { replaceAllTextEmojiToString } from \"./utils/emoji-utils\";\n\n/**\n * @typedef {Object} Props\n * @property {(event: React.KeyboardEvent) => void} onKeyDown\n * @property {(event: React.KeyboardEvent) => void} onKeyUp\n * @property {() => void} onFocus\n * @property {() => void} onBlur\n * @property {(sanitizedText: string) => void=} onChange\n * @property {(event: React.KeyboardEvent) => void} onArrowUp\n * @property {(event: React.KeyboardEvent) => void} onArrowDown\n * @property {(event: React.KeyboardEvent) => void} onEnter\n * @property {boolean} shouldReturn\n * @property {(event: React.ClipboardEvent) => void} onCopy\n * @property {(event: React.ClipboardEvent) => void} onPaste\n * @property {string} placeholder\n * @property {React.CSSProperties} style\n * @property {number} tabIndex\n * @property {string} className\n * @property {(html: string) => void} onChange\n */\n\n/**\n * @typedef {{\n * appendContent: (html: string) => void;\n * html: string;\n * text: string;\n * size: { width: number; height: number;};\n * focus: () => void;\n * }} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst TextInput = (\n { placeholder, style, tabIndex, className, onChange, ...props },\n ref\n) => {\n useImperativeHandle(ref, () => ({\n appendContent: html => {\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n handlePasteHtmlAtCaret(html);\n\n if (textInputRef.current) {\n textInputRef.current.focus();\n }\n\n if (textInputRef.current && placeholderRef.current && replaceAllTextEmojiToString(textInputRef.current.innerHTML) === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else if (placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n\n if (textInputRef.current && typeof onChange === 'function') {\n onChange(textInputRef.current.innerHTML);\n }\n },\n set html(value) {\n if (textInputRef.current) {\n textInputRef.current.innerHTML = value;\n }\n \n if (placeholderRef.current) {\n const text = replaceAllTextEmojiToString(value)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n },\n get html() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerHTML;\n },\n get text() {\n if (!textInputRef.current) return ''\n\n return textInputRef.current.innerText;\n },\n get size() {\n if (!textInputRef.current) {\n return {\n width: 0,\n height: 0\n }\n }\n\n return {\n width: textInputRef.current.offsetWidth,\n height: textInputRef.current.offsetHeight\n };\n },\n focus() {\n if (!textInputRef.current) return\n\n textInputRef.current.focus();\n }\n }));\n\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const placeholderRef = useRef(null);\n /** @type {React.MutableRefObject<HTMLDivElement | null>} */\n const textInputRef = useRef(null);\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) { \n if (event.key === \"Enter\" && (event.shiftKey === true || event.ctrlKey === true) && props.shouldReturn) {\n event.preventDefault();\n if(textInputRef.current) {\n addLineBreak()\n return;\n }\n } \n if (event.key === \"Enter\") {\n props.onEnter(event);\n } else if (event.key === \"ArrowUp\") {\n props.onArrowUp(event);\n } else if (event.key === \"ArrowDown\") {\n props.onArrowDown(event);\n } else {\n if (event.key.length === 1 && placeholderRef.current) {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n props.onKeyDown(event);\n }\n\n /** */\n function handleClick() {\n props.onFocus();\n }\n\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyUp(event) {\n props.onKeyUp(event);\n\n const input = textInputRef.current;\n\n if (placeholderRef.current && input) {\n const text = replaceAllTextEmojiToString(input.innerHTML)\n if (text === \"\") {\n placeholderRef.current.style.visibility = \"visible\";\n } else {\n placeholderRef.current.style.visibility = \"hidden\";\n }\n }\n\n if (typeof onChange === 'function' && textInputRef.current) {\n onChange(textInputRef.current.innerHTML);\n }\n }\n\n return (\n <div className=\"react-input-emoji--container\" style={style}>\n <div className=\"react-input-emoji--wrapper\" onClick={handleClick}>\n <div ref={placeholderRef} className=\"react-input-emoji--placeholder\">\n {placeholder}\n </div>\n <div\n ref={textInputRef}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n tabIndex={tabIndex}\n contentEditable\n className={`react-input-emoji--input${className ? ` ${className}` : \"\"\n }`}\n onBlur={props.onBlur}\n onCopy={props.onCopy}\n onPaste={props.onPaste}\n data-testid=\"react-input-emoji--input\"\n />\n </div>\n </div>\n );\n};\n\nconst TextInputWithRef = forwardRef(TextInput);\n\nexport default TextInputWithRef;\n","// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {(event: React.MouseEvent) => void} toggleShowPicker\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerButton({ showPicker, toggleShowPicker, buttonElement, buttonRef }) {\n \n const localButtonRef = useRef(null);\n const [showCustomButtonContent, setShowCustomButtonContent] = useState(false);\n\n useEffect(() => {\n if ((buttonRef?.current?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonRef.current.childNodes[0]);\n setShowCustomButtonContent(true);\n } else if ((buttonElement?.childNodes?.length ?? 0) > 2) {\n localButtonRef.current.appendChild(buttonElement?.childNodes[0]);\n setShowCustomButtonContent(true);\n }\n }, [buttonElement?.childNodes]);\n\n return (\n <button\n ref={localButtonRef}\n type=\"button\"\n className={`react-input-emoji--button${\n showPicker ? \" react-input-emoji--button__show\" : \"\"\n }`}\n onClick={toggleShowPicker}\n >\n {!showCustomButtonContent && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width=\"24\"\n height=\"24\"\n className=\"react-input-emoji--button--icon\"\n >\n {/* eslint-disable-next-line max-len */}\n <path d=\"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10\" />\n {/* eslint-disable-next-line max-len */}\n <path d=\"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0\" />\n </svg>\n )}\n </button>\n );\n}\n\nexport default EmojiPickerButton;\n","import $dvPge$react, {useRef as $dvPge$useRef, useEffect as $dvPge$useEffect} from \"react\";\nimport {Picker as $dvPge$Picker} from \"emoji-mart\";\n\n\n\nfunction $e5534fc185f7111e$export$2e2bcd8739ae039(props) {\n const ref = (0, $dvPge$useRef)(null);\n const instance = (0, $dvPge$useRef)(null);\n if (instance.current) instance.current.update(props);\n (0, $dvPge$useEffect)(()=>{\n instance.current = new (0, $dvPge$Picker)({\n ...props,\n ref: ref\n });\n return ()=>{\n instance.current = null;\n };\n }, []);\n return /*#__PURE__*/ (0, $dvPge$react).createElement(\"div\", {\n ref: ref\n });\n}\n\n\nexport {$e5534fc185f7111e$export$2e2bcd8739ae039 as default};\n//# sourceMappingURL=module.js.map\n","// vendors\nimport React, { memo, useMemo } from \"react\";\nimport Picker from \"@emoji-mart/react\";\n\n/**\n * @typedef {object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {function(import(\"../types/types\").EmojiMartItem): void} onSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Component\n * @param {Props} props\n */\nfunction EmojiPicker(props) {\n const { theme, onSelectEmoji, disableRecent, customEmojis, language } = props;\n\n /** @type {string[]} */\n const categories = useMemo(() => {\n /** @type {string[]} */\n let categoryies = [];\n\n if (!disableRecent) {\n categoryies.push(\"frequent\");\n }\n\n categoryies = [\n ...categoryies,\n \"people\",\n \"nature\",\n \"foods\",\n \"activity\",\n \"places\",\n \"objects\",\n \"symbols\",\n \"flags\"\n ];\n\n return categoryies;\n }, [disableRecent]);\n\n const i18n = useMemo(() => {\n if (!language) {\n return undefined\n }\n\n return require(`@emoji-mart/data/i18n/${language ?? 'en'}.json`)\n }, [language])\n\n return (\n <Picker\n data={undefined}\n theme={theme}\n previewPosition=\"none\"\n onEmojiSelect={onSelectEmoji}\n custom={customEmojis}\n categories={categories}\n set=\"apple\"\n i18n={i18n}\n />\n );\n}\n\n\nexport default memo(EmojiPicker);\n","import React from \"react\";\nimport EmojiPicker from \"./emoji-picker\";\n\n/**\n * @typedef {object} Props\n * @property {boolean} showPicker\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {(emoji: import(\"../types/types\").EmojiMartItem) => void} handleSelectEmoji\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {('above' | 'below')=} position\n * @property {import('../types/types').Languages=} language\n */\n\n/**\n * Emoji Picker Button Component\n * @param {Props} props\n * @return {JSX.Element}\n */\nfunction EmojiPickerContainer({\n showPicker,\n theme,\n handleSelectEmoji,\n disableRecent,\n customEmojis,\n position,\n language\n}) {\n return (\n <div className=\"react-emoji-picker--container\">\n {showPicker && (\n <div\n className=\"react-emoji-picker--wrapper\"\n onClick={evt => evt.stopPropagation()}\n style={position === 'below' ? {top: '40px'} : {}}\n >\n <div className=\"react-emoji-picker\">\n <EmojiPicker\n theme={theme}\n onSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n language={language}\n />\n </div>\n </div>\n )}\n </div>\n );\n}\n\nexport default EmojiPickerContainer;\n","// @ts-check\n// vendors\nimport React, { useEffect, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport {\n getImageEmoji,\n replaceAllTextEmojis,\n replaceAllTextEmojiToString\n} from \"../utils/emoji-utils\";\n\nimport EmojiPickerButton from \"./emoji-picker-button\";\nimport EmojiPickerContainer from \"./emoji-picker-container\";\n\nconst EMOJI_PICKER_CONTAINER_HEIGHT = 435;\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {'light' | 'dark' | 'auto'} theme\n * @property {boolean} keepOpened\n * @property {boolean} disableRecent\n * @property {any[]=} customEmojis\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n * @property {(fn: PolluteFn) => void} addPolluteFn\n * @property {(html: string) => void} appendContent\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n * @property {import('../types/types').Languages=} language\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst EmojiPickerWrapper = props => {\n const {\n theme,\n keepOpened,\n disableRecent,\n customEmojis,\n addSanitizeFn,\n addPolluteFn,\n appendContent,\n buttonElement,\n buttonRef,\n language\n } = props;\n\n const [showPicker, setShowPicker] = useState(false);\n /** @type {[HTMLDivElement | undefined, React.Dispatch<React.SetStateAction<HTMLDivElement | undefined>>]} */\n const [customButton, setCustomButton] = useState();\n /** @type {['above' | 'below' | undefined, React.Dispatch<React.SetStateAction<'above' | 'below' | undefined>>]} */\n const [emojiPickerPosition, setEmojiPickerPosition] = useState()\n\n useEffect(() => {\n addSanitizeFn(replaceAllTextEmojiToString);\n }, [addSanitizeFn]);\n\n useEffect(() => {\n addPolluteFn(replaceAllTextEmojis);\n }, [addPolluteFn]);\n\n useEffect(() => {\n /**\n *\n * @param {MouseEvent} event\n */\n function checkClickOutside(event) {\n /** @type {HTMLElement} */\n // @ts-ignore\n const element = event.target;\n\n if (\n element.classList.contains(\"react-input-emoji--button\") ||\n element.classList.contains(\"react-input-emoji--button--icon\")\n ) {\n return;\n }\n\n setShowPicker(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n /**\n *\n * @param {React.MouseEvent} event\n */\n function toggleShowPicker(event) {\n event.stopPropagation();\n event.preventDefault();\n\n setEmojiPickerPosition(calcTopPosition(event))\n\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n\n /**\n * \n * @param {React.MouseEvent} event\n * @return {'above' | 'below'}\n */\n function calcTopPosition(event) {\n const btn = event.currentTarget\n const btnRect = btn.getBoundingClientRect();\n\n const popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT;\n\n // Decide to display above or below based on available space\n if (btnRect.top >= popoverHeight) {\n // Display above\n return 'above'\n } else {\n // Display below\n return 'below'\n }\n }\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {import(\"../types/types\").EmojiMartItem} emoji\n */\n function handleSelectEmoji(emoji) {\n appendContent(getImageEmoji(emoji));\n\n if (!keepOpened) {\n setShowPicker(currentShowPicker => !currentShowPicker);\n }\n }\n\n useEffect(() => {\n if (buttonRef?.current?.style) {\n buttonRef.current.style.position = \"relative\";\n setCustomButton(buttonRef.current);\n } else if (buttonElement?.style) {\n buttonElement.style.position = \"relative\";\n setCustomButton(buttonElement);\n }\n }, [buttonRef, buttonElement]);\n\n return customButton ? (\n (ReactDOM.createPortal(\n <>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n buttonElement={customButton}\n buttonRef={buttonRef}\n />\n </>,\n customButton\n ))\n ) : (\n (<>\n <EmojiPickerContainer\n showPicker={showPicker}\n theme={theme}\n handleSelectEmoji={handleSelectEmoji}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n position={emojiPickerPosition}\n language={language}\n />\n <EmojiPickerButton\n showPicker={showPicker}\n toggleShowPicker={toggleShowPicker}\n />\n </>)\n );\n};\n\nexport default EmojiPickerWrapper;\n","// @ts-check\n\n/**\n *\n * @return {string | null}\n */\nexport function getTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return null;\n\n const text = range.text.substring(range.begin, range.end);\n\n return text || null;\n}\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function deleteTextFromAtToCaret() {\n const range = getRangeFromAtToCaret();\n\n if (!range) return;\n\n // @ts-ignore\n range.element.deleteData(range.begin, range.end - range.begin);\n}\n\n/**\n *\n * @return {{begin: number, end: number, text: string, element: Node} | null}\n */\nfunction getRangeFromAtToCaret() {\n const elementWithFocus = getElementWithFocus();\n\n if (!elementWithFocus) {\n return null;\n }\n\n const { element, caretOffset } = elementWithFocus;\n const text = element.textContent;\n const lastAt = text.lastIndexOf(\"@\");\n\n if (\n lastAt === -1 ||\n lastAt >= caretOffset ||\n (lastAt !== 0 && text[lastAt - 1] !== \" \")\n ) {\n return null;\n }\n\n return { begin: lastAt, end: caretOffset, text, element };\n}\n\n/**\n *\n * @return {{element: Node, caretOffset: number}}\n */\nexport function getElementWithFocus() {\n const element = getSelectionStart();\n\n if (element === null) {\n return null;\n }\n\n let caretOffset = 0;\n if (typeof window.getSelection != \"undefined\") {\n const range = window.getSelection().getRangeAt(0);\n const preCaretRange = range.cloneRange();\n preCaretRange.selectNodeContents(element);\n preCaretRange.setEnd(range.endContainer, range.endOffset);\n caretOffset = preCaretRange.toString().length;\n } else if (\n // @ts-ignore\n typeof document.selection != \"undefined\" &&\n // @ts-ignore\n document.selection.type != \"Control\"\n ) {\n // @ts-ignore\n const textRange = document.selection.createRange();\n // @ts-ignore\n const preCaretTextRange = document.body.createTextRange();\n preCaretTextRange.moveToElementText(element);\n preCaretTextRange.setEndPoint(\"EndToEnd\", textRange);\n caretOffset = preCaretTextRange.text.length;\n }\n\n return { element, caretOffset };\n}\n\n/**\n *\n * @return {Node | null}\n */\nfunction getSelectionStart() {\n const node = document.getSelection().anchorNode;\n return node?.nodeType == 3 ? node : null;\n}\n","// @ts-check\nimport { useCallback, useState } from \"react\";\nimport {\n deleteTextFromAtToCaret,\n getElementWithFocus,\n getTextFromAtToCaret\n} from \"../utils/mention-utils\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n// eslint-disable-next-line valid-jsdoc\n/**\n *\n * @param {(text: string) => Promise<MentionUser[]>=} searchMention\n * @returns {{mentionSearchText: string | null, mentionUsers: MentionUser[], onKeyUp: (event: React.KeyboardEvent) => void, onFocus: () => void, onSelectUser: () => void, loading: boolean}}\n */\nexport function useMention(searchMention) {\n const [loading, setLoading] = useState(false);\n\n /** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */\n const [mentionUsers, setMentionUsers] = useState([]);\n\n /** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */\n const [mentionSearchText, setMentionSearchText] = useState(null);\n\n const onSelectUser = useCallback(() => {\n deleteTextFromAtToCaret();\n setMentionUsers([]);\n }, []);\n\n /** */\n const checkMentionText = useCallback(async () => {\n const metionText = getTextFromAtToCaret();\n\n setMentionSearchText(metionText);\n\n if (metionText === null) {\n setMentionUsers([]);\n } else {\n setLoading(true);\n const users = await searchMention(metionText);\n setLoading(false);\n setMentionUsers(users);\n }\n }, [searchMention]);\n\n /** @type {(event: React.KeyboardEvent) => void} */\n const onKeyUp = useCallback(\n async event => {\n if (typeof searchMention !== \"function\") return;\n\n if (\n event.key === \"Backspace\" &&\n getElementWithFocus()?.element.parentElement.hasAttribute(\n \"data-mention-id\"\n )\n ) {\n const elementWithFocus = getElementWithFocus();\n elementWithFocus.element.parentElement.remove();\n } else if (\n ![\"ArrowUp\", \"ArrowDown\", \"Esc\", \"Escape\"].includes(event.key)\n ) {\n checkMentionText();\n }\n },\n [checkMentionText, searchMention]\n );\n\n const onFocus = useCallback(() => {\n checkMentionText();\n }, [checkMentionText]);\n\n return {\n mentionSearchText,\n mentionUsers,\n onKeyUp,\n onFocus,\n onSelectUser,\n loading\n };\n}\n","// @ts-check\n// vendors\nimport React, {\n useImperativeHandle,\n useState,\n forwardRef,\n useMemo,\n useEffect\n} from \"react\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MentionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {Object} Props\n * @property {MentionUser[]} users\n * @property {string | null} mentionSearchText\n * @property {(user: MentionUser) => void} onSelect\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n */\n\n/**\n * @typedef {{prevUser: () => void; nextUser: () => void;}} Ref\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.ForwardRefRenderFunction<Ref, Props>} */\nconst MentionUserList = (\n { users, mentionSearchText, onSelect, addEventListener },\n ref\n) => {\n const [selectedUser, setSelectedUser] = useState(0);\n\n useImperativeHandle(ref, () => ({\n prevUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === 0) {\n return 0;\n }\n\n return currentSelectedUser - 1;\n });\n },\n nextUser: () => {\n setSelectedUser(currentSelectedUser => {\n if (currentSelectedUser === users.length - 1) {\n return users.length - 1;\n }\n\n return currentSelectedUser + 1;\n });\n }\n }));\n\n useEffect(() => {\n setSelectedUser(0);\n }, [users]);\n\n /**\n *\n * @param {string} selectedText\n * @param {string} rest\n * @return {string}\n */\n function getMentionSelectedNameEl(selectedText, rest) {\n return `<span class=\"react-input-emoji--mention--item--name__selected\" data-testid=\"metion-selected-word\">${selectedText}</span>${rest}`;\n }\n\n /** @type {(MentionUser & {nameHtml: string})[]} */\n const usersFiltered = useMemo(() => {\n const searchText = mentionSearchText\n ? mentionSearchText.substring(1).toLocaleLowerCase()\n : \"\";\n return users.map(user => {\n let nameHtml = user.name;\n\n if (mentionSearchText && mentionSearchText.length > 1) {\n if (user.name.toLowerCase().startsWith(searchText)) {\n nameHtml = getMentionSelectedNameEl(\n user.name.substring(0, searchText.length),\n user.name.substring(searchText.length)\n );\n } else {\n const names = user.name.split(\" \");\n\n nameHtml = names\n .map(name => {\n if (name.toLocaleLowerCase().startsWith(searchText)) {\n return getMentionSelectedNameEl(\n name.substring(0, searchText.length),\n name.substring(searchText.length)\n );\n }\n return name;\n })\n .join(\" \");\n }\n }\n\n return {\n ...user,\n nameHtml\n };\n });\n }, [mentionSearchText, users]);\n\n // eslint-disable-next-line valid-jsdoc\n /**\n *\n * @param {MentionUser} user\n * @returns {(event: React.MouseEvent) => void} event\n */\n function handleClick(user) {\n return event => {\n event.stopPropagation();\n event.preventDefault();\n\n onSelect(user);\n };\n }\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"enter\", event => {\n event.stopPropagation();\n event.preventDefault();\n onSelect(usersFiltered[selectedUser]);\n });\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onSelect, selectedUser, usersFiltered]);\n\n return (\n <ul\n className=\"react-input-emoji--mention--list\"\n data-testid=\"mention-user-list\"\n >\n {usersFiltered.map((user, index) => (\n <li key={user.id}>\n <button\n type=\"button\"\n onClick={handleClick(user)}\n className={`react-input-emoji--mention--item${\n selectedUser === index\n ? \" react-input-emoji--mention--item__selected\"\n : \"\"\n }`}\n onMouseOver={() => setSelectedUser(index)}\n >\n <img\n className=\"react-input-emoji--mention--item--img\"\n src={user.image}\n />\n <div\n className=\"react-input-emoji--mention--item--name\"\n dangerouslySetInnerHTML={{ __html: user.nameHtml }}\n />\n </button>\n </li>\n ))}\n </ul>\n );\n};\n\nconst MentionUserListWithRef = forwardRef(MentionUserList);\n\nexport default MentionUserListWithRef;\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, useState } from \"react\";\n\n// hooks\nimport { useMention } from \"../hooks/use-mention\";\n\n// components\nimport MentionUserList from \"./mention-user-list\";\n\n/**\n * @typedef {import('../types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n/**\n * @typedef {import('../types/types').SanitizeFn} SanitizeFn\n */\n\n/**\n * @typedef {Object} Props\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void} addEventListener\n * @property {(html: string) => void} appendContent\n * @property {(fn: SanitizeFn) => void} addSanitizeFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** @type {React.FC<Props>} */\nconst MentionWrapper = ({\n searchMention,\n addEventListener,\n appendContent,\n addSanitizeFn\n}) => {\n /** @type {React.MutableRefObject<import('./mention-user-list').Ref | null>} */\n const metionUserListRef = useRef(null);\n const [showUserList, setShowUserList] = useState(false);\n\n const {\n mentionSearchText,\n mentionUsers,\n loading,\n onKeyUp,\n onFocus,\n onSelectUser\n } = useMention(searchMention);\n\n useEffect(() => {\n addSanitizeFn(html => {\n const container = document.createElement(\"div\");\n container.innerHTML = html;\n\n const mentionsEl = Array.prototype.slice.call(\n container.querySelectorAll(\".react-input-emoji--mention--text\")\n );\n\n mentionsEl.forEach(mentionEl => {\n container.innerHTML = container.innerHTML.replace(\n mentionEl.outerHTML,\n `@[${mentionEl.dataset.mentionName}](userId:${mentionEl.dataset.mentionId})`\n );\n });\n\n return container.innerHTML;\n });\n }, [addSanitizeFn]);\n\n useEffect(() => {\n setShowUserList(mentionUsers.length > 0);\n }, [mentionUsers]);\n\n useEffect(() => {\n /** */\n function checkClickOutside() {\n setShowUserList(false);\n }\n\n document.addEventListener(\"click\", checkClickOutside);\n\n return () => {\n document.removeEventListener(\"click\", checkClickOutside);\n };\n }, []);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"keyUp\", onKeyUp);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onKeyUp]);\n\n useEffect(() => {\n /**\n *\n * @param {React.KeyboardEvent} event\n */\n function handleKeyDown(event) {\n switch (event.key) {\n case \"Esc\": // IE/Edge specific value\n case \"Escape\":\n setShowUserList(false);\n break;\n default:\n break;\n }\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeyDown);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener]);\n\n useEffect(() => {\n const unsubscribe = addEventListener(\"focus\", onFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onFocus]);\n\n useEffect(() => {\n if (showUserList) {\n const unsubscribeArrowUp = addEventListener(\"arrowUp\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.prevUser();\n });\n\n const unsubscribeArrowDown = addEventListener(\"arrowDown\", event => {\n event.stopPropagation();\n event.preventDefault();\n metionUserListRef.current.nextUser();\n });\n\n return () => {\n unsubscribeArrowUp();\n unsubscribeArrowDown();\n };\n }\n }, [addEventListener, showUserList]);\n\n /**\n *\n * @param {MetionUser} user\n */\n function handleSelect(user) {\n onSelectUser();\n appendContent(\n `<span class=\"react-input-emoji--mention--text\" data-mention-id=\"${user.id}\" data-mention-name=\"${user.name}\">@${user.name}</span> `\n );\n }\n\n return (\n <>\n {loading ? (\n <div className=\"react-input-emoji--mention--container\">\n <div className=\"react-input-emoji--mention--loading\">\n <div className=\"react-input-emoji--mention--loading--spinner\">\n Loading...\n </div>\n </div>\n </div>\n ) : (\n showUserList && (\n <div\n className=\"react-input-emoji--mention--container\"\n onClick={evt => evt.stopPropagation()}\n >\n <MentionUserList\n ref={metionUserListRef}\n mentionSearchText={mentionSearchText}\n users={mentionUsers}\n onSelect={handleSelect}\n addEventListener={addEventListener}\n />\n </div>\n )\n )}\n </>\n );\n};\n\nexport default MentionWrapper;\n","// @ts-check\n\n// eslint-disable-next-line valid-jsdoc\n/**\n * @template T\n * @returns {import('../types/types').ListenerObj<T>}\n */\nexport function createObserver() {\n /** @type {import('../types/types').Listerner<T>[]} */\n let listeners = [];\n\n return {\n subscribe: listener => {\n listeners.push(listener);\n return () => {\n listeners = listeners.filter(l => l !== listener);\n };\n },\n publish: event => {\n listeners.forEach(listener => listener(event));\n },\n get currentListerners() {\n return listeners;\n }\n };\n}\n","// @ts-check\n\nimport { useCallback, useMemo } from \"react\";\nimport { createObserver } from \"../utils/observer\";\n\n/**\n * @typedef {import('../types/types').TextInputListeners} TextInputListeners\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function useEventListeners() {\n /** @type {TextInputListeners} */\n const listeners = useMemo(\n () => ({\n keyDown: createObserver(),\n keyUp: createObserver(),\n arrowUp: createObserver(),\n arrowDown: createObserver(),\n enter: createObserver(),\n focus: createObserver(),\n blur: createObserver()\n }),\n []\n );\n\n /**\n * @template {keyof TextInputListeners} T, K\n * @type {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void}\n */\n const addEventListener = useCallback(\n (event, fn) => {\n return listeners[event].subscribe(fn);\n },\n [listeners]\n );\n\n return { addEventListener, listeners };\n}\n","// @ts-check\n\nimport { useCallback, useRef } from \"react\";\n\n/**\n * @typedef {import('../types/types').PolluteFn} PolluteFn\n */\n\n// eslint-disable-next-line valid-jsdoc\n/** */\nexport function usePollute() {\n /** @type {React.MutableRefObject<PolluteFn[]>} */\n const polluteFnsRef = useRef([]);\n\n /** @type {(fn: PolluteFn) => void} */\n const addPolluteFn = useCallback(fn => {\n polluteFnsRef.current.push(fn);\n }, []);\n\n /** @type {(html: string) => string} */\n const pollute = useCallback(text => {\n const result = polluteFnsRef.current.reduce((acc, fn) => {\n return fn(acc);\n }, text);\n\n return result;\n }, []);\n\n return { addPolluteFn, pollute };\n}\n","// @ts-check\n// vendors\nimport React, { useEffect, useRef, forwardRef, useCallback } from \"react\";\n\n// css\nimport \"./styles.css\";\n\n// utils\nimport { replaceAllTextEmojis } from \"./utils/emoji-utils\";\nimport { handleCopy, totalCharacters } from \"./utils/input-event-utils\";\n\n// hooks\nimport { useExpose } from \"./hooks/use-expose\";\nimport { useEmit } from \"./hooks/use-emit\";\n\n// components\nimport TextInput from \"./text-input\";\nimport EmojiPickerWrapper from \"./components/emoji-picker-wrapper\";\nimport MentionWrapper from \"./components/mention-wrapper\";\nimport { useEventListeners } from \"./hooks/use-event-listeners\";\nimport { useSanitize } from \"./hooks/use-sanitize\";\nimport { usePollute } from \"./hooks/user-pollute\";\n\n/**\n * @typedef {import('./types/types').MentionUser} MetionUser\n */\n\n/**\n * @typedef {import('./types/types').ListenerObj<any>} ListenerObj\n */\n\n/**\n * @typedef {object} Props\n * @property {string} value\n * @property {(value: string) => void} onChange\n * @property {\"light\" | \"dark\" | \"auto\"=} theme\n * @property {boolean=} cleanOnEnter\n * @property {(text: string) => void=} onEnter\n * @property {string=} placeholder\n * @property {(size: {width: number, height: number}) => void=} onResize\n * @property {() => void=} onClick\n * @property {() => void=} onFocus\n * @property {() => void=} onBlur\n * @property {boolean=} shouldReturn\n * @property {number=} maxLength\n * @property {boolean=} keepOpened\n * @property {(event: KeyboardEvent) => void=} onKeyDown\n * @property {string=} inputClass\n * @property {boolean=} disableRecent\n * @property {number=} tabIndex\n * @property {number=} height\n * @property {number=} borderRadius\n * @property {string=} borderColor\n * @property {number=} fontSize\n * @property {string=} fontFamily\n * @property {{id: string; name: string; emojis: {id: string; name: string; keywords: string[], skins: {src: string}[]}}[]=} customEmojis\n * @property {import('./types/types').Languages=} language\n * @property {(text: string) => Promise<MetionUser[]>=} searchMention\n * @property {HTMLDivElement=} buttonElement\n * @property {React.MutableRefObject=} buttonRef\n */\n\n/**\n * Input Emoji Component\n * @param {Props} props\n * @param {React.Ref<any>} ref\n * @return {JSX.Element}\n */\nfunction InputEmoji(props, ref) {\n const {\n onChange,\n onEnter,\n shouldReturn,\n onResize,\n onClick,\n onFocus,\n onBlur,\n onKeyDown,\n theme,\n cleanOnEnter,\n placeholder,\n maxLength,\n keepOpened,\n inputClass,\n disableRecent,\n tabIndex,\n value,\n customEmojis,\n language,\n searchMention,\n buttonElement,\n buttonRef,\n // style\n borderRadius,\n borderColor,\n fontSize,\n fontFamily,\n } = props;\n\n /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */\n const textInputRef = useRef(null);\n\n const { addEventListener, listeners } = useEventListeners();\n\n const { addSanitizeFn, sanitize, sanitizedTextRef } = useSanitize(props.shouldReturn);\n\n const { addPolluteFn, pollute } = usePollute();\n\n const updateHTML = useCallback(\n (nextValue = \"\") => {\n if (textInputRef.current === null) return;\n\n textInputRef.current.html = replaceAllTextEmojis(nextValue);\n sanitizedTextRef.current = nextValue;\n },\n [sanitizedTextRef]\n );\n\n const setValue = useCallback(\n /**\n * \n * @param {string} value\n */\n (value) => {\n updateHTML(value);\n },\n [updateHTML]\n );\n\n const emitChange = useEmit(textInputRef, onResize, onChange);\n\n useExpose({\n ref,\n setValue,\n textInputRef,\n emitChange\n });\n\n useEffect(() => {\n if (sanitizedTextRef.current !== value) {\n setValue(value);\n }\n }, [sanitizedTextRef, setValue, value]);\n\n // useEffect(() => {\n // updateHTML();\n // }, [updateHTML]);\n\n useEffect(() => {\n /**\n * Handle keydown event\n * @param {React.KeyboardEvent} event\n * @return {boolean}\n */\n function handleKeydown(event) {\n if (\n typeof maxLength !== \"undefined\" &&\n event.key !== \"Backspace\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n event.preventDefault();\n }\n\n if (event.key === \"Enter\" && textInputRef.current) {\n event.preventDefault();\n\n const text = sanitize(textInputRef.current.html);\n\n emitChange(sanitizedTextRef.current);\n\n if (\n typeof onEnter === \"function\" &&\n listeners.enter.currentListerners.length === 0\n ) {\n onEnter(text);\n }\n\n if (cleanOnEnter && listeners.enter.currentListerners.length === 0) {\n updateHTML(\"\");\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return false;\n }\n\n if (typeof onKeyDown === \"function\") {\n onKeyDown(event.nativeEvent);\n }\n\n return true;\n }\n\n const unsubscribe = addEventListener(\"keyDown\", handleKeydown);\n\n return () => {\n unsubscribe();\n };\n }, [\n addEventListener,\n cleanOnEnter,\n emitChange,\n listeners.enter.currentListerners.length,\n maxLength,\n onEnter,\n onKeyDown,\n sanitize,\n sanitizedTextRef,\n updateHTML\n ]);\n\n useEffect(() => {\n /** */\n function handleFocus() {\n if (typeof onClick === \"function\") {\n onClick();\n }\n\n if (typeof onFocus === \"function\") {\n onFocus();\n }\n }\n\n const unsubscribe = addEventListener(\"focus\", handleFocus);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onClick, onFocus]);\n\n useEffect(() => {\n /** */\n function handleBlur() {\n if (typeof onBlur === \"function\") {\n onBlur();\n }\n }\n\n const unsubscribe = addEventListener(\"blur\", handleBlur);\n\n return () => {\n unsubscribe();\n };\n }, [addEventListener, onBlur]);\n\n /**\n *\n * @param {string} html\n */\n function handleTextInputChange(html) {\n sanitize(html);\n\n if (value !== sanitizedTextRef.current) {\n emitChange(sanitizedTextRef.current);\n }\n }\n\n /**\n *\n * @param {string} html\n */\n function appendContent(html) {\n if (\n typeof maxLength !== \"undefined\" &&\n textInputRef.current !== null &&\n totalCharacters(textInputRef.current) >= maxLength\n ) {\n return;\n }\n\n if (textInputRef.current !== null) {\n textInputRef.current.appendContent(html);\n }\n }\n\n /**\n * Handle past on input\n * @param {React.ClipboardEvent} event\n */\n function handlePaste(event) {\n event.preventDefault();\n let content;\n if (event.clipboardData) {\n content = event.clipboardData.getData(\"text/plain\");\n content = pollute(content);\n document.execCommand(\"insertHTML\", false, content);\n }\n }\n\n return (\n <div className=\"react-emoji\">\n <MentionWrapper\n searchMention={searchMention}\n addEventListener={addEventListener}\n appendContent={appendContent}\n addSanitizeFn={addSanitizeFn}\n />\n <TextInput\n ref={textInputRef}\n onCopy={handleCopy}\n onPaste={handlePaste}\n shouldReturn={shouldReturn}\n onBlur={listeners.blur.publish}\n onFocus={listeners.focus.publish}\n onArrowUp={listeners.arrowUp.publish}\n onArrowDown={listeners.arrowDown.publish}\n onKeyUp={listeners.keyUp.publish}\n onKeyDown={listeners.keyDown.publish}\n onEnter={listeners.enter.publish}\n placeholder={placeholder}\n style={{\n borderRadius,\n borderColor,\n fontSize,\n fontFamily\n }}\n tabIndex={tabIndex}\n className={inputClass}\n onChange={handleTextInputChange}\n />\n <EmojiPickerWrapper\n theme={theme}\n keepOpened={keepOpened}\n disableRecent={disableRecent}\n customEmojis={customEmojis}\n addSanitizeFn={addSanitizeFn}\n addPolluteFn={addPolluteFn}\n appendContent={appendContent}\n buttonElement={buttonElement}\n buttonRef={buttonRef}\n language={language}\n />\n </div>\n );\n}\n\nconst InputEmojiWithRef = forwardRef(InputEmoji);\n\nInputEmojiWithRef.defaultProps = {\n theme: /** @type {const} */ (\"auto\"),\n height: 30,\n placeholder: \"Type a message\",\n borderRadius: 21,\n borderColor: \"#EAEAEA\",\n fontSize: 15,\n fontFamily: \"sans-serif\",\n tabIndex: 0,\n shouldReturn: false,\n customEmojis: [],\n language: undefined,\n};\n\nexport default InputEmojiWithRef;\n"],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","TRANSPARENT_GIF","replaceAllTextEmojis","text","allEmojis","getAllEmojisFromText","_toConsumableArray","Set","forEach","emoji","replaceAll","getInputEmojiHTML","str","find","replace","RegExp","match","getImageEmoji","_emojiPickerEl$shadow","emojiPickerEl","querySelector","getInputEmojiNativeHTML","emojiSpanEl","shadowRoot","concat","name","replaceAllTextEmojiToString","html","container","innerHTML","images","Array","prototype","slice","call","querySelectorAll","image","outerHTML","dataset","handleCopy","event","selectedText","window","getSelection","i","len","rangeCount","getRangeAt","cloneContents","replaceEmojiToString","clipboardData","setData","innerText","preventDefault","handlePasteHtmlAtCaret","sel","range","deleteContents","el","frag","createDocumentFragment","node","lastNode","insertNode","cloneRange","setStartAfter","collapse","removeAllRanges","addRange","totalCharacters","_ref2","textCount","length","emojisCount","removeHtmlExceptBr","inputDiv","temp","stripped","final","getSelectionStart","startContainer","offset","startOffset","nodeType","Node","TEXT_NODE","nextSibling","commonAncestorContainer","getCursor","selection","selectionStart","addLineBreak","_getCursor","isCollapsed","textContent","br","setEndAfter","br2","setStart","setEnd","useSanitize","shouldReturn","sanitizeFnsRef","useRef","sanitizedTextRef","addSanitizeFn","useCallback","fn","current","push","sanitize","result","reduce","acc","replaceAllHtmlToString","useExpose","_ref","textInputRef","setValue","emitChange","_useSanitize","useImperativeHandle","value","focus","blur","useEmit","onResize","onChange","currentSizeRef","onChangeFn","checkAndEmitResize","currentSize","nextSize","size","width","height","sanitizedText","useEffect","TextInput","placeholder","tabIndex","className","props","_objectWithoutProperties","_excluded","appendContent","placeholderRef","visibility","offsetWidth","offsetHeight","handleKeyDown","key","shiftKey","ctrlKey","onEnter","onArrowUp","onArrowDown","onKeyDown","handleClick","onFocus","handleKeyUp","onKeyUp","input","React","onClick","contentEditable","onBlur","onCopy","onPaste","TextInputWithRef","forwardRef","EmojiPickerButton","showPicker","toggleShowPicker","buttonElement","buttonRef","localButtonRef","_useState","useState","_useState2","_slicedToArray","showCustomButtonContent","setShowCustomButtonContent","_buttonRef$current$ch","_buttonRef$current","_buttonElement$childN","_buttonElement$childN2","childNodes","xmlns","viewBox","d","$e5534fc185f7111e$export$2e2bcd8739ae039","$dvPge$useRef","instance","update","$dvPge$useEffect","$dvPge$Picker","$dvPge$react","EmojiPicker","theme","onSelectEmoji","disableRecent","customEmojis","language","categories","useMemo","categoryies","i18n","undefined","require","Picker","data","previewPosition","onEmojiSelect","custom","set","memo","EmojiPickerContainer","handleSelectEmoji","position","evt","stopPropagation","top","EMOJI_PICKER_CONTAINER_HEIGHT","EmojiPickerWrapper","keepOpened","addPolluteFn","setShowPicker","_useState3","_useState4","customButton","setCustomButton","_useState5","_useState6","emojiPickerPosition","setEmojiPickerPosition","checkClickOutside","element","target","classList","contains","addEventListener","removeEventListener","calcTopPosition","currentShowPicker","btn","currentTarget","btnRect","getBoundingClientRect","popoverHeight","ReactDOM","createPortal","Fragment","getTextFromAtToCaret","getRangeFromAtToCaret","substring","begin","end","deleteTextFromAtToCaret","deleteData","elementWithFocus","getElementWithFocus","caretOffset","lastAt","lastIndexOf","preCaretRange","selectNodeContents","endContainer","endOffset","toString","textRange","createRange","preCaretTextRange","body","createTextRange","moveToElementText","setEndPoint","anchorNode","useMention","searchMention","loading","setLoading","mentionUsers","setMentionUsers","mentionSearchText","setMentionSearchText","onSelectUser","checkMentionText","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metionText","users","wrap","_callee$","_context","prev","next","sent","stop","_x","_callee2","_getElementWithFocus","_callee2$","_context2","abrupt","parentElement","hasAttribute","remove","includes","apply","arguments","MentionUserList","onSelect","selectedUser","setSelectedUser","prevUser","currentSelectedUser","nextUser","getMentionSelectedNameEl","rest","usersFiltered","searchText","toLocaleLowerCase","map","user","nameHtml","toLowerCase","startsWith","names","split","join","_objectSpread","unsubscribe","index","id","onMouseOver","src","dangerouslySetInnerHTML","__html","MentionUserListWithRef","MentionWrapper","metionUserListRef","showUserList","setShowUserList","_useMention","mentionsEl","mentionEl","mentionName","mentionId","unsubscribeArrowUp","unsubscribeArrowDown","handleSelect","createObserver","listeners","subscribe","listener","filter","l","publish","currentListerners","useEventListeners","keyDown","keyUp","arrowUp","arrowDown","enter","usePollute","polluteFnsRef","pollute","InputEmoji","cleanOnEnter","maxLength","inputClass","borderRadius","borderColor","fontSize","fontFamily","_useEventListeners","_usePollute","updateHTML","nextValue","handleKeydown","nativeEvent","handleFocus","handleBlur","handleTextInputChange","handlePaste","content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