{"version":3,"file":"compose-W5mt71Ut.js","sources":["../../node_modules/@github/combobox-nav/dist/index.js","../../node_modules/@github/text-expander-element/dist/index.js","../../node_modules/ansi-regex/index.js","../../node_modules/strip-ansi/index.js","../../node_modules/string-length/index.js","../../src/assets/powered-by-giphy.svg","../../src/components/compose.jsx"],"sourcesContent":["export default class Combobox {\n constructor(input, list, { tabInsertsSuggestions, defaultFirstOption } = {}) {\n this.input = input;\n this.list = list;\n this.tabInsertsSuggestions = tabInsertsSuggestions !== null && tabInsertsSuggestions !== void 0 ? tabInsertsSuggestions : true;\n this.defaultFirstOption = defaultFirstOption !== null && defaultFirstOption !== void 0 ? defaultFirstOption : false;\n this.isComposing = false;\n if (!list.id) {\n list.id = `combobox-${Math.random().toString().slice(2, 6)}`;\n }\n this.ctrlBindings = !!navigator.userAgent.match(/Macintosh/);\n this.keyboardEventHandler = event => keyboardBindings(event, this);\n this.compositionEventHandler = event => trackComposition(event, this);\n this.inputHandler = this.clearSelection.bind(this);\n input.setAttribute('role', 'combobox');\n input.setAttribute('aria-controls', list.id);\n input.setAttribute('aria-expanded', 'false');\n input.setAttribute('aria-autocomplete', 'list');\n input.setAttribute('aria-haspopup', 'listbox');\n }\n destroy() {\n this.clearSelection();\n this.stop();\n this.input.removeAttribute('role');\n this.input.removeAttribute('aria-controls');\n this.input.removeAttribute('aria-expanded');\n this.input.removeAttribute('aria-autocomplete');\n this.input.removeAttribute('aria-haspopup');\n }\n start() {\n this.input.setAttribute('aria-expanded', 'true');\n this.input.addEventListener('compositionstart', this.compositionEventHandler);\n this.input.addEventListener('compositionend', this.compositionEventHandler);\n this.input.addEventListener('input', this.inputHandler);\n this.input.addEventListener('keydown', this.keyboardEventHandler);\n this.list.addEventListener('click', commitWithElement);\n this.indicateDefaultOption();\n }\n stop() {\n this.clearSelection();\n this.input.setAttribute('aria-expanded', 'false');\n this.input.removeEventListener('compositionstart', this.compositionEventHandler);\n this.input.removeEventListener('compositionend', this.compositionEventHandler);\n this.input.removeEventListener('input', this.inputHandler);\n this.input.removeEventListener('keydown', this.keyboardEventHandler);\n this.list.removeEventListener('click', commitWithElement);\n }\n indicateDefaultOption() {\n var _a;\n if (this.defaultFirstOption) {\n (_a = Array.from(this.list.querySelectorAll('[role=\"option\"]:not([aria-disabled=\"true\"])'))\n .filter(visible)[0]) === null || _a === void 0 ? void 0 : _a.setAttribute('data-combobox-option-default', 'true');\n }\n }\n navigate(indexDiff = 1) {\n const focusEl = Array.from(this.list.querySelectorAll('[aria-selected=\"true\"]')).filter(visible)[0];\n const els = Array.from(this.list.querySelectorAll('[role=\"option\"]')).filter(visible);\n const focusIndex = els.indexOf(focusEl);\n if ((focusIndex === els.length - 1 && indexDiff === 1) || (focusIndex === 0 && indexDiff === -1)) {\n this.clearSelection();\n this.input.focus();\n return;\n }\n let indexOfItem = indexDiff === 1 ? 0 : els.length - 1;\n if (focusEl && focusIndex >= 0) {\n const newIndex = focusIndex + indexDiff;\n if (newIndex >= 0 && newIndex < els.length)\n indexOfItem = newIndex;\n }\n const target = els[indexOfItem];\n if (!target)\n return;\n for (const el of els) {\n el.removeAttribute('data-combobox-option-default');\n if (target === el) {\n this.input.setAttribute('aria-activedescendant', target.id);\n target.setAttribute('aria-selected', 'true');\n scrollTo(this.list, target);\n }\n else {\n el.removeAttribute('aria-selected');\n }\n }\n }\n clearSelection() {\n this.input.removeAttribute('aria-activedescendant');\n for (const el of this.list.querySelectorAll('[aria-selected=\"true\"]')) {\n el.removeAttribute('aria-selected');\n }\n this.indicateDefaultOption();\n }\n}\nfunction keyboardBindings(event, combobox) {\n if (event.shiftKey || event.metaKey || event.altKey)\n return;\n if (!combobox.ctrlBindings && event.ctrlKey)\n return;\n if (combobox.isComposing)\n return;\n switch (event.key) {\n case 'Enter':\n if (commit(combobox.input, combobox.list)) {\n event.preventDefault();\n }\n break;\n case 'Tab':\n if (combobox.tabInsertsSuggestions && commit(combobox.input, combobox.list)) {\n event.preventDefault();\n }\n break;\n case 'Escape':\n combobox.clearSelection();\n break;\n case 'ArrowDown':\n combobox.navigate(1);\n event.preventDefault();\n break;\n case 'ArrowUp':\n combobox.navigate(-1);\n event.preventDefault();\n break;\n case 'n':\n if (combobox.ctrlBindings && event.ctrlKey) {\n combobox.navigate(1);\n event.preventDefault();\n }\n break;\n case 'p':\n if (combobox.ctrlBindings && event.ctrlKey) {\n combobox.navigate(-1);\n event.preventDefault();\n }\n break;\n default:\n if (event.ctrlKey)\n break;\n combobox.clearSelection();\n }\n}\nfunction commitWithElement(event) {\n if (!(event.target instanceof Element))\n return;\n const target = event.target.closest('[role=\"option\"]');\n if (!target)\n return;\n if (target.getAttribute('aria-disabled') === 'true')\n return;\n fireCommitEvent(target);\n}\nfunction commit(input, list) {\n const target = list.querySelector('[aria-selected=\"true\"], [data-combobox-option-default=\"true\"]');\n if (!target)\n return false;\n if (target.getAttribute('aria-disabled') === 'true')\n return true;\n target.click();\n return true;\n}\nfunction fireCommitEvent(target) {\n target.dispatchEvent(new CustomEvent('combobox-commit', { bubbles: true }));\n}\nfunction visible(el) {\n return (!el.hidden &&\n !(el instanceof HTMLInputElement && el.type === 'hidden') &&\n (el.offsetWidth > 0 || el.offsetHeight > 0));\n}\nfunction trackComposition(event, combobox) {\n combobox.isComposing = event.type === 'compositionstart';\n const list = document.getElementById(combobox.input.getAttribute('aria-controls') || '');\n if (!list)\n return;\n combobox.clearSelection();\n}\nfunction scrollTo(container, target) {\n if (!inViewport(container, target)) {\n container.scrollTop = target.offsetTop;\n }\n}\nfunction inViewport(container, element) {\n const scrollTop = container.scrollTop;\n const containerBottom = scrollTop + container.clientHeight;\n const top = element.offsetTop;\n const bottom = top + element.clientHeight;\n return top >= scrollTop && bottom <= containerBottom;\n}\n","import Combobox from '@github/combobox-nav';\n\nconst boundary = /\\s|\\(|\\[/;\nfunction query(text, key, cursor, { multiWord, lookBackIndex, lastMatchPosition } = {\n multiWord: false,\n lookBackIndex: 0,\n lastMatchPosition: null\n}) {\n let keyIndex = text.lastIndexOf(key, cursor - 1);\n if (keyIndex === -1)\n return;\n if (keyIndex < lookBackIndex)\n return;\n if (multiWord) {\n if (lastMatchPosition != null) {\n if (lastMatchPosition === keyIndex)\n return;\n keyIndex = lastMatchPosition - key.length;\n }\n const charAfterKey = text[keyIndex + 1];\n if (charAfterKey === ' ' && cursor >= keyIndex + key.length + 1)\n return;\n const newLineIndex = text.lastIndexOf('\\n', cursor - 1);\n if (newLineIndex > keyIndex)\n return;\n const dotIndex = text.lastIndexOf('.', cursor - 1);\n if (dotIndex > keyIndex)\n return;\n }\n else {\n const spaceIndex = text.lastIndexOf(' ', cursor - 1);\n if (spaceIndex > keyIndex)\n return;\n }\n const pre = text[keyIndex - 1];\n if (pre && !boundary.test(pre))\n return;\n const queryString = text.substring(keyIndex + key.length, cursor);\n return {\n text: queryString,\n position: keyIndex + key.length\n };\n}\n\n/**\n * A custom element is implemented as a class which extends HTMLElement (in the\n * case of autonomous elements) or the interface you want to customize (in the\n * case of customized built-in elements).\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#custom_element_lifecycle_callbacks\n */\nclass CustomHTMLElement extends HTMLElement {\n}\n\nclass InputStyleCloneUpdateEvent extends Event {\n constructor() {\n super(\"update\");\n }\n}\nconst CloneRegistry = new WeakMap();\n/**\n * Create an element that exactly matches an input pixel-for-pixel and automatically stays in sync with it. This\n * is a non-interactive overlay on to the input and can be used to affect the visual appearance of the input\n * without modifying its behavior. The clone element is hidden by default.\n *\n * This lower level API powers the `InputRange` but provides more advanced functionality including event updates.\n *\n * Emits `update` events whenever anything is recalculated: when the layout changes, when the user scrolls, when the\n * input is updated, etc. This event may be emitted more than once per change.\n *\n * @note There may be cases in which the clone cannot observe changes to the input and fails to automatically update.\n * For example, if the `value` property on the input is written to directly, no `input` event is emitted by the input\n * and the clone does not automatically update. In these cases, `forceUpdate` can be used to manually trigger an update.\n */\n// PRIOR ART: This approach was adapted from the following MIT-licensed sources:\n// - primer/react (Copyright (c) 2018 GitHub, Inc.): https://github.com/primer/react/blob/a0db832302702b869aa22b0c4049ad9305ef631f/src/drafts/utils/character-coordinates.ts\n// - component/textarea-caret-position (Copyright (c) 2015 Jonathan Ong me@jongleberry.com): https://github.com/component/textarea-caret-position/blob/b5db7a7e47dd149c2a66276183c69234e4dabe30/index.js\n// - koddsson/textarea-caret-position (Copyright (c) 2015 Jonathan Ong me@jongleberry.com): https://github.com/koddsson/textarea-caret-position/blob/eba40ec8488eed4d77815f109af22e1d9c0751d3/index.js\nclass InputStyleCloneElement extends CustomHTMLElement {\n #styleObserver = new MutationObserver(() => this.#updateStyles());\n #resizeObserver = new ResizeObserver(() => this.#requestUpdateLayout());\n // This class is unique in that it will prevent itself from getting garbage collected because of the subscribed\n // observers (if never detached). Because of this, we want to avoid preventing the existence of this class from also\n // preventing the garbage collection of the associated input. This also allows us to automatically detach if the\n // input gets collected.\n #inputRef;\n #container;\n /**\n * Get the clone for an input, reusing an existing one if available. This avoids creating unecessary clones, which\n * have a performance cost due to their high-frequency event-based updates. Because these elements are shared, they\n * should be mutated with caution.\n *\n * Upon initial creation the clone element will automatically be inserted into the DOM and begin observing the\n * linked input. Only one clone per input can ever exist at a time.\n * @param input The target input to clone.\n */\n static for(input) {\n const clone = CloneRegistry.get(input) ?? new InputStyleCloneElement(input);\n CloneRegistry.set(input, clone);\n return clone;\n }\n /**\n * Avoid constructing directly: Use `InputStyleCloneElement.for` instead.\n * @private\n */\n constructor(input) {\n super();\n this.#inputRef = new WeakRef(input);\n // We want position:absolute so it doesn't take space in the layout, but that doesn't work with display:table-cell\n // used in the HTMLInputElement approach. So we need a wrapper.\n this.#container = document.createElement(\"div\");\n this.#container.style.position = \"absolute\";\n this.#container.style.pointerEvents = \"none\";\n input.after(this.#container);\n this.#container.appendChild(this);\n }\n /**\n * Force a recalculation. Will emit an `update` event. This is typically not needed unless the input has changed in\n * an unobservable way, eg by directly writing to the `value` property.\n */\n forceUpdate() {\n this.#updateStyles();\n this.#updateText();\n }\n /** @private */\n connectedCallback() {\n const input = this.#inputRef.deref();\n if (!input)\n return this.remove();\n this.style.pointerEvents = \"none\";\n this.style.userSelect = \"none\";\n this.style.overflow = \"hidden\";\n this.style.display = \"block\";\n // Important not to use display:none which would not render the content at all\n this.style.visibility = \"hidden\";\n if (input instanceof HTMLTextAreaElement) {\n this.style.whiteSpace = \"pre-wrap\";\n this.style.wordWrap = \"break-word\";\n }\n else {\n this.style.whiteSpace = \"nowrap\";\n // text in single-line inputs is vertically centered\n this.style.display = \"table-cell\";\n this.style.verticalAlign = \"middle\";\n }\n this.setAttribute(\"aria-hidden\", \"true\");\n this.#updateStyles();\n this.#updateText();\n this.#styleObserver.observe(input, {\n attributeFilter: [\n \"style\",\n \"dir\", // users can right-click in some browsers to change the text direction dynamically\n ],\n });\n this.#resizeObserver.observe(input);\n document.addEventListener(\"scroll\", this.#onDocumentScrollOrResize, { capture: true });\n window.addEventListener(\"resize\", this.#onDocumentScrollOrResize, { capture: true });\n // capture so this happens first, so other things can respond to `input` events after this data updates\n input.addEventListener(\"input\", this.#onInput, { capture: true });\n }\n /** @private */\n disconnectedCallback() {\n this.#container.remove();\n this.#styleObserver.disconnect();\n this.#resizeObserver.disconnect();\n document.removeEventListener(\"scroll\", this.#onDocumentScrollOrResize, { capture: true });\n window.removeEventListener(\"resize\", this.#onDocumentScrollOrResize, { capture: true });\n const input = this.#inputRef.deref();\n if (input) {\n input.removeEventListener(\"input\", this.#onInput, { capture: true });\n CloneRegistry.delete(input);\n }\n }\n // --- private ---\n /** Perform `fn` using the `input` if it is still available. If not, clean up the clone instead. */\n #usingInput(fn) {\n const input = this.#inputRef.deref();\n if (!input)\n return this.remove();\n return fn(input);\n }\n /** Current relative x-adjustment in pixels, executed via CSS transform. */\n #xOffset = 0;\n /** Current relative y-adjustment in pixels, executed via CSS transform. */\n #yOffset = 0;\n /**\n * Update only geometric properties without recalculating styles. Typically call `#requestUpdateLayout` instead to\n * only update once per animation frame.\n */\n #updateLayout() {\n // This runs often, so keep it as fast as possible! Avoid all unecessary updates.\n this.#usingInput((input) => {\n const inputStyle = window.getComputedStyle(input);\n this.style.height = inputStyle.height;\n this.style.width = inputStyle.width;\n // Immediately re-adjust for browser inconsistencies in scrollbar handling, if necessary\n if (input.clientHeight !== this.clientHeight)\n this.style.height = `calc(${inputStyle.height} + ${input.clientHeight - this.clientHeight}px)`;\n if (input.clientWidth !== this.clientWidth)\n this.style.width = `calc(${inputStyle.width} + ${input.clientWidth - this.clientWidth}px)`;\n // Position on top of the input\n const inputRect = input.getBoundingClientRect();\n const cloneRect = this.getBoundingClientRect();\n this.#xOffset = this.#xOffset + inputRect.left - cloneRect.left;\n this.#yOffset = this.#yOffset + inputRect.top - cloneRect.top;\n this.style.transform = `translate(${this.#xOffset}px, ${this.#yOffset}px)`;\n this.scrollTop = input.scrollTop;\n this.scrollLeft = input.scrollLeft;\n this.dispatchEvent(new InputStyleCloneUpdateEvent());\n });\n }\n #isLayoutUpdating = false;\n /** Request a layout update. Will only happen once per animation frame, to avoid unecessary updates. */\n #requestUpdateLayout() {\n if (this.#isLayoutUpdating)\n return;\n this.#isLayoutUpdating = true;\n requestAnimationFrame(() => {\n this.#updateLayout();\n this.#isLayoutUpdating = false;\n });\n }\n /** Update the styles of the clone based on the styles of the input, then request a layout update. */\n #updateStyles() {\n this.#usingInput((input) => {\n const inputStyle = window.getComputedStyle(input);\n for (const prop of propertiesToCopy)\n this.style[prop] = inputStyle[prop];\n this.#requestUpdateLayout();\n });\n }\n /**\n * Update the text content of the clone based on the text content of the input. Triggers a layout update in case the\n * text update caused scrolling.\n */\n #updateText() {\n this.#usingInput((input) => {\n this.textContent = input.value;\n // This is often unecessary on a pure text update, but text updates could potentially cause layout updates like\n // scrolling or resizing. And we run the update on _every frame_ when scrolling, so this isn't that expensive.\n // We don't requestUpdateLayout here because this one should happen synchronously, so that clients can react\n // within their own `input` event handlers.\n this.#updateLayout();\n });\n }\n #onInput = () => this.#updateText();\n #onDocumentScrollOrResize = (event) => {\n this.#usingInput((input) => {\n if (event.target === document ||\n event.target === window ||\n (event.target instanceof Node && event.target.contains(input)))\n this.#requestUpdateLayout();\n });\n };\n}\n// Note that some browsers, such as Firefox, do not concatenate properties\n// into their shorthand (e.g. padding-top, padding-bottom etc. -> padding),\n// so we have to list every single property explicitly.\nconst propertiesToCopy = [\n // RTL / vertical writing modes support:\n \"direction\",\n \"writingMode\",\n \"unicodeBidi\",\n \"textOrientation\",\n \"boxSizing\",\n \"borderTopWidth\",\n \"borderRightWidth\",\n \"borderBottomWidth\",\n \"borderLeftWidth\",\n \"borderStyle\",\n \"paddingTop\",\n \"paddingRight\",\n \"paddingBottom\",\n \"paddingLeft\",\n // https://developer.mozilla.org/en-US/docs/Web/CSS/font\n \"fontStyle\",\n \"fontVariant\",\n \"fontWeight\",\n \"fontStretch\",\n \"fontSize\",\n \"fontSizeAdjust\",\n \"lineHeight\",\n \"fontFamily\",\n \"textAlign\",\n \"textTransform\",\n \"textIndent\",\n \"textDecoration\",\n \"letterSpacing\",\n \"wordSpacing\",\n \"tabSize\",\n \"MozTabSize\",\n];\n// Inspired by https://github.com/github/catalyst/blob/dc284dcf4f82329a9cac5c867462a8fa529b6c40/src/register.ts\ntry {\n customElements.define(\"input-style-clone\", InputStyleCloneElement);\n}\ncatch (e) {\n // Throws DOMException with NotSupportedError if already defined\n if (!(e instanceof DOMException && e.name === \"NotSupportedError\"))\n throw e;\n}\n\nclass InputRange {\n #inputElement;\n #startOffset;\n #endOffset;\n /**\n * Construct a new `InputRange`.\n * @param element The target input element that contains the content for the range.\n * @param startOffset The inclusive 0-based start index for the range. Will be adjusted to fit in the input contents.\n * @param endOffset The exclusive 0-based end index for the range. Will be adjusted to fit in the input contents.\n */\n constructor(element, startOffset = 0, endOffset = startOffset) {\n this.#inputElement = element;\n this.#startOffset = startOffset;\n this.#endOffset = endOffset;\n }\n /**\n * Create a new range from the current user selection. If the input is not focused, the range will just be the start\n * of the input (offsets `0` to `0`).\n *\n * This can be used to get the caret coordinates: if the resulting range is `collapsed`, the location of the\n * `getBoundingClientRect` will be the location of the caret caret (note, however, that the width will be `0` in\n * this case).\n */\n static fromSelection(input) {\n const { selectionStart, selectionEnd } = input;\n return new InputRange(input, selectionStart ?? undefined, selectionEnd ?? undefined);\n }\n /** Returns true if the start is equal to the end of this range. */\n get collapsed() {\n return this.startOffset === this.endOffset;\n }\n /** Always returns the containing input element. */\n get commonAncestorContainer() {\n return this.#inputElement;\n }\n /** Always returns the containing input element. */\n get endContainer() {\n return this.#inputElement;\n }\n /** Always returns the containing input element. */\n get startContainer() {\n return this.#inputElement;\n }\n get startOffset() {\n return this.#startOffset;\n }\n get endOffset() {\n return this.#endOffset;\n }\n /** Update the inclusive start offset. Will be adjusted to fit within the content size. */\n setStartOffset(offset) {\n this.#startOffset = this.#clampOffset(offset);\n }\n /** Update the exclusive end offset. Will be adjusted to fit within the content size. */\n setEndOffset(offset) {\n this.#endOffset = this.#clampOffset(offset);\n }\n /**\n * Collapse this range to one side.\n * @param toStart If `true`, will collapse to the start side. Otherwise, will collapse to the end.\n */\n collapse(toStart = false) {\n if (toStart)\n this.setEndOffset(this.startOffset);\n else\n this.setStartOffset(this.endOffset);\n }\n /** Returns a `DocumentFragment` containing a new `Text` node containing the content in the range. */\n cloneContents() {\n return this.#createCloneRange().cloneContents();\n }\n /** Create a copy of this range. */\n cloneRange() {\n return new InputRange(this.#inputElement, this.startOffset, this.endOffset);\n }\n /**\n * Obtain one rect that contains the entire contents of the range. If the range spans multiple lines, this box will\n * contain all pieces of the range but may also contain some space outside the range.\n * @see https://iansan5653.github.io/dom-input-range/demos/playground/\n */\n getBoundingClientRect() {\n return this.#createCloneRange().getBoundingClientRect();\n }\n /**\n * Obtain the rects that contain contents of this range. If the range spans multiple lines, there will be multiple\n * bounding boxes. These boxes can be used, for example, to draw a highlight over the range.\n * @see https://iansan5653.github.io/dom-input-range/demos/playground/\n */\n getClientRects() {\n return this.#createCloneRange().getClientRects();\n }\n /** Get the contents of the range as a string. */\n toString() {\n return this.#createCloneRange().toString();\n }\n /**\n * Get the underlying `InputStyleClone` instance powering these calculations. This can be used to listen for\n * updates to trigger layout recalculation.\n */\n getStyleClone() {\n return this.#styleClone;\n }\n // --- private ---\n get #styleClone() {\n return InputStyleCloneElement.for(this.#inputElement);\n }\n get #cloneElement() {\n return this.#styleClone;\n }\n #clampOffset(offset) {\n return Math.max(0, Math.min(offset, this.#inputElement.value.length));\n }\n #createCloneRange() {\n // It's tempting to create a single Range and reuse it across the lifetime of the class. However, this wouldn't be\n // accurate because the contents of the input can change and the contents of the range would become stale. So we\n // must create a new range every time we need it.\n const range = document.createRange();\n const textNode = this.#cloneElement.childNodes[0];\n if (textNode) {\n range.setStart(textNode, this.startOffset);\n range.setEnd(textNode, this.endOffset);\n }\n return range;\n }\n}\n\nconst states = new WeakMap();\nclass TextExpander {\n constructor(expander, input) {\n this.expander = expander;\n this.input = input;\n this.combobox = null;\n this.menu = null;\n this.match = null;\n this.justPasted = false;\n this.lookBackIndex = 0;\n this.oninput = this.onInput.bind(this);\n this.onpaste = this.onPaste.bind(this);\n this.onkeydown = this.onKeydown.bind(this);\n this.oncommit = this.onCommit.bind(this);\n this.onmousedown = this.onMousedown.bind(this);\n this.onblur = this.onBlur.bind(this);\n this.interactingWithList = false;\n input.addEventListener('paste', this.onpaste);\n input.addEventListener('input', this.oninput);\n input.addEventListener('keydown', this.onkeydown);\n input.addEventListener('blur', this.onblur);\n }\n destroy() {\n this.input.removeEventListener('paste', this.onpaste);\n this.input.removeEventListener('input', this.oninput);\n this.input.removeEventListener('keydown', this.onkeydown);\n this.input.removeEventListener('blur', this.onblur);\n }\n dismissMenu() {\n if (this.deactivate()) {\n this.lookBackIndex = this.input.selectionEnd || this.lookBackIndex;\n }\n }\n activate(match, menu) {\n var _a, _b;\n if (this.input !== document.activeElement && this.input !== ((_b = (_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.activeElement)) {\n return;\n }\n this.deactivate();\n this.menu = menu;\n if (!menu.id)\n menu.id = `text-expander-${Math.floor(Math.random() * 100000).toString()}`;\n this.expander.append(menu);\n this.combobox = new Combobox(this.input, menu);\n this.expander.dispatchEvent(new Event('text-expander-activate'));\n this.positionMenu(menu, match.position);\n this.combobox.start();\n menu.addEventListener('combobox-commit', this.oncommit);\n menu.addEventListener('mousedown', this.onmousedown);\n this.combobox.navigate(1);\n }\n positionMenu(menu, position) {\n const caretRect = new InputRange(this.input, position).getBoundingClientRect();\n const targetPosition = { left: caretRect.left, top: caretRect.top + caretRect.height };\n const currentPosition = menu.getBoundingClientRect();\n const delta = {\n left: targetPosition.left - currentPosition.left,\n top: targetPosition.top - currentPosition.top\n };\n if (delta.left !== 0 || delta.top !== 0) {\n const currentStyle = getComputedStyle(menu);\n menu.style.left = currentStyle.left ? `calc(${currentStyle.left} + ${delta.left}px)` : `${delta.left}px`;\n menu.style.top = currentStyle.top ? `calc(${currentStyle.top} + ${delta.top}px)` : `${delta.top}px`;\n }\n }\n deactivate() {\n const menu = this.menu;\n if (!menu || !this.combobox)\n return false;\n this.expander.dispatchEvent(new Event('text-expander-deactivate'));\n this.menu = null;\n menu.removeEventListener('combobox-commit', this.oncommit);\n menu.removeEventListener('mousedown', this.onmousedown);\n this.combobox.destroy();\n this.combobox = null;\n menu.remove();\n return true;\n }\n onCommit({ target }) {\n var _a;\n const item = target;\n if (!(item instanceof HTMLElement))\n return;\n if (!this.combobox)\n return;\n const match = this.match;\n if (!match)\n return;\n const beginning = this.input.value.substring(0, match.position - match.key.length);\n const remaining = this.input.value.substring(match.position + match.text.length);\n const detail = { item, key: match.key, value: null, continue: false };\n const canceled = !this.expander.dispatchEvent(new CustomEvent('text-expander-value', { cancelable: true, detail }));\n if (canceled)\n return;\n if (!detail.value)\n return;\n let suffix = (_a = this.expander.getAttribute('suffix')) !== null && _a !== void 0 ? _a : ' ';\n if (detail.continue) {\n suffix = '';\n }\n const value = `${detail.value}${suffix}`;\n this.input.value = beginning + value + remaining;\n const cursor = beginning.length + value.length;\n this.deactivate();\n this.input.focus({\n preventScroll: true\n });\n this.input.selectionStart = cursor;\n this.input.selectionEnd = cursor;\n if (!detail.continue) {\n this.lookBackIndex = cursor;\n this.match = null;\n }\n this.expander.dispatchEvent(new CustomEvent('text-expander-committed', { cancelable: false, detail: { input: this.input } }));\n }\n onBlur() {\n if (this.interactingWithList) {\n this.interactingWithList = false;\n return;\n }\n this.deactivate();\n }\n onPaste() {\n this.justPasted = true;\n }\n async onInput() {\n if (this.justPasted) {\n this.justPasted = false;\n return;\n }\n const match = this.findMatch();\n if (match) {\n this.match = match;\n const menu = await this.notifyProviders(match);\n if (!this.match)\n return;\n if (menu) {\n this.activate(match, menu);\n }\n else {\n this.deactivate();\n }\n }\n else {\n this.match = null;\n this.deactivate();\n }\n }\n findMatch() {\n const cursor = this.input.selectionEnd || 0;\n const text = this.input.value;\n if (cursor <= this.lookBackIndex) {\n this.lookBackIndex = cursor - 1;\n }\n for (const { key, multiWord } of this.expander.keys) {\n const found = query(text, key, cursor, {\n multiWord,\n lookBackIndex: this.lookBackIndex,\n lastMatchPosition: this.match ? this.match.position : null\n });\n if (found) {\n return { text: found.text, key, position: found.position };\n }\n }\n }\n async notifyProviders(match) {\n const providers = [];\n const provide = (result) => providers.push(result);\n const canceled = !this.expander.dispatchEvent(new CustomEvent('text-expander-change', { cancelable: true, detail: { provide, text: match.text, key: match.key } }));\n if (canceled)\n return;\n const all = await Promise.all(providers);\n const fragments = all.filter(x => x.matched).map(x => x.fragment);\n return fragments[0];\n }\n onMousedown() {\n this.interactingWithList = true;\n }\n onKeydown(event) {\n if (event.key === 'Escape') {\n this.match = null;\n if (this.deactivate()) {\n this.lookBackIndex = this.input.selectionEnd || this.lookBackIndex;\n event.stopImmediatePropagation();\n event.preventDefault();\n }\n }\n }\n}\nclass TextExpanderElement extends HTMLElement {\n get keys() {\n const keysAttr = this.getAttribute('keys');\n const keys = keysAttr ? keysAttr.split(' ') : [];\n const multiWordAttr = this.getAttribute('multiword');\n const multiWord = multiWordAttr ? multiWordAttr.split(' ') : [];\n const globalMultiWord = multiWord.length === 0 && this.hasAttribute('multiword');\n return keys.map(key => ({ key, multiWord: globalMultiWord || multiWord.includes(key) }));\n }\n connectedCallback() {\n const input = this.querySelector('input[type=\"text\"], textarea');\n if (!(input instanceof HTMLInputElement || input instanceof HTMLTextAreaElement))\n return;\n const state = new TextExpander(this, input);\n states.set(this, state);\n }\n disconnectedCallback() {\n const state = states.get(this);\n if (!state)\n return;\n state.destroy();\n states.delete(this);\n }\n dismiss() {\n const state = states.get(this);\n if (!state)\n return;\n state.dismissMenu();\n }\n}\n\nif (!window.customElements.get('text-expander')) {\n window.TextExpanderElement = TextExpanderElement;\n window.customElements.define('text-expander', TextExpanderElement);\n}\n\nexport default TextExpanderElement;\n","export default function ansiRegex({onlyFirst = false} = {}) {\n\tconst pattern = [\n\t '[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)',\n\t\t'(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-ntqry=><~]))'\n\t].join('|');\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n}\n","import ansiRegex from 'ansi-regex';\n\nconst regex = ansiRegex();\n\nexport default function stripAnsi(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\`, got \\`${typeof string}\\``);\n\t}\n\n\t// Even though the regex is global, we don't need to reset the `.lastIndex`\n\t// because unlike `.exec()` and `.test()`, `.replace()` does it automatically\n\t// and doing it manually has a performance penalty.\n\treturn string.replace(regex, '');\n}\n","import stripAnsi from 'strip-ansi';\n\nconst segmenter = new Intl.Segmenter();\n\nexport default function stringLength(string, {countAnsiEscapeCodes = false} = {}) {\n\tif (string === '') {\n\t\treturn 0;\n\t}\n\n\tif (!countAnsiEscapeCodes) {\n\t\tstring = stripAnsi(string);\n\t}\n\n\tif (string === '') {\n\t\treturn 0;\n\t}\n\n\tlet length = 0;\n\n\tfor (const _ of segmenter.segment(string)) { // eslint-disable-line no-unused-vars\n\t\tlength++;\n\t}\n\n\treturn length;\n}\n","export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.0'%20viewBox='0%200%20641%20223'%3e%3cpath%20fill='%23aaa'%20d='M86%20214c-9-1-17-4-24-8l-6-3-5-5-5-4-4-6-4-6-3-8-2-8v-27l2-9%203-9%204-6%204-6%205-5%205-5%207-3%206-4%207-2%207-2%2012-1h12l7%201%208%202%207%204%207%203%205%205%205%204-10%2010-10%209-4-3-10-5-5-1H88l-5%202-6%203-3%204-4%204-2%205-2%206v6l-1%207%201%207%202%207%203%205%202%204%204%203%204%203%205%202%206%202h9l10-1%205-2%206-3v-16H91v-27h59v54l-1%203-2%203-5%204-4%204-5%203-5%202-8%202-8%202-10%201H92l-6-1zm266-62V91h34v46h44V91h34v121h-34v-46h-44v46h-34v-61zm-182-1V90h34v121h-34v-60zm59-1V90h35l36%201%205%202c3%200%208%202%2010%204l5%202%204%205%205%204%203%207%203%207%201%2013v13l-4%206-3%207-4%204-5%205-5%202-5%203-6%202-5%201-18%201h-18v32h-34v-61zm67-2%203-2%202-4%202-5v-5l-2-4-2-4-3-2-3-3h-30v31h30l3-2zm226%2039v-24l-8-12-18-28a1751%201751%200%200%200-20-31v-2h39l7%2012%2012%2021%206%209%2013-21%2013-21h38v2l-41%2061-7%2010v48h-34v-24zM109%2066l-4-1-5-5-5-4-1-5-3-9v-5l1-5c2-7%203-10%208-15l4-4%207-2%207-2h7l6%201%205%202%205%202%203%204%204%203%202%206%202%205v13l-2%205-2%206-4%204-3%203-5%202-4%202-9%201h-9l-5-2zm22-11%204-2%203-4%202-5V34l-2-4-2-4-3-2-4-3-5-1h-6l-4%202-5%202-2%204-3%205-1%203v4l1%205%202%205%202%202%205%203%204%202h10l4-2zM37%2039V11h33l3%201%203%202%204%203%203%203%201%205%201%204v5l-1%204-3%204-3%205-4%201-3%202-11%201H49v16H37V39zm31%200%203-2%201-2%201-2v-4l-1-3-3-2-2-2H49v18h15l4-1zm107%2025a512%20512%200%200%200-19-53h14l4%2014%206%2019%201%204%201-1%207-19%205-17h9l6%2019%207%2018v-1l2-6%205-17%204-13h14v1l-4%2012-16%2041v2h-5l-5-1-6-15-6-15-1%201-3%207-6%2015-2%208h-11l-1-3zm74-25V11h42v11h-29v2l-1%205v4h29v11h-28v11h2l15%201h13v11h-43V39zm55%200V11h33l5%203%205%202%202%204%202%205v10l-2%203-1%204-5%203-5%203%205%205%208%2010%203%204h-14l-7-9-8-10h-9v19h-12V39zm33-3%202-3v-6l-3-3-2-3h-18v16h1v1h17l2-2zm26%203V11h42v11h-29l-1%206v5h29v11h-28v5l-1%205%201%201v1h30v11h-43V39zm54%200V11h17l18%201%204%202%205%203%202%204%203%204%202%206%201%206v5c-1%206-3%2012-6%2015l-3%204-5%203-5%202-17%201h-16V39zm33%2014%205-5%202-3v-6l-1-6-1-3-1-3-4-3-3-2h-5l-6-1-3%201h-3v34h9l8-1%203-2zm50-14V11h34l5%202%204%202%202%203%202%203v9l-2%202-3%204-1%201%203%203%203%204%201%203%201%204-1%204-1%204-3%203-3%203-5%201-5%201h-31V39zm34%2015%202-1v-6l-2-2-2-2h-20v13h20l2-2zm-3-22%204-2v-6l-2-1-2-2h-19v12h16l4-1zm42%2024V45l-6-9-11-17-5-8h15l4%208%207%2011%202%203%207-11%207-11h14l-11%2016-11%2017v23h-12V56z'/%3e%3c/svg%3e\"","import './compose.css';\n\nimport '@github/text-expander-element';\nimport { MenuItem } from '@szhsin/react-menu';\nimport { deepEqual } from 'fast-equals';\nimport Fuse from 'fuse.js';\nimport { memo } from 'preact/compat';\nimport { forwardRef } from 'preact/compat';\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport { useHotkeys } from 'react-hotkeys-hook';\nimport stringLength from 'string-length';\nimport { detectAll } from 'tinyld/light';\nimport { uid } from 'uid/single';\nimport { useDebouncedCallback, useThrottledCallback } from 'use-debounce';\nimport { useSnapshot } from 'valtio';\n\nimport poweredByGiphyURL from '../assets/powered-by-giphy.svg';\n\nimport Menu2 from '../components/menu2';\nimport supportedLanguages from '../data/status-supported-languages';\nimport urlRegex from '../data/url-regex';\nimport { api } from '../utils/api';\nimport db from '../utils/db';\nimport emojifyText from '../utils/emojify-text';\nimport localeMatch from '../utils/locale-match';\nimport localeCode2Text from '../utils/localeCode2Text';\nimport openCompose from '../utils/open-compose';\nimport pmem from '../utils/pmem';\nimport { fetchRelationships } from '../utils/relationships';\nimport shortenNumber from '../utils/shorten-number';\nimport showToast from '../utils/show-toast';\nimport states, { saveStatus } from '../utils/states';\nimport store from '../utils/store';\nimport {\n getCurrentAccount,\n getCurrentAccountNS,\n getCurrentInstance,\n getCurrentInstanceConfiguration,\n} from '../utils/store-utils';\nimport supports from '../utils/supports';\nimport useCloseWatcher from '../utils/useCloseWatcher';\nimport useInterval from '../utils/useInterval';\nimport visibilityIconsMap from '../utils/visibility-icons-map';\n\nimport AccountBlock from './account-block';\n// import Avatar from './avatar';\nimport Icon from './icon';\nimport Loader from './loader';\nimport Modal from './modal';\nimport Status from './status';\n\nconst {\n PHANPY_IMG_ALT_API_URL: IMG_ALT_API_URL,\n PHANPY_GIPHY_API_KEY: GIPHY_API_KEY,\n} = import.meta.env;\n\nconst supportedLanguagesMap = supportedLanguages.reduce((acc, l) => {\n const [code, common, native] = l;\n acc[code] = {\n common,\n native,\n };\n return acc;\n}, {});\n\n/* NOTES:\n - Max character limit includes BOTH status text and Content Warning text\n*/\n\nconst expiryOptions = {\n '5 minutes': 5 * 60,\n '30 minutes': 30 * 60,\n '1 hour': 60 * 60,\n '6 hours': 6 * 60 * 60,\n '12 hours': 12 * 60 * 60,\n '1 day': 24 * 60 * 60,\n '3 days': 3 * 24 * 60 * 60,\n '7 days': 7 * 24 * 60 * 60,\n};\nconst expirySeconds = Object.values(expiryOptions);\nconst oneDay = 24 * 60 * 60;\n\nconst expiresInFromExpiresAt = (expiresAt) => {\n if (!expiresAt) return oneDay;\n const delta = (new Date(expiresAt).getTime() - Date.now()) / 1000;\n return expirySeconds.find((s) => s >= delta) || oneDay;\n};\n\nconst menu = document.createElement('ul');\nmenu.role = 'listbox';\nmenu.className = 'text-expander-menu';\n\n// Set IntersectionObserver on menu, reposition it because text-expander doesn't handle it\nconst windowMargin = 16;\nconst observer = new IntersectionObserver((entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n const { left, width } = entry.boundingClientRect;\n const { innerWidth } = window;\n if (left + width > innerWidth) {\n menu.style.left = innerWidth - width - windowMargin + 'px';\n }\n }\n });\n});\nobserver.observe(menu);\n\nconst DEFAULT_LANG = localeMatch(\n [new Intl.DateTimeFormat().resolvedOptions().locale, ...navigator.languages],\n supportedLanguages.map((l) => l[0]),\n 'en',\n);\n\n// https://github.com/mastodon/mastodon/blob/c4a429ed47e85a6bbf0d470a41cc2f64cf120c19/app/javascript/mastodon/features/compose/util/counter.js\nconst urlRegexObj = new RegExp(urlRegex.source, urlRegex.flags);\nconst usernameRegex = /(^|[^\\/\\w])@(([a-z0-9_]+)@[a-z0-9\\.\\-]+[a-z0-9]+)/gi;\nconst urlPlaceholder = '$2xxxxxxxxxxxxxxxxxxxxxxx';\nfunction countableText(inputText) {\n return inputText\n .replace(urlRegexObj, urlPlaceholder)\n .replace(usernameRegex, '$1@$3');\n}\n\n// https://github.com/mastodon/mastodon/blob/c03bd2a238741a012aa4b98dc4902d6cf948ab63/app/models/account.rb#L69\nconst USERNAME_RE = /[a-z0-9_]+([a-z0-9_.-]+[a-z0-9_]+)?/i;\nconst MENTION_RE = new RegExp(\n `(^|[^=\\\\/\\\\w])(@${USERNAME_RE.source}(?:@[\\\\p{L}\\\\w.-]+[\\\\w]+)?)`,\n 'uig',\n);\n\n// AI-generated, all other regexes are too complicated\nconst HASHTAG_RE = new RegExp(\n `(^|[^=\\\\/\\\\w])(#[a-z0-9_]+([a-z0-9_.]+[a-z0-9_]+)?)(?![\\\\/\\\\w])`,\n 'ig',\n);\n\n// https://github.com/mastodon/mastodon/blob/23e32a4b3031d1da8b911e0145d61b4dd47c4f96/app/models/custom_emoji.rb#L31\nconst SHORTCODE_RE_FRAGMENT = '[a-zA-Z0-9_]{2,}';\nconst SCAN_RE = new RegExp(\n `(^|[^=\\\\/\\\\w])(:${SHORTCODE_RE_FRAGMENT}:)(?=[^A-Za-z0-9_:]|$)`,\n 'g',\n);\n\nconst segmenter = new Intl.Segmenter();\nfunction highlightText(text, { maxCharacters = Infinity }) {\n // Accept text string, return formatted HTML string\n // Escape all HTML special characters\n let html = text\n .replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n\n // Exceeded characters limit\n const { composerCharacterCount } = states;\n if (composerCharacterCount > maxCharacters) {\n // Highlight exceeded characters\n let withinLimitHTML = '',\n exceedLimitHTML = '';\n const htmlSegments = segmenter.segment(html);\n for (const { segment, index } of htmlSegments) {\n if (index < maxCharacters) {\n withinLimitHTML += segment;\n } else {\n exceedLimitHTML += segment;\n }\n }\n if (exceedLimitHTML) {\n exceedLimitHTML =\n '' +\n exceedLimitHTML +\n '';\n }\n return withinLimitHTML + exceedLimitHTML;\n }\n\n return html\n .replace(urlRegexObj, '$2$3') // URLs\n .replace(MENTION_RE, '$1$2') // Mentions\n .replace(HASHTAG_RE, '$1$2') // Hashtags\n .replace(\n SCAN_RE,\n '$1$2',\n ); // Emoji shortcodes\n}\n\nconst rtf = new Intl.RelativeTimeFormat();\n\nconst CUSTOM_EMOJIS_COUNT = 100;\n\nfunction Compose({\n onClose,\n replyToStatus,\n editStatus,\n draftStatus,\n standalone,\n hasOpener,\n}) {\n console.warn('RENDER COMPOSER');\n const { masto, instance } = api();\n const [uiState, setUIState] = useState('default');\n const UID = useRef(draftStatus?.uid || uid());\n console.log('Compose UID', UID.current);\n\n const currentAccount = getCurrentAccount();\n const currentAccountInfo = currentAccount.info;\n\n const configuration = getCurrentInstanceConfiguration();\n console.log('⚙️ Configuration', configuration);\n\n const {\n statuses: {\n maxCharacters,\n maxMediaAttachments,\n charactersReservedPerUrl,\n } = {},\n mediaAttachments: {\n supportedMimeTypes = [],\n imageSizeLimit,\n imageMatrixLimit,\n videoSizeLimit,\n videoMatrixLimit,\n videoFrameRateLimit,\n } = {},\n polls: {\n maxOptions,\n maxCharactersPerOption,\n maxExpiration,\n minExpiration,\n } = {},\n } = configuration || {};\n\n const textareaRef = useRef();\n const spoilerTextRef = useRef();\n const [visibility, setVisibility] = useState('public');\n const [sensitive, setSensitive] = useState(false);\n const [language, setLanguage] = useState(\n store.session.get('currentLanguage') || DEFAULT_LANG,\n );\n const prevLanguage = useRef(language);\n const [mediaAttachments, setMediaAttachments] = useState([]);\n const [poll, setPoll] = useState(null);\n\n const prefs = store.account.get('preferences') || {};\n\n const oninputTextarea = () => {\n if (!textareaRef.current) return;\n textareaRef.current.dispatchEvent(new Event('input'));\n };\n const focusTextarea = () => {\n setTimeout(() => {\n if (!textareaRef.current) return;\n // status starts with newline, focus on first position\n if (draftStatus?.status?.startsWith?.('\\n')) {\n textareaRef.current.selectionStart = 0;\n textareaRef.current.selectionEnd = 0;\n }\n console.debug('FOCUS textarea');\n textareaRef.current?.focus();\n }, 300);\n };\n\n useEffect(() => {\n if (replyToStatus) {\n const { spoilerText, visibility, language, sensitive } = replyToStatus;\n if (spoilerText && spoilerTextRef.current) {\n spoilerTextRef.current.value = spoilerText;\n }\n const mentions = new Set([\n replyToStatus.account.acct,\n ...replyToStatus.mentions.map((m) => m.acct),\n ]);\n const allMentions = [...mentions].filter(\n (m) => m !== currentAccountInfo.acct,\n );\n if (allMentions.length > 0) {\n textareaRef.current.value = `${allMentions\n .map((m) => `@${m}`)\n .join(' ')} `;\n oninputTextarea();\n }\n focusTextarea();\n setVisibility(\n visibility === 'public' && prefs['posting:default:visibility']\n ? prefs['posting:default:visibility']\n : visibility,\n );\n setLanguage(language || prefs.postingDefaultLanguage || DEFAULT_LANG);\n setSensitive(sensitive && !!spoilerText);\n } else if (editStatus) {\n const { visibility, language, sensitive, poll, mediaAttachments } =\n editStatus;\n const composablePoll = !!poll?.options && {\n ...poll,\n options: poll.options.map((o) => o?.title || o),\n expiresIn: poll?.expiresIn || expiresInFromExpiresAt(poll.expiresAt),\n };\n setUIState('loading');\n (async () => {\n try {\n const statusSource = await masto.v1.statuses\n .$select(editStatus.id)\n .source.fetch();\n console.log({ statusSource });\n const { text, spoilerText } = statusSource;\n textareaRef.current.value = text;\n textareaRef.current.dataset.source = text;\n oninputTextarea();\n focusTextarea();\n spoilerTextRef.current.value = spoilerText;\n setVisibility(visibility);\n setLanguage(language || presf.postingDefaultLanguage || DEFAULT_LANG);\n setSensitive(sensitive);\n if (composablePoll) setPoll(composablePoll);\n setMediaAttachments(mediaAttachments);\n setUIState('default');\n } catch (e) {\n console.error(e);\n alert(e?.reason || e);\n setUIState('error');\n }\n })();\n } else {\n focusTextarea();\n console.log('Apply prefs', prefs);\n if (prefs['posting:default:visibility']) {\n setVisibility(prefs['posting:default:visibility']);\n }\n if (prefs['posting:default:language']) {\n setLanguage(prefs['posting:default:language']);\n }\n if (prefs['posting:default:sensitive']) {\n setSensitive(prefs['posting:default:sensitive']);\n }\n }\n if (draftStatus) {\n const {\n status,\n spoilerText,\n visibility,\n language,\n sensitive,\n poll,\n mediaAttachments,\n } = draftStatus;\n const composablePoll = !!poll?.options && {\n ...poll,\n options: poll.options.map((o) => o?.title || o),\n expiresIn: poll?.expiresIn || expiresInFromExpiresAt(poll.expiresAt),\n };\n textareaRef.current.value = status;\n oninputTextarea();\n focusTextarea();\n if (spoilerText) spoilerTextRef.current.value = spoilerText;\n if (visibility) setVisibility(visibility);\n setLanguage(language || prefs.postingDefaultLanguage || DEFAULT_LANG);\n if (sensitive !== null) setSensitive(sensitive);\n if (composablePoll) setPoll(composablePoll);\n if (mediaAttachments) setMediaAttachments(mediaAttachments);\n }\n }, [draftStatus, editStatus, replyToStatus]);\n\n const formRef = useRef();\n\n const beforeUnloadCopy = 'You have unsaved changes. Discard this post?';\n const canClose = () => {\n const { value, dataset } = textareaRef.current;\n\n // check if loading\n if (uiState === 'loading') {\n console.log('canClose', { uiState });\n return false;\n }\n\n // check for status and media attachments\n const hasValue = (value || '')\n .trim()\n .replace(/^\\p{White_Space}+|\\p{White_Space}+$/gu, '');\n const hasMediaAttachments = mediaAttachments.length > 0;\n if (!hasValue && !hasMediaAttachments) {\n console.log('canClose', { value, mediaAttachments });\n return true;\n }\n\n // check if all media attachments have IDs\n const hasIDMediaAttachments =\n mediaAttachments.length > 0 &&\n mediaAttachments.every((media) => media.id);\n if (hasIDMediaAttachments) {\n console.log('canClose', { hasIDMediaAttachments });\n return true;\n }\n\n // check if status contains only \"@acct\", if replying\n const isSelf = replyToStatus?.account.id === currentAccountInfo.id;\n const hasOnlyAcct =\n replyToStatus && value.trim() === `@${replyToStatus.account.acct}`;\n // TODO: check for mentions, or maybe just generic \"@username\", including multiple mentions like \"@username1@username2\"\n if (!isSelf && hasOnlyAcct) {\n console.log('canClose', { isSelf, hasOnlyAcct });\n return true;\n }\n\n // check if status is same with source\n const sameWithSource = value === dataset?.source;\n if (sameWithSource) {\n console.log('canClose', { sameWithSource });\n return true;\n }\n\n console.log('canClose', {\n value,\n hasMediaAttachments,\n hasIDMediaAttachments,\n poll,\n isSelf,\n hasOnlyAcct,\n sameWithSource,\n uiState,\n });\n\n return false;\n };\n\n const confirmClose = () => {\n if (!canClose()) {\n const yes = confirm(beforeUnloadCopy);\n return yes;\n }\n return true;\n };\n\n useEffect(() => {\n // Show warning if user tries to close window with unsaved changes\n const handleBeforeUnload = (e) => {\n if (!canClose()) {\n e.preventDefault();\n e.returnValue = beforeUnloadCopy;\n }\n };\n window.addEventListener('beforeunload', handleBeforeUnload, {\n capture: true,\n });\n return () =>\n window.removeEventListener('beforeunload', handleBeforeUnload, {\n capture: true,\n });\n }, []);\n\n const getCharCount = () => {\n const { value } = textareaRef.current;\n const { value: spoilerText } = spoilerTextRef.current;\n return stringLength(countableText(value)) + stringLength(spoilerText);\n };\n const updateCharCount = () => {\n const count = getCharCount();\n states.composerCharacterCount = count;\n };\n useEffect(updateCharCount, []);\n\n const supportsCloseWatcher = window.CloseWatcher;\n const escDownRef = useRef(false);\n useHotkeys(\n 'esc',\n () => {\n escDownRef.current = true;\n // This won't be true if this event is already handled and not propagated 🤞\n },\n {\n enabled: !supportsCloseWatcher,\n enableOnFormTags: true,\n },\n );\n useHotkeys(\n 'esc',\n () => {\n if (!standalone && escDownRef.current && confirmClose()) {\n onClose();\n }\n escDownRef.current = false;\n },\n {\n enabled: !supportsCloseWatcher,\n enableOnFormTags: true,\n // Use keyup because Esc keydown will close the confirm dialog on Safari\n keyup: true,\n ignoreEventWhen: (e) => {\n const modals = document.querySelectorAll('#modal-container > *');\n const hasModal = !!modals;\n const hasOnlyComposer =\n modals.length === 1 && modals[0].querySelector('#compose-container');\n return hasModal && !hasOnlyComposer;\n },\n },\n );\n useCloseWatcher(() => {\n if (!standalone && confirmClose()) {\n onClose();\n }\n }, [standalone, confirmClose, onClose]);\n\n const prevBackgroundDraft = useRef({});\n const draftKey = () => {\n const ns = getCurrentAccountNS();\n return `${ns}#${UID.current}`;\n };\n const saveUnsavedDraft = () => {\n // Not enabling this for editing status\n // I don't think this warrant a draft mode for a status that's already posted\n // Maybe it could be a big edit change but it should be rare\n if (editStatus) return;\n if (states.composerState.minimized) return;\n const key = draftKey();\n const backgroundDraft = {\n key,\n replyTo: replyToStatus\n ? {\n /* Smaller payload of replyToStatus. Reasons:\n - No point storing whole thing\n - Could have media attachments\n - Could be deleted/edited later\n */\n id: replyToStatus.id,\n account: {\n id: replyToStatus.account.id,\n username: replyToStatus.account.username,\n acct: replyToStatus.account.acct,\n },\n }\n : null,\n draftStatus: {\n uid: UID.current,\n status: textareaRef.current.value,\n spoilerText: spoilerTextRef.current.value,\n visibility,\n language,\n sensitive,\n poll,\n mediaAttachments,\n },\n };\n if (\n !deepEqual(backgroundDraft, prevBackgroundDraft.current) &&\n !canClose()\n ) {\n console.debug('not equal', backgroundDraft, prevBackgroundDraft.current);\n db.drafts\n .set(key, {\n ...backgroundDraft,\n state: 'unsaved',\n updatedAt: Date.now(),\n })\n .then(() => {\n console.debug('DRAFT saved', key, backgroundDraft);\n })\n .catch((e) => {\n console.error('DRAFT failed', key, e);\n });\n prevBackgroundDraft.current = structuredClone(backgroundDraft);\n }\n };\n useInterval(saveUnsavedDraft, 5000); // background save every 5s\n useEffect(() => {\n saveUnsavedDraft();\n // If unmounted, means user discarded the draft\n // Also means pop-out 🙈, but it's okay because the pop-out will persist the ID and re-create the draft\n return () => {\n db.drafts.del(draftKey());\n };\n }, []);\n\n useEffect(() => {\n const handleItems = (e) => {\n const { items } = e.clipboardData || e.dataTransfer;\n const files = [];\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (item.kind === 'file') {\n const file = item.getAsFile();\n if (file && supportedMimeTypes.includes(file.type)) {\n files.push(file);\n }\n }\n }\n if (files.length > 0 && mediaAttachments.length >= maxMediaAttachments) {\n alert(`You can only attach up to ${maxMediaAttachments} files.`);\n return;\n }\n console.log({ files });\n if (files.length > 0) {\n e.preventDefault();\n e.stopPropagation();\n // Auto-cut-off files to avoid exceeding maxMediaAttachments\n const max = maxMediaAttachments - mediaAttachments.length;\n const allowedFiles = files.slice(0, max);\n if (allowedFiles.length <= 0) {\n alert(`You can only attach up to ${maxMediaAttachments} files.`);\n return;\n }\n const mediaFiles = allowedFiles.map((file) => ({\n file,\n type: file.type,\n size: file.size,\n url: URL.createObjectURL(file),\n id: null,\n description: null,\n }));\n setMediaAttachments([...mediaAttachments, ...mediaFiles]);\n }\n };\n window.addEventListener('paste', handleItems);\n const handleDragover = (e) => {\n // Prevent default if there's files\n if (e.dataTransfer.items.length > 0) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n window.addEventListener('dragover', handleDragover);\n window.addEventListener('drop', handleItems);\n return () => {\n window.removeEventListener('paste', handleItems);\n window.removeEventListener('dragover', handleDragover);\n window.removeEventListener('drop', handleItems);\n };\n }, [mediaAttachments]);\n\n const [showMentionPicker, setShowMentionPicker] = useState(false);\n const [showEmoji2Picker, setShowEmoji2Picker] = useState(false);\n const [showGIFPicker, setShowGIFPicker] = useState(false);\n\n const [autoDetectedLanguages, setAutoDetectedLanguages] = useState(null);\n const [topSupportedLanguages, restSupportedLanguages] = useMemo(() => {\n const topLanguages = [];\n const restLanguages = [];\n const { contentTranslationHideLanguages = [] } = states.settings;\n supportedLanguages.forEach((l) => {\n const [code] = l;\n if (\n code === language ||\n code === prevLanguage.current ||\n code === DEFAULT_LANG ||\n contentTranslationHideLanguages.includes(code) ||\n (autoDetectedLanguages?.length && autoDetectedLanguages.includes(code))\n ) {\n topLanguages.push(l);\n } else {\n restLanguages.push(l);\n }\n });\n topLanguages.sort(([codeA, commonA], [codeB, commonB]) => {\n if (codeA === language) return -1;\n if (codeB === language) return 1;\n return commonA.localeCompare(commonB);\n });\n restLanguages.sort(([codeA, commonA], [codeB, commonB]) =>\n commonA.localeCompare(commonB),\n );\n return [topLanguages, restLanguages];\n }, [language, autoDetectedLanguages]);\n\n const replyToStatusMonthsAgo = useMemo(\n () =>\n !!replyToStatus?.createdAt &&\n Math.floor(\n (Date.now() - new Date(replyToStatus.createdAt)) /\n (1000 * 60 * 60 * 24 * 30),\n ),\n [replyToStatus],\n );\n\n const onMinimize = () => {\n saveUnsavedDraft();\n states.composerState.minimized = true;\n };\n\n return (\n
\n
\n
\n {currentAccountInfo?.avatarStatic && (\n // \n \n )}\n {!standalone ? (\n \n {\n // If there are non-ID media attachments (not yet uploaded), show confirmation dialog because they are not going to be passed to the new window\n // const containNonIDMediaAttachments =\n // mediaAttachments.length > 0 &&\n // mediaAttachments.some((media) => !media.id);\n // if (containNonIDMediaAttachments) {\n // const yes = confirm(\n // 'You have media attachments that are not yet uploaded. Opening a new window will discard them and you will need to re-attach them. Are you sure you want to continue?',\n // );\n // if (!yes) {\n // return;\n // }\n // }\n\n // const mediaAttachmentsWithIDs = mediaAttachments.filter(\n // (media) => media.id,\n // );\n\n const newWin = openCompose({\n editStatus,\n replyToStatus,\n draftStatus: {\n uid: UID.current,\n status: textareaRef.current.value,\n spoilerText: spoilerTextRef.current.value,\n visibility,\n language,\n sensitive,\n poll,\n mediaAttachments,\n },\n });\n\n if (!newWin) {\n return;\n }\n\n onClose();\n }}\n >\n \n \n \n \n {' '}\n {\n if (confirmClose()) {\n onClose();\n }\n }}\n >\n \n \n \n ) : (\n hasOpener && (\n {\n // If there are non-ID media attachments (not yet uploaded), show confirmation dialog because they are not going to be passed to the new window\n // const containNonIDMediaAttachments =\n // mediaAttachments.length > 0 &&\n // mediaAttachments.some((media) => !media.id);\n // if (containNonIDMediaAttachments) {\n // const yes = confirm(\n // 'You have media attachments that are not yet uploaded. Opening a new window will discard them and you will need to re-attach them. Are you sure you want to continue?',\n // );\n // if (!yes) {\n // return;\n // }\n // }\n\n if (!window.opener) {\n alert('Looks like you closed the parent window.');\n return;\n }\n\n if (window.opener.__STATES__.showCompose) {\n if (window.opener.__STATES__.composerState?.publishing) {\n alert(\n 'Looks like you already have a compose field open in the parent window and currently publishing. Please wait for it to be done and try again later.',\n );\n return;\n }\n\n let confirmText =\n 'Looks like you already have a compose field open in the parent window. Popping in this window will discard the changes you made in the parent window. Continue?';\n const yes = confirm(confirmText);\n if (!yes) return;\n }\n\n // const mediaAttachmentsWithIDs = mediaAttachments.filter(\n // (media) => media.id,\n // );\n\n onClose({\n fn: () => {\n const passData = {\n editStatus,\n replyToStatus,\n draftStatus: {\n uid: UID.current,\n status: textareaRef.current.value,\n spoilerText: spoilerTextRef.current.value,\n visibility,\n language,\n sensitive,\n poll,\n mediaAttachments,\n },\n };\n window.opener.__COMPOSE__ = passData; // Pass it here instead of `showCompose` due to some weird proxy issue again\n if (window.opener.__STATES__.showCompose) {\n window.opener.__STATES__.showCompose = false;\n setTimeout(() => {\n window.opener.__STATES__.showCompose = true;\n }, 10);\n } else {\n window.opener.__STATES__.showCompose = true;\n }\n if (window.opener.__STATES__.composerState.minimized) {\n // Maximize it\n window.opener.__STATES__.composerState.minimized = false;\n }\n },\n });\n }}\n >\n \n \n )\n )}\n
\n {!!replyToStatus && (\n
\n \n
\n Replying to @\n {replyToStatus.account.acct || replyToStatus.account.username}\n ’s post\n {replyToStatusMonthsAgo >= 3 && (\n <>\n {' '}\n (\n \n {rtf.format(-replyToStatusMonthsAgo, 'month')}\n \n )\n \n )}\n
\n
\n )}\n {!!editStatus && (\n
\n \n
Editing source post
\n
\n )}\n {\n if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) {\n formRef.current.dispatchEvent(\n new Event('submit', { cancelable: true }),\n );\n }\n }}\n onSubmit={(e) => {\n e.preventDefault();\n\n const formData = new FormData(e.target);\n const entries = Object.fromEntries(formData.entries());\n console.log('ENTRIES', entries);\n let { status, visibility, sensitive, spoilerText } = entries;\n\n // Pre-cleanup\n sensitive = sensitive === 'on'; // checkboxes return \"on\" if checked\n\n // Validation\n /* Let the backend validate this\n if (stringLength(status) > maxCharacters) {\n alert(`Status is too long! Max characters: ${maxCharacters}`);\n return;\n }\n if (\n sensitive &&\n stringLength(status) + stringLength(spoilerText) > maxCharacters\n ) {\n alert(\n `Status and content warning is too long! Max characters: ${maxCharacters}`,\n );\n return;\n }\n */\n if (poll) {\n if (poll.options.length < 2) {\n alert('Poll must have at least 2 options');\n return;\n }\n if (poll.options.some((option) => option === '')) {\n alert('Some poll choices are empty');\n return;\n }\n }\n // TODO: check for URLs and use `charactersReservedPerUrl` to calculate max characters\n\n if (mediaAttachments.length > 0) {\n // If there are media attachments, check if they have no descriptions\n const hasNoDescriptions = mediaAttachments.some(\n (media) => !media.description?.trim?.(),\n );\n if (hasNoDescriptions) {\n const yes = confirm(\n 'Some media have no descriptions. Continue?',\n );\n if (!yes) return;\n }\n }\n\n // Post-cleanup\n spoilerText = (sensitive && spoilerText) || undefined;\n status = status === '' ? undefined : status;\n\n // states.composerState.minimized = true;\n states.composerState.publishing = true;\n setUIState('loading');\n (async () => {\n try {\n console.log('MEDIA ATTACHMENTS', mediaAttachments);\n if (mediaAttachments.length > 0) {\n // Upload media attachments first\n const mediaPromises = mediaAttachments.map((attachment) => {\n const { file, description, id } = attachment;\n console.log('UPLOADING', attachment);\n if (id) {\n // If already uploaded\n return attachment;\n } else {\n const params = removeNullUndefined({\n file,\n description,\n });\n return masto.v2.media.create(params).then((res) => {\n if (res.id) {\n attachment.id = res.id;\n }\n return res;\n });\n }\n });\n const results = await Promise.allSettled(mediaPromises);\n\n // If any failed, return\n if (\n results.some((result) => {\n return result.status === 'rejected' || !result.value?.id;\n })\n ) {\n states.composerState.publishing = false;\n states.composerState.publishingError = true;\n setUIState('error');\n // Alert all the reasons\n results.forEach((result) => {\n if (result.status === 'rejected') {\n console.error(result);\n alert(result.reason || `Attachment #${i} failed`);\n }\n });\n return;\n }\n\n console.log({ results, mediaAttachments });\n }\n\n /* NOTE:\n Using snakecase here because masto.js's `isObject` returns false for `params`, ONLY happens when opening in pop-out window. This is maybe due to `window.masto` variable being passed from the parent window. The check that failed is `x.constructor === Object`, so maybe the `Object` in new window is different than parent window's?\n Code: https://github.com/neet/masto.js/blob/dd0d649067b6a2b6e60fbb0a96597c373a255b00/src/serializers/is-object.ts#L2\n\n // TODO: Note above is no longer true in Masto.js v6. Revisit this.\n */\n let params = {\n status,\n // spoilerText,\n spoiler_text: spoilerText,\n language,\n sensitive,\n poll,\n // mediaIds: mediaAttachments.map((attachment) => attachment.id),\n media_ids: mediaAttachments.map(\n (attachment) => attachment.id,\n ),\n };\n if (editStatus && supports('@mastodon/edit-media-attributes')) {\n params.media_attributes = mediaAttachments.map(\n (attachment) => {\n return {\n id: attachment.id,\n description: attachment.description,\n // focus\n // thumbnail\n };\n },\n );\n } else if (!editStatus) {\n params.visibility = visibility;\n // params.inReplyToId = replyToStatus?.id || undefined;\n params.in_reply_to_id = replyToStatus?.id || undefined;\n }\n params = removeNullUndefined(params);\n console.log('POST', params);\n\n let newStatus;\n if (editStatus) {\n newStatus = await masto.v1.statuses\n .$select(editStatus.id)\n .update(params);\n saveStatus(newStatus, instance, {\n skipThreading: true,\n });\n } else {\n try {\n newStatus = await masto.v1.statuses.create(params, {\n requestInit: {\n headers: {\n 'Idempotency-Key': UID.current,\n },\n },\n });\n } catch (_) {\n // If idempotency key fails, try again without it\n newStatus = await masto.v1.statuses.create(params);\n }\n }\n states.composerState.minimized = false;\n states.composerState.publishing = false;\n setUIState('default');\n\n // Close\n onClose({\n // type: post, reply, edit\n type: editStatus ? 'edit' : replyToStatus ? 'reply' : 'post',\n newStatus,\n instance,\n });\n } catch (e) {\n states.composerState.publishing = false;\n states.composerState.publishingError = true;\n console.error(e);\n alert(e?.reason || e);\n setUIState('error');\n }\n })();\n }}\n >\n
\n {\n updateCharCount();\n }}\n />\n \n {\n const sensitive = e.target.checked;\n setSensitive(sensitive);\n if (sensitive) {\n spoilerTextRef.current?.focus();\n } else {\n textareaRef.current?.focus();\n }\n }}\n />\n \n {' '}\n \n \n {\n setVisibility(e.target.value);\n }}\n disabled={uiState === 'loading' || !!editStatus}\n >\n \n \n \n \n \n {' '}\n
\n {\n updateCharCount();\n }}\n maxCharacters={maxCharacters}\n performSearch={(params) => {\n const { type, q, limit } = params;\n if (type === 'accounts') {\n return masto.v1.accounts.search.list({\n q,\n limit,\n resolve: false,\n });\n }\n return masto.v2.search.fetch(params);\n }}\n onTrigger={(action) => {\n if (action?.name === 'custom-emojis') {\n setShowEmoji2Picker({\n defaultSearchTerm: action?.defaultSearchTerm || null,\n });\n } else if (action?.name === 'mention') {\n setShowMentionPicker({\n defaultSearchTerm: action?.defaultSearchTerm || null,\n });\n } else if (\n action?.name === 'auto-detect-language' &&\n action?.languages\n ) {\n setAutoDetectedLanguages(action.languages);\n }\n }}\n />\n {mediaAttachments?.length > 0 && (\n
\n {mediaAttachments.map((attachment, i) => {\n const { id, file } = attachment;\n const fileID = file?.size + file?.type + file?.name;\n return (\n {\n setMediaAttachments((attachments) => {\n const newAttachments = [...attachments];\n newAttachments[i].description = value;\n return newAttachments;\n });\n }}\n onRemove={() => {\n setMediaAttachments((attachments) => {\n return attachments.filter((_, j) => j !== i);\n });\n }}\n />\n );\n })}\n \n
\n )}\n {!!poll && (\n {\n if (poll) {\n const newPoll = { ...poll };\n setPoll(newPoll);\n } else {\n setPoll(null);\n }\n }}\n />\n )}\n \n \n \n {/* If maxOptions is not defined or defined and is greater than 1, show poll button */}\n {maxOptions == null ||\n (maxOptions > 1 && (\n <>\n {\n setPoll({\n options: ['', ''],\n expiresIn: 24 * 60 * 60, // 1 day\n multiple: false,\n });\n }}\n >\n \n \n \n ))}\n {/* {\n setShowMentionPicker(true);\n }}\n >\n \n */}\n {\n setShowEmoji2Picker(true);\n }}\n >\n \n \n {!!states.settings.composerGIFPicker && (\n = maxMediaAttachments ||\n !!poll\n }\n onClick={() => {\n setShowGIFPicker(true);\n }}\n >\n GIF\n \n )}\n \n
\n {uiState === 'loading' ? (\n \n ) : (\n
\n \n
\n {showMentionPicker && (\n {\n if (e.target === e.currentTarget) {\n setShowMentionPicker(false);\n }\n }}\n >\n {\n setShowMentionPicker(false);\n }}\n defaultSearchTerm={showMentionPicker?.defaultSearchTerm}\n onSelect={(socialAddress) => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n const { selectionStart, selectionEnd } = textarea;\n const text = textarea.value;\n const textBeforeMention = text.slice(0, selectionStart);\n const spaceBeforeMention = textBeforeMention\n ? /[\\s\\t\\n\\r]$/.test(textBeforeMention)\n ? ''\n : ' '\n : '';\n const textAfterMention = text.slice(selectionEnd);\n const spaceAfterMention = /^[\\s\\t\\n\\r]/.test(textAfterMention)\n ? ''\n : ' ';\n const newText =\n textBeforeMention +\n spaceBeforeMention +\n '@' +\n socialAddress +\n spaceAfterMention +\n textAfterMention;\n textarea.value = newText;\n textarea.selectionStart = textarea.selectionEnd =\n selectionEnd +\n 1 +\n socialAddress.length +\n spaceAfterMention.length;\n textarea.focus();\n textarea.dispatchEvent(new Event('input'));\n }}\n />\n \n )}\n {showEmoji2Picker && (\n {\n if (e.target === e.currentTarget) {\n setShowEmoji2Picker(false);\n }\n }}\n >\n {\n setShowEmoji2Picker(false);\n }}\n defaultSearchTerm={showEmoji2Picker?.defaultSearchTerm}\n onSelect={(emojiShortcode) => {\n const textarea = textareaRef.current;\n if (!textarea) return;\n const { selectionStart, selectionEnd } = textarea;\n const text = textarea.value;\n const textBeforeEmoji = text.slice(0, selectionStart);\n const spaceBeforeEmoji = textBeforeEmoji\n ? /[\\s\\t\\n\\r]$/.test(textBeforeEmoji)\n ? ''\n : ' '\n : '';\n const textAfterEmoji = text.slice(selectionEnd);\n const spaceAfterEmoji = /^[\\s\\t\\n\\r]/.test(textAfterEmoji)\n ? ''\n : ' ';\n const newText =\n textBeforeEmoji +\n spaceBeforeEmoji +\n emojiShortcode +\n spaceAfterEmoji +\n textAfterEmoji;\n textarea.value = newText;\n textarea.selectionStart = textarea.selectionEnd =\n selectionEnd + emojiShortcode.length + spaceAfterEmoji.length;\n textarea.focus();\n textarea.dispatchEvent(new Event('input'));\n }}\n />\n \n )}\n {showGIFPicker && (\n {\n if (e.target === e.currentTarget) {\n setShowGIFPicker(false);\n }\n }}\n >\n setShowGIFPicker(false)}\n onSelect={({ url, type, alt_text }) => {\n console.log('GIF URL', url);\n if (mediaAttachments.length >= maxMediaAttachments) {\n alert(\n `You can only attach up to ${maxMediaAttachments} files.`,\n );\n return;\n }\n // Download the GIF and insert it as media attachment\n (async () => {\n let theToast;\n try {\n theToast = showToast({\n text: 'Downloading GIF…',\n duration: -1,\n });\n const blob = await fetch(url, {\n referrerPolicy: 'no-referrer',\n }).then((res) => res.blob());\n const file = new File(\n [blob],\n type === 'video/mp4' ? 'video.mp4' : 'image.gif',\n {\n type,\n },\n );\n const newMediaAttachments = [\n ...mediaAttachments,\n {\n file,\n type,\n size: file.size,\n id: null,\n description: alt_text || '',\n },\n ];\n setMediaAttachments(newMediaAttachments);\n theToast?.hideToast?.();\n } catch (err) {\n console.error(err);\n theToast?.hideToast?.();\n showToast('Failed to download GIF');\n }\n })();\n }}\n />\n \n )}\n
\n );\n}\n\nfunction autoResizeTextarea(textarea) {\n if (!textarea) return;\n const { value, offsetHeight, scrollHeight, clientHeight } = textarea;\n if (offsetHeight < window.innerHeight) {\n // NOTE: This check is needed because the offsetHeight return 50000 (really large number) on first render\n // No idea why it does that, will re-investigate in far future\n const offset = offsetHeight - clientHeight;\n const height = value ? scrollHeight + offset + 'px' : null;\n textarea.style.height = height;\n }\n}\n\nasync function _getCustomEmojis(instance, masto) {\n const emojis = await masto.v1.customEmojis.list();\n const visibleEmojis = emojis.filter((e) => e.visibleInPicker);\n const searcher = new Fuse(visibleEmojis, {\n keys: ['shortcode'],\n findAllMatches: true,\n });\n return [visibleEmojis, searcher];\n}\nconst getCustomEmojis = pmem(_getCustomEmojis, {\n // Limit by time to reduce memory usage\n // Cached by instance\n matchesArg: (cacheKeyArg, keyArg) => cacheKeyArg.instance === keyArg.instance,\n maxAge: 30 * 60 * 1000, // 30 minutes\n});\n\nconst detectLangs = (text) => {\n const langs = detectAll(text);\n if (langs?.length) {\n // return max 2\n return langs.slice(0, 2).map((lang) => lang.lang);\n }\n return null;\n};\n\nconst Textarea = forwardRef((props, ref) => {\n const { masto, instance } = api();\n const [text, setText] = useState(ref.current?.value || '');\n const {\n maxCharacters,\n performSearch = () => {},\n onTrigger = () => {},\n ...textareaProps\n } = props;\n // const snapStates = useSnapshot(states);\n // const charCount = snapStates.composerCharacterCount;\n\n // const customEmojis = useRef();\n const searcherRef = useRef();\n useEffect(() => {\n getCustomEmojis(instance, masto)\n .then((r) => {\n const [emojis, searcher] = r;\n searcherRef.current = searcher;\n })\n .catch((e) => {\n console.error(e);\n });\n }, []);\n\n const textExpanderRef = useRef();\n const textExpanderTextRef = useRef('');\n useEffect(() => {\n let handleChange, handleValue, handleCommited;\n if (textExpanderRef.current) {\n handleChange = (e) => {\n // console.log('text-expander-change', e);\n const { key, provide, text } = e.detail;\n textExpanderTextRef.current = text;\n\n if (text === '') {\n provide(\n Promise.resolve({\n matched: false,\n }),\n );\n return;\n }\n\n if (key === ':') {\n // const emojis = customEmojis.current.filter((emoji) =>\n // emoji.shortcode.startsWith(text),\n // );\n // const emojis = filterShortcodes(customEmojis.current, text);\n const results = searcherRef.current?.search(text, {\n limit: 5,\n });\n let html = '';\n results.forEach(({ item: emoji }) => {\n const { shortcode, url } = emoji;\n html += `\n
  • \n \"\" \n ${encodeHTML(shortcode)}\n
  • `;\n });\n html += `
  • More…
  • `;\n // console.log({ emojis, html });\n menu.innerHTML = html;\n provide(\n Promise.resolve({\n matched: results.length > 0,\n fragment: menu,\n }),\n );\n return;\n }\n\n const type = {\n '@': 'accounts',\n '#': 'hashtags',\n }[key];\n provide(\n new Promise((resolve) => {\n const searchResults = performSearch({\n type,\n q: text,\n limit: 5,\n });\n searchResults.then((value) => {\n if (text !== textExpanderTextRef.current) {\n return;\n }\n console.log({ value, type, v: value[type] });\n const results = value[type] || value;\n console.log('RESULTS', value, results);\n let html = '';\n results.forEach((result) => {\n const {\n name,\n avatarStatic,\n displayName,\n username,\n acct,\n emojis,\n history,\n } = result;\n const displayNameWithEmoji = emojifyText(displayName, emojis);\n // const item = menuItem.cloneNode();\n if (acct) {\n html += `\n
  • \n \n \"\"\n \n \n ${displayNameWithEmoji || username}\n
    @${encodeHTML(acct)}\n
    \n
  • \n `;\n } else {\n const total = history?.reduce?.(\n (acc, cur) => acc + +cur.uses,\n 0,\n );\n html += `\n
  • \n #${encodeHTML(name)}\n ${\n total\n ? `${shortenNumber(total)}`\n : ''\n }\n
  • \n `;\n }\n });\n if (type === 'accounts') {\n html += `
  • More…
  • `;\n }\n menu.innerHTML = html;\n console.log('MENU', results, menu);\n resolve({\n matched: results.length > 0,\n fragment: menu,\n });\n });\n }),\n );\n };\n\n textExpanderRef.current.addEventListener(\n 'text-expander-change',\n handleChange,\n );\n\n handleValue = (e) => {\n const { key, item } = e.detail;\n const { value, more } = item.dataset;\n if (key === ':') {\n e.detail.value = value ? `:${value}:` : '​'; // zero-width space\n if (more) {\n // Prevent adding space after the above value\n e.detail.continue = true;\n\n setTimeout(() => {\n onTrigger?.({\n name: 'custom-emojis',\n defaultSearchTerm: more,\n });\n }, 300);\n }\n } else if (key === '@') {\n e.detail.value = value ? `@${value} ` : '​'; // zero-width space\n if (more) {\n e.detail.continue = true;\n setTimeout(() => {\n onTrigger?.({\n name: 'mention',\n defaultSearchTerm: more,\n });\n }, 300);\n }\n } else {\n e.detail.value = `${key}${value}`;\n }\n };\n\n textExpanderRef.current.addEventListener(\n 'text-expander-value',\n handleValue,\n );\n\n handleCommited = (e) => {\n const { input } = e.detail;\n setText(input.value);\n // fire input event\n if (ref.current) {\n const event = new Event('input', { bubbles: true });\n ref.current.dispatchEvent(event);\n }\n };\n\n textExpanderRef.current.addEventListener(\n 'text-expander-committed',\n handleCommited,\n );\n }\n\n return () => {\n if (textExpanderRef.current) {\n textExpanderRef.current.removeEventListener(\n 'text-expander-change',\n handleChange,\n );\n textExpanderRef.current.removeEventListener(\n 'text-expander-value',\n handleValue,\n );\n textExpanderRef.current.removeEventListener(\n 'text-expander-committed',\n handleCommited,\n );\n }\n };\n }, []);\n\n useEffect(() => {\n // Resize observer for textarea\n const textarea = ref.current;\n if (!textarea) return;\n const resizeObserver = new ResizeObserver(() => {\n // Get height of textarea, set height to textExpander\n if (textExpanderRef.current) {\n const { height } = textarea.getBoundingClientRect();\n textExpanderRef.current.style.height = height + 'px';\n }\n });\n resizeObserver.observe(textarea);\n }, []);\n\n const slowHighlightPerf = useRef(0); // increment if slow\n const composeHighlightRef = useRef();\n const throttleHighlightText = useThrottledCallback((text) => {\n if (!composeHighlightRef.current) return;\n if (slowHighlightPerf.current > 3) {\n // After 3 times of lag, disable highlighting\n composeHighlightRef.current.innerHTML = '';\n composeHighlightRef.current = null; // Destroy the whole thing\n throttleHighlightText?.cancel?.();\n return;\n }\n let start;\n let end;\n if (slowHighlightPerf.current <= 3) start = Date.now();\n composeHighlightRef.current.innerHTML =\n highlightText(text, {\n maxCharacters,\n }) + '\\n';\n if (slowHighlightPerf.current <= 3) end = Date.now();\n console.debug('HIGHLIGHT PERF', { start, end, diff: end - start });\n if (start && end && end - start > 50) {\n // if slow, increment\n slowHighlightPerf.current++;\n }\n // Newline to prevent multiple line breaks at the end from being collapsed, no idea why\n }, 500);\n\n const debouncedAutoDetectLanguage = useDebouncedCallback(() => {\n // Make use of the highlightRef to get the DOM\n // Clone the dom\n const dom = composeHighlightRef.current?.cloneNode(true);\n if (!dom) return;\n // Remove mark\n dom.querySelectorAll('mark').forEach((mark) => {\n mark.remove();\n });\n const text = dom.innerText?.trim();\n if (!text) return;\n const langs = detectLangs(text);\n if (langs?.length) {\n onTrigger?.({\n name: 'auto-detect-language',\n languages: langs,\n });\n }\n }, 2000);\n\n return (\n \n {\n // Get line before cursor position after pressing 'Enter'\n const { key, target } = e;\n if (key === 'Enter' && !(e.ctrlKey || e.metaKey)) {\n try {\n const { value, selectionStart } = target;\n const textBeforeCursor = value.slice(0, selectionStart);\n const lastLine = textBeforeCursor.split('\\n').slice(-1)[0];\n if (lastLine) {\n // If line starts with \"- \" or \"12. \"\n if (/^\\s*(-|\\d+\\.)\\s/.test(lastLine)) {\n // insert \"- \" at cursor position\n const [_, preSpaces, bullet, postSpaces, anything] =\n lastLine.match(/^(\\s*)(-|\\d+\\.)(\\s+)(.+)?/) || [];\n if (anything) {\n e.preventDefault();\n const [number] = bullet.match(/\\d+/) || [];\n const newBullet = number ? `${+number + 1}.` : '-';\n const text = `\\n${preSpaces}${newBullet}${postSpaces}`;\n target.setRangeText(text, selectionStart, selectionStart);\n const pos = selectionStart + text.length;\n target.setSelectionRange(pos, pos);\n } else {\n // trim the line before the cursor, then insert new line\n const pos = selectionStart - lastLine.length;\n target.setRangeText('', pos, selectionStart);\n }\n autoResizeTextarea(target);\n target.dispatchEvent(new Event('input'));\n }\n }\n } catch (e) {\n // silent fail\n console.error(e);\n }\n }\n if (composeHighlightRef.current) {\n composeHighlightRef.current.scrollTop = target.scrollTop;\n }\n }}\n onInput={(e) => {\n const { target } = e;\n // Replace zero-width space\n const text = target.value.replace(/\\u200b/g, '');\n setText(text);\n autoResizeTextarea(target);\n props.onInput?.(e);\n throttleHighlightText(text);\n debouncedAutoDetectLanguage();\n }}\n style={{\n width: '100%',\n height: '4em',\n // '--text-weight': (1 + charCount / 140).toFixed(1) || 1,\n }}\n onScroll={(e) => {\n if (composeHighlightRef.current) {\n const { scrollTop } = e.target;\n composeHighlightRef.current.scrollTop = scrollTop;\n }\n }}\n />\n \n \n );\n});\n\nfunction CharCountMeter({ maxCharacters = 500, hidden }) {\n const snapStates = useSnapshot(states);\n const charCount = snapStates.composerCharacterCount;\n const leftChars = maxCharacters - charCount;\n if (hidden) {\n return \n );\n}\n\nfunction prettyBytes(bytes) {\n const units = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n let unitIndex = 0;\n while (bytes >= 1024) {\n bytes /= 1024;\n unitIndex++;\n }\n return `${bytes.toFixed(0).toLocaleString()} ${units[unitIndex]}`;\n}\n\nfunction scaleDimension(matrix, matrixLimit, width, height) {\n // matrix = number of pixels\n // matrixLimit = max number of pixels\n // Calculate new width and height, downsize to within the limit, preserve aspect ratio, no decimals\n const scalingFactor = Math.sqrt(matrixLimit / matrix);\n const newWidth = Math.floor(width * scalingFactor);\n const newHeight = Math.floor(height * scalingFactor);\n return { newWidth, newHeight };\n}\n\nfunction MediaAttachment({\n attachment,\n disabled,\n lang,\n onDescriptionChange = () => {},\n onRemove = () => {},\n}) {\n const [uiState, setUIState] = useState('default');\n const supportsEdit = supports('@mastodon/edit-media-attributes');\n const { type, id, file } = attachment;\n const url = useMemo(\n () => (file ? URL.createObjectURL(file) : attachment.url),\n [file, attachment.url],\n );\n console.log({ attachment });\n\n const checkMaxError = !!file?.size;\n const configuration = checkMaxError ? getCurrentInstanceConfiguration() : {};\n const {\n mediaAttachments: {\n imageSizeLimit,\n imageMatrixLimit,\n videoSizeLimit,\n videoMatrixLimit,\n videoFrameRateLimit,\n } = {},\n } = configuration || {};\n\n const [maxError, setMaxError] = useState(() => {\n if (!checkMaxError) return null;\n if (\n type.startsWith('image') &&\n imageSizeLimit &&\n file.size > imageSizeLimit\n ) {\n return {\n type: 'imageSizeLimit',\n details: {\n imageSize: file.size,\n imageSizeLimit,\n },\n };\n } else if (\n type.startsWith('video') &&\n videoSizeLimit &&\n file.size > videoSizeLimit\n ) {\n return {\n type: 'videoSizeLimit',\n details: {\n videoSize: file.size,\n videoSizeLimit,\n },\n };\n }\n return null;\n });\n\n const [imageMatrix, setImageMatrix] = useState({});\n useEffect(() => {\n if (!checkMaxError || !imageMatrixLimit) return;\n if (imageMatrix?.matrix > imageMatrixLimit) {\n setMaxError({\n type: 'imageMatrixLimit',\n details: {\n imageMatrix: imageMatrix?.matrix,\n imageMatrixLimit,\n width: imageMatrix?.width,\n height: imageMatrix?.height,\n },\n });\n }\n }, [imageMatrix, imageMatrixLimit, checkMaxError]);\n\n const [videoMatrix, setVideoMatrix] = useState({});\n useEffect(() => {\n if (!checkMaxError || !videoMatrixLimit) return;\n if (videoMatrix?.matrix > videoMatrixLimit) {\n setMaxError({\n type: 'videoMatrixLimit',\n details: {\n videoMatrix: videoMatrix?.matrix,\n videoMatrixLimit,\n width: videoMatrix?.width,\n height: videoMatrix?.height,\n },\n });\n }\n }, [videoMatrix, videoMatrixLimit, checkMaxError]);\n\n const [description, setDescription] = useState(attachment.description);\n const [suffixType, subtype] = type.split('/');\n const debouncedOnDescriptionChange = useDebouncedCallback(\n onDescriptionChange,\n 250,\n );\n useEffect(() => {\n debouncedOnDescriptionChange(description);\n }, [description, debouncedOnDescriptionChange]);\n\n const [showModal, setShowModal] = useState(false);\n const textareaRef = useRef(null);\n useEffect(() => {\n let timer;\n if (showModal && textareaRef.current) {\n timer = setTimeout(() => {\n textareaRef.current.focus();\n }, 100);\n }\n return () => {\n clearTimeout(timer);\n };\n }, [showModal]);\n\n const descTextarea = (\n <>\n {!!id && !supportsEdit ? (\n
    \n Uploaded\n

    \n {attachment.description || No description}\n

    \n
    \n ) : (\n {\n const { value } = e.target;\n setDescription(value);\n // debouncedOnDescriptionChange(value);\n }}\n >\n )}\n \n );\n\n const toastRef = useRef(null);\n useEffect(() => {\n return () => {\n toastRef.current?.hideToast?.();\n };\n }, []);\n\n const maxErrorToast = useRef(null);\n\n const maxErrorText = (err) => {\n const { type, details } = err;\n switch (type) {\n case 'imageSizeLimit': {\n const { imageSize, imageSizeLimit } = details;\n return `File size too large. Uploading might encounter issues. Try reduce the file size from ${prettyBytes(\n imageSize,\n )} to ${prettyBytes(imageSizeLimit)} or lower.`;\n }\n case 'imageMatrixLimit': {\n const { imageMatrix, imageMatrixLimit, width, height } = details;\n const { newWidth, newHeight } = scaleDimension(\n imageMatrix,\n imageMatrixLimit,\n width,\n height,\n );\n return `Dimension too large. Uploading might encounter issues. Try reduce dimension from ${width.toLocaleString()}×${height.toLocaleString()}px to ${newWidth.toLocaleString()}×${newHeight.toLocaleString()}px.`;\n }\n case 'videoSizeLimit': {\n const { videoSize, videoSizeLimit } = details;\n return `File size too large. Uploading might encounter issues. Try reduce the file size from ${prettyBytes(\n videoSize,\n )} to ${prettyBytes(videoSizeLimit)} or lower.`;\n }\n case 'videoMatrixLimit': {\n const { videoMatrix, videoMatrixLimit, width, height } = details;\n const { newWidth, newHeight } = scaleDimension(\n videoMatrix,\n videoMatrixLimit,\n width,\n height,\n );\n return `Dimension too large. Uploading might encounter issues. Try reduce dimension from ${width.toLocaleString()}×${height.toLocaleString()}px to ${newWidth.toLocaleString()}×${newHeight.toLocaleString()}px.`;\n }\n case 'videoFrameRateLimit': {\n // Not possible to detect this on client-side for now\n return 'Frame rate too high. Uploading might encounter issues.';\n }\n }\n };\n\n return (\n <>\n
    \n {\n setShowModal(true);\n }}\n >\n {suffixType === 'image' ? (\n {\n if (!checkMaxError) return;\n const { naturalWidth, naturalHeight } = e.target;\n setImageMatrix({\n matrix: naturalWidth * naturalHeight,\n width: naturalWidth,\n height: naturalHeight,\n });\n }}\n />\n ) : suffixType === 'video' || suffixType === 'gifv' ? (\n {\n if (!checkMaxError) return;\n const { videoWidth, videoHeight } = e.target;\n if (videoWidth && videoHeight) {\n setVideoMatrix({\n matrix: videoWidth * videoHeight,\n width: videoWidth,\n height: videoHeight,\n });\n }\n }}\n />\n ) : suffixType === 'audio' ? (\n
    \n {descTextarea}\n
    \n \n \n \n {!!maxError && (\n {\n if (maxErrorToast.current) {\n maxErrorToast.current.hideToast();\n }\n maxErrorToast.current = showToast({\n text: maxErrorText(maxError),\n duration: 10_000,\n });\n }}\n >\n \n \n )}\n
    \n \n {showModal && (\n {\n if (e.target === e.currentTarget) {\n setShowModal(false);\n }\n }}\n >\n
    \n {\n setShowModal(false);\n }}\n >\n \n \n
    \n

    \n {\n {\n image: 'Edit image description',\n video: 'Edit video description',\n audio: 'Edit audio description',\n }[suffixType]\n }\n

    \n
    \n
    \n
    \n {suffixType === 'image' ? (\n \"\"\n ) : suffixType === 'video' || suffixType === 'gifv' ? (\n
    \n
    \n {descTextarea}\n
    \n {suffixType === 'image' &&\n /^(png|jpe?g|gif|webp)$/i.test(subtype) &&\n !!states.settings.mediaAltGenerator &&\n !!IMG_ALT_API_URL && (\n \n \n \n }\n >\n {\n setUIState('loading');\n toastRef.current = showToast({\n text: 'Generating description. Please wait...',\n duration: -1,\n });\n // POST with multipart\n (async function () {\n try {\n const body = new FormData();\n body.append('image', file);\n const response = await fetch(IMG_ALT_API_URL, {\n method: 'POST',\n body,\n }).then((r) => r.json());\n if (response.error) {\n throw new Error(response.error);\n }\n setDescription(response.description);\n } catch (e) {\n console.error(e);\n showToast(\n `Failed to generate description${\n e?.message ? `: ${e.message}` : ''\n }`,\n );\n } finally {\n setUIState('default');\n toastRef.current?.hideToast?.();\n }\n })();\n }}\n >\n \n {lang && lang !== 'en' ? (\n \n Generate description…\n
    \n (English)\n
    \n ) : (\n Generate description…\n )}\n \n {!!lang && lang !== 'en' && (\n {\n setUIState('loading');\n toastRef.current = showToast({\n text: 'Generating description. Please wait...',\n duration: -1,\n });\n // POST with multipart\n (async function () {\n try {\n const body = new FormData();\n body.append('image', file);\n const params = `?lang=${lang}`;\n const response = await fetch(\n IMG_ALT_API_URL + params,\n {\n method: 'POST',\n body,\n },\n ).then((r) => r.json());\n if (response.error) {\n throw new Error(response.error);\n }\n setDescription(response.description);\n } catch (e) {\n console.error(e);\n showToast(\n `Failed to generate description${\n e?.message ? `: ${e.message}` : ''\n }`,\n );\n } finally {\n setUIState('default');\n toastRef.current?.hideToast?.();\n }\n })();\n }}\n >\n \n \n Generate description…\n
    ({localeCode2Text(lang)}){' '}\n \n — experimental\n \n
    \n \n )}\n \n )}\n {\n setShowModal(false);\n }}\n disabled={uiState === 'loading'}\n >\n Done\n \n
    \n
    \n
    \n
    \n \n )}\n \n );\n}\n\nfunction Poll({\n lang,\n poll,\n disabled,\n onInput = () => {},\n maxOptions,\n maxExpiration,\n minExpiration,\n maxCharactersPerOption,\n}) {\n const { options, expiresIn, multiple } = poll;\n\n return (\n
    \n
    \n {options.map((option, i) => (\n
    \n {\n const { value } = e.target;\n options[i] = value;\n onInput(poll);\n }}\n />\n {\n options.splice(i, 1);\n onInput(poll);\n }}\n >\n \n \n
    \n ))}\n
    \n
    \n = maxOptions}\n onClick={() => {\n options.push('');\n onInput(poll);\n }}\n >\n +\n {' '}\n \n \n
    \n
    \n {\n onInput(null);\n }}\n >\n Remove poll\n \n
    \n
    \n );\n}\n\nfunction filterShortcodes(emojis, searchTerm) {\n searchTerm = searchTerm.toLowerCase();\n\n // Return an array of shortcodes that start with or contain the search term, sorted by relevance and limited to the first 5\n return emojis\n .sort((a, b) => {\n let aLower = a.shortcode.toLowerCase();\n let bLower = b.shortcode.toLowerCase();\n\n let aStartsWith = aLower.startsWith(searchTerm);\n let bStartsWith = bLower.startsWith(searchTerm);\n let aContains = aLower.includes(searchTerm);\n let bContains = bLower.includes(searchTerm);\n let bothStartWith = aStartsWith && bStartsWith;\n let bothContain = aContains && bContains;\n\n return bothStartWith\n ? a.length - b.length\n : aStartsWith\n ? -1\n : bStartsWith\n ? 1\n : bothContain\n ? a.length - b.length\n : aContains\n ? -1\n : bContains\n ? 1\n : 0;\n })\n .slice(0, 5);\n}\n\nfunction encodeHTML(str) {\n return str.replace(/[&<>\"']/g, function (char) {\n return '&#' + char.charCodeAt(0) + ';';\n });\n}\n\nfunction removeNullUndefined(obj) {\n for (let key in obj) {\n if (obj[key] === null || obj[key] === undefined) {\n delete obj[key];\n }\n }\n return obj;\n}\n\nfunction MentionModal({\n onClose = () => {},\n onSelect = () => {},\n defaultSearchTerm,\n}) {\n const { masto } = api();\n const [uiState, setUIState] = useState('default');\n const [accounts, setAccounts] = useState([]);\n const [relationshipsMap, setRelationshipsMap] = useState({});\n\n const [selectedIndex, setSelectedIndex] = useState(0);\n\n const loadRelationships = async (accounts) => {\n if (!accounts?.length) return;\n const relationships = await fetchRelationships(accounts, relationshipsMap);\n if (relationships) {\n setRelationshipsMap({\n ...relationshipsMap,\n ...relationships,\n });\n }\n };\n\n const loadAccounts = (term) => {\n if (!term) return;\n setUIState('loading');\n (async () => {\n try {\n const accounts = await masto.v1.accounts.search.list({\n q: term,\n limit: 40,\n resolve: false,\n });\n setAccounts(accounts);\n loadRelationships(accounts);\n setUIState('default');\n } catch (e) {\n setUIState('error');\n console.error(e);\n }\n })();\n };\n\n const debouncedLoadAccounts = useDebouncedCallback(loadAccounts, 1000);\n\n useEffect(() => {\n loadAccounts();\n }, [loadAccounts]);\n\n const inputRef = useRef();\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n // Put cursor at the end\n if (inputRef.current.value) {\n inputRef.current.selectionStart = inputRef.current.value.length;\n inputRef.current.selectionEnd = inputRef.current.value.length;\n }\n }\n }, []);\n\n useEffect(() => {\n if (defaultSearchTerm) {\n loadAccounts(defaultSearchTerm);\n }\n }, [defaultSearchTerm]);\n\n const selectAccount = (account) => {\n const socialAddress = account.acct;\n onSelect(socialAddress);\n onClose();\n };\n\n useHotkeys(\n 'enter',\n () => {\n const selectedAccount = accounts[selectedIndex];\n if (selectedAccount) {\n selectAccount(selectedAccount);\n }\n },\n {\n preventDefault: true,\n enableOnFormTags: ['input'],\n },\n );\n\n const listRef = useRef();\n useHotkeys(\n 'down',\n () => {\n if (selectedIndex < accounts.length - 1) {\n setSelectedIndex(selectedIndex + 1);\n } else {\n setSelectedIndex(0);\n }\n setTimeout(() => {\n const selectedItem = listRef.current.querySelector('.selected');\n if (selectedItem) {\n selectedItem.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n });\n }\n }, 1);\n },\n {\n preventDefault: true,\n enableOnFormTags: ['input'],\n },\n );\n\n useHotkeys(\n 'up',\n () => {\n if (selectedIndex > 0) {\n setSelectedIndex(selectedIndex - 1);\n } else {\n setSelectedIndex(accounts.length - 1);\n }\n setTimeout(() => {\n const selectedItem = listRef.current.querySelector('.selected');\n if (selectedItem) {\n selectedItem.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n });\n }\n }, 1);\n },\n {\n preventDefault: true,\n enableOnFormTags: ['input'],\n },\n );\n\n return (\n
    \n {!!onClose && (\n \n )}\n
    \n {\n e.preventDefault();\n debouncedLoadAccounts.flush?.();\n // const searchTerm = inputRef.current.value;\n // debouncedLoadAccounts(searchTerm);\n }}\n >\n {\n const { value } = e.target;\n debouncedLoadAccounts(value);\n }}\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellCheck=\"false\"\n dir=\"auto\"\n defaultValue={defaultSearchTerm || ''}\n />\n \n
    \n
    \n {accounts?.length > 0 ? (\n \n {accounts.map((account, i) => {\n const relationship = relationshipsMap[account.id];\n return (\n \n \n {\n selectAccount(account);\n }}\n >\n \n \n \n );\n })}\n \n ) : uiState === 'loading' ? (\n
    \n \n
    \n ) : uiState === 'error' ? (\n
    \n

    Error loading accounts

    \n
    \n ) : null}\n
    \n
    \n );\n}\n\nfunction CustomEmojisModal({\n masto,\n instance,\n onClose = () => {},\n onSelect = () => {},\n defaultSearchTerm,\n}) {\n const [uiState, setUIState] = useState('default');\n const customEmojisList = useRef([]);\n const [customEmojis, setCustomEmojis] = useState([]);\n const recentlyUsedCustomEmojis = useMemo(\n () => store.account.get('recentlyUsedCustomEmojis') || [],\n );\n const searcherRef = useRef();\n useEffect(() => {\n setUIState('loading');\n (async () => {\n try {\n const [emojis, searcher] = await getCustomEmojis(instance, masto);\n console.log('emojis', emojis);\n searcherRef.current = searcher;\n setCustomEmojis(emojis);\n setUIState('default');\n } catch (e) {\n setUIState('error');\n console.error(e);\n }\n })();\n }, []);\n\n const customEmojisCatList = useMemo(() => {\n // Group emojis by category\n const emojisCat = {\n '--recent--': recentlyUsedCustomEmojis.filter((emoji) =>\n customEmojis.find((e) => e.shortcode === emoji.shortcode),\n ),\n };\n const othersCat = [];\n customEmojis.forEach((emoji) => {\n customEmojisList.current?.push?.(emoji);\n if (!emoji.category) {\n othersCat.push(emoji);\n return;\n }\n if (!emojisCat[emoji.category]) {\n emojisCat[emoji.category] = [];\n }\n emojisCat[emoji.category].push(emoji);\n });\n if (othersCat.length) {\n emojisCat['--others--'] = othersCat;\n }\n return emojisCat;\n }, [customEmojis]);\n\n const scrollableRef = useRef();\n const [matches, setMatches] = useState(null);\n const onFind = useCallback(\n (e) => {\n const { value } = e.target;\n if (value) {\n const results = searcherRef.current?.search(value, {\n limit: CUSTOM_EMOJIS_COUNT,\n });\n setMatches(results.map((r) => r.item));\n scrollableRef.current?.scrollTo?.(0, 0);\n } else {\n setMatches(null);\n }\n },\n [customEmojis],\n );\n useEffect(() => {\n if (defaultSearchTerm && customEmojis?.length) {\n onFind({ target: { value: defaultSearchTerm } });\n }\n }, [defaultSearchTerm, onFind, customEmojis]);\n\n const onSelectEmoji = useCallback(\n (emoji) => {\n onSelect?.(emoji);\n onClose?.();\n\n queueMicrotask(() => {\n let recentlyUsedCustomEmojis =\n store.account.get('recentlyUsedCustomEmojis') || [];\n const recentlyUsedEmojiIndex = recentlyUsedCustomEmojis.findIndex(\n (e) => e.shortcode === emoji.shortcode,\n );\n if (recentlyUsedEmojiIndex !== -1) {\n // Move emoji to index 0\n recentlyUsedCustomEmojis.splice(recentlyUsedEmojiIndex, 1);\n recentlyUsedCustomEmojis.unshift(emoji);\n } else {\n recentlyUsedCustomEmojis.unshift(emoji);\n // Remove unavailable ones\n recentlyUsedCustomEmojis = recentlyUsedCustomEmojis.filter((e) =>\n customEmojisList.current?.find?.(\n (emoji) => emoji.shortcode === e.shortcode,\n ),\n );\n // Limit to 10\n recentlyUsedCustomEmojis = recentlyUsedCustomEmojis.slice(0, 10);\n }\n\n // Store back\n store.account.set('recentlyUsedCustomEmojis', recentlyUsedCustomEmojis);\n });\n },\n [onSelect],\n );\n\n const inputRef = useRef();\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n // Put cursor at the end\n if (inputRef.current.value) {\n inputRef.current.selectionStart = inputRef.current.value.length;\n inputRef.current.selectionEnd = inputRef.current.value.length;\n }\n }\n }, []);\n\n return (\n
    \n {!!onClose && (\n \n )}\n
    \n
    \n Custom emojis{' '}\n {uiState === 'loading' ? (\n \n ) : (\n • {instance}\n )}\n
    \n {\n e.preventDefault();\n const emoji = matches[0];\n if (emoji) {\n onSelectEmoji(`:${emoji.shortcode}:`);\n }\n }}\n >\n \n \n
    \n
    \n {matches !== null ? (\n
      \n {matches.map((emoji) => (\n
    • \n {\n onSelectEmoji(`:${emoji.shortcode}:`);\n }}\n showCode\n />\n
    • \n ))}\n
    \n ) : (\n
    \n {uiState === 'error' && (\n
    \n

    Error loading custom emojis

    \n
    \n )}\n {uiState === 'default' &&\n Object.entries(customEmojisCatList).map(\n ([category, emojis]) =>\n !!emojis?.length && (\n <>\n
    \n {{\n '--recent--': 'Recently used',\n '--others--': 'Others',\n }[category] || category}\n
    \n \n \n ),\n )}\n
    \n )}\n
    \n
    \n );\n}\n\nconst CustomEmojisList = memo(({ emojis, onSelect }) => {\n const [max, setMax] = useState(CUSTOM_EMOJIS_COUNT);\n const showMore = emojis.length > max;\n return (\n
    \n {emojis.slice(0, max).map((emoji) => (\n {\n onSelect(`:${emoji.shortcode}:`);\n }}\n />\n ))}\n {showMore && (\n setMax(max + CUSTOM_EMOJIS_COUNT)}\n >\n {(emojis.length - max).toLocaleString()} more…\n \n )}\n
    \n );\n});\n\nconst CustomEmojiButton = memo(({ emoji, onClick, showCode }) => {\n const addEdges = (e) => {\n // Add edge-left or edge-right class based on self position relative to scrollable parent\n // If near left edge, add edge-left, if near right edge, add edge-right\n const buffer = 88;\n const parent = e.currentTarget.closest('main');\n if (parent) {\n const rect = parent.getBoundingClientRect();\n const selfRect = e.currentTarget.getBoundingClientRect();\n const targetClassList = e.currentTarget.classList;\n if (selfRect.left < rect.left + buffer) {\n targetClassList.add('edge-left');\n targetClassList.remove('edge-right');\n } else if (selfRect.right > rect.right - buffer) {\n targetClassList.add('edge-right');\n targetClassList.remove('edge-left');\n } else {\n targetClassList.remove('edge-left', 'edge-right');\n }\n }\n };\n\n return (\n \n \n {!!emoji.staticUrl && (\n \n )}\n \n \n {showCode && (\n <>\n {' '}\n {emoji.shortcode}\n \n )}\n \n );\n});\n\nconst GIFS_PER_PAGE = 20;\nfunction GIFPickerModal({ onClose = () => {}, onSelect = () => {} }) {\n const [uiState, setUIState] = useState('default');\n const [results, setResults] = useState([]);\n const formRef = useRef(null);\n const qRef = useRef(null);\n const currentOffset = useRef(0);\n const scrollableRef = useRef(null);\n\n function fetchGIFs({ offset }) {\n console.log('fetchGIFs', { offset });\n if (!qRef.current?.value) return;\n setUIState('loading');\n scrollableRef.current?.scrollTo?.({\n top: 0,\n left: 0,\n behavior: 'smooth',\n });\n (async () => {\n try {\n const query = {\n api_key: GIPHY_API_KEY,\n q: qRef.current.value,\n rating: 'g',\n limit: GIFS_PER_PAGE,\n bundle: 'messaging_non_clips',\n offset,\n };\n const response = await fetch(\n 'https://api.giphy.com/v1/gifs/search?' + new URLSearchParams(query),\n {\n referrerPolicy: 'no-referrer',\n },\n ).then((r) => r.json());\n currentOffset.current = response.pagination?.offset || 0;\n setResults(response);\n setUIState('results');\n } catch (e) {\n setUIState('error');\n console.error(e);\n }\n })();\n }\n\n useEffect(() => {\n qRef.current?.focus();\n }, []);\n\n const debouncedOnInput = useDebouncedCallback(() => {\n fetchGIFs({ offset: 0 });\n }, 1000);\n\n return (\n
    \n {!!onClose && (\n \n )}\n
    \n {\n e.preventDefault();\n fetchGIFs({ offset: 0 });\n }}\n >\n \n \n \n
    \n
    \n {uiState === 'default' && (\n
    \n

    Type to search GIFs

    \n
    \n )}\n {uiState === 'loading' && !results?.data?.length && (\n
    \n \n
    \n )}\n {results?.data?.length > 0 ? (\n <>\n
      \n {results.data.map((gif) => {\n const { id, images, title, alt_text } = gif;\n const {\n fixed_height_small,\n fixed_height_downsampled,\n fixed_height,\n original,\n } = images;\n const theImage = fixed_height_small?.url\n ? fixed_height_small\n : fixed_height_downsampled?.url\n ? fixed_height_downsampled\n : fixed_height;\n let { url, webp, width, height } = theImage;\n if (+height > 100) {\n width = (width / height) * 100;\n height = 100;\n }\n const urlObj = new URL(url);\n const strippedURL = urlObj.origin + urlObj.pathname;\n let strippedWebP;\n if (webp) {\n const webpObj = new URL(webp);\n strippedWebP = webpObj.origin + webpObj.pathname;\n }\n return (\n
    • \n {\n const { mp4, url } = original;\n const theURL = mp4 || url;\n const urlObj = new URL(theURL);\n const strippedURL = urlObj.origin + urlObj.pathname;\n onClose();\n onSelect({\n url: strippedURL,\n type: mp4 ? 'video/mp4' : 'image/gif',\n alt_text: alt_text || title,\n });\n }}\n >\n \n \n {strippedWebP && (\n \n )}\n {\n e.target.style.backgroundColor = 'transparent';\n }}\n />\n \n
      {alt_text || title}
      \n \n \n
    • \n );\n })}\n
    \n

    \n {results.pagination?.offset > 0 && (\n {\n fetchGIFs({\n offset: results.pagination?.offset - GIFS_PER_PAGE,\n });\n }}\n >\n \n Previous\n \n )}\n \n {results.pagination?.offset + results.pagination?.count <\n results.pagination?.total_count && (\n {\n fetchGIFs({\n offset: results.pagination?.offset + GIFS_PER_PAGE,\n });\n }}\n >\n Next \n \n )}\n

    \n \n ) : (\n uiState === 'results' && (\n
    \n

    No results

    \n
    \n )\n )}\n {uiState === 'error' && (\n
    \n

    Error loading GIFs

    \n
    \n )}\n
    \n
    \n );\n}\n\nexport default Compose;\n"],"names":["Combobox","input","list","tabInsertsSuggestions","defaultFirstOption","event","keyboardBindings","trackComposition","commitWithElement","_a","visible","indexDiff","focusEl","els","focusIndex","indexOfItem","newIndex","target","el","scrollTo","combobox","commit","fireCommitEvent","container","inViewport","element","scrollTop","containerBottom","top","bottom","boundary","query","text","key","cursor","multiWord","lookBackIndex","lastMatchPosition","keyIndex","pre","CustomHTMLElement","InputStyleCloneUpdateEvent","CloneRegistry","_InputStyleCloneElement","__privateAdd","_usingInput","_updateLayout","_requestUpdateLayout","_updateStyles","_updateText","_styleObserver","__privateMethod","updateStyles_fn","_resizeObserver","requestUpdateLayout_fn","_inputRef","_container","_xOffset","_yOffset","_isLayoutUpdating","_onInput","updateText_fn","_onDocumentScrollOrResize","usingInput_fn","__privateSet","__privateGet","clone","fn","updateLayout_fn","inputStyle","inputRect","cloneRect","prop","propertiesToCopy","InputStyleCloneElement","e","_InputRange","startOffset","endOffset","_styleClone","_cloneElement","_clampOffset","_createCloneRange","_inputElement","_startOffset","_endOffset","selectionStart","selectionEnd","offset","clampOffset_fn","toStart","createCloneRange_fn","styleClone_get","cloneElement_get","range","textNode","InputRange","states","TextExpander","expander","match","menu","_b","position","caretRect","targetPosition","currentPosition","delta","currentStyle","item","beginning","remaining","detail","suffix","value","found","providers","provide","result","x","TextExpanderElement","keysAttr","keys","multiWordAttr","globalMultiWord","state","ansiRegex","onlyFirst","pattern","regex","stripAnsi","string","segmenter","stringLength","countAnsiEscapeCodes","length","_","poweredByGiphyURL","PHANPY_IMG_ALT_API_URL","IMG_ALT_API_URL","PHANPY_GIPHY_API_KEY","GIPHY_API_KEY","import","supportedLanguagesMap","supportedLanguages","reduce","acc","l","code","common","native","expiryOptions","expirySeconds","Object","values","oneDay","expiresInFromExpiresAt","expiresAt","Date","getTime","now","find","s","document","createElement","role","className","windowMargin","observer","IntersectionObserver","entries","forEach","entry","isIntersecting","left","width","boundingClientRect","innerWidth","window","style","observe","DEFAULT_LANG","localeMatch","Intl","DateTimeFormat","resolvedOptions","locale","navigator","languages","map","urlRegexObj","RegExp","urlRegex","source","flags","usernameRegex","urlPlaceholder","countableText","inputText","replace","USERNAME_RE","MENTION_RE","HASHTAG_RE","SHORTCODE_RE_FRAGMENT","SCAN_RE","Segmenter","highlightText","maxCharacters","Infinity","html","composerCharacterCount","withinLimitHTML","exceedLimitHTML","htmlSegments","segment","index","rtf","RelativeTimeFormat","CUSTOM_EMOJIS_COUNT","Compose","onClose","replyToStatus","editStatus","draftStatus","standalone","hasOpener","console","masto","instance","uiState","setUIState","useState","UID","uid","log","currentAccount","currentAccountInfo","maxMediaAttachments","charactersReservedPerUrl","imageMatrixLimit","supportedMimeTypes","imageSizeLimit","videoSizeLimit","videoMatrixLimit","videoFrameRateLimit","maxExpiration","maxOptions","maxCharactersPerOption","minExpiration","spoilerTextRef","useRef","textareaRef","store","prevLanguage","language","sensitive","setMediaAttachments","setLanguage","oninputTextarea","poll","focusTextarea","dispatchEvent","setTimeout","current","spoilerText","useEffect","visibility2","language2","sensitive2","visibility","m","allMentions","prefs","setSensitive","poll2","mediaAttachments","options","expiresIn","statusSource","setPoll","composablePoll","mediaAttachments2","setVisibility","status","beforeUnloadCopy","hasValue","hasMediaAttachments","isSelf","hasOnlyAcct","dataset","confirmClose","hasIDMediaAttachments","id","handleBeforeUnload","sameWithSource","getCharCount","updateCharCount","supportsCloseWatcher","useHotkeys","yes","addEventListener","capture","modals","hasModal","hasOnlyComposer","prevBackgroundDraft","count","escDownRef","draftKey","ignoreEventWhen","useCloseWatcher","canClose","db","backgroundDraft","saveUnsavedDraft","useInterval","handleItems","account","username","acct","items","i2","file","files","drafts","allowedFiles","updatedAt","then","debug","error","mediaFiles","handleDragover","includes","showMentionPicker","setShowMentionPicker","showEmoji2Picker","setShowEmoji2Picker","showGIFPicker","autoDetectedLanguages","setAutoDetectedLanguages","topSupportedLanguages","restSupportedLanguages","useMemo","topLanguages","contentTranslationHideLanguages","max","restLanguages","commonB","size","URL","commonA","codeA","codeB","replyToStatusMonthsAgo","dataTransfer","_jsxs","removeEventListener","_jsx","children","icon","passData","onMinimize","alert","Icon","settings","push","openCompose","sort","class","avatarStatic","instanceURL","type","onClick","Status","confirmText","_Fragment","opener","formRef","composerState","formData","previewMode","option","media","pointerEvents","opacity","mediaPromises","attachment","onKeyDown","params2","removeNullUndefined","res","results","some","params","description","saveStatus","newStatus","allSettled","e2","media_attributes","in_reply_to_id","Textarea","onChange","limit","action","title","name","MediaAttachment","attachments","newAttachments","required","fileID","performSearch","q","v1","search","resolve","v2","fetch","onTrigger","defaultSearchTerm","newPoll","onDescriptionChange","i","checked","onInput","accept","multiple","disabled","setShowGIFPicker","Array","url","Loader","CharCountMeter","MentionModal","socialAddress","textarea","abrupt","textBeforeMention","textAfterMention","newText","spaceBeforeMention","spaceAfterMention","set","emojiShortcode","Modal","spaceBeforeEmoji","textBeforeEmoji","textAfterEmoji","spaceAfterEmoji","onSelect","GIFPickerModal","alt_text","slice","theToast","showToast","currentTarget","blob","offsetHeight","scrollHeight","clientHeight","height","searcher","Fuse","visibleEmojis","getCustomEmojis","pmem","_getCustomEmojis","keyArg","cacheKeyArg","langs","referrerPolicy","lang","newMediaAttachments","api","setText","ref","textareaProps","props","searcherRef","r","emojis","textExpanderRef","textExpanderTextRef","text2","emoji","shortcode","detectLangs","encodeHTML","forwardRef","handleChange","total","history","cur","matched","handleValue","more","searchResults","v","displayName","handleCommited","shortenNumber","throttleHighlightText","composeHighlightRef","slowHighlightPerf","end","start","debouncedAutoDetectLanguage","useDebouncedCallback","dom","mark","resizeObserver","lastLine","bullet","postSpaces","anything","pos","querySelectorAll","innerText","autoResizeTextarea","dir","rows","cols","hidden","charCount","leftChars","ctrlKey","setRangeText","setSelectionRange","prettyBytes","bytes","unitIndex","units","scaleDimension","newWidth","scalingFactor","newHeight","onRemove","supportsEdit","supports","onScroll","checkMaxError","configuration","getCurrentInstanceConfiguration","snapStates","imageMatrix","setImageMatrix","setMaxError","Math","matrixLimit","videoMatrix","setDescription","debouncedOnDescriptionChange","showModal","maxError","details","suffixType","matrix","toastRef","maxErrorToast","maxErrorText","err","type2","imageSizeLimit2","imageSize","subtype","imageMatrixLimit2","timer","videoSize","clearTimeout","videoSizeLimit2","descTextarea","videoMatrix2","videoMatrixLimit2","autoCapitalize","autoComplete","naturalWidth","naturalHeight","videoHeight","videoWidth","setVideoMatrix","setShowModal","onLoad","disablePictureInPicture","preload","onLoadedMetadata","Menu2","body","response","MenuItem","menuButton","localeCode2Text","append","Poll","label","maxlength","placeholder","str","char","obj","accounts2","fetchRelationships","relationshipsMap","setRelationshipsMap","setAccounts","loadAccounts","inputRef","filterShortcodes","searchTerm","b","aLower","a","bStartsWith","aContains","bContains","selectAccount","selectedAccount","accounts","selectedIndex","listRef","setSelectedIndex","selectedItem","relationships","term","loadRelationships","debouncedLoadAccounts","enableOnFormTags","AccountBlock","relationship","inline","customEmojis","setCustomEmojis","onSubmit","recentlyUsedCustomEmojis","autocorrect","customEmojisList","othersCat","emojisCat","useCallback","_c","scrollableRef","setMatches","onFind","onSelectEmoji","recentlyUsedCustomEmojis2","recentlyUsedEmojiIndex","emoji2","customEmojisCatList","category","matches","CustomEmojiButton","queueMicrotask","splice","CustomEmojisList","setMax","showMore","memo","showCode","parent","rect","selfRect","targetClassList","addEdges","GIFS_PER_PAGE","setResults","qRef","currentOffset","closest","fetchGIFs","remove","srcSet","staticUrl","src","decoding","debouncedOnInput","gif","fixed_height_downsampled","original","pagination","fixed_height_small","fixed_height","theImage","urlObj","strippedWebP","webp","webpObj","url2","theURL","mp4","urlObj2","strippedURL2","strippedURL","images"],"mappings":"+0BAAe,MAAMA,EAAS,CAC1B,YAAYC,EAAOC,EAAM,CAAE,sBAAAC,EAAuB,mBAAAC,CAAoB,EAAG,GAAI,CACzE,KAAK,MAAQH,EACb,KAAK,KAAOC,EACZ,KAAK,sBAAwBC,GAA6F,GAC1H,KAAK,mBAAqBC,GAAoF,GAC9G,KAAK,YAAc,GACdF,EAAK,KACNA,EAAK,GAAK,YAAY,KAAK,OAAM,EAAG,SAAQ,EAAG,MAAM,EAAG,CAAC,CAAC,IAE9D,KAAK,aAAe,CAAC,CAAC,UAAU,UAAU,MAAM,WAAW,EAC3D,KAAK,qBAAuBG,GAASC,GAAiBD,EAAO,IAAI,EACjE,KAAK,wBAA0BA,GAASE,GAAiBF,EAAO,IAAI,EACpE,KAAK,aAAe,KAAK,eAAe,KAAK,IAAI,EACjDJ,EAAM,aAAa,OAAQ,UAAU,EACrCA,EAAM,aAAa,gBAAiBC,EAAK,EAAE,EAC3CD,EAAM,aAAa,gBAAiB,OAAO,EAC3CA,EAAM,aAAa,oBAAqB,MAAM,EAC9CA,EAAM,aAAa,gBAAiB,SAAS,CAChD,CACD,SAAU,CACN,KAAK,eAAc,EACnB,KAAK,KAAI,EACT,KAAK,MAAM,gBAAgB,MAAM,EACjC,KAAK,MAAM,gBAAgB,eAAe,EAC1C,KAAK,MAAM,gBAAgB,eAAe,EAC1C,KAAK,MAAM,gBAAgB,mBAAmB,EAC9C,KAAK,MAAM,gBAAgB,eAAe,CAC7C,CACD,OAAQ,CACJ,KAAK,MAAM,aAAa,gBAAiB,MAAM,EAC/C,KAAK,MAAM,iBAAiB,mBAAoB,KAAK,uBAAuB,EAC5E,KAAK,MAAM,iBAAiB,iBAAkB,KAAK,uBAAuB,EAC1E,KAAK,MAAM,iBAAiB,QAAS,KAAK,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